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

ARM: dts: Fix timer regression for beagleboard revision c

Commit e428e250fde6 ("ARM: dts: Configure system timers for omap3")
caused a timer regression for beagleboard revision c where the system
clockevent stops working if omap3isp module is unloaded.

Turns out we still have beagleboard revisions a-b4 capacitor c70 quirks
applied that limit the usable timers for no good reason. This also affects
the power management as we use the system clock instead of the 32k clock
source.

Let's fix the issue by adding a new omap3-beagle-ab4.dts for the old timer
quirks. This allows us to remove the timer quirks for later beagleboard
revisions. We also need to update the related timer quirk check for the
correct compatible property.

Fixes: e428e250fde6 ("ARM: dts: Configure system timers for omap3")
Cc: linux-kernel@vger.kernel.org
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rob Herring <robh+dt@kernel.org>
Reported-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

+52 -34
+3
Documentation/devicetree/bindings/arm/omap/omap.txt
··· 119 119 - OMAP3 BeagleBoard : Low cost community board 120 120 compatible = "ti,omap3-beagle", "ti,omap3430", "ti,omap3" 121 121 122 + - OMAP3 BeagleBoard A to B4 : Early BeagleBoard revisions A to B4 with a timer quirk 123 + compatible = "ti,omap3-beagle-ab4", "ti,omap3-beagle", "ti,omap3430", "ti,omap3" 124 + 122 125 - OMAP3 Tobi with Overo : Commercial expansion board with daughter board 123 126 compatible = "gumstix,omap3-overo-tobi", "gumstix,omap3-overo", "ti,omap3430", "ti,omap3" 124 127
+1
arch/arm/boot/dts/Makefile
··· 794 794 logicpd-som-lv-37xx-devkit.dtb \ 795 795 omap3430-sdp.dtb \ 796 796 omap3-beagle.dtb \ 797 + omap3-beagle-ab4.dtb \ 797 798 omap3-beagle-xm.dtb \ 798 799 omap3-beagle-xm-ab.dtb \ 799 800 omap3-cm-t3517.dtb \
+47
arch/arm/boot/dts/omap3-beagle-ab4.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /dts-v1/; 3 + 4 + #include "omap3-beagle.dts" 5 + 6 + / { 7 + model = "TI OMAP3 BeagleBoard A to B4"; 8 + compatible = "ti,omap3-beagle-ab4", "ti,omap3-beagle", "ti,omap3430", "ti,omap3"; 9 + }; 10 + 11 + /* 12 + * Workaround for capacitor C70 issue, see "Boards revision A and < B5" 13 + * section at https://elinux.org/BeagleBoard_Community 14 + */ 15 + 16 + /* Unusable as clocksource because of unreliable oscillator */ 17 + &counter32k { 18 + status = "disabled"; 19 + }; 20 + 21 + /* Unusable as clockevent because of unreliable oscillator, allow to idle */ 22 + &timer1_target { 23 + /delete-property/ti,no-reset-on-init; 24 + /delete-property/ti,no-idle; 25 + timer@0 { 26 + /delete-property/ti,timer-alwon; 27 + }; 28 + }; 29 + 30 + /* Preferred always-on timer for clocksource */ 31 + &timer12_target { 32 + ti,no-reset-on-init; 33 + ti,no-idle; 34 + timer@0 { 35 + /* Always clocked by secure_32k_fck */ 36 + }; 37 + }; 38 + 39 + /* Preferred timer for clockevent */ 40 + &timer2_target { 41 + ti,no-reset-on-init; 42 + ti,no-idle; 43 + timer@0 { 44 + assigned-clocks = <&gpt2_fck>; 45 + assigned-clock-parents = <&sys_ck>; 46 + }; 47 + };
-33
arch/arm/boot/dts/omap3-beagle.dts
··· 304 304 phys = <0 &hsusb2_phy>; 305 305 }; 306 306 307 - /* Unusable as clocksource because of unreliable oscillator */ 308 - &counter32k { 309 - status = "disabled"; 310 - }; 311 - 312 - /* Unusable as clockevent because if unreliable oscillator, allow to idle */ 313 - &timer1_target { 314 - /delete-property/ti,no-reset-on-init; 315 - /delete-property/ti,no-idle; 316 - timer@0 { 317 - /delete-property/ti,timer-alwon; 318 - }; 319 - }; 320 - 321 - /* Preferred always-on timer for clocksource */ 322 - &timer12_target { 323 - ti,no-reset-on-init; 324 - ti,no-idle; 325 - timer@0 { 326 - /* Always clocked by secure_32k_fck */ 327 - }; 328 - }; 329 - 330 - /* Preferred timer for clockevent */ 331 - &timer2_target { 332 - ti,no-reset-on-init; 333 - ti,no-idle; 334 - timer@0 { 335 - assigned-clocks = <&gpt2_fck>; 336 - assigned-clock-parents = <&sys_ck>; 337 - }; 338 - }; 339 - 340 307 &twl_gpio { 341 308 ti,use-leds; 342 309 /* pullups: BIT(1) */
+1 -1
drivers/clocksource/timer-ti-dm-systimer.c
··· 241 241 bool quirk_unreliable_oscillator = false; 242 242 243 243 /* Quirk unreliable 32 KiHz oscillator with incomplete dts */ 244 - if (of_machine_is_compatible("ti,omap3-beagle") || 244 + if (of_machine_is_compatible("ti,omap3-beagle-ab4") || 245 245 of_machine_is_compatible("timll,omap3-devkit8000")) { 246 246 quirk_unreliable_oscillator = true; 247 247 counter_32k = -ENODEV;