Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: Configure system timers for omap4

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: devicetree@vger.kernel.org
Cc: Grygorii Strashko <grygorii.strashko@ti.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: Tony Lindgren <tony@atomide.com>

+12 -94
+1 -3
arch/arm/boot/dts/omap4-l4.dtsi
··· 974 974 975 975 target-module@4000 { /* 0x4a304000, ap 17 24.0 */ 976 976 compatible = "ti,sysc-omap2", "ti,sysc"; 977 - ti,hwmods = "counter_32k"; 978 977 reg = <0x4000 0x4>, 979 978 <0x4004 0x4>; 980 979 reg-names = "rev", "sysc"; ··· 1138 1139 }; 1139 1140 }; 1140 1141 1141 - target-module@8000 { /* 0x4a318000, ap 9 1c.0 */ 1142 + timer1_target: target-module@8000 { /* 0x4a318000, ap 9 1c.0 */ 1142 1143 compatible = "ti,sysc-omap2-timer", "ti,sysc"; 1143 - ti,hwmods = "timer1"; 1144 1144 reg = <0x8000 0x4>, 1145 1145 <0x8010 0x4>, 1146 1146 <0x8014 0x4>;
+10
arch/arm/boot/dts/omap4.dtsi
··· 655 655 #reset-cells = <1>; 656 656 }; 657 657 }; 658 + 659 + /* Preferred always-on timer for clockevent */ 660 + &timer1_target { 661 + ti,no-reset-on-init; 662 + ti,no-idle; 663 + timer@0 { 664 + assigned-clocks = <&l4_wkup_clkctrl OMAP4_TIMER1_CLKCTRL 24>; 665 + assigned-clock-parents = <&sys_clkin_ck>; 666 + }; 667 + };
+1 -1
arch/arm/mach-omap2/board-generic.c
··· 261 261 .init_irq = omap_gic_of_init, 262 262 .init_machine = omap_generic_init, 263 263 .init_late = omap4430_init_late, 264 - .init_time = omap4_local_timer_init, 264 + .init_time = omap_init_time_of, 265 265 .dt_compat = omap4_boards_compat, 266 266 .restart = omap44xx_restart, 267 267 MACHINE_END
-90
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
··· 232 232 */ 233 233 234 234 /* 235 - * 'counter' class 236 - * 32-bit ordinary counter, clocked by the falling edge of the 32 khz clock 237 - */ 238 - 239 - static struct omap_hwmod_class_sysconfig omap44xx_counter_sysc = { 240 - .rev_offs = 0x0000, 241 - .sysc_offs = 0x0004, 242 - .sysc_flags = SYSC_HAS_SIDLEMODE, 243 - .idlemodes = (SIDLE_FORCE | SIDLE_NO), 244 - .sysc_fields = &omap_hwmod_sysc_type1, 245 - }; 246 - 247 - static struct omap_hwmod_class omap44xx_counter_hwmod_class = { 248 - .name = "counter", 249 - .sysc = &omap44xx_counter_sysc, 250 - }; 251 - 252 - /* counter_32k */ 253 - static struct omap_hwmod omap44xx_counter_32k_hwmod = { 254 - .name = "counter_32k", 255 - .class = &omap44xx_counter_hwmod_class, 256 - .clkdm_name = "l4_wkup_clkdm", 257 - .flags = HWMOD_SWSUP_SIDLE, 258 - .main_clk = "sys_32k_ck", 259 - .prcm = { 260 - .omap4 = { 261 - .clkctrl_offs = OMAP4_CM_WKUP_SYNCTIMER_CLKCTRL_OFFSET, 262 - .context_offs = OMAP4_RM_WKUP_SYNCTIMER_CONTEXT_OFFSET, 263 - }, 264 - }, 265 - }; 266 - 267 - /* 268 235 * 'ctrl_module' class 269 236 * attila core control module + core pad control module + wkup pad control 270 237 * module + attila wkup control module ··· 640 673 }; 641 674 642 675 /* 643 - * 'timer' class 644 - * general purpose timer module with accurate 1ms tick 645 - * This class contains several variants: ['timer_1ms', 'timer'] 646 - */ 647 - 648 - static struct omap_hwmod_class_sysconfig omap44xx_timer_1ms_sysc = { 649 - .rev_offs = 0x0000, 650 - .sysc_offs = 0x0010, 651 - .syss_offs = 0x0014, 652 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | 653 - SYSC_HAS_EMUFREE | SYSC_HAS_ENAWAKEUP | 654 - SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | 655 - SYSS_HAS_RESET_STATUS), 656 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 657 - .sysc_fields = &omap_hwmod_sysc_type1, 658 - }; 659 - 660 - static struct omap_hwmod_class omap44xx_timer_1ms_hwmod_class = { 661 - .name = "timer", 662 - .sysc = &omap44xx_timer_1ms_sysc, 663 - }; 664 - 665 - /* timer1 */ 666 - static struct omap_hwmod omap44xx_timer1_hwmod = { 667 - .name = "timer1", 668 - .class = &omap44xx_timer_1ms_hwmod_class, 669 - .clkdm_name = "l4_wkup_clkdm", 670 - .flags = HWMOD_SET_DEFAULT_CLOCKACT, 671 - .main_clk = "dmt1_clk_mux", 672 - .prcm = { 673 - .omap4 = { 674 - .clkctrl_offs = OMAP4_CM_WKUP_TIMER1_CLKCTRL_OFFSET, 675 - .context_offs = OMAP4_RM_WKUP_TIMER1_CONTEXT_OFFSET, 676 - .modulemode = MODULEMODE_SWCTRL, 677 - }, 678 - }, 679 - }; 680 - 681 - /* 682 676 * 'usb_host_fs' class 683 677 * full-speed usb host controller 684 678 */ ··· 991 1063 .user = OCP_USER_MPU | OCP_USER_SDMA, 992 1064 }; 993 1065 994 - /* l4_wkup -> counter_32k */ 995 - static struct omap_hwmod_ocp_if omap44xx_l4_wkup__counter_32k = { 996 - .master = &omap44xx_l4_wkup_hwmod, 997 - .slave = &omap44xx_counter_32k_hwmod, 998 - .clk = "l4_wkup_clk_mux_ck", 999 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1000 - }; 1001 - 1002 1066 /* l4_cfg -> ctrl_module_core */ 1003 1067 static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ctrl_module_core = { 1004 1068 .master = &omap44xx_l4_cfg_hwmod, ··· 1119 1199 .user = OCP_USER_MPU | OCP_USER_SDMA, 1120 1200 }; 1121 1201 1122 - /* l4_wkup -> timer1 */ 1123 - static struct omap_hwmod_ocp_if omap44xx_l4_wkup__timer1 = { 1124 - .master = &omap44xx_l4_wkup_hwmod, 1125 - .slave = &omap44xx_timer1_hwmod, 1126 - .clk = "l4_wkup_clk_mux_ck", 1127 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1128 - }; 1129 - 1130 1202 /* l4_cfg -> usb_host_fs */ 1131 1203 static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_cfg__usb_host_fs = { 1132 1204 .master = &omap44xx_l4_cfg_hwmod, ··· 1185 1273 &omap44xx_l4_cfg__l4_wkup, 1186 1274 &omap44xx_mpu__mpu_private, 1187 1275 &omap44xx_l4_cfg__ocp_wp_noc, 1188 - &omap44xx_l4_wkup__counter_32k, 1189 1276 &omap44xx_l4_cfg__ctrl_module_core, 1190 1277 &omap44xx_l4_cfg__ctrl_module_pad_core, 1191 1278 &omap44xx_l4_wkup__ctrl_module_wkup, ··· 1201 1290 &omap44xx_l4_wkup__prm, 1202 1291 &omap44xx_l4_wkup__scrm, 1203 1292 /* &omap44xx_l3_main_2__sl2if, */ 1204 - &omap44xx_l4_wkup__timer1, 1205 1293 /* &omap44xx_l4_cfg__usb_host_fs, */ 1206 1294 &omap44xx_l4_cfg__usb_host_hs, 1207 1295 &omap44xx_l4_cfg__usb_tll_hs,