sh: CONFIG_SH_TIMER support
PATCH 1/3 sh: CONFIG_SH_TIMER support
From: Magnus Damm <[email protected]>
SuperH timer V5 base code supporting:
- early platform drivers
- hardware configuration kept as platform data
- compile time CONFIG_SH_TIMER switch
Signed-off-by Magnus Damm <[email protected]>
---
arch/sh/Kconfig | 13 +++++++++---- arch/sh/include/asm/timer.h | 4 ++++ arch/sh/kernel/time_32.c | 41 +++++++++++++++++++++++++++++++---------- 3 files changed, 44 insertions(+), 14 deletions(-)
arch/sh/Kconfig +9 -4
@@ -395,33 +395,38 @@ source "arch/sh/boards/Kconfig" menu "Timer and clock configuration" +config SH_TIMER + def_bool n + select GENERIC_CLOCKEVENTS + config SH_TMU def_bool y prompt "TMU timer support" - depends on CPU_SH3 || CPU_SH4 + depends on !SH_TIMER && (CPU_SH3 || CPU_SH4) select GENERIC_CLOCKEVENTS help This enables the use of the TMU as the system timer. config ARCH_USES_GETTIMEOFFSET def_bool y - depends on !SH_TMU + depends on !SH_TMU && !SH_TIMER config SH_CMT def_bool y prompt "CMT timer support" - depends on CPU_SH2 && !CPU_SUBTYPE_MXG + depends on !SH_TIMER && CPU_SH2 && !CPU_SUBTYPE_MXG help This enables the use of the CMT as the system timer. config SH_MTU2 def_bool n prompt "MTU2 timer support" - depends on CPU_SH2A + depends on !SH_TIMER && CPU_SH2A help This enables the use of the MTU2 as the system timer. config SH_TIMER_IRQ + depends on !SH_TIMER int default "28" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 || \ CPU_SUBTYPE_SH7763
arch/sh/include/asm/timer.h +4 -0
@@ -3,6 +3,7 @@#include <linux/sysdev.h> #include <linux/clocksource.h> +#include <linux/platform_device.h> #include <cpu/timer.h> struct sys_timer_ops {
@@ -41,4 +42,7 @@ struct sys_timer *get_sys_timer(void);void handle_timer_tick (void );extern unsigned long sh_hpt_frequency; +void sh_timer_register (struct platform_device **pdevs,int nr_pdevs); +void plat_timer_setup (void ); +#endif /* __ASM_SH_TIMER_H */
arch/sh/kernel/time_32.c +31 -10
89 lines not on this page · raw message