]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: dts: berlin: convert BG2CD to DT clock nodes
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Sat, 10 May 2014 13:22:48 +0000 (15:22 +0200)
committerSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tue, 13 May 2014 20:24:37 +0000 (22:24 +0200)
This converts Berlin BG2CD SoC dtsi to make use of the new DT clock
nodes for Berlin SoCs. Also add a binding include to ease core clock
references.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
arch/arm/boot/dts/berlin2cd.dtsi
include/dt-bindings/clock/berlin2.h [new file with mode: 0644]

index 6eb1bdae23ac91b78cdacaa2ea2347c461eeee75..818c7557bad568f8b8f35598840b012cb08cfc67 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include "skeleton.dtsi"
+#include <dt-bindings/clock/berlin2.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 
 / {
                };
        };
 
-       clocks {
-               smclk: sysmgr-clock {
-                       compatible = "fixed-clock";
-                       #clock-cells = <0>;
-                       clock-frequency = <25000000>;
-               };
-
-               cfgclk: cfg-clock {
-                       compatible = "fixed-clock";
-                       #clock-cells = <0>;
-                       clock-frequency = <75000000>;
-               };
+       refclk: oscillator {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <25000000>;
+       };
 
-               sysclk: system-clock {
-                       compatible = "fixed-clock";
-                       #clock-cells = <0>;
-                       clock-frequency = <300000000>;
-               };
+       twdclk: twdclk {
+               compatible = "fixed-factor-clock";
+               #clock-cells = <0>;
+               clocks = <&coreclk CLKID_CPU>;
+               clock-mult = <1>;
+               clock-div = <3>;
        };
 
        soc {
@@ -76,7 +71,7 @@
                        compatible = "arm,cortex-a9-twd-timer";
                        reg = <0xad0600 0x20>;
                        interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&sysclk>;
+                       clocks = <&twdclk>;
                };
 
                apb@e80000 {
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c00 0x14>;
                                interrupts = <8>;
-                               clocks = <&cfgclk>;
+                               clocks = <&coreclk CLKID_CFG>;
                                clock-names = "timer";
                                status = "okay";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c14 0x14>;
                                interrupts = <9>;
-                               clocks = <&cfgclk>;
+                               clocks = <&coreclk CLKID_CFG>;
                                clock-names = "timer";
                                status = "okay";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c28 0x14>;
                                interrupts = <10>;
-                               clocks = <&cfgclk>;
+                               clocks = <&coreclk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c3c 0x14>;
                                interrupts = <11>;
-                               clocks = <&cfgclk>;
+                               clocks = <&coreclk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c50 0x14>;
                                interrupts = <12>;
-                               clocks = <&cfgclk>;
+                               clocks = <&coreclk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c64 0x14>;
                                interrupts = <13>;
-                               clocks = <&cfgclk>;
+                               clocks = <&coreclk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c78 0x14>;
                                interrupts = <14>;
-                               clocks = <&cfgclk>;
+                               clocks = <&coreclk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c8c 0x14>;
                                interrupts = <15>;
-                               clocks = <&cfgclk>;
+                               clocks = <&coreclk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                        };
                };
 
