linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] AM57 timer fixes
@ 2025-09-01 10:15 Anurag Dutta
  2025-09-01 10:15 ` [PATCH v2 1/2] bus: ti-sysc: Add DRA7 SoC matching Anurag Dutta
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anurag Dutta @ 2025-09-01 10:15 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

Changelog: v1:
1. Modified commit messages and subject according to review comments

Sinthu Raja (2):
  bus: ti-sysc: Add DRA7 SoC matching
  ARM: dts: ti: omap: 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] 4+ messages in thread

* [PATCH v2 1/2] bus: ti-sysc: Add DRA7 SoC matching
  2025-09-01 10:15 [PATCH v2 0/2] AM57 timer fixes Anurag Dutta
@ 2025-09-01 10:15 ` Anurag Dutta
  2025-09-01 10:15 ` [PATCH v2 2/2] ARM: dts: ti: omap: Use DMTimer as Clocksource instead of counter_32k Anurag Dutta
  2025-09-02 13:18 ` [PATCH v2 0/2] AM57 timer fixes Rob Herring (Arm)
  2 siblings, 0 replies; 4+ messages in thread
From: Anurag Dutta @ 2025-09-01 10:15 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. This tags the system timer as reserved and probes it without
probing any interconnected target child devices.

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 related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] ARM: dts: ti: omap: Use DMTimer as Clocksource instead of counter_32k
  2025-09-01 10:15 [PATCH v2 0/2] AM57 timer fixes Anurag Dutta
  2025-09-01 10:15 ` [PATCH v2 1/2] bus: ti-sysc: Add DRA7 SoC matching Anurag Dutta
@ 2025-09-01 10:15 ` Anurag Dutta
  2025-09-02 13:18 ` [PATCH v2 0/2] AM57 timer fixes Rob Herring (Arm)
  2 siblings, 0 replies; 4+ messages in thread
From: Anurag Dutta @ 2025-09-01 10:15 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..0e0b5364be2b 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 related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/2] AM57 timer fixes
  2025-09-01 10:15 [PATCH v2 0/2] AM57 timer fixes Anurag Dutta
  2025-09-01 10:15 ` [PATCH v2 1/2] bus: ti-sysc: Add DRA7 SoC matching Anurag Dutta
  2025-09-01 10:15 ` [PATCH v2 2/2] ARM: dts: ti: omap: Use DMTimer as Clocksource instead of counter_32k Anurag Dutta
@ 2025-09-02 13:18 ` Rob Herring (Arm)
  2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring (Arm) @ 2025-09-02 13:18 UTC (permalink / raw)
  To: Anurag Dutta
  Cc: tony, u-kumar1, linux-omap, andreas, linux-kernel, aaro.koskinen,
	rogerq, khilman, vigneshr


On Mon, 01 Sep 2025 15:45:23 +0530, Anurag Dutta wrote:
> 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
> 
> Changelog: v1:
> 1. Modified commit messages and subject according to review comments
> 
> Sinthu Raja (2):
>   bus: ti-sysc: Add DRA7 SoC matching
>   ARM: dts: ti: omap: 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
> 
> 
> 


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

  pip3 install dtschema --upgrade


This patch series was applied (using b4) to base:
 Base: attempting to guess base-commit...
 Base: tags/next-20250829 (exact match)

If this is not the correct base, please add 'base-commit' tag
(or use b4 which does this automatically)

New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/ti/' for 20250901101525.1090334-1-a-dutta@ti.com:

arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dtb: serial@0 (ti,dra742-uart): {'compatible': ['ti,dra742-uart'], 'reg': [[0, 256]], 'interrupts': [[0, 69, 4]], 'clock-frequency': 48000000, 'status': ['okay'], 'dmas': [[153, 53], [153, 54]], 'dma-names': ['tx', 'rx'], 'interrupts-extended': [[1, 0, 69, 4], [154, 1016]], 'phandle': 390, '$nodename': ['serial@0']} is valid under each of {'required': ['interrupts-extended']}, {'required': ['interrupts']}
	from schema $id: http://devicetree.org/schemas/serial/8250_omap.yaml#
arch/arm/boot/dts/ti/omap/am57xx-beagle-x15-revc.dtb: serial@0 (ti,dra742-uart): {'compatible': ['ti,dra742-uart'], 'reg': [[0, 256]], 'interrupts': [[0, 69, 4]], 'clock-frequency': 48000000, 'status': ['okay'], 'dmas': [[153, 53], [153, 54]], 'dma-names': ['tx', 'rx'], 'interrupts-extended': [[1, 0, 69, 4], [154, 1016]], 'phandle': 389, '$nodename': ['serial@0']} is valid under each of {'required': ['interrupts-extended']}, {'required': ['interrupts']}
	from schema $id: http://devicetree.org/schemas/serial/8250_omap.yaml#
arch/arm/boot/dts/ti/omap/dra76-evm.dtb: ocmcram@40400000 (mmio-sram): $nodename:0: 'ocmcram@40400000' does not match '^sram(@.*)?'
	from schema $id: http://devicetree.org/schemas/sram/sram.yaml#






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-02 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01 10:15 [PATCH v2 0/2] AM57 timer fixes Anurag Dutta
2025-09-01 10:15 ` [PATCH v2 1/2] bus: ti-sysc: Add DRA7 SoC matching Anurag Dutta
2025-09-01 10:15 ` [PATCH v2 2/2] ARM: dts: ti: omap: Use DMTimer as Clocksource instead of counter_32k Anurag Dutta
2025-09-02 13:18 ` [PATCH v2 0/2] AM57 timer fixes Rob Herring (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).