Skip to content

Commit dac5a68

Browse files
committed
[nrf fromlist] 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. Upstream PR #: 92340 Signed-off-by: Karsten Koenig <[email protected]>
1 parent 46c5b41 commit dac5a68

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
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
select EXPERIMENTAL if MCUBOOT
1413

@@ -68,11 +67,23 @@ config SOC_NRF54H20_CPURAD_COMMON
6867
select HAS_PM
6968
select HAS_POWEROFF
7069

70+
config SOC_NRF54H20_TDD_ENABLE
71+
bool "Power and configure the trace and debug domain (TDD)"
72+
depends on SOC_NRF54H20_CPUAPP
73+
select NRF_IRONSIDE_TDD_SERVICE
74+
select SOC_LATE_INIT_HOOK
75+
help
76+
This will at application boot time request that the trace and
77+
debug domain (TDD) is powered up and configured.
78+
This allows configuring the coresight peripherals from
79+
the application domain.
80+
7181
config SOC_NRF54H20_CPURAD_ENABLE
7282
bool "Boot the nRF54H20 Radio core"
7383
default y if NRF_802154_SER_HOST
7484
depends on SOC_NRF54H20_CPUAPP
7585
select NRF_IRONSIDE_CPUCONF_SERVICE
86+
select SOC_LATE_INIT_HOOK
7687
help
7788
This will at application boot time enable clock to the
7889
Radiocore, and also power will be requested to the Radiocore

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

@@ -168,10 +169,19 @@ void soc_early_init_hook(void)
168169
}
169170
}
170171

171-
#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE)
172+
#if defined(CONFIG_SOC_LATE_INIT_HOOK)
173+
172174
void soc_late_init_hook(void)
173175
{
174-
int err;
176+
#if defined(CONFIG_SOC_NRF54H20_TDD_ENABLE)
177+
int err_tdd;
178+
179+
err_tdd = ironside_se_tdd_configure(IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT);
180+
__ASSERT(err_tdd == 0, "err_tdd was %d", err_tdd);
181+
#endif
182+
183+
#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE)
184+
int err_cpuconf;
175185

176186
/* The msg will be used for communication prior to IPC
177187
* communication being set up. But at this moment no such
@@ -210,8 +220,10 @@ void soc_late_init_hook(void)
210220
/* Don't wait as this is not yet supported. */
211221
bool cpu_wait = false;
212222

213-
err = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, msg_size);
214-
__ASSERT(err == 0, "err was %d", err);
223+
err_cpuconf = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg,
224+
msg_size);
225+
__ASSERT(err_cpuconf == 0, "err_cpuconf was %d", err_cpuconf);
226+
#endif
215227
}
216228
#endif
217229

0 commit comments

Comments
 (0)