Skip to content

Commit 36e5878

Browse files
bjarki-andreasennordic-segl
authored andcommitted
[nrf fromtree] pm: refactor PM_S2RAM_CUSTOM_MARKING option to be promptless
The config PM_S2RAM_CUSTOM_MARKING is not an optional config for a user to select, it is required by some soc implementations of S2RAM, in which case it must be selected by the soc. Refactor the configuration to be HAS_PM_S2RAM_CUSTOM_MARKING, and make the currently only soc which needs it select it. Then update samples which previously had to select this option for this soc. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit 1767f13)
1 parent c828b62 commit 36e5878

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

arch/arm/core/cortex_m/pm_s2ram.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ __noinit
2828
#endif
2929
_cpu_context_t _cpu_context;
3030

31-
#ifndef CONFIG_PM_S2RAM_CUSTOM_MARKING
31+
#ifndef CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING
3232
/**
3333
* S2RAM Marker
3434
*/
@@ -50,4 +50,4 @@ bool pm_s2ram_mark_check_and_clear(void)
5050
return false;
5151
}
5252

53-
#endif /* CONFIG_PM_S2RAM_CUSTOM_MARKING */
53+
#endif /* CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING */

include/zephyr/arch/common/pm_s2ram.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ int arch_pm_s2ram_suspend(pm_s2ram_system_off_fn_t system_off);
6363
* Function is called when system state is stored to RAM, just before going to system
6464
* off.
6565
*
66-
* Default implementation is setting a magic word in RAM. CONFIG_PM_S2RAM_CUSTOM_MARKING
67-
* allows custom implementation.
66+
* Default implementation is setting a magic word in RAM used if
67+
* CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING is not set.
6868
*/
6969
void pm_s2ram_mark_set(void);
7070

@@ -74,8 +74,8 @@ void pm_s2ram_mark_set(void);
7474
* Function is used to determine if resuming after suspend-to-RAM shall be performed
7575
* or standard boot code shall be executed.
7676
*
77-
* Default implementation is checking a magic word in RAM. CONFIG_PM_S2RAM_CUSTOM_MARKING
78-
* allows custom implementation.
77+
* Default implementation is checking a magic word in RAM used if
78+
* CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING is not set.
7979
*
8080
* @retval true if marking is found which indicates resuming after suspend-to-RAM.
8181
* @retval false if marking is not found which indicates standard boot.

samples/boards/nordic/spis_wakeup/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ CONFIG_SPI_SLAVE=y
33
CONFIG_GPIO=y
44

55
CONFIG_PM=y
6-
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
76
CONFIG_PM_DEVICE=y
87
CONFIG_PM_DEVICE_RUNTIME=y
98

samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500
33
CONFIG_GPIO=y
44

55
CONFIG_PM=y
6-
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
76
CONFIG_PM_DEVICE=y
87
CONFIG_PM_DEVICE_RUNTIME=y
98

soc/nordic/nrf54h/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ config SOC_NRF54H20_CPUAPP_COMMON
3535
select NRFS_HAS_TEMP_SERVICE
3636
select NRFS_HAS_VBUS_DETECTOR_SERVICE
3737
select HAS_PM
38+
select HAS_PM_S2RAM_CUSTOM_MARKING
3839
select HAS_POWEROFF
3940

4041
config SOC_NRF54H20_CPUAPP
@@ -64,6 +65,7 @@ config SOC_NRF54H20_CPURAD_COMMON
6465
select HAS_NORDIC_DMM
6566
select HAS_NORDIC_RAM_CTRL
6667
select HAS_PM
68+
select HAS_PM_S2RAM_CUSTOM_MARKING
6769
select HAS_POWEROFF
6870

6971
config SOC_NRF54H20_CPURAD_ENABLE

subsys/pm/Kconfig

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ config HAS_PM
1010
This option must be selected by SoCs that provide PM hooks, that is,
1111
calls to configure low-power states.
1212

13+
config HAS_PM_S2RAM_CUSTOM_MARKING
14+
bool
15+
depends on HAS_PM
16+
help
17+
By default a magic word in RAM is used to mark entering suspend-to-RAM. If this
18+
option is selected, a custom implementation of functions which handle the marking
19+
must be provided.
20+
1321
config PM
1422
bool "System Power Management"
1523
depends on SYS_CLOCK_EXISTS && HAS_PM
@@ -45,13 +53,6 @@ config PM_S2RAM
4553
sleep states if PM is enabled and one or more suspend-to-ram sleep states are
4654
enabled in the devicetree.
4755

48-
config PM_S2RAM_CUSTOM_MARKING
49-
bool "Use custom marking functions"
50-
depends on PM_S2RAM
51-
help
52-
By default a magic word in RAM is used to mark entering suspend-to-RAM. Enabling
53-
this option allows custom implementation of functions which handle the marking.
54-
5556
config PM_NEED_ALL_DEVICES_IDLE
5657
bool "System Low Power Mode Needs All Devices Idle"
5758
depends on PM_DEVICE && !SMP

0 commit comments

Comments
 (0)