PDK API Guide for J721E
pmic_fsm.h File Reference

Introduction

PMIC Low Level Driver API/interface file for FSM API.

Go to the source code of this file.

Data Structures

struct  Pmic_FsmCfg_t
 PMIC FSM configuration structure. Note: validParams is input param for all Set and Get APIs. other params except validParams is input param for Set APIs and output param for Get APIs. More...
 

Macros

PMIC FSM Off Request Type

#define PMIC_FSM_I2C_TRIGGER0_TYPE   (0U)
 
#define PMIC_FSM_ENABLE_PIN_TYPE   (1U)
 
#define PMIC_FSM_NPWRON_PIN_TYPE   (2U)
 
To Select PMIC FSM State

#define PMIC_FSM_STANBY_STATE   (0U)
 
#define PMIC_FSM_LP_STANBY_STATE   (1U)
 
#define PMIC_FSM_ACTIVE_STATE   (2U)
 
#define PMIC_FSM_MCU_ONLY_STATE   (3U)
 
#define PMIC_FSM_S2R_STATE   (4U)
 
PMIC Nsleep Signals

#define PMIC_NSLEEP1_SIGNAL   (bool)false
 
#define PMIC_NSLEEP2_SIGNAL   (bool)true
 
PMIC Nsleep Masking/Unmasking

#define PMIC_NSLEEPX_MASK   1U
 
#define PMIC_NSLEEPX_UNMASK   0U
 
PMIC Fast BIST Enable/Disable

   This affects whether or not LBIST can be skipped to save boot up time
   from LP_STANDBY state.
   Application need to configure this before the device is turned off
   (using ENABLE pin or TRIGGER_I2C_0 bit) and enters LP_STANDBY state
#define PMIC_FSM_FAST_BIST_ENABLE   1U
 Only analog BIST is run at BOOT BIST. More...
 
#define PMIC_FSM_FAST_BIST_DISABLE   0U
 Logic and analog BIST is run at BOOT BIST. More...
 
PMIC Nsleep FSM configuration

#define PMIC_NSLEEP1B_FSM_UNMASK   (0U)
 
#define PMIC_NSLEEP1B_FSM_MASK   (1U)
 
#define PMIC_NSLEEP2B_FSM_UNMASK   (0U)
 
#define PMIC_NSLEEP2B_FSM_MASK   (1U)
 
Select PMIC FSM Startup Destination

#define PMIC_FSM_STARTUPDEST_STANDBY_LPSTANDBY   (0U)
 Selects PMIC FSM Startup Destination as STANDBY state or LPSTANDBY state based on LP_STANDBY_SEL. More...
 
#define PMIC_FSM_STARTUPDEST_MCUONLY   (2U)
 Selects PMIC FSM Startup Destination as MCU only state. More...
 
#define PMIC_FSM_STARTUPDEST_ACTIVE   (3U)
 Selects PMIC FSM Startup Destination as Active state. More...
 
PMIC LPSTANDBY State Selection

#define PMIC_FSM_SELECT_LPSTANDBY_STATE   1U
 
#define PMIC_FSM_SELECT_STANDBY_STATE   0U
 
To Enable/Disable PMIC Buck/LDO regulators ILIM interrupts affect

FSM triggers

#define PMIC_FSM_ILIM_INT_FSMCTRL_ENABLE   1U
 
#define PMIC_FSM_ILIM_INT_FSMCTRL_DISABLE   0U
 
PMIC PFSM Delay Type

#define PMIC_PFSM_DELAY1   (0U)
 
#define PMIC_PFSM_DELAY2   (1U)
 
#define PMIC_PFSM_DELAY3   (2U)
 
#define PMIC_PFSM_DELAY4   (3U)
 
PMIC FSM Configuration Structure Param Bits

PMIC FSM valid params configuration type for the structure member validParams of Pmic_FsmCfg_t structure

#define PMIC_FSM_CFG_FAST_BIST_EN_VALID   (0U)
 validParams value used to set/get to Enable/Disable Fast BIST More...
 
#define PMIC_FSM_CFG_LP_STANDBYSEL_VALID   (1U)
 validParams value used to set/get Low Power Standby State Selection More...
 
#define PMIC_FSM_CFG_ILIM_INT_FSMCTRL_EN_VALID   (2U)
 validParams value used to set/get to Enable/Disable Buck/LDO regulators ILIM interrupts affect FSM triggers More...
 
#define PMIC_FSM_CFG_FSM_STARTUP_DEST_SEL_VALID   (3U)
 validParams value used to set/get to Select FSM Startup Destination More...
 
PMIC FSM Configuration valid param bit shift values

Application can use below shifted values to set the validParam member defined in Pmic_FsmCfg_t structure

#define PMIC_FSM_CFG_FAST_BIST_EN_VALID_SHIFT   (1U << PMIC_FSM_CFG_FAST_BIST_EN_VALID)
 
#define PMIC_FSM_CFG_LP_STANDBYSEL_VALID_SHIFT   (1U << PMIC_FSM_CFG_LP_STANDBYSEL_VALID)
 
#define PMIC_FSM_CFG_ILIM_INT_FSMCTRL_EN_VALID_SHIFT   (1U << PMIC_FSM_CFG_ILIM_INT_FSMCTRL_EN_VALID)
 
