Skip to content

Commit 157c55f

Browse files
jonathannilsenrlubos
authored andcommitted
[nrf fromtree] modules: hal_nordic: move IronSide SE supporting code to hal_nordic
Move most of the code that is used to interface with IronSide SE on the nRF54H20/nRF9280 from the soc/nordic directory to the hal_nordic repository. The interface code is now provided by the new IronSide support package. Build system code and glue code that makes use of Zephyr APIs is now located in the modules/hal_nordic directory. Update the directory path for IronSide SE interface code in MAINTAINERS.yml to match the move from soc/nordic/ironside to modules/hal_nordic/ironside. Also included are some refactoring changes and cleanup to match the new supporting code. C code and Kconfigs have been renamed to *ironside_se* / *IRONSIDE_SE* to match the supporting code changes. Users of these APIs in zephyr have been updated to match. Individual configurations for different "IronSide services" have been removed as the API serialization for all of these is now provided in a single C file / header file (ironside/se/api.h). The ironside_boot_report_get() API has been removed. The boot report structure can be accessed through the IRONSIDE_SE_BOOT_REPORT macro. Most configs relating to UICR / PERIPHCONF have been moved under the "IronSide SE" menu to make it clear that these are part of the IronSide SE interface. The macros that in uicr.h that were used to add entries to the PERIPHCONF section have been removed. The supporting code now provides PERIPHCONF_XYZ() macros that can be used to initialize structures that go into this section, and the zephyr part now only contains a macro UICR_PERIPHCONF_ENTRY() that is used to place an arbitrary structure into the section. The gen_periphconf_entries.py script used to generate PERIPHCONF entries based on devicetree has been updated to use the new macro system. IronSide SE integration code/configs is now guarded by HAS_IRONSIDE_SE. Note that the UICR build system integration that relies on Sysbuild remains under the soc/nordic directory for now, but will be moved to the modules/hal_nordic directory once it is clear how the integration will look there. Signed-off-by: Jonathan Nilsen <[email protected]> (cherry picked from commit ef587e1)
1 parent e7f8446 commit 157c55f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+288
-2536
lines changed

MAINTAINERS.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6050,7 +6050,7 @@ nRF IronSide SE Platforms:
60506050
- karstenkoenig
60516051
- SebastianBoe
60526052
files:
6053-
- soc/nordic/ironside/
6053+
- modules/hal_nordic/ironside/
60546054
- soc/nordic/common/uicr/
60556055
labels:
60566056
- "platform: nRF IronSide SE"

drivers/clock_control/Kconfig.nrf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ endif # CLOCK_CONTROL_NRF_HSFLL_LOCAL
290290
config CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL
291291
bool "NRF IronSide HSFLL LOCAL driver support"
292292
depends on DT_HAS_NORDIC_NRF_IRON_HSFLL_LOCAL_ENABLED
293-
select NRF_IRONSIDE_DVFS_SERVICE
293+
select IRONSIDE_SE_DVFS
294294
select CLOCK_CONTROL_NRF2_COMMON
295295
default y
296296

drivers/clock_control/clock_control_nrf_iron_hsfll_local.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ LOG_MODULE_DECLARE(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL);
1414

1515
BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, "multiple instances not supported");
1616

17-
#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE
18-
#include <nrf_ironside/dvfs.h>
17+
#ifdef CONFIG_IRONSIDE_SE_DVFS
18+
#include <ironside_zephyr/se/dvfs.h>
1919

2020
#define HSFLL_FREQ_LOW MHZ(64)
2121
#define HSFLL_FREQ_MEDLOW MHZ(128)
2222
#define HSFLL_FREQ_HIGH MHZ(320)
2323

24-
#define IRONSIDE_DVFS_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_DVFS_TIMEOUT_MS)
24+
#define IRONSIDE_SE_DVFS_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_DVFS_TIMEOUT_MS)
2525

