Merge tag 'clk-for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk updates from Michael Turquette:
 "The bulk of the changes are updates and fixes to existing clk provider
  drivers, along with a pretty standard number of new drivers.  The core
  recieved a small number of updates as well.

  Core changes of note:
   - removed CLK_IS_ROOT flag

  New clk provider drivers:
   - Renesas r8a7796 clock pulse generator / module standby and
     software reset
   - Allwinner sun8i H3 clock controller unit
   - AmLogic meson8b clock controller (rewritten)
   - AmLogic gxbb clock controller
   - support for some new ICs was added by simple changes to static
     data tables for chips sharing the same family

  Driver updates of note:
   - the Allwinner sunxi clock driver infrastucture was rewritten to
     comform to the state of the art at drivers/clk/sunxi-ng.  The old
     implementation is still supported for backwards compatibility with
     the DT ABI"

* tag 'clk-for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (162 commits)
  clk: Makefile: re-sort and clean up
  Revert "clk: gxbb: expose CLKID_MMC_PCLK"
  clk: samsung: Allow modular build of the Audio Subsystem CLKCON driver
  clk: samsung: make clk-s5pv210-audss explicitly non-modular
  clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks
  clk: oxnas: Add hardware dependencies
  clk: imx7d: do not set parent of ethernet time/ref clocks
  ARM: dt: sun8i: switch the H3 to the new CCU driver
  clk: sunxi-ng: h3: Fix Kconfig symbol typo
  clk: sunxi-ng: h3: Fix audio clock divider offset
  clk: sunxi-ng: Add H3 clocks
  clk: sunxi-ng: Add N-K-M-P factor clock
  clk: sunxi-ng: Add N-K-M Factor clock
  clk: sunxi-ng: Add N-M-factor clock support
  clk: sunxi-ng: Add N-K-factor clock support
  clk: sunxi-ng: Add M-P factor clock support
  clk: sunxi-ng: Add divider
  clk: sunxi-ng: Add phase clock support
  clk: sunxi-ng: Add mux clock support
  clk: sunxi-ng: Add gate clock support
  ...
