summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlice Guo <[email protected]>2025-04-28 18:37:31 +0800
committerFabio Estevam <[email protected]>2025-05-03 16:55:32 -0300
commit15fdfef6642c8262331e22f8d9507ee5c11f027a (patch)
treede116d883154f6812654f8657923a6e0f883530e /include
parentaf2a671f78ee230dd81679b944ef02e9ffe2ec45 (diff)
clk: scmi: check the clock state/parent/rate control permissions
Clock driver based on SCMI clock management protocol in Linux checks clock state, parent and rate control permissions. To be consistent with the kernel driver, add this check here. CLOCK_GET_PERMISSIONS is from ARM System Control and Management Interface Platform Design Document 3.2. When using common clock framework (CCF), use the clock signal ID to get the clock registered by clk_register() in scmi_clk_probe(), and then obatin the struct clk_scmi variable with container_of(). Signed-off-by: Alice Guo <[email protected]> Signed-off-by: Ye Li <[email protected]> Reviewed-by: Peng Fan <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/scmi_protocols.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/scmi_protocols.h b/include/scmi_protocols.h
index 342a65ae7f4..519b906b4ce 100644
--- a/include/scmi_protocols.h
+++ b/include/scmi_protocols.h
@@ -731,6 +731,7 @@ int scmi_pwd_name_get(struct udevice *dev, u32 domain_id, u8 **name);
/*
* SCMI Clock Protocol
*/
+#define CLOCK_PROTOCOL_VERSION_3_0 0x30000
enum scmi_clock_message_id {
SCMI_CLOCK_ATTRIBUTES = 0x3,
@@ -738,6 +739,7 @@ enum scmi_clock_message_id {
SCMI_CLOCK_RATE_GET = 0x6,
SCMI_CLOCK_CONFIG_SET = 0x7,
SCMI_CLOCK_PARENT_SET = 0xD,
+ SCMI_CLOCK_GET_PERMISSIONS = 0xF,
};
#define SCMI_CLK_PROTO_ATTR_COUNT_MASK GENMASK(15, 0)
@@ -776,6 +778,7 @@ struct scmi_clk_attribute_in {
struct scmi_clk_attribute_out {
s32 status;
u32 attributes;
+#define CLK_HAS_RESTRICTIONS(x) ((x) & BIT(1))
char clock_name[SCMI_CLOCK_NAME_LENGTH_MAX];
};
@@ -858,6 +861,27 @@ struct scmi_clk_parent_set_out {
s32 status;
};
+/**
+ * @clock_id: Identifier for the clock device.
+ */
+struct scmi_clk_get_permissions_in {
+ u32 clock_id;
+};
+
+/**
+ * @status: Negative 32-bit integers are used to return error status codes.
+ * @permissions: Bit[31] Clock state control, Bit[30] Clock parent control,
+ * Bit[29] Clock rate control, Bits[28:0] Reserved, must be zero.
+ */
+struct scmi_clk_get_permissions_out {
+ s32 status;
+ u32 permissions;
+};
+
+#define SUPPORT_CLK_STAT_CONTROL BIT(31)
+#define SUPPORT_CLK_PARENT_CONTROL BIT(30)
+#define SUPPORT_CLK_RATE_CONTROL BIT(29)
+
/*
* SCMI Reset Domain Protocol
*/