diff --git a/soc/nordic/common/soc_lrcconf.c b/soc/nordic/common/soc_lrcconf.c index f7a40c1d099..da6dbf10b3f 100644 --- a/soc/nordic/common/soc_lrcconf.c +++ b/soc/nordic/common/soc_lrcconf.c @@ -24,6 +24,7 @@ void soc_lrcconf_poweron_request(sys_snode_t *node, nrf_lrcconf_power_domain_mas } else { return; } + K_SPINLOCK(&lock) { if (sys_slist_len(poweron_list) == 0) { nrf_lrcconf_poweron_force_set(NRF_LRCCONF010, domain, true); diff --git a/soc/nordic/nrf54h/power.c b/soc/nordic/nrf54h/power.c index c6cf44953fa..a3b39a4c5fe 100644 --- a/soc/nordic/nrf54h/power.c +++ b/soc/nordic/nrf54h/power.c @@ -16,12 +16,10 @@ #include "soc.h" #include "pm_s2ram.h" +extern sys_snode_t soc_node; + static void common_suspend(void) { - sys_snode_t *node; - - node = soc_pd_sys_snode_get(); - if (IS_ENABLED(CONFIG_DCACHE)) { /* Flush, disable and power down DCACHE */ sys_cache_data_flush_all(); @@ -37,15 +35,11 @@ static void common_suspend(void) RAMBLOCK_CONTROL_BIT_ICACHE, false); } - soc_lrcconf_poweron_release(node, NRF_LRCCONF_POWER_DOMAIN_0); + soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_DOMAIN_0); } static void common_resume(void) { - sys_snode_t *node; - - node = soc_pd_sys_snode_get(); - if (IS_ENABLED(CONFIG_ICACHE)) { /* Power up and re-enable ICACHE */ nrf_memconf_ramblock_control_enable_set(NRF_MEMCONF, RAMBLOCK_POWER_ID, @@ -60,7 +54,7 @@ static void common_resume(void) sys_cache_data_enable(); } - soc_lrcconf_poweron_request(node, NRF_LRCCONF_POWER_DOMAIN_0); + soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_DOMAIN_0); } void nrf_poweroff(void) @@ -68,7 +62,7 @@ void nrf_poweroff(void) nrf_resetinfo_resetreas_local_set(NRF_RESETINFO, 0); nrf_resetinfo_restore_valid_set(NRF_RESETINFO, false); -#if !defined(NRF_RADIOCORE) +#if !defined(CONFIG_SOC_NRF54H20_CPURAD) /* Disable retention */ nrf_lrcconf_retain_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_MAIN, false); nrf_lrcconf_retain_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_DOMAIN_0, false); @@ -87,10 +81,6 @@ void nrf_poweroff(void) static void s2idle_enter(uint8_t substate_id) { - sys_snode_t *node; - - node = soc_pd_sys_snode_get(); - switch (substate_id) { case 0: /* Substate for idle with cache powered on - not implemented yet. */ @@ -98,8 +88,8 @@ static void s2idle_enter(uint8_t substate_id) case 1: /* Substate for idle with cache retained - not implemented yet. */ break; case 2: /* Substate for idle with cache disabled. */ -#if !defined(NRF_RADIOCORE) - soc_lrcconf_poweron_request(node, NRF_LRCCONF_POWER_MAIN); +#if !defined(CONFIG_SOC_NRF54H20_CPURAD) + soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_MAIN); #endif common_suspend(); break; @@ -115,10 +105,6 @@ static void s2idle_enter(uint8_t substate_id) static void s2idle_exit(uint8_t substate_id) { - sys_snode_t *node; - - node = soc_pd_sys_snode_get(); - switch (substate_id) { case 0: /* Substate for idle with cache powered on - not implemented yet. */ @@ -127,8 +113,8 @@ static void s2idle_exit(uint8_t substate_id) break; case 2: /* Substate for idle with cache disabled. */ common_resume(); -#if !defined(NRF_RADIOCORE) - soc_lrcconf_poweron_release(node, NRF_LRCCONF_POWER_MAIN); +#if !defined(CONFIG_SOC_NRF54H20_CPURAD) + soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_MAIN); #endif default: /* Unknown substate. */ return; @@ -140,7 +126,7 @@ static void s2idle_exit(uint8_t substate_id) static void s2ram_exit(void) { common_resume(); -#if !defined(NRF_RADIOCORE) +#if !defined(CONFIG_SOC_NRF54H20_CPURAD) /* Re-enable domain retention. */ nrf_lrcconf_retain_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_DOMAIN_0, true); #endif @@ -156,7 +142,7 @@ static int sys_suspend_to_ram(void) NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK); nrf_resetinfo_restore_valid_set(NRF_RESETINFO, true); -#if !defined(NRF_RADIOCORE) +#if !defined(CONFIG_SOC_NRF54H20_CPURAD) /* Disable retention */ nrf_lrcconf_retain_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_DOMAIN_0, false); #endif diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 85570bd9ff3..43c84e1b9a7 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -30,7 +30,7 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #define HSFLL_NODE DT_NODELABEL(cpurad_hsfll) #endif -static sys_snode_t soc_node; +sys_snode_t soc_node; #define FICR_ADDR_GET(node_id, name) \ DT_REG_ADDR(DT_PHANDLE_BY_NAME(node_id, nordic_ficrs, name)) + \ @@ -41,10 +41,6 @@ static sys_snode_t soc_node; ADDRESS_SECURITY_Msk | \ ADDRESS_DOMAIN_Msk | \ ADDRESS_BUS_Msk))) -sys_snode_t *soc_pd_sys_snode_get(void) -{ - return &soc_node; -} static void power_domain_init(void) { diff --git a/soc/nordic/nrf54h/soc.h b/soc/nordic/nrf54h/soc.h index 92c411ec9c9..566c07a8c2c 100644 --- a/soc/nordic/nrf54h/soc.h +++ b/soc/nordic/nrf54h/soc.h @@ -8,7 +8,6 @@ #define SOC_ARM_NORDIC_NRF_NRF54H_SOC_H_ #include -#include #if defined(CONFIG_SOC_NRF54H20_CPUAPP) #define RAMBLOCK_CONTROL_BIT_ICACHE MEMCONF_POWER_CONTROL_MEM1_Pos @@ -37,14 +36,4 @@ #define RAMBLOCK_RET2_BIT_DCACHE MEMCONF_POWER_RET2_MEM7_Pos #endif -/** - * @brief Get the ID of the node used by the power domain management. - * - * This function returns the node ID to be shared with other dependent modules. - * - * @return The pointer to the node assigned to the SOC module - * used for the power domain management purposes. - */ -sys_snode_t *soc_pd_sys_snode_get(void); - #endif /* SOC_ARM_NORDIC_NRF_NRF54H_SOC_H_ */