]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
firmware: scmi: prepare uclass to pass channel reference
authorEtienne Carriere <etienne.carriere@linaro.org>
Tue, 31 May 2022 16:09:19 +0000 (18:09 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 23 Jun 2022 17:12:55 +0000 (13:12 -0400)
Changes SCMI transport operator ::process_msg to pass the SCMI channel
reference provided by caller SCMI protocol device.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
drivers/firmware/scmi/mailbox_agent.c
drivers/firmware/scmi/optee_agent.c
drivers/firmware/scmi/sandbox-scmi_agent.c
drivers/firmware/scmi/scmi_agent-uclass.c
drivers/firmware/scmi/smccc_agent.c
include/scmi_agent-uclass.h

index 8e4af0c8faf08e06a7f903a624d33858eee12069..aa4929aafaed7de3db260f56e9c39b7fe8c14e91 100644 (file)
@@ -31,7 +31,9 @@ struct scmi_mbox_channel {
        ulong timeout_us;
 };
 
-static int scmi_mbox_process_msg(struct udevice *dev, struct scmi_msg *msg)
+static int scmi_mbox_process_msg(struct udevice *dev,
+                                struct scmi_channel *channel,
+                                struct scmi_msg *msg)
 {
        struct scmi_mbox_channel *chan = dev_get_plat(dev);
        int ret;
index bf0647bafd1e4651d86c038fd629362dce602e1c..771fa25e9896ef9ceeb6b12da94431d847ea28c1 100644 (file)
@@ -267,7 +267,9 @@ static void release_shm(struct udevice *dev, struct channel_session *sess)
                tee_shm_free(sess->tee_shm);
 }
 
-static int scmi_optee_process_msg(struct udevice *dev, struct scmi_msg *msg)
+static int scmi_optee_process_msg(struct udevice *dev,
+                                 struct scmi_channel *channel,
+                                 struct scmi_msg *msg)
 {
        struct channel_session sess = { };
        int ret;
index c555164d1961013164efd7ef4e64ab1ddabfed9c..031882998dfaea9fa7043fffbec213b0d37d524b 100644 (file)
@@ -471,6 +471,7 @@ static int sandbox_scmi_voltd_level_get(struct udevice *dev,
 }
 
 static int sandbox_scmi_test_process_msg(struct udevice *dev,
+                                        struct scmi_channel *channel,
                                         struct scmi_msg *msg)
 {
        switch (msg->protocol_id) {
index 93cfc9c395b75c5709e2715d64303986741c3182..c9c9c00384a4698d6722441a86688176699ea361 100644 (file)
@@ -133,7 +133,7 @@ int devm_scmi_process_msg(struct udevice *dev, struct scmi_channel *channel,
        ops = transport_dev_ops(parent);
 
        if (ops->process_msg)
-               return ops->process_msg(parent, msg);
+               return ops->process_msg(parent, NULL, msg);
 
        return -EPROTONOSUPPORT;
 }
index 5e166ca93ee1f4dd332f623800e2278a826b715b..b7a930b24df11a99b6134c63c4f5729cb057a448 100644 (file)
@@ -30,7 +30,9 @@ struct scmi_smccc_channel {
        struct scmi_smt smt;
 };
 
-static int scmi_smccc_process_msg(struct udevice *dev, struct scmi_msg *msg)
+static int scmi_smccc_process_msg(struct udevice *dev,
+                                 struct scmi_channel *channel,
+                                 struct scmi_msg *msg)
 {
        struct scmi_smccc_channel *chan = dev_get_plat(dev);
        struct arm_smccc_res res;
index 861ac6d11007fbe1977362b5a6f908e6b55647f2..562a4cc99affb39aedde220c9213f1edbe949600 100644 (file)
@@ -7,6 +7,7 @@
 
 struct udevice;
 struct scmi_msg;
+struct scmi_channel;
 
 /**
  * struct scmi_transport_ops - The functions that a SCMI transport layer must implement.
@@ -18,7 +19,8 @@ struct scmi_agent_ops {
         * @dev:                SCMI protocol device using the transport
         * @msg:                SCMI message to be transmitted
         */
-       int (*process_msg)(struct udevice *dev, struct scmi_msg *msg);
+       int (*process_msg)(struct udevice *dev, struct scmi_channel *channel,
+                          struct scmi_msg *msg);
 };
 
 #endif /* _SCMI_TRANSPORT_UCLASS_H */