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 | |
David Vincze | cea8b59 | 2019-10-29 16:09:51 +0100 | [diff] [blame^] | 8 | /* |
| 9 | * Original code taken from mcuboot project at: |
| 10 | * https://github.com/JuulLabs-OSS/mcuboot |
| 11 | * Git SHA of the original version: 4f0ea747c314547daa6b6299ccbd77ae4dee6758 |
| 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 | |
Raef Coles | af08238 | 2019-10-01 11:10:33 +0100 | [diff] [blame] | 30 | #ifdef MCUBOOT_RAM_LOADING |
| 31 | #ifndef IMAGE_EXECUTABLE_RAM_START |
| 32 | #error "If MCUBOOT_RAM_LOADING is set then IMAGE_EXECUTABLE_RAM_START must be \ |
| 33 | defined by the target" |
| 34 | #endif |
| 35 | |
| 36 | #ifndef IMAGE_EXECUTABLE_RAM_SIZE |
| 37 | #error "If MCUBOOT_RAM_LOADING is set then IMAGE_EXECUTABLE_RAM_SIZE must be \ |
| 38 | defined by the target" |
| 39 | #endif |
| 40 | #endif /* MCUBOOT_RAM_LOADING */ |
| 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 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 50 | #ifndef FLASH_AREA_2_OFFSET |
| 51 | #error "FLASH_AREA_2_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 52 | #endif |
| 53 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 54 | #ifndef FLASH_AREA_2_SIZE |
| 55 | #error "FLASH_AREA_2_SIZE must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 56 | #endif |
| 57 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 58 | #if (MCUBOOT_IMAGE_NUMBER == 2) |
| 59 | #ifndef FLASH_AREA_1_OFFSET |
| 60 | #error "FLASH_AREA_1_OFFSET must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 61 | #endif |
| 62 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 63 | #ifndef FLASH_AREA_1_SIZE |
| 64 | #error "FLASH_AREA_1_SIZE must be defined by the target" |
| 65 | #endif |
| 66 | |
| 67 | #ifndef FLASH_AREA_3_OFFSET |
| 68 | #error "FLASH_AREA_3_OFFSET must be defined by the target" |
| 69 | #endif |
| 70 | |
| 71 | #ifndef FLASH_AREA_3_SIZE |
| 72 | #error "FLASH_AREA_3_SIZE must be defined by the target" |
| 73 | #endif |
| 74 | #endif /* (MCUBOOT_IMAGE_NUMBER == 2) */ |
| 75 | |
| 76 | #ifndef FLASH_AREA_SCRATCH_OFFSET |
| 77 | #error "FLASH_AREA_SCRATCH_OFFSET must be defined by the target" |
| 78 | #endif |
| 79 | |
| 80 | #ifndef FLASH_AREA_SCRATCH_SIZE |
| 81 | #error "FLASH_AREA_SCRATCH_SIZE must be defined by the target" |
Tamas Ban | c382885 | 2018-02-01 12:24:16 +0000 | [diff] [blame] | 82 | #endif |
| 83 | |
| 84 | #ifndef FLASH_DEV_NAME |
| 85 | #error "BL2 supports CMSIS flash interface and device name must be specified" |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 86 | #endif |
| 87 | |
Mate Toth-Pal | a76e2ab | 2018-05-31 15:43:01 +0200 | [diff] [blame] | 88 | #ifndef BOOT_STATUS_MAX_ENTRIES |
| 89 | #error "BOOT_STATUS_MAX_ENTRIES must be defined by the target" |
| 90 | #endif |
| 91 | |
| 92 | #ifndef BOOT_MAX_IMG_SECTORS |
| 93 | #error "BOOT_MAX_IMG_SECTORS must be defined by the target" |
| 94 | #endif |
| 95 | |
David Vincze | bb20798 | 2019-08-21 15:13:04 +0200 | [diff] [blame] | 96 | #endif /* H_TARGETS_TARGET_ */ |