diff options
| -rw-r--r-- | drivers/clk/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 3 | ||||
| -rw-r--r-- | drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 19 | ||||
| -rw-r--r-- | drivers/clk/sunxi-ng/ccu-sun5i.h | 4 | ||||
| -rw-r--r-- | drivers/clk/sunxi-ng/ccu-sun8i-a83t.c | 5 | ||||
| -rw-r--r-- | drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 3 | ||||
| -rw-r--r-- | drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 2 | ||||
| -rw-r--r-- | drivers/clk/sunxi/Kconfig | 43 | ||||
| -rw-r--r-- | drivers/clk/sunxi/Makefile | 49 | ||||
| -rw-r--r-- | include/dt-bindings/clock/sun5i-ccu.h | 2 |
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" | |||
| 310 | source "drivers/clk/renesas/Kconfig" | 310 | source "drivers/clk/renesas/Kconfig" |
| 311 | source "drivers/clk/samsung/Kconfig" | 311 | source "drivers/clk/samsung/Kconfig" |
| 312 | source "drivers/clk/sprd/Kconfig" | 312 | source "drivers/clk/sprd/Kconfig" |
| 313 | source "drivers/clk/sunxi/Kconfig" | ||
| 313 | source "drivers/clk/sunxi-ng/Kconfig" | 314 | source "drivers/clk/sunxi-ng/Kconfig" |
| 314 | source "drivers/clk/tegra/Kconfig" | 315 | source "drivers/clk/tegra/Kconfig" |
| 315 | source "drivers/clk/ti/Kconfig" | 316 | source "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 | ||
| 532 | static const char * const de_parents[] = { "pll-periph0-2x", "pll-de" }; | 532 | static const char * const de_parents[] = { "pll-periph0-2x", "pll-de" }; |
| 533 | static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents, | 533 | static 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 | ||
| 536 | static const char * const tcon0_parents[] = { "pll-mipi", "pll-video0-2x" }; | 537 | static const char * const tcon0_parents[] = { "pll-mipi", "pll-video0-2x" }; |
| 537 | static const u8 tcon0_table[] = { 0, 2, }; | 538 | static 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 | ||
| 271 | static SUNXI_CCU_GATE(bus_de_clk, "bus-de", "psi-ahb1-ahb2", | 271 | static 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 | ||
| 316 | static SUNXI_CCU_GATE(bus_ve_clk, "bus-ve", "psi-ahb1-ahb2", | 316 | static 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" }; | |||
| 656 | static const struct ccu_mux_fixed_prediv hdmi_cec_predivs[] = { | 656 | static 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 | ||
| 659 | static struct ccu_mux hdmi_cec_clk = { | 661 | static 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 | ||
| 694 | static SUNXI_CCU_GATE(bus_tcon_lcd0_clk, "bus-tcon-lcd0", "ahb3", | 696 | static 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 | ||
| 709 | static SUNXI_CCU_GATE(bus_tcon_tv0_clk, "bus-tcon-tv0", "ahb3", | 711 | static 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 | ||
| 514 | static SUNXI_CCU_GATE(mipi_csi_clk, "mipi-csi", "osc24M", 0x130, BIT(31), 0); | 514 | static SUNXI_CCU_GATE(mipi_csi_clk, "mipi-csi", "osc24M", 0x130, BIT(31), 0); |
| 515 | 515 | ||
| 516 | static const char * const csi_mclk_parents[] = { "pll-de", "osc24M" }; | 516 | static const char * const csi_mclk_parents[] = { "pll-video0", "pll-de", |
| 517 | static const u8 csi_mclk_table[] = { 3, 5 }; | 517 | "osc24M" }; |
| 518 | static const u8 csi_mclk_table[] = { 0, 3, 5 }; | ||
| 518 | static SUNXI_CCU_M_WITH_MUX_TABLE_GATE(csi_mclk_clk, "csi-mclk", | 519 | static 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 | ||
| 326 | static const char * const de_parents[] = { "pll-video", "pll-periph0" }; | 326 | static const char * const de_parents[] = { "pll-video", "pll-periph0" }; |
| 327 | static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents, | 327 | static 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 | ||
| 330 | static const char * const tcon_parents[] = { "pll-video" }; | 331 | static const char * const tcon_parents[] = { "pll-video" }; |
| 331 | static SUNXI_CCU_M_WITH_MUX_GATE(tcon_clk, "tcon", tcon_parents, | 332 | static 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 | ||
| 242 | static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M", | 242 | static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M", |
| 243 | 0x0cc, BIT(8), 0); | 243 | 0x0cc, BIT(1), 0); |
| 244 | 244 | ||
| 245 | static SUNXI_CCU_GATE(dram_ve_clk, "dram-ve", "pll-ddr", | 245 | static 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 @@ | |||
| 1 | menuconfig CLK_SUNXI | ||
| 2 | bool "Legacy clock support for Allwinner SoCs" | ||
| 3 | depends on ARCH_SUNXI || COMPILE_TEST | ||
| 4 | default y | ||
| 5 | |||
| 6 | if CLK_SUNXI | ||
| 7 | |||
| 8 | config 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 | |||
| 19 | config 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 | |||
| 27 | config 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 | |||
| 36 | config 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 | |||
| 43 | endif | ||
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 | ||
| 6 | obj-y += clk-sunxi.o clk-factors.o | 6 | obj-$(CONFIG_CLK_SUNXI) += clk-factors.o |
| 7 | obj-y += clk-a10-codec.o | ||
| 8 | obj-y += clk-a10-hosc.o | ||
| 9 | obj-y += clk-a10-mod1.o | ||
| 10 | obj-y += clk-a10-pll2.o | ||
| 11 | obj-y += clk-a10-ve.o | ||
| 12 | obj-y += clk-a20-gmac.o | ||
| 13 | obj-y += clk-mod0.o | ||
| 14 | obj-y += clk-simple-gates.o | ||
| 15 | obj-y += clk-sun4i-display.o | ||
| 16 | obj-y += clk-sun4i-pll3.o | ||
| 17 | obj-y += clk-sun4i-tcon-ch1.o | ||
| 18 | obj-y += clk-sun8i-bus-gates.o | ||
| 19 | obj-y += clk-sun8i-mbus.o | ||
| 20 | obj-y += clk-sun9i-core.o | ||
| 21 | obj-y += clk-sun9i-mmc.o | ||
| 22 | obj-y += clk-usb.o | ||
| 23 | 7 | ||
| 24 | obj-$(CONFIG_MACH_SUN9I) += clk-sun8i-apb0.o | 8 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sunxi.o |
| 25 | obj-$(CONFIG_MACH_SUN9I) += clk-sun9i-cpus.o | 9 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a10-codec.o |
| 10 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a10-hosc.o | ||
| 11 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a10-mod1.o | ||
| 12 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a10-pll2.o | ||
| 13 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a10-ve.o | ||
| 14 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-a20-gmac.o | ||
| 15 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-mod0.o | ||
| 16 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-simple-gates.o | ||
| 17 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun4i-display.o | ||
| 18 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun4i-pll3.o | ||
| 19 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun4i-tcon-ch1.o | ||
| 20 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun8i-bus-gates.o | ||
| 21 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun8i-mbus.o | ||
| 22 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun9i-core.o | ||
| 23 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun9i-mmc.o | ||
| 24 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-usb.o | ||
| 26 | 25 | ||
| 27 | obj-$(CONFIG_MFD_SUN6I_PRCM) += \ | 26 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun8i-apb0.o |
| 28 | clk-sun6i-ar100.o clk-sun6i-apb0.o clk-sun6i-apb0-gates.o \ | 27 | obj-$(CONFIG_CLK_SUNXI_CLOCKS) += clk-sun9i-cpus.o |
| 29 | clk-sun8i-apb0.o | 28 | |
| 29 | obj-$(CONFIG_CLK_SUNXI_PRCM_SUN6I) += clk-sun6i-apb0.o | ||
| 30 | obj-$(CONFIG_CLK_SUNXI_PRCM_SUN6I) += clk-sun6i-apb0-gates.o | ||
| 31 | obj-$(CONFIG_CLK_SUNXI_PRCM_SUN6I) += clk-sun6i-ar100.o | ||
| 32 | |||
| 33 | obj-$(CONFIG_CLK_SUNXI_PRCM_SUN8I) += clk-sun8i-apb0.o | ||
| 34 | obj-$(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_ */ |
