sh: CMT platform driver V6
Subsystems (2)
PATCH 4/5 sh: CMT platform driver V6
From: Magnus Damm <[email protected]>
SuperH CMT driver V6.
Both 16-bit and 32-bit CMT versions are supported, but only 32-bit is tested. This driver contains support for both clockevents and clocksources, but no unregistration is supported at this point.
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.
This version is lacking clocksource and early platform driver support for now - this to minimize the amount of dependencies.
---
Changes since V5 include:
- remove clocksource code for now to minimize dependencies
- remove early platform driver code to minimize dependencies
Changes since V4 include:
- use read() instead of read2()
- use early platform driver instead of sh_timer code
- keep platform data in sh_cmt.h instead of sh_timer.h
Changes since V3 include:
- Removed dependency of timer_inc
- Removed unregistration code
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 | 8 drivers/clocksource/Makefile | 1 drivers/clocksource/sh_cmt.c | 615 ++++++++++++++++++++++++++++++++++++++++++ include/linux/sh_cmt.h | 13 4 files changed, 637 insertions(+)
arch/sh/Kconfig +8 -0
@@ -397,6 +397,14 @@ source "arch/sh/boards/Kconfig" menu "Timer and clock configuration" +config SH_TIMER_CMT + def_bool n + prompt "CMT support" + select GENERIC_TIME + select GENERIC_CLOCKEVENTS + 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
@@ -2,3 +2,4 @@ obj-$(CONFIG_ATMEL_TCB_CLKSRC) += tcb_cl obj-$(CONFIG_X86_CYCLONE_TIMER) += cyclone.o obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o obj-$(CONFIG_SCx200HR_TIMER) += scx200_hrt.o +obj-$(CONFIG_SH_TIMER_CMT) += sh_cmt.o
drivers/clocksource/sh_cmt.c new file +615 -0
615 lines not on this page · raw message
include/linux/sh_cmt.h new file +13 -0
@@ -0,0 +1,13 @@ +#ifndef __SH_CMT_H__ +#define __SH_CMT_H__ + +struct sh_cmt_config { +char *name; +unsigned long channel_offset; +int timer_bit; +char *clk; +unsigned long clockevent_rating; +unsigned long clocksource_rating; +}; + +#endif /* __SH_CMT_H__ */