Skip to content

Commit 91ce46f

Browse files
committed
[nrf toup] soc: add ironside boot report
Also update memory map to leverage unused MRAM and move sysctrl IPC to RAM20 to free global RAM. Signed-off-by: Håkon Amundsen <[email protected]>
1 parent 87432d9 commit 91ce46f

File tree

11 files changed

+204
-10
lines changed

11 files changed

+204
-10
lines changed

boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
/delete-node/&cpurad_rx_partitions;
1010
/delete-node/&cpuapp_rx_partitions;
1111

12+
/* Update the location of cpusys IPC shared memory */
13+
/delete-node/&cpuapp_cpusys_ipc_shm;
14+
/delete-node/&cpusys_cpuapp_ipc_shm;
15+
/delete-node/&cpurad_cpusys_ipc_shm;
16+
/delete-node/&cpusys_cpurad_ipc_shm;
17+
1218
/* This is not yet an exhaustive memory map, and contain only a minimum required to boot
1319
* the application core.
1420
*/
@@ -34,20 +40,48 @@
3440

3541
slot0_partition: partition@3c000 {
3642
label = "image-0";
37-
reg = <0x3c000 DT_SIZE_K(200)>;
43+
reg = <0x3c000 DT_SIZE_K(336)>;
3844
};
3945

