blob: 68f1190e4dbc6d5f9b7a39434375fad5db69bf6a [file] [log] [blame]
Tamas Banf70ef8c2017-12-19 15:35:09 +00001/*
2 * Copyright (C) 2017, Linaro Ltd
David Vincze8bdfc2d2019-03-18 15:49:23 +01003 * Copyright (c) 2018-2019, Arm Limited.
Tamas Banc3828852018-02-01 12:24:16 +00004 *
Tamas Banf70ef8c2017-12-19 15:35:09 +00005 * SPDX-License-Identifier: Apache-2.0
6 */
7
David Vinczecea8b592019-10-29 16:09:51 +01008/*
9 * Original code taken from mcuboot project at:
10 * https://github.com/JuulLabs-OSS/mcuboot
David Vincze2ddc1372019-10-25 11:10:08 +020011 * Git SHA of the original version: ac55554059147fff718015be9f4bd3108123f50a
David Vinczecea8b592019-10-29 16:09:51 +010012 */
13
Tamas Banf70ef8c2017-12-19 15:35:09 +000014#ifndef H_TARGETS_TARGET_
15#define H_TARGETS_TARGET_
16
Tamas Banc3828852018-02-01 12:24:16 +000017/* 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 Colesaf082382019-10-01 11:10:33 +010030#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 \
33defined 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 \
38defined by the target"
39#endif
40#endif /* MCUBOOT_RAM_LOADING */
41
David Vinczebb207982019-08-21 15:13:04 +020042#ifndef FLASH_AREA_0_OFFSET
43#error "FLASH_AREA_0_OFFSET must be defined by the target"
Tamas Banc3828852018-02-01 12:24:16 +000044#endif
45
David Vinczebb207982019-08-21 15:13:04 +020046#ifndef FLASH_AREA_0_SIZE
47#error "FLASH_AREA_0_SIZE must be defined by the target"
Tamas Banc3828852018-02-01 12:24:16 +000048#endif
49
David Vinczebb207982019-08-21 15:13:04 +020050#ifndef FLASH_AREA_2_OFFSET
51#error "FLASH_AREA_2_OFFSET must be defined by the target"
Tamas Banc3828852018-02-01 12:24:16 +000052#endif
53
David Vinczebb207982019-08-21 15:13:04 +020054#ifndef FLASH_AREA_2_SIZE
55#error "FLASH_AREA_2_SIZE must be defined by the target"
Tamas Banc3828852018-02-01 12:24:16 +000056#endif
57
David Vinczebb207982019-08-21 15:13:04 +020058#if (MCUBOOT_IMAGE_NUMBER == 2)
59#ifndef FLASH_AREA_1_OFFSET
60#error "FLASH_AREA_1_OFFSET must be defined by the target"
Tamas Banc3828852018-02-01 12:24:16 +000061#endif
62
David Vinczebb207982019-08-21 15:13:04 +020063#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 Banc3828852018-02-01 12:24:16 +000082#endif
83
84#ifndef FLASH_DEV_NAME
85#error "BL2 supports CMSIS flash interface and device name must be specified"
Tamas Banf70ef8c2017-12-19 15:35:09 +000086#endif
87
Mate Toth-Pala76e2ab2018-05-31 15:43:01 +020088#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 Vinczebb207982019-08-21 15:13:04 +020096#endif /* H_TARGETS_TARGET_ */