Skip to content

Commit 7eb9668

Browse files
committed
soc: nordic: nrf54h: Add TDD enable option
Allow starting the trace and debug domain in the soc_late_init() hook. Signed-off-by: Karsten Koenig <[email protected]>
1 parent c3a2b10 commit 7eb9668

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

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_ENABLE_TDD_WITH_PINS
81+
bool "Enable the trace and debug domain (TDD) with pins"
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 that the TPIU pins are
88+
configured. 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: 15 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

@@ -159,10 +160,19 @@ void soc_early_init_hook(void)
159160
}
160161
}
161162

162-
#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE)
163+
#if defined(CONFIG_SOC_LATE_INIT_HOOK)
164+
163165
void soc_late_init_hook(void)
164166
{
165-
int err;
167+
#if defined(CONFIG_SOC_NRF54H20_ENABLE_TDD_WITH_PINS)
168+
int err_tdd;
169+
170+
err_tdd = ironside_tdd(IRONSIDE_TDD_CONFIG_ON_DEFAULT);
171+
__ASSERT(err_tdd == 0, "err_tdd was %d", err_tdd);
172+
#endif
173+
174+
#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE)
175+
int err_cpuconf;
166176

167177
/* The msg will be used for communication prior to IPC
168178
* communication being set up. But at this moment no such
@@ -178,8 +188,9 @@ void soc_late_init_hook(void)
178188
/* Don't wait as this is not yet supported. */
179189
bool cpu_wait = false;
180190

181-
err = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, msg_size);
182-
__ASSERT(err == 0, "err was %d", err);
191+
err_cpuconf = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, msg_size);
192+
__ASSERT(err_cpuconf == 0, "err_cpuconf was %d", err_cpuconf);
193+
#endif
183194
}
184195
#endif
185196

0 commit comments

Comments
 (0)