Skip to content

Commit bfb67a4

Browse files
committed
drivers: firmware: nrf_ironside: Add TDD
Added support for the IronSide TDD service which allows configuring and powering the trace and debug domain of the nrf54h20. Also provide option to start the trace and debug domain in the soc start sequence. Signed-off-by: Karsten Koenig <karsten.koenig@nordicsemi.no>
1 parent f4a0beb commit bfb67a4

File tree

6 files changed

+101
-5
lines changed

6 files changed

+101
-5
lines changed

drivers/firmware/nrf_ironside/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c)
77

88
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOT_REPORT boot_report.c)
99
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c)
10+
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_TDD_SERVICE tdd.c)
1011
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c)
1112
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_DVFS_SERVICE dvfs.c)

drivers/firmware/nrf_ironside/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ config NRF_IRONSIDE_CPUCONF_SERVICE
3737
help
3838
Service used to boot local domain cores.
3939

40+
config NRF_IRONSIDE_TDD_SERVICE
41+
bool "IRONside tdd service"
42+
select NRF_IRONSIDE_CALL
43+
help
44+
Service used to control the trace and debug domain.
45+
4046
config NRF_IRONSIDE_UPDATE_SERVICE
4147
bool "IRONside update service"
4248
select NRF_IRONSIDE_CALL

drivers/firmware/nrf_ironside/tdd.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/drivers/firmware/nrf_ironside/tdd.h>
7+
#include <zephyr/drivers/firmware/nrf_ironside/call.h>
8+
9+
int ironside_se_tdd_configure(const enum ironside_se_tdd_config config)
10+
{
11+
int err;
12+
struct ironside_call_buf *const buf = ironside_call_alloc();
13+
14+
buf->id = IRONSIDE_SE_CALL_ID_TDD_V0;
15+
buf->args[IRONSIDE_SE_TDD_SERVICE_REQ_CONFIG_IDX] = (uint32_t)config;
16+
17+
ironside_call_dispatch(buf);
18+
19+
if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) {
20+
err = buf->args[IRONSIDE_SE_TDD_SERVICE_RSP_RETCODE_IDX];
21+
} else {
22+
err = buf->status;
23+
}
24+
25+
ironside_call_release(buf);
26+
27+
return err;
28+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_TDD_H_
7+
#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_TDD_H_
8+
9+
#include <zephyr/drivers/firmware/nrf_ironside/call.h>
10+
11+
#include <nrfx.h>
12+
13+
#define IRONSIDE_SE_TDD_SERVICE_ERROR_INVALID_CONFIG (1)
14+
15+
#define IRONSIDE_SE_CALL_ID_TDD_V0 4
16+
17+
#define IRONSIDE_SE_TDD_SERVICE_REQ_CONFIG_IDX 0
18+
#define IRONSIDE_SE_TDD_SERVICE_RSP_RETCODE_IDX 0
19+
20+
enum ironside_se_tdd_config {
21+
RESERVED0 = 0, /* Reserved */
22+
/** Turn off the TDD */
23+
IRONSIDE_SE_TDD_CONFIG_OFF = 1,
24+
/** Turn on the TDD with default configuration */
25+
IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT = 2,
26+
};
27+
28+
/**
29+
* @brief Control the Trace and Debug Domain (TDD).
30+
*
31+
* @param config The configuration to be applied.
32+
*
33+
* @retval 0 on success.
34+
* @retval -IRONSIDE_SE_TDD_ERROR_EINVAL on invalid argument.
35+
*/
36+
int ironside_se_tdd_configure(const enum ironside_se_tdd_config config);
37+
38+
#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_TDD_H_ */

soc/nordic/nrf54h/Kconfig

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ config SOC_SERIES_NRF54HX
88
select HAS_NRFX
99
select HAS_NORDIC_DRIVERS
1010
select SOC_EARLY_INIT_HOOK if ARM
11-
select SOC_LATE_INIT_HOOK if SOC_NRF54H20_CPURAD_ENABLE
1211
select NRF_PLATFORM_HALTIUM
1312

1413
config SOC_NRF54H20_CPUAPP_COMMON
@@ -72,11 +71,23 @@ config SOC_NRF54H20_CPURAD_ENABLE
7271
default y if NRF_802154_SER_HOST
7372
depends on SOC_NRF54H20_CPUAPP
7473
select NRF_IRONSIDE_CPUCONF_SERVICE
74+
select SOC_LATE_INIT_HOOK
7575
help
7676
This will at application boot time enable clock to the
7777
Radiocore, and also power will be requested to the Radiocore
7878
subsystem. The Radiocore will then start executing instructions.
7979

80+
config SOC_NRF54H20_TDD_ENABLE
81+
bool "Power and configure the trace and debug domain (TDD)"
82+
depends on SOC_NRF54H20_CPUAPP
83+
select NRF_IRONSIDE_TDD_SERVICE
84+
select SOC_LATE_INIT_HOOK
85+
help
86+
This will at application boot time request that the trace and
87+
debug domain (TDD) is powered up and configured.
88+
This allows configuring the coresight peripherals from
89+
the application domain.
90+
8091
config SOC_NRF54H20_CPURAD
8192
select SOC_NRF54H20_CPURAD_COMMON
8293

soc/nordic/nrf54h/soc.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <soc_lrcconf.h>
2424
#include <dmm.h>
2525
#include <zephyr/drivers/firmware/nrf_ironside/cpuconf.h>
26+
#include <zephyr/drivers/firmware/nrf_ironside/tdd.h>
2627

2728
LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
2829

@@ -161,10 +162,19 @@ void soc_early_init_hook(void)
161162
}
162163
}
163164

164-
#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE)
165+
#if defined(CONFIG_SOC_LATE_INIT_HOOK)
166+
165167
void soc_late_init_hook(void)
166168
{
167-
int err;
169+
#if defined(CONFIG_SOC_NRF54H20_TDD_ENABLE)
170+
int err_tdd;
171+
172+
err_tdd = ironside_se_tdd_configure(IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT);
173+
__ASSERT(err_tdd == 0, "err_tdd was %d", err_tdd);
174+
#endif
175+
176+
#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE)
177+
int err_cpuconf;
168178

169179
/* The msg will be used for communication prior to IPC
170180
* communication being set up. But at this moment no such
@@ -181,8 +191,10 @@ void soc_late_init_hook(void)
181191
/* Don't wait as this is not yet supported. */
182192
bool cpu_wait = false;
183193

184-
err = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, msg_size);
185-
__ASSERT(err == 0, "err was %d", err);
194+
err_cpuconf = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg,
195+
msg_size);
196+
__ASSERT(err_cpuconf == 0, "err_cpuconf was %d", err_cpuconf);
197+
#endif
186198
}
187199
#endif
188200

0 commit comments

Comments
 (0)