Skip to content

Commit 545a955

Browse files
committed
ARM: dts: Configure system timers for am437x
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. Cc: [email protected] Cc: Grygorii Strashko <[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 e20ef23 commit 545a955

File tree

7 files changed

+23
-121
lines changed

7 files changed

+23
-121
lines changed

arch/arm/boot/dts/am4372.dtsi

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,23 @@
553553
#reset-cells = <1>;
554554
};
555555
};
556+
557+
/* Preferred always-on timer for clocksource */
558+
&timer1_target {
559+
ti,no-reset-on-init;
560+
ti,no-idle;
561+
timer@0 {
562+
assigned-clocks = <&timer1_fck>;
563+
assigned-clock-parents = <&sys_clkin_ck>;
564+
};
565+
};
566+
567+
/* Preferred timer for clockevent */
568+
&timer2_target {
569+
ti,no-reset-on-init;
570+
ti,no-idle;
571+
timer@0 {
572+
assigned-clocks = <&timer2_fck>;
573+
assigned-clock-parents = <&sys_clkin_ck>;
574+
};
575+
};

arch/arm/boot/dts/am437x-l4.dtsi

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,8 @@
328328
};
329329
};
330330

331-
target-module@31000 { /* 0x44e31000, ap 24 40.0 */
331+
timer1_target: target-module@31000 { /* 0x44e31000, ap 24 40.0 */
332332
compatible = "ti,sysc-omap2-timer", "ti,sysc";
333-
ti,hwmods = "timer1";
334333
reg = <0x31000 0x4>,
335334
<0x31010 0x4>,
336335
<0x31014 0x4>;
@@ -450,7 +449,6 @@
450449

451450
target-module@86000 { /* 0x44e86000, ap 40 70.0 */
452451
compatible = "ti,sysc-omap2", "ti,sysc";
453-
ti,hwmods = "counter_32k";
454452
reg = <0x86000 0x4>,
455453
<0x86004 0x4>;
456454
reg-names = "rev", "sysc";
@@ -868,9 +866,8 @@
868866
};
869867
};
870868

871-
target-module@40000 { /* 0x48040000, ap 18 1e.0 */
869+
timer2_target: target-module@40000 { /* 0x48040000, ap 18 1e.0 */
872870
compatible = "ti,sysc-omap4-timer", "ti,sysc";
873-
ti,hwmods = "timer2";
874871
reg = <0x40000 0x4>,
875872
<0x40010 0x4>,
876873
<0x40014 0x4>;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
308308
.init_late = am43xx_init_late,
309309
.init_irq = omap_gic_of_init,
310310
.init_machine = omap_generic_init,
311-
.init_time = omap3_gptimer_timer_init,
311+
.init_time = omap_init_time_of,
312312
.dt_compat = am43_boards_compat,
313313
.restart = omap44xx_restart,
314314
MACHINE_END

arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ extern struct omap_hwmod am33xx_smartreflex0_hwmod;
4444
extern struct omap_hwmod am33xx_smartreflex1_hwmod;
4545
extern struct omap_hwmod am33xx_gpmc_hwmod;
4646
extern struct omap_hwmod am33xx_rtc_hwmod;
47-
extern struct omap_hwmod am33xx_timer1_hwmod;
48-
extern struct omap_hwmod am33xx_timer2_hwmod;
4947

5048
extern struct omap_hwmod_class am33xx_emif_hwmod_class;
5149
extern struct omap_hwmod_class am33xx_l4_hwmod_class;

arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,6 @@ struct omap_hwmod_ocp_if am33xx_l3_s__gpmc = {
106106
.user = OCP_USER_MPU,
107107
};
108108

109-
/* l4 per -> timer2 */
110-
struct omap_hwmod_ocp_if am33xx_l4_ls__timer2 = {
111-
.master = &am33xx_l4_ls_hwmod,
112-
.slave = &am33xx_timer2_hwmod,
113-
.clk = "l4ls_gclk",
114-
.user = OCP_USER_MPU,
115-
};
116-
117109
/* l3 main -> ocmc */
118110
struct omap_hwmod_ocp_if am33xx_l3_main__ocmc = {
119111
.master = &am33xx_l3_main_hwmod,

arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -307,64 +307,6 @@ struct omap_hwmod am33xx_rtc_hwmod = {
307307
},
308308
};
309309

310-
/* 'timer 2-7' class */
311-
static struct omap_hwmod_class_sysconfig am33xx_timer_sysc = {
312-
.rev_offs = 0x0000,
313-
.sysc_offs = 0x0010,
314-
.syss_offs = 0x0014,
315-
.sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
316-
SYSC_HAS_RESET_STATUS,
317-
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
318-
SIDLE_SMART_WKUP),
319-
.sysc_fields = &omap_hwmod_sysc_type2,
320-
};
321-
322-
struct omap_hwmod_class am33xx_timer_hwmod_class = {
323-
.name = "timer",
324-
.sysc = &am33xx_timer_sysc,
325-
};
326-
327-
/* timer1 1ms */
328-
static struct omap_hwmod_class_sysconfig am33xx_timer1ms_sysc = {
329-
.rev_offs = 0x0000,
330-
.sysc_offs = 0x0010,
331-
.syss_offs = 0x0014,
332-
.sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
333-
SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
334-
SYSS_HAS_RESET_STATUS),
335-
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
336-
.sysc_fields = &omap_hwmod_sysc_type1,
337-
};
338-
339-
static struct omap_hwmod_class am33xx_timer1ms_hwmod_class = {
340-
.name = "timer",
341-
.sysc = &am33xx_timer1ms_sysc,
342-
};
343-
344-
struct omap_hwmod am33xx_timer1_hwmod = {
345-
.name = "timer1",
346-
.class = &am33xx_timer1ms_hwmod_class,
347-
.clkdm_name = "l4_wkup_clkdm",
348-
.main_clk = "timer1_fck",
349-
.prcm = {
350-
.omap4 = {
351-
.modulemode = MODULEMODE_SWCTRL,
352-
},
353-
},
354-
};
355-
356-
struct omap_hwmod am33xx_timer2_hwmod = {
357-
.name = "timer2",
358-
.class = &am33xx_timer_hwmod_class,
359-
.clkdm_name = "l4ls_clkdm",
360-
.main_clk = "timer2_fck",
361-
.prcm = {
362-
.omap4 = {
363-
.modulemode = MODULEMODE_SWCTRL,
364-
},
365-
},
366-
};
367-
368310
static void omap_hwmod_am33xx_clkctrl(void)
369311
{
370312
CLKCTRL(am33xx_smartreflex0_hwmod,
@@ -397,12 +339,10 @@ void omap_hwmod_am33xx_reg(void)
397339

398340
static void omap_hwmod_am43xx_clkctrl(void)
399341
{
400-
CLKCTRL(am33xx_timer2_hwmod, AM43XX_CM_PER_TIMER2_CLKCTRL_OFFSET);
401342
CLKCTRL(am33xx_smartreflex0_hwmod,
402343
AM43XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);
403344
CLKCTRL(am33xx_smartreflex1_hwmod,
404345
AM43XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);
405-
CLKCTRL(am33xx_timer1_hwmod, AM43XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET);
406346
CLKCTRL(am33xx_rtc_hwmod, AM43XX_CM_RTC_RTC_CLKCTRL_OFFSET);
407347
CLKCTRL(am33xx_gpmc_hwmod, AM43XX_CM_PER_GPMC_CLKCTRL_OFFSET);
408348
CLKCTRL(am33xx_l4_ls_hwmod, AM43XX_CM_PER_L4LS_CLKCTRL_OFFSET);

arch/arm/mach-omap2/omap_hwmod_43xx_data.c

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -85,34 +85,6 @@ static struct omap_hwmod am43xx_control_hwmod = {
8585
},
8686
};
8787

88-
static struct omap_hwmod_class_sysconfig am43xx_synctimer_sysc = {
89-
.rev_offs = 0x0,
90-
.sysc_offs = 0x4,
91-
.sysc_flags = SYSC_HAS_SIDLEMODE,
92-
.idlemodes = (SIDLE_FORCE | SIDLE_NO),
93-
.sysc_fields = &omap_hwmod_sysc_type1,
94-
};
95-
96-
static struct omap_hwmod_class am43xx_synctimer_hwmod_class = {
97-
.name = "synctimer",
98-
.sysc = &am43xx_synctimer_sysc,
99-
};
100-
101-
static struct omap_hwmod am43xx_synctimer_hwmod = {
102-
.name = "counter_32k",
103-
.class = &am43xx_synctimer_hwmod_class,
104-
.clkdm_name = "l4_wkup_aon_clkdm",
105-
.flags = HWMOD_SWSUP_SIDLE,
106-
.main_clk = "synctimer_32kclk",
107-
.prcm = {
108-
.omap4 = {
109-
.clkctrl_offs = AM43XX_CM_WKUP_SYNCTIMER_CLKCTRL_OFFSET,
110-
.modulemode = MODULEMODE_SWCTRL,
111-
},
112-
},
113-
};
114-
115-
11688
static struct omap_hwmod_class_sysconfig am43xx_usb_otg_ss_sysc = {
11789
.rev_offs = 0x0000,
11890
.sysc_offs = 0x0010,
@@ -206,20 +178,6 @@ static struct omap_hwmod_ocp_if am43xx_l4_wkup__control = {
206178
.user = OCP_USER_MPU,
207179
};
208180

209-
static struct omap_hwmod_ocp_if am43xx_l4_wkup__timer1 = {
210-
.master = &am33xx_l4_wkup_hwmod,
211-
.slave = &am33xx_timer1_hwmod,
212-
.clk = "sys_clkin_ck",
213-
.user = OCP_USER_MPU,
214-
};
215-
216-
static struct omap_hwmod_ocp_if am33xx_l4_wkup__synctimer = {
217-
.master = &am33xx_l4_wkup_hwmod,
218-
.slave = &am43xx_synctimer_hwmod,
219-
.clk = "sys_clkin_ck",
220-
.user = OCP_USER_MPU,
221-
};
222-
223181
static struct omap_hwmod_ocp_if am43xx_l3_s__usbotgss0 = {
224182
.master = &am33xx_l3_s_hwmod,
225183
.slave = &am43xx_usb_otg_ss0_hwmod,
@@ -235,7 +193,6 @@ static struct omap_hwmod_ocp_if am43xx_l3_s__usbotgss1 = {
235193
};
236194

237195
static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
238-
&am33xx_l4_wkup__synctimer,
239196
&am33xx_mpu__l3_main,
240197
&am33xx_mpu__prcm,
241198
&am33xx_l3_s__l4_ls,
@@ -252,8 +209,6 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
252209
&am43xx_l4_wkup__control,
253210
&am43xx_l4_wkup__smartreflex0,
254211
&am43xx_l4_wkup__smartreflex1,
255-
&am43xx_l4_wkup__timer1,
256-
&am33xx_l4_ls__timer2,
257212
&am33xx_l3_s__gpmc,
258213
&am33xx_l3_main__ocmc,
259214
&am43xx_l3_s__usbotgss0,

0 commit comments

Comments
 (0)