linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-next 0/4] arm: am437x: use TWD/Global timers
@ 2015-08-12 19:56 Felipe Balbi
  2015-08-12 19:56 ` [PATCH-next 1/4] Revert "ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp" Felipe Balbi
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Felipe Balbi @ 2015-08-12 19:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

with these patches AM437x devices can use TWD/global timers.

At least TWD is now used as sched_clock() which gives better latency as seen
below. Keep in mind that while I ran cyclictest to have a feel for avg latency
this test was not against an RT kernel, so results should be taken with a
grain of salt.

Also, I'm not 100% sure clock rate is correct. According to TRM, this timer
should run as MPU_CLK/2 which would be 1GHz / 2 = 500MHz, but even though
I'm using dpll_mpu_m2_ck clock, it still shows as 1000MHz.

Are there any other tests I could/should run ? BTW, I boot-tested on AM4372
with and without 'nosmp' on cmdline.

pre-patch:
T: 0 (  245) P:95 I:1000 C:   9995 Min:     24 Act:   31 Avg:   36 Max:     596

post-patch:
T: 0 (  253) P:95 I:1000 C:   9995 Min:     10 Act:   12 Avg:   14 Max:      68


Changes since v1:
	- Rebased on top of today's linux-next (c1a0c66f231d Add linux-next
	  specific files for 20150812)

Felipe Balbi (4):
  Revert "ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op
    for nosmp"
  arm: boot: dts: am4372: add ARM timers and SCU nodes
  arm: omap2: Kconfig: select TWD and global timer on AM43xx devices
  arm: omap2: board-generic: use omap4_local_timer_init for AM437x

 arch/arm/boot/dts/am4372.dtsi       | 21 +++++++++++++++++++++
 arch/arm/kernel/smp_twd.c           |  4 ----
 arch/arm/mach-omap2/Kconfig         |  3 +++
 arch/arm/mach-omap2/board-generic.c |  2 +-
 4 files changed, 25 insertions(+), 5 deletions(-)

-- 
2.5.0

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

* [PATCH-next 1/4] Revert "ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp"
  2015-08-12 19:56 [PATCH-next 0/4] arm: am437x: use TWD/Global timers Felipe Balbi
@ 2015-08-12 19:56 ` Felipe Balbi
  2015-08-13 15:37   ` Russell King - ARM Linux
  2015-08-12 19:56 ` [PATCH-next 2/4] arm: boot: dts: am4372: add ARM timers and SCU nodes Felipe Balbi
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Felipe Balbi @ 2015-08-12 19:56 UTC (permalink / raw)
  To: linux-arm-kernel

This reverts commit 904464b91eca8c665acea033489225af02eeb75a.

