Zephyr Project API 4.4.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
39#define SCMI_CLK_NAME_LEN 16
40
42#define SCMI_CLK_ENABLED(attributes) ((attributes) & BIT(0))
43
45#define SCMI_CLK_HAS_RESTRICTIONS(attributes) ((attributes) & BIT(1))
46
48#define SCMI_CLK_STATE_CONTROL_ALLOWED(permissions) ((permissions) & BIT(31))
49
61
73
89
101 struct scmi_clock_config *cfg);
113 uint32_t clk_id, uint32_t *rate);
114
126
137int scmi_clock_parent_get(struct scmi_protocol *proto, uint32_t clk_id, uint32_t *parent_id);
138
150int scmi_clock_parent_set(struct scmi_protocol *proto, uint32_t clk_id, uint32_t parent_id);
151
163 struct scmi_clock_attributes *attributes);
164
176 uint32_t *permissions);
180
181#endif /* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CLK_H_ */
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:39
__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:79
uint32_t attributes
clock attributes
Definition clk.h:83
uint32_t clock_enable_delay
clock enable delay incurred by platform
Definition clk.h:87
int32_t status
reply status
Definition clk.h:81
uint8_t clock_name[16]
clock name
Definition clk.h:85
Describes the parameters for the CLOCK_CONFIG_SET command.
Definition clk.h:56
uint32_t clk_id
Definition clk.h:57
uint32_t extended_cfg_val
Definition clk.h:59
uint32_t attributes
Definition clk.h:58
Describes the parameters for the CLOCK_RATE_SET command.
Definition clk.h:68
uint32_t rate[2]
Definition clk.h:71
uint32_t flags
Definition clk.h:69
uint32_t clk_id
Definition clk.h:70
SCMI protocol structure.
Definition protocol.h:85