|
20 | 20 | #ifndef __FLASH_LAYOUT_H__
|
21 | 21 | #define __FLASH_LAYOUT_H__
|
22 | 22 |
|
23 |
| -/* Flash layout on Musca-B1 with BL2 (multiple image boot, boot from eFlash 0): |
| 23 | +#ifndef FORWARD_PROT_MSG |
| 24 | +/* Flash layouts if FORWARD_PROT_MSG is OFF |
| 25 | + * |
| 26 | + * |
| 27 | + * Flash layout on Musca-B1 with BL2 (multiple image boot, boot from eFlash 0): |
24 | 28 | *
|
25 | 29 | * 0x0A00_0000 BL2 - MCUBoot (128 KB)
|
26 | 30 | * 0x0A02_0000 Secure image primary slot (384 KB)
|
|
81 | 85 | #define QSPI_FLASH_TOTAL_SIZE (0x800000) /* 8 MB */
|
82 | 86 |
|
83 | 87 | /* Flash layout info for BL2 bootloader */
|
84 |
| -/* Same as MUSCA_B1_EFLASH0_S_BASE */ |
85 | 88 | #define FLASH_BASE_ADDRESS (0x1A000000)
|
86 | 89 |
|
87 | 90 | /* Offset and size definitions of the flash partitions that are handled by the
|
|
179 | 182 | * Note: Further documentation of these definitions can be found in the
|
180 | 183 | * TF-M PS Integration Guide.
|
181 | 184 | */
|
182 |
| -#define PS_FLASH_DEV_NAME Driver_QSPI_FLASH0 |
| 185 | +#define TFM_HAL_PS_FLASH_DRIVER Driver_QSPI_FLASH0 |
183 | 186 |
|
184 | 187 | /* In this target the CMSIS driver requires only the offset from the base
|
185 | 188 | * address instead of the full memory address.
|
186 | 189 | */
|
187 |
| -#define PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET |
188 |
| -/* Dedicated flash area for PS */ |
189 |
| -#define PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE |
190 |
| -#define PS_RAM_FS_SIZE PS_FLASH_AREA_SIZE |
191 |
| -#define PS_SECTOR_SIZE QSPI_FLASH_AREA_IMAGE_SECTOR_SIZE |
192 |
| -/* Number of PS_SECTOR_SIZE per block */ |
193 |
| -#define PS_SECTORS_PER_BLOCK (0x1) |
194 |
| -/* Specifies the smallest flash programmable unit in bytes */ |
195 |
| -#define PS_FLASH_PROGRAM_UNIT (0x1) |
| 190 | +/* Base address of dedicated flash area for PS */ |
| 191 | +#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET |
| 192 | +/* Size of dedicated flash area for PS */ |
| 193 | +#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE |
| 194 | +#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE |
| 195 | +/* Number of physical erase sectors per logical FS block */ |
| 196 | +#define TFM_HAL_PS_SECTORS_PER_BLOCK (1) |
| 197 | +/* Smallest flash programmable unit in bytes */ |
| 198 | +#define TFM_HAL_PS_PROGRAM_UNIT (0x1) |
196 | 199 |
|
197 | 200 | /* Internal Trusted Storage (ITS) Service definitions
|
198 | 201 | * Note: Further documentation of these definitions can be found in the
|
199 |
| - * TF-M ITS Integration Guide. The ITS should be in the internal flash, but is |
200 |
| - * allocated in the external flash just for development platforms that don't |
201 |
| - * have internal flash available. |
| 202 | + * TF-M ITS Integration Guide. |
202 | 203 | */
|
203 |
| -#define ITS_FLASH_DEV_NAME Driver_EFLASH0 |
| 204 | +#define TFM_HAL_ITS_FLASH_DRIVER Driver_EFLASH0 |
204 | 205 |
|
205 | 206 | /* In this target the CMSIS driver requires only the offset from the base
|
206 | 207 | * address instead of the full memory address.
|
207 | 208 | */
|
208 |
| -#define ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET |
209 |
| -/* Dedicated flash area for ITS */ |
210 |
| -#define ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE |
211 |
| -#define ITS_RAM_FS_SIZE ITS_FLASH_AREA_SIZE |
212 |
| -#define ITS_SECTOR_SIZE FLASH_AREA_IMAGE_SECTOR_SIZE |
213 |
| -/* Number of ITS_SECTOR_SIZE per block */ |
214 |
| -#define ITS_SECTORS_PER_BLOCK (0x1) |
215 |
| -/* Specifies the smallest flash programmable unit in bytes */ |
216 |
| -#define ITS_FLASH_PROGRAM_UNIT (0x4) |
| 209 | +/* Base address of dedicated flash area for ITS */ |
| 210 | +#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET |
| 211 | +/* Size of dedicated flash area for ITS */ |
| 212 | +#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE |
| 213 | +#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE |
| 214 | +/* Number of physical erase sectors per logical FS block */ |
| 215 | +#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1) |
| 216 | +/* Smallest flash programmable unit in bytes */ |
| 217 | +#define TFM_HAL_ITS_PROGRAM_UNIT (0x4) |
217 | 218 |
|
218 | 219 | /* NV Counters definitions */
|
219 | 220 | #define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
|
|
232 | 233 | #define TOTAL_ROM_SIZE FLASH_TOTAL_SIZE
|
233 | 234 | #define TOTAL_RAM_SIZE (0x80000) /* 512 KB */
|
234 | 235 |
|
| 236 | +#else /* FORWARD_PROT_MSG */ |
| 237 | + |
| 238 | +/* Flash layout information if FORWARD_PROT_MSG is ON. |
| 239 | + * For information you can check Musca-B1 Secure Enclave's flash_layout.h |
| 240 | + */ |
| 241 | + |
| 242 | +#define FLASH_S_PARTITION_SIZE (0x30000) /* S partition: 192 KB */ |
| 243 | +#define FLASH_NS_PARTITION_SIZE (0x50000) /* NS partition: 320 KB */ |
| 244 | + |
| 245 | +/* Offset and size definition in flash area used by assemble.py */ |
| 246 | +#define SECURE_IMAGE_OFFSET (0x0) |
| 247 | +#define SECURE_IMAGE_MAX_SIZE FLASH_S_PARTITION_SIZE |
| 248 | + |
| 249 | +#define NON_SECURE_IMAGE_OFFSET (SECURE_IMAGE_OFFSET + \ |
| 250 | + SECURE_IMAGE_MAX_SIZE) |
| 251 | +#define NON_SECURE_IMAGE_MAX_SIZE FLASH_NS_PARTITION_SIZE |
| 252 | + |
| 253 | +/* Image placed in eFlash 1 */ |
| 254 | +#define FLASH_BASE_ADDRESS (0x1A200000) |
| 255 | + |
| 256 | +#if (MCUBOOT_IMAGE_NUMBER != 1) |
| 257 | +#error "If FORWARD_PROT_MSG is ON MCUBOOT_IMAGE_NUMBER must be 1" |
| 258 | +#endif |
| 259 | + |
| 260 | +/* Secure + Non-secure image primary slot */ |
| 261 | +#define FLASH_AREA_0_ID (1) |
| 262 | +#define FLASH_AREA_0_OFFSET (0x60000) /* Address comes from SE */ |
| 263 | +#define FLASH_AREA_0_SIZE (FLASH_S_PARTITION_SIZE + \ |
| 264 | + FLASH_NS_PARTITION_SIZE) |
| 265 | +/* Secure + Non-secure secondary slot */ |
| 266 | +#define FLASH_AREA_2_ID (FLASH_AREA_0_ID + 1) |
| 267 | +#define FLASH_AREA_2_OFFSET (0x160000) /* Address comes from SE */ |
| 268 | +#define FLASH_AREA_2_SIZE (FLASH_S_PARTITION_SIZE + \ |
| 269 | + FLASH_NS_PARTITION_SIZE) |
| 270 | + |
| 271 | +/* Image placed in eFlash 1 */ |
| 272 | +#define S_ROM_ALIAS_BASE (0x1A200000) |
| 273 | +#define NS_ROM_ALIAS_BASE (0x0A200000) |
| 274 | + |
| 275 | +#define S_RAM_ALIAS_BASE (0x30000000) |
| 276 | +#define NS_RAM_ALIAS_BASE (0x20000000) |
| 277 | + |
| 278 | +#define TOTAL_RAM_SIZE (0x80000) /* 512 KB */ |
| 279 | + |
| 280 | +/* Macros needed for BL2 build with dummy values. |
| 281 | + * This BL2 instance is not used, but the BL2 macro needs to be set, and this |
| 282 | + * macro and BL2 build is entangled. If this is fixed the following macros can |
| 283 | + * be deleted. |
| 284 | + */ |
| 285 | +#define FLASH_AREA_IMAGE_SECTOR_SIZE 0 |
| 286 | + |
| 287 | +#define MCUBOOT_STATUS_MAX_ENTRIES 0 |
| 288 | +#define MCUBOOT_MAX_IMG_SECTORS 32 |
| 289 | + |
| 290 | +#define FLASH_AREA_SCRATCH_ID 0 |
| 291 | +#define FLASH_AREA_SCRATCH_OFFSET 0 |
| 292 | +#define FLASH_AREA_SCRATCH_SIZE 0 |
| 293 | + |
| 294 | +#define FLASH_DEV_NAME Driver_EFLASH0 |
| 295 | +#define FLASH_AREA_BL2_OFFSET 0 |
| 296 | +#define FLASH_AREA_BL2_SIZE 0x20000 |
| 297 | + |
| 298 | +#define TFM_NV_COUNTERS_AREA_ADDR 0 |
| 299 | +#define TFM_NV_COUNTERS_AREA_SIZE 8 |
| 300 | +#define TFM_NV_COUNTERS_SECTOR_ADDR 0 |
| 301 | +#define TFM_NV_COUNTERS_SECTOR_SIZE 8 |
| 302 | + |
| 303 | +#endif /* FORWARD_PROT_MSG */ |
| 304 | + |
235 | 305 | #endif /* __FLASH_LAYOUT_H__ */
|
0 commit comments