13#ifndef _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CLK_H_
14#define _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CLK_H_
26#define SCMI_CLK_CONFIG_DISABLE_ENABLE_MASK GENMASK(1, 0)
28#define SCMI_CLK_CONFIG_ENABLE_DISABLE(x)\
29 ((uint32_t)(x) & SCMI_CLK_CONFIG_DISABLE_ENABLE_MASK)
32#define SCMI_CLK_ATTRIBUTES_CLK_NUM(x) ((x) & GENMASK(15, 0))
35#define SCMI_CLK_RATE_SET_FLAGS_ASYNC BIT(0)
37#define SCMI_CLK_RATE_SET_FLAGS_IGNORE_DELEAYED_RESP BIT(1)
39#define SCMI_CLK_RATE_SET_FLAGS_ROUNDS_UP_DOWN BIT(2)
41#define SCMI_CLK_RATE_SET_FLAGS_ROUNDS_AUTO BIT(3)
44#define SCMI_CLK_PROTOCOL_SUPPORTED_VERSION 0x30000
53#define SCMI_PROTO_VER_MAJOR(v) ((v) >> 16)
61#define SCMI_PROTO_VER_MINOR(v) ((v) & 0xFFFF)
64#define SCMI_CLK_NAME_LEN 16
67#define SCMI_CLK_ENABLED(attributes) ((attributes) & BIT(0))
70#define SCMI_CLK_HAS_RESTRICTIONS(attributes) ((attributes) & BIT(1))
73#define SCMI_CLK_STATE_CONTROL_ALLOWED(permissions) ((permissions) & BIT(31))
Header file for the SCMI (System Control and Management Interface) driver API.
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.
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_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_rate_get(struct scmi_protocol *proto, uint32_t clk_id, uint32_t *rate)
Query the rate of a clock.
int scmi_clock_config_set(struct scmi_protocol *proto, struct scmi_clock_config *cfg)
Send the CLOCK_CONFIG_SET command and get its reply.
#define SCMI_CLK_NAME_LEN
clock name length (short version)
Definition clk.h:64
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Describes the content of the CLOCK_ATTRIBUTES command reply.
Definition clk.h:110
uint32_t attributes
clock attributes
Definition clk.h:112
uint32_t clock_enable_delay
Clock enable delay incurred by platform.
Definition clk.h:116
uint8_t clock_name[16]
Clock name.
Definition clk.h:114
Describes the parameters for the CLOCK_CONFIG_SET command.
Definition clk.h:81
uint32_t clk_id
ID of the clock to configure.
Definition clk.h:83
uint32_t extended_cfg_val
Extended configuration value (meaning depends on attributes).
Definition clk.h:87
uint32_t attributes
Configuration attributes (e.g.
Definition clk.h:85
Describes the parameters for the CLOCK_RATE_SET command.
Definition clk.h:96
uint32_t rate[2]
64-bit rate in Hz, split as { lower 32 bits, upper 32 bits }
Definition clk.h:102
uint32_t flags
Rate set flags (see SCMI_CLK_RATE_SET_FLAGS_*).
Definition clk.h:98
uint32_t clk_id
ID of the clock whose rate is being set.
Definition clk.h:100
SCMI protocol structure.
Definition protocol.h:100