Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017, Linaro Ltd |
David Vincze | 8bdfc2d | 2019-03-18 15:49:23 +0100 | [diff] [blame] | 3 | * Copyright (c) 2018-2019, 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 | |
| 8 | #ifndef H_TARGETS_TARGET_ |
| 9 | #define H_TARGETS_TARGET_ |
| 10 | |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 11 | /* Target specific defines: flash partitions; flash driver name, etc. |
| 12 | * Comes from: platform/ext/target/<BOARD>/<SUBSYSTEM>/partition |
| 13 | */ |
| 14 | #include "flash_layout.h" |
| 15 | |
| 16 | #ifndef FLASH_BASE_ADDRESS |
| 17 | #error "FLASH_BASE_ADDRESS must be defined by the target" |
| 18 | #endif |
| 19 | |
| 20 | #ifndef FLASH_AREA_IMAGE_SECTOR_SIZE |
| 21 | #error "FLASH_AREA_IMAGE_SECTOR_SIZE must be defined by the target" |
| 22 | #endif |
| 23 | |
Raef Coles | af08238 | 2019-10-01 11:10:33 +0100 | [diff] [blame^] | 24 | #ifdef MCUBOOT_RAM_LOADING |
| 25 | #ifndef IMAGE_EXECUTABLE_RAM_START |
| 26 | #error "If MCUBOOT_RAM_LOADING is set then IMAGE_EXECUTABLE_RAM_START must be \ |
| 27 | defined by the target" |
| 28 | #endif |
| 29 | |
| 30 | #ifndef IMAGE_EXECUTABLE_RAM_SIZE |
| 31 | #error "If MCUBOOT_RAM_LOADING is set then IMAGE_EXECUTABLE_RAM_SIZE must be \ |
| 32 | defined by the target" |
| 33 | #endif |
| 34 | #endif /* MCUBOOT_RAM_LOADING */ |
| 35 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 36 | #ifndef FLASH_AREA_0_OFFSET |
| 37 | #error "FLASH_AREA_0_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 38 | #endif |
| 39 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 40 | #ifndef FLASH_AREA_0_SIZE |
| 41 | #error "FLASH_AREA_0_SIZE must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 42 | #endif |
| 43 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 44 | #ifndef FLASH_AREA_2_OFFSET |
| 45 | #error "FLASH_AREA_2_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 46 | #endif |
| 47 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 48 | #ifndef FLASH_AREA_2_SIZE |
| 49 | #error "FLASH_AREA_2_SIZE must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 50 | #endif |
| 51 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 52 | #if (MCUBOOT_IMAGE_NUMBER == 2) |
| 53 | #ifndef FLASH_AREA_1_OFFSET |
| 54 | #error "FLASH_AREA_1_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 55 | #endif |
| 56 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 57 | #ifndef FLASH_AREA_1_SIZE |
| 58 | #error "FLASH_AREA_1_SIZE must be defined by the target" |
| 59 | #endif |
| 60 | |
| 61 | #ifndef FLASH_AREA_3_OFFSET |
| 62 | #error "FLASH_AREA_3_OFFSET must be defined by the target" |
| 63 | #endif |
| 64 | |
| 65 | #ifndef FLASH_AREA_3_SIZE |
| 66 | #error "FLASH_AREA_3_SIZE must be defined by the target" |
| 67 | #endif |
| 68 | #endif /* (MCUBOOT_IMAGE_NUMBER == 2) */ |
| 69 | |
| 70 | #ifndef FLASH_AREA_SCRATCH_OFFSET |
| 71 | #error "FLASH_AREA_SCRATCH_OFFSET must be defined by the target" |
| 72 | #endif |
| 73 | |
| 74 | #ifndef FLASH_AREA_SCRATCH_SIZE |
| 75 | #error "FLASH_AREA_SCRATCH_SIZE must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 76 | #endif |
| 77 | |
| 78 | #ifndef FLASH_DEV_NAME |
| 79 | #error "BL2 supports CMSIS flash interface and device name must be specified" |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 80 | #endif |
| 81 | |
Mate Toth-Pal | a76e2ab | 2018-05-31 15:43:01 +0200 | [diff] [blame] | 82 | #ifndef BOOT_STATUS_MAX_ENTRIES |
| 83 | #error "BOOT_STATUS_MAX_ENTRIES must be defined by the target" |
| 84 | #endif |
| 85 | |
| 86 | #ifndef BOOT_MAX_IMG_SECTORS |
| 87 | #error "BOOT_MAX_IMG_SECTORS must be defined by the target" |
| 88 | #endif |
| 89 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 90 | #endif /* H_TARGETS_TARGET_ */ |