aboutsummaryrefslogtreecommitdiff
path: root/bl2/ext/mcuboot/include/target.h
blob: 9ead129861b303655e4254a85fd2f61342493c7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
 *  Copyright (C) 2017, Linaro Ltd
 *  Copyright (c) 2018-2020, Arm Limited.
 *
 *  SPDX-License-Identifier: Apache-2.0
 */

/*
 * Original code taken from mcuboot project at:
 * https://github.com/mcu-tools/mcuboot
 * Git SHA of the original version: ac55554059147fff718015be9f4bd3108123f50a
 */

#ifndef H_TARGETS_TARGET_
#define H_TARGETS_TARGET_

/* Target specific defines: flash partitions; flash driver name, etc.
 * Comes from: platform/ext/target/<BOARD>/<SUBSYSTEM>/partition
 */
#include "flash_layout.h"

#ifndef FLASH_BASE_ADDRESS
#error "FLASH_BASE_ADDRESS must be defined by the target"
#endif

#ifndef FLASH_AREA_IMAGE_SECTOR_SIZE
#error "FLASH_AREA_IMAGE_SECTOR_SIZE must be defined by the target"
#endif

#ifdef MCUBOOT_RAM_LOAD
#ifndef IMAGE_EXECUTABLE_RAM_START
#error "If MCUBOOT_RAM_LOAD is set then IMAGE_EXECUTABLE_RAM_START must be \
defined by the target"
#endif

#ifndef IMAGE_EXECUTABLE_RAM_SIZE
#error "If MCUBOOT_RAM_LOAD is set then IMAGE_EXECUTABLE_RAM_SIZE must be \
defined by the target"
#endif
#endif /* MCUBOOT_RAM_LOAD */

#ifndef FLASH_AREA_0_OFFSET
#error "FLASH_AREA_0_OFFSET must be defined by the target"
#endif

#ifndef FLASH_AREA_0_SIZE
#error "FLASH_AREA_0_SIZE must be defined by the target"
#endif

#if defined(FLASH_DEV_NAME_0) != defined(FLASH_DEVICE_ID_0)
#error "FLASH DEV_NAME_0 and DEVICE_ID_0 must be simultaneously defined or not \
by target"
#endif

#ifndef FLASH_AREA_2_OFFSET
#error "FLASH_AREA_2_OFFSET must be defined by the target"
#endif

#ifndef FLASH_AREA_2_SIZE
#error "FLASH_AREA_2_SIZE must be defined by the target"
#endif

#if defined(FLASH_DEV_NAME_2) != defined(FLASH_DEVICE_ID_2)
#error "FLASH DEV_NAME_2 and DEVICE_ID_2 must be simultaneously defined or not \
by target"
#endif

#if (MCUBOOT_IMAGE_NUMBER == 2)
#ifndef FLASH_AREA_1_OFFSET
#error "FLASH_AREA_1_OFFSET must be defined by the target"
#endif

#ifndef FLASH_AREA_1_SIZE
#error "FLASH_AREA_1_SIZE must be defined by the target"
#endif

#if defined(FLASH_DEV_NAME_1) != defined(FLASH_DEVICE_ID_1)
#error "FLASH DEV_NAME_1 and DEVICE_ID_1 must be simultaneously defined or not \
by target"
#endif

#ifndef FLASH_AREA_3_OFFSET
#error "FLASH_AREA_3_OFFSET must be defined by the target"
#endif

#ifndef FLASH_AREA_3_SIZE
#error "FLASH_AREA_3_SIZE must be defined by the target"
#endif

#if defined(FLASH_DEV_NAME_3) != defined(FLASH_DEVICE_ID_3)
#error "FLASH DEV_NAME_3 and DEVICE_ID_3 must be simultaneously defined or not \
by target"
#endif
#endif /* (MCUBOOT_IMAGE_NUMBER == 2) */

#ifndef FLASH_AREA_SCRATCH_OFFSET
#error "FLASH_AREA_SCRATCH_OFFSET must be defined by the target"
#endif

#ifndef FLASH_AREA_SCRATCH_SIZE
#error "FLASH_AREA_SCRATCH_SIZE must be defined by the target"
#endif

#if defined(FLASH_DEV_NAME_SCRATCH) != defined(FLASH_DEVICE_ID_SCRATCH)
#error "FLASH DEV_NAME_SCRATCH and DEVICE_ID_SCRATCH must be simultaneously defined \
or not by target"
#endif

#ifndef FLASH_DEV_NAME
#error "BL2 supports CMSIS flash interface and device name must be specified"
#endif

#ifndef MCUBOOT_STATUS_MAX_ENTRIES
#error "MCUBOOT_STATUS_MAX_ENTRIES must be defined by the target"
#endif

#ifndef MCUBOOT_MAX_IMG_SECTORS
#error "MCUBOOT_MAX_IMG_SECTORS must be defined by the target"
#endif

#endif /* H_TARGETS_TARGET_ */