clk: sirf: add CSR atlas7 clk and reset support
Subsystems (2)
PATCH v4 1/2 clk: sirf: add CSR atlas7 clk and reset support
From: Zhiwu Song <[email protected]>
the hardware node includes both clock and reset support, so it is named as "car".
this patch implements Flexible clocks(mux, divider, gate), Selectable clock(mux, divider, gate), root clock(gate),leaf clock(gate), others. it also implements the reset controller functionality.
---
-v4: fix checkpatch issues;
drop unless headfile;
add const;
.../devicetree/bindings/clock/csr,atlas7-car.txt | 55 + drivers/clk/sirf/Makefile | 2 +- drivers/clk/sirf/clk-atlas7.c | 1633 ++++++++++++++++++++ 3 files changed, 1689 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/clock/csr,atlas7-car.txt create mode 100644 drivers/clk/sirf/clk-atlas7.c
Documentation/devicetree/bindings/clock/csr,atlas7-car.txt new file +55 -0
@@ -0,0 +1,55 @@ +* Clock and reset bindings for CSR atlas7 + +Required properties: +- compatible: Should be "sirf,atlas7-car" +- reg: Address and length of the register set +- #clock-cells: Should be <1> +- #reset-cells: Should be <1> + +The clock consumer should specify the desired clock by having the clock +ID in its "clocks" phandle cell. +The ID list atlas7_clks defined in drivers/clk/sirf/clk-atlas7.c + +The reset consumer should specify the desired reset by having the reset +ID in its "reset" phandle cell. +The ID list atlas7_reset_unit defined in drivers/clk/sirf/clk-atlas7.c + +Examples: Clock and reset controller node: + +car: clock-controller at 18620000 { + compatible = "sirf,atlas7-car"; + reg = <0x18620000 0x1000>; + #clock-cells = <1>; + #reset-cells = <1>; +}; + +Examples: Consumers using clock or reset: + +timer at 10dc0000 { + compatible = "sirf,macro-tick"; + reg = <0x10dc0000 0x1000>; + clocks = <&car 54>; + interrupts = <0 0 0>, + <0 1 0>, + <0 2 0>, + <0 49 0>, + <0 50 0>, + <0 51 0>; +}; + +uart1: uart at 18020000 { + cell-index = <1>; + compatible = "sirf,macro-uart"; + reg = <0x18020000 0x1000>; + clocks = <&clks 95>; + interrupts = <0 18 0>; + fifosize = <32>; +}; + +vpp at 13110000 { + compatible = "sirf,prima2-vpp"; + reg = <0x13110000 0x10000>; + interrupts = <0 31 0>; + clocks = <&car 85>; + resets = <&car 29>; +};
drivers/clk/sirf/Makefile +1 -1
@@ -2,4 +2,4 @@ # Makefile for sirf specific clk # -obj-$(CONFIG_ARCH_SIRF) += clk-prima2.o clk-atlas6.o +obj-$(CONFIG_ARCH_SIRF) += clk-prima2.o clk-atlas6.o clk-atlas7.o
drivers/clk/sirf/clk-atlas7.c new file +1633 -0
1,633 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v4 2/2 ARM: dts: atlas7: add fixed frequency clocks in car node
From: Guo Zeng <[email protected]>
This patch adds the fixed clocks of external crystal oscillators.
---
-v4: move the clocks to be global;
arch/arm/boot/dts/atlas7.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/arm/boot/dts/atlas7.dtsi +18 -0
@@ -38,6 +38,24 @@ }; }; + clocks { + #address-cells = <1>; + #size-cells = <1>; + + xinw { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "xinw"; + }; + xin { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <26000000>; + clock-output-names = "xin"; + }; + }; + noc { compatible = "simple-bus"; #address-cells = <1>;
Signature · 1 line
1.9.1
PATCH v4 2/2 ARM: dts: atlas7: add fixed frequency clocks in car node
Quoted 17 lines · Barry Song
From: Guo Zeng <[email protected]>
This patch adds the fixed clocks of external crystal oscillators.
Signed-off-by Guo Zeng <[email protected]>Signed-off-by Barry Song <[email protected]>---
-v4: move the clocks to be global;arch/arm/boot/dts/atlas7.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)arch/arm/boot/dts/atlas7.dtsi +0
-0
arch/arm/boot/dts/atlas7.dtsi line 43
Quoted 6 lines
arch/arm/boot/dts/atlas7.dtsi +3
-0@@ -38,6 +38,24 @@ }; }; + clocks { + #address-cells = <1>; + #size-cells = <1>;
This isn't necessary right? I dropped it and applied it.
----8<-----
arch/arm/boot/dts/atlas7.dtsi +0 -3
@@ -39,9 +39,6 @@ }; clocks { - #address-cells = <1>; - #size-cells = <1>; - xinw { compatible = "fixed-clock"; #clock-cells = <0>;
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Stephen Boyd
AppliedPATCH v4 1/2 clk: sirf: add CSR atlas7 clk and reset support
In reply to Barry SongQuoted 8 lines · Barry Song
From: Zhiwu Song <[email protected]>
the hardware node includes both clock and reset support, so it is named as "car".
this patch implements Flexibleclocks(mux, divider, gate), Selectableclock(mux, divider, gate), root clock(gate),leaf clock(gate), others. it also implements the reset controller functionality.
Quoted 4 lines
Signed-off-by Zhiwu Song <[email protected]>Signed-off-by Guo Zeng <[email protected]>Signed-off-by Barry Song <[email protected]>---
Applied to clk-next with two checkpatches squelched
WARNING: __initdata should be placed after divider_list[] #740: FILE: drivers/clk/sirf/clk-atlas7.c:637:
+static __initdata struct atlas7_div_init_data divider_list[] = {
WARNING: static const char * array should probably be static const char * const #1061: FILE: drivers/clk/sirf/clk-atlas7.c:958:
+static const char *vip_clk_parents[] = {
---8<----
drivers/clk/sirf/clk-atlas7.c +2 -2
@@ -634,7 +634,7 @@ static struct clk_dto clk_disp1_dto = { }, }; -static __initdata struct atlas7_div_init_data divider_list[] = { +static struct atlas7_div_init_data divider_list[]__initdata = {/* div_name, parent_name, gate_name, clk_flag, divider_flag, gate_flag, div_offset, shift, wdith, gate_offset, bit_enable, lock */ {"sys0pll_qa1" ,"sys0pll_fixdiv" ,"sys0pll_a1" ,0 ,0 ,0 ,SIRFSOC_CLKC_USBPHY_CLKDIV_CFG ,0 ,6 ,SIRFSOC_CLKC_USBPHY_CLKDIV_ENA ,0 , &usbphy_div_lock }, {"sys1pll_qa1" ,"sys1pll_fixdiv" ,"sys1pll_a1" ,0 ,0 ,0 ,SIRFSOC_CLKC_USBPHY_CLKDIV_CFG ,8 ,6 ,SIRFSOC_CLKC_USBPHY_CLKDIV_ENA ,4 , &usbphy_div_lock },
@@ -955,7 +955,7 @@ static const char * const sdr_clk_parents[] = { "sys1pll_a17", }; -static const char *vip_clk_parents[] = { +static const char *const vip_clk_parents[] = {"xin" ,"xinw" ,"sys2pll_a20" ,
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project