From 8426fc0c69ccadfb53987110aa432a32019d3ca5 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 28 May 2025 08:50:17 +0200 Subject: [PATCH 01/18] Revert "[nrf noup] drivers: firmware: nrf_ironside: add IRONside update service" This reverts commit e54729f97c7e4afd1aab40c52944cc5589a091c5. Signed-off-by: Jonathan Nilsen --- drivers/firmware/nrf_ironside/CMakeLists.txt | 1 - drivers/firmware/nrf_ironside/Kconfig | 6 -- drivers/firmware/nrf_ironside/update.c | 28 -------- .../drivers/firmware/nrf_ironside/update.h | 72 ------------------- 4 files changed, 107 deletions(-) delete mode 100644 drivers/firmware/nrf_ironside/update.c delete mode 100644 include/zephyr/drivers/firmware/nrf_ironside/update.h diff --git a/drivers/firmware/nrf_ironside/CMakeLists.txt b/drivers/firmware/nrf_ironside/CMakeLists.txt index d21a132d67d..8f31acfef00 100644 --- a/drivers/firmware/nrf_ironside/CMakeLists.txt +++ b/drivers/firmware/nrf_ironside/CMakeLists.txt @@ -6,4 +6,3 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c) diff --git a/drivers/firmware/nrf_ironside/Kconfig b/drivers/firmware/nrf_ironside/Kconfig index 97e3604bf72..86c94d3a2ad 100644 --- a/drivers/firmware/nrf_ironside/Kconfig +++ b/drivers/firmware/nrf_ironside/Kconfig @@ -37,10 +37,4 @@ config NRF_IRONSIDE_CPUCONF_SERVICE help Service used to boot local domain cores. -config NRF_IRONSIDE_UPDATE_SERVICE - bool "IRONside update service" - select NRF_IRONSIDE_CALL - help - Service used to update the IRONside SE firmware. - endmenu diff --git a/drivers/firmware/nrf_ironside/update.c b/drivers/firmware/nrf_ironside/update.c deleted file mode 100644 index 8de21303b05..00000000000 --- a/drivers/firmware/nrf_ironside/update.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -int ironside_update(const struct ironside_update_blob *update) -{ - int err; - struct ironside_call_buf *const buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_UPDATE_SERVICE_V0; - buf->args[IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX] = (uintptr_t)update; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_UPDATE_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} diff --git a/include/zephyr/drivers/firmware/nrf_ironside/update.h b/include/zephyr/drivers/firmware/nrf_ironside/update.h deleted file mode 100644 index 62191b3285b..00000000000 --- a/include/zephyr/drivers/firmware/nrf_ironside/update.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_UPDATE_H_ -#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_UPDATE_H_ - -#include -#include - -/** - * @name Update service error codes. - * @{ - */ - -/** Caller does not have access to the provided update candidate buffer. */ -#define IRONSIDE_UPDATE_ERROR_NOT_PERMITTED (1) -/** Failed to write the update metadata to SICR. */ -#define IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED (2) - -/** - * @} - */ - -/** Length of the update manifest in bytes */ -#define IRONSIDE_UPDATE_MANIFEST_LENGTH (256) -/** Length of the update public key in bytes. */ -#define IRONSIDE_UPDATE_PUBKEY_LENGTH (32) -/** Length of the update signature in bytes. */ -#define IRONSIDE_UPDATE_SIGNATURE_LENGTH (64) - -/* IRONside call identifiers with implicit versions. - * - * With the initial "version 0", the service ABI is allowed to break until the - * first production release of IRONside SE. - */ -#define IRONSIDE_CALL_ID_UPDATE_SERVICE_V0 1 - -/* Index of the update blob pointer within the service buffer. */ -#define IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX (0) -/* Index of the return code within the service buffer. */ -#define IRONSIDE_UPDATE_SERVICE_RETCODE_IDX (0) - -/** - * @brief IRONside update blob. - */ -struct ironside_update_blob { - uint8_t manifest[IRONSIDE_UPDATE_MANIFEST_LENGTH]; - uint8_t pubkey[IRONSIDE_UPDATE_PUBKEY_LENGTH]; - uint8_t signature[IRONSIDE_UPDATE_SIGNATURE_LENGTH]; - uint32_t firmware[]; -}; - -/** - * @brief Request a firmware upgrade of the IRONside SE. - * - * This invokes the IRONside SE update service. The device must be restarted for the update - * to be installed. Check the update status in the application boot report to see if the update - * was successfully installed. - * - * @param update Pointer to update blob - * - * @retval -IRONSIDE_UPDATE_ERROR_NOT_PERMITTED if missing access to the update candidate. - * @retval -IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED if writing update parameters to SICR failed. - * @returns Positive non-0 error status if reported by IRONside call. - * @returns 0 on a successful request (although the update itself may still fail). - * - */ -int ironside_update(const struct ironside_update_blob *update); - -#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_UPDATE_H_ */ From bcb9871e73cc6e67719f509884f3c96b069d354e Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 28 May 2025 08:50:56 +0200 Subject: [PATCH 02/18] Revert "[nrf fromlist] samples: boards: nordic: add sample for nrf_ironside update service" This reverts commit 796c0e174e6fc37546563e1e19f9ea268bed0753. Signed-off-by: Jonathan Nilsen --- .../nordic/nrf_ironside/update/CMakeLists.txt | 10 --- .../boards/nordic/nrf_ironside/update/Kconfig | 11 --- .../nordic/nrf_ironside/update/README.rst | 74 ------------------- .../nordic/nrf_ironside/update/prj.conf | 3 - .../nordic/nrf_ironside/update/sample.yaml | 12 --- .../nordic/nrf_ironside/update/src/main.c | 31 -------- 6 files changed, 141 deletions(-) delete mode 100644 samples/boards/nordic/nrf_ironside/update/CMakeLists.txt delete mode 100644 samples/boards/nordic/nrf_ironside/update/Kconfig delete mode 100644 samples/boards/nordic/nrf_ironside/update/README.rst delete mode 100644 samples/boards/nordic/nrf_ironside/update/prj.conf delete mode 100644 samples/boards/nordic/nrf_ironside/update/sample.yaml delete mode 100644 samples/boards/nordic/nrf_ironside/update/src/main.c diff --git a/samples/boards/nordic/nrf_ironside/update/CMakeLists.txt b/samples/boards/nordic/nrf_ironside/update/CMakeLists.txt deleted file mode 100644 index b3aa8c35c2a..00000000000 --- a/samples/boards/nordic/nrf_ironside/update/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) - -project(ironside_se_update) - -target_sources(app PRIVATE src/main.c) diff --git a/samples/boards/nordic/nrf_ironside/update/Kconfig b/samples/boards/nordic/nrf_ironside/update/Kconfig deleted file mode 100644 index 702b943ff60..00000000000 --- a/samples/boards/nordic/nrf_ironside/update/Kconfig +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config UPDATE_BLOB_ADDRESS - hex "Address of the update blob" - default 0xe100000 - help - Address of the update blob. The default value matches the placement of the - update blobs delivered with the IRONside SE firmware. - -source "Kconfig.zephyr" diff --git a/samples/boards/nordic/nrf_ironside/update/README.rst b/samples/boards/nordic/nrf_ironside/update/README.rst deleted file mode 100644 index 2f44feedf06..00000000000 --- a/samples/boards/nordic/nrf_ironside/update/README.rst +++ /dev/null @@ -1,74 +0,0 @@ -.. zephyr:code-sample:: nrf_ironside_update - :name: Nordic IRONside SE firmware update - - Update the Nordic IRONside SE firmware. - -Overview -******** - -The Nordic IRONside SE Update sample updates the IRONside SE firmware on a SoC that already has IRONside SE installed. -It can update both the main image and the recovery image of IRONside SE using the IRONside SE firmware release ZIP file. - -Update procedure -**************** - -The update procedure works as follows: - -1. The application invokes the IRONside SE update service and passes the parameters that correspond to the location of the HEX file of the IRONside SE firmware update. - -#. The application prints the return value of the service call and outputs information from the update HEX file. - -#. After the service call completes, the IRONside SE firmware updates the internal state of the device. - -#. The firmware installs the update during the next device boot. - This operation can take several seconds. - -Once the operation has completed, you can read the boot report to verify that the update has taken place. - -Building and running the application for nrf54h20dk/nrf54h20/cpuapp/iron -************************************************************************ - -.. note:: - You can use this application only when there is already a version of IRONside SE installed on the device. - -1. Unzip the IRONside SE release ZIP to get the update hex file: - - .. code-block:: console - - unzip nrf54h20_soc_binaries_v.*.zip - -#. Program the appropriate update hex file from the release ZIP using one (not both) of the following commands: - - a) To update IRONside SE firmware: - - .. code-block:: console - - nrfutil device program --traits jlink --firmware update/ironside_se_update.hex - - b) To update IRONside SE recovery firmware: - - .. code-block:: console - - nrfutil device program --traits jlink --firmware update/ironside_se_recovery_update.hex - -#. Build and program the application: - - .. zephyr-app-commands:: - :zephyr-app: samples/boards/nordic/nrf_ironside/update - :board: nrf54h20dk/nrf54h20/cpuapp/iron - :goals: flash - -#. Trigger a reset: - -.. code-block:: console - - nrfutil device reset --reset-kind RESET_PIN --traits jlink - -#. Check that the new version is installed: - - .. code-block:: console - - # Read the version fields from the boot report - nrfutil x-read --direct --address 0x2f88fd04 --bytes 16 --traits jlink - # Read the update status in the boot report - nrfutil x-read --direct --address 0x2f88fd24 --bytes 4 --traits jlink diff --git a/samples/boards/nordic/nrf_ironside/update/prj.conf b/samples/boards/nordic/nrf_ironside/update/prj.conf deleted file mode 100644 index 8682307eca6..00000000000 --- a/samples/boards/nordic/nrf_ironside/update/prj.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_LOG=y - -CONFIG_NRF_IRONSIDE_UPDATE_SERVICE=y diff --git a/samples/boards/nordic/nrf_ironside/update/sample.yaml b/samples/boards/nordic/nrf_ironside/update/sample.yaml deleted file mode 100644 index af3c24624b8..00000000000 --- a/samples/boards/nordic/nrf_ironside/update/sample.yaml +++ /dev/null @@ -1,12 +0,0 @@ -sample: - name: Nordic IRONside SE update service - description: Demonstrates how to update the Nordic IRONside SE firmware -common: - build_only: true - tags: nrf_ironside - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp/iron - -tests: - sample.boards.nordic.nrf_ironside.update: - platform_allow: nrf54h20dk/nrf54h20/cpuapp/iron diff --git a/samples/boards/nordic/nrf_ironside/update/src/main.c b/samples/boards/nordic/nrf_ironside/update/src/main.c deleted file mode 100644 index 09513497de9..00000000000 --- a/samples/boards/nordic/nrf_ironside/update/src/main.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -LOG_MODULE_REGISTER(app, LOG_LEVEL_INF); - -int main(void) -{ - int err; - const struct ironside_update_blob *update = (void *)CONFIG_UPDATE_BLOB_ADDRESS; - - err = ironside_update(update); - LOG_INF("IRONside update retval: 0x%x", err); - - if (err == 0) { - LOG_HEXDUMP_INF(update->manifest, sizeof(update->manifest), "Update manifest:"); - LOG_HEXDUMP_INF(update->pubkey, sizeof(update->pubkey), "Public key:"); - LOG_HEXDUMP_INF(update->signature, sizeof(update->signature), "Signature:"); - LOG_HEXDUMP_INF(update->firmware, 8, "First 8 bytes of encrypted fw:"); - LOG_INF("Reboot the device to trigger the update"); - } else { - LOG_ERR("The request to update failed"); - } - - return 0; -} From ada86d319a24f7465e2940684345b2492232bb6d Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 28 May 2025 08:51:15 +0200 Subject: [PATCH 03/18] Revert "[nrf fromlist] samples: sysbuild: Add support for nrf54h20dk/nrf54h20/cpuapp/iron" This reverts commit 6118016c38ab1c8bced5d7ab1b5c8a8c1c0bc51f. Signed-off-by: Jonathan Nilsen --- .../hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf | 4 ---- samples/sysbuild/hello_world/sample.yaml | 5 ----- .../sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf | 1 - 3 files changed, 10 deletions(-) delete mode 100644 samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf delete mode 100644 samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf diff --git a/samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf b/samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf deleted file mode 100644 index ca2bc07e4f2..00000000000 --- a/samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y diff --git a/samples/sysbuild/hello_world/sample.yaml b/samples/sysbuild/hello_world/sample.yaml index c8ca9cbe4c0..cbc58e2a336 100644 --- a/samples/sysbuild/hello_world/sample.yaml +++ b/samples/sysbuild/hello_world/sample.yaml @@ -27,11 +27,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf - sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpurad.iron: - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp/iron - extra_args: SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf - sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpuppr: platform_allow: - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf b/samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf deleted file mode 100644 index 8d4a230adbe..00000000000 --- a/samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad/iron" From abebeed9a407d970157da1e057395c09808be0a3 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 28 May 2025 08:51:28 +0200 Subject: [PATCH 04/18] Revert "[nrf fromlist] cpuconf: Boot the radiocore from the app in soc_late_init_hook" This reverts commit cb7ed2dba414f2c29319b20c5946312b097841c7. Signed-off-by: Jonathan Nilsen --- soc/nordic/nrf54h/Kconfig | 11 ----------- soc/nordic/nrf54h/soc.c | 27 --------------------------- 2 files changed, 38 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 8e3a72373fc..b1933a0422c 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -8,7 +8,6 @@ config SOC_SERIES_NRF54HX select HAS_NRFX select HAS_NORDIC_DRIVERS select SOC_EARLY_INIT_HOOK if ARM - select SOC_LATE_INIT_HOOK if SOC_NRF54H20_CPURAD_ENABLE select NRF_PLATFORM_HALTIUM config SOC_NRF54H20_CPUAPP_COMMON @@ -67,16 +66,6 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_PM select HAS_POWEROFF -config SOC_NRF54H20_CPURAD_ENABLE - bool "Boot the nRF54H20 Radio core" - default y if NRF_802154_SER_HOST - depends on SOC_NRF54H20_CPUAPP - select NRF_IRONSIDE_CPUCONF_SERVICE - help - This will at application boot time enable clock to the - Radiocore, and also power will be requested to the Radiocore - subsystem. The Radiocore will then start executing instructions. - config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index c1849ab3a23..ad2da0b30bf 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -22,7 +22,6 @@ #include #include #include -#include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -44,8 +43,6 @@ sys_snode_t soc_node; ADDRESS_DOMAIN_Msk | \ ADDRESS_BUS_Msk))) -#define DT_NODELABEL_CPURAD_SLOT0_PARTITION DT_NODELABEL(cpurad_slot0_partition) - static void power_domain_init(void) { /* @@ -159,30 +156,6 @@ void soc_early_init_hook(void) } } -#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) -void soc_late_init_hook(void) -{ - int err; - - /* The msg will be used for communication prior to IPC - * communication being set up. But at this moment no such - * communication is required. - */ - uint8_t *msg = NULL; - size_t msg_size = 0; - - void *radiocore_address = - (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL_CPURAD_SLOT0_PARTITION)) + - DT_REG_ADDR(DT_NODELABEL_CPURAD_SLOT0_PARTITION)); - - /* Don't wait as this is not yet supported. */ - bool cpu_wait = false; - - err = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, msg_size); - __ASSERT(err == 0, "err was %d", err); -} -#endif - void arch_busy_wait(uint32_t time_us) { nrfx_coredep_delay_us(time_us); From 31998f142a5b3c16aa2aa085000a79ce5a2d5e7c Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 28 May 2025 08:51:41 +0200 Subject: [PATCH 05/18] Revert "[nrf fromlist] drivers: firmware: nrf_ironside: add IRONside CPUCONF service" This reverts commit 3823cef1475c64d3cad964e69f5764dd13274b05. Signed-off-by: Jonathan Nilsen --- drivers/firmware/nrf_ironside/CMakeLists.txt | 2 - drivers/firmware/nrf_ironside/Kconfig | 12 ---- drivers/firmware/nrf_ironside/cpuconf.c | 40 ------------ .../drivers/firmware/nrf_ironside/cpuconf.h | 63 ------------------- 4 files changed, 117 deletions(-) delete mode 100644 drivers/firmware/nrf_ironside/cpuconf.c delete mode 100644 include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h diff --git a/drivers/firmware/nrf_ironside/CMakeLists.txt b/drivers/firmware/nrf_ironside/CMakeLists.txt index 8f31acfef00..90320c62df5 100644 --- a/drivers/firmware/nrf_ironside/CMakeLists.txt +++ b/drivers/firmware/nrf_ironside/CMakeLists.txt @@ -4,5 +4,3 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) - -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c) diff --git a/drivers/firmware/nrf_ironside/Kconfig b/drivers/firmware/nrf_ironside/Kconfig index 86c94d3a2ad..20545669e92 100644 --- a/drivers/firmware/nrf_ironside/Kconfig +++ b/drivers/firmware/nrf_ironside/Kconfig @@ -26,15 +26,3 @@ config NRF_IRONSIDE_CALL_INIT_PRIORITY but higher than the priority of any feature that selects NRF_IRONSIDE_CALL. endif # NRF_IRONSIDE_CALL - -menu "Nordic IRONside services" - depends on SOC_NRF54H20_IRON - -config NRF_IRONSIDE_CPUCONF_SERVICE - bool "IRONside CPUCONF service" - depends on SOC_NRF54H20_CPUAPP - select NRF_IRONSIDE_CALL - help - Service used to boot local domain cores. - -endmenu diff --git a/drivers/firmware/nrf_ironside/cpuconf.c b/drivers/firmware/nrf_ironside/cpuconf.c deleted file mode 100644 index 93627eaca37..00000000000 --- a/drivers/firmware/nrf_ironside/cpuconf.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -#include -#include - -#include -#include - -int ironside_cpuconf(NRF_PROCESSORID_Type cpu, void *vector_table, bool cpu_wait, uint8_t *msg, - size_t msg_size) -{ - int err; - struct ironside_call_buf *const buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_CPUCONF_V0; - - buf->args[IRONSIDE_CPUCONF_SERVICE_CPU_IDX] = cpu; - buf->args[IRONSIDE_CPUCONF_SERVICE_VECTOR_TABLE_IDX] = (uint32_t)vector_table; - buf->args[IRONSIDE_CPUCONF_SERVICE_CPU_WAIT_IDX] = cpu_wait; - buf->args[IRONSIDE_CPUCONF_SERVICE_MSG_IDX] = (uint32_t)msg; - buf->args[IRONSIDE_CPUCONF_SERVICE_MSG_SIZE_IDX] = msg_size; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_CPUCONF_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} diff --git a/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h b/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h deleted file mode 100644 index c0b19e1d3f4..00000000000 --- a/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_ -#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_ - -#include - -#include - -/** - * @name CPUCONF service error codes. - * @{ - */ - -#define IRONSIDE_CPUCONF_ERROR_WRONG_CPU 0x5eb2 -#define IRONSIDE_CPUCONF_ERROR_MEM_ACCESS_NOT_PERMITTED 0x5eb1 - -/** - * @} - */ - -#define IRONSIDE_CALL_ID_CPUCONF_V0 2 - -enum { - IRONSIDE_CPUCONF_SERVICE_CPU_IDX, - IRONSIDE_CPUCONF_SERVICE_VECTOR_TABLE_IDX, - IRONSIDE_CPUCONF_SERVICE_CPU_WAIT_IDX, - IRONSIDE_CPUCONF_SERVICE_MSG_IDX, - IRONSIDE_CPUCONF_SERVICE_MSG_SIZE_IDX, - /* The last enum value is reserved for the number of arguments */ - IRONSIDE_CPUCONF_NUM_ARGS -}; - -/* IDX 0 is re-used by the error return code and the 'cpu' parameter. */ -#define IRONSIDE_CPUCONF_SERVICE_RETCODE_IDX 0 - -BUILD_ASSERT(IRONSIDE_CPUCONF_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); - -/** - * @brief Boot a local domain CPU - * - * @param cpu The CPU to be booted - * @param vector_table Pointer to the vector table used to boot the CPU. - * @param cpu_wait When this is true, the CPU will WAIT even if the CPU has clock. - * @param msg A message that can be placed in radiocore's boot report. - * @param msg_size Size of the message in bytes. - * - * @note cpu_wait is only intended to be enabled for debug purposes - * and it is only supported that a debugger resumes the CPU. - * - * @retval 0 on success or if the CPU has already booted. - * @retval Positive non-0 error status if reported by IRONside call. - * @retval -IRONSIDE_CPUCONF_ERROR_WRONG_CPU if cpu is unrecognized - * @retval -IRONSIDE_CPUCONF_ERROR_MEM_ACCESS_NOT_PERMITTED - * if the CPU does not have read access configured for the vector_table address - */ -int ironside_cpuconf(NRF_PROCESSORID_Type cpu, void *vector_table, bool cpu_wait, uint8_t *msg, - size_t msg_size); - -#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_ */ From 3306c87734bcfa56bab2941f25f93c4a3ac3b81c Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 28 May 2025 08:51:55 +0200 Subject: [PATCH 06/18] Revert "[nrf fromlist] soc: nrf54: Port SYS_INIT to use soc_early_init_hook" This reverts commit 5d33965a9823a4edb256a70a9e6a657144c477d8. Signed-off-by: Jonathan Nilsen --- soc/nordic/nrf54h/Kconfig | 1 - soc/nordic/nrf54h/soc.c | 10 ++++++++-- tests/boards/nrf/dmm/src/main.c | 3 +-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index b1933a0422c..89fa83ef869 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -7,7 +7,6 @@ config SOC_SERIES_NRF54HX select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS - select SOC_EARLY_INIT_HOOK if ARM select NRF_PLATFORM_HALTIUM config SOC_NRF54H20_CPUAPP_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index ad2da0b30bf..6dc8100e00c 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -126,7 +126,7 @@ bool z_arm_on_enter_cpu_idle(void) } #endif -void soc_early_init_hook(void) +static int nordicsemi_nrf54h_init(void) { int err; @@ -138,7 +138,9 @@ void soc_early_init_hook(void) trim_hsfll(); err = dmm_init(); - __ASSERT_NO_MSG(err == 0); + if (err < 0) { + return err; + } #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ccm030)) /* DMASEC is set to non-secure by default, which prevents CCM from @@ -154,9 +156,13 @@ void soc_early_init_hook(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } + + return 0; } void arch_busy_wait(uint32_t time_us) { nrfx_coredep_delay_us(time_us); } + +SYS_INIT(nordicsemi_nrf54h_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 214a9069752..078edcdd39f 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -228,5 +228,4 @@ int dmm_test_prepare(void) return 0; } -/* Needs to execute before DMM initialization. */ -SYS_INIT(dmm_test_prepare, EARLY, 0); +SYS_INIT(dmm_test_prepare, PRE_KERNEL_1, 0); From 1fc99b4c848b6ba0c69229055df83dddc1b04537 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 28 May 2025 08:52:09 +0200 Subject: [PATCH 07/18] Revert "[nrf fromlist] boards: nordic: add 'iron' board variant for radio" This reverts commit 80f90fc18f38c919e1fbf9ac7e39bded324b5d4e. Signed-off-by: Jonathan Nilsen --- boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk | 6 ++-- boards/nordic/nrf54h20dk/board.cmake | 6 ++-- boards/nordic/nrf54h20dk/board.yml | 2 -- .../nrf54h20dk_nrf54h20_cpurad_iron.dts | 22 --------------- ...nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml | 20 ------------- .../nrf54h20dk_nrf54h20_cpurad_iron_defconfig | 28 ------------------- 6 files changed, 4 insertions(+), 80 deletions(-) delete mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts delete mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml delete mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig diff --git a/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk b/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk index c509f968db6..de513858e9c 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk +++ b/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk @@ -4,11 +4,9 @@ config BOARD_NRF54H20DK select SOC_NRF54H20_CPUAPP if (BOARD_NRF54H20DK_NRF54H20_CPUAPP || \ BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON) - select SOC_NRF54H20_CPURAD if (BOARD_NRF54H20DK_NRF54H20_CPURAD || \ - BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON) + select SOC_NRF54H20_CPURAD if BOARD_NRF54H20DK_NRF54H20_CPURAD select SOC_NRF54H20_CPUPPR if (BOARD_NRF54H20DK_NRF54H20_CPUPPR || \ BOARD_NRF54H20DK_NRF54H20_CPUPPR_XIP) select SOC_NRF54H20_CPUFLPR if (BOARD_NRF54H20DK_NRF54H20_CPUFLPR || \ BOARD_NRF54H20DK_NRF54H20_CPUFLPR_XIP) - select SOC_NRF54H20_IRON if (BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON || \ - BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON) + select SOC_NRF54H20_IRON if BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON diff --git a/boards/nordic/nrf54h20dk/board.cmake b/boards/nordic/nrf54h20dk/board.cmake index 093155e9322..5ad6557c003 100644 --- a/boards/nordic/nrf54h20dk/board.cmake +++ b/boards/nordic/nrf54h20dk/board.cmake @@ -2,10 +2,8 @@ include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) -if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR - CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD OR - CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON OR - CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON) +if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD + OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON) if(CONFIG_SOC_NRF54H20_CPUAPP) set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuapp.JLinkScript) else() diff --git a/boards/nordic/nrf54h20dk/board.yml b/boards/nordic/nrf54h20dk/board.yml index a54cf1ae549..2009cc6130b 100644 --- a/boards/nordic/nrf54h20dk/board.yml +++ b/boards/nordic/nrf54h20dk/board.yml @@ -11,8 +11,6 @@ board: cpucluster: cpuflpr - name: iron cpucluster: cpuapp - - name: iron - cpucluster: cpurad revision: format: major.minor.patch default: "0.9.0" diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts deleted file mode 100644 index d9f2ec40f6f..00000000000 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54h20dk_nrf54h20_cpurad.dts" -#include "nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi" -#include "nrf54h20dk_nrf54h20-memory_map_iron.dtsi" - -/ { - chosen { - zephyr,code-partition = &cpurad_slot0_partition; - zephyr,uart-mcumgr = &uart135; - }; -}; - - -&cpusec_cpurad_ipc { - mbox-names = "tx", "rx"; - status = "okay"; -}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml deleted file mode 100644 index ef71cfa924c..00000000000 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54h20dk/nrf54h20/cpurad/iron -name: nRF54H20-DK-nRF54H20-Radio (IRONside SE compatible) (revision 0.9.0) -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -sysbuild: true -ram: 192 -flash: 336 -supported: - - counter - - gpio - - pwm - - retained_mem - - spi diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig deleted file mode 100644 index 0ee0a96f99d..00000000000 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable UART driver -CONFIG_SERIAL=y - -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -CONFIG_USE_DT_CODE_PARTITION=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# MPU-based null-pointer dereferencing detection cannot be applied -# as the (0x0 - 0x400) region is unmapped for this target. -CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y - -# Enable cache -CONFIG_CACHE_MANAGEMENT=y -CONFIG_EXTERNAL_CACHE=y - -# UICR generation is not supported, and when reintroduced will not use nrf-regtool. -CONFIG_NRF_REGTOOL_GENERATE_UICR=n From 9d3ecae17208d19ca96c6549ed28d82b3921ad28 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 28 May 2025 08:52:24 +0200 Subject: [PATCH 08/18] Revert "[nrf noup] boards: nrf54h20dk: Add common files for iron board variants" This reverts commit e1c9150e890bf2798177637f27682b5c4a25bf08. Signed-off-by: Jonathan Nilsen --- .../nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi | 30 ----- .../nrf54h20dk_nrf54h20-memory_map_iron.dtsi | 104 ------------------ .../nrf54h20dk_nrf54h20_cpuapp_iron.dts | 80 +++++++++++--- 3 files changed, 66 insertions(+), 148 deletions(-) delete mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi delete mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi deleted file mode 100644 index a44db40538d..00000000000 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* This file is to be merged with the original ipc_conf.dtsi in the future. */ - -/ { - ipc { - /delete-node/ ipc-1-2; - /delete-node/ ipc-1-3; - - cpusec_cpuapp_ipc: ipc-1-2 { - compatible = "nordic,ironside-call"; - memory-region = <&cpusec_cpuapp_ipc_shm>; - mboxes = <&cpusec_bellboard 12>, - <&cpuapp_bellboard 0>; - status = "disabled"; - }; - - cpusec_cpurad_ipc: ipc-1-3 { - compatible = "nordic,ironside-call"; - memory-region = <&cpusec_cpurad_ipc_shm>; - mboxes = <&cpusec_bellboard 18>, - <&cpurad_bellboard 0>; - status = "disabled"; - }; - }; -}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi deleted file mode 100644 index 2977e83758b..00000000000 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* This file is to be merged with the original memory_map.dtsi in the future. - * The following nodes will be replaced: - */ -/delete-node/ &cpuapp_cpusec_ipc_shm; -/delete-node/ &cpuapp_cpusys_ipc_shm; -/delete-node/ &cpurad_cpusec_ipc_shm; -/delete-node/ &cpurad_cpusys_ipc_shm; -/delete-node/ &cpusec_cpuapp_ipc_shm; -/delete-node/ &cpusec_cpurad_ipc_shm; -/delete-node/ &cpusys_cpuapp_ipc_shm; -/delete-node/ &cpusys_cpurad_ipc_shm; -/delete-node/ &cpuapp_rw_partitions; -/delete-node/ &cpuapp_rx_partitions; -/delete-node/ &cpurad_rx_partitions; - -/ { - reserved-memory { - cpuapp_cpusys_ipc_shm: memory@2f88f600 { - reg = <0x2f88f600 0x80>; - }; - - cpusys_cpuapp_ipc_shm: memory@2f88f680 { - reg = <0x2f88f680 0x80>; - }; - - cpurad_cpusys_ipc_shm: memory@2f88f700 { - reg = <0x2f88f700 0x80>; - }; - - cpusys_cpurad_ipc_shm: memory@2f88f780 { - reg = <0x2f88f780 0x80>; - }; - - cpusec_cpurad_ipc_shm: memory@2f88f800 { - reg = <0x2f88f800 0x80>; - }; - - cpurad_ironside_se_event_report: memory@2f88f880 { - reg = <0x2f88f880 0x100>; - }; - - cpurad_ironside_se_boot_report: memory@2f88f980 { - reg = <0x2f88f980 0x200>; - }; - - cpusec_cpuapp_ipc_shm: memory@2f88fb80 { - reg = <0x2f88fb80 0x80>; - }; - - cpuapp_ironside_se_event_report: memory@2f88fc00 { - reg = <0x2f88fc00 0x100>; - }; - - cpuapp_ironside_se_boot_report: memory@2f88fd00 { - reg = <0x2f88fd00 0x200>; - }; - }; -}; - -&mram1x { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_boot_partition: partition@2c000 { - reg = <0x2c000 DT_SIZE_K(64)>; - }; - - cpuapp_slot0_partition: partition@3c000 { - reg = <0x3c000 DT_SIZE_K(336)>; - }; - - cpurad_slot0_partition: partition@90000 { - reg = <0x90000 DT_SIZE_K(336)>; - }; - - cpuppr_code_partition: partition@e4000 { - reg = <0xe4000 DT_SIZE_K(64)>; - }; - - cpuflpr_code_partition: partition@f4000 { - reg = <0xf4000 DT_SIZE_K(48)>; - }; - - cpuapp_slot1_partition: partition@100000 { - reg = <0x100000 DT_SIZE_K(336)>; - }; - - cpurad_slot1_partition: partition@154000 { - reg = <0x154000 DT_SIZE_K(336)>; - }; - - storage_partition: partition@1a8000 { - reg = <0x1a8000 DT_SIZE_K(40)>; - }; - }; -}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts index dbd20dafc85..47fffbeb4fc 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts @@ -5,10 +5,19 @@ */ #include "nrf54h20dk_nrf54h20_cpuapp.dts" -#include "nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi" -#include "nrf54h20dk_nrf54h20-memory_map_iron.dtsi" -/delete-node/ &cpusec_cpurad_ipc; +/delete-node/&cpurad_rx_partitions; +/delete-node/&cpuapp_rx_partitions; + +/* Update the location of cpusys IPC shared memory */ +/delete-node/&cpuapp_cpusys_ipc_shm; +/delete-node/&cpusys_cpuapp_ipc_shm; +/delete-node/&cpurad_cpusys_ipc_shm; +/delete-node/&cpusys_cpurad_ipc_shm; + +/* This is not yet an exhaustive memory map, and contain only a minimum required to boot + * the application core. + */ / { chosen { @@ -17,19 +26,62 @@ }; }; -&cpusec_cpuapp_ipc { - mbox-names = "tx", "rx"; - status = "okay"; -}; +&mram1x { + cpuapp_rx_partitions: cpuapp-rx-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; -boot_partition: &cpuapp_boot_partition { - label = "mcuboot"; -}; + boot_partition: partition@2c000 { + label = "mcuboot"; + reg = <0x2c000 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@3c000 { + label = "image-0"; + reg = <0x3c000 DT_SIZE_K(336)>; + }; + + slot1_partition: partition@90000 { + label = "image-1"; + reg = <0x90000 DT_SIZE_K(336)>; + }; + + cpuppr_code_partition: partition@e4000 { + reg = <0xe4000 DT_SIZE_K(64)>; + }; -slot0_partition: &cpuapp_slot0_partition { - label = "image-0"; + cpuflpr_code_partition: partition@f4000 { + reg = <0xf4000 DT_SIZE_K(48)>; + }; + }; }; -slot1_partition: &cpuapp_slot1_partition { - label = "image-1"; +/ { + reserved-memory { + sysctrl_rom_report: memory@2f88ff00 { + reg = <0x2f88ff00 0x100>; + }; + + cpuapp_ironside_se_boot_report: memory@2f88fd00 { + reg = <0x2f88fd00 0x200>; + }; + + cpusys_cpurad_ipc_shm: memory@2f88f780 { + reg = <0x2f88f780 0x80>; + }; + + cpurad_cpusys_ipc_shm: memory@2f88f700 { + reg = <0x2f88f700 0x80>; + }; + + cpusys_cpuapp_ipc_shm: memory@2f88f680 { + reg = <0x2f88f680 0x80>; + }; + + cpuapp_cpusys_ipc_shm: memory@2f88f600 { + reg = <0x2f88f600 0x80>; + }; + }; }; From 8199d81b24c20bd924b13513d9c4e031c6e7cf3a Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 28 May 2025 08:52:41 +0200 Subject: [PATCH 09/18] Revert "[nrf fromlist] soc: add ironside boot report" This reverts commit f32cef9cbabf0866214c6839a518220ba40ba05f. Signed-off-by: Jonathan Nilsen --- .../nrf54h20dk_nrf54h20_cpuapp_iron.dts | 48 +++----------- soc/nordic/nrf54h/CMakeLists.txt | 1 - soc/nordic/nrf54h/Kconfig | 7 +-- soc/nordic/nrf54h/ironside/se/CMakeLists.txt | 5 -- soc/nordic/nrf54h/ironside/se/Kconfig | 15 ----- .../se/include/nrf/ironside_se_boot_report.h | 63 ------------------- .../ironside/se/ironside_se_boot_report.c | 25 -------- .../ironside_se_boot_report/CMakeLists.txt | 9 --- .../nrf/ironside_se_boot_report/prj.conf | 1 - .../nrf/ironside_se_boot_report/src/main.c | 21 ------- .../nrf/ironside_se_boot_report/testcase.yaml | 19 ------ 11 files changed, 10 insertions(+), 204 deletions(-) delete mode 100644 soc/nordic/nrf54h/ironside/se/CMakeLists.txt delete mode 100644 soc/nordic/nrf54h/ironside/se/Kconfig delete mode 100644 soc/nordic/nrf54h/ironside/se/include/nrf/ironside_se_boot_report.h delete mode 100644 soc/nordic/nrf54h/ironside/se/ironside_se_boot_report.c delete mode 100644 tests/boards/nrf/ironside_se_boot_report/CMakeLists.txt delete mode 100644 tests/boards/nrf/ironside_se_boot_report/prj.conf delete mode 100644 tests/boards/nrf/ironside_se_boot_report/src/main.c delete mode 100644 tests/boards/nrf/ironside_se_boot_report/testcase.yaml diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts index 47fffbeb4fc..54e3014adea 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts @@ -9,12 +9,6 @@ /delete-node/&cpurad_rx_partitions; /delete-node/&cpuapp_rx_partitions; -/* Update the location of cpusys IPC shared memory */ -/delete-node/&cpuapp_cpusys_ipc_shm; -/delete-node/&cpusys_cpuapp_ipc_shm; -/delete-node/&cpurad_cpusys_ipc_shm; -/delete-node/&cpusys_cpurad_ipc_shm; - /* This is not yet an exhaustive memory map, and contain only a minimum required to boot * the application core. */ @@ -40,48 +34,20 @@ slot0_partition: partition@3c000 { label = "image-0"; - reg = <0x3c000 DT_SIZE_K(336)>; + reg = <0x3c000 DT_SIZE_K(200)>; }; - slot1_partition: partition@90000 { + slot1_partition: partition@6E000 { label = "image-1"; - reg = <0x90000 DT_SIZE_K(336)>; - }; - - cpuppr_code_partition: partition@e4000 { - reg = <0xe4000 DT_SIZE_K(64)>; - }; - - cpuflpr_code_partition: partition@f4000 { - reg = <0xf4000 DT_SIZE_K(48)>; - }; - }; -}; - -/ { - reserved-memory { - sysctrl_rom_report: memory@2f88ff00 { - reg = <0x2f88ff00 0x100>; - }; - - cpuapp_ironside_se_boot_report: memory@2f88fd00 { - reg = <0x2f88fd00 0x200>; - }; - - cpusys_cpurad_ipc_shm: memory@2f88f780 { - reg = <0x2f88f780 0x80>; - }; - - cpurad_cpusys_ipc_shm: memory@2f88f700 { - reg = <0x2f88f700 0x80>; + reg = <0x6E000 DT_SIZE_K(200)>; }; - cpusys_cpuapp_ipc_shm: memory@2f88f680 { - reg = <0x2f88f680 0x80>; + cpuppr_code_partition: partition@a4000 { + reg = <0xa4000 DT_SIZE_K(64)>; }; - cpuapp_cpusys_ipc_shm: memory@2f88f600 { - reg = <0x2f88f600 0x80>; + cpuflpr_code_partition: partition@b4000 { + reg = <0xb4000 DT_SIZE_K(48)>; }; }; }; diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index c5f1aa93af4..23c1cab1e77 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -18,4 +18,3 @@ zephyr_linker_sources(SECTIONS SORT_KEY zzz_place_align_at_end align.ld) add_subdirectory(bicr) add_subdirectory(gpd) -add_subdirectory(ironside/se) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 89fa83ef869..0373e00d07b 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -74,9 +74,8 @@ config SOC_NRF54H20_CPUPPR config SOC_NRF54H20_CPUFLPR select RISCV_CORE_NORDIC_VPR -config SOC_NRF54H20_IRON - select EXPERIMENTAL if MCUBOOT - rsource "bicr/Kconfig" rsource "gpd/Kconfig" -rsource "ironside/se/Kconfig" + +config SOC_NRF54H20_IRON + select EXPERIMENTAL if MCUBOOT diff --git a/soc/nordic/nrf54h/ironside/se/CMakeLists.txt b/soc/nordic/nrf54h/ironside/se/CMakeLists.txt deleted file mode 100644 index 5254d6e37b3..00000000000 --- a/soc/nordic/nrf54h/ironside/se/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor -# SPDX-License-Identifier: Apache-2.0 - -zephyr_library_sources_ifdef(CONFIG_SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT ironside_se_boot_report.c) -zephyr_include_directories(include) diff --git a/soc/nordic/nrf54h/ironside/se/Kconfig b/soc/nordic/nrf54h/ironside/se/Kconfig deleted file mode 100644 index 1e43127b555..00000000000 --- a/soc/nordic/nrf54h/ironside/se/Kconfig +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor -# SPDX-License-Identifier: Apache-2.0 - -config SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT - bool "Nordic IRONside SE boot report" - default y if SOC_NRF54H20_CPUAPP - depends on SOC_NRF54H20_IRON - help - This option enables parsing of the Boot Report populated by Nordic IRONside SE. - -config SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT_MAGIC - hex - default 0x4d69546f - help - Constant used to check if an Nordic IRONside SE boot report has been written. diff --git a/soc/nordic/nrf54h/ironside/se/include/nrf/ironside_se_boot_report.h b/soc/nordic/nrf54h/ironside/se/include/nrf/ironside_se_boot_report.h deleted file mode 100644 index 0843edd67e1..00000000000 --- a/soc/nordic/nrf54h/ironside/se/include/nrf/ironside_se_boot_report.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_ -#define ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_ - -#include -#include - -#define IRONSIDE_SE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE (16UL) /* Size in bytes */ -#define IRONSIDE_SE_BOOT_REPORT_RANDOM_DATA_SIZE (32UL) /* Size in bytes */ - -/** @brief UICR error description contained in the boot report. */ -struct ironside_se_boot_report_uicr_error { - /** The type of error. A value of 0 indicates no error */ - uint32_t error_type; - /** Error descriptions specific to each type of UICR error */ - union { - /** RFU */ - struct { - uint32_t rfu[4]; - } rfu; - } description; -}; - -/** @brief IRONside boot report. */ -struct ironside_se_boot_report { - /** Magic value used to identify valid boot report */ - uint32_t magic; - /** Firmware version of IRONside SE. 8bit MAJOR.MINOR.PATCH.SEQNUM */ - uint32_t ironside_se_version_int; - /** Human readable extraversion of IRONside SE */ - char ironside_se_extraversion[12]; - /** Firmware version of IRONside SE recovery firmware. 8bit MAJOR.MINOR.PATCH.SEQNUM */ - uint32_t ironside_se_recovery_version_int; - /** Human readable extraversion of IRONside SE recovery firmware */ - char ironside_se_recovery_extraversion[12]; - /** Copy of SICR.UROT.UPDATE.STATUS.*/ - uint32_t ironside_update_status; - /** See @ref ironside_se_boot_report_uicr_error */ - struct ironside_se_boot_report_uicr_error uicr_error_description; - /** Data passed from booting local domain to local domain being booted */ - uint8_t local_domain_context[IRONSIDE_SE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE]; - /** CSPRNG data */ - uint8_t random_data[IRONSIDE_SE_BOOT_REPORT_RANDOM_DATA_SIZE]; - /** Reserved for Future Use */ - uint32_t rfu[64]; -}; - -/** - * @brief Get a pointer to the IRONside boot report. - * - * @param[out] report Will be set to point to the IRONside boot report. - * - * @return non-negative value if success, negative value otherwise. - * @retval -EFAULT if the magic field in the report is incorrect. - * @retval -EINVAL if @ref report is NULL. - */ -int ironside_se_boot_report_get(const struct ironside_se_boot_report **report); - -#endif /* ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_ */ diff --git a/soc/nordic/nrf54h/ironside/se/ironside_se_boot_report.c b/soc/nordic/nrf54h/ironside/se/ironside_se_boot_report.c deleted file mode 100644 index d3f3c777c72..00000000000 --- a/soc/nordic/nrf54h/ironside/se/ironside_se_boot_report.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include - -#define IRONSIDE_SE_BOOT_REPORT_ADDR DT_REG_ADDR(DT_NODELABEL(cpuapp_ironside_se_boot_report)) -#define IRONSIDE_SE_BOOT_REPORT_MAGIC CONFIG_SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT_MAGIC - -int ironside_se_boot_report_get(const struct ironside_se_boot_report **report) -{ - const struct ironside_se_boot_report *tmp_report = - (const struct ironside_se_boot_report *)IRONSIDE_SE_BOOT_REPORT_ADDR; - - if (tmp_report->magic != IRONSIDE_SE_BOOT_REPORT_MAGIC) { - return -EINVAL; - } - - *report = tmp_report; - - return 0; -} diff --git a/tests/boards/nrf/ironside_se_boot_report/CMakeLists.txt b/tests/boards/nrf/ironside_se_boot_report/CMakeLists.txt deleted file mode 100644 index 26e471228fa..00000000000 --- a/tests/boards/nrf/ironside_se_boot_report/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(ironside_se_boot_report) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/boards/nrf/ironside_se_boot_report/prj.conf b/tests/boards/nrf/ironside_se_boot_report/prj.conf deleted file mode 100644 index b7db25411d0..00000000000 --- a/tests/boards/nrf/ironside_se_boot_report/prj.conf +++ /dev/null @@ -1 +0,0 @@ -# Empty diff --git a/tests/boards/nrf/ironside_se_boot_report/src/main.c b/tests/boards/nrf/ironside_se_boot_report/src/main.c deleted file mode 100644 index 2bcd4437bd1..00000000000 --- a/tests/boards/nrf/ironside_se_boot_report/src/main.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -int main(void) -{ - int err; - const struct ironside_se_boot_report *report; - - err = ironside_se_boot_report_get(&report); - printf("err: %d\n", err); - printf("version: 0x%x\n", report->ironside_se_version_int); - printf("extraversion: %s\n", report->ironside_se_extraversion); - - return 0; -} diff --git a/tests/boards/nrf/ironside_se_boot_report/testcase.yaml b/tests/boards/nrf/ironside_se_boot_report/testcase.yaml deleted file mode 100644 index cb6e2290e29..00000000000 --- a/tests/boards/nrf/ironside_se_boot_report/testcase.yaml +++ /dev/null @@ -1,19 +0,0 @@ -common: - tags: - - drivers - - hwinfo - harness: console - -tests: - soc.nordic.ironside_se_boot_report: - harness_config: - type: multi_line - ordered: true - regex: - - "err: 0" - - "version: 0x([0-9a-fA-F]+)" - - "extraversion: ([0-9a-fA-F]+)" - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp/iron - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp/iron From 2cb6c59d4c48b681225e5dacb6a9bbeec2ee576a Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Wed, 23 Apr 2025 08:32:14 +0200 Subject: [PATCH 10/18] [nrf fromtree] boards: nrf54h20dk: Add common files for iron board variants Define `ipc_conf_iron.dtsi` and `memory_map_iron.dtsi`. In the future, they will be merged with the base `ipc_conf.dtsi` and `memory_map.dtsi` respectively. For now, they are used to replace a few devicetree nodes when building for `nrf54h20dk/nrf54h20/*/iron` board targets. Additional changes are included: * The IPC configuration includes new "nordic,ironside-call" nodes. * The memory map includes an updated RAM20 layout. Its subregions are placed under the `/reserved-memory` node like before. * The memory map also includes an updated MRAM layout. Partitions are now placed under a plain "fixed-partitions" node. MCUboot-specific node labels are applied in `cpuapp.dts`. Signed-off-by: Grzegorz Swiderski (cherry picked from commit d3704516b7466f3bba37fb117eae0057fa5a24db) --- .../nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi | 30 +++++ .../nrf54h20dk_nrf54h20-memory_map_iron.dtsi | 104 ++++++++++++++++++ .../nrf54h20dk_nrf54h20_cpuapp_iron.dts | 48 +++----- 3 files changed, 149 insertions(+), 33 deletions(-) create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi new file mode 100644 index 00000000000..a44db40538d --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is to be merged with the original ipc_conf.dtsi in the future. */ + +/ { + ipc { + /delete-node/ ipc-1-2; + /delete-node/ ipc-1-3; + + cpusec_cpuapp_ipc: ipc-1-2 { + compatible = "nordic,ironside-call"; + memory-region = <&cpusec_cpuapp_ipc_shm>; + mboxes = <&cpusec_bellboard 12>, + <&cpuapp_bellboard 0>; + status = "disabled"; + }; + + cpusec_cpurad_ipc: ipc-1-3 { + compatible = "nordic,ironside-call"; + memory-region = <&cpusec_cpurad_ipc_shm>; + mboxes = <&cpusec_bellboard 18>, + <&cpurad_bellboard 0>; + status = "disabled"; + }; + }; +}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi new file mode 100644 index 00000000000..2977e83758b --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is to be merged with the original memory_map.dtsi in the future. + * The following nodes will be replaced: + */ +/delete-node/ &cpuapp_cpusec_ipc_shm; +/delete-node/ &cpuapp_cpusys_ipc_shm; +/delete-node/ &cpurad_cpusec_ipc_shm; +/delete-node/ &cpurad_cpusys_ipc_shm; +/delete-node/ &cpusec_cpuapp_ipc_shm; +/delete-node/ &cpusec_cpurad_ipc_shm; +/delete-node/ &cpusys_cpuapp_ipc_shm; +/delete-node/ &cpusys_cpurad_ipc_shm; +/delete-node/ &cpuapp_rw_partitions; +/delete-node/ &cpuapp_rx_partitions; +/delete-node/ &cpurad_rx_partitions; + +/ { + reserved-memory { + cpuapp_cpusys_ipc_shm: memory@2f88f600 { + reg = <0x2f88f600 0x80>; + }; + + cpusys_cpuapp_ipc_shm: memory@2f88f680 { + reg = <0x2f88f680 0x80>; + }; + + cpurad_cpusys_ipc_shm: memory@2f88f700 { + reg = <0x2f88f700 0x80>; + }; + + cpusys_cpurad_ipc_shm: memory@2f88f780 { + reg = <0x2f88f780 0x80>; + }; + + cpusec_cpurad_ipc_shm: memory@2f88f800 { + reg = <0x2f88f800 0x80>; + }; + + cpurad_ironside_se_event_report: memory@2f88f880 { + reg = <0x2f88f880 0x100>; + }; + + cpurad_ironside_se_boot_report: memory@2f88f980 { + reg = <0x2f88f980 0x200>; + }; + + cpusec_cpuapp_ipc_shm: memory@2f88fb80 { + reg = <0x2f88fb80 0x80>; + }; + + cpuapp_ironside_se_event_report: memory@2f88fc00 { + reg = <0x2f88fc00 0x100>; + }; + + cpuapp_ironside_se_boot_report: memory@2f88fd00 { + reg = <0x2f88fd00 0x200>; + }; + }; +}; + +&mram1x { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_boot_partition: partition@2c000 { + reg = <0x2c000 DT_SIZE_K(64)>; + }; + + cpuapp_slot0_partition: partition@3c000 { + reg = <0x3c000 DT_SIZE_K(336)>; + }; + + cpurad_slot0_partition: partition@90000 { + reg = <0x90000 DT_SIZE_K(336)>; + }; + + cpuppr_code_partition: partition@e4000 { + reg = <0xe4000 DT_SIZE_K(64)>; + }; + + cpuflpr_code_partition: partition@f4000 { + reg = <0xf4000 DT_SIZE_K(48)>; + }; + + cpuapp_slot1_partition: partition@100000 { + reg = <0x100000 DT_SIZE_K(336)>; + }; + + cpurad_slot1_partition: partition@154000 { + reg = <0x154000 DT_SIZE_K(336)>; + }; + + storage_partition: partition@1a8000 { + reg = <0x1a8000 DT_SIZE_K(40)>; + }; + }; +}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts index 54e3014adea..dbd20dafc85 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts @@ -5,13 +5,10 @@ */ #include "nrf54h20dk_nrf54h20_cpuapp.dts" +#include "nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi" +#include "nrf54h20dk_nrf54h20-memory_map_iron.dtsi" -/delete-node/&cpurad_rx_partitions; -/delete-node/&cpuapp_rx_partitions; - -/* This is not yet an exhaustive memory map, and contain only a minimum required to boot - * the application core. - */ +/delete-node/ &cpusec_cpurad_ipc; / { chosen { @@ -20,34 +17,19 @@ }; }; -&mram1x { - cpuapp_rx_partitions: cpuapp-rx-partitions { - compatible = "nordic,owned-partitions", "fixed-partitions"; - nordic,access = ; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@2c000 { - label = "mcuboot"; - reg = <0x2c000 DT_SIZE_K(64)>; - }; - - slot0_partition: partition@3c000 { - label = "image-0"; - reg = <0x3c000 DT_SIZE_K(200)>; - }; +&cpusec_cpuapp_ipc { + mbox-names = "tx", "rx"; + status = "okay"; +}; - slot1_partition: partition@6E000 { - label = "image-1"; - reg = <0x6E000 DT_SIZE_K(200)>; - }; +boot_partition: &cpuapp_boot_partition { + label = "mcuboot"; +}; - cpuppr_code_partition: partition@a4000 { - reg = <0xa4000 DT_SIZE_K(64)>; - }; +slot0_partition: &cpuapp_slot0_partition { + label = "image-0"; +}; - cpuflpr_code_partition: partition@b4000 { - reg = <0xb4000 DT_SIZE_K(48)>; - }; - }; +slot1_partition: &cpuapp_slot1_partition { + label = "image-1"; }; From 88b2d4a71dd4cf99aca6bd69f69c5a026f1025d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 1 May 2025 11:48:00 +0200 Subject: [PATCH 11/18] [nrf fromtree] boards: nordic: add 'iron' board variant for radio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed for next generation Secure Domain firmware. Signed-off-by: Sebastian Bøe Signed-off-by: Jonathan Nilsen (cherry picked from commit 2ba5d469f84e1c1cdc250f09b2940dd34176dbdc) --- boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk | 6 ++-- boards/nordic/nrf54h20dk/board.cmake | 6 ++-- boards/nordic/nrf54h20dk/board.yml | 2 ++ .../nrf54h20dk_nrf54h20_cpurad_iron.dts | 21 ++++++++++++++ ...nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml | 20 +++++++++++++ .../nrf54h20dk_nrf54h20_cpurad_iron_defconfig | 28 +++++++++++++++++++ 6 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig diff --git a/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk b/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk index de513858e9c..c509f968db6 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk +++ b/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk @@ -4,9 +4,11 @@ config BOARD_NRF54H20DK select SOC_NRF54H20_CPUAPP if (BOARD_NRF54H20DK_NRF54H20_CPUAPP || \ BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON) - select SOC_NRF54H20_CPURAD if BOARD_NRF54H20DK_NRF54H20_CPURAD + select SOC_NRF54H20_CPURAD if (BOARD_NRF54H20DK_NRF54H20_CPURAD || \ + BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON) select SOC_NRF54H20_CPUPPR if (BOARD_NRF54H20DK_NRF54H20_CPUPPR || \ BOARD_NRF54H20DK_NRF54H20_CPUPPR_XIP) select SOC_NRF54H20_CPUFLPR if (BOARD_NRF54H20DK_NRF54H20_CPUFLPR || \ BOARD_NRF54H20DK_NRF54H20_CPUFLPR_XIP) - select SOC_NRF54H20_IRON if BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON + select SOC_NRF54H20_IRON if (BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON || \ + BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON) diff --git a/boards/nordic/nrf54h20dk/board.cmake b/boards/nordic/nrf54h20dk/board.cmake index 5ad6557c003..093155e9322 100644 --- a/boards/nordic/nrf54h20dk/board.cmake +++ b/boards/nordic/nrf54h20dk/board.cmake @@ -2,8 +2,10 @@ include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) -if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD - OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON) +if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD OR + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON OR + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON) if(CONFIG_SOC_NRF54H20_CPUAPP) set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuapp.JLinkScript) else() diff --git a/boards/nordic/nrf54h20dk/board.yml b/boards/nordic/nrf54h20dk/board.yml index 2009cc6130b..a54cf1ae549 100644 --- a/boards/nordic/nrf54h20dk/board.yml +++ b/boards/nordic/nrf54h20dk/board.yml @@ -11,6 +11,8 @@ board: cpucluster: cpuflpr - name: iron cpucluster: cpuapp + - name: iron + cpucluster: cpurad revision: format: major.minor.patch default: "0.9.0" diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts new file mode 100644 index 00000000000..669143a79da --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54h20dk_nrf54h20_cpurad.dts" +#include "nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi" +#include "nrf54h20dk_nrf54h20-memory_map_iron.dtsi" + +/ { + chosen { + zephyr,code-partition = &cpurad_slot0_partition; + zephyr,uart-mcumgr = &uart135; + }; +}; + +&cpusec_cpurad_ipc { + mbox-names = "tx", "rx"; + status = "okay"; +}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml new file mode 100644 index 00000000000..ef71cfa924c --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml @@ -0,0 +1,20 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +identifier: nrf54h20dk/nrf54h20/cpurad/iron +name: nRF54H20-DK-nRF54H20-Radio (IRONside SE compatible) (revision 0.9.0) +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +sysbuild: true +ram: 192 +flash: 336 +supported: + - counter + - gpio + - pwm + - retained_mem + - spi diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig new file mode 100644 index 00000000000..0ee0a96f99d --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig @@ -0,0 +1,28 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_USE_DT_CODE_PARTITION=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# MPU-based null-pointer dereferencing detection cannot be applied +# as the (0x0 - 0x400) region is unmapped for this target. +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y + +# Enable cache +CONFIG_CACHE_MANAGEMENT=y +CONFIG_EXTERNAL_CACHE=y + +# UICR generation is not supported, and when reintroduced will not use nrf-regtool. +CONFIG_NRF_REGTOOL_GENERATE_UICR=n From 5caf876f4b1c75f684eea967ba7bbd3c2c08a0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 1 May 2025 11:49:05 +0200 Subject: [PATCH 12/18] [nrf fromtree] soc: nrf54: Port SYS_INIT to use soc_early_init_hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port SYS_INIT to use soc_early_init_hook as SYS_INITs are legacy. Due to moving dmm_init() from PRE_KERNEL_1 SYS_INIT to soc_early_init_hook(), the DMM test is also updated to ensure that its setup function runs before dmm_init(). Signed-off-by: Sebastian Bøe Signed-off-by: Jonathan Nilsen (cherry picked from commit c0c4170c42ca689f96969f948e7c44173777dd97) --- soc/nordic/nrf54h/Kconfig | 1 + soc/nordic/nrf54h/soc.c | 10 ++-------- tests/boards/nrf/dmm/src/main.c | 3 ++- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 0373e00d07b..55dbbc7116f 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -7,6 +7,7 @@ config SOC_SERIES_NRF54HX select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS + select SOC_EARLY_INIT_HOOK if ARM select NRF_PLATFORM_HALTIUM config SOC_NRF54H20_CPUAPP_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 6dc8100e00c..ad2da0b30bf 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -126,7 +126,7 @@ bool z_arm_on_enter_cpu_idle(void) } #endif -static int nordicsemi_nrf54h_init(void) +void soc_early_init_hook(void) { int err; @@ -138,9 +138,7 @@ static int nordicsemi_nrf54h_init(void) trim_hsfll(); err = dmm_init(); - if (err < 0) { - return err; - } + __ASSERT_NO_MSG(err == 0); #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ccm030)) /* DMASEC is set to non-secure by default, which prevents CCM from @@ -156,13 +154,9 @@ static int nordicsemi_nrf54h_init(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } - - return 0; } void arch_busy_wait(uint32_t time_us) { nrfx_coredep_delay_us(time_us); } - -SYS_INIT(nordicsemi_nrf54h_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 078edcdd39f..214a9069752 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -228,4 +228,5 @@ int dmm_test_prepare(void) return 0; } -SYS_INIT(dmm_test_prepare, PRE_KERNEL_1, 0); +/* Needs to execute before DMM initialization. */ +SYS_INIT(dmm_test_prepare, EARLY, 0); From 410342c2eb3ba52491d2e4e2e00fb61f4f5526d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 1 May 2025 11:49:18 +0200 Subject: [PATCH 13/18] [nrf fromtree] drivers: firmware: nrf_ironside: add IRONside CPUCONF service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an IPC service API for booting local domain cores. Signed-off-by: Sebastian Bøe Signed-off-by: Jonathan Nilsen (cherry picked from commit 14a47cbe05d462b85d6e501d4d6ca9103a9afa74) --- drivers/firmware/nrf_ironside/CMakeLists.txt | 2 + drivers/firmware/nrf_ironside/Kconfig | 12 +++ drivers/firmware/nrf_ironside/cpuconf.c | 59 +++++++++++++++ .../drivers/firmware/nrf_ironside/cpuconf.h | 74 +++++++++++++++++++ 4 files changed, 147 insertions(+) create mode 100644 drivers/firmware/nrf_ironside/cpuconf.c create mode 100644 include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h diff --git a/drivers/firmware/nrf_ironside/CMakeLists.txt b/drivers/firmware/nrf_ironside/CMakeLists.txt index 90320c62df5..8f31acfef00 100644 --- a/drivers/firmware/nrf_ironside/CMakeLists.txt +++ b/drivers/firmware/nrf_ironside/CMakeLists.txt @@ -4,3 +4,5 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) + +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c) diff --git a/drivers/firmware/nrf_ironside/Kconfig b/drivers/firmware/nrf_ironside/Kconfig index 20545669e92..86c94d3a2ad 100644 --- a/drivers/firmware/nrf_ironside/Kconfig +++ b/drivers/firmware/nrf_ironside/Kconfig @@ -26,3 +26,15 @@ config NRF_IRONSIDE_CALL_INIT_PRIORITY but higher than the priority of any feature that selects NRF_IRONSIDE_CALL. endif # NRF_IRONSIDE_CALL + +menu "Nordic IRONside services" + depends on SOC_NRF54H20_IRON + +config NRF_IRONSIDE_CPUCONF_SERVICE + bool "IRONside CPUCONF service" + depends on SOC_NRF54H20_CPUAPP + select NRF_IRONSIDE_CALL + help + Service used to boot local domain cores. + +endmenu diff --git a/drivers/firmware/nrf_ironside/cpuconf.c b/drivers/firmware/nrf_ironside/cpuconf.c new file mode 100644 index 00000000000..a8377ae0f93 --- /dev/null +++ b/drivers/firmware/nrf_ironside/cpuconf.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +#include +#include + +#include +#include + +#define CPU_PARAMS_CPU_OFFSET (0) +#define CPU_PARAMS_CPU_MASK (0xF) +#define CPU_PARAMS_WAIT_BIT BIT(4) + +int ironside_cpuconf(NRF_PROCESSORID_Type cpu, const void *vector_table, bool cpu_wait, + const uint8_t *msg, size_t msg_size) +{ + int err; + struct ironside_call_buf *buf; + uint8_t *buf_msg; + + if (msg_size > IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE) { + return -IRONSIDE_CPUCONF_ERROR_MESSAGE_TOO_LARGE; + } + + buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_CPUCONF_V0; + + buf->args[IRONSIDE_CPUCONF_SERVICE_CPU_PARAMS_IDX] = + (((uint32_t)cpu << CPU_PARAMS_CPU_OFFSET) & CPU_PARAMS_CPU_MASK) | + (cpu_wait ? CPU_PARAMS_WAIT_BIT : 0); + + buf->args[IRONSIDE_CPUCONF_SERVICE_VECTOR_TABLE_IDX] = (uint32_t)vector_table; + + buf_msg = (uint8_t *)&buf->args[IRONSIDE_CPUCONF_SERVICE_MSG_0]; + if (msg_size > 0) { + memcpy(buf_msg, msg, msg_size); + } + if (msg_size < IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE) { + memset(&buf_msg[msg_size], 0, IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE - msg_size); + } + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_CPUCONF_SERVICE_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} diff --git a/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h b/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h new file mode 100644 index 00000000000..e6f2150b6e2 --- /dev/null +++ b/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_ +#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_ + +#include +#include +#include +#include +#include + +/** + * @name CPUCONF service error codes. + * @{ + */ + +/** An invalid or unsupported processor ID was specified. */ +#define IRONSIDE_CPUCONF_ERROR_WRONG_CPU (1) +/** The boot message is too large to fit in the buffer. */ +#define IRONSIDE_CPUCONF_ERROR_MESSAGE_TOO_LARGE (2) + +/** + * @} + */ + +#define IRONSIDE_CALL_ID_CPUCONF_V0 2 + +enum { + IRONSIDE_CPUCONF_SERVICE_CPU_PARAMS_IDX, + IRONSIDE_CPUCONF_SERVICE_VECTOR_TABLE_IDX, + IRONSIDE_CPUCONF_SERVICE_MSG_0, + IRONSIDE_CPUCONF_SERVICE_MSG_1, + IRONSIDE_CPUCONF_SERVICE_MSG_2, + IRONSIDE_CPUCONF_SERVICE_MSG_3, + /* The last enum value is reserved for the number of arguments */ + IRONSIDE_CPUCONF_NUM_ARGS +}; + +/* Maximum size of the CPUCONF message parameter. */ +#define IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE (4 * sizeof(uint32_t)) + +/* IDX 0 is re-used by the error return code and the 'cpu' parameter. */ +#define IRONSIDE_CPUCONF_SERVICE_RETCODE_IDX 0 + +BUILD_ASSERT(IRONSIDE_CPUCONF_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); + +/** + * @brief Boot a local domain CPU + * + * @param cpu The CPU to be booted + * @param vector_table Pointer to the vector table used to boot the CPU. + * @param cpu_wait When this is true, the CPU will WAIT even if the CPU has clock. + * @param msg A message that can be placed in radiocore's boot report. + * @param msg_size Size of the message in bytes. + * + * @note cpu_wait is only intended to be enabled for debug purposes + * and it is only supported that a debugger resumes the CPU. + * + * @note the call always sends IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE message bytes. + * If the given msg_size is less than that, the remaining bytes are set to zero. + * + * @retval 0 on success or if the CPU has already booted. + * @retval Positive non-0 error status if reported by IRONside call. + * @retval -IRONSIDE_CPUCONF_ERROR_WRONG_CPU if cpu is unrecognized + * @retval -IRONSIDE_CPUCONF_ERROR_MESSAGE_TOO_LARGE if msg_size is greater than + * IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE. + */ +int ironside_cpuconf(NRF_PROCESSORID_Type cpu, const void *vector_table, bool cpu_wait, + const uint8_t *msg, size_t msg_size); + +#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_ */ From c286771c5e95cc954a6cd49f2906a6ea219c67d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 1 May 2025 11:49:29 +0200 Subject: [PATCH 14/18] [nrf fromtree] cpuconf: Boot the radiocore from the app in soc_late_init_hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Boot the radiocore from the app in soc_late_init_hook. Signed-off-by: Sebastian Bøe (cherry picked from commit d9499322348317a75237f0dfa69bea5b2b240aec) --- soc/nordic/nrf54h/Kconfig | 11 +++++++++++ soc/nordic/nrf54h/soc.c | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 55dbbc7116f..c0e619cd1e2 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -8,6 +8,7 @@ config SOC_SERIES_NRF54HX select HAS_NRFX select HAS_NORDIC_DRIVERS select SOC_EARLY_INIT_HOOK if ARM + select SOC_LATE_INIT_HOOK if SOC_NRF54H20_CPURAD_ENABLE select NRF_PLATFORM_HALTIUM config SOC_NRF54H20_CPUAPP_COMMON @@ -66,6 +67,16 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_PM select HAS_POWEROFF +config SOC_NRF54H20_CPURAD_ENABLE + bool "Boot the nRF54H20 Radio core" + default y if NRF_802154_SER_HOST + depends on SOC_NRF54H20_CPUAPP + select NRF_IRONSIDE_CPUCONF_SERVICE + help + This will at application boot time enable clock to the + Radiocore, and also power will be requested to the Radiocore + subsystem. The Radiocore will then start executing instructions. + config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index ad2da0b30bf..c1849ab3a23 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -22,6 +22,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -43,6 +44,8 @@ sys_snode_t soc_node; ADDRESS_DOMAIN_Msk | \ ADDRESS_BUS_Msk))) +#define DT_NODELABEL_CPURAD_SLOT0_PARTITION DT_NODELABEL(cpurad_slot0_partition) + static void power_domain_init(void) { /* @@ -156,6 +159,30 @@ void soc_early_init_hook(void) } } +#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) +void soc_late_init_hook(void) +{ + int err; + + /* The msg will be used for communication prior to IPC + * communication being set up. But at this moment no such + * communication is required. + */ + uint8_t *msg = NULL; + size_t msg_size = 0; + + void *radiocore_address = + (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL_CPURAD_SLOT0_PARTITION)) + + DT_REG_ADDR(DT_NODELABEL_CPURAD_SLOT0_PARTITION)); + + /* Don't wait as this is not yet supported. */ + bool cpu_wait = false; + + err = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, msg_size); + __ASSERT(err == 0, "err was %d", err); +} +#endif + void arch_busy_wait(uint32_t time_us) { nrfx_coredep_delay_us(time_us); From c5322ba53a6a7eb0574a18ed637c6bdeccede67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 1 May 2025 11:49:43 +0200 Subject: [PATCH 15/18] [nrf fromtree] samples: sysbuild: Add support for nrf54h20dk/nrf54h20/cpuapp/iron MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for nrf54h20dk/nrf54h20/cpuapp/iron to the samples/sysbuild/hello_world sample. Signed-off-by: Sebastian Bøe (cherry picked from commit afc83895f45e0ef81fd44fa945ea14e8dd1a9a81) --- .../hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf | 4 ++++ samples/sysbuild/hello_world/sample.yaml | 5 +++++ .../sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf | 1 + 3 files changed, 10 insertions(+) create mode 100644 samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf create mode 100644 samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf diff --git a/samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf b/samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf new file mode 100644 index 00000000000..ca2bc07e4f2 --- /dev/null +++ b/samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf @@ -0,0 +1,4 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y diff --git a/samples/sysbuild/hello_world/sample.yaml b/samples/sysbuild/hello_world/sample.yaml index cbc58e2a336..c8ca9cbe4c0 100644 --- a/samples/sysbuild/hello_world/sample.yaml +++ b/samples/sysbuild/hello_world/sample.yaml @@ -27,6 +27,11 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpurad.iron: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp/iron + extra_args: SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf + sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpuppr: platform_allow: - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf b/samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf new file mode 100644 index 00000000000..8d4a230adbe --- /dev/null +++ b/samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad/iron" From f33f26f3003d18e4c9e7aa4aeb48418474baf8f5 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 30 Apr 2025 11:48:57 +0200 Subject: [PATCH 16/18] [nrf fromtree] drivers: firmware: nrf_ironside: add IRONside update service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an IPC service API for triggering updates of the Nordic IRONside SE firmware using the IRONside call module. Co-authored-by: Håkon Amundsen Signed-off-by: Jonathan Nilsen (cherry picked from commit 51609f03802a74242e435688939a00a76eccebb9) --- drivers/firmware/nrf_ironside/CMakeLists.txt | 1 + drivers/firmware/nrf_ironside/Kconfig | 6 ++ drivers/firmware/nrf_ironside/update.c | 28 ++++++++ .../drivers/firmware/nrf_ironside/update.h | 72 +++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 drivers/firmware/nrf_ironside/update.c create mode 100644 include/zephyr/drivers/firmware/nrf_ironside/update.h diff --git a/drivers/firmware/nrf_ironside/CMakeLists.txt b/drivers/firmware/nrf_ironside/CMakeLists.txt index 8f31acfef00..d21a132d67d 100644 --- a/drivers/firmware/nrf_ironside/CMakeLists.txt +++ b/drivers/firmware/nrf_ironside/CMakeLists.txt @@ -6,3 +6,4 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c) +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c) diff --git a/drivers/firmware/nrf_ironside/Kconfig b/drivers/firmware/nrf_ironside/Kconfig index 86c94d3a2ad..97e3604bf72 100644 --- a/drivers/firmware/nrf_ironside/Kconfig +++ b/drivers/firmware/nrf_ironside/Kconfig @@ -37,4 +37,10 @@ config NRF_IRONSIDE_CPUCONF_SERVICE help Service used to boot local domain cores. +config NRF_IRONSIDE_UPDATE_SERVICE + bool "IRONside update service" + select NRF_IRONSIDE_CALL + help + Service used to update the IRONside SE firmware. + endmenu diff --git a/drivers/firmware/nrf_ironside/update.c b/drivers/firmware/nrf_ironside/update.c new file mode 100644 index 00000000000..8de21303b05 --- /dev/null +++ b/drivers/firmware/nrf_ironside/update.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +int ironside_update(const struct ironside_update_blob *update) +{ + int err; + struct ironside_call_buf *const buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_UPDATE_SERVICE_V0; + buf->args[IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX] = (uintptr_t)update; + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_UPDATE_SERVICE_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} diff --git a/include/zephyr/drivers/firmware/nrf_ironside/update.h b/include/zephyr/drivers/firmware/nrf_ironside/update.h new file mode 100644 index 00000000000..62191b3285b --- /dev/null +++ b/include/zephyr/drivers/firmware/nrf_ironside/update.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_UPDATE_H_ +#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_UPDATE_H_ + +#include +#include + +/** + * @name Update service error codes. + * @{ + */ + +/** Caller does not have access to the provided update candidate buffer. */ +#define IRONSIDE_UPDATE_ERROR_NOT_PERMITTED (1) +/** Failed to write the update metadata to SICR. */ +#define IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED (2) + +/** + * @} + */ + +/** Length of the update manifest in bytes */ +#define IRONSIDE_UPDATE_MANIFEST_LENGTH (256) +/** Length of the update public key in bytes. */ +#define IRONSIDE_UPDATE_PUBKEY_LENGTH (32) +/** Length of the update signature in bytes. */ +#define IRONSIDE_UPDATE_SIGNATURE_LENGTH (64) + +/* IRONside call identifiers with implicit versions. + * + * With the initial "version 0", the service ABI is allowed to break until the + * first production release of IRONside SE. + */ +#define IRONSIDE_CALL_ID_UPDATE_SERVICE_V0 1 + +/* Index of the update blob pointer within the service buffer. */ +#define IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX (0) +/* Index of the return code within the service buffer. */ +#define IRONSIDE_UPDATE_SERVICE_RETCODE_IDX (0) + +/** + * @brief IRONside update blob. + */ +struct ironside_update_blob { + uint8_t manifest[IRONSIDE_UPDATE_MANIFEST_LENGTH]; + uint8_t pubkey[IRONSIDE_UPDATE_PUBKEY_LENGTH]; + uint8_t signature[IRONSIDE_UPDATE_SIGNATURE_LENGTH]; + uint32_t firmware[]; +}; + +/** + * @brief Request a firmware upgrade of the IRONside SE. + * + * This invokes the IRONside SE update service. The device must be restarted for the update + * to be installed. Check the update status in the application boot report to see if the update + * was successfully installed. + * + * @param update Pointer to update blob + * + * @retval -IRONSIDE_UPDATE_ERROR_NOT_PERMITTED if missing access to the update candidate. + * @retval -IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED if writing update parameters to SICR failed. + * @returns Positive non-0 error status if reported by IRONside call. + * @returns 0 on a successful request (although the update itself may still fail). + * + */ +int ironside_update(const struct ironside_update_blob *update); + +#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_UPDATE_H_ */ From 3c47c6cff92aaeba9615badc46e14c989ef9b0a7 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 30 Apr 2025 15:44:02 +0200 Subject: [PATCH 17/18] [nrf fromtree] samples: boards: nordic: add sample for nrf_ironside update service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a sample demonstrating how to use the IRONside update service to update the IRONside SE firmware on the nrf54h20dk/nrf54h20/cpuapp/iron board. Co-authored-by: Håkon Amundsen Signed-off-by: Jonathan Nilsen (cherry picked from commit eb7b9781b29c2aba4bf32af6775b76af7377016d) --- .../nordic/nrf_ironside/update/CMakeLists.txt | 10 +++ .../boards/nordic/nrf_ironside/update/Kconfig | 11 +++ .../nordic/nrf_ironside/update/README.rst | 74 +++++++++++++++++++ .../nordic/nrf_ironside/update/prj.conf | 3 + .../nordic/nrf_ironside/update/sample.yaml | 12 +++ .../nordic/nrf_ironside/update/src/main.c | 31 ++++++++ 6 files changed, 141 insertions(+) create mode 100644 samples/boards/nordic/nrf_ironside/update/CMakeLists.txt create mode 100644 samples/boards/nordic/nrf_ironside/update/Kconfig create mode 100644 samples/boards/nordic/nrf_ironside/update/README.rst create mode 100644 samples/boards/nordic/nrf_ironside/update/prj.conf create mode 100644 samples/boards/nordic/nrf_ironside/update/sample.yaml create mode 100644 samples/boards/nordic/nrf_ironside/update/src/main.c diff --git a/samples/boards/nordic/nrf_ironside/update/CMakeLists.txt b/samples/boards/nordic/nrf_ironside/update/CMakeLists.txt new file mode 100644 index 00000000000..b3aa8c35c2a --- /dev/null +++ b/samples/boards/nordic/nrf_ironside/update/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +project(ironside_se_update) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/boards/nordic/nrf_ironside/update/Kconfig b/samples/boards/nordic/nrf_ironside/update/Kconfig new file mode 100644 index 00000000000..702b943ff60 --- /dev/null +++ b/samples/boards/nordic/nrf_ironside/update/Kconfig @@ -0,0 +1,11 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config UPDATE_BLOB_ADDRESS + hex "Address of the update blob" + default 0xe100000 + help + Address of the update blob. The default value matches the placement of the + update blobs delivered with the IRONside SE firmware. + +source "Kconfig.zephyr" diff --git a/samples/boards/nordic/nrf_ironside/update/README.rst b/samples/boards/nordic/nrf_ironside/update/README.rst new file mode 100644 index 00000000000..2f44feedf06 --- /dev/null +++ b/samples/boards/nordic/nrf_ironside/update/README.rst @@ -0,0 +1,74 @@ +.. zephyr:code-sample:: nrf_ironside_update + :name: Nordic IRONside SE firmware update + + Update the Nordic IRONside SE firmware. + +Overview +******** + +The Nordic IRONside SE Update sample updates the IRONside SE firmware on a SoC that already has IRONside SE installed. +It can update both the main image and the recovery image of IRONside SE using the IRONside SE firmware release ZIP file. + +Update procedure +**************** + +The update procedure works as follows: + +1. The application invokes the IRONside SE update service and passes the parameters that correspond to the location of the HEX file of the IRONside SE firmware update. + +#. The application prints the return value of the service call and outputs information from the update HEX file. + +#. After the service call completes, the IRONside SE firmware updates the internal state of the device. + +#. The firmware installs the update during the next device boot. + This operation can take several seconds. + +Once the operation has completed, you can read the boot report to verify that the update has taken place. + +Building and running the application for nrf54h20dk/nrf54h20/cpuapp/iron +************************************************************************ + +.. note:: + You can use this application only when there is already a version of IRONside SE installed on the device. + +1. Unzip the IRONside SE release ZIP to get the update hex file: + + .. code-block:: console + + unzip nrf54h20_soc_binaries_v.*.zip + +#. Program the appropriate update hex file from the release ZIP using one (not both) of the following commands: + + a) To update IRONside SE firmware: + + .. code-block:: console + + nrfutil device program --traits jlink --firmware update/ironside_se_update.hex + + b) To update IRONside SE recovery firmware: + + .. code-block:: console + + nrfutil device program --traits jlink --firmware update/ironside_se_recovery_update.hex + +#. Build and program the application: + + .. zephyr-app-commands:: + :zephyr-app: samples/boards/nordic/nrf_ironside/update + :board: nrf54h20dk/nrf54h20/cpuapp/iron + :goals: flash + +#. Trigger a reset: + +.. code-block:: console + + nrfutil device reset --reset-kind RESET_PIN --traits jlink + +#. Check that the new version is installed: + + .. code-block:: console + + # Read the version fields from the boot report + nrfutil x-read --direct --address 0x2f88fd04 --bytes 16 --traits jlink + # Read the update status in the boot report + nrfutil x-read --direct --address 0x2f88fd24 --bytes 4 --traits jlink diff --git a/samples/boards/nordic/nrf_ironside/update/prj.conf b/samples/boards/nordic/nrf_ironside/update/prj.conf new file mode 100644 index 00000000000..8682307eca6 --- /dev/null +++ b/samples/boards/nordic/nrf_ironside/update/prj.conf @@ -0,0 +1,3 @@ +CONFIG_LOG=y + +CONFIG_NRF_IRONSIDE_UPDATE_SERVICE=y diff --git a/samples/boards/nordic/nrf_ironside/update/sample.yaml b/samples/boards/nordic/nrf_ironside/update/sample.yaml new file mode 100644 index 00000000000..af3c24624b8 --- /dev/null +++ b/samples/boards/nordic/nrf_ironside/update/sample.yaml @@ -0,0 +1,12 @@ +sample: + name: Nordic IRONside SE update service + description: Demonstrates how to update the Nordic IRONside SE firmware +common: + build_only: true + tags: nrf_ironside + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp/iron + +tests: + sample.boards.nordic.nrf_ironside.update: + platform_allow: nrf54h20dk/nrf54h20/cpuapp/iron diff --git a/samples/boards/nordic/nrf_ironside/update/src/main.c b/samples/boards/nordic/nrf_ironside/update/src/main.c new file mode 100644 index 00000000000..09513497de9 --- /dev/null +++ b/samples/boards/nordic/nrf_ironside/update/src/main.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +LOG_MODULE_REGISTER(app, LOG_LEVEL_INF); + +int main(void) +{ + int err; + const struct ironside_update_blob *update = (void *)CONFIG_UPDATE_BLOB_ADDRESS; + + err = ironside_update(update); + LOG_INF("IRONside update retval: 0x%x", err); + + if (err == 0) { + LOG_HEXDUMP_INF(update->manifest, sizeof(update->manifest), "Update manifest:"); + LOG_HEXDUMP_INF(update->pubkey, sizeof(update->pubkey), "Public key:"); + LOG_HEXDUMP_INF(update->signature, sizeof(update->signature), "Signature:"); + LOG_HEXDUMP_INF(update->firmware, 8, "First 8 bytes of encrypted fw:"); + LOG_INF("Reboot the device to trigger the update"); + } else { + LOG_ERR("The request to update failed"); + } + + return 0; +} From 854e3074f1b92aa5a06621e5fd5ce019a072f526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Amundsen?= Date: Tue, 27 May 2025 07:13:02 +0200 Subject: [PATCH 18/18] [nrf fromlist] drivers: firmware: add IRONside boot report MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream PR #: 90569 The boot report is used to pass information from IRONside to a CPU being booted. Integrate the boot report to the update service sample. Signed-off-by: Håkon Amundsen --- .../nrf54h20dk_nrf54h20_cpuapp_iron.dts | 2 + drivers/firmware/nrf_ironside/CMakeLists.txt | 1 + drivers/firmware/nrf_ironside/Kconfig | 7 ++ drivers/firmware/nrf_ironside/boot_report.c | 23 ++++++ .../firmware/nrf_ironside/boot_report.h | 77 +++++++++++++++++++ .../nordic/nrf_ironside/update/prj.conf | 1 + .../nordic/nrf_ironside/update/src/main.c | 13 ++++ 7 files changed, 124 insertions(+) create mode 100644 drivers/firmware/nrf_ironside/boot_report.c create mode 100644 include/zephyr/drivers/firmware/nrf_ironside/boot_report.h diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts index dbd20dafc85..d455e200b0b 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts @@ -22,6 +22,8 @@ status = "okay"; }; +ironside_se_boot_report: &cpuapp_ironside_se_boot_report {}; + boot_partition: &cpuapp_boot_partition { label = "mcuboot"; }; diff --git a/drivers/firmware/nrf_ironside/CMakeLists.txt b/drivers/firmware/nrf_ironside/CMakeLists.txt index d21a132d67d..bc2adf842ed 100644 --- a/drivers/firmware/nrf_ironside/CMakeLists.txt +++ b/drivers/firmware/nrf_ironside/CMakeLists.txt @@ -5,5 +5,6 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOT_REPORT boot_report.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c) diff --git a/drivers/firmware/nrf_ironside/Kconfig b/drivers/firmware/nrf_ironside/Kconfig index 97e3604bf72..e009df4df05 100644 --- a/drivers/firmware/nrf_ironside/Kconfig +++ b/drivers/firmware/nrf_ironside/Kconfig @@ -43,4 +43,11 @@ config NRF_IRONSIDE_UPDATE_SERVICE help Service used to update the IRONside SE firmware. +config NRF_IRONSIDE_BOOT_REPORT + bool "IRONside boot report" + depends on $(dt_nodelabel_exists,ironside_se_boot_report) + select NRF_IRONSIDE + help + Support for parsing the Boot Report populated by Nordic IRONside firmware. + endmenu diff --git a/drivers/firmware/nrf_ironside/boot_report.c b/drivers/firmware/nrf_ironside/boot_report.c new file mode 100644 index 00000000000..ee3e5ff3042 --- /dev/null +++ b/drivers/firmware/nrf_ironside/boot_report.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +#define IRONSIDE_SE_BOOT_REPORT_ADDR DT_REG_ADDR(DT_NODELABEL(ironside_se_boot_report)) + +int ironside_boot_report_get(const struct ironside_boot_report **report) +{ + const struct ironside_boot_report *tmp_report = (void *)IRONSIDE_SE_BOOT_REPORT_ADDR; + + if (tmp_report->magic != IRONSIDE_BOOT_REPORT_MAGIC) { + return -EINVAL; + } + + *report = tmp_report; + + return 0; +} diff --git a/include/zephyr/drivers/firmware/nrf_ironside/boot_report.h b/include/zephyr/drivers/firmware/nrf_ironside/boot_report.h new file mode 100644 index 00000000000..8a209b8788d --- /dev/null +++ b/include/zephyr/drivers/firmware/nrf_ironside/boot_report.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_BOOT_REPORT_H_ +#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_BOOT_REPORT_H_ + +#include +#include + +/** Constant used to check if an Nordic IRONside SE boot report has been written. */ +#define IRONSIDE_BOOT_REPORT_MAGIC (0x4d69546fUL) +/** Length of the local domain context buffer in bytes. */ +#define IRONSIDE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE (16UL) +/** Length of the random data buffer in bytes. */ +#define IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE (32UL) + +/** @brief IRONside version structure. */ +struct ironside_version { + /** Wrapping sequence number ranging from 1-126, incremented for each release. */ + uint8_t seqnum; + /** Path version. */ + uint8_t patch; + /** Minor version. */ + uint8_t minor; + /** Major version. */ + uint8_t major; + /** Human readable extraversion string. */ + char extraversion[12]; +}; + +/** @brief UICR error description contained in the boot report. */ +struct ironside_boot_report_uicr_error { + /** The type of error. A value of 0 indicates no error */ + uint32_t error_type; + /** Error descriptions specific to each type of UICR error */ + union { + /** RFU */ + struct { + uint32_t rfu[4]; + } rfu; + } description; +}; + +/** @brief IRONside boot report. */ +struct ironside_boot_report { + /** Magic value used to identify valid boot report */ + uint32_t magic; + /** Firmware version of IRONside SE. */ + struct ironside_version ironside_se_version; + /** Firmware version of IRONside SE recovery firmware. */ + struct ironside_version ironside_se_recovery_version; + /** Copy of SICR.UROT.UPDATE.STATUS.*/ + uint32_t ironside_update_status; + /** See @ref ironside_boot_report_uicr_error */ + struct ironside_boot_report_uicr_error uicr_error_description; + /** Data passed from booting local domain to local domain being booted */ + uint8_t local_domain_context[IRONSIDE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE]; + /** CSPRNG data */ + uint8_t random_data[IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE]; + /** Reserved for Future Use */ + uint32_t rfu[64]; +}; + +/** + * @brief Get a pointer to the IRONside boot report. + * + * @param[out] report Will be set to point to the IRONside boot report. + * + * @retval 0 if successful. + * @retval -EFAULT if the magic field in the report is incorrect. + * @retval -EINVAL if @p report is NULL. + */ +int ironside_boot_report_get(const struct ironside_boot_report **report); + +#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_BOOT_REPORT_H_ */ diff --git a/samples/boards/nordic/nrf_ironside/update/prj.conf b/samples/boards/nordic/nrf_ironside/update/prj.conf index 8682307eca6..1d6a2ac823d 100644 --- a/samples/boards/nordic/nrf_ironside/update/prj.conf +++ b/samples/boards/nordic/nrf_ironside/update/prj.conf @@ -1,3 +1,4 @@ CONFIG_LOG=y CONFIG_NRF_IRONSIDE_UPDATE_SERVICE=y +CONFIG_NRF_IRONSIDE_BOOT_REPORT=y diff --git a/samples/boards/nordic/nrf_ironside/update/src/main.c b/samples/boards/nordic/nrf_ironside/update/src/main.c index 09513497de9..a06603ca9b2 100644 --- a/samples/boards/nordic/nrf_ironside/update/src/main.c +++ b/samples/boards/nordic/nrf_ironside/update/src/main.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include @@ -13,6 +14,18 @@ int main(void) { int err; const struct ironside_update_blob *update = (void *)CONFIG_UPDATE_BLOB_ADDRESS; + const struct ironside_boot_report *report; + + err = ironside_boot_report_get(&report); + LOG_INF("ironside_boot_report_get err: %d", err); + LOG_INF("version: %d.%d.%d-%s+%d", report->ironside_se_version.major, + report->ironside_se_version.minor, report->ironside_se_version.patch, + report->ironside_se_version.extraversion, report->ironside_se_version.seqnum); + LOG_INF("recovery version: %d.%d.%d-%s+%d", report->ironside_se_version.major, + report->ironside_se_version.minor, report->ironside_se_version.patch, + report->ironside_se_version.extraversion, report->ironside_se_version.seqnum); + LOG_INF("update status: 0x%x", report->ironside_update_status); + LOG_HEXDUMP_INF((void *)report->random_data, sizeof(report->random_data), "random data"); err = ironside_update(update); LOG_INF("IRONside update retval: 0x%x", err);