Platform: TF-M ITS and PS HAL
Expands the TF-M Internal Trusted Storage and Protected Storage HALs to
cover all flash and filesystem configuration parameters required from
the platform. The CMSIS Flash APIs are exposed to abstract the flash
device, along with a function and some definitions to expose further
parameters required by the filesystem.
Updates ITS to use the new HALs and removes its_flash_info_external.c,
its_flash_info_internal.c and its_flash.c. Also moves the
block_to_block_move() function from its_flash.c to the filesystem, as
its implementation is agnostic to the flash device. The its_flash.h
header is kept as a helper to abstract the different flash block device
wrappers (NOR, NAND, RAM).
The ITS filesystem is updated to take a configuration struct as an
initialisation parameter, which is filled using values from the HAL.
Change-Id: I95ae44795a59b1f36c9b95d057f44b4ae3ba2344
Signed-off-by: Jamie Fox <jamie.fox@arm.com>
diff --git a/platform/ext/common/tfm_hal_its.c b/platform/ext/common/tfm_hal_its.c
index ac5f09a..e53623f 100644
--- a/platform/ext/common/tfm_hal_its.c
+++ b/platform/ext/common/tfm_hal_its.c
@@ -1,20 +1,44 @@
/*
* Copyright (c) 2020, Cypress Semiconductor Corporation. All rights reserved.
+ * Copyright (c) 2020-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
-#include "cmsis_compiler.h"
-#include "flash_layout.h"
#include "tfm_hal_its.h"
-__WEAK void tfm_hal_its_fs_info(uint32_t *flash_area_addr, size_t *flash_area_size)
+#include "cmsis_compiler.h"
+#include "flash_layout.h"
+
+/* The base address of the dedicated flash area for ITS */
+#ifndef TFM_HAL_ITS_FLASH_AREA_ADDR
+#error "TFM_HAL_ITS_FLASH_AREA_ADDR must be defined by the target in flash_layout.h"
+#endif
+
+/* The size of the dedicated flash area for ITS in bytes */
+#ifndef TFM_HAL_ITS_FLASH_AREA_SIZE
+#error "TFM_HAL_ITS_FLASH_AREA_SIZE must be defined by the target in flash_layout.h"
+#endif
+
+/* The number of contiguous physical flash erase sectors per logical filesystem
+ * erase block. Adjust so that the maximum required asset size will fit in one
+ * logical block.
+ */
+#ifndef TFM_HAL_ITS_SECTORS_PER_BLOCK
+#error "TFM_HAL_ITS_SECTORS_PER_BLOCK must be defined by the target in flash_layout.h"
+#endif
+
+__WEAK enum tfm_hal_status_t
+tfm_hal_its_fs_info(struct tfm_hal_its_fs_info_t *fs_info)
{
- if (!flash_area_addr || !flash_area_size) {
- return;
+ if (!fs_info) {
+ return TFM_HAL_ERROR_INVALID_INPUT;
}
- *flash_area_addr = ITS_FLASH_AREA_ADDR;
- *flash_area_size = ITS_FLASH_AREA_SIZE;
+ fs_info->flash_area_addr = TFM_HAL_ITS_FLASH_AREA_ADDR;
+ fs_info->flash_area_size = TFM_HAL_ITS_FLASH_AREA_SIZE;
+ fs_info->sectors_per_block = TFM_HAL_ITS_SECTORS_PER_BLOCK;
+
+ return TFM_HAL_SUCCESS;
}
diff --git a/platform/ext/common/tfm_hal_ps.c b/platform/ext/common/tfm_hal_ps.c
index 1f3f6e5..337ba5f 100644
--- a/platform/ext/common/tfm_hal_ps.c
+++ b/platform/ext/common/tfm_hal_ps.c
@@ -1,20 +1,44 @@
/*
* Copyright (c) 2020, Cypress Semiconductor Corporation. All rights reserved.
+ * Copyright (c) 2020-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
-#include "cmsis_compiler.h"
-#include "flash_layout.h"
#include "tfm_hal_ps.h"
-__WEAK void tfm_hal_ps_fs_info(uint32_t *flash_area_addr, size_t *flash_area_size)
+#include "cmsis_compiler.h"
+#include "flash_layout.h"
+
+/* The base address of the dedicated flash area for PS */
+#ifndef TFM_HAL_PS_FLASH_AREA_ADDR
+#error "TFM_HAL_PS_FLASH_AREA_ADDR must be defined by the target in flash_layout.h"
+#endif
+
+/* The size of the dedicated flash area for PS in bytes */
+#ifndef TFM_HAL_PS_FLASH_AREA_SIZE
+#error "TFM_HAL_PS_FLASH_AREA_SIZE must be defined by the target in flash_layout.h"
+#endif
+
+/* The number of contiguous physical flash erase sectors per logical filesystem
+ * erase block. Adjust so that the maximum required asset size will fit in one
+ * logical block.
+ */
+#ifndef TFM_HAL_PS_SECTORS_PER_BLOCK
+#error "TFM_HAL_PS_SECTORS_PER_BLOCK must be defined by the target in flash_layout.h"
+#endif
+
+__WEAK enum tfm_hal_status_t
+tfm_hal_ps_fs_info(struct tfm_hal_ps_fs_info_t *fs_info)
{
- if (!flash_area_addr || !flash_area_size) {
- return;
+ if (!fs_info) {
+ return TFM_HAL_ERROR_INVALID_INPUT;
}
- *flash_area_addr = PS_FLASH_AREA_ADDR;
- *flash_area_size = PS_FLASH_AREA_SIZE;
+ fs_info->flash_area_addr = TFM_HAL_PS_FLASH_AREA_ADDR;
+ fs_info->flash_area_size = TFM_HAL_PS_FLASH_AREA_SIZE;
+ fs_info->sectors_per_block = TFM_HAL_PS_SECTORS_PER_BLOCK;
+
+ return TFM_HAL_SUCCESS;
}
diff --git a/platform/ext/target/cypress/psoc64/CMSIS_Driver/Driver_Flash.c b/platform/ext/target/cypress/psoc64/CMSIS_Driver/Driver_Flash.c
index 55e57b5..0e84274 100644
--- a/platform/ext/target/cypress/psoc64/CMSIS_Driver/Driver_Flash.c
+++ b/platform/ext/target/cypress/psoc64/CMSIS_Driver/Driver_Flash.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2020 ARM Limited. All rights reserved.
+ * Copyright (c) 2013-2021 ARM Limited. All rights reserved.
* Copyright (c) 2019, Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
@@ -75,7 +75,7 @@
.sector_count = FLASH0_SIZE / FLASH0_SECTOR_SIZE,
.sector_size = FLASH0_SECTOR_SIZE,
.page_size = FLASH0_PAGE_SIZE,
- .program_unit = PS_FLASH_PROGRAM_UNIT,
+ .program_unit = TFM_HAL_PS_PROGRAM_UNIT,
.erased_value = ARM_FLASH_DRV_ERASE_VALUE
};
diff --git a/platform/ext/target/cypress/psoc64/driver_smpu.c b/platform/ext/target/cypress/psoc64/driver_smpu.c
index bb45f2b..663d55d 100644
--- a/platform/ext/target/cypress/psoc64/driver_smpu.c
+++ b/platform/ext/target/cypress/psoc64/driver_smpu.c
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2020, Cypress Semiconductor Corporation. All rights reserved.
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -231,14 +232,20 @@
/* Figure out the base, size, and subregion mask to use */
if (smpu == ITS_SMPU_STRUCT) {
+ struct tfm_hal_its_fs_info_t its_fs_info;
/* Retrieve the ITS region definition */
- tfm_hal_its_fs_info(base, size);
+ tfm_hal_its_fs_info(&its_fs_info);
+ *base = its_fs_info.flash_area_addr;
+ *size = its_fs_info.flash_area_size;
} else if (smpu == NVC_SMPU_STRUCT) {
/* Retrieve the non-volatile counters region definition */
nvc_flash_block(base, size);
} else if (smpu == PS_SMPU_STRUCT) {
+ struct tfm_hal_ps_fs_info_t ps_fs_info;
/* Retrieve the PS region definition */
- tfm_hal_ps_fs_info(base, size);
+ tfm_hal_ps_fs_info(&ps_fs_info);
+ *base = ps_fs_info.flash_area_addr;
+ *size = ps_fs_info.flash_area_size;
} else {
/* We don't know where to get the region definition */
ret = CY_PROT_FAILURE;
diff --git a/platform/ext/target/cypress/psoc64/partition/flash_layout.h b/platform/ext/target/cypress/psoc64/partition/flash_layout.h
index 8eb501f..71d893f 100644
--- a/platform/ext/target/cypress/psoc64/partition/flash_layout.h
+++ b/platform/ext/target/cypress/psoc64/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021 Arm Limited. All rights reserved.
* Copyright (c) 2019-2020, Cypress Semiconductor Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -117,20 +117,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 0x8
-/* Specifies the smallest flash programmable unit in bytes */
-#define PS_FLASH_PROGRAM_UNIT 0x1
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK 8
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT 0x1
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -138,20 +138,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 (0x8)
-/* Specifies the smallest flash programmable unit in bytes */
-#define ITS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK 8
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT 0x1
/* Decrease flash wear slightly, at the cost of increased ITS service memory */
#define ITS_MAX_BLOCK_DATA_COPY 512
diff --git a/platform/ext/target/mps2/an519/partition/flash_layout.h b/platform/ext/target/mps2/an519/partition/flash_layout.h
index 8d026a3..6c3208d 100644
--- a/platform/ext/target/mps2/an519/partition/flash_layout.h
+++ b/platform/ext/target/mps2/an519/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021 Arm Limited. All rights reserved.
* Copyright (c) 2020 Cypress Semiconductor Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -171,20 +171,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 PS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -192,20 +192,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x1)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/mps2/an521/partition/flash_layout.h b/platform/ext/target/mps2/an521/partition/flash_layout.h
index f64a681..6a0e442 100644
--- a/platform/ext/target/mps2/an521/partition/flash_layout.h
+++ b/platform/ext/target/mps2/an521/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021 Arm Limited. All rights reserved.
* Copyright (c) 2020 Cypress Semiconductor Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -171,20 +171,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 PS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -192,20 +192,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x1)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/mps2/an539/partition/flash_layout.h b/platform/ext/target/mps2/an539/partition/flash_layout.h
index 4ca51c7..25f5d8e 100644
--- a/platform/ext/target/mps2/an539/partition/flash_layout.h
+++ b/platform/ext/target/mps2/an539/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2021 Arm Limited. All rights reserved.
* Copyright (c) 2020 Cypress Semiconductor Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -169,21 +169,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
-/*
- * In this target the CMSIS driver requires only the offset from the
- * flash base address instead of the full flash address.
+/* In this target the CMSIS driver requires only the offset from the base
+ * address instead of the full memory address.
*/
-#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 PS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -191,20 +190,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x1)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/mps2/fvp_sse300/partition/flash_layout.h b/platform/ext/target/mps2/fvp_sse300/partition/flash_layout.h
index 2e8538f..9fc1db0 100644
--- a/platform/ext/target/mps2/fvp_sse300/partition/flash_layout.h
+++ b/platform/ext/target/mps2/fvp_sse300/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2021 Arm Limited. All rights reserved.
* Copyright (c) 2020 Cypress Semiconductor Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -174,20 +174,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 PS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -195,20 +195,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x1)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/mps2/sse-200_aws/partition/flash_layout.h b/platform/ext/target/mps2/sse-200_aws/partition/flash_layout.h
index aca6c24..b2f043b 100644
--- a/platform/ext/target/mps2/sse-200_aws/partition/flash_layout.h
+++ b/platform/ext/target/mps2/sse-200_aws/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021 Arm Limited. All rights reserved.
* Copyright (c) 2020 Cypress Semiconductor Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -171,20 +171,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 PS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -192,20 +192,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x1)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/mps3/an524/cmsis_drivers/Driver_Flash.c b/platform/ext/target/mps3/an524/cmsis_drivers/Driver_Flash.c
index 37a7e90..0582300 100644
--- a/platform/ext/target/mps3/an524/cmsis_drivers/Driver_Flash.c
+++ b/platform/ext/target/mps3/an524/cmsis_drivers/Driver_Flash.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2013-2021 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -40,7 +40,7 @@
/* Driver version */
#define ARM_FLASH_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1, 0)
-#define FLASH_REDIRECT_BASE PS_FLASH_AREA_ADDR
+#define FLASH_REDIRECT_BASE FLASH_PS_AREA_OFFSET
#define FLASH_REDIRECT_LIMIT (FLASH_REDIRECT_BASE \
+ FLASH_PS_AREA_SIZE \
+ FLASH_ITS_AREA_SIZE \
diff --git a/platform/ext/target/mps3/an524/partition/flash_layout.h b/platform/ext/target/mps3/an524/partition/flash_layout.h
index 1c433a1..35e7d1e 100644
--- a/platform/ext/target/mps3/an524/partition/flash_layout.h
+++ b/platform/ext/target/mps3/an524/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2021 Arm Limited. All rights reserved.
* Copyright (c) 2020 Cypress Semiconductor Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -158,21 +158,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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
-/* Sector size of the flash hardware; same as FLASH0_SECTOR_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 PS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -180,21 +179,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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
-/* Sector size of the flash hardware; same as FLASH0_SECTOR_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)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x1)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/mps3/fvp_sse300/partition/flash_layout.h b/platform/ext/target/mps3/fvp_sse300/partition/flash_layout.h
index 8ae6d25..93c9cf8 100644
--- a/platform/ext/target/mps3/fvp_sse300/partition/flash_layout.h
+++ b/platform/ext/target/mps3/fvp_sse300/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2021 Arm Limited. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -172,20 +172,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 PS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -193,20 +193,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x1)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/musca_a/partition/flash_layout.h b/platform/ext/target/musca_a/partition/flash_layout.h
index 1fb6af0..b0c7839 100644
--- a/platform/ext/target/musca_a/partition/flash_layout.h
+++ b/platform/ext/target/musca_a/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -178,20 +178,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 PS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -199,20 +199,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x1)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/musca_b1/secure_enclave/partition/flash_layout.h b/platform/ext/target/musca_b1/secure_enclave/partition/flash_layout.h
index 80815f2..10c131b 100644
--- a/platform/ext/target/musca_b1/secure_enclave/partition/flash_layout.h
+++ b/platform/ext/target/musca_b1/secure_enclave/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021 Arm Limited. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -160,20 +160,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M ITS Integration Guide.
*/
-#define ITS_FLASH_DEV_NAME Driver_EFLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_EFLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 (0x4)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x4)
/* NV Counters definitions */
#define NV_COUNTERS_FLASH_DEV_NAME Driver_EFLASH0
@@ -191,20 +191,19 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_QSPI_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_QSPI_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 QSPI_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 PS_FLASH_PROGRAM_UNIT (0x1)
-/* The maximum asset size to be stored in the PS area */
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
#endif /* __FLASH_LAYOUT_H__ */
diff --git a/platform/ext/target/musca_b1/sse_200/partition/flash_layout.h b/platform/ext/target/musca_b1/sse_200/partition/flash_layout.h
index 7c26f00..b111f54 100644
--- a/platform/ext/target/musca_b1/sse_200/partition/flash_layout.h
+++ b/platform/ext/target/musca_b1/sse_200/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -180,41 +180,39 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_QSPI_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_QSPI_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 QSPI_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 PS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
- * TF-M ITS Integration Guide. The ITS should be in the internal flash, but is
- * allocated in the external flash just for development platforms that don't
- * have internal flash available.
+ * TF-M ITS Integration Guide.
*/
-#define ITS_FLASH_DEV_NAME Driver_EFLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_EFLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 (0x4)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x4)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/musca_s1/partition/flash_layout.h b/platform/ext/target/musca_s1/partition/flash_layout.h
index efff344..2c3d4d2 100644
--- a/platform/ext/target/musca_s1/partition/flash_layout.h
+++ b/platform/ext/target/musca_s1/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -180,41 +180,39 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 PS_FLASH_PROGRAM_UNIT (0x1)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x1)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
- * TF-M ITS Integration Guide. The ITS should be in the internal flash, but is
- * allocated in the external flash just for development platforms that don't
- * have internal flash available.
+ * TF-M ITS Integration Guide.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x1)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/nordic_nrf/common/nrf5340/partition/flash_layout.h b/platform/ext/target/nordic_nrf/common/nrf5340/partition/flash_layout.h
index c2802e5..4fec9f5 100644
--- a/platform/ext/target/nordic_nrf/common/nrf5340/partition/flash_layout.h
+++ b/platform/ext/target/nordic_nrf/common/nrf5340/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021 Arm Limited. All rights reserved.
* Copyright (c) 2020 Nordic Semiconductor ASA. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -165,19 +165,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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_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 PS_FLASH_PROGRAM_UNIT (0x4)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x4)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -185,19 +186,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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_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 (0x4)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x4)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/nordic_nrf/common/nrf9160/partition/flash_layout.h b/platform/ext/target/nordic_nrf/common/nrf9160/partition/flash_layout.h
index 4bbfb26..ad53de9 100644
--- a/platform/ext/target/nordic_nrf/common/nrf9160/partition/flash_layout.h
+++ b/platform/ext/target/nordic_nrf/common/nrf9160/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021 Arm Limited. All rights reserved.
* Copyright (c) 2020 Nordic Semiconductor ASA. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -166,19 +166,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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_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 PS_FLASH_PROGRAM_UNIT (0x4)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x4)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -186,19 +187,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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_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 (0x4)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x4)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/nuvoton/m2351/partition/flash_layout.h b/platform/ext/target/nuvoton/m2351/partition/flash_layout.h
index 85d506f..103867d 100644
--- a/platform/ext/target/nuvoton/m2351/partition/flash_layout.h
+++ b/platform/ext/target/nuvoton/m2351/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021 Arm Limited. All rights reserved.
* Copyright (c) 2020 Nuvoton Technology Corp. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -123,19 +123,20 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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_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 PS_FLASH_PROGRAM_UNIT (0x4)
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x4)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -143,19 +144,20 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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_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 (0x4)
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x4)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/nxp/lpcxpresso55s69/partition/flash_layout.h b/platform/ext/target/nxp/lpcxpresso55s69/partition/flash_layout.h
index 8cd8b33..81adaa4 100755
--- a/platform/ext/target/nxp/lpcxpresso55s69/partition/flash_layout.h
+++ b/platform/ext/target/nxp/lpcxpresso55s69/partition/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * 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.
* Copyright (c) 2020 Linaro. All rights reserved.
*
@@ -195,20 +195,22 @@
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 (0x8)
-/* Specifies the smallest flash programmable unit in bytes */
-#define PS_FLASH_PROGRAM_UNIT FLASH_AREA_IMAGE_SECTOR_SIZE
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (8)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT FLASH_AREA_IMAGE_SECTOR_SIZE
+#define PS_FLASH_NAND_BUF_SIZE (FLASH_AREA_IMAGE_SECTOR_SIZE * \
+ TFM_HAL_PS_SECTORS_PER_BLOCK)
/* Internal Trusted Storage (ITS) Service definitions
* Note: Further documentation of these definitions can be found in the
@@ -216,20 +218,22 @@
* allocated in the external flash just for development platforms that don't
* have internal flash available.
*/
-#define ITS_FLASH_DEV_NAME Driver_FLASH0
+#define TFM_HAL_ITS_FLASH_DRIVER Driver_FLASH0
/* In this target the CMSIS driver requires only the offset from the base
* address instead of the full memory address.
*/
-#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 (0x8)
-/* Specifies the smallest flash programmable unit in bytes */
-#define ITS_FLASH_PROGRAM_UNIT FLASH_AREA_IMAGE_SECTOR_SIZE
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (8)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT FLASH_AREA_IMAGE_SECTOR_SIZE
+#define ITS_FLASH_NAND_BUF_SIZE (FLASH_AREA_IMAGE_SECTOR_SIZE * \
+ TFM_HAL_ITS_SECTORS_PER_BLOCK)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/stm/nucleo_l552ze_q/include/flash_layout.h b/platform/ext/target/stm/nucleo_l552ze_q/include/flash_layout.h
index 39579fc..705e230 100644
--- a/platform/ext/target/stm/nucleo_l552ze_q/include/flash_layout.h
+++ b/platform/ext/target/stm/nucleo_l552ze_q/include/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -159,41 +159,43 @@
#define FLASH_DEV_NAME TFM_Driver_FLASH0
-/* Secure Storage (PS) Service definitions
+/* Protected Storage (PS) Service definitions
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME TFM_Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER TFM_Driver_FLASH0
-/* Secure Storage (PS) Service definitions */
/* In this target the CMSIS driver requires only the offset from the base
- * address instead of the full memory address.
- */
-#define PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
-#define PS_SECTOR_SIZE FLASH_AREA_IMAGE_SECTOR_SIZE
-#define PS_SECTORS_PER_BLOCK (0x1)
-#define PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
-#define PS_RAM_FS_SIZE PS_FLASH_AREA_SIZE
+ * address instead of the full memory address.
+ */
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x8)
-/* The sectors must be in consecutive memory location */
-#define PS_NBR_OF_SECTORS (FLASH_PS_AREA_SIZE / PS_SECTOR_SIZE)
-/* Specifies the smallest flash programmable unit in bytes */
-#define PS_FLASH_PROGRAM_UNIT 0x8
+/* Internal Trusted Storage (ITS) Service definitions
+ * Note: Further documentation of these definitions can be found in the
+ * TF-M ITS Integration Guide.
+ */
+#define TFM_HAL_ITS_FLASH_DRIVER TFM_Driver_FLASH0
-#define ITS_FLASH_DEV_NAME TFM_Driver_FLASH0
-
-#define ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
-#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
-/* The sectors must be in consecutive memory location */
-#define ITS_NBR_OF_SECTORS (FLASH_ITS_AREA_SIZE / ITS_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 (0x8)
+/* In this target the CMSIS driver requires only the offset from the base
+ * address instead of the full memory address.
+ */
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x8)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET
diff --git a/platform/ext/target/stm/stm32l562e_dk/include/flash_layout.h b/platform/ext/target/stm/stm32l562e_dk/include/flash_layout.h
index 1cb05e6..99910d4 100644
--- a/platform/ext/target/stm/stm32l562e_dk/include/flash_layout.h
+++ b/platform/ext/target/stm/stm32l562e_dk/include/flash_layout.h
@@ -1,5 +1,5 @@
/*
- * 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -222,41 +222,43 @@
#define FLASH_DEV_NAME TFM_Driver_FLASH0
-/* Secure Storage (PS) Service definitions
+/* Protected Storage (PS) Service definitions
* Note: Further documentation of these definitions can be found in the
* TF-M PS Integration Guide.
*/
-#define PS_FLASH_DEV_NAME TFM_Driver_FLASH0
+#define TFM_HAL_PS_FLASH_DRIVER TFM_Driver_FLASH0
-/* Secure Storage (PS) Service definitions */
/* In this target the CMSIS driver requires only the offset from the base
- * address instead of the full memory address.
- */
-#define PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
-#define PS_SECTOR_SIZE FLASH_AREA_IMAGE_SECTOR_SIZE
-#define PS_SECTORS_PER_BLOCK (0x1)
-#define PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
-#define PS_RAM_FS_SIZE PS_FLASH_AREA_SIZE
+ * address instead of the full memory address.
+ */
+/* Base address of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_ADDR FLASH_PS_AREA_OFFSET
+/* Size of dedicated flash area for PS */
+#define TFM_HAL_PS_FLASH_AREA_SIZE FLASH_PS_AREA_SIZE
+#define PS_RAM_FS_SIZE TFM_HAL_PS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_PS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_PS_PROGRAM_UNIT (0x8)
-/* The sectors must be in consecutive memory location */
-#define PS_NBR_OF_SECTORS (FLASH_PS_AREA_SIZE / PS_SECTOR_SIZE)
-/* Specifies the smallest flash programmable unit in bytes */
-#define PS_FLASH_PROGRAM_UNIT 0x8
+/* Internal Trusted Storage (ITS) Service definitions
+ * Note: Further documentation of these definitions can be found in the
+ * TF-M ITS Integration Guide.
+ */
+#define TFM_HAL_ITS_FLASH_DRIVER TFM_Driver_FLASH0
-#define ITS_FLASH_DEV_NAME TFM_Driver_FLASH0
-
-#define ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
-#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
-/* The sectors must be in consecutive memory location */
-#define ITS_NBR_OF_SECTORS (FLASH_ITS_AREA_SIZE / ITS_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 (0x8)
+/* In this target the CMSIS driver requires only the offset from the base
+ * address instead of the full memory address.
+ */
+/* Base address of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_ADDR FLASH_ITS_AREA_OFFSET
+/* Size of dedicated flash area for ITS */
+#define TFM_HAL_ITS_FLASH_AREA_SIZE FLASH_ITS_AREA_SIZE
+#define ITS_RAM_FS_SIZE TFM_HAL_ITS_FLASH_AREA_SIZE
+/* Number of physical erase sectors per logical FS block */
+#define TFM_HAL_ITS_SECTORS_PER_BLOCK (1)
+/* Smallest flash programmable unit in bytes */
+#define TFM_HAL_ITS_PROGRAM_UNIT (0x8)
/* NV Counters definitions */
#define TFM_NV_COUNTERS_AREA_ADDR FLASH_NV_COUNTERS_AREA_OFFSET