clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940
authorTony Lindgren <tony@atomide.com>
Fri, 9 Jul 2021 07:37:45 +0000 (10:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Jul 2021 10:49:32 +0000 (12:49 +0200)
commit330584716d4b5b9653608edc0adf7251bcd7e506
treefe6382d17976e532e46704b7286ede34e78f7ac4
parent123235223169d1a73e55fcd5d857be676207021f
clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940

commit 25de4ce5ed02994aea8bc111d133308f6fd62566 upstream.

There is a timer wrap issue on dra7 for the ARM architected timer.
In a typical clock configuration the timer fails to wrap after 388 days.

To work around the issue, we need to use timer-ti-dm percpu timers instead.

Let's configure dmtimer3 and 4 as percpu timers by default, and warn about
the issue if the dtb is not configured properly.

For more information, please see the errata for "AM572x Sitara Processors
Silicon Revisions 1.1, 2.0":

https://www.ti.com/lit/er/sprz429m/sprz429m.pdf

The concept is based on earlier reference patches done by Tero Kristo and
Keerthy.

Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Keerthy <j-keerthy@ti.com>
Cc: Tero Kristo <kristo@kernel.org>
[tony@atomide.com: backported to 4.19.y]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/boot/dts/dra7.dtsi
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/timer.c
drivers/clk/ti/clk-7xx.c
include/linux/cpuhotplug.h