summaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorEtienne Carriere <etienne.carriere@linaro.org>2020-09-09 18:44:04 +0200
committerTom Rini <trini@konsulko.com>2020-09-30 11:55:23 -0400
commit60388844836f5639e6c9a4331335ff22298128da (patch)
treeb5f9e60ab477d740c2542cd123d0d81eb0c862dd /drivers/firmware
parent4e5ce7ecd3ed734245b00a4068d6c86009e8b7ab (diff)
downloadu-boot-60388844836f5639e6c9a4331335ff22298128da.tar.gz
u-boot-60388844836f5639e6c9a4331335ff22298128da.tar.bz2
u-boot-60388844836f5639e6c9a4331335ff22298128da.zip
clk: add clock driver for SCMI agents
This change introduces a clock driver for SCMI agent devices. When SCMI agent and SCMI clock drivers are enabled, SCMI agent binds a clock device for each SCMI clock protocol devices enabled in the FDT. SCMI clock driver is embedded upon CONFIG_CLK_SCMI=y. If enabled, CONFIG_SCMI_AGENT is also enabled. SCMI Clock protocol is defined in the SCMI specification [1]. Links: [1] https://developer.arm.com/architectures/system-architectures/software-standards/scmi Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Cc: Lukasz Majewski <lukma@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Peng Fan <peng.fan@nxp.com> Cc: Sudeep Holla <sudeep.holla@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/scmi/scmi_agent-uclass.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c
index 67a6f907c9..1f36f23b6d 100644
--- a/drivers/firmware/scmi/scmi_agent-uclass.c
+++ b/drivers/firmware/scmi/scmi_agent-uclass.c
@@ -58,9 +58,9 @@ static int scmi_bind_protocols(struct udevice *dev)
{
int ret = 0;
ofnode node;
- struct driver *drv;
dev_for_each_subnode(node, dev) {
+ struct driver *drv = NULL;
u32 protocol_id;
if (!ofnode_is_available(node))
@@ -70,9 +70,17 @@ static int scmi_bind_protocols(struct udevice *dev)
continue;
switch (protocol_id) {
+ case SCMI_PROTOCOL_ID_CLOCK:
+ if (IS_ENABLED(CONFIG_CLK_SCMI))
+ drv = DM_GET_DRIVER(scmi_clock);
+ break;
default:
- dev_info(dev, "Ignore unsupported SCMI protocol %#x\n",
- protocol_id);
+ break;
+ }
+
+ if (!drv) {
+ dev_dbg(dev, "Ignore unsupported SCMI protocol %#x\n",
+ protocol_id);
continue;
}