The problem pointed out by commit 904464b91eca ("ARM: 7655/1:
smp_twd: make twd_local_timer_of_register() no-op for nosmp")
doesn't exist anymore.

We can safely boot with nosmp and the warning won't show up.

The other side benefit of this patch is that TWD has a chance
to probe on single-core A9 systems such as AM437x which sport
TWD.

Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Dirk Behme <dirk.behme@de.bosch.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 arch/arm/kernel/smp_twd.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index e9035cda1485..662ed88bc1f9 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -23,7 +23,6 @@
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
 
-#include <asm/smp_plat.h>
 #include <asm/smp_twd.h>
 
 /* set up by the platform code */
@@ -392,9 +391,6 @@ static void __init twd_local_timer_of_register(struct device_node *np)
 {
 	int err;
 
-	if (!is_smp() || !setup_max_cpus)
-		return;
-
 	twd_ppi = irq_of_parse_and_map(np, 0);
 	if (!twd_ppi) {
 		err = -EINVAL;
-- 
2.5.0

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

* [PATCH-next 2/4] arm: boot: dts: am4372: add ARM timers and SCU nodes
  2015-08-12 19:56 [PATCH-next 0/4] arm: am437x: use TWD/Global timers Felipe Balbi
  2015-08-12 19:56 ` [PATCH-next 1/4] Revert "ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp" Felipe Balbi
@ 2015-08-12 19:56 ` Felipe Balbi
  2015-08-13  8:32   ` Tony Lindgren
  2015-08-12 19:56 ` [PATCH-next 3/4] arm: omap2: Kconfig: select TWD and global timer on AM43xx devices Felipe Balbi
  2015-08-12 19:56 ` [PATCH-next 4/4] arm: omap2: board-generic: use omap4_local_timer_init for AM437x Felipe Balbi
  3 siblings, 1 reply; 9+ messages in thread
From: Felipe Balbi @ 2015-08-12 19:56 UTC (permalink / raw)
  To: linux-arm-kernel

AM437x devices sport SCU, TWD and Global timers,
let's add them to DTS so they have a chance to
probe and be used by Linux.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 arch/arm/boot/dts/am4372.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index 51feccfa0e0a..7dfc9d8bd003 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -64,6 +64,27 @@
 		interrupt-parent = <&gic>;
 	};
 
+	scu: scu at 48240000 {
+		compatible = "arm,cortex-a9-scu";
+		reg = <0x48240000 0x100>;
+	};
+
+	global_timer: timer at 48240200 {
+		compatible = "arm,cortex-a9-global-timer";
+		reg = <0x48240200 0x100>;
+		interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-parent = <&gic>;
+		clocks = <&dpll_mpu_m2_ck>;
+	};
+
+	local_timer: timer at 48240600 {
+		compatible = "arm,cortex-a9-twd-timer";
+		reg = <0x48240600 0x100>;
+		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-parent = <&gic>;
+		clocks = <&dpll_mpu_m2_ck>;
+	};
+
 	l2-cache-controller at 48242000 {
 		compatible = "arm,pl310-cache";
 		reg = <0x48242000 0x1000>;
-- 
2.5.0

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

* [PATCH-next 3/4] arm: omap2: Kconfig: select TWD and global timer on AM43xx devices
  2015-08-12 19:56 [PATCH-next 0/4] arm: am437x: use TWD/Global timers Felipe Balbi
  2015-08-12 19:56 ` [PATCH-next 1/4] Revert "ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp" Felipe Balbi
  2015-08-12 19:56 ` [PATCH-next 2/4] arm: boot: dts: am4372: add ARM timers and SCU nodes Felipe Balbi
@ 2015-08-12 19:56 ` Felipe Balbi
  2015-08-12 19:56 ` [PATCH-next 4/4] arm: omap2: board-generic: use omap4_local_timer_init for AM437x Felipe Balbi
  3 siblings, 0 replies; 9+ messages in thread
From: Felipe Balbi @ 2015-08-12 19:56 UTC (permalink / raw)
  To: linux-arm-kernel

Make sure to tell the kernel that AM437x has
TWD and global timers.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 arch/arm/mach-omap2/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 07d2e100caab..88ef10b2d415 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -63,6 +63,9 @@ config SOC_AM43XX
 	select MACH_OMAP_GENERIC
 	select MIGHT_HAVE_CACHE_L2X0
 	select HAVE_ARM_SCU
+	select HAVE_ARM_TWD
+	select ARM_GLOBAL_TIMER
+	select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
 
 config SOC_DRA7XX
 	bool "TI DRA7XX"
-- 
2.5.0

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

* [PATCH-next 4/4] arm: omap2: board-generic: use omap4_local_timer_init for AM437x
  2015-08-12 19:56 [PATCH-next 0/4] arm: am437x: use TWD/Global timers Felipe Balbi
                   ` (2 preceding siblings ...)
  2015-08-12 19:56 ` [PATCH-next 3/4] arm: omap2: Kconfig: select TWD and global timer on AM43xx devices Felipe Balbi
@ 2015-08-12 19:56 ` Felipe Balbi
  3 siblings, 0 replies; 9+ messages in thread
From: Felipe Balbi @ 2015-08-12 19:56 UTC (permalink / raw)
  To: linux-arm-kernel

AM437x-based boards, can use omap4_local_timer_init()
just fine. Let's use that instead.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 arch/arm/mach-omap2/board-generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 24c9afc9e8a7..89bf39663d61 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -279,7 +279,7 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
 	.init_late	= am43xx_init_late,
 	.init_irq	= omap_gic_of_init,
 	.init_machine	= omap_generic_init,
-	.init_time	= omap3_gptimer_timer_init,
+	.init_time	= omap4_local_timer_init,
 	.dt_compat	= am43_boards_compat,
 	.restart	= omap44xx_restart,
 MACHINE_END
-- 
2.5.0

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

* [PATCH-next 2/4] arm: boot: dts: am4372: add ARM timers and SCU nodes
  2015-08-12 19:56 ` [PATCH-next 2/4] arm: boot: dts: am4372: add ARM timers and SCU nodes Felipe Balbi
@ 2015-08-13  8:32   ` Tony Lindgren
  2015-08-13 15:01     ` Felipe Balbi
  0 siblings, 1 reply; 9+ messages in thread
From: Tony Lindgren @ 2015-08-13  8:32 UTC (permalink / raw)
  To: linux-arm-kernel

* Felipe Balbi <balbi@ti.com> [150812 13:00]:
> AM437x devices sport SCU, TWD and Global timers,
> let's add them to DTS so they have a chance to
> probe and be used by Linux.

Applying this one into omap-for-v4.3/dt-v2. Not sure
if it will get merged as we're getting close to the
merge window. The rest we can patch once Russell has
reverted the bogus SMP dependency.

Regards,

Tony

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

* [PATCH-next 2/4] arm: boot: dts: am4372: add ARM timers and SCU nodes
  2015-08-13  8:32   ` Tony Lindgren
@ 2015-08-13 15:01     ` Felipe Balbi
  0 siblings, 0 replies; 9+ messages in thread
From: Felipe Balbi @ 2015-08-13 15:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 13, 2015 at 01:32:15AM -0700, Tony Lindgren wrote:
> * Felipe Balbi <balbi@ti.com> [150812 13:00]:
> > AM437x devices sport SCU, TWD and Global timers,
> > let's add them to DTS so they have a chance to
> > probe and be used by Linux.
> 
> Applying this one into omap-for-v4.3/dt-v2. Not sure
> if it will get merged as we're getting close to the
> merge window. The rest we can patch once Russell has
> reverted the bogus SMP dependency.

I'm just waiting for Russell's "it's okay to post on patch system".

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150813/a9e68a66/attachment-0001.sig>

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

* [PATCH-next 1/4] Revert "ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp"
  2015-08-12 19:56 ` [PATCH-next 1/4] Revert "ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp" Felipe Balbi
@ 2015-08-13 15:37   ` Russell King - ARM Linux
  2015-08-13 15:47     ` Felipe Balbi
  0 siblings, 1 reply; 9+ messages in thread
From: Russell King - ARM Linux @ 2015-08-13 15:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 12, 2015 at 02:56:53PM -0500, Felipe Balbi wrote:
> This reverts commit 904464b91eca8c665acea033489225af02eeb75a.
> 
> The problem pointed out by commit 904464b91eca ("ARM: 7655/1:
> smp_twd: make twd_local_timer_of_register() no-op for nosmp")
> doesn't exist anymore.
> 
> We can safely boot with nosmp and the warning won't show up.
> 
> The other side benefit of this patch is that TWD has a chance
> to probe on single-core A9 systems such as AM437x which sport
> TWD.

I don't remember all the details from Feb 2013 on why we made that
change.  If this is proven safe, then I guess it's okay.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

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

* [PATCH-next 1/4] Revert "ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp"
  2015-08-13 15:37   ` Russell King - ARM Linux
@ 2015-08-13 15:47     ` Felipe Balbi
  0 siblings, 0 replies; 9+ messages in thread
From: Felipe Balbi @ 2015-08-13 15:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 13, 2015 at 04:37:07PM +0100, Russell King - ARM Linux wrote:
> On Wed, Aug 12, 2015 at 02:56:53PM -0500, Felipe Balbi wrote:
> > This reverts commit 904464b91eca8c665acea033489225af02eeb75a.
> > 
> > The problem pointed out by commit 904464b91eca ("ARM: 7655/1:
> > smp_twd: make twd_local_timer_of_register() no-op for nosmp")
> > doesn't exist anymore.
> > 
> > We can safely boot with nosmp and the warning won't show up.
> > 
> > The other side benefit of this patch is that TWD has a chance
> > to probe on single-core A9 systems such as AM437x which sport
> > TWD.
> 
> I don't remember all the details from Feb 2013 on why we made that
> change.  If this is proven safe, then I guess it's okay.

Do you want me to upload to your patch system and, perhaps, keep in
linux-next for v4.4 merge window ? (too late for v4.3 I guess).

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150813/67ef08f1/attachment-0001.sig>

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

end of thread, other threads:[~2015-08-13 15:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-12 19:56 [PATCH-next 0/4] arm: am437x: use TWD/Global timers Felipe Balbi
2015-08-12 19:56 ` [PATCH-next 1/4] Revert "ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp" Felipe Balbi
2015-08-13 15:37   ` Russell King - ARM Linux
2015-08-13 15:47     ` Felipe Balbi
2015-08-12 19:56 ` [PATCH-next 2/4] arm: boot: dts: am4372: add ARM timers and SCU nodes Felipe Balbi
2015-08-13  8:32   ` Tony Lindgren
2015-08-13 15:01     ` Felipe Balbi
2015-08-12 19:56 ` [PATCH-next 3/4] arm: omap2: Kconfig: select TWD and global timer on AM43xx devices Felipe Balbi
2015-08-12 19:56 ` [PATCH-next 4/4] arm: omap2: board-generic: use omap4_local_timer_init for AM437x Felipe Balbi

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).