Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
clk.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CLK_H_
14#define _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CLK_H_
15
17
24
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)
28
29#define SCMI_CLK_ATTRIBUTES_CLK_NUM(x) ((x) & GENMASK(15, 0))
30
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)
35
36#define SCMI_CLK_PROTOCOL_SUPPORTED_VERSION 0x30000
37
49
61
84
96 uint32_t *attributes);
97
109 struct scmi_clock_config *cfg);
121 uint32_t clk_id, uint32_t *rate);
122
134
145int scmi_clock_parent_get(struct scmi_protocol *proto, uint32_t clk_id, uint32_t *parent_id);
146
158int scmi_clock_parent_set(struct scmi_protocol *proto, uint32_t clk_id, uint32_t parent_id);
159
163
164#endif /* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CLK_H_ */
Header file for the SCMI (System Control and Management Interface) driver API.
scmi_clock_message
Clock protocol command message IDs.
Definition clk.h:65
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_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.
@ SCMI_CLK_MSG_CLOCK_NAME_GET
Definition clk.h:74
@ SCMI_CLK_MSG_CLOCK_CONFIG_GET
Definition clk.h:77
@ SCMI_CLK_MSG_CLOCK_RATE_CHANGE_REQUESTED_NOTIFY
Definition clk.h:76
@ SCMI_CLK_MSG_PROTOCOL_ATTRIBUTES
Definition clk.h:67
@ SCMI_CLK_MSG_CLOCK_ATTRIBUTES
Definition clk.h:69
@ SCMI_CLK_MSG_CLOCK_DESCRIBE_RATES
Definition clk.h:70
@ SCMI_CLK_MSG_NEGOTIATE_PROTOCOL_VERSION
Definition clk.h:82
@ SCMI_CLK_MSG_CLOCK_POSSIBLE_PARENTS_GET
Definition clk.h:78
@ SCMI_CLK_MSG_CLOCK_RATE_SET
Definition clk.h:71
@ SCMI_CLK_MSG_CLOCK_RATE_GET
Definition clk.h:72
@ SCMI_CLK_MSG_CLOCK_CONFIG_SET
Definition clk.h:73
@ SCMI_CLK_MSG_CLOCK_PARENT_GET
Definition clk.h:80
@ SCMI_CLK_MSG_CLOCK_RATE_NOTIFY
Definition clk.h:75
@ SCMI_CLK_MSG_PROTOCOL_VERSION
Definition clk.h:66
@ SCMI_CLK_MSG_CLOCK_PARENT_SET
Definition clk.h:79
@ SCMI_CLK_MSG_CLOCK_GET_PERMISSIONS
Definition clk.h:81
@ SCMI_CLK_MSG_PROTOCOL_MESSAGE_ATTRIBUTES
Definition clk.h:68
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Describes the parameters for the CLOCK_CONFIG_SET command.
Definition clk.h:44
uint32_t clk_id
Definition clk.h:45
uint32_t extended_cfg_val
Definition clk.h:47
uint32_t attributes
Definition clk.h:46
Describes the parameters for the CLOCK_RATE_SET command.
Definition clk.h:56
uint32_t rate[2]
Definition clk.h:59
uint32_t flags
Definition clk.h:57
uint32_t clk_id
Definition clk.h:58
SCMI protocol structure.
Definition protocol.h:92