linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Versatile Express: add support for local timers on CA9X4 daughterboard
@ 2010-06-07  9:53 Will Deacon
  2010-06-30 12:49 ` Will Deacon
  2010-07-09 10:16 ` Russell King - ARM Linux
  0 siblings, 2 replies; 6+ messages in thread
From: Will Deacon @ 2010-06-07  9:53 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds support for the Cortex-A9 local timers available when
using the CA9X4 daughterboard with the Versatile Express.

Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm/Kconfig                               |    5 +++--
 arch/arm/mach-vexpress/ct-ca9x4.c              |   14 ++++++++------
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h |    1 +
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 98922f7..7b117b1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1172,9 +1172,10 @@ config HOTPLUG_CPU
 config LOCAL_TIMERS
 	bool "Use local timer interrupts"
 	depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || \
-		REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500)
+		REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
+		ARCH_U8500 || ARCH_VEXPRESS_CA9X4)
 	default y
-	select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500)
+	select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_VEXPRESS || ARCH_OMAP4 || ARCH_U8500)
 	help
 	  Enable support for local timers on SMP platforms, rather then the
 	  legacy IPI broadcast method.  Local timers allows the system
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index e6f7303..3762fc8 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -14,6 +14,7 @@
 #include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/pmu.h>
+#include <asm/smp_twd.h>
 
 #include <mach/clkdev.h>
 #include <mach/ct-ca9x4.h>
@@ -63,20 +64,25 @@ static void __init ct_ca9x4_init_irq(void)
 	gic_cpu_init(0, gic_cpu_base_addr);
 }
 
-#if 0
 static void ct_ca9x4_timer_init(void)
 {
+#if 0
 	writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL);
 	writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL);
 
 	sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1));
 	sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0);
+#endif
+
+#ifdef CONFIG_LOCAL_TIMERS
+	twd_base = MMIO_P2V(A9_MPCORE_TWD);
+#endif
+	v2m_timer.init();
 }
 
 static struct sys_timer ct_ca9x4_timer = {
 	.init	= ct_ca9x4_timer_init,
 };