2626
/* Clock options sorted from lowest to highest frequency */
2727
static const struct clock_options {
2828
uint32_t frequency;
29-
enum ironside_dvfs_oppoint setting;
29+
enum ironside_se_dvfs_oppoint setting;
3030
} clock_options[] = {
3131
{
3232
.frequency = HSFLL_FREQ_LOW,
33-
.setting = IRONSIDE_DVFS_OPP_LOW,
33+
.setting = IRONSIDE_SE_DVFS_OPP_LOW,
3434
},
3535
{
3636
.frequency = HSFLL_FREQ_MEDLOW,
37-
.setting = IRONSIDE_DVFS_OPP_MEDLOW,
37+
.setting = IRONSIDE_SE_DVFS_OPP_MEDLOW,
3838
},
3939
{
4040
.frequency = HSFLL_FREQ_HIGH,
41-
.setting = IRONSIDE_DVFS_OPP_HIGH,
41+
.setting = IRONSIDE_SE_DVFS_OPP_HIGH,
4242
},
4343
};
4444

@@ -57,17 +57,17 @@ static void hsfll_update_timeout_handler(struct k_timer *timer)
5757
static void hsfll_work_handler(struct k_work *work)
5858
{
5959
struct hsfll_dev_data *dev_data = CONTAINER_OF(work, struct hsfll_dev_data, clk_cfg.work);
60-
enum ironside_dvfs_oppoint required_setting;
60+
enum ironside_se_dvfs_oppoint required_setting;
6161
uint8_t to_activate_idx;
6262
int rc;
6363

6464
to_activate_idx = clock_config_update_begin(work);
6565
required_setting = clock_options[to_activate_idx].setting;
6666

67-
k_timer_start(&dev_data->timer, IRONSIDE_DVFS_TIMEOUT, K_NO_WAIT);
67+
k_timer_start(&dev_data->timer, IRONSIDE_SE_DVFS_TIMEOUT, K_NO_WAIT);
6868

6969
/* Request the DVFS service to change the OPP point. */
70-
rc = ironside_dvfs_change_oppoint(required_setting);
70+
rc = ironside_se_dvfs_change_oppoint(required_setting);
7171
k_timer_stop(&dev_data->timer);
7272
clock_config_update_end(&dev_data->clk_cfg, rc);
7373
}
@@ -123,12 +123,12 @@ static struct onoff_manager *hsfll_find_mgr_by_spec(const struct device *dev,
123123
idx = hsfll_resolve_spec_to_idx(spec);
124124
return idx < 0 ? NULL : hsfll_get_mgr_by_idx(dev, idx);
125125
}
126-
#endif /* CONFIG_NRF_IRONSIDE_DVFS_SERVICE */
126+
#endif /* CONFIG_IRONSIDE_SE_DVFS */
127127

128128
static int api_request_hsfll(const struct device *dev, const struct nrf_clock_spec *spec,
129129
struct onoff_client *cli)
130130
{
131-
#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE
131+
#ifdef CONFIG_IRONSIDE_SE_DVFS
132132
struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec);
133133

