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 <bjarki.andreasen@nordicsemi.no>
This commit is contained in:
committed by
Chris Friedt
parent
4626f6b776
commit
1767f131aa
@@ -28,7 +28,7 @@ __noinit
|
||||
#endif
|
||||
_cpu_context_t _cpu_context;
|
||||
|
||||
#ifndef CONFIG_PM_S2RAM_CUSTOM_MARKING
|
||||
#ifndef CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING
|
||||
/**
|
||||
* S2RAM Marker
|
||||
*/
|
||||
@@ -50,4 +50,4 @@ bool pm_s2ram_mark_check_and_clear(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PM_S2RAM_CUSTOM_MARKING */
|
||||
#endif /* CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING */
|
||||
|
||||
@@ -63,8 +63,8 @@ int arch_pm_s2ram_suspend(pm_s2ram_system_off_fn_t system_off);
|
||||
* Function is called when system state is stored to RAM, just before going to system
|
||||
* off.
|
||||
*
|
||||
* Default implementation is setting a magic word in RAM. CONFIG_PM_S2RAM_CUSTOM_MARKING
|
||||
* allows custom implementation.
|
||||
* Default implementation is setting a magic word in RAM used if
|
||||
* CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING is not set.
|
||||
*/
|
||||
void pm_s2ram_mark_set(void);
|
||||
|
||||
@@ -74,8 +74,8 @@ void pm_s2ram_mark_set(void);
|
||||
* Function is used to determine if resuming after suspend-to-RAM shall be performed
|
||||
* or standard boot code shall be executed.
|
||||
*
|
||||
* Default implementation is checking a magic word in RAM. CONFIG_PM_S2RAM_CUSTOM_MARKING
|
||||
* allows custom implementation.
|
||||
* Default implementation is checking a magic word in RAM used if
|
||||
* CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING is not set.
|
||||
*
|
||||
* @retval true if marking is found which indicates resuming after suspend-to-RAM.
|
||||
* @retval false if marking is not found which indicates standard boot.
|
||||
|
||||
@@ -3,7 +3,6 @@ CONFIG_SPI_SLAVE=y
|
||||
CONFIG_GPIO=y
|
||||
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
|
||||
CONFIG_PM_DEVICE=y
|
||||
CONFIG_PM_DEVICE_RUNTIME=y
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500
|
||||
CONFIG_GPIO=y
|
||||
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
|
||||
CONFIG_PM_DEVICE=y
|
||||
CONFIG_PM_DEVICE_RUNTIME=y
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ config SOC_NRF54H20_CPUAPP_COMMON
|
||||
select NRFS_HAS_TEMP_SERVICE
|
||||
select NRFS_HAS_VBUS_DETECTOR_SERVICE
|
||||
select HAS_PM
|
||||
select HAS_PM_S2RAM_CUSTOM_MARKING
|
||||
select HAS_POWEROFF
|
||||
|
||||
config SOC_NRF54H20_CPUAPP
|
||||
@@ -64,6 +65,7 @@ config SOC_NRF54H20_CPURAD_COMMON
|
||||
select HAS_NORDIC_DMM
|
||||
select HAS_NORDIC_RAM_CTRL
|
||||
select HAS_PM
|
||||
select HAS_PM_S2RAM_CUSTOM_MARKING
|
||||
select HAS_POWEROFF
|
||||
|
||||
config SOC_NRF54H20_TDD_ENABLE
|
||||
|
||||
@@ -10,6 +10,14 @@ config HAS_PM
|
||||
This option must be selected by SoCs that provide PM hooks, that is,
|
||||
calls to configure low-power states.
|
||||
|
||||
config HAS_PM_S2RAM_CUSTOM_MARKING
|
||||
bool
|
||||
depends on HAS_PM
|
||||
help
|
||||
By default a magic word in RAM is used to mark entering suspend-to-RAM. If this
|
||||
option is selected, a custom implementation of functions which handle the marking
|
||||
must be provided.
|
||||
|
||||
config PM
|
||||
bool "System Power Management"
|
||||
depends on SYS_CLOCK_EXISTS && HAS_PM
|
||||
@@ -45,13 +53,6 @@ config PM_S2RAM
|
||||
sleep states if PM is enabled and one or more suspend-to-ram sleep states are
|
||||
enabled in the devicetree.
|
||||
|
||||
config PM_S2RAM_CUSTOM_MARKING
|
||||
bool "Use custom marking functions"
|
||||
depends on PM_S2RAM
|
||||
help
|
||||
By default a magic word in RAM is used to mark entering suspend-to-RAM. Enabling
|
||||
this option allows custom implementation of functions which handle the marking.
|
||||
|
||||
config PM_NEED_ALL_DEVICES_IDLE
|
||||
bool "System Low Power Mode Needs All Devices Idle"
|
||||
depends on PM_DEVICE && !SMP
|
||||
|
||||
Reference in New Issue
Block a user