AM62L FreeRTOS SDK  11.00.00

Introduction

This module contains APIs to program and use the PSCI module.

Files

file  scp/psci/v0/psci.h
 PSCI Driver API/interface file.
 

Data Structures

struct  PSCI_Object
 PSCI driver object. More...
 
struct  PSCI_Config
 PSCI Global Configuration. More...
 

Functions

void PSCI_init (void)
 Initialize the PSCI module. More...
 
void PSCI_deinit (void)
 Deinitialize the PSCI module. More...
 
PSCI_Handle PSCI_open (uint32_t idx)
 Open the PSCI at index idx. More...
 
void PSCI_close (PSCI_Handle handle)
 Function to close the PSCI instance specified by the handle. More...
 
PSCI_Handle PSCI_getHandle (uint32_t driverInstanceIndex)
 This function returns the handle of an open PSCI Instance from the instance index. More...
 
uint32_t PSCI_getInitDriverIndex (void)
 This function returns the initialised instance index. More...
 
int32_t PSCI_getPSCIVersion (PSCI_Handle handle, uint32_t *psciVer)
 Get the PSCI version. More...
 
int32_t PSCI_cpuOff (PSCI_Handle handle)
 Power off the calling CPU. More...
 
int32_t PSCI_cpuOn (PSCI_Handle handle, uint32_t cpuId, uint32_t entryPoint)
 Power on the CPU required. More...
 
int32_t PSCI_systemReset (PSCI_Handle handle)
 Cold reset of the entire system. More...
 
int32_t PSCI_getFeatures (PSCI_Handle handle, uint32_t functionId, uint32_t *feature)
 Get the features of a PSCI function. More...
 

Typedefs

typedef struct PSCI_Config_s * PSCI_Handle
 A handle that is returned from a PSCI_open() call. More...
 

Macros

#define PSCI_BASE_FUNC   (uint32_t) 0x84000000U
 
#define PSCI_FUNC(n)   (PSCI_BASE_FUNC + (n))
 
#define PSCI_FUNC_OFF_64BIT   (uint32_t) 0x40000000U
 
#define PSCI_BASE_FUNC_64BIT    (PSCI_BASE_FUNC + PSCI_FUNC_OFF_64BIT)
 
#define PSCI_FUNC_64BIT(n)   (PSCI_BASE_FUNC_64BIT + (n))
 
#define PSCI_FUNC_PSCI_VERSION   PSCI_FUNC(0)
 
#define PSCI_FUNC_CPU_OFF   PSCI_FUNC(2)
 
#define PSCI_FUNC_SYSTEM_RESET   PSCI_FUNC(9)
 
#define PSCI_FUNC_CPU_ON_64BIT   PSCI_FUNC_64BIT(3)
 
#define PSCI_FUNC_PSCI_FEATURES   PSCI_FUNC(10)
 
#define PSCI_MAJOR_VERSION_SHIFT   (16U)
 
#define PSCI_MINOR_VERSION_MASK    ((1U << PSCI_MAJOR_VERSION_SHIFT) - 1)
 
#define PSCI_MAJOR_VERSION_MASK   ~PSCI_MINOR_VERSION_MASK
 
#define PSCI_MAJOR_VERSION(ver)    (((ver) & PSCI_MAJOR_VERSION_MASK) >> PSCI_MAJOR_VERSION_SHIFT)
 
#define PSCI_MINOR_VERSION(ver)    ((ver) & PSCI_MINOR_VERSION_MASK)
 
#define PSCI_SUCCESS   (0)
 
#define PSCI_NOT_SUPPORTED   (-1)
 
#define PSCI_INVALID_PARAMS   (-2)
 
#define PSCI_DENIED   (-3)
 
#define PSCI_ALREADY_ON   (-4)
 
#define PSCI_ON_PENDING   (-5)
 
#define PSCI_INTERNAL_FAILURE   (-6)
 
#define PSCI_NOT_PRESENT   (-7)
 
#define PSCI_DISABLED   (-8)
 
#define PSCI_INVALID_ADDRESS   (-9)
 

Macro Definition Documentation

◆ PSCI_BASE_FUNC

#define PSCI_BASE_FUNC   (uint32_t) 0x84000000U

◆ PSCI_FUNC

#define PSCI_FUNC (   n)    (PSCI_BASE_FUNC + (n))

◆ PSCI_FUNC_OFF_64BIT

#define PSCI_FUNC_OFF_64BIT   (uint32_t) 0x40000000U

◆ PSCI_BASE_FUNC_64BIT

#define PSCI_BASE_FUNC_64BIT    (PSCI_BASE_FUNC + PSCI_FUNC_OFF_64BIT)

◆ PSCI_FUNC_64BIT

#define PSCI_FUNC_64BIT (   n)    (PSCI_BASE_FUNC_64BIT + (n))

◆ PSCI_FUNC_PSCI_VERSION

#define PSCI_FUNC_PSCI_VERSION   PSCI_FUNC(0)

◆ PSCI_FUNC_CPU_OFF

#define PSCI_FUNC_CPU_OFF   PSCI_FUNC(2)

◆ PSCI_FUNC_SYSTEM_RESET

#define PSCI_FUNC_SYSTEM_RESET   PSCI_FUNC(9)

◆ PSCI_FUNC_CPU_ON_64BIT

