Skip to content

Commit 7c813bf

Browse files
karstenkoenigcfriedt
authored andcommitted
soc: nordic: 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 <[email protected]>
1 parent 0974632 commit 7c813bf

File tree

6 files changed

+103
-5
lines changed

6 files changed

+103
-5
lines changed

soc/nordic/ironside/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ zephyr_library()
66
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c)
77
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOT_REPORT boot_report.c)
88
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c)
9+
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_TDD_SERVICE tdd.c)
910
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c)
1011
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_DVFS_SERVICE dvfs.c)

soc/nordic/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: 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_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_
7+
#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_
8+
9+
#include <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_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_ */

soc/nordic/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 <nrf_ironside/tdd.h>
7+
#include <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+
}

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 || BT_HCI_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: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE)
2727
#include <nrf_ironside/cpuconf.h>
2828
#endif
29+
#if defined(CONFIG_SOC_NRF54H20_TDD_ENABLE)
30+
#include <nrf_ironside/tdd.h>
31+
#endif
2932

3033
LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
3134

@@ -171,10 +174,19 @@ void soc_early_init_hook(void)
171174
}
172175
}
173176

174-
#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE)
177+
#if defined(CONFIG_SOC_LATE_INIT_HOOK)
178+
175179
void soc_late_init_hook(void)
176180
{
177-
int err;
181+
#if defined(CONFIG_SOC_NRF54H20_TDD_ENABLE)
182+
int err_tdd;
183+
184+
err_tdd = ironside_se_tdd_configure(IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT);
185+
__ASSERT(err_tdd == 0, "err_tdd was %d", err_tdd);
186+
#endif
187+
188+
#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE)
189+
int err_cpuconf;
178190

179191
/* The msg will be used for communication prior to IPC
180192
* communication being set up. But at this moment no such
@@ -213,8 +225,10 @@ void soc_late_init_hook(void)
213225
/* Don't wait as this is not yet supported. */
214226
bool cpu_wait = false;
215227

216-
err = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, msg_size);
217-
__ASSERT(err == 0, "err was %d", err);
228+
err_cpuconf = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg,
229+
msg_size);
230+
__ASSERT(err_cpuconf == 0, "err_cpuconf was %d", err_cpuconf);
231+
#endif
218232
}
219233
#endif
220234

0 commit comments

Comments
 (0)