mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 20:04:46 +00:00
firmware: scmi: prepare uclass to pass channel reference
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>
This commit is contained in:
parent
8bcb1b4898
commit
85dc582892
6 changed files with 14 additions and 5 deletions
|
@ -31,7 +31,9 @@ struct scmi_mbox_channel {
|
||||||
ulong timeout_us;
|
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);
|
struct scmi_mbox_channel *chan = dev_get_plat(dev);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -267,7 +267,9 @@ static void release_shm(struct udevice *dev, struct channel_session *sess)
|
||||||
tee_shm_free(sess->tee_shm);
|
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 = { };
|
struct channel_session sess = { };
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -471,6 +471,7 @@ static int sandbox_scmi_voltd_level_get(struct udevice *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sandbox_scmi_test_process_msg(struct udevice *dev,
|
static int sandbox_scmi_test_process_msg(struct udevice *dev,
|
||||||
|
struct scmi_channel *channel,
|
||||||
struct scmi_msg *msg)
|
struct scmi_msg *msg)
|
||||||
{
|
{
|
||||||
switch (msg->protocol_id) {
|
switch (msg->protocol_id) {
|
||||||
|
|
|
@ -133,7 +133,7 @@ int devm_scmi_process_msg(struct udevice *dev, struct scmi_channel *channel,
|
||||||
ops = transport_dev_ops(parent);
|
ops = transport_dev_ops(parent);
|
||||||
|
|
||||||
if (ops->process_msg)
|
if (ops->process_msg)
|
||||||
return ops->process_msg(parent, msg);
|
return ops->process_msg(parent, NULL, msg);
|
||||||
|
|
||||||
return -EPROTONOSUPPORT;
|
return -EPROTONOSUPPORT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,9 @@ struct scmi_smccc_channel {
|
||||||
struct scmi_smt smt;
|
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 scmi_smccc_channel *chan = dev_get_plat(dev);
|
||||||
struct arm_smccc_res res;
|
struct arm_smccc_res res;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
struct udevice;
|
struct udevice;
|
||||||
struct scmi_msg;
|
struct scmi_msg;
|
||||||
|
struct scmi_channel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct scmi_transport_ops - The functions that a SCMI transport layer must implement.
|
* 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
|
* @dev: SCMI protocol device using the transport
|
||||||
* @msg: SCMI message to be transmitted
|
* @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 */
|
#endif /* _SCMI_TRANSPORT_UCLASS_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue