Skip to contentSkip to conversation

ARM: S5PV310: Add support Multi-Core Timer

PATCH New Kukjin Kim 1 participant 4 messages Jan 4, 2011

Subsystems (3)
lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

v2 cover ARM: S5PV310: Add support Multi-Core Timer

This patch adds support MCT, Multi-Core Timer for S5PV310 and S5PC210 and SYSTIMER IO address mapping and global timer interrupt definitinon.

Changes since v1:
- Addressed comments from Russell King
- Fixed small things

[PATCH 1/3] ARM: S5PV310: Add SYSTIMER IO Address mapping for MCT [PATCH 2/3] ARM: S5PV310: Add irq definition for kernel global timer [PATCH 3/3] ARM: S5PV310: Implement kernel timers using MCT

author
#1 lore raw

PATCH v2 1/3 ARM: S5PV310: Add SYSTIMER IO Address mapping for MCT

From: Changhwan Youn <[email protected]>

The MCT(Multi-Core Timer) is used for implementing kernel timers for S5PV310 and S5PC210.

---
 arch/arm/mach-s5pv310/cpu.c              |    5 +++++
 arch/arm/mach-s5pv310/include/mach/map.h |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv310/cpu.c +5 -0
index 3d0c1cb..99b5dc3 100644
@@ -33,6 +33,11 @@ extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq);
 /* Initial IO mappings */
 static struct map_desc s5pv310_iodesc[] __initdata = {
 	{
+		.virtual	= (unsigned long)S5P_VA_SYSTIMER,
+		.pfn		= __phys_to_pfn(S5PV310_PA_SYSTIMER),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	}, {
 		.virtual	= (unsigned long)S5P_VA_SYSRAM,
 		.pfn		= __phys_to_pfn(S5PV310_PA_SYSRAM),
 		.length		= SZ_4K,
arch/arm/mach-s5pv310/include/mach/map.h +2 -0
index 7acf4e7..c37e2db 100644
@@ -41,6 +41,8 @@
 
 #define S5PV310_PA_CMU			(0x10030000)
 
+#define S5PV310_PA_SYSTIMER		(0x10050000)
+
 #define S5PV310_PA_WATCHDOG		(0x10060000)
 #define S5PV310_PA_RTC			(0x10070000)
 
Signature · 1 line
1.6.2.5
author
#2 lore raw

PATCH v2 2/3 ARM: S5PV310: Add irq definition for kernel global timer

In reply to Kukjin Kim

From: Changhwan Youn <[email protected]>

This patch adds IRQ_MCT_G0 to irq map. IRQ_MCT_G0 is an interrupt of MCT comparator and used for kernel global timer.

---
 arch/arm/mach-s5pv310/include/mach/irqs.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv310/include/mach/irqs.h +1 -0
index f9a2830..edb2445 100644
@@ -107,6 +107,7 @@
 #define IRQ_MCT_L0		COMBINER_IRQ(51, 0)
 
 #define IRQ_WDT			COMBINER_IRQ(53, 0)
+#define IRQ_MCT_G0		COMBINER_IRQ(53, 4)
 
 #define MAX_COMBINER_NR		54
 
Signature · 1 line
1.6.2.5
author
#3 lore raw

PATCH v2 3/3 ARM: S5PV310: Implement kernel timers using MCT

In reply to Kukjin Kim

From: Changhwan Youn <[email protected]>

The Multi-Core Timer(MCT) of S5PV310 is designed for implementing clock source timer and clock event timers. This patch implements 1 clock source timer with 64 bit free running counter of MCT and 2 clock event timers with two of 31-bit tick counters.

---
 arch/arm/Kconfig                              |    2 +-
 arch/arm/mach-s5pv310/Kconfig                 |    5 +
 arch/arm/mach-s5pv310/Makefile                |   10 +-
 arch/arm/mach-s5pv310/include/mach/regs-mct.h |   58 +++
 arch/arm/mach-s5pv310/mct.c                   |  492 +++++++++++++++++++++++++
 5 files changed, 564 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-mct.h
 create mode 100644 arch/arm/mach-s5pv310/mct.c
arch/arm/Kconfig +1 -1
index d56d21c..d9ee300 100644
@@ -1291,7 +1291,7 @@ config LOCAL_TIMERS
 	bool "Use local timer interrupts"
 	depends on SMP
 	default y
-	select HAVE_ARM_TWD
+	select HAVE_ARM_TWD if !S5PV310_MCT
 	help
 	  Enable support for local timers on SMP platforms, rather then the
 	  legacy IPI broadcast method.  Local timers allows the system
arch/arm/mach-s5pv310/Kconfig +5 -0
index 1150b36..5fecf1b 100644
@@ -14,6 +14,11 @@ config CPU_S5PV310
 	help
 	  Enable S5PV310 CPU support
 
+config S5PV310_MCT
+	bool "Kernel timer support by MCT"
+	help
+	  Use MCT (Multi Core Timer) as kernel timers
+
 config S5PV310_SETUP_I2C1
 	bool
 	help
arch/arm/mach-s5pv310/Makefile +8 -2
index 84afc64..5ca7645 100644
@@ -13,10 +13,16 @@ obj-				:=
 # Core support for S5PV310 system
 
 obj-$(CONFIG_CPU_S5PV310)	+= cpu.o init.o clock.o irq-combiner.o
-obj-$(CONFIG_CPU_S5PV310)	+= setup-i2c0.o time.o gpiolib.o irq-eint.o
+obj-$(CONFIG_CPU_S5PV310)	+= setup-i2c0.o gpiolib.o irq-eint.o
 
-obj-$(CONFIG_SMP)		+= platsmp.o headsmp.o
+ifeq ($(CONFIG_S5PV310_MCT),y)
+obj-y				+= mct.o
+else
+obj-y				+= time.o
 obj-$(CONFIG_LOCAL_TIMERS)	+= localtimer.o
+endif
+
+obj-$(CONFIG_SMP)		+= platsmp.o headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o
 
 # machine support
arch/arm/mach-s5pv310/include/mach/regs-mct.h new file +58 -0

58 lines not on this page · raw message

arch/arm/mach-s5pv310/mct.c new file +492 -0

492 lines not on this page · raw message

Signature · 1 line
1.6.2.5