Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8426fc0
Revert "[nrf noup] drivers: firmware: nrf_ironside: add IRONside upda…
jonathannilsen May 28, 2025
bcb9871
Revert "[nrf fromlist] samples: boards: nordic: add sample for nrf_ir…
jonathannilsen May 28, 2025
ada86d3
Revert "[nrf fromlist] samples: sysbuild: Add support for nrf54h20dk/…
jonathannilsen May 28, 2025
abebeed
Revert "[nrf fromlist] cpuconf: Boot the radiocore from the app in so…
jonathannilsen May 28, 2025
31998f1
Revert "[nrf fromlist] drivers: firmware: nrf_ironside: add IRONside …
jonathannilsen May 28, 2025
3306c87
Revert "[nrf fromlist] soc: nrf54: Port SYS_INIT to use soc_early_ini…
jonathannilsen May 28, 2025
1fc99b4
Revert "[nrf fromlist] boards: nordic: add 'iron' board variant for r…
jonathannilsen May 28, 2025
9d3ecae
Revert "[nrf noup] boards: nrf54h20dk: Add common files for iron boar…
jonathannilsen May 28, 2025
8199d81
Revert "[nrf fromlist] soc: add ironside boot report"
jonathannilsen May 28, 2025
2cb6c59
[nrf fromtree] boards: nrf54h20dk: Add common files for iron board va…
57300 Apr 23, 2025
88b2d4a
[nrf fromtree] boards: nordic: add 'iron' board variant for radio
SebastianBoe May 1, 2025
5caf876
[nrf fromtree] soc: nrf54: Port SYS_INIT to use soc_early_init_hook
SebastianBoe May 1, 2025
410342c
[nrf fromtree] drivers: firmware: nrf_ironside: add IRONside CPUCONF …
SebastianBoe May 1, 2025
c286771
[nrf fromtree] cpuconf: Boot the radiocore from the app in soc_late_i…
SebastianBoe May 1, 2025
c5322ba
[nrf fromtree] samples: sysbuild: Add support for nrf54h20dk/nrf54h20…
SebastianBoe May 1, 2025
f33f26f
[nrf fromtree] drivers: firmware: nrf_ironside: add IRONside update s…
jonathannilsen Apr 30, 2025
3c47c6c
[nrf fromtree] samples: boards: nordic: add sample for nrf_ironside u…
jonathannilsen Apr 30, 2025
854e307
[nrf fromlist] drivers: firmware: add IRONside boot report
hakonfam May 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
status = "okay";
};

ironside_se_boot_report: &cpuapp_ironside_se_boot_report {};

boot_partition: &cpuapp_boot_partition {
label = "mcuboot";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
};
};


&cpusec_cpurad_ipc {
mbox-names = "tx", "rx";
status = "okay";
Expand Down
1 change: 1 addition & 0 deletions drivers/firmware/nrf_ironside/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 7 additions & 0 deletions drivers/firmware/nrf_ironside/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 23 additions & 0 deletions drivers/firmware/nrf_ironside/boot_report.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/

#include <errno.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/firmware/nrf_ironside/boot_report.h>

#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;
}
33 changes: 26 additions & 7 deletions drivers/firmware/nrf_ironside/cpuconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,38 @@
#include <zephyr/drivers/firmware/nrf_ironside/call.h>
#include <zephyr/drivers/firmware/nrf_ironside/cpuconf.h>

int ironside_cpuconf(NRF_PROCESSORID_Type cpu, void *vector_table, bool cpu_wait, uint8_t *msg,
size_t msg_size)
#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 *const buf = ironside_call_alloc();
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_IDX] = cpu;
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->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;

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);

Expand Down
77 changes: 77 additions & 0 deletions include/zephyr/drivers/firmware/nrf_ironside/boot_report.h
Original file line number Diff line number Diff line change
@@ -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 <stdint.h>
#include <stddef.h>

/** 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_ */
33 changes: 22 additions & 11 deletions include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_
#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_

#include <stdbool.h>
#include <stddef.h>
#include <zephyr/drivers/firmware/nrf_ironside/call.h>

#include <zephyr/toolchain/common.h>
#include <nrf.h>

/**
* @name CPUCONF service error codes.
* @{
*/

#define IRONSIDE_CPUCONF_ERROR_WRONG_CPU 0x5eb2
#define IRONSIDE_CPUCONF_ERROR_MEM_ACCESS_NOT_PERMITTED 0x5eb1
/** 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)

/**
* @}
Expand All @@ -25,15 +29,19 @@
#define IRONSIDE_CALL_ID_CPUCONF_V0 2

enum {
IRONSIDE_CPUCONF_SERVICE_CPU_IDX,
IRONSIDE_CPUCONF_SERVICE_CPU_PARAMS_IDX,
IRONSIDE_CPUCONF_SERVICE_VECTOR_TABLE_IDX,
IRONSIDE_CPUCONF_SERVICE_CPU_WAIT_IDX,
IRONSIDE_CPUCONF_SERVICE_MSG_IDX,
IRONSIDE_CPUCONF_SERVICE_MSG_SIZE_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

Expand All @@ -51,13 +59,16 @@ BUILD_ASSERT(IRONSIDE_CPUCONF_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS);
* @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_MEM_ACCESS_NOT_PERMITTED
* if the CPU does not have read access configured for the vector_table address
* @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, void *vector_table, bool cpu_wait, uint8_t *msg,
size_t msg_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_ */
1 change: 1 addition & 0 deletions samples/boards/nordic/nrf_ironside/update/prj.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_LOG=y

CONFIG_NRF_IRONSIDE_UPDATE_SERVICE=y
CONFIG_NRF_IRONSIDE_BOOT_REPORT=y
13 changes: 13 additions & 0 deletions samples/boards/nordic/nrf_ironside/update/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/drivers/firmware/nrf_ironside/boot_report.h>
#include <zephyr/drivers/firmware/nrf_ironside/update.h>
#include <zephyr/logging/log.h>

Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion soc/nordic/nrf54h/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 3 additions & 4 deletions soc/nordic/nrf54h/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,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
5 changes: 0 additions & 5 deletions soc/nordic/nrf54h/ironside/se/CMakeLists.txt

This file was deleted.

15 changes: 0 additions & 15 deletions soc/nordic/nrf54h/ironside/se/Kconfig

This file was deleted.

This file was deleted.

Loading