1616#include "soc.h"
1717#include "pm_s2ram.h"
1818
19+ extern sys_snode_t soc_node ;
20+
1921static void common_suspend (void )
2022{
21- sys_snode_t * node ;
22-
23- node = soc_pd_sys_snode_get ();
24-
2523 if (IS_ENABLED (CONFIG_DCACHE )) {
2624 /* Flush, disable and power down DCACHE */
2725 sys_cache_data_flush_all ();
@@ -37,15 +35,11 @@ static void common_suspend(void)
3735 RAMBLOCK_CONTROL_BIT_ICACHE , false);
3836 }
3937
40- soc_lrcconf_poweron_release (node , NRF_LRCCONF_POWER_DOMAIN_0 );
38+ soc_lrcconf_poweron_release (& soc_node , NRF_LRCCONF_POWER_DOMAIN_0 );
4139}
4240
4341static void common_resume (void )
4442{
45- sys_snode_t * node ;
46-
47- node = soc_pd_sys_snode_get ();
48-
4943 if (IS_ENABLED (CONFIG_ICACHE )) {
5044 /* Power up and re-enable ICACHE */
5145 nrf_memconf_ramblock_control_enable_set (NRF_MEMCONF , RAMBLOCK_POWER_ID ,
@@ -60,15 +54,15 @@ static void common_resume(void)
6054 sys_cache_data_enable ();
6155 }
6256
63- soc_lrcconf_poweron_request (node , NRF_LRCCONF_POWER_DOMAIN_0 );
57+ soc_lrcconf_poweron_request (& soc_node , NRF_LRCCONF_POWER_DOMAIN_0 );
6458}
6559
6660void nrf_poweroff (void )
6761{
6862 nrf_resetinfo_resetreas_local_set (NRF_RESETINFO , 0 );
6963 nrf_resetinfo_restore_valid_set (NRF_RESETINFO , false);
7064
71- #if !defined(NRF_RADIOCORE )
65+ #if !defined(CONFIG_SOC_NRF54H20_CPURAD )
7266 /* Disable retention */
7367 nrf_lrcconf_retain_set (NRF_LRCCONF010 , NRF_LRCCONF_POWER_MAIN , false);
7468 nrf_lrcconf_retain_set (NRF_LRCCONF010 , NRF_LRCCONF_POWER_DOMAIN_0 , false);
@@ -87,19 +81,15 @@ void nrf_poweroff(void)
8781
8882static void s2idle_enter (uint8_t substate_id )
8983{
90- sys_snode_t * node ;
91-
92- node = soc_pd_sys_snode_get ();
93-
9484 switch (substate_id ) {
9585 case 0 :
9686 /* Substate for idle with cache powered on - not implemented yet. */
9787 break ;
9888 case 1 : /* Substate for idle with cache retained - not implemented yet. */
9989 break ;
10090 case 2 : /* Substate for idle with cache disabled. */
101- #if !defined(NRF_RADIOCORE )
102- soc_lrcconf_poweron_request (node , NRF_LRCCONF_POWER_MAIN );
91+ #if !defined(CONFIG_SOC_NRF54H20_CPURAD )
92+ soc_lrcconf_poweron_request (& soc_node , NRF_LRCCONF_POWER_MAIN );
10393#endif
10494 common_suspend ();
10595 break ;
@@ -115,10 +105,6 @@ static void s2idle_enter(uint8_t substate_id)
115105
116106static void s2idle_exit (uint8_t substate_id )
117107{
118- sys_snode_t * node ;
119-
120- node = soc_pd_sys_snode_get ();
121-
122108 switch (substate_id ) {
123109 case 0 :
124110 /* Substate for idle with cache powered on - not implemented yet. */
@@ -127,8 +113,8 @@ static void s2idle_exit(uint8_t substate_id)
127113 break ;
128114 case 2 : /* Substate for idle with cache disabled. */
129115 common_resume ();
130- #if !defined(NRF_RADIOCORE )
131- soc_lrcconf_poweron_release (node , NRF_LRCCONF_POWER_MAIN );
116+ #if !defined(CONFIG_SOC_NRF54H20_CPURAD )
117+ soc_lrcconf_poweron_release (& soc_node , NRF_LRCCONF_POWER_MAIN );
132118#endif
133119 default : /* Unknown substate. */
134120 return ;
@@ -140,7 +126,7 @@ static void s2idle_exit(uint8_t substate_id)
140126static void s2ram_exit (void )
141127{
142128 common_resume ();
143- #if !defined(NRF_RADIOCORE )
129+ #if !defined(CONFIG_SOC_NRF54H20_CPURAD )
144130 /* Re-enable domain retention. */
145131 nrf_lrcconf_retain_set (NRF_LRCCONF010 , NRF_LRCCONF_POWER_DOMAIN_0 , true);
146132#endif
@@ -156,7 +142,7 @@ static int sys_suspend_to_ram(void)
156142 NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK );
157143 nrf_resetinfo_restore_valid_set (NRF_RESETINFO , true);
158144
159- #if !defined(NRF_RADIOCORE )
145+ #if !defined(CONFIG_SOC_NRF54H20_CPURAD )
160146 /* Disable retention */
161147 nrf_lrcconf_retain_set (NRF_LRCCONF010 , NRF_LRCCONF_POWER_DOMAIN_0 , false);
162148#endif
0 commit comments