License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 21:07:57 +07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2005-04-17 05:20:36 +07:00
|
|
|
#include <linux/bitops.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/pci.h>
|
|
|
|
#include <asm/dma.h>
|
2009-07-04 06:35:45 +07:00
|
|
|
#include <linux/io.h>
|
2007-07-22 16:12:38 +07:00
|
|
|
#include <asm/processor-cyrix.h>
|
2008-01-30 19:30:39 +07:00
|
|
|
#include <asm/processor-flags.h>
|
2009-07-04 06:35:45 +07:00
|
|
|
#include <linux/timer.h>
|
2007-02-13 19:26:26 +07: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 04:22:52 +07:00
|
|
|
#include <asm/tsc.h>
|
2016-01-27 04:12:04 +07:00
|
|
|
#include <asm/cpufeature.h>
|
2017-01-19 20:36:33 +07:00
|
|
|
#include <linux/sched.h>
|
2017-02-01 22:36:40 +07:00
|
|
|
#include <linux/sched/clock.h>
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static void __do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
unsigned char ccr2, ccr3;
|
2008-02-23 05:11:23 +07:00
|
|
|
|
2005-04-17 05:20:36 +07: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 05:11:23 +07:00
|
|
|
} else {
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static void do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
|
2008-09-05 02:09:43 +07:00
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
local_irq_save(flags);
|
|
|
|
__do_cyrix_devid(dir0, dir1);
|
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static unsigned char Cx86_dir0_msb = 0;
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static const char Cx86_model[][9] = {
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static const char Cx486_name[][5] = {
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static const char Cx486S_name[][4] = {
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static const char Cx486D_name[][4] = {
|
2005-04-17 05:20:36 +07: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 05:23:59 +07: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 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static void check_cx686_slop(struct cpuinfo_x86 *c)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
unsigned long flags;
|
2008-02-23 05:11:23 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
if (Cx86_dir0_msb == 3) {
|
|
|
|
unsigned char ccr3, ccr5;
|
|
|
|
|
|
|
|
local_irq_save(flags);
|
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
2007-10-20 04:22:11 +07:00
|
|
|
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
|
2005-04-17 05:20:36 +07: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 */
|
2016-02-02 10:45:02 +07:00
|
|
|
pr_info("Recalibrating delay loop with SLOP bit reset\n");
|
2005-04-17 05:20:36 +07:00
|
|
|
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 05:23:59 +07:00
|
|
|
static void set_cx86_reorder(void)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
u8 ccr3;
|
|
|
|
|
2016-02-02 10:45:02 +07:00
|
|
|
pr_info("Enable Memory access reorder on Cyrix/NSC processor.\n");
|
2005-04-17 05:20:36 +07:00
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
2007-10-20 04:21:04 +07:00
|
|
|
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2007-10-20 04:21:04 +07:00
|
|
|
/* Load/Store Serialize to mem access disable (=reorder it) */
|
2008-07-22 16:58:14 +07:00
|
|
|
setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80);
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static void set_cx86_memwb(void)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
2016-02-02 10:45:02 +07:00
|
|
|
pr_info("Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* CCR2 bit 2: unlock NW bit */
|
2008-07-22 16:58:14 +07:00
|
|
|
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04);
|
2005-04-17 05:20:36 +07:00
|
|
|
/* set 'Not Write-through' */
|
2008-01-30 19:30:39 +07:00
|
|
|
write_cr0(read_cr0() | X86_CR0_NW);
|
2005-04-17 05:20:36 +07:00
|
|
|
/* CCR2 bit 2: lock NW bit and set WT1 */
|
2008-07-22 16:58:14 +07:00
|
|
|
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14);
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static void geode_configure(void)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
unsigned long flags;
|
2007-02-13 19:26:25 +07:00
|
|
|
u8 ccr3;
|
2005-04-17 05:20:36 +07:00
|
|
|
local_irq_save(flags);
|
|
|
|
|
|
|
|
/* Suspend on halt power saving and enable #SUSP pin */
|
2008-07-22 16:58:14 +07:00
|
|
|
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
2007-02-13 19:26:25 +07:00
|
|
|
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
|
2008-02-23 05:11:23 +07:00
|
|
|
|
2007-02-13 19:26:25 +07:00
|
|
|
|
|
|
|
/* FPU fast, DTE cache, Mem bypass */
|
2008-07-22 16:58:14 +07:00
|
|
|
setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38);
|
2007-02-13 19:26:25 +07:00
|
|
|
setCx86(CX86_CCR3, ccr3); /* disable MAPEN */
|
2008-02-23 05:11:23 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
set_cx86_memwb();
|
2008-02-23 05:11:23 +07:00
|
|
|
set_cx86_reorder();
|
|
|
|
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static void early_init_cyrix(struct cpuinfo_x86 *c)
|
2008-09-05 02:09:43 +07: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 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static void init_cyrix(struct cpuinfo_x86 *c)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
unsigned char dir0, dir0_msn, dir0_lsn, dir1 = 0;
|
|
|
|
char *buf = c->x86_model_id;
|
|
|
|
const char *p = NULL;
|
|
|
|
|
2008-02-23 05:11:23 +07: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 14:52:27 +07:00
|
|
|
clear_cpu_cap(c, 0*32+31);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* Cyrix used bit 24 in extended (AMD) CPUID for Cyrix MMX extensions */
|
2008-02-26 14:52:27 +07: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 05:20:36 +07: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;
|
2018-01-01 08:52:10 +07:00
|
|
|
c->x86_stepping = dir1 & 0xf;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* 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 05:11:23 +07:00
|
|
|
|
2005-04-17 05:20:36 +07: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 14:52:27 +07:00
|
|
|
set_cpu_cap(c, X86_FEATURE_CYRIX_ARR);
|
2005-04-17 05:20:36 +07:00
|
|
|
/* 6x86's contain this bug */
|
2013-03-20 21:07:26 +07:00
|
|
|
set_cpu_bug(c, X86_BUG_COMA);
|
2005-04-17 05:20:36 +07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 4: /* MediaGX/GXm or Geode GXM/GXLV/GX1 */
|
x86/cpu/cyrix: Add alternative Device ID of Geode GX1 SoC
A SoC variant of Geode GX1, notably NSC branded SC1100, seems to
report an inverted Device ID in its DIR0 configuration register,
specifically 0xb instead of the expected 0x4.
Catch this presumably quirky version so it's properly recognized
as GX1 and has its cache switched to write-back mode, which provides
a significant performance boost in most workloads.
SC1100's datasheet "Geode™ SC1100 Information Appliance On a Chip",
states in section 1.1.7.1 "Device ID" that device identification
values are specified in SC1100's device errata. These, however,
seem to not have been publicly released.
Wading through a number of boot logs and /proc/cpuinfo dumps found on
pastebin and blogs, this patch should mostly be relevant for a number
of now admittedly aging Soekris NET4801 and PC Engines WRAP devices,
the latter being the platform this issue was discovered on.
Performance impact was verified using "openssl speed", with
write-back caching scaling throughput between -3% and +41%.
Signed-off-by: Christian Sünkenberg <christian.suenkenberg@student.kit.edu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1496596719.26725.14.camel@student.kit.edu
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-06-05 00:18:39 +07:00
|
|
|
case 11: /* GX1 with inverted Device ID */
|
2005-04-17 05:20:36 +07:00
|
|
|
#ifdef CONFIG_PCI
|
2007-02-13 19:26:26 +07:00
|
|
|
{
|
|
|
|
u32 vendor, device;
|
2008-02-23 05:11:23 +07: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 05:20:36 +07:00
|
|
|
|
2016-02-02 10:45:02 +07:00
|
|
|
pr_info("Working around Cyrix MediaGX virtual DMA bugs.\n");
|
2005-04-17 05:20:36 +07:00
|
|
|
isa_dma_bridge_buggy = 2;
|
2006-06-23 16:04:26 +07:00
|
|
|
|
2007-02-13 19:26:26 +07: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 16:04:26 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* The 5510/5520 companion chips have a funky PIT.
|
2008-02-23 05:11:23 +07:00
|
|
|
*/
|
2007-02-13 19:26:26 +07:00
|
|
|
if (vendor == PCI_VENDOR_ID_CYRIX &&
|
2009-07-04 06:35:45 +07:00
|
|
|
(device == PCI_DEVICE_ID_CYRIX_5510 ||
|
|
|
|
device == PCI_DEVICE_ID_CYRIX_5520))
|
2007-05-03 00:27:08 +07:00
|
|
|
mark_tsc_unstable("cyrix 5510/5520 detected");
|
2007-02-13 19:26:26 +07:00
|
|
|
}
|
2006-06-23 16:04:26 +07:00
|
|
|
#endif
|
2008-02-23 05:11:23 +07:00
|
|
|
c->x86_cache_size = 16; /* Yep 16K integrated cache thats it */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* GXm supports extended cpuid levels 'ala' AMD */
|
|
|
|
if (c->cpuid_level == 2) {
|
|
|
|
/* Enable cxMMX extensions (GX1 Datasheet 54) */
|
2008-07-22 16:58:14 +07:00
|
|
|
setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1);
|
2008-02-23 05:11:23 +07:00
|
|
|
|
2007-02-13 19:26:24 +07:00
|
|
|
/*
|
|
|
|
* GXm : 0x30 ... 0x5f GXm datasheet 51
|
|
|
|
* GXlv: 0x6x GXlv datasheet 54
|
|
|
|
* ? : 0x7x
|
|
|
|
* GX1 : 0x8x GX1 datasheet 56
|
|
|
|
*/
|
2009-07-04 06:35:45 +07:00
|
|
|
if ((0x30 <= dir1 && dir1 <= 0x6f) ||
|
|
|
|
(0x80 <= dir1 && dir1 <= 0x8f))
|
2005-04-17 05:20:36 +07:00
|
|
|
geode_configure();
|
|
|
|
return;
|
2008-02-23 05:11:23 +07:00
|
|
|
} else { /* MediaGX */
|
2005-04-17 05:20:36 +07:00
|
|
|
Cx86_cb[2] = (dir0_lsn & 1) ? '3' : '4';
|
|
|
|
p = Cx86_cb+2;
|
|
|
|
c->x86_model = (dir1 & 0x20) ? 1 : 2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-02-23 05:11:23 +07:00
|
|
|
case 5: /* 6x86MX/M II */
|
|
|
|
if (dir1 > 7) {
|
2005-04-17 05:20:36 +07:00
|
|
|
dir0_msn++; /* M II */
|
|
|
|
/* Enable MMX extensions (App note 108) */
|
2008-07-22 16:58:14 +07:00
|
|
|
setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1);
|
2008-02-23 05:11:23 +07:00
|
|
|
} else {
|
2013-03-20 21:07:26 +07:00
|
|
|
/* A 6x86MX - it has the bug. */
|
|
|
|
set_cpu_bug(c, X86_BUG_COMA);
|
2005-04-17 05:20:36 +07: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 05:11:23 +07:00
|
|
|
if (((dir1 & 0x0f) > 4) || ((dir1 & 0xf0) == 0x20))
|
2005-04-17 05:20:36 +07:00
|
|
|
(c->x86_model)++;
|
|
|
|
/* Emulate MTRRs using Cyrix's ARRs. */
|
2008-02-26 14:52:27 +07:00
|
|
|
set_cpu_cap(c, X86_FEATURE_CYRIX_ARR);
|
2005-04-17 05:20:36 +07: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;
|
2016-04-05 03:24:58 +07:00
|
|
|
p = Cx486_name[!!boot_cpu_has(X86_FEATURE_FPU)];
|
2005-04-17 05:20:36 +07: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 05:11:23 +07:00
|
|
|
if (p)
|
|
|
|
strcat(buf, p);
|
2005-04-17 05:20:36 +07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:12:14 +07: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 05:23:59 +07:00
|
|
|
static void init_nsc(struct cpuinfo_x86 *c)
|
2006-01-06 15:12:14 +07:00
|
|
|
{
|
2008-02-23 05:11:23 +07:00
|
|
|
/*
|
|
|
|
* There may be GX1 processors in the wild that are branded
|
2006-01-06 15:12:14 +07: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-26 23:35:02 +07:00
|
|
|
* after NSC acquired Cyrix.
|
2006-01-06 15:12:14 +07: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 20:01:45 +07:00
|
|
|
cpu_detect_cache_sizes(c);
|
2006-01-06 15:12:14 +07:00
|
|
|
else
|
|
|
|
init_cyrix(c);
|
|
|
|
}
|
|
|
|
|
2005-04-17 05:20:36 +07: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 05:11:23 +07:00
|
|
|
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static void cyrix_identify(struct cpuinfo_x86 *c)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
/* Detect Cyrix with disabled CPUID */
|
2008-02-23 05:11:23 +07:00
|
|
|
if (c->x86 == 4 && test_cyrix_52div()) {
|
2005-04-17 05:20:36 +07:00
|
|
|
unsigned char dir0, dir1;
|
2008-02-23 05:11:23 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
strcpy(c->x86_vendor_id, "CyrixInstead");
|
2008-02-23 05:11:23 +07:00
|
|
|
c->x86_vendor = X86_VENDOR_CYRIX;
|
|
|
|
|
|
|
|
/* Actually enable cpuid on the older cyrix */
|
|
|
|
|
|
|
|
/* Retrieve CPU revisions */
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
do_cyrix_devid(&dir0, &dir1);
|
|
|
|
|
2008-02-23 05:11:23 +07:00
|
|
|
dir0 >>= 4;
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/* Check it is an affected model */
|
2008-02-23 05:11:23 +07:00
|
|
|
|
|
|
|
if (dir0 == 5 || dir0 == 3) {
|
2007-02-13 19:26:25 +07:00
|
|
|
unsigned char ccr3;
|
2005-04-17 05:20:36 +07:00
|
|
|
unsigned long flags;
|
2016-02-02 10:45:02 +07:00
|
|
|
pr_info("Enabling CPUID on Cyrix processor.\n");
|
2005-04-17 05:20:36 +07:00
|
|
|
local_irq_save(flags);
|
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
2009-07-04 06:35:45 +07: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 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static const struct cpu_dev cyrix_cpu_dev = {
|
2005-04-17 05:20:36 +07:00
|
|
|
.c_vendor = "Cyrix",
|
2008-02-23 05:11:23 +07:00
|
|
|
.c_ident = { "CyrixInstead" },
|
2008-09-05 02:09:43 +07:00
|
|
|
.c_early_init = early_init_cyrix,
|
2005-04-17 05:20:36 +07:00
|
|
|
.c_init = init_cyrix,
|
|
|
|
.c_identify = cyrix_identify,
|
2008-09-05 02:09:45 +07:00
|
|
|
.c_x86_vendor = X86_VENDOR_CYRIX,
|
2005-04-17 05:20:36 +07:00
|
|
|
};
|
|
|
|
|
2008-09-05 02:09:45 +07:00
|
|
|
cpu_dev_register(cyrix_cpu_dev);
|
2005-04-17 05:20:36 +07: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 05:23:59 +07:00
|
|
|
static const struct cpu_dev nsc_cpu_dev = {
|
2005-04-17 05:20:36 +07:00
|
|
|
.c_vendor = "NSC",
|
2008-02-23 05:11:23 +07:00
|
|
|
.c_ident = { "Geode by NSC" },
|
2006-01-06 15:12:14 +07:00
|
|
|
.c_init = init_nsc,
|
2008-09-05 02:09:45 +07:00
|
|
|
.c_x86_vendor = X86_VENDOR_NSC,
|
2005-04-17 05:20:36 +07:00
|
|
|
};
|
|
|
|
|
2008-09-05 02:09:45 +07:00
|
|
|
cpu_dev_register(nsc_cpu_dev);
|