40-
slot1_partition: partition@6E000 {
46+
slot1_partition: partition@90000 {
4147
label = "image-1";
42-
reg = <0x6E000 DT_SIZE_K(200)>;
48+
reg = <0x90000 DT_SIZE_K(336)>;
49+
};
50+
51+
cpuppr_code_partition: partition@e4000 {
52+
reg = <0xe4000 DT_SIZE_K(64)>;
53+
};
54+
55+
cpuflpr_code_partition: partition@f4000 {
56+
reg = <0xf4000 DT_SIZE_K(48)>;
57+
};
58+
};
59+
};
60+
61+
/ {
62+
reserved-memory {
63+
sysctrl_rom_report: memory@2f88ff00 {
64+
reg = <0x2f88ff00 0x100>;
65+
};
66+
67+
cpuapp_ironside_se_boot_report: memory@2f88fd00 {
68+
reg = <0x2f88fd00 0x200>;
69+
};
70+
71+
cpusys_cpurad_ipc_shm: memory@2f88f780 {
72+
reg = <0x2f88f780 0x80>;
73+
};
74+
75+
cpurad_cpusys_ipc_shm: memory@2f88f700 {
76+
reg = <0x2f88f700 0x80>;
4377
};
4478

45-
cpuppr_code_partition: partition@a4000 {
46-
reg = <0xa4000 DT_SIZE_K(64)>;
79+
cpusys_cpuapp_ipc_shm: memory@2f88f680 {
80+
reg = <0x2f88f680 0x80>;
4781
};
4882

49-
cpuflpr_code_partition: partition@b4000 {
50-
reg = <0xb4000 DT_SIZE_K(48)>;
83+
cpuapp_cpusys_ipc_shm: memory@2f88f600 {
84+
reg = <0x2f88f600 0x80>;
5185
};
5286
};
5387
};

soc/nordic/nrf54h/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ zephyr_linker_sources(SECTIONS SORT_KEY zzz_place_align_at_end align.ld)
1818

1919
add_subdirectory(bicr)
2020
add_subdirectory(gpd)
21+
add_subdirectory(ironside/se)

soc/nordic/nrf54h/Kconfig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ config SOC_NRF54H20_CPUPPR
7272
config SOC_NRF54H20_CPUFLPR
7373
select RISCV_CORE_NORDIC_VPR
7474

75-
rsource "bicr/Kconfig"
76-
rsource "gpd/Kconfig"
77-
7875
config SOC_NRF54H20_IRON
7976
select EXPERIMENTAL if MCUBOOT
77+
78+
rsource "bicr/Kconfig"
79+
rsource "gpd/Kconfig"
80+
rsource "ironside/se/Kconfig"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Nordic Semiconductor
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_library_sources_ifdef(CONFIG_SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT ironside_se_boot_report.c)
5+
zephyr_include_directories(include)

soc/nordic/nrf54h/ironside/se/Kconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2025 Nordic Semiconductor
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT
5+
bool "Nordic IRONside SE boot report"
6+
default y if SOC_NRF54H20_CPUAPP
7+
depends on SOC_NRF54H20_IRON
8+
help
9+
This option enables parsing of the Boot Report populated by Nordic IRONside SE.
10+
11+
config SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT_MAGIC
12+
hex
13+
default 0x4d69546f
14+
help
15+
Constant used to check if an Nordic IRONside SE boot report has been written.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#ifndef ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_
7+
#define ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_
8+
9+
#include <stdint.h>
10+
#include <stddef.h>
11+
12+
#define IRONSIDE_SE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE (16UL) /* Size in bytes */
13+
#define IRONSIDE_SE_BOOT_REPORT_RANDOM_DATA_SIZE (32UL) /* Size in bytes */
14+
15+
/** @brief UICR error description contained in the boot report. */
16+
struct ironside_se_boot_report_uicr_error {
17+
/** The type of error. A value of 0 indicates no error */
18+
uint32_t error_type;
19+
/** Error descriptions specific to each type of UICR error */
20+
union {
21+
/** RFU */
22+
struct {
23+
uint32_t rfu[4];
24+
} rfu;
25+
} description;
26+
};
27+
28+
/** @brief IRONside boot report. */
29+
struct ironside_se_boot_report {
30+
/** Magic value used to identify valid boot report */
31+
uint32_t magic;
32+
/** Firmware version of IRONside SE. 8bit MAJOR.MINOR.PATCH.SEQNUM */
33+
uint32_t ironside_se_version_int;
34+
/** Human readable extraversion of IRONside SE */
35+
char ironside_se_extraversion[12];
36+
/** Firmware version of IRONside SE recovery firmware. 8bit MAJOR.MINOR.PATCH.SEQNUM */
37+
uint32_t ironside_se_recovery_version_int;
38+
/** Human readable extraversion of IRONside SE recovery firmware */
39+
char ironside_se_recovery_extraversion[12];
40+
/** Copy of SICR.UROT.UPDATE.STATUS.*/
41+
uint32_t ironside_update_status;
42+
/** See @ref ironside_se_boot_report_uicr_error */
43+
struct ironside_se_boot_report_uicr_error uicr_error_description;
44+
/** Data passed from booting local domain to local domain being booted */
45+
uint8_t local_domain_context[IRONSIDE_SE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE];
46+
/** CSPRNG data */
47+
uint8_t random_data[IRONSIDE_SE_BOOT_REPORT_RANDOM_DATA_SIZE];
48+
/** Reserved for Future Use */
49+
uint32_t rfu[64];
50+
};
51+
52+
/**
53+
* @brief Get a pointer to the IRONside boot report.
54+
*
55+
* @param[out] report Will be set to point to the IRONside boot report.
56+
*
57+
* @return non-negative value if success, negative value otherwise.
58+
* @retval -EFAULT if the magic field in the report is incorrect.
59+
* @retval -EINVAL if @ref report is NULL.
60+
*/
61+
int ironside_se_boot_report_get(const struct ironside_se_boot_report **report);
62+
63+
#endif /* ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_ */
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <errno.h>
7+
#include <zephyr/devicetree.h>
8+
#include <nrf/ironside_se_boot_report.h>
9+
10+
#define IRONSIDE_SE_BOOT_REPORT_ADDR DT_REG_ADDR(DT_NODELABEL(cpuapp_ironside_se_boot_report))
11+
#define IRONSIDE_SE_BOOT_REPORT_MAGIC CONFIG_SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT_MAGIC
12+
13+
int ironside_se_boot_report_get(const struct ironside_se_boot_report **report)
14+
{
15+
const struct ironside_se_boot_report *tmp_report =
16+
(const struct ironside_se_boot_report *)IRONSIDE_SE_BOOT_REPORT_ADDR;
17+
18+
if (tmp_report->magic != IRONSIDE_SE_BOOT_REPORT_MAGIC) {
19+
return -EINVAL;
20+
}
21+
22+
*report = tmp_report;
23+
24+
return 0;
25+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2025 Nordic Semiconductor
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
cmake_minimum_required(VERSION 3.20.0)
5+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
6+
project(ironside_se_boot_report)
7+
8+
FILE(GLOB app_sources src/*.c)
9+
target_sources(app PRIVATE ${app_sources})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Empty
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <nrf/ironside_se_boot_report.h>
8+
#include <stdio.h>
9+
10+
int main(void)
11+
{
12+
int err;
13+
const struct ironside_se_boot_report *report;
14+
15+
err = ironside_se_boot_report_get(&report);
16+
printf("err: %d\n", err);
17+
printf("version: 0x%x\n", report->ironside_se_version_int);
18+
printf("extraversion: %s\n", report->ironside_se_extraversion);
19+
20+
return 0;
21+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
common:
2+
tags:
3+
- drivers
4+
- hwinfo
5+
harness: console
6+
7+
tests:
8+
soc.nordic.ironside_se_boot_report:
9+
harness_config:
10+
type: multi_line
11+
ordered: true
12+
regex:
13+
- "err: 0"
14+
- "version: 0x([0-9a-fA-F]+)"
15+
- "extraversion: ([0-9a-fA-F]+)"
16+
platform_allow:
17+
- nrf54h20dk/nrf54h20/cpuapp/iron
18+
integration_platforms:
19+
- nrf54h20dk/nrf54h20/cpuapp/iron

0 commit comments

Comments
 (0)