diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c index 2f8375a4282e..0d53197ef046 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c @@ -31,12 +31,34 @@ extern nrf_security_mutex_t cracen_mutex_symmetric; +#define KMU_PUSH_AREA_SIZE 64 + +/* When execution in place (CONFIG_XIP) is not enabled, which in practice means that when Zephyr is + * built for a RAM loaded image, the Zephyr linker script always places the RAM loaded image in the + * top address of the RAM and then loads the linker scripts defined with the Zephyr SECTION_PROLOGUE + * macros. Using SECTION_PROLOGUE macros to set the address of the kmu_push_area is + * incompatible with RAM loaded images. The Zephyr reserved-memory devicetree methodology works for + * both use cases but it requires heavy updates of multiple devicetree files and overlays. In order + * to support the RAM loaded images use cases faster initial support for reserving the memory of + * nrf_kmu_reserved_push_area though devicetree is limited to RAM loaded images. + */ +#if DT_NODE_EXISTS(DT_NODELABEL(nrf_kmu_reserved_push_area)) && !CONFIG_XIP + +#include +#include +#define KMU_PUSH_AREA_NODE DT_NODELABEL(nrf_kmu_reserved_push_area) +uint8_t kmu_push_area[KMU_PUSH_AREA_SIZE] Z_GENERIC_SECTION( + LINKER_DT_NODE_REGION_NAME(KMU_PUSH_AREA_NODE)); + +#else + /* The section .nrf_kmu_reserved_push_area is placed at the top RAM address * by the linker scripts. We do that for both the secure and non-secure builds. * Since this buffer is placed on the top of RAM we don't need to have the alignment * attribute anymore. */ -uint8_t kmu_push_area[64] __attribute__((section(".nrf_kmu_reserved_push_area"))); +uint8_t kmu_push_area[KMU_PUSH_AREA_SIZE] __attribute__((section(".nrf_kmu_reserved_push_area"))); +#endif typedef struct kmu_metadata { uint32_t metadata_version: 4; diff --git a/west.yml b/west.yml index 15c08bac1efc..9ecad07b0267 100644 --- a/west.yml +++ b/west.yml @@ -66,7 +66,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 16dc0c6c01401abcb069ec35139f490c2b13d907 + revision: b91aa4fec5484f6cd076c9333bb474a7f5c002c1 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above