Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017, Linaro Ltd |
David Vincze | ead78fb | 2019-12-09 17:41:58 +0100 | [diff] [blame] | 3 | * Copyright (c) 2018-2020, Arm Limited. |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 4 | * |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 5 | * SPDX-License-Identifier: Apache-2.0 |
| 6 | */ |
| 7 | |
David Vincze | cea8b59 | 2019-10-29 16:09:51 +0100 | [diff] [blame] | 8 | /* |
| 9 | * Original code taken from mcuboot project at: |
Tamas Ban | c5b2f2b | 2020-11-12 09:47:05 +0000 | [diff] [blame] | 10 | * https://github.com/mcu-tools/mcuboot |
David Vincze | 2ddc137 | 2019-10-25 11:10:08 +0200 | [diff] [blame] | 11 | * Git SHA of the original version: ac55554059147fff718015be9f4bd3108123f50a |
David Vincze | cea8b59 | 2019-10-29 16:09:51 +0100 | [diff] [blame] | 12 | */ |
| 13 | |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 14 | #ifndef H_TARGETS_TARGET_ |
| 15 | #define H_TARGETS_TARGET_ |
| 16 | |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 17 | /* Target specific defines: flash partitions; flash driver name, etc. |
| 18 | * Comes from: platform/ext/target/<BOARD>/<SUBSYSTEM>/partition |
| 19 | */ |
| 20 | #include "flash_layout.h" |
| 21 | |
| 22 | #ifndef FLASH_BASE_ADDRESS |
| 23 | #error "FLASH_BASE_ADDRESS must be defined by the target" |
| 24 | #endif |
| 25 | |
| 26 | #ifndef FLASH_AREA_IMAGE_SECTOR_SIZE |
| 27 | #error "FLASH_AREA_IMAGE_SECTOR_SIZE must be defined by the target" |
| 28 | #endif |
| 29 | |
Tamas Ban | f4023f3 | 2020-09-16 11:02:52 +0100 | [diff] [blame] | 30 | #ifdef MCUBOOT_RAM_LOAD |
Raef Coles | af08238 | 2019-10-01 11:10:33 +0100 | [diff] [blame] | 31 | #ifndef IMAGE_EXECUTABLE_RAM_START |
Tamas Ban | f4023f3 | 2020-09-16 11:02:52 +0100 | [diff] [blame] | 32 | #error "If MCUBOOT_RAM_LOAD is set then IMAGE_EXECUTABLE_RAM_START must be \ |
Raef Coles | af08238 | 2019-10-01 11:10:33 +0100 | [diff] [blame] | 33 | defined by the target" |
| 34 | #endif |
| 35 | |
| 36 | #ifndef IMAGE_EXECUTABLE_RAM_SIZE |
Tamas Ban | f4023f3 | 2020-09-16 11:02:52 +0100 | [diff] [blame] | 37 | #error "If MCUBOOT_RAM_LOAD is set then IMAGE_EXECUTABLE_RAM_SIZE must be \ |
Raef Coles | af08238 | 2019-10-01 11:10:33 +0100 | [diff] [blame] | 38 | defined by the target" |
| 39 | #endif |
Tamas Ban | f4023f3 | 2020-09-16 11:02:52 +0100 | [diff] [blame] | 40 | #endif /* MCUBOOT_RAM_LOAD */ |
Raef Coles | af08238 | 2019-10-01 11:10:33 +0100 | [diff] [blame] | 41 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 42 | #ifndef FLASH_AREA_0_OFFSET |
| 43 | #error "FLASH_AREA_0_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 44 | #endif |
| 45 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 46 | #ifndef FLASH_AREA_0_SIZE |
| 47 | #error "FLASH_AREA_0_SIZE must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 48 | #endif |
| 49 | |
Michel Jaouen | 26f6c02 | 2020-12-03 10:37:22 +0100 | [diff] [blame^] | 50 | #if defined(FLASH_DEV_NAME_0) != defined(FLASH_DEVICE_ID_0) |
| 51 | #error "FLASH DEV_NAME_0 and DEVICE_ID_0 must be simultaneously defined or not \ |
| 52 | by target" |
| 53 | #endif |
| 54 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 55 | #ifndef FLASH_AREA_2_OFFSET |
| 56 | #error "FLASH_AREA_2_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 57 | #endif |
| 58 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 59 | #ifndef FLASH_AREA_2_SIZE |
| 60 | #error "FLASH_AREA_2_SIZE must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 61 | #endif |
| 62 | |
Michel Jaouen | 26f6c02 | 2020-12-03 10:37:22 +0100 | [diff] [blame^] | 63 | #if defined(FLASH_DEV_NAME_2) != defined(FLASH_DEVICE_ID_2) |
| 64 | #error "FLASH DEV_NAME_2 and DEVICE_ID_2 must be simultaneously defined or not \ |
| 65 | by target" |
| 66 | #endif |
| 67 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 68 | #if (MCUBOOT_IMAGE_NUMBER == 2) |
| 69 | #ifndef FLASH_AREA_1_OFFSET |
| 70 | #error "FLASH_AREA_1_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 71 | #endif |
| 72 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 73 | #ifndef FLASH_AREA_1_SIZE |
| 74 | #error "FLASH_AREA_1_SIZE must be defined by the target" |
| 75 | #endif |
| 76 | |
Michel Jaouen | 26f6c02 | 2020-12-03 10:37:22 +0100 | [diff] [blame^] | 77 | #if defined(FLASH_DEV_NAME_1) != defined(FLASH_DEVICE_ID_1) |
| 78 | #error "FLASH DEV_NAME_1 and DEVICE_ID_1 must be simultaneously defined or not \ |
| 79 | by target" |
| 80 | #endif |
| 81 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 82 | #ifndef FLASH_AREA_3_OFFSET |
| 83 | #error "FLASH_AREA_3_OFFSET must be defined by the target" |
| 84 | #endif |
| 85 | |
| 86 | #ifndef FLASH_AREA_3_SIZE |
| 87 | #error "FLASH_AREA_3_SIZE must be defined by the target" |
| 88 | #endif |
Michel Jaouen | 26f6c02 | 2020-12-03 10:37:22 +0100 | [diff] [blame^] | 89 | |
| 90 | #if defined(FLASH_DEV_NAME_3) != defined(FLASH_DEVICE_ID_3) |
| 91 | #error "FLASH DEV_NAME_3 and DEVICE_ID_3 must be simultaneously defined or not \ |
| 92 | by target" |
| 93 | #endif |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 94 | #endif /* (MCUBOOT_IMAGE_NUMBER == 2) */ |
| 95 | |
| 96 | #ifndef FLASH_AREA_SCRATCH_OFFSET |
| 97 | #error "FLASH_AREA_SCRATCH_OFFSET must be defined by the target" |
| 98 | #endif |
| 99 | |
| 100 | #ifndef FLASH_AREA_SCRATCH_SIZE |
| 101 | #error "FLASH_AREA_SCRATCH_SIZE must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 102 | #endif |
| 103 | |
Michel Jaouen | 26f6c02 | 2020-12-03 10:37:22 +0100 | [diff] [blame^] | 104 | #if defined(FLASH_DEV_NAME_SCRATCH) != defined(FLASH_DEVICE_ID_SCRATCH) |
| 105 | #error "FLASH DEV_NAME_SCRATCH and DEVICE_ID_SCRATCH must be simultaneously defined \ |
| 106 | or not by target" |
| 107 | #endif |
| 108 | |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 109 | #ifndef FLASH_DEV_NAME |
| 110 | #error "BL2 supports CMSIS flash interface and device name must be specified" |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 111 | #endif |
| 112 | |
David Vincze | ead78fb | 2019-12-09 17:41:58 +0100 | [diff] [blame] | 113 | #ifndef MCUBOOT_STATUS_MAX_ENTRIES |
| 114 | #error "MCUBOOT_STATUS_MAX_ENTRIES must be defined by the target" |
Mate Toth-Pal | a76e2ab | 2018-05-31 15:43:01 +0200 | [diff] [blame] | 115 | #endif |
| 116 | |
David Vincze | ead78fb | 2019-12-09 17:41:58 +0100 | [diff] [blame] | 117 | #ifndef MCUBOOT_MAX_IMG_SECTORS |
| 118 | #error "MCUBOOT_MAX_IMG_SECTORS must be defined by the target" |
Mate Toth-Pal | a76e2ab | 2018-05-31 15:43:01 +0200 | [diff] [blame] | 119 | #endif |
| 120 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 121 | #endif /* H_TARGETS_TARGET_ */ |