blob: 256f725aa3d16c0f0de74a36cbb76708e99c8819 [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
8#ifndef H_TARGETS_TARGET_
9#define H_TARGETS_TARGET_
10
Tamas Banc3828852018-02-01 12:24:16 +000011/* 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 Colesaf082382019-10-01 11:10:33 +010024#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 \
27defined 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 \
32defined by the target"
33#endif
34#endif /* MCUBOOT_RAM_LOADING */
35
David Vinczebb207982019-08-21 15:13:04 +020036#ifndef FLASH_AREA_0_OFFSET
37#error "FLASH_AREA_0_OFFSET must be defined by the target"
Tamas Banc3828852018-02-01 12:24:16 +000038#endif
39
David Vinczebb207982019-08-21 15:13:04 +020040#ifndef FLASH_AREA_0_SIZE
41#error "FLASH_AREA_0_SIZE must be defined by the target"
Tamas Banc3828852018-02-01 12:24:16 +000042#endif
43
David Vinczebb207982019-08-21 15:13:04 +020044#ifndef FLASH_AREA_2_OFFSET
45#error "FLASH_AREA_2_OFFSET must be defined by the target"
Tamas Banc3828852018-02-01 12:24:16 +000046#endif
47
David Vinczebb207982019-08-21 15:13:04 +020048#ifndef FLASH_AREA_2_SIZE
49#error "FLASH_AREA_2_SIZE must be defined by the target"
Tamas Banc3828852018-02-01 12:24:16 +000050#endif
51
David Vinczebb207982019-08-21 15:13:04 +020052#if (MCUBOOT_IMAGE_NUMBER == 2)
53#ifndef FLASH_AREA_1_OFFSET
54#error "FLASH_AREA_1_OFFSET must be defined by the target"
Tamas Banc3828852018-02-01 12:24:16 +000055#endif
56
David Vinczebb207982019-08-21 15:13:04 +020057#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 Banc3828852018-02-01 12:24:16 +000076#endif
77
78#ifndef FLASH_DEV_NAME
79#error "BL2 supports CMSIS flash interface and device name must be specified"
Tamas Banf70ef8c2017-12-19 15:35:09 +000080#endif
81
Mate Toth-Pala76e2ab2018-05-31 15:43:01 +020082#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 Vinczebb207982019-08-21 15:13:04 +020090#endif /* H_TARGETS_TARGET_ */