提交 8be5f1a6 编写于 作者: P Paul Mundt

sh: Kill off the remnants of the old timer code.

Now with all of the TMU users moved over to the new TMU driver, and the
old TMU driver killed off, the left-over infrastructure can go along
with it.
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 f19900b2
......@@ -494,17 +494,6 @@ config SH_TIMER_MTU2
help
This enables build of the MTU2 timer driver.
config SH_TIMER_IRQ
int
default "28" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 || \
CPU_SUBTYPE_SH7763
default "86" if CPU_SUBTYPE_SH7619
default "140" if CPU_SUBTYPE_SH7206
default "142" if CPU_SUBTYPE_SH7203 && SH_CMT
default "153" if CPU_SUBTYPE_SH7203 && SH_MTU2
default "238" if CPU_SUBTYPE_MXG
default "16"
config SH_PCLK_FREQ
int "Peripheral clock frequency (in Hz)"
default "27000000" if CPU_SUBTYPE_SH7343
......
#ifndef __ASM_SH_TIMER_H
#define __ASM_SH_TIMER_H
#include <linux/sysdev.h>
#include <linux/clocksource.h>
#include <cpu/timer.h>
struct sys_timer_ops {
int (*init)(void);
int (*start)(void);
int (*stop)(void);
};
struct sys_timer {
const char *name;
struct sys_device dev;
struct sys_timer_ops *ops;
};
extern struct sys_timer *sys_timer;
/* arch/sh/kernel/timers/timer.c */
struct sys_timer *get_sys_timer(void);
extern struct clocksource clocksource_sh;
#endif /* __ASM_SH_TIMER_H */
......@@ -14,7 +14,7 @@ obj-y := debugtraps.o idle.o io.o io_generic.o irq.o \
sys_sh.o sys_sh32.o syscalls_32.o time.o topology.o \
traps.o traps_32.o
obj-y += cpu/ timers/
obj-y += cpu/
obj-$(CONFIG_VSYSCALL) += vsyscall/
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o
......
......@@ -4,7 +4,7 @@ obj-y := debugtraps.o idle.o io.o io_generic.o irq.o machvec.o process_64.o \
ptrace_64.o setup.o signal_64.o sys_sh.o sys_sh64.o \
syscalls_64.o time.o topology.o traps.o traps_64.o
obj-y += cpu/ timers/
obj-y += cpu/
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o
obj-$(CONFIG_MODULES) += sh_ksyms_64.o module.o
......
......@@ -26,7 +26,6 @@
#include <linux/platform_device.h>
#include <linux/proc_fs.h>
#include <asm/clock.h>
#include <asm/timer.h>
static LIST_HEAD(clock_list);
static DEFINE_SPINLOCK(clock_lock);
......
......@@ -22,9 +22,6 @@
#include <linux/rtc.h>
#include <asm/clock.h>
#include <asm/rtc.h>
#include <asm/timer.h>
struct sys_timer *sys_timer;
/* Dummy RTC ops */
static void null_rtc_get_time(struct timespec *tv)
......@@ -94,20 +91,9 @@ module_init(rtc_generic_init);
void (*board_time_init)(void);
struct clocksource clocksource_sh = {
.name = "SuperH",
};
unsigned long long sched_clock(void)
{
unsigned long long cycles;
/* jiffies based sched_clock if no clocksource is installed */
if (!clocksource_sh.rating)
return (jiffies_64 - INITIAL_JIFFIES) * (NSEC_PER_SEC / HZ);
cycles = clocksource_sh.read(&clocksource_sh);
return cyc2ns(&clocksource_sh, cycles);
return (jiffies_64 - INITIAL_JIFFIES) * (NSEC_PER_SEC / HZ);
}
static void __init sh_late_time_init(void)
......@@ -117,18 +103,7 @@ static void __init sh_late_time_init(void)
* Run probe() for one "earlytimer" device.
*/
early_platform_driver_register_all("earlytimer");
if (early_platform_driver_probe("earlytimer", 1, 0))
return;
/*
* Find the timer to use as the system timer, it will be
* initialized for us.
*/
sys_timer = get_sys_timer();
if (unlikely(!sys_timer))
panic("System timer missing.\n");
printk(KERN_INFO "Using %s for system timer\n", sys_timer->name);
early_platform_driver_probe("earlytimer", 1, 0);
}
void __init time_init(void)
......
#
# Makefile for the various Linux/SuperH timers
#
obj-y := timer.o
/*
* arch/sh/kernel/timers/timer.c - Common timer code
*
* Copyright (C) 2005 Paul Mundt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/timer.h>
#include <linux/string.h>
#include <asm/timer.h>
static struct sys_timer *sys_timers[] = {
NULL,
};
static char timer_override[10];
static int __init timer_setup(char *str)
{
if (str)
strlcpy(timer_override, str, sizeof(timer_override));
return 1;
}
__setup("timer=", timer_setup);
struct sys_timer *get_sys_timer(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(sys_timers); i++) {
struct sys_timer *t = sys_timers[i];
if (unlikely(!t))
break;
if (unlikely(timer_override[0]))
if ((strcmp(timer_override, t->name) != 0))
continue;
if (likely(t->ops->init() == 0))
return t;
}
return NULL;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册