AM62L FreeRTOS SDK  11.00.00
SCMI

System Control and Management Interface (SCMI) is a standardized protocol for communication between platform management controllers (Trusted Firmware-A) and application processors. It provides a unified interface for system control and management operations.

Features Supported

  • Message-based communication protocol
  • Power domain control
  • Clock management
  • Support for multiple transport protocols
  • Protocol versioning

SysConfig Features

  • SCMI init and open is done by default through sysconfig generated code.
  • SCMI init and open has been done before power and clock are enabled for the peripherals in the sysconfig generated code.

Important Usage Guidelines

  • Most of these APIs are already integrated with SysConfig tool and the generated code does the required call to enable a module, set the required clock and so on through the SoC layer.
  • User may not need to perform any explicit configuration for power domain and clock, unless it's needed in exceptional scenarios.

Features NOT Supported

NA

Example Usage

Include the below file to access the APIs

#include <drivers/scmi.h>

Base protocol versioning example

int32_t status;
uint32_t version;
SCMI_Handle handle = SCMI_getHandle(CONFIG_SCMI_INSTANCE);
/* Get Power Domain Protocol Version */
DebugP_log("SCMI_PROTOCOL_POWER: version : %x\r\n", version);
/* Get Clock Domain Protocol Version */
DebugP_log("SCMI_PROTOCOL_CLOCK: version : %x\r\n", version);

Power domain state set and get example

int32_t status;
uint32_t flags = 0U;
/* Power on */
status = SCMI_powerDomainStateSet(handle, TEST_SCMI_PD_AM62LX_DEV_MMCSD0,
/* Check the power state */
status = SCMI_powerDomainStateGet(handle, TEST_SCMI_PD_AM62LX_DEV_MMCSD0,
&pstate);
DebugP_asssert(pstate == SCMI_PWD_POWER_STATE_ON);

Clock rate get and set example

int32_t status;
uint64_t clockRate;
SCMI_Handle handle = SCMI_getHandle(CONFIG_SCMI_INSTANCE);
/* Get clock rate */
status = SCMI_clockRateGet(handle, TEST_CLK_AM62LX_DEV_FSS0_OSPI0_RCLK_CLK,
&clockRate);
DebugP_log("SCMI_PROTOCOL_CLOCK: TEST_CLK_AM62LX_DEV_FSS0_OSPI0_RCLK_CLK: Get Rate : %d\r\n", clockRate);
/* Set clock rate */
clockRate = TEST_CLK_AM62LX_CLOCK_FREQ;
status = SCMI_clockRateSet(handle, TEST_CLK_AM62LX_DEV_FSS0_OSPI0_RCLK_CLK,
clockRate);

API

APIs for SCMI

SCMI_PROTOCOL_CLOCK
@ SCMI_PROTOCOL_CLOCK
Definition: scmi_protocol.h:125
SCMI_PWD_POWER_STATE_ON
#define SCMI_PWD_POWER_STATE_ON
Definition: scmi_protocol.h:63
SCMI_Handle
void * SCMI_Handle
A handle that is returned from a SCMI_open() call.
Definition: scp/scmi/v0/scmi.h:68
SCMI_baseGenericProtocolVersion
int32_t SCMI_baseGenericProtocolVersion(SCMI_Handle handle, SCMI_StandardProtocol protocolId, uint32_t *version)
API to get generic protocol version.
DebugP_log
#define DebugP_log(format,...)
Function to log a string to the enabled console.
Definition: DebugP.h:235
SCMI_powerDomainStateGet
int32_t SCMI_powerDomainStateGet(SCMI_Handle handle, uint32_t domainId, uint32_t *pstate)
API to get power domain state.
SCMI_clockRateGet
int32_t SCMI_clockRateGet(SCMI_Handle handle, uint32_t clockId, uint64_t *clockRate)
API to get clock rate for a clock.
scmi.h
SystemP_SUCCESS
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
SCMI_clockRateSet
int32_t SCMI_clockRateSet(SCMI_Handle handle, uint32_t clockId, uint64_t clockRate)
API to set clock rate for a clock.
flags
uint32_t flags
Definition: csl_udmap_tr.h:0
SCMI_PROTOCOL_POWER
@ SCMI_PROTOCOL_POWER
Definition: scmi_protocol.h:122
SCMI_getHandle
SCMI_Handle SCMI_getHandle(uint32_t driverInstanceIndex)
This function returns the handle of an open SCMI Instance from the instance index.
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:183
SCMI_powerDomainStateSet
int32_t SCMI_powerDomainStateSet(SCMI_Handle handle, uint32_t domainId, uint32_t flags, uint32_t pstate)
API to set power domain to on or off state.