at91: add kernel support for sama7g5 soc
[openwrt/staging/ldir.git] / target / linux / at91 / patches-5.10 / 102-dt-bindings-clock-at91-add-sama7g5-pll-defines.patch
1 From 44bb7c72cdd830f54fe18e730205f892d9cbfe39 Mon Sep 17 00:00:00 2001
2 From: Eugen Hristev <eugen.hristev@microchip.com>
3 Date: Thu, 19 Nov 2020 17:43:08 +0200
4 Subject: [PATCH 102/247] dt-bindings: clock: at91: add sama7g5 pll defines
5
6 Add SAMA7G5 specific PLL defines to be referenced in a phandle as a
7 PMC_TYPE_CORE clock.
8
9 Suggested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
10 Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
11 [claudiu.beznea@microchip.com: adapt comit message, adapt sama7g5.c]
12 Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
13 Link: https://lore.kernel.org/r/1605800597-16720-3-git-send-email-claudiu.beznea@microchip.com
14 Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 ---
16 drivers/clk/at91/sama7g5.c | 6 +++---
17 include/dt-bindings/clock/at91.h | 10 ++++++++++
18 2 files changed, 13 insertions(+), 3 deletions(-)
19
20 diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c
21 index a092a940baa4..7ef7963126b6 100644
22 --- a/drivers/clk/at91/sama7g5.c
23 +++ b/drivers/clk/at91/sama7g5.c
24 @@ -182,13 +182,13 @@ static const struct {
25 .p = "audiopll_fracck",
26 .l = &pll_layout_divpmc,
27 .t = PLL_TYPE_DIV,
28 - .eid = PMC_I2S0_MUX, },
29 + .eid = PMC_AUDIOPMCPLL, },
30
31 { .n = "audiopll_diviock",
32 .p = "audiopll_fracck",
33 .l = &pll_layout_divio,
34 .t = PLL_TYPE_DIV,
35 - .eid = PMC_I2S1_MUX, },
36 + .eid = PMC_AUDIOIOPLL, },
37 },
38
39 [PLL_ID_ETH] = {
40 @@ -835,7 +835,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
41 if (IS_ERR(regmap))
42 return;
43
44 - sama7g5_pmc = pmc_data_allocate(PMC_I2S1_MUX + 1,
45 + sama7g5_pmc = pmc_data_allocate(PMC_ETHPLL + 1,
46 nck(sama7g5_systemck),
47 nck(sama7g5_periphck),
48 nck(sama7g5_gck), 8);
49 diff --git a/include/dt-bindings/clock/at91.h b/include/dt-bindings/clock/at91.h
50 index eba17106608b..fab313f62e8f 100644
51 --- a/include/dt-bindings/clock/at91.h
52 +++ b/include/dt-bindings/clock/at91.h
53 @@ -25,6 +25,16 @@
54 #define PMC_PLLBCK 8
55 #define PMC_AUDIOPLLCK 9
56
57 +/* SAMA7G5 */
58 +#define PMC_CPUPLL (PMC_MAIN + 1)
59 +#define PMC_SYSPLL (PMC_MAIN + 2)
60 +#define PMC_DDRPLL (PMC_MAIN + 3)
61 +#define PMC_IMGPLL (PMC_MAIN + 4)
62 +#define PMC_BAUDPLL (PMC_MAIN + 5)
63 +#define PMC_AUDIOPMCPLL (PMC_MAIN + 6)
64 +#define PMC_AUDIOIOPLL (PMC_MAIN + 7)
65 +#define PMC_ETHPLL (PMC_MAIN + 8)
66 +
67 #ifndef AT91_PMC_MOSCS
68 #define AT91_PMC_MOSCS 0 /* MOSCS Flag */
69 #define AT91_PMC_LOCKA 1 /* PLLA Lock */
70 --
71 2.32.0
72