-#endif
 
 static struct clcd_panel xvga_panel = {
 	.mode		= {
@@ -240,10 +246,6 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4")
 	.boot_params	= PHYS_OFFSET + 0x00000100,
 	.map_io		= ct_ca9x4_map_io,
 	.init_irq	= ct_ca9x4_init_irq,
-#if 0
 	.timer		= &ct_ca9x4_timer,
-#else
-	.timer		= &v2m_timer,
-#endif
 	.init_machine	= ct_ca9x4_init,
 MACHINE_END
diff --git a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
index 8650f04..f9e2f8d 100644
--- a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
+++ b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
@@ -28,6 +28,7 @@
 #define A9_MPCORE_SCU		(CT_CA9X4_MPIC + 0x0000)
 #define A9_MPCORE_GIC_CPU	(CT_CA9X4_MPIC + 0x0100)
 #define A9_MPCORE_GIT		(CT_CA9X4_MPIC + 0x0200)
+#define A9_MPCORE_TWD		(CT_CA9X4_MPIC + 0x0600)
 #define A9_MPCORE_GIC_DIST	(CT_CA9X4_MPIC + 0x1000)
 
 /*
-- 
1.6.3.3

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

* [PATCH] Versatile Express: add support for local timers on CA9X4 daughterboard
  2010-06-07  9:53 [PATCH] Versatile Express: add support for local timers on CA9X4 daughterboard Will Deacon
@ 2010-06-30 12:49 ` Will Deacon
  2010-07-09 10:16 ` Russell King - ARM Linux
  1 sibling, 0 replies; 6+ messages in thread
From: Will Deacon @ 2010-06-30 12:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Russell,

> [PATCH] Versatile Express: add support for local timers on CA9X4 daughterboard
> 
> This patch adds support for the Cortex-A9 local timers available when
> using the CA9X4 daughterboard with the Versatile Express.
> 
> Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
>  arch/arm/Kconfig                               |    5 +++--
>  arch/arm/mach-vexpress/ct-ca9x4.c              |   14 ++++++++------
>  arch/arm/mach-vexpress/include/mach/ct-ca9x4.h |    1 +
>  3 files changed, 12 insertions(+), 8 deletions(-)
> 

Do you have any objections to this patch, or can I submit it to
the patch system please? There are some timer init functions
in ct-ca9x4.c that are commented out so I'd like to make sure
I'm not interfering with any future plans.

Thanks,

Will

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

* [PATCH] Versatile Express: add support for local timers on CA9X4 daughterboard
  2010-06-07  9:53 [PATCH] Versatile Express: add support for local timers on CA9X4 daughterboard Will Deacon
  2010-06-30 12:49 ` Will Deacon
@ 2010-07-09 10:16 ` Russell King - ARM Linux
  2010-07-09 12:22   ` Will Deacon
  1 sibling, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2010-07-09 10:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 07, 2010 at 10:53:50AM +0100, Will Deacon wrote:
> This patch adds support for the Cortex-A9 local timers available when
> using the CA9X4 daughterboard with the Versatile Express.

I'd rather we didn't change the timer stuff like this - all that you
seem to want is some way to setup the twd base address.  Can this be
done via .map_io method instead?

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

* [PATCH] Versatile Express: add support for local timers on CA9X4 daughterboard
  2010-07-09 10:16 ` Russell King - ARM Linux
@ 2010-07-09 12:22   ` Will Deacon
  2010-07-09 12:43     ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: Will Deacon @ 2010-07-09 12:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Russell,

> On Mon, Jun 07, 2010 at 10:53:50AM +0100, Will Deacon wrote:
> > This patch adds support for the Cortex-A9 local timers available when
> > using the CA9X4 daughterboard with the Versatile Express.
> 
> I'd rather we didn't change the timer stuff like this - all that you
> seem to want is some way to setup the twd base address.  Can this be
> done via .map_io method instead?

That's a lot tidier, how about something like this?:

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 98922f7..7b117b1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1172,9 +1172,10 @@ config HOTPLUG_CPU
 config LOCAL_TIMERS
        bool "Use local timer interrupts"
        depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || \
-               REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500)
+               REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
+               ARCH_U8500 || ARCH_VEXPRESS_CA9X4)
        default y
-       select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500)
+       select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_VEXPRESS || ARCH_OMAP4 || ARCH_U8500)
        help
          Enable support for local timers on SMP platforms, rather then the
          legacy IPI broadcast method.  Local timers allows the system
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index 6353459..577df6c 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -16,6 +16,7 @@
 #include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/pmu.h>
+#include <asm/smp_twd.h>
 
 #include <mach/clkdev.h>
 #include <mach/ct-ca9x4.h>
@@ -53,6 +54,7 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = {
 
 static void __init ct_ca9x4_map_io(void)
 {
+       twd_base = MMIO_P2V(A9_MPCORE_TWD);
        v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
 }
 
diff --git a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
index 8650f04..f9e2f8d 100644
--- a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
+++ b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
@@ -28,6 +28,7 @@
 #define A9_MPCORE_SCU          (CT_CA9X4_MPIC + 0x0000)
 #define A9_MPCORE_GIC_CPU      (CT_CA9X4_MPIC + 0x0100)
 #define A9_MPCORE_GIT          (CT_CA9X4_MPIC + 0x0200)
+#define A9_MPCORE_TWD          (CT_CA9X4_MPIC + 0x0600)
 #define A9_MPCORE_GIC_DIST     (CT_CA9X4_MPIC + 0x1000)
 
 /*


My only question is; what is the commented-out timer code for in
ct-ca9x4.c? It would be nice to get rid of it if it's not useful.

Cheers,

Will

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

* [PATCH] Versatile Express: add support for local timers on CA9X4 daughterboard
  2010-07-09 12:22   ` Will Deacon
@ 2010-07-09 12:43     ` Russell King - ARM Linux
  2010-07-09 13:11       ` Will Deacon
  0 siblings, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2010-07-09 12:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 09, 2010 at 01:22:48PM +0100, Will Deacon wrote:
> That's a lot tidier, how about something like this?:

Yea.

> My only question is; what is the commented-out timer code for in
> ct-ca9x4.c? It would be nice to get rid of it if it's not useful.

I tried to use the core tile timers, but I couldn't get them to work
properly (I don't remember why.)  I guess it would be preferable to
use the core tile timers as they probably have a faster latency than
the baseboard ones.  Hence I left the code there for when I can
investigate a little more.

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

* [PATCH] Versatile Express: add support for local timers on CA9X4 daughterboard
  2010-07-09 12:43     ` Russell King - ARM Linux
@ 2010-07-09 13:11       ` Will Deacon
  0 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2010-07-09 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

> On Fri, Jul 09, 2010 at 01:22:48PM +0100, Will Deacon wrote:
> > That's a lot tidier, how about something like this?:
> 
> Yea.

Great - submitted as 6218/1 superseding the old patch.
 
> > My only question is; what is the commented-out timer code for in
> > ct-ca9x4.c? It would be nice to get rid of it if it's not useful.
> 
> I tried to use the core tile timers, but I couldn't get them to work
> properly (I don't remember why.)  I guess it would be preferable to
> use the core tile timers as they probably have a faster latency than
> the baseboard ones.  Hence I left the code there for when I can
> investigate a little more.

Ah, ok, I'll leave that alone then.

Thanks,

Will

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

end of thread, other threads:[~2010-07-09 13:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-07  9:53 [PATCH] Versatile Express: add support for local timers on CA9X4 daughterboard Will Deacon
2010-06-30 12:49 ` Will Deacon
2010-07-09 10:16 ` Russell King - ARM Linux
2010-07-09 12:22   ` Will Deacon
2010-07-09 12:43     ` Russell King - ARM Linux
2010-07-09 13:11       ` Will Deacon

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