diff options
| -rw-r--r-- | arch/sh/Kconfig | 11 | ||||
| -rw-r--r-- | arch/sh/include/asm/timer.h | 28 | ||||
| -rw-r--r-- | arch/sh/kernel/Makefile_32 | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/Makefile_64 | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/clock.c | 1 | ||||
| -rw-r--r-- | arch/sh/kernel/time.c | 29 | ||||
| -rw-r--r-- | arch/sh/kernel/timers/Makefile | 5 | ||||
| -rw-r--r-- | arch/sh/kernel/timers/timer.c | 46 |
8 files changed, 4 insertions, 120 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index e7b6406c96b6..fb75c2d1928d 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
| @@ -494,17 +494,6 @@ config SH_TIMER_MTU2 | |||
| 494 | help | 494 | help |
| 495 | This enables build of the MTU2 timer driver. | 495 | This enables build of the MTU2 timer driver. |
| 496 | 496 | ||
| 497 | config SH_TIMER_IRQ | ||
| 498 | int | ||
| 499 | default "28" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 || \ | ||
| 500 | CPU_SUBTYPE_SH7763 | ||
| 501 | default "86" if CPU_SUBTYPE_SH7619 | ||
| 502 | default "140" if CPU_SUBTYPE_SH7206 | ||
| 503 | default "142" if CPU_SUBTYPE_SH7203 && SH_CMT | ||
| 504 | default "153" if CPU_SUBTYPE_SH7203 && SH_MTU2 | ||
| 505 | default "238" if CPU_SUBTYPE_MXG | ||
| 506 | default "16" | ||
| 507 | |||
| 508 | config SH_PCLK_FREQ | 497 | config SH_PCLK_FREQ |
| 509 | int "Peripheral clock frequency (in Hz)" | 498 | int "Peripheral clock frequency (in Hz)" |
| 510 | default "27000000" if CPU_SUBTYPE_SH7343 | 499 | default "27000000" if CPU_SUBTYPE_SH7343 |
diff --git a/arch/sh/include/asm/timer.h b/arch/sh/include/asm/timer.h deleted file mode 100644 index f27a88bfdcc7..000000000000 --- a/arch/sh/include/asm/timer.h +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | #ifndef __ASM_SH_TIMER_H | ||
| 2 | #define __ASM_SH_TIMER_H | ||
| 3 | |||
| 4 | #include <linux/sysdev.h> | ||
| 5 | #include <linux/clocksource.h> | ||
| 6 | #include <cpu/timer.h> | ||
| 7 | |||
| 8 | struct sys_timer_ops { | ||
| 9 | int (*init)(void); | ||
| 10 | int (*start)(void); | ||
| 11 | int (*stop)(void); | ||
| 12 | }; | ||
| 13 | |||
| 14 | struct sys_timer { | ||
| 15 | const char *name; | ||
| 16 | |||
| 17 | struct sys_device dev; | ||
| 18 | struct sys_timer_ops *ops; | ||
| 19 | }; | ||
| 20 | |||
| 21 | extern struct sys_timer *sys_timer; | ||
| 22 | |||
| 23 | /* arch/sh/kernel/timers/timer.c */ | ||
| 24 | struct sys_timer *get_sys_timer(void); | ||
| 25 | |||
| 26 | extern struct clocksource clocksource_sh; | ||
| 27 | |||
| 28 | #endif /* __ASM_SH_TIMER_H */ | ||
diff --git a/arch/sh/kernel/Makefile_32 b/arch/sh/kernel/Makefile_32 index aee08afe5ff7..9411e3e31e68 100644 --- a/arch/sh/kernel/Makefile_32 +++ b/arch/sh/kernel/Makefile_32 | |||
| @@ -14,7 +14,7 @@ obj-y := debugtraps.o idle.o io.o io_generic.o irq.o \ | |||
| 14 | sys_sh.o sys_sh32.o syscalls_32.o time.o topology.o \ | 14 | sys_sh.o sys_sh32.o syscalls_32.o time.o topology.o \ |
| 15 | traps.o traps_32.o | 15 | traps.o traps_32.o |
| 16 | 16 | ||
| 17 | obj-y += cpu/ timers/ | 17 | obj-y += cpu/ |
| 18 | obj-$(CONFIG_VSYSCALL) += vsyscall/ | 18 | obj-$(CONFIG_VSYSCALL) += vsyscall/ |
| 19 | obj-$(CONFIG_SMP) += smp.o | 19 | obj-$(CONFIG_SMP) += smp.o |
| 20 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o | 20 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o |
diff --git a/arch/sh/kernel/Makefile_64 b/arch/sh/kernel/Makefile_64 index c845a0d61979..67b9f6c6326b 100644 --- a/arch/sh/kernel/Makefile_64 +++ b/arch/sh/kernel/Makefile_64 | |||
| @@ -4,7 +4,7 @@ obj-y := debugtraps.o idle.o io.o io_generic.o irq.o machvec.o process_64.o \ | |||
| 4 | ptrace_64.o setup.o signal_64.o sys_sh.o sys_sh64.o \ | 4 | ptrace_64.o setup.o signal_64.o sys_sh.o sys_sh64.o \ |
| 5 | syscalls_64.o time.o topology.o traps.o traps_64.o | 5 | syscalls_64.o time.o topology.o traps.o traps_64.o |
| 6 | 6 | ||
| 7 | obj-y += cpu/ timers/ | 7 | obj-y += cpu/ |
| 8 | obj-$(CONFIG_SMP) += smp.o | 8 | obj-$(CONFIG_SMP) += smp.o |
| 9 | obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o | 9 | obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o |
| 10 | obj-$(CONFIG_MODULES) += sh_ksyms_64.o module.o | 10 | obj-$(CONFIG_MODULES) += sh_ksyms_64.o module.o |
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c index 133dbe403341..f54769f455b1 100644 --- a/arch/sh/kernel/cpu/clock.c +++ b/arch/sh/kernel/cpu/clock.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
| 27 | #include <linux/proc_fs.h> | 27 | #include <linux/proc_fs.h> |
| 28 | #include <asm/clock.h> | 28 | #include <asm/clock.h> |
| 29 | #include <asm/timer.h> | ||
| 30 | 29 | ||
| 31 | static LIST_HEAD(clock_list); | 30 | static LIST_HEAD(clock_list); |
| 32 | static DEFINE_SPINLOCK(clock_lock); | 31 | static DEFINE_SPINLOCK(clock_lock); |
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index a77838f539f8..2edde32c764b 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c | |||
| @@ -22,9 +22,6 @@ | |||
| 22 | #include <linux/rtc.h> | 22 | #include <linux/rtc.h> |
| 23 | #include <asm/clock.h> | 23 | #include <asm/clock.h> |
| 24 | #include <asm/rtc.h> | 24 | #include <asm/rtc.h> |
| 25 | #include <asm/timer.h> | ||
| 26 | |||
| 27 | struct sys_timer *sys_timer; | ||
| 28 | 25 | ||
| 29 | /* Dummy RTC ops */ | 26 | /* Dummy RTC ops */ |
| 30 | static void null_rtc_get_time(struct timespec *tv) | 27 | static void null_rtc_get_time(struct timespec *tv) |
| @@ -94,20 +91,9 @@ module_init(rtc_generic_init); | |||
| 94 | 91 | ||
| 95 | void (*board_time_init)(void); | 92 | void (*board_time_init)(void); |
| 96 | 93 | ||
| 97 | struct clocksource clocksource_sh = { | ||
| 98 | .name = "SuperH", | ||
| 99 | }; | ||
| 100 | |||
| 101 | unsigned long long sched_clock(void) | 94 | unsigned long long sched_clock(void) |
| 102 | { | 95 | { |
| 103 | unsigned long long cycles; | 96 | return (jiffies_64 - INITIAL_JIFFIES) * (NSEC_PER_SEC / HZ); |
| 104 | |||
| 105 | /* jiffies based sched_clock if no clocksource is installed */ | ||
| 106 | if (!clocksource_sh.rating) | ||
| 107 | return (jiffies_64 - INITIAL_JIFFIES) * (NSEC_PER_SEC / HZ); | ||
| 108 | |||
| 109 | cycles = clocksource_sh.read(&clocksource_sh); | ||
| 110 | return cyc2ns(&clocksource_sh, cycles); | ||
| 111 | } | 97 | } |
| 112 | 98 | ||
| 113 | static void __init sh_late_time_init(void) | 99 | static void __init sh_late_time_init(void) |
| @@ -117,18 +103,7 @@ static void __init sh_late_time_init(void) | |||
| 117 | * Run probe() for one "earlytimer" device. | 103 | * Run probe() for one "earlytimer" device. |
| 118 | */ | 104 | */ |
| 119 | early_platform_driver_register_all("earlytimer"); | 105 | early_platform_driver_register_all("earlytimer"); |
| 120 | if (early_platform_driver_probe("earlytimer", 1, 0)) | 106 | early_platform_driver_probe("earlytimer", 1, 0); |
| 121 | return; | ||
| 122 | |||
| 123 | /* | ||
| 124 | * Find the timer to use as the system timer, it will be | ||
| 125 | * initialized for us. | ||
| 126 | */ | ||
| 127 | sys_timer = get_sys_timer(); | ||
| 128 | if (unlikely(!sys_timer)) | ||
| 129 | panic("System timer missing.\n"); | ||
| 130 | |||
| 131 | printk(KERN_INFO "Using %s for system timer\n", sys_timer->name); | ||
| 132 | } | 107 | } |
| 133 | 108 | ||
| 134 | void __init time_init(void) | 109 | void __init time_init(void) |
diff --git a/arch/sh/kernel/timers/Makefile b/arch/sh/kernel/timers/Makefile deleted file mode 100644 index fefd7edd413d..000000000000 --- a/arch/sh/kernel/timers/Makefile +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Makefile for the various Linux/SuperH timers | ||
| 3 | # | ||
| 4 | |||
| 5 | obj-y := timer.o | ||
diff --git a/arch/sh/kernel/timers/timer.c b/arch/sh/kernel/timers/timer.c deleted file mode 100644 index f8812bd3b797..000000000000 --- a/arch/sh/kernel/timers/timer.c +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * arch/sh/kernel/timers/timer.c - Common timer code | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005 Paul Mundt | ||
| 5 | * | ||
| 6 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 7 | * License. See the file "COPYING" in the main directory of this archive | ||
| 8 | * for more details. | ||
| 9 | */ | ||
| 10 | #include <linux/kernel.h> | ||
| 11 | #include <linux/init.h> | ||
| 12 | #include <linux/timer.h> | ||
| 13 | #include <linux/string.h> | ||
| 14 | #include <asm/timer.h> | ||
| 15 | |||
| 16 | static struct sys_timer *sys_timers[] = { | ||
| 17 | NULL, | ||
| 18 | }; | ||
| 19 | |||
| 20 | static char timer_override[10]; | ||
| 21 | static int __init timer_setup(char *str) | ||
| 22 | { | ||
| 23 | if (str) | ||
| 24 | strlcpy(timer_override, str, sizeof(timer_override)); | ||
| 25 | return 1; | ||
| 26 | } | ||
| 27 | __setup("timer=", timer_setup); | ||
| 28 | |||
| 29 | struct sys_timer *get_sys_timer(void) | ||
| 30 | { | ||
| 31 | int i; | ||
| 32 | |||
| 33 | for (i = 0; i < ARRAY_SIZE(sys_timers); i++) { | ||
| 34 | struct sys_timer *t = sys_timers[i]; | ||
| 35 | |||
| 36 | if (unlikely(!t)) | ||
| 37 | break; | ||
| 38 | if (unlikely(timer_override[0])) | ||
| 39 | if ((strcmp(timer_override, t->name) != 0)) | ||
| 40 | continue; | ||
| 41 | if (likely(t->ops->init() == 0)) | ||
| 42 | return t; | ||
| 43 | } | ||
| 44 | |||
| 45 | return NULL; | ||
| 46 | } | ||
