2005-04-17 06:20:36 +08:00
|
|
|
#include <linux/bitops.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/pci.h>
|
|
|
|
#include <asm/dma.h>
|
2009-07-04 07:35:45 +08:00
|
|
|
#include <linux/io.h>
|
2007-07-22 17:12:38 +08:00
|
|
|
#include <asm/processor-cyrix.h>
|
2008-01-30 20:30:39 +08:00
|
|
|
#include <asm/processor-flags.h>
|
2009-07-04 07:35:45 +08:00
|
|
|
#include <linux/timer.h>
|
2007-02-13 20:26:26 +08:00
|
|
|
#include <asm/pci-direct.h>
|
Detach sched.h from mm.h
First thing mm.h does is including sched.h solely for can_do_mlock() inline
function which has "current" dereference inside. By dealing with can_do_mlock()
mm.h can be detached from sched.h which is good. See below, why.
This patch
a) removes unconditional inclusion of sched.h from mm.h
b) makes can_do_mlock() normal function in mm/mlock.c
c) exports can_do_mlock() to not break compilation
d) adds sched.h inclusions back to files that were getting it indirectly.
e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were
getting them indirectly
Net result is:
a) mm.h users would get less code to open, read, preprocess, parse, ... if
they don't need sched.h
b) sched.h stops being dependency for significant number of files:
on x86_64 allmodconfig touching sched.h results in recompile of 4083 files,
after patch it's only 3744 (-8.3%).
Cross-compile tested on
all arm defconfigs, all mips defconfigs, all powerpc defconfigs,
alpha alpha-up
arm
i386 i386-up i386-defconfig i386-allnoconfig
ia64 ia64-up
m68k
mips
parisc parisc-up
powerpc powerpc-up
s390 s390-up
sparc sparc-up
sparc64 sparc64-up
um-x86_64
x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig
as well as my two usual configs.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-21 05:22:52 +08:00
|
|
|
#include <asm/tsc.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Read NSC/Cyrix DEVID registers (DIR) to get more detailed info. about the CPU
|
|
|
|
*/
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static void __do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
unsigned char ccr2, ccr3;
|
2008-02-23 06:11:23 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/* we test for DEVID by checking whether CCR3 is writable */
|
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
|
|
|
setCx86(CX86_CCR3, ccr3 ^ 0x80);
|
|
|
|
getCx86(0xc0); /* dummy to change bus */
|
|
|
|
|
|
|
|
if (getCx86(CX86_CCR3) == ccr3) { /* no DEVID regs. */
|
|
|
|
ccr2 = getCx86(CX86_CCR2);
|
|
|
|
setCx86(CX86_CCR2, ccr2 ^ 0x04);
|
|
|
|
getCx86(0xc0); /* dummy */
|
|
|
|
|
|
|
|
if (getCx86(CX86_CCR2) == ccr2) /* old Cx486SLC/DLC */
|
|
|
|
*dir0 = 0xfd;
|
|
|
|
else { /* Cx486S A step */
|
|
|
|
setCx86(CX86_CCR2, ccr2);
|
|
|
|
*dir0 = 0xfe;
|
|
|
|
}
|
2008-02-23 06:11:23 +08:00
|
|
|
} else {
|
2005-04-17 06:20:36 +08:00
|
|
|
setCx86(CX86_CCR3, ccr3); /* restore CCR3 */
|
|
|
|
|
|
|
|
/* read DIR0 and DIR1 CPU registers */
|
|
|
|
*dir0 = getCx86(CX86_DIR0);
|
|
|
|
*dir1 = getCx86(CX86_DIR1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static void do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
|
2008-09-05 03:09:43 +08:00
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
local_irq_save(flags);
|
|
|
|
__do_cyrix_devid(dir0, dir1);
|
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in bugs.h in
|
|
|
|
* order to identify the Cyrix CPU model after we're out of setup.c
|
|
|
|
*
|
|
|
|
* Actually since bugs.h doesn't even reference this perhaps someone should
|
|
|
|
* fix the documentation ???
|
|
|
|
*/
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static unsigned char Cx86_dir0_msb = 0;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static const char Cx86_model[][9] = {
|
2005-04-17 06:20:36 +08:00
|
|
|
"Cx486", "Cx486", "5x86 ", "6x86", "MediaGX ", "6x86MX ",
|
|
|
|
"M II ", "Unknown"
|
|
|
|
};
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static const char Cx486_name[][5] = {
|
2005-04-17 06:20:36 +08:00
|
|
|
"SLC", "DLC", "SLC2", "DLC2", "SRx", "DRx",
|
|
|
|
"SRx2", "DRx2"
|
|
|
|
};
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static const char Cx486S_name[][4] = {
|
2005-04-17 06:20:36 +08:00
|
|
|
"S", "S2", "Se", "S2e"
|
|
|
|
};
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static const char Cx486D_name[][4] = {
|
2005-04-17 06:20:36 +08:00
|
|
|
"DX", "DX2", "?", "?", "?", "DX4"
|
|
|
|
};
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static char Cx86_cb[] = "?.5x Core/Bus Clock";
|
|
|
|
static const char cyrix_model_mult1[] = "12??43";
|
|
|
|
static const char cyrix_model_mult2[] = "12233445";
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Reset the slow-loop (SLOP) bit on the 686(L) which is set by some old
|
|
|
|
* BIOSes for compatibility with DOS games. This makes the udelay loop
|
|
|
|
* work correctly, and improves performance.
|
|
|
|
*
|
|
|
|
* FIXME: our newer udelay uses the tsc. We don't need to frob with SLOP
|
|
|
|
*/
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static void check_cx686_slop(struct cpuinfo_x86 *c)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
unsigned long flags;
|
2008-02-23 06:11:23 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
if (Cx86_dir0_msb == 3) {
|
|
|
|
unsigned char ccr3, ccr5;
|
|
|
|
|
|
|
|
local_irq_save(flags);
|
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
2007-10-20 05:22:11 +08:00
|
|
|
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
|
2005-04-17 06:20:36 +08:00
|
|
|
ccr5 = getCx86(CX86_CCR5);
|
|
|
|
if (ccr5 & 2)
|
|
|
|
setCx86(CX86_CCR5, ccr5 & 0xfd); /* reset SLOP */
|
|
|
|
setCx86(CX86_CCR3, ccr3); /* disable MAPEN */
|
|
|
|
local_irq_restore(flags);
|
|
|
|
|
|
|
|
if (ccr5 & 2) { /* possible wrong calibration done */
|
|
|
|
printk(KERN_INFO "Recalibrating delay loop with SLOP bit reset\n");
|
|
|
|
calibrate_delay();
|
|
|
|
c->loops_per_jiffy = loops_per_jiffy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static void set_cx86_reorder(void)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
u8 ccr3;
|
|
|
|
|
|
|
|
printk(KERN_INFO "Enable Memory access reorder on Cyrix/NSC processor.\n");
|
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
2007-10-20 05:21:04 +08:00
|
|
|
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-10-20 05:21:04 +08:00
|
|
|
/* Load/Store Serialize to mem access disable (=reorder it) */
|
2008-07-22 17:58:14 +08:00
|
|
|
setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80);
|
2005-04-17 06:20:36 +08:00
|
|
|
/* set load/store serialize from 1GB to 4GB */
|
|
|
|
ccr3 |= 0xe0;
|
|
|
|
setCx86(CX86_CCR3, ccr3);
|
|
|
|
}
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static void set_cx86_memwb(void)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
|
|
|
|
|
|
|
|
/* CCR2 bit 2: unlock NW bit */
|
2008-07-22 17:58:14 +08:00
|
|
|
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04);
|
2005-04-17 06:20:36 +08:00
|
|
|
/* set 'Not Write-through' */
|
2008-01-30 20:30:39 +08:00
|
|
|
write_cr0(read_cr0() | X86_CR0_NW);
|
2005-04-17 06:20:36 +08:00
|
|
|
/* CCR2 bit 2: lock NW bit and set WT1 */
|
2008-07-22 17:58:14 +08:00
|
|
|
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Configure later MediaGX and/or Geode processor.
|
|
|
|
*/
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static void geode_configure(void)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
unsigned long flags;
|
2007-02-13 20:26:25 +08:00
|
|
|
u8 ccr3;
|
2005-04-17 06:20:36 +08:00
|
|
|
local_irq_save(flags);
|
|
|
|
|
|
|
|
/* Suspend on halt power saving and enable #SUSP pin */
|
2008-07-22 17:58:14 +08:00
|
|
|
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
2007-02-13 20:26:25 +08:00
|
|
|
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
|
2008-02-23 06:11:23 +08:00
|
|
|
|
2007-02-13 20:26:25 +08:00
|
|
|
|
|
|
|
/* FPU fast, DTE cache, Mem bypass */
|
2008-07-22 17:58:14 +08:00
|
|
|
setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38);
|
2007-02-13 20:26:25 +08:00
|
|
|
setCx86(CX86_CCR3, ccr3); /* disable MAPEN */
|
2008-02-23 06:11:23 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
set_cx86_memwb();
|
2008-02-23 06:11:23 +08:00
|
|
|
set_cx86_reorder();
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static void early_init_cyrix(struct cpuinfo_x86 *c)
|
2008-09-05 03:09:43 +08:00
|
|
|
{
|
|
|
|
unsigned char dir0, dir0_msn, dir1 = 0;
|
|
|
|
|
|
|
|
__do_cyrix_devid(&dir0, &dir1);
|
|
|
|
dir0_msn = dir0 >> 4; /* identifies CPU "family" */
|
|
|
|
|
|
|
|
switch (dir0_msn) {
|
|
|
|
case 3: /* 6x86/6x86L */
|
|
|
|
/* Emulate MTRRs using Cyrix's ARRs. */
|
|
|
|
set_cpu_cap(c, X86_FEATURE_CYRIX_ARR);
|
|
|
|
break;
|
|
|
|
case 5: /* 6x86MX/M II */
|
|
|
|
/* Emulate MTRRs using Cyrix's ARRs. */
|
|
|
|
set_cpu_cap(c, X86_FEATURE_CYRIX_ARR);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static void init_cyrix(struct cpuinfo_x86 *c)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
unsigned char dir0, dir0_msn, dir0_lsn, dir1 = 0;
|
|
|
|
char *buf = c->x86_model_id;
|
|
|
|
const char *p = NULL;
|
|
|
|
|
2008-02-23 06:11:23 +08:00
|
|
|
/*
|
|
|
|
* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
|
|
|
|
* 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway
|
|
|
|
*/
|
2008-02-26 15:52:27 +08:00
|
|
|
clear_cpu_cap(c, 0*32+31);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* Cyrix used bit 24 in extended (AMD) CPUID for Cyrix MMX extensions */
|
2008-02-26 15:52:27 +08:00
|
|
|
if (test_cpu_cap(c, 1*32+24)) {
|
|
|
|
clear_cpu_cap(c, 1*32+24);
|
|
|
|
set_cpu_cap(c, X86_FEATURE_CXMMX);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
do_cyrix_devid(&dir0, &dir1);
|
|
|
|
|
|
|
|
check_cx686_slop(c);
|
|
|
|
|
|
|
|
Cx86_dir0_msb = dir0_msn = dir0 >> 4; /* identifies CPU "family" */
|
|
|
|
dir0_lsn = dir0 & 0xf; /* model or clock multiplier */
|
|
|
|
|
|
|
|
/* common case step number/rev -- exceptions handled below */
|
|
|
|
c->x86_model = (dir1 >> 4) + 1;
|
|
|
|
c->x86_mask = dir1 & 0xf;
|
|
|
|
|
|
|
|
/* Now cook; the original recipe is by Channing Corn, from Cyrix.
|
|
|
|
* We do the same thing for each generation: we work out
|
|
|
|
* the model, multiplier and stepping. Black magic included,
|
|
|
|
* to make the silicon step/rev numbers match the printed ones.
|
|
|
|
*/
|
2008-02-23 06:11:23 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
switch (dir0_msn) {
|
|
|
|
unsigned char tmp;
|
|
|
|
|
|
|
|
case 0: /* Cx486SLC/DLC/SRx/DRx */
|
|
|
|
p = Cx486_name[dir0_lsn & 7];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1: /* Cx486S/DX/DX2/DX4 */
|
|
|
|
p = (dir0_lsn & 8) ? Cx486D_name[dir0_lsn & 5]
|
|
|
|
: Cx486S_name[dir0_lsn & 3];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2: /* 5x86 */
|
|
|
|
Cx86_cb[2] = cyrix_model_mult1[dir0_lsn & 5];
|
|
|
|
p = Cx86_cb+2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3: /* 6x86/6x86L */
|
|
|
|
Cx86_cb[1] = ' ';
|
|
|
|
Cx86_cb[2] = cyrix_model_mult1[dir0_lsn & 5];
|
|
|
|
if (dir1 > 0x21) { /* 686L */
|
|
|
|
Cx86_cb[0] = 'L';
|
|
|
|
p = Cx86_cb;
|
|
|
|
(c->x86_model)++;
|
|
|
|
} else /* 686 */
|
|
|
|
p = Cx86_cb+1;
|
|
|
|
/* Emulate MTRRs using Cyrix's ARRs. */
|
2008-02-26 15:52:27 +08:00
|
|
|
set_cpu_cap(c, X86_FEATURE_CYRIX_ARR);
|
2005-04-17 06:20:36 +08:00
|
|
|
/* 6x86's contain this bug */
|
2013-03-20 22:07:26 +08:00
|
|
|
set_cpu_bug(c, X86_BUG_COMA);
|
2005-04-17 06:20:36 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 4: /* MediaGX/GXm or Geode GXM/GXLV/GX1 */
|
|
|
|
#ifdef CONFIG_PCI
|
2007-02-13 20:26:26 +08:00
|
|
|
{
|
|
|
|
u32 vendor, device;
|
2008-02-23 06:11:23 +08:00
|
|
|
/*
|
|
|
|
* It isn't really a PCI quirk directly, but the cure is the
|
|
|
|
* same. The MediaGX has deep magic SMM stuff that handles the
|
|
|
|
* SB emulation. It throws away the fifo on disable_dma() which
|
|
|
|
* is wrong and ruins the audio.
|
|
|
|
*
|
|
|
|
* Bug2: VSA1 has a wrap bug so that using maximum sized DMA
|
|
|
|
* causes bad things. According to NatSemi VSA2 has another
|
|
|
|
* bug to do with 'hlt'. I've not seen any boards using VSA2
|
|
|
|
* and X doesn't seem to support it either so who cares 8).
|
|
|
|
* VSA1 we work around however.
|
|
|
|
*/
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
printk(KERN_INFO "Working around Cyrix MediaGX virtual DMA bugs.\n");
|
|
|
|
isa_dma_bridge_buggy = 2;
|
2006-06-23 17:04:26 +08:00
|
|
|
|
2007-02-13 20:26:26 +08:00
|
|
|
/* We do this before the PCI layer is running. However we
|
|
|
|
are safe here as we know the bridge must be a Cyrix
|
|
|
|
companion and must be present */
|
|
|
|
vendor = read_pci_config_16(0, 0, 0x12, PCI_VENDOR_ID);
|
|
|
|
device = read_pci_config_16(0, 0, 0x12, PCI_DEVICE_ID);
|
2006-06-23 17:04:26 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* The 5510/5520 companion chips have a funky PIT.
|
2008-02-23 06:11:23 +08:00
|
|
|
*/
|
2007-02-13 20:26:26 +08:00
|
|
|
if (vendor == PCI_VENDOR_ID_CYRIX &&
|
2009-07-04 07:35:45 +08:00
|
|
|
(device == PCI_DEVICE_ID_CYRIX_5510 ||
|
|
|
|
device == PCI_DEVICE_ID_CYRIX_5520))
|
2007-05-03 01:27:08 +08:00
|
|
|
mark_tsc_unstable("cyrix 5510/5520 detected");
|
2007-02-13 20:26:26 +08:00
|
|
|
}
|
2006-06-23 17:04:26 +08:00
|
|
|
#endif
|
2008-02-23 06:11:23 +08:00
|
|
|
c->x86_cache_size = 16; /* Yep 16K integrated cache thats it */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* GXm supports extended cpuid levels 'ala' AMD */
|
|
|
|
if (c->cpuid_level == 2) {
|
|
|
|
/* Enable cxMMX extensions (GX1 Datasheet 54) */
|
2008-07-22 17:58:14 +08:00
|
|
|
setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1);
|
2008-02-23 06:11:23 +08:00
|
|
|
|
2007-02-13 20:26:24 +08:00
|
|
|
/*
|
|
|
|
* GXm : 0x30 ... 0x5f GXm datasheet 51
|
|
|
|
* GXlv: 0x6x GXlv datasheet 54
|
|
|
|
* ? : 0x7x
|
|
|
|
* GX1 : 0x8x GX1 datasheet 56
|
|
|
|
*/
|
2009-07-04 07:35:45 +08:00
|
|
|
if ((0x30 <= dir1 && dir1 <= 0x6f) ||
|
|
|
|
(0x80 <= dir1 && dir1 <= 0x8f))
|
2005-04-17 06:20:36 +08:00
|
|
|
geode_configure();
|
|
|
|
return;
|
2008-02-23 06:11:23 +08:00
|
|
|
} else { /* MediaGX */
|
2005-04-17 06:20:36 +08:00
|
|
|
Cx86_cb[2] = (dir0_lsn & 1) ? '3' : '4';
|
|
|
|
p = Cx86_cb+2;
|
|
|
|
c->x86_model = (dir1 & 0x20) ? 1 : 2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-02-23 06:11:23 +08:00
|
|
|
case 5: /* 6x86MX/M II */
|
|
|
|
if (dir1 > 7) {
|
2005-04-17 06:20:36 +08:00
|
|
|
dir0_msn++; /* M II */
|
|
|
|
/* Enable MMX extensions (App note 108) */
|
2008-07-22 17:58:14 +08:00
|
|
|
setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1);
|
2008-02-23 06:11:23 +08:00
|
|
|
} else {
|
2013-03-20 22:07:26 +08:00
|
|
|
/* A 6x86MX - it has the bug. */
|
|
|
|
set_cpu_bug(c, X86_BUG_COMA);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
tmp = (!(dir0_lsn & 7) || dir0_lsn & 1) ? 2 : 0;
|
|
|
|
Cx86_cb[tmp] = cyrix_model_mult2[dir0_lsn & 7];
|
|
|
|
p = Cx86_cb+tmp;
|
2008-02-23 06:11:23 +08:00
|
|
|
if (((dir1 & 0x0f) > 4) || ((dir1 & 0xf0) == 0x20))
|
2005-04-17 06:20:36 +08:00
|
|
|
(c->x86_model)++;
|
|
|
|
/* Emulate MTRRs using Cyrix's ARRs. */
|
2008-02-26 15:52:27 +08:00
|
|
|
set_cpu_cap(c, X86_FEATURE_CYRIX_ARR);
|
2005-04-17 06:20:36 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0xf: /* Cyrix 486 without DEVID registers */
|
|
|
|
switch (dir0_lsn) {
|
|
|
|
case 0xd: /* either a 486SLC or DLC w/o DEVID */
|
|
|
|
dir0_msn = 0;
|
2013-04-29 22:04:20 +08:00
|
|
|
p = Cx486_name[(cpu_has_fpu ? 1 : 0)];
|
2005-04-17 06:20:36 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0xe: /* a 486S A step */
|
|
|
|
dir0_msn = 0;
|
|
|
|
p = Cx486S_name[0];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default: /* unknown (shouldn't happen, we know everyone ;-) */
|
|
|
|
dir0_msn = 7;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
strcpy(buf, Cx86_model[dir0_msn & 7]);
|
2008-02-23 06:11:23 +08:00
|
|
|
if (p)
|
|
|
|
strcat(buf, p);
|
2005-04-17 06:20:36 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-01-06 16:12:14 +08:00
|
|
|
/*
|
|
|
|
* Handle National Semiconductor branded processors
|
|
|
|
*/
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static void init_nsc(struct cpuinfo_x86 *c)
|
2006-01-06 16:12:14 +08:00
|
|
|
{
|
2008-02-23 06:11:23 +08:00
|
|
|
/*
|
|
|
|
* There may be GX1 processors in the wild that are branded
|
2006-01-06 16:12:14 +08:00
|
|
|
* NSC and not Cyrix.
|
|
|
|
*
|
|
|
|
* This function only handles the GX processor, and kicks every
|
|
|
|
* thing else to the Cyrix init function above - that should
|
|
|
|
* cover any processors that might have been branded differently
|
2006-06-27 00:35:02 +08:00
|
|
|
* after NSC acquired Cyrix.
|
2006-01-06 16:12:14 +08:00
|
|
|
*
|
|
|
|
* If this breaks your GX1 horribly, please e-mail
|
|
|
|
* info-linux@ldcmail.amd.com to tell us.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Handle the GX (Formally known as the GX2) */
|
|
|
|
|
|
|
|
if (c->x86 == 5 && c->x86_model == 5)
|
2009-11-21 21:01:45 +08:00
|
|
|
cpu_detect_cache_sizes(c);
|
2006-01-06 16:12:14 +08:00
|
|
|
else
|
|
|
|
init_cyrix(c);
|
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* Cyrix CPUs without cpuid or with cpuid not yet enabled can be detected
|
|
|
|
* by the fact that they preserve the flags across the division of 5/2.
|
|
|
|
* PII and PPro exhibit this behavior too, but they have cpuid available.
|
|
|
|
*/
|
2008-02-23 06:11:23 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* Perform the Cyrix 5/2 test. A Cyrix won't change
|
|
|
|
* the flags, while other 486 chips will.
|
|
|
|
*/
|
|
|
|
static inline int test_cyrix_52div(void)
|
|
|
|
{
|
|
|
|
unsigned int test;
|
|
|
|
|
|
|
|
__asm__ __volatile__(
|
|
|
|
"sahf\n\t" /* clear flags (%eax = 0x0005) */
|
|
|
|
"div %b2\n\t" /* divide 5 by 2 */
|
|
|
|
"lahf" /* store flags into %ah */
|
|
|
|
: "=a" (test)
|
|
|
|
: "0" (5), "q" (2)
|
|
|
|
: "cc");
|
|
|
|
|
|
|
|
/* AH is 0x02 on Cyrix after the divide.. */
|
|
|
|
return (unsigned char) (test >> 8) == 0x02;
|
|
|
|
}
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static void cyrix_identify(struct cpuinfo_x86 *c)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
/* Detect Cyrix with disabled CPUID */
|
2008-02-23 06:11:23 +08:00
|
|
|
if (c->x86 == 4 && test_cyrix_52div()) {
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned char dir0, dir1;
|
2008-02-23 06:11:23 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
strcpy(c->x86_vendor_id, "CyrixInstead");
|
2008-02-23 06:11:23 +08:00
|
|
|
c->x86_vendor = X86_VENDOR_CYRIX;
|
|
|
|
|
|
|
|
/* Actually enable cpuid on the older cyrix */
|
|
|
|
|
|
|
|
/* Retrieve CPU revisions */
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
do_cyrix_devid(&dir0, &dir1);
|
|
|
|
|
2008-02-23 06:11:23 +08:00
|
|
|
dir0 >>= 4;
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/* Check it is an affected model */
|
2008-02-23 06:11:23 +08:00
|
|
|
|
|
|
|
if (dir0 == 5 || dir0 == 3) {
|
2007-02-13 20:26:25 +08:00
|
|
|
unsigned char ccr3;
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned long flags;
|
|
|
|
printk(KERN_INFO "Enabling CPUID on Cyrix processor.\n");
|
|
|
|
local_irq_save(flags);
|
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
2009-07-04 07:35:45 +08:00
|
|
|
/* enable MAPEN */
|
|
|
|
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);
|
|
|
|
/* enable cpuid */
|
|
|
|
setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);
|
|
|
|
/* disable MAPEN */
|
|
|
|
setCx86(CX86_CCR3, ccr3);
|
2005-04-17 06:20:36 +08:00
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static const struct cpu_dev cyrix_cpu_dev = {
|
2005-04-17 06:20:36 +08:00
|
|
|
.c_vendor = "Cyrix",
|
2008-02-23 06:11:23 +08:00
|
|
|
.c_ident = { "CyrixInstead" },
|
2008-09-05 03:09:43 +08:00
|
|
|
.c_early_init = early_init_cyrix,
|
2005-04-17 06:20:36 +08:00
|
|
|
.c_init = init_cyrix,
|
|
|
|
.c_identify = cyrix_identify,
|
2008-09-05 03:09:45 +08:00
|
|
|
.c_x86_vendor = X86_VENDOR_CYRIX,
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2008-09-05 03:09:45 +08:00
|
|
|
cpu_dev_register(cyrix_cpu_dev);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 06:23:59 +08:00
|
|
|
static const struct cpu_dev nsc_cpu_dev = {
|
2005-04-17 06:20:36 +08:00
|
|
|
.c_vendor = "NSC",
|
2008-02-23 06:11:23 +08:00
|
|
|
.c_ident = { "Geode by NSC" },
|
2006-01-06 16:12:14 +08:00
|
|
|
.c_init = init_nsc,
|
2008-09-05 03:09:45 +08:00
|
|
|
.c_x86_vendor = X86_VENDOR_NSC,
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2008-09-05 03:09:45 +08:00
|
|
|
cpu_dev_register(nsc_cpu_dev);
|