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

clk: at91: sama7g5: register cpu clock

Register CPU clock as being the master clock prescaler. This would
be used by DVFS. The block schema of SAMA7G5's PMC contains also a divider
between master clock prescaler and CPU (PMC_CPU_RATIO.RATIO) but the
frequencies supported by SAMA7G5 could be directly received from
CPUPLL + master clock prescaler and the extra divider would do no work in
case it would be enabled.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/1605800597-16720-12-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Claudiu Beznea and committed by
Stephen Boyd
91f3bf0d 7a110b91

+7 -7
+6 -7
drivers/clk/at91/sama7g5.c
··· 904 904 if (IS_ERR(regmap)) 905 905 return; 906 906 907 - sama7g5_pmc = pmc_data_allocate(PMC_ETHPLL + 1, 907 + sama7g5_pmc = pmc_data_allocate(PMC_CPU + 1, 908 908 nck(sama7g5_systemck), 909 909 nck(sama7g5_periphck), 910 910 nck(sama7g5_gck), 8); ··· 981 981 } 982 982 } 983 983 984 - parent_names[0] = md_slck_name; 985 - parent_names[1] = "mainck"; 986 - parent_names[2] = "cpupll_divpmcck"; 987 - parent_names[3] = "syspll_divpmcck"; 988 - hw = at91_clk_register_master_pres(regmap, "mck0_pres", 4, parent_names, 984 + parent_names[0] = "cpupll_divpmcck"; 985 + hw = at91_clk_register_master_pres(regmap, "cpuck", 1, parent_names, 989 986 &mck0_layout, &mck0_characteristics, 990 987 &pmc_mck0_lock, 991 988 CLK_SET_RATE_PARENT, 0); 992 989 if (IS_ERR(hw)) 993 990 goto err_free; 994 991 995 - hw = at91_clk_register_master_div(regmap, "mck0_div", "mck0_pres", 992 + sama7g5_pmc->chws[PMC_CPU] = hw; 993 + 994 + hw = at91_clk_register_master_div(regmap, "mck0", "cpuck", 996 995 &mck0_layout, &mck0_characteristics, 997 996 &pmc_mck0_lock, 0); 998 997 if (IS_ERR(hw))
+1
include/dt-bindings/clock/at91.h
··· 34 34 #define PMC_AUDIOPMCPLL (PMC_MAIN + 6) 35 35 #define PMC_AUDIOIOPLL (PMC_MAIN + 7) 36 36 #define PMC_ETHPLL (PMC_MAIN + 8) 37 + #define PMC_CPU (PMC_MAIN + 9) 37 38 38 39 #ifndef AT91_PMC_MOSCS 39 40 #define AT91_PMC_MOSCS 0 /* MOSCS Flag */