summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/arm_scmi/protocols.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2022-07-06 13:56:10 +0200
committerArnd Bergmann <arnd@arndb.de>2022-07-06 13:56:10 +0200
commit77abf47213c6065d878020707aa611ef02f2e4bf (patch)
treed1a9e4f3e791c531ded1eb4480ab8fb191790464 /drivers/firmware/arm_scmi/protocols.h
parent3ed9222ce728fd3f1c4e429293270f58f3a8256d (diff)
parentb27d04d5a51c28322cadb18d8d2ff5d0fb892fff (diff)
downloadlinux-77abf47213c6065d878020707aa611ef02f2e4bf.tar.bz2
Merge tag 'scmi-updates-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/drivers
Arm SCMI updates for v5.20 The main additions this time around are: 1. The capability to trace full SCMI message headers and payloads. The recent unearthing of chain of old firmware issues motivated this effort so that it is easier to trace them and debug quicker than it took this time around in absence of such tracing. 2. SCMI System power control driver to handle platform's requests for a graceful shutdown. Though the system power control protocol has been around since the begining of SCMI, it lacked the timeout information that was added in SCMI v3.1 that enables kernel to take appropriate action within the timeout and doesn't have to rely on any other user inputs(which was blocking factor for addition of this driver earlier) 3. Support for SCMI Power Capping protocol that was introduced in SCMI v3.1 This protocol is intended for controlling and monitoring the power consumption of power capping domains. The firmware also provides the hierarchy of powercap domains by providing parent domain information. It also contains a bug fix in the old SCPI driver addressing possible user-after-free issues. * tag 'scmi-updates-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Use fast channel tracing include: trace: Add SCMI fast channel tracing firmware: arm_scmi: Add SCMI v3.1 powercap fast channels support firmware: arm_scmi: Generalize the fast channel support firmware: arm_scmi: Add SCMI v3.1 powercap protocol basic support dt-bindings: firmware: arm,scmi: Add support for powercap protocol firmware: arm_scmi: Add SCMI System Power Control driver firmware: arm_scmi: Add devm_protocol_acquire helper firmware: arm_scmi: Add SCMI v3.1 System Power extensions firmware: arm_scmi: Support only one single system power device firmware: arm_scmi: Use new SCMI full message tracing include: trace: Add SCMI full message tracing firmware: arm_scpi: Ensure scpi_info is not assigned if the probe fails firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API firmware: arm_scmi: Fix response size warning for OPTEE transport firmware: arm_scmi: Relax CLOCK_DESCRIBE_RATES out-of-spec checks Link: https://lore.kernel.org/r/20220706115045.2272678-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/firmware/arm_scmi/protocols.h')
-rw-r--r--drivers/firmware/arm_scmi/protocols.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scmi/protocols.h b/drivers/firmware/arm_scmi/protocols.h
index c679f3fb8718..2f3bf691db7c 100644
--- a/drivers/firmware/arm_scmi/protocols.h
+++ b/drivers/firmware/arm_scmi/protocols.h
@@ -179,6 +179,8 @@ struct scmi_protocol_handle {
* @max_resources: Maximum acceptable number of items, configured by the caller
* depending on the underlying resources that it is querying.
* @loop_idx: The iterator loop index in the current multi-part reply.
+ * @rx_len: Size in bytes of the currenly processed message; it can be used by
+ * the user of the iterator to verify a reply size.
* @priv: Optional pointer to some additional state-related private data setup
* by the caller during the iterations.
*/
@@ -188,6 +190,7 @@ struct scmi_iterator_state {
unsigned int num_remaining;
unsigned int max_resources;
unsigned int loop_idx;
+ size_t rx_len;
void *priv;
};
@@ -212,6 +215,19 @@ struct scmi_iterator_ops {
struct scmi_iterator_state *st, void *priv);
};
+struct scmi_fc_db_info {
+ int width;
+ u64 set;
+ u64 mask;
+ void __iomem *addr;
+};
+
+struct scmi_fc_info {
+ void __iomem *set_addr;
+ void __iomem *get_addr;
+ struct scmi_fc_db_info *set_db;
+};
+
/**
* struct scmi_proto_helpers_ops - References to common protocol helpers
* @extended_name_get: A common helper function to retrieve extended naming
@@ -227,6 +243,9 @@ struct scmi_iterator_ops {
* provided in @ops.
* @iter_response_run: A common helper to trigger the run of a previously
* initialized iterator.
+ * @fastchannel_init: A common helper used to initialize FC descriptors by
+ * gathering FC descriptions from the SCMI platform server.
+ * @fastchannel_db_ring: A common helper to ring a FC doorbell.
*/
struct scmi_proto_helpers_ops {
int (*extended_name_get)(const struct scmi_protocol_handle *ph,
@@ -236,6 +255,12 @@ struct scmi_proto_helpers_ops {
unsigned int max_resources, u8 msg_id,
size_t tx_size, void *priv);
int (*iter_response_run)(void *iter);
+ void (*fastchannel_init)(const struct scmi_protocol_handle *ph,
+ u8 describe_id, u32 message_id,
+ u32 valid_size, u32 domain,
+ void __iomem **p_addr,
+ struct scmi_fc_db_info **p_db);
+ void (*fastchannel_db_ring)(struct scmi_fc_db_info *db);
};
/**
@@ -312,5 +337,6 @@ DECLARE_SCMI_REGISTER_UNREGISTER(reset);
DECLARE_SCMI_REGISTER_UNREGISTER(sensors);
DECLARE_SCMI_REGISTER_UNREGISTER(voltage);
DECLARE_SCMI_REGISTER_UNREGISTER(system);
+DECLARE_SCMI_REGISTER_UNREGISTER(powercap);
#endif /* _SCMI_PROTOCOLS_H */