* [PATCH 0/2] AM57 timer fixes
@ 2025-08-29 9:29 Anurag Dutta
2025-08-29 9:29 ` [PATCH 1/2] bus: ti-sysc: Add DRA7 SoC matching Anurag Dutta
2025-08-29 9:29 ` [PATCH 2/2] arm: dts: Use DMTimer as Clocksource instead of counter_32k Anurag Dutta
0 siblings, 2 replies; 5+ messages in thread
From: Anurag Dutta @ 2025-08-29 9:29 UTC (permalink / raw)
To: aaro.koskinen, andreas, khilman, rogerq, tony
Cc: linux-omap, linux-kernel, u-kumar1, vigneshr
Hi all
This series introduces a couple of fixes for the am57 board viz.
1. Add DRA7 SoC matching to avoid probe failures for timers
2. Use DMtimer as clocksource to avoid using 32k counter due to
incorrect frequency.
logs:
https://gist.github.com/anuragdutta731/9366b4e582f7adb86e40ede1add1c79c
Sinthu Raja (2):
bus: ti-sysc: Add DRA7 SoC matching
arm: dts: Use DMTimer as Clocksource instead of counter_32k
arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts | 9 +++++++++
arch/arm/boot/dts/ti/omap/dra7-l4.dtsi | 2 +-
drivers/bus/ti-sysc.c | 3 ++-
3 files changed, 12 insertions(+), 2 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] bus: ti-sysc: Add DRA7 SoC matching
2025-08-29 9:29 [PATCH 0/2] AM57 timer fixes Anurag Dutta
@ 2025-08-29 9:29 ` Anurag Dutta
2025-08-29 14:22 ` Kumar, Udit
2025-08-29 9:29 ` [PATCH 2/2] arm: dts: Use DMTimer as Clocksource instead of counter_32k Anurag Dutta
1 sibling, 1 reply; 5+ messages in thread
From: Anurag Dutta @ 2025-08-29 9:29 UTC (permalink / raw)
To: aaro.koskinen, andreas, khilman, rogerq, tony
Cc: linux-omap, linux-kernel, u-kumar1, vigneshr
From: Sinthu Raja <sinthu.raja@ti.com>
Kernel Commit 25de4ce5ed02 ("clocksource/drivers/timer-ti-dm: Handle
dra7 timer wrap errata i940") states that "There is a timer wrap issue
on dra7 and as a work around, we need to use timer-ti-dm percpu timers
instead. So, configure dmtimer3 and 4 as percpu timers by default." In
this commit, the author has used ti,no-reset-on-init and ti,no-idle quirks.
The sysc_check_active_timer() checks for these quirks and accordingly,
returns EBUSY error if the quirks match. Because of this, the timer
modules fail to probe as can be observed during bootup :"ti-sysc
4882c000.target-module: probe with driver ti-sysc failed with error -16"
Return 'ENXIO' instead of 'EBUSY' for DRA7 SoC, so that the error is set
to ENXIO and the module gets probed under "certain conditions".
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
Signed-off-by: Anurag Dutta <a-dutta@ti.com>
---
drivers/bus/ti-sysc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 5566ad11399e..90766f804706 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -3117,7 +3117,8 @@ static int sysc_check_active_timer(struct sysc *ddata)
* can be dropped if we stop supporting old beagleboard revisions
* A to B4 at some point.
*/
- if (sysc_soc->soc == SOC_3430 || sysc_soc->soc == SOC_AM35)
+ if (sysc_soc->soc == SOC_3430 || sysc_soc->soc == SOC_AM35 ||
+ sysc_soc->soc == SOC_DRA7)
error = -ENXIO;
else
error = -EBUSY;
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] arm: dts: Use DMTimer as Clocksource instead of counter_32k
2025-08-29 9:29 [PATCH 0/2] AM57 timer fixes Anurag Dutta
2025-08-29 9:29 ` [PATCH 1/2] bus: ti-sysc: Add DRA7 SoC matching Anurag Dutta
@ 2025-08-29 9:29 ` Anurag Dutta
2025-08-29 14:25 ` Kumar, Udit
1 sibling, 1 reply; 5+ messages in thread
From: Anurag Dutta @ 2025-08-29 9:29 UTC (permalink / raw)
To: aaro.koskinen, andreas, khilman, rogerq, tony
Cc: linux-omap, linux-kernel, u-kumar1, vigneshr
From: Sinthu Raja <sinthu.raja@ti.com>
Clock drift of approximately 500 ppm is observed with 'counter_32k'
as clocksource. Clock drift is seen because 'counter_32k' is running
with 32786Hz frequency instead it should run with 32768Hz. Use DMTimer as
clocksource, which is running at 32768Hz to fix the clock drift issue.
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
Signed-off-by: Anurag Dutta <a-dutta@ti.com>
---
arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts | 9 +++++++++
arch/arm/boot/dts/ti/omap/dra7-l4.dtsi | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts b/arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts
index 0a8b16505ed9..83009883277e 100644
--- a/arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts
+++ b/arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts
@@ -36,3 +36,12 @@ &mmc2 {
&phy1 {
max-speed = <100>;
};
+
+&timer12_target {
+ ti,no-reset-on-init;
+ ti,no-idle;
+};
+
+&counter32k {
+ status = "disabled";
+};
diff --git a/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi b/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi
index ba7fdaae9c6e..a6ac4fd43b54 100644
--- a/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi
+++ b/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi
@@ -4439,7 +4439,7 @@ segment@20000 { /* 0x4ae20000 */
<0x0000c000 0x0002c000 0x001000>, /* ap 29 */
<0x0000f000 0x0002f000 0x001000>; /* ap 32 */
- target-module@0 { /* 0x4ae20000, ap 19 08.0 */
+ timer12_target: target-module@0 { /* 0x4ae20000, ap 19 08.0 */
compatible = "ti,sysc-omap4-timer", "ti,sysc";
reg = <0x0 0x4>,
<0x10 0x4>;
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] bus: ti-sysc: Add DRA7 SoC matching
2025-08-29 9:29 ` [PATCH 1/2] bus: ti-sysc: Add DRA7 SoC matching Anurag Dutta
@ 2025-08-29 14:22 ` Kumar, Udit
0 siblings, 0 replies; 5+ messages in thread
From: Kumar, Udit @ 2025-08-29 14:22 UTC (permalink / raw)
To: Anurag Dutta, aaro.koskinen, andreas, khilman, rogerq, tony
Cc: linux-omap, linux-kernel, vigneshr, u-kumar1
On 8/29/2025 2:59 PM, Anurag Dutta wrote:
> From: Sinthu Raja <sinthu.raja@ti.com>
>
> Kernel Commit 25de4ce5ed02 ("clocksource/drivers/timer-ti-dm: Handle
> dra7 timer wrap errata i940") states that "There is a timer wrap issue
> on dra7 and as a work around, we need to use timer-ti-dm percpu timers
> instead. So, configure dmtimer3 and 4 as percpu timers by default." In
> this commit, the author has used ti,no-reset-on-init and ti,no-idle quirks.
>
> The sysc_check_active_timer() checks for these quirks and accordingly,
> returns EBUSY error if the quirks match. Because of this, the timer
> modules fail to probe as can be observed during bootup :"ti-sysc
> 4882c000.target-module: probe with driver ti-sysc failed with error -16"
>
> Return 'ENXIO' instead of 'EBUSY' for DRA7 SoC, so that the error is set
> to ENXIO and the module gets probed under "certain conditions".
Please define, what are "certain conditions".
With addition of conditions in commit message, for this patch
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
>
> Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
> Signed-off-by: Anurag Dutta <a-dutta@ti.com>
> ---
> drivers/bus/ti-sysc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> index 5566ad11399e..90766f804706 100644
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> @@ -3117,7 +3117,8 @@ static int sysc_check_active_timer(struct sysc *ddata)
> * can be dropped if we stop supporting old beagleboard revisions
> * A to B4 at some point.
> */
> - if (sysc_soc->soc == SOC_3430 || sysc_soc->soc == SOC_AM35)
> + if (sysc_soc->soc == SOC_3430 || sysc_soc->soc == SOC_AM35 ||
> + sysc_soc->soc == SOC_DRA7)
> error = -ENXIO;
> else
> error = -EBUSY;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] arm: dts: Use DMTimer as Clocksource instead of counter_32k
2025-08-29 9:29 ` [PATCH 2/2] arm: dts: Use DMTimer as Clocksource instead of counter_32k Anurag Dutta
@ 2025-08-29 14:25 ` Kumar, Udit
0 siblings, 0 replies; 5+ messages in thread
From: Kumar, Udit @ 2025-08-29 14:25 UTC (permalink / raw)
To: Anurag Dutta, aaro.koskinen, andreas, khilman, rogerq, tony
Cc: linux-omap, linux-kernel, vigneshr, u-kumar1
On 8/29/2025 2:59 PM, Anurag Dutta wrote:
> From: Sinthu Raja <sinthu.raja@ti.com>
Please check subject of patch
> Clock drift of approximately 500 ppm is observed with 'counter_32k'
> as clocksource. Clock drift is seen because 'counter_32k' is running
> with 32786Hz frequency instead it should run with 32768Hz. Use DMTimer as
> clocksource, which is running at 32768Hz to fix the clock drift issue.
>
> Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
> Signed-off-by: Anurag Dutta <a-dutta@ti.com>
> ---
> arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts | 9 +++++++++
> arch/arm/boot/dts/ti/omap/dra7-l4.dtsi | 2 +-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts b/arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts
> index 0a8b16505ed9..83009883277e 100644
> --- a/arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts
> +++ b/arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dts
> @@ -36,3 +36,12 @@ &mmc2 {
> &phy1 {
> max-speed = <100>;
> };
> +
> +&timer12_target {
> + ti,no-reset-on-init;
> + ti,no-idle;
> +};
> +
> +&counter32k {
> + status = "disabled";
> +};
> diff --git a/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi b/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi
> index ba7fdaae9c6e..a6ac4fd43b54 100644
> --- a/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi
> +++ b/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi
> @@ -4439,7 +4439,7 @@ segment@20000 { /* 0x4ae20000 */
> <0x0000c000 0x0002c000 0x001000>, /* ap 29 */
> <0x0000f000 0x0002f000 0x001000>; /* ap 32 */
>
> - target-module@0 { /* 0x4ae20000, ap 19 08.0 */
> + timer12_target: target-module@0 { /* 0x4ae20000, ap 19 08.0 */
you can reduce tab between { and comments
> compatible = "ti,sysc-omap4-timer", "ti,sysc";
> reg = <0x0 0x4>,
> <0x10 0x4>;
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-08-29 14:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-29 9:29 [PATCH 0/2] AM57 timer fixes Anurag Dutta
2025-08-29 9:29 ` [PATCH 1/2] bus: ti-sysc: Add DRA7 SoC matching Anurag Dutta
2025-08-29 14:22 ` Kumar, Udit
2025-08-29 9:29 ` [PATCH 2/2] arm: dts: Use DMTimer as Clocksource instead of counter_32k Anurag Dutta
2025-08-29 14:25 ` Kumar, Udit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®