ARM: dts: Fix some mux and divider clocks to get dm814x-evm booting
authorTony Lindgren <tony@atomide.com>
Thu, 3 Dec 2015 20:02:31 +0000 (12:02 -0800)
committerTony Lindgren <tony@atomide.com>
Thu, 10 Dec 2015 00:53:46 +0000 (16:53 -0800)
Although we have hp t410 booting, I noticed that dm814x-evm does not boot
after I got one. This is because we don't have the clocks yet configured
properly. Let's start configuring proper clocks starting with the system
timers and clocks that work with existing mux and divider clock drivers.

Note that the oscillator speed register is different from am335x, dm814x
has only one bit that shows the BTMODE[6] at CONTROL_STATUS[21].

Also note that this only gets the system timers working with the defined
clocks. The PLL clocks are still missing and and the devices may or may
not work depending on what the bootloader has enabled.

Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/boot/dts/dm814x-clocks.dtsi

index ef1e8e7a6cc66810f1ae436b3d72a4d867f6e3e4..26001585673add86c25b11874d4a98c3a55ec691 100644 (file)
@@ -4,25 +4,74 @@
  * published by the Free Software Foundation.
  */
 
+&pllss_clocks {
+       timer1_fck: timer1_fck {
+               #clock-cells = <0>;
+               compatible = "ti,mux-clock";
+               clocks = <&sysclk18_ck &aud_clkin0_ck &aud_clkin1_ck
+                         &aud_clkin2_ck &devosc_ck &auxosc_ck &tclkin_ck>;
+               ti,bit-shift = <3>;
+               reg = <0x2e0>;
+       };
+
+       timer2_fck: timer2_fck {
+               #clock-cells = <0>;
+               compatible = "ti,mux-clock";
+               clocks = <&sysclk18_ck &aud_clkin0_ck &aud_clkin1_ck
+                         &aud_clkin2_ck &devosc_ck &auxosc_ck &tclkin_ck>;
+               ti,bit-shift = <6>;
+               reg = <0x2e0>;
+       };
+
+       sysclk18_ck: sysclk18_ck {
+               #clock-cells = <0>;
+               compatible = "ti,mux-clock";
+               clocks = <&rtcosc_ck>, <&rtcdivider_ck>;
+               ti,bit-shift = <0>;
+               reg = <0x02f0>;
+       };
+};
+
 &scm_clocks {
+       devosc_ck: devosc_ck {
+               #clock-cells = <0>;
+               compatible = "ti,mux-clock";
+               clocks = <&virt_20000000_ck>, <&virt_19200000_ck>;
+               ti,bit-shift = <21>;
+               reg = <0x0040>;
+       };
 
-       tclkin_ck: tclkin_ck {
+       /* Optional auxosc, 20 - 30 MHz range, assume 27 MHz by default */
+       auxosc_ck: auxosc_ck {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <27000000>;
+       };
+
+       /* Optional 32768Hz crystal or clock on RTCOSC pins */
+       rtcosc_ck: rtcosc_ck {
                #clock-cells = <0>;
                compatible = "fixed-clock";
                clock-frequency = <32768>;
        };
 
-       devosc_ck: devosc_ck {
+       /* Optional external clock on TCLKIN pin, set rate in baord dts file */
+       tclkin_ck: tclkin_ck {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <0>;
+       };
+
+       virt_20000000_ck: virt_20000000_ck {
                #clock-cells = <0>;
                compatible = "fixed-clock";
                clock-frequency = <20000000>;
        };
 
-       /* Optional auxosc, 20 - 30 MHz range, assume 27 MHz by default */
-       auxosc_ck: auxosc_ck {
+       virt_19200000_ck: virt_19200000_ck {
                #clock-cells = <0>;
                compatible = "fixed-clock";
-               clock-frequency = <27000000>;
+               clock-frequency = <19200000>;
        };
 
        mpu_ck: mpu_ck {
                clock-frequency = <48000000>;
        };
 
-       sysclk18_ck: sysclk18_ck {
-               #clock-cells = <0>;
-               compatible = "fixed-clock";
-               clock-frequency = <32768>;
-       };
-
         cpsw_125mhz_gclk: cpsw_125mhz_gclk {
                #clock-cells = <0>;
                compatible = "fixed-clock";
 
 };
 
-&pllss_clocks {
+&prcm_clocks {
+       osc_src_ck: osc_src_ck {
+               #clock-cells = <0>;
+               compatible = "fixed-factor-clock";
+               clocks = <&devosc_ck>;
+               clock-mult = <1>;
+               clock-div = <1>;
+       };
+
+       mpu_clksrc_ck: mpu_clksrc_ck {
+               #clock-cells = <0>;
+               compatible = "ti,mux-clock";
+               clocks = <&devosc_ck>, <&rtcdivider_ck>;
+               ti,bit-shift = <0>;
+               reg = <0x0040>;
+       };
+
+       /* Fixed divider clock 0.0016384 * devosc */
+       rtcdivider_ck: rtcdivider_ck {
+               #clock-cells = <0>;
+               compatible = "fixed-factor-clock";
+               clocks = <&devosc_ck>;
+               clock-mult = <128>;
+               clock-div = <78125>;
+       };
 
        aud_clkin0_ck: aud_clkin0_ck {
                #clock-cells = <0>;
                compatible = "fixed-clock";
                clock-frequency = <20000000>;
        };
-
-       timer1_mux_ck: timer1_mux_ck {
-               #clock-cells = <0>;
-               compatible = "ti,mux-clock";
-               clocks = <&sysclk18_ck &aud_clkin0_ck &aud_clkin1_ck
-                         &aud_clkin2_ck &devosc_ck &auxosc_ck &tclkin_ck>;
-               ti,bit-shift = <3>;
-               reg = <0x2e0>;
-       };
-
-       timer2_mux_ck: timer2_mux_ck {
-               #clock-cells = <0>;
-               compatible = "ti,mux-clock";
-               clocks = <&sysclk18_ck &aud_clkin0_ck &aud_clkin1_ck
-                         &aud_clkin2_ck &devosc_ck &auxosc_ck &tclkin_ck>;
-               ti,bit-shift = <6>;
-               reg = <0x2e0>;
-       };
 };