Skip to content

Commit e20ef23

Browse files
committed
ARM: dts: Configure system timers for am335x
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 e69b4e1 commit e20ef23

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,8 @@
330330
};
331331
};
332332

333-
target-module@31000 { /* 0x44e31000, ap 25 40.0 */
333+
timer1_target: target-module@31000 { /* 0x44e31000, ap 25 40.0 */
334334
compatible = "ti,sysc-omap2-timer", "ti,sysc";
335-
ti,hwmods = "timer1";
336335
reg = <0x31000 0x4>,
337336
<0x31010 0x4>,
338337
<0x31014 0x4>;
@@ -1117,9 +1116,8 @@
11171116
};
11181117
};
11191118

1120-
target-module@40000 { /* 0x48040000, ap 22 1e.0 */
1119+
timer2_target: target-module@40000 { /* 0x48040000, ap 22 1e.0 */
11211120
compatible = "ti,sysc-omap4-timer", "ti,sysc";
1122-
ti,hwmods = "timer2";
11231121
reg = <0x40000 0x4>,
11241122
<0x40010 0x4>,
11251123
<0x40014 0x4>;

arch/arm/boot/dts/am33xx.dtsi

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,3 +619,23 @@
619619
#reset-cells = <1>;
620620
};
621621
};
622+
623+
/* Preferred always-on timer for clocksource */
624+
&timer1_target {
625+
ti,no-reset-on-init;
626+
ti,no-idle;
627+
timer@0 {
628+
assigned-clocks = <&timer1_fck>;
629+
assigned-clock-parents = <&sys_clkin_ck>;
630+
};
631+
};
632+
633+
/* Preferred timer for clockevent */
634+
&timer2_target {
635+
ti,no-reset-on-init;
636+
ti,no-idle;
637+
timer@0 {
638+
assigned-clocks = <&timer2_fck>;
639+
assigned-clock-parents = <&sys_clkin_ck>;
640+
};
641+
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
236236
.init_early = am33xx_init_early,
237237
.init_machine = omap_generic_init,
238238
.init_late = am33xx_init_late,
239-
.init_time = omap3_gptimer_timer_init,
239+
.init_time = omap_init_time_of,
240240
.dt_compat = am33xx_boards_compat,
241241
.restart = am33xx_restart,
242242
MACHINE_END

arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,10 @@ struct omap_hwmod am33xx_timer2_hwmod = {
367367

368368
static void omap_hwmod_am33xx_clkctrl(void)
369369
{
370-
CLKCTRL(am33xx_timer2_hwmod, AM33XX_CM_PER_TIMER2_CLKCTRL_OFFSET);
371370
CLKCTRL(am33xx_smartreflex0_hwmod,
372371
AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);
373372
CLKCTRL(am33xx_smartreflex1_hwmod,
374373
AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);
375-
CLKCTRL(am33xx_timer1_hwmod, AM33XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET);
376374
CLKCTRL(am33xx_rtc_hwmod, AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET);
377375
PRCM_FLAGS(am33xx_rtc_hwmod, HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET);
378376
CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET);

arch/arm/mach-omap2/omap_hwmod_33xx_data.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,6 @@ static struct omap_hwmod_ocp_if am33xx_l4_wkup__control = {
265265
.user = OCP_USER_MPU,
266266
};
267267

268-
/* l4 wkup -> timer1 */
269-
static struct omap_hwmod_ocp_if am33xx_l4_wkup__timer1 = {
270-
.master = &am33xx_l4_wkup_hwmod,
271-
.slave = &am33xx_timer1_hwmod,
272-
.clk = "dpll_core_m4_div2_ck",
273-
.user = OCP_USER_MPU,
274-
};
275-
276268
static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
277269
&am33xx_l3_main__emif,
278270
&am33xx_mpu__l3_main,
@@ -291,9 +283,7 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
291283
&am33xx_l4_wkup__control,
292284
&am33xx_l4_wkup__smartreflex0,
293285
&am33xx_l4_wkup__smartreflex1,
294-
&am33xx_l4_wkup__timer1,
295286
&am33xx_l4_wkup__rtc,
296-
&am33xx_l4_ls__timer2,
297287
&am33xx_l3_s__gpmc,
298288
&am33xx_l3_main__ocmc,
299289
NULL,

0 commit comments

Comments
 (0)