Update omaps to use drivers/clocksource timers
Subsystems (8)
Tony Lindgren
maintainerv2 cover Update omaps to use drivers/clocksource timers
Hi all,
Here's v2 series to udpate omaps to use drivers/clocksource timers for the 32k counter and dmtimer, and to remove the old legacy platform code. Please review and test.
I've updated the timer-ti-dm-systimer.c patch based on the comments from Daniel, and also updated the dts files accordingly.
Then for merging when folks are happy with this series, Daniel if you can please apply the first three patches into an immutable branch it would be great.
Regards,
Tony
Tony Lindgren (15):
clocksource/drivers/timer-ti-32k: Add support for initializing
directly
dt-bindings: timer: add ti,dmtimer compatible for for system timers clocksource/drivers/timer-ti-dm: Add clockevent and clocksource
support
clk: ti: dm816: enable sysclk6_ck on init
bus: ti-sysc: Ignore timer12 on secure omap3
ARM: OMAP2+: Add omap_init_time_of()
ARM: dts: Configure system timers for am335x
ARM: dts: Configure system timers for am437x
ARM: dts: Configure system timers for omap4
ARM: dts: Configure system timers for omap5 and dra7
ARM: dts: Configure system timers for omap3
ARM: dts: Configure system timers for ti81xx
ARM: dts: Configure system timers for omap2
ARM: OMAP2+: Drop old timer code for dmtimer and 32k counter
bus: ti-sysc: Timers no longer need legacy quirk handling
.../devicetree/bindings/timer/ti,timer.txt | 1 + arch/arm/boot/dts/am33xx-l4.dtsi | 6 +- arch/arm/boot/dts/am33xx.dtsi | 24 + arch/arm/boot/dts/am3517.dtsi | 28 +- arch/arm/boot/dts/am4372.dtsi | 24 + arch/arm/boot/dts/am437x-l4.dtsi | 7 +- arch/arm/boot/dts/dm814x.dtsi | 78 ++- arch/arm/boot/dts/dm816x.dtsi | 82 ++- arch/arm/boot/dts/dra7-l4.dtsi | 7 +- arch/arm/boot/dts/dra7.dtsi | 11 + arch/arm/boot/dts/omap2.dtsi | 31 +- arch/arm/boot/dts/omap2420.dtsi | 69 ++- arch/arm/boot/dts/omap2430.dtsi | 69 ++- arch/arm/boot/dts/omap3-beagle.dts | 33 + arch/arm/boot/dts/omap3-devkit8000.dts | 33 + arch/arm/boot/dts/omap3.dtsi | 135 ++++- arch/arm/boot/dts/omap4-l4.dtsi | 4 +- arch/arm/boot/dts/omap4.dtsi | 11 + arch/arm/boot/dts/omap5-l4.dtsi | 4 +- arch/arm/boot/dts/omap5.dtsi | 11 + arch/arm/mach-omap2/Makefile | 4 +- arch/arm/mach-omap2/board-generic.c | 32 +- arch/arm/mach-omap2/common.h | 7 + arch/arm/mach-omap2/omap_hwmod_2420_data.c | 20 - arch/arm/mach-omap2/omap_hwmod_2430_data.c | 19 - .../omap_hwmod_2xxx_interconnect_data.c | 8 - .../mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 47 -- .../omap_hwmod_33xx_43xx_common_data.h | 2 - .../omap_hwmod_33xx_43xx_interconnect_data.c | 8 - .../omap_hwmod_33xx_43xx_ipblock_data.c | 62 -- arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 10 - arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 146 +---- arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 45 -- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 90 --- arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 89 --- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 176 ------ arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 74 --- arch/arm/mach-omap2/omap_hwmod_common_data.h | 3 - arch/arm/mach-omap2/timer.c | 568 +----------------- drivers/bus/ti-sysc.c | 25 +- drivers/clk/ti/clk-816x.c | 1 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-ti-32k.c | 48 +- drivers/clocksource/timer-ti-dm-systimer.c | 511 ++++++++++++++++ 44 files changed, 1179 insertions(+), 1485 deletions(-) create mode 100644 drivers/clocksource/timer-ti-dm-systimer.c
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 1/15 clocksource/drivers/timer-ti-32k: Add support for initializing directly
Let's allow probing the 32k counter directly based on devicetree data to prepare for dropping the related legacy platform code. Let's only do this if the parent node is compatible with ti-sysc to make sure we have the related devicetree data available.
Let's also show the 32k counter information before registering the clocksource, now we see it after the clocksource information which is a bit confusing.
--- drivers/clocksource/timer-ti-32k.c | 48 +++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-)
drivers/clocksource/timer-ti-32k.c +47 -1
@@ -24,6 +24,7 @@* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com */ +#include <linux/clk.h> #include <linux/init.h> #include <linux/time.h> #include <linux/sched_clock.h>
@@ -76,6 +77,49 @@ static u64 notrace omap_32k_read_sched_clock(void)return ti_32k_read_cycles (&ti_32k_timer.cs); } +static void __init ti_32k_timer_enable_clock (struct device_node *np, +const char *name) +{ +struct clk *clock; +int error; + + clock =of_clk_get_by_name (np->parent, name); +if (IS_ERR (clock)) { +/* Only some SoCs have a separate interface clock */ +if (PTR_ERR (clock) == -EINVAL && !strncmp ("ick" , name,3 )) +return ; + +pr_warn ("%s: could not get clock %s %li\n" , + __func__, name,PTR_ERR (clock)); +return ; + } + + error =clk_prepare_enable (clock); +if (error) { +pr_warn ("%s: could not enable %s: %i\n" , + __func__, name, error); +return ; + } +} + +static void __init ti_32k_timer_module_init (struct device_node *np, +void __iomem *base) +{ +void __iomem *sysc = base +4 ; + +if (!of_device_is_compatible (np->parent,"ti,sysc" )) +return ; + +ti_32k_timer_enable_clock (np,"fck" ); +ti_32k_timer_enable_clock (np,"ick" ); + +/* +* Force idle module as wkup domain is active with MPU. +* No need to tag the module disabled for ti-sysc probe. +*/ +writel_relaxed (0 , sysc); +} +static int __init ti_32k_timer_init (struct device_node *np) {int ret;
@@ -90,6 +134,7 @@ static int __init ti_32k_timer_init(struct device_node *np) ti_32k_timer.cs.flags |=CLOCK_SOURCE_SUSPEND_NONSTOP ; ti_32k_timer.counter = ti_32k_timer.base; +ti_32k_timer_module_init (np, ti_32k_timer.base);/* * 32k sync Counter IP register offsets vary between the highlander
@@ -104,6 +149,8 @@ static int __init ti_32k_timer_init(struct device_node *np)else ti_32k_timer.counter +=OMAP2_32KSYNCNT_CR_OFF_LOW ; +pr_info ("OMAP clocksource: 32k_counter at 32768 Hz\n" ); + ret =clocksource_register_hz (&ti_32k_timer.cs,32768 );if (ret) {pr_err ("32k_counter: can't register clocksource\n" );
@@ -111,7 +158,6 @@ static int __init ti_32k_timer_init(struct device_node *np) }sched_clock_register (omap_32k_read_sched_clock,32 ,32768 ); -pr_info ("OMAP clocksource: 32k_counter at 32768 Hz\n" );return 0 ; }
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 2/15 dt-bindings: timer: add ti,dmtimer compatible for for system timers
In reply to Tony LindgrenThe TI dual-mode timer can be used for both clocksource and clockevent system timers. We need a way to specify which dual-mode timers are reserved for system timers as there are multiple instances available that may require a board specific configuration.
Let's add a generic compatible "ti,dmtimer" that TIMER_OF_DECLARE can use as suggested by Daniel Lezcano <[email protected]>.
--- Documentation/devicetree/bindings/timer/ti,timer.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/timer/ti,timer.txt +1 -0
@@ -14,6 +14,7 @@ Required properties: ti,omap5430-timer (applicable to OMAP543x devices) ti,am335x-timer (applicable to AM335x devices) ti,am335x-timer-1ms (applicable to AM335x devices) + ti,dmtimer (applicable to system timers) - reg: Contains timer register address range (base address and length).
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 4/15 clk: ti: dm816: enable sysclk6_ck on init
In reply to Tony LindgrenWe need sysclk6_ck enabled early as it is needed by l4_ls and system timers early on boot. This removes the dependency of system timers to the interconnect related code that can be then probed later on when suitable at module_init time.
--- drivers/clk/ti/clk-816x.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/ti/clk-816x.c +1 -0
@@ -73,6 +73,7 @@ static const char *enable_init_clks[] = {"ddr_pll_clk1" ,"ddr_pll_clk2" ,"ddr_pll_clk3" , + "sysclk6_ck", };int __init dm816x_dt_clk_init (void )
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 3/15 clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support
In reply to Tony LindgrenWe can move the TI dmtimer clockevent and clocksource to live under drivers/clocksource if we rely only on the clock framework, and handle the module configuration directly in the clocksource driver based on the device tree data.
This removes the early dependency with system timers to the interconnect related code, and we can probe pretty much everything else later on at the module_init level.
Let's first add a new driver for timer-ti-dm-systimer based on existing arch/arm/mach-omap2/timer.c. Then let's start moving SoCs to probe with device tree data while still keeping the old timer.c. And eventually we can just drop the old timer.c.
Let's take the opportunity to switch to use readl/writel as pointed out by Daniel Lezcano <[email protected]>. This allows further clean-up of the timer-ti-dm code the a lot of the shared helpers can just become static to the non-syster related code.
Note the boards can optionally configure the timer source clock in using assigned-clock-parents.
--- drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-ti-dm-systimer.c | 511 +++++++++++++++++++++ 2 files changed, 512 insertions(+) create mode 100644 drivers/clocksource/timer-ti-dm-systimer.c
drivers/clocksource/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_CLKSRC_MMIO) += mmio.o obj-$(CONFIG_DAVINCI_TIMER) += timer-davinci.o obj-$(CONFIG_DIGICOLOR_TIMER) += timer-digicolor.o obj-$(CONFIG_OMAP_DM_TIMER) += timer-ti-dm.o +obj-$(CONFIG_OMAP_DM_TIMER) += timer-ti-dm-systimer.o obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o obj-$(CONFIG_FTTMR010_TIMER) += timer-fttmr010.o
drivers/clocksource/timer-ti-dm-systimer.c new file +511 -0
511 lines not on this page · raw message
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 5/15 bus: ti-sysc: Ignore timer12 on secure omap3
In reply to Tony LindgrenSome early omap3 boards use timer12 for system timer, but for secure SoCs like on n900 it's not accessible. Likely we will be configuring unavailable devices for other SoCs too based on runtime SoC detection, so let's use a switch to start with.
--- drivers/bus/ti-sysc.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/bus/ti-sysc.c +11 -0
@@ -2744,6 +2744,17 @@ static int sysc_init_soc(struct sysc *ddata)if (match && match->data) sysc_soc->soc = (int )match->data; +/* Ignore devices that are not available on HS and EMU SoCs */ +if (!sysc_soc->general_purpose) { +switch (sysc_soc->soc) { + case SOC_3430 ... SOC_3630: +sysc_add_disabled (0x48304000 );/* timer12 */ +break ; +default : +break ; + }; + } + match =soc_device_match (sysc_soc_feat_match);if (!match)return 0 ;
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 7/15 ARM: dts: Configure system timers for am335x
In reply to Tony LindgrenWe 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.
--- arch/arm/boot/dts/am33xx-l4.dtsi | 6 ++--- arch/arm/boot/dts/am33xx.dtsi | 24 +++++++++++++++++++ arch/arm/mach-omap2/board-generic.c | 2 +- .../omap_hwmod_33xx_43xx_ipblock_data.c | 2 -- arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 10 -------- 5 files changed, 27 insertions(+), 17 deletions(-)
arch/arm/boot/dts/am33xx-l4.dtsi +2 -4
@@ -330,9 +330,8 @@ scm_clockdomains: clockdomains { }; }; - target-module@31000 { /* 0x44e31000, ap 25 40.0 */ + timer1_target: target-module@31000 { /* 0x44e31000, ap 25 40.0 */ compatible = "ti,sysc-omap2-timer", "ti,sysc"; - ti,hwmods = "timer1"; reg = <0x31000 0x4>, <0x31010 0x4>, <0x31014 0x4>;
@@ -1117,9 +1116,8 @@ mcasp1: mcasp@0 { }; }; - target-module@40000 { /* 0x48040000, ap 22 1e.0 */ + timer2_target: target-module@40000 { /* 0x48040000, ap 22 1e.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer2"; reg = <0x40000 0x4>, <0x40010 0x4>, <0x40014 0x4>;
arch/arm/boot/dts/am33xx.dtsi +24 -0
@@ -619,3 +619,27 @@ prm_gfx: prm@1100 { #reset-cells = <1>; }; }; + +/* Timer for clocksource, configured without interrupts */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + /delete-property/interrupts; + /delete-property/interrupts-extended; + assigned-clocks = <&timer1_fck>; + assigned-clock-parents = <&sys_clkin_ck>; + }; +}; + +/* Timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&timer2_fck>; + assigned-clock-parents = <&sys_clkin_ck>; + }; +};
arch/arm/mach-omap2/board-generic.c +1 -1
@@ -236,7 +236,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)") .init_early = am33xx_init_early, .init_machine = omap_generic_init, .init_late = am33xx_init_late, - .init_time = omap3_gptimer_timer_init, + .init_time = omap_init_time_of, .dt_compat = am33xx_boards_compat, .restart = am33xx_restart,MACHINE_END
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c +0 -2
@@ -367,12 +367,10 @@ struct omap_hwmod am33xx_timer2_hwmod = {static void omap_hwmod_am33xx_clkctrl (void ) { -CLKCTRL (am33xx_timer2_hwmod,AM33XX_CM_PER_TIMER2_CLKCTRL_OFFSET );CLKCTRL (am33xx_smartreflex0_hwmod,AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET );CLKCTRL (am33xx_smartreflex1_hwmod,AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET ); -CLKCTRL (am33xx_timer1_hwmod,AM33XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET );CLKCTRL (am33xx_rtc_hwmod,AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET );PRCM_FLAGS (am33xx_rtc_hwmod,HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET );CLKCTRL (am33xx_gpmc_hwmod,AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET );
arch/arm/mach-omap2/omap_hwmod_33xx_data.c +0 -10
@@ -265,14 +265,6 @@ static struct omap_hwmod_ocp_if am33xx_l4_wkup__control = { .user = OCP_USER_MPU, }; -/* l4 wkup -> timer1 */ -static struct omap_hwmod_ocp_if am33xx_l4_wkup__timer1 = { - .master = &am33xx_l4_wkup_hwmod, - .slave = &am33xx_timer1_hwmod, - .clk ="dpll_core_m4_div2_ck" , - .user =OCP_USER_MPU , -}; -static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[]__initdata = { &am33xx_l3_main__emif, &am33xx_mpu__l3_main,
@@ -291,9 +283,7 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { &am33xx_l4_wkup__control, &am33xx_l4_wkup__smartreflex0, &am33xx_l4_wkup__smartreflex1, - &am33xx_l4_wkup__timer1, &am33xx_l4_wkup__rtc, - &am33xx_l4_ls__timer2, &am33xx_l3_s__gpmc, &am33xx_l3_main__ocmc, NULL,
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 8/15 ARM: dts: Configure system timers for am437x
In reply to Tony LindgrenWe 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.
--- arch/arm/boot/dts/am4372.dtsi | 24 ++++++++ arch/arm/boot/dts/am437x-l4.dtsi | 7 +-- arch/arm/mach-omap2/board-generic.c | 2 +- .../omap_hwmod_33xx_43xx_common_data.h | 2 - .../omap_hwmod_33xx_43xx_interconnect_data.c | 8 --- .../omap_hwmod_33xx_43xx_ipblock_data.c | 60 ------------------- arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 45 -------------- 7 files changed, 27 insertions(+), 121 deletions(-)
arch/arm/boot/dts/am4372.dtsi +24 -0
@@ -553,3 +553,27 @@ prm_device: prm@4000 { #reset-cells = <1>; }; }; + +/* Timer for clocksource, configured without interrupts */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + /delete-property/interrupts; + /delete-property/interrupts-extended; + assigned-clocks = <&timer1_fck>; + assigned-clock-parents = <&sys_clkin_ck>; + }; +}; + +/* Timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&timer2_fck>; + assigned-clock-parents = <&sys_clkin_ck>; + }; +};
arch/arm/boot/dts/am437x-l4.dtsi +2 -5
@@ -328,9 +328,8 @@ scm_clockdomains: clockdomains { }; }; - target-module@31000 { /* 0x44e31000, ap 24 40.0 */ + timer1_target: target-module@31000 { /* 0x44e31000, ap 24 40.0 */ compatible = "ti,sysc-omap2-timer", "ti,sysc"; - ti,hwmods = "timer1"; reg = <0x31000 0x4>, <0x31010 0x4>, <0x31014 0x4>;
@@ -450,7 +449,6 @@ target-module@40000 { /* 0x44e40000, ap 36 68.0 */ target-module@86000 { /* 0x44e86000, ap 40 70.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "counter_32k"; reg = <0x86000 0x4>, <0x86004 0x4>; reg-names = "rev", "sysc";
@@ -868,9 +866,8 @@ mcasp1: mcasp@0 { }; }; - target-module@40000 { /* 0x48040000, ap 18 1e.0 */ + timer2_target: target-module@40000 { /* 0x48040000, ap 18 1e.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer2"; reg = <0x40000 0x4>, <0x40010 0x4>, <0x40014 0x4>;
arch/arm/mach-omap2/board-generic.c +1 -1
@@ -308,7 +308,7 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)") .init_late = am43xx_init_late, .init_irq = omap_gic_of_init, .init_machine = omap_generic_init, - .init_time = omap3_gptimer_timer_init, + .init_time = omap_init_time_of, .dt_compat = am43_boards_compat, .restart = omap44xx_restart,MACHINE_END
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h +0 -2
@@ -44,8 +44,6 @@ extern struct omap_hwmod am33xx_smartreflex0_hwmod;extern struct omap_hwmod am33xx_smartreflex1_hwmod;extern struct omap_hwmod am33xx_gpmc_hwmod;extern struct omap_hwmod am33xx_rtc_hwmod; -extern struct omap_hwmod am33xx_timer1_hwmod; -extern struct omap_hwmod am33xx_timer2_hwmod;extern struct omap_hwmod_class am33xx_emif_hwmod_class;extern struct omap_hwmod_class am33xx_l4_hwmod_class;
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c +0 -8
@@ -106,14 +106,6 @@ struct omap_hwmod_ocp_if am33xx_l3_s__gpmc = { .user = OCP_USER_MPU, }; -/* l4 per -> timer2 */ -struct omap_hwmod_ocp_if am33xx_l4_ls__timer2 = { - .master = &am33xx_l4_ls_hwmod, - .slave = &am33xx_timer2_hwmod, - .clk ="l4ls_gclk" , - .user =OCP_USER_MPU , -}; -/* l3 main -> ocmc */ struct omap_hwmod_ocp_if am33xx_l3_main__ocmc = { .master = &am33xx_l3_main_hwmod,
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c +0 -60
76 lines not on this page · raw message
arch/arm/mach-omap2/omap_hwmod_43xx_data.c +0 -45
69 lines not on this page · raw message
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 9/15 ARM: dts: Configure system timers for omap4
In reply to Tony LindgrenWe 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.
--- arch/arm/boot/dts/omap4-l4.dtsi | 4 +- arch/arm/boot/dts/omap4.dtsi | 11 +++ arch/arm/mach-omap2/board-generic.c | 2 +- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 90 ---------------------- 4 files changed, 13 insertions(+), 94 deletions(-)
arch/arm/boot/dts/omap4-l4.dtsi +1 -3
@@ -974,7 +974,6 @@ segment@0 { /* 0x4a300000 */ target-module@4000 { /* 0x4a304000, ap 17 24.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "counter_32k"; reg = <0x4000 0x4>, <0x4004 0x4>; reg-names = "rev", "sysc";
@@ -1139,9 +1138,8 @@ wdt2: wdt@0 { }; }; - target-module@8000 { /* 0x4a318000, ap 9 1c.0 */ + timer1_target: target-module@8000 { /* 0x4a318000, ap 9 1c.0 */ compatible = "ti,sysc-omap2-timer", "ti,sysc"; - ti,hwmods = "timer1"; reg = <0x8000 0x4>, <0x8010 0x4>, <0x8014 0x4>;
arch/arm/boot/dts/omap4.dtsi +11 -0
@@ -655,3 +655,14 @@ prm_device: prm@1b00 { #reset-cells = <1>; }; }; + +/* Timer for clockevent */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&l4_wkup_clkctrl OMAP4_TIMER1_CLKCTRL 24>; + assigned-clock-parents = <&sys_clkin_ck>; + }; +};
arch/arm/mach-omap2/board-generic.c +1 -1
@@ -261,7 +261,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") .init_irq = omap_gic_of_init, .init_machine = omap_generic_init, .init_late = omap4430_init_late, - .init_time = omap4_local_timer_init, + .init_time = omap_init_time_of, .dt_compat = omap4_boards_compat, .restart = omap44xx_restart,MACHINE_END
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -90
126 lines not on this page · raw message
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 10/15 ARM: dts: Configure system timers for omap5 and dra7
In reply to Tony LindgrenWe 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.
Note that similar to omap_init_time_of(), we now need to call omap_clk_init() also from omap5_realtime_timer_init().
--- arch/arm/boot/dts/dra7-l4.dtsi | 7 +- arch/arm/boot/dts/dra7.dtsi | 11 ++ arch/arm/boot/dts/omap5-l4.dtsi | 4 +- arch/arm/boot/dts/omap5.dtsi | 11 ++ arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 89 ----------- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 176 --------------------- arch/arm/mach-omap2/timer.c | 17 +- 7 files changed, 25 insertions(+), 290 deletions(-)
arch/arm/boot/dts/dra7-l4.dtsi +1 -6
@@ -1143,7 +1143,6 @@ uart3: serial@0 { target-module@32000 { /* 0x48032000, ap 5 3e.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer2"; reg = <0x32000 0x4>, <0x32010 0x4>; reg-names = "rev", "sysc";
@@ -1171,7 +1170,6 @@ timer2: timer@0 { target-module@34000 { /* 0x48034000, ap 7 46.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer3"; reg = <0x34000 0x4>, <0x34010 0x4>; reg-names = "rev", "sysc";
@@ -1199,7 +1197,6 @@ timer3: timer@0 { target-module@36000 { /* 0x48036000, ap 9 4e.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer4"; reg = <0x36000 0x4>, <0x36010 0x4>; reg-names = "rev", "sysc";
@@ -4295,7 +4292,6 @@ segment@0 { /* 0x4ae00000 */ target-module@4000 { /* 0x4ae04000, ap 15 40.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "counter_32k"; reg = <0x4000 0x4>, <0x4010 0x4>; reg-names = "rev", "sysc";
@@ -4430,9 +4426,8 @@ wdt2: wdt@0 { }; }; - target-module@8000 { /* 0x4ae18000, ap 9 30.0 */ + timer1_target: target-module@8000 { /* 0x4ae18000, ap 9 30.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer1"; reg = <0x8000 0x4>, <0x8010 0x4>; reg-names = "rev", "sysc";
arch/arm/boot/dts/dra7.dtsi +11 -0
@@ -1044,3 +1044,14 @@ prm_eve4: prm@1c00 { reg = <0x1c00 0x60>; }; }; + +/* Timer for clockevent */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&wkupaon_clkctrl DRA7_TIMER1_CLKCTRL 24>; + assigned-clock-parents = <&sys_32k_ck>; + }; +};
arch/arm/boot/dts/omap5-l4.dtsi +1 -3
@@ -2150,7 +2150,6 @@ segment@0 { /* 0x4ae00000 */ target-module@4000 { /* 0x4ae04000, ap 17 20.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "counter_32k"; reg = <0x4000 0x4>, <0x4010 0x4>; reg-names = "rev", "sysc";
@@ -2336,9 +2335,8 @@ wdt2: wdt@0 { }; }; - target-module@8000 { /* 0x4ae18000, ap 9 18.0 */ + timer1_target: target-module@8000 { /* 0x4ae18000, ap 9 18.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer1"; reg = <0x8000 0x4>, <0x8010 0x4>; reg-names = "rev", "sysc";
arch/arm/boot/dts/omap5.dtsi +11 -0
@@ -581,3 +581,14 @@ prm_device: prm@1c00 { #reset-cells = <1>; }; }; + +/* Timer for clockevent */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&wkupaon_clkctrl OMAP5_TIMER1_CLKCTRL 24>; + assigned-clock-parents = <&sys_32k_ck>; + }; +};
arch/arm/mach-omap2/omap_hwmod_54xx_data.c +0 -89
122 lines not on this page · raw message
arch/arm/mach-omap2/omap_hwmod_7xx_data.c +0 -176
212 lines not on this page · raw message
arch/arm/mach-omap2/timer.c +1 -16
@@ -576,21 +576,6 @@ void __init omap3_gptimer_timer_init(void) }#endif -#if defined(CONFIG_ARCH_OMAP4 ) || defined(CONFIG_SOC_OMAP5 ) || \ - defined(CONFIG_SOC_DRA7XX ) -static void __init omap4_sync32k_timer_init (void ) -{ -__omap_sync32k_timer_init (1 ,"timer_32k_ck" ,"ti,timer-alwon" , -0 ,NULL ,NULL , false); -} - -void __init omap4_local_timer_init (void ) -{ -omap4_sync32k_timer_init (); -timer_probe (); -} -#endif -#if defined(CONFIG_SOC_OMAP5 ) || defined(CONFIG_SOC_DRA7XX )/*
@@ -708,7 +693,7 @@ static void __init realtime_counter_init(void)void __init omap5_realtime_timer_init (void ) { -omap4_sync32k_timer_init (); +omap_clk_init ();realtime_counter_init ();timer_probe ();
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 12/15 ARM: dts: Configure system timers for ti81xx
In reply to Tony LindgrenWe 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.
Note that for ti81xx, also timer1 is of type 2 unlike on am335x where timer1 is type1 while the rest of the timers are type 2.
--- arch/arm/boot/dts/dm814x.dtsi | 78 +++++++++++++++++--- arch/arm/boot/dts/dm816x.dtsi | 82 ++++++++++++++++++---- arch/arm/mach-omap2/board-generic.c | 4 +- arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 74 ------------------- 4 files changed, 138 insertions(+), 100 deletions(-)
arch/arm/boot/dts/dm814x.dtsi +67 -11
@@ -308,14 +308,30 @@ mcspi4: spi@1a4000 { ti,hwmods = "mcspi4"; }; - timer1: timer@2e000 { - compatible = "ti,dm814-timer"; - reg = <0x2e000 0x2000>; - interrupts = <67>; - ti,hwmods = "timer1"; - ti,timer-alwon; + timer1_target: target-module@2e000 { + compatible = "ti,sysc-omap4-timer", "ti,sysc"; + reg = <0x2e000 0x4>, + <0x2e010 0x4>; + reg-names = "rev", "sysc"; + ti,sysc-mask = <SYSC_OMAP4_SOFTRESET>; + ti,sysc-sidle = <SYSC_IDLE_FORCE>, + <SYSC_IDLE_NO>, + <SYSC_IDLE_SMART>, + <SYSC_IDLE_SMART_WKUP>; clocks = <&timer1_fck>; clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2e000 0x1000>; + + timer1: timer@0 { + compatible = "ti,am335x-timer-1ms"; + reg = <0x0 0x400>; + interrupts = <67>; + ti,timer-alwon; + clocks = <&timer1_fck>; + clock-names = "fck"; + }; }; uart1: uart@20000 {
@@ -348,13 +364,29 @@ uart3: uart@24000 { dma-names = "tx", "rx"; }; - timer2: timer@40000 { - compatible = "ti,dm814-timer"; - reg = <0x40000 0x2000>; - interrupts = <68>; - ti,hwmods = "timer2"; + timer2_target: target-module@40000 { + compatible = "ti,sysc-omap4-timer", "ti,sysc"; + reg = <0x40000 0x4>, + <0x40010 0x4>; + reg-names = "rev", "sysc"; + ti,sysc-mask = <SYSC_OMAP4_SOFTRESET>; + ti,sysc-sidle = <SYSC_IDLE_FORCE>, + <SYSC_IDLE_NO>, + <SYSC_IDLE_SMART>, + <SYSC_IDLE_SMART_WKUP>; clocks = <&timer2_fck>; clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x40000 0x1000>; + + timer2: timer@0 { + compatible = "ti,dm814-timer"; + reg = <0 0x1000>; + interrupts = <68>; + clocks = <&timer2_fck>; + clock-names = "fck"; + }; }; timer3: timer@42000 {
@@ -735,3 +767,27 @@ gpmc: gpmc@50000000 { }; #include "dm814x-clocks.dtsi" + +/* Timer for clocksource, configured without interrupts */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + /delete-property/interrupts; + /delete-property/interrupts-extended; + assigned-clocks = <&timer1_fck>; + assigned-clock-parents = <&devosc_ck>; + }; +}; + +/* Timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&timer2_fck>; + assigned-clock-parents = <&devosc_ck>; + }; +};
arch/arm/boot/dts/dm816x.dtsi +69 -13
95 lines not on this page · raw message
arch/arm/mach-omap2/board-generic.c +2 -2
@@ -201,7 +201,7 @@ DT_MACHINE_START(TI814X_DT, "Generic ti814x (Flattened Device Tree)") .init_early = ti814x_init_early, .init_machine = omap_generic_init, .init_late = ti81xx_init_late, - .init_time = omap3_gptimer_timer_init, + .init_time = omap_init_time_of, .dt_compat = ti814x_boards_compat, .restart = ti81xx_restart,MACHINE_END
@@ -218,7 +218,7 @@ DT_MACHINE_START(TI816X_DT, "Generic ti816x (Flattened Device Tree)") .init_early = ti816x_init_early, .init_machine = omap_generic_init, .init_late = ti81xx_init_late, - .init_time = omap3_gptimer_timer_init, + .init_time = omap_init_time_of, .dt_compat = ti816x_boards_compat, .restart = ti81xx_restart,MACHINE_END
arch/arm/mach-omap2/omap_hwmod_81xx_data.c +0 -74
92 lines not on this page · raw message
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 11/15 ARM: dts: Configure system timers for omap3
In reply to Tony LindgrenWe 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.
--- arch/arm/boot/dts/am3517.dtsi | 28 +++- arch/arm/boot/dts/omap3-beagle.dts | 33 +++++ arch/arm/boot/dts/omap3-devkit8000.dts | 33 +++++ arch/arm/boot/dts/omap3.dtsi | 135 +++++++++++++++---- arch/arm/mach-omap2/board-generic.c | 10 +- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 146 +-------------------- 6 files changed, 210 insertions(+), 175 deletions(-)
arch/arm/boot/dts/am3517.dtsi +26 -2
@@ -169,5 +169,29 @@ &mmu_isp { status = "disabled"; }; -/include/ "am35xx-clocks.dtsi" -/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" +#include "am35xx-clocks.dtsi" +#include "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" + +/* Timer for clocksource, configured without interrupts */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + /delete-property/interrupts; + /delete-property/interrupts-extended; + assigned-clocks = <&gpt1_fck>; + assigned-clock-parents = <&sys_ck>; + }; +}; + +/* Timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&gpt2_fck>; + assigned-clock-parents = <&sys_ck>; + }; +};
arch/arm/boot/dts/omap3-beagle.dts +33 -0
@@ -304,6 +304,39 @@ &usbhsehci { phys = <0 &hsusb2_phy>; }; +/* Unusable as clockevent, allow to idle */ +&timer1_target { + /delete-property/ti,no-reset-on-init; + /delete-property/ti,no-idle; + timer@0 { + compatible = "ti,omap3430-timer"; + interrupts = <37>; + }; +}; + +/* Timer for clocksource, configured without interrupts */ +&timer12_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + /delete-property/interrupts; + /delete-property/interrupts-extended; + /* Always clocked by secure_32k_fck */ + }; +}; + +/* Timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&gpt2_fck>; + assigned-clock-parents = <&sys_ck>; + }; +}; + &twl_gpio { ti,use-leds; /* pullups: BIT(1) */
arch/arm/boot/dts/omap3-devkit8000.dts +33 -0
@@ -14,3 +14,36 @@ aliases { display2 = &tv0; }; }; + +/* Unusable as clockevent, allow to idle */ +&timer1_target { + /delete-property/ti,no-reset-on-init; + /delete-property/ti,no-idle; + timer@0 { + compatible = "ti,omap3430-timer"; + interrupts = <37>; + }; +}; + +/* Timer for clocksource, configured without interrupts */ +&timer12_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + /delete-property/interrupts; + /delete-property/interrupts-extended; + /* Always clocked by secure_32k_fck */ + }; +}; + +/* Timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&gpt2_fck>; + assigned-clock-parents = <&sys_ck>; + }; +};
arch/arm/boot/dts/omap3.dtsi +112 -23
158 lines not on this page · raw message
arch/arm/mach-omap2/board-generic.c +5 -5
@@ -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
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -145
225 lines not on this page · raw message
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 13/15 ARM: dts: Configure system timers for omap2
In reply to Tony LindgrenWe 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.
--- arch/arm/boot/dts/omap2.dtsi | 31 +++++++-- arch/arm/boot/dts/omap2420.dtsi | 69 +++++++++++++++---- arch/arm/boot/dts/omap2430.dtsi | 69 +++++++++++++++---- arch/arm/mach-omap2/board-generic.c | 4 +- arch/arm/mach-omap2/omap_hwmod_2420_data.c | 20 ------ arch/arm/mach-omap2/omap_hwmod_2430_data.c | 19 ----- .../omap_hwmod_2xxx_interconnect_data.c | 8 --- .../mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 47 ------------- arch/arm/mach-omap2/omap_hwmod_common_data.h | 3 - 9 files changed, 142 insertions(+), 128 deletions(-)
arch/arm/boot/dts/omap2.dtsi +26 -5
@@ -201,11 +201,32 @@ uart3: serial@4806e000 { clock-frequency = <48000000>; }; - timer2: timer@4802a000 { - compatible = "ti,omap2420-timer"; - reg = <0x4802a000 0x400>; - interrupts = <38>; - ti,hwmods = "timer2"; + timer2_target: target-module@4802a000 { + compatible = "ti,sysc-omap2-timer", "ti,sysc"; + reg = <0x4802a000 0x4>, + <0x4802a010 0x4>, + <0x4802a014 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 0x4802a000 0x1000>; + + timer2: timer@0 { + compatible = "ti,omap2420-timer"; + reg = <0 0x400>; + interrupts = <38>; + }; }; timer3: timer@48078000 {
arch/arm/boot/dts/omap2420.dtsi +57 -12
84 lines not on this page · raw message
arch/arm/boot/dts/omap2430.dtsi +57 -12
84 lines not on this page · raw message
arch/arm/mach-omap2/board-generic.c +2 -2
@@ -50,7 +50,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)") .map_io = omap242x_map_io, .init_early = omap2420_init_early, .init_machine = omap_generic_init, - .init_time = omap_init_time, + .init_time = omap_init_time_of, .dt_compat = omap242x_boards_compat, .restart = omap2xxx_restart,MACHINE_END
@@ -67,7 +67,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)") .map_io = omap243x_map_io, .init_early = omap2430_init_early, .init_machine = omap_generic_init, - .init_time = omap_init_time, + .init_time = omap_init_time_of, .dt_compat = omap243x_boards_compat, .restart = omap2xxx_restart,MACHINE_END
arch/arm/mach-omap2/omap_hwmod_2420_data.c +0 -20
@@ -264,14 +264,6 @@ static struct omap_hwmod_ocp_if omap2420_l3__dsp = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; -/* l4_wkup -> timer1 */ -static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = { - .master = &omap2xxx_l4_wkup_hwmod, - .slave = &omap2xxx_timer1_hwmod, - .clk ="gpt1_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; -/* l4_wkup -> wd_timer2 */ static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = { .master = &omap2xxx_l4_wkup_hwmod,
@@ -352,15 +344,6 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__hdq1w = { .flags = OMAP_FIREWALL_L4 | OCPIF_SWSUP_IDLE, }; - -/* l4_wkup -> 32ksync_counter */ -static struct omap_hwmod_ocp_if omap2420_l4_wkup__counter_32k = { - .master = &omap2xxx_l4_wkup_hwmod, - .slave = &omap2xxx_counter_32k_hwmod, - .clk ="sync_32k_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; -static struct omap_hwmod_ocp_if omap2420_l3__gpmc = { .master = &omap2xxx_l3_main_hwmod, .slave = &omap2xxx_gpmc_hwmod,
@@ -382,8 +365,6 @@ static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = { &omap2420_l4_core__i2c2, &omap2420_l3__iva, &omap2420_l3__dsp, - &omap2420_l4_wkup__timer1, - &omap2xxx_l4_core__timer2, &omap2xxx_l4_core__timer3, &omap2xxx_l4_core__timer4, &omap2xxx_l4_core__timer5,
@@ -411,7 +392,6 @@ static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = { &omap2xxx_l4_core__sham, &omap2xxx_l4_core__aes, &omap2420_l4_core__hdq1w, - &omap2420_l4_wkup__counter_32k, &omap2420_l3__gpmc, NULL, };
arch/arm/mach-omap2/omap_hwmod_2430_data.c +0 -19
@@ -436,14 +436,6 @@ static struct omap_hwmod_ocp_if omap2430_l3__iva = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; -/* l4_wkup -> timer1 */ -static struct omap_hwmod_ocp_if omap2430_l4_wkup__timer1 = { - .master = &omap2xxx_l4_wkup_hwmod, - .slave = &omap2xxx_timer1_hwmod, - .clk ="gpt1_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; -/* l4_wkup -> wd_timer2 */ static struct omap_hwmod_ocp_if omap2430_l4_wkup__wd_timer2 = { .master = &omap2xxx_l4_wkup_hwmod,
@@ -548,14 +540,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__hdq1w = { .flags = OMAP_FIREWALL_L4 | OCPIF_SWSUP_IDLE, }; -/* l4_wkup -> 32ksync_counter */ -static struct omap_hwmod_ocp_if omap2430_l4_wkup__counter_32k = { - .master = &omap2xxx_l4_wkup_hwmod, - .slave = &omap2xxx_counter_32k_hwmod, - .clk ="sync_32k_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; -static struct omap_hwmod_ocp_if omap2430_l3__gpmc = { .master = &omap2xxx_l3_main_hwmod, .slave = &omap2xxx_gpmc_hwmod,
@@ -581,8 +565,6 @@ static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = { &omap2xxx_l4_core__mcspi2, &omap2430_l4_core__mcspi3, &omap2430_l3__iva, - &omap2430_l4_wkup__timer1, - &omap2xxx_l4_core__timer2, &omap2xxx_l4_core__timer3, &omap2xxx_l4_core__timer4, &omap2xxx_l4_core__timer5,
@@ -613,7 +595,6 @@ static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = { &omap2xxx_l4_core__rng, &omap2xxx_l4_core__sham, &omap2xxx_l4_core__aes, - &omap2430_l4_wkup__counter_32k, &omap2430_l3__gpmc, NULL, };
arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c +0 -8
@@ -95,14 +95,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__mcspi2 = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; -/* l4_core -> timer2 */ -struct omap_hwmod_ocp_if omap2xxx_l4_core__timer2 = { - .master = &omap2xxx_l4_core_hwmod, - .slave = &omap2xxx_timer2_hwmod, - .clk ="gpt2_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; -/* l4_core -> timer3 */ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer3 = { .master = &omap2xxx_l4_core_hwmod,
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c +0 -47
59 lines not on this page · raw message
arch/arm/mach-omap2/omap_hwmod_common_data.h +0 -3
@@ -21,8 +21,6 @@ extern struct omap_hwmod omap2xxx_l4_core_hwmod;extern struct omap_hwmod omap2xxx_l4_wkup_hwmod;extern struct omap_hwmod omap2xxx_mpu_hwmod;extern struct omap_hwmod omap2xxx_iva_hwmod; -extern struct omap_hwmod omap2xxx_timer1_hwmod; -extern struct omap_hwmod omap2xxx_timer2_hwmod;extern struct omap_hwmod omap2xxx_timer3_hwmod;extern struct omap_hwmod omap2xxx_timer4_hwmod;extern struct omap_hwmod omap2xxx_timer5_hwmod;
@@ -47,7 +45,6 @@ extern struct omap_hwmod omap2xxx_gpio3_hwmod;extern struct omap_hwmod omap2xxx_gpio4_hwmod;extern struct omap_hwmod omap2xxx_mcspi1_hwmod;extern struct omap_hwmod omap2xxx_mcspi2_hwmod; -extern struct omap_hwmod omap2xxx_counter_32k_hwmod;extern struct omap_hwmod omap2xxx_gpmc_hwmod;extern struct omap_hwmod omap2xxx_rng_hwmod;extern struct omap_hwmod omap2xxx_sham_hwmod;
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 15/15 bus: ti-sysc: Timers no longer need legacy quirk handling
In reply to Tony LindgrenAs timers no longer need legacy quirk handling, let's move them to the CONFIG_DEBUG section to make it easier to see which drivers still need more work.
Let's also add detection for few more older timer revisions while at it as that makes CONFIG_DEBUG output easier to read with proper names.
--- drivers/bus/ti-sysc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/bus/ti-sysc.c +7 -7
@@ -1275,13 +1275,6 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { SYSC_QUIRK_LEGACY_IDLE),SYSC_QUIRK ("smartreflex" ,0 , -ENODEV ,0x38 , -ENODEV ,0x00000000 ,0xffffffff ,SYSC_QUIRK_LEGACY_IDLE ), -SYSC_QUIRK ("timer" ,0 ,0 ,0x10 ,0x14 ,0x00000015 ,0xffffffff , -0 ), -/* Some timers on omap4 and later */ -SYSC_QUIRK ("timer" ,0 ,0 ,0x10 , -ENODEV ,0x50002100 ,0xffffffff , -0 ), -SYSC_QUIRK ("timer" ,0 ,0 ,0x10 , -ENODEV ,0x4fff1301 ,0xffff00ff , -0 ),SYSC_QUIRK ("uart" ,0 ,0x50 ,0x54 ,0x58 ,0x00000046 ,0xffffffff ,SYSC_QUIRK_SWSUP_SIDLE |SYSC_QUIRK_LEGACY_IDLE ), SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff,
@@ -1404,6 +1397,13 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {SYSC_QUIRK ("slimbus" ,0 ,0 ,0x10 , -ENODEV ,0x40002903 ,0xffffffff ,0 ),SYSC_QUIRK ("spinlock" ,0 ,0 ,0x10 , -ENODEV ,0x50020000 ,0xffffffff ,0 ),SYSC_QUIRK ("rng" ,0 ,0x1fe0 ,0x1fe4 , -ENODEV ,0x00000020 ,0xffffffff ,0 ), +SYSC_QUIRK ("timer" ,0 ,0 ,0x10 ,0x14 ,0x00000013 ,0xffffffff ,0 ), +SYSC_QUIRK ("timer" ,0 ,0 ,0x10 ,0x14 ,0x00000015 ,0xffffffff ,0 ), +/* Some timers on omap4 and later */ +SYSC_QUIRK ("timer" ,0 ,0 ,0x10 , -ENODEV ,0x50002100 ,0xffffffff ,0 ), +SYSC_QUIRK ("timer" ,0 ,0 ,0x10 , -ENODEV ,0x4fff1301 ,0xffff00ff ,0 ), +SYSC_QUIRK ("timer32k" ,0 ,0 ,0x4 , -ENODEV ,0x00000040 ,0xffffffff ,0 ), +SYSC_QUIRK ("timer32k" ,0 ,0 ,0x4 , -ENODEV ,0x00000011 ,0xffffffff ,0 ),SYSC_QUIRK ("timer32k" ,0 ,0 ,0x4 , -ENODEV ,0x00000060 ,0xffffffff ,0 ),SYSC_QUIRK ("tpcc" ,0 ,0 , -ENODEV , -ENODEV ,0x40014c00 ,0xffffffff ,0 ), SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000004, 0xffffffff, 0),
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 14/15 ARM: OMAP2+: Drop old timer code for dmtimer and 32k counter
In reply to Tony LindgrenWith dmtimer and 32k counter being initialized based on devicetree data, we can just drop the old timer code.
This still leaves the omap5 and dra7 realtime_counter_init() that depend on the smc calls and control module platform code for the dra7 quirk init.
--- arch/arm/mach-omap2/Makefile | 4 +- arch/arm/mach-omap2/common.h | 7 + arch/arm/mach-omap2/timer.c | 551 ----------------------------------- 3 files changed, 10 insertions(+), 552 deletions(-)
arch/arm/mach-omap2/Makefile +3 -1
@@ -7,7 +7,7 @@ ccflags-y := -I$(srctree)/$(src)/include \ -I$(srctree)/arch/arm/plat-omap/include # Common support -obj-y := id.o io.o control.o devices.o fb.o timer.o pm.o \ +obj-y := id.o io.o control.o devices.o fb.o pm.o \ common.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ omap_device.o omap-headsmp.o sram.o
@@ -16,6 +16,8 @@ hwmod-common = omap_hwmod.o omap_hwmod_reset.o \ clock-common = clock.o secure-common = omap-smc.o omap-secure.o +obj-$(CONFIG_SOC_HAS_REALTIME_COUNTER) += timer.o + obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common) obj-$(CONFIG_ARCH_OMAP4) += $(hwmod-common) $(secure-common)
arch/arm/mach-omap2/common.h +7 -0
@@ -111,7 +111,14 @@ static inline int omap_l2_cache_init(void)#define OMAP_L2C_AUX_CTRL 0#define omap4_l2c310_write_sec NULL#endif + +#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER extern void omap5_realtime_timer_init (void ); +#else +static inline void omap5_realtime_timer_init (void ) +{ +} +#endif void omap2420_init_early (void );void omap2430_init_early (void );
arch/arm/mach-omap2/timer.c +0 -551
596 lines not on this page · raw message
Signature · 1 line
2.26.2
Tony Lindgren
maintainerPATCH v2 6/15 ARM: OMAP2+: Add omap_init_time_of()
In reply to Tony LindgrenThis allows us to move the SoCs to probe system timers one SoC at at time. As arch/arm/mach-omap2/timer.c will be eventually gone, let's just add omap_init_time_of() to board-generic.c directly.
--- arch/arm/mach-omap2/board-generic.c | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/mach-omap2/board-generic.c +8 -0
@@ -12,6 +12,7 @@#include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/irqdomain.h> +#include <linux/clocksource.h> #include <asm/setup.h> #include <asm/mach/arch.h>
@@ -31,6 +32,13 @@ static void __init __maybe_unused omap_generic_init(void)omap_soc_device_init (); } +/* Clocks are needed early, see drivers/clocksource for the rest */ +void __init __maybe_unused omap_init_time_of (void ) +{ +omap_clk_init (); +timer_probe (); +} +#ifdef CONFIG_SOC_OMAP2420 static const char *const omap242x_boards_compat[]__initconst = { "ti,omap2420",
Signature · 1 line
2.26.2
Re: [PATCH 11/15] ARM: dts: Configure system timers for omap3
In reply to Tony LindgrenQuoted 25 lines · Tony Lindgren
We can now init system timers using the dmtimer and 32k counter based on only devicetree data and
drivers/clocksourcetimers. 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 Adam Ford <[email protected]>Cc Andreas Kemnade <[email protected]>Cc "H. Nikolaus Schaller" <[email protected]>Cc Keerthy <[email protected]>Cc Lokesh Vutla <[email protected]>Cc Tero Kristo <[email protected]>Signed-off-by Tony Lindgren <[email protected]>
Quoted 2 lines
--- arch/arm/boot/dts/am3517.dtsi | 28 +++-
For the series on the am3517-evm,
Quoted 579 lines
arch/arm/boot/dts/omap3-beagle.dts | 33 +++++ arch/arm/boot/dts/omap3-devkit8000.dts | 33 +++++ arch/arm/boot/dts/omap3.dtsi | 135 +++++++++++++++---- arch/arm/mach-omap2/board-generic.c | 10 +- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 146 +-------------------- 6 files changed, 210 insertions(+), 175 deletions(-)arch/arm/boot/dts/am3517.dtsi +26
-2@@ -169,5 +169,29 @@ &mmu_isp { status = "disabled"; }; -/include/ "am35xx-clocks.dtsi" -/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" +#include "am35xx-clocks.dtsi" +#include "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" + +/* Timer for clocksource, configured without interrupts */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + /delete-property/interrupts; + /delete-property/interrupts-extended; + assigned-clocks = <&gpt1_fck>; + assigned-clock-parents = <&sys_ck>; + }; +}; + +/* Timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&gpt2_fck>; + assigned-clock-parents = <&sys_ck>; + }; +};arch/arm/boot/dts/omap3-beagle.dts +33
-0@@ -304,6 +304,39 @@ &usbhsehci { phys = <0 &hsusb2_phy>; }; +/* Unusable as clockevent, allow to idle */ +&timer1_target { + /delete-property/ti,no-reset-on-init; + /delete-property/ti,no-idle; + timer@0 { + compatible = "ti,omap3430-timer"; + interrupts = <37>; + }; +}; + +/* Timer for clocksource, configured without interrupts */ +&timer12_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + /delete-property/interrupts; + /delete-property/interrupts-extended; + /* Always clocked by secure_32k_fck */ + }; +}; + +/* Timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&gpt2_fck>; + assigned-clock-parents = <&sys_ck>; + }; +}; + &twl_gpio { ti,use-leds; /* pullups: BIT(1) */arch/arm/boot/dts/omap3-devkit8000.dts +33
-0@@ -14,3 +14,36 @@ aliases { display2 = &tv0; }; }; + +/* Unusable as clockevent, allow to idle */ +&timer1_target { + /delete-property/ti,no-reset-on-init; + /delete-property/ti,no-idle; + timer@0 { + compatible = "ti,omap3430-timer"; + interrupts = <37>; + }; +}; + +/* Timer for clocksource, configured without interrupts */ +&timer12_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + /delete-property/interrupts; + /delete-property/interrupts-extended; + /* Always clocked by secure_32k_fck */ + }; +}; + +/* Timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&gpt2_fck>; + assigned-clock-parents = <&sys_ck>; + }; +};arch/arm/boot/dts/omap3.dtsi +112
-23@@ -193,10 +193,23 @@ cm_clockdomains: clockdomains { }; }; - counter32k: counter@48320000 { - compatible = "ti,omap-counter32k"; - reg = <0x48320000 0x20>; - ti,hwmods = "counter_32k"; + 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 = <0x0 0x20>; + }; }; intc: interrupt-controller@48200000 {@@ -637,19 +650,63 @@ sham: sham@480c3000 { dma-names = "rx"; }; - timer1: timer@48318000 { - compatible = "ti,omap3430-timer"; - reg = <0x48318000 0x400>; - interrupts = <37>; - ti,hwmods = "timer1"; - ti,timer-alwon; + 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 = <0x0 0x80>; + clocks = <&gpt1_fck>; + clock-names = "fck"; + interrupts = <37>; + ti,timer-alwon; + }; }; - timer2: timer@49032000 { - compatible = "ti,omap3430-timer"; - reg = <0x49032000 0x400>; - interrupts = <38>; - ti,hwmods = "timer2"; + 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@0 { + compatible = "ti,omap3430-timer"; + reg = <0 0x400>; + interrupts = <38>; + }; }; timer3: timer@49034000 {@@ -723,13 +780,34 @@ timer11: timer@48088000 { ti,timer-pwm; }; - timer12: timer@48304000 { - compatible = "ti,omap3430-timer"; - reg = <0x48304000 0x400>; - interrupts = <95>; - ti,hwmods = "timer12"; - ti,timer-alwon; - ti,timer-secure; + 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 = <0 0x400>; + interrupts = <95>; + ti,timer-alwon; + ti,timer-secure; + }; }; usbhstll: usbhstll@48062000 {@@ -886,4 +964,15 @@ ssi_port2: ssi-port@4805b000 { }; }; -/include/ "omap3xxx-clocks.dtsi" +#include "omap3xxx-clocks.dtsi" + +/* Timer for clockevent */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + compatible = "ti,dmtimer"; + assigned-clocks = <&gpt1_fck>; + assigned-clock-parents = <&omap_32k_fck>; + }; +};arch/arm/mach-omap2/board-generic.c +5
-5@@ -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 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1
-146@@ -147,36 +147,6 @@ static struct omap_hwmod_class omap3xxx_timer_hwmod_class = { .sysc = &omap3xxx_timer_sysc, }; -/* timer1 */ -static struct omap_hwmod omap3xxx_timer1_hwmod = { - .name ="timer1" , - .main_clk ="gpt1_fck" , - .prcm = { - .omap2 = { - .module_offs =WKUP_MOD , - .idlest_reg_id =1 , - .idlest_idle_bit =OMAP3430_ST_GPT1_SHIFT , - }, - }, - .class = &omap3xxx_timer_hwmod_class, - .flags =HWMOD_SET_DEFAULT_CLOCKACT , -}; - -/* timer2 */ -static struct omap_hwmod omap3xxx_timer2_hwmod = { - .name ="timer2" , - .main_clk ="gpt2_fck" , - .prcm = { - .omap2 = { - .module_offs =OMAP3430_PER_MOD , - .idlest_reg_id =1 , - .idlest_idle_bit =OMAP3430_ST_GPT2_SHIFT , - }, - }, - .class = &omap3xxx_timer_hwmod_class, - .flags =HWMOD_SET_DEFAULT_CLOCKACT , -}; -/* timer3 */ static struct omap_hwmod omap3xxx_timer3_hwmod = { .name ="timer3" ,@@ -312,21 +282,6 @@ static struct omap_hwmod omap3xxx_timer11_hwmod = { .flags = HWMOD_SET_DEFAULT_CLOCKACT, }; -/* timer12 */ -static struct omap_hwmod omap3xxx_timer12_hwmod = { - .name ="timer12" , - .main_clk ="gpt12_fck" , - .prcm = { - .omap2 = { - .module_offs =WKUP_MOD , - .idlest_reg_id =1 , - .idlest_idle_bit =OMAP3430_ST_GPT12_SHIFT , - }, - }, - .class = &omap3xxx_timer_hwmod_class, - .flags =HWMOD_SET_DEFAULT_CLOCKACT , -}; -/* * 'wd_timer' class * 32-bit watchdog upward counter that generates a pulse on the reset pin on @@ -1524,38 +1479,6 @@ static struct omap_hwmod omap3xxx_sad2d_hwmod = { .class = &omap3xxx_sad2d_class, }; -/* -* '32K sync counter' class -* 32-bit ordinary counter, clocked by the falling edge of the 32 khz clock -*/ -static struct omap_hwmod_class_sysconfig omap3xxx_counter_sysc = { - .rev_offs =0x0000 , - .sysc_offs =0x0004 , - .sysc_flags =SYSC_HAS_SIDLEMODE , - .idlemodes = (SIDLE_FORCE |SIDLE_NO ), - .sysc_fields = &omap_hwmod_sysc_type1, -}; - -static struct omap_hwmod_class omap3xxx_counter_hwmod_class = { - .name ="counter" , - .sysc = &omap3xxx_counter_sysc, -}; - -static struct omap_hwmod omap3xxx_counter_32k_hwmod = { - .name ="counter_32k" , - .class = &omap3xxx_counter_hwmod_class, - .clkdm_name ="wkup_clkdm" , - .flags =HWMOD_SWSUP_SIDLE , - .main_clk ="wkup_32k_fck" , - .prcm = { - .omap2 = { - .module_offs =WKUP_MOD , - .idlest_reg_id =1 , - .idlest_idle_bit =OMAP3430_ST_32KSYNC_SHIFT , - }, - }, -}; -/* * 'gpmc' class * general purpose memory controller @@ -1868,25 +1791,6 @@ static struct omap_hwmod_ocp_if omap3xxx_l3__iva = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; - -/* l4_wkup -> timer1 */ -static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__timer1 = { - .master = &omap3xxx_l4_wkup_hwmod, - .slave = &omap3xxx_timer1_hwmod, - .clk ="gpt1_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; - - -/* l4_per -> timer2 */ -static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer2 = { - .master = &omap3xxx_l4_per_hwmod, - .slave = &omap3xxx_timer2_hwmod, - .clk ="gpt2_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; - -/* l4_per -> timer3 */ static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer3 = { .master = &omap3xxx_l4_per_hwmod,@@ -1965,15 +1869,6 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer11 = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; - -/* l4_core -> timer12 */ -static struct omap_hwmod_ocp_if omap3xxx_l4_sec__timer12 = { - .master = &omap3xxx_l4_sec_hwmod, - .slave = &omap3xxx_timer12_hwmod, - .clk ="gpt12_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; -/* l4_wkup -> wd_timer2 */ static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__wd_timer2 = {@@ -2325,16 +2220,6 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__hdq1w = { .flags = OMAP_FIREWALL_L4 | OCPIF_SWSUP_IDLE, }; -/* l4_wkup -> 32ksync_counter */ - - -static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__counter_32k = { - .master = &omap3xxx_l4_wkup_hwmod, - .slave = &omap3xxx_counter_32k_hwmod, - .clk ="omap_32ksync_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; -/* am35xx has Davinci MDIO & EMAC */ static struct omap_hwmod_class am35xx_mdio_class = { .name ="davinci_mdio" ,@@ -2551,8 +2436,6 @@ static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = { &omap3_l4_core__i2c2, &omap3_l4_core__i2c3, &omap3xxx_l4_wkup__l4_sec, - &omap3xxx_l4_wkup__timer1, - &omap3xxx_l4_per__timer2, &omap3xxx_l4_per__timer3, &omap3xxx_l4_per__timer4, &omap3xxx_l4_per__timer5,@@ -2580,27 +2463,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = { &omap34xx_l4_core__mcspi2, &omap34xx_l4_core__mcspi3, &omap34xx_l4_core__mcspi4, - &omap3xxx_l4_wkup__counter_32k, &omap3xxx_l3_main__gpmc, NULL, }; -/* GP-only hwmod links */ -static struct omap_hwmod_ocp_if *omap34xx_gp_hwmod_ocp_ifs[]__initdata = { - &omap3xxx_l4_sec__timer12, -NULL , -}; - -static struct omap_hwmod_ocp_if *omap36xx_gp_hwmod_ocp_ifs[]__initdata = { - &omap3xxx_l4_sec__timer12, -NULL , -}; - -static struct omap_hwmod_ocp_if *am35xx_gp_hwmod_ocp_ifs[]__initdata = { - &omap3xxx_l4_sec__timer12, -NULL , -}; -/* crypto hwmod links */ static struct omap_hwmod_ocp_if *omap34xx_sham_hwmod_ocp_ifs[]__initdata = { &omap3xxx_l4_core__sham,@@ -2774,7 +2640,7 @@ static bool __init omap3xxx_hwmod_is_hs_ip_block_usable(struct device_node *bus,int __init omap3xxx_hwmod_init (void ) {int r; -struct omap_hwmod_ocp_if **h =NULL , **h_gp =NULL , **h_sham =NULL ; +struct omap_hwmod_ocp_if **h =NULL , **h_sham =NULL ;struct omap_hwmod_ocp_if **h_aes =NULL ;struct device_node *bus;unsigned int rev;@@ -2797,18 +2663,15 @@ int __init omap3xxx_hwmod_init(void) rev == OMAP3430_REV_ES2_1 || rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2) { h = omap34xx_hwmod_ocp_ifs; - h_gp = omap34xx_gp_hwmod_ocp_ifs; h_sham = omap34xx_sham_hwmod_ocp_ifs; h_aes = omap34xx_aes_hwmod_ocp_ifs; } else if (rev == AM35XX_REV_ES1_0 || rev == AM35XX_REV_ES1_1) { h = am35xx_hwmod_ocp_ifs; - h_gp = am35xx_gp_hwmod_ocp_ifs; h_sham = am35xx_sham_hwmod_ocp_ifs; h_aes = am35xx_aes_hwmod_ocp_ifs; } else if (rev == OMAP3630_REV_ES1_0 || rev == OMAP3630_REV_ES1_1 || rev == OMAP3630_REV_ES1_2) { h = omap36xx_hwmod_ocp_ifs; - h_gp = omap36xx_gp_hwmod_ocp_ifs; h_sham = omap36xx_sham_hwmod_ocp_ifs; h_aes = omap36xx_aes_hwmod_ocp_ifs; } else {@@ -2820,13 +2683,6 @@ int __init omap3xxx_hwmod_init(void)if (r <0 )return r; -/* Register GP-only hwmod links. */ -if (h_gp &&omap_type () ==OMAP2_DEVICE_TYPE_GP ) { - r =omap_hwmod_register_links (h_gp); -if (r <0 ) -return r; - } -/* * Register crypto hwmod links only if they are not disabled in DT. * If DT information is missing, enable them only for GP devices. -- 2.26.2
Re: [PATCH 02/15] dt-bindings: timer: add ti, dmtimer compatible for for system timers
In reply to Tony LindgrenQuoted 5 lines · Tony Lindgren
The TI dual-mode timer can be used for both clocksource and clockevent system timers. We need a way to specify which dual-mode timers are reserved for system timers as there are multiple instances available that may require a board specific configuration.
Quoted 9 lines
Let's add a generic compatible "ti,dmtimer" that
TIMER_OF_DECLAREcan use as suggested by Daniel Lezcano <[email protected]>.Suggested-by Daniel Lezcano <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- Documentation/devicetree/bindings/timer/ti,timer.txt | 1 + 1 file changed, 1 insertion(+)
Tony Lindgren
maintainerRe: [PATCH 02/15] dt-bindings: timer: add ti, dmtimer compatible for for system timers
Quoted 9 lines · Rob Herring
Quoted 8 lines · Tony Lindgren
The TI dual-mode timer can be used for both clocksource and clockevent system timers. We need a way to specify which dual-mode timers are reserved for system timers as there are multiple instances available that may require a board specific configuration.
Let's add a generic compatible "ti,dmtimer" that
TIMER_OF_DECLAREcan use as suggested by Daniel Lezcano <[email protected]>.
Quoted 8 lines
Quoted 6 lines
Suggested-by Daniel Lezcano <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- Documentation/devicetree/bindings/timer/ti,timer.txt | 1 + 1 file changed, 1 insertion(+)Acked-by Rob Herring <[email protected]>
Looks like this is no longer needed with v3 set in the repost thread:
"[PATCHv3 00/14] Update omaps to use drivers/clocksource timers"
It now does detection for the preferred system timers based on the various timer features like you suggested.
Regards,
Tony