+               syspll: syspll@ea0014 {
+                       compatible = "marvell,berlin2-pll";
+                       #clock-cells = <0>;
+                       reg = <0xea0014 0x14>;
+                       clocks = <&refclk>;
+               };
+
+               mempll: mempll@ea0028 {
+                       compatible = "marvell,berlin2-pll";
+                       #clock-cells = <0>;
+                       reg = <0xea0028 0x14>;
+                       clocks = <&refclk>;
+               };
+
+               cpupll: cpupll@ea003c {
+                       compatible = "marvell,berlin2-pll";
+                       #clock-cells = <0>;
+                       reg = <0xea003c 0x14>;
+                       clocks = <&refclk>;
+               };
+
+               avpll: avpll@ea0040 {
+                       compatible = "marvell,berlin2-avpll";
+                       #clock-cells = <2>;
+                       reg = <0xea0050 0x100>;
+                       clocks = <&refclk>;
+               };
+
+               coreclk: core-clock@ea0150 {
+                       compatible = "marvell,berlin2-core-clocks";
+                       #clock-cells = <1>;
+                       reg = <0xea0150 0x1c>;
+                       clocks = <&refclk>, <&syspll>, <&mempll>, <&cpupll>,
+                               <&avpll 0 1>, <&avpll 0 2>,
+                               <&avpll 0 3>, <&avpll 0 4>,
+                               <&avpll 0 5>, <&avpll 0 6>,
+                               <&avpll 0 7>, <&avpll 0 8>,
+                               <&avpll 1 1>, <&avpll 1 2>,
+                               <&avpll 1 3>, <&avpll 1 4>,
+                               <&avpll 1 5>, <&avpll 1 6>,
+                               <&avpll 1 7>, <&avpll 1 8>;
+                       clock-names = "refclk", "syspll", "mempll", "cpupll",
+                               "avpll_a1", "avpll_a2", "avpll_a3", "avpll_a4",
+                               "avpll_a5", "avpll_a6", "avpll_a7", "avpll_a8",
+                               "avpll_b1", "avpll_b2", "avpll_b3", "avpll_b4",
+                               "avpll_b5", "avpll_b6", "avpll_b7", "avpll_b8";
+                       clock-output-names = "sys", "cpu", "drmfigo", "cfg",
+                               "gfx", "zsp", "perif", "pcube", "vscope",
+                               "nfc_ecc", "vpp", "app", "audio0", "audio2",
+                               "audio3", "audio1", "geth0", "geth1", "sata",
+                               "ahbapb", "usb0", "usb1", "pbridge", "sdio0",
+                               "sdio1", "nfc", "smemc", "audiohd", "video0",
+                               "video1", "video2";
+               };
+
+               gfx3dcore_clk: gfx3dcore@ea022c {
+                       compatible = "marvell,berlin2-clk-div";
+                       #clock-cells = <0>;
+                       reg = <0xea022c 0x4>;
+                       clocks = <&syspll>,
+                               <&avpll 1 4>, <&avpll 1 5>,
+                               <&avpll 1 6>, <&avpll 1 7>;
+                       clock-names = "mux_bypass",
+                               "mux0", "mux1", "mux2", "mux3";
+               };
+
+               gfx3dsys_clk: gfx3dsys@ea0230 {
+                       compatible = "marvell,berlin2-clk-div";
+                       #clock-cells = <0>;
+                       reg = <0xea0230 0x4>;
+                       clocks = <&syspll>,
+                               <&avpll 1 4>, <&avpll 1 5>,
+                               <&avpll 1 6>, <&avpll 1 7>;
+                       clock-names = "mux_bypass",
+                               "mux0", "mux1", "mux2", "mux3";
+               };
+
+               arc_clk: arc@ea0234 {
+                       compatible = "marvell,berlin2-clk-div";
+                       #clock-cells = <0>;
+                       reg = <0xea0234 0x4>;
+                       clocks = <&syspll>,
+                               <&avpll 1 4>, <&avpll 1 5>,
+                               <&avpll 1 6>, <&avpll 1 7>;
+                       clock-names = "mux_bypass",
+                               "mux0", "mux1", "mux2", "mux3";
+               };
+
+               vip_clk: vip@ea0238 {
+                       compatible = "marvell,berlin2-clk-div";
+                       #clock-cells = <0>;
+                       reg = <0xea0238 0x4>;
+                       clocks = <&syspll>,
+                               <&avpll 1 4>, <&avpll 1 5>,
+                               <&avpll 1 6>, <&avpll 1 7>;
+                       clock-names = "mux_bypass",
+                               "mux0", "mux1", "mux2", "mux3";
+               };
+
+               sdio0xin_clk: sdio0xin@ea023c {
+                       compatible = "marvell,berlin2-clk-div";
+                       #clock-cells = <0>;
+                       reg = <0xea023c 0x4>;
+                       clocks = <&syspll>,
+                               <&avpll 1 4>, <&avpll 1 5>,
+                               <&avpll 1 6>, <&avpll 1 7>;
+                       clock-names = "mux_bypass",
+                               "mux0", "mux1", "mux2", "mux3";
+               };
+
+               sdio1xin_clk: sdio1xin@ea0240 {
+                       compatible = "marvell,berlin2-clk-div";
+                       #clock-cells = <0>;
+                       reg = <0xea0240 0x4>;
+                       clocks = <&syspll>,
+                               <&avpll 1 4>, <&avpll 1 5>,
+                               <&avpll 1 6>, <&avpll 1 7>;
+                       clock-names = "mux_bypass",
+                               "mux0", "mux1", "mux2", "mux3";
+               };
+
+               gfx3dextra_clk: gfx3dextra@ea0244 {
+                       compatible = "marvell,berlin2-clk-div";
+                       #clock-cells = <0>;
+                       reg = <0xea0244 0x4>;
+                       clocks = <&syspll>,
+                               <&avpll 1 4>, <&avpll 1 5>,
+                               <&avpll 1 6>, <&avpll 1 7>;
+                       clock-names = "mux_bypass",
+                               "mux0", "mux1", "mux2", "mux3";
+               };
+
+               gc360_clk: gc360@ea024c {
+                       compatible = "marvell,berlin2-clk-div";
+                       #clock-cells = <0>;
+                       reg = <0xea024c 0x4>;
+                       clocks = <&syspll>,
+                               <&avpll 1 4>, <&avpll 1 5>,
+                               <&avpll 1 6>, <&avpll 1 7>;
+                       clock-names = "mux_bypass",
+                               "mux0", "mux1", "mux2", "mux3";
+               };
+
+               sdio_dllmst_clk: sdio_dllmst@ea0250 {
+                       compatible = "marvell,berlin2-clk-div";
+                       #clock-cells = <0>;
+                       reg = <0xea0250 0x4>;
+                       clocks = <&syspll>,
+                               <&avpll 1 4>, <&avpll 1 5>,
+                               <&avpll 1 6>, <&avpll 1 7>;
+                       clock-names = "mux_bypass",
+                               "mux0", "mux1", "mux2", "mux3";
+               };
+
                apb@fc0000 {
                        compatible = "simple-bus";
                        #address-cells = <1>;
                                reg-shift = <2>;
                                reg-io-width = <1>;
                                interrupts = <8>;
-                               clocks = <&smclk>;
+                               clocks = <&refclk>;
                                status = "disabled";
                        };
 
                                reg-shift = <2>;
                                reg-io-width = <1>;
                                interrupts = <9>;
