Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
6adfceca
Commit
6adfceca
authored
Nov 25, 2002
by
Alan Cox
Committed by
Linus Torvalds
Nov 25, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] cyrix cpu optimisations
parent
fa8bb677
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
1 deletion
+91
-1
arch/i386/kernel/cpu/cyrix.c
arch/i386/kernel/cpu/cyrix.c
+87
-1
include/asm-i386/processor.h
include/asm-i386/processor.h
+4
-0
No files found.
arch/i386/kernel/cpu/cyrix.c
View file @
6adfceca
...
...
@@ -106,6 +106,89 @@ static void __init check_cx686_slop(struct cpuinfo_x86 *c)
}
}
static
void
__init
set_cx86_reorder
(
void
)
{
#ifdef CONFIG_OOSTORE
u8
ccr3
;
printk
(
KERN_INFO
"Enable Memory access reorder on Cyrix/NSC processor.
\n
"
);
ccr3
=
getCx86
(
CX86_CCR3
);
setCx86
(
CX86_CCR3
,
(
ccr3
&
0x0f
)
|
0x10
);
/* enable MAPEN */
/* Load/Store Serialize to mem access disable (=reorder it) */
setCx86
(
CX86_PCR0
,
getCx86
(
CX86_PCR0
)
&
~
0x80
);
#ifdef CONFIG_NOHIGHMEM
/* set load/store serialize from 1GB to 4GB */
ccr3
|=
0xe0
;
#endif
setCx86
(
CX86_CCR3
,
ccr3
);
#endif
}
static
void
__init
set_cx86_memwb
(
void
)
{
u32
cr0
;
printk
(
KERN_INFO
"Enable Memory-Write-back mode on Cyrix/NSC processor.
\n
"
);
/* CCR2 bit 2: unlock NW bit */
setCx86
(
CX86_CCR2
,
getCx86
(
CX86_CCR2
)
&
~
0x04
);
/* set 'Not Write-through' */
cr0
=
0x20000000
;
__asm__
(
"movl %%cr0,%%eax
\n\t
"
"orl %0,%%eax
\n\t
"
"movl %%eax,%%cr0
\n
"
:
:
"r"
(
cr0
)
:
"ax"
);
/* CCR2 bit 2: lock NW bit and set WT1 */
setCx86
(
CX86_CCR2
,
getCx86
(
CX86_CCR2
)
|
0x14
);
}
static
void
__init
set_cx86_inc
(
void
)
{
unsigned
char
ccr3
;
printk
(
KERN_INFO
"Enable Incrementor on Cyrix/NSC processor.
\n
"
);
ccr3
=
getCx86
(
CX86_CCR3
);
setCx86
(
CX86_CCR3
,
(
ccr3
&
0x0f
)
|
0x10
);
/* enable MAPEN */
/* PCR1 -- Performance Control */
/* Incrementor on, whatever that is */
setCx86
(
CX86_PCR1
,
getCx86
(
CX86_PCR1
)
|
0x02
);
/* PCR0 -- Performance Control */
/* Incrementor Margin 10 */
setCx86
(
CX86_PCR0
,
getCx86
(
CX86_PCR0
)
|
0x04
);
setCx86
(
CX86_CCR3
,
ccr3
);
/* disable MAPEN */
}
/*
* Configure later MediaGX and/or Geode processor.
*/
static
void
__init
geode_configure
(
void
)
{
unsigned
long
flags
;
u8
ccr3
,
ccr4
;
unsigned
long
cr0
;
local_irq_save
(
flags
);
ccr3
=
getCx86
(
CX86_CCR3
);
setCx86
(
CX86_CCR3
,
(
ccr3
&
0x0f
)
|
0x10
);
/* Enable */
ccr4
=
getCx86
(
CX86_CCR4
);
ccr4
|=
0x38
;
/* FPU fast, DTE cache, Mem bypass */
setCx86
(
CX86_CCR3
,
ccr3
);
set_cx86_memwb
();
set_cx86_reorder
();
set_cx86_inc
();
local_irq_restore
(
flags
);
}
static
void
__init
init_cyrix
(
struct
cpuinfo_x86
*
c
)
{
unsigned
char
dir0
,
dir0_msn
,
dir0_lsn
,
dir1
=
0
;
...
...
@@ -201,7 +284,10 @@ static void __init init_cyrix(struct cpuinfo_x86 *c)
if
(
c
->
cpuid_level
==
2
)
{
/* Enable cxMMX extensions (GX1 Datasheet 54) */
setCx86
(
CX86_CCR7
,
getCx86
(
CX86_CCR7
)
|
1
);
/* GXlv/GXm/GX1 */
if
((
dir1
>=
0x50
&&
dir1
<=
0x54
)
||
dir1
>=
0x63
)
geode_configure
();
get_model_name
(
c
);
/* get CPU marketing name */
return
;
}
...
...
include/asm-i386/processor.h
View file @
6adfceca
...
...
@@ -221,6 +221,9 @@ static inline void clear_in_cr4 (unsigned long mask)
/*
* NSC/Cyrix CPU configuration register indexes
*/
#define CX86_PCR0 0x20
#define CX86_GCR 0xb8
#define CX86_CCR0 0xc0
#define CX86_CCR1 0xc1
#define CX86_CCR2 0xc2
...
...
@@ -229,6 +232,7 @@ static inline void clear_in_cr4 (unsigned long mask)
#define CX86_CCR5 0xe9
#define CX86_CCR6 0xea
#define CX86_CCR7 0xeb
#define CX86_PCR1 0xf0
#define CX86_DIR0 0xfe
#define CX86_DIR1 0xff
#define CX86_ARR_BASE 0xc4
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment