* [PATCH 0/3] Meson8/Meson8b: add the ARM TWD timer
@ 2018-07-21 17:37 Martin Blumenstingl
2018-07-21 17:37 ` [PATCH 1/3] ARM: meson: select HAVE_ARM_TWD when SMP support is enabled Martin Blumenstingl
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Martin Blumenstingl @ 2018-07-21 17:37 UTC (permalink / raw)
To: linus-amlogic
Carlo sent a .dts patch for the ARM TWD (timer watchdog) a long time
ago: [0]
This patch was never applied. While resurrecting it I found out (by
trial and error) that the TWD clock is derived from the CPU clock by
dividing the existing CPU clock by 16. Additionally I found out that
the interrupt is defined incorrectly, leading to an error message
during boot: "GIC: PPI13 is secure or misconfigured".
Amlogic's GPL kernel does not use the TWD timer. However, it seems to
work fine for me and it fixes the following warnings during boot:
Clockevents: could not switch to one-shot mode:
Clockevents: could not switch to one-shot mode:
Clockevents: could not switch to one-shot mode:
Clockevents: could not switch to one-shot mode:
dummy_timer is not functional.
dummy_timer is not functional.
dummy_timer is not functional.
dummy_timer is not functional.
Could not switch to high resolution mode on CPU 0
Could not switch to high resolution mode on CPU 2
Could not switch to high resolution mode on CPU 3
Could not switch to high resolution mode on CPU 1
I chose not to split the interrupt line at 80 chars to make it easier
to read (in my opinion, other .dts are not splitting it either).
NOTE: This series depends on the following clock driver changes: [1]
[0] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-December/391928.html
[1] http://lists.infradead.org/pipermail/linux-amlogic/2018-July/007890.html
Martin Blumenstingl (3):
ARM: meson: select HAVE_ARM_TWD when SMP support is enabled
ARM: dts: meson8: add the ARM TWD timer
ARM: dts: meson8b: add the ARM TWD timer
arch/arm/boot/dts/meson8.dtsi | 7 +++++++
arch/arm/boot/dts/meson8b.dtsi | 7 +++++++
arch/arm/mach-meson/Kconfig | 1 +
3 files changed, 15 insertions(+)
--
2.18.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/3] ARM: meson: select HAVE_ARM_TWD when SMP support is enabled
2018-07-21 17:37 [PATCH 0/3] Meson8/Meson8b: add the ARM TWD timer Martin Blumenstingl
@ 2018-07-21 17:37 ` Martin Blumenstingl
2018-07-21 17:37 ` [PATCH 2/3] ARM: dts: meson8: add the ARM TWD timer Martin Blumenstingl
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Martin Blumenstingl @ 2018-07-21 17:37 UTC (permalink / raw)
To: linus-amlogic
The 32-bit Meson SoCs come with a per-core Cortex-A9 (Meson8 and
Meson8m2) or Cortex-A5 (Meson8b) "Timer-Watchdog (aka TWD), which
provides both a per-cpu local timer and watchdog".
Selecting HAVE_ARM_TWD allows adding a "arm,cortex-a5-twd-timer" or
"arm,cortex-a9-twd-timer" compatible timer to the SoC's .dts.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
arch/arm/mach-meson/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
index d51cfda953d4..27ae58f87406 100644
--- a/arch/arm/mach-meson/Kconfig
+++ b/arch/arm/mach-meson/Kconfig
@@ -10,6 +10,7 @@ menuconfig ARCH_MESON
select COMMON_CLK
select COMMON_CLK_AMLOGIC
select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
if ARCH_MESON
--
2.18.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 2/3] ARM: dts: meson8: add the ARM TWD timer
2018-07-21 17:37 [PATCH 0/3] Meson8/Meson8b: add the ARM TWD timer Martin Blumenstingl
2018-07-21 17:37 ` [PATCH 1/3] ARM: meson: select HAVE_ARM_TWD when SMP support is enabled Martin Blumenstingl
@ 2018-07-21 17:37 ` Martin Blumenstingl
2018-07-21 17:37 ` [PATCH 3/3] ARM: dts: meson8b: " Martin Blumenstingl
2018-07-21 18:58 ` [PATCH 0/3] Meson8/Meson8b: " Martin Blumenstingl
3 siblings, 0 replies; 5+ messages in thread
From: Martin Blumenstingl @ 2018-07-21 17:37 UTC (permalink / raw)
To: linus-amlogic
The Meson8 and Meson8m2 SoC are using four ARM Cortex-A9 cores which
come with a "TWD" (Timer-Watchdog) based timer. This adds support for
the ARM TWD Timer on these two SoCs.
Suggested-by: Carlo Caione <carlo@endlessm.com>
[ rebased patch from Carlo, use IRQ_TYPE_EDGE_RISING instead of
IRQ_TYPE_LEVEL_LOW to prevent "GIC: PPI13 is secure or misconfigured"
message during boot, use pre-processor macros to specify the IRQ,
dropped TWD watchdog node since there's no driver for it anymore ]
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
arch/arm/boot/dts/meson8.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
index d77dcf890cfc..4e3406edb61b 100644
--- a/arch/arm/boot/dts/meson8.dtsi
+++ b/arch/arm/boot/dts/meson8.dtsi
@@ -134,6 +134,13 @@
compatible = "arm,cortex-a9-scu";
reg = <0xc4300000 0x100>;
};
+
+ timer at c4300600 {
+ compatible = "arm,cortex-a9-twd-timer";
+ reg = <0xc4300600 0x20>;
+ interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
+ clocks = <&clkc CLKID_CPU_DIV16>;
+ };
}; /* end of / */
&aobus {
--
2.18.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 3/3] ARM: dts: meson8b: add the ARM TWD timer
2018-07-21 17:37 [PATCH 0/3] Meson8/Meson8b: add the ARM TWD timer Martin Blumenstingl
2018-07-21 17:37 ` [PATCH 1/3] ARM: meson: select HAVE_ARM_TWD when SMP support is enabled Martin Blumenstingl
2018-07-21 17:37 ` [PATCH 2/3] ARM: dts: meson8: add the ARM TWD timer Martin Blumenstingl
@ 2018-07-21 17:37 ` Martin Blumenstingl
2018-07-21 18:58 ` [PATCH 0/3] Meson8/Meson8b: " Martin Blumenstingl
3 siblings, 0 replies; 5+ messages in thread
From: Martin Blumenstingl @ 2018-07-21 17:37 UTC (permalink / raw)
To: linus-amlogic
The Meson8B SoC is using four ARM Cortex-A5 cores which come with a
"TWD" (Timer-Watchdog) based timer. This adds support for the ARM TWD
Timer on this SoC.
Suggested-by: Carlo Caione <carlo@endlessm.com>
[ rebased patch from Carlo, use IRQ_TYPE_EDGE_RISING instead of
IRQ_TYPE_LEVEL_LOW to prevent "GIC: PPI13 is secure or misconfigured"
message during boot, use pre-processor macros to specify the IRQ,
dropped TWD watchdog node since there's no driver for it anymore ]
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
arch/arm/boot/dts/meson8b.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
index 08f7f6be7254..d0443ae03c72 100644
--- a/arch/arm/boot/dts/meson8b.dtsi
+++ b/arch/arm/boot/dts/meson8b.dtsi
@@ -117,6 +117,13 @@
compatible = "arm,cortex-a5-scu";
reg = <0xc4300000 0x100>;
};
+
+ timer at c4300600 {
+ compatible = "arm,cortex-a5-twd-timer";
+ reg = <0xc4300600 0x20>;
+ interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
+ clocks = <&clkc CLKID_CPU_DIV16>;
+ };
}; /* end of / */
&aobus {
--
2.18.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 0/3] Meson8/Meson8b: add the ARM TWD timer
2018-07-21 17:37 [PATCH 0/3] Meson8/Meson8b: add the ARM TWD timer Martin Blumenstingl
` (2 preceding siblings ...)
2018-07-21 17:37 ` [PATCH 3/3] ARM: dts: meson8b: " Martin Blumenstingl
@ 2018-07-21 18:58 ` Martin Blumenstingl
3 siblings, 0 replies; 5+ messages in thread
From: Martin Blumenstingl @ 2018-07-21 18:58 UTC (permalink / raw)
To: linus-amlogic
On Sat, Jul 21, 2018 at 7:37 PM Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> Carlo sent a .dts patch for the ARM TWD (timer watchdog) a long time
> ago: [0]
> This patch was never applied. While resurrecting it I found out (by
> trial and error) that the TWD clock is derived from the CPU clock by
> dividing the existing CPU clock by 16. Additionally I found out that
> the interrupt is defined incorrectly, leading to an error message
> during boot: "GIC: PPI13 is secure or misconfigured".
>
> Amlogic's GPL kernel does not use the TWD timer. However, it seems to
> work fine for me and it fixes the following warnings during boot:
> Clockevents: could not switch to one-shot mode:
> Clockevents: could not switch to one-shot mode:
> Clockevents: could not switch to one-shot mode:
> Clockevents: could not switch to one-shot mode:
> dummy_timer is not functional.
> dummy_timer is not functional.
> dummy_timer is not functional.
> dummy_timer is not functional.
> Could not switch to high resolution mode on CPU 0
> Could not switch to high resolution mode on CPU 2
> Could not switch to high resolution mode on CPU 3
> Could not switch to high resolution mode on CPU 1
>
> I chose not to split the interrupt line at 80 chars to make it easier
> to read (in my opinion, other .dts are not splitting it either).
>
> NOTE: This series depends on the following clock driver changes: [1]
Kevin, please ignore this series
I just realized that it depends on a clock controller change I have in
my local tree which is not upstream yet
the TWD timer driver needs to load early in the boot process where the
clock controller driver is (currently) not loaded yet
I'll send patches for the clock controller driver and re-send this
afterwards - sorry for the noise
Regards
Martin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-07-21 18:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-21 17:37 [PATCH 0/3] Meson8/Meson8b: add the ARM TWD timer Martin Blumenstingl
2018-07-21 17:37 ` [PATCH 1/3] ARM: meson: select HAVE_ARM_TWD when SMP support is enabled Martin Blumenstingl
2018-07-21 17:37 ` [PATCH 2/3] ARM: dts: meson8: add the ARM TWD timer Martin Blumenstingl
2018-07-21 17:37 ` [PATCH 3/3] ARM: dts: meson8b: " Martin Blumenstingl
2018-07-21 18:58 ` [PATCH 0/3] Meson8/Meson8b: " Martin Blumenstingl
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®