Commit b24fc5b2 authored by James Bottomley's avatar James Bottomley

Make the TSC a run-time specifier only

Also localises the parameters and setup into kernel/timers

Adds an external flag so that the tsc can be disabled from the
machine specific setup (used by voyager)
parent 85e270bc
No related merge requests found
...@@ -280,11 +280,6 @@ config X86_ALIGNMENT_16 ...@@ -280,11 +280,6 @@ config X86_ALIGNMENT_16
depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486 depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486
default y default y
config X86_TSC
bool
depends on MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || M686 || M586MMX || M586TSC
default y
config X86_GOOD_APIC config X86_GOOD_APIC
bool bool
depends on MK7 || MPENTIUM4 || MPENTIUMIII || M686 || M586MMX depends on MK7 || MPENTIUM4 || MPENTIUMIII || M686 || M586MMX
......
...@@ -45,25 +45,6 @@ static int __init cachesize_setup(char *str) ...@@ -45,25 +45,6 @@ static int __init cachesize_setup(char *str)
} }
__setup("cachesize=", cachesize_setup); __setup("cachesize=", cachesize_setup);
#ifndef CONFIG_X86_TSC
static int tsc_disable __initdata = 0;
static int __init tsc_setup(char *str)
{
tsc_disable = 1;
return 1;
}
#else
#define tsc_disable 0
static int __init tsc_setup(char *str)
{
printk("notsc: Kernel compiled with CONFIG_X86_TSC, cannot disable TSC.\n");
return 1;
}
#endif
__setup("notsc", tsc_setup);
int __init get_model_name(struct cpuinfo_x86 *c) int __init get_model_name(struct cpuinfo_x86 *c)
{ {
unsigned int *v; unsigned int *v;
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
# Makefile for x86 timers # Makefile for x86 timers
# #
obj-y := timer.o obj-y := timer.o timer_tsc.o timer_pit.o
obj-y += timer_tsc.o obj-$(CONFIG_X86_CYCLONE) += timer_cyclone.o
obj-y += timer_pit.o
obj-$(CONFIG_X86_CYCLONE) += timer_cyclone.o
...@@ -8,9 +8,7 @@ extern struct timer_opts timer_tsc; ...@@ -8,9 +8,7 @@ extern struct timer_opts timer_tsc;
/* list of timers, ordered by preference, NULL terminated */ /* list of timers, ordered by preference, NULL terminated */
static struct timer_opts* timers[] = { static struct timer_opts* timers[] = {
&timer_tsc, &timer_tsc,
#ifndef CONFIG_X86_TSC
&timer_pit, &timer_pit,
#endif
NULL, NULL,
}; };
......
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <asm/mpspec.h> #include <asm/mpspec.h>
#include <asm/timer.h> #include <asm/timer.h>
#include <asm/smp.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/arch_hooks.h>
extern spinlock_t i8259A_lock; extern spinlock_t i8259A_lock;
extern spinlock_t i8253_lock; extern spinlock_t i8253_lock;
......
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
#include <asm/timer.h> #include <asm/timer.h>
#include <asm/io.h> #include <asm/io.h>
/* processor.h for distable_tsc flag */
#include <asm/processor.h>
int tsc_disable __initdata = 0;
extern int x86_udelay_tsc; extern int x86_udelay_tsc;
extern spinlock_t i8253_lock; extern spinlock_t i8253_lock;
...@@ -287,6 +291,18 @@ static int init_tsc(void) ...@@ -287,6 +291,18 @@ static int init_tsc(void)
return -ENODEV; return -ENODEV;
} }
/* disable flag for tsc. Takes effect by clearing the TSC cpu flag
* in cpu/common.c */
static int __init tsc_setup(char *str)
{
tsc_disable = 1;
return 1;
}
__setup("notsc", tsc_setup);
/************************************************************/ /************************************************************/
/* tsc timer_opts struct */ /* tsc timer_opts struct */
......
...@@ -29,6 +29,9 @@ void __init intr_init_hook(void) ...@@ -29,6 +29,9 @@ void __init intr_init_hook(void)
void __init pre_setup_arch_hook(void) void __init pre_setup_arch_hook(void)
{ {
/* Voyagers run their CPUs from independent clocks, so disable
* the TSC code because we can't sync them */
tsc_disable = 1;
} }
void __init trap_init_hook(void) void __init trap_init_hook(void)
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/threads.h> #include <linux/threads.h>
/* flag for disabling the tsc */
extern int tsc_disable;
struct desc_struct { struct desc_struct {
unsigned long a,b; unsigned long a,b;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment