Skip to contentSkip to conversation

clocksource: add samsung pwm timer driver

PATCH New Arnd Bergmann 2 participants 2 messages Apr 20, 2013 – Apr 22, 2013

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

PATCH 1/1 clocksource: add samsung pwm timer driver

From: Tomasz Figa <[email protected]>

This adds a new clocksource driver for the PWM timer that is present in most Samsung SoCs, based on the existing driver in arch/arm/plat-samsung/samsung-time.c and many changes implemented by Tomasz Figa.

Originally, the conversion of all Samsung machines to the new driver was planned for 3.10, but that work ended up being too late and too invasive just before the merge window.

Unfortunately, other changes in the Exynos platform resulted in some Exynos4 setups, particularly the Universal C210 board to be broken. In order to fix that with minimum risk, so we now leave the existing pwm clocksource driver in place for all older platforms and use the new driver only for device tree enabled boards. This way, we can get the broken machines running again using DT descriptions.

All clocksource changes were implemented by Tomasz, while the DT registration was rewritten by Arnd.

Cc Tomasz Figa <[email protected]>
Cc Kyungmin Park <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Ben Dooks <[email protected]>
Cc John Stultz <[email protected]>
Cc Thomas Gleixner <[email protected]>

---
This is my final attempt to fix the Exynos4 regressions we have, since Tomasz put a lot of work into getting this running, and I gave him a hard time about some of the earlier patches.

Tomasz, can you have a look at this to see if it would actually help? I have removed all the non-DT registration from your code, as well as the interface to the pwm subsystem, since I assume the existing code will work for all users we care about.

drivers/clocksource/Kconfig +10 -0
index 73fcddb..5b8ba91 100644
@@ -75,3 +75,13 @@ config CLKSRC_EXYNOS_MCT
 	def_bool y if ARCH_EXYNOS
 	help
 	  Support for Multi Core Timer controller on Exynos SoCs.
+
+config CLKSRC_SAMSUNG_PWM
+	def_bool ARCH_EXYNOS4
+	depends on OF
+	select CLKSRC_MMIO
+	help
+	  This is a new clocksource driver for the PWM timer found in
+	  Samsung S3C, S5P and Exynos SoCs, replacing an earlier driver
+	  for all devicetree enabled platforms. This driver will be
+	  needed only on systems that do not have the Exynos MCT available.
drivers/clocksource/Makefile +1 -0
index cd1f09c..2289f0c 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_ARCH_TEGRA)	+= tegra20_timer.o
 obj-$(CONFIG_VT8500_TIMER)	+= vt8500_timer.o
 obj-$(CONFIG_CADENCE_TTC_TIMER)	+= cadence_ttc_timer.o
 obj-$(CONFIG_CLKSRC_EXYNOS_MCT)	+= exynos_mct.o
+obj-$(CONFIG_CLKSRC_SAMSUNG_PWM)	+= samsung_pwm_timer.o
 
 obj-$(CONFIG_ARM_ARCH_TIMER)		+= arm_arch_timer.o
 obj-$(CONFIG_CLKSRC_METAG_GENERIC)	+= metag_generic.o
drivers/clocksource/samsung_pwm_timer.c new file +477 -0

477 lines not on this page · raw message

include/clocksource/samsung_pwm.h new file +41 -0

41 lines not on this page · raw message

#1 lore raw

PATCH 1/1 clocksource: add samsung pwm timer driver

Quoted 18 lines · Arnd Bergmann

From: Tomasz Figa<[email protected]>

This adds a new clocksource driver for the PWM timer that is present in most Samsung SoCs, based on the existing driver in arch/arm/plat-samsung/samsung-time.c and many changes implemented by Tomasz Figa.

Originally, the conversion of all Samsung machines to the new driver was planned for 3.10, but that work ended up being too late and too invasive just before the merge window.

Unfortunately, other changes in the Exynos platform resulted in some Exynos4 setups, particularly the Universal C210 board to be broken. In order to fix that with minimum risk, so we now leave the existing pwm clocksource driver in place for all older platforms and use the new driver only for device tree enabled boards. This way, we can get the broken machines running again using DT descriptions.

Quoted 7 lines

All clocksource changes were implemented by Tomasz, while the DT registration was rewritten by Arnd.

Cc Tomasz Figa<[email protected]>
Cc Kyungmin Park<[email protected]>
Cc Kukjin Kim<[email protected]>

Thanks.

- Kukjin

Quoted 12 lines
Cc Ben Dooks<[email protected]>
Cc John Stultz<[email protected]>
Cc Thomas Gleixner<[email protected]>

---
This is my final attempt to fix the Exynos4 regressions we have, since Tomasz put a lot of work into getting this running, and I gave him a hard time about some of the earlier patches.

Tomasz, can you have a look at this to see if it would actually help? I have removed all the non-DT registration from your code, as well as the interface to the pwm subsystem, since I assume the existing code will work for all users we care about.