From 2333bbb7af80ea29cf96574b6566de547bb0dbc2 Mon Sep 17 00:00:00 2001 From: Tony Han Date: Mon, 11 Sep 2023 17:19:27 +0800 Subject: [PATCH] drivers: atmel_tcb: update to compatible with sama7g5 Update the clocks for sama7g5's TC. Signed-off-by: Tony Han --- core/drivers/atmel_tcb.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/drivers/atmel_tcb.c b/core/drivers/atmel_tcb.c index 9458c2864f7..2d873a97f02 100644 --- a/core/drivers/atmel_tcb.c +++ b/core/drivers/atmel_tcb.c @@ -50,7 +50,12 @@ #define TCB_WPMR 0xe4 #define TCB_WPMR_WAKEY 0x54494d +#ifdef CFG_DRIVERS_SAMA7G5_CLK +static const char * const tcb_clocks[] = {"t0_clk", "t1_clk", "t2_clk", + "td_slck"}; +#else static const char * const tcb_clocks[] = { "t0_clk", "gclk", "slow_clk" }; +#endif static vaddr_t tcb_base; static uint32_t tcb_rate; @@ -168,7 +173,11 @@ static TEE_Result atmel_tcb_probe(const void *fdt, int node, if (fdt_get_status(fdt, node) != DT_STATUS_OK_SEC) return TEE_SUCCESS; +#ifdef CFG_DRIVERS_SAMA7G5_CLK + res = clk_dt_get_by_name(fdt, node, "td_slck", &clk); +#else res = clk_dt_get_by_name(fdt, node, "slow_clk", &clk); +#endif if (res) return res;