#define PSCI_FUNC_CPU_ON_64BIT   PSCI_FUNC_64BIT(3)

◆ PSCI_FUNC_PSCI_FEATURES

#define PSCI_FUNC_PSCI_FEATURES   PSCI_FUNC(10)

◆ PSCI_MAJOR_VERSION_SHIFT

#define PSCI_MAJOR_VERSION_SHIFT   (16U)

◆ PSCI_MINOR_VERSION_MASK

#define PSCI_MINOR_VERSION_MASK    ((1U << PSCI_MAJOR_VERSION_SHIFT) - 1)

◆ PSCI_MAJOR_VERSION_MASK

#define PSCI_MAJOR_VERSION_MASK   ~PSCI_MINOR_VERSION_MASK

◆ PSCI_MAJOR_VERSION

#define PSCI_MAJOR_VERSION (   ver)     (((ver) & PSCI_MAJOR_VERSION_MASK) >> PSCI_MAJOR_VERSION_SHIFT)

◆ PSCI_MINOR_VERSION

#define PSCI_MINOR_VERSION (   ver)     ((ver) & PSCI_MINOR_VERSION_MASK)

◆ PSCI_SUCCESS

#define PSCI_SUCCESS   (0)

◆ PSCI_NOT_SUPPORTED

#define PSCI_NOT_SUPPORTED   (-1)

◆ PSCI_INVALID_PARAMS

#define PSCI_INVALID_PARAMS   (-2)

◆ PSCI_DENIED

#define PSCI_DENIED   (-3)

◆ PSCI_ALREADY_ON

#define PSCI_ALREADY_ON   (-4)

◆ PSCI_ON_PENDING

#define PSCI_ON_PENDING   (-5)

◆ PSCI_INTERNAL_FAILURE

#define PSCI_INTERNAL_FAILURE   (-6)

◆ PSCI_NOT_PRESENT

#define PSCI_NOT_PRESENT   (-7)

◆ PSCI_DISABLED

#define PSCI_DISABLED   (-8)

◆ PSCI_INVALID_ADDRESS

#define PSCI_INVALID_ADDRESS   (-9)

Typedef Documentation

◆ PSCI_Handle

typedef struct PSCI_Config_s* PSCI_Handle

A handle that is returned from a PSCI_open() call.

Function Documentation

◆ PSCI_init()

void PSCI_init ( void  )

Initialize the PSCI module.

◆ PSCI_deinit()

void PSCI_deinit ( void  )

Deinitialize the PSCI module.

◆ PSCI_open()

PSCI_Handle PSCI_open ( uint32_t  idx)

Open the PSCI at index idx.

Parameters
idx[IN] Index of PSCI to open in global config
Returns
PSCI_Handle

◆ PSCI_close()

void PSCI_close ( PSCI_Handle  handle)

Function to close the PSCI instance specified by the handle.

Precondition
PSCI_open() has to be called first
Parameters
handle[IN] PSCI_Handle returned from PSCI_open()
See also
PSCI_open()

◆ PSCI_getHandle()

PSCI_Handle PSCI_getHandle ( uint32_t  driverInstanceIndex)

This function returns the handle of an open PSCI Instance from the instance index.

Parameters
driverInstanceIndexIndex of config to use in the PSCI_Config array
Returns
An PSCI_Handle if it has been opened already or NULL otherwise

◆ PSCI_getInitDriverIndex()

uint32_t PSCI_getInitDriverIndex ( void  )

This function returns the initialised instance index.

Returns
instanceIndex First instance which is open for PSCI driver

◆ PSCI_getPSCIVersion()

int32_t PSCI_getPSCIVersion ( PSCI_Handle  handle,
uint32_t *  psciVer 
)

Get the PSCI version.

Parameters
handle[IN] PSCI_Handle returned from PSCI_open()
psciVer[OUT] Pointer to PSCI version.
Returns
PSCI_StatusCode

◆ PSCI_cpuOff()

int32_t PSCI_cpuOff ( PSCI_Handle  handle)

Power off the calling CPU.

Parameters
handle[IN] PSCI_Handle returned from PSCI_open()
Returns
SystemP_FAILURE if failure, else should never return.

◆ PSCI_cpuOn()

int32_t PSCI_cpuOn ( PSCI_Handle  handle,
uint32_t  cpuId,
uint32_t  entryPoint 
)

Power on the CPU required.

Parameters
handle[IN] PSCI_Handle returned from PSCI_open()
cpuId[IN] CPU ID of the CPU required to be powered on.
entryPoint[IN] Entry Point of the CPU in the non-secure world.
Returns
PSCI_StatusCode

◆ PSCI_systemReset()

int32_t PSCI_systemReset ( PSCI_Handle  handle)

Cold reset of the entire system.

Parameters
handle[IN] PSCI_Handle returned from PSCI_open()
Returns
SystemP_FAILURE if failure, else should never return.

◆ PSCI_getFeatures()

int32_t PSCI_getFeatures ( PSCI_Handle  handle,
uint32_t  functionId,
uint32_t *  feature 
)

Get the features of a PSCI function.

Parameters
handle[IN] PSCI_Handle returned from PSCI_open()
functionId[IN] PSCI Function ID whose features are needed.
feature[OUT] Pointer to the PSCI feature result.
Returns
PSCI_StatusCode