[PATCH 1/3] plat: ti: k3: fix SCMI parent clock ids
Sascha Hauer
s.hauer at pengutronix.de
Tue Jun 17 02:01:40 PDT 2025
On AM62lx not the full clock tree is exposed to the normal world.
Instead only some muxes are exposed which do not have any connection
between them. When a mux has a clock_id of 'n' its possible inputs have
the clock_ids 'n+1', 'n+2',... Now the mux inputs are not exposed as
'n+x', but instead only as 'x', so when the normal world wants to select
the first mux input then it has to pass 0 as input, not n+0. This
confuses the Linux and barebox SCMI clock drivers which hang all muxes
to the first n clock_ids instead of their real parents.
Fix this by adding the scmi clock_id to the possible parents.
Change-Id: I5857e67b040e0060b1d2fe57937b5b44ccc3441e
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
plat/ti/k3/common/drivers/scmi/scmi_clock.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plat/ti/k3/common/drivers/scmi/scmi_clock.c b/plat/ti/k3/common/drivers/scmi/scmi_clock.c
index 48a362ed5..afda3f05b 100644
--- a/plat/ti/k3/common/drivers/scmi/scmi_clock.c
+++ b/plat/ti/k3/common/drivers/scmi/scmi_clock.c
@@ -162,7 +162,7 @@ int32_t plat_scmi_clock_get_possible_parents(unsigned int agent_id,
clock->clock_id);
if (plat_possible_parents) {
for (uint32_t i = 0; i < (uint32_t)*nb_elts ; i++) {
- plat_possible_parents[i] = i;
+ plat_possible_parents[i] = i + scmi_id + 1;
}
}
VERBOSE("num_parents %d\n", (uint32_t)*nb_elts);
@@ -185,7 +185,7 @@ int32_t plat_scmi_clock_get_parent(unsigned int agent_id,
if (status)
return SCMI_GENERIC_ERROR;
- parent_id = parent_id - clock->clock_id - 1;
+ parent_id = parent_id - clock->clock_id + scmi_id;
VERBOSE("scmi_clock_get_parent parent_id = %d\n", parent_id);
return parent_id;
@@ -204,7 +204,7 @@ int32_t plat_scmi_clock_set_parent(unsigned int agent_id,
if (clock == 0)
return SCMI_NOT_FOUND;
- parent_id = parent_id + clock->clock_id + 1;
+ parent_id = parent_id + clock->clock_id - scmi_id;
status = scmi_handler_clock_set_clock_parent(clock->dev_id, clock->clock_id, parent_id);
if (status)
return SCMI_GENERIC_ERROR;
--
2.39.5
More information about the barebox
mailing list