aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@kernel.org>2019-04-19 16:11:39 -0400
committerStephen Boyd <sboyd@kernel.org>2019-04-19 16:11:39 -0400
commit93737fe93ec6cd3ffe49f631ad854c36a3d78ac2 (patch)
treee4f65c542420799e6cbce22297c5f05008b1ccdf
parent9e98c678c2d6ae3a17cb2de55d17f69dddaa231b (diff)
parentc77cebac96a9edf1f3a508b475110f5d44196901 (diff)
Merge tag 'sunxi-clk-for-5.2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner
Pull Allwinner clk driver updates from Maxime Ripard: Our usual bunch of changes, this time, it's mainly: - Export a new clock for the MBUS controller on the A13 - H6 fixes to support a finer clocking of the video and VPU engines - Add some Kconfig options - Some bit offset fixes * tag 'sunxi-clk-for-5.2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: sun5i: Export the MBUS clock clk: sunxi-ng: a83t: Add pll-video0 as parent of csi-mclk clk: sunxi-ng: h6: Allow video & vpu clocks to change parent rate clk: sunxi-ng: h6: Preset hdmi-cec clock parent clk: sunxi: Add Kconfig options clk: sunxi-ng: f1c100s: fix USB PHY gate bit offset clk: sunxi-ng: Allow DE clock to set parent rate
-rw-r--r--drivers/clk/Kconfig1
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun50i-a64.c3
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun50i-h6.c19
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun5i.h4
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun8i-a83t.c5
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun8i-v3s.c3
-rw-r--r--drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c2
-rw-r--r--drivers/clk/sunxi/Kconfig43
-rw-r--r--drivers/clk/sunxi/Makefile49
-rw-r--r--include/dt-bindings/clock/sun5i-ccu.h2
10 files changed, 95 insertions, 36 deletions
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index e705aab9e38b..f96c7f39ab7e 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -310,6 +310,7 @@ source "drivers/clk/qcom/Kconfig"
310source "drivers/clk/renesas/Kconfig" 310source "drivers/clk/renesas/Kconfig"
311source "drivers/clk/samsung/Kconfig" 311source "drivers/clk/samsung/Kconfig"
312source "drivers/clk/sprd/Kconfig" 312source "drivers/clk/sprd/Kconfig"
313source "drivers/clk/sunxi/Kconfig"
313source "drivers/clk/sunxi-ng/Kconfig" 314source "drivers/clk/sunxi-ng/Kconfig"
314source "drivers/clk/tegra/Kconfig" 315source "drivers/clk/tegra/Kconfig"
315source "drivers/clk/ti/Kconfig" 316source "drivers/clk/ti/Kconfig"
diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
index 932836d26e2b..be0deee70182 100644
--- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
@@ -531,7 +531,8 @@ static SUNXI_CCU_GATE(dram_ts_clk, "dram-ts", "dram",
531 531
532static const char * const de_parents[] = { "pll-periph0-2x", "pll-de" }; 532static const char * const de_parents[] = { "pll-periph0-2x", "pll-de" };
533static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents, 533static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents,
534 0x104, 0, 4, 24, 3, BIT(31), 0); 534 0x104, 0, 4, 24, 3, BIT(31),
535 CLK_SET_RATE_PARENT);
535 536
536static const char * const tcon0_parents[] = { "pll-mipi", "pll-video0-2x" }; 537static const char * const tcon0_parents[] = { "pll-mipi", "pll-video0-2x" };
537static const u8 tcon0_table[] = { 0, 2, }; 538static const u8 tcon0_table[] = { 0, 2, };
diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
index 139e8389615c..3c32d7798f27 100644
--- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
@@ -266,7 +266,7 @@ static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents, 0x600,
266 0, 4, /* M */ 266 0, 4, /* M */
267 24, 1, /* mux */ 267 24, 1, /* mux */
268 BIT(31), /* gate */ 268 BIT(31), /* gate */
269 0); 269 CLK_SET_RATE_PARENT);
270 270
271static SUNXI_CCU_GATE(bus_de_clk, "bus-de", "psi-ahb1-ahb2", 271static SUNXI_CCU_GATE(bus_de_clk, "bus-de", "psi-ahb1-ahb2",
272 0x60c, BIT(0), 0); 272 0x60c, BIT(0), 0);
@@ -311,7 +311,7 @@ static SUNXI_CCU_M_WITH_MUX_GATE(ve_clk, "ve", ve_parents, 0x690,
311 0, 3, /* M */ 311 0, 3, /* M */
312 24, 1, /* mux */ 312 24, 1, /* mux */
313 BIT(31), /* gate */ 313 BIT(31), /* gate */
314 0); 314 CLK_SET_RATE_PARENT);
315 315
316static SUNXI_CCU_GATE(bus_ve_clk, "bus-ve", "psi-ahb1-ahb2", 316static SUNXI_CCU_GATE(bus_ve_clk, "bus-ve", "psi-ahb1-ahb2",
317 0x69c, BIT(0), 0); 317 0x69c, BIT(0), 0);
@@ -656,6 +656,8 @@ static const char * const hdmi_cec_parents[] = { "osc32k", "pll-periph0-2x" };
656static const struct ccu_mux_fixed_prediv hdmi_cec_predivs[] = { 656static const struct ccu_mux_fixed_prediv hdmi_cec_predivs[] = {
657 { .index = 1, .div = 36621 }, 657 { .index = 1, .div = 36621 },
658}; 658};
659
660#define SUN50I_H6_HDMI_CEC_CLK_REG 0xb10
659static struct ccu_mux hdmi_cec_clk = { 661static struct ccu_mux hdmi_cec_clk = {
660 .enable = BIT(31), 662 .enable = BIT(31),
661 663
@@ -689,7 +691,7 @@ static SUNXI_CCU_MUX_WITH_GATE(tcon_lcd0_clk, "tcon-lcd0",
689 tcon_lcd0_parents, 0xb60, 691 tcon_lcd0_parents, 0xb60,
690 24, 3, /* mux */ 692 24, 3, /* mux */
691 BIT(31), /* gate */ 693 BIT(31), /* gate */
692 0); 694 CLK_SET_RATE_PARENT);
693 695
694static SUNXI_CCU_GATE(bus_tcon_lcd0_clk, "bus-tcon-lcd0", "ahb3", 696static SUNXI_CCU_GATE(bus_tcon_lcd0_clk, "bus-tcon-lcd0", "ahb3",
695 0xb7c, BIT(0), 0); 697 0xb7c, BIT(0), 0);
@@ -704,7 +706,7 @@ static SUNXI_CCU_MP_WITH_MUX_GATE(tcon_tv0_clk, "tcon-tv0",
704 8, 2, /* P */ 706 8, 2, /* P */
705 24, 3, /* mux */ 707 24, 3, /* mux */
706 BIT(31), /* gate */ 708 BIT(31), /* gate */
707 0); 709 CLK_SET_RATE_PARENT);
708 710
709static SUNXI_CCU_GATE(bus_tcon_tv0_clk, "bus-tcon-tv0", "ahb3", 711static SUNXI_CCU_GATE(bus_tcon_tv0_clk, "bus-tcon-tv0", "ahb3",
710 0xb9c, BIT(0), 0); 712 0xb9c, BIT(0), 0);
@@ -1200,6 +1202,15 @@ static int sun50i_h6_ccu_probe(struct platform_device *pdev)
1200 val &= ~(GENMASK(21, 16) | BIT(0)); 1202 val &= ~(GENMASK(21, 16) | BIT(0));
1201 writel(val | (7 << 16), reg + SUN50I_H6_PLL_AUDIO_REG); 1203 writel(val | (7 << 16), reg + SUN50I_H6_PLL_AUDIO_REG);
1202 1204
1205 /*
1206 * First clock parent (osc32K) is unusable for CEC. But since there
1207 * is no good way to force parent switch (both run with same frequency),
1208 * just set second clock parent here.
1209 */
1210 val = readl(reg + SUN50I_H6_HDMI_CEC_CLK_REG);
1211 val |= BIT(24);
1212 writel(val, reg + SUN50I_H6_HDMI_CEC_CLK_REG);
1213
1203 return sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_h6_ccu_desc); 1214 return sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_h6_ccu_desc);
1204} 1215}
1205 1216
diff --git a/drivers/clk/sunxi-ng/ccu-sun5i.h b/drivers/clk/sunxi-ng/ccu-sun5i.h
index 93a275fbd9a9..b66abd4fd0bf 100644
--- a/drivers/clk/sunxi-ng/ccu-sun5i.h
+++ b/drivers/clk/sunxi-ng/ccu-sun5i.h
@@ -60,10 +60,6 @@
60 60
61/* The rest of the module clocks are exported */ 61/* The rest of the module clocks are exported */
62 62
63#define CLK_MBUS 99
64
65/* And finally the IEP clock */
66
67#define CLK_NUMBER (CLK_IEP + 1) 63#define CLK_NUMBER (CLK_IEP + 1)
68 64
69#endif /* _CCU_SUN5I_H_ */ 65#endif /* _CCU_SUN5I_H_ */
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c b/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
index 2d6555d73170..5f714b4d8ee4 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
@@ -513,8 +513,9 @@ static SUNXI_CCU_GATE(csi_misc_clk, "csi-misc", "osc24M", 0x130, BIT(16), 0);
513 513
514static SUNXI_CCU_GATE(mipi_csi_clk, "mipi-csi", "osc24M", 0x130, BIT(31), 0); 514static SUNXI_CCU_GATE(mipi_csi_clk, "mipi-csi", "osc24M", 0x130, BIT(31), 0);
515 515
516static const char * const csi_mclk_parents[] = { "pll-de", "osc24M" }; 516static const char * const csi_mclk_parents[] = { "pll-video0", "pll-de",
517static const u8 csi_mclk_table[] = { 3, 5 }; 517 "osc24M" };
518static const u8 csi_mclk_table[] = { 0, 3, 5 };
518static SUNXI_CCU_M_WITH_MUX_TABLE_GATE(csi_mclk_clk, "csi-mclk", 519static SUNXI_CCU_M_WITH_MUX_TABLE_GATE(csi_mclk_clk, "csi-mclk",
519 csi_mclk_parents, csi_mclk_table, 520 csi_mclk_parents, csi_mclk_table,
520 0x134, 521 0x134,
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c b/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c
index ac12f261f8ca..eada0e291859 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c
@@ -325,7 +325,8 @@ static SUNXI_CCU_GATE(dram_ohci_clk, "dram-ohci", "dram",
325 325
326static const char * const de_parents[] = { "pll-video", "pll-periph0" }; 326static const char * const de_parents[] = { "pll-video", "pll-periph0" };
327static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents, 327static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents,
328 0x104, 0, 4, 24, 2, BIT(31), 0); 328 0x104, 0, 4, 24, 2, BIT(31),
329 CLK_SET_RATE_PARENT);
329 330
330static const char * const tcon_parents[] = { "pll-video" }; 331static const char * const tcon_parents[] = { "pll-video" };
331static SUNXI_CCU_M_WITH_MUX_GATE(tcon_clk, "tcon", tcon_parents, 332static SUNXI_CCU_M_WITH_MUX_GATE(tcon_clk, "tcon", tcon_parents,
diff --git a/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c b/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c
index a09dfbe36402..dc9f0a365664 100644
--- a/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c
+++ b/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c
@@ -240,7 +240,7 @@ static SUNXI_CCU_MUX_WITH_GATE(spdif_clk, "spdif", i2s_spdif_parents,
240/* The BSP header file has a CIR_CFG, but no mod clock uses this definition */ 240/* The BSP header file has a CIR_CFG, but no mod clock uses this definition */
241 241
242static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M", 242static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M",
243 0x0cc, BIT(8), 0); 243 0x0cc, BIT(1), 0);
244 244
245static SUNXI_CCU_GATE(dram_ve_clk, "dram-ve", "pll-ddr", 245static SUNXI_CCU_GATE(dram_ve_clk, "dram-ve", "pll-ddr",
246 0x100, BIT(0), 0); 246 0x100, BIT(0), 0);
diff --git a/drivers/clk/sunxi/Kconfig b/drivers/clk/sunxi/Kconfig
new file mode 100644
index 000000000000..2b6207cc4eda
--- /dev/null
+++ b/drivers/clk/sunxi/Kconfig
@@ -0,0 +1,43 @@
1menuconfig CLK_SUNXI
2 bool "Legacy clock support for Allwinner SoCs"
3 depends on ARCH_SUNXI || COMPILE_TEST
4 default y
5
6if CLK_SUNXI
7
8config CLK_SUNXI_CLOCKS
9 bool "Legacy clock drivers"
10 default y
11 help
12 Legacy clock drivers being used on older (A10, A13, A20,
13 A23, A31, A80) SoCs. These drivers are kept around for
14 Device Tree backward compatibility issues, in case one would
15 still use a Device Tree with one clock provider by
16 node. Newer Device Trees and newer SoCs use the drivers
17 controlled by CONFIG_SUNXI_CCU.
18
19config CLK_SUNXI_PRCM_SUN6I
20 bool "Legacy A31 PRCM driver"
21 select MFD_SUN6I_PRCM
22 default y
23 help
24 Legacy clock driver for the A31 PRCM clocks. Those are
25 usually needed for the PMIC communication, mostly.
26
27config CLK_SUNXI_PRCM_SUN8I
28 bool "Legacy sun8i PRCM driver"
29 select MFD_SUN6I_PRCM
30 default y
31 help
32 Legacy clock driver for the sun8i family PRCM clocks.
33 Those are usually needed for the PMIC communication,
34 mostly.
35
36config CLK_SUNXI_PRCM_SUN9I
37 bool "Legacy A80 PRCM driver"
38 default y
39 help
40 Legacy clock driver for the A80 PRCM clocks. Those are
41 usually needed for the PMIC communication, mostly.
42
43endif
diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile
index be88368b48a1..e10824c76ae9 100644
--- a/drivers/clk/sunxi/Makefile
+++ b/drivers/clk/sunxi/Makefile
@@ -3,27 +3,32 @@
3# Makefile for sunxi specific clk 3# Makefile for sunxi specific clk
4# 4#
5 5
6obj-y += clk-sunxi.o clk-factors.o 6obj-$(CONFIG_CLK_SUNXI) += clk-factors.o
7obj-y += clk-a10-codec.o
8obj-y += clk-a10-hosc.o
9obj-y += clk-a10-mod1.o
10obj-y += clk-a10-pll2.o
11obj-y += clk-a10-ve.o
12obj-y += clk-a20-gmac.o
13obj-y += clk-mod0.o
14obj-y += clk-simple-gates.o
15obj-y += clk-sun4i-display.o
16obj-y += clk-sun4i-pll3.o
17obj-y += clk-sun4i-tcon-ch1.o
18obj-y += clk-sun8i-bus-gates.o
19obj-y += clk-sun8i-mbus.o
20obj-y += clk-sun9i-core.o
21obj-y += clk-sun9i-mmc.o
22obj-y += clk-usb.o
23 7
24obj-$(CONFIG_MACH_SUN9I) += clk-sun8i-apb0.o 8obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sunxi.o
25obj-$(CONFIG_MACH_SUN9I) += clk-sun9i-cpus.o 9obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a10-codec.o
10obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a10-hosc.o
11obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a10-mod1.o
12obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a10-pll2.o
13obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a10-ve.o
14obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a20-gmac.o
15obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-mod0.o
16obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-simple-gates.o
17obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun4i-display.o
18obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun4i-pll3.o
19obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun4i-tcon-ch1.o
20obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun8i-bus-gates.o
21obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun8i-mbus.o
22obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun9i-core.o
23obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun9i-mmc.o
24obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-usb.o
26 25
27obj-$(CONFIG_MFD_SUN6I_PRCM) += \ 26obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun8i-apb0.o
28 clk-sun6i-ar100.o clk-sun6i-apb0.o clk-sun6i-apb0-gates.o \ 27obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun9i-cpus.o
29 clk-sun8i-apb0.o 28
29obj-$(CONFIG_CLK_SUNXI_PRCM_SUN6I) += clk-sun6i-apb0.o
30obj-$(CONFIG_CLK_SUNXI_PRCM_SUN6I) += clk-sun6i-apb0-gates.o
31obj-$(CONFIG_CLK_SUNXI_PRCM_SUN6I) += clk-sun6i-ar100.o
32
33obj-$(CONFIG_CLK_SUNXI_PRCM_SUN8I) += clk-sun8i-apb0.o
34obj-$(CONFIG_CLK_SUNXI_PRCM_SUN8I) += clk-sun6i-apb0-gates.o
diff --git a/include/dt-bindings/clock/sun5i-ccu.h b/include/dt-bindings/clock/sun5i-ccu.h
index 81f34d477aeb..2e6b9ddcc24e 100644
--- a/include/dt-bindings/clock/sun5i-ccu.h
+++ b/include/dt-bindings/clock/sun5i-ccu.h
@@ -100,7 +100,7 @@
100#define CLK_AVS 96 100#define CLK_AVS 96
101#define CLK_HDMI 97 101#define CLK_HDMI 97
102#define CLK_GPU 98 102#define CLK_GPU 98
103 103#define CLK_MBUS 99
104#define CLK_IEP 100 104#define CLK_IEP 100
105 105
106#endif /* _DT_BINDINGS_CLK_SUN5I_H_ */ 106#endif /* _DT_BINDINGS_CLK_SUN5I_H_ */