Skip to content

Commit e428e25

Browse files
committed
ARM: dts: Configure system timers for omap3
We can now init system timers using the dmtimer and 32k counter based on only devicetree data and drivers/clocksource timers. Let's configure the clocksource and clockevent, and drop the old unused platform data. As we're just dropping platform data, and the early platform data init is based on the custom ti,hwmods property, we want to drop both the platform data and ti,hwmods property in a single patch. Since the dmtimer can use both 32k clock and system clock as the source, let's also configure the SoC specific default values. The board specific dts files can reconfigure these with assigned-clocks and assigned-clock-parents as needed. Let's also update the dts file to use #include while at it. Cc: [email protected] Cc: Adam Ford <[email protected]> Cc: Andreas Kemnade <[email protected]> Cc: Grygorii Strashko <[email protected]> Cc: "H. Nikolaus Schaller" <[email protected]> Cc: Keerthy <[email protected]> Cc: Lokesh Vutla <[email protected]> Cc: Rob Herring <[email protected]> Cc: Tero Kristo <[email protected]> Signed-off-by: Tony Lindgren <[email protected]>
1 parent 036a3d4 commit e428e25

File tree

6 files changed

+205
-175
lines changed

6 files changed

+205
-175
lines changed

arch/arm/boot/dts/am3517.dtsi

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,25 @@
169169
status = "disabled";
170170
};
171171

172-
/include/ "am35xx-clocks.dtsi"
173-
/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
172+
#include "am35xx-clocks.dtsi"
173+
#include "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
174+
175+
/* Preferred always-on timer for clocksource */
176+
&timer1_target {
177+
ti,no-reset-on-init;
178+
ti,no-idle;
179+
timer@0 {
180+
assigned-clocks = <&gpt1_fck>;
181+
assigned-clock-parents = <&sys_ck>;
182+
};
183+
};
184+
185+
/* Preferred timer for clockevent */
186+
&timer2_target {
187+
ti,no-reset-on-init;
188+
ti,no-idle;
189+
timer@0 {
190+
assigned-clocks = <&gpt2_fck>;
191+
assigned-clock-parents = <&sys_ck>;
192+
};
193+
};

arch/arm/boot/dts/omap3-beagle.dts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,39 @@
304304
phys = <0 &hsusb2_phy>;
305305
};
306306

307+
/* Unusable as clocksource because of unreliable oscillator */
308+
&counter32k {
309+
status = "disabled";
310+
};
311+
312+
/* Unusable as clockevent because if unreliable oscillator, allow to idle */
313+
&timer1_target {
314+
/delete-property/ti,no-reset-on-init;
315+
/delete-property/ti,no-idle;
316+
timer@0 {
317+
/delete-property/ti,timer-alwon;
318+
};
319+
};
320+
321+
/* Preferred always-on timer for clocksource */
322+
&timer12_target {
323+
ti,no-reset-on-init;
324+
ti,no-idle;
325+
timer@0 {
326+
/* Always clocked by secure_32k_fck */
327+
};
328+
};
329+
330+
/* Preferred timer for clockevent */
331+
&timer2_target {
332+
ti,no-reset-on-init;
333+
ti,no-idle;
334+
timer@0 {
335+
assigned-clocks = <&gpt2_fck>;
336+
assigned-clock-parents = <&sys_ck>;
337+
};
338+
};
339+
307340
&twl_gpio {
308341
ti,use-leds;
309342
/* pullups: BIT(1) */

arch/arm/boot/dts/omap3-devkit8000.dts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,36 @@
1414
display2 = &tv0;
1515
};
1616
};
17+
18+
/* Unusable as clocksource because of unreliable oscillator */
19+
&counter32k {
20+
status = "disabled";
21+
};
22+
23+
/* Unusable as clockevent because if unreliable oscillator, allow to idle */
24+
&timer1_target {
25+
/delete-property/ti,no-reset-on-init;
26+
/delete-property/ti,no-idle;
27+
timer@0 {
28+
/delete-property/ti,timer-alwon;
29+
};
30+
};
31+
32+
/* Preferred always-on timer for clocksource */
33+
&timer12_target {
34+
ti,no-reset-on-init;
35+
ti,no-idle;
36+
timer@0 {
37+
/* Always clocked by secure_32k_fck */
38+
};
39+
};
40+
41+
/* Preferred timer for clockevent */
42+
&timer2_target {
43+
ti,no-reset-on-init;
44+
ti,no-idle;
45+
timer@0 {
46+
assigned-clocks = <&gpt2_fck>;
47+
assigned-clock-parents = <&sys_ck>;
48+
};
49+
};

