Skip to contentSkip to conversation

clocksource: em_sti: Emma Mobile STI driver V3

PATCH In review Magnus Damm 1 participant 2 messages May 25, 2012

Subsystems (5)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 1/1 clocksource: em_sti: Emma Mobile STI driver V3

From: Magnus Damm <[email protected]>

This is V3 of the Emma Mobile STI timer driver.

The STI hardware is based on a single 48-bit 32kHz counter that together with two individual compare registers can generate interrupts. There are no timer operating modes selectable which means that the timer can not clear on match.

This driver is providing clocksource support for the 48-bit counter. Clockevents are also supported using the same timer in oneshot mode.

---

Thanks to Thomas Gleixner for his reviews!

Changes since V2 :
- use raw spinlocks
- get rid of periodic support
- get rid of now unused private data
- rename em_sti_update() to em_sti_set_next()

Changes since V1 :
- removed unused early timer cruft
- reduce number of functions
- use request_irq() instead setup_irq() since we run late during boot
- replace confusing flags with perhaps equally confusing active[] array
- use clockevents_config_and_register() for registration
- update frequency with clockevents_config()
- use 2 ticks as minimum
- verify oneshot timer and return error to clock event layer

Verified V2 in the following modes on EMEV2:
- clocksource only
- clockevent in periodic mode only
- clocksource and clockevent in periodic mode
- clocksource and clockevent in oneshot mode

 arch/arm/mach-shmobile/Kconfig |    6 
 drivers/clocksource/Makefile   |    1 
 drivers/clocksource/em_sti.c   |  399 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 406 insertions(+)
arch/arm/mach-shmobile/Kconfig +6 -0
@@ -183,6 +183,12 @@ config SH_TIMER_TMU
 	help
 	  This enables build of the TMU timer driver.
 
+config EM_TIMER_STI
+	bool "STI timer driver"
+	default y
+	help
+	  This enables build of the STI timer driver.
+
 endmenu
 
 config SH_CLK_CPG
drivers/clocksource/Makefile +1 -0
@@ -6,6 +6,7 @@ obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC)	+=
 obj-$(CONFIG_SH_TIMER_CMT)	+= sh_cmt.o
 obj-$(CONFIG_SH_TIMER_MTU2)	+= sh_mtu2.o
 obj-$(CONFIG_SH_TIMER_TMU)	+= sh_tmu.o
+obj-$(CONFIG_EM_TIMER_STI)	+= em_sti.o
 obj-$(CONFIG_CLKBLD_I8253)	+= i8253.o
 obj-$(CONFIG_CLKSRC_MMIO)	+= mmio.o
 obj-$(CONFIG_DW_APB_TIMER)	+= dw_apb_timer.o
drivers/clocksource/em_sti.c new file +399 -0

399 lines not on this page · raw message

author maintainer
#1 lore raw

[tip:timers/core] clocksource: em_sti: Emma Mobile STI driver

Commit-ID:  b9dbf9517784084ee9496f9f17f9754c1d021a9e
Gitweb:     http://git.kernel.org/tip/b9dbf9517784084ee9496f9f17f9754c1d021a9e
Author:     Magnus Damm <[email protected]>
AuthorDate: Fri, 25 May 2012 16:03:44 +0900
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Fri, 25 May 2012 11:32:06 +0200

clocksource: em_sti: Emma Mobile STI driver

The STI hardware is based on a single 48-bit 32kHz counter that together with two individual compare registers can generate interrupts. There are no timer operating modes selectable which means that the timer can not clear on match.

This driver is providing clocksource support for the 48-bit counter. Clockevents are also supported using the same timer in oneshot mode.

---
 arch/arm/mach-shmobile/Kconfig |    6 +
 drivers/clocksource/Makefile   |    1 +
 drivers/clocksource/em_sti.c   |  399 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 406 insertions(+), 0 deletions(-)
arch/arm/mach-shmobile/Kconfig +6 -0
index f31383c..df33909 100644
@@ -186,6 +186,12 @@ config SH_TIMER_TMU
 	help
 	  This enables build of the TMU timer driver.
 
+config EM_TIMER_STI
+	bool "STI timer driver"
+	default y
+	help
+	  This enables build of the STI timer driver.
+
 endmenu
 
 config SH_CLK_CPG
drivers/clocksource/Makefile +1 -0
index 8d81a1d..dd3e661 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC)	+= cs5535-clockevt.o
 obj-$(CONFIG_SH_TIMER_CMT)	+= sh_cmt.o
 obj-$(CONFIG_SH_TIMER_MTU2)	+= sh_mtu2.o
 obj-$(CONFIG_SH_TIMER_TMU)	+= sh_tmu.o
+obj-$(CONFIG_EM_TIMER_STI)	+= em_sti.o
 obj-$(CONFIG_CLKBLD_I8253)	+= i8253.o
 obj-$(CONFIG_CLKSRC_MMIO)	+= mmio.o
 obj-$(CONFIG_DW_APB_TIMER)	+= dw_apb_timer.o
drivers/clocksource/em_sti.c new file +399 -0

399 lines not on this page · raw message