Skip to contentSkip to conversation

ARM: s3c64xx: Add generic high resolution time support using PWM timers.

PATCH New Tomasz Figa 1 participant 1 message Aug 28, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/5 ARM: s3c64xx: Add generic high resolution time support using PWM timers.

This patch adds a sys_timer implementing generic clock source and clock event device on S3C64xx using PWM timers 3 and 4. It can be enabled by a Kconfig option, based on which either the new sys_timer is used as s3c64xx_timer or s3c64xx_timer is defined to s3c24xx_timer which is the old tick timer.

---
 arch/arm/Kconfig                         |    1 -
 arch/arm/mach-s3c64xx/Kconfig            |   12 ++
 arch/arm/mach-s3c64xx/Makefile           |    3 +
 arch/arm/mach-s3c64xx/time.c             |  320 ++++++++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/cpu.h |    7 +
 5 files changed, 342 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-s3c64xx/time.c
arch/arm/Kconfig +0 -1
index 9adc278..05941f6 100644
@@ -700,7 +700,6 @@ config ARCH_S3C64XX
 	select ARM_VIC
 	select HAVE_CLK
 	select NO_IOPORT
-	select ARCH_USES_GETTIMEOFFSET
 	select ARCH_HAS_CPUFREQ
 	select ARCH_REQUIRE_GPIOLIB
 	select SAMSUNG_CLKSRC
arch/arm/mach-s3c64xx/Kconfig +12 -0
index e4177e2..2db76fd 100644
@@ -25,6 +25,18 @@ config CPU_S3C6410
 	help
 	  Enable S3C6410 CPU support
 
+config S3C64XX_GENERIC_CLOCKEVENTS
+	bool "Enable high resolution generic time support using PWM timers"
+	select GENERIC_CLOCKEVENTS
+	help
+	  This option enables high resolution generic time support
+	  on S3C6400/S3C6410 SoCs using PWM timers 3 and 4 instead
+	  of standard periodic tick using PWM timer 4.
+
+config S3C64XX_ARCH_USES_GETTIMEOFFSET
+	def_bool y if !S3C64XX_GENERIC_CLOCKEVENTS
+	select ARCH_USES_GETTIMEOFFSET
+
 config S3C64XX_DMA
 	bool "S3C64XX DMA"
 	select S3C_DMA
arch/arm/mach-s3c64xx/Makefile +3 -0
index 4657363..a152002 100644
@@ -15,6 +15,9 @@ obj-y				+= cpu.o
 obj-y				+= clock.o
 obj-y				+= gpiolib.o
 
+# Generic clockevents
+obj-$(CONFIG_S3C64XX_GENERIC_CLOCKEVENTS) += time.o
+
 # Core support for S3C6400 system
 
 obj-$(CONFIG_CPU_S3C6400)	+= s3c6400.o
arch/arm/mach-s3c64xx/time.c new file +320 -0

320 lines not on this page · raw message

arch/arm/plat-samsung/include/plat/cpu.h +7 -0
index c0a5741..e1fcad0 100644
@@ -74,6 +74,13 @@ extern struct syscore_ops s3c2416_pm_syscore_ops;
 extern struct syscore_ops s3c244x_pm_syscore_ops;
 extern struct syscore_ops s3c64xx_irq_syscore_ops;
 
+/* timer for 64xx */
+#ifdef CONFIG_S3C64XX_GENERIC_CLOCKEVENTS
+extern struct sys_timer s3c64xx_timer;
+#else
+#define s3c64xx_timer s3c24xx_timer
+#endif
+
 /* system device classes */
 
 extern struct sysdev_class s3c2410_sysclass;
Signature · 1 line
1.7.6.1