sh: CMT platform driver using timer_inc
Subsystems (2)
PATCH 6/10 sh: CMT platform driver using timer_inc
From: Magnus Damm <[email protected]>
CMT driver for the SuperH timer base code implementation V3. Both 16-bit and 32-bit CMT versions are supported, but only 32-bit is tested. This driver only contains hardware specific bits, the logic handling clock events and clock sources is performed by the timer_inc helper code.
Works fine as clock source and/or event in periodic or oneshot mode. Tested on sh7722 and sh7723, but should work with any cpu/architecture.
---
Changes since V2 include:
- Rewrote driver to platform driver and early timer
- Only control clocks and hardware registers in disable()/enable()
- Removed exported struct from sh_timer.c/sh_timer.h
- sh_timer_early_probe() is used for early timer setup
Changes since V1 include:
- Reworked private data handling - no more union in sh_timer.h
- Made spinlock static
- Use setup_irq() to request early interrupt
- Removed request_mem_region()/free_mem_region()
- Removed sysdev code
arch/sh/Kconfig | 7 drivers/clocksource/Makefile | 1 drivers/clocksource/sh_cmt.c | 366 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 374 insertions(+)
arch/sh/Kconfig +7 -0
@@ -394,6 +394,13 @@ config SH_TIMER select GENERIC_TIME select GENERIC_CLOCKEVENTS +config SH_TIMER_CMT + def_bool y + prompt "CMT timer support" + depends on SH_TIMER + help + This enables build of the CMT system timer driver. + config SH_TMU def_bool y prompt "TMU timer support"
drivers/clocksource/Makefile +1 -0
@@ -3,3 +3,4 @@ obj-$(CONFIG_X86_CYCLONE_TIMER) += cyclo obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o obj-$(CONFIG_SCx200HR_TIMER) += scx200_hrt.o obj-$(CONFIG_SH_TIMER) += sh_timer.o +obj-$(CONFIG_SH_TIMER_CMT) += sh_cmt.o timer_inc.o
drivers/clocksource/sh_cmt.c new file +366 -0
366 lines not on this page · raw message