-                               clocks = <&smclk>;
+                               clocks = <&refclk>;
                                status = "disabled";
                        };
 
diff --git a/include/dt-bindings/clock/berlin2.h b/include/dt-bindings/clock/berlin2.h
new file mode 100644 (file)
index 0000000..dacf7ed
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Berlin2 BG2/BG2CD clock tree IDs
+ */
+
+#define CLKID_SYS              0
+#define CLKID_CPU              1
+#define CLKID_DRMFIGO          2
+#define CLKID_CFG              3
+#define CLKID_GFX              4
+#define CLKID_ZSP              5
+#define CLKID_PERIF            6
+#define CLKID_PCUBE            7
+#define CLKID_VSCOPE           8
+#define CLKID_NFC_ECC          9
+#define CLKID_VPP              10
+#define CLKID_APP              11
+#define CLKID_AUDIO0           12
+#define CLKID_AUDIO2           23
+#define CLKID_AUDIO3           14
+#define CLKID_AUDIO1           15
+#define CLKID_GETH0            16
+#define CLKID_GETH1            17
+#define CLKID_SATA             18
+#define CLKID_AHBAPB           19
+#define CLKID_USB0             20
+#define CLKID_USB1             21
+#define CLKID_PBRIDGE          22
+#define CLKID_SDIO0            23
+#define CLKID_SDIO1            24
+#define CLKID_NFC              25
+#define CLKID_SMEMC            26
+#define CLKID_AUDIOHD          27
+#define CLKID_VIDEO0           28
+#define CLKID_VIDEO1           29
+#define CLKID_VIDEO2           30