Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: at91: sama7g5: Allow MCK1 to be exported and referenced in DT

MCK1 feeds the External Bus Interface (EBI). EBI's clock rate is used
to translate EBI's timmings to SMC timings, thus we need to handle MCK1
in the EBI driver. Allow MCK1 to be referenced as a PMC_TYPE_CORE clock
from phandle in DT.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20220111125310.902856-1-tudor.ambarus@microchip.com
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Tudor Ambarus and committed by
Stephen Boyd
a5ab04af ea2be22f

+8 -1
+7 -1
drivers/clk/at91/sama7g5.c
··· 302 302 * @ep_count: extra parents count 303 303 * @ep_mux_table: mux table for extra parents 304 304 * @id: clock id 305 + * @eid: export index in sama7g5->chws[] array 305 306 * @c: true if clock is critical and cannot be disabled 306 307 */ 307 308 static const struct { ··· 312 311 u8 ep_count; 313 312 u8 ep_mux_table[4]; 314 313 u8 id; 314 + u8 eid; 315 315 u8 c; 316 316 } sama7g5_mckx[] = { 317 317 { .n = "mck1", ··· 321 319 .ep_mux_table = { 5, }, 322 320 .ep_count = 1, 323 321 .ep_chg_id = INT_MIN, 322 + .eid = PMC_MCK1, 324 323 .c = 1, }, 325 324 326 325 { .n = "mck2", ··· 916 913 if (IS_ERR(regmap)) 917 914 return; 918 915 919 - sama7g5_pmc = pmc_data_allocate(PMC_CPU + 1, 916 + sama7g5_pmc = pmc_data_allocate(PMC_MCK1 + 1, 920 917 nck(sama7g5_systemck), 921 918 nck(sama7g5_periphck), 922 919 nck(sama7g5_gck), 8); ··· 1030 1027 goto err_free; 1031 1028 1032 1029 alloc_mem[alloc_mem_size++] = mux_table; 1030 + 1031 + if (sama7g5_mckx[i].eid) 1032 + sama7g5_pmc->chws[sama7g5_mckx[i].eid] = hw; 1033 1033 } 1034 1034 1035 1035 hw = at91_clk_sama7g5_register_utmi(regmap, "utmick", "main_xtal");
+1
include/dt-bindings/clock/at91.h
··· 36 36 #define PMC_AUDIOIOPLL (PMC_MAIN + 7) 37 37 #define PMC_ETHPLL (PMC_MAIN + 8) 38 38 #define PMC_CPU (PMC_MAIN + 9) 39 + #define PMC_MCK1 (PMC_MAIN + 10) 39 40 40 41 #ifndef AT91_PMC_MOSCS 41 42 #define AT91_PMC_MOSCS 0 /* MOSCS Flag */