* [PATCH] clocksource/drivers/timer-ti-dm: fix regression from errata i940 fix
@ 2022-02-02 21:25 Drew Fustini
2022-02-02 21:33 ` Suman Anna
2022-02-03 6:53 ` Tony Lindgren
0 siblings, 2 replies; 5+ messages in thread
From: Drew Fustini @ 2022-02-02 21:25 UTC (permalink / raw)
To: Tony Lindgren, Daniel Lezcano, Keerthy, linux-kernel, linux-omap,
linux-arm-kernel, Tero Kristo, khilman, s-anna
Cc: Drew Fustini
The existing fix for errata i940 causes a conflict for IPU2 which is
using timer 3 and 4. From arch/arm/boot/dts/dra7-ipu-dsp-common.dtsi:
&ipu2 {
mboxes = <&mailbox6 &mbox_ipu2_ipc3x>;
ti,timers = <&timer3>;
ti,watchdog-timers = <&timer4>, <&timer9>;
};
I discovered the timer conflict from when booting mainline on a
BeagleBoard X15 (AM5728):
remoteproc remoteproc1: 55020000.ipu is available
remoteproc remoteproc1: powering up 55020000.ipu
remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4
omap-rproc 55020000.ipu: could not get timer platform device
omap-rproc 55020000.ipu: omap_rproc_enable_timers failed: -19
remoteproc remoteproc1: can't start rproc 55020000.ipu: -19
I modified the errata fix to use timer 15 and 16 instead which resolves
the timer conflict.
Fixes: 25de4ce5ed02 ("clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940")
Link: https://lore.kernel.org/linux-omap/YfWsG0p6to3IJuvE@x1/
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
---
Note: I am keeping the device tree and driver change together in one
patch as that is how the original errata fix commit was structured.
arch/arm/boot/dts/dra7-l4.dtsi | 5 ++---
arch/arm/boot/dts/dra7.dtsi | 8 ++++----
drivers/clocksource/timer-ti-dm-systimer.c | 4 ++--
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/arch/arm/boot/dts/dra7-l4.dtsi b/arch/arm/boot/dts/dra7-l4.dtsi
index 956a26d52a4c..0a11bacffc1f 100644
--- a/arch/arm/boot/dts/dra7-l4.dtsi
+++ b/arch/arm/boot/dts/dra7-l4.dtsi
@@ -3482,8 +3482,7 @@ timer14: timer@0 {
ti,timer-pwm;
};
};
-
- target-module@2c000 { /* 0x4882c000, ap 17 02.0 */
+ timer15_target: target-module@2c000 { /* 0x4882c000, ap 17 02.0 */
compatible = "ti,sysc-omap4-timer", "ti,sysc";
reg = <0x2c000 0x4>,
<0x2c010 0x4>;
@@ -3511,7 +3510,7 @@ timer15: timer@0 {
};
};
- target-module@2e000 { /* 0x4882e000, ap 19 14.0 */
+ timer16_target: target-module@2e000 { /* 0x4882e000, ap 19 14.0 */
compatible = "ti,sysc-omap4-timer", "ti,sysc";
reg = <0x2e000 0x4>,
<0x2e010 0x4>;
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 6b485cbed8d5..8f7ffe2f66e9 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -1339,20 +1339,20 @@ timer@0 {
};
/* Local timers, see ARM architected timer wrap erratum i940 */
-&timer3_target {
+&timer15_target {
ti,no-reset-on-init;
ti,no-idle;
timer@0 {
- assigned-clocks = <&l4per_clkctrl DRA7_L4PER_TIMER3_CLKCTRL 24>;
+ assigned-clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER15_CLKCTRL 24>;
assigned-clock-parents = <&timer_sys_clk_div>;
};
};
-&timer4_target {
+&timer16_target {
ti,no-reset-on-init;
ti,no-idle;
timer@0 {
- assigned-clocks = <&l4per_clkctrl DRA7_L4PER_TIMER4_CLKCTRL 24>;
+ assigned-clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER16_CLKCTRL 24>;
assigned-clock-parents = <&timer_sys_clk_div>;
};
};
diff --git a/drivers/clocksource/timer-ti-dm-systimer.c b/drivers/clocksource/timer-ti-dm-systimer.c
index b6f97960d8ee..c706d63e9f5c 100644
--- a/drivers/clocksource/timer-ti-dm-systimer.c
+++ b/drivers/clocksource/timer-ti-dm-systimer.c
@@ -695,9 +695,9 @@ static int __init dmtimer_percpu_quirk_init(struct device_node *np, u32 pa)
return 0;
}
- if (pa == 0x48034000) /* dra7 dmtimer3 */
+ if (pa == 0x4882C000) /* dra7 dmtimer15 */
return dmtimer_percpu_timer_init(np, 0);
- else if (pa == 0x48036000) /* dra7 dmtimer4 */
+ else if (pa == 0x4882E000) /* dra7 dmtimer16 */
return dmtimer_percpu_timer_init(np, 1);
return 0;
--
2.32.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] clocksource/drivers/timer-ti-dm: fix regression from errata i940 fix
2022-02-02 21:25 [PATCH] clocksource/drivers/timer-ti-dm: fix regression from errata i940 fix Drew Fustini
@ 2022-02-02 21:33 ` Suman Anna
2022-02-02 21:36 ` Drew Fustini
2022-02-03 6:53 ` Tony Lindgren
1 sibling, 1 reply; 5+ messages in thread
From: Suman Anna @ 2022-02-02 21:33 UTC (permalink / raw)
To: Drew Fustini, Tony Lindgren, Daniel Lezcano, Keerthy,
linux-kernel, linux-omap, linux-arm-kernel, Tero Kristo, khilman
On 2/2/22 15:25, Drew Fustini wrote:
> The existing fix for errata i940 causes a conflict for IPU2 which is
> using timer 3 and 4. From arch/arm/boot/dts/dra7-ipu-dsp-common.dtsi:
>
> &ipu2 {
> mboxes = <&mailbox6 &mbox_ipu2_ipc3x>;
> ti,timers = <&timer3>;
> ti,watchdog-timers = <&timer4>, <&timer9>;
> };
>
> I discovered the timer conflict from when booting mainline on a
> BeagleBoard X15 (AM5728):
>
> remoteproc remoteproc1: 55020000.ipu is available
> remoteproc remoteproc1: powering up 55020000.ipu
> remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4
> omap-rproc 55020000.ipu: could not get timer platform device
> omap-rproc 55020000.ipu: omap_rproc_enable_timers failed: -19
> remoteproc remoteproc1: can't start rproc 55020000.ipu: -19
>
> I modified the errata fix to use timer 15 and 16 instead which resolves
> the timer conflict.
>
> Fixes: 25de4ce5ed02 ("clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940")
> Link: https://lore.kernel.org/linux-omap/YfWsG0p6to3IJuvE@x1/
Suggested-by: Suman Anna <s-anna@ti.com>
regards
Suman
> Signed-off-by: Drew Fustini <dfustini@baylibre.com>
> ---
> Note: I am keeping the device tree and driver change together in one
> patch as that is how the original errata fix commit was structured.
>
> arch/arm/boot/dts/dra7-l4.dtsi | 5 ++---
> arch/arm/boot/dts/dra7.dtsi | 8 ++++----
> drivers/clocksource/timer-ti-dm-systimer.c | 4 ++--
> 3 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/boot/dts/dra7-l4.dtsi b/arch/arm/boot/dts/dra7-l4.dtsi
> index 956a26d52a4c..0a11bacffc1f 100644
> --- a/arch/arm/boot/dts/dra7-l4.dtsi
> +++ b/arch/arm/boot/dts/dra7-l4.dtsi
> @@ -3482,8 +3482,7 @@ timer14: timer@0 {
> ti,timer-pwm;
> };
> };
> -
> - target-module@2c000 { /* 0x4882c000, ap 17 02.0 */
> + timer15_target: target-module@2c000 { /* 0x4882c000, ap 17 02.0 */
> compatible = "ti,sysc-omap4-timer", "ti,sysc";
> reg = <0x2c000 0x4>,
> <0x2c010 0x4>;
> @@ -3511,7 +3510,7 @@ timer15: timer@0 {
> };
> };
>
> - target-module@2e000 { /* 0x4882e000, ap 19 14.0 */
> + timer16_target: target-module@2e000 { /* 0x4882e000, ap 19 14.0 */
> compatible = "ti,sysc-omap4-timer", "ti,sysc";
> reg = <0x2e000 0x4>,
> <0x2e010 0x4>;
> diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
> index 6b485cbed8d5..8f7ffe2f66e9 100644
> --- a/arch/arm/boot/dts/dra7.dtsi
> +++ b/arch/arm/boot/dts/dra7.dtsi
> @@ -1339,20 +1339,20 @@ timer@0 {
> };
>
> /* Local timers, see ARM architected timer wrap erratum i940 */
> -&timer3_target {
> +&timer15_target {
> ti,no-reset-on-init;
> ti,no-idle;
> timer@0 {
> - assigned-clocks = <&l4per_clkctrl DRA7_L4PER_TIMER3_CLKCTRL 24>;
> + assigned-clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER15_CLKCTRL 24>;
> assigned-clock-parents = <&timer_sys_clk_div>;
> };
> };
>
> -&timer4_target {
> +&timer16_target {
> ti,no-reset-on-init;
> ti,no-idle;
> timer@0 {
> - assigned-clocks = <&l4per_clkctrl DRA7_L4PER_TIMER4_CLKCTRL 24>;
> + assigned-clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER16_CLKCTRL 24>;
> assigned-clock-parents = <&timer_sys_clk_div>;
> };
> };
> diff --git a/drivers/clocksource/timer-ti-dm-systimer.c b/drivers/clocksource/timer-ti-dm-systimer.c
> index b6f97960d8ee..c706d63e9f5c 100644
> --- a/drivers/clocksource/timer-ti-dm-systimer.c
> +++ b/drivers/clocksource/timer-ti-dm-systimer.c
> @@ -695,9 +695,9 @@ static int __init dmtimer_percpu_quirk_init(struct device_node *np, u32 pa)
> return 0;
> }
>
> - if (pa == 0x48034000) /* dra7 dmtimer3 */
> + if (pa == 0x4882C000) /* dra7 dmtimer15 */
> return dmtimer_percpu_timer_init(np, 0);
> - else if (pa == 0x48036000) /* dra7 dmtimer4 */
> + else if (pa == 0x4882E000) /* dra7 dmtimer16 */
> return dmtimer_percpu_timer_init(np, 1);
>
> return 0;
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] clocksource/drivers/timer-ti-dm: fix regression from errata i940 fix
2022-02-02 21:33 ` Suman Anna
@ 2022-02-02 21:36 ` Drew Fustini
0 siblings, 0 replies; 5+ messages in thread
From: Drew Fustini @ 2022-02-02 21:36 UTC (permalink / raw)
To: Suman Anna
Cc: Tony Lindgren, Daniel Lezcano, Keerthy, linux-kernel, linux-omap,
linux-arm-kernel, Tero Kristo, khilman
On Wed, Feb 02, 2022 at 03:33:45PM -0600, Suman Anna wrote:
> On 2/2/22 15:25, Drew Fustini wrote:
> > The existing fix for errata i940 causes a conflict for IPU2 which is
> > using timer 3 and 4. From arch/arm/boot/dts/dra7-ipu-dsp-common.dtsi:
> >
> > &ipu2 {
> > mboxes = <&mailbox6 &mbox_ipu2_ipc3x>;
> > ti,timers = <&timer3>;
> > ti,watchdog-timers = <&timer4>, <&timer9>;
> > };
> >
> > I discovered the timer conflict from when booting mainline on a
> > BeagleBoard X15 (AM5728):
> >
> > remoteproc remoteproc1: 55020000.ipu is available
> > remoteproc remoteproc1: powering up 55020000.ipu
> > remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4
> > omap-rproc 55020000.ipu: could not get timer platform device
> > omap-rproc 55020000.ipu: omap_rproc_enable_timers failed: -19
> > remoteproc remoteproc1: can't start rproc 55020000.ipu: -19
> >
> > I modified the errata fix to use timer 15 and 16 instead which resolves
> > the timer conflict.
> >
> > Fixes: 25de4ce5ed02 ("clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940")
> > Link: https://lore.kernel.org/linux-omap/YfWsG0p6to3IJuvE@x1/
>
> Suggested-by: Suman Anna <s-anna@ti.com>
Yes, thank you for adding.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clocksource/drivers/timer-ti-dm: fix regression from errata i940 fix
2022-02-02 21:25 [PATCH] clocksource/drivers/timer-ti-dm: fix regression from errata i940 fix Drew Fustini
2022-02-02 21:33 ` Suman Anna
@ 2022-02-03 6:53 ` Tony Lindgren
2022-02-03 15:56 ` Suman Anna
1 sibling, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2022-02-03 6:53 UTC (permalink / raw)
To: Drew Fustini
Cc: Tero Kristo, Keerthy, Daniel Lezcano, linux-kernel, khilman,
linux-omap, linux-arm-kernel
* Drew Fustini <dfustini@baylibre.com> [220202 23:26]:
> I modified the errata fix to use timer 15 and 16 instead which resolves
> the timer conflict.
Makes sens to me, just one nit below.
> Note: I am keeping the device tree and driver change together in one
> patch as that is how the original errata fix commit was structured.
Yes.. The old dtb handling for the timer driver causes this dependency
unfortunately.
> --- a/drivers/clocksource/timer-ti-dm-systimer.c
> +++ b/drivers/clocksource/timer-ti-dm-systimer.c
> @@ -695,9 +695,9 @@ static int __init dmtimer_percpu_quirk_init(struct device_node *np, u32 pa)
> return 0;
> }
>
> - if (pa == 0x48034000) /* dra7 dmtimer3 */
> + if (pa == 0x4882C000) /* dra7 dmtimer15 */
> return dmtimer_percpu_timer_init(np, 0);
> - else if (pa == 0x48036000) /* dra7 dmtimer4 */
> + else if (pa == 0x4882E000) /* dra7 dmtimer16 */
> return dmtimer_percpu_timer_init(np, 1);
>
> return 0;
Linux use lower case hex number typically :)
With that, please feel free to add:
Reviewed-by: Tony Lindgren <tony@atomide.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clocksource/drivers/timer-ti-dm: fix regression from errata i940 fix
2022-02-03 6:53 ` Tony Lindgren
@ 2022-02-03 15:56 ` Suman Anna
0 siblings, 0 replies; 5+ messages in thread
From: Suman Anna @ 2022-02-03 15:56 UTC (permalink / raw)
To: Tony Lindgren, Drew Fustini
Cc: Daniel Lezcano, Keerthy, linux-kernel, linux-omap,
linux-arm-kernel, Tero Kristo, khilman
Hi Drew,
On 2/3/22 00:53, Tony Lindgren wrote:
> * Drew Fustini <dfustini@baylibre.com> [220202 23:26]:
>> I modified the errata fix to use timer 15 and 16 instead which resolves
>> the timer conflict.
>
> Makes sens to me, just one nit below.
>
>> Note: I am keeping the device tree and driver change together in one
>> patch as that is how the original errata fix commit was structured.
>
> Yes.. The old dtb handling for the timer driver causes this dependency
> unfortunately.
Can you also add the cyclictest info to the commit log when you repost v2?
regards
Suman
>
>> --- a/drivers/clocksource/timer-ti-dm-systimer.c
>> +++ b/drivers/clocksource/timer-ti-dm-systimer.c
>> @@ -695,9 +695,9 @@ static int __init dmtimer_percpu_quirk_init(struct device_node *np, u32 pa)
>> return 0;
>> }
>>
>> - if (pa == 0x48034000) /* dra7 dmtimer3 */
>> + if (pa == 0x4882C000) /* dra7 dmtimer15 */
>> return dmtimer_percpu_timer_init(np, 0);
>> - else if (pa == 0x48036000) /* dra7 dmtimer4 */
>> + else if (pa == 0x4882E000) /* dra7 dmtimer16 */
>> return dmtimer_percpu_timer_init(np, 1);
>>
>> return 0;
>
> Linux use lower case hex number typically :)
>
> With that, please feel free to add:
>
> Reviewed-by: Tony Lindgren <tony@atomide.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-02-03 15:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-02 21:25 [PATCH] clocksource/drivers/timer-ti-dm: fix regression from errata i940 fix Drew Fustini
2022-02-02 21:33 ` Suman Anna
2022-02-02 21:36 ` Drew Fustini
2022-02-03 6:53 ` Tony Lindgren
2022-02-03 15:56 ` Suman Anna
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).