13#ifndef _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CLK_H_
14#define _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CLK_H_
25#define SCMI_CLK_CONFIG_DISABLE_ENABLE_MASK GENMASK(1, 0)
26#define SCMI_CLK_CONFIG_ENABLE_DISABLE(x)\
27 ((uint32_t)(x) & SCMI_CLK_CONFIG_DISABLE_ENABLE_MASK)
29#define SCMI_CLK_ATTRIBUTES_CLK_NUM(x) ((x) & GENMASK(15, 0))
31#define SCMI_CLK_RATE_SET_FLAGS_ASYNC BIT(0)
32#define SCMI_CLK_RATE_SET_FLAGS_IGNORE_DELEAYED_RESP BIT(1)
33#define SCMI_CLK_RATE_SET_FLAGS_ROUNDS_UP_DOWN BIT(2)
34#define SCMI_CLK_RATE_SET_FLAGS_ROUNDS_AUTO BIT(3)
36#define SCMI_CLK_PROTOCOL_SUPPORTED_VERSION 0x30000
39#define SCMI_CLK_NAME_LEN 16
42#define SCMI_CLK_ENABLED(attributes) ((attributes) & BIT(0))
Header file for the SCMI (System Control and Management Interface) driver API.
scmi_clock_message
Clock protocol command message IDs.
Definition clk.h:87
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_protocol_attributes(struct scmi_protocol *proto, uint32_t *attributes)
Send the PROTOCOL_ATTRIBUTES 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:39
@ SCMI_CLK_MSG_CLOCK_NAME_GET
Definition clk.h:96
@ SCMI_CLK_MSG_CLOCK_CONFIG_GET
Definition clk.h:99
@ SCMI_CLK_MSG_CLOCK_RATE_CHANGE_REQUESTED_NOTIFY
Definition clk.h:98
@ SCMI_CLK_MSG_PROTOCOL_ATTRIBUTES
Definition clk.h:89
@ SCMI_CLK_MSG_CLOCK_ATTRIBUTES
Definition clk.h:91
@ SCMI_CLK_MSG_CLOCK_DESCRIBE_RATES
Definition clk.h:92
@ SCMI_CLK_MSG_NEGOTIATE_PROTOCOL_VERSION
Definition clk.h:104
@ SCMI_CLK_MSG_CLOCK_POSSIBLE_PARENTS_GET
Definition clk.h:100
@ SCMI_CLK_MSG_CLOCK_RATE_SET
Definition clk.h:93
@ SCMI_CLK_MSG_CLOCK_RATE_GET
Definition clk.h:94
@ SCMI_CLK_MSG_CLOCK_CONFIG_SET
Definition clk.h:95
@ SCMI_CLK_MSG_CLOCK_PARENT_GET
Definition clk.h:102
@ SCMI_CLK_MSG_CLOCK_RATE_NOTIFY
Definition clk.h:97
@ SCMI_CLK_MSG_PROTOCOL_VERSION
Definition clk.h:88
@ SCMI_CLK_MSG_CLOCK_PARENT_SET
Definition clk.h:101
@ SCMI_CLK_MSG_CLOCK_GET_PERMISSIONS
Definition clk.h:103
@ SCMI_CLK_MSG_PROTOCOL_MESSAGE_ATTRIBUTES
Definition clk.h:90
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Describes the content of the CLOCK_ATTRIBUTES command reply.
Definition clk.h:73
uint32_t attributes
clock attributes
Definition clk.h:77
uint32_t clock_enable_delay
clock enable delay incurred by platform
Definition clk.h:81
int32_t status
reply status
Definition clk.h:75
uint8_t clock_name[16]
clock name
Definition clk.h:79
Describes the parameters for the CLOCK_CONFIG_SET command.
Definition clk.h:50
uint32_t clk_id
Definition clk.h:51
uint32_t extended_cfg_val
Definition clk.h:53
uint32_t attributes
Definition clk.h:52
Describes the parameters for the CLOCK_RATE_SET command.
Definition clk.h:62
uint32_t rate[2]
Definition clk.h:65
uint32_t flags
Definition clk.h:63
uint32_t clk_id
Definition clk.h:64
SCMI protocol structure.
Definition protocol.h:92