|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Clock management operations via SCMI. More...
Files | |
| file | clk.h |
| Header file for the SCMI Clock Protocol. | |
Data Structures | |
| struct | scmi_clock_config |
| Describes the parameters for the CLOCK_CONFIG_SET command. More... | |
| struct | scmi_clock_rate_config |
| Describes the parameters for the CLOCK_RATE_SET command. More... | |
| struct | scmi_clock_attributes |
| Describes the content of the CLOCK_ATTRIBUTES command reply. More... | |
Macros | |
| #define | SCMI_CLK_CONFIG_DISABLE_ENABLE_MASK GENMASK(1, 0) |
| Mask of the enable/disable field in a CLOCK_CONFIG_SET attributes word. | |
| #define | SCMI_CLK_CONFIG_ENABLE_DISABLE(x) |
Extract the enable/disable field from a CLOCK_CONFIG_SET value x. | |
| #define | SCMI_CLK_ATTRIBUTES_CLK_NUM(x) |
Extract the number of clocks from a PROTOCOL_ATTRIBUTES reply x. | |
| #define | SCMI_CLK_RATE_SET_FLAGS_ASYNC BIT(0) |
| CLOCK_RATE_SET flag: perform the rate change asynchronously. | |
| #define | SCMI_CLK_RATE_SET_FLAGS_IGNORE_DELEAYED_RESP BIT(1) |
| CLOCK_RATE_SET flag: do not send a delayed response for async requests. | |
| #define | SCMI_CLK_RATE_SET_FLAGS_ROUNDS_UP_DOWN BIT(2) |
| CLOCK_RATE_SET flag: round the rate up (set) or down (cleared). | |
| #define | SCMI_CLK_RATE_SET_FLAGS_ROUNDS_AUTO BIT(3) |
| CLOCK_RATE_SET flag: round the rate to the closest supported value. | |
| #define | SCMI_CLK_PROTOCOL_SUPPORTED_VERSION 0x30000 |
| Version of the SCMI clock protocol supported by this driver. | |
| #define | SCMI_PROTO_VER_MAJOR(v) |
| Clock name length (short version). | |
| #define | SCMI_PROTO_VER_MINOR(v) |
| Extract minor version from SCMI protocol version. | |
| #define | SCMI_CLK_NAME_LEN 16 |
| clock name length (short version) | |
| #define | SCMI_CLK_ENABLED(attributes) |
| Get the clock's enabled status based on given attributes. | |
| #define | SCMI_CLK_HAS_RESTRICTIONS(attributes) |
| Check if a clock has restrictions based on given attributes. | |
| #define | SCMI_CLK_STATE_CONTROL_ALLOWED(permissions) |
| Check if clock allows gating/ungating based on its permissions. | |
Functions | |
| int | scmi_clock_config_set (struct scmi_protocol *proto, struct scmi_clock_config *cfg) |
| Send the CLOCK_CONFIG_SET command and get its reply. | |
| int | scmi_clock_rate_get (struct scmi_protocol *proto, uint32_t clk_id, uint32_t *rate) |
| Query the rate of a clock. | |
| int | scmi_clock_rate_set (struct scmi_protocol *proto, struct scmi_clock_rate_config *cfg) |
| Send the CLOCK_RATE_SET command and get its reply. | |
| int | scmi_clock_parent_get (struct scmi_protocol *proto, uint32_t clk_id, uint32_t *parent_id) |
| Query the parent of a clock. | |
| int | scmi_clock_parent_set (struct scmi_protocol *proto, uint32_t clk_id, uint32_t parent_id) |
| Send the CLOCK_PARENT_SET command and get its reply. | |
| int | scmi_clock_attributes (struct scmi_protocol *proto, uint32_t clk_id, struct scmi_clock_attributes *attributes) |
| Send the CLOCK_ATTRIBUTES command and get its reply. | |
| int | scmi_clock_get_permissions (struct scmi_protocol *proto, uint32_t clk_id, uint32_t *permissions) |
| Send the CLOCK_GET_PERMISSIONS command and get its reply. | |
Clock management operations via SCMI.
| #define SCMI_CLK_ATTRIBUTES_CLK_NUM | ( | x | ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Extract the number of clocks from a PROTOCOL_ATTRIBUTES reply x.
| #define SCMI_CLK_CONFIG_DISABLE_ENABLE_MASK GENMASK(1, 0) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Mask of the enable/disable field in a CLOCK_CONFIG_SET attributes word.
| #define SCMI_CLK_CONFIG_ENABLE_DISABLE | ( | x | ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Extract the enable/disable field from a CLOCK_CONFIG_SET value x.
| #define SCMI_CLK_ENABLED | ( | attributes | ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Get the clock's enabled status based on given attributes.
| #define SCMI_CLK_HAS_RESTRICTIONS | ( | attributes | ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Check if a clock has restrictions based on given attributes.
| #define SCMI_CLK_NAME_LEN 16 |
#include <zephyr/drivers/firmware/scmi/clk.h>
clock name length (short version)
| #define SCMI_CLK_PROTOCOL_SUPPORTED_VERSION 0x30000 |
#include <zephyr/drivers/firmware/scmi/clk.h>
Version of the SCMI clock protocol supported by this driver.
| #define SCMI_CLK_RATE_SET_FLAGS_ASYNC BIT(0) |
#include <zephyr/drivers/firmware/scmi/clk.h>
CLOCK_RATE_SET flag: perform the rate change asynchronously.
| #define SCMI_CLK_RATE_SET_FLAGS_IGNORE_DELEAYED_RESP BIT(1) |
#include <zephyr/drivers/firmware/scmi/clk.h>
CLOCK_RATE_SET flag: do not send a delayed response for async requests.
| #define SCMI_CLK_RATE_SET_FLAGS_ROUNDS_AUTO BIT(3) |
#include <zephyr/drivers/firmware/scmi/clk.h>
CLOCK_RATE_SET flag: round the rate to the closest supported value.
| #define SCMI_CLK_RATE_SET_FLAGS_ROUNDS_UP_DOWN BIT(2) |
#include <zephyr/drivers/firmware/scmi/clk.h>
CLOCK_RATE_SET flag: round the rate up (set) or down (cleared).
| #define SCMI_CLK_STATE_CONTROL_ALLOWED | ( | permissions | ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Check if clock allows gating/ungating based on its permissions.
| #define SCMI_PROTO_VER_MAJOR | ( | v | ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Clock name length (short version).
Extract major version from SCMI protocol version
| v | Combined 32-bit protocol version (major << 16 | minor) |
| #define SCMI_PROTO_VER_MINOR | ( | v | ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Extract minor version from SCMI protocol version.
| v | Combined 32-bit protocol version (major << 16 | minor) |
| int scmi_clock_attributes | ( | struct scmi_protocol * | proto, |
| uint32_t | clk_id, | ||
| struct scmi_clock_attributes * | attributes ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Send the CLOCK_ATTRIBUTES command and get its reply.
| proto | Pointer to SCMI clock protocol data |
| clk_id | ID of the clock for which the query is done |
| attributes | Clock attributes returned by the command |
| int scmi_clock_config_set | ( | struct scmi_protocol * | proto, |
| struct scmi_clock_config * | cfg ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Send the CLOCK_CONFIG_SET command and get its reply.
| proto | Pointer to SCMI clock protocol data |
| cfg | Pointer to structure containing configuration to be set |
| int scmi_clock_get_permissions | ( | struct scmi_protocol * | proto, |
| uint32_t | clk_id, | ||
| uint32_t * | permissions ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Send the CLOCK_GET_PERMISSIONS command and get its reply.
| proto | Pointer to SCMI clock protocol data |
| clk_id | ID of the clock for which the query is done |
| permissions | Clock permissions returned by the command |
| int scmi_clock_parent_get | ( | struct scmi_protocol * | proto, |
| uint32_t | clk_id, | ||
| uint32_t * | parent_id ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Query the parent of a clock.
| proto | Pointer to SCMI clock protocol data |
| clk_id | ID of the clock for which the query is done |
| parent_id | Pointer to be set via this command |
| int scmi_clock_parent_set | ( | struct scmi_protocol * | proto, |
| uint32_t | clk_id, | ||
| uint32_t | parent_id ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Send the CLOCK_PARENT_SET command and get its reply.
| proto | Pointer to SCMI clock protocol data |
| clk_id | ID of the clock for which the query is done |
| parent_id | to be set via this command to be set |
| int scmi_clock_rate_get | ( | struct scmi_protocol * | proto, |
| uint32_t | clk_id, | ||
| uint32_t * | rate ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Query the rate of a clock.
| proto | Pointer to SCMI clock protocol data |
| clk_id | ID of the clock for which the query is done |
| rate | Pointer to rate to be set via this command |
| int scmi_clock_rate_set | ( | struct scmi_protocol * | proto, |
| struct scmi_clock_rate_config * | cfg ) |
#include <zephyr/drivers/firmware/scmi/clk.h>
Send the CLOCK_RATE_SET command and get its reply.
| proto | Pointer to SCMI clock protocol data |
| cfg | Pointer to structure containing configuration to be set |