134134
if (mgr) {
@@ -143,7 +143,7 @@ static int api_request_hsfll(const struct device *dev, const struct nrf_clock_sp
143143

144144
static int api_release_hsfll(const struct device *dev, const struct nrf_clock_spec *spec)
145145
{
146-
#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE
146+
#ifdef CONFIG_IRONSIDE_SE_DVFS
147147
struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec);
148148

149149
if (mgr) {
@@ -159,7 +159,7 @@ static int api_release_hsfll(const struct device *dev, const struct nrf_clock_sp
159159
static int api_cancel_or_release_hsfll(const struct device *dev, const struct nrf_clock_spec *spec,
160160
struct onoff_client *cli)
161161
{
162-
#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE
162+
#ifdef CONFIG_IRONSIDE_SE_DVFS
163163
struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec);
164164

165165
if (mgr) {
@@ -175,7 +175,7 @@ static int api_cancel_or_release_hsfll(const struct device *dev, const struct nr
175175
static int api_resolve_hsfll(const struct device *dev, const struct nrf_clock_spec *req_spec,
176176
struct nrf_clock_spec *res_spec)
177177
{
178-
#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE
178+
#ifdef CONFIG_IRONSIDE_SE_DVFS
179179
int idx;
180180

181181
idx = hsfll_resolve_spec_to_idx(req_spec);
@@ -192,7 +192,7 @@ static int api_resolve_hsfll(const struct device *dev, const struct nrf_clock_sp
192192

193193
static int hsfll_init(const struct device *dev)
194194
{
195-
#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE
195+
#ifdef CONFIG_IRONSIDE_SE_DVFS
196196
struct hsfll_dev_data *dev_data = dev->data;
197197
int rc;
198198

@@ -220,14 +220,14 @@ static DEVICE_API(nrf_clock_control, hsfll_drv_api) = {
220220
.resolve = api_resolve_hsfll,
221221
};
222222

223-
#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE
223+
#ifdef CONFIG_IRONSIDE_SE_DVFS
224224
static struct hsfll_dev_data hsfll_data;
225225
#endif
226226

227227
#ifdef CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_REQ_LOW_FREQ
228228
static int dvfs_low_init(void)
229229
{
230-
static const k_timeout_t timeout = IRONSIDE_DVFS_TIMEOUT;
230+
static const k_timeout_t timeout = IRONSIDE_SE_DVFS_TIMEOUT;
231231
static const struct device *hsfll_dev = DEVICE_DT_GET(DT_CLOCKS_CTLR(DT_NODELABEL(cpu)));
232232
static const struct nrf_clock_spec clk_spec = {.frequency = HSFLL_FREQ_LOW};
233233

@@ -238,7 +238,7 @@ SYS_INIT(dvfs_low_init, APPLICATION, 0);
238238
#endif
239239

240240
DEVICE_DT_INST_DEFINE(0, hsfll_init, NULL,
241-
COND_CODE_1(CONFIG_NRF_IRONSIDE_DVFS_SERVICE,
241+
COND_CODE_1(CONFIG_IRONSIDE_SE_DVFS,
242242
(&hsfll_data),
243243
(NULL)), NULL, PRE_KERNEL_1,
244244
CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &hsfll_drv_api);

drivers/debug/Kconfig.nrf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ menuconfig DEBUG_CORESIGHT_NRF
117117
default y
118118
depends on DT_HAS_NORDIC_CORESIGHT_NRF_ENABLED
119119
select PINCTRL
120-
select NRF_IRONSIDE_TDD_SERVICE
120+
select IRONSIDE_SE_CALL
121121
help
122122
Support CoreSight peripherals in Test and Debug Domain for ARM
123123
CoreSight System Trace Macrocell (STM) trace support.

drivers/debug/debug_coresight_nrf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <zephyr/drivers/pinctrl.h>
1010
#include <zephyr/sys/util.h>
1111
#include <zephyr/sys/sys_io.h>
12-
#include <nrf_ironside/tdd.h>
13-
#include <uicr/uicr.h>
12+
#include <ironside/se/api.h>
13+
#include <ironside_zephyr/se/uicr_periphconf.h>
1414

1515
#undef ETR_MODE_MODE_CIRCULARBUF
1616

@@ -262,7 +262,7 @@ static int coresight_nrf_init(const struct device *dev)
262262
return 0;
263263
}
264264

265-
#define DEBUG_CORESIGHT_NRF_INIT_PRIORITY UTIL_INC(CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY)
265+
#define DEBUG_CORESIGHT_NRF_INIT_PRIORITY UTIL_INC(CONFIG_IRONSIDE_SE_CALL_INIT_PRIORITY)
266266

267267
#define CORESIGHT_NRF_INST(inst) \
268268
COND_CODE_1(DT_INST_PINCTRL_HAS_IDX(inst, 0), \

drivers/debug/debug_nrf_etr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ int etr_process_init(void)
792792
return 0;
793793
}
794794

795-
#define NRF_ETR_INIT_PRIORITY UTIL_INC(UTIL_INC(CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY))
795+
#define NRF_ETR_INIT_PRIORITY UTIL_INC(UTIL_INC(CONFIG_IRONSIDE_SE_CALL_INIT_PRIORITY))
796796

797797
SYS_INIT(etr_process_init, POST_KERNEL, NRF_ETR_INIT_PRIORITY);
798798

modules/hal_nordic/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ if (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION)
55
add_subdirectory(nrf_802154)
66
endif (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION)
77

8+
add_subdirectory_ifdef(CONFIG_HAS_IRONSIDE_SE ironside/se)
89
add_subdirectory_ifdef(CONFIG_HAS_NRFX nrfx)
910
add_subdirectory_ifdef(CONFIG_HAS_NRFS nrfs)
1011

modules/hal_nordic/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ endif # NRF_802154_RADIO_DRIVER || NRF_802154_SERIALIZATION
258258

259259
endmenu # HAS_NORDIC_DRIVERS
260260

261+
rsource "ironside/se/Kconfig"
261262
rsource "nrfs/Kconfig"
262263
rsource "nrfx/Kconfig"
263264
rsource "Kconfig.nrf_regtool"

soc/nordic/common/uicr/CMakeLists.txt renamed to modules/hal_nordic/ironside/se/CMakeLists.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
# Copyright (c) 2025 Nordic Semiconductor ASA
22
# SPDX-License-Identifier: Apache-2.0
33

4+
# The IronSide source directory can be overridden by setting
5+
# IRONSIDE_SUPPORT_DIR before invoking the build system.
6+
zephyr_get(IRONSIDE_SUPPORT_DIR SYSBUILD GLOBAL)
7+
if(NOT DEFINED IRONSIDE_SUPPORT_DIR)
8+
set(IRONSIDE_SUPPORT_DIR
9+
${ZEPHYR_CURRENT_MODULE_DIR}/ironside CACHE PATH "IronSide Support Directory"
10+
)
11+
endif()
12+
13+
zephyr_include_directories(include)
14+
zephyr_include_directories(${IRONSIDE_SUPPORT_DIR}/se/include)
15+
16+
zephyr_library()
17+
zephyr_library_property(ALLOW_EMPTY TRUE)
18+
zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL
19+
${IRONSIDE_SUPPORT_DIR}/se/src/ironside_se_api.c
20+
call.c
21+
)
22+
zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_DVFS dvfs.c)
23+
424
if(CONFIG_NRF_PERIPHCONF_SECTION)
525
zephyr_linker_sources(SECTIONS uicr.ld)
626
endif()
@@ -10,7 +30,7 @@ if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES)
1030
execute_process(
1131
COMMAND
1232
${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE}
13-
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/gen_periphconf_entries.py
33+
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/scripts/gen_periphconf_entries.py
1434
--soc ${CONFIG_SOC}
1535
--in-edt-pickle ${EDT_PICKLE}
1636
--out-periphconf-source ${periphconf_entries_c_file}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config HAS_IRONSIDE_SE
5+
bool
6+
7+
menu "IronSide SE"
8+
depends on HAS_IRONSIDE_SE
9+
10+
config IRONSIDE_SE_CALL
11+
bool "IronSide calls"
12+
default y
13+
depends on DT_HAS_NORDIC_IRONSIDE_CALL_ENABLED
14+
depends on MULTITHREADING
15+
select EVENTS
16+
select MBOX
17+
help
18+
Support for IronSide call APIs.
19+
20+
if IRONSIDE_SE_CALL
21+
22+
config IRONSIDE_SE_CALL_INIT_PRIORITY
23+
int "IronSide calls' driver initialization priority"
24+
default 41
25+
help
26+
Initialization priority of the IronSide call protocol driver.
27+
It must be below MBOX_INIT_PRIORITY, but higher than the priority of any feature
28+
that depends on IRONSIDE_SE_CALL.
29+
30+
endif # IRONSIDE_SE_CALL
31+
32+
config IRONSIDE_SE_DVFS
33+
bool "DVFS support"
34+
depends on SOC_NRF54H20_CPUAPP
35+
depends on IRONSIDE_SE_CALL
36+
help
37+
Support for changing the DVFS operating point.
38+
39+
if IRONSIDE_SE_DVFS
40+
41+
config IRONSIDE_SE_DVFS_ABB_STATUSANA_CHECK_MAX_ATTEMPTS
42+
int "ABB analog status check maximum attempts"
43+
range 0 255
44+
default 50
45+
help
46+
Maximum attempts with 10us intervals before busy status will be reported.
47+
48+
endif # IRONSIDE_SE_DVFS
49+
50+
menuconfig NRF_PERIPHCONF_SECTION
51+
bool "Global peripheral initialization section"
52+
depends on LINKER_DEVNULL_SUPPORT
53+
imply LINKER_DEVNULL_MEMORY
54+
help
55+
Include static global domain peripheral initialization values from the
56+
build in a dedicated section in the devnull region.
57+
58+
config NRF_PERIPHCONF_GENERATE_ENTRIES
59+
bool "Generate PERIPHCONF entries source file"
60+
default y
61+
depends on NRF_PERIPHCONF_SECTION
62+
help
63+
Generate a C file containing PERIPHCONF entries based on the
64+
device configuration in the devicetree.
65+
66+
endmenu # IronSide SE

0 commit comments

Comments
 (0)