Commit e428e250 authored by Tony Lindgren's avatar Tony Lindgren
Browse files

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: devicetree@vger.kernel.org
Cc: Adam Ford <aford173@gmail.com>
Cc: Andreas Kemnade <andreas@kemnade.info>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Keerthy <j-keerthy@ti.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 036a3d42
Loading
Loading
Loading
Loading
+22 −2
Original line number Diff line number Diff line
@@ -169,5 +169,25 @@
	status = "disabled";
};

/include/ "am35xx-clocks.dtsi"
/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
#include "am35xx-clocks.dtsi"
#include "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"

/* Preferred always-on timer for clocksource */
&timer1_target {
	ti,no-reset-on-init;
	ti,no-idle;
	timer@0 {
		assigned-clocks = <&gpt1_fck>;
		assigned-clock-parents = <&sys_ck>;
	};
};

/* Preferred timer for clockevent */
&timer2_target {
	ti,no-reset-on-init;
	ti,no-idle;
	timer@0 {
		assigned-clocks = <&gpt2_fck>;
		assigned-clock-parents = <&sys_ck>;
	};
};
+33 −0
Original line number Diff line number Diff line
@@ -304,6 +304,39 @@
	phys = <0 &hsusb2_phy>;
};

/* Unusable as clocksource because of unreliable oscillator */
&counter32k {
	status = "disabled";
};

/* Unusable as clockevent because if unreliable oscillator, allow to idle */
&timer1_target {
	/delete-property/ti,no-reset-on-init;
	/delete-property/ti,no-idle;
	timer@0 {
		/delete-property/ti,timer-alwon;
	};
};

/* Preferred always-on timer for clocksource */
&timer12_target {
	ti,no-reset-on-init;
	ti,no-idle;
	timer@0 {
		/* Always clocked by secure_32k_fck */
	};
};

/* Preferred timer for clockevent */
&timer2_target {
	ti,no-reset-on-init;
	ti,no-idle;
	timer@0 {
		assigned-clocks = <&gpt2_fck>;
		assigned-clock-parents = <&sys_ck>;
	};
};

&twl_gpio {
	ti,use-leds;
	/* pullups: BIT(1) */
+33 −0
Original line number Diff line number Diff line
@@ -14,3 +14,36 @@
		display2 = &tv0;
	};
};

/* Unusable as clocksource because of unreliable oscillator */
&counter32k {
	status = "disabled";
};

/* Unusable as clockevent because if unreliable oscillator, allow to idle */
&timer1_target {
	/delete-property/ti,no-reset-on-init;
	/delete-property/ti,no-idle;
	timer@0 {
		/delete-property/ti,timer-alwon;
	};
};

/* Preferred always-on timer for clocksource */
&timer12_target {
	ti,no-reset-on-init;
	ti,no-idle;
	timer@0 {
		/* Always clocked by secure_32k_fck */
	};
};

