summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2026-05-30 01:04:45 +0300
committerArnd Bergmann <arnd@arndb.de>2026-05-30 01:04:46 +0300
commit1499b84142cc1c85df780f26fe9b94d8fffd87d8 (patch)
tree69d4daa3c1cc5447c7d8a234d85c4d533995e9db /include/linux
parentb6a6fae6c542e0e71bbabca653bb97699d2f3b33 (diff)
parent524abd2fa6907ebe2762342be339afcc5b227dc4 (diff)
downloadlinux-1499b84142cc1c85df780f26fe9b94d8fffd87d8.tar.xz
Merge tag 'scmi-updates-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers
Arm SCMI updates for v7.2 1. Improve SCMI clock handling with a protocol-level determine_rate operation, simplified per-clock rate properties, dynamic rate allocation, bounded iterator support, lazy full-rate discovery, and hardened parent/rate enumeration. 2. Fix several SCMI bounds and payload validation issues, including clock rate discovery OOB handling, power domain name lookup, Powercap domain state access, BASE_ERROR_EVENT and SENSOR_UPDATE payload sizing, and sensor config width handling. 3. Rework SCMI transport probing for virtio and OP-TEE using per-instance transport handles and a generic transport supplier, removing the need to register SCMI core drivers from transport probe paths. 4. Add i.MX SCMI MISC reset reason support and print i.MX95 boot/shutdown reasons via the System Manager interface. 5. Clean up SCMI core internals, including base-info naming, quirk parsing and table iteration, and list iteration. 6. Fix SCPI clock provider removal so child clock providers are unregistered using the same DT nodes used at registration time. * tag 'scmi-updates-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (31 commits) firmware: arm_scmi: optee: Rework transport probe sequence firmware: arm_scmi: virtio: Rework transport probe sequence firmware: arm_scmi: Add a generic transport supplier firmware: arm_scmi: Add transport instance handles firmware: arm_scmi: Fix OOB in scmi_power_name_get() firmware: arm_scmi: Validate Powercap domains before state access firmware: arm_scmi: Validate SENSOR_UPDATE payload size firmware: arm_scmi: Validate BASE_ERROR_EVENT payload size firmware: arm_scmi: Read sensor config as 32-bit value clk: scpi: Unregister child clock providers on remove firmware: arm_scmi: Introduce all_rates_get clock operation firmware: arm_scmi: Fix OOB in scmi_clock_describe_rates_get_lazy() firmware: arm_scmi: Use bound iterators to minimize discovered rates firmware: arm_scmi: Use proper iter_response_bound_cleanup() name firmware: arm_scmi: Fix bound iterators returning too many items firmware: arm_scmi: Add bound iterators support firmware: arm_scmi: Refactor iterators internal allocation firmware: arm_scmi: Harden clock parents discovery firmware: arm_scmi: Make clock rates allocation dynamic firmware: arm_scmi: Drop unused clock rate interfaces ... Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/scmi_imx_protocol.h14
-rw-r--r--include/linux/scmi_protocol.h36
2 files changed, 34 insertions, 16 deletions
diff --git a/include/linux/scmi_imx_protocol.h b/include/linux/scmi_imx_protocol.h
index 2407d7693b6b..ab867463c08c 100644
--- a/include/linux/scmi_imx_protocol.h
+++ b/include/linux/scmi_imx_protocol.h
@@ -52,6 +52,17 @@ struct scmi_imx_misc_ctrl_notify_report {
unsigned int flags;
};
+
+#define MISC_EXT_INFO_LEN_MAX 4
+struct scmi_imx_misc_reset_reason {
+ bool valid:1;
+ bool orig_valid:1;
+ bool err_valid:1;
+ u32 reason;
+ u32 origin;
+ u32 errid;
+};
+
struct scmi_imx_misc_proto_ops {
int (*misc_ctrl_set)(const struct scmi_protocol_handle *ph, u32 id,
u32 num, u32 *val);
@@ -61,6 +72,9 @@ struct scmi_imx_misc_proto_ops {
u32 ctrl_id, u32 evt_id, u32 flags);
int (*misc_syslog)(const struct scmi_protocol_handle *ph, u16 *size,
void *array);
+ int (*misc_reset_reason)(const struct scmi_protocol_handle *ph,
+ bool system, struct scmi_imx_misc_reset_reason *boot_r,
+ struct scmi_imx_misc_reset_reason *shut_r, u32 *extinfo);
};
/* See LMM_ATTRIBUTES in imx95.rst */
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index aafaac1496b0..5ab73b1ab9aa 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -15,10 +15,9 @@
#define SCMI_MAX_STR_SIZE 64
#define SCMI_SHORT_NAME_MAX_SIZE 16
-#define SCMI_MAX_NUM_RATES 16
/**
- * struct scmi_revision_info - version information structure
+ * struct scmi_base_info - version information structure
*
* @major_ver: Major ABI version. Change here implies risk of backward
* compatibility break.
@@ -31,7 +30,7 @@
* @vendor_id: A vendor identifier(Null terminated ASCII string)
* @sub_vendor_id: A sub-vendor identifier(Null terminated ASCII string)
*/
-struct scmi_revision_info {
+struct scmi_base_info {
u16 major_ver;
u16 minor_ver;
u8 num_protocols;
@@ -41,27 +40,23 @@ struct scmi_revision_info {
char sub_vendor_id[SCMI_SHORT_NAME_MAX_SIZE];
};
+struct scmi_clock_rates {
+ bool rate_discrete;
+ unsigned int num_rates;
+ u64 *rates;
+};
+
struct scmi_clock_info {
char name[SCMI_MAX_STR_SIZE];
unsigned int enable_latency;
- bool rate_discrete;
bool rate_changed_notifications;
bool rate_change_requested_notifications;
bool state_ctrl_forbidden;
bool rate_ctrl_forbidden;
bool parent_ctrl_forbidden;
bool extended_config;
- union {
- struct {
- int num_rates;
- u64 rates[SCMI_MAX_NUM_RATES];
- } list;
- struct {
- u64 min_rate;
- u64 max_rate;
- u64 step_size;
- } range;
- };
+ u64 min_rate;
+ u64 max_rate;
int num_parents;
u32 *parents;
};
@@ -91,6 +86,11 @@ enum scmi_clock_oem_config {
* @info_get: get the information of the specified clock
* @rate_get: request the current clock rate of a clock
* @rate_set: set the clock rate of a clock
+ * @determine_rate: determine the effective rate that can be supported by a
+ * clock calculating the closest allowed rate.
+ * Note that @rate is an input/output parameter used both to
+ * describe the requested rate and report the closest match
+ * @all_rates_get: get the list of all available rates for the specified clock.
* @enable: enables the specified clock
* @disable: disables the specified clock
* @state_get: get the status of the specified clock
@@ -108,6 +108,10 @@ struct scmi_clk_proto_ops {
u64 *rate);
int (*rate_set)(const struct scmi_protocol_handle *ph, u32 clk_id,
u64 rate);
+ int (*determine_rate)(const struct scmi_protocol_handle *ph, u32 clk_id,
+ unsigned long *rate);
+ const struct scmi_clock_rates __must_check *(*all_rates_get)
+ (const struct scmi_protocol_handle *ph, u32 clk_id);
int (*enable)(const struct scmi_protocol_handle *ph, u32 clk_id,
bool atomic);
int (*disable)(const struct scmi_protocol_handle *ph, u32 clk_id,
@@ -901,7 +905,7 @@ struct scmi_notify_ops {
*/
struct scmi_handle {
struct device *dev;
- struct scmi_revision_info *version;
+ struct scmi_base_info *version;
int __must_check (*devm_protocol_acquire)(struct scmi_device *sdev,
u8 proto);