summaryrefslogtreecommitdiff
path: root/include/scmi_agent-uclass.h
diff options
context:
space:
mode:
authorAlice Guo <alice.guo@nxp.com>2025-04-28 18:37:24 +0800
committerFabio Estevam <festevam@gmail.com>2025-05-03 16:55:32 -0300
commitb4f3fab643324d41ff0074ebed49713ddd4009eb (patch)
treeecf640d24b84461f3c5ab55fb5d315613a8e13a8 /include/scmi_agent-uclass.h
parent0c8a89d252c3db3401ffa572ee2e4dfcb94e2c3b (diff)
firmware: scmi: support to manage SCMI protocol drivers with a linker-genetated array
U_BOOT_SCMI_PROTO_DRIVER macro is used to add a SCMI protocol driver to scmi_proto_driver list. scmi_proto_driver_get() function can be used to match a SCMI protocol id and its driver. Signed-off-by: Alice Guo <alice.guo@nxp.com>
Diffstat (limited to 'include/scmi_agent-uclass.h')
-rw-r--r--include/scmi_agent-uclass.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/scmi_agent-uclass.h b/include/scmi_agent-uclass.h
index 33e0e18c30d..842c56858af 100644
--- a/include/scmi_agent-uclass.h
+++ b/include/scmi_agent-uclass.h
@@ -115,4 +115,19 @@ struct scmi_agent_ops {
struct scmi_msg *msg);
};
+struct scmi_proto_match {
+ unsigned int proto_id;
+};
+
+struct scmi_proto_driver {
+ struct driver *driver;
+ const struct scmi_proto_match *match;
+};
+
+#define U_BOOT_SCMI_PROTO_DRIVER(__name, __match) \
+ ll_entry_declare(struct scmi_proto_driver, __name, scmi_proto_driver) = { \
+ .driver = llsym(struct driver, __name, driver), \
+ .match = __match, \
+ }
+
#endif /* _SCMI_TRANSPORT_UCLASS_H */