/* Preferred timer for clockevent */
&timer2_target {
	ti,no-reset-on-init;
	ti,no-idle;
	timer@0 {
		assigned-clocks = <&gpt2_fck>;
		assigned-clock-parents = <&sys_ck>;
	};
};
+111 −23
Original line number Diff line number Diff line
@@ -193,10 +193,23 @@
			};
		};

		counter32k: counter@48320000 {
		target-module@48320000 {
			compatible = "ti,sysc-omap2", "ti,sysc";
			reg = <0x48320000 0x4>,
			      <0x48320004 0x4>;
			reg-names = "rev", "sysc";
			ti,sysc-sidle = <SYSC_IDLE_FORCE>,
					<SYSC_IDLE_NO>;
			clocks = <&wkup_32k_fck>, <&omap_32ksync_ick>;
			clock-names = "fck", "ick";
			#address-cells = <1>;
			#size-cells = <1>;
			ranges = <0x0 0x48320000 0x1000>;

			counter32k: counter@0 {
				compatible = "ti,omap-counter32k";
			reg = <0x48320000 0x20>;
			ti,hwmods = "counter_32k";
				reg = <0x0 0x20>;
			};
		};

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

		timer1: timer@48318000 {
		timer1_target: target-module@48318000 {
			compatible = "ti,sysc-omap2-timer", "ti,sysc";
			reg = <0x48318000 0x4>,
			      <0x48318010 0x4>,
			      <0x48318014 0x4>;
			reg-names = "rev", "sysc", "syss";
			ti,sysc-mask = <(SYSC_OMAP2_CLOCKACTIVITY |
					 SYSC_OMAP2_EMUFREE |
					 SYSC_OMAP2_ENAWAKEUP |
					 SYSC_OMAP2_SOFTRESET |
					 SYSC_OMAP2_AUTOIDLE)>;
			ti,sysc-sidle = <SYSC_IDLE_FORCE>,
					<SYSC_IDLE_NO>,
					<SYSC_IDLE_SMART>;
			ti,syss-mask = <1>;
			clocks = <&gpt1_fck>, <&gpt1_ick>;
			clock-names = "fck", "ick";
			#address-cells = <1>;
			#size-cells = <1>;
			ranges = <0x0 0x48318000 0x1000>;

			timer1: timer@0 {
				compatible = "ti,omap3430-timer";
			reg = <0x48318000 0x400>;
				reg = <0x0 0x80>;
				clocks = <&gpt1_fck>;
				clock-names = "fck";
				interrupts = <37>;
			ti,hwmods = "timer1";
				ti,timer-alwon;
			};
		};

		timer2_target: target-module@49032000 {
			compatible = "ti,sysc-omap2-timer", "ti,sysc";
			reg = <0x49032000 0x4>,
			      <0x49032010 0x4>,
			      <0x49032014 0x4>;
			reg-names = "rev", "sysc", "syss";
			ti,sysc-mask = <(SYSC_OMAP2_CLOCKACTIVITY |
					 SYSC_OMAP2_EMUFREE |
					 SYSC_OMAP2_ENAWAKEUP |
					 SYSC_OMAP2_SOFTRESET |
					 SYSC_OMAP2_AUTOIDLE)>;
			ti,sysc-sidle = <SYSC_IDLE_FORCE>,
					<SYSC_IDLE_NO>,
					<SYSC_IDLE_SMART>;
			ti,syss-mask = <1>;
			clocks = <&gpt2_fck>, <&gpt2_ick>;
			clock-names = "fck", "ick";
			#address-cells = <1>;
			#size-cells = <1>;
			ranges = <0x0 0x49032000 0x1000>;

		timer2: timer@49032000 {
			timer2: timer@0 {
				compatible = "ti,omap3430-timer";
			reg = <0x49032000 0x400>;
				reg = <0 0x400>;
				interrupts = <38>;
			ti,hwmods = "timer2";
			};
		};

		timer3: timer@49034000 {
@@ -723,14 +780,35 @@
			ti,timer-pwm;
		};

		timer12: timer@48304000 {
		timer12_target: target-module@48304000 {
			compatible = "ti,sysc-omap2-timer", "ti,sysc";
			reg = <0x48304000 0x4>,
			      <0x48304010 0x4>,
			      <0x48304014 0x4>;
			reg-names = "rev", "sysc", "syss";
			ti,sysc-mask = <(SYSC_OMAP2_CLOCKACTIVITY |
					 SYSC_OMAP2_EMUFREE |
					 SYSC_OMAP2_ENAWAKEUP |
					 SYSC_OMAP2_SOFTRESET |
					 SYSC_OMAP2_AUTOIDLE)>;
			ti,sysc-sidle = <SYSC_IDLE_FORCE>,
					<SYSC_IDLE_NO>,
					<SYSC_IDLE_SMART>;
			ti,syss-mask = <1>;
			clocks = <&gpt12_fck>, <&gpt12_ick>;
			clock-names = "fck", "ick";
			#address-cells = <1>;
			#size-cells = <1>;
			ranges = <0x0 0x48304000 0x1000>;

			timer12: timer@0 {
				compatible = "ti,omap3430-timer";
			reg = <0x48304000 0x400>;
				reg = <0 0x400>;
				interrupts = <95>;
			ti,hwmods = "timer12";
				ti,timer-alwon;
				ti,timer-secure;
			};
		};

		usbhstll: usbhstll@48062000 {
			compatible = "ti,usbhs-tll";
@@ -886,4 +964,14 @@
	};
};

/include/ "omap3xxx-clocks.dtsi"
#include "omap3xxx-clocks.dtsi"

/* Preferred always-on timer for clockevent. Some boards must use dmtimer12 */
&timer1_target {
	ti,no-reset-on-init;
	ti,no-idle;
	timer@0 {
		assigned-clocks = <&gpt1_fck>;
		assigned-clock-parents = <&omap_32k_fck>;
	};
};
+5 −5
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board")
	.init_early	= omap3430_init_early,
	.init_machine	= omap_generic_init,
	.init_late	= omap3_init_late,
	.init_time	= omap_init_time,
	.init_time	= omap_init_time_of,
	.dt_compat	= n900_boards_compat,
	.restart	= omap3xxx_restart,
MACHINE_END
@@ -132,7 +132,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
	.init_early	= omap3430_init_early,
	.init_machine	= omap_generic_init,
	.init_late	= omap3_init_late,
	.init_time	= omap_init_time,
	.init_time	= omap_init_time_of,
	.dt_compat	= omap3_boards_compat,
	.restart	= omap3xxx_restart,
MACHINE_END
@@ -149,7 +149,7 @@ DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
	.init_early	= omap3630_init_early,
	.init_machine	= omap_generic_init,
	.init_late	= omap3_init_late,
	.init_time	= omap_init_time,
	.init_time	= omap_init_time_of,
	.dt_compat	= omap36xx_boards_compat,
	.restart	= omap3xxx_restart,
MACHINE_END
@@ -166,7 +166,7 @@ DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
	.init_early	= omap3430_init_early,
	.init_machine	= omap_generic_init,
	.init_late	= omap3_init_late,
	.init_time	= omap3_secure_sync32k_timer_init,
	.init_time	= omap_init_time_of,
	.dt_compat	= omap3_gp_boards_compat,
	.restart	= omap3xxx_restart,
MACHINE_END
@@ -182,7 +182,7 @@ DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)")
	.init_early	= am35xx_init_early,
	.init_machine	= omap_generic_init,
	.init_late	= omap3_init_late,
	.init_time	= omap3_gptimer_timer_init,
	.init_time	= omap_init_time_of,
	.dt_compat	= am3517_boards_compat,
	.restart	= omap3xxx_restart,
MACHINE_END
Loading