#define PMIC_FSM_CFG_FSM_STARTUP_DEST_SEL_VALID_SHIFT   (1U << PMIC_FSM_CFG_FSM_STARTUP_DEST_SEL_VALID)
 
PMIC Nsleep 1B/2B signal level

#define PMIC_NSLEEP_LOW   (0U)
 
#define PMIC_NSLEEP_HIGH   (1U)
 
PMIC FSM I2C Trigger Type

#define PMIC_FSM_I2C_TRIGGER0   (0x0U)
 
#define PMIC_FSM_I2C_TRIGGER1   (0x1U)
 Valid only for TPS6594x Leo PMIC PG2.0 and LP8764x Hera PMIC PG2.0. More...
 
#define PMIC_FSM_I2C_TRIGGER2   (0x2U)
 Valid only for TPS6594x Leo PMIC PG2.0 and LP8764x Hera PMIC PG2.0. More...
 
#define PMIC_FSM_I2C_TRIGGER3   (0x3U)
 Configuration of PMIC_FSM_I2C_TRIGGER3 is not supported for TPS6594x Leo and LP8764x Hera PMIC. More...
 
#define PMIC_FSM_I2C_TRIGGER4   (0x4U)
 
#define PMIC_FSM_I2C_TRIGGER5   (0x5U)
 
#define PMIC_FSM_I2C_TRIGGER6   (0x6U)
 
#define PMIC_FSM_I2C_TRIGGER7   (0x7U)
 
PMIC FSM I2C Trigger Value

#define PMIC_FSM_I2C_TRIGGER_VAL_0   (0x0U)
 Valid only for I2C4/ I2C5/ I2C6/ I2C7. More...
 
#define PMIC_FSM_I2C_TRIGGER_VAL_1   (0x1U)
 
PMIC FSM Retention Mode

#define PMIC_FSM_DDR_RETENTION_MODE   (0x0U)
 
#define PMIC_FSM_GPIO_RETENTION_MODE   (0x1U)
 Valid only for J7200 SOC. More...
 

Functions

int32_t Pmic_fsmDeviceOffRequestCfg (Pmic_CoreHandle_t *pPmicCoreHandle, uint8_t eventType, uint8_t fsmState)
 API to initiate OFF Request FSM transition. More...
 
int32_t Pmic_fsmDeviceOnRequest (Pmic_CoreHandle_t *pPmicCoreHandle)
 API to initiate ON Request FSM transition. More...
 
int32_t Pmic_fsmSetMissionState (Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t pmicState)
 API to Set FSM mission States. More...
 
int32_t Pmic_fsmSetNsleepSignalMask (Pmic_CoreHandle_t *pPmicCoreHandle, const bool nsleepType, const bool maskEnable)
 API to MASK/UNMASK NSLEEP1B or 2B Signal. More...
 
int32_t Pmic_fsmGetNsleepSignalMaskStat (Pmic_CoreHandle_t *pPmicCoreHandle, const bool nsleepType, bool *pNsleepStat)
 API to read the status of the NSLEEP1B/2B Signal is masked or not. More...
 
int32_t Pmic_fsmRequestRuntimeBist (Pmic_CoreHandle_t *pPmicCoreHandle)
 API to initiate Runtime BIST. More...
 
int32_t Pmic_fsmSetConfiguration (Pmic_CoreHandle_t *pPmicCoreHandle, const Pmic_FsmCfg_t fsmCfg)
 API to set PMIC FSM configuration. More...
 
int32_t Pmic_fsmGetConfiguration (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_FsmCfg_t *pFsmCfg)
 API to get PMIC FSM configuration. More...
 
int32_t Pmic_fsmSetPfsmDelay (Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t pFsmDelayType, const uint8_t pfsmDelay)
 API to configure PFSM Delay. More...
 
int32_t Pmic_fsmGetPfsmDelay (Pmic_CoreHandle_t *pPmicCoreHandle, uint8_t pFsmDelayType, uint8_t *pPfsmDelay)
 API to read PFSM Delay. More...
 
int32_t Pmic_fsmSetNsleepSignalVal (Pmic_CoreHandle_t *pPmicCoreHandle, const bool nsleepType, const uint8_t nsleepVal)
 API to set PMIC Nsleep1B/2B Signal value. More...
 
int32_t Pmic_fsmGetNsleepSignalVal (Pmic_CoreHandle_t *pPmicCoreHandle, const bool nsleepType, uint8_t *pNsleepVal)
 API to get PMIC Nsleep1B/2B Signal value. More...
 
int32_t Pmic_fsmRecoverSocPwrErr (Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t nsleepVal)
 API to recover from SOC Power Error using Nsleep1B and Nsleep2B signal. More...
 
int32_t Pmic_fsmEnableI2cTrigger (Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t i2cTriggerType, const uint8_t i2cTriggerVal)
 API to initiate FSM I2C trigger for given FSM I2C trigger type. More...
 
int32_t Pmic_fsmGetI2cTriggerVal (Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t i2cTriggerType, uint8_t *pI2cTriggerVal)
 API to get FSM I2C trigger Value for given FSM I2C trigger type. More...
 
int32_t Pmic_fsmRequestDdrGpioRetentionMode (Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t retentionMode, const uint8_t i2cTriggerVal)
 API to initiate DDR/GPIO Retention Mode. More...