arch/arm/boot/dts/omap3.dtsi

Lines changed: 111 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,23 @@
193193
};
194194
};
195195

196-
counter32k: counter@48320000 {
197-
compatible = "ti,omap-counter32k";
198-
reg = <0x48320000 0x20>;
199-
ti,hwmods = "counter_32k";
196+
target-module@48320000 {
197+
compatible = "ti,sysc-omap2", "ti,sysc";
198+
reg = <0x48320000 0x4>,
199+
<0x48320004 0x4>;
200+
reg-names = "rev", "sysc";
201+
ti,sysc-sidle = <SYSC_IDLE_FORCE>,
202+
<SYSC_IDLE_NO>;
203+
clocks = <&wkup_32k_fck>, <&omap_32ksync_ick>;
204+
clock-names = "fck", "ick";
205+
#address-cells = <1>;
206+
#size-cells = <1>;
207+
ranges = <0x0 0x48320000 0x1000>;
208+
209+
counter32k: counter@0 {
210+
compatible = "ti,omap-counter32k";
211+
reg = <0x0 0x20>;
212+
};
200213
};
201214

202215
intc: interrupt-controller@48200000 {
@@ -637,19 +650,63 @@
637650
dma-names = "rx";
638651
};
639652

640-
timer1: timer@48318000 {
641-
compatible = "ti,omap3430-timer";
642-
reg = <0x48318000 0x400>;
643-
interrupts = <37>;
644-
ti,hwmods = "timer1";
645-
ti,timer-alwon;
653+
timer1_target: target-module@48318000 {
654+
compatible = "ti,sysc-omap2-timer", "ti,sysc";
655+
reg = <0x48318000 0x4>,
656+
<0x48318010 0x4>,
657+
<0x48318014 0x4>;
658+
reg-names = "rev", "sysc", "syss";
659+
ti,sysc-mask = <(SYSC_OMAP2_CLOCKACTIVITY |
660+
SYSC_OMAP2_EMUFREE |
661+
SYSC_OMAP2_ENAWAKEUP |
662+
SYSC_OMAP2_SOFTRESET |
663+
SYSC_OMAP2_AUTOIDLE)>;
664+
ti,sysc-sidle = <SYSC_IDLE_FORCE>,
665+
<SYSC_IDLE_NO>,
666+
<SYSC_IDLE_SMART>;
667+
ti,syss-mask = <1>;
668+
clocks = <&gpt1_fck>, <&gpt1_ick>;
669+
clock-names = "fck", "ick";
670+
#address-cells = <1>;
671+
#size-cells = <1>;
672+
ranges = <0x0 0x48318000 0x1000>;
673+
674+
timer1: timer@0 {
675+
compatible = "ti,omap3430-timer";
676+
reg = <0x0 0x80>;
677+
clocks = <&gpt1_fck>;
678+
clock-names = "fck";
679+
interrupts = <37>;
680+
ti,timer-alwon;
681+
};
646682
};
647683

648-
timer2: timer@49032000 {
649-
compatible = "ti,omap3430-timer";
650-
reg = <0x49032000 0x400>;
651-
interrupts = <38>;
652-
ti,hwmods = "timer2";
684+
timer2_target: target-module@49032000 {
685+
compatible = "ti,sysc-omap2-timer", "ti,sysc";
686+
reg = <0x49032000 0x4>,
687+
<0x49032010 0x4>,
688+
<0x49032014 0x4>;
689+
reg-names = "rev", "sysc", "syss";
690+
ti,sysc-mask = <(SYSC_OMAP2_CLOCKACTIVITY |
691+
SYSC_OMAP2_EMUFREE |
692+
SYSC_OMAP2_ENAWAKEUP |
693+
SYSC_OMAP2_SOFTRESET |
694+
SYSC_OMAP2_AUTOIDLE)>;
695+
ti,sysc-sidle = <SYSC_IDLE_FORCE>,
696+
<SYSC_IDLE_NO>,
697+
<SYSC_IDLE_SMART>;
698+
ti,syss-mask = <1>;
699+
clocks = <&gpt2_fck>, <&gpt2_ick>;
700+
clock-names = "fck", "ick";
701+
#address-cells = <1>;
702+
#size-cells = <1>;
703+
ranges = <0x0 0x49032000 0x1000>;
704+
705+
timer2: timer@0 {
706+
compatible = "ti,omap3430-timer";
707+
reg = <0 0x400>;
708+
interrupts = <38>;
709+
};
653710
};
654711

655712
timer3: timer@49034000 {
@@ -723,13 +780,34 @@
723780
ti,timer-pwm;
724781
};
725782

726-
timer12: timer@48304000 {
727-
compatible = "ti,omap3430-timer";
728-
reg = <0x48304000 0x400>;
729-
interrupts = <95>;
730-
ti,hwmods = "timer12";
731-
ti,timer-alwon;
732-
ti,timer-secure;
783+
timer12_target: target-module@48304000 {
784+
compatible = "ti,sysc-omap2-timer", "ti,sysc";
785+
reg = <0x48304000 0x4>,
786+
<0x48304010 0x4>,
787+
<0x48304014 0x4>;
788+
reg-names = "rev", "sysc", "syss";
789+
ti,sysc-mask = <(SYSC_OMAP2_CLOCKACTIVITY |
790+
SYSC_OMAP2_EMUFREE |
791+
SYSC_OMAP2_ENAWAKEUP |
792+
SYSC_OMAP2_SOFTRESET |
793+
SYSC_OMAP2_AUTOIDLE)>;
794+
ti,sysc-sidle = <SYSC_IDLE_FORCE>,
795+
<SYSC_IDLE_NO>,
796+
<SYSC_IDLE_SMART>;
797+
ti,syss-mask = <1>;
798+
clocks = <&gpt12_fck>, <&gpt12_ick>;
799+
clock-names = "fck", "ick";
800+
#address-cells = <1>;
801+
#size-cells = <1>;
802+
ranges = <0x0 0x48304000 0x1000>;
803+
804+
timer12: timer@0 {
805+
compatible = "ti,omap3430-timer";
806+
reg = <0 0x400>;
807+
interrupts = <95>;
808+
ti,timer-alwon;
809+
ti,timer-secure;
810+
};
733811
};
734812

735813
usbhstll: usbhstll@48062000 {
@@ -886,4 +964,14 @@
886964
};
887965
};
888966

889-
/include/ "omap3xxx-clocks.dtsi"
967+
#include "omap3xxx-clocks.dtsi"
968+
969+
/* Preferred always-on timer for clockevent. Some boards must use dmtimer12 */
970+
&timer1_target {
971+
ti,no-reset-on-init;
972+
ti,no-idle;
973+
timer@0 {
974+
assigned-clocks = <&gpt1_fck>;
975+
assigned-clock-parents = <&omap_32k_fck>;
976+
};
977+
};

arch/arm/mach-omap2/board-generic.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board")
114114
.init_early = omap3430_init_early,
115115
.init_machine = omap_generic_init,
116116
.init_late = omap3_init_late,
117-
.init_time = omap_init_time,
117+
.init_time = omap_init_time_of,
118118
.dt_compat = n900_boards_compat,
119119
.restart = omap3xxx_restart,
120120
MACHINE_END
@@ -132,7 +132,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
132132
.init_early = omap3430_init_early,
133133
.init_machine = omap_generic_init,
134134
.init_late = omap3_init_late,
135-
.init_time = omap_init_time,
135+
.init_time = omap_init_time_of,
136136
.dt_compat = omap3_boards_compat,
137137
.restart = omap3xxx_restart,
138138
MACHINE_END
@@ -149,7 +149,7 @@ DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
149149
.init_early = omap3630_init_early,
150150
.init_machine = omap_generic_init,
151151
.init_late = omap3_init_late,
152-
.init_time = omap_init_time,
152+
.init_time = omap_init_time_of,
153153
.dt_compat = omap36xx_boards_compat,
154154
.restart = omap3xxx_restart,
155155
MACHINE_END
@@ -166,7 +166,7 @@ DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
166166
.init_early = omap3430_init_early,
167167
.init_machine = omap_generic_init,
168168
.init_late = omap3_init_late,
169-
.init_time = omap3_secure_sync32k_timer_init,
169+
.init_time = omap_init_time_of,
170170
.dt_compat = omap3_gp_boards_compat,
171171
.restart = omap3xxx_restart,
172172
MACHINE_END
@@ -182,7 +182,7 @@ DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)")
182182
.init_early = am35xx_init_early,
183183
.init_machine = omap_generic_init,
184184
.init_late = omap3_init_late,
185-
.init_time = omap3_gptimer_timer_init,
185+
.init_time = omap_init_time_of,
186186
.dt_compat = am3517_boards_compat,
187187
.restart = omap3xxx_restart,
188188
MACHINE_END

0 commit comments

Comments
 (0)