47 #include "power_smc_hw_access.h"
48 #include "power_rcm_hw_access.h"
52 #define POWER_SET_MODE_TIMEOUT 1000U
146 #if FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE
147 powerModeProtConfig.hsrunProt =
false;
149 powerModeProtConfig.
vlpProt =
false;
154 #if FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE
155 if (config->
powerMode == POWER_MANAGER_HSRUN)
157 powerModeProtConfig.hsrunProt =
true;
162 powerModeProtConfig.
vlpProt =
true;
166 SMC_SetProtectionMode(
SMC, &powerModeProtConfig);
222 switch (SMC_GetPowerModeStatus(
SMC))
224 #if FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE
227 retVal = POWER_MANAGER_HSRUN;
270 #if FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE
287 if (SMC_GetPowerModeStatus(
SMC) == modeStat)
316 static bool changeClkVlpr =
false;
324 #if FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE
326 case POWER_MANAGER_HSRUN:
341 changeClkVlpr =
false;
344 returnCode = SMC_SetPowerMode(
SMC, &modeConfig);
360 returnCode = SMC_SetPowerMode(
SMC, &modeConfig);
369 changeClkVlpr =
false;
390 changeClkVlpr =
true;
393 returnCode = SMC_SetPowerMode(
SMC, &modeConfig);
427 uint32_t predivSysFre;
433 #if FEATURE_SMC_HAS_WAIT_VLPW
435 case POWER_MANAGER_WAIT:
446 case POWER_MANAGER_VLPW:
457 #if FEATURE_SMC_HAS_PSTOPO
459 case POWER_MANAGER_PSTOP1:
461 case POWER_MANAGER_PSTOP2:
464 #if FEATURE_SMC_HAS_STOPO
478 #if FEATURE_SMC_HAS_PSTOPO
479 modeConfig.pstopOption =
true;
481 if (POWER_MANAGER_PSTOP1 == configPtr->
powerMode)
483 modeConfig.pstopOptionValue = SMC_PSTOP_STOP1;
485 else if (POWER_MANAGER_PSTOP2 == configPtr->
powerMode)
487 modeConfig.pstopOptionValue = SMC_PSTOP_STOP2;
491 modeConfig.pstopOptionValue = SMC_PSTOP_STOP;
495 #if FEATURE_SMC_HAS_STOPO
513 returnCode = SMC_SetPowerMode(
SMC, &modeConfig);
568 if ((currentSystemClockSource !=
SIRC_CLK) && (currentSystemClockSource !=
SOSC_CLK))
641 return RCM_GetSrcStatusCmd(baseAddr , srcName);
static status_t POWER_SYS_SwitchToRunningPowerMode(const power_manager_user_config_t *const configPtr)
power_manager_state_t gPowerManagerState
Power manager internal structure.
power_mode_stat_t
Power Modes in PMSTAT.
bool POWER_SYS_GetResetSrcStatusCmd(const RCM_Type *const baseAddr, const rcm_source_names_t srcName)
Gets the reset source status.
Power mode protection configuration.
power_manager_modes_t powerModeName
status_t POWER_SYS_DoDeinit(void)
This function implementation-specific de-initialization of power manager.
status_t CLOCK_DRV_SetSystemClock(const pwr_modes_t *mode, const sys_clk_config_t *sysClkConfig)
Configures the system clocks.
static status_t POWER_DRV_SwitchVlprClk(const sys_clk_config_t *const sysClock)
status_t POWER_SYS_DoInit(void)
This function implementation-specific configuration of power modes.
smc_run_mode_t
Run mode definition.
void CLOCK_DRV_GetSystemClockSource(sys_clk_config_t *sysClkConfig)
Gets the system clock source.
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
#define S32_SCB_SCR_SLEEPONEXIT_MASK
power_manager_modes_t POWER_SYS_GetCurrentMode(void)
This function returns currently running power mode.
rcm_source_names_t
System Reset Source Name definitions Implements rcm_source_names_t_Class.
power_manager_user_config_t *(* configs)[]
Power mode control configuration used for calling the SMC_SYS_SetPowerMode API.
Power mode user configuration structure.
static status_t POWER_SYS_WaitForModeStatus(smc_run_mode_t mode)
static status_t POWER_SYS_SwitchToSleepingPowerMode(const power_manager_user_config_t *const configPtr)
Power manager internal state structure.
static status_t POWER_DRV_UpdateInitClk(const sys_clk_config_t *const sysClk, bool allowUpdate)
power_manager_modes_t powerMode
clock_names_t
Clock names.
status_t CLOCK_DRV_GetFreq(clock_names_t clockName, uint32_t *frequency)
Return frequency.
#define POWER_SET_MODE_TIMEOUT
power_manager_modes_t
Power modes enumeration.
status_t POWER_SYS_DoSetMode(const power_manager_user_config_t *const configPtr)
This function configures the power mode.
smc_stop_option_t stopOptionValue
System clock configuration. Implements sys_clk_config_t_Class.