also update spec file ...
[linux-flexiantxendom0-3.2.10.git] / arch / mips64 / mm / cex-sb1.S
1 /*
2  * Copyright (C) 2001,2002,2003 Broadcom Corporation
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17  */
18 #include <linux/config.h>
19 #include <linux/init.h>
20
21 #include <asm/asm.h>
22 #include <asm/regdef.h>
23 #include <asm/mipsregs.h>
24 #include <asm/stackframe.h>
25 #include <asm/sibyte/board.h>
26
27         .text
28         .set    noat
29         .set    mips4
30
31         __INIT
32         
33         /* Cache Error handler for SB1 */
34         LEAF(except_vec2_sb1)
35         mfc0    k1, $26
36         # check if error was recoverable
37         bltz    k1, leave_cerr
38 #ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
39         # look for signature of spurious CErr
40         lui     k0, 0x4000
41         bne     k0, k1, 1f
42         .word   0x401Bd801                      # mfc0  k1, $27, 1
43         lui     k0, 0xffe0
44         and     k1, k0, k1
45         lui     k0, 0x0200
46         beq     k0, k1, leave_cerr
47 1:
48 #endif
49         j       handle_vec2_sb1
50
51 leave_cerr:
52         # clear/unlock the registers
53         mtc0    zero, $26
54         mtc0    zero, $27
55         .word   0x4080d801                      # mtc0  zero, $27, 1
56         .word   0x4080d803                      # mtc0  zero, $27, 3
57         eret
58         END(except_vec2_sb1)
59
60         __FINIT
61
62         LEAF(handle_vec2_sb1)
63         mfc0    k0,CP0_CONFIG
64         li      k1,~CONF_CM_CMASK
65         and     k0,k0,k1
66         ori     k0,k0,CONF_CM_UNCACHED
67         mtc0    k0,CP0_CONFIG
68
69         SSNOP
70         SSNOP
71         SSNOP
72         SSNOP
73         bnezl   $0, 1f
74 1:
75         mfc0    k0, CP0_STATUS
76         sll     k0, k0, 3                       # check CU0 (kernel?)
77         bltz    k0, 2f
78         get_saved_sp
79         move    sp, k1                          # want Kseg SP (so uncached)
80 2:
81         j       sb1_cache_error
82
83         END(handle_vec2_sb1)