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
Kirill Smelkov
linux
Commits
5a812999
Commit
5a812999
authored
Jul 17, 2007
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MIPS] Workaround for RM7000 WAIT instruction aka erratum 38
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
17099b11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
arch/mips/kernel/cpu-probe.c
arch/mips/kernel/cpu-probe.c
+25
-1
No files found.
arch/mips/kernel/cpu-probe.c
View file @
5a812999
...
@@ -75,6 +75,27 @@ static void r4k_wait_irqoff(void)
...
@@ -75,6 +75,27 @@ static void r4k_wait_irqoff(void)
local_irq_enable
();
local_irq_enable
();
}
}
/*
* The RM7000 variant has to handle erratum 38. The workaround is to not
* have any pending stores when the WAIT instruction is executed.
*/
static
void
rm7k_wait_irqoff
(
void
)
{
local_irq_disable
();
if
(
!
need_resched
())
__asm__
(
" .set push
\n
"
" .set mips3
\n
"
" .set noat
\n
"
" mfc0 $1, $12
\n
"
" sync
\n
"
" mtc0 $1, $12 # stalls until W stage
\n
"
" wait
\n
"
" mtc0 $1, $12 # stalls until W stage
\n
"
" .set pop
\n
"
);
local_irq_enable
();
}
/* The Au1xxx wait is available only if using 32khz counter or
/* The Au1xxx wait is available only if using 32khz counter or
* external timer source, but specifically not CP0 Counter. */
* external timer source, but specifically not CP0 Counter. */
int
allow_au1k_wait
;
int
allow_au1k_wait
;
...
@@ -132,7 +153,6 @@ static inline void check_wait(void)
...
@@ -132,7 +153,6 @@ static inline void check_wait(void)
case
CPU_R4700
:
case
CPU_R4700
:
case
CPU_R5000
:
case
CPU_R5000
:
case
CPU_NEVADA
:
case
CPU_NEVADA
:
case
CPU_RM7000
:
case
CPU_4KC
:
case
CPU_4KC
:
case
CPU_4KEC
:
case
CPU_4KEC
:
case
CPU_4KSC
:
case
CPU_4KSC
:
...
@@ -142,6 +162,10 @@ static inline void check_wait(void)
...
@@ -142,6 +162,10 @@ static inline void check_wait(void)
cpu_wait
=
r4k_wait
;
cpu_wait
=
r4k_wait
;
break
;
break
;
case
CPU_RM7000
:
cpu_wait
=
rm7k_wait_irqoff
;
break
;
case
CPU_24K
:
case
CPU_24K
:
case
CPU_34K
:
case
CPU_34K
:
cpu_wait
=
r4k_wait
;
cpu_wait
=
r4k_wait
;
...
...
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