This commit is contained in:
Linus Torvalds
2016-07-30 11:20:02 -07:00
148 changed files with 8997 additions and 3412 deletions
@@ -0,0 +1,36 @@
* Amlogic GXBB Clock and Reset Unit
The Amlogic GXBB clock controller generates and supplies clock to various
controllers within the SoC.
Required Properties:
- compatible: should be "amlogic,gxbb-clkc"
- reg: physical base address of the clock controller and length of memory
mapped region.
- #clock-cells: should be 1.
Each clock is assigned an identifier and client nodes can use this identifier
to specify the clock which they consume. All available clocks are defined as
preprocessor macros in the dt-bindings/clock/gxbb-clkc.h header and can be
used in device tree sources.
Example: Clock controller node:
clkc: clock-controller@c883c000 {
#clock-cells = <1>;
compatible = "amlogic,gxbb-clkc";
reg = <0x0 0xc883c000 0x0 0x3db>;
};
Example: UART controller node that consumes the clock generated by the clock
controller:
uart_AO: serial@c81004c0 {
compatible = "amlogic,meson-uart";
reg = <0xc81004c0 0x14>;
interrupts = <0 90 1>;
clocks = <&clkc CLKID_CLK81>;
status = "disabled";
};
@@ -14,6 +14,10 @@ Required properties:
Optional properties: Optional properties:
- clock-output-names : From common clock binding. - clock-output-names : From common clock binding.
Some clocks that require special treatments are also handled by that
driver, with the compatibles:
- allwinner,sun4i-a10-pll3-2x-clk
Example: Example:
clock { clock {
compatible = "fixed-factor-clock"; compatible = "fixed-factor-clock";
@@ -13,7 +13,8 @@ They provide the following functionalities:
Required Properties: Required Properties:
- compatible: Must be one of: - compatible: Must be one of:
- "renesas,r8a7795-cpg-mssr" for the r8a7795 SoC - "renesas,r8a7795-cpg-mssr" for the r8a7795 SoC (R-Car H3)
- "renesas,r8a7796-cpg-mssr" for the r8a7796 SoC (R-Car M3-W)
- reg: Base address and length of the memory resource used by the CPG/MSSR - reg: Base address and length of the memory resource used by the CPG/MSSR
block block
@@ -21,8 +22,8 @@ Required Properties:
- clocks: References to external parent clocks, one entry for each entry in - clocks: References to external parent clocks, one entry for each entry in
clock-names clock-names
- clock-names: List of external parent clock names. Valid names are: - clock-names: List of external parent clock names. Valid names are:
- "extal" (r8a7795) - "extal" (r8a7795, r8a7796)
- "extalr" (r8a7795) - "extalr" (r8a7795, r8a7796)
- #clock-cells: Must be 2 - #clock-cells: Must be 2
- For CPG core clocks, the two clock specifier cells must be "CPG_CORE" - For CPG core clocks, the two clock specifier cells must be "CPG_CORE"
@@ -17,6 +17,7 @@ Required Properties:
- "renesas,r8a7779-mstp-clocks" for R8A7779 (R-Car H1) MSTP gate clocks - "renesas,r8a7779-mstp-clocks" for R8A7779 (R-Car H1) MSTP gate clocks
- "renesas,r8a7790-mstp-clocks" for R8A7790 (R-Car H2) MSTP gate clocks - "renesas,r8a7790-mstp-clocks" for R8A7790 (R-Car H2) MSTP gate clocks
- "renesas,r8a7791-mstp-clocks" for R8A7791 (R-Car M2-W) MSTP gate clocks - "renesas,r8a7791-mstp-clocks" for R8A7791 (R-Car M2-W) MSTP gate clocks
- "renesas,r8a7792-mstp-clocks" for R8A7792 (R-Car V2H) MSTP gate clocks
- "renesas,r8a7793-mstp-clocks" for R8A7793 (R-Car M2-N) MSTP gate clocks - "renesas,r8a7793-mstp-clocks" for R8A7793 (R-Car M2-N) MSTP gate clocks
- "renesas,r8a7794-mstp-clocks" for R8A7794 (R-Car E2) MSTP gate clocks - "renesas,r8a7794-mstp-clocks" for R8A7794 (R-Car E2) MSTP gate clocks
- "renesas,sh73a0-mstp-clocks" for SH73A0 (SH-MobileAG5) MSTP gate clocks - "renesas,sh73a0-mstp-clocks" for SH73A0 (SH-MobileAG5) MSTP gate clocks
@@ -10,6 +10,7 @@ Required Properties:
- compatible: Must be one of - compatible: Must be one of
- "renesas,r8a7790-cpg-clocks" for the r8a7790 CPG - "renesas,r8a7790-cpg-clocks" for the r8a7790 CPG
- "renesas,r8a7791-cpg-clocks" for the r8a7791 CPG - "renesas,r8a7791-cpg-clocks" for the r8a7791 CPG
- "renesas,r8a7792-cpg-clocks" for the r8a7792 CPG
- "renesas,r8a7793-cpg-clocks" for the r8a7793 CPG - "renesas,r8a7793-cpg-clocks" for the r8a7793 CPG
- "renesas,r8a7794-cpg-clocks" for the r8a7794 CPG - "renesas,r8a7794-cpg-clocks" for the r8a7794 CPG
and "renesas,rcar-gen2-cpg-clocks" as a fallback. and "renesas,rcar-gen2-cpg-clocks" as a fallback.
@@ -0,0 +1,24 @@
Allwinner Clock Control Unit Binding
------------------------------------
Required properties :
- compatible: must contain one of the following compatible:
- "allwinner,sun8i-h3-ccu"
- reg: Must contain the registers base address and length
- clocks: phandle to the oscillators feeding the CCU. Two are needed:
- "hosc": the high frequency oscillator (usually at 24MHz)
- "losc": the low frequency oscillator (usually at 32kHz)
- clock-names: Must contain the clock names described just above
- #clock-cells : must contain 1
- #reset-cells : must contain 1
Example:
ccu: clock@01c20000 {
compatible = "allwinner,sun8i-h3-ccu";
reg = <0x01c20000 0x400>;
clocks = <&osc24M>, <&osc32k>;
clock-names = "hosc", "losc";
#clock-cells = <1>;
#reset-cells = <1>;
};
+60 -252
View File
@@ -42,8 +42,10 @@
#include "skeleton.dtsi" #include "skeleton.dtsi"
#include <dt-bindings/clock/sun8i-h3-ccu.h>
#include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/pinctrl/sun4i-a10.h> #include <dt-bindings/pinctrl/sun4i-a10.h>
#include <dt-bindings/reset/sun8i-h3-ccu.h>
/ { / {
interrupt-parent = <&gic>; interrupt-parent = <&gic>;
@@ -104,191 +106,6 @@
clock-output-names = "osc32k"; clock-output-names = "osc32k";
}; };
pll1: clk@01c20000 {
#clock-cells = <0>;
compatible = "allwinner,sun8i-a23-pll1-clk";
reg = <0x01c20000 0x4>;
clocks = <&osc24M>;
clock-output-names = "pll1";
};
/* dummy clock until actually implemented */
pll5: pll5_clk {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <0>;
clock-output-names = "pll5";
};
pll6: clk@01c20028 {
#clock-cells = <1>;
compatible = "allwinner,sun6i-a31-pll6-clk";
reg = <0x01c20028 0x4>;
clocks = <&osc24M>;
clock-output-names = "pll6", "pll6x2";
};
pll6d2: pll6d2_clk {
#clock-cells = <0>;
compatible = "fixed-factor-clock";
clock-div = <2>;
clock-mult = <1>;
clocks = <&pll6 0>;
clock-output-names = "pll6d2";
};
/* dummy clock until pll6 can be reused */
pll8: pll8_clk {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <1>;
clock-output-names = "pll8";
};
cpu: cpu_clk@01c20050 {
#clock-cells = <0>;
compatible = "allwinner,sun4i-a10-cpu-clk";
reg = <0x01c20050 0x4>;
clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll1>;
clock-output-names = "cpu";
};
axi: axi_clk@01c20050 {
#clock-cells = <0>;
compatible = "allwinner,sun4i-a10-axi-clk";
reg = <0x01c20050 0x4>;
clocks = <&cpu>;
clock-output-names = "axi";
};
ahb1: ahb1_clk@01c20054 {
#clock-cells = <0>;
compatible = "allwinner,sun6i-a31-ahb1-clk";
reg = <0x01c20054 0x4>;
clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6 0>;
clock-output-names = "ahb1";
};
ahb2: ahb2_clk@01c2005c {
#clock-cells = <0>;
compatible = "allwinner,sun8i-h3-ahb2-clk";
reg = <0x01c2005c 0x4>;
clocks = <&ahb1>, <&pll6d2>;
clock-output-names = "ahb2";
};
apb1: apb1_clk@01c20054 {
#clock-cells = <0>;
compatible = "allwinner,sun4i-a10-apb0-clk";
reg = <0x01c20054 0x4>;
clocks = <&ahb1>;
clock-output-names = "apb1";
};
apb2: apb2_clk@01c20058 {
#clock-cells = <0>;
compatible = "allwinner,sun4i-a10-apb1-clk";
reg = <0x01c20058 0x4>;
clocks = <&osc32k>, <&osc24M>, <&pll6 0>, <&pll6 0>;
clock-output-names = "apb2";
};
bus_gates: clk@01c20060 {
#clock-cells = <1>;
compatible = "allwinner,sun8i-h3-bus-gates-clk";
reg = <0x01c20060 0x14>;
clocks = <&ahb1>, <&ahb2>, <&apb1>, <&apb2>;
clock-names = "ahb1", "ahb2", "apb1", "apb2";
clock-indices = <5>, <6>, <8>,
<9>, <10>, <13>,
<14>, <17>, <18>,
<19>, <20>,
<21>, <23>,
<24>, <25>,
<26>, <27>,
<28>, <29>,
<30>, <31>, <32>,
<35>, <36>, <37>,
<40>, <41>, <43>,
<44>, <52>, <53>,
<54>, <64>,
<65>, <69>, <72>,
<76>, <77>, <78>,
<96>, <97>, <98>,
<112>, <113>,
<114>, <115>,
<116>, <128>, <135>;
clock-output-names = "bus_ce", "bus_dma", "bus_mmc0",
"bus_mmc1", "bus_mmc2", "bus_nand",
"bus_sdram", "bus_gmac", "bus_ts",
"bus_hstimer", "bus_spi0",
"bus_spi1", "bus_otg",
"bus_otg_ehci0", "bus_ehci1",
"bus_ehci2", "bus_ehci3",
"bus_otg_ohci0", "bus_ohci1",
"bus_ohci2", "bus_ohci3", "bus_ve",
"bus_lcd0", "bus_lcd1", "bus_deint",
"bus_csi", "bus_tve", "bus_hdmi",
"bus_de", "bus_gpu", "bus_msgbox",
"bus_spinlock", "bus_codec",
"bus_spdif", "bus_pio", "bus_ths",
"bus_i2s0", "bus_i2s1", "bus_i2s2",
"bus_i2c0", "bus_i2c1", "bus_i2c2",
"bus_uart0", "bus_uart1",
"bus_uart2", "bus_uart3",
"bus_scr", "bus_ephy", "bus_dbg";
};
mmc0_clk: clk@01c20088 {
#clock-cells = <1>;
compatible = "allwinner,sun4i-a10-mmc-clk";
reg = <0x01c20088 0x4>;
clocks = <&osc24M>, <&pll6 0>, <&pll8>;
clock-output-names = "mmc0",
"mmc0_output",
"mmc0_sample";
};
mmc1_clk: clk@01c2008c {
#clock-cells = <1>;
compatible = "allwinner,sun4i-a10-mmc-clk";
reg = <0x01c2008c 0x4>;
clocks = <&osc24M>, <&pll6 0>, <&pll8>;
clock-output-names = "mmc1",
"mmc1_output",
"mmc1_sample";
};
mmc2_clk: clk@01c20090 {
#clock-cells = <1>;
compatible = "allwinner,sun4i-a10-mmc-clk";
reg = <0x01c20090 0x4>;
clocks = <&osc24M>, <&pll6 0>, <&pll8>;
clock-output-names = "mmc2",
"mmc2_output",
"mmc2_sample";
};
usb_clk: clk@01c200cc {
#clock-cells = <1>;
#reset-cells = <1>;
compatible = "allwinner,sun8i-h3-usb-clk";
reg = <0x01c200cc 0x4>;
clocks = <&osc24M>;
clock-output-names = "usb_phy0", "usb_phy1",
"usb_phy2", "usb_phy3",
"usb_ohci0", "usb_ohci1",
"usb_ohci2", "usb_ohci3";
};
mbus_clk: clk@01c2015c {
#clock-cells = <0>;
compatible = "allwinner,sun8i-a23-mbus-clk";
reg = <0x01c2015c 0x4>;
clocks = <&osc24M>, <&pll6 1>, <&pll5>;
clock-output-names = "mbus";
};
apb0: apb0_clk { apb0: apb0_clk {
compatible = "fixed-factor-clock"; compatible = "fixed-factor-clock";
#clock-cells = <0>; #clock-cells = <0>;
@@ -327,23 +144,23 @@
compatible = "allwinner,sun8i-h3-dma"; compatible = "allwinner,sun8i-h3-dma";
reg = <0x01c02000 0x1000>; reg = <0x01c02000 0x1000>;
interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&bus_gates 6>; clocks = <&ccu CLK_BUS_DMA>;
resets = <&ahb_rst 6>; resets = <&ccu RST_BUS_DMA>;
#dma-cells = <1>; #dma-cells = <1>;
}; };
mmc0: mmc@01c0f000 { mmc0: mmc@01c0f000 {
compatible = "allwinner,sun5i-a13-mmc"; compatible = "allwinner,sun5i-a13-mmc";
reg = <0x01c0f000 0x1000>; reg = <0x01c0f000 0x1000>;
clocks = <&bus_gates 8>, clocks = <&ccu CLK_BUS_MMC0>,
<&mmc0_clk 0>, <&ccu CLK_MMC0>,
<&mmc0_clk 1>, <&ccu CLK_MMC0_OUTPUT>,
<&mmc0_clk 2>; <&ccu CLK_MMC0_SAMPLE>;
clock-names = "ahb", clock-names = "ahb",
"mmc", "mmc",
"output", "output",
"sample"; "sample";
resets = <&ahb_rst 8>; resets = <&ccu RST_BUS_MMC0>;
reset-names = "ahb"; reset-names = "ahb";
interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled"; status = "disabled";
@@ -354,15 +171,15 @@
mmc1: mmc@01c10000 { mmc1: mmc@01c10000 {
compatible = "allwinner,sun5i-a13-mmc"; compatible = "allwinner,sun5i-a13-mmc";
reg = <0x01c10000 0x1000>; reg = <0x01c10000 0x1000>;
clocks = <&bus_gates 9>, clocks = <&ccu CLK_BUS_MMC1>,
<&mmc1_clk 0>, <&ccu CLK_MMC1>,
<&mmc1_clk 1>, <&ccu CLK_MMC1_OUTPUT>,
<&mmc1_clk 2>; <&ccu CLK_MMC1_SAMPLE>;
clock-names = "ahb", clock-names = "ahb",
"mmc", "mmc",
"output", "output",
"sample"; "sample";
resets = <&ahb_rst 9>; resets = <&ccu RST_BUS_MMC1>;
reset-names = "ahb"; reset-names = "ahb";
interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled"; status = "disabled";
@@ -373,15 +190,15 @@
mmc2: mmc@01c11000 { mmc2: mmc@01c11000 {
compatible = "allwinner,sun5i-a13-mmc"; compatible = "allwinner,sun5i-a13-mmc";
reg = <0x01c11000 0x1000>; reg = <0x01c11000 0x1000>;
clocks = <&bus_gates 10>, clocks = <&ccu CLK_BUS_MMC2>,
<&mmc2_clk 0>, <&ccu CLK_MMC2>,
<&mmc2_clk 1>, <&ccu CLK_MMC2_OUTPUT>,
<&mmc2_clk 2>; <&ccu CLK_MMC2_SAMPLE>;
clock-names = "ahb", clock-names = "ahb",
"mmc", "mmc",
"output", "output",
"sample"; "sample";
resets = <&ahb_rst 10>; resets = <&ccu RST_BUS_MMC2>;
reset-names = "ahb"; reset-names = "ahb";
interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled"; status = "disabled";
@@ -401,18 +218,18 @@
"pmu1", "pmu1",
"pmu2", "pmu2",
"pmu3"; "pmu3";
clocks = <&usb_clk 8>, clocks = <&ccu CLK_USB_PHY0>,
<&usb_clk 9>, <&ccu CLK_USB_PHY1>,
<&usb_clk 10>, <&ccu CLK_USB_PHY2>,
<&usb_clk 11>; <&ccu CLK_USB_PHY3>;
clock-names = "usb0_phy", clock-names = "usb0_phy",
"usb1_phy", "usb1_phy",
"usb2_phy", "usb2_phy",
"usb3_phy"; "usb3_phy";
resets = <&usb_clk 0>, resets = <&ccu RST_USB_PHY0>,
<&usb_clk 1>, <&ccu RST_USB_PHY1>,
<&usb_clk 2>, <&ccu RST_USB_PHY2>,
<&usb_clk 3>; <&ccu RST_USB_PHY3>;
reset-names = "usb0_reset", reset-names = "usb0_reset",
"usb1_reset", "usb1_reset",
"usb2_reset", "usb2_reset",
@@ -425,8 +242,8 @@
compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
reg = <0x01c1b000 0x100>; reg = <0x01c1b000 0x100>;
interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&bus_gates 25>, <&bus_gates 29>; clocks = <&ccu CLK_BUS_EHCI1>, <&ccu CLK_BUS_OHCI1>;
resets = <&ahb_rst 25>, <&ahb_rst 29>; resets = <&ccu RST_BUS_EHCI1>, <&ccu RST_BUS_OHCI1>;
phys = <&usbphy 1>; phys = <&usbphy 1>;
phy-names = "usb"; phy-names = "usb";
status = "disabled"; status = "disabled";
@@ -436,9 +253,9 @@
compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
reg = <0x01c1b400 0x100>; reg = <0x01c1b400 0x100>;
interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&bus_gates 29>, <&bus_gates 25>, clocks = <&ccu CLK_BUS_EHCI1>, <&ccu CLK_BUS_OHCI1>,
<&usb_clk 17>; <&ccu CLK_USB_OHCI1>;
resets = <&ahb_rst 29>, <&ahb_rst 25>; resets = <&ccu RST_BUS_EHCI1>, <&ccu RST_BUS_OHCI1>;
phys = <&usbphy 1>; phys = <&usbphy 1>;
phy-names = "usb"; phy-names = "usb";
status = "disabled"; status = "disabled";
@@ -448,8 +265,8 @@
compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
reg = <0x01c1c000 0x100>; reg = <0x01c1c000 0x100>;
interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&bus_gates 26>, <&bus_gates 30>; clocks = <&ccu CLK_BUS_EHCI2>, <&ccu CLK_BUS_OHCI2>;
resets = <&ahb_rst 26>, <&ahb_rst 30>; resets = <&ccu RST_BUS_EHCI2>, <&ccu RST_BUS_OHCI2>;
phys = <&usbphy 2>; phys = <&usbphy 2>;
phy-names = "usb"; phy-names = "usb";
status = "disabled"; status = "disabled";
@@ -459,9 +276,9 @@
compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
reg = <0x01c1c400 0x100>; reg = <0x01c1c400 0x100>;
interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&bus_gates 30>, <&bus_gates 26>, clocks = <&ccu CLK_BUS_EHCI2>, <&ccu CLK_BUS_OHCI2>,
<&usb_clk 18>; <&ccu CLK_USB_OHCI2>;
resets = <&ahb_rst 30>, <&ahb_rst 26>; resets = <&ccu RST_BUS_EHCI2>, <&ccu RST_BUS_OHCI2>;
phys = <&usbphy 2>; phys = <&usbphy 2>;
phy-names = "usb"; phy-names = "usb";
status = "disabled"; status = "disabled";
@@ -471,8 +288,8 @@
compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
reg = <0x01c1d000 0x100>; reg = <0x01c1d000 0x100>;
interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&bus_gates 27>, <&bus_gates 31>; clocks = <&ccu CLK_BUS_EHCI3>, <&ccu CLK_BUS_OHCI3>;
resets = <&ahb_rst 27>, <&ahb_rst 31>; resets = <&ccu RST_BUS_EHCI3>, <&ccu RST_BUS_OHCI3>;
phys = <&usbphy 3>; phys = <&usbphy 3>;
phy-names = "usb"; phy-names = "usb";
status = "disabled"; status = "disabled";
@@ -482,20 +299,29 @@
compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
reg = <0x01c1d400 0x100>; reg = <0x01c1d400 0x100>;
interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&bus_gates 31>, <&bus_gates 27>, clocks = <&ccu CLK_BUS_EHCI3>, <&ccu CLK_BUS_OHCI3>,
<&usb_clk 19>; <&ccu CLK_USB_OHCI3>;
resets = <&ahb_rst 31>, <&ahb_rst 27>; resets = <&ccu RST_BUS_EHCI3>, <&ccu RST_BUS_OHCI3>;
phys = <&usbphy 3>; phys = <&usbphy 3>;
phy-names = "usb"; phy-names = "usb";
status = "disabled"; status = "disabled";
}; };
ccu: clock@01c20000 {
compatible = "allwinner,sun8i-h3-ccu";
reg = <0x01c20000 0x400>;
clocks = <&osc24M>, <&osc32k>;
clock-names = "hosc", "losc";
#clock-cells = <1>;
#reset-cells = <1>;
};
pio: pinctrl@01c20800 { pio: pinctrl@01c20800 {
compatible = "allwinner,sun8i-h3-pinctrl"; compatible = "allwinner,sun8i-h3-pinctrl";
reg = <0x01c20800 0x400>; reg = <0x01c20800 0x400>;
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>, interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&bus_gates 69>; clocks = <&ccu CLK_BUS_PIO>;
gpio-controller; gpio-controller;
#gpio-cells = <3>; #gpio-cells = <3>;
interrupt-controller; interrupt-controller;
@@ -542,24 +368,6 @@
}; };
}; };
ahb_rst: reset@01c202c0 {
#reset-cells = <1>;
compatible = "allwinner,sun6i-a31-ahb1-reset";
reg = <0x01c202c0 0xc>;
};
apb1_rst: reset@01c202d0 {
#reset-cells = <1>;
compatible = "allwinner,sun6i-a31-clock-reset";
reg = <0x01c202d0 0x4>;
};
apb2_rst: reset@01c202d8 {
#reset-cells = <1>;
compatible = "allwinner,sun6i-a31-clock-reset";
reg = <0x01c202d8 0x4>;
};
timer@01c20c00 { timer@01c20c00 {
compatible = "allwinner,sun4i-a10-timer"; compatible = "allwinner,sun4i-a10-timer";
reg = <0x01c20c00 0xa0>; reg = <0x01c20c00 0xa0>;
@@ -580,8 +388,8 @@
interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>; reg-shift = <2>;
reg-io-width = <4>; reg-io-width = <4>;
clocks = <&bus_gates 112>; clocks = <&ccu CLK_BUS_UART0>;
resets = <&apb2_rst 16>; resets = <&ccu RST_BUS_UART0>;
dmas = <&dma 6>, <&dma 6>; dmas = <&dma 6>, <&dma 6>;
dma-names = "rx", "tx"; dma-names = "rx", "tx";
status = "disabled"; status = "disabled";
@@ -593,8 +401,8 @@
interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>; reg-shift = <2>;
reg-io-width = <4>; reg-io-width = <4>;
clocks = <&bus_gates 113>; clocks = <&ccu CLK_BUS_UART1>;
resets = <&apb2_rst 17>; resets = <&ccu RST_BUS_UART1>;
dmas = <&dma 7>, <&dma 7>; dmas = <&dma 7>, <&dma 7>;
dma-names = "rx", "tx"; dma-names = "rx", "tx";
status = "disabled"; status = "disabled";
@@ -606,8 +414,8 @@
interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>; reg-shift = <2>;
reg-io-width = <4>; reg-io-width = <4>;
clocks = <&bus_gates 114>; clocks = <&ccu CLK_BUS_UART2>;
resets = <&apb2_rst 18>; resets = <&ccu RST_BUS_UART2>;
dmas = <&dma 8>, <&dma 8>; dmas = <&dma 8>, <&dma 8>;
dma-names = "rx", "tx"; dma-names = "rx", "tx";
status = "disabled"; status = "disabled";
@@ -619,8 +427,8 @@
interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>; reg-shift = <2>;
reg-io-width = <4>; reg-io-width = <4>;
clocks = <&bus_gates 115>; clocks = <&ccu CLK_BUS_UART3>;
resets = <&apb2_rst 19>; resets = <&ccu RST_BUS_UART3>;
dmas = <&dma 9>, <&dma 9>; dmas = <&dma 9>, <&dma 9>;
dma-names = "rx", "tx"; dma-names = "rx", "tx";
status = "disabled"; status = "disabled";
+5 -2
View File
@@ -49,10 +49,10 @@ config COMMON_CLK_MAX77802
This driver supports Maxim 77802 crystal oscillator clock. This driver supports Maxim 77802 crystal oscillator clock.
config COMMON_CLK_RK808 config COMMON_CLK_RK808
tristate "Clock driver for RK808" tristate "Clock driver for RK808/RK818"
depends on MFD_RK808 depends on MFD_RK808
---help--- ---help---
This driver supports RK808 crystal oscillator clock. These This driver supports RK808 and RK818 crystal oscillator clock. These
multi-function devices have two fixed-rate oscillators, multi-function devices have two fixed-rate oscillators,
clocked at 32KHz each. Clkout1 is always on, Clkout2 can off clocked at 32KHz each. Clkout1 is always on, Clkout2 can off
by control register. by control register.
@@ -203,16 +203,19 @@ config COMMON_CLK_PIC32
config COMMON_CLK_OXNAS config COMMON_CLK_OXNAS
bool "Clock driver for the OXNAS SoC Family" bool "Clock driver for the OXNAS SoC Family"
depends on ARCH_OXNAS || COMPILE_TEST
select MFD_SYSCON select MFD_SYSCON
---help--- ---help---
Support for the OXNAS SoC Family clocks. Support for the OXNAS SoC Family clocks.
source "drivers/clk/bcm/Kconfig" source "drivers/clk/bcm/Kconfig"
source "drivers/clk/hisilicon/Kconfig" source "drivers/clk/hisilicon/Kconfig"
source "drivers/clk/meson/Kconfig"
source "drivers/clk/mvebu/Kconfig" source "drivers/clk/mvebu/Kconfig"
source "drivers/clk/qcom/Kconfig" source "drivers/clk/qcom/Kconfig"
source "drivers/clk/renesas/Kconfig" source "drivers/clk/renesas/Kconfig"
source "drivers/clk/samsung/Kconfig" source "drivers/clk/samsung/Kconfig"
source "drivers/clk/sunxi-ng/Kconfig"
source "drivers/clk/tegra/Kconfig" source "drivers/clk/tegra/Kconfig"
source "drivers/clk/ti/Kconfig" source "drivers/clk/ti/Kconfig"
+12 -9
View File
@@ -16,13 +16,14 @@ obj-$(CONFIG_COMMON_CLK) += clk-conf.o
endif endif
# hardware specific clock types # hardware specific clock types
# please keep this section sorted lexicographically by file/directory path name # please keep this section sorted lexicographically by file path name
obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o
obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o
obj-$(CONFIG_ARCH_AXXIA) += clk-axm5516.o obj-$(CONFIG_ARCH_AXXIA) += clk-axm5516.o
obj-$(CONFIG_COMMON_CLK_CDCE706) += clk-cdce706.o obj-$(CONFIG_COMMON_CLK_CDCE706) += clk-cdce706.o
obj-$(CONFIG_COMMON_CLK_CS2000_CP) += clk-cs2000-cp.o obj-$(CONFIG_COMMON_CLK_CDCE925) += clk-cdce925.o
obj-$(CONFIG_ARCH_CLPS711X) += clk-clps711x.o obj-$(CONFIG_ARCH_CLPS711X) += clk-clps711x.o
obj-$(CONFIG_COMMON_CLK_CS2000_CP) += clk-cs2000-cp.o
obj-$(CONFIG_ARCH_EFM32) += clk-efm32gg.o obj-$(CONFIG_ARCH_EFM32) += clk-efm32gg.o
obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o
obj-$(CONFIG_MACH_LOONGSON32) += clk-ls1x.o obj-$(CONFIG_MACH_LOONGSON32) += clk-ls1x.o
@@ -35,6 +36,7 @@ obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o
obj-$(CONFIG_ARCH_NSPIRE) += clk-nspire.o obj-$(CONFIG_ARCH_NSPIRE) += clk-nspire.o
obj-$(CONFIG_COMMON_CLK_OXNAS) += clk-oxnas.o obj-$(CONFIG_COMMON_CLK_OXNAS) += clk-oxnas.o
obj-$(CONFIG_COMMON_CLK_PALMAS) += clk-palmas.o obj-$(CONFIG_COMMON_CLK_PALMAS) += clk-palmas.o
obj-$(CONFIG_COMMON_CLK_PWM) += clk-pwm.o
obj-$(CONFIG_CLK_QORIQ) += clk-qoriq.o obj-$(CONFIG_CLK_QORIQ) += clk-qoriq.o
obj-$(CONFIG_COMMON_CLK_RK808) += clk-rk808.o obj-$(CONFIG_COMMON_CLK_RK808) += clk-rk808.o
obj-$(CONFIG_COMMON_CLK_S2MPS11) += clk-s2mps11.o obj-$(CONFIG_COMMON_CLK_S2MPS11) += clk-s2mps11.o
@@ -42,7 +44,6 @@ obj-$(CONFIG_COMMON_CLK_SCPI) += clk-scpi.o
obj-$(CONFIG_COMMON_CLK_SI5351) += clk-si5351.o obj-$(CONFIG_COMMON_CLK_SI5351) += clk-si5351.o
obj-$(CONFIG_COMMON_CLK_SI514) += clk-si514.o obj-$(CONFIG_COMMON_CLK_SI514) += clk-si514.o
obj-$(CONFIG_COMMON_CLK_SI570) += clk-si570.o obj-$(CONFIG_COMMON_CLK_SI570) += clk-si570.o
obj-$(CONFIG_COMMON_CLK_CDCE925) += clk-cdce925.o
obj-$(CONFIG_ARCH_STM32) += clk-stm32f4.o obj-$(CONFIG_ARCH_STM32) += clk-stm32f4.o
obj-$(CONFIG_ARCH_TANGO) += clk-tango4.o obj-$(CONFIG_ARCH_TANGO) += clk-tango4.o
obj-$(CONFIG_CLK_TWL6040) += clk-twl6040.o obj-$(CONFIG_CLK_TWL6040) += clk-twl6040.o
@@ -50,35 +51,39 @@ obj-$(CONFIG_ARCH_U300) += clk-u300.o
obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o
obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
obj-$(CONFIG_COMMON_CLK_XGENE) += clk-xgene.o obj-$(CONFIG_COMMON_CLK_XGENE) += clk-xgene.o
obj-$(CONFIG_COMMON_CLK_PWM) += clk-pwm.o
# please keep this section sorted lexicographically by directory path name
obj-$(CONFIG_COMMON_CLK_AT91) += at91/ obj-$(CONFIG_COMMON_CLK_AT91) += at91/
obj-$(CONFIG_ARCH_ARTPEC) += axis/ obj-$(CONFIG_ARCH_ARTPEC) += axis/
obj-$(CONFIG_ARC_PLAT_AXS10X) += axs10x/
obj-y += bcm/ obj-y += bcm/
obj-$(CONFIG_ARCH_BERLIN) += berlin/ obj-$(CONFIG_ARCH_BERLIN) += berlin/
obj-$(CONFIG_H8300) += h8300/
obj-$(CONFIG_ARCH_HISI) += hisilicon/ obj-$(CONFIG_ARCH_HISI) += hisilicon/
obj-$(CONFIG_ARCH_MXC) += imx/ obj-$(CONFIG_ARCH_MXC) += imx/
obj-$(CONFIG_MACH_INGENIC) += ingenic/ obj-$(CONFIG_MACH_INGENIC) += ingenic/
obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/ obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/
obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/ obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/
obj-$(CONFIG_COMMON_CLK_AMLOGIC) += meson/
obj-$(CONFIG_MACH_PIC32) += microchip/ obj-$(CONFIG_MACH_PIC32) += microchip/
ifeq ($(CONFIG_COMMON_CLK), y) ifeq ($(CONFIG_COMMON_CLK), y)
obj-$(CONFIG_ARCH_MMP) += mmp/ obj-$(CONFIG_ARCH_MMP) += mmp/
endif endif
obj-y += mvebu/ obj-y += mvebu/
obj-$(CONFIG_ARCH_MESON) += meson/
obj-$(CONFIG_ARCH_MXS) += mxs/ obj-$(CONFIG_ARCH_MXS) += mxs/
obj-$(CONFIG_MACH_PISTACHIO) += pistachio/
obj-$(CONFIG_COMMON_CLK_NXP) += nxp/ obj-$(CONFIG_COMMON_CLK_NXP) += nxp/
obj-$(CONFIG_MACH_PISTACHIO) += pistachio/
obj-$(CONFIG_COMMON_CLK_PXA) += pxa/ obj-$(CONFIG_COMMON_CLK_PXA) += pxa/
obj-$(CONFIG_COMMON_CLK_QCOM) += qcom/ obj-$(CONFIG_COMMON_CLK_QCOM) += qcom/
obj-$(CONFIG_ARCH_RENESAS) += renesas/
obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
obj-$(CONFIG_COMMON_CLK_SAMSUNG) += samsung/ obj-$(CONFIG_COMMON_CLK_SAMSUNG) += samsung/
obj-$(CONFIG_ARCH_RENESAS) += renesas/
obj-$(CONFIG_ARCH_SIRF) += sirf/ obj-$(CONFIG_ARCH_SIRF) += sirf/
obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/ obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/
obj-$(CONFIG_PLAT_SPEAR) += spear/ obj-$(CONFIG_PLAT_SPEAR) += spear/
obj-$(CONFIG_ARCH_STI) += st/ obj-$(CONFIG_ARCH_STI) += st/
obj-$(CONFIG_ARCH_SUNXI) += sunxi/ obj-$(CONFIG_ARCH_SUNXI) += sunxi/
obj-$(CONFIG_ARCH_SUNXI) += sunxi-ng/
obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_ARCH_TEGRA) += tegra/
obj-y += ti/ obj-y += ti/
obj-$(CONFIG_ARCH_U8500) += ux500/ obj-$(CONFIG_ARCH_U8500) += ux500/
@@ -86,5 +91,3 @@ obj-$(CONFIG_COMMON_CLK_VERSATILE) += versatile/
obj-$(CONFIG_X86) += x86/ obj-$(CONFIG_X86) += x86/
obj-$(CONFIG_ARCH_ZX) += zte/ obj-$(CONFIG_ARCH_ZX) += zte/
obj-$(CONFIG_ARCH_ZYNQ) += zynq/ obj-$(CONFIG_ARCH_ZYNQ) += zynq/
obj-$(CONFIG_H8300) += h8300/
obj-$(CONFIG_ARC_PLAT_AXS10X) += axs10x/
+1 -1
View File
@@ -267,7 +267,7 @@ at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, const char
return clk; return clk;
} }
void __init of_sama5d2_clk_generated_setup(struct device_node *np) static void __init of_sama5d2_clk_generated_setup(struct device_node *np)
{ {
int num; int num;
u32 id; u32 id;
+6 -5
View File
@@ -20,6 +20,8 @@
#include <linux/clkdev.h> #include <linux/clkdev.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include "clk-iproc.h"
#define IPROC_CLK_MAX_FREQ_POLICY 0x3 #define IPROC_CLK_MAX_FREQ_POLICY 0x3
#define IPROC_CLK_POLICY_FREQ_OFFSET 0x008 #define IPROC_CLK_POLICY_FREQ_OFFSET 0x008
#define IPROC_CLK_POLICY_FREQ_POLICY_FREQ_SHIFT 8 #define IPROC_CLK_POLICY_FREQ_POLICY_FREQ_SHIFT 8
@@ -242,7 +244,6 @@ static const struct clk_ops iproc_arm_pll_ops = {
void __init iproc_armpll_setup(struct device_node *node) void __init iproc_armpll_setup(struct device_node *node)
{ {
int ret; int ret;
struct clk *clk;
struct iproc_arm_pll *pll; struct iproc_arm_pll *pll;
struct clk_init_data init; struct clk_init_data init;
const char *parent_name; const char *parent_name;
@@ -263,18 +264,18 @@ void __init iproc_armpll_setup(struct device_node *node)
init.num_parents = (parent_name ? 1 : 0); init.num_parents = (parent_name ? 1 : 0);
pll->hw.init = &init; pll->hw.init = &init;
clk = clk_register(NULL, &pll->hw); ret = clk_hw_register(NULL, &pll->hw);
if (WARN_ON(IS_ERR(clk))) if (WARN_ON(ret))
goto err_iounmap; goto err_iounmap;
ret = of_clk_add_provider(node, of_clk_src_simple_get, clk); ret = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &pll->hw);
if (WARN_ON(ret)) if (WARN_ON(ret))
goto err_clk_unregister; goto err_clk_unregister;
return; return;
err_clk_unregister: err_clk_unregister:
clk_unregister(clk); clk_hw_unregister(&pll->hw);
err_iounmap: err_iounmap:
iounmap(pll->base); iounmap(pll->base);
err_free_pll: err_free_pll:
+13 -14
View File
@@ -37,7 +37,7 @@ struct iproc_asiu {
void __iomem *div_base; void __iomem *div_base;
void __iomem *gate_base; void __iomem *gate_base;
struct clk_onecell_data clk_data; struct clk_hw_onecell_data *clk_data;
struct iproc_asiu_clk *clks; struct iproc_asiu_clk *clks;
}; };
@@ -197,11 +197,11 @@ void __init iproc_asiu_setup(struct device_node *node,
if (WARN_ON(!asiu)) if (WARN_ON(!asiu))
return; return;
asiu->clk_data.clk_num = num_clks; asiu->clk_data = kzalloc(sizeof(*asiu->clk_data->hws) * num_clks +
asiu->clk_data.clks = kcalloc(num_clks, sizeof(*asiu->clk_data.clks), sizeof(*asiu->clk_data), GFP_KERNEL);
GFP_KERNEL); if (WARN_ON(!asiu->clk_data))
if (WARN_ON(!asiu->clk_data.clks))
goto err_clks; goto err_clks;
asiu->clk_data->num = num_clks;
asiu->clks = kcalloc(num_clks, sizeof(*asiu->clks), GFP_KERNEL); asiu->clks = kcalloc(num_clks, sizeof(*asiu->clks), GFP_KERNEL);
if (WARN_ON(!asiu->clks)) if (WARN_ON(!asiu->clks))
@@ -217,7 +217,6 @@ void __init iproc_asiu_setup(struct device_node *node,
for (i = 0; i < num_clks; i++) { for (i = 0; i < num_clks; i++) {
struct clk_init_data init; struct clk_init_data init;
struct clk *clk;
const char *parent_name; const char *parent_name;
struct iproc_asiu_clk *asiu_clk; struct iproc_asiu_clk *asiu_clk;
const char *clk_name; const char *clk_name;
@@ -240,22 +239,22 @@ void __init iproc_asiu_setup(struct device_node *node,
init.num_parents = (parent_name ? 1 : 0); init.num_parents = (parent_name ? 1 : 0);
asiu_clk->hw.init = &init; asiu_clk->hw.init = &init;
clk = clk_register(NULL, &asiu_clk->hw); ret = clk_hw_register(NULL, &asiu_clk->hw);
if (WARN_ON(IS_ERR(clk))) if (WARN_ON(ret))
goto err_clk_register; goto err_clk_register;
asiu->clk_data.clks[i] = clk; asiu->clk_data->hws[i] = &asiu_clk->hw;
} }
ret = of_clk_add_provider(node, of_clk_src_onecell_get, ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
&asiu->clk_data); asiu->clk_data);
if (WARN_ON(ret)) if (WARN_ON(ret))
goto err_clk_register; goto err_clk_register;
return; return;
err_clk_register: err_clk_register:
for (i = 0; i < num_clks; i++) while (--i >= 0)
clk_unregister(asiu->clk_data.clks[i]); clk_hw_unregister(asiu->clk_data->hws[i]);
iounmap(asiu->gate_base); iounmap(asiu->gate_base);
err_iomap_gate: err_iomap_gate:
@@ -265,7 +264,7 @@ err_iomap_div:
kfree(asiu->clks); kfree(asiu->clks);
err_asiu_clks: err_asiu_clks:
kfree(asiu->clk_data.clks); kfree(asiu->clk_data);
err_clks: err_clks:
kfree(asiu); kfree(asiu);
+16 -16
View File
@@ -89,7 +89,7 @@ struct iproc_pll {
const struct iproc_pll_vco_param *vco_param; const struct iproc_pll_vco_param *vco_param;
unsigned int num_vco_entries; unsigned int num_vco_entries;
struct clk_onecell_data clk_data; struct clk_hw_onecell_data *clk_data;
struct iproc_clk *clks; struct iproc_clk *clks;
}; };
@@ -625,7 +625,6 @@ void __init iproc_pll_clk_setup(struct device_node *node,
unsigned int num_clks) unsigned int num_clks)
{ {
int i, ret; int i, ret;
struct clk *clk;
struct iproc_pll *pll; struct iproc_pll *pll;
struct iproc_clk *iclk; struct iproc_clk *iclk;
struct clk_init_data init; struct clk_init_data init;
@@ -638,11 +637,11 @@ void __init iproc_pll_clk_setup(struct device_node *node,
if (WARN_ON(!pll)) if (WARN_ON(!pll))
return; return;
pll->clk_data.clk_num = num_clks; pll->clk_data = kzalloc(sizeof(*pll->clk_data->hws) * num_clks +
pll->clk_data.clks = kcalloc(num_clks, sizeof(*pll->clk_data.clks), sizeof(*pll->clk_data), GFP_KERNEL);
GFP_KERNEL); if (WARN_ON(!pll->clk_data))
if (WARN_ON(!pll->clk_data.clks))
goto err_clk_data; goto err_clk_data;
pll->clk_data->num = num_clks;
pll->clks = kcalloc(num_clks, sizeof(*pll->clks), GFP_KERNEL); pll->clks = kcalloc(num_clks, sizeof(*pll->clks), GFP_KERNEL);
if (WARN_ON(!pll->clks)) if (WARN_ON(!pll->clks))
@@ -694,11 +693,11 @@ void __init iproc_pll_clk_setup(struct device_node *node,
iproc_pll_sw_cfg(pll); iproc_pll_sw_cfg(pll);
clk = clk_register(NULL, &iclk->hw); ret = clk_hw_register(NULL, &iclk->hw);
if (WARN_ON(IS_ERR(clk))) if (WARN_ON(ret))
goto err_pll_register; goto err_pll_register;
pll->clk_data.clks[0] = clk; pll->clk_data->hws[0] = &iclk->hw;
/* now initialize and register all leaf clocks */ /* now initialize and register all leaf clocks */
for (i = 1; i < num_clks; i++) { for (i = 1; i < num_clks; i++) {
@@ -724,22 +723,23 @@ void __init iproc_pll_clk_setup(struct device_node *node,
init.num_parents = (parent_name ? 1 : 0); init.num_parents = (parent_name ? 1 : 0);
iclk->hw.init = &init; iclk->hw.init = &init;
clk = clk_register(NULL, &iclk->hw); ret = clk_hw_register(NULL, &iclk->hw);
if (WARN_ON(IS_ERR(clk))) if (WARN_ON(ret))
goto err_clk_register; goto err_clk_register;
pll->clk_data.clks[i] = clk; pll->clk_data->hws[i] = &iclk->hw;
} }
ret = of_clk_add_provider(node, of_clk_src_onecell_get, &pll->clk_data); ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
pll->clk_data);
if (WARN_ON(ret)) if (WARN_ON(ret))
goto err_clk_register; goto err_clk_register;
return; return;
err_clk_register: err_clk_register:
for (i = 0; i < num_clks; i++) while (--i >= 0)
clk_unregister(pll->clk_data.clks[i]); clk_hw_unregister(pll->clk_data->hws[i]);
err_pll_register: err_pll_register:
if (pll->status_base != pll->control_base) if (pll->status_base != pll->control_base)
@@ -759,7 +759,7 @@ err_pll_iomap:
kfree(pll->clks); kfree(pll->clks);
err_clks: err_clks:
kfree(pll->clk_data.clks); kfree(pll->clk_data);
err_clk_data: err_clk_data:
kfree(pll); kfree(pll);
+1 -1
View File
@@ -55,7 +55,7 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)
} }
clk = of_clk_get_from_provider(&clkspec); clk = of_clk_get_from_provider(&clkspec);
if (IS_ERR(clk)) { if (IS_ERR(clk)) {
pr_warn("clk: couldn't get parent clock %d for %s\n", pr_warn("clk: couldn't get assigned clock %d for %s\n",
index, node->full_name); index, node->full_name);
rc = PTR_ERR(clk); rc = PTR_ERR(clk);
goto err; goto err;
+10 -1
View File
@@ -142,6 +142,11 @@ void clk_hw_unregister_fixed_factor(struct clk_hw *hw)
EXPORT_SYMBOL_GPL(clk_hw_unregister_fixed_factor); EXPORT_SYMBOL_GPL(clk_hw_unregister_fixed_factor);
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id set_rate_parent_matches[] = {
{ .compatible = "allwinner,sun4i-a10-pll3-2x-clk" },
{ /* Sentinel */ },
};
/** /**
* of_fixed_factor_clk_setup() - Setup function for simple fixed factor clock * of_fixed_factor_clk_setup() - Setup function for simple fixed factor clock
*/ */
@@ -150,6 +155,7 @@ void __init of_fixed_factor_clk_setup(struct device_node *node)
struct clk *clk; struct clk *clk;
const char *clk_name = node->name; const char *clk_name = node->name;
const char *parent_name; const char *parent_name;
unsigned long flags = 0;
u32 div, mult; u32 div, mult;
if (of_property_read_u32(node, "clock-div", &div)) { if (of_property_read_u32(node, "clock-div", &div)) {
@@ -167,7 +173,10 @@ void __init of_fixed_factor_clk_setup(struct device_node *node)
of_property_read_string(node, "clock-output-names", &clk_name); of_property_read_string(node, "clock-output-names", &clk_name);
parent_name = of_clk_get_parent_name(node, 0); parent_name = of_clk_get_parent_name(node, 0);
clk = clk_register_fixed_factor(NULL, clk_name, parent_name, 0, if (of_match_node(set_rate_parent_matches, node))
flags |= CLK_SET_RATE_PARENT;
clk = clk_register_fixed_factor(NULL, clk_name, parent_name, flags,
mult, div); mult, div);
if (!IS_ERR(clk)) if (!IS_ERR(clk))
of_clk_add_provider(node, of_clk_src_simple_get, clk); of_clk_add_provider(node, of_clk_src_simple_get, clk);
+11
View File
@@ -145,6 +145,17 @@ void clk_unregister_fixed_rate(struct clk *clk)
} }
EXPORT_SYMBOL_GPL(clk_unregister_fixed_rate); EXPORT_SYMBOL_GPL(clk_unregister_fixed_rate);
void clk_hw_unregister_fixed_rate(struct clk_hw *hw)
{
struct clk_fixed_rate *fixed;
fixed = to_clk_fixed_rate(hw);
clk_hw_unregister(hw);
kfree(fixed);
}
EXPORT_SYMBOL_GPL(clk_hw_unregister_fixed_rate);
#ifdef CONFIG_OF #ifdef CONFIG_OF
/** /**
* of_fixed_clk_setup() - Setup function for simple fixed rate clock * of_fixed_clk_setup() - Setup function for simple fixed rate clock
+4 -5
View File
@@ -275,7 +275,6 @@ static const struct clk_ops periclk_ops = {
static __init struct clk *hb_clk_init(struct device_node *node, const struct clk_ops *ops) static __init struct clk *hb_clk_init(struct device_node *node, const struct clk_ops *ops)
{ {
u32 reg; u32 reg;
struct clk *clk;
struct hb_clk *hb_clk; struct hb_clk *hb_clk;
const char *clk_name = node->name; const char *clk_name = node->name;
const char *parent_name; const char *parent_name;
@@ -308,13 +307,13 @@ static __init struct clk *hb_clk_init(struct device_node *node, const struct clk
hb_clk->hw.init = &init; hb_clk->hw.init = &init;
clk = clk_register(NULL, &hb_clk->hw); rc = clk_hw_register(NULL, &hb_clk->hw);
if (WARN_ON(IS_ERR(clk))) { if (WARN_ON(rc)) {
kfree(hb_clk); kfree(hb_clk);
return NULL; return NULL;
} }
rc = of_clk_add_provider(node, of_clk_src_simple_get, clk); rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &hb_clk->hw);
return clk; return hb_clk->hw.clk;
} }
static void __init hb_pll_init(struct device_node *node) static void __init hb_pll_init(struct device_node *node)
+17 -3
View File
@@ -52,14 +52,28 @@ static unsigned long __bestmult(struct clk_hw *hw, unsigned long rate,
unsigned long *best_parent_rate, unsigned long *best_parent_rate,
u8 width, unsigned long flags) u8 width, unsigned long flags)
{ {
struct clk_multiplier *mult = to_clk_multiplier(hw);
unsigned long orig_parent_rate = *best_parent_rate; unsigned long orig_parent_rate = *best_parent_rate;
unsigned long parent_rate, current_rate, best_rate = ~0; unsigned long parent_rate, current_rate, best_rate = ~0;
unsigned int i, bestmult = 0; unsigned int i, bestmult = 0;
unsigned int maxmult = (1 << width) - 1;
if (!(clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT)) if (!(clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT)) {
return rate / *best_parent_rate; bestmult = rate / orig_parent_rate;
for (i = 1; i < ((1 << width) - 1); i++) { /* Make sure we don't end up with a 0 multiplier */
if ((bestmult == 0) &&
!(mult->flags & CLK_MULTIPLIER_ZERO_BYPASS))
bestmult = 1;
/* Make sure we don't overflow the multiplier */
if (bestmult > maxmult)
bestmult = maxmult;
return bestmult;
}
for (i = 1; i < maxmult; i++) {
if (rate == orig_parent_rate * i) { if (rate == orig_parent_rate * i) {
/* /*
* This is the best case for us if we have a * This is the best case for us if we have a
+26 -22
View File
@@ -253,11 +253,11 @@ static const struct clk_ops pll_clk_ops = {
.recalc_rate = pll_clk_recalc_rate, .recalc_rate = pll_clk_recalc_rate,
}; };
static struct clk * __init static struct clk_hw * __init
pll_clk_register(struct device *dev, const char *name, pll_clk_register(struct device *dev, const char *name,
const char *parent_name, u32 id) const char *parent_name, u32 id)
{ {
struct clk *clk; int ret;
struct clk_pll *pll; struct clk_pll *pll;
struct clk_init_data init; struct clk_init_data init;
@@ -281,11 +281,13 @@ pll_clk_register(struct device *dev, const char *name,
pr_debug("register PLL1 clock \"%s\"\n", name); pr_debug("register PLL1 clock \"%s\"\n", name);
clk = clk_register(dev, &pll->hw); ret = clk_hw_register(dev, &pll->hw);
if (IS_ERR(clk)) if (ret) {
kfree(pll); kfree(pll);
return ERR_PTR(ret);
}
return clk; return &pll->hw;
} }
/* /*
@@ -345,11 +347,11 @@ static const struct clk_ops src_clk_ops = {
.recalc_rate = src_clk_recalc_rate, .recalc_rate = src_clk_recalc_rate,
}; };
static struct clk * __init static struct clk_hw * __init
src_clk_register(struct device *dev, const char *name, src_clk_register(struct device *dev, const char *name,
const char *parent_name, u8 id) const char *parent_name, u8 id)
{ {
struct clk *clk; int ret;
struct clk_src *sclk; struct clk_src *sclk;
struct clk_init_data init; struct clk_init_data init;
@@ -376,11 +378,13 @@ src_clk_register(struct device *dev, const char *name,
pr_debug("register clock \"%s\" ID: %d group: %d bits: %08x\n", pr_debug("register clock \"%s\" ID: %d group: %d bits: %08x\n",
name, id, sclk->group1, sclk->clkbit); name, id, sclk->group1, sclk->clkbit);
clk = clk_register(dev, &sclk->hw); ret = clk_hw_register(dev, &sclk->hw);
if (IS_ERR(clk)) if (ret) {
kfree(sclk); kfree(sclk);
return ERR_PTR(ret);
}
return clk; return &sclk->hw;
} }
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
@@ -508,7 +512,7 @@ device_initcall(nomadik_src_clk_init_debugfs);
static void __init of_nomadik_pll_setup(struct device_node *np) static void __init of_nomadik_pll_setup(struct device_node *np)
{ {
struct clk *clk = ERR_PTR(-EINVAL); struct clk_hw *hw;
const char *clk_name = np->name; const char *clk_name = np->name;
const char *parent_name; const char *parent_name;
u32 pll_id; u32 pll_id;
@@ -522,16 +526,16 @@ static void __init of_nomadik_pll_setup(struct device_node *np)
return; return;
} }
parent_name = of_clk_get_parent_name(np, 0); parent_name = of_clk_get_parent_name(np, 0);
clk = pll_clk_register(NULL, clk_name, parent_name, pll_id); hw = pll_clk_register(NULL, clk_name, parent_name, pll_id);
if (!IS_ERR(clk)) if (!IS_ERR(hw))
of_clk_add_provider(np, of_clk_src_simple_get, clk); of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
} }
CLK_OF_DECLARE(nomadik_pll_clk, CLK_OF_DECLARE(nomadik_pll_clk,
"st,nomadik-pll-clock", of_nomadik_pll_setup); "st,nomadik-pll-clock", of_nomadik_pll_setup);
static void __init of_nomadik_hclk_setup(struct device_node *np) static void __init of_nomadik_hclk_setup(struct device_node *np)
{ {
struct clk *clk = ERR_PTR(-EINVAL); struct clk_hw *hw;
const char *clk_name = np->name; const char *clk_name = np->name;
const char *parent_name; const char *parent_name;
@@ -542,20 +546,20 @@ static void __init of_nomadik_hclk_setup(struct device_node *np)
/* /*
* The HCLK divides PLL1 with 1 (passthru), 2, 3 or 4. * The HCLK divides PLL1 with 1 (passthru), 2, 3 or 4.
*/ */
clk = clk_register_divider(NULL, clk_name, parent_name, hw = clk_hw_register_divider(NULL, clk_name, parent_name,
0, src_base + SRC_CR, 0, src_base + SRC_CR,
13, 2, 13, 2,
CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO, CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO,
&src_lock); &src_lock);
if (!IS_ERR(clk)) if (!IS_ERR(hw))
of_clk_add_provider(np, of_clk_src_simple_get, clk); of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
} }
CLK_OF_DECLARE(nomadik_hclk_clk, CLK_OF_DECLARE(nomadik_hclk_clk,
"st,nomadik-hclk-clock", of_nomadik_hclk_setup); "st,nomadik-hclk-clock", of_nomadik_hclk_setup);
static void __init of_nomadik_src_clk_setup(struct device_node *np) static void __init of_nomadik_src_clk_setup(struct device_node *np)
{ {
struct clk *clk = ERR_PTR(-EINVAL); struct clk_hw *hw;
const char *clk_name = np->name; const char *clk_name = np->name;
const char *parent_name; const char *parent_name;
u32 clk_id; u32 clk_id;
@@ -569,9 +573,9 @@ static void __init of_nomadik_src_clk_setup(struct device_node *np)
return; return;
} }
parent_name = of_clk_get_parent_name(np, 0); parent_name = of_clk_get_parent_name(np, 0);
clk = src_clk_register(NULL, clk_name, parent_name, clk_id); hw = src_clk_register(NULL, clk_name, parent_name, clk_id);
if (!IS_ERR(clk)) if (!IS_ERR(hw))
of_clk_add_provider(np, of_clk_src_simple_get, clk); of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
} }
CLK_OF_DECLARE(nomadik_src_clk, CLK_OF_DECLARE(nomadik_src_clk,
"st,nomadik-src-clock", of_nomadik_src_clk_setup); "st,nomadik-src-clock", of_nomadik_src_clk_setup);
+3 -12
View File
@@ -18,7 +18,7 @@
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/init.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/stringify.h> #include <linux/stringify.h>
@@ -170,26 +170,17 @@ static int oxnas_stdclk_probe(struct platform_device *pdev)
clk_oxnas->onecell_data); clk_oxnas->onecell_data);
} }
static int oxnas_stdclk_remove(struct platform_device *pdev)
{
of_clk_del_provider(pdev->dev.of_node);
return 0;
}
static const struct of_device_id oxnas_stdclk_dt_ids[] = { static const struct of_device_id oxnas_stdclk_dt_ids[] = {
{ .compatible = "oxsemi,ox810se-stdclk" }, { .compatible = "oxsemi,ox810se-stdclk" },
{ } { }
}; };
MODULE_DEVICE_TABLE(of, oxnas_stdclk_dt_ids);
static struct platform_driver oxnas_stdclk_driver = { static struct platform_driver oxnas_stdclk_driver = {
.probe = oxnas_stdclk_probe, .probe = oxnas_stdclk_probe,
.remove = oxnas_stdclk_remove,
.driver = { .driver = {
.name = "oxnas-stdclk", .name = "oxnas-stdclk",
.suppress_bind_attrs = true,
.of_match_table = oxnas_stdclk_dt_ids, .of_match_table = oxnas_stdclk_dt_ids,
}, },
}; };
builtin_platform_driver(oxnas_stdclk_driver);
module_platform_driver(oxnas_stdclk_driver);

Some files were not shown because too many files have changed in this diff Show More