[PATCH/RFC 8/9] firmware: arm_scmi: quirk: Handle power management clocks on R-Car X5H

Geert Uytterhoeven geert+renesas at glider.be
Thu Jun 11 06:02:12 PDT 2026


On Renesas R-Car X5H, power management of on-SoC modules is handled
through two methods: module power control and module clock gating.  The
former is exposed as an SCMI power domain, the latter as an SCMI clock.

Currently the SCMI clock protocol does not support advertizing
power-management clocks yet.  Add quirks to mark all module clocks
suitable for power management, reusing the existing clock_rcar_x5h_4_28
and clock_rcar_x5h_4_31 quirk keys.

Signed-off-by: Geert Uytterhoeven <geert+renesas at glider.be>
---
This patch is included as a PoC.
This does not build as the quirk keys are not added in this series.
---
 drivers/firmware/arm_scmi/clock.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c
index 42e666a628c732e5..c2648f9f283f2488 100644
--- a/drivers/firmware/arm_scmi/clock.c
+++ b/drivers/firmware/arm_scmi/clock.c
@@ -355,6 +355,18 @@ scmi_clock_get_permissions(const struct scmi_protocol_handle *ph, u32 clk_id,
 	return ret;
 }
 
+#define QUIRK_RCAR_X5H_4_28_PM_CLK					\
+	({								\
+		if (clk_id <= 818 /* Last MDLC clock MDLC_GPIODM3 */)	\
+			clk->pm_clk = true;				\
+	})
+
+#define QUIRK_RCAR_X5H_4_31_PM_CLK					\
+	({								\
+		if (clk_id <= 814 /* Last MDLC clock MDLC_GPIODM3 */)	\
+			clk->pm_clk = true;				\
+	})
+
 static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph,
 				     u32 clk_id, struct clock_info *cinfo)
 {
@@ -410,6 +422,9 @@ static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph,
 			if (SUPPORTS_EXTENDED_CONFIG(attributes))
 				clk->extended_config = true;
 		}
+
+		SCMI_QUIRK(clock_rcar_x5h_4_28, QUIRK_RCAR_X5H_4_28_PM_CLK);
+		SCMI_QUIRK(clock_rcar_x5h_4_31, QUIRK_RCAR_X5H_4_31_PM_CLK);
 	}
 
 	return ret;
-- 
2.43.0




More information about the linux-arm-kernel mailing list