From d9499322348317a75237f0dfa69bea5b2b240aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 1 May 2025 11:49:29 +0200 Subject: [PATCH] cpuconf: Boot the radiocore from the app in soc_late_init_hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Boot the radiocore from the app in soc_late_init_hook. Signed-off-by: Sebastian Bøe --- soc/nordic/nrf54h/Kconfig | 11 +++++++++++ soc/nordic/nrf54h/soc.c | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 55dbbc7116f..c0e619cd1e2 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -8,6 +8,7 @@ config SOC_SERIES_NRF54HX select HAS_NRFX select HAS_NORDIC_DRIVERS select SOC_EARLY_INIT_HOOK if ARM + select SOC_LATE_INIT_HOOK if SOC_NRF54H20_CPURAD_ENABLE select NRF_PLATFORM_HALTIUM config SOC_NRF54H20_CPUAPP_COMMON @@ -66,6 +67,16 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_PM select HAS_POWEROFF +config SOC_NRF54H20_CPURAD_ENABLE + bool "Boot the nRF54H20 Radio core" + default y if NRF_802154_SER_HOST + depends on SOC_NRF54H20_CPUAPP + select NRF_IRONSIDE_CPUCONF_SERVICE + help + This will at application boot time enable clock to the + Radiocore, and also power will be requested to the Radiocore + subsystem. The Radiocore will then start executing instructions. + config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index ad2da0b30bf..c1849ab3a23 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -22,6 +22,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -43,6 +44,8 @@ sys_snode_t soc_node; ADDRESS_DOMAIN_Msk | \ ADDRESS_BUS_Msk))) +#define DT_NODELABEL_CPURAD_SLOT0_PARTITION DT_NODELABEL(cpurad_slot0_partition) + static void power_domain_init(void) { /* @@ -156,6 +159,30 @@ void soc_early_init_hook(void) } } +#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) +void soc_late_init_hook(void) +{ + int err; + + /* The msg will be used for communication prior to IPC + * communication being set up. But at this moment no such + * communication is required. + */ + uint8_t *msg = NULL; + size_t msg_size = 0; + + void *radiocore_address = + (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL_CPURAD_SLOT0_PARTITION)) + + DT_REG_ADDR(DT_NODELABEL_CPURAD_SLOT0_PARTITION)); + + /* Don't wait as this is not yet supported. */ + bool cpu_wait = false; + + err = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, msg_size); + __ASSERT(err == 0, "err was %d", err); +} +#endif + void arch_busy_wait(uint32_t time_us) { nrfx_coredep_delay_us(time_us);