From d4585bdee82662408e54013c137a66262b27daea Mon Sep 17 00:00:00 2001 From: Tony Han Date: Thu, 13 Jun 2024 13:48:48 +0800 Subject: [PATCH] plat-sam: register CPU OPP clock for SCMI usage Add the definitinon for 'AT91_SCMI_CLK_CPU_OPP'. When the CPU OPP clock is available, add it to SCMI clock list. Signed-off-by: Tony Han Acked-by: Etienne Carriere --- core/arch/arm/plat-sam/scmi_server.c | 9 +++++++++ core/include/dt-bindings/clock/at91.h | 1 + 2 files changed, 10 insertions(+) diff --git a/core/arch/arm/plat-sam/scmi_server.c b/core/arch/arm/plat-sam/scmi_server.c index 8dd5ecc7701..cba98c27818 100644 --- a/core/arch/arm/plat-sam/scmi_server.c +++ b/core/arch/arm/plat-sam/scmi_server.c @@ -1026,6 +1026,15 @@ static TEE_Result sam_init_scmi_clk(void) return res; } + clk = at91_cpu_opp_clk_get(); + if (clk) { + res = scmi_clk_add(clk, 0, AT91_SCMI_CLK_CPU_OPP); + if (res) { + EMSG("Failed to add CPU OPP clock to SCMI clocks"); + return res; + } + } + return TEE_SUCCESS; } diff --git a/core/include/dt-bindings/clock/at91.h b/core/include/dt-bindings/clock/at91.h index 0e73b4c6f84..c10e0de4e77 100644 --- a/core/include/dt-bindings/clock/at91.h +++ b/core/include/dt-bindings/clock/at91.h @@ -136,6 +136,7 @@ #define AT91_SCMI_CLK_PROG_PROG2 81 #define AT91_SCMI_CLK_SCKC_SLOWCK_32K 82 +#define AT91_SCMI_CLK_CPU_OPP 101 #ifdef CFG_SAMA7G5 #define AT91_SCMI_CLK_CORE_CPUPLLCK 4