From c0721a95ca05df104f4b2908bf22cff735f4a426 Mon Sep 17 00:00:00 2001 From: Vikas Katariya Date: Tue, 19 Jan 2021 15:24:40 +0000 Subject: [PATCH] Update partition files for `ARM_MUSCA_S1` * Partition files are synced with TF-M v1.2 * To have uniformity with TF-M v1.2, rename the following: ** image_macros_preprocessed_ns.c to `signing_layout_ns.c` ** image_macros_preprocessed_s.c to `signing_layout_s.c` * `MCUBOOT_IMAGE_NUMBER` is set to 2 by default for TF-M v1.2, therefore it is necessary that Mbed OS compiles the right macros for when linking and using the partition files. --- .../TARGET_MUSCA_S1/partition/flash_layout.h | 77 +++++++++---------- ..._preprocessed_ns.c => signing_layout_ns.c} | 0 ...os_preprocessed_s.c => signing_layout_s.c} | 0 targets/targets.json | 3 +- 4 files changed, 40 insertions(+), 40 deletions(-) rename targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/{image_macros_preprocessed_ns.c => signing_layout_ns.c} (100%) rename targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/{image_macros_preprocessed_s.c => signing_layout_s.c} (100%) diff --git a/targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/flash_layout.h b/targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/flash_layout.h index 9ebc41f24c..5317e2ccce 100644 --- a/targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/flash_layout.h +++ b/targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/flash_layout.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 2018-2020 Arm Limited. All rights reserved. + * Copyright (c) 2018-2021 Arm Limited. All rights reserved. + * Copyright (c) 2020 Cypress Semiconductor Corporation. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -21,15 +22,18 @@ /* Flash layout on Musca-S1 with BL2(multiple image boot, boot from MRAM): * 0x0A00_0000 BL2 - MCUBoot(128 KB) - * 0x0A02_0000 Secure image primary (320 KB) - * 0x0A07_0000 Non-secure image primary (512 KB) - * 0x0A0F_0000 Secure image secondary (320 KB) - * 0x0A14_0000 Non-secure image secondary (512 KB) - * 0x0A1C_0000 Scratch Area (16 KB) - * 0x0A1C_4000 Secure Storage Area (20 KB) - * 0x0A1C_9000 Internal Trusted Storage Area (16 KB) - * 0x0A1C_D000 NV counters area (4 KB) - * 0x0A1C_E000 Unused + * 0x0A02_0000 Secure image primary (384 KB) + * 0x0A08_0000 Non-secure image primary (512 KB) + * 0x0A10_0000 Secure image secondary (384 KB) + * 0x0A16_0000 Non-secure image secondary (512 KB) + * 0x0A1E_0000 Scratch Area (16 KB) + * 0x0A1E_4000 Protected Storage Area (20 KB) + * 0x0A1E_9000 Internal Trusted Storage Area (16 KB) + * 0x0A1E_D000 NV counters area (4 KB) + * 0x0A1E_E000 TF-M key area (256 bytes) This area is referred to in + * /lib/ext/cryptocell-312-runtime/shared/hw/include/musca_s1/ \ + * dx_reg_base_host.h Do not change one without changing the other. + * 0x0A1E_E100 Unused * * Flash layout on Musca-S1 with BL2(single image boot): * 0x0A00_0000 BL2 - MCUBoot(128 KB) @@ -39,17 +43,18 @@ * 0x0A10_0000 Secondary image area (896 KB): * 0x0A10_0000 Secure image secondary (384 KB) * 0x0A16_0000 Non-secure image secondary (512 KB) - * 0x0A1E_0000 Secure Storage Area (20 KB) - * 0x0A1E_5000 Internal Trusted Storage Area (16 KB) - * 0x0A1E_9000 NV counters area (4 KB) - * 0x0A1E_A000 TF-M key area (256 bytes) This area is referred to in + * 0x0A1E_0000 Scratch Area (16 KB) + * 0x0A1E_4000 Protected Storage Area (20 KB) + * 0x0A1E_9000 Internal Trusted Storage Area (16 KB) + * 0x0A1E_D000 NV counters area (4 KB) + * 0x0A1E_E000 TF-M key area (256 bytes) This area is referred to in * /lib/ext/cryptocell-312-runtime/shared/hw/include/musca_s1/ \ * dx_reg_base_host.h Do not change one without changing the other. - * 0x0A1E_A100 Unused + * 0x0A1E_E100 Unused * * Flash layout on Musca-S1 without BL2: * 0x0A00_0000 Secure image - * 0x0A07_0000 Non-secure image + * 0x0A08_0000 Non-secure image */ /* This header file is included from linker scatter file as well, where only a @@ -137,17 +142,17 @@ #error "Only MCUBOOT_IMAGE_NUMBER 1 and 2 are supported!" #endif /* MCUBOOT_IMAGE_NUMBER */ -/* Note: FLASH_SST_AREA_OFFSET, FLASH_ITS_AREA_OFFSET and +/* Note: FLASH_PS_AREA_OFFSET, FLASH_ITS_AREA_OFFSET and * FLASH_NV_COUNTERS_AREA_OFFSET point to offsets in flash, but reads and writes * to these addresses are redirected to Code SRAM by Driver_Flash.c. */ -#define FLASH_SST_AREA_OFFSET (FLASH_AREA_SCRATCH_OFFSET + \ +#define FLASH_PS_AREA_OFFSET (FLASH_AREA_SCRATCH_OFFSET + \ FLASH_AREA_SCRATCH_SIZE) -#define FLASH_SST_AREA_SIZE (0x5000) /* 20 KB */ +#define FLASH_PS_AREA_SIZE (0x5000) /* 20 KB */ /* Internal Trusted Storage (ITS) Service definitions */ -#define FLASH_ITS_AREA_OFFSET (FLASH_SST_AREA_OFFSET + \ - FLASH_SST_AREA_SIZE) +#define FLASH_ITS_AREA_OFFSET (FLASH_PS_AREA_OFFSET + \ + FLASH_PS_AREA_SIZE) #define FLASH_ITS_AREA_SIZE (0x4000) /* 16 KB */ /* NV Counters definitions */ @@ -173,27 +178,24 @@ */ #define FLASH_DEV_NAME Driver_FLASH0 -/* Secure Storage (SST) Service definitions +/* Protected Storage (PS) Service definitions * Note: Further documentation of these definitions can be found in the - * TF-M SST Integration Guide. + * TF-M PS Integration Guide. */ -#define SST_FLASH_DEV_NAME Driver_FLASH0 +#define PS_FLASH_DEV_NAME Driver_FLASH0 /* In this target the CMSIS driver requires only the offset from the base * address instead of the full memory address. */ -#define SST_FLASH_AREA_ADDR FLASH_SST_AREA_OFFSET -/* Dedicated flash area for SST */ -#define SST_FLASH_AREA_SIZE FLASH_SST_AREA_SIZE -#define SST_SECTOR_SIZE FLASH_AREA_IMAGE_SECTOR_SIZE -/* Number of SST_SECTOR_SIZE per block */ -#define SST_SECTORS_PER_BLOCK (0x1) +#define PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET +/* Dedicated flash area for PS */ +#define PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE +#define PS_RAM_FS_SIZE PS_FLASH_AREA_SIZE +#define PS_SECTOR_SIZE FLASH_AREA_IMAGE_SECTOR_SIZE +/* Number of PS_SECTOR_SIZE per block */ +#define PS_SECTORS_PER_BLOCK (0x1) /* Specifies the smallest flash programmable unit in bytes */ -#define SST_FLASH_PROGRAM_UNIT (0x1) -/* The maximum asset size to be stored in the SST area */ -#define SST_MAX_ASSET_SIZE (2048) -/* The maximum number of assets to be stored in the SST area */ -#define SST_NUM_ASSETS (10) +#define PS_FLASH_PROGRAM_UNIT (0x1) /* Internal Trusted Storage (ITS) Service definitions * Note: Further documentation of these definitions can be found in the @@ -209,15 +211,12 @@ #define ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET /* Dedicated flash area for ITS */ #define ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE +#define ITS_RAM_FS_SIZE ITS_FLASH_AREA_SIZE #define ITS_SECTOR_SIZE FLASH_AREA_IMAGE_SECTOR_SIZE /* Number of ITS_SECTOR_SIZE per block */ #define ITS_SECTORS_PER_BLOCK (0x1) /* Specifies the smallest flash programmable unit in bytes */ #define ITS_FLASH_PROGRAM_UNIT (0x1) -/* The maximum asset size to be stored in the ITS area */ -#define ITS_MAX_ASSET_SIZE (512) -/* The maximum number of assets to be stored in the ITS area */ -#define ITS_NUM_ASSETS (10) /* NV Counters definitions */ #define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET diff --git a/targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/image_macros_preprocessed_ns.c b/targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/signing_layout_ns.c similarity index 100% rename from targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/image_macros_preprocessed_ns.c rename to targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/signing_layout_ns.c diff --git a/targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/image_macros_preprocessed_s.c b/targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/signing_layout_s.c similarity index 100% rename from targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/image_macros_preprocessed_s.c rename to targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/signing_layout_s.c diff --git a/targets/targets.json b/targets/targets.json index 0f7508a867..f52bf24c59 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -4779,7 +4779,8 @@ "CMSIS_NVIC_VIRTUAL", "LPTICKER_DELAY_TICKS=3", "MBED_MPU_CUSTOM", - "BL2" + "BL2", + "MCUBOOT_IMAGE_NUMBER=2" ], "extra_labels_add": [ "ARM_SSG",