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 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame^] | 24 | #ifndef FLASH_AREA_0_OFFSET |
| 25 | #error "FLASH_AREA_0_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 26 | #endif |
| 27 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame^] | 28 | #ifndef FLASH_AREA_0_SIZE |
| 29 | #error "FLASH_AREA_0_SIZE must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 30 | #endif |
| 31 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame^] | 32 | #ifndef FLASH_AREA_2_OFFSET |
| 33 | #error "FLASH_AREA_2_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 34 | #endif |
| 35 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame^] | 36 | #ifndef FLASH_AREA_2_SIZE |
| 37 | #error "FLASH_AREA_2_SIZE 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 | #if (MCUBOOT_IMAGE_NUMBER == 2) |
| 41 | #ifndef FLASH_AREA_1_OFFSET |
| 42 | #error "FLASH_AREA_1_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 43 | #endif |
| 44 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame^] | 45 | #ifndef FLASH_AREA_1_SIZE |
| 46 | #error "FLASH_AREA_1_SIZE must be defined by the target" |
| 47 | #endif |
| 48 | |
| 49 | #ifndef FLASH_AREA_3_OFFSET |
| 50 | #error "FLASH_AREA_3_OFFSET must be defined by the target" |
| 51 | #endif |
| 52 | |
| 53 | #ifndef FLASH_AREA_3_SIZE |
| 54 | #error "FLASH_AREA_3_SIZE must be defined by the target" |
| 55 | #endif |
| 56 | #endif /* (MCUBOOT_IMAGE_NUMBER == 2) */ |
| 57 | |
| 58 | #ifndef FLASH_AREA_SCRATCH_OFFSET |
| 59 | #error "FLASH_AREA_SCRATCH_OFFSET must be defined by the target" |
| 60 | #endif |
| 61 | |
| 62 | #ifndef FLASH_AREA_SCRATCH_SIZE |
| 63 | #error "FLASH_AREA_SCRATCH_SIZE must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 64 | #endif |
| 65 | |
| 66 | #ifndef FLASH_DEV_NAME |
| 67 | #error "BL2 supports CMSIS flash interface and device name must be specified" |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 68 | #endif |
| 69 | |
Mate Toth-Pal | a76e2ab | 2018-05-31 15:43:01 +0200 | [diff] [blame] | 70 | #ifndef BOOT_STATUS_MAX_ENTRIES |
| 71 | #error "BOOT_STATUS_MAX_ENTRIES must be defined by the target" |
| 72 | #endif |
| 73 | |
| 74 | #ifndef BOOT_MAX_IMG_SECTORS |
| 75 | #error "BOOT_MAX_IMG_SECTORS must be defined by the target" |
| 76 | #endif |
| 77 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame^] | 78 | #endif /* H_TARGETS_TARGET_ */ |