diff options
Diffstat (limited to 'include')
462 files changed, 0 insertions, 61610 deletions
diff --git a/include/asm-mips/Kbuild b/include/asm-mips/Kbuild deleted file mode 100644 index 7897f05e3165..000000000000 --- a/include/asm-mips/Kbuild +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | |||
3 | header-y += cachectl.h sgidefs.h sysmips.h | ||
diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h deleted file mode 100644 index cad8371422ab..000000000000 --- a/include/asm-mips/a.out.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 - 1999, 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_A_OUT_H | ||
9 | #define _ASM_A_OUT_H | ||
10 | |||
11 | #ifdef __KERNEL__ | ||
12 | |||
13 | |||
14 | #endif | ||
15 | |||
16 | struct exec | ||
17 | { | ||
18 | unsigned long a_info; /* Use macros N_MAGIC, etc for access */ | ||
19 | unsigned a_text; /* length of text, in bytes */ | ||
20 | unsigned a_data; /* length of data, in bytes */ | ||
21 | unsigned a_bss; /* length of uninitialized data area for | ||
22 | file, in bytes */ | ||
23 | unsigned a_syms; /* length of symbol table data in file, | ||
24 | in bytes */ | ||
25 | unsigned a_entry; /* start address */ | ||
26 | unsigned a_trsize; /* length of relocation info for text, in | ||
27 | bytes */ | ||
28 | unsigned a_drsize; /* length of relocation info for data, in bytes */ | ||
29 | }; | ||
30 | |||
31 | #define N_TRSIZE(a) ((a).a_trsize) | ||
32 | #define N_DRSIZE(a) ((a).a_drsize) | ||
33 | #define N_SYMSIZE(a) ((a).a_syms) | ||
34 | |||
35 | #endif /* _ASM_A_OUT_H */ | ||
diff --git a/include/asm-mips/abi.h b/include/asm-mips/abi.h deleted file mode 100644 index 1dd74fbdc09b..000000000000 --- a/include/asm-mips/abi.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2005, 06 by Ralf Baechle (ralf@linux-mips.org) | ||
7 | * Copyright (C) 2005 MIPS Technologies, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_ABI_H | ||
10 | #define _ASM_ABI_H | ||
11 | |||
12 | #include <asm/signal.h> | ||
13 | #include <asm/siginfo.h> | ||
14 | |||
15 | struct mips_abi { | ||
16 | int (* const setup_frame)(struct k_sigaction * ka, | ||
17 | struct pt_regs *regs, int signr, | ||
18 | sigset_t *set); | ||
19 | int (* const setup_rt_frame)(struct k_sigaction * ka, | ||
20 | struct pt_regs *regs, int signr, | ||
21 | sigset_t *set, siginfo_t *info); | ||
22 | const unsigned long restart; | ||
23 | }; | ||
24 | |||
25 | #endif /* _ASM_ABI_H */ | ||
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h deleted file mode 100644 index 569f80aacbd2..000000000000 --- a/include/asm-mips/addrspace.h +++ /dev/null | |||
@@ -1,154 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 99 Ralf Baechle | ||
7 | * Copyright (C) 2000, 2002 Maciej W. Rozycki | ||
8 | * Copyright (C) 1990, 1999 by Silicon Graphics, Inc. | ||
9 | */ | ||
10 | #ifndef _ASM_ADDRSPACE_H | ||
11 | #define _ASM_ADDRSPACE_H | ||
12 | |||
13 | #include <spaces.h> | ||
14 | |||
15 | /* | ||
16 | * Configure language | ||
17 | */ | ||
18 | #ifdef __ASSEMBLY__ | ||
19 | #define _ATYPE_ | ||
20 | #define _ATYPE32_ | ||
21 | #define _ATYPE64_ | ||
22 | #define _CONST64_(x) x | ||
23 | #else | ||
24 | #define _ATYPE_ __PTRDIFF_TYPE__ | ||
25 | #define _ATYPE32_ int | ||
26 | #define _ATYPE64_ __s64 | ||
27 | #ifdef CONFIG_64BIT | ||
28 | #define _CONST64_(x) x ## L | ||
29 | #else | ||
30 | #define _CONST64_(x) x ## LL | ||
31 | #endif | ||
32 | #endif | ||
33 | |||
34 | /* | ||
35 | * 32-bit MIPS address spaces | ||
36 | */ | ||
37 | #ifdef __ASSEMBLY__ | ||
38 | #define _ACAST32_ | ||
39 | #define _ACAST64_ | ||
40 | #else | ||
41 | #define _ACAST32_ (_ATYPE_)(_ATYPE32_) /* widen if necessary */ | ||
42 | #define _ACAST64_ (_ATYPE64_) /* do _not_ narrow */ | ||
43 | #endif | ||
44 | |||
45 | /* | ||
46 | * Returns the kernel segment base of a given address | ||
47 | */ | ||
48 | #define KSEGX(a) ((_ACAST32_ (a)) & 0xe0000000) | ||
49 | |||
50 | /* | ||
51 | * Returns the physical address of a CKSEGx / XKPHYS address | ||
52 | */ | ||
53 | #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) | ||
54 | #define XPHYSADDR(a) ((_ACAST64_(a)) & \ | ||
55 | _CONST64_(0x000000ffffffffff)) | ||
56 | |||
57 | #ifdef CONFIG_64BIT | ||
58 | |||
59 | /* | ||
60 | * Memory segments (64bit kernel mode addresses) | ||
61 | * The compatibility segments use the full 64-bit sign extended value. Note | ||
62 | * the R8000 doesn't have them so don't reference these in generic MIPS code. | ||
63 | */ | ||
64 | #define XKUSEG _CONST64_(0x0000000000000000) | ||
65 | #define XKSSEG _CONST64_(0x4000000000000000) | ||
66 | #define XKPHYS _CONST64_(0x8000000000000000) | ||
67 | #define XKSEG _CONST64_(0xc000000000000000) | ||
68 | #define CKSEG0 _CONST64_(0xffffffff80000000) | ||
69 | #define CKSEG1 _CONST64_(0xffffffffa0000000) | ||
70 | #define CKSSEG _CONST64_(0xffffffffc0000000) | ||
71 | #define CKSEG3 _CONST64_(0xffffffffe0000000) | ||
72 | |||
73 | #define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0) | ||
74 | #define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1) | ||
75 | #define CKSEG2ADDR(a) (CPHYSADDR(a) | CKSEG2) | ||
76 | #define CKSEG3ADDR(a) (CPHYSADDR(a) | CKSEG3) | ||
77 | |||
78 | #else | ||
79 | |||
80 | #define CKSEG0ADDR(a) (CPHYSADDR(a) | KSEG0) | ||
81 | #define CKSEG1ADDR(a) (CPHYSADDR(a) | KSEG1) | ||
82 | #define CKSEG2ADDR(a) (CPHYSADDR(a) | KSEG2) | ||
83 | #define CKSEG3ADDR(a) (CPHYSADDR(a) | KSEG3) | ||
84 | |||
85 | /* | ||
86 | * Map an address to a certain kernel segment | ||
87 | */ | ||
88 | #define KSEG0ADDR(a) (CPHYSADDR(a) | KSEG0) | ||
89 | #define KSEG1ADDR(a) (CPHYSADDR(a) | KSEG1) | ||
90 | #define KSEG2ADDR(a) (CPHYSADDR(a) | KSEG2) | ||
91 | #define KSEG3ADDR(a) (CPHYSADDR(a) | KSEG3) | ||
92 | |||
93 | /* | ||
94 | * Memory segments (32bit kernel mode addresses) | ||
95 | * These are the traditional names used in the 32-bit universe. | ||
96 | */ | ||
97 | #define KUSEG 0x00000000 | ||
98 | #define KSEG0 0x80000000 | ||
99 | #define KSEG1 0xa0000000 | ||
100 | #define KSEG2 0xc0000000 | ||
101 | #define KSEG3 0xe0000000 | ||
102 | |||
103 | #define CKUSEG 0x00000000 | ||
104 | #define CKSEG0 0x80000000 | ||
105 | #define CKSEG1 0xa0000000 | ||
106 | #define CKSEG2 0xc0000000 | ||
107 | #define CKSEG3 0xe0000000 | ||
108 | |||
109 | #endif | ||
110 | |||
111 | /* | ||
112 | * Cache modes for XKPHYS address conversion macros | ||
113 | */ | ||
114 | #define K_CALG_COH_EXCL1_NOL2 0 | ||
115 | #define K_CALG_COH_SHRL1_NOL2 1 | ||
116 | #define K_CALG_UNCACHED 2 | ||
117 | #define K_CALG_NONCOHERENT 3 | ||
118 | #define K_CALG_COH_EXCL 4 | ||
119 | #define K_CALG_COH_SHAREABLE 5 | ||
120 | #define K_CALG_NOTUSED 6 | ||
121 | #define K_CALG_UNCACHED_ACCEL 7 | ||
122 | |||
123 | /* | ||
124 | * 64-bit address conversions | ||
125 | */ | ||
126 | #define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED, (p)) | ||
127 | #define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE, (p)) | ||
128 | #define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) | ||
129 | #define PHYS_TO_XKPHYS(cm, a) (_CONST64_(0x8000000000000000) | \ | ||
130 | (_CONST64_(cm) << 59) | (a)) | ||
131 | |||
132 | /* | ||
133 | * The ultimate limited of the 64-bit MIPS architecture: 2 bits for selecting | ||
134 | * the region, 3 bits for the CCA mode. This leaves 59 bits of which the | ||
135 | * R8000 implements most with its 48-bit physical address space. | ||
136 | */ | ||
137 | #define TO_PHYS_MASK _CONST64_(0x07ffffffffffffff) /* 2^^59 - 1 */ | ||
138 | |||
139 | #ifndef CONFIG_CPU_R8000 | ||
140 | |||
141 | /* | ||
142 | * The R8000 doesn't have the 32-bit compat spaces so we don't define them | ||
143 | * in order to catch bugs in the source code. | ||
144 | */ | ||
145 | |||
146 | #define COMPAT_K1BASE32 _CONST64_(0xffffffffa0000000) | ||
147 | #define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */ | ||
148 | |||
149 | #endif | ||
150 | |||
151 | #define KDM_TO_PHYS(x) (_ACAST64_ (x) & TO_PHYS_MASK) | ||
152 | #define PHYS_TO_K0(x) (_ACAST64_ (x) | CAC_BASE) | ||
153 | |||
154 | #endif /* _ASM_ADDRSPACE_H */ | ||
diff --git a/include/asm-mips/asm.h b/include/asm-mips/asm.h deleted file mode 100644 index 608cfcfbb3ea..000000000000 --- a/include/asm-mips/asm.h +++ /dev/null | |||
@@ -1,409 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 1996, 1997, 1999, 2001 by Ralf Baechle | ||
7 | * Copyright (C) 1999 by Silicon Graphics, Inc. | ||
8 | * Copyright (C) 2001 MIPS Technologies, Inc. | ||
9 | * Copyright (C) 2002 Maciej W. Rozycki | ||
10 | * | ||
11 | * Some useful macros for MIPS assembler code | ||
12 | * | ||
13 | * Some of the routines below contain useless nops that will be optimized | ||
14 | * away by gas in -O mode. These nops are however required to fill delay | ||
15 | * slots in noreorder mode. | ||
16 | */ | ||
17 | #ifndef __ASM_ASM_H | ||
18 | #define __ASM_ASM_H | ||
19 | |||
20 | #include <asm/sgidefs.h> | ||
21 | |||
22 | #ifndef CAT | ||
23 | #ifdef __STDC__ | ||
24 | #define __CAT(str1, str2) str1##str2 | ||
25 | #else | ||
26 | #define __CAT(str1, str2) str1/**/str2 | ||
27 | #endif | ||
28 | #define CAT(str1, str2) __CAT(str1, str2) | ||
29 | #endif | ||
30 | |||
31 | /* | ||
32 | * PIC specific declarations | ||
33 | * Not used for the kernel but here seems to be the right place. | ||
34 | */ | ||
35 | #ifdef __PIC__ | ||
36 | #define CPRESTORE(register) \ | ||
37 | .cprestore register | ||
38 | #define CPADD(register) \ | ||
39 | .cpadd register | ||
40 | #define CPLOAD(register) \ | ||
41 | .cpload register | ||
42 | #else | ||
43 | #define CPRESTORE(register) | ||
44 | #define CPADD(register) | ||
45 | #define CPLOAD(register) | ||
46 | #endif | ||
47 | |||
48 | /* | ||
49 | * LEAF - declare leaf routine | ||
50 | */ | ||
51 | #define LEAF(symbol) \ | ||
52 | .globl symbol; \ | ||
53 | .align 2; \ | ||
54 | .type symbol, @function; \ | ||
55 | .ent symbol, 0; \ | ||
56 | symbol: .frame sp, 0, ra | ||
57 | |||
58 | /* | ||
59 | * NESTED - declare nested routine entry point | ||
60 | */ | ||
61 | #define NESTED(symbol, framesize, rpc) \ | ||
62 | .globl symbol; \ | ||
63 | .align 2; \ | ||
64 | .type symbol, @function; \ | ||
65 | .ent symbol, 0; \ | ||
66 | symbol: .frame sp, framesize, rpc | ||
67 | |||
68 | /* | ||
69 | * END - mark end of function | ||
70 | */ | ||
71 | #define END(function) \ | ||
72 | .end function; \ | ||
73 | .size function, .-function | ||
74 | |||
75 | /* | ||
76 | * EXPORT - export definition of symbol | ||
77 | */ | ||
78 | #define EXPORT(symbol) \ | ||
79 | .globl symbol; \ | ||
80 | symbol: | ||
81 | |||
82 | /* | ||
83 | * FEXPORT - export definition of a function symbol | ||
84 | */ | ||
85 | #define FEXPORT(symbol) \ | ||
86 | .globl symbol; \ | ||
87 | .type symbol, @function; \ | ||
88 | symbol: | ||
89 | |||
90 | /* | ||
91 | * ABS - export absolute symbol | ||
92 | */ | ||
93 | #define ABS(symbol,value) \ | ||
94 | .globl symbol; \ | ||
95 | symbol = value | ||
96 | |||
97 | #define PANIC(msg) \ | ||
98 | .set push; \ | ||
99 | .set reorder; \ | ||
100 | PTR_LA a0, 8f; \ | ||
101 | jal panic; \ | ||
102 | 9: b 9b; \ | ||
103 | .set pop; \ | ||
104 | TEXT(msg) | ||
105 | |||
106 | /* | ||
107 | * Print formatted string | ||
108 | */ | ||
109 | #ifdef CONFIG_PRINTK | ||
110 | #define PRINT(string) \ | ||
111 | .set push; \ | ||
112 | .set reorder; \ | ||
113 | PTR_LA a0, 8f; \ | ||
114 | jal printk; \ | ||
115 | .set pop; \ | ||
116 | TEXT(string) | ||
117 | #else | ||
118 | #define PRINT(string) | ||
119 | #endif | ||
120 | |||
121 | #define TEXT(msg) \ | ||
122 | .pushsection .data; \ | ||
123 | 8: .asciiz msg; \ | ||
124 | .popsection; | ||
125 | |||
126 | /* | ||
127 | * Build text tables | ||
128 | */ | ||
129 | #define TTABLE(string) \ | ||
130 | .pushsection .text; \ | ||
131 | .word 1f; \ | ||
132 | .popsection \ | ||
133 | .pushsection .data; \ | ||
134 | 1: .asciiz string; \ | ||
135 | .popsection | ||
136 | |||
137 | /* | ||
138 | * MIPS IV pref instruction. | ||
139 | * Use with .set noreorder only! | ||
140 | * | ||
141 | * MIPS IV implementations are free to treat this as a nop. The R5000 | ||
142 | * is one of them. So we should have an option not to use this instruction. | ||
143 | */ | ||
144 | #ifdef CONFIG_CPU_HAS_PREFETCH | ||
145 | |||
146 | #define PREF(hint,addr) \ | ||
147 | .set push; \ | ||
148 | .set mips4; \ | ||
149 | pref hint, addr; \ | ||
150 | .set pop | ||
151 | |||
152 | #define PREFX(hint,addr) \ | ||
153 | .set push; \ | ||
154 | .set mips4; \ | ||
155 | prefx hint, addr; \ | ||
156 | .set pop | ||
157 | |||
158 | #else /* !CONFIG_CPU_HAS_PREFETCH */ | ||
159 | |||
160 | #define PREF(hint, addr) | ||
161 | #define PREFX(hint, addr) | ||
162 | |||
163 | #endif /* !CONFIG_CPU_HAS_PREFETCH */ | ||
164 | |||
165 | /* | ||
166 | * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs. | ||
167 | */ | ||
168 | #if (_MIPS_ISA == _MIPS_ISA_MIPS1) | ||
169 | #define MOVN(rd, rs, rt) \ | ||
170 | .set push; \ | ||
171 | .set reorder; \ | ||
172 | beqz rt, 9f; \ | ||
173 | move rd, rs; \ | ||
174 | .set pop; \ | ||
175 | 9: | ||
176 | #define MOVZ(rd, rs, rt) \ | ||
177 | .set push; \ | ||
178 | .set reorder; \ | ||
179 | bnez rt, 9f; \ | ||
180 | move rd, rs; \ | ||
181 | .set pop; \ | ||
182 | 9: | ||
183 | #endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */ | ||
184 | #if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) | ||
185 | #define MOVN(rd, rs, rt) \ | ||
186 | .set push; \ | ||
187 | .set noreorder; \ | ||
188 | bnezl rt, 9f; \ | ||
189 | move rd, rs; \ | ||
190 | .set pop; \ | ||
191 | 9: | ||
192 | #define MOVZ(rd, rs, rt) \ | ||
193 | .set push; \ | ||
194 | .set noreorder; \ | ||
195 | beqzl rt, 9f; \ | ||
196 | move rd, rs; \ | ||
197 | .set pop; \ | ||
198 | 9: | ||
199 | #endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */ | ||
200 | #if (_MIPS_ISA == _MIPS_ISA_MIPS4 ) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \ | ||
201 | (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) | ||
202 | #define MOVN(rd, rs, rt) \ | ||
203 | movn rd, rs, rt | ||
204 | #define MOVZ(rd, rs, rt) \ | ||
205 | movz rd, rs, rt | ||
206 | #endif /* MIPS IV, MIPS V, MIPS32 or MIPS64 */ | ||
207 | |||
208 | /* | ||
209 | * Stack alignment | ||
210 | */ | ||
211 | #if (_MIPS_SIM == _MIPS_SIM_ABI32) | ||
212 | #define ALSZ 7 | ||
213 | #define ALMASK ~7 | ||
214 | #endif | ||
215 | #if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) | ||
216 | #define ALSZ 15 | ||
217 | #define ALMASK ~15 | ||
218 | #endif | ||
219 | |||
220 | /* | ||
221 | * Macros to handle different pointer/register sizes for 32/64-bit code | ||
222 | */ | ||
223 | |||
224 | /* | ||
225 | * Size of a register | ||
226 | */ | ||
227 | #ifdef __mips64 | ||
228 | #define SZREG 8 | ||
229 | #else | ||
230 | #define SZREG 4 | ||
231 | #endif | ||
232 | |||
233 | /* | ||
234 | * Use the following macros in assemblercode to load/store registers, | ||
235 | * pointers etc. | ||
236 | */ | ||
237 | #if (_MIPS_SIM == _MIPS_SIM_ABI32) | ||
238 | #define REG_S sw | ||
239 | #define REG_L lw | ||
240 | #define REG_SUBU subu | ||
241 | #define REG_ADDU addu | ||
242 | #endif | ||
243 | #if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) | ||
244 | #define REG_S sd | ||
245 | #define REG_L ld | ||
246 | #define REG_SUBU dsubu | ||
247 | #define REG_ADDU daddu | ||
248 | #endif | ||
249 | |||
250 | /* | ||
251 | * How to add/sub/load/store/shift C int variables. | ||
252 | */ | ||
253 | #if (_MIPS_SZINT == 32) | ||
254 | #define INT_ADD add | ||
255 | #define INT_ADDU addu | ||
256 | #define INT_ADDI addi | ||
257 | #define INT_ADDIU addiu | ||
258 | #define INT_SUB sub | ||
259 | #define INT_SUBU subu | ||
260 | #define INT_L lw | ||
261 | #define INT_S sw | ||
262 | #define INT_SLL sll | ||
263 | #define INT_SLLV sllv | ||
264 | #define INT_SRL srl | ||
265 | #define INT_SRLV srlv | ||
266 | #define INT_SRA sra | ||
267 | #define INT_SRAV srav | ||
268 | #endif | ||
269 | |||
270 | #if (_MIPS_SZINT == 64) | ||
271 | #define INT_ADD dadd | ||
272 | #define INT_ADDU daddu | ||
273 | #define INT_ADDI daddi | ||
274 | #define INT_ADDIU daddiu | ||
275 | #define INT_SUB dsub | ||
276 | #define INT_SUBU dsubu | ||
277 | #define INT_L ld | ||
278 | #define INT_S sd | ||
279 | #define INT_SLL dsll | ||
280 | #define INT_SLLV dsllv | ||
281 | #define INT_SRL dsrl | ||
282 | #define INT_SRLV dsrlv | ||
283 | #define INT_SRA dsra | ||
284 | #define INT_SRAV dsrav | ||
285 | #endif | ||
286 | |||
287 | /* | ||
288 | * How to add/sub/load/store/shift C long variables. | ||
289 | */ | ||
290 | #if (_MIPS_SZLONG == 32) | ||
291 | #define LONG_ADD add | ||
292 | #define LONG_ADDU addu | ||
293 | #define LONG_ADDI addi | ||
294 | #define LONG_ADDIU addiu | ||
295 | #define LONG_SUB sub | ||
296 | #define LONG_SUBU subu | ||
297 | #define LONG_L lw | ||
298 | #define LONG_S sw | ||
299 | #define LONG_SLL sll | ||
300 | #define LONG_SLLV sllv | ||
301 | #define LONG_SRL srl | ||
302 | #define LONG_SRLV srlv | ||
303 | #define LONG_SRA sra | ||
304 | #define LONG_SRAV srav | ||
305 | |||
306 | #define LONG .word | ||
307 | #define LONGSIZE 4 | ||
308 | #define LONGMASK 3 | ||
309 | #define LONGLOG 2 | ||
310 | #endif | ||
311 | |||
312 | #if (_MIPS_SZLONG == 64) | ||
313 | #define LONG_ADD dadd | ||
314 | #define LONG_ADDU daddu | ||
315 | #define LONG_ADDI daddi | ||
316 | #define LONG_ADDIU daddiu | ||
317 | #define LONG_SUB dsub | ||
318 | #define LONG_SUBU dsubu | ||
319 | #define LONG_L ld | ||
320 | #define LONG_S sd | ||
321 | #define LONG_SLL dsll | ||
322 | #define LONG_SLLV dsllv | ||
323 | #define LONG_SRL dsrl | ||
324 | #define LONG_SRLV dsrlv | ||
325 | #define LONG_SRA dsra | ||
326 | #define LONG_SRAV dsrav | ||
327 | |||
328 | #define LONG .dword | ||
329 | #define LONGSIZE 8 | ||
330 | #define LONGMASK 7 | ||
331 | #define LONGLOG 3 | ||
332 | #endif | ||
333 | |||
334 | /* | ||
335 | * How to add/sub/load/store/shift pointers. | ||
336 | */ | ||
337 | #if (_MIPS_SZPTR == 32) | ||
338 | #define PTR_ADD add | ||
339 | #define PTR_ADDU addu | ||
340 | #define PTR_ADDI addi | ||
341 | #define PTR_ADDIU addiu | ||
342 | #define PTR_SUB sub | ||
343 | #define PTR_SUBU subu | ||
344 | #define PTR_L lw | ||
345 | #define PTR_S sw | ||
346 | #define PTR_LA la | ||
347 | #define PTR_LI li | ||
348 | #define PTR_SLL sll | ||
349 | #define PTR_SLLV sllv | ||
350 | #define PTR_SRL srl | ||
351 | #define PTR_SRLV srlv | ||
352 | #define PTR_SRA sra | ||
353 | #define PTR_SRAV srav | ||
354 | |||
355 | #define PTR_SCALESHIFT 2 | ||
356 | |||
357 | #define PTR .word | ||
358 | #define PTRSIZE 4 | ||
359 | #define PTRLOG 2 | ||
360 | #endif | ||
361 | |||
362 | #if (_MIPS_SZPTR == 64) | ||
363 | #define PTR_ADD dadd | ||
364 | #define PTR_ADDU daddu | ||
365 | #define PTR_ADDI daddi | ||
366 | #define PTR_ADDIU daddiu | ||
367 | #define PTR_SUB dsub | ||
368 | #define PTR_SUBU dsubu | ||
369 | #define PTR_L ld | ||
370 | #define PTR_S sd | ||
371 | #define PTR_LA dla | ||
372 | #define PTR_LI dli | ||
373 | #define PTR_SLL dsll | ||
374 | #define PTR_SLLV dsllv | ||
375 | #define PTR_SRL dsrl | ||
376 | #define PTR_SRLV dsrlv | ||
377 | #define PTR_SRA dsra | ||
378 | #define PTR_SRAV dsrav | ||
379 | |||
380 | #define PTR_SCALESHIFT 3 | ||
381 | |||
382 | #define PTR .dword | ||
383 | #define PTRSIZE 8 | ||
384 | #define PTRLOG 3 | ||
385 | #endif | ||
386 | |||
387 | /* | ||
388 | * Some cp0 registers were extended to 64bit for MIPS III. | ||
389 | */ | ||
390 | #if (_MIPS_SIM == _MIPS_SIM_ABI32) | ||
391 | #define MFC0 mfc0 | ||
392 | #define MTC0 mtc0 | ||
393 | #endif | ||
394 | #if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) | ||
395 | #define MFC0 dmfc0 | ||
396 | #define MTC0 dmtc0 | ||
397 | #endif | ||
398 | |||
399 | #define SSNOP sll zero, zero, 1 | ||
400 | |||
401 | #ifdef CONFIG_SGI_IP28 | ||
402 | /* Inhibit speculative stores to volatile (e.g.DMA) or invalid addresses. */ | ||
403 | #include <asm/cacheops.h> | ||
404 | #define R10KCBARRIER(addr) cache Cache_Barrier, addr; | ||
405 | #else | ||
406 | #define R10KCBARRIER(addr) | ||
407 | #endif | ||
408 | |||
409 | #endif /* __ASM_ASM_H */ | ||
diff --git a/include/asm-mips/asmmacro-32.h b/include/asm-mips/asmmacro-32.h deleted file mode 100644 index 5de3963f511e..000000000000 --- a/include/asm-mips/asmmacro-32.h +++ /dev/null | |||
@@ -1,158 +0,0 @@ | |||
1 | /* | ||
2 | * asmmacro.h: Assembler macros to make things easier to read. | ||
3 | * | ||
4 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | ||
5 | * Copyright (C) 1998, 1999, 2003 Ralf Baechle | ||
6 | */ | ||
7 | #ifndef _ASM_ASMMACRO_32_H | ||
8 | #define _ASM_ASMMACRO_32_H | ||
9 | |||
10 | #include <asm/asm-offsets.h> | ||
11 | #include <asm/regdef.h> | ||
12 | #include <asm/fpregdef.h> | ||
13 | #include <asm/mipsregs.h> | ||
14 | |||
15 | .macro fpu_save_double thread status tmp1=t0 | ||
16 | cfc1 \tmp1, fcr31 | ||
17 | sdc1 $f0, THREAD_FPR0(\thread) | ||
18 | sdc1 $f2, THREAD_FPR2(\thread) | ||
19 | sdc1 $f4, THREAD_FPR4(\thread) | ||
20 | sdc1 $f6, THREAD_FPR6(\thread) | ||
21 | sdc1 $f8, THREAD_FPR8(\thread) | ||
22 | sdc1 $f10, THREAD_FPR10(\thread) | ||
23 | sdc1 $f12, THREAD_FPR12(\thread) | ||
24 | sdc1 $f14, THREAD_FPR14(\thread) | ||
25 | sdc1 $f16, THREAD_FPR16(\thread) | ||
26 | sdc1 $f18, THREAD_FPR18(\thread) | ||
27 | sdc1 $f20, THREAD_FPR20(\thread) | ||
28 | sdc1 $f22, THREAD_FPR22(\thread) | ||
29 | sdc1 $f24, THREAD_FPR24(\thread) | ||
30 | sdc1 $f26, THREAD_FPR26(\thread) | ||
31 | sdc1 $f28, THREAD_FPR28(\thread) | ||
32 | sdc1 $f30, THREAD_FPR30(\thread) | ||
33 | sw \tmp1, THREAD_FCR31(\thread) | ||
34 | .endm | ||
35 | |||
36 | .macro fpu_save_single thread tmp=t0 | ||
37 | cfc1 \tmp, fcr31 | ||
38 | swc1 $f0, THREAD_FPR0(\thread) | ||
39 | swc1 $f1, THREAD_FPR1(\thread) | ||
40 | swc1 $f2, THREAD_FPR2(\thread) | ||
41 | swc1 $f3, THREAD_FPR3(\thread) | ||
42 | swc1 $f4, THREAD_FPR4(\thread) | ||
43 | swc1 $f5, THREAD_FPR5(\thread) | ||
44 | swc1 $f6, THREAD_FPR6(\thread) | ||
45 | swc1 $f7, THREAD_FPR7(\thread) | ||
46 | swc1 $f8, THREAD_FPR8(\thread) | ||
47 | swc1 $f9, THREAD_FPR9(\thread) | ||
48 | swc1 $f10, THREAD_FPR10(\thread) | ||
49 | swc1 $f11, THREAD_FPR11(\thread) | ||
50 | swc1 $f12, THREAD_FPR12(\thread) | ||
51 | swc1 $f13, THREAD_FPR13(\thread) | ||
52 | swc1 $f14, THREAD_FPR14(\thread) | ||
53 | swc1 $f15, THREAD_FPR15(\thread) | ||
54 | swc1 $f16, THREAD_FPR16(\thread) | ||
55 | swc1 $f17, THREAD_FPR17(\thread) | ||
56 | swc1 $f18, THREAD_FPR18(\thread) | ||
57 | swc1 $f19, THREAD_FPR19(\thread) | ||
58 | swc1 $f20, THREAD_FPR20(\thread) | ||
59 | swc1 $f21, THREAD_FPR21(\thread) | ||
60 | swc1 $f22, THREAD_FPR22(\thread) | ||
61 | swc1 $f23, THREAD_FPR23(\thread) | ||
62 | swc1 $f24, THREAD_FPR24(\thread) | ||
63 | swc1 $f25, THREAD_FPR25(\thread) | ||
64 | swc1 $f26, THREAD_FPR26(\thread) | ||
65 | swc1 $f27, THREAD_FPR27(\thread) | ||
66 | swc1 $f28, THREAD_FPR28(\thread) | ||
67 | swc1 $f29, THREAD_FPR29(\thread) | ||
68 | swc1 $f30, THREAD_FPR30(\thread) | ||
69 | swc1 $f31, THREAD_FPR31(\thread) | ||
70 | sw \tmp, THREAD_FCR31(\thread) | ||
71 | .endm | ||
72 | |||
73 | .macro fpu_restore_double thread status tmp=t0 | ||
74 | lw \tmp, THREAD_FCR31(\thread) | ||
75 | ldc1 $f0, THREAD_FPR0(\thread) | ||
76 | ldc1 $f2, THREAD_FPR2(\thread) | ||
77 | ldc1 $f4, THREAD_FPR4(\thread) | ||
78 | ldc1 $f6, THREAD_FPR6(\thread) | ||
79 | ldc1 $f8, THREAD_FPR8(\thread) | ||
80 | ldc1 $f10, THREAD_FPR10(\thread) | ||
81 | ldc1 $f12, THREAD_FPR12(\thread) | ||
82 | ldc1 $f14, THREAD_FPR14(\thread) | ||
83 | ldc1 $f16, THREAD_FPR16(\thread) | ||
84 | ldc1 $f18, THREAD_FPR18(\thread) | ||
85 | ldc1 $f20, THREAD_FPR20(\thread) | ||
86 | ldc1 $f22, THREAD_FPR22(\thread) | ||
87 | ldc1 $f24, THREAD_FPR24(\thread) | ||
88 | ldc1 $f26, THREAD_FPR26(\thread) | ||
89 | ldc1 $f28, THREAD_FPR28(\thread) | ||
90 | ldc1 $f30, THREAD_FPR30(\thread) | ||
91 | ctc1 \tmp, fcr31 | ||
92 | .endm | ||
93 | |||
94 | .macro fpu_restore_single thread tmp=t0 | ||
95 | lw \tmp, THREAD_FCR31(\thread) | ||
96 | lwc1 $f0, THREAD_FPR0(\thread) | ||
97 | lwc1 $f1, THREAD_FPR1(\thread) | ||
98 | lwc1 $f2, THREAD_FPR2(\thread) | ||
99 | lwc1 $f3, THREAD_FPR3(\thread) | ||
100 | lwc1 $f4, THREAD_FPR4(\thread) | ||
101 | lwc1 $f5, THREAD_FPR5(\thread) | ||
102 | lwc1 $f6, THREAD_FPR6(\thread) | ||
103 | lwc1 $f7, THREAD_FPR7(\thread) | ||
104 | lwc1 $f8, THREAD_FPR8(\thread) | ||
105 | lwc1 $f9, THREAD_FPR9(\thread) | ||
106 | lwc1 $f10, THREAD_FPR10(\thread) | ||
107 | lwc1 $f11, THREAD_FPR11(\thread) | ||
108 | lwc1 $f12, THREAD_FPR12(\thread) | ||
109 | lwc1 $f13, THREAD_FPR13(\thread) | ||
110 | lwc1 $f14, THREAD_FPR14(\thread) | ||
111 | lwc1 $f15, THREAD_FPR15(\thread) | ||
112 | lwc1 $f16, THREAD_FPR16(\thread) | ||
113 | lwc1 $f17, THREAD_FPR17(\thread) | ||
114 | lwc1 $f18, THREAD_FPR18(\thread) | ||
115 | lwc1 $f19, THREAD_FPR19(\thread) | ||
116 | lwc1 $f20, THREAD_FPR20(\thread) | ||
117 | lwc1 $f21, THREAD_FPR21(\thread) | ||
118 | lwc1 $f22, THREAD_FPR22(\thread) | ||
119 | lwc1 $f23, THREAD_FPR23(\thread) | ||
120 | lwc1 $f24, THREAD_FPR24(\thread) | ||
121 | lwc1 $f25, THREAD_FPR25(\thread) | ||
122 | lwc1 $f26, THREAD_FPR26(\thread) | ||
123 | lwc1 $f27, THREAD_FPR27(\thread) | ||
124 | lwc1 $f28, THREAD_FPR28(\thread) | ||
125 | lwc1 $f29, THREAD_FPR29(\thread) | ||
126 | lwc1 $f30, THREAD_FPR30(\thread) | ||
127 | lwc1 $f31, THREAD_FPR31(\thread) | ||
128 | ctc1 \tmp, fcr31 | ||
129 | .endm | ||
130 | |||
131 | .macro cpu_save_nonscratch thread | ||
132 | LONG_S s0, THREAD_REG16(\thread) | ||
133 | LONG_S s1, THREAD_REG17(\thread) | ||
134 | LONG_S s2, THREAD_REG18(\thread) | ||
135 | LONG_S s3, THREAD_REG19(\thread) | ||
136 | LONG_S s4, THREAD_REG20(\thread) | ||
137 | LONG_S s5, THREAD_REG21(\thread) | ||
138 | LONG_S s6, THREAD_REG22(\thread) | ||
139 | LONG_S s7, THREAD_REG23(\thread) | ||
140 | LONG_S sp, THREAD_REG29(\thread) | ||
141 | LONG_S fp, THREAD_REG30(\thread) | ||
142 | .endm | ||
143 | |||
144 | .macro cpu_restore_nonscratch thread | ||
145 | LONG_L s0, THREAD_REG16(\thread) | ||
146 | LONG_L s1, THREAD_REG17(\thread) | ||
147 | LONG_L s2, THREAD_REG18(\thread) | ||
148 | LONG_L s3, THREAD_REG19(\thread) | ||
149 | LONG_L s4, THREAD_REG20(\thread) | ||
150 | LONG_L s5, THREAD_REG21(\thread) | ||
151 | LONG_L s6, THREAD_REG22(\thread) | ||
152 | LONG_L s7, THREAD_REG23(\thread) | ||
153 | LONG_L sp, THREAD_REG29(\thread) | ||
154 | LONG_L fp, THREAD_REG30(\thread) | ||
155 | LONG_L ra, THREAD_REG31(\thread) | ||
156 | .endm | ||
157 | |||
158 | #endif /* _ASM_ASMMACRO_32_H */ | ||
diff --git a/include/asm-mips/asmmacro-64.h b/include/asm-mips/asmmacro-64.h deleted file mode 100644 index 225feefcb25d..000000000000 --- a/include/asm-mips/asmmacro-64.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | /* | ||
2 | * asmmacro.h: Assembler macros to make things easier to read. | ||
3 | * | ||
4 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | ||
5 | * Copyright (C) 1998, 1999 Ralf Baechle | ||
6 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
7 | */ | ||
8 | #ifndef _ASM_ASMMACRO_64_H | ||
9 | #define _ASM_ASMMACRO_64_H | ||
10 | |||
11 | #include <asm/asm-offsets.h> | ||
12 | #include <asm/regdef.h> | ||
13 | #include <asm/fpregdef.h> | ||
14 | #include <asm/mipsregs.h> | ||
15 | |||
16 | .macro fpu_save_16even thread tmp=t0 | ||
17 | cfc1 \tmp, fcr31 | ||
18 | sdc1 $f0, THREAD_FPR0(\thread) | ||
19 | sdc1 $f2, THREAD_FPR2(\thread) | ||
20 | sdc1 $f4, THREAD_FPR4(\thread) | ||
21 | sdc1 $f6, THREAD_FPR6(\thread) | ||
22 | sdc1 $f8, THREAD_FPR8(\thread) | ||
23 | sdc1 $f10, THREAD_FPR10(\thread) | ||
24 | sdc1 $f12, THREAD_FPR12(\thread) | ||
25 | sdc1 $f14, THREAD_FPR14(\thread) | ||
26 | sdc1 $f16, THREAD_FPR16(\thread) | ||
27 | sdc1 $f18, THREAD_FPR18(\thread) | ||
28 | sdc1 $f20, THREAD_FPR20(\thread) | ||
29 | sdc1 $f22, THREAD_FPR22(\thread) | ||
30 | sdc1 $f24, THREAD_FPR24(\thread) | ||
31 | sdc1 $f26, THREAD_FPR26(\thread) | ||
32 | sdc1 $f28, THREAD_FPR28(\thread) | ||
33 | sdc1 $f30, THREAD_FPR30(\thread) | ||
34 | sw \tmp, THREAD_FCR31(\thread) | ||
35 | .endm | ||
36 | |||
37 | .macro fpu_save_16odd thread | ||
38 | sdc1 $f1, THREAD_FPR1(\thread) | ||
39 | sdc1 $f3, THREAD_FPR3(\thread) | ||
40 | sdc1 $f5, THREAD_FPR5(\thread) | ||
41 | sdc1 $f7, THREAD_FPR7(\thread) | ||
42 | sdc1 $f9, THREAD_FPR9(\thread) | ||
43 | sdc1 $f11, THREAD_FPR11(\thread) | ||
44 | sdc1 $f13, THREAD_FPR13(\thread) | ||
45 | sdc1 $f15, THREAD_FPR15(\thread) | ||
46 | sdc1 $f17, THREAD_FPR17(\thread) | ||
47 | sdc1 $f19, THREAD_FPR19(\thread) | ||
48 | sdc1 $f21, THREAD_FPR21(\thread) | ||
49 | sdc1 $f23, THREAD_FPR23(\thread) | ||
50 | sdc1 $f25, THREAD_FPR25(\thread) | ||
51 | sdc1 $f27, THREAD_FPR27(\thread) | ||
52 | sdc1 $f29, THREAD_FPR29(\thread) | ||
53 | sdc1 $f31, THREAD_FPR31(\thread) | ||
54 | .endm | ||
55 | |||
56 | .macro fpu_save_double thread status tmp | ||
57 | sll \tmp, \status, 5 | ||
58 | bgez \tmp, 2f | ||
59 | fpu_save_16odd \thread | ||
60 | 2: | ||
61 | fpu_save_16even \thread \tmp | ||
62 | .endm | ||
63 | |||
64 | .macro fpu_restore_16even thread tmp=t0 | ||
65 | lw \tmp, THREAD_FCR31(\thread) | ||
66 | ldc1 $f0, THREAD_FPR0(\thread) | ||
67 | ldc1 $f2, THREAD_FPR2(\thread) | ||
68 | ldc1 $f4, THREAD_FPR4(\thread) | ||
69 | ldc1 $f6, THREAD_FPR6(\thread) | ||
70 | ldc1 $f8, THREAD_FPR8(\thread) | ||
71 | ldc1 $f10, THREAD_FPR10(\thread) | ||
72 | ldc1 $f12, THREAD_FPR12(\thread) | ||
73 | ldc1 $f14, THREAD_FPR14(\thread) | ||
74 | ldc1 $f16, THREAD_FPR16(\thread) | ||
75 | ldc1 $f18, THREAD_FPR18(\thread) | ||
76 | ldc1 $f20, THREAD_FPR20(\thread) | ||
77 | ldc1 $f22, THREAD_FPR22(\thread) | ||
78 | ldc1 $f24, THREAD_FPR24(\thread) | ||
79 | ldc1 $f26, THREAD_FPR26(\thread) | ||
80 | ldc1 $f28, THREAD_FPR28(\thread) | ||
81 | ldc1 $f30, THREAD_FPR30(\thread) | ||
82 | ctc1 \tmp, fcr31 | ||
83 | .endm | ||
84 | |||
85 | .macro fpu_restore_16odd thread | ||
86 | ldc1 $f1, THREAD_FPR1(\thread) | ||
87 | ldc1 $f3, THREAD_FPR3(\thread) | ||
88 | ldc1 $f5, THREAD_FPR5(\thread) | ||
89 | ldc1 $f7, THREAD_FPR7(\thread) | ||
90 | ldc1 $f9, THREAD_FPR9(\thread) | ||
91 | ldc1 $f11, THREAD_FPR11(\thread) | ||
92 | ldc1 $f13, THREAD_FPR13(\thread) | ||
93 | ldc1 $f15, THREAD_FPR15(\thread) | ||
94 | ldc1 $f17, THREAD_FPR17(\thread) | ||
95 | ldc1 $f19, THREAD_FPR19(\thread) | ||
96 | ldc1 $f21, THREAD_FPR21(\thread) | ||
97 | ldc1 $f23, THREAD_FPR23(\thread) | ||
98 | ldc1 $f25, THREAD_FPR25(\thread) | ||
99 | ldc1 $f27, THREAD_FPR27(\thread) | ||
100 | ldc1 $f29, THREAD_FPR29(\thread) | ||
101 | ldc1 $f31, THREAD_FPR31(\thread) | ||
102 | .endm | ||
103 | |||
104 | .macro fpu_restore_double thread status tmp | ||
105 | sll \tmp, \status, 5 | ||
106 | bgez \tmp, 1f # 16 register mode? | ||
107 | |||
108 | fpu_restore_16odd \thread | ||
109 | 1: fpu_restore_16even \thread \tmp | ||
110 | .endm | ||
111 | |||
112 | .macro cpu_save_nonscratch thread | ||
113 | LONG_S s0, THREAD_REG16(\thread) | ||
114 | LONG_S s1, THREAD_REG17(\thread) | ||
115 | LONG_S s2, THREAD_REG18(\thread) | ||
116 | LONG_S s3, THREAD_REG19(\thread) | ||
117 | LONG_S s4, THREAD_REG20(\thread) | ||
118 | LONG_S s5, THREAD_REG21(\thread) | ||
119 | LONG_S s6, THREAD_REG22(\thread) | ||
120 | LONG_S s7, THREAD_REG23(\thread) | ||
121 | LONG_S sp, THREAD_REG29(\thread) | ||
122 | LONG_S fp, THREAD_REG30(\thread) | ||
123 | .endm | ||
124 | |||
125 | .macro cpu_restore_nonscratch thread | ||
126 | LONG_L s0, THREAD_REG16(\thread) | ||
127 | LONG_L s1, THREAD_REG17(\thread) | ||
128 | LONG_L s2, THREAD_REG18(\thread) | ||
129 | LONG_L s3, THREAD_REG19(\thread) | ||
130 | LONG_L s4, THREAD_REG20(\thread) | ||
131 | LONG_L s5, THREAD_REG21(\thread) | ||
132 | LONG_L s6, THREAD_REG22(\thread) | ||
133 | LONG_L s7, THREAD_REG23(\thread) | ||
134 | LONG_L sp, THREAD_REG29(\thread) | ||
135 | LONG_L fp, THREAD_REG30(\thread) | ||
136 | LONG_L ra, THREAD_REG31(\thread) | ||
137 | .endm | ||
138 | |||
139 | #endif /* _ASM_ASMMACRO_64_H */ | ||
diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h deleted file mode 100644 index 7a881755800f..000000000000 --- a/include/asm-mips/asmmacro.h +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_ASMMACRO_H | ||
9 | #define _ASM_ASMMACRO_H | ||
10 | |||
11 | #include <asm/hazards.h> | ||
12 | |||
13 | #ifdef CONFIG_32BIT | ||
14 | #include <asm/asmmacro-32.h> | ||
15 | #endif | ||
16 | #ifdef CONFIG_64BIT | ||
17 | #include <asm/asmmacro-64.h> | ||
18 | #endif | ||
19 | #ifdef CONFIG_MIPS_MT_SMTC | ||
20 | #include <asm/mipsmtregs.h> | ||
21 | #endif | ||
22 | |||
23 | #ifdef CONFIG_MIPS_MT_SMTC | ||
24 | .macro local_irq_enable reg=t0 | ||
25 | mfc0 \reg, CP0_TCSTATUS | ||
26 | ori \reg, \reg, TCSTATUS_IXMT | ||
27 | xori \reg, \reg, TCSTATUS_IXMT | ||
28 | mtc0 \reg, CP0_TCSTATUS | ||
29 | _ehb | ||
30 | .endm | ||
31 | |||
32 | .macro local_irq_disable reg=t0 | ||
33 | mfc0 \reg, CP0_TCSTATUS | ||
34 | ori \reg, \reg, TCSTATUS_IXMT | ||
35 | mtc0 \reg, CP0_TCSTATUS | ||
36 | _ehb | ||
37 | .endm | ||
38 | #else | ||
39 | .macro local_irq_enable reg=t0 | ||
40 | mfc0 \reg, CP0_STATUS | ||
41 | ori \reg, \reg, 1 | ||
42 | mtc0 \reg, CP0_STATUS | ||
43 | irq_enable_hazard | ||
44 | .endm | ||
45 | |||
46 | .macro local_irq_disable reg=t0 | ||
47 | mfc0 \reg, CP0_STATUS | ||
48 | ori \reg, \reg, 1 | ||
49 | xori \reg, \reg, 1 | ||
50 | mtc0 \reg, CP0_STATUS | ||
51 | irq_disable_hazard | ||
52 | .endm | ||
53 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
54 | |||
55 | /* | ||
56 | * Temporary until all gas have MT ASE support | ||
57 | */ | ||
58 | .macro DMT reg=0 | ||
59 | .word 0x41600bc1 | (\reg << 16) | ||
60 | .endm | ||
61 | |||
62 | .macro EMT reg=0 | ||
63 | .word 0x41600be1 | (\reg << 16) | ||
64 | .endm | ||
65 | |||
66 | .macro DVPE reg=0 | ||
67 | .word 0x41600001 | (\reg << 16) | ||
68 | .endm | ||
69 | |||
70 | .macro EVPE reg=0 | ||
71 | .word 0x41600021 | (\reg << 16) | ||
72 | .endm | ||
73 | |||
74 | .macro MFTR rt=0, rd=0, u=0, sel=0 | ||
75 | .word 0x41000000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel) | ||
76 | .endm | ||
77 | |||
78 | .macro MTTR rt=0, rd=0, u=0, sel=0 | ||
79 | .word 0x41800000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel) | ||
80 | .endm | ||
81 | |||
82 | #endif /* _ASM_ASMMACRO_H */ | ||
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h deleted file mode 100644 index 1232be3885b0..000000000000 --- a/include/asm-mips/atomic.h +++ /dev/null | |||
@@ -1,801 +0,0 @@ | |||
1 | /* | ||
2 | * Atomic operations that C can't guarantee us. Useful for | ||
3 | * resource counting etc.. | ||
4 | * | ||
5 | * But use these as seldom as possible since they are much more slower | ||
6 | * than regular operations. | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | * | ||
12 | * Copyright (C) 1996, 97, 99, 2000, 03, 04, 06 by Ralf Baechle | ||
13 | */ | ||
14 | #ifndef _ASM_ATOMIC_H | ||
15 | #define _ASM_ATOMIC_H | ||
16 | |||
17 | #include <linux/irqflags.h> | ||
18 | #include <asm/barrier.h> | ||
19 | #include <asm/cpu-features.h> | ||
20 | #include <asm/war.h> | ||
21 | #include <asm/system.h> | ||
22 | |||
23 | typedef struct { volatile int counter; } atomic_t; | ||
24 | |||
25 | #define ATOMIC_INIT(i) { (i) } | ||
26 | |||
27 | /* | ||
28 | * atomic_read - read atomic variable | ||
29 | * @v: pointer of type atomic_t | ||
30 | * | ||
31 | * Atomically reads the value of @v. | ||
32 | */ | ||
33 | #define atomic_read(v) ((v)->counter) | ||
34 | |||
35 | /* | ||
36 | * atomic_set - set atomic variable | ||
37 | * @v: pointer of type atomic_t | ||
38 | * @i: required value | ||
39 | * | ||
40 | * Atomically sets the value of @v to @i. | ||
41 | */ | ||
42 | #define atomic_set(v, i) ((v)->counter = (i)) | ||
43 | |||
44 | /* | ||
45 | * atomic_add - add integer to atomic variable | ||
46 | * @i: integer value to add | ||
47 | * @v: pointer of type atomic_t | ||
48 | * | ||
49 | * Atomically adds @i to @v. | ||
50 | */ | ||
51 | static __inline__ void atomic_add(int i, atomic_t * v) | ||
52 | { | ||
53 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
54 | unsigned long temp; | ||
55 | |||
56 | __asm__ __volatile__( | ||
57 | " .set mips3 \n" | ||
58 | "1: ll %0, %1 # atomic_add \n" | ||
59 | " addu %0, %2 \n" | ||
60 | " sc %0, %1 \n" | ||
61 | " beqzl %0, 1b \n" | ||
62 | " .set mips0 \n" | ||
63 | : "=&r" (temp), "=m" (v->counter) | ||
64 | : "Ir" (i), "m" (v->counter)); | ||
65 | } else if (cpu_has_llsc) { | ||
66 | unsigned long temp; | ||
67 | |||
68 | __asm__ __volatile__( | ||
69 | " .set mips3 \n" | ||
70 | "1: ll %0, %1 # atomic_add \n" | ||
71 | " addu %0, %2 \n" | ||
72 | " sc %0, %1 \n" | ||
73 | " beqz %0, 2f \n" | ||
74 | " .subsection 2 \n" | ||
75 | "2: b 1b \n" | ||
76 | " .previous \n" | ||
77 | " .set mips0 \n" | ||
78 | : "=&r" (temp), "=m" (v->counter) | ||
79 | : "Ir" (i), "m" (v->counter)); | ||
80 | } else { | ||
81 | unsigned long flags; | ||
82 | |||
83 | raw_local_irq_save(flags); | ||
84 | v->counter += i; | ||
85 | raw_local_irq_restore(flags); | ||
86 | } | ||
87 | } | ||
88 | |||
89 | /* | ||
90 | * atomic_sub - subtract the atomic variable | ||
91 | * @i: integer value to subtract | ||
92 | * @v: pointer of type atomic_t | ||
93 | * | ||
94 | * Atomically subtracts @i from @v. | ||
95 | */ | ||
96 | static __inline__ void atomic_sub(int i, atomic_t * v) | ||
97 | { | ||
98 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
99 | unsigned long temp; | ||
100 | |||
101 | __asm__ __volatile__( | ||
102 | " .set mips3 \n" | ||
103 | "1: ll %0, %1 # atomic_sub \n" | ||
104 | " subu %0, %2 \n" | ||
105 | " sc %0, %1 \n" | ||
106 | " beqzl %0, 1b \n" | ||
107 | " .set mips0 \n" | ||
108 | : "=&r" (temp), "=m" (v->counter) | ||
109 | : "Ir" (i), "m" (v->counter)); | ||
110 | } else if (cpu_has_llsc) { | ||
111 | unsigned long temp; | ||
112 | |||
113 | __asm__ __volatile__( | ||
114 | " .set mips3 \n" | ||
115 | "1: ll %0, %1 # atomic_sub \n" | ||
116 | " subu %0, %2 \n" | ||
117 | " sc %0, %1 \n" | ||
118 | " beqz %0, 2f \n" | ||
119 | " .subsection 2 \n" | ||
120 | "2: b 1b \n" | ||
121 | " .previous \n" | ||
122 | " .set mips0 \n" | ||
123 | : "=&r" (temp), "=m" (v->counter) | ||
124 | : "Ir" (i), "m" (v->counter)); | ||
125 | } else { | ||
126 | unsigned long flags; | ||
127 | |||
128 | raw_local_irq_save(flags); | ||
129 | v->counter -= i; | ||
130 | raw_local_irq_restore(flags); | ||
131 | } | ||
132 | } | ||
133 | |||
134 | /* | ||
135 | * Same as above, but return the result value | ||
136 | */ | ||
137 | static __inline__ int atomic_add_return(int i, atomic_t * v) | ||
138 | { | ||
139 | unsigned long result; | ||
140 | |||
141 | smp_llsc_mb(); | ||
142 | |||
143 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
144 | unsigned long temp; | ||
145 | |||
146 | __asm__ __volatile__( | ||
147 | " .set mips3 \n" | ||
148 | "1: ll %1, %2 # atomic_add_return \n" | ||
149 | " addu %0, %1, %3 \n" | ||
150 | " sc %0, %2 \n" | ||
151 | " beqzl %0, 1b \n" | ||
152 | " addu %0, %1, %3 \n" | ||
153 | " .set mips0 \n" | ||
154 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
155 | : "Ir" (i), "m" (v->counter) | ||
156 | : "memory"); | ||
157 | } else if (cpu_has_llsc) { | ||
158 | unsigned long temp; | ||
159 | |||
160 | __asm__ __volatile__( | ||
161 | " .set mips3 \n" | ||
162 | "1: ll %1, %2 # atomic_add_return \n" | ||
163 | " addu %0, %1, %3 \n" | ||
164 | " sc %0, %2 \n" | ||
165 | " beqz %0, 2f \n" | ||
166 | " addu %0, %1, %3 \n" | ||
167 | " .subsection 2 \n" | ||
168 | "2: b 1b \n" | ||
169 | " .previous \n" | ||
170 | " .set mips0 \n" | ||
171 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
172 | : "Ir" (i), "m" (v->counter) | ||
173 | : "memory"); | ||
174 | } else { | ||
175 | unsigned long flags; | ||
176 | |||
177 | raw_local_irq_save(flags); | ||
178 | result = v->counter; | ||
179 | result += i; | ||
180 | v->counter = result; | ||
181 | raw_local_irq_restore(flags); | ||
182 | } | ||
183 | |||
184 | smp_llsc_mb(); | ||
185 | |||
186 | return result; | ||
187 | } | ||
188 | |||
189 | static __inline__ int atomic_sub_return(int i, atomic_t * v) | ||
190 | { | ||
191 | unsigned long result; | ||
192 | |||
193 | smp_llsc_mb(); | ||
194 | |||
195 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
196 | unsigned long temp; | ||
197 | |||
198 | __asm__ __volatile__( | ||
199 | " .set mips3 \n" | ||
200 | "1: ll %1, %2 # atomic_sub_return \n" | ||
201 | " subu %0, %1, %3 \n" | ||
202 | " sc %0, %2 \n" | ||
203 | " beqzl %0, 1b \n" | ||
204 | " subu %0, %1, %3 \n" | ||
205 | " .set mips0 \n" | ||
206 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
207 | : "Ir" (i), "m" (v->counter) | ||
208 | : "memory"); | ||
209 | } else if (cpu_has_llsc) { | ||
210 | unsigned long temp; | ||
211 | |||
212 | __asm__ __volatile__( | ||
213 | " .set mips3 \n" | ||
214 | "1: ll %1, %2 # atomic_sub_return \n" | ||
215 | " subu %0, %1, %3 \n" | ||
216 | " sc %0, %2 \n" | ||
217 | " beqz %0, 2f \n" | ||
218 | " subu %0, %1, %3 \n" | ||
219 | " .subsection 2 \n" | ||
220 | "2: b 1b \n" | ||
221 | " .previous \n" | ||
222 | " .set mips0 \n" | ||
223 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
224 | : "Ir" (i), "m" (v->counter) | ||
225 | : "memory"); | ||
226 | } else { | ||
227 | unsigned long flags; | ||
228 | |||
229 | raw_local_irq_save(flags); | ||
230 | result = v->counter; | ||
231 | result -= i; | ||
232 | v->counter = result; | ||
233 | raw_local_irq_restore(flags); | ||
234 | } | ||
235 | |||
236 | smp_llsc_mb(); | ||
237 | |||
238 | return result; | ||
239 | } | ||
240 | |||
241 | /* | ||
242 | * atomic_sub_if_positive - conditionally subtract integer from atomic variable | ||
243 | * @i: integer value to subtract | ||
244 | * @v: pointer of type atomic_t | ||
245 | * | ||
246 | * Atomically test @v and subtract @i if @v is greater or equal than @i. | ||
247 | * The function returns the old value of @v minus @i. | ||
248 | */ | ||
249 | static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) | ||
250 | { | ||
251 | unsigned long result; | ||
252 | |||
253 | smp_llsc_mb(); | ||
254 | |||
255 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
256 | unsigned long temp; | ||
257 | |||
258 | __asm__ __volatile__( | ||
259 | " .set mips3 \n" | ||
260 | "1: ll %1, %2 # atomic_sub_if_positive\n" | ||
261 | " subu %0, %1, %3 \n" | ||
262 | " bltz %0, 1f \n" | ||
263 | " sc %0, %2 \n" | ||
264 | " .set noreorder \n" | ||
265 | " beqzl %0, 1b \n" | ||
266 | " subu %0, %1, %3 \n" | ||
267 | " .set reorder \n" | ||
268 | "1: \n" | ||
269 | " .set mips0 \n" | ||
270 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
271 | : "Ir" (i), "m" (v->counter) | ||
272 | : "memory"); | ||
273 | } else if (cpu_has_llsc) { | ||
274 | unsigned long temp; | ||
275 | |||
276 | __asm__ __volatile__( | ||
277 | " .set mips3 \n" | ||
278 | "1: ll %1, %2 # atomic_sub_if_positive\n" | ||
279 | " subu %0, %1, %3 \n" | ||
280 | " bltz %0, 1f \n" | ||
281 | " sc %0, %2 \n" | ||
282 | " .set noreorder \n" | ||
283 | " beqz %0, 2f \n" | ||
284 | " subu %0, %1, %3 \n" | ||
285 | " .set reorder \n" | ||
286 | " .subsection 2 \n" | ||
287 | "2: b 1b \n" | ||
288 | " .previous \n" | ||
289 | "1: \n" | ||
290 | " .set mips0 \n" | ||
291 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
292 | : "Ir" (i), "m" (v->counter) | ||
293 | : "memory"); | ||
294 | } else { | ||
295 | unsigned long flags; | ||
296 | |||
297 | raw_local_irq_save(flags); | ||
298 | result = v->counter; | ||
299 | result -= i; | ||
300 | if (result >= 0) | ||
301 | v->counter = result; | ||
302 | raw_local_irq_restore(flags); | ||
303 | } | ||
304 | |||
305 | smp_llsc_mb(); | ||
306 | |||
307 | return result; | ||
308 | } | ||
309 | |||
310 | #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) | ||
311 | #define atomic_xchg(v, new) (xchg(&((v)->counter), (new))) | ||
312 | |||
313 | /** | ||
314 | * atomic_add_unless - add unless the number is a given value | ||
315 | * @v: pointer of type atomic_t | ||
316 | * @a: the amount to add to v... | ||
317 | * @u: ...unless v is equal to u. | ||
318 | * | ||
319 | * Atomically adds @a to @v, so long as it was not @u. | ||
320 | * Returns non-zero if @v was not @u, and zero otherwise. | ||
321 | */ | ||
322 | static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) | ||
323 | { | ||
324 | int c, old; | ||
325 | c = atomic_read(v); | ||
326 | for (;;) { | ||
327 | if (unlikely(c == (u))) | ||
328 | break; | ||
329 | old = atomic_cmpxchg((v), c, c + (a)); | ||
330 | if (likely(old == c)) | ||
331 | break; | ||
332 | c = old; | ||
333 | } | ||
334 | return c != (u); | ||
335 | } | ||
336 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | ||
337 | |||
338 | #define atomic_dec_return(v) atomic_sub_return(1, (v)) | ||
339 | #define atomic_inc_return(v) atomic_add_return(1, (v)) | ||
340 | |||
341 | /* | ||
342 | * atomic_sub_and_test - subtract value from variable and test result | ||
343 | * @i: integer value to subtract | ||
344 | * @v: pointer of type atomic_t | ||
345 | * | ||
346 | * Atomically subtracts @i from @v and returns | ||
347 | * true if the result is zero, or false for all | ||
348 | * other cases. | ||
349 | */ | ||
350 | #define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0) | ||
351 | |||
352 | /* | ||
353 | * atomic_inc_and_test - increment and test | ||
354 | * @v: pointer of type atomic_t | ||
355 | * | ||
356 | * Atomically increments @v by 1 | ||
357 | * and returns true if the result is zero, or false for all | ||
358 | * other cases. | ||
359 | */ | ||
360 | #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) | ||
361 | |||
362 | /* | ||
363 | * atomic_dec_and_test - decrement by 1 and test | ||
364 | * @v: pointer of type atomic_t | ||
365 | * | ||
366 | * Atomically decrements @v by 1 and | ||
367 | * returns true if the result is 0, or false for all other | ||
368 | * cases. | ||
369 | */ | ||
370 | #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) | ||
371 | |||
372 | /* | ||
373 | * atomic_dec_if_positive - decrement by 1 if old value positive | ||
374 | * @v: pointer of type atomic_t | ||
375 | */ | ||
376 | #define atomic_dec_if_positive(v) atomic_sub_if_positive(1, v) | ||
377 | |||
378 | /* | ||
379 | * atomic_inc - increment atomic variable | ||
380 | * @v: pointer of type atomic_t | ||
381 | * | ||
382 | * Atomically increments @v by 1. | ||
383 | */ | ||
384 | #define atomic_inc(v) atomic_add(1, (v)) | ||
385 | |||
386 | /* | ||
387 | * atomic_dec - decrement and test | ||
388 | * @v: pointer of type atomic_t | ||
389 | * | ||
390 | * Atomically decrements @v by 1. | ||
391 | */ | ||
392 | #define atomic_dec(v) atomic_sub(1, (v)) | ||
393 | |||
394 | /* | ||
395 | * atomic_add_negative - add and test if negative | ||
396 | * @v: pointer of type atomic_t | ||
397 | * @i: integer value to add | ||
398 | * | ||
399 | * Atomically adds @i to @v and returns true | ||
400 | * if the result is negative, or false when | ||
401 | * result is greater than or equal to zero. | ||
402 | */ | ||
403 | #define atomic_add_negative(i, v) (atomic_add_return(i, (v)) < 0) | ||
404 | |||
405 | #ifdef CONFIG_64BIT | ||
406 | |||
407 | typedef struct { volatile long counter; } atomic64_t; | ||
408 | |||
409 | #define ATOMIC64_INIT(i) { (i) } | ||
410 | |||
411 | /* | ||
412 | * atomic64_read - read atomic variable | ||
413 | * @v: pointer of type atomic64_t | ||
414 | * | ||
415 | */ | ||
416 | #define atomic64_read(v) ((v)->counter) | ||
417 | |||
418 | /* | ||
419 | * atomic64_set - set atomic variable | ||
420 | * @v: pointer of type atomic64_t | ||
421 | * @i: required value | ||
422 | */ | ||
423 | #define atomic64_set(v, i) ((v)->counter = (i)) | ||
424 | |||
425 | /* | ||
426 | * atomic64_add - add integer to atomic variable | ||
427 | * @i: integer value to add | ||
428 | * @v: pointer of type atomic64_t | ||
429 | * | ||
430 | * Atomically adds @i to @v. | ||
431 | */ | ||
432 | static __inline__ void atomic64_add(long i, atomic64_t * v) | ||
433 | { | ||
434 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
435 | unsigned long temp; | ||
436 | |||
437 | __asm__ __volatile__( | ||
438 | " .set mips3 \n" | ||
439 | "1: lld %0, %1 # atomic64_add \n" | ||
440 | " addu %0, %2 \n" | ||
441 | " scd %0, %1 \n" | ||
442 | " beqzl %0, 1b \n" | ||
443 | " .set mips0 \n" | ||
444 | : "=&r" (temp), "=m" (v->counter) | ||
445 | : "Ir" (i), "m" (v->counter)); | ||
446 | } else if (cpu_has_llsc) { | ||
447 | unsigned long temp; | ||
448 | |||
449 | __asm__ __volatile__( | ||
450 | " .set mips3 \n" | ||
451 | "1: lld %0, %1 # atomic64_add \n" | ||
452 | " addu %0, %2 \n" | ||
453 | " scd %0, %1 \n" | ||
454 | " beqz %0, 2f \n" | ||
455 | " .subsection 2 \n" | ||
456 | "2: b 1b \n" | ||
457 | " .previous \n" | ||
458 | " .set mips0 \n" | ||
459 | : "=&r" (temp), "=m" (v->counter) | ||
460 | : "Ir" (i), "m" (v->counter)); | ||
461 | } else { | ||
462 | unsigned long flags; | ||
463 | |||
464 | raw_local_irq_save(flags); | ||
465 | v->counter += i; | ||
466 | raw_local_irq_restore(flags); | ||
467 | } | ||
468 | } | ||
469 | |||
470 | /* | ||
471 | * atomic64_sub - subtract the atomic variable | ||
472 | * @i: integer value to subtract | ||
473 | * @v: pointer of type atomic64_t | ||
474 | * | ||
475 | * Atomically subtracts @i from @v. | ||
476 | */ | ||
477 | static __inline__ void atomic64_sub(long i, atomic64_t * v) | ||
478 | { | ||
479 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
480 | unsigned long temp; | ||
481 | |||
482 | __asm__ __volatile__( | ||
483 | " .set mips3 \n" | ||
484 | "1: lld %0, %1 # atomic64_sub \n" | ||
485 | " subu %0, %2 \n" | ||
486 | " scd %0, %1 \n" | ||
487 | " beqzl %0, 1b \n" | ||
488 | " .set mips0 \n" | ||
489 | : "=&r" (temp), "=m" (v->counter) | ||
490 | : "Ir" (i), "m" (v->counter)); | ||
491 | } else if (cpu_has_llsc) { | ||
492 | unsigned long temp; | ||
493 | |||
494 | __asm__ __volatile__( | ||
495 | " .set mips3 \n" | ||
496 | "1: lld %0, %1 # atomic64_sub \n" | ||
497 | " subu %0, %2 \n" | ||
498 | " scd %0, %1 \n" | ||
499 | " beqz %0, 2f \n" | ||
500 | " .subsection 2 \n" | ||
501 | "2: b 1b \n" | ||
502 | " .previous \n" | ||
503 | " .set mips0 \n" | ||
504 | : "=&r" (temp), "=m" (v->counter) | ||
505 | : "Ir" (i), "m" (v->counter)); | ||
506 | } else { | ||
507 | unsigned long flags; | ||
508 | |||
509 | raw_local_irq_save(flags); | ||
510 | v->counter -= i; | ||
511 | raw_local_irq_restore(flags); | ||
512 | } | ||
513 | } | ||
514 | |||
515 | /* | ||
516 | * Same as above, but return the result value | ||
517 | */ | ||
518 | static __inline__ long atomic64_add_return(long i, atomic64_t * v) | ||
519 | { | ||
520 | unsigned long result; | ||
521 | |||
522 | smp_llsc_mb(); | ||
523 | |||
524 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
525 | unsigned long temp; | ||
526 | |||
527 | __asm__ __volatile__( | ||
528 | " .set mips3 \n" | ||
529 | "1: lld %1, %2 # atomic64_add_return \n" | ||
530 | " addu %0, %1, %3 \n" | ||
531 | " scd %0, %2 \n" | ||
532 | " beqzl %0, 1b \n" | ||
533 | " addu %0, %1, %3 \n" | ||
534 | " .set mips0 \n" | ||
535 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
536 | : "Ir" (i), "m" (v->counter) | ||
537 | : "memory"); | ||
538 | } else if (cpu_has_llsc) { | ||
539 | unsigned long temp; | ||
540 | |||
541 | __asm__ __volatile__( | ||
542 | " .set mips3 \n" | ||
543 | "1: lld %1, %2 # atomic64_add_return \n" | ||
544 | " addu %0, %1, %3 \n" | ||
545 | " scd %0, %2 \n" | ||
546 | " beqz %0, 2f \n" | ||
547 | " addu %0, %1, %3 \n" | ||
548 | " .subsection 2 \n" | ||
549 | "2: b 1b \n" | ||
550 | " .previous \n" | ||
551 | " .set mips0 \n" | ||
552 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
553 | : "Ir" (i), "m" (v->counter) | ||
554 | : "memory"); | ||
555 | } else { | ||
556 | unsigned long flags; | ||
557 | |||
558 | raw_local_irq_save(flags); | ||
559 | result = v->counter; | ||
560 | result += i; | ||
561 | v->counter = result; | ||
562 | raw_local_irq_restore(flags); | ||
563 | } | ||
564 | |||
565 | smp_llsc_mb(); | ||
566 | |||
567 | return result; | ||
568 | } | ||
569 | |||
570 | static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | ||
571 | { | ||
572 | unsigned long result; | ||
573 | |||
574 | smp_llsc_mb(); | ||
575 | |||
576 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
577 | unsigned long temp; | ||
578 | |||
579 | __asm__ __volatile__( | ||
580 | " .set mips3 \n" | ||
581 | "1: lld %1, %2 # atomic64_sub_return \n" | ||
582 | " subu %0, %1, %3 \n" | ||
583 | " scd %0, %2 \n" | ||
584 | " beqzl %0, 1b \n" | ||
585 | " subu %0, %1, %3 \n" | ||
586 | " .set mips0 \n" | ||
587 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
588 | : "Ir" (i), "m" (v->counter) | ||
589 | : "memory"); | ||
590 | } else if (cpu_has_llsc) { | ||
591 | unsigned long temp; | ||
592 | |||
593 | __asm__ __volatile__( | ||
594 | " .set mips3 \n" | ||
595 | "1: lld %1, %2 # atomic64_sub_return \n" | ||
596 | " subu %0, %1, %3 \n" | ||
597 | " scd %0, %2 \n" | ||
598 | " beqz %0, 2f \n" | ||
599 | " subu %0, %1, %3 \n" | ||
600 | " .subsection 2 \n" | ||
601 | "2: b 1b \n" | ||
602 | " .previous \n" | ||
603 | " .set mips0 \n" | ||
604 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
605 | : "Ir" (i), "m" (v->counter) | ||
606 | : "memory"); | ||
607 | } else { | ||
608 | unsigned long flags; | ||
609 | |||
610 | raw_local_irq_save(flags); | ||
611 | result = v->counter; | ||
612 | result -= i; | ||
613 | v->counter = result; | ||
614 | raw_local_irq_restore(flags); | ||
615 | } | ||
616 | |||
617 | smp_llsc_mb(); | ||
618 | |||
619 | return result; | ||
620 | } | ||
621 | |||
622 | /* | ||
623 | * atomic64_sub_if_positive - conditionally subtract integer from atomic variable | ||
624 | * @i: integer value to subtract | ||
625 | * @v: pointer of type atomic64_t | ||
626 | * | ||
627 | * Atomically test @v and subtract @i if @v is greater or equal than @i. | ||
628 | * The function returns the old value of @v minus @i. | ||
629 | */ | ||
630 | static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) | ||
631 | { | ||
632 | unsigned long result; | ||
633 | |||
634 | smp_llsc_mb(); | ||
635 | |||
636 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
637 | unsigned long temp; | ||
638 | |||
639 | __asm__ __volatile__( | ||
640 | " .set mips3 \n" | ||
641 | "1: lld %1, %2 # atomic64_sub_if_positive\n" | ||
642 | " dsubu %0, %1, %3 \n" | ||
643 | " bltz %0, 1f \n" | ||
644 | " scd %0, %2 \n" | ||
645 | " .set noreorder \n" | ||
646 | " beqzl %0, 1b \n" | ||
647 | " dsubu %0, %1, %3 \n" | ||
648 | " .set reorder \n" | ||
649 | "1: \n" | ||
650 | " .set mips0 \n" | ||
651 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
652 | : "Ir" (i), "m" (v->counter) | ||
653 | : "memory"); | ||
654 | } else if (cpu_has_llsc) { | ||
655 | unsigned long temp; | ||
656 | |||
657 | __asm__ __volatile__( | ||
658 | " .set mips3 \n" | ||
659 | "1: lld %1, %2 # atomic64_sub_if_positive\n" | ||
660 | " dsubu %0, %1, %3 \n" | ||
661 | " bltz %0, 1f \n" | ||
662 | " scd %0, %2 \n" | ||
663 | " .set noreorder \n" | ||
664 | " beqz %0, 2f \n" | ||
665 | " dsubu %0, %1, %3 \n" | ||
666 | " .set reorder \n" | ||
667 | " .subsection 2 \n" | ||
668 | "2: b 1b \n" | ||
669 | " .previous \n" | ||
670 | "1: \n" | ||
671 | " .set mips0 \n" | ||
672 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | ||
673 | : "Ir" (i), "m" (v->counter) | ||
674 | : "memory"); | ||
675 | } else { | ||
676 | unsigned long flags; | ||
677 | |||
678 | raw_local_irq_save(flags); | ||
679 | result = v->counter; | ||
680 | result -= i; | ||
681 | if (result >= 0) | ||
682 | v->counter = result; | ||
683 | raw_local_irq_restore(flags); | ||
684 | } | ||
685 | |||
686 | smp_llsc_mb(); | ||
687 | |||
688 | return result; | ||
689 | } | ||
690 | |||
691 | #define atomic64_cmpxchg(v, o, n) \ | ||
692 | ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n))) | ||
693 | #define atomic64_xchg(v, new) (xchg(&((v)->counter), (new))) | ||
694 | |||
695 | /** | ||
696 | * atomic64_add_unless - add unless the number is a given value | ||
697 | * @v: pointer of type atomic64_t | ||
698 | * @a: the amount to add to v... | ||
699 | * @u: ...unless v is equal to u. | ||
700 | * | ||
701 | * Atomically adds @a to @v, so long as it was not @u. | ||
702 | * Returns non-zero if @v was not @u, and zero otherwise. | ||
703 | */ | ||
704 | static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | ||
705 | { | ||
706 | long c, old; | ||
707 | c = atomic64_read(v); | ||
708 | for (;;) { | ||
709 | if (unlikely(c == (u))) | ||
710 | break; | ||
711 | old = atomic64_cmpxchg((v), c, c + (a)); | ||
712 | if (likely(old == c)) | ||
713 | break; | ||
714 | c = old; | ||
715 | } | ||
716 | return c != (u); | ||
717 | } | ||
718 | |||
719 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) | ||
720 | |||
721 | #define atomic64_dec_return(v) atomic64_sub_return(1, (v)) | ||
722 | #define atomic64_inc_return(v) atomic64_add_return(1, (v)) | ||
723 | |||
724 | /* | ||
725 | * atomic64_sub_and_test - subtract value from variable and test result | ||
726 | * @i: integer value to subtract | ||
727 | * @v: pointer of type atomic64_t | ||
728 | * | ||
729 | * Atomically subtracts @i from @v and returns | ||
730 | * true if the result is zero, or false for all | ||
731 | * other cases. | ||
732 | */ | ||
733 | #define atomic64_sub_and_test(i, v) (atomic64_sub_return((i), (v)) == 0) | ||
734 | |||
735 | /* | ||
736 | * atomic64_inc_and_test - increment and test | ||
737 | * @v: pointer of type atomic64_t | ||
738 | * | ||
739 | * Atomically increments @v by 1 | ||
740 | * and returns true if the result is zero, or false for all | ||
741 | * other cases. | ||
742 | */ | ||
743 | #define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0) | ||
744 | |||
745 | /* | ||
746 | * atomic64_dec_and_test - decrement by 1 and test | ||
747 | * @v: pointer of type atomic64_t | ||
748 | * | ||
749 | * Atomically decrements @v by 1 and | ||
750 | * returns true if the result is 0, or false for all other | ||
751 | * cases. | ||
752 | */ | ||
753 | #define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0) | ||
754 | |||
755 | /* | ||
756 | * atomic64_dec_if_positive - decrement by 1 if old value positive | ||
757 | * @v: pointer of type atomic64_t | ||
758 | */ | ||
759 | #define atomic64_dec_if_positive(v) atomic64_sub_if_positive(1, v) | ||
760 | |||
761 | /* | ||
762 | * atomic64_inc - increment atomic variable | ||
763 | * @v: pointer of type atomic64_t | ||
764 | * | ||
765 | * Atomically increments @v by 1. | ||
766 | */ | ||
767 | #define atomic64_inc(v) atomic64_add(1, (v)) | ||
768 | |||
769 | /* | ||
770 | * atomic64_dec - decrement and test | ||
771 | * @v: pointer of type atomic64_t | ||
772 | * | ||
773 | * Atomically decrements @v by 1. | ||
774 | */ | ||
775 | #define atomic64_dec(v) atomic64_sub(1, (v)) | ||
776 | |||
777 | /* | ||
778 | * atomic64_add_negative - add and test if negative | ||
779 | * @v: pointer of type atomic64_t | ||
780 | * @i: integer value to add | ||
781 | * | ||
782 | * Atomically adds @i to @v and returns true | ||
783 | * if the result is negative, or false when | ||
784 | * result is greater than or equal to zero. | ||
785 | */ | ||
786 | #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0) | ||
787 | |||
788 | #endif /* CONFIG_64BIT */ | ||
789 | |||
790 | /* | ||
791 | * atomic*_return operations are serializing but not the non-*_return | ||
792 | * versions. | ||
793 | */ | ||
794 | #define smp_mb__before_atomic_dec() smp_llsc_mb() | ||
795 | #define smp_mb__after_atomic_dec() smp_llsc_mb() | ||
796 | #define smp_mb__before_atomic_inc() smp_llsc_mb() | ||
797 | #define smp_mb__after_atomic_inc() smp_llsc_mb() | ||
798 | |||
799 | #include <asm-generic/atomic.h> | ||
800 | |||
801 | #endif /* _ASM_ATOMIC_H */ | ||
diff --git a/include/asm-mips/auxvec.h b/include/asm-mips/auxvec.h deleted file mode 100644 index 7cf7f2d21943..000000000000 --- a/include/asm-mips/auxvec.h +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #ifndef _ASM_AUXVEC_H | ||
2 | #define _ASM_AUXVEC_H | ||
3 | |||
4 | #endif /* _ASM_AUXVEC_H */ | ||
diff --git a/include/asm-mips/barrier.h b/include/asm-mips/barrier.h deleted file mode 100644 index 8e9ac313ca3b..000000000000 --- a/include/asm-mips/barrier.h +++ /dev/null | |||
@@ -1,155 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006 by Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #ifndef __ASM_BARRIER_H | ||
9 | #define __ASM_BARRIER_H | ||
10 | |||
11 | /* | ||
12 | * read_barrier_depends - Flush all pending reads that subsequents reads | ||
13 | * depend on. | ||
14 | * | ||
15 | * No data-dependent reads from memory-like regions are ever reordered | ||
16 | * over this barrier. All reads preceding this primitive are guaranteed | ||
17 | * to access memory (but not necessarily other CPUs' caches) before any | ||
18 | * reads following this primitive that depend on the data return by | ||
19 | * any of the preceding reads. This primitive is much lighter weight than | ||
20 | * rmb() on most CPUs, and is never heavier weight than is | ||
21 | * rmb(). | ||
22 | * | ||
23 | * These ordering constraints are respected by both the local CPU | ||
24 | * and the compiler. | ||
25 | * | ||
26 | * Ordering is not guaranteed by anything other than these primitives, | ||
27 | * not even by data dependencies. See the documentation for | ||
28 | * memory_barrier() for examples and URLs to more information. | ||
29 | * | ||
30 | * For example, the following code would force ordering (the initial | ||
31 | * value of "a" is zero, "b" is one, and "p" is "&a"): | ||
32 | * | ||
33 | * <programlisting> | ||
34 | * CPU 0 CPU 1 | ||
35 | * | ||
36 | * b = 2; | ||
37 | * memory_barrier(); | ||
38 | * p = &b; q = p; | ||
39 | * read_barrier_depends(); | ||
40 | * d = *q; | ||
41 | * </programlisting> | ||
42 | * | ||
43 | * because the read of "*q" depends on the read of "p" and these | ||
44 | * two reads are separated by a read_barrier_depends(). However, | ||
45 | * the following code, with the same initial values for "a" and "b": | ||
46 | * | ||
47 | * <programlisting> | ||
48 | * CPU 0 CPU 1 | ||
49 | * | ||
50 | * a = 2; | ||
51 | * memory_barrier(); | ||
52 | * b = 3; y = b; | ||
53 | * read_barrier_depends(); | ||
54 | * x = a; | ||
55 | * </programlisting> | ||
56 | * | ||
57 | * does not enforce ordering, since there is no data dependency between | ||
58 | * the read of "a" and the read of "b". Therefore, on some CPUs, such | ||
59 | * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() | ||
60 | * in cases like this where there are no data dependencies. | ||
61 | */ | ||
62 | |||
63 | #define read_barrier_depends() do { } while(0) | ||
64 | #define smp_read_barrier_depends() do { } while(0) | ||
65 | |||
66 | #ifdef CONFIG_CPU_HAS_SYNC | ||
67 | #define __sync() \ | ||
68 | __asm__ __volatile__( \ | ||
69 | ".set push\n\t" \ | ||
70 | ".set noreorder\n\t" \ | ||
71 | ".set mips2\n\t" \ | ||
72 | "sync\n\t" \ | ||
73 | ".set pop" \ | ||
74 | : /* no output */ \ | ||
75 | : /* no input */ \ | ||
76 | : "memory") | ||
77 | #else | ||
78 | #define __sync() do { } while(0) | ||
79 | #endif | ||
80 | |||
81 | #define __fast_iob() \ | ||
82 | __asm__ __volatile__( \ | ||
83 | ".set push\n\t" \ | ||
84 | ".set noreorder\n\t" \ | ||
85 | "lw $0,%0\n\t" \ | ||
86 | "nop\n\t" \ | ||
87 | ".set pop" \ | ||
88 | : /* no output */ \ | ||
89 | : "m" (*(int *)CKSEG1) \ | ||
90 | : "memory") | ||
91 | |||
92 | #define fast_wmb() __sync() | ||
93 | #define fast_rmb() __sync() | ||
94 | #define fast_mb() __sync() | ||
95 | #ifdef CONFIG_SGI_IP28 | ||
96 | #define fast_iob() \ | ||
97 | __asm__ __volatile__( \ | ||
98 | ".set push\n\t" \ | ||
99 | ".set noreorder\n\t" \ | ||
100 | "lw $0,%0\n\t" \ | ||
101 | "sync\n\t" \ | ||
102 | "lw $0,%0\n\t" \ | ||
103 | ".set pop" \ | ||
104 | : /* no output */ \ | ||
105 | : "m" (*(int *)CKSEG1ADDR(0x1fa00004)) \ | ||
106 | : "memory") | ||
107 | #else | ||
108 | #define fast_iob() \ | ||
109 | do { \ | ||
110 | __sync(); \ | ||
111 | __fast_iob(); \ | ||
112 | } while (0) | ||
113 | #endif | ||
114 | |||
115 | #ifdef CONFIG_CPU_HAS_WB | ||
116 | |||
117 | #include <asm/wbflush.h> | ||
118 | |||
119 | #define wmb() fast_wmb() | ||
120 | #define rmb() fast_rmb() | ||
121 | #define mb() wbflush() | ||
122 | #define iob() wbflush() | ||
123 | |||
124 | #else /* !CONFIG_CPU_HAS_WB */ | ||
125 | |||
126 | #define wmb() fast_wmb() | ||
127 | #define rmb() fast_rmb() | ||
128 | #define mb() fast_mb() | ||
129 | #define iob() fast_iob() | ||
130 | |||
131 | #endif /* !CONFIG_CPU_HAS_WB */ | ||
132 | |||
133 | #if defined(CONFIG_WEAK_ORDERING) && defined(CONFIG_SMP) | ||
134 | #define __WEAK_ORDERING_MB " sync \n" | ||
135 | #else | ||
136 | #define __WEAK_ORDERING_MB " \n" | ||
137 | #endif | ||
138 | #if defined(CONFIG_WEAK_REORDERING_BEYOND_LLSC) && defined(CONFIG_SMP) | ||
139 | #define __WEAK_LLSC_MB " sync \n" | ||
140 | #else | ||
141 | #define __WEAK_LLSC_MB " \n" | ||
142 | #endif | ||
143 | |||
144 | #define smp_mb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory") | ||
145 | #define smp_rmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory") | ||
146 | #define smp_wmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory") | ||
147 | |||
148 | #define set_mb(var, value) \ | ||
149 | do { var = value; smp_mb(); } while (0) | ||
150 | |||
151 | #define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory") | ||
152 | #define smp_llsc_rmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory") | ||
153 | #define smp_llsc_wmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory") | ||
154 | |||
155 | #endif /* __ASM_BARRIER_H */ | ||
diff --git a/include/asm-mips/bcache.h b/include/asm-mips/bcache.h deleted file mode 100644 index 0ba9d6ef76a7..000000000000 --- a/include/asm-mips/bcache.h +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 1997, 1999 by Ralf Baechle | ||
7 | * Copyright (c) 1999 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_BCACHE_H | ||
10 | #define _ASM_BCACHE_H | ||
11 | |||
12 | |||
13 | /* Some R4000 / R4400 / R4600 / R5000 machines may have a non-dma-coherent, | ||
14 | chipset implemented caches. On machines with other CPUs the CPU does the | ||
15 | cache thing itself. */ | ||
16 | struct bcache_ops { | ||
17 | void (*bc_enable)(void); | ||
18 | void (*bc_disable)(void); | ||
19 | void (*bc_wback_inv)(unsigned long page, unsigned long size); | ||
20 | void (*bc_inv)(unsigned long page, unsigned long size); | ||
21 | }; | ||
22 | |||
23 | extern void indy_sc_init(void); | ||
24 | |||
25 | #ifdef CONFIG_BOARD_SCACHE | ||
26 | |||
27 | extern struct bcache_ops *bcops; | ||
28 | |||
29 | static inline void bc_enable(void) | ||
30 | { | ||
31 | bcops->bc_enable(); | ||
32 | } | ||
33 | |||
34 | static inline void bc_disable(void) | ||
35 | { | ||
36 | bcops->bc_disable(); | ||
37 | } | ||
38 | |||
39 | static inline void bc_wback_inv(unsigned long page, unsigned long size) | ||
40 | { | ||
41 | bcops->bc_wback_inv(page, size); | ||
42 | } | ||
43 | |||
44 | static inline void bc_inv(unsigned long page, unsigned long size) | ||
45 | { | ||
46 | bcops->bc_inv(page, size); | ||
47 | } | ||
48 | |||
49 | #else /* !defined(CONFIG_BOARD_SCACHE) */ | ||
50 | |||
51 | /* Not R4000 / R4400 / R4600 / R5000. */ | ||
52 | |||
53 | #define bc_enable() do { } while (0) | ||
54 | #define bc_disable() do { } while (0) | ||
55 | #define bc_wback_inv(page, size) do { } while (0) | ||
56 | #define bc_inv(page, size) do { } while (0) | ||
57 | |||
58 | #endif /* !defined(CONFIG_BOARD_SCACHE) */ | ||
59 | |||
60 | #endif /* _ASM_BCACHE_H */ | ||
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h deleted file mode 100644 index 49df8c4c9d25..000000000000 --- a/include/asm-mips/bitops.h +++ /dev/null | |||
@@ -1,672 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 1994 - 1997, 99, 2000, 06, 07 Ralf Baechle (ralf@linux-mips.org) | ||
7 | * Copyright (c) 1999, 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_BITOPS_H | ||
10 | #define _ASM_BITOPS_H | ||
11 | |||
12 | #ifndef _LINUX_BITOPS_H | ||
13 | #error only <linux/bitops.h> can be included directly | ||
14 | #endif | ||
15 | |||
16 | #include <linux/compiler.h> | ||
17 | #include <linux/irqflags.h> | ||
18 | #include <linux/types.h> | ||
19 | #include <asm/barrier.h> | ||
20 | #include <asm/bug.h> | ||
21 | #include <asm/byteorder.h> /* sigh ... */ | ||
22 | #include <asm/cpu-features.h> | ||
23 | #include <asm/sgidefs.h> | ||
24 | #include <asm/war.h> | ||
25 | |||
26 | #if _MIPS_SZLONG == 32 | ||
27 | #define SZLONG_LOG 5 | ||
28 | #define SZLONG_MASK 31UL | ||
29 | #define __LL "ll " | ||
30 | #define __SC "sc " | ||
31 | #define __INS "ins " | ||
32 | #define __EXT "ext " | ||
33 | #elif _MIPS_SZLONG == 64 | ||
34 | #define SZLONG_LOG 6 | ||
35 | #define SZLONG_MASK 63UL | ||
36 | #define __LL "lld " | ||
37 | #define __SC "scd " | ||
38 | #define __INS "dins " | ||
39 | #define __EXT "dext " | ||
40 | #endif | ||
41 | |||
42 | /* | ||
43 | * clear_bit() doesn't provide any barrier for the compiler. | ||
44 | */ | ||
45 | #define smp_mb__before_clear_bit() smp_llsc_mb() | ||
46 | #define smp_mb__after_clear_bit() smp_llsc_mb() | ||
47 | |||
48 | /* | ||
49 | * set_bit - Atomically set a bit in memory | ||
50 | * @nr: the bit to set | ||
51 | * @addr: the address to start counting from | ||
52 | * | ||
53 | * This function is atomic and may not be reordered. See __set_bit() | ||
54 | * if you do not require the atomic guarantees. | ||
55 | * Note that @nr may be almost arbitrarily large; this function is not | ||
56 | * restricted to acting on a single-word quantity. | ||
57 | */ | ||
58 | static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | ||
59 | { | ||
60 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
61 | unsigned short bit = nr & SZLONG_MASK; | ||
62 | unsigned long temp; | ||
63 | |||
64 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
65 | __asm__ __volatile__( | ||
66 | " .set mips3 \n" | ||
67 | "1: " __LL "%0, %1 # set_bit \n" | ||
68 | " or %0, %2 \n" | ||
69 | " " __SC "%0, %1 \n" | ||
70 | " beqzl %0, 1b \n" | ||
71 | " .set mips0 \n" | ||
72 | : "=&r" (temp), "=m" (*m) | ||
73 | : "ir" (1UL << bit), "m" (*m)); | ||
74 | #ifdef CONFIG_CPU_MIPSR2 | ||
75 | } else if (__builtin_constant_p(bit)) { | ||
76 | __asm__ __volatile__( | ||
77 | "1: " __LL "%0, %1 # set_bit \n" | ||
78 | " " __INS "%0, %4, %2, 1 \n" | ||
79 | " " __SC "%0, %1 \n" | ||
80 | " beqz %0, 2f \n" | ||
81 | " .subsection 2 \n" | ||
82 | "2: b 1b \n" | ||
83 | " .previous \n" | ||
84 | : "=&r" (temp), "=m" (*m) | ||
85 | : "ir" (bit), "m" (*m), "r" (~0)); | ||
86 | #endif /* CONFIG_CPU_MIPSR2 */ | ||
87 | } else if (cpu_has_llsc) { | ||
88 | __asm__ __volatile__( | ||
89 | " .set mips3 \n" | ||
90 | "1: " __LL "%0, %1 # set_bit \n" | ||
91 | " or %0, %2 \n" | ||
92 | " " __SC "%0, %1 \n" | ||
93 | " beqz %0, 2f \n" | ||
94 | " .subsection 2 \n" | ||
95 | "2: b 1b \n" | ||
96 | " .previous \n" | ||
97 | " .set mips0 \n" | ||
98 | : "=&r" (temp), "=m" (*m) | ||
99 | : "ir" (1UL << bit), "m" (*m)); | ||
100 | } else { | ||
101 | volatile unsigned long *a = addr; | ||
102 | unsigned long mask; | ||
103 | unsigned long flags; | ||
104 | |||
105 | a += nr >> SZLONG_LOG; | ||
106 | mask = 1UL << bit; | ||
107 | raw_local_irq_save(flags); | ||
108 | *a |= mask; | ||
109 | raw_local_irq_restore(flags); | ||
110 | } | ||
111 | } | ||
112 | |||
113 | /* | ||
114 | * clear_bit - Clears a bit in memory | ||
115 | * @nr: Bit to clear | ||
116 | * @addr: Address to start counting from | ||
117 | * | ||
118 | * clear_bit() is atomic and may not be reordered. However, it does | ||
119 | * not contain a memory barrier, so if it is used for locking purposes, | ||
120 | * you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit() | ||
121 | * in order to ensure changes are visible on other processors. | ||
122 | */ | ||
123 | static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) | ||
124 | { | ||
125 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
126 | unsigned short bit = nr & SZLONG_MASK; | ||
127 | unsigned long temp; | ||
128 | |||
129 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
130 | __asm__ __volatile__( | ||
131 | " .set mips3 \n" | ||
132 | "1: " __LL "%0, %1 # clear_bit \n" | ||
133 | " and %0, %2 \n" | ||
134 | " " __SC "%0, %1 \n" | ||
135 | " beqzl %0, 1b \n" | ||
136 | " .set mips0 \n" | ||
137 | : "=&r" (temp), "=m" (*m) | ||
138 | : "ir" (~(1UL << bit)), "m" (*m)); | ||
139 | #ifdef CONFIG_CPU_MIPSR2 | ||
140 | } else if (__builtin_constant_p(bit)) { | ||
141 | __asm__ __volatile__( | ||
142 | "1: " __LL "%0, %1 # clear_bit \n" | ||
143 | " " __INS "%0, $0, %2, 1 \n" | ||
144 | " " __SC "%0, %1 \n" | ||
145 | " beqz %0, 2f \n" | ||
146 | " .subsection 2 \n" | ||
147 | "2: b 1b \n" | ||
148 | " .previous \n" | ||
149 | : "=&r" (temp), "=m" (*m) | ||
150 | : "ir" (bit), "m" (*m)); | ||
151 | #endif /* CONFIG_CPU_MIPSR2 */ | ||
152 | } else if (cpu_has_llsc) { | ||
153 | __asm__ __volatile__( | ||
154 | " .set mips3 \n" | ||
155 | "1: " __LL "%0, %1 # clear_bit \n" | ||
156 | " and %0, %2 \n" | ||
157 | " " __SC "%0, %1 \n" | ||
158 | " beqz %0, 2f \n" | ||
159 | " .subsection 2 \n" | ||
160 | "2: b 1b \n" | ||
161 | " .previous \n" | ||
162 | " .set mips0 \n" | ||
163 | : "=&r" (temp), "=m" (*m) | ||
164 | : "ir" (~(1UL << bit)), "m" (*m)); | ||
165 | } else { | ||
166 | volatile unsigned long *a = addr; | ||
167 | unsigned long mask; | ||
168 | unsigned long flags; | ||
169 | |||
170 | a += nr >> SZLONG_LOG; | ||
171 | mask = 1UL << bit; | ||
172 | raw_local_irq_save(flags); | ||
173 | *a &= ~mask; | ||
174 | raw_local_irq_restore(flags); | ||
175 | } | ||
176 | } | ||
177 | |||
178 | /* | ||
179 | * clear_bit_unlock - Clears a bit in memory | ||
180 | * @nr: Bit to clear | ||
181 | * @addr: Address to start counting from | ||
182 | * | ||
183 | * clear_bit() is atomic and implies release semantics before the memory | ||
184 | * operation. It can be used for an unlock. | ||
185 | */ | ||
186 | static inline void clear_bit_unlock(unsigned long nr, volatile unsigned long *addr) | ||
187 | { | ||
188 | smp_mb__before_clear_bit(); | ||
189 | clear_bit(nr, addr); | ||
190 | } | ||
191 | |||
192 | /* | ||
193 | * change_bit - Toggle a bit in memory | ||
194 | * @nr: Bit to change | ||
195 | * @addr: Address to start counting from | ||
196 | * | ||
197 | * change_bit() is atomic and may not be reordered. | ||
198 | * Note that @nr may be almost arbitrarily large; this function is not | ||
199 | * restricted to acting on a single-word quantity. | ||
200 | */ | ||
201 | static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | ||
202 | { | ||
203 | unsigned short bit = nr & SZLONG_MASK; | ||
204 | |||
205 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
206 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
207 | unsigned long temp; | ||
208 | |||
209 | __asm__ __volatile__( | ||
210 | " .set mips3 \n" | ||
211 | "1: " __LL "%0, %1 # change_bit \n" | ||
212 | " xor %0, %2 \n" | ||
213 | " " __SC "%0, %1 \n" | ||
214 | " beqzl %0, 1b \n" | ||
215 | " .set mips0 \n" | ||
216 | : "=&r" (temp), "=m" (*m) | ||
217 | : "ir" (1UL << bit), "m" (*m)); | ||
218 | } else if (cpu_has_llsc) { | ||
219 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
220 | unsigned long temp; | ||
221 | |||
222 | __asm__ __volatile__( | ||
223 | " .set mips3 \n" | ||
224 | "1: " __LL "%0, %1 # change_bit \n" | ||
225 | " xor %0, %2 \n" | ||
226 | " " __SC "%0, %1 \n" | ||
227 | " beqz %0, 2f \n" | ||
228 | " .subsection 2 \n" | ||
229 | "2: b 1b \n" | ||
230 | " .previous \n" | ||
231 | " .set mips0 \n" | ||
232 | : "=&r" (temp), "=m" (*m) | ||
233 | : "ir" (1UL << bit), "m" (*m)); | ||
234 | } else { | ||
235 | volatile unsigned long *a = addr; | ||
236 | unsigned long mask; | ||
237 | unsigned long flags; | ||
238 | |||
239 | a += nr >> SZLONG_LOG; | ||
240 | mask = 1UL << bit; | ||
241 | raw_local_irq_save(flags); | ||
242 | *a ^= mask; | ||
243 | raw_local_irq_restore(flags); | ||
244 | } | ||
245 | } | ||
246 | |||
247 | /* | ||
248 | * test_and_set_bit - Set a bit and return its old value | ||
249 | * @nr: Bit to set | ||
250 | * @addr: Address to count from | ||
251 | * | ||
252 | * This operation is atomic and cannot be reordered. | ||
253 | * It also implies a memory barrier. | ||
254 | */ | ||
255 | static inline int test_and_set_bit(unsigned long nr, | ||
256 | volatile unsigned long *addr) | ||
257 | { | ||
258 | unsigned short bit = nr & SZLONG_MASK; | ||
259 | unsigned long res; | ||
260 | |||
261 | smp_llsc_mb(); | ||
262 | |||
263 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
264 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
265 | unsigned long temp; | ||
266 | |||
267 | __asm__ __volatile__( | ||
268 | " .set mips3 \n" | ||
269 | "1: " __LL "%0, %1 # test_and_set_bit \n" | ||
270 | " or %2, %0, %3 \n" | ||
271 | " " __SC "%2, %1 \n" | ||
272 | " beqzl %2, 1b \n" | ||
273 | " and %2, %0, %3 \n" | ||
274 | " .set mips0 \n" | ||
275 | : "=&r" (temp), "=m" (*m), "=&r" (res) | ||
276 | : "r" (1UL << bit), "m" (*m) | ||
277 | : "memory"); | ||
278 | } else if (cpu_has_llsc) { | ||
279 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
280 | unsigned long temp; | ||
281 | |||
282 | __asm__ __volatile__( | ||
283 | " .set push \n" | ||
284 | " .set noreorder \n" | ||
285 | " .set mips3 \n" | ||
286 | "1: " __LL "%0, %1 # test_and_set_bit \n" | ||
287 | " or %2, %0, %3 \n" | ||
288 | " " __SC "%2, %1 \n" | ||
289 | " beqz %2, 2f \n" | ||
290 | " and %2, %0, %3 \n" | ||
291 | " .subsection 2 \n" | ||
292 | "2: b 1b \n" | ||
293 | " nop \n" | ||
294 | " .previous \n" | ||
295 | " .set pop \n" | ||
296 | : "=&r" (temp), "=m" (*m), "=&r" (res) | ||
297 | : "r" (1UL << bit), "m" (*m) | ||
298 | : "memory"); | ||
299 | } else { | ||
300 | volatile unsigned long *a = addr; | ||
301 | unsigned long mask; | ||
302 | unsigned long flags; | ||
303 | |||
304 | a += nr >> SZLONG_LOG; | ||
305 | mask = 1UL << bit; | ||
306 | raw_local_irq_save(flags); | ||
307 | res = (mask & *a); | ||
308 | *a |= mask; | ||
309 | raw_local_irq_restore(flags); | ||
310 | } | ||
311 | |||
312 | smp_llsc_mb(); | ||
313 | |||
314 | return res != 0; | ||
315 | } | ||
316 | |||
317 | /* | ||
318 | * test_and_set_bit_lock - Set a bit and return its old value | ||
319 | * @nr: Bit to set | ||
320 | * @addr: Address to count from | ||
321 | * | ||
322 | * This operation is atomic and implies acquire ordering semantics | ||
323 | * after the memory operation. | ||
324 | */ | ||
325 | static inline int test_and_set_bit_lock(unsigned long nr, | ||
326 | volatile unsigned long *addr) | ||
327 | { | ||
328 | unsigned short bit = nr & SZLONG_MASK; | ||
329 | unsigned long res; | ||
330 | |||
331 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
332 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
333 | unsigned long temp; | ||
334 | |||
335 | __asm__ __volatile__( | ||
336 | " .set mips3 \n" | ||
337 | "1: " __LL "%0, %1 # test_and_set_bit \n" | ||
338 | " or %2, %0, %3 \n" | ||
339 | " " __SC "%2, %1 \n" | ||
340 | " beqzl %2, 1b \n" | ||
341 | " and %2, %0, %3 \n" | ||
342 | " .set mips0 \n" | ||
343 | : "=&r" (temp), "=m" (*m), "=&r" (res) | ||
344 | : "r" (1UL << bit), "m" (*m) | ||
345 | : "memory"); | ||
346 | } else if (cpu_has_llsc) { | ||
347 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
348 | unsigned long temp; | ||
349 | |||
350 | __asm__ __volatile__( | ||
351 | " .set push \n" | ||
352 | " .set noreorder \n" | ||
353 | " .set mips3 \n" | ||
354 | "1: " __LL "%0, %1 # test_and_set_bit \n" | ||
355 | " or %2, %0, %3 \n" | ||
356 | " " __SC "%2, %1 \n" | ||
357 | " beqz %2, 2f \n" | ||
358 | " and %2, %0, %3 \n" | ||
359 | " .subsection 2 \n" | ||
360 | "2: b 1b \n" | ||
361 | " nop \n" | ||
362 | " .previous \n" | ||
363 | " .set pop \n" | ||
364 | : "=&r" (temp), "=m" (*m), "=&r" (res) | ||
365 | : "r" (1UL << bit), "m" (*m) | ||
366 | : "memory"); | ||
367 | } else { | ||
368 | volatile unsigned long *a = addr; | ||
369 | unsigned long mask; | ||
370 | unsigned long flags; | ||
371 | |||
372 | a += nr >> SZLONG_LOG; | ||
373 | mask = 1UL << bit; | ||
374 | raw_local_irq_save(flags); | ||
375 | res = (mask & *a); | ||
376 | *a |= mask; | ||
377 | raw_local_irq_restore(flags); | ||
378 | } | ||
379 | |||
380 | smp_llsc_mb(); | ||
381 | |||
382 | return res != 0; | ||
383 | } | ||
384 | /* | ||
385 | * test_and_clear_bit - Clear a bit and return its old value | ||
386 | * @nr: Bit to clear | ||
387 | * @addr: Address to count from | ||
388 | * | ||
389 | * This operation is atomic and cannot be reordered. | ||
390 | * It also implies a memory barrier. | ||
391 | */ | ||
392 | static inline int test_and_clear_bit(unsigned long nr, | ||
393 | volatile unsigned long *addr) | ||
394 | { | ||
395 | unsigned short bit = nr & SZLONG_MASK; | ||
396 | unsigned long res; | ||
397 | |||
398 | smp_llsc_mb(); | ||
399 | |||
400 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
401 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
402 | unsigned long temp; | ||
403 | |||
404 | __asm__ __volatile__( | ||
405 | " .set mips3 \n" | ||
406 | "1: " __LL "%0, %1 # test_and_clear_bit \n" | ||
407 | " or %2, %0, %3 \n" | ||
408 | " xor %2, %3 \n" | ||
409 | " " __SC "%2, %1 \n" | ||
410 | " beqzl %2, 1b \n" | ||
411 | " and %2, %0, %3 \n" | ||
412 | " .set mips0 \n" | ||
413 | : "=&r" (temp), "=m" (*m), "=&r" (res) | ||
414 | : "r" (1UL << bit), "m" (*m) | ||
415 | : "memory"); | ||
416 | #ifdef CONFIG_CPU_MIPSR2 | ||
417 | } else if (__builtin_constant_p(nr)) { | ||
418 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
419 | unsigned long temp; | ||
420 | |||
421 | __asm__ __volatile__( | ||
422 | "1: " __LL "%0, %1 # test_and_clear_bit \n" | ||
423 | " " __EXT "%2, %0, %3, 1 \n" | ||
424 | " " __INS "%0, $0, %3, 1 \n" | ||
425 | " " __SC "%0, %1 \n" | ||
426 | " beqz %0, 2f \n" | ||
427 | " .subsection 2 \n" | ||
428 | "2: b 1b \n" | ||
429 | " .previous \n" | ||
430 | : "=&r" (temp), "=m" (*m), "=&r" (res) | ||
431 | : "ir" (bit), "m" (*m) | ||
432 | : "memory"); | ||
433 | #endif | ||
434 | } else if (cpu_has_llsc) { | ||
435 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
436 | unsigned long temp; | ||
437 | |||
438 | __asm__ __volatile__( | ||
439 | " .set push \n" | ||
440 | " .set noreorder \n" | ||
441 | " .set mips3 \n" | ||
442 | "1: " __LL "%0, %1 # test_and_clear_bit \n" | ||
443 | " or %2, %0, %3 \n" | ||
444 | " xor %2, %3 \n" | ||
445 | " " __SC "%2, %1 \n" | ||
446 | " beqz %2, 2f \n" | ||
447 | " and %2, %0, %3 \n" | ||
448 | " .subsection 2 \n" | ||
449 | "2: b 1b \n" | ||
450 | " nop \n" | ||
451 | " .previous \n" | ||
452 | " .set pop \n" | ||
453 | : "=&r" (temp), "=m" (*m), "=&r" (res) | ||
454 | : "r" (1UL << bit), "m" (*m) | ||
455 | : "memory"); | ||
456 | } else { | ||
457 | volatile unsigned long *a = addr; | ||
458 | unsigned long mask; | ||
459 | unsigned long flags; | ||
460 | |||
461 | a += nr >> SZLONG_LOG; | ||
462 | mask = 1UL << bit; | ||
463 | raw_local_irq_save(flags); | ||
464 | res = (mask & *a); | ||
465 | *a &= ~mask; | ||
466 | raw_local_irq_restore(flags); | ||
467 | } | ||
468 | |||
469 | smp_llsc_mb(); | ||
470 | |||
471 | return res != 0; | ||
472 | } | ||
473 | |||
474 | /* | ||
475 | * test_and_change_bit - Change a bit and return its old value | ||
476 | * @nr: Bit to change | ||
477 | * @addr: Address to count from | ||
478 | * | ||
479 | * This operation is atomic and cannot be reordered. | ||
480 | * It also implies a memory barrier. | ||
481 | */ | ||
482 | static inline int test_and_change_bit(unsigned long nr, | ||
483 | volatile unsigned long *addr) | ||
484 | { | ||
485 | unsigned short bit = nr & SZLONG_MASK; | ||
486 | unsigned long res; | ||
487 | |||
488 | smp_llsc_mb(); | ||
489 | |||
490 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
491 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
492 | unsigned long temp; | ||
493 | |||
494 | __asm__ __volatile__( | ||
495 | " .set mips3 \n" | ||
496 | "1: " __LL "%0, %1 # test_and_change_bit \n" | ||
497 | " xor %2, %0, %3 \n" | ||
498 | " " __SC "%2, %1 \n" | ||
499 | " beqzl %2, 1b \n" | ||
500 | " and %2, %0, %3 \n" | ||
501 | " .set mips0 \n" | ||
502 | : "=&r" (temp), "=m" (*m), "=&r" (res) | ||
503 | : "r" (1UL << bit), "m" (*m) | ||
504 | : "memory"); | ||
505 | } else if (cpu_has_llsc) { | ||
506 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
507 | unsigned long temp; | ||
508 | |||
509 | __asm__ __volatile__( | ||
510 | " .set push \n" | ||
511 | " .set noreorder \n" | ||
512 | " .set mips3 \n" | ||
513 | "1: " __LL "%0, %1 # test_and_change_bit \n" | ||
514 | " xor %2, %0, %3 \n" | ||
515 | " " __SC "\t%2, %1 \n" | ||
516 | " beqz %2, 2f \n" | ||
517 | " and %2, %0, %3 \n" | ||
518 | " .subsection 2 \n" | ||
519 | "2: b 1b \n" | ||
520 | " nop \n" | ||
521 | " .previous \n" | ||
522 | " .set pop \n" | ||
523 | : "=&r" (temp), "=m" (*m), "=&r" (res) | ||
524 | : "r" (1UL << bit), "m" (*m) | ||
525 | : "memory"); | ||
526 | } else { | ||
527 | volatile unsigned long *a = addr; | ||
528 | unsigned long mask; | ||
529 | unsigned long flags; | ||
530 | |||
531 | a += nr >> SZLONG_LOG; | ||
532 | mask = 1UL << bit; | ||
533 | raw_local_irq_save(flags); | ||
534 | res = (mask & *a); | ||
535 | *a ^= mask; | ||
536 | raw_local_irq_restore(flags); | ||
537 | } | ||
538 | |||
539 | smp_llsc_mb(); | ||
540 | |||
541 | return res != 0; | ||
542 | } | ||
543 | |||
544 | #include <asm-generic/bitops/non-atomic.h> | ||
545 | |||
546 | /* | ||
547 | * __clear_bit_unlock - Clears a bit in memory | ||
548 | * @nr: Bit to clear | ||
549 | * @addr: Address to start counting from | ||
550 | * | ||
551 | * __clear_bit() is non-atomic and implies release semantics before the memory | ||
552 | * operation. It can be used for an unlock if no other CPUs can concurrently | ||
553 | * modify other bits in the word. | ||
554 | */ | ||
555 | static inline void __clear_bit_unlock(unsigned long nr, volatile unsigned long *addr) | ||
556 | { | ||
557 | smp_mb(); | ||
558 | __clear_bit(nr, addr); | ||
559 | } | ||
560 | |||
561 | #if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) | ||
562 | |||
563 | /* | ||
564 | * Return the bit position (0..63) of the most significant 1 bit in a word | ||
565 | * Returns -1 if no 1 bit exists | ||
566 | */ | ||
567 | static inline unsigned long __fls(unsigned long x) | ||
568 | { | ||
569 | int lz; | ||
570 | |||
571 | if (sizeof(x) == 4) { | ||
572 | __asm__( | ||
573 | " .set push \n" | ||
574 | " .set mips32 \n" | ||
575 | " clz %0, %1 \n" | ||
576 | " .set pop \n" | ||
577 | : "=r" (lz) | ||
578 | : "r" (x)); | ||
579 | |||
580 | return 31 - lz; | ||
581 | } | ||
582 | |||
583 | BUG_ON(sizeof(x) != 8); | ||
584 | |||
585 | __asm__( | ||
586 | " .set push \n" | ||
587 | " .set mips64 \n" | ||
588 | " dclz %0, %1 \n" | ||
589 | " .set pop \n" | ||
590 | : "=r" (lz) | ||
591 | : "r" (x)); | ||
592 | |||
593 | return 63 - lz; | ||
594 | } | ||
595 | |||
596 | /* | ||
597 | * __ffs - find first bit in word. | ||
598 | * @word: The word to search | ||
599 | * | ||
600 | * Returns 0..SZLONG-1 | ||
601 | * Undefined if no bit exists, so code should check against 0 first. | ||
602 | */ | ||
603 | static inline unsigned long __ffs(unsigned long word) | ||
604 | { | ||
605 | return __fls(word & -word); | ||
606 | } | ||
607 | |||
608 | /* | ||
609 | * fls - find last bit set. | ||
610 | * @word: The word to search | ||
611 | * | ||
612 | * This is defined the same way as ffs. | ||
613 | * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. | ||
614 | */ | ||
615 | static inline int fls(int word) | ||
616 | { | ||
617 | __asm__("clz %0, %1" : "=r" (word) : "r" (word)); | ||
618 | |||
619 | return 32 - word; | ||
620 | } | ||
621 | |||
622 | #if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPS64) | ||
623 | static inline int fls64(__u64 word) | ||
624 | { | ||
625 | __asm__("dclz %0, %1" : "=r" (word) : "r" (word)); | ||
626 | |||
627 | return 64 - word; | ||
628 | } | ||
629 | #else | ||
630 | #include <asm-generic/bitops/fls64.h> | ||
631 | #endif | ||
632 | |||
633 | /* | ||
634 | * ffs - find first bit set. | ||
635 | * @word: The word to search | ||
636 | * | ||
637 | * This is defined the same way as | ||
638 | * the libc and compiler builtin ffs routines, therefore | ||
639 | * differs in spirit from the above ffz (man ffs). | ||
640 | */ | ||
641 | static inline int ffs(int word) | ||
642 | { | ||
643 | if (!word) | ||
644 | return 0; | ||
645 | |||
646 | return fls(word & -word); | ||
647 | } | ||
648 | |||
649 | #else | ||
650 | |||
651 | #include <asm-generic/bitops/__ffs.h> | ||
652 | #include <asm-generic/bitops/__fls.h> | ||
653 | #include <asm-generic/bitops/ffs.h> | ||
654 | #include <asm-generic/bitops/fls.h> | ||
655 | #include <asm-generic/bitops/fls64.h> | ||
656 | |||
657 | #endif /*defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) */ | ||
658 | |||
659 | #include <asm-generic/bitops/ffz.h> | ||
660 | #include <asm-generic/bitops/find.h> | ||
661 | |||
662 | #ifdef __KERNEL__ | ||
663 | |||
664 | #include <asm-generic/bitops/sched.h> | ||
665 | #include <asm-generic/bitops/hweight.h> | ||
666 | #include <asm-generic/bitops/ext2-non-atomic.h> | ||
667 | #include <asm-generic/bitops/ext2-atomic.h> | ||
668 | #include <asm-generic/bitops/minix.h> | ||
669 | |||
670 | #endif /* __KERNEL__ */ | ||
671 | |||
672 | #endif /* _ASM_BITOPS_H */ | ||
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h deleted file mode 100644 index 610fe3af7a03..000000000000 --- a/include/asm-mips/bootinfo.h +++ /dev/null | |||
@@ -1,110 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file COPYING in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 1996, 2003 by Ralf Baechle | ||
7 | * Copyright (C) 1995, 1996 Andreas Busse | ||
8 | * Copyright (C) 1995, 1996 Stoned Elipot | ||
9 | * Copyright (C) 1995, 1996 Paul M. Antoine. | ||
10 | */ | ||
11 | #ifndef _ASM_BOOTINFO_H | ||
12 | #define _ASM_BOOTINFO_H | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <asm/setup.h> | ||
16 | |||
17 | /* | ||
18 | * The MACH_ IDs are sort of equivalent to PCI product IDs. As such the | ||
19 | * numbers do not necessarily reflect technical relations or similarities | ||
20 | * between systems. | ||
21 | */ | ||
22 | |||
23 | /* | ||
24 | * Valid machtype values for group unknown | ||
25 | */ | ||
26 | #define MACH_UNKNOWN 0 /* whatever... */ | ||
27 | |||
28 | /* | ||
29 | * Valid machtype for group DEC | ||
30 | */ | ||
31 | #define MACH_DSUNKNOWN 0 | ||
32 | #define MACH_DS23100 1 /* DECstation 2100 or 3100 */ | ||
33 | #define MACH_DS5100 2 /* DECsystem 5100 */ | ||
34 | #define MACH_DS5000_200 3 /* DECstation 5000/200 */ | ||
35 | #define MACH_DS5000_1XX 4 /* DECstation 5000/120, 125, 133, 150 */ | ||
36 | #define MACH_DS5000_XX 5 /* DECstation 5000/20, 25, 33, 50 */ | ||
37 | #define MACH_DS5000_2X0 6 /* DECstation 5000/240, 260 */ | ||
38 | #define MACH_DS5400 7 /* DECsystem 5400 */ | ||
39 | #define MACH_DS5500 8 /* DECsystem 5500 */ | ||
40 | #define MACH_DS5800 9 /* DECsystem 5800 */ | ||
41 | #define MACH_DS5900 10 /* DECsystem 5900 */ | ||
42 | |||
43 | /* | ||
44 | * Valid machtype for group PMC-MSP | ||
45 | */ | ||
46 | #define MACH_MSP4200_EVAL 0 /* PMC-Sierra MSP4200 Evaluation */ | ||
47 | #define MACH_MSP4200_GW 1 /* PMC-Sierra MSP4200 Gateway demo */ | ||
48 | #define MACH_MSP4200_FPGA 2 /* PMC-Sierra MSP4200 Emulation */ | ||
49 | #define MACH_MSP7120_EVAL 3 /* PMC-Sierra MSP7120 Evaluation */ | ||
50 | #define MACH_MSP7120_GW 4 /* PMC-Sierra MSP7120 Residential GW */ | ||
51 | #define MACH_MSP7120_FPGA 5 /* PMC-Sierra MSP7120 Emulation */ | ||
52 | #define MACH_MSP_OTHER 255 /* PMC-Sierra unknown board type */ | ||
53 | |||
54 | /* | ||
55 | * Valid machtype for group Mikrotik | ||
56 | */ | ||
57 | #define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */ | ||
58 | #define MACH_MIKROTIK_RB532A 1 /* Mikrotik RouterBoard 532A */ | ||
59 | |||
60 | #define CL_SIZE COMMAND_LINE_SIZE | ||
61 | |||
62 | extern char *system_type; | ||
63 | const char *get_system_type(void); | ||
64 | |||
65 | extern unsigned long mips_machtype; | ||
66 | |||
67 | #define BOOT_MEM_MAP_MAX 32 | ||
68 | #define BOOT_MEM_RAM 1 | ||
69 | #define BOOT_MEM_ROM_DATA 2 | ||
70 | #define BOOT_MEM_RESERVED 3 | ||
71 | |||
72 | /* | ||
73 | * A memory map that's built upon what was determined | ||
74 | * or specified on the command line. | ||
75 | */ | ||
76 | struct boot_mem_map { | ||
77 | int nr_map; | ||
78 | struct boot_mem_map_entry { | ||
79 | phys_t addr; /* start of memory segment */ | ||
80 | phys_t size; /* size of memory segment */ | ||
81 | long type; /* type of memory segment */ | ||
82 | } map[BOOT_MEM_MAP_MAX]; | ||
83 | }; | ||
84 | |||
85 | extern struct boot_mem_map boot_mem_map; | ||
86 | |||
87 | extern void add_memory_region(phys_t start, phys_t size, long type); | ||
88 | |||
89 | extern void prom_init(void); | ||
90 | extern void prom_free_prom_memory(void); | ||
91 | |||
92 | extern void free_init_pages(const char *what, | ||
93 | unsigned long begin, unsigned long end); | ||
94 | |||
95 | /* | ||
96 | * Initial kernel command line, usually setup by prom_init() | ||
97 | */ | ||
98 | extern char arcs_cmdline[CL_SIZE]; | ||
99 | |||
100 | /* | ||
101 | * Registers a0, a1, a3 and a4 as passed to the kernel entry by firmware | ||
102 | */ | ||
103 | extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3; | ||
104 | |||
105 | /* | ||
106 | * Platform memory detection hook called by setup_arch | ||
107 | */ | ||
108 | extern void plat_mem_setup(void); | ||
109 | |||
110 | #endif /* _ASM_BOOTINFO_H */ | ||
diff --git a/include/asm-mips/branch.h b/include/asm-mips/branch.h deleted file mode 100644 index 37c6857c8d4a..000000000000 --- a/include/asm-mips/branch.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_BRANCH_H | ||
9 | #define _ASM_BRANCH_H | ||
10 | |||
11 | #include <asm/ptrace.h> | ||
12 | |||
13 | static inline int delay_slot(struct pt_regs *regs) | ||
14 | { | ||
15 | return regs->cp0_cause & CAUSEF_BD; | ||
16 | } | ||
17 | |||
18 | static inline unsigned long exception_epc(struct pt_regs *regs) | ||
19 | { | ||
20 | if (!delay_slot(regs)) | ||
21 | return regs->cp0_epc; | ||
22 | |||
23 | return regs->cp0_epc + 4; | ||
24 | } | ||
25 | |||
26 | extern int __compute_return_epc(struct pt_regs *regs); | ||
27 | |||
28 | static inline int compute_return_epc(struct pt_regs *regs) | ||
29 | { | ||
30 | if (!delay_slot(regs)) { | ||
31 | regs->cp0_epc += 4; | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | return __compute_return_epc(regs); | ||
36 | } | ||
37 | |||
38 | #endif /* _ASM_BRANCH_H */ | ||
diff --git a/include/asm-mips/break.h b/include/asm-mips/break.h deleted file mode 100644 index 25b980c91e7e..000000000000 --- a/include/asm-mips/break.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 2003 by Ralf Baechle | ||
7 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef __ASM_BREAK_H | ||
10 | #define __ASM_BREAK_H | ||
11 | |||
12 | /* | ||
13 | * The following break codes are or were in use for specific purposes in | ||
14 | * other MIPS operating systems. Linux/MIPS doesn't use all of them. The | ||
15 | * unused ones are here as placeholders; we might encounter them in | ||
16 | * non-Linux/MIPS object files or make use of them in the future. | ||
17 | */ | ||
18 | #define BRK_USERBP 0 /* User bp (used by debuggers) */ | ||
19 | #define BRK_KERNELBP 1 /* Break in the kernel */ | ||
20 | #define BRK_ABORT 2 /* Sometimes used by abort(3) to SIGIOT */ | ||
21 | #define BRK_BD_TAKEN 3 /* For bd slot emulation - not implemented */ | ||
22 | #define BRK_BD_NOTTAKEN 4 /* For bd slot emulation - not implemented */ | ||
23 | #define BRK_SSTEPBP 5 /* User bp (used by debuggers) */ | ||
24 | #define BRK_OVERFLOW 6 /* Overflow check */ | ||
25 | #define BRK_DIVZERO 7 /* Divide by zero check */ | ||
26 | #define BRK_RANGE 8 /* Range error check */ | ||
27 | #define BRK_STACKOVERFLOW 9 /* For Ada stackchecking */ | ||
28 | #define BRK_NORLD 10 /* No rld found - not used by Linux/MIPS */ | ||
29 | #define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */ | ||
30 | #define BRK_BUG 512 /* Used by BUG() */ | ||
31 | #define BRK_KDB 513 /* Used in KDB_ENTER() */ | ||
32 | #define BRK_MULOVF 1023 /* Multiply overflow */ | ||
33 | |||
34 | #endif /* __ASM_BREAK_H */ | ||
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h deleted file mode 100644 index 7eb63de808bc..000000000000 --- a/include/asm-mips/bug.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | #ifndef __ASM_BUG_H | ||
2 | #define __ASM_BUG_H | ||
3 | |||
4 | #include <asm/sgidefs.h> | ||
5 | |||
6 | #ifdef CONFIG_BUG | ||
7 | |||
8 | #include <asm/break.h> | ||
9 | |||
10 | #define BUG() \ | ||
11 | do { \ | ||
12 | __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); \ | ||
13 | } while (0) | ||
14 | |||
15 | #define HAVE_ARCH_BUG | ||
16 | |||
17 | #if (_MIPS_ISA > _MIPS_ISA_MIPS1) | ||
18 | |||
19 | #define BUG_ON(condition) \ | ||
20 | do { \ | ||
21 | __asm__ __volatile__("tne $0, %0, %1" \ | ||
22 | : : "r" (condition), "i" (BRK_BUG)); \ | ||
23 | } while (0) | ||
24 | |||
25 | #define HAVE_ARCH_BUG_ON | ||
26 | |||
27 | #endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */ | ||
28 | |||
29 | #endif | ||
30 | |||
31 | #include <asm-generic/bug.h> | ||
32 | |||
33 | #endif /* __ASM_BUG_H */ | ||
diff --git a/include/asm-mips/bugs.h b/include/asm-mips/bugs.h deleted file mode 100644 index 9dc10df32078..000000000000 --- a/include/asm-mips/bugs.h +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /* | ||
2 | * This is included by init/main.c to check for architecture-dependent bugs. | ||
3 | * | ||
4 | * Copyright (C) 2007 Maciej W. Rozycki | ||
5 | * | ||
6 | * Needs: | ||
7 | * void check_bugs(void); | ||
8 | */ | ||
9 | #ifndef _ASM_BUGS_H | ||
10 | #define _ASM_BUGS_H | ||
11 | |||
12 | #include <linux/bug.h> | ||
13 | #include <linux/delay.h> | ||
14 | |||
15 | #include <asm/cpu.h> | ||
16 | #include <asm/cpu-info.h> | ||
17 | |||
18 | extern int daddiu_bug; | ||
19 | |||
20 | extern void check_bugs64_early(void); | ||
21 | |||
22 | extern void check_bugs32(void); | ||
23 | extern void check_bugs64(void); | ||
24 | |||
25 | static inline void check_bugs_early(void) | ||
26 | { | ||
27 | #ifdef CONFIG_64BIT | ||
28 | check_bugs64_early(); | ||
29 | #endif | ||
30 | } | ||
31 | |||
32 | static inline void check_bugs(void) | ||
33 | { | ||
34 | unsigned int cpu = smp_processor_id(); | ||
35 | |||
36 | cpu_data[cpu].udelay_val = loops_per_jiffy; | ||
37 | check_bugs32(); | ||
38 | #ifdef CONFIG_64BIT | ||
39 | check_bugs64(); | ||
40 | #endif | ||
41 | } | ||
42 | |||
43 | static inline int r4k_daddiu_bug(void) | ||
44 | { | ||
45 | #ifdef CONFIG_64BIT | ||
46 | WARN_ON(daddiu_bug < 0); | ||
47 | return daddiu_bug != 0; | ||
48 | #else | ||
49 | return 0; | ||
50 | #endif | ||
51 | } | ||
52 | |||
53 | #endif /* _ASM_BUGS_H */ | ||
diff --git a/include/asm-mips/byteorder.h b/include/asm-mips/byteorder.h deleted file mode 100644 index fe7dc2d59b69..000000000000 --- a/include/asm-mips/byteorder.h +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 99, 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_BYTEORDER_H | ||
9 | #define _ASM_BYTEORDER_H | ||
10 | |||
11 | #include <linux/compiler.h> | ||
12 | #include <asm/types.h> | ||
13 | |||
14 | #ifdef __GNUC__ | ||
15 | |||
16 | #ifdef CONFIG_CPU_MIPSR2 | ||
17 | |||
18 | static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x) | ||
19 | { | ||
20 | __asm__( | ||
21 | " wsbh %0, %1 \n" | ||
22 | : "=r" (x) | ||
23 | : "r" (x)); | ||
24 | |||
25 | return x; | ||
26 | } | ||
27 | #define __arch__swab16(x) ___arch__swab16(x) | ||
28 | |||
29 | static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) | ||
30 | { | ||
31 | __asm__( | ||
32 | " wsbh %0, %1 \n" | ||
33 | " rotr %0, %0, 16 \n" | ||
34 | : "=r" (x) | ||
35 | : "r" (x)); | ||
36 | |||
37 | return x; | ||
38 | } | ||
39 | #define __arch__swab32(x) ___arch__swab32(x) | ||
40 | |||
41 | #ifdef CONFIG_CPU_MIPS64_R2 | ||
42 | |||
43 | static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x) | ||
44 | { | ||
45 | __asm__( | ||
46 | " dsbh %0, %1 \n" | ||
47 | " dshd %0, %0 \n" | ||
48 | " drotr %0, %0, 32 \n" | ||
49 | : "=r" (x) | ||
50 | : "r" (x)); | ||
51 | |||
52 | return x; | ||
53 | } | ||
54 | |||
55 | #define __arch__swab64(x) ___arch__swab64(x) | ||
56 | |||
57 | #endif /* CONFIG_CPU_MIPS64_R2 */ | ||
58 | |||
59 | #endif /* CONFIG_CPU_MIPSR2 */ | ||
60 | |||
61 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
62 | # define __BYTEORDER_HAS_U64__ | ||
63 | # define __SWAB_64_THRU_32__ | ||
64 | #endif | ||
65 | |||
66 | #endif /* __GNUC__ */ | ||
67 | |||
68 | #if defined(__MIPSEB__) | ||
69 | # include <linux/byteorder/big_endian.h> | ||
70 | #elif defined(__MIPSEL__) | ||
71 | # include <linux/byteorder/little_endian.h> | ||
72 | #else | ||
73 | # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" | ||
74 | #endif | ||
75 | |||
76 | #endif /* _ASM_BYTEORDER_H */ | ||
diff --git a/include/asm-mips/cache.h b/include/asm-mips/cache.h deleted file mode 100644 index 37f175c42bb5..000000000000 --- a/include/asm-mips/cache.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1997, 98, 99, 2000, 2003 Ralf Baechle | ||
7 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_CACHE_H | ||
10 | #define _ASM_CACHE_H | ||
11 | |||
12 | #include <kmalloc.h> | ||
13 | |||
14 | #define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT | ||
15 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | ||
16 | |||
17 | #define SMP_CACHE_SHIFT L1_CACHE_SHIFT | ||
18 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | ||
19 | |||
20 | #endif /* _ASM_CACHE_H */ | ||
diff --git a/include/asm-mips/cachectl.h b/include/asm-mips/cachectl.h deleted file mode 100644 index f3ce721861d3..000000000000 --- a/include/asm-mips/cachectl.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 1995, 1996 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_CACHECTL | ||
9 | #define _ASM_CACHECTL | ||
10 | |||
11 | /* | ||
12 | * Options for cacheflush system call | ||
13 | */ | ||
14 | #define ICACHE (1<<0) /* flush instruction cache */ | ||
15 | #define DCACHE (1<<1) /* writeback and flush data cache */ | ||
16 | #define BCACHE (ICACHE|DCACHE) /* flush both caches */ | ||
17 | |||
18 | /* | ||
19 | * Caching modes for the cachectl(2) call | ||
20 | * | ||
21 | * cachectl(2) is currently not supported and returns ENOSYS. | ||
22 | */ | ||
23 | #define CACHEABLE 0 /* make pages cacheable */ | ||
24 | #define UNCACHEABLE 1 /* make pages uncacheable */ | ||
25 | |||
26 | #endif /* _ASM_CACHECTL */ | ||
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h deleted file mode 100644 index 03b1d69b142f..000000000000 --- a/include/asm-mips/cacheflush.h +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02, 03 by Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_CACHEFLUSH_H | ||
10 | #define _ASM_CACHEFLUSH_H | ||
11 | |||
12 | /* Keep includes the same across arches. */ | ||
13 | #include <linux/mm.h> | ||
14 | #include <asm/cpu-features.h> | ||
15 | |||
16 | /* Cache flushing: | ||
17 | * | ||
18 | * - flush_cache_all() flushes entire cache | ||
19 | * - flush_cache_mm(mm) flushes the specified mm context's cache lines | ||
20 | * - flush_cache_dup mm(mm) handles cache flushing when forking | ||
21 | * - flush_cache_page(mm, vmaddr, pfn) flushes a single page | ||
22 | * - flush_cache_range(vma, start, end) flushes a range of pages | ||
23 | * - flush_icache_range(start, end) flush a range of instructions | ||
24 | * - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache | ||
25 | * | ||
26 | * MIPS specific flush operations: | ||
27 | * | ||
28 | * - flush_cache_sigtramp() flush signal trampoline | ||
29 | * - flush_icache_all() flush the entire instruction cache | ||
30 | * - flush_data_cache_page() flushes a page from the data cache | ||
31 | */ | ||
32 | extern void (*flush_cache_all)(void); | ||
33 | extern void (*__flush_cache_all)(void); | ||
34 | extern void (*flush_cache_mm)(struct mm_struct *mm); | ||
35 | #define flush_cache_dup_mm(mm) do { (void) (mm); } while (0) | ||
36 | extern void (*flush_cache_range)(struct vm_area_struct *vma, | ||
37 | unsigned long start, unsigned long end); | ||
38 | extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn); | ||
39 | extern void __flush_dcache_page(struct page *page); | ||
40 | |||
41 | static inline void flush_dcache_page(struct page *page) | ||
42 | { | ||
43 | if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc) | ||
44 | __flush_dcache_page(page); | ||
45 | |||
46 | } | ||
47 | |||
48 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | ||
49 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | ||
50 | |||
51 | #define ARCH_HAS_FLUSH_ANON_PAGE | ||
52 | extern void __flush_anon_page(struct page *, unsigned long); | ||
53 | static inline void flush_anon_page(struct vm_area_struct *vma, | ||
54 | struct page *page, unsigned long vmaddr) | ||
55 | { | ||
56 | if (cpu_has_dc_aliases && PageAnon(page)) | ||
57 | __flush_anon_page(page, vmaddr); | ||
58 | } | ||
59 | |||
60 | static inline void flush_icache_page(struct vm_area_struct *vma, | ||
61 | struct page *page) | ||
62 | { | ||
63 | } | ||
64 | |||
65 | extern void (*flush_icache_range)(unsigned long start, unsigned long end); | ||
66 | extern void (*local_flush_icache_range)(unsigned long start, unsigned long end); | ||
67 | |||
68 | extern void (*__flush_cache_vmap)(void); | ||
69 | |||
70 | static inline void flush_cache_vmap(unsigned long start, unsigned long end) | ||
71 | { | ||
72 | if (cpu_has_dc_aliases) | ||
73 | __flush_cache_vmap(); | ||
74 | } | ||
75 | |||
76 | extern void (*__flush_cache_vunmap)(void); | ||
77 | |||
78 | static inline void flush_cache_vunmap(unsigned long start, unsigned long end) | ||
79 | { | ||
80 | if (cpu_has_dc_aliases) | ||
81 | __flush_cache_vunmap(); | ||
82 | } | ||
83 | |||
84 | extern void copy_to_user_page(struct vm_area_struct *vma, | ||
85 | struct page *page, unsigned long vaddr, void *dst, const void *src, | ||
86 | unsigned long len); | ||
87 | |||
88 | extern void copy_from_user_page(struct vm_area_struct *vma, | ||
89 | struct page *page, unsigned long vaddr, void *dst, const void *src, | ||
90 | unsigned long len); | ||
91 | |||
92 | extern void (*flush_cache_sigtramp)(unsigned long addr); | ||
93 | extern void (*flush_icache_all)(void); | ||
94 | extern void (*local_flush_data_cache_page)(void * addr); | ||
95 | extern void (*flush_data_cache_page)(unsigned long addr); | ||
96 | |||
97 | /* | ||
98 | * This flag is used to indicate that the page pointed to by a pte | ||
99 | * is dirty and requires cleaning before returning it to the user. | ||
100 | */ | ||
101 | #define PG_dcache_dirty PG_arch_1 | ||
102 | |||
103 | #define Page_dcache_dirty(page) \ | ||
104 | test_bit(PG_dcache_dirty, &(page)->flags) | ||
105 | #define SetPageDcacheDirty(page) \ | ||
106 | set_bit(PG_dcache_dirty, &(page)->flags) | ||
107 | #define ClearPageDcacheDirty(page) \ | ||
108 | clear_bit(PG_dcache_dirty, &(page)->flags) | ||
109 | |||
110 | /* Run kernel code uncached, useful for cache probing functions. */ | ||
111 | unsigned long run_uncached(void *func); | ||
112 | |||
113 | extern void *kmap_coherent(struct page *page, unsigned long addr); | ||
114 | extern void kunmap_coherent(void); | ||
115 | |||
116 | #endif /* _ASM_CACHEFLUSH_H */ | ||
diff --git a/include/asm-mips/cacheops.h b/include/asm-mips/cacheops.h deleted file mode 100644 index 256ad2cc6eb8..000000000000 --- a/include/asm-mips/cacheops.h +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /* | ||
2 | * Cache operations for the cache instruction. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * (C) Copyright 1996, 97, 99, 2002, 03 Ralf Baechle | ||
9 | * (C) Copyright 1999 Silicon Graphics, Inc. | ||
10 | */ | ||
11 | #ifndef __ASM_CACHEOPS_H | ||
12 | #define __ASM_CACHEOPS_H | ||
13 | |||
14 | /* | ||
15 | * Cache Operations available on all MIPS processors with R4000-style caches | ||
16 | */ | ||
17 | #define Index_Invalidate_I 0x00 | ||
18 | #define Index_Writeback_Inv_D 0x01 | ||
19 | #define Index_Load_Tag_I 0x04 | ||
20 | #define Index_Load_Tag_D 0x05 | ||
21 | #define Index_Store_Tag_I 0x08 | ||
22 | #define Index_Store_Tag_D 0x09 | ||
23 | #if defined(CONFIG_CPU_LOONGSON2) | ||
24 | #define Hit_Invalidate_I 0x00 | ||
25 | #else | ||
26 | #define Hit_Invalidate_I 0x10 | ||
27 | #endif | ||
28 | #define Hit_Invalidate_D 0x11 | ||
29 | #define Hit_Writeback_Inv_D 0x15 | ||
30 | |||
31 | /* | ||
32 | * R4000-specific cacheops | ||
33 | */ | ||
34 | #define Create_Dirty_Excl_D 0x0d | ||
35 | #define Fill 0x14 | ||
36 | #define Hit_Writeback_I 0x18 | ||
37 | #define Hit_Writeback_D 0x19 | ||
38 | |||
39 | /* | ||
40 | * R4000SC and R4400SC-specific cacheops | ||
41 | */ | ||
42 | #define Index_Invalidate_SI 0x02 | ||
43 | #define Index_Writeback_Inv_SD 0x03 | ||
44 | #define Index_Load_Tag_SI 0x06 | ||
45 | #define Index_Load_Tag_SD 0x07 | ||
46 | #define Index_Store_Tag_SI 0x0A | ||
47 | #define Index_Store_Tag_SD 0x0B | ||
48 | #define Create_Dirty_Excl_SD 0x0f | ||
49 | #define Hit_Invalidate_SI 0x12 | ||
50 | #define Hit_Invalidate_SD 0x13 | ||
51 | #define Hit_Writeback_Inv_SD 0x17 | ||
52 | #define Hit_Writeback_SD 0x1b | ||
53 | #define Hit_Set_Virtual_SI 0x1e | ||
54 | #define Hit_Set_Virtual_SD 0x1f | ||
55 | |||
56 | /* | ||
57 | * R5000-specific cacheops | ||
58 | */ | ||
59 | #define R5K_Page_Invalidate_S 0x17 | ||
60 | |||
61 | /* | ||
62 | * RM7000-specific cacheops | ||
63 | */ | ||
64 | #define Page_Invalidate_T 0x16 | ||
65 | |||
66 | /* | ||
67 | * R10000-specific cacheops | ||
68 | * | ||
69 | * Cacheops 0x02, 0x06, 0x0a, 0x0c-0x0e, 0x16, 0x1a and 0x1e are unused. | ||
70 | * Most of the _S cacheops are identical to the R4000SC _SD cacheops. | ||
71 | */ | ||
72 | #define Index_Writeback_Inv_S 0x03 | ||
73 | #define Index_Load_Tag_S 0x07 | ||
74 | #define Index_Store_Tag_S 0x0B | ||
75 | #define Hit_Invalidate_S 0x13 | ||
76 | #define Cache_Barrier 0x14 | ||
77 | #define Hit_Writeback_Inv_S 0x17 | ||
78 | #define Index_Load_Data_I 0x18 | ||
79 | #define Index_Load_Data_D 0x19 | ||
80 | #define Index_Load_Data_S 0x1b | ||
81 | #define Index_Store_Data_I 0x1c | ||
82 | #define Index_Store_Data_D 0x1d | ||
83 | #define Index_Store_Data_S 0x1f | ||
84 | |||
85 | #endif /* __ASM_CACHEOPS_H */ | ||
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h deleted file mode 100644 index 290485ac5407..000000000000 --- a/include/asm-mips/checksum.h +++ /dev/null | |||
@@ -1,260 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 96, 97, 98, 99, 2001 by Ralf Baechle | ||
7 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
8 | * Copyright (C) 2001 Thiemo Seufer. | ||
9 | * Copyright (C) 2002 Maciej W. Rozycki | ||
10 | */ | ||
11 | #ifndef _ASM_CHECKSUM_H | ||
12 | #define _ASM_CHECKSUM_H | ||
13 | |||
14 | #include <linux/in6.h> | ||
15 | |||
16 | #include <asm/uaccess.h> | ||
17 | |||
18 | /* | ||
19 | * computes the checksum of a memory block at buff, length len, | ||
20 | * and adds in "sum" (32-bit) | ||
21 | * | ||
22 | * returns a 32-bit number suitable for feeding into itself | ||
23 | * or csum_tcpudp_magic | ||
24 | * | ||
25 | * this function must be called with even lengths, except | ||
26 | * for the last fragment, which may be odd | ||
27 | * | ||
28 | * it's best to have buff aligned on a 32-bit boundary | ||
29 | */ | ||
30 | __wsum csum_partial(const void *buff, int len, __wsum sum); | ||
31 | |||
32 | __wsum __csum_partial_copy_user(const void *src, void *dst, | ||
33 | int len, __wsum sum, int *err_ptr); | ||
34 | |||
35 | /* | ||
36 | * this is a new version of the above that records errors it finds in *errp, | ||
37 | * but continues and zeros the rest of the buffer. | ||
38 | */ | ||
39 | static inline | ||
40 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len, | ||
41 | __wsum sum, int *err_ptr) | ||
42 | { | ||
43 | might_sleep(); | ||
44 | return __csum_partial_copy_user((__force void *)src, dst, | ||
45 | len, sum, err_ptr); | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | * Copy and checksum to user | ||
50 | */ | ||
51 | #define HAVE_CSUM_COPY_USER | ||
52 | static inline | ||
53 | __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len, | ||
54 | __wsum sum, int *err_ptr) | ||
55 | { | ||
56 | might_sleep(); | ||
57 | if (access_ok(VERIFY_WRITE, dst, len)) | ||
58 | return __csum_partial_copy_user(src, (__force void *)dst, | ||
59 | len, sum, err_ptr); | ||
60 | if (len) | ||
61 | *err_ptr = -EFAULT; | ||
62 | |||
63 | return (__force __wsum)-1; /* invalid checksum */ | ||
64 | } | ||
65 | |||
66 | /* | ||
67 | * the same as csum_partial, but copies from user space (but on MIPS | ||
68 | * we have just one address space, so this is identical to the above) | ||
69 | */ | ||
70 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, | ||
71 | int len, __wsum sum); | ||
72 | |||
73 | /* | ||
74 | * Fold a partial checksum without adding pseudo headers | ||
75 | */ | ||
76 | static inline __sum16 csum_fold(__wsum sum) | ||
77 | { | ||
78 | __asm__( | ||
79 | " .set push # csum_fold\n" | ||
80 | " .set noat \n" | ||
81 | " sll $1, %0, 16 \n" | ||
82 | " addu %0, $1 \n" | ||
83 | " sltu $1, %0, $1 \n" | ||
84 | " srl %0, %0, 16 \n" | ||
85 | " addu %0, $1 \n" | ||
86 | " xori %0, 0xffff \n" | ||
87 | " .set pop" | ||
88 | : "=r" (sum) | ||
89 | : "0" (sum)); | ||
90 | |||
91 | return (__force __sum16)sum; | ||
92 | } | ||
93 | |||
94 | /* | ||
95 | * This is a version of ip_compute_csum() optimized for IP headers, | ||
96 | * which always checksum on 4 octet boundaries. | ||
97 | * | ||
98 | * By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by | ||
99 | * Arnt Gulbrandsen. | ||
100 | */ | ||
101 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) | ||
102 | { | ||
103 | const unsigned int *word = iph; | ||
104 | const unsigned int *stop = word + ihl; | ||
105 | unsigned int csum; | ||
106 | int carry; | ||
107 | |||
108 | csum = word[0]; | ||
109 | csum += word[1]; | ||
110 | carry = (csum < word[1]); | ||
111 | csum += carry; | ||
112 | |||
113 | csum += word[2]; | ||
114 | carry = (csum < word[2]); | ||
115 | csum += carry; | ||
116 | |||
117 | csum += word[3]; | ||
118 | carry = (csum < word[3]); | ||
119 | csum += carry; | ||
120 | |||
121 | word += 4; | ||
122 | do { | ||
123 | csum += *word; | ||
124 | carry = (csum < *word); | ||
125 | csum += carry; | ||
126 | word++; | ||
127 | } while (word != stop); | ||
128 | |||
129 | return csum_fold(csum); | ||
130 | } | ||
131 | |||
132 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, | ||
133 | __be32 daddr, unsigned short len, unsigned short proto, | ||
134 | __wsum sum) | ||
135 | { | ||
136 | __asm__( | ||
137 | " .set push # csum_tcpudp_nofold\n" | ||
138 | " .set noat \n" | ||
139 | #ifdef CONFIG_32BIT | ||
140 | " addu %0, %2 \n" | ||
141 | " sltu $1, %0, %2 \n" | ||
142 | " addu %0, $1 \n" | ||
143 | |||
144 | " addu %0, %3 \n" | ||
145 | " sltu $1, %0, %3 \n" | ||
146 | " addu %0, $1 \n" | ||
147 | |||
148 | " addu %0, %4 \n" | ||
149 | " sltu $1, %0, %4 \n" | ||
150 | " addu %0, $1 \n" | ||
151 | #endif | ||
152 | #ifdef CONFIG_64BIT | ||
153 | " daddu %0, %2 \n" | ||
154 | " daddu %0, %3 \n" | ||
155 | " daddu %0, %4 \n" | ||
156 | " dsll32 $1, %0, 0 \n" | ||
157 | " daddu %0, $1 \n" | ||
158 | " dsra32 %0, %0, 0 \n" | ||
159 | #endif | ||
160 | " .set pop" | ||
161 | : "=r" (sum) | ||
162 | : "0" ((__force unsigned long)daddr), | ||
163 | "r" ((__force unsigned long)saddr), | ||
164 | #ifdef __MIPSEL__ | ||
165 | "r" ((proto + len) << 8), | ||
166 | #else | ||
167 | "r" (proto + len), | ||
168 | #endif | ||
169 | "r" ((__force unsigned long)sum)); | ||
170 | |||
171 | return sum; | ||
172 | } | ||
173 | |||
174 | /* | ||
175 | * computes the checksum of the TCP/UDP pseudo-header | ||
176 | * returns a 16-bit checksum, already complemented | ||
177 | */ | ||
178 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, | ||
179 | unsigned short len, | ||
180 | unsigned short proto, | ||
181 | __wsum sum) | ||
182 | { | ||
183 | return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); | ||
184 | } | ||
185 | |||
186 | /* | ||
187 | * this routine is used for miscellaneous IP-like checksums, mainly | ||
188 | * in icmp.c | ||
189 | */ | ||
190 | static inline __sum16 ip_compute_csum(const void *buff, int len) | ||
191 | { | ||
192 | return csum_fold(csum_partial(buff, len, 0)); | ||
193 | } | ||
194 | |||
195 | #define _HAVE_ARCH_IPV6_CSUM | ||
196 | static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | ||
197 | const struct in6_addr *daddr, | ||
198 | __u32 len, unsigned short proto, | ||
199 | __wsum sum) | ||
200 | { | ||
201 | __asm__( | ||
202 | " .set push # csum_ipv6_magic\n" | ||
203 | " .set noreorder \n" | ||
204 | " .set noat \n" | ||
205 | " addu %0, %5 # proto (long in network byte order)\n" | ||
206 | " sltu $1, %0, %5 \n" | ||
207 | " addu %0, $1 \n" | ||
208 | |||
209 | " addu %0, %6 # csum\n" | ||
210 | " sltu $1, %0, %6 \n" | ||
211 | " lw %1, 0(%2) # four words source address\n" | ||
212 | " addu %0, $1 \n" | ||
213 | " addu %0, %1 \n" | ||
214 | " sltu $1, %0, %1 \n" | ||
215 | |||
216 | " lw %1, 4(%2) \n" | ||
217 | " addu %0, $1 \n" | ||
218 | " addu %0, %1 \n" | ||
219 | " sltu $1, %0, %1 \n" | ||
220 | |||
221 | " lw %1, 8(%2) \n" | ||
222 | " addu %0, $1 \n" | ||
223 | " addu %0, %1 \n" | ||
224 | " sltu $1, %0, %1 \n" | ||
225 | |||
226 | " lw %1, 12(%2) \n" | ||
227 | " addu %0, $1 \n" | ||
228 | " addu %0, %1 \n" | ||
229 | " sltu $1, %0, %1 \n" | ||
230 | |||
231 | " lw %1, 0(%3) \n" | ||
232 | " addu %0, $1 \n" | ||
233 | " addu %0, %1 \n" | ||
234 | " sltu $1, %0, %1 \n" | ||
235 | |||
236 | " lw %1, 4(%3) \n" | ||
237 | " addu %0, $1 \n" | ||
238 | " addu %0, %1 \n" | ||
239 | " sltu $1, %0, %1 \n" | ||
240 | |||
241 | " lw %1, 8(%3) \n" | ||
242 | " addu %0, $1 \n" | ||
243 | " addu %0, %1 \n" | ||
244 | " sltu $1, %0, %1 \n" | ||
245 | |||
246 | " lw %1, 12(%3) \n" | ||
247 | " addu %0, $1 \n" | ||
248 | " addu %0, %1 \n" | ||
249 | " sltu $1, %0, %1 \n" | ||
250 | |||
251 | " addu %0, $1 # Add final carry\n" | ||
252 | " .set pop" | ||
253 | : "=r" (sum), "=r" (proto) | ||
254 | : "r" (saddr), "r" (daddr), | ||
255 | "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); | ||
256 | |||
257 | return csum_fold(sum); | ||
258 | } | ||
259 | |||
260 | #endif /* _ASM_CHECKSUM_H */ | ||
diff --git a/include/asm-mips/cmp.h b/include/asm-mips/cmp.h deleted file mode 100644 index 89a73fb93ae6..000000000000 --- a/include/asm-mips/cmp.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | #ifndef _ASM_CMP_H | ||
2 | #define _ASM_CMP_H | ||
3 | |||
4 | /* | ||
5 | * Definitions for CMP multitasking on MIPS cores | ||
6 | */ | ||
7 | struct task_struct; | ||
8 | |||
9 | extern void cmp_smp_setup(void); | ||
10 | extern void cmp_smp_finish(void); | ||
11 | extern void cmp_boot_secondary(int cpu, struct task_struct *t); | ||
12 | extern void cmp_init_secondary(void); | ||
13 | extern void cmp_cpus_done(void); | ||
14 | extern void cmp_prepare_cpus(unsigned int max_cpus); | ||
15 | |||
16 | /* This is platform specific */ | ||
17 | extern void cmp_send_ipi(int cpu, unsigned int action); | ||
18 | #endif /* _ASM_CMP_H */ | ||
diff --git a/include/asm-mips/cmpxchg.h b/include/asm-mips/cmpxchg.h deleted file mode 100644 index 4a812c3ceb90..000000000000 --- a/include/asm-mips/cmpxchg.h +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 06, 07 by Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #ifndef __ASM_CMPXCHG_H | ||
9 | #define __ASM_CMPXCHG_H | ||
10 | |||
11 | #include <linux/irqflags.h> | ||
12 | |||
13 | #define __HAVE_ARCH_CMPXCHG 1 | ||
14 | |||
15 | #define __cmpxchg_asm(ld, st, m, old, new) \ | ||
16 | ({ \ | ||
17 | __typeof(*(m)) __ret; \ | ||
18 | \ | ||
19 | if (cpu_has_llsc && R10000_LLSC_WAR) { \ | ||
20 | __asm__ __volatile__( \ | ||
21 | " .set push \n" \ | ||
22 | " .set noat \n" \ | ||
23 | " .set mips3 \n" \ | ||
24 | "1: " ld " %0, %2 # __cmpxchg_asm \n" \ | ||
25 | " bne %0, %z3, 2f \n" \ | ||
26 | " .set mips0 \n" \ | ||
27 | " move $1, %z4 \n" \ | ||
28 | " .set mips3 \n" \ | ||
29 | " " st " $1, %1 \n" \ | ||
30 | " beqzl $1, 1b \n" \ | ||
31 | "2: \n" \ | ||
32 | " .set pop \n" \ | ||
33 | : "=&r" (__ret), "=R" (*m) \ | ||
34 | : "R" (*m), "Jr" (old), "Jr" (new) \ | ||
35 | : "memory"); \ | ||
36 | } else if (cpu_has_llsc) { \ | ||
37 | __asm__ __volatile__( \ | ||
38 | " .set push \n" \ | ||
39 | " .set noat \n" \ | ||
40 | " .set mips3 \n" \ | ||
41 | "1: " ld " %0, %2 # __cmpxchg_asm \n" \ | ||
42 | " bne %0, %z3, 2f \n" \ | ||
43 | " .set mips0 \n" \ | ||
44 | " move $1, %z4 \n" \ | ||
45 | " .set mips3 \n" \ | ||
46 | " " st " $1, %1 \n" \ | ||
47 | " beqz $1, 3f \n" \ | ||
48 | "2: \n" \ | ||
49 | " .subsection 2 \n" \ | ||
50 | "3: b 1b \n" \ | ||
51 | " .previous \n" \ | ||
52 | " .set pop \n" \ | ||
53 | : "=&r" (__ret), "=R" (*m) \ | ||
54 | : "R" (*m), "Jr" (old), "Jr" (new) \ | ||
55 | : "memory"); \ | ||
56 | } else { \ | ||
57 | unsigned long __flags; \ | ||
58 | \ | ||
59 | raw_local_irq_save(__flags); \ | ||
60 | __ret = *m; \ | ||
61 | if (__ret == old) \ | ||
62 | *m = new; \ | ||
63 | raw_local_irq_restore(__flags); \ | ||
64 | } \ | ||
65 | \ | ||
66 | __ret; \ | ||
67 | }) | ||
68 | |||
69 | /* | ||
70 | * This function doesn't exist, so you'll get a linker error | ||
71 | * if something tries to do an invalid cmpxchg(). | ||
72 | */ | ||
73 | extern void __cmpxchg_called_with_bad_pointer(void); | ||
74 | |||
75 | #define __cmpxchg(ptr, old, new, barrier) \ | ||
76 | ({ \ | ||
77 | __typeof__(ptr) __ptr = (ptr); \ | ||
78 | __typeof__(*(ptr)) __old = (old); \ | ||
79 | __typeof__(*(ptr)) __new = (new); \ | ||
80 | __typeof__(*(ptr)) __res = 0; \ | ||
81 | \ | ||
82 | barrier; \ | ||
83 | \ | ||
84 | switch (sizeof(*(__ptr))) { \ | ||
85 | case 4: \ | ||
86 | __res = __cmpxchg_asm("ll", "sc", __ptr, __old, __new); \ | ||
87 | break; \ | ||
88 | case 8: \ | ||
89 | if (sizeof(long) == 8) { \ | ||
90 | __res = __cmpxchg_asm("lld", "scd", __ptr, \ | ||
91 | __old, __new); \ | ||
92 | break; \ | ||
93 | } \ | ||
94 | default: \ | ||
95 | __cmpxchg_called_with_bad_pointer(); \ | ||
96 | break; \ | ||
97 | } \ | ||
98 | \ | ||
99 | barrier; \ | ||
100 | \ | ||
101 | __res; \ | ||
102 | }) | ||
103 | |||
104 | #define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_llsc_mb()) | ||
105 | #define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, ) | ||
106 | |||
107 | #define cmpxchg64(ptr, o, n) \ | ||
108 | ({ \ | ||
109 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ | ||
110 | cmpxchg((ptr), (o), (n)); \ | ||
111 | }) | ||
112 | |||
113 | #ifdef CONFIG_64BIT | ||
114 | #define cmpxchg64_local(ptr, o, n) \ | ||
115 | ({ \ | ||
116 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ | ||
117 | cmpxchg_local((ptr), (o), (n)); \ | ||
118 | }) | ||
119 | #else | ||
120 | #include <asm-generic/cmpxchg-local.h> | ||
121 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
122 | #endif | ||
123 | |||
124 | #endif /* __ASM_CMPXCHG_H */ | ||
diff --git a/include/asm-mips/compat-signal.h b/include/asm-mips/compat-signal.h deleted file mode 100644 index 368a99e5c3e1..000000000000 --- a/include/asm-mips/compat-signal.h +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | #ifndef __ASM_COMPAT_SIGNAL_H | ||
2 | #define __ASM_COMPAT_SIGNAL_H | ||
3 | |||
4 | #include <linux/bug.h> | ||
5 | #include <linux/compat.h> | ||
6 | #include <linux/compiler.h> | ||
7 | |||
8 | #include <asm/signal.h> | ||
9 | #include <asm/siginfo.h> | ||
10 | |||
11 | #include <asm/uaccess.h> | ||
12 | |||
13 | #define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) | ||
14 | |||
15 | typedef struct compat_siginfo { | ||
16 | int si_signo; | ||
17 | int si_code; | ||
18 | int si_errno; | ||
19 | |||
20 | union { | ||
21 | int _pad[SI_PAD_SIZE32]; | ||
22 | |||
23 | /* kill() */ | ||
24 | struct { | ||
25 | compat_pid_t _pid; /* sender's pid */ | ||
26 | compat_uid_t _uid; /* sender's uid */ | ||
27 | } _kill; | ||
28 | |||
29 | /* SIGCHLD */ | ||
30 | struct { | ||
31 | compat_pid_t _pid; /* which child */ | ||
32 | compat_uid_t _uid; /* sender's uid */ | ||
33 | int _status; /* exit code */ | ||
34 | compat_clock_t _utime; | ||
35 | compat_clock_t _stime; | ||
36 | } _sigchld; | ||
37 | |||
38 | /* IRIX SIGCHLD */ | ||
39 | struct { | ||
40 | compat_pid_t _pid; /* which child */ | ||
41 | compat_clock_t _utime; | ||
42 | int _status; /* exit code */ | ||
43 | compat_clock_t _stime; | ||
44 | } _irix_sigchld; | ||
45 | |||
46 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
47 | struct { | ||
48 | s32 _addr; /* faulting insn/memory ref. */ | ||
49 | } _sigfault; | ||
50 | |||
51 | /* SIGPOLL, SIGXFSZ (To do ...) */ | ||
52 | struct { | ||
53 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
54 | int _fd; | ||
55 | } _sigpoll; | ||
56 | |||
57 | /* POSIX.1b timers */ | ||
58 | struct { | ||
59 | timer_t _tid; /* timer id */ | ||
60 | int _overrun; /* overrun count */ | ||
61 | compat_sigval_t _sigval;/* same as below */ | ||
62 | int _sys_private; /* not to be passed to user */ | ||
63 | } _timer; | ||
64 | |||
65 | /* POSIX.1b signals */ | ||
66 | struct { | ||
67 | compat_pid_t _pid; /* sender's pid */ | ||
68 | compat_uid_t _uid; /* sender's uid */ | ||
69 | compat_sigval_t _sigval; | ||
70 | } _rt; | ||
71 | |||
72 | } _sifields; | ||
73 | } compat_siginfo_t; | ||
74 | |||
75 | static inline int __copy_conv_sigset_to_user(compat_sigset_t __user *d, | ||
76 | const sigset_t *s) | ||
77 | { | ||
78 | int err; | ||
79 | |||
80 | BUG_ON(sizeof(*d) != sizeof(*s)); | ||
81 | BUG_ON(_NSIG_WORDS != 2); | ||
82 | |||
83 | err = __put_user(s->sig[0], &d->sig[0]); | ||
84 | err |= __put_user(s->sig[0] >> 32, &d->sig[1]); | ||
85 | err |= __put_user(s->sig[1], &d->sig[2]); | ||
86 | err |= __put_user(s->sig[1] >> 32, &d->sig[3]); | ||
87 | |||
88 | return err; | ||
89 | } | ||
90 | |||
91 | static inline int __copy_conv_sigset_from_user(sigset_t *d, | ||
92 | const compat_sigset_t __user *s) | ||
93 | { | ||
94 | int err; | ||
95 | union sigset_u { | ||
96 | sigset_t s; | ||
97 | compat_sigset_t c; | ||
98 | } *u = (union sigset_u *) d; | ||
99 | |||
100 | BUG_ON(sizeof(*d) != sizeof(*s)); | ||
101 | BUG_ON(_NSIG_WORDS != 2); | ||
102 | |||
103 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
104 | err = __get_user(u->c.sig[1], &s->sig[0]); | ||
105 | err |= __get_user(u->c.sig[0], &s->sig[1]); | ||
106 | err |= __get_user(u->c.sig[3], &s->sig[2]); | ||
107 | err |= __get_user(u->c.sig[2], &s->sig[3]); | ||
108 | #endif | ||
109 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
110 | err = __get_user(u->c.sig[0], &s->sig[0]); | ||
111 | err |= __get_user(u->c.sig[1], &s->sig[1]); | ||
112 | err |= __get_user(u->c.sig[2], &s->sig[2]); | ||
113 | err |= __get_user(u->c.sig[3], &s->sig[3]); | ||
114 | #endif | ||
115 | |||
116 | return err; | ||
117 | } | ||
118 | |||
119 | #endif /* __ASM_COMPAT_SIGNAL_H */ | ||
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h deleted file mode 100644 index ac5d541368e9..000000000000 --- a/include/asm-mips/compat.h +++ /dev/null | |||
@@ -1,221 +0,0 @@ | |||
1 | #ifndef _ASM_COMPAT_H | ||
2 | #define _ASM_COMPAT_H | ||
3 | /* | ||
4 | * Architecture specific compatibility types | ||
5 | */ | ||
6 | #include <linux/types.h> | ||
7 | #include <asm/page.h> | ||
8 | #include <asm/ptrace.h> | ||
9 | |||
10 | #define COMPAT_USER_HZ 100 | ||
11 | |||
12 | typedef u32 compat_size_t; | ||
13 | typedef s32 compat_ssize_t; | ||
14 | typedef s32 compat_time_t; | ||
15 | typedef s32 compat_clock_t; | ||
16 | typedef s32 compat_suseconds_t; | ||
17 | |||
18 | typedef s32 compat_pid_t; | ||
19 | typedef s32 __compat_uid_t; | ||
20 | typedef s32 __compat_gid_t; | ||
21 | typedef __compat_uid_t __compat_uid32_t; | ||
22 | typedef __compat_gid_t __compat_gid32_t; | ||
23 | typedef u32 compat_mode_t; | ||
24 | typedef u32 compat_ino_t; | ||
25 | typedef u32 compat_dev_t; | ||
26 | typedef s32 compat_off_t; | ||
27 | typedef s64 compat_loff_t; | ||
28 | typedef u32 compat_nlink_t; | ||
29 | typedef s32 compat_ipc_pid_t; | ||
30 | typedef s32 compat_daddr_t; | ||
31 | typedef s32 compat_caddr_t; | ||
32 | typedef struct { | ||
33 | s32 val[2]; | ||
34 | } compat_fsid_t; | ||
35 | typedef s32 compat_timer_t; | ||
36 | typedef s32 compat_key_t; | ||
37 | |||
38 | typedef s32 compat_int_t; | ||
39 | typedef s32 compat_long_t; | ||
40 | typedef s64 compat_s64; | ||
41 | typedef u32 compat_uint_t; | ||
42 | typedef u32 compat_ulong_t; | ||
43 | typedef u64 compat_u64; | ||
44 | |||
45 | struct compat_timespec { | ||
46 | compat_time_t tv_sec; | ||
47 | s32 tv_nsec; | ||
48 | }; | ||
49 | |||
50 | struct compat_timeval { | ||
51 | compat_time_t tv_sec; | ||
52 | s32 tv_usec; | ||
53 | }; | ||
54 | |||
55 | struct compat_stat { | ||
56 | compat_dev_t st_dev; | ||
57 | s32 st_pad1[3]; | ||
58 | compat_ino_t st_ino; | ||
59 | compat_mode_t st_mode; | ||
60 | compat_nlink_t st_nlink; | ||
61 | __compat_uid_t st_uid; | ||
62 | __compat_gid_t st_gid; | ||
63 | compat_dev_t st_rdev; | ||
64 | s32 st_pad2[2]; | ||
65 | compat_off_t st_size; | ||
66 | s32 st_pad3; | ||
67 | compat_time_t st_atime; | ||
68 | s32 st_atime_nsec; | ||
69 | compat_time_t st_mtime; | ||
70 | s32 st_mtime_nsec; | ||
71 | compat_time_t st_ctime; | ||
72 | s32 st_ctime_nsec; | ||
73 | s32 st_blksize; | ||
74 | s32 st_blocks; | ||
75 | s32 st_pad4[14]; | ||
76 | }; | ||
77 | |||
78 | struct compat_flock { | ||
79 | short l_type; | ||
80 | short l_whence; | ||
81 | compat_off_t l_start; | ||
82 | compat_off_t l_len; | ||
83 | s32 l_sysid; | ||
84 | compat_pid_t l_pid; | ||
85 | short __unused; | ||
86 | s32 pad[4]; | ||
87 | }; | ||
88 | |||
89 | #define F_GETLK64 33 | ||
90 | #define F_SETLK64 34 | ||
91 | #define F_SETLKW64 35 | ||
92 | |||
93 | struct compat_flock64 { | ||
94 | short l_type; | ||
95 | short l_whence; | ||
96 | compat_loff_t l_start; | ||
97 | compat_loff_t l_len; | ||
98 | compat_pid_t l_pid; | ||
99 | }; | ||
100 | |||
101 | struct compat_statfs { | ||
102 | int f_type; | ||
103 | int f_bsize; | ||
104 | int f_frsize; | ||
105 | int f_blocks; | ||
106 | int f_bfree; | ||
107 | int f_files; | ||
108 | int f_ffree; | ||
109 | int f_bavail; | ||
110 | compat_fsid_t f_fsid; | ||
111 | int f_namelen; | ||
112 | int f_spare[6]; | ||
113 | }; | ||
114 | |||
115 | #define COMPAT_RLIM_INFINITY 0x7fffffffUL | ||
116 | |||
117 | typedef u32 compat_old_sigset_t; /* at least 32 bits */ | ||
118 | |||
119 | #define _COMPAT_NSIG 128 /* Don't ask !$@#% ... */ | ||
120 | #define _COMPAT_NSIG_BPW 32 | ||
121 | |||
122 | typedef u32 compat_sigset_word; | ||
123 | |||
124 | #define COMPAT_OFF_T_MAX 0x7fffffff | ||
125 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | ||
126 | |||
127 | /* | ||
128 | * A pointer passed in from user mode. This should not | ||
129 | * be used for syscall parameters, just declare them | ||
130 | * as pointers because the syscall entry code will have | ||
131 | * appropriately converted them already. | ||
132 | */ | ||
133 | typedef u32 compat_uptr_t; | ||
134 | |||
135 | static inline void __user *compat_ptr(compat_uptr_t uptr) | ||
136 | { | ||
137 | /* cast to a __user pointer via "unsigned long" makes sparse happy */ | ||
138 | return (void __user *)(unsigned long)(long)uptr; | ||
139 | } | ||
140 | |||
141 | static inline compat_uptr_t ptr_to_compat(void __user *uptr) | ||
142 | { | ||
143 | return (u32)(unsigned long)uptr; | ||
144 | } | ||
145 | |||
146 | static inline void __user *compat_alloc_user_space(long len) | ||
147 | { | ||
148 | struct pt_regs *regs = (struct pt_regs *) | ||
149 | ((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1; | ||
150 | |||
151 | return (void __user *) (regs->regs[29] - len); | ||
152 | } | ||
153 | |||
154 | struct compat_ipc64_perm { | ||
155 | compat_key_t key; | ||
156 | __compat_uid32_t uid; | ||
157 | __compat_gid32_t gid; | ||
158 | __compat_uid32_t cuid; | ||
159 | __compat_gid32_t cgid; | ||
160 | compat_mode_t mode; | ||
161 | unsigned short seq; | ||
162 | unsigned short __pad2; | ||
163 | compat_ulong_t __unused1; | ||
164 | compat_ulong_t __unused2; | ||
165 | }; | ||
166 | |||
167 | struct compat_semid64_ds { | ||
168 | struct compat_ipc64_perm sem_perm; | ||
169 | compat_time_t sem_otime; | ||
170 | compat_time_t sem_ctime; | ||
171 | compat_ulong_t sem_nsems; | ||
172 | compat_ulong_t __unused1; | ||
173 | compat_ulong_t __unused2; | ||
174 | }; | ||
175 | |||
176 | struct compat_msqid64_ds { | ||
177 | struct compat_ipc64_perm msg_perm; | ||
178 | #ifndef CONFIG_CPU_LITTLE_ENDIAN | ||
179 | compat_ulong_t __unused1; | ||
180 | #endif | ||
181 | compat_time_t msg_stime; | ||
182 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
183 | compat_ulong_t __unused1; | ||
184 | #endif | ||
185 | #ifndef CONFIG_CPU_LITTLE_ENDIAN | ||
186 | compat_ulong_t __unused2; | ||
187 | #endif | ||
188 | compat_time_t msg_rtime; | ||
189 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
190 | compat_ulong_t __unused2; | ||
191 | #endif | ||
192 | #ifndef CONFIG_CPU_LITTLE_ENDIAN | ||
193 | compat_ulong_t __unused3; | ||
194 | #endif | ||
195 | compat_time_t msg_ctime; | ||
196 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
197 | compat_ulong_t __unused3; | ||
198 | #endif | ||
199 | compat_ulong_t msg_cbytes; | ||
200 | compat_ulong_t msg_qnum; | ||
201 | compat_ulong_t msg_qbytes; | ||
202 | compat_pid_t msg_lspid; | ||
203 | compat_pid_t msg_lrpid; | ||
204 | compat_ulong_t __unused4; | ||
205 | compat_ulong_t __unused5; | ||
206 | }; | ||
207 | |||
208 | struct compat_shmid64_ds { | ||
209 | struct compat_ipc64_perm shm_perm; | ||
210 | compat_size_t shm_segsz; | ||
211 | compat_time_t shm_atime; | ||
212 | compat_time_t shm_dtime; | ||
213 | compat_time_t shm_ctime; | ||
214 | compat_pid_t shm_cpid; | ||
215 | compat_pid_t shm_lpid; | ||
216 | compat_ulong_t shm_nattch; | ||
217 | compat_ulong_t __unused1; | ||
218 | compat_ulong_t __unused2; | ||
219 | }; | ||
220 | |||
221 | #endif /* _ASM_COMPAT_H */ | ||
diff --git a/include/asm-mips/compiler.h b/include/asm-mips/compiler.h deleted file mode 100644 index 71f5c5cfc58a..000000000000 --- a/include/asm-mips/compiler.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004, 2007 Maciej W. Rozycki | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | */ | ||
8 | #ifndef _ASM_COMPILER_H | ||
9 | #define _ASM_COMPILER_H | ||
10 | |||
11 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) | ||
12 | #define GCC_IMM_ASM() "n" | ||
13 | #define GCC_REG_ACCUM "$0" | ||
14 | #else | ||
15 | #define GCC_IMM_ASM() "rn" | ||
16 | #define GCC_REG_ACCUM "accum" | ||
17 | #endif | ||
18 | |||
19 | #endif /* _ASM_COMPILER_H */ | ||
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h deleted file mode 100644 index 5ea701fc3425..000000000000 --- a/include/asm-mips/cpu-features.h +++ /dev/null | |||
@@ -1,219 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 2004 Ralf Baechle | ||
7 | * Copyright (C) 2004 Maciej W. Rozycki | ||
8 | */ | ||
9 | #ifndef __ASM_CPU_FEATURES_H | ||
10 | #define __ASM_CPU_FEATURES_H | ||
11 | |||
12 | #include <asm/cpu.h> | ||
13 | #include <asm/cpu-info.h> | ||
14 | #include <cpu-feature-overrides.h> | ||
15 | |||
16 | #ifndef current_cpu_type | ||
17 | #define current_cpu_type() current_cpu_data.cputype | ||
18 | #endif | ||
19 | |||
20 | /* | ||
21 | * SMP assumption: Options of CPU 0 are a superset of all processors. | ||
22 | * This is true for all known MIPS systems. | ||
23 | */ | ||
24 | #ifndef cpu_has_tlb | ||
25 | #define cpu_has_tlb (cpu_data[0].options & MIPS_CPU_TLB) | ||
26 | #endif | ||
27 | #ifndef cpu_has_4kex | ||
28 | #define cpu_has_4kex (cpu_data[0].options & MIPS_CPU_4KEX) | ||
29 | #endif | ||
30 | #ifndef cpu_has_3k_cache | ||
31 | #define cpu_has_3k_cache (cpu_data[0].options & MIPS_CPU_3K_CACHE) | ||
32 | #endif | ||
33 | #define cpu_has_6k_cache 0 | ||
34 | #define cpu_has_8k_cache 0 | ||
35 | #ifndef cpu_has_4k_cache | ||
36 | #define cpu_has_4k_cache (cpu_data[0].options & MIPS_CPU_4K_CACHE) | ||
37 | #endif | ||
38 | #ifndef cpu_has_tx39_cache | ||
39 | #define cpu_has_tx39_cache (cpu_data[0].options & MIPS_CPU_TX39_CACHE) | ||
40 | #endif | ||
41 | #ifndef cpu_has_fpu | ||
42 | #define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) | ||
43 | #define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU) | ||
44 | #else | ||
45 | #define raw_cpu_has_fpu cpu_has_fpu | ||
46 | #endif | ||
47 | #ifndef cpu_has_32fpr | ||
48 | #define cpu_has_32fpr (cpu_data[0].options & MIPS_CPU_32FPR) | ||
49 | #endif | ||
50 | #ifndef cpu_has_counter | ||
51 | #define cpu_has_counter (cpu_data[0].options & MIPS_CPU_COUNTER) | ||
52 | #endif | ||
53 | #ifndef cpu_has_watch | ||
54 | #define cpu_has_watch (cpu_data[0].options & MIPS_CPU_WATCH) | ||
55 | #endif | ||
56 | #ifndef cpu_has_divec | ||
57 | #define cpu_has_divec (cpu_data[0].options & MIPS_CPU_DIVEC) | ||
58 | #endif | ||
59 | #ifndef cpu_has_vce | ||
60 | #define cpu_has_vce (cpu_data[0].options & MIPS_CPU_VCE) | ||
61 | #endif | ||
62 | #ifndef cpu_has_cache_cdex_p | ||
63 | #define cpu_has_cache_cdex_p (cpu_data[0].options & MIPS_CPU_CACHE_CDEX_P) | ||
64 | #endif | ||
65 | #ifndef cpu_has_cache_cdex_s | ||
66 | #define cpu_has_cache_cdex_s (cpu_data[0].options & MIPS_CPU_CACHE_CDEX_S) | ||
67 | #endif | ||
68 | #ifndef cpu_has_prefetch | ||
69 | #define cpu_has_prefetch (cpu_data[0].options & MIPS_CPU_PREFETCH) | ||
70 | #endif | ||
71 | #ifndef cpu_has_mcheck | ||
72 | #define cpu_has_mcheck (cpu_data[0].options & MIPS_CPU_MCHECK) | ||
73 | #endif | ||
74 | #ifndef cpu_has_ejtag | ||
75 | #define cpu_has_ejtag (cpu_data[0].options & MIPS_CPU_EJTAG) | ||
76 | #endif | ||
77 | #ifndef cpu_has_llsc | ||
78 | #define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC) | ||
79 | #endif | ||
80 | #ifndef cpu_has_mips16 | ||
81 | #define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16) | ||
82 | #endif | ||
83 | #ifndef cpu_has_mdmx | ||
84 | #define cpu_has_mdmx (cpu_data[0].ases & MIPS_ASE_MDMX) | ||
85 | #endif | ||
86 | #ifndef cpu_has_mips3d | ||
87 | #define cpu_has_mips3d (cpu_data[0].ases & MIPS_ASE_MIPS3D) | ||
88 | #endif | ||
89 | #ifndef cpu_has_smartmips | ||
90 | #define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS) | ||
91 | #endif | ||
92 | #ifndef cpu_has_vtag_icache | ||
93 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) | ||
94 | #endif | ||
95 | #ifndef cpu_has_dc_aliases | ||
96 | #define cpu_has_dc_aliases (cpu_data[0].dcache.flags & MIPS_CACHE_ALIASES) | ||
97 | #endif | ||
98 | #ifndef cpu_has_ic_fills_f_dc | ||
99 | #define cpu_has_ic_fills_f_dc (cpu_data[0].icache.flags & MIPS_CACHE_IC_F_DC) | ||
100 | #endif | ||
101 | #ifndef cpu_has_pindexed_dcache | ||
102 | #define cpu_has_pindexed_dcache (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX) | ||
103 | #endif | ||
104 | |||
105 | /* | ||
106 | * I-Cache snoops remote store. This only matters on SMP. Some multiprocessors | ||
107 | * such as the R10000 have I-Caches that snoop local stores; the embedded ones | ||
108 | * don't. For maintaining I-cache coherency this means we need to flush the | ||
109 | * D-cache all the way back to whever the I-cache does refills from, so the | ||
110 | * I-cache has a chance to see the new data at all. Then we have to flush the | ||
111 | * I-cache also. | ||
112 | * Note we may have been rescheduled and may no longer be running on the CPU | ||
113 | * that did the store so we can't optimize this into only doing the flush on | ||
114 | * the local CPU. | ||
115 | */ | ||
116 | #ifndef cpu_icache_snoops_remote_store | ||
117 | #ifdef CONFIG_SMP | ||
118 | #define cpu_icache_snoops_remote_store (cpu_data[0].icache.flags & MIPS_IC_SNOOPS_REMOTE) | ||
119 | #else | ||
120 | #define cpu_icache_snoops_remote_store 1 | ||
121 | #endif | ||
122 | #endif | ||
123 | |||
124 | # ifndef cpu_has_mips32r1 | ||
125 | # define cpu_has_mips32r1 (cpu_data[0].isa_level & MIPS_CPU_ISA_M32R1) | ||
126 | # endif | ||
127 | # ifndef cpu_has_mips32r2 | ||
128 | # define cpu_has_mips32r2 (cpu_data[0].isa_level & MIPS_CPU_ISA_M32R2) | ||
129 | # endif | ||
130 | # ifndef cpu_has_mips64r1 | ||
131 | # define cpu_has_mips64r1 (cpu_data[0].isa_level & MIPS_CPU_ISA_M64R1) | ||
132 | # endif | ||
133 | # ifndef cpu_has_mips64r2 | ||
134 | # define cpu_has_mips64r2 (cpu_data[0].isa_level & MIPS_CPU_ISA_M64R2) | ||
135 | # endif | ||
136 | |||
137 | /* | ||
138 | * Shortcuts ... | ||
139 | */ | ||
140 | #define cpu_has_mips32 (cpu_has_mips32r1 | cpu_has_mips32r2) | ||
141 | #define cpu_has_mips64 (cpu_has_mips64r1 | cpu_has_mips64r2) | ||
142 | #define cpu_has_mips_r1 (cpu_has_mips32r1 | cpu_has_mips64r1) | ||
143 | #define cpu_has_mips_r2 (cpu_has_mips32r2 | cpu_has_mips64r2) | ||
144 | |||
145 | #ifndef cpu_has_dsp | ||
146 | #define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) | ||
147 | #endif | ||
148 | |||
149 | #ifndef cpu_has_mipsmt | ||
150 | #define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) | ||
151 | #endif | ||
152 | |||
153 | #ifndef cpu_has_userlocal | ||
154 | #define cpu_has_userlocal (cpu_data[0].options & MIPS_CPU_ULRI) | ||
155 | #endif | ||
156 | |||
157 | #ifdef CONFIG_32BIT | ||
158 | # ifndef cpu_has_nofpuex | ||
159 | # define cpu_has_nofpuex (cpu_data[0].options & MIPS_CPU_NOFPUEX) | ||
160 | # endif | ||
161 | # ifndef cpu_has_64bits | ||
162 | # define cpu_has_64bits (cpu_data[0].isa_level & MIPS_CPU_ISA_64BIT) | ||
163 | # endif | ||
164 | # ifndef cpu_has_64bit_zero_reg | ||
165 | # define cpu_has_64bit_zero_reg (cpu_data[0].isa_level & MIPS_CPU_ISA_64BIT) | ||
166 | # endif | ||
167 | # ifndef cpu_has_64bit_gp_regs | ||
168 | # define cpu_has_64bit_gp_regs 0 | ||
169 | # endif | ||
170 | # ifndef cpu_has_64bit_addresses | ||
171 | # define cpu_has_64bit_addresses 0 | ||
172 | # endif | ||
173 | #endif | ||
174 | |||
175 | #ifdef CONFIG_64BIT | ||
176 | # ifndef cpu_has_nofpuex | ||
177 | # define cpu_has_nofpuex 0 | ||
178 | # endif | ||
179 | # ifndef cpu_has_64bits | ||
180 | # define cpu_has_64bits 1 | ||
181 | # endif | ||
182 | # ifndef cpu_has_64bit_zero_reg | ||
183 | # define cpu_has_64bit_zero_reg 1 | ||
184 | # endif | ||
185 | # ifndef cpu_has_64bit_gp_regs | ||
186 | # define cpu_has_64bit_gp_regs 1 | ||
187 | # endif | ||
188 | # ifndef cpu_has_64bit_addresses | ||
189 | # define cpu_has_64bit_addresses 1 | ||
190 | # endif | ||
191 | #endif | ||
192 | |||
193 | #if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint) | ||
194 | # define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT) | ||
195 | #elif !defined(cpu_has_vint) | ||
196 | # define cpu_has_vint 0 | ||
197 | #endif | ||
198 | |||
199 | #if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic) | ||
200 | # define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC) | ||
201 | #elif !defined(cpu_has_veic) | ||
202 | # define cpu_has_veic 0 | ||
203 | #endif | ||
204 | |||
205 | #ifndef cpu_has_inclusive_pcaches | ||
206 | #define cpu_has_inclusive_pcaches (cpu_data[0].options & MIPS_CPU_INCLUSIVE_CACHES) | ||
207 | #endif | ||
208 | |||
209 | #ifndef cpu_dcache_line_size | ||
210 | #define cpu_dcache_line_size() cpu_data[0].dcache.linesz | ||
211 | #endif | ||
212 | #ifndef cpu_icache_line_size | ||
213 | #define cpu_icache_line_size() cpu_data[0].icache.linesz | ||
214 | #endif | ||
215 | #ifndef cpu_scache_line_size | ||
216 | #define cpu_scache_line_size() cpu_data[0].scache.linesz | ||
217 | #endif | ||
218 | |||
219 | #endif /* __ASM_CPU_FEATURES_H */ | ||
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h deleted file mode 100644 index 2de73dbb2e9e..000000000000 --- a/include/asm-mips/cpu-info.h +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 Waldorf GMBH | ||
7 | * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle | ||
8 | * Copyright (C) 1996 Paul M. Antoine | ||
9 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
10 | * Copyright (C) 2004 Maciej W. Rozycki | ||
11 | */ | ||
12 | #ifndef __ASM_CPU_INFO_H | ||
13 | #define __ASM_CPU_INFO_H | ||
14 | |||
15 | #include <asm/cache.h> | ||
16 | |||
17 | /* | ||
18 | * Descriptor for a cache | ||
19 | */ | ||
20 | struct cache_desc { | ||
21 | unsigned int waysize; /* Bytes per way */ | ||
22 | unsigned short sets; /* Number of lines per set */ | ||
23 | unsigned char ways; /* Number of ways */ | ||
24 | unsigned char linesz; /* Size of line in bytes */ | ||
25 | unsigned char waybit; /* Bits to select in a cache set */ | ||
26 | unsigned char flags; /* Flags describing cache properties */ | ||
27 | }; | ||
28 | |||
29 | /* | ||
30 | * Flag definitions | ||
31 | */ | ||
32 | #define MIPS_CACHE_NOT_PRESENT 0x00000001 | ||
33 | #define MIPS_CACHE_VTAG 0x00000002 /* Virtually tagged cache */ | ||
34 | #define MIPS_CACHE_ALIASES 0x00000004 /* Cache could have aliases */ | ||
35 | #define MIPS_CACHE_IC_F_DC 0x00000008 /* Ic can refill from D-cache */ | ||
36 | #define MIPS_IC_SNOOPS_REMOTE 0x00000010 /* Ic snoops remote stores */ | ||
37 | #define MIPS_CACHE_PINDEX 0x00000020 /* Physically indexed cache */ | ||
38 | |||
39 | struct cpuinfo_mips { | ||
40 | unsigned long udelay_val; | ||
41 | unsigned long asid_cache; | ||
42 | |||
43 | /* | ||
44 | * Capability and feature descriptor structure for MIPS CPU | ||
45 | */ | ||
46 | unsigned long options; | ||
47 | unsigned long ases; | ||
48 | unsigned int processor_id; | ||
49 | unsigned int fpu_id; | ||
50 | unsigned int cputype; | ||
51 | int isa_level; | ||
52 | int tlbsize; | ||
53 | struct cache_desc icache; /* Primary I-cache */ | ||
54 | struct cache_desc dcache; /* Primary D or combined I/D cache */ | ||
55 | struct cache_desc scache; /* Secondary cache */ | ||
56 | struct cache_desc tcache; /* Tertiary/split secondary cache */ | ||
57 | int srsets; /* Shadow register sets */ | ||
58 | int core; /* physical core number */ | ||
59 | #if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC) | ||
60 | /* | ||
61 | * In the MIPS MT "SMTC" model, each TC is considered | ||
62 | * to be a "CPU" for the purposes of scheduling, but | ||
63 | * exception resources, ASID spaces, etc, are common | ||
64 | * to all TCs within the same VPE. | ||
65 | */ | ||
66 | int vpe_id; /* Virtual Processor number */ | ||
67 | #endif | ||
68 | #ifdef CONFIG_MIPS_MT_SMTC | ||
69 | int tc_id; /* Thread Context number */ | ||
70 | #endif | ||
71 | void *data; /* Additional data */ | ||
72 | } __attribute__((aligned(SMP_CACHE_BYTES))); | ||
73 | |||
74 | extern struct cpuinfo_mips cpu_data[]; | ||
75 | #define current_cpu_data cpu_data[smp_processor_id()] | ||
76 | #define raw_current_cpu_data cpu_data[raw_smp_processor_id()] | ||
77 | |||
78 | extern void cpu_probe(void); | ||
79 | extern void cpu_report(void); | ||
80 | |||
81 | extern const char *__cpu_name[]; | ||
82 | #define cpu_name_string() __cpu_name[smp_processor_id()] | ||
83 | |||
84 | #endif /* __ASM_CPU_INFO_H */ | ||
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h deleted file mode 100644 index 229a786101d9..000000000000 --- a/include/asm-mips/cpu.h +++ /dev/null | |||
@@ -1,267 +0,0 @@ | |||
1 | /* | ||
2 | * cpu.h: Values of the PRId register used to match up | ||
3 | * various MIPS cpu types. | ||
4 | * | ||
5 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | ||
6 | * Copyright (C) 2004 Maciej W. Rozycki | ||
7 | */ | ||
8 | #ifndef _ASM_CPU_H | ||
9 | #define _ASM_CPU_H | ||
10 | |||
11 | /* Assigned Company values for bits 23:16 of the PRId Register | ||
12 | (CP0 register 15, select 0). As of the MIPS32 and MIPS64 specs from | ||
13 | MTI, the PRId register is defined in this (backwards compatible) | ||
14 | way: | ||
15 | |||
16 | +----------------+----------------+----------------+----------------+ | ||
17 | | Company Options| Company ID | Processor ID | Revision | | ||
18 | +----------------+----------------+----------------+----------------+ | ||
19 | 31 24 23 16 15 8 7 | ||
20 | |||
21 | I don't have docs for all the previous processors, but my impression is | ||
22 | that bits 16-23 have been 0 for all MIPS processors before the MIPS32/64 | ||
23 | spec. | ||
24 | */ | ||
25 | |||
26 | #define PRID_COMP_LEGACY 0x000000 | ||
27 | #define PRID_COMP_MIPS 0x010000 | ||
28 | #define PRID_COMP_BROADCOM 0x020000 | ||
29 | #define PRID_COMP_ALCHEMY 0x030000 | ||
30 | #define PRID_COMP_SIBYTE 0x040000 | ||
31 | #define PRID_COMP_SANDCRAFT 0x050000 | ||
32 | #define PRID_COMP_NXP 0x060000 | ||
33 | #define PRID_COMP_TOSHIBA 0x070000 | ||
34 | #define PRID_COMP_LSI 0x080000 | ||
35 | #define PRID_COMP_LEXRA 0x0b0000 | ||
36 | |||
37 | |||
38 | /* | ||
39 | * Assigned values for the product ID register. In order to detect a | ||
40 | * certain CPU type exactly eventually additional registers may need to | ||
41 | * be examined. These are valid when 23:16 == PRID_COMP_LEGACY | ||
42 | */ | ||
43 | #define PRID_IMP_R2000 0x0100 | ||
44 | #define PRID_IMP_AU1_REV1 0x0100 | ||
45 | #define PRID_IMP_AU1_REV2 0x0200 | ||
46 | #define PRID_IMP_R3000 0x0200 /* Same as R2000A */ | ||
47 | #define PRID_IMP_R6000 0x0300 /* Same as R3000A */ | ||
48 | #define PRID_IMP_R4000 0x0400 | ||
49 | #define PRID_IMP_R6000A 0x0600 | ||
50 | #define PRID_IMP_R10000 0x0900 | ||
51 | #define PRID_IMP_R4300 0x0b00 | ||
52 | #define PRID_IMP_VR41XX 0x0c00 | ||
53 | #define PRID_IMP_R12000 0x0e00 | ||
54 | #define PRID_IMP_R14000 0x0f00 | ||
55 | #define PRID_IMP_R8000 0x1000 | ||
56 | #define PRID_IMP_PR4450 0x1200 | ||
57 | #define PRID_IMP_R4600 0x2000 | ||
58 | #define PRID_IMP_R4700 0x2100 | ||
59 | #define PRID_IMP_TX39 0x2200 | ||
60 | #define PRID_IMP_R4640 0x2200 | ||
61 | #define PRID_IMP_R4650 0x2200 /* Same as R4640 */ | ||
62 | #define PRID_IMP_R5000 0x2300 | ||
63 | #define PRID_IMP_TX49 0x2d00 | ||
64 | #define PRID_IMP_SONIC 0x2400 | ||
65 | #define PRID_IMP_MAGIC 0x2500 | ||
66 | #define PRID_IMP_RM7000 0x2700 | ||
67 | #define PRID_IMP_NEVADA 0x2800 /* RM5260 ??? */ | ||
68 | #define PRID_IMP_RM9000 0x3400 | ||
69 | #define PRID_IMP_LOONGSON1 0x4200 | ||
70 | #define PRID_IMP_R5432 0x5400 | ||
71 | #define PRID_IMP_R5500 0x5500 | ||
72 | #define PRID_IMP_LOONGSON2 0x6300 | ||
73 | |||
74 | #define PRID_IMP_UNKNOWN 0xff00 | ||
75 | |||
76 | /* | ||
77 | * These are the PRID's for when 23:16 == PRID_COMP_MIPS | ||
78 | */ | ||
79 | |||
80 | #define PRID_IMP_4KC 0x8000 | ||
81 | #define PRID_IMP_5KC 0x8100 | ||
82 | #define PRID_IMP_20KC 0x8200 | ||
83 | #define PRID_IMP_4KEC 0x8400 | ||
84 | #define PRID_IMP_4KSC 0x8600 | ||
85 | #define PRID_IMP_25KF 0x8800 | ||
86 | #define PRID_IMP_5KE 0x8900 | ||
87 | #define PRID_IMP_4KECR2 0x9000 | ||
88 | #define PRID_IMP_4KEMPR2 0x9100 | ||
89 | #define PRID_IMP_4KSD 0x9200 | ||
90 | #define PRID_IMP_24K 0x9300 | ||
91 | #define PRID_IMP_34K 0x9500 | ||
92 | #define PRID_IMP_24KE 0x9600 | ||
93 | #define PRID_IMP_74K 0x9700 | ||
94 | #define PRID_IMP_1004K 0x9900 | ||
95 | |||
96 | /* | ||
97 | * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE | ||
98 | */ | ||
99 | |||
100 | #define PRID_IMP_SB1 0x0100 | ||
101 | #define PRID_IMP_SB1A 0x1100 | ||
102 | |||
103 | /* | ||
104 | * These are the PRID's for when 23:16 == PRID_COMP_SANDCRAFT | ||
105 | */ | ||
106 | |||
107 | #define PRID_IMP_SR71000 0x0400 | ||
108 | |||
109 | /* | ||
110 | * These are the PRID's for when 23:16 == PRID_COMP_BROADCOM | ||
111 | */ | ||
112 | |||
113 | #define PRID_IMP_BCM4710 0x4000 | ||
114 | #define PRID_IMP_BCM3302 0x9000 | ||
115 | |||
116 | /* | ||
117 | * Definitions for 7:0 on legacy processors | ||
118 | */ | ||
119 | |||
120 | #define PRID_REV_MASK 0x00ff | ||
121 | |||
122 | #define PRID_REV_TX4927 0x0022 | ||
123 | #define PRID_REV_TX4937 0x0030 | ||
124 | #define PRID_REV_R4400 0x0040 | ||
125 | #define PRID_REV_R3000A 0x0030 | ||
126 | #define PRID_REV_R3000 0x0020 | ||
127 | #define PRID_REV_R2000A 0x0010 | ||
128 | #define PRID_REV_TX3912 0x0010 | ||
129 | #define PRID_REV_TX3922 0x0030 | ||
130 | #define PRID_REV_TX3927 0x0040 | ||
131 | #define PRID_REV_VR4111 0x0050 | ||
132 | #define PRID_REV_VR4181 0x0050 /* Same as VR4111 */ | ||
133 | #define PRID_REV_VR4121 0x0060 | ||
134 | #define PRID_REV_VR4122 0x0070 | ||
135 | #define PRID_REV_VR4181A 0x0070 /* Same as VR4122 */ | ||
136 | #define PRID_REV_VR4130 0x0080 | ||
137 | #define PRID_REV_34K_V1_0_2 0x0022 | ||
138 | |||
139 | /* | ||
140 | * Older processors used to encode processor version and revision in two | ||
141 | * 4-bit bitfields, the 4K seems to simply count up and even newer MTI cores | ||
142 | * have switched to use the 8-bits as 3:3:2 bitfield with the last field as | ||
143 | * the patch number. *ARGH* | ||
144 | */ | ||
145 | #define PRID_REV_ENCODE_44(ver, rev) \ | ||
146 | ((ver) << 4 | (rev)) | ||
147 | #define PRID_REV_ENCODE_332(ver, rev, patch) \ | ||
148 | ((ver) << 5 | (rev) << 2 | (patch)) | ||
149 | |||
150 | /* | ||
151 | * FPU implementation/revision register (CP1 control register 0). | ||
152 | * | ||
153 | * +---------------------------------+----------------+----------------+ | ||
154 | * | 0 | Implementation | Revision | | ||
155 | * +---------------------------------+----------------+----------------+ | ||
156 | * 31 16 15 8 7 0 | ||
157 | */ | ||
158 | |||
159 | #define FPIR_IMP_NONE 0x0000 | ||
160 | |||
161 | enum cpu_type_enum { | ||
162 | CPU_UNKNOWN, | ||
163 | |||
164 | /* | ||
165 | * R2000 class processors | ||
166 | */ | ||
167 | CPU_R2000, CPU_R3000, CPU_R3000A, CPU_R3041, CPU_R3051, CPU_R3052, | ||
168 | CPU_R3081, CPU_R3081E, | ||
169 | |||
170 | /* | ||
171 | * R6000 class processors | ||
172 | */ | ||
173 | CPU_R6000, CPU_R6000A, | ||
174 | |||
175 | /* | ||
176 | * R4000 class processors | ||
177 | */ | ||
178 | CPU_R4000PC, CPU_R4000SC, CPU_R4000MC, CPU_R4200, CPU_R4300, CPU_R4310, | ||
179 | CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600, CPU_R4640, CPU_R4650, | ||
180 | CPU_R4700, CPU_R5000, CPU_R5000A, CPU_R5500, CPU_NEVADA, CPU_R5432, | ||
181 | CPU_R10000, CPU_R12000, CPU_R14000, CPU_VR41XX, CPU_VR4111, CPU_VR4121, | ||
182 | CPU_VR4122, CPU_VR4131, CPU_VR4133, CPU_VR4181, CPU_VR4181A, CPU_RM7000, | ||
183 | CPU_SR71000, CPU_RM9000, CPU_TX49XX, | ||
184 | |||
185 | /* | ||
186 | * R8000 class processors | ||
187 | */ | ||
188 | CPU_R8000, | ||
189 | |||
190 | /* | ||
191 | * TX3900 class processors | ||
192 | */ | ||
193 | CPU_TX3912, CPU_TX3922, CPU_TX3927, | ||
194 | |||
195 | /* | ||
196 | * MIPS32 class processors | ||
197 | */ | ||
198 | CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K, | ||
199 | CPU_AU1000, CPU_AU1100, CPU_AU1200, CPU_AU1210, CPU_AU1250, CPU_AU1500, | ||
200 | CPU_AU1550, CPU_PR4450, CPU_BCM3302, CPU_BCM4710, | ||
201 | |||
202 | /* | ||
203 | * MIPS64 class processors | ||
204 | */ | ||
205 | CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, | ||
206 | |||
207 | CPU_LAST | ||
208 | }; | ||
209 | |||
210 | |||
211 | /* | ||
212 | * ISA Level encodings | ||
213 | * | ||
214 | */ | ||
215 | #define MIPS_CPU_ISA_I 0x00000001 | ||
216 | #define MIPS_CPU_ISA_II 0x00000002 | ||
217 | #define MIPS_CPU_ISA_III 0x00000004 | ||
218 | #define MIPS_CPU_ISA_IV 0x00000008 | ||
219 | #define MIPS_CPU_ISA_V 0x00000010 | ||
220 | #define MIPS_CPU_ISA_M32R1 0x00000020 | ||
221 | #define MIPS_CPU_ISA_M32R2 0x00000040 | ||
222 | #define MIPS_CPU_ISA_M64R1 0x00000080 | ||
223 | #define MIPS_CPU_ISA_M64R2 0x00000100 | ||
224 | |||
225 | #define MIPS_CPU_ISA_32BIT (MIPS_CPU_ISA_I | MIPS_CPU_ISA_II | \ | ||
226 | MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 ) | ||
227 | #define MIPS_CPU_ISA_64BIT (MIPS_CPU_ISA_III | MIPS_CPU_ISA_IV | \ | ||
228 | MIPS_CPU_ISA_V | MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2) | ||
229 | |||
230 | /* | ||
231 | * CPU Option encodings | ||
232 | */ | ||
233 | #define MIPS_CPU_TLB 0x00000001 /* CPU has TLB */ | ||
234 | #define MIPS_CPU_4KEX 0x00000002 /* "R4K" exception model */ | ||
235 | #define MIPS_CPU_3K_CACHE 0x00000004 /* R3000-style caches */ | ||
236 | #define MIPS_CPU_4K_CACHE 0x00000008 /* R4000-style caches */ | ||
237 | #define MIPS_CPU_TX39_CACHE 0x00000010 /* TX3900-style caches */ | ||
238 | #define MIPS_CPU_FPU 0x00000020 /* CPU has FPU */ | ||
239 | #define MIPS_CPU_32FPR 0x00000040 /* 32 dbl. prec. FP registers */ | ||
240 | #define MIPS_CPU_COUNTER 0x00000080 /* Cycle count/compare */ | ||
241 | #define MIPS_CPU_WATCH 0x00000100 /* watchpoint registers */ | ||
242 | #define MIPS_CPU_DIVEC 0x00000200 /* dedicated interrupt vector */ | ||
243 | #define MIPS_CPU_VCE 0x00000400 /* virt. coherence conflict possible */ | ||
244 | #define MIPS_CPU_CACHE_CDEX_P 0x00000800 /* Create_Dirty_Exclusive CACHE op */ | ||
245 | #define MIPS_CPU_CACHE_CDEX_S 0x00001000 /* ... same for seconary cache ... */ | ||
246 | #define MIPS_CPU_MCHECK 0x00002000 /* Machine check exception */ | ||
247 | #define MIPS_CPU_EJTAG 0x00004000 /* EJTAG exception */ | ||
248 | #define MIPS_CPU_NOFPUEX 0x00008000 /* no FPU exception */ | ||
249 | #define MIPS_CPU_LLSC 0x00010000 /* CPU has ll/sc instructions */ | ||
250 | #define MIPS_CPU_INCLUSIVE_CACHES 0x00020000 /* P-cache subset enforced */ | ||
251 | #define MIPS_CPU_PREFETCH 0x00040000 /* CPU has usable prefetch */ | ||
252 | #define MIPS_CPU_VINT 0x00080000 /* CPU supports MIPSR2 vectored interrupts */ | ||
253 | #define MIPS_CPU_VEIC 0x00100000 /* CPU supports MIPSR2 external interrupt controller mode */ | ||
254 | #define MIPS_CPU_ULRI 0x00200000 /* CPU has ULRI feature */ | ||
255 | |||
256 | /* | ||
257 | * CPU ASE encodings | ||
258 | */ | ||
259 | #define MIPS_ASE_MIPS16 0x00000001 /* code compression */ | ||
260 | #define MIPS_ASE_MDMX 0x00000002 /* MIPS digital media extension */ | ||
261 | #define MIPS_ASE_MIPS3D 0x00000004 /* MIPS-3D */ | ||
262 | #define MIPS_ASE_SMARTMIPS 0x00000008 /* SmartMIPS */ | ||
263 | #define MIPS_ASE_DSP 0x00000010 /* Signal Processing ASE */ | ||
264 | #define MIPS_ASE_MIPSMT 0x00000020 /* CPU supports MIPS MT */ | ||
265 | |||
266 | |||
267 | #endif /* _ASM_CPU_H */ | ||
diff --git a/include/asm-mips/cputime.h b/include/asm-mips/cputime.h deleted file mode 100644 index c00eacbdd979..000000000000 --- a/include/asm-mips/cputime.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __MIPS_CPUTIME_H | ||
2 | #define __MIPS_CPUTIME_H | ||
3 | |||
4 | #include <asm-generic/cputime.h> | ||
5 | |||
6 | #endif /* __MIPS_CPUTIME_H */ | ||
diff --git a/include/asm-mips/current.h b/include/asm-mips/current.h deleted file mode 100644 index 559db66b9790..000000000000 --- a/include/asm-mips/current.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 2002 Ralf Baechle | ||
7 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_CURRENT_H | ||
10 | #define _ASM_CURRENT_H | ||
11 | |||
12 | #include <linux/thread_info.h> | ||
13 | |||
14 | struct task_struct; | ||
15 | |||
16 | static inline struct task_struct * get_current(void) | ||
17 | { | ||
18 | return current_thread_info()->task; | ||
19 | } | ||
20 | |||
21 | #define current get_current() | ||
22 | |||
23 | #endif /* _ASM_CURRENT_H */ | ||
diff --git a/include/asm-mips/debug.h b/include/asm-mips/debug.h deleted file mode 100644 index 1fd5a2b39445..000000000000 --- a/include/asm-mips/debug.h +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * Debug macros for run-time debugging. | ||
3 | * Turned on/off with CONFIG_RUNTIME_DEBUG option. | ||
4 | * | ||
5 | * Copyright (C) 2001 MontaVista Software Inc. | ||
6 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef _ASM_DEBUG_H | ||
16 | #define _ASM_DEBUG_H | ||
17 | |||
18 | |||
19 | /* | ||
20 | * run-time macros for catching spurious errors. Eable CONFIG_RUNTIME_DEBUG in | ||
21 | * kernel hacking config menu to use them. | ||
22 | * | ||
23 | * Use them as run-time debugging aid. NEVER USE THEM AS ERROR HANDLING CODE!!! | ||
24 | */ | ||
25 | |||
26 | #ifdef CONFIG_RUNTIME_DEBUG | ||
27 | |||
28 | #include <linux/kernel.h> | ||
29 | |||
30 | #define db_assert(x) if (!(x)) { \ | ||
31 | panic("assertion failed at %s:%d: %s", __FILE__, __LINE__, #x); } | ||
32 | #define db_warn(x) if (!(x)) { \ | ||
33 | printk(KERN_WARNING "warning at %s:%d: %s", __FILE__, __LINE__, #x); } | ||
34 | #define db_verify(x, y) db_assert(x y) | ||
35 | #define db_verify_warn(x, y) db_warn(x y) | ||
36 | #define db_run(x) do { x; } while (0) | ||
37 | |||
38 | #else | ||
39 | |||
40 | #define db_assert(x) | ||
41 | #define db_warn(x) | ||
42 | #define db_verify(x, y) x | ||
43 | #define db_verify_warn(x, y) x | ||
44 | #define db_run(x) | ||
45 | |||
46 | #endif | ||
47 | |||
48 | #endif /* _ASM_DEBUG_H */ | ||
diff --git a/include/asm-mips/dec/ecc.h b/include/asm-mips/dec/ecc.h deleted file mode 100644 index 707ffdbc9add..000000000000 --- a/include/asm-mips/dec/ecc.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/dec/ecc.h | ||
3 | * | ||
4 | * ECC handling logic definitions common to DECstation/DECsystem | ||
5 | * 5000/200 (KN02), 5000/240 (KN03), 5000/260 (KN05) and | ||
6 | * DECsystem 5900 (KN03), 5900/260 (KN05) systems. | ||
7 | * | ||
8 | * Copyright (C) 2003 Maciej W. Rozycki | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version | ||
13 | * 2 of the License, or (at your option) any later version. | ||
14 | */ | ||
15 | #ifndef __ASM_MIPS_DEC_ECC_H | ||
16 | #define __ASM_MIPS_DEC_ECC_H | ||
17 | |||
18 | /* | ||
19 | * Error Address Register bits. | ||
20 | * The register is r/wc -- any write clears it. | ||
21 | */ | ||
22 | #define KN0X_EAR_VALID (1<<31) /* error data valid, bus IRQ */ | ||
23 | #define KN0X_EAR_CPU (1<<30) /* CPU/DMA transaction */ | ||
24 | #define KN0X_EAR_WRITE (1<<29) /* write/read transaction */ | ||
25 | #define KN0X_EAR_ECCERR (1<<28) /* ECC/timeout or overrun */ | ||
26 | #define KN0X_EAR_RES_27 (1<<27) /* unused */ | ||
27 | #define KN0X_EAR_ADDRESS (0x7ffffff<<0) /* address involved */ | ||
28 | |||
29 | /* | ||
30 | * Error Syndrome Register bits. | ||
31 | * The register is frozen when EAR.VALID is set, otherwise it records bits | ||
32 | * from the last memory read. The register is r/wc -- any write clears it. | ||
33 | */ | ||
34 | #define KN0X_ESR_VLDHI (1<<31) /* error data valid hi word */ | ||
35 | #define KN0X_ESR_CHKHI (0x7f<<24) /* check bits read from mem */ | ||
36 | #define KN0X_ESR_SNGHI (1<<23) /* single/double bit error */ | ||
37 | #define KN0X_ESR_SYNHI (0x7f<<16) /* syndrome from ECC logic */ | ||
38 | #define KN0X_ESR_VLDLO (1<<15) /* error data valid lo word */ | ||
39 | #define KN0X_ESR_CHKLO (0x7f<<8) /* check bits read from mem */ | ||
40 | #define KN0X_ESR_SNGLO (1<<7) /* single/double bit error */ | ||
41 | #define KN0X_ESR_SYNLO (0x7f<<0) /* syndrome from ECC logic */ | ||
42 | |||
43 | |||
44 | #ifndef __ASSEMBLY__ | ||
45 | |||
46 | #include <linux/interrupt.h> | ||
47 | |||
48 | struct pt_regs; | ||
49 | |||
50 | extern void dec_ecc_be_init(void); | ||
51 | extern int dec_ecc_be_handler(struct pt_regs *regs, int is_fixup); | ||
52 | extern irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id); | ||
53 | #endif | ||
54 | |||
55 | #endif /* __ASM_MIPS_DEC_ECC_H */ | ||
diff --git a/include/asm-mips/dec/interrupts.h b/include/asm-mips/dec/interrupts.h deleted file mode 100644 index e10d341067c8..000000000000 --- a/include/asm-mips/dec/interrupts.h +++ /dev/null | |||
@@ -1,126 +0,0 @@ | |||
1 | /* | ||
2 | * Miscellaneous definitions used to initialise the interrupt vector table | ||
3 | * with the machine-specific interrupt routines. | ||
4 | * | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * Copyright (C) 1997 by Paul M. Antoine. | ||
10 | * reworked 1998 by Harald Koerfgen. | ||
11 | * Copyright (C) 2001, 2002, 2003 Maciej W. Rozycki | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_DEC_INTERRUPTS_H | ||
15 | #define __ASM_DEC_INTERRUPTS_H | ||
16 | |||
17 | #include <irq.h> | ||
18 | #include <asm/mipsregs.h> | ||
19 | |||
20 | |||
21 | /* | ||
22 | * The list of possible system devices which provide an | ||
23 | * interrupt. Not all devices exist on a given system. | ||
24 | */ | ||
25 | #define DEC_IRQ_CASCADE 0 /* cascade from CSR or I/O ASIC */ | ||
26 | |||
27 | /* Ordinary interrupts */ | ||
28 | #define DEC_IRQ_AB_RECV 1 /* ACCESS.bus receive */ | ||
29 | #define DEC_IRQ_AB_XMIT 2 /* ACCESS.bus transmit */ | ||
30 | #define DEC_IRQ_DZ11 3 /* DZ11 (DC7085) serial */ | ||
31 | #define DEC_IRQ_ASC 4 /* ASC (NCR53C94) SCSI */ | ||
32 | #define DEC_IRQ_FLOPPY 5 /* 82077 FDC */ | ||
33 | #define DEC_IRQ_FPU 6 /* R3k FPU */ | ||
34 | #define DEC_IRQ_HALT 7 /* HALT button or from ACCESS.Bus */ | ||
35 | #define DEC_IRQ_ISDN 8 /* Am79C30A ISDN */ | ||
36 | #define DEC_IRQ_LANCE 9 /* LANCE (Am7990) Ethernet */ | ||
37 | #define DEC_IRQ_BUS 10 /* memory, I/O bus read/write errors */ | ||
38 | #define DEC_IRQ_PSU 11 /* power supply unit warning */ | ||
39 | #define DEC_IRQ_RTC 12 /* DS1287 RTC */ | ||
40 | #define DEC_IRQ_SCC0 13 /* SCC (Z85C30) serial #0 */ | ||
41 | #define DEC_IRQ_SCC1 14 /* SCC (Z85C30) serial #1 */ | ||
42 | #define DEC_IRQ_SII 15 /* SII (DC7061) SCSI */ | ||
43 | #define DEC_IRQ_TC0 16 /* TURBOchannel slot #0 */ | ||
44 | #define DEC_IRQ_TC1 17 /* TURBOchannel slot #1 */ | ||
45 | #define DEC_IRQ_TC2 18 /* TURBOchannel slot #2 */ | ||
46 | #define DEC_IRQ_TIMER 19 /* ARC periodic timer */ | ||
47 | #define DEC_IRQ_VIDEO 20 /* framebuffer */ | ||
48 | |||
49 | /* I/O ASIC DMA interrupts */ | ||
50 | #define DEC_IRQ_ASC_MERR 21 /* ASC memory read error */ | ||
51 | #define DEC_IRQ_ASC_ERR 22 /* ASC page overrun */ | ||
52 | #define DEC_IRQ_ASC_DMA 23 /* ASC buffer pointer loaded */ | ||
53 | #define DEC_IRQ_FLOPPY_ERR 24 /* FDC error */ | ||
54 | #define DEC_IRQ_ISDN_ERR 25 /* ISDN memory read/overrun error */ | ||
55 | #define DEC_IRQ_ISDN_RXDMA 26 /* ISDN recv buffer pointer loaded */ | ||
56 | #define DEC_IRQ_ISDN_TXDMA 27 /* ISDN xmit buffer pointer loaded */ | ||
57 | #define DEC_IRQ_LANCE_MERR 28 /* LANCE memory read error */ | ||
58 | #define DEC_IRQ_SCC0A_RXERR 29 /* SCC0A (printer) receive overrun */ | ||
59 | #define DEC_IRQ_SCC0A_RXDMA 30 /* SCC0A receive half page */ | ||
60 | #define DEC_IRQ_SCC0A_TXERR 31 /* SCC0A xmit memory read/overrun */ | ||
61 | #define DEC_IRQ_SCC0A_TXDMA 32 /* SCC0A transmit page end */ | ||
62 | #define DEC_IRQ_AB_RXERR 33 /* ACCESS.bus receive overrun */ | ||
63 | #define DEC_IRQ_AB_RXDMA 34 /* ACCESS.bus receive half page */ | ||
64 | #define DEC_IRQ_AB_TXERR 35 /* ACCESS.bus xmit memory read/ovrn */ | ||
65 | #define DEC_IRQ_AB_TXDMA 36 /* ACCESS.bus transmit page end */ | ||
66 | #define DEC_IRQ_SCC1A_RXERR 37 /* SCC1A (modem) receive overrun */ | ||
67 | #define DEC_IRQ_SCC1A_RXDMA 38 /* SCC1A receive half page */ | ||
68 | #define DEC_IRQ_SCC1A_TXERR 39 /* SCC1A xmit memory read/overrun */ | ||
69 | #define DEC_IRQ_SCC1A_TXDMA 40 /* SCC1A transmit page end */ | ||
70 | |||
71 | /* TC5 & TC6 are virtual slots for KN02's onboard devices */ | ||
72 | #define DEC_IRQ_TC5 DEC_IRQ_ASC /* virtual PMAZ-AA */ | ||
73 | #define DEC_IRQ_TC6 DEC_IRQ_LANCE /* virtual PMAD-AA */ | ||
74 | |||
75 | #define DEC_NR_INTS 41 | ||
76 | |||
77 | |||
78 | /* Largest of cpu mask_nr tables. */ | ||
79 | #define DEC_MAX_CPU_INTS 6 | ||
80 | /* Largest of asic mask_nr tables. */ | ||
81 | #define DEC_MAX_ASIC_INTS 9 | ||
82 | |||
83 | |||
84 | /* | ||
85 | * CPU interrupt bits common to all systems. | ||
86 | */ | ||
87 | #define DEC_CPU_INR_FPU 7 /* R3k FPU */ | ||
88 | #define DEC_CPU_INR_SW1 1 /* software #1 */ | ||
89 | #define DEC_CPU_INR_SW0 0 /* software #0 */ | ||
90 | |||
91 | #define DEC_CPU_IRQ_BASE MIPS_CPU_IRQ_BASE /* first IRQ assigned to CPU */ | ||
92 | |||
93 | #define DEC_CPU_IRQ_NR(n) ((n) + DEC_CPU_IRQ_BASE) | ||
94 | #define DEC_CPU_IRQ_MASK(n) (1 << ((n) + CAUSEB_IP)) | ||
95 | #define DEC_CPU_IRQ_ALL (0xff << CAUSEB_IP) | ||
96 | |||
97 | |||
98 | #ifndef __ASSEMBLY__ | ||
99 | |||
100 | /* | ||
101 | * Interrupt table structures to hide differences between systems. | ||
102 | */ | ||
103 | typedef union { int i; void *p; } int_ptr; | ||
104 | extern int dec_interrupt[DEC_NR_INTS]; | ||
105 | extern int_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2]; | ||
106 | extern int_ptr asic_mask_nr_tbl[DEC_MAX_ASIC_INTS][2]; | ||
107 | extern int cpu_fpu_mask; | ||
108 | |||
109 | |||
110 | /* | ||
111 | * Common interrupt routine prototypes for all DECStations | ||
112 | */ | ||
113 | extern void kn02_io_int(void); | ||
114 | extern void kn02xa_io_int(void); | ||
115 | extern void kn03_io_int(void); | ||
116 | extern void asic_dma_int(void); | ||
117 | extern void asic_all_int(void); | ||
118 | extern void kn02_all_int(void); | ||
119 | extern void cpu_all_int(void); | ||
120 | |||
121 | extern void dec_intr_unimplemented(void); | ||
122 | extern void asic_intr_unimplemented(void); | ||
123 | |||
124 | #endif /* __ASSEMBLY__ */ | ||
125 | |||
126 | #endif | ||
diff --git a/include/asm-mips/dec/ioasic.h b/include/asm-mips/dec/ioasic.h deleted file mode 100644 index 98badd6bf22d..000000000000 --- a/include/asm-mips/dec/ioasic.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/dec/ioasic.h | ||
3 | * | ||
4 | * DEC I/O ASIC access operations. | ||
5 | * | ||
6 | * Copyright (C) 2000, 2002, 2003 Maciej W. Rozycki | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_DEC_IOASIC_H | ||
15 | #define __ASM_DEC_IOASIC_H | ||
16 | |||
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/types.h> | ||
19 | |||
20 | extern spinlock_t ioasic_ssr_lock; | ||
21 | |||
22 | extern volatile u32 *ioasic_base; | ||
23 | |||
24 | static inline void ioasic_write(unsigned int reg, u32 v) | ||
25 | { | ||
26 | ioasic_base[reg / 4] = v; | ||
27 | } | ||
28 | |||
29 | static inline u32 ioasic_read(unsigned int reg) | ||
30 | { | ||
31 | return ioasic_base[reg / 4]; | ||
32 | } | ||
33 | |||
34 | extern void init_ioasic_irqs(int base); | ||
35 | |||
36 | extern void dec_ioasic_clocksource_init(void); | ||
37 | |||
38 | #endif /* __ASM_DEC_IOASIC_H */ | ||
diff --git a/include/asm-mips/dec/ioasic_addrs.h b/include/asm-mips/dec/ioasic_addrs.h deleted file mode 100644 index 4cbc1f8a1129..000000000000 --- a/include/asm-mips/dec/ioasic_addrs.h +++ /dev/null | |||
@@ -1,152 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Definitions for the address map in the JUNKIO Asic | ||
7 | * | ||
8 | * Created with Information from: | ||
9 | * | ||
10 | * "DEC 3000 300/400/500/600/700/800/900 AXP Models System Programmer's Manual" | ||
11 | * | ||
12 | * and the Mach Sources | ||
13 | * | ||
14 | * Copyright (C) 199x the Anonymous | ||
15 | * Copyright (C) 2002, 2003 Maciej W. Rozycki | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_MIPS_DEC_IOASIC_ADDRS_H | ||
19 | #define __ASM_MIPS_DEC_IOASIC_ADDRS_H | ||
20 | |||
21 | #define IOASIC_SLOT_SIZE 0x00040000 | ||
22 | |||
23 | /* | ||
24 | * Address ranges decoded by the I/O ASIC for onboard devices. | ||
25 | */ | ||
26 | #define IOASIC_SYS_ROM (0*IOASIC_SLOT_SIZE) /* system board ROM */ | ||
27 | #define IOASIC_IOCTL (1*IOASIC_SLOT_SIZE) /* I/O ASIC */ | ||
28 | #define IOASIC_ESAR (2*IOASIC_SLOT_SIZE) /* LANCE MAC address chip */ | ||
29 | #define IOASIC_LANCE (3*IOASIC_SLOT_SIZE) /* LANCE Ethernet */ | ||
30 | #define IOASIC_SCC0 (4*IOASIC_SLOT_SIZE) /* SCC #0 */ | ||
31 | #define IOASIC_VDAC_HI (5*IOASIC_SLOT_SIZE) /* VDAC (maxine) */ | ||
32 | #define IOASIC_SCC1 (6*IOASIC_SLOT_SIZE) /* SCC #1 (3min, 3max+) */ | ||
33 | #define IOASIC_VDAC_LO (7*IOASIC_SLOT_SIZE) /* VDAC (maxine) */ | ||
34 | #define IOASIC_TOY (8*IOASIC_SLOT_SIZE) /* RTC */ | ||
35 | #define IOASIC_ISDN (9*IOASIC_SLOT_SIZE) /* ISDN (maxine) */ | ||
36 | #define IOASIC_ERRADDR (9*IOASIC_SLOT_SIZE) /* bus error address (3max+) */ | ||
37 | #define IOASIC_CHKSYN (10*IOASIC_SLOT_SIZE) /* ECC syndrome (3max+) */ | ||
38 | #define IOASIC_ACC_BUS (10*IOASIC_SLOT_SIZE) /* ACCESS.bus (maxine) */ | ||
39 | #define IOASIC_MCR (11*IOASIC_SLOT_SIZE) /* memory control (3max+) */ | ||
40 | #define IOASIC_FLOPPY (11*IOASIC_SLOT_SIZE) /* FDC (maxine) */ | ||
41 | #define IOASIC_SCSI (12*IOASIC_SLOT_SIZE) /* ASC SCSI */ | ||
42 | #define IOASIC_FDC_DMA (13*IOASIC_SLOT_SIZE) /* FDC DMA (maxine) */ | ||
43 | #define IOASIC_SCSI_DMA (14*IOASIC_SLOT_SIZE) /* ??? */ | ||
44 | #define IOASIC_RES_15 (15*IOASIC_SLOT_SIZE) /* unused? */ | ||
45 | |||
46 | |||
47 | /* | ||
48 | * Offsets for I/O ASIC registers | ||
49 | * (relative to (dec_kn_slot_base + IOASIC_IOCTL)). | ||
50 | */ | ||
51 | /* all systems */ | ||
52 | #define IO_REG_SCSI_DMA_P 0x00 /* SCSI DMA Pointer */ | ||
53 | #define IO_REG_SCSI_DMA_BP 0x10 /* SCSI DMA Buffer Pointer */ | ||
54 | #define IO_REG_LANCE_DMA_P 0x20 /* LANCE DMA Pointer */ | ||
55 | #define IO_REG_SCC0A_T_DMA_P 0x30 /* SCC0A Transmit DMA Pointer */ | ||
56 | #define IO_REG_SCC0A_R_DMA_P 0x40 /* SCC0A Receive DMA Pointer */ | ||
57 | |||
58 | /* except Maxine */ | ||
59 | #define IO_REG_SCC1A_T_DMA_P 0x50 /* SCC1A Transmit DMA Pointer */ | ||
60 | #define IO_REG_SCC1A_R_DMA_P 0x60 /* SCC1A Receive DMA Pointer */ | ||
61 | |||
62 | /* Maxine */ | ||
63 | #define IO_REG_AB_T_DMA_P 0x50 /* ACCESS.bus Transmit DMA Pointer */ | ||
64 | #define IO_REG_AB_R_DMA_P 0x60 /* ACCESS.bus Receive DMA Pointer */ | ||
65 | #define IO_REG_FLOPPY_DMA_P 0x70 /* Floppy DMA Pointer */ | ||
66 | #define IO_REG_ISDN_T_DMA_P 0x80 /* ISDN Transmit DMA Pointer */ | ||
67 | #define IO_REG_ISDN_T_DMA_BP 0x90 /* ISDN Transmit DMA Buffer Pointer */ | ||
68 | #define IO_REG_ISDN_R_DMA_P 0xa0 /* ISDN Receive DMA Pointer */ | ||
69 | #define IO_REG_ISDN_R_DMA_BP 0xb0 /* ISDN Receive DMA Buffer Pointer */ | ||
70 | |||
71 | /* all systems */ | ||
72 | #define IO_REG_DATA_0 0xc0 /* System Data Buffer 0 */ | ||
73 | #define IO_REG_DATA_1 0xd0 /* System Data Buffer 1 */ | ||
74 | #define IO_REG_DATA_2 0xe0 /* System Data Buffer 2 */ | ||
75 | #define IO_REG_DATA_3 0xf0 /* System Data Buffer 3 */ | ||
76 | |||
77 | /* all systems */ | ||
78 | #define IO_REG_SSR 0x100 /* System Support Register */ | ||
79 | #define IO_REG_SIR 0x110 /* System Interrupt Register */ | ||
80 | #define IO_REG_SIMR 0x120 /* System Interrupt Mask Reg. */ | ||
81 | #define IO_REG_SAR 0x130 /* System Address Register */ | ||
82 | |||
83 | /* Maxine */ | ||
84 | #define IO_REG_ISDN_T_DATA 0x140 /* ISDN Xmit Data Register */ | ||
85 | #define IO_REG_ISDN_R_DATA 0x150 /* ISDN Receive Data Register */ | ||
86 | |||
87 | /* all systems */ | ||
88 | #define IO_REG_LANCE_SLOT 0x160 /* LANCE I/O Slot Register */ | ||
89 | #define IO_REG_SCSI_SLOT 0x170 /* SCSI Slot Register */ | ||
90 | #define IO_REG_SCC0A_SLOT 0x180 /* SCC0A DMA Slot Register */ | ||
91 | |||
92 | /* except Maxine */ | ||
93 | #define IO_REG_SCC1A_SLOT 0x190 /* SCC1A DMA Slot Register */ | ||
94 | |||
95 | /* Maxine */ | ||
96 | #define IO_REG_AB_SLOT 0x190 /* ACCESS.bus DMA Slot Register */ | ||
97 | #define IO_REG_FLOPPY_SLOT 0x1a0 /* Floppy Slot Register */ | ||
98 | |||
99 | /* all systems */ | ||
100 | #define IO_REG_SCSI_SCR 0x1b0 /* SCSI Partial-Word DMA Control */ | ||
101 | #define IO_REG_SCSI_SDR0 0x1c0 /* SCSI DMA Partial Word 0 */ | ||
102 | #define IO_REG_SCSI_SDR1 0x1d0 /* SCSI DMA Partial Word 1 */ | ||
103 | #define IO_REG_FCTR 0x1e0 /* Free-Running Counter */ | ||
104 | #define IO_REG_RES_31 0x1f0 /* unused */ | ||
105 | |||
106 | |||
107 | /* | ||
108 | * The upper 16 bits of the System Support Register are a part of the | ||
109 | * I/O ASIC's internal DMA engine and thus are common to all I/O ASIC | ||
110 | * machines. The exception is the Maxine, which makes use of the | ||
111 | * FLOPPY and ISDN bits (otherwise unused) and has a different SCC | ||
112 | * wiring. | ||
113 | */ | ||
114 | /* all systems */ | ||
115 | #define IO_SSR_SCC0A_TX_DMA_EN (1<<31) /* SCC0A transmit DMA enable */ | ||
116 | #define IO_SSR_SCC0A_RX_DMA_EN (1<<30) /* SCC0A receive DMA enable */ | ||
117 | #define IO_SSR_RES_27 (1<<27) /* unused */ | ||
118 | #define IO_SSR_RES_26 (1<<26) /* unused */ | ||
119 | #define IO_SSR_RES_25 (1<<25) /* unused */ | ||
120 | #define IO_SSR_RES_24 (1<<24) /* unused */ | ||
121 | #define IO_SSR_RES_23 (1<<23) /* unused */ | ||
122 | #define IO_SSR_SCSI_DMA_DIR (1<<18) /* SCSI DMA direction */ | ||
123 | #define IO_SSR_SCSI_DMA_EN (1<<17) /* SCSI DMA enable */ | ||
124 | #define IO_SSR_LANCE_DMA_EN (1<<16) /* LANCE DMA enable */ | ||
125 | |||
126 | /* except Maxine */ | ||
127 | #define IO_SSR_SCC1A_TX_DMA_EN (1<<29) /* SCC1A transmit DMA enable */ | ||
128 | #define IO_SSR_SCC1A_RX_DMA_EN (1<<28) /* SCC1A receive DMA enable */ | ||
129 | #define IO_SSR_RES_22 (1<<22) /* unused */ | ||
130 | #define IO_SSR_RES_21 (1<<21) /* unused */ | ||
131 | #define IO_SSR_RES_20 (1<<20) /* unused */ | ||
132 | #define IO_SSR_RES_19 (1<<19) /* unused */ | ||
133 | |||
134 | /* Maxine */ | ||
135 | #define IO_SSR_AB_TX_DMA_EN (1<<29) /* ACCESS.bus xmit DMA enable */ | ||
136 | #define IO_SSR_AB_RX_DMA_EN (1<<28) /* ACCESS.bus recv DMA enable */ | ||
137 | #define IO_SSR_FLOPPY_DMA_DIR (1<<22) /* Floppy DMA direction */ | ||
138 | #define IO_SSR_FLOPPY_DMA_EN (1<<21) /* Floppy DMA enable */ | ||
139 | #define IO_SSR_ISDN_TX_DMA_EN (1<<20) /* ISDN transmit DMA enable */ | ||
140 | #define IO_SSR_ISDN_RX_DMA_EN (1<<19) /* ISDN receive DMA enable */ | ||
141 | |||
142 | /* | ||
143 | * The lower 16 bits are system-specific. Bits 15,11:8 are common and | ||
144 | * defined here. The rest is defined in system-specific headers. | ||
145 | */ | ||
146 | #define KN0X_IO_SSR_DIAGDN (1<<15) /* diagnostic jumper */ | ||
147 | #define KN0X_IO_SSR_SCC_RST (1<<11) /* ~SCC0,1 (Z85C30) reset */ | ||
148 | #define KN0X_IO_SSR_RTC_RST (1<<10) /* ~RTC (DS1287) reset */ | ||
149 | #define KN0X_IO_SSR_ASC_RST (1<<9) /* ~ASC (NCR53C94) reset */ | ||
150 | #define KN0X_IO_SSR_LANCE_RST (1<<8) /* ~LANCE (Am7990) reset */ | ||
151 | |||
152 | #endif /* __ASM_MIPS_DEC_IOASIC_ADDRS_H */ | ||
diff --git a/include/asm-mips/dec/ioasic_ints.h b/include/asm-mips/dec/ioasic_ints.h deleted file mode 100644 index 9aaa9869615f..000000000000 --- a/include/asm-mips/dec/ioasic_ints.h +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Definitions for the interrupt related bits in the I/O ASIC | ||
7 | * interrupt status register (and the interrupt mask register, of course) | ||
8 | * | ||
9 | * Created with Information from: | ||
10 | * | ||
11 | * "DEC 3000 300/400/500/600/700/800/900 AXP Models System Programmer's Manual" | ||
12 | * | ||
13 | * and the Mach Sources | ||
14 | * | ||
15 | * Copyright (C) 199x the Anonymous | ||
16 | * Copyright (C) 2002 Maciej W. Rozycki | ||
17 | */ | ||
18 | |||
19 | #ifndef __ASM_DEC_IOASIC_INTS_H | ||
20 | #define __ASM_DEC_IOASIC_INTS_H | ||
21 | |||
22 | /* | ||
23 | * The upper 16 bits are a part of the I/O ASIC's internal DMA engine | ||
24 | * and thus are common to all I/O ASIC machines. The exception is | ||
25 | * the Maxine, which makes use of the FLOPPY and ISDN bits (otherwise | ||
26 | * unused) and has a different SCC wiring. | ||
27 | */ | ||
28 | /* all systems */ | ||
29 | #define IO_INR_SCC0A_TXDMA 31 /* SCC0A transmit page end */ | ||
30 | #define IO_INR_SCC0A_TXERR 30 /* SCC0A transmit memory read error */ | ||
31 | #define IO_INR_SCC0A_RXDMA 29 /* SCC0A receive half page */ | ||
32 | #define IO_INR_SCC0A_RXERR 28 /* SCC0A receive overrun */ | ||
33 | #define IO_INR_ASC_DMA 19 /* ASC buffer pointer loaded */ | ||
34 | #define IO_INR_ASC_ERR 18 /* ASC page overrun */ | ||
35 | #define IO_INR_ASC_MERR 17 /* ASC memory read error */ | ||
36 | #define IO_INR_LANCE_MERR 16 /* LANCE memory read error */ | ||
37 | |||
38 | /* except Maxine */ | ||
39 | #define IO_INR_SCC1A_TXDMA 27 /* SCC1A transmit page end */ | ||
40 | #define IO_INR_SCC1A_TXERR 26 /* SCC1A transmit memory read error */ | ||
41 | #define IO_INR_SCC1A_RXDMA 25 /* SCC1A receive half page */ | ||
42 | #define IO_INR_SCC1A_RXERR 24 /* SCC1A receive overrun */ | ||
43 | #define IO_INR_RES_23 23 /* unused */ | ||
44 | #define IO_INR_RES_22 22 /* unused */ | ||
45 | #define IO_INR_RES_21 21 /* unused */ | ||
46 | #define IO_INR_RES_20 20 /* unused */ | ||
47 | |||
48 | /* Maxine */ | ||
49 | #define IO_INR_AB_TXDMA 27 /* ACCESS.bus transmit page end */ | ||
50 | #define IO_INR_AB_TXERR 26 /* ACCESS.bus xmit memory read error */ | ||
51 | #define IO_INR_AB_RXDMA 25 /* ACCESS.bus receive half page */ | ||
52 | #define IO_INR_AB_RXERR 24 /* ACCESS.bus receive overrun */ | ||
53 | #define IO_INR_FLOPPY_ERR 23 /* FDC error */ | ||
54 | #define IO_INR_ISDN_TXDMA 22 /* ISDN xmit buffer pointer loaded */ | ||
55 | #define IO_INR_ISDN_RXDMA 21 /* ISDN recv buffer pointer loaded */ | ||
56 | #define IO_INR_ISDN_ERR 20 /* ISDN memory read/overrun error */ | ||
57 | |||
58 | #define IO_INR_DMA 16 /* first DMA IRQ */ | ||
59 | |||
60 | /* | ||
61 | * The lower 16 bits are system-specific and thus defined in | ||
62 | * system-specific headers. | ||
63 | */ | ||
64 | |||
65 | |||
66 | #define IO_IRQ_BASE 8 /* first IRQ assigned to I/O ASIC */ | ||
67 | #define IO_IRQ_LINES 32 /* number of I/O ASIC interrupts */ | ||
68 | |||
69 | #define IO_IRQ_NR(n) ((n) + IO_IRQ_BASE) | ||
70 | #define IO_IRQ_MASK(n) (1 << (n)) | ||
71 | #define IO_IRQ_ALL 0x0000ffff | ||
72 | #define IO_IRQ_DMA 0xffff0000 | ||
73 | |||
74 | #endif /* __ASM_DEC_IOASIC_INTS_H */ | ||
diff --git a/include/asm-mips/dec/kn01.h b/include/asm-mips/dec/kn01.h deleted file mode 100644 index 28fa717ac423..000000000000 --- a/include/asm-mips/dec/kn01.h +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* | ||
2 | * Hardware info about DECstation DS2100/3100 systems (otherwise known as | ||
3 | * pmin/pmax or KN01). | ||
4 | * | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions | ||
10 | * are by courtesy of Chris Fraser. | ||
11 | * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki | ||
12 | */ | ||
13 | #ifndef __ASM_MIPS_DEC_KN01_H | ||
14 | #define __ASM_MIPS_DEC_KN01_H | ||
15 | |||
16 | #define KN01_SLOT_BASE 0x10000000 | ||
17 | #define KN01_SLOT_SIZE 0x01000000 | ||
18 | |||
19 | /* | ||
20 | * Address ranges for devices. | ||
21 | */ | ||
22 | #define KN01_PMASK (0*KN01_SLOT_SIZE) /* color plane mask */ | ||
23 | #define KN01_PCC (1*KN01_SLOT_SIZE) /* PCC (DC503) cursor */ | ||
24 | #define KN01_VDAC (2*KN01_SLOT_SIZE) /* color map */ | ||
25 | #define KN01_RES_3 (3*KN01_SLOT_SIZE) /* unused */ | ||
26 | #define KN01_RES_4 (4*KN01_SLOT_SIZE) /* unused */ | ||
27 | #define KN01_RES_5 (5*KN01_SLOT_SIZE) /* unused */ | ||
28 | #define KN01_RES_6 (6*KN01_SLOT_SIZE) /* unused */ | ||
29 | #define KN01_ERRADDR (7*KN01_SLOT_SIZE) /* write error address */ | ||
30 | #define KN01_LANCE (8*KN01_SLOT_SIZE) /* LANCE (Am7990) Ethernet */ | ||
31 | #define KN01_LANCE_MEM (9*KN01_SLOT_SIZE) /* LANCE buffer memory */ | ||
32 | #define KN01_SII (10*KN01_SLOT_SIZE) /* SII (DC7061) SCSI */ | ||
33 | #define KN01_SII_MEM (11*KN01_SLOT_SIZE) /* SII buffer memory */ | ||
34 | #define KN01_DZ11 (12*KN01_SLOT_SIZE) /* DZ11 (DC7085) serial */ | ||
35 | #define KN01_RTC (13*KN01_SLOT_SIZE) /* DS1287 RTC (bytes #0) */ | ||
36 | #define KN01_ESAR (13*KN01_SLOT_SIZE) /* MAC address (bytes #1) */ | ||
37 | #define KN01_CSR (14*KN01_SLOT_SIZE) /* system ctrl & status reg */ | ||
38 | #define KN01_SYS_ROM (15*KN01_SLOT_SIZE) /* system board ROM */ | ||
39 | |||
40 | |||
41 | /* | ||
42 | * Frame buffer memory address. | ||
43 | */ | ||
44 | #define KN01_VFB_MEM 0x0fc00000 | ||
45 | |||
46 | /* | ||
47 | * CPU interrupt bits. | ||
48 | */ | ||
49 | #define KN01_CPU_INR_BUS 6 /* memory, I/O bus read/write errors */ | ||
50 | #define KN01_CPU_INR_VIDEO 6 /* PCC area detect #2 */ | ||
51 | #define KN01_CPU_INR_RTC 5 /* DS1287 RTC */ | ||
52 | #define KN01_CPU_INR_DZ11 4 /* DZ11 (DC7085) serial */ | ||
53 | #define KN01_CPU_INR_LANCE 3 /* LANCE (Am7990) Ethernet */ | ||
54 | #define KN01_CPU_INR_SII 2 /* SII (DC7061) SCSI */ | ||
55 | |||
56 | |||
57 | /* | ||
58 | * System Control & Status Register bits. | ||
59 | */ | ||
60 | #define KN01_CSR_MNFMOD (1<<15) /* MNFMOD manufacturing jumper */ | ||
61 | #define KN01_CSR_STATUS (1<<14) /* self-test result status output */ | ||
62 | #define KN01_CSR_PARDIS (1<<13) /* parity error disable */ | ||
63 | #define KN01_CSR_CRSRTST (1<<12) /* PCC test output */ | ||
64 | #define KN01_CSR_MONO (1<<11) /* mono/color fb SIMM installed */ | ||
65 | #define KN01_CSR_MEMERR (1<<10) /* write timeout error status & ack*/ | ||
66 | #define KN01_CSR_VINT (1<<9) /* PCC area detect #2 status & ack */ | ||
67 | #define KN01_CSR_TXDIS (1<<8) /* DZ11 transmit disable */ | ||
68 | #define KN01_CSR_VBGTRG (1<<2) /* blue DAC voltage over green (r/o) */ | ||
69 | #define KN01_CSR_VRGTRG (1<<1) /* red DAC voltage over green (r/o) */ | ||
70 | #define KN01_CSR_VRGTRB (1<<0) /* red DAC voltage over blue (r/o) */ | ||
71 | #define KN01_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */ | ||
72 | |||
73 | |||
74 | #ifndef __ASSEMBLY__ | ||
75 | |||
76 | #include <linux/interrupt.h> | ||
77 | #include <linux/spinlock.h> | ||
78 | #include <linux/types.h> | ||
79 | |||
80 | struct pt_regs; | ||
81 | |||
82 | extern u16 cached_kn01_csr; | ||
83 | extern spinlock_t kn01_lock; | ||
84 | |||
85 | extern void dec_kn01_be_init(void); | ||
86 | extern int dec_kn01_be_handler(struct pt_regs *regs, int is_fixup); | ||
87 | extern irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id); | ||
88 | #endif | ||
89 | |||
90 | #endif /* __ASM_MIPS_DEC_KN01_H */ | ||
diff --git a/include/asm-mips/dec/kn02.h b/include/asm-mips/dec/kn02.h deleted file mode 100644 index 93430b5f4724..000000000000 --- a/include/asm-mips/dec/kn02.h +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | /* | ||
2 | * Hardware info about DECstation 5000/200 systems (otherwise known as | ||
3 | * 3max or KN02). | ||
4 | * | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions | ||
10 | * are by courtesy of Chris Fraser. | ||
11 | * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki | ||
12 | */ | ||
13 | #ifndef __ASM_MIPS_DEC_KN02_H | ||
14 | #define __ASM_MIPS_DEC_KN02_H | ||
15 | |||
16 | #define KN02_SLOT_BASE 0x1fc00000 | ||
17 | #define KN02_SLOT_SIZE 0x00080000 | ||
18 | |||
19 | /* | ||
20 | * Address ranges decoded by the "system slot" logic for onboard devices. | ||
21 | */ | ||
22 | #define KN02_SYS_ROM (0*KN02_SLOT_SIZE) /* system board ROM */ | ||
23 | #define KN02_RES_1 (1*KN02_SLOT_SIZE) /* unused */ | ||
24 | #define KN02_CHKSYN (2*KN02_SLOT_SIZE) /* ECC syndrome */ | ||
25 | #define KN02_ERRADDR (3*KN02_SLOT_SIZE) /* bus error address */ | ||
26 | #define KN02_DZ11 (4*KN02_SLOT_SIZE) /* DZ11 (DC7085) serial */ | ||
27 | #define KN02_RTC (5*KN02_SLOT_SIZE) /* DS1287 RTC */ | ||
28 | #define KN02_CSR (6*KN02_SLOT_SIZE) /* system ctrl & status reg */ | ||
29 | #define KN02_SYS_ROM_7 (7*KN02_SLOT_SIZE) /* system board ROM (alias) */ | ||
30 | |||
31 | |||
32 | /* | ||
33 | * System Control & Status Register bits. | ||
34 | */ | ||
35 | #define KN02_CSR_RES_28 (0xf<<28) /* unused */ | ||
36 | #define KN02_CSR_PSU (1<<27) /* power supply unit warning */ | ||
37 | #define KN02_CSR_NVRAM (1<<26) /* ~NVRAM clear jumper */ | ||
38 | #define KN02_CSR_REFEVEN (1<<25) /* mem refresh bank toggle */ | ||
39 | #define KN02_CSR_NRMOD (1<<24) /* ~NRMOD manufact. jumper */ | ||
40 | #define KN02_CSR_IOINTEN (0xff<<16) /* IRQ mask bits */ | ||
41 | #define KN02_CSR_DIAGCHK (1<<15) /* diagn/norml ECC reads */ | ||
42 | #define KN02_CSR_DIAGGEN (1<<14) /* diagn/norml ECC writes */ | ||
43 | #define KN02_CSR_CORRECT (1<<13) /* ECC correct/check */ | ||
44 | #define KN02_CSR_LEDIAG (1<<12) /* ECC diagn. latch strobe */ | ||
45 | #define KN02_CSR_TXDIS (1<<11) /* DZ11 transmit disable */ | ||
46 | #define KN02_CSR_BNK32M (1<<10) /* 32M/8M stride */ | ||
47 | #define KN02_CSR_DIAGDN (1<<9) /* DIAGDN manufact. jumper */ | ||
48 | #define KN02_CSR_BAUD38 (1<<8) /* DZ11 38/19kbps ext. rate */ | ||
49 | #define KN02_CSR_IOINT (0xff<<0) /* IRQ status bits (r/o) */ | ||
50 | #define KN02_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */ | ||
51 | |||
52 | |||
53 | /* | ||
54 | * CPU interrupt bits. | ||
55 | */ | ||
56 | #define KN02_CPU_INR_RES_6 6 /* unused */ | ||
57 | #define KN02_CPU_INR_BUS 5 /* memory, I/O bus read/write errors */ | ||
58 | #define KN02_CPU_INR_RES_4 4 /* unused */ | ||
59 | #define KN02_CPU_INR_RTC 3 /* DS1287 RTC */ | ||
60 | #define KN02_CPU_INR_CASCADE 2 /* CSR cascade */ | ||
61 | |||
62 | /* | ||
63 | * CSR interrupt bits. | ||
64 | */ | ||
65 | #define KN02_CSR_INR_DZ11 7 /* DZ11 (DC7085) serial */ | ||
66 | #define KN02_CSR_INR_LANCE 6 /* LANCE (Am7990) Ethernet */ | ||
67 | #define KN02_CSR_INR_ASC 5 /* ASC (NCR53C94) SCSI */ | ||
68 | #define KN02_CSR_INR_RES_4 4 /* unused */ | ||
69 | #define KN02_CSR_INR_RES_3 3 /* unused */ | ||
70 | #define KN02_CSR_INR_TC2 2 /* TURBOchannel slot #2 */ | ||
71 | #define KN02_CSR_INR_TC1 1 /* TURBOchannel slot #1 */ | ||
72 | #define KN02_CSR_INR_TC0 0 /* TURBOchannel slot #0 */ | ||
73 | |||
74 | |||
75 | #define KN02_IRQ_BASE 8 /* first IRQ assigned to CSR */ | ||
76 | #define KN02_IRQ_LINES 8 /* number of CSR interrupts */ | ||
77 | |||
78 | #define KN02_IRQ_NR(n) ((n) + KN02_IRQ_BASE) | ||
79 | #define KN02_IRQ_MASK(n) (1 << (n)) | ||
80 | #define KN02_IRQ_ALL 0xff | ||
81 | |||
82 | |||
83 | #ifndef __ASSEMBLY__ | ||
84 | |||
85 | #include <linux/types.h> | ||
86 | |||
87 | extern u32 cached_kn02_csr; | ||
88 | extern void init_kn02_irqs(int base); | ||
89 | #endif | ||
90 | |||
91 | #endif /* __ASM_MIPS_DEC_KN02_H */ | ||
diff --git a/include/asm-mips/dec/kn02ba.h b/include/asm-mips/dec/kn02ba.h deleted file mode 100644 index c957a4f1b32d..000000000000 --- a/include/asm-mips/dec/kn02ba.h +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/dec/kn02ba.h | ||
3 | * | ||
4 | * DECstation 5000/1xx (3min or KN02-BA) definitions. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2003 Maciej W. Rozycki | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | #ifndef __ASM_MIPS_DEC_KN02BA_H | ||
14 | #define __ASM_MIPS_DEC_KN02BA_H | ||
15 | |||
16 | #include <asm/dec/kn02xa.h> /* For common definitions. */ | ||
17 | |||
18 | /* | ||
19 | * CPU interrupt bits. | ||
20 | */ | ||
21 | #define KN02BA_CPU_INR_HALT 6 /* HALT button */ | ||
22 | #define KN02BA_CPU_INR_CASCADE 5 /* I/O ASIC cascade */ | ||
23 | #define KN02BA_CPU_INR_TC2 4 /* TURBOchannel slot #2 */ | ||
24 | #define KN02BA_CPU_INR_TC1 3 /* TURBOchannel slot #1 */ | ||
25 | #define KN02BA_CPU_INR_TC0 2 /* TURBOchannel slot #0 */ | ||
26 | |||
27 | /* | ||
28 | * I/O ASIC interrupt bits. Star marks denote non-IRQ status bits. | ||
29 | */ | ||
30 | #define KN02BA_IO_INR_RES_15 15 /* unused */ | ||
31 | #define KN02BA_IO_INR_NVRAM 14 /* (*) NVRAM clear jumper */ | ||
32 | #define KN02BA_IO_INR_RES_13 13 /* unused */ | ||
33 | #define KN02BA_IO_INR_BUS 12 /* memory, I/O bus read/write errors */ | ||
34 | #define KN02BA_IO_INR_RES_11 11 /* unused */ | ||
35 | #define KN02BA_IO_INR_NRMOD 10 /* (*) NRMOD manufacturing jumper */ | ||
36 | #define KN02BA_IO_INR_ASC 9 /* ASC (NCR53C94) SCSI */ | ||
37 | #define KN02BA_IO_INR_LANCE 8 /* LANCE (Am7990) Ethernet */ | ||
38 | #define KN02BA_IO_INR_SCC1 7 /* SCC (Z85C30) serial #1 */ | ||
39 | #define KN02BA_IO_INR_SCC0 6 /* SCC (Z85C30) serial #0 */ | ||
40 | #define KN02BA_IO_INR_RTC 5 /* DS1287 RTC */ | ||
41 | #define KN02BA_IO_INR_PSU 4 /* power supply unit warning */ | ||
42 | #define KN02BA_IO_INR_RES_3 3 /* unused */ | ||
43 | #define KN02BA_IO_INR_ASC_DATA 2 /* SCSI data ready (for PIO) */ | ||
44 | #define KN02BA_IO_INR_PBNC 1 /* ~HALT button debouncer */ | ||
45 | #define KN02BA_IO_INR_PBNO 0 /* HALT button debouncer */ | ||
46 | |||
47 | |||
48 | /* | ||
49 | * Memory Error Register bits. | ||
50 | */ | ||
51 | #define KN02BA_MER_RES_27 (1<<27) /* unused */ | ||
52 | |||
53 | /* | ||
54 | * Memory Size Register bits. | ||
55 | */ | ||
56 | #define KN02BA_MSR_RES_17 (0x3ff<<17) /* unused */ | ||
57 | |||
58 | /* | ||
59 | * I/O ASIC System Support Register bits. | ||
60 | */ | ||
61 | #define KN02BA_IO_SSR_TXDIS1 (1<<14) /* SCC1 transmit disable */ | ||
62 | #define KN02BA_IO_SSR_TXDIS0 (1<<13) /* SCC0 transmit disable */ | ||
63 | #define KN02BA_IO_SSR_RES_12 (1<<12) /* unused */ | ||
64 | |||
65 | #define KN02BA_IO_SSR_LEDS (0xff<<0) /* ~diagnostic LEDs */ | ||
66 | |||
67 | #endif /* __ASM_MIPS_DEC_KN02BA_H */ | ||
diff --git a/include/asm-mips/dec/kn02ca.h b/include/asm-mips/dec/kn02ca.h deleted file mode 100644 index 92c0fe256099..000000000000 --- a/include/asm-mips/dec/kn02ca.h +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/dec/kn02ca.h | ||
3 | * | ||
4 | * Personal DECstation 5000/xx (Maxine or KN02-CA) definitions. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2003 Maciej W. Rozycki | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | #ifndef __ASM_MIPS_DEC_KN02CA_H | ||
14 | #define __ASM_MIPS_DEC_KN02CA_H | ||
15 | |||
16 | #include <asm/dec/kn02xa.h> /* For common definitions. */ | ||
17 | |||
18 | /* | ||
19 | * CPU interrupt bits. | ||
20 | */ | ||
21 | #define KN02CA_CPU_INR_HALT 6 /* HALT from ACCESS.Bus */ | ||
22 | #define KN02CA_CPU_INR_CASCADE 5 /* I/O ASIC cascade */ | ||
23 | #define KN02CA_CPU_INR_BUS 4 /* memory, I/O bus read/write errors */ | ||
24 | #define KN02CA_CPU_INR_RTC 3 /* DS1287 RTC */ | ||
25 | #define KN02CA_CPU_INR_TIMER 2 /* ARC periodic timer */ | ||
26 | |||
27 | /* | ||
28 | * I/O ASIC interrupt bits. Star marks denote non-IRQ status bits. | ||
29 | */ | ||
30 | #define KN02CA_IO_INR_FLOPPY 15 /* 82077 FDC */ | ||
31 | #define KN02CA_IO_INR_NVRAM 14 /* (*) NVRAM clear jumper */ | ||
32 | #define KN02CA_IO_INR_POWERON 13 /* (*) ACCESS.Bus/power-on reset */ | ||
33 | #define KN02CA_IO_INR_TC0 12 /* TURBOchannel slot #0 */ | ||
34 | #define KN02CA_IO_INR_TIMER 12 /* ARC periodic timer (?) */ | ||
35 | #define KN02CA_IO_INR_ISDN 11 /* Am79C30A ISDN */ | ||
36 | #define KN02CA_IO_INR_NRMOD 10 /* (*) NRMOD manufacturing jumper */ | ||
37 | #define KN02CA_IO_INR_ASC 9 /* ASC (NCR53C94) SCSI */ | ||
38 | #define KN02CA_IO_INR_LANCE 8 /* LANCE (Am7990) Ethernet */ | ||
39 | #define KN02CA_IO_INR_HDFLOPPY 7 /* (*) HD (1.44MB) floppy status */ | ||
40 | #define KN02CA_IO_INR_SCC0 6 /* SCC (Z85C30) serial #0 */ | ||
41 | #define KN02CA_IO_INR_TC1 5 /* TURBOchannel slot #1 */ | ||
42 | #define KN02CA_IO_INR_XDFLOPPY 4 /* (*) XD (2.88MB) floppy status */ | ||
43 | #define KN02CA_IO_INR_VIDEO 3 /* framebuffer */ | ||
44 | #define KN02CA_IO_INR_XVIDEO 2 /* ~framebuffer */ | ||
45 | #define KN02CA_IO_INR_AB_XMIT 1 /* ACCESS.bus transmit */ | ||
46 | #define KN02CA_IO_INR_AB_RECV 0 /* ACCESS.bus receive */ | ||
47 | |||
48 | |||
49 | /* | ||
50 | * Memory Error Register bits. | ||
51 | */ | ||
52 | #define KN02CA_MER_INTR (1<<27) /* ARC IRQ status & ack */ | ||
53 | |||
54 | /* | ||
55 | * Memory Size Register bits. | ||
56 | */ | ||
57 | #define KN02CA_MSR_INTREN (1<<26) /* ARC periodic IRQ enable */ | ||
58 | #define KN02CA_MSR_MS10EN (1<<25) /* 10/1ms IRQ period select */ | ||
59 | #define KN02CA_MSR_PFORCE (0xf<<21) /* byte lane error force */ | ||
60 | #define KN02CA_MSR_MABEN (1<<20) /* A side VFB address enable */ | ||
61 | #define KN02CA_MSR_LASTBANK (0x7<<17) /* onboard RAM bank # */ | ||
62 | |||
63 | /* | ||
64 | * I/O ASIC System Support Register bits. | ||
65 | */ | ||
66 | #define KN03CA_IO_SSR_RES_14 (1<<14) /* unused */ | ||
67 | #define KN03CA_IO_SSR_RES_13 (1<<13) /* unused */ | ||
68 | #define KN03CA_IO_SSR_ISDN_RST (1<<12) /* ~ISDN (Am79C30A) reset */ | ||
69 | |||
70 | #define KN03CA_IO_SSR_FLOPPY_RST (1<<7) /* ~FDC (82077) reset */ | ||
71 | #define KN03CA_IO_SSR_VIDEO_RST (1<<6) /* ~framebuffer reset */ | ||
72 | #define KN03CA_IO_SSR_AB_RST (1<<5) /* ACCESS.bus reset */ | ||
73 | #define KN03CA_IO_SSR_RES_4 (1<<4) /* unused */ | ||
74 | #define KN03CA_IO_SSR_RES_3 (1<<4) /* unused */ | ||
75 | #define KN03CA_IO_SSR_RES_2 (1<<2) /* unused */ | ||
76 | #define KN03CA_IO_SSR_RES_1 (1<<1) /* unused */ | ||
77 | #define KN03CA_IO_SSR_LED (1<<0) /* power LED */ | ||
78 | |||
79 | #endif /* __ASM_MIPS_DEC_KN02CA_H */ | ||
diff --git a/include/asm-mips/dec/kn02xa.h b/include/asm-mips/dec/kn02xa.h deleted file mode 100644 index b56b4577f6ef..000000000000 --- a/include/asm-mips/dec/kn02xa.h +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | /* | ||
2 | * Hardware info common to DECstation 5000/1xx systems (otherwise | ||
3 | * known as 3min or kn02ba) and Personal DECstations 5000/xx ones | ||
4 | * (otherwise known as maxine or kn02ca). | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions | ||
11 | * are by courtesy of Chris Fraser. | ||
12 | * Copyright (C) 2000, 2002, 2003, 2005 Maciej W. Rozycki | ||
13 | * | ||
14 | * These are addresses which have to be known early in the boot process. | ||
15 | * For other addresses refer to tc.h, ioasic_addrs.h and friends. | ||
16 | */ | ||
17 | #ifndef __ASM_MIPS_DEC_KN02XA_H | ||
18 | #define __ASM_MIPS_DEC_KN02XA_H | ||
19 | |||
20 | #include <asm/dec/ioasic_addrs.h> | ||
21 | |||
22 | #define KN02XA_SLOT_BASE 0x1c000000 | ||
23 | |||
24 | /* | ||
25 | * Memory control ASIC registers. | ||
26 | */ | ||
27 | #define KN02XA_MER 0x0c400000 /* memory error register */ | ||
28 | #define KN02XA_MSR 0x0c800000 /* memory size register */ | ||
29 | |||
30 | /* | ||
31 | * CPU control ASIC registers. | ||
32 | */ | ||
33 | #define KN02XA_MEM_CONF 0x0e000000 /* write timeout config */ | ||
34 | #define KN02XA_EAR 0x0e000004 /* error address register */ | ||
35 | #define KN02XA_BOOT0 0x0e000008 /* boot 0 register */ | ||
36 | #define KN02XA_MEM_INTR 0x0e00000c /* write err IRQ stat & ack */ | ||
37 | |||
38 | /* | ||
39 | * Memory Error Register bits, common definitions. | ||
40 | * The rest is defined in system-specific headers. | ||
41 | */ | ||
42 | #define KN02XA_MER_RES_28 (0xf<<28) /* unused */ | ||
43 | #define KN02XA_MER_RES_17 (0x3ff<<17) /* unused */ | ||
44 | #define KN02XA_MER_PAGERR (1<<16) /* 2k page boundary error */ | ||
45 | #define KN02XA_MER_TRANSERR (1<<15) /* transfer length error */ | ||
46 | #define KN02XA_MER_PARDIS (1<<14) /* parity error disable */ | ||
47 | #define KN02XA_MER_SIZE (1<<13) /* r/o mirror of MSR_SIZE */ | ||
48 | #define KN02XA_MER_RES_12 (1<<12) /* unused */ | ||
49 | #define KN02XA_MER_BYTERR (0xf<<8) /* byte lane error bitmask: */ | ||
50 | #define KN02XA_MER_BYTERR_3 (0x8<<8) /* byte lane #3 */ | ||
51 | #define KN02XA_MER_BYTERR_2 (0x4<<8) /* byte lane #2 */ | ||
52 | #define KN02XA_MER_BYTERR_1 (0x2<<8) /* byte lane #1 */ | ||
53 | #define KN02XA_MER_BYTERR_0 (0x1<<8) /* byte lane #0 */ | ||
54 | #define KN02XA_MER_RES_0 (0xff<<0) /* unused */ | ||
55 | |||
56 | /* | ||
57 | * Memory Size Register bits, common definitions. | ||
58 | * The rest is defined in system-specific headers. | ||
59 | */ | ||
60 | #define KN02XA_MSR_RES_27 (0x1f<<27) /* unused */ | ||
61 | #define KN02XA_MSR_RES_14 (0x7<<14) /* unused */ | ||
62 | #define KN02XA_MSR_SIZE (1<<13) /* 16M/4M stride */ | ||
63 | #define KN02XA_MSR_RES_0 (0x1fff<<0) /* unused */ | ||
64 | |||
65 | /* | ||
66 | * Error Address Register bits. | ||
67 | */ | ||
68 | #define KN02XA_EAR_RES_29 (0x7<<29) /* unused */ | ||
69 | #define KN02XA_EAR_ADDRESS (0x7ffffff<<2) /* address involved */ | ||
70 | #define KN02XA_EAR_RES_0 (0x3<<0) /* unused */ | ||
71 | |||
72 | |||
73 | #ifndef __ASSEMBLY__ | ||
74 | |||
75 | #include <linux/interrupt.h> | ||
76 | |||
77 | struct pt_regs; | ||
78 | |||
79 | extern void dec_kn02xa_be_init(void); | ||
80 | extern int dec_kn02xa_be_handler(struct pt_regs *regs, int is_fixup); | ||
81 | extern irqreturn_t dec_kn02xa_be_interrupt(int irq, void *dev_id); | ||
82 | #endif | ||
83 | |||
84 | #endif /* __ASM_MIPS_DEC_KN02XA_H */ | ||
diff --git a/include/asm-mips/dec/kn03.h b/include/asm-mips/dec/kn03.h deleted file mode 100644 index edede923ffb8..000000000000 --- a/include/asm-mips/dec/kn03.h +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | /* | ||
2 | * Hardware info about DECstation 5000/2x0 systems (otherwise known as | ||
3 | * 3max+) and DECsystem 5900 systems (otherwise known as bigmax) which | ||
4 | * differ mechanically but are otherwise identical (both are known as | ||
5 | * KN03). | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General Public | ||
8 | * License. See the file "COPYING" in the main directory of this archive | ||
9 | * for more details. | ||
10 | * | ||
11 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions | ||
12 | * are by courtesy of Chris Fraser. | ||
13 | * Copyright (C) 2000, 2002, 2003, 2005 Maciej W. Rozycki | ||
14 | */ | ||
15 | #ifndef __ASM_MIPS_DEC_KN03_H | ||
16 | #define __ASM_MIPS_DEC_KN03_H | ||
17 | |||
18 | #include <asm/dec/ecc.h> | ||
19 | #include <asm/dec/ioasic_addrs.h> | ||
20 | |||
21 | #define KN03_SLOT_BASE 0x1f800000 | ||
22 | |||
23 | /* | ||
24 | * CPU interrupt bits. | ||
25 | */ | ||
26 | #define KN03_CPU_INR_HALT 6 /* HALT button */ | ||
27 | #define KN03_CPU_INR_BUS 5 /* memory, I/O bus read/write errors */ | ||
28 | #define KN03_CPU_INR_RES_4 4 /* unused */ | ||
29 | #define KN03_CPU_INR_RTC 3 /* DS1287 RTC */ | ||
30 | #define KN03_CPU_INR_CASCADE 2 /* I/O ASIC cascade */ | ||
31 | |||
32 | /* | ||
33 | * I/O ASIC interrupt bits. Star marks denote non-IRQ status bits. | ||
34 | */ | ||
35 | #define KN03_IO_INR_3MAXP 15 /* (*) 3max+/bigmax ID */ | ||
36 | #define KN03_IO_INR_NVRAM 14 /* (*) NVRAM clear jumper */ | ||
37 | #define KN03_IO_INR_TC2 13 /* TURBOchannel slot #2 */ | ||
38 | #define KN03_IO_INR_TC1 12 /* TURBOchannel slot #1 */ | ||
39 | #define KN03_IO_INR_TC0 11 /* TURBOchannel slot #0 */ | ||
40 | #define KN03_IO_INR_NRMOD 10 /* (*) NRMOD manufacturing jumper */ | ||
41 | #define KN03_IO_INR_ASC 9 /* ASC (NCR53C94) SCSI */ | ||
42 | #define KN03_IO_INR_LANCE 8 /* LANCE (Am7990) Ethernet */ | ||
43 | #define KN03_IO_INR_SCC1 7 /* SCC (Z85C30) serial #1 */ | ||
44 | #define KN03_IO_INR_SCC0 6 /* SCC (Z85C30) serial #0 */ | ||
45 | #define KN03_IO_INR_RTC 5 /* DS1287 RTC */ | ||
46 | #define KN03_IO_INR_PSU 4 /* power supply unit warning */ | ||
47 | #define KN03_IO_INR_RES_3 3 /* unused */ | ||
48 | #define KN03_IO_INR_ASC_DATA 2 /* SCSI data ready (for PIO) */ | ||
49 | #define KN03_IO_INR_PBNC 1 /* ~HALT button debouncer */ | ||
50 | #define KN03_IO_INR_PBNO 0 /* HALT button debouncer */ | ||
51 | |||
52 | |||
53 | /* | ||
54 | * Memory Control Register bits. | ||
55 | */ | ||
56 | #define KN03_MCR_RES_16 (0xffff<<16) /* unused */ | ||
57 | #define KN03_MCR_DIAGCHK (1<<15) /* diagn/norml ECC reads */ | ||
58 | #define KN03_MCR_DIAGGEN (1<<14) /* diagn/norml ECC writes */ | ||
59 | #define KN03_MCR_CORRECT (1<<13) /* ECC correct/check */ | ||
60 | #define KN03_MCR_RES_11 (0x3<<12) /* unused */ | ||
61 | #define KN03_MCR_BNK32M (1<<10) /* 32M/8M stride */ | ||
62 | #define KN03_MCR_RES_7 (0x7<<7) /* unused */ | ||
63 | #define KN03_MCR_CHECK (0x7f<<0) /* diagnostic check bits */ | ||
64 | |||
65 | /* | ||
66 | * I/O ASIC System Support Register bits. | ||
67 | */ | ||
68 | #define KN03_IO_SSR_TXDIS1 (1<<14) /* SCC1 transmit disable */ | ||
69 | #define KN03_IO_SSR_TXDIS0 (1<<13) /* SCC0 transmit disable */ | ||
70 | #define KN03_IO_SSR_RES_12 (1<<12) /* unused */ | ||
71 | |||
72 | #define KN03_IO_SSR_LEDS (0xff<<0) /* ~diagnostic LEDs */ | ||
73 | |||
74 | #endif /* __ASM_MIPS_DEC_KN03_H */ | ||
diff --git a/include/asm-mips/dec/kn05.h b/include/asm-mips/dec/kn05.h deleted file mode 100644 index 56d22dc8803a..000000000000 --- a/include/asm-mips/dec/kn05.h +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/dec/kn05.h | ||
3 | * | ||
4 | * DECstation/DECsystem 5000/260 (4max+ or KN05), 5000/150 (4min | ||
5 | * or KN04-BA), Personal DECstation/DECsystem 5000/50 (4maxine or | ||
6 | * KN04-CA) and DECsystem 5900/260 (KN05) R4k CPU card MB ASIC | ||
7 | * definitions. | ||
8 | * | ||
9 | * Copyright (C) 2002, 2003, 2005, 2008 Maciej W. Rozycki | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License | ||
13 | * as published by the Free Software Foundation; either version | ||
14 | * 2 of the License, or (at your option) any later version. | ||
15 | * | ||
16 | * WARNING! All this information is pure guesswork based on the | ||
17 | * ROM. It is provided here in hope it will give someone some | ||
18 | * food for thought. No documentation for the KN05 nor the KN04 | ||
19 | * module has been located so far. | ||
20 | */ | ||
21 | #ifndef __ASM_MIPS_DEC_KN05_H | ||
22 | #define __ASM_MIPS_DEC_KN05_H | ||
23 | |||
24 | #include <asm/dec/ioasic_addrs.h> | ||
25 | |||
26 | /* | ||
27 | * The oncard MB (Memory Buffer) ASIC provides an additional address | ||
28 | * decoder. Certain address ranges within the "high" 16 slots are | ||
29 | * passed to the I/O ASIC's decoder like with the KN03 or KN02-BA/CA. | ||
30 | * Others are handled locally. "Low" slots are always passed. | ||
31 | */ | ||
32 | #define KN4K_SLOT_BASE 0x1fc00000 | ||
33 | |||
34 | #define KN4K_MB_ROM (0*IOASIC_SLOT_SIZE) /* KN05/KN04 card ROM */ | ||
35 | #define KN4K_IOCTL (1*IOASIC_SLOT_SIZE) /* I/O ASIC */ | ||
36 | #define KN4K_ESAR (2*IOASIC_SLOT_SIZE) /* LANCE MAC address chip */ | ||
37 | #define KN4K_LANCE (3*IOASIC_SLOT_SIZE) /* LANCE Ethernet */ | ||
38 | #define KN4K_MB_INT (4*IOASIC_SLOT_SIZE) /* MB interrupt register */ | ||
39 | #define KN4K_MB_EA (5*IOASIC_SLOT_SIZE) /* MB error address? */ | ||
40 | #define KN4K_MB_EC (6*IOASIC_SLOT_SIZE) /* MB error ??? */ | ||
41 | #define KN4K_MB_CSR (7*IOASIC_SLOT_SIZE) /* MB control & status */ | ||
42 | #define KN4K_RES_08 (8*IOASIC_SLOT_SIZE) /* unused? */ | ||
43 | #define KN4K_RES_09 (9*IOASIC_SLOT_SIZE) /* unused? */ | ||
44 | #define KN4K_RES_10 (10*IOASIC_SLOT_SIZE) /* unused? */ | ||
45 | #define KN4K_RES_11 (11*IOASIC_SLOT_SIZE) /* unused? */ | ||
46 | #define KN4K_SCSI (12*IOASIC_SLOT_SIZE) /* ASC SCSI */ | ||
47 | #define KN4K_RES_13 (13*IOASIC_SLOT_SIZE) /* unused? */ | ||
48 | #define KN4K_RES_14 (14*IOASIC_SLOT_SIZE) /* unused? */ | ||
49 | #define KN4K_RES_15 (15*IOASIC_SLOT_SIZE) /* unused? */ | ||
50 | |||
51 | /* | ||
52 | * Bits for the MB interrupt register. | ||
53 | * The register appears read-only. | ||
54 | */ | ||
55 | #define KN4K_MB_INT_TC (1<<0) /* TURBOchannel? */ | ||
56 | #define KN4K_MB_INT_RTC (1<<1) /* RTC? */ | ||
57 | #define KN4K_MB_INT_MT (1<<3) /* I/O ASIC cascade */ | ||
58 | |||
59 | /* | ||
60 | * Bits for the MB control & status register. | ||
61 | * Set to 0x00bf8001 for KN05 and to 0x003f8000 for KN04 by the firmware. | ||
62 | */ | ||
63 | #define KN4K_MB_CSR_PF (1<<0) /* PreFetching enable? */ | ||
64 | #define KN4K_MB_CSR_F (1<<1) /* ??? */ | ||
65 | #define KN4K_MB_CSR_ECC (0xff<<2) /* ??? */ | ||
66 | #define KN4K_MB_CSR_OD (1<<10) /* ??? */ | ||
67 | #define KN4K_MB_CSR_CP (1<<11) /* ??? */ | ||
68 | #define KN4K_MB_CSR_UNC (1<<12) /* ??? */ | ||
69 | #define KN4K_MB_CSR_IM (1<<13) /* ??? */ | ||
70 | #define KN4K_MB_CSR_NC (1<<14) /* ??? */ | ||
71 | #define KN4K_MB_CSR_EE (1<<15) /* (bus) Exception Enable? */ | ||
72 | #define KN4K_MB_CSR_MSK (0x1f<<16) /* CPU Int[4:0] mask */ | ||
73 | #define KN4K_MB_CSR_FW (1<<21) /* ??? */ | ||
74 | #define KN4K_MB_CSR_W (1<<31) /* ??? */ | ||
75 | |||
76 | #endif /* __ASM_MIPS_DEC_KN05_H */ | ||
diff --git a/include/asm-mips/dec/kn230.h b/include/asm-mips/dec/kn230.h deleted file mode 100644 index ff1bf17de8d8..000000000000 --- a/include/asm-mips/dec/kn230.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/dec/kn230.h | ||
3 | * | ||
4 | * DECsystem 5100 (MIPSmate or KN230) definitions. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2003 Maciej W. Rozycki | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | #ifndef __ASM_MIPS_DEC_KN230_H | ||
14 | #define __ASM_MIPS_DEC_KN230_H | ||
15 | |||
16 | /* | ||
17 | * CPU interrupt bits. | ||
18 | */ | ||
19 | #define KN230_CPU_INR_HALT 6 /* HALT button */ | ||
20 | #define KN230_CPU_INR_BUS 5 /* memory, I/O bus read/write errors */ | ||
21 | #define KN230_CPU_INR_RTC 4 /* DS1287 RTC */ | ||
22 | #define KN230_CPU_INR_SII 3 /* SII (DC7061) SCSI */ | ||
23 | #define KN230_CPU_INR_LANCE 3 /* LANCE (Am7990) Ethernet */ | ||
24 | #define KN230_CPU_INR_DZ11 2 /* DZ11 (DC7085) serial */ | ||
25 | |||
26 | #endif /* __ASM_MIPS_DEC_KN230_H */ | ||
diff --git a/include/asm-mips/dec/machtype.h b/include/asm-mips/dec/machtype.h deleted file mode 100644 index a6ecdebc430a..000000000000 --- a/include/asm-mips/dec/machtype.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * Various machine type macros | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (c) 1998, 2000 Harald Koerfgen | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_DEC_MACHTYPE_H | ||
12 | #define __ASM_DEC_MACHTYPE_H | ||
13 | |||
14 | #include <asm/bootinfo.h> | ||
15 | |||
16 | #define TURBOCHANNEL (mips_machtype == MACH_DS5000_200 || \ | ||
17 | mips_machtype == MACH_DS5000_1XX || \ | ||
18 | mips_machtype == MACH_DS5000_XX || \ | ||
19 | mips_machtype == MACH_DS5000_2X0 || \ | ||
20 | mips_machtype == MACH_DS5900) | ||
21 | |||
22 | #define IOASIC (mips_machtype == MACH_DS5000_1XX || \ | ||
23 | mips_machtype == MACH_DS5000_XX || \ | ||
24 | mips_machtype == MACH_DS5000_2X0 || \ | ||
25 | mips_machtype == MACH_DS5900) | ||
26 | |||
27 | #endif | ||
diff --git a/include/asm-mips/dec/prom.h b/include/asm-mips/dec/prom.h deleted file mode 100644 index b9c8203688d5..000000000000 --- a/include/asm-mips/dec/prom.h +++ /dev/null | |||
@@ -1,174 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/dec/prom.h | ||
3 | * | ||
4 | * DECstation PROM interface. | ||
5 | * | ||
6 | * Copyright (C) 2002 Maciej W. Rozycki | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * | ||
13 | * Based on arch/mips/dec/prom/prom.h by the Anonymous. | ||
14 | */ | ||
15 | #ifndef _ASM_DEC_PROM_H | ||
16 | #define _ASM_DEC_PROM_H | ||
17 | |||
18 | #include <linux/types.h> | ||
19 | |||
20 | #include <asm/addrspace.h> | ||
21 | |||
22 | /* | ||
23 | * PMAX/3MAX PROM entry points for DS2100/3100's and DS5000/2xx's. | ||
24 | * Many of these will work for MIPSen as well! | ||
25 | */ | ||
26 | #define VEC_RESET (u64 *)CKSEG1ADDR(0x1fc00000) | ||
27 | /* Prom base address */ | ||
28 | |||
29 | #define PMAX_PROM_ENTRY(x) (VEC_RESET + (x)) /* Prom jump table */ | ||
30 | |||
31 | #define PMAX_PROM_HALT PMAX_PROM_ENTRY(2) /* valid on MIPSen */ | ||
32 | #define PMAX_PROM_AUTOBOOT PMAX_PROM_ENTRY(5) /* valid on MIPSen */ | ||
33 | #define PMAX_PROM_OPEN PMAX_PROM_ENTRY(6) | ||
34 | #define PMAX_PROM_READ PMAX_PROM_ENTRY(7) | ||
35 | #define PMAX_PROM_CLOSE PMAX_PROM_ENTRY(10) | ||
36 | #define PMAX_PROM_LSEEK PMAX_PROM_ENTRY(11) | ||
37 | #define PMAX_PROM_GETCHAR PMAX_PROM_ENTRY(12) | ||
38 | #define PMAX_PROM_PUTCHAR PMAX_PROM_ENTRY(13) /* 12 on MIPSen */ | ||
39 | #define PMAX_PROM_GETS PMAX_PROM_ENTRY(15) | ||
40 | #define PMAX_PROM_PRINTF PMAX_PROM_ENTRY(17) | ||
41 | #define PMAX_PROM_GETENV PMAX_PROM_ENTRY(33) /* valid on MIPSen */ | ||
42 | |||
43 | |||
44 | /* | ||
45 | * Magic number indicating REX PROM available on DECstation. Found in | ||
46 | * register a2 on transfer of control to program from PROM. | ||
47 | */ | ||
48 | #define REX_PROM_MAGIC 0x30464354 | ||
49 | |||
50 | #ifdef CONFIG_64BIT | ||
51 | |||
52 | #define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */ | ||
53 | |||
54 | #else /* !CONFIG_64BIT */ | ||
55 | |||
56 | #define prom_is_rex(magic) ((magic) == REX_PROM_MAGIC) | ||
57 | |||
58 | #endif /* !CONFIG_64BIT */ | ||
59 | |||
60 | |||
61 | /* | ||
62 | * 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and | ||
63 | * DS5000/2x0. | ||
64 | */ | ||
65 | #define REX_PROM_GETBITMAP 0x84/4 /* get mem bitmap */ | ||
66 | #define REX_PROM_GETCHAR 0x24/4 /* getch() */ | ||
67 | #define REX_PROM_GETENV 0x64/4 /* get env. variable */ | ||
68 | #define REX_PROM_GETSYSID 0x80/4 /* get system id */ | ||
69 | #define REX_PROM_GETTCINFO 0xa4/4 | ||
70 | #define REX_PROM_PRINTF 0x30/4 /* printf() */ | ||
71 | #define REX_PROM_SLOTADDR 0x6c/4 /* slotaddr */ | ||
72 | #define REX_PROM_BOOTINIT 0x54/4 /* open() */ | ||
73 | #define REX_PROM_BOOTREAD 0x58/4 /* read() */ | ||
74 | #define REX_PROM_CLEARCACHE 0x7c/4 | ||
75 | |||
76 | |||
77 | /* | ||
78 | * Used by rex_getbitmap(). | ||
79 | */ | ||
80 | typedef struct { | ||
81 | int pagesize; | ||
82 | unsigned char bitmap[0]; | ||
83 | } memmap; | ||
84 | |||
85 | |||
86 | /* | ||
87 | * Function pointers as read from a PROM's callback vector. | ||
88 | */ | ||
89 | extern int (*__rex_bootinit)(void); | ||
90 | extern int (*__rex_bootread)(void); | ||
91 | extern int (*__rex_getbitmap)(memmap *); | ||
92 | extern unsigned long *(*__rex_slot_address)(int); | ||
93 | extern void *(*__rex_gettcinfo)(void); | ||
94 | extern int (*__rex_getsysid)(void); | ||
95 | extern void (*__rex_clear_cache)(void); | ||
96 | |||
97 | extern int (*__prom_getchar)(void); | ||
98 | extern char *(*__prom_getenv)(char *); | ||
99 | extern int (*__prom_printf)(char *, ...); | ||
100 | |||
101 | extern int (*__pmax_open)(char*, int); | ||
102 | extern int (*__pmax_lseek)(int, long, int); | ||
103 | extern int (*__pmax_read)(int, void *, int); | ||
104 | extern int (*__pmax_close)(int); | ||
105 | |||
106 | |||
107 | #ifdef CONFIG_64BIT | ||
108 | |||
109 | /* | ||
110 | * On MIPS64 we have to call PROM functions via a helper | ||
111 | * dispatcher to accomodate ABI incompatibilities. | ||
112 | */ | ||
113 | #define __DEC_PROM_O32(fun, arg) fun arg __asm__(#fun); \ | ||
114 | __asm__(#fun " = call_o32") | ||
115 | |||
116 | int __DEC_PROM_O32(_rex_bootinit, (int (*)(void))); | ||
117 | int __DEC_PROM_O32(_rex_bootread, (int (*)(void))); | ||
118 | int __DEC_PROM_O32(_rex_getbitmap, (int (*)(memmap *), memmap *)); | ||
119 | unsigned long *__DEC_PROM_O32(_rex_slot_address, | ||
120 | (unsigned long *(*)(int), int)); | ||
121 | void *__DEC_PROM_O32(_rex_gettcinfo, (void *(*)(void))); | ||
122 | int __DEC_PROM_O32(_rex_getsysid, (int (*)(void))); | ||
123 | void __DEC_PROM_O32(_rex_clear_cache, (void (*)(void))); | ||
124 | |||
125 | int __DEC_PROM_O32(_prom_getchar, (int (*)(void))); | ||
126 | char *__DEC_PROM_O32(_prom_getenv, (char *(*)(char *), char *)); | ||
127 | int __DEC_PROM_O32(_prom_printf, (int (*)(char *, ...), char *, ...)); | ||
128 | |||
129 | |||
130 | #define rex_bootinit() _rex_bootinit(__rex_bootinit) | ||
131 | #define rex_bootread() _rex_bootread(__rex_bootread) | ||
132 | #define rex_getbitmap(x) _rex_getbitmap(__rex_getbitmap, x) | ||
133 | #define rex_slot_address(x) _rex_slot_address(__rex_slot_address, x) | ||
134 | #define rex_gettcinfo() _rex_gettcinfo(__rex_gettcinfo) | ||
135 | #define rex_getsysid() _rex_getsysid(__rex_getsysid) | ||
136 | #define rex_clear_cache() _rex_clear_cache(__rex_clear_cache) | ||
137 | |||
138 | #define prom_getchar() _prom_getchar(__prom_getchar) | ||
139 | #define prom_getenv(x) _prom_getenv(__prom_getenv, x) | ||
140 | #define prom_printf(x...) _prom_printf(__prom_printf, x) | ||
141 | |||
142 | #else /* !CONFIG_64BIT */ | ||
143 | |||
144 | /* | ||
145 | * On plain MIPS we just call PROM functions directly. | ||
146 | */ | ||
147 | #define rex_bootinit __rex_bootinit | ||
148 | #define rex_bootread __rex_bootread | ||
149 | #define rex_getbitmap __rex_getbitmap | ||
150 | #define rex_slot_address __rex_slot_address | ||
151 | #define rex_gettcinfo __rex_gettcinfo | ||
152 | #define rex_getsysid __rex_getsysid | ||
153 | #define rex_clear_cache __rex_clear_cache | ||
154 | |||
155 | #define prom_getchar __prom_getchar | ||
156 | #define prom_getenv __prom_getenv | ||
157 | #define prom_printf __prom_printf | ||
158 | |||
159 | #define pmax_open __pmax_open | ||
160 | #define pmax_lseek __pmax_lseek | ||
161 | #define pmax_read __pmax_read | ||
162 | #define pmax_close __pmax_close | ||
163 | |||
164 | #endif /* !CONFIG_64BIT */ | ||
165 | |||
166 | |||
167 | extern void prom_meminit(u32); | ||
168 | extern void prom_identify_arch(u32); | ||
169 | extern void prom_init_cmdline(s32, s32 *, u32); | ||
170 | |||
171 | extern void register_prom_console(void); | ||
172 | extern void unregister_prom_console(void); | ||
173 | |||
174 | #endif /* _ASM_DEC_PROM_H */ | ||
diff --git a/include/asm-mips/dec/system.h b/include/asm-mips/dec/system.h deleted file mode 100644 index b2afaccd6831..000000000000 --- a/include/asm-mips/dec/system.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/dec/system.h | ||
3 | * | ||
4 | * Generic DECstation/DECsystem bits. | ||
5 | * | ||
6 | * Copyright (C) 2005, 2006 Maciej W. Rozycki | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | #ifndef __ASM_DEC_SYSTEM_H | ||
14 | #define __ASM_DEC_SYSTEM_H | ||
15 | |||
16 | extern unsigned long dec_kn_slot_base, dec_kn_slot_size; | ||
17 | extern int dec_tc_bus; | ||
18 | |||
19 | #endif /* __ASM_DEC_SYSTEM_H */ | ||
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h deleted file mode 100644 index b0bccd2c4ed5..000000000000 --- a/include/asm-mips/delay.h +++ /dev/null | |||
@@ -1,112 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 by Waldorf Electronics | ||
7 | * Copyright (C) 1995 - 2000, 01, 03 by Ralf Baechle | ||
8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 2007 Maciej W. Rozycki | ||
10 | */ | ||
11 | #ifndef _ASM_DELAY_H | ||
12 | #define _ASM_DELAY_H | ||
13 | |||
14 | #include <linux/param.h> | ||
15 | #include <linux/smp.h> | ||
16 | |||
17 | #include <asm/compiler.h> | ||
18 | #include <asm/war.h> | ||
19 | |||
20 | static inline void __delay(unsigned long loops) | ||
21 | { | ||
22 | if (sizeof(long) == 4) | ||
23 | __asm__ __volatile__ ( | ||
24 | " .set noreorder \n" | ||
25 | " .align 3 \n" | ||
26 | "1: bnez %0, 1b \n" | ||
27 | " subu %0, 1 \n" | ||
28 | " .set reorder \n" | ||
29 | : "=r" (loops) | ||
30 | : "0" (loops)); | ||
31 | else if (sizeof(long) == 8 && !DADDI_WAR) | ||
32 | __asm__ __volatile__ ( | ||
33 | " .set noreorder \n" | ||
34 | " .align 3 \n" | ||
35 | "1: bnez %0, 1b \n" | ||
36 | " dsubu %0, 1 \n" | ||
37 | " .set reorder \n" | ||
38 | : "=r" (loops) | ||
39 | : "0" (loops)); | ||
40 | else if (sizeof(long) == 8 && DADDI_WAR) | ||
41 | __asm__ __volatile__ ( | ||
42 | " .set noreorder \n" | ||
43 | " .align 3 \n" | ||
44 | "1: bnez %0, 1b \n" | ||
45 | " dsubu %0, %2 \n" | ||
46 | " .set reorder \n" | ||
47 | : "=r" (loops) | ||
48 | : "0" (loops), "r" (1)); | ||
49 | } | ||
50 | |||
51 | |||
52 | /* | ||
53 | * Division by multiplication: you don't have to worry about | ||
54 | * loss of precision. | ||
55 | * | ||
56 | * Use only for very small delays ( < 1 msec). Should probably use a | ||
57 | * lookup table, really, as the multiplications take much too long with | ||
58 | * short delays. This is a "reasonable" implementation, though (and the | ||
59 | * first constant multiplications gets optimized away if the delay is | ||
60 | * a constant) | ||
61 | */ | ||
62 | |||
63 | static inline void __udelay(unsigned long usecs, unsigned long lpj) | ||
64 | { | ||
65 | unsigned long hi, lo; | ||
66 | |||
67 | /* | ||
68 | * The rates of 128 is rounded wrongly by the catchall case | ||
69 | * for 64-bit. Excessive precission? Probably ... | ||
70 | */ | ||
71 | #if defined(CONFIG_64BIT) && (HZ == 128) | ||
72 | usecs *= 0x0008637bd05af6c7UL; /* 2**64 / (1000000 / HZ) */ | ||
73 | #elif defined(CONFIG_64BIT) | ||
74 | usecs *= (0x8000000000000000UL / (500000 / HZ)); | ||
75 | #else /* 32-bit junk follows here */ | ||
76 | usecs *= (unsigned long) (((0x8000000000000000ULL / (500000 / HZ)) + | ||
77 | 0x80000000ULL) >> 32); | ||
78 | #endif | ||
79 | |||
80 | if (sizeof(long) == 4) | ||
81 | __asm__("multu\t%2, %3" | ||
82 | : "=h" (usecs), "=l" (lo) | ||
83 | : "r" (usecs), "r" (lpj) | ||
84 | : GCC_REG_ACCUM); | ||
85 | else if (sizeof(long) == 8 && !R4000_WAR) | ||
86 | __asm__("dmultu\t%2, %3" | ||
87 | : "=h" (usecs), "=l" (lo) | ||
88 | : "r" (usecs), "r" (lpj) | ||
89 | : GCC_REG_ACCUM); | ||
90 | else if (sizeof(long) == 8 && R4000_WAR) | ||
91 | __asm__("dmultu\t%3, %4\n\tmfhi\t%0" | ||
92 | : "=r" (usecs), "=h" (hi), "=l" (lo) | ||
93 | : "r" (usecs), "r" (lpj) | ||
94 | : GCC_REG_ACCUM); | ||
95 | |||
96 | __delay(usecs); | ||
97 | } | ||
98 | |||
99 | #define __udelay_val cpu_data[raw_smp_processor_id()].udelay_val | ||
100 | |||
101 | #define udelay(usecs) __udelay((usecs), __udelay_val) | ||
102 | |||
103 | /* make sure "usecs *= ..." in udelay do not overflow. */ | ||
104 | #if HZ >= 1000 | ||
105 | #define MAX_UDELAY_MS 1 | ||
106 | #elif HZ <= 200 | ||
107 | #define MAX_UDELAY_MS 5 | ||
108 | #else | ||
109 | #define MAX_UDELAY_MS (1000 / HZ) | ||
110 | #endif | ||
111 | |||
112 | #endif /* _ASM_DELAY_H */ | ||
diff --git a/include/asm-mips/device.h b/include/asm-mips/device.h deleted file mode 100644 index d8f9872b0e2d..000000000000 --- a/include/asm-mips/device.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-mips/div64.h b/include/asm-mips/div64.h deleted file mode 100644 index d1d699105c11..000000000000 --- a/include/asm-mips/div64.h +++ /dev/null | |||
@@ -1,110 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2004 Maciej W. Rozycki | ||
3 | * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org) | ||
4 | * | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | */ | ||
9 | #ifndef _ASM_DIV64_H | ||
10 | #define _ASM_DIV64_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | #if (_MIPS_SZLONG == 32) | ||
15 | |||
16 | #include <asm/compiler.h> | ||
17 | |||
18 | /* | ||
19 | * No traps on overflows for any of these... | ||
20 | */ | ||
21 | |||
22 | #define do_div64_32(res, high, low, base) ({ \ | ||
23 | unsigned long __quot32, __mod32; \ | ||
24 | unsigned long __cf, __tmp, __tmp2, __i; \ | ||
25 | \ | ||
26 | __asm__(".set push\n\t" \ | ||
27 | ".set noat\n\t" \ | ||
28 | ".set noreorder\n\t" \ | ||
29 | "move %2, $0\n\t" \ | ||
30 | "move %3, $0\n\t" \ | ||
31 | "b 1f\n\t" \ | ||
32 | " li %4, 0x21\n" \ | ||
33 | "0:\n\t" \ | ||
34 | "sll $1, %0, 0x1\n\t" \ | ||
35 | "srl %3, %0, 0x1f\n\t" \ | ||
36 | "or %0, $1, %5\n\t" \ | ||
37 | "sll %1, %1, 0x1\n\t" \ | ||
38 | "sll %2, %2, 0x1\n" \ | ||
39 | "1:\n\t" \ | ||
40 | "bnez %3, 2f\n\t" \ | ||
41 | " sltu %5, %0, %z6\n\t" \ | ||
42 | "bnez %5, 3f\n" \ | ||
43 | "2:\n\t" \ | ||
44 | " addiu %4, %4, -1\n\t" \ | ||
45 | "subu %0, %0, %z6\n\t" \ | ||
46 | "addiu %2, %2, 1\n" \ | ||
47 | "3:\n\t" \ | ||
48 | "bnez %4, 0b\n\t" \ | ||
49 | " srl %5, %1, 0x1f\n\t" \ | ||
50 | ".set pop" \ | ||
51 | : "=&r" (__mod32), "=&r" (__tmp), \ | ||
52 | "=&r" (__quot32), "=&r" (__cf), \ | ||
53 | "=&r" (__i), "=&r" (__tmp2) \ | ||
54 | : "Jr" (base), "0" (high), "1" (low)); \ | ||
55 | \ | ||
56 | (res) = __quot32; \ | ||
57 | __mod32; }) | ||
58 | |||
59 | #define do_div(n, base) ({ \ | ||
60 | unsigned long long __quot; \ | ||
61 | unsigned long __mod; \ | ||
62 | unsigned long long __div; \ | ||
63 | unsigned long __upper, __low, __high, __base; \ | ||
64 | \ | ||
65 | __div = (n); \ | ||
66 | __base = (base); \ | ||
67 | \ | ||
68 | __high = __div >> 32; \ | ||
69 | __low = __div; \ | ||
70 | __upper = __high; \ | ||
71 | \ | ||
72 | if (__high) \ | ||
73 | __asm__("divu $0, %z2, %z3" \ | ||
74 | : "=h" (__upper), "=l" (__high) \ | ||
75 | : "Jr" (__high), "Jr" (__base) \ | ||
76 | : GCC_REG_ACCUM); \ | ||
77 | \ | ||
78 | __mod = do_div64_32(__low, __upper, __low, __base); \ | ||
79 | \ | ||
80 | __quot = __high; \ | ||
81 | __quot = __quot << 32 | __low; \ | ||
82 | (n) = __quot; \ | ||
83 | __mod; }) | ||
84 | |||
85 | #endif /* (_MIPS_SZLONG == 32) */ | ||
86 | |||
87 | #if (_MIPS_SZLONG == 64) | ||
88 | |||
89 | /* | ||
90 | * Hey, we're already 64-bit, no | ||
91 | * need to play games.. | ||
92 | */ | ||
93 | #define do_div(n, base) ({ \ | ||
94 | unsigned long __quot; \ | ||
95 | unsigned int __mod; \ | ||
96 | unsigned long __div; \ | ||
97 | unsigned int __base; \ | ||
98 | \ | ||
99 | __div = (n); \ | ||
100 | __base = (base); \ | ||
101 | \ | ||
102 | __mod = __div % __base; \ | ||
103 | __quot = __div / __base; \ | ||
104 | \ | ||
105 | (n) = __quot; \ | ||
106 | __mod; }) | ||
107 | |||
108 | #endif /* (_MIPS_SZLONG == 64) */ | ||
109 | |||
110 | #endif /* _ASM_DIV64_H */ | ||
diff --git a/include/asm-mips/dma-mapping.h b/include/asm-mips/dma-mapping.h deleted file mode 100644 index c64afb40cd06..000000000000 --- a/include/asm-mips/dma-mapping.h +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | #ifndef _ASM_DMA_MAPPING_H | ||
2 | #define _ASM_DMA_MAPPING_H | ||
3 | |||
4 | #include <asm/scatterlist.h> | ||
5 | #include <asm/cache.h> | ||
6 | |||
7 | void *dma_alloc_noncoherent(struct device *dev, size_t size, | ||
8 | dma_addr_t *dma_handle, gfp_t flag); | ||
9 | |||
10 | void dma_free_noncoherent(struct device *dev, size_t size, | ||
11 | void *vaddr, dma_addr_t dma_handle); | ||
12 | |||
13 | void *dma_alloc_coherent(struct device *dev, size_t size, | ||
14 | dma_addr_t *dma_handle, gfp_t flag); | ||
15 | |||
16 | void dma_free_coherent(struct device *dev, size_t size, | ||
17 | void *vaddr, dma_addr_t dma_handle); | ||
18 | |||
19 | extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, | ||
20 | enum dma_data_direction direction); | ||
21 | extern void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, | ||
22 | size_t size, enum dma_data_direction direction); | ||
23 | extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | ||
24 | enum dma_data_direction direction); | ||
25 | extern dma_addr_t dma_map_page(struct device *dev, struct page *page, | ||
26 | unsigned long offset, size_t size, enum dma_data_direction direction); | ||
27 | extern void dma_unmap_page(struct device *dev, dma_addr_t dma_address, | ||
28 | size_t size, enum dma_data_direction direction); | ||
29 | extern void dma_unmap_sg(struct device *dev, struct scatterlist *sg, | ||
30 | int nhwentries, enum dma_data_direction direction); | ||
31 | extern void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, | ||
32 | size_t size, enum dma_data_direction direction); | ||
33 | extern void dma_sync_single_for_device(struct device *dev, | ||
34 | dma_addr_t dma_handle, size_t size, enum dma_data_direction direction); | ||
35 | extern void dma_sync_single_range_for_cpu(struct device *dev, | ||
36 | dma_addr_t dma_handle, unsigned long offset, size_t size, | ||
37 | enum dma_data_direction direction); | ||
38 | extern void dma_sync_single_range_for_device(struct device *dev, | ||
39 | dma_addr_t dma_handle, unsigned long offset, size_t size, | ||
40 | enum dma_data_direction direction); | ||
41 | extern void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | ||
42 | int nelems, enum dma_data_direction direction); | ||
43 | extern void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | ||
44 | int nelems, enum dma_data_direction direction); | ||
45 | extern int dma_mapping_error(struct device *dev, dma_addr_t dma_addr); | ||
46 | extern int dma_supported(struct device *dev, u64 mask); | ||
47 | |||
48 | static inline int | ||
49 | dma_set_mask(struct device *dev, u64 mask) | ||
50 | { | ||
51 | if(!dev->dma_mask || !dma_supported(dev, mask)) | ||
52 | return -EIO; | ||
53 | |||
54 | *dev->dma_mask = mask; | ||
55 | |||
56 | return 0; | ||
57 | } | ||
58 | |||
59 | static inline int | ||
60 | dma_get_cache_alignment(void) | ||
61 | { | ||
62 | /* XXX Largest on any MIPS */ | ||
63 | return 128; | ||
64 | } | ||
65 | |||
66 | extern int dma_is_consistent(struct device *dev, dma_addr_t dma_addr); | ||
67 | |||
68 | extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | ||
69 | enum dma_data_direction direction); | ||
70 | |||
71 | #if 0 | ||
72 | #define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY | ||
73 | |||
74 | extern int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | ||
75 | dma_addr_t device_addr, size_t size, int flags); | ||
76 | extern void dma_release_declared_memory(struct device *dev); | ||
77 | extern void * dma_mark_declared_memory_occupied(struct device *dev, | ||
78 | dma_addr_t device_addr, size_t size); | ||
79 | #endif | ||
80 | |||
81 | #endif /* _ASM_DMA_MAPPING_H */ | ||
diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h deleted file mode 100644 index 1353c81065d1..000000000000 --- a/include/asm-mips/dma.h +++ /dev/null | |||
@@ -1,315 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm/dma.h: Defines for using and allocating dma channels. | ||
3 | * Written by Hennus Bergman, 1992. | ||
4 | * High DMA channel support & info by Hannu Savolainen | ||
5 | * and John Boyd, Nov. 1992. | ||
6 | * | ||
7 | * NOTE: all this is true *only* for ISA/EISA expansions on Mips boards | ||
8 | * and can only be used for expansion cards. Onboard DMA controllers, such | ||
9 | * as the R4030 on Jazz boards behave totally different! | ||
10 | */ | ||
11 | |||
12 | #ifndef _ASM_DMA_H | ||
13 | #define _ASM_DMA_H | ||
14 | |||
15 | #include <asm/io.h> /* need byte IO */ | ||
16 | #include <linux/spinlock.h> /* And spinlocks */ | ||
17 | #include <linux/delay.h> | ||
18 | #include <asm/system.h> | ||
19 | |||
20 | |||
21 | #ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER | ||
22 | #define dma_outb outb_p | ||
23 | #else | ||
24 | #define dma_outb outb | ||
25 | #endif | ||
26 | |||
27 | #define dma_inb inb | ||
28 | |||
29 | /* | ||
30 | * NOTES about DMA transfers: | ||
31 | * | ||
32 | * controller 1: channels 0-3, byte operations, ports 00-1F | ||
33 | * controller 2: channels 4-7, word operations, ports C0-DF | ||
34 | * | ||
35 | * - ALL registers are 8 bits only, regardless of transfer size | ||
36 | * - channel 4 is not used - cascades 1 into 2. | ||
37 | * - channels 0-3 are byte - addresses/counts are for physical bytes | ||
38 | * - channels 5-7 are word - addresses/counts are for physical words | ||
39 | * - transfers must not cross physical 64K (0-3) or 128K (5-7) boundaries | ||
40 | * - transfer count loaded to registers is 1 less than actual count | ||
41 | * - controller 2 offsets are all even (2x offsets for controller 1) | ||
42 | * - page registers for 5-7 don't use data bit 0, represent 128K pages | ||
43 | * - page registers for 0-3 use bit 0, represent 64K pages | ||
44 | * | ||
45 | * DMA transfers are limited to the lower 16MB of _physical_ memory. | ||
46 | * Note that addresses loaded into registers must be _physical_ addresses, | ||
47 | * not logical addresses (which may differ if paging is active). | ||
48 | * | ||
49 | * Address mapping for channels 0-3: | ||
50 | * | ||
51 | * A23 ... A16 A15 ... A8 A7 ... A0 (Physical addresses) | ||
52 | * | ... | | ... | | ... | | ||
53 | * | ... | | ... | | ... | | ||
54 | * | ... | | ... | | ... | | ||
55 | * P7 ... P0 A7 ... A0 A7 ... A0 | ||
56 | * | Page | Addr MSB | Addr LSB | (DMA registers) | ||
57 | * | ||
58 | * Address mapping for channels 5-7: | ||
59 | * | ||
60 | * A23 ... A17 A16 A15 ... A9 A8 A7 ... A1 A0 (Physical addresses) | ||
61 | * | ... | \ \ ... \ \ \ ... \ \ | ||
62 | * | ... | \ \ ... \ \ \ ... \ (not used) | ||
63 | * | ... | \ \ ... \ \ \ ... \ | ||
64 | * P7 ... P1 (0) A7 A6 ... A0 A7 A6 ... A0 | ||
65 | * | Page | Addr MSB | Addr LSB | (DMA registers) | ||
66 | * | ||
67 | * Again, channels 5-7 transfer _physical_ words (16 bits), so addresses | ||
68 | * and counts _must_ be word-aligned (the lowest address bit is _ignored_ at | ||
69 | * the hardware level, so odd-byte transfers aren't possible). | ||
70 | * | ||
71 | * Transfer count (_not # bytes_) is limited to 64K, represented as actual | ||
72 | * count - 1 : 64K => 0xFFFF, 1 => 0x0000. Thus, count is always 1 or more, | ||
73 | * and up to 128K bytes may be transferred on channels 5-7 in one operation. | ||
74 | * | ||
75 | */ | ||
76 | |||
77 | #ifndef CONFIG_GENERIC_ISA_DMA_SUPPORT_BROKEN | ||
78 | #define MAX_DMA_CHANNELS 8 | ||
79 | #endif | ||
80 | |||
81 | /* | ||
82 | * The maximum address in KSEG0 that we can perform a DMA transfer to on this | ||
83 | * platform. This describes only the PC style part of the DMA logic like on | ||
84 | * Deskstations or Acer PICA but not the much more versatile DMA logic used | ||
85 | * for the local devices on Acer PICA or Magnums. | ||
86 | */ | ||
87 | #if defined(CONFIG_SGI_IP22) || defined(CONFIG_SGI_IP28) | ||
88 | /* don't care; ISA bus master won't work, ISA slave DMA supports 32bit addr */ | ||
89 | #define MAX_DMA_ADDRESS PAGE_OFFSET | ||
90 | #else | ||
91 | #define MAX_DMA_ADDRESS (PAGE_OFFSET + 0x01000000) | ||
92 | #endif | ||
93 | #define MAX_DMA_PFN PFN_DOWN(virt_to_phys((void *)MAX_DMA_ADDRESS)) | ||
94 | #define MAX_DMA32_PFN (1UL << (32 - PAGE_SHIFT)) | ||
95 | |||
96 | /* 8237 DMA controllers */ | ||
97 | #define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */ | ||
98 | #define IO_DMA2_BASE 0xC0 /* 16 bit master DMA, ch 4(=slave input)..7 */ | ||
99 | |||
100 | /* DMA controller registers */ | ||
101 | #define DMA1_CMD_REG 0x08 /* command register (w) */ | ||
102 | #define DMA1_STAT_REG 0x08 /* status register (r) */ | ||
103 | #define DMA1_REQ_REG 0x09 /* request register (w) */ | ||
104 | #define DMA1_MASK_REG 0x0A /* single-channel mask (w) */ | ||
105 | #define DMA1_MODE_REG 0x0B /* mode register (w) */ | ||
106 | #define DMA1_CLEAR_FF_REG 0x0C /* clear pointer flip-flop (w) */ | ||
107 | #define DMA1_TEMP_REG 0x0D /* Temporary Register (r) */ | ||
108 | #define DMA1_RESET_REG 0x0D /* Master Clear (w) */ | ||
109 | #define DMA1_CLR_MASK_REG 0x0E /* Clear Mask */ | ||
110 | #define DMA1_MASK_ALL_REG 0x0F /* all-channels mask (w) */ | ||
111 | |||
112 | #define DMA2_CMD_REG 0xD0 /* command register (w) */ | ||
113 | #define DMA2_STAT_REG 0xD0 /* status register (r) */ | ||
114 | #define DMA2_REQ_REG 0xD2 /* request register (w) */ | ||
115 | #define DMA2_MASK_REG 0xD4 /* single-channel mask (w) */ | ||
116 | #define DMA2_MODE_REG 0xD6 /* mode register (w) */ | ||
117 | #define DMA2_CLEAR_FF_REG 0xD8 /* clear pointer flip-flop (w) */ | ||
118 | #define DMA2_TEMP_REG 0xDA /* Temporary Register (r) */ | ||
119 | #define DMA2_RESET_REG 0xDA /* Master Clear (w) */ | ||
120 | #define DMA2_CLR_MASK_REG 0xDC /* Clear Mask */ | ||
121 | #define DMA2_MASK_ALL_REG 0xDE /* all-channels mask (w) */ | ||
122 | |||
123 | #define DMA_ADDR_0 0x00 /* DMA address registers */ | ||
124 | #define DMA_ADDR_1 0x02 | ||
125 | #define DMA_ADDR_2 0x04 | ||
126 | #define DMA_ADDR_3 0x06 | ||
127 | #define DMA_ADDR_4 0xC0 | ||
128 | #define DMA_ADDR_5 0xC4 | ||
129 | #define DMA_ADDR_6 0xC8 | ||
130 | #define DMA_ADDR_7 0xCC | ||
131 | |||
132 | #define DMA_CNT_0 0x01 /* DMA count registers */ | ||
133 | #define DMA_CNT_1 0x03 | ||
134 | #define DMA_CNT_2 0x05 | ||
135 | #define DMA_CNT_3 0x07 | ||
136 | #define DMA_CNT_4 0xC2 | ||
137 | #define DMA_CNT_5 0xC6 | ||
138 | #define DMA_CNT_6 0xCA | ||
139 | #define DMA_CNT_7 0xCE | ||
140 | |||
141 | #define DMA_PAGE_0 0x87 /* DMA page registers */ | ||
142 | #define DMA_PAGE_1 0x83 | ||
143 | #define DMA_PAGE_2 0x81 | ||
144 | #define DMA_PAGE_3 0x82 | ||
145 | #define DMA_PAGE_5 0x8B | ||
146 | #define DMA_PAGE_6 0x89 | ||
147 | #define DMA_PAGE_7 0x8A | ||
148 | |||
149 | #define DMA_MODE_READ 0x44 /* I/O to memory, no autoinit, increment, single mode */ | ||
150 | #define DMA_MODE_WRITE 0x48 /* memory to I/O, no autoinit, increment, single mode */ | ||
151 | #define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */ | ||
152 | |||
153 | #define DMA_AUTOINIT 0x10 | ||
154 | |||
155 | extern spinlock_t dma_spin_lock; | ||
156 | |||
157 | static __inline__ unsigned long claim_dma_lock(void) | ||
158 | { | ||
159 | unsigned long flags; | ||
160 | spin_lock_irqsave(&dma_spin_lock, flags); | ||
161 | return flags; | ||
162 | } | ||
163 | |||
164 | static __inline__ void release_dma_lock(unsigned long flags) | ||
165 | { | ||
166 | spin_unlock_irqrestore(&dma_spin_lock, flags); | ||
167 | } | ||
168 | |||
169 | /* enable/disable a specific DMA channel */ | ||
170 | static __inline__ void enable_dma(unsigned int dmanr) | ||
171 | { | ||
172 | if (dmanr<=3) | ||
173 | dma_outb(dmanr, DMA1_MASK_REG); | ||
174 | else | ||
175 | dma_outb(dmanr & 3, DMA2_MASK_REG); | ||
176 | } | ||
177 | |||
178 | static __inline__ void disable_dma(unsigned int dmanr) | ||
179 | { | ||
180 | if (dmanr<=3) | ||
181 | dma_outb(dmanr | 4, DMA1_MASK_REG); | ||
182 | else | ||
183 | dma_outb((dmanr & 3) | 4, DMA2_MASK_REG); | ||
184 | } | ||
185 | |||
186 | /* Clear the 'DMA Pointer Flip Flop'. | ||
187 | * Write 0 for LSB/MSB, 1 for MSB/LSB access. | ||
188 | * Use this once to initialize the FF to a known state. | ||
189 | * After that, keep track of it. :-) | ||
190 | * --- In order to do that, the DMA routines below should --- | ||
191 | * --- only be used while holding the DMA lock ! --- | ||
192 | */ | ||
193 | static __inline__ void clear_dma_ff(unsigned int dmanr) | ||
194 | { | ||
195 | if (dmanr<=3) | ||
196 | dma_outb(0, DMA1_CLEAR_FF_REG); | ||
197 | else | ||
198 | dma_outb(0, DMA2_CLEAR_FF_REG); | ||
199 | } | ||
200 | |||
201 | /* set mode (above) for a specific DMA channel */ | ||
202 | static __inline__ void set_dma_mode(unsigned int dmanr, char mode) | ||
203 | { | ||
204 | if (dmanr<=3) | ||
205 | dma_outb(mode | dmanr, DMA1_MODE_REG); | ||
206 | else | ||
207 | dma_outb(mode | (dmanr&3), DMA2_MODE_REG); | ||
208 | } | ||
209 | |||
210 | /* Set only the page register bits of the transfer address. | ||
211 | * This is used for successive transfers when we know the contents of | ||
212 | * the lower 16 bits of the DMA current address register, but a 64k boundary | ||
213 | * may have been crossed. | ||
214 | */ | ||
215 | static __inline__ void set_dma_page(unsigned int dmanr, char pagenr) | ||
216 | { | ||
217 | switch(dmanr) { | ||
218 | case 0: | ||
219 | dma_outb(pagenr, DMA_PAGE_0); | ||
220 | break; | ||
221 | case 1: | ||
222 | dma_outb(pagenr, DMA_PAGE_1); | ||
223 | break; | ||
224 | case 2: | ||
225 | dma_outb(pagenr, DMA_PAGE_2); | ||
226 | break; | ||
227 | case 3: | ||
228 | dma_outb(pagenr, DMA_PAGE_3); | ||
229 | break; | ||
230 | case 5: | ||
231 | dma_outb(pagenr & 0xfe, DMA_PAGE_5); | ||
232 | break; | ||
233 | case 6: | ||
234 | dma_outb(pagenr & 0xfe, DMA_PAGE_6); | ||
235 | break; | ||
236 | case 7: | ||
237 | dma_outb(pagenr & 0xfe, DMA_PAGE_7); | ||
238 | break; | ||
239 | } | ||
240 | } | ||
241 | |||
242 | |||
243 | /* Set transfer address & page bits for specific DMA channel. | ||
244 | * Assumes dma flipflop is clear. | ||
245 | */ | ||
246 | static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a) | ||
247 | { | ||
248 | set_dma_page(dmanr, a>>16); | ||
249 | if (dmanr <= 3) { | ||
250 | dma_outb( a & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE ); | ||
251 | dma_outb( (a>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE ); | ||
252 | } else { | ||
253 | dma_outb( (a>>1) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE ); | ||
254 | dma_outb( (a>>9) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE ); | ||
255 | } | ||
256 | } | ||
257 | |||
258 | |||
259 | /* Set transfer size (max 64k for DMA0..3, 128k for DMA5..7) for | ||
260 | * a specific DMA channel. | ||
261 | * You must ensure the parameters are valid. | ||
262 | * NOTE: from a manual: "the number of transfers is one more | ||
263 | * than the initial word count"! This is taken into account. | ||
264 | * Assumes dma flip-flop is clear. | ||
265 | * NOTE 2: "count" represents _bytes_ and must be even for channels 5-7. | ||
266 | */ | ||
267 | static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count) | ||
268 | { | ||
269 | count--; | ||
270 | if (dmanr <= 3) { | ||
271 | dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE ); | ||
272 | dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE ); | ||
273 | } else { | ||
274 | dma_outb( (count>>1) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE ); | ||
275 | dma_outb( (count>>9) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE ); | ||
276 | } | ||
277 | } | ||
278 | |||
279 | |||
280 | /* Get DMA residue count. After a DMA transfer, this | ||
281 | * should return zero. Reading this while a DMA transfer is | ||
282 | * still in progress will return unpredictable results. | ||
283 | * If called before the channel has been used, it may return 1. | ||
284 | * Otherwise, it returns the number of _bytes_ left to transfer. | ||
285 | * | ||
286 | * Assumes DMA flip-flop is clear. | ||
287 | */ | ||
288 | static __inline__ int get_dma_residue(unsigned int dmanr) | ||
289 | { | ||
290 | unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE | ||
291 | : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE; | ||
292 | |||
293 | /* using short to get 16-bit wrap around */ | ||
294 | unsigned short count; | ||
295 | |||
296 | count = 1 + dma_inb(io_port); | ||
297 | count += dma_inb(io_port) << 8; | ||
298 | |||
299 | return (dmanr<=3)? count : (count<<1); | ||
300 | } | ||
301 | |||
302 | |||
303 | /* These are in kernel/dma.c: */ | ||
304 | extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */ | ||
305 | extern void free_dma(unsigned int dmanr); /* release it again */ | ||
306 | |||
307 | /* From PCI */ | ||
308 | |||
309 | #ifdef CONFIG_PCI | ||
310 | extern int isa_dma_bridge_buggy; | ||
311 | #else | ||
312 | #define isa_dma_bridge_buggy (0) | ||
313 | #endif | ||
314 | |||
315 | #endif /* _ASM_DMA_H */ | ||
diff --git a/include/asm-mips/ds1286.h b/include/asm-mips/ds1286.h deleted file mode 100644 index 6983b6ff0af3..000000000000 --- a/include/asm-mips/ds1286.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Machine dependent access functions for RTC registers. | ||
7 | * | ||
8 | * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org) | ||
9 | */ | ||
10 | #ifndef _ASM_DS1286_H | ||
11 | #define _ASM_DS1286_H | ||
12 | |||
13 | #include <ds1286.h> | ||
14 | |||
15 | #endif /* _ASM_DS1286_H */ | ||
diff --git a/include/asm-mips/ds1287.h b/include/asm-mips/ds1287.h deleted file mode 100644 index ba1702e86931..000000000000 --- a/include/asm-mips/ds1287.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * DS1287 timer functions. | ||
3 | * | ||
4 | * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | */ | ||
20 | #ifndef __ASM_DS1287_H | ||
21 | #define __ASM_DS1287_H | ||
22 | |||
23 | extern int ds1287_timer_state(void); | ||
24 | extern void ds1287_set_base_clock(unsigned int clock); | ||
25 | extern int ds1287_clockevent_init(int irq); | ||
26 | |||
27 | #endif | ||
diff --git a/include/asm-mips/dsp.h b/include/asm-mips/dsp.h deleted file mode 100644 index e9bfc0813c72..000000000000 --- a/include/asm-mips/dsp.h +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Mips Technologies | ||
3 | * Author: Chris Dearman, chris@mips.com derived from fpu.h | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | */ | ||
10 | #ifndef _ASM_DSP_H | ||
11 | #define _ASM_DSP_H | ||
12 | |||
13 | #include <asm/cpu.h> | ||
14 | #include <asm/cpu-features.h> | ||
15 | #include <asm/hazards.h> | ||
16 | #include <asm/mipsregs.h> | ||
17 | |||
18 | #define DSP_DEFAULT 0x00000000 | ||
19 | #define DSP_MASK 0x3ff | ||
20 | |||
21 | #define __enable_dsp_hazard() \ | ||
22 | do { \ | ||
23 | asm("_ehb"); \ | ||
24 | } while (0) | ||
25 | |||
26 | static inline void __init_dsp(void) | ||
27 | { | ||
28 | mthi1(0); | ||
29 | mtlo1(0); | ||
30 | mthi2(0); | ||
31 | mtlo2(0); | ||
32 | mthi3(0); | ||
33 | mtlo3(0); | ||
34 | wrdsp(DSP_DEFAULT, DSP_MASK); | ||
35 | } | ||
36 | |||
37 | static inline void init_dsp(void) | ||
38 | { | ||
39 | if (cpu_has_dsp) | ||
40 | __init_dsp(); | ||
41 | } | ||
42 | |||
43 | #define __save_dsp(tsk) \ | ||
44 | do { \ | ||
45 | tsk->thread.dsp.dspr[0] = mfhi1(); \ | ||
46 | tsk->thread.dsp.dspr[1] = mflo1(); \ | ||
47 | tsk->thread.dsp.dspr[2] = mfhi2(); \ | ||
48 | tsk->thread.dsp.dspr[3] = mflo2(); \ | ||
49 | tsk->thread.dsp.dspr[4] = mfhi3(); \ | ||
50 | tsk->thread.dsp.dspr[5] = mflo3(); \ | ||
51 | tsk->thread.dsp.dspcontrol = rddsp(DSP_MASK); \ | ||
52 | } while (0) | ||
53 | |||
54 | #define save_dsp(tsk) \ | ||
55 | do { \ | ||
56 | if (cpu_has_dsp) \ | ||
57 | __save_dsp(tsk); \ | ||
58 | } while (0) | ||
59 | |||
60 | #define __restore_dsp(tsk) \ | ||
61 | do { \ | ||
62 | mthi1(tsk->thread.dsp.dspr[0]); \ | ||
63 | mtlo1(tsk->thread.dsp.dspr[1]); \ | ||
64 | mthi2(tsk->thread.dsp.dspr[2]); \ | ||
65 | mtlo2(tsk->thread.dsp.dspr[3]); \ | ||
66 | mthi3(tsk->thread.dsp.dspr[4]); \ | ||
67 | mtlo3(tsk->thread.dsp.dspr[5]); \ | ||
68 | wrdsp(tsk->thread.dsp.dspcontrol, DSP_MASK); \ | ||
69 | } while (0) | ||
70 | |||
71 | #define restore_dsp(tsk) \ | ||
72 | do { \ | ||
73 | if (cpu_has_dsp) \ | ||
74 | __restore_dsp(tsk); \ | ||
75 | } while (0) | ||
76 | |||
77 | #define __get_dsp_regs(tsk) \ | ||
78 | ({ \ | ||
79 | if (tsk == current) \ | ||
80 | __save_dsp(current); \ | ||
81 | \ | ||
82 | tsk->thread.dsp.dspr; \ | ||
83 | }) | ||
84 | |||
85 | #endif /* _ASM_DSP_H */ | ||
diff --git a/include/asm-mips/edac.h b/include/asm-mips/edac.h deleted file mode 100644 index 4da0c1fe30d9..000000000000 --- a/include/asm-mips/edac.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | #ifndef ASM_EDAC_H | ||
2 | #define ASM_EDAC_H | ||
3 | |||
4 | /* ECC atomic, DMA, SMP and interrupt safe scrub function */ | ||
5 | |||
6 | static inline void atomic_scrub(void *va, u32 size) | ||
7 | { | ||
8 | unsigned long *virt_addr = va; | ||
9 | unsigned long temp; | ||
10 | u32 i; | ||
11 | |||
12 | for (i = 0; i < size / sizeof(unsigned long); i++) { | ||
13 | /* | ||
14 | * Very carefully read and write to memory atomically | ||
15 | * so we are interrupt, DMA and SMP safe. | ||
16 | * | ||
17 | * Intel: asm("lock; addl $0, %0"::"m"(*virt_addr)); | ||
18 | */ | ||
19 | |||
20 | __asm__ __volatile__ ( | ||
21 | " .set mips2 \n" | ||
22 | "1: ll %0, %1 # atomic_scrub \n" | ||
23 | " addu %0, $0 \n" | ||
24 | " sc %0, %1 \n" | ||
25 | " beqz %0, 1b \n" | ||
26 | " .set mips0 \n" | ||
27 | : "=&r" (temp), "=m" (*virt_addr) | ||
28 | : "m" (*virt_addr)); | ||
29 | |||
30 | virt_addr++; | ||
31 | } | ||
32 | } | ||
33 | |||
34 | #endif | ||
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h deleted file mode 100644 index f69f7acba637..000000000000 --- a/include/asm-mips/elf.h +++ /dev/null | |||
@@ -1,371 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Much of this is taken from binutils and GNU libc ... | ||
7 | */ | ||
8 | #ifndef _ASM_ELF_H | ||
9 | #define _ASM_ELF_H | ||
10 | |||
11 | |||
12 | /* ELF header e_flags defines. */ | ||
13 | /* MIPS architecture level. */ | ||
14 | #define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ | ||
15 | #define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ | ||
16 | #define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ | ||
17 | #define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ | ||
18 | #define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ | ||
19 | #define EF_MIPS_ARCH_32 0x50000000 /* MIPS32 code. */ | ||
20 | #define EF_MIPS_ARCH_64 0x60000000 /* MIPS64 code. */ | ||
21 | #define EF_MIPS_ARCH_32R2 0x70000000 /* MIPS32 R2 code. */ | ||
22 | #define EF_MIPS_ARCH_64R2 0x80000000 /* MIPS64 R2 code. */ | ||
23 | |||
24 | /* The ABI of a file. */ | ||
25 | #define EF_MIPS_ABI_O32 0x00001000 /* O32 ABI. */ | ||
26 | #define EF_MIPS_ABI_O64 0x00002000 /* O32 extended for 64 bit. */ | ||
27 | |||
28 | #define PT_MIPS_REGINFO 0x70000000 | ||
29 | #define PT_MIPS_RTPROC 0x70000001 | ||
30 | #define PT_MIPS_OPTIONS 0x70000002 | ||
31 | |||
32 | /* Flags in the e_flags field of the header */ | ||
33 | #define EF_MIPS_NOREORDER 0x00000001 | ||
34 | #define EF_MIPS_PIC 0x00000002 | ||
35 | #define EF_MIPS_CPIC 0x00000004 | ||
36 | #define EF_MIPS_ABI2 0x00000020 | ||
37 | #define EF_MIPS_OPTIONS_FIRST 0x00000080 | ||
38 | #define EF_MIPS_32BITMODE 0x00000100 | ||
39 | #define EF_MIPS_ABI 0x0000f000 | ||
40 | #define EF_MIPS_ARCH 0xf0000000 | ||
41 | |||
42 | #define DT_MIPS_RLD_VERSION 0x70000001 | ||
43 | #define DT_MIPS_TIME_STAMP 0x70000002 | ||
44 | #define DT_MIPS_ICHECKSUM 0x70000003 | ||
45 | #define DT_MIPS_IVERSION 0x70000004 | ||
46 | #define DT_MIPS_FLAGS 0x70000005 | ||
47 | #define RHF_NONE 0x00000000 | ||
48 | #define RHF_HARDWAY 0x00000001 | ||
49 | #define RHF_NOTPOT 0x00000002 | ||
50 | #define RHF_SGI_ONLY 0x00000010 | ||
51 | #define DT_MIPS_BASE_ADDRESS 0x70000006 | ||
52 | #define DT_MIPS_CONFLICT 0x70000008 | ||
53 | #define DT_MIPS_LIBLIST 0x70000009 | ||
54 | #define DT_MIPS_LOCAL_GOTNO 0x7000000a | ||
55 | #define DT_MIPS_CONFLICTNO 0x7000000b | ||
56 | #define DT_MIPS_LIBLISTNO 0x70000010 | ||
57 | #define DT_MIPS_SYMTABNO 0x70000011 | ||
58 | #define DT_MIPS_UNREFEXTNO 0x70000012 | ||
59 | #define DT_MIPS_GOTSYM 0x70000013 | ||
60 | #define DT_MIPS_HIPAGENO 0x70000014 | ||
61 | #define DT_MIPS_RLD_MAP 0x70000016 | ||
62 | |||
63 | #define R_MIPS_NONE 0 | ||
64 | #define R_MIPS_16 1 | ||
65 | #define R_MIPS_32 2 | ||
66 | #define R_MIPS_REL32 3 | ||
67 | #define R_MIPS_26 4 | ||
68 | #define R_MIPS_HI16 5 | ||
69 | #define R_MIPS_LO16 6 | ||
70 | #define R_MIPS_GPREL16 7 | ||
71 | #define R_MIPS_LITERAL 8 | ||
72 | #define R_MIPS_GOT16 9 | ||
73 | #define R_MIPS_PC16 10 | ||
74 | #define R_MIPS_CALL16 11 | ||
75 | #define R_MIPS_GPREL32 12 | ||
76 | /* The remaining relocs are defined on Irix, although they are not | ||
77 | in the MIPS ELF ABI. */ | ||
78 | #define R_MIPS_UNUSED1 13 | ||
79 | #define R_MIPS_UNUSED2 14 | ||
80 | #define R_MIPS_UNUSED3 15 | ||
81 | #define R_MIPS_SHIFT5 16 | ||
82 | #define R_MIPS_SHIFT6 17 | ||
83 | #define R_MIPS_64 18 | ||
84 | #define R_MIPS_GOT_DISP 19 | ||
85 | #define R_MIPS_GOT_PAGE 20 | ||
86 | #define R_MIPS_GOT_OFST 21 | ||
87 | /* | ||
88 | * The following two relocation types are specified in the MIPS ABI | ||
89 | * conformance guide version 1.2 but not yet in the psABI. | ||
90 | */ | ||
91 | #define R_MIPS_GOTHI16 22 | ||
92 | #define R_MIPS_GOTLO16 23 | ||
93 | #define R_MIPS_SUB 24 | ||
94 | #define R_MIPS_INSERT_A 25 | ||
95 | #define R_MIPS_INSERT_B 26 | ||
96 | #define R_MIPS_DELETE 27 | ||
97 | #define R_MIPS_HIGHER 28 | ||
98 | #define R_MIPS_HIGHEST 29 | ||
99 | /* | ||
100 | * The following two relocation types are specified in the MIPS ABI | ||
101 | * conformance guide version 1.2 but not yet in the psABI. | ||
102 | */ | ||
103 | #define R_MIPS_CALLHI16 30 | ||
104 | #define R_MIPS_CALLLO16 31 | ||
105 | /* | ||
106 | * This range is reserved for vendor specific relocations. | ||
107 | */ | ||
108 | #define R_MIPS_LOVENDOR 100 | ||
109 | #define R_MIPS_HIVENDOR 127 | ||
110 | |||
111 | #define SHN_MIPS_ACCOMON 0xff00 /* Allocated common symbols */ | ||
112 | #define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */ | ||
113 | #define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */ | ||
114 | #define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */ | ||
115 | #define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */ | ||
116 | |||
117 | #define SHT_MIPS_LIST 0x70000000 | ||
118 | #define SHT_MIPS_CONFLICT 0x70000002 | ||
119 | #define SHT_MIPS_GPTAB 0x70000003 | ||
120 | #define SHT_MIPS_UCODE 0x70000004 | ||
121 | #define SHT_MIPS_DEBUG 0x70000005 | ||
122 | #define SHT_MIPS_REGINFO 0x70000006 | ||
123 | #define SHT_MIPS_PACKAGE 0x70000007 | ||
124 | #define SHT_MIPS_PACKSYM 0x70000008 | ||
125 | #define SHT_MIPS_RELD 0x70000009 | ||
126 | #define SHT_MIPS_IFACE 0x7000000b | ||
127 | #define SHT_MIPS_CONTENT 0x7000000c | ||
128 | #define SHT_MIPS_OPTIONS 0x7000000d | ||
129 | #define SHT_MIPS_SHDR 0x70000010 | ||
130 | #define SHT_MIPS_FDESC 0x70000011 | ||
131 | #define SHT_MIPS_EXTSYM 0x70000012 | ||
132 | #define SHT_MIPS_DENSE 0x70000013 | ||
133 | #define SHT_MIPS_PDESC 0x70000014 | ||
134 | #define SHT_MIPS_LOCSYM 0x70000015 | ||
135 | #define SHT_MIPS_AUXSYM 0x70000016 | ||
136 | #define SHT_MIPS_OPTSYM 0x70000017 | ||
137 | #define SHT_MIPS_LOCSTR 0x70000018 | ||
138 | #define SHT_MIPS_LINE 0x70000019 | ||
139 | #define SHT_MIPS_RFDESC 0x7000001a | ||
140 | #define SHT_MIPS_DELTASYM 0x7000001b | ||
141 | #define SHT_MIPS_DELTAINST 0x7000001c | ||
142 | #define SHT_MIPS_DELTACLASS 0x7000001d | ||
143 | #define SHT_MIPS_DWARF 0x7000001e | ||
144 | #define SHT_MIPS_DELTADECL 0x7000001f | ||
145 | #define SHT_MIPS_SYMBOL_LIB 0x70000020 | ||
146 | #define SHT_MIPS_EVENTS 0x70000021 | ||
147 | #define SHT_MIPS_TRANSLATE 0x70000022 | ||
148 | #define SHT_MIPS_PIXIE 0x70000023 | ||
149 | #define SHT_MIPS_XLATE 0x70000024 | ||
150 | #define SHT_MIPS_XLATE_DEBUG 0x70000025 | ||
151 | #define SHT_MIPS_WHIRL 0x70000026 | ||
152 | #define SHT_MIPS_EH_REGION 0x70000027 | ||
153 | #define SHT_MIPS_XLATE_OLD 0x70000028 | ||
154 | #define SHT_MIPS_PDR_EXCEPTION 0x70000029 | ||
155 | |||
156 | #define SHF_MIPS_GPREL 0x10000000 | ||
157 | #define SHF_MIPS_MERGE 0x20000000 | ||
158 | #define SHF_MIPS_ADDR 0x40000000 | ||
159 | #define SHF_MIPS_STRING 0x80000000 | ||
160 | #define SHF_MIPS_NOSTRIP 0x08000000 | ||
161 | #define SHF_MIPS_LOCAL 0x04000000 | ||
162 | #define SHF_MIPS_NAMES 0x02000000 | ||
163 | #define SHF_MIPS_NODUPES 0x01000000 | ||
164 | |||
165 | #ifndef ELF_ARCH | ||
166 | /* ELF register definitions */ | ||
167 | #define ELF_NGREG 45 | ||
168 | #define ELF_NFPREG 33 | ||
169 | |||
170 | typedef unsigned long elf_greg_t; | ||
171 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
172 | |||
173 | typedef double elf_fpreg_t; | ||
174 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | ||
175 | |||
176 | #ifdef CONFIG_32BIT | ||
177 | |||
178 | /* | ||
179 | * This is used to ensure we don't load something for the wrong architecture. | ||
180 | */ | ||
181 | #define elf_check_arch(hdr) \ | ||
182 | ({ \ | ||
183 | int __res = 1; \ | ||
184 | struct elfhdr *__h = (hdr); \ | ||
185 | \ | ||
186 | if (__h->e_machine != EM_MIPS) \ | ||
187 | __res = 0; \ | ||
188 | if (__h->e_ident[EI_CLASS] != ELFCLASS32) \ | ||
189 | __res = 0; \ | ||
190 | if ((__h->e_flags & EF_MIPS_ABI2) != 0) \ | ||
191 | __res = 0; \ | ||
192 | if (((__h->e_flags & EF_MIPS_ABI) != 0) && \ | ||
193 | ((__h->e_flags & EF_MIPS_ABI) != EF_MIPS_ABI_O32)) \ | ||
194 | __res = 0; \ | ||
195 | \ | ||
196 | __res; \ | ||
197 | }) | ||
198 | |||
199 | /* | ||
200 | * These are used to set parameters in the core dumps. | ||
201 | */ | ||
202 | #define ELF_CLASS ELFCLASS32 | ||
203 | |||
204 | #endif /* CONFIG_32BIT */ | ||
205 | |||
206 | #ifdef CONFIG_64BIT | ||
207 | /* | ||
208 | * This is used to ensure we don't load something for the wrong architecture. | ||
209 | */ | ||
210 | #define elf_check_arch(hdr) \ | ||
211 | ({ \ | ||
212 | int __res = 1; \ | ||
213 | struct elfhdr *__h = (hdr); \ | ||
214 | \ | ||
215 | if (__h->e_machine != EM_MIPS) \ | ||
216 | __res = 0; \ | ||
217 | if (__h->e_ident[EI_CLASS] != ELFCLASS64) \ | ||
218 | __res = 0; \ | ||
219 | \ | ||
220 | __res; \ | ||
221 | }) | ||
222 | |||
223 | /* | ||
224 | * These are used to set parameters in the core dumps. | ||
225 | */ | ||
226 | #define ELF_CLASS ELFCLASS64 | ||
227 | |||
228 | #endif /* CONFIG_64BIT */ | ||
229 | |||
230 | /* | ||
231 | * These are used to set parameters in the core dumps. | ||
232 | */ | ||
233 | #ifdef __MIPSEB__ | ||
234 | #define ELF_DATA ELFDATA2MSB | ||
235 | #elif __MIPSEL__ | ||
236 | #define ELF_DATA ELFDATA2LSB | ||
237 | #endif | ||
238 | #define ELF_ARCH EM_MIPS | ||
239 | |||
240 | #endif /* !defined(ELF_ARCH) */ | ||
241 | |||
242 | struct mips_abi; | ||
243 | |||
244 | extern struct mips_abi mips_abi; | ||
245 | extern struct mips_abi mips_abi_32; | ||
246 | extern struct mips_abi mips_abi_n32; | ||
247 | |||
248 | #ifdef CONFIG_32BIT | ||
249 | |||
250 | #define SET_PERSONALITY(ex, ibcs2) \ | ||
251 | do { \ | ||
252 | if (ibcs2) \ | ||
253 | set_personality(PER_SVR4); \ | ||
254 | set_personality(PER_LINUX); \ | ||
255 | \ | ||
256 | current->thread.abi = &mips_abi; \ | ||
257 | } while (0) | ||
258 | |||
259 | #endif /* CONFIG_32BIT */ | ||
260 | |||
261 | #ifdef CONFIG_64BIT | ||
262 | |||
263 | #ifdef CONFIG_MIPS32_N32 | ||
264 | #define __SET_PERSONALITY32_N32() \ | ||
265 | do { \ | ||
266 | set_thread_flag(TIF_32BIT_ADDR); \ | ||
267 | current->thread.abi = &mips_abi_n32; \ | ||
268 | } while (0) | ||
269 | #else | ||
270 | #define __SET_PERSONALITY32_N32() \ | ||
271 | do { } while (0) | ||
272 | #endif | ||
273 | |||
274 | #ifdef CONFIG_MIPS32_O32 | ||
275 | #define __SET_PERSONALITY32_O32() \ | ||
276 | do { \ | ||
277 | set_thread_flag(TIF_32BIT_REGS); \ | ||
278 | set_thread_flag(TIF_32BIT_ADDR); \ | ||
279 | current->thread.abi = &mips_abi_32; \ | ||
280 | } while (0) | ||
281 | #else | ||
282 | #define __SET_PERSONALITY32_O32() \ | ||
283 | do { } while (0) | ||
284 | #endif | ||
285 | |||
286 | #ifdef CONFIG_MIPS32_COMPAT | ||
287 | #define __SET_PERSONALITY32(ex) \ | ||
288 | do { \ | ||
289 | if ((((ex).e_flags & EF_MIPS_ABI2) != 0) && \ | ||
290 | ((ex).e_flags & EF_MIPS_ABI) == 0) \ | ||
291 | __SET_PERSONALITY32_N32(); \ | ||
292 | else \ | ||
293 | __SET_PERSONALITY32_O32(); \ | ||
294 | } while (0) | ||
295 | #else | ||
296 | #define __SET_PERSONALITY32(ex) do { } while (0) | ||
297 | #endif | ||
298 | |||
299 | #define SET_PERSONALITY(ex, ibcs2) \ | ||
300 | do { \ | ||
301 | clear_thread_flag(TIF_32BIT_REGS); \ | ||
302 | clear_thread_flag(TIF_32BIT_ADDR); \ | ||
303 | \ | ||
304 | if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ | ||
305 | __SET_PERSONALITY32(ex); \ | ||
306 | else \ | ||
307 | current->thread.abi = &mips_abi; \ | ||
308 | \ | ||
309 | if (ibcs2) \ | ||
310 | set_personality(PER_SVR4); \ | ||
311 | else if (current->personality != PER_LINUX32) \ | ||
312 | set_personality(PER_LINUX); \ | ||
313 | } while (0) | ||
314 | |||
315 | #endif /* CONFIG_64BIT */ | ||
316 | |||
317 | struct task_struct; | ||
318 | |||
319 | extern void elf_dump_regs(elf_greg_t *, struct pt_regs *regs); | ||
320 | extern int dump_task_regs(struct task_struct *, elf_gregset_t *); | ||
321 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); | ||
322 | |||
323 | #define ELF_CORE_COPY_REGS(elf_regs, regs) \ | ||
324 | elf_dump_regs((elf_greg_t *)&(elf_regs), regs); | ||
325 | #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) | ||
326 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \ | ||
327 | dump_task_fpu(tsk, elf_fpregs) | ||
328 | |||
329 | #define USE_ELF_CORE_DUMP | ||
330 | #define ELF_EXEC_PAGESIZE PAGE_SIZE | ||
331 | |||
332 | /* This yields a mask that user programs can use to figure out what | ||
333 | instruction set this cpu supports. This could be done in userspace, | ||
334 | but it's not easy, and we've already done it here. */ | ||
335 | |||
336 | #define ELF_HWCAP (0) | ||
337 | |||
338 | /* This yields a string that ld.so will use to load implementation | ||
339 | specific libraries for optimization. This is more specific in | ||
340 | intent than poking at uname or /proc/cpuinfo. | ||
341 | |||
342 | For the moment, we have only optimizations for the Intel generations, | ||
343 | but that could change... */ | ||
344 | |||
345 | #define ELF_PLATFORM (NULL) | ||
346 | |||
347 | /* | ||
348 | * See comments in asm-alpha/elf.h, this is the same thing | ||
349 | * on the MIPS. | ||
350 | */ | ||
351 | #define ELF_PLAT_INIT(_r, load_addr) do { \ | ||
352 | _r->regs[1] = _r->regs[2] = _r->regs[3] = _r->regs[4] = 0; \ | ||
353 | _r->regs[5] = _r->regs[6] = _r->regs[7] = _r->regs[8] = 0; \ | ||
354 | _r->regs[9] = _r->regs[10] = _r->regs[11] = _r->regs[12] = 0; \ | ||
355 | _r->regs[13] = _r->regs[14] = _r->regs[15] = _r->regs[16] = 0; \ | ||
356 | _r->regs[17] = _r->regs[18] = _r->regs[19] = _r->regs[20] = 0; \ | ||
357 | _r->regs[21] = _r->regs[22] = _r->regs[23] = _r->regs[24] = 0; \ | ||
358 | _r->regs[25] = _r->regs[26] = _r->regs[27] = _r->regs[28] = 0; \ | ||
359 | _r->regs[30] = _r->regs[31] = 0; \ | ||
360 | } while (0) | ||
361 | |||
362 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | ||
363 | use of this is to invoke "./ld.so someprog" to test out a new version of | ||
364 | the loader. We need to make sure that it is out of the way of the program | ||
365 | that it will "exec", and that there is sufficient room for the brk. */ | ||
366 | |||
367 | #ifndef ELF_ET_DYN_BASE | ||
368 | #define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2) | ||
369 | #endif | ||
370 | |||
371 | #endif /* _ASM_ELF_H */ | ||
diff --git a/include/asm-mips/emergency-restart.h b/include/asm-mips/emergency-restart.h deleted file mode 100644 index 108d8c48e42e..000000000000 --- a/include/asm-mips/emergency-restart.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-mips/emma2rh/emma2rh.h b/include/asm-mips/emma2rh/emma2rh.h deleted file mode 100644 index 6a1af0af51e3..000000000000 --- a/include/asm-mips/emma2rh/emma2rh.h +++ /dev/null | |||
@@ -1,333 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/emma2rh/emma2rh.h | ||
3 | * This file is EMMA2RH common header. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2005-2006 | ||
6 | * | ||
7 | * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h | ||
8 | * Copyright 2001 MontaVista Software Inc. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | */ | ||
24 | #ifndef __ASM_EMMA2RH_EMMA2RH_H | ||
25 | #define __ASM_EMMA2RH_EMMA2RH_H | ||
26 | |||
27 | #include <irq.h> | ||
28 | |||
29 | /* | ||
30 | * EMMA2RH registers | ||
31 | */ | ||
32 | #define REGBASE 0x10000000 | ||
33 | |||
34 | #define EMMA2RH_BHIF_STRAP_0 (0x000010+REGBASE) | ||
35 | #define EMMA2RH_BHIF_INT_ST_0 (0x000030+REGBASE) | ||
36 | #define EMMA2RH_BHIF_INT_ST_1 (0x000034+REGBASE) | ||
37 | #define EMMA2RH_BHIF_INT_ST_2 (0x000038+REGBASE) | ||
38 | #define EMMA2RH_BHIF_INT_EN_0 (0x000040+REGBASE) | ||
39 | #define EMMA2RH_BHIF_INT_EN_1 (0x000044+REGBASE) | ||
40 | #define EMMA2RH_BHIF_INT_EN_2 (0x000048+REGBASE) | ||
41 | #define EMMA2RH_BHIF_INT1_EN_0 (0x000050+REGBASE) | ||
42 | #define EMMA2RH_BHIF_INT1_EN_1 (0x000054+REGBASE) | ||
43 | #define EMMA2RH_BHIF_INT1_EN_2 (0x000058+REGBASE) | ||
44 | #define EMMA2RH_BHIF_SW_INT (0x000070+REGBASE) | ||
45 | #define EMMA2RH_BHIF_SW_INT_EN (0x000080+REGBASE) | ||
46 | #define EMMA2RH_BHIF_SW_INT_CLR (0x000090+REGBASE) | ||
47 | #define EMMA2RH_BHIF_MAIN_CTRL (0x0000b4+REGBASE) | ||
48 | #define EMMA2RH_BHIF_EXCEPT_VECT_BASE_ADDRESS (0x0000c0+REGBASE) | ||
49 | #define EMMA2RH_GPIO_DIR (0x110d20+REGBASE) | ||
50 | #define EMMA2RH_GPIO_INT_ST (0x110d30+REGBASE) | ||
51 | #define EMMA2RH_GPIO_INT_MASK (0x110d3c+REGBASE) | ||
52 | #define EMMA2RH_GPIO_INT_MODE (0x110d48+REGBASE) | ||
53 | #define EMMA2RH_GPIO_INT_CND_A (0x110d54+REGBASE) | ||
54 | #define EMMA2RH_GPIO_INT_CND_B (0x110d60+REGBASE) | ||
55 | #define EMMA2RH_PBRD_INT_EN (0x100010+REGBASE) | ||
56 | #define EMMA2RH_PBRD_CLKSEL (0x100028+REGBASE) | ||
57 | #define EMMA2RH_PFUR0_BASE (0x101000+REGBASE) | ||
58 | #define EMMA2RH_PFUR1_BASE (0x102000+REGBASE) | ||
59 | #define EMMA2RH_PFUR2_BASE (0x103000+REGBASE) | ||
60 | #define EMMA2RH_PIIC0_BASE (0x107000+REGBASE) | ||
61 | #define EMMA2RH_PIIC1_BASE (0x108000+REGBASE) | ||
62 | #define EMMA2RH_PIIC2_BASE (0x109000+REGBASE) | ||
63 | #define EMMA2RH_PCI_CONTROL (0x200000+REGBASE) | ||
64 | #define EMMA2RH_PCI_ARBIT_CTR (0x200004+REGBASE) | ||
65 | #define EMMA2RH_PCI_IWIN0_CTR (0x200010+REGBASE) | ||
66 | #define EMMA2RH_PCI_IWIN1_CTR (0x200014+REGBASE) | ||
67 | #define EMMA2RH_PCI_INIT_ESWP (0x200018+REGBASE) | ||
68 | #define EMMA2RH_PCI_INT (0x200020+REGBASE) | ||
69 | #define EMMA2RH_PCI_INT_EN (0x200024+REGBASE) | ||
70 | #define EMMA2RH_PCI_TWIN_CTR (0x200030+REGBASE) | ||
71 | #define EMMA2RH_PCI_TWIN_BADR (0x200034+REGBASE) | ||
72 | #define EMMA2RH_PCI_TWIN0_DADR (0x200038+REGBASE) | ||
73 | #define EMMA2RH_PCI_TWIN1_DADR (0x20003c+REGBASE) | ||
74 | |||
75 | /* | ||
76 | * Memory map (physical address) | ||
77 | * | ||
78 | * Note most of the following address must be properly aligned by the | ||
79 | * corresponding size. For example, if PCI_IO_SIZE is 16MB, then | ||
80 | * PCI_IO_BASE must be aligned along 16MB boundary. | ||
81 | */ | ||
82 | |||
83 | /* the actual ram size is detected at run-time */ | ||
84 | #define EMMA2RH_RAM_BASE 0x00000000 | ||
85 | #define EMMA2RH_RAM_SIZE 0x10000000 /* less than 256MB */ | ||
86 | |||
87 | #define EMMA2RH_IO_BASE 0x10000000 | ||
88 | #define EMMA2RH_IO_SIZE 0x01000000 /* 16 MB */ | ||
89 | |||
90 | #define EMMA2RH_GENERALIO_BASE 0x11000000 | ||
91 | #define EMMA2RH_GENERALIO_SIZE 0x01000000 /* 16 MB */ | ||
92 | |||
93 | #define EMMA2RH_PCI_IO_BASE 0x12000000 | ||
94 | #define EMMA2RH_PCI_IO_SIZE 0x02000000 /* 32 MB */ | ||
95 | |||
96 | #define EMMA2RH_PCI_MEM_BASE 0x14000000 | ||
97 | #define EMMA2RH_PCI_MEM_SIZE 0x08000000 /* 128 MB */ | ||
98 | |||
99 | #define EMMA2RH_ROM_BASE 0x1c000000 | ||
100 | #define EMMA2RH_ROM_SIZE 0x04000000 /* 64 MB */ | ||
101 | |||
102 | #define EMMA2RH_PCI_CONFIG_BASE EMMA2RH_PCI_IO_BASE | ||
103 | #define EMMA2RH_PCI_CONFIG_SIZE EMMA2RH_PCI_IO_SIZE | ||
104 | |||
105 | #define NUM_CPU_IRQ 8 | ||
106 | #define NUM_EMMA2RH_IRQ 96 | ||
107 | |||
108 | #define CPU_EMMA2RH_CASCADE 2 | ||
109 | #define CPU_IRQ_BASE MIPS_CPU_IRQ_BASE | ||
110 | #define EMMA2RH_IRQ_BASE (CPU_IRQ_BASE + NUM_CPU_IRQ) | ||
111 | |||
112 | /* | ||
113 | * emma2rh irq defs | ||
114 | */ | ||
115 | |||
116 | #define EMMA2RH_IRQ_INT0 (0 + EMMA2RH_IRQ_BASE) | ||
117 | #define EMMA2RH_IRQ_INT1 (1 + EMMA2RH_IRQ_BASE) | ||
118 | #define EMMA2RH_IRQ_INT2 (2 + EMMA2RH_IRQ_BASE) | ||
119 | #define EMMA2RH_IRQ_INT3 (3 + EMMA2RH_IRQ_BASE) | ||
120 | #define EMMA2RH_IRQ_INT4 (4 + EMMA2RH_IRQ_BASE) | ||
121 | #define EMMA2RH_IRQ_INT5 (5 + EMMA2RH_IRQ_BASE) | ||
122 | #define EMMA2RH_IRQ_INT6 (6 + EMMA2RH_IRQ_BASE) | ||
123 | #define EMMA2RH_IRQ_INT7 (7 + EMMA2RH_IRQ_BASE) | ||
124 | #define EMMA2RH_IRQ_INT8 (8 + EMMA2RH_IRQ_BASE) | ||
125 | #define EMMA2RH_IRQ_INT9 (9 + EMMA2RH_IRQ_BASE) | ||
126 | #define EMMA2RH_IRQ_INT10 (10 + EMMA2RH_IRQ_BASE) | ||
127 | #define EMMA2RH_IRQ_INT11 (11 + EMMA2RH_IRQ_BASE) | ||
128 | #define EMMA2RH_IRQ_INT12 (12 + EMMA2RH_IRQ_BASE) | ||
129 | #define EMMA2RH_IRQ_INT13 (13 + EMMA2RH_IRQ_BASE) | ||
130 | #define EMMA2RH_IRQ_INT14 (14 + EMMA2RH_IRQ_BASE) | ||
131 | #define EMMA2RH_IRQ_INT15 (15 + EMMA2RH_IRQ_BASE) | ||
132 | #define EMMA2RH_IRQ_INT16 (16 + EMMA2RH_IRQ_BASE) | ||
133 | #define EMMA2RH_IRQ_INT17 (17 + EMMA2RH_IRQ_BASE) | ||
134 | #define EMMA2RH_IRQ_INT18 (18 + EMMA2RH_IRQ_BASE) | ||
135 | #define EMMA2RH_IRQ_INT19 (19 + EMMA2RH_IRQ_BASE) | ||
136 | #define EMMA2RH_IRQ_INT20 (20 + EMMA2RH_IRQ_BASE) | ||
137 | #define EMMA2RH_IRQ_INT21 (21 + EMMA2RH_IRQ_BASE) | ||
138 | #define EMMA2RH_IRQ_INT22 (22 + EMMA2RH_IRQ_BASE) | ||
139 | #define EMMA2RH_IRQ_INT23 (23 + EMMA2RH_IRQ_BASE) | ||
140 | #define EMMA2RH_IRQ_INT24 (24 + EMMA2RH_IRQ_BASE) | ||
141 | #define EMMA2RH_IRQ_INT25 (25 + EMMA2RH_IRQ_BASE) | ||
142 | #define EMMA2RH_IRQ_INT26 (26 + EMMA2RH_IRQ_BASE) | ||
143 | #define EMMA2RH_IRQ_INT27 (27 + EMMA2RH_IRQ_BASE) | ||
144 | #define EMMA2RH_IRQ_INT28 (28 + EMMA2RH_IRQ_BASE) | ||
145 | #define EMMA2RH_IRQ_INT29 (29 + EMMA2RH_IRQ_BASE) | ||
146 | #define EMMA2RH_IRQ_INT30 (30 + EMMA2RH_IRQ_BASE) | ||
147 | #define EMMA2RH_IRQ_INT31 (31 + EMMA2RH_IRQ_BASE) | ||
148 | #define EMMA2RH_IRQ_INT32 (32 + EMMA2RH_IRQ_BASE) | ||
149 | #define EMMA2RH_IRQ_INT33 (33 + EMMA2RH_IRQ_BASE) | ||
150 | #define EMMA2RH_IRQ_INT34 (34 + EMMA2RH_IRQ_BASE) | ||
151 | #define EMMA2RH_IRQ_INT35 (35 + EMMA2RH_IRQ_BASE) | ||
152 | #define EMMA2RH_IRQ_INT36 (36 + EMMA2RH_IRQ_BASE) | ||
153 | #define EMMA2RH_IRQ_INT37 (37 + EMMA2RH_IRQ_BASE) | ||
154 | #define EMMA2RH_IRQ_INT38 (38 + EMMA2RH_IRQ_BASE) | ||
155 | #define EMMA2RH_IRQ_INT39 (39 + EMMA2RH_IRQ_BASE) | ||
156 | #define EMMA2RH_IRQ_INT40 (40 + EMMA2RH_IRQ_BASE) | ||
157 | #define EMMA2RH_IRQ_INT41 (41 + EMMA2RH_IRQ_BASE) | ||
158 | #define EMMA2RH_IRQ_INT42 (42 + EMMA2RH_IRQ_BASE) | ||
159 | #define EMMA2RH_IRQ_INT43 (43 + EMMA2RH_IRQ_BASE) | ||
160 | #define EMMA2RH_IRQ_INT44 (44 + EMMA2RH_IRQ_BASE) | ||
161 | #define EMMA2RH_IRQ_INT45 (45 + EMMA2RH_IRQ_BASE) | ||
162 | #define EMMA2RH_IRQ_INT46 (46 + EMMA2RH_IRQ_BASE) | ||
163 | #define EMMA2RH_IRQ_INT47 (47 + EMMA2RH_IRQ_BASE) | ||
164 | #define EMMA2RH_IRQ_INT48 (48 + EMMA2RH_IRQ_BASE) | ||
165 | #define EMMA2RH_IRQ_INT49 (49 + EMMA2RH_IRQ_BASE) | ||
166 | #define EMMA2RH_IRQ_INT50 (50 + EMMA2RH_IRQ_BASE) | ||
167 | #define EMMA2RH_IRQ_INT51 (51 + EMMA2RH_IRQ_BASE) | ||
168 | #define EMMA2RH_IRQ_INT52 (52 + EMMA2RH_IRQ_BASE) | ||
169 | #define EMMA2RH_IRQ_INT53 (53 + EMMA2RH_IRQ_BASE) | ||
170 | #define EMMA2RH_IRQ_INT54 (54 + EMMA2RH_IRQ_BASE) | ||
171 | #define EMMA2RH_IRQ_INT55 (55 + EMMA2RH_IRQ_BASE) | ||
172 | #define EMMA2RH_IRQ_INT56 (56 + EMMA2RH_IRQ_BASE) | ||
173 | #define EMMA2RH_IRQ_INT57 (57 + EMMA2RH_IRQ_BASE) | ||
174 | #define EMMA2RH_IRQ_INT58 (58 + EMMA2RH_IRQ_BASE) | ||
175 | #define EMMA2RH_IRQ_INT59 (59 + EMMA2RH_IRQ_BASE) | ||
176 | #define EMMA2RH_IRQ_INT60 (60 + EMMA2RH_IRQ_BASE) | ||
177 | #define EMMA2RH_IRQ_INT61 (61 + EMMA2RH_IRQ_BASE) | ||
178 | #define EMMA2RH_IRQ_INT62 (62 + EMMA2RH_IRQ_BASE) | ||
179 | #define EMMA2RH_IRQ_INT63 (63 + EMMA2RH_IRQ_BASE) | ||
180 | |||
181 | #define EMMA2RH_IRQ_PFUR0 EMMA2RH_IRQ_INT49 | ||
182 | #define EMMA2RH_IRQ_PFUR1 EMMA2RH_IRQ_INT50 | ||
183 | #define EMMA2RH_IRQ_PFUR2 EMMA2RH_IRQ_INT51 | ||
184 | #define EMMA2RH_IRQ_PIIC0 EMMA2RH_IRQ_INT56 | ||
185 | #define EMMA2RH_IRQ_PIIC1 EMMA2RH_IRQ_INT57 | ||
186 | #define EMMA2RH_IRQ_PIIC2 EMMA2RH_IRQ_INT58 | ||
187 | |||
188 | /* | ||
189 | * EMMA2RH Register Access | ||
190 | */ | ||
191 | |||
192 | #define EMMA2RH_BASE (0xa0000000) | ||
193 | |||
194 | static inline void emma2rh_sync(void) | ||
195 | { | ||
196 | volatile u32 *p = (volatile u32 *)0xbfc00000; | ||
197 | (void)(*p); | ||
198 | } | ||
199 | |||
200 | static inline void emma2rh_out32(u32 offset, u32 val) | ||
201 | { | ||
202 | *(volatile u32 *)(EMMA2RH_BASE | offset) = val; | ||
203 | emma2rh_sync(); | ||
204 | } | ||
205 | |||
206 | static inline u32 emma2rh_in32(u32 offset) | ||
207 | { | ||
208 | u32 val = *(volatile u32 *)(EMMA2RH_BASE | offset); | ||
209 | emma2rh_sync(); | ||
210 | return val; | ||
211 | } | ||
212 | |||
213 | static inline void emma2rh_out16(u32 offset, u16 val) | ||
214 | { | ||
215 | *(volatile u16 *)(EMMA2RH_BASE | offset) = val; | ||
216 | emma2rh_sync(); | ||
217 | } | ||
218 | |||
219 | static inline u16 emma2rh_in16(u32 offset) | ||
220 | { | ||
221 | u16 val = *(volatile u16 *)(EMMA2RH_BASE | offset); | ||
222 | emma2rh_sync(); | ||
223 | return val; | ||
224 | } | ||
225 | |||
226 | static inline void emma2rh_out8(u32 offset, u8 val) | ||
227 | { | ||
228 | *(volatile u8 *)(EMMA2RH_BASE | offset) = val; | ||
229 | emma2rh_sync(); | ||
230 | } | ||
231 | |||
232 | static inline u8 emma2rh_in8(u32 offset) | ||
233 | { | ||
234 | u8 val = *(volatile u8 *)(EMMA2RH_BASE | offset); | ||
235 | emma2rh_sync(); | ||
236 | return val; | ||
237 | } | ||
238 | |||
239 | /** | ||
240 | * IIC registers map | ||
241 | **/ | ||
242 | |||
243 | /*---------------------------------------------------------------------------*/ | ||
244 | /* CNT - Control register (00H R/W) */ | ||
245 | /*---------------------------------------------------------------------------*/ | ||
246 | #define SPT 0x00000001 | ||
247 | #define STT 0x00000002 | ||
248 | #define ACKE 0x00000004 | ||
249 | #define WTIM 0x00000008 | ||
250 | #define SPIE 0x00000010 | ||
251 | #define WREL 0x00000020 | ||
252 | #define LREL 0x00000040 | ||
253 | #define IICE 0x00000080 | ||
254 | #define CNT_RESERVED 0x000000ff /* reserved bit 0 */ | ||
255 | |||
256 | #define I2C_EMMA_START (IICE | STT) | ||
257 | #define I2C_EMMA_STOP (IICE | SPT) | ||
258 | #define I2C_EMMA_REPSTART I2C_EMMA_START | ||
259 | |||
260 | /*---------------------------------------------------------------------------*/ | ||
261 | /* STA - Status register (10H Read) */ | ||
262 | /*---------------------------------------------------------------------------*/ | ||
263 | #define MSTS 0x00000080 | ||
264 | #define ALD 0x00000040 | ||
265 | #define EXC 0x00000020 | ||
266 | #define COI 0x00000010 | ||
267 | #define TRC 0x00000008 | ||
268 | #define ACKD 0x00000004 | ||
269 | #define STD 0x00000002 | ||
270 | #define SPD 0x00000001 | ||
271 | |||
272 | /*---------------------------------------------------------------------------*/ | ||
273 | /* CSEL - Clock select register (20H R/W) */ | ||
274 | /*---------------------------------------------------------------------------*/ | ||
275 | #define FCL 0x00000080 | ||
276 | #define ND50 0x00000040 | ||
277 | #define CLD 0x00000020 | ||
278 | #define DAD 0x00000010 | ||
279 | #define SMC 0x00000008 | ||
280 | #define DFC 0x00000004 | ||
281 | #define CL 0x00000003 | ||
282 | #define CSEL_RESERVED 0x000000ff /* reserved bit 0 */ | ||
283 | |||
284 | #define FAST397 0x0000008b | ||
285 | #define FAST297 0x0000008a | ||
286 | #define FAST347 0x0000000b | ||
287 | #define FAST260 0x0000000a | ||
288 | #define FAST130 0x00000008 | ||
289 | #define STANDARD108 0x00000083 | ||
290 | #define STANDARD83 0x00000082 | ||
291 | #define STANDARD95 0x00000003 | ||
292 | #define STANDARD73 0x00000002 | ||
293 | #define STANDARD36 0x00000001 | ||
294 | #define STANDARD71 0x00000000 | ||
295 | |||
296 | /*---------------------------------------------------------------------------*/ | ||
297 | /* SVA - Slave address register (30H R/W) */ | ||
298 | /*---------------------------------------------------------------------------*/ | ||
299 | #define SVA 0x000000fe | ||
300 | |||
301 | /*---------------------------------------------------------------------------*/ | ||
302 | /* SHR - Shift register (40H R/W) */ | ||
303 | /*---------------------------------------------------------------------------*/ | ||
304 | #define SR 0x000000ff | ||
305 | |||
306 | /*---------------------------------------------------------------------------*/ | ||
307 | /* INT - Interrupt register (50H R/W) */ | ||
308 | /* INTM - Interrupt mask register (60H R/W) */ | ||
309 | /*---------------------------------------------------------------------------*/ | ||
310 | #define INTE0 0x00000001 | ||
311 | |||
312 | /*********************************************************************** | ||
313 | * I2C registers | ||
314 | *********************************************************************** | ||
315 | */ | ||
316 | #define I2C_EMMA_CNT 0x00 | ||
317 | #define I2C_EMMA_STA 0x10 | ||
318 | #define I2C_EMMA_CSEL 0x20 | ||
319 | #define I2C_EMMA_SVA 0x30 | ||
320 | #define I2C_EMMA_SHR 0x40 | ||
321 | #define I2C_EMMA_INT 0x50 | ||
322 | #define I2C_EMMA_INTM 0x60 | ||
323 | |||
324 | /* | ||
325 | * include the board dependent part | ||
326 | */ | ||
327 | #if defined(CONFIG_MARKEINS) | ||
328 | #include <asm/emma2rh/markeins.h> | ||
329 | #else | ||
330 | #error "Unknown EMMA2RH board!" | ||
331 | #endif | ||
332 | |||
333 | #endif /* __ASM_EMMA2RH_EMMA2RH_H */ | ||
diff --git a/include/asm-mips/emma2rh/markeins.h b/include/asm-mips/emma2rh/markeins.h deleted file mode 100644 index 973b0628490d..000000000000 --- a/include/asm-mips/emma2rh/markeins.h +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/emma2rh/markeins.h | ||
3 | * This file is EMMA2RH board depended header. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2005-2006 | ||
6 | * | ||
7 | * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h | ||
8 | * Copyright 2001 MontaVista Software Inc. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | */ | ||
24 | |||
25 | #ifndef MARKEINS_H | ||
26 | #define MARKEINS_H | ||
27 | |||
28 | #define NUM_EMMA2RH_IRQ_SW 32 | ||
29 | #define NUM_EMMA2RH_IRQ_GPIO 32 | ||
30 | |||
31 | #define EMMA2RH_SW_CASCADE (EMMA2RH_IRQ_INT7 - EMMA2RH_IRQ_INT0) | ||
32 | #define EMMA2RH_GPIO_CASCADE (EMMA2RH_IRQ_INT46 - EMMA2RH_IRQ_INT0) | ||
33 | |||
34 | #define EMMA2RH_SW_IRQ_BASE (EMMA2RH_IRQ_BASE + NUM_EMMA2RH_IRQ) | ||
35 | #define EMMA2RH_GPIO_IRQ_BASE (EMMA2RH_SW_IRQ_BASE + NUM_EMMA2RH_IRQ_SW) | ||
36 | |||
37 | #define EMMA2RH_SW_IRQ_INT0 (0+EMMA2RH_SW_IRQ_BASE) | ||
38 | #define EMMA2RH_SW_IRQ_INT1 (1+EMMA2RH_SW_IRQ_BASE) | ||
39 | #define EMMA2RH_SW_IRQ_INT2 (2+EMMA2RH_SW_IRQ_BASE) | ||
40 | #define EMMA2RH_SW_IRQ_INT3 (3+EMMA2RH_SW_IRQ_BASE) | ||
41 | #define EMMA2RH_SW_IRQ_INT4 (4+EMMA2RH_SW_IRQ_BASE) | ||
42 | #define EMMA2RH_SW_IRQ_INT5 (5+EMMA2RH_SW_IRQ_BASE) | ||
43 | #define EMMA2RH_SW_IRQ_INT6 (6+EMMA2RH_SW_IRQ_BASE) | ||
44 | #define EMMA2RH_SW_IRQ_INT7 (7+EMMA2RH_SW_IRQ_BASE) | ||
45 | #define EMMA2RH_SW_IRQ_INT8 (8+EMMA2RH_SW_IRQ_BASE) | ||
46 | #define EMMA2RH_SW_IRQ_INT9 (9+EMMA2RH_SW_IRQ_BASE) | ||
47 | #define EMMA2RH_SW_IRQ_INT10 (10+EMMA2RH_SW_IRQ_BASE) | ||
48 | #define EMMA2RH_SW_IRQ_INT11 (11+EMMA2RH_SW_IRQ_BASE) | ||
49 | #define EMMA2RH_SW_IRQ_INT12 (12+EMMA2RH_SW_IRQ_BASE) | ||
50 | #define EMMA2RH_SW_IRQ_INT13 (13+EMMA2RH_SW_IRQ_BASE) | ||
51 | #define EMMA2RH_SW_IRQ_INT14 (14+EMMA2RH_SW_IRQ_BASE) | ||
52 | #define EMMA2RH_SW_IRQ_INT15 (15+EMMA2RH_SW_IRQ_BASE) | ||
53 | #define EMMA2RH_SW_IRQ_INT16 (16+EMMA2RH_SW_IRQ_BASE) | ||
54 | #define EMMA2RH_SW_IRQ_INT17 (17+EMMA2RH_SW_IRQ_BASE) | ||
55 | #define EMMA2RH_SW_IRQ_INT18 (18+EMMA2RH_SW_IRQ_BASE) | ||
56 | #define EMMA2RH_SW_IRQ_INT19 (19+EMMA2RH_SW_IRQ_BASE) | ||
57 | #define EMMA2RH_SW_IRQ_INT20 (20+EMMA2RH_SW_IRQ_BASE) | ||
58 | #define EMMA2RH_SW_IRQ_INT21 (21+EMMA2RH_SW_IRQ_BASE) | ||
59 | #define EMMA2RH_SW_IRQ_INT22 (22+EMMA2RH_SW_IRQ_BASE) | ||
60 | #define EMMA2RH_SW_IRQ_INT23 (23+EMMA2RH_SW_IRQ_BASE) | ||
61 | #define EMMA2RH_SW_IRQ_INT24 (24+EMMA2RH_SW_IRQ_BASE) | ||
62 | #define EMMA2RH_SW_IRQ_INT25 (25+EMMA2RH_SW_IRQ_BASE) | ||
63 | #define EMMA2RH_SW_IRQ_INT26 (26+EMMA2RH_SW_IRQ_BASE) | ||
64 | #define EMMA2RH_SW_IRQ_INT27 (27+EMMA2RH_SW_IRQ_BASE) | ||
65 | #define EMMA2RH_SW_IRQ_INT28 (28+EMMA2RH_SW_IRQ_BASE) | ||
66 | #define EMMA2RH_SW_IRQ_INT29 (29+EMMA2RH_SW_IRQ_BASE) | ||
67 | #define EMMA2RH_SW_IRQ_INT30 (30+EMMA2RH_SW_IRQ_BASE) | ||
68 | #define EMMA2RH_SW_IRQ_INT31 (31+EMMA2RH_SW_IRQ_BASE) | ||
69 | |||
70 | #define MARKEINS_PCI_IRQ_INTA EMMA2RH_GPIO_IRQ_BASE+15 | ||
71 | #define MARKEINS_PCI_IRQ_INTB EMMA2RH_GPIO_IRQ_BASE+16 | ||
72 | #define MARKEINS_PCI_IRQ_INTC EMMA2RH_GPIO_IRQ_BASE+17 | ||
73 | #define MARKEINS_PCI_IRQ_INTD EMMA2RH_GPIO_IRQ_BASE+18 | ||
74 | |||
75 | #endif /* CONFIG_MARKEINS */ | ||
diff --git a/include/asm-mips/errno.h b/include/asm-mips/errno.h deleted file mode 100644 index 3c0d840e4577..000000000000 --- a/include/asm-mips/errno.h +++ /dev/null | |||
@@ -1,131 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 1999, 2001, 2002 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_ERRNO_H | ||
9 | #define _ASM_ERRNO_H | ||
10 | |||
11 | /* | ||
12 | * These error numbers are intended to be MIPS ABI compatible | ||
13 | */ | ||
14 | |||
15 | #include <asm-generic/errno-base.h> | ||
16 | |||
17 | #define ENOMSG 35 /* No message of desired type */ | ||
18 | #define EIDRM 36 /* Identifier removed */ | ||
19 | #define ECHRNG 37 /* Channel number out of range */ | ||
20 | #define EL2NSYNC 38 /* Level 2 not synchronized */ | ||
21 | #define EL3HLT 39 /* Level 3 halted */ | ||
22 | #define EL3RST 40 /* Level 3 reset */ | ||
23 | #define ELNRNG 41 /* Link number out of range */ | ||
24 | #define EUNATCH 42 /* Protocol driver not attached */ | ||
25 | #define ENOCSI 43 /* No CSI structure available */ | ||
26 | #define EL2HLT 44 /* Level 2 halted */ | ||
27 | #define EDEADLK 45 /* Resource deadlock would occur */ | ||
28 | #define ENOLCK 46 /* No record locks available */ | ||
29 | #define EBADE 50 /* Invalid exchange */ | ||
30 | #define EBADR 51 /* Invalid request descriptor */ | ||
31 | #define EXFULL 52 /* Exchange full */ | ||
32 | #define ENOANO 53 /* No anode */ | ||
33 | #define EBADRQC 54 /* Invalid request code */ | ||
34 | #define EBADSLT 55 /* Invalid slot */ | ||
35 | #define EDEADLOCK 56 /* File locking deadlock error */ | ||
36 | #define EBFONT 59 /* Bad font file format */ | ||
37 | #define ENOSTR 60 /* Device not a stream */ | ||
38 | #define ENODATA 61 /* No data available */ | ||
39 | #define ETIME 62 /* Timer expired */ | ||
40 | #define ENOSR 63 /* Out of streams resources */ | ||
41 | #define ENONET 64 /* Machine is not on the network */ | ||
42 | #define ENOPKG 65 /* Package not installed */ | ||
43 | #define EREMOTE 66 /* Object is remote */ | ||
44 | #define ENOLINK 67 /* Link has been severed */ | ||
45 | #define EADV 68 /* Advertise error */ | ||
46 | #define ESRMNT 69 /* Srmount error */ | ||
47 | #define ECOMM 70 /* Communication error on send */ | ||
48 | #define EPROTO 71 /* Protocol error */ | ||
49 | #define EDOTDOT 73 /* RFS specific error */ | ||
50 | #define EMULTIHOP 74 /* Multihop attempted */ | ||
51 | #define EBADMSG 77 /* Not a data message */ | ||
52 | #define ENAMETOOLONG 78 /* File name too long */ | ||
53 | #define EOVERFLOW 79 /* Value too large for defined data type */ | ||
54 | #define ENOTUNIQ 80 /* Name not unique on network */ | ||
55 | #define EBADFD 81 /* File descriptor in bad state */ | ||
56 | #define EREMCHG 82 /* Remote address changed */ | ||
57 | #define ELIBACC 83 /* Can not access a needed shared library */ | ||
58 | #define ELIBBAD 84 /* Accessing a corrupted shared library */ | ||
59 | #define ELIBSCN 85 /* .lib section in a.out corrupted */ | ||
60 | #define ELIBMAX 86 /* Attempting to link in too many shared libraries */ | ||
61 | #define ELIBEXEC 87 /* Cannot exec a shared library directly */ | ||
62 | #define EILSEQ 88 /* Illegal byte sequence */ | ||
63 | #define ENOSYS 89 /* Function not implemented */ | ||
64 | #define ELOOP 90 /* Too many symbolic links encountered */ | ||
65 | #define ERESTART 91 /* Interrupted system call should be restarted */ | ||
66 | #define ESTRPIPE 92 /* Streams pipe error */ | ||
67 | #define ENOTEMPTY 93 /* Directory not empty */ | ||
68 | #define EUSERS 94 /* Too many users */ | ||
69 | #define ENOTSOCK 95 /* Socket operation on non-socket */ | ||
70 | #define EDESTADDRREQ 96 /* Destination address required */ | ||
71 | #define EMSGSIZE 97 /* Message too long */ | ||
72 | #define EPROTOTYPE 98 /* Protocol wrong type for socket */ | ||
73 | #define ENOPROTOOPT 99 /* Protocol not available */ | ||
74 | #define EPROTONOSUPPORT 120 /* Protocol not supported */ | ||
75 | #define ESOCKTNOSUPPORT 121 /* Socket type not supported */ | ||
76 | #define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */ | ||
77 | #define EPFNOSUPPORT 123 /* Protocol family not supported */ | ||
78 | #define EAFNOSUPPORT 124 /* Address family not supported by protocol */ | ||
79 | #define EADDRINUSE 125 /* Address already in use */ | ||
80 | #define EADDRNOTAVAIL 126 /* Cannot assign requested address */ | ||
81 | #define ENETDOWN 127 /* Network is down */ | ||
82 | #define ENETUNREACH 128 /* Network is unreachable */ | ||
83 | #define ENETRESET 129 /* Network dropped connection because of reset */ | ||
84 | #define ECONNABORTED 130 /* Software caused connection abort */ | ||
85 | #define ECONNRESET 131 /* Connection reset by peer */ | ||
86 | #define ENOBUFS 132 /* No buffer space available */ | ||
87 | #define EISCONN 133 /* Transport endpoint is already connected */ | ||
88 | #define ENOTCONN 134 /* Transport endpoint is not connected */ | ||
89 | #define EUCLEAN 135 /* Structure needs cleaning */ | ||
90 | #define ENOTNAM 137 /* Not a XENIX named type file */ | ||
91 | #define ENAVAIL 138 /* No XENIX semaphores available */ | ||
92 | #define EISNAM 139 /* Is a named type file */ | ||
93 | #define EREMOTEIO 140 /* Remote I/O error */ | ||
94 | #define EINIT 141 /* Reserved */ | ||
95 | #define EREMDEV 142 /* Error 142 */ | ||
96 | #define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */ | ||
97 | #define ETOOMANYREFS 144 /* Too many references: cannot splice */ | ||
98 | #define ETIMEDOUT 145 /* Connection timed out */ | ||
99 | #define ECONNREFUSED 146 /* Connection refused */ | ||
100 | #define EHOSTDOWN 147 /* Host is down */ | ||
101 | #define EHOSTUNREACH 148 /* No route to host */ | ||
102 | #define EWOULDBLOCK EAGAIN /* Operation would block */ | ||
103 | #define EALREADY 149 /* Operation already in progress */ | ||
104 | #define EINPROGRESS 150 /* Operation now in progress */ | ||
105 | #define ESTALE 151 /* Stale NFS file handle */ | ||
106 | #define ECANCELED 158 /* AIO operation canceled */ | ||
107 | |||
108 | /* | ||
109 | * These error are Linux extensions. | ||
110 | */ | ||
111 | #define ENOMEDIUM 159 /* No medium found */ | ||
112 | #define EMEDIUMTYPE 160 /* Wrong medium type */ | ||
113 | #define ENOKEY 161 /* Required key not available */ | ||
114 | #define EKEYEXPIRED 162 /* Key has expired */ | ||
115 | #define EKEYREVOKED 163 /* Key has been revoked */ | ||
116 | #define EKEYREJECTED 164 /* Key was rejected by service */ | ||
117 | |||
118 | /* for robust mutexes */ | ||
119 | #define EOWNERDEAD 165 /* Owner died */ | ||
120 | #define ENOTRECOVERABLE 166 /* State not recoverable */ | ||
121 | |||
122 | #define EDQUOT 1133 /* Quota exceeded */ | ||
123 | |||
124 | #ifdef __KERNEL__ | ||
125 | |||
126 | /* The biggest error number defined here or in <linux/errno.h>. */ | ||
127 | #define EMAXERRNO 1133 | ||
128 | |||
129 | #endif /* __KERNEL__ */ | ||
130 | |||
131 | #endif /* _ASM_ERRNO_H */ | ||
diff --git a/include/asm-mips/fb.h b/include/asm-mips/fb.h deleted file mode 100644 index bd3f68c9ddfc..000000000000 --- a/include/asm-mips/fb.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | #ifndef _ASM_FB_H_ | ||
2 | #define _ASM_FB_H_ | ||
3 | |||
4 | #include <linux/fb.h> | ||
5 | #include <linux/fs.h> | ||
6 | #include <asm/page.h> | ||
7 | |||
8 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
9 | unsigned long off) | ||
10 | { | ||
11 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
12 | } | ||
13 | |||
14 | static inline int fb_is_primary_device(struct fb_info *info) | ||
15 | { | ||
16 | return 0; | ||
17 | } | ||
18 | |||
19 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h deleted file mode 100644 index 2a52333a062d..000000000000 --- a/include/asm-mips/fcntl.h +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_FCNTL_H | ||
9 | #define _ASM_FCNTL_H | ||
10 | |||
11 | |||
12 | #define O_APPEND 0x0008 | ||
13 | #define O_SYNC 0x0010 | ||
14 | #define O_NONBLOCK 0x0080 | ||
15 | #define O_CREAT 0x0100 /* not fcntl */ | ||
16 | #define O_TRUNC 0x0200 /* not fcntl */ | ||
17 | #define O_EXCL 0x0400 /* not fcntl */ | ||
18 | #define O_NOCTTY 0x0800 /* not fcntl */ | ||
19 | #define FASYNC 0x1000 /* fcntl, for BSD compatibility */ | ||
20 | #define O_LARGEFILE 0x2000 /* allow large file opens */ | ||
21 | #define O_DIRECT 0x8000 /* direct disk access hint */ | ||
22 | |||
23 | #define F_GETLK 14 | ||
24 | #define F_SETLK 6 | ||
25 | #define F_SETLKW 7 | ||
26 | |||
27 | #define F_SETOWN 24 /* for sockets. */ | ||
28 | #define F_GETOWN 23 /* for sockets. */ | ||
29 | |||
30 | #ifndef __mips64 | ||
31 | #define F_GETLK64 33 /* using 'struct flock64' */ | ||
32 | #define F_SETLK64 34 | ||
33 | #define F_SETLKW64 35 | ||
34 | #endif | ||
35 | |||
36 | /* | ||
37 | * The flavours of struct flock. "struct flock" is the ABI compliant | ||
38 | * variant. Finally struct flock64 is the LFS variant of struct flock. As | ||
39 | * a historic accident and inconsistence with the ABI definition it doesn't | ||
40 | * contain all the same fields as struct flock. | ||
41 | */ | ||
42 | |||
43 | #ifdef CONFIG_32BIT | ||
44 | |||
45 | struct flock { | ||
46 | short l_type; | ||
47 | short l_whence; | ||
48 | off_t l_start; | ||
49 | off_t l_len; | ||
50 | long l_sysid; | ||
51 | __kernel_pid_t l_pid; | ||
52 | long pad[4]; | ||
53 | }; | ||
54 | |||
55 | #define HAVE_ARCH_STRUCT_FLOCK | ||
56 | |||
57 | #endif /* CONFIG_32BIT */ | ||
58 | |||
59 | #include <asm-generic/fcntl.h> | ||
60 | |||
61 | #endif /* _ASM_FCNTL_H */ | ||
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h deleted file mode 100644 index 9cc8522a394f..000000000000 --- a/include/asm-mips/fixmap.h +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | /* | ||
2 | * fixmap.h: compile-time virtual memory allocation | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1998 Ingo Molnar | ||
9 | * | ||
10 | * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 | ||
11 | */ | ||
12 | |||
13 | #ifndef _ASM_FIXMAP_H | ||
14 | #define _ASM_FIXMAP_H | ||
15 | |||
16 | #include <asm/page.h> | ||
17 | #ifdef CONFIG_HIGHMEM | ||
18 | #include <linux/threads.h> | ||
19 | #include <asm/kmap_types.h> | ||
20 | #endif | ||
21 | |||
22 | /* | ||
23 | * Here we define all the compile-time 'special' virtual | ||
24 | * addresses. The point is to have a constant address at | ||
25 | * compile time, but to set the physical address only | ||
26 | * in the boot process. We allocate these special addresses | ||
27 | * from the end of virtual memory (0xfffff000) backwards. | ||
28 | * Also this lets us do fail-safe vmalloc(), we | ||
29 | * can guarantee that these special addresses and | ||
30 | * vmalloc()-ed addresses never overlap. | ||
31 | * | ||
32 | * these 'compile-time allocated' memory buffers are | ||
33 | * fixed-size 4k pages. (or larger if used with an increment | ||
34 | * highger than 1) use fixmap_set(idx,phys) to associate | ||
35 | * physical memory with fixmap indices. | ||
36 | * | ||
37 | * TLB entries of such buffers will not be flushed across | ||
38 | * task switches. | ||
39 | */ | ||
40 | |||
41 | /* | ||
42 | * on UP currently we will have no trace of the fixmap mechanizm, | ||
43 | * no page table allocations, etc. This might change in the | ||
44 | * future, say framebuffers for the console driver(s) could be | ||
45 | * fix-mapped? | ||
46 | */ | ||
47 | enum fixed_addresses { | ||
48 | #define FIX_N_COLOURS 8 | ||
49 | FIX_CMAP_BEGIN, | ||
50 | #ifdef CONFIG_MIPS_MT_SMTC | ||
51 | FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS), | ||
52 | #else | ||
53 | FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS, | ||
54 | #endif | ||
55 | #ifdef CONFIG_HIGHMEM | ||
56 | /* reserved pte's for temporary kernel mappings */ | ||
57 | FIX_KMAP_BEGIN = FIX_CMAP_END + 1, | ||
58 | FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, | ||
59 | #endif | ||
60 | __end_of_fixed_addresses | ||
61 | }; | ||
62 | |||
63 | /* | ||
64 | * used by vmalloc.c. | ||
65 | * | ||
66 | * Leave one empty page between vmalloc'ed areas and | ||
67 | * the start of the fixmap, and leave one page empty | ||
68 | * at the top of mem.. | ||
69 | */ | ||
70 | #if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX) | ||
71 | #define FIXADDR_TOP ((unsigned long)(long)(int)(0xff000000 - 0x20000)) | ||
72 | #else | ||
73 | #define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000) | ||
74 | #endif | ||
75 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) | ||
76 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) | ||
77 | |||
78 | #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) | ||
79 | #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) | ||
80 | |||
81 | extern void __this_fixmap_does_not_exist(void); | ||
82 | |||
83 | /* | ||
84 | * 'index to address' translation. If anyone tries to use the idx | ||
85 | * directly without tranlation, we catch the bug with a NULL-deference | ||
86 | * kernel oops. Illegal ranges of incoming indices are caught too. | ||
87 | */ | ||
88 | static inline unsigned long fix_to_virt(const unsigned int idx) | ||
89 | { | ||
90 | /* | ||
91 | * this branch gets completely eliminated after inlining, | ||
92 | * except when someone tries to use fixaddr indices in an | ||
93 | * illegal way. (such as mixing up address types or using | ||
94 | * out-of-range indices). | ||
95 | * | ||
96 | * If it doesn't get removed, the linker will complain | ||
97 | * loudly with a reasonably clear error message.. | ||
98 | */ | ||
99 | if (idx >= __end_of_fixed_addresses) | ||
100 | __this_fixmap_does_not_exist(); | ||
101 | |||
102 | return __fix_to_virt(idx); | ||
103 | } | ||
104 | |||
105 | static inline unsigned long virt_to_fix(const unsigned long vaddr) | ||
106 | { | ||
107 | BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); | ||
108 | return __virt_to_fix(vaddr); | ||
109 | } | ||
110 | |||
111 | /* | ||
112 | * Called from pgtable_init() | ||
113 | */ | ||
114 | extern void fixrange_init(unsigned long start, unsigned long end, | ||
115 | pgd_t *pgd_base); | ||
116 | |||
117 | |||
118 | #endif | ||
diff --git a/include/asm-mips/floppy.h b/include/asm-mips/floppy.h deleted file mode 100644 index 992d232adc83..000000000000 --- a/include/asm-mips/floppy.h +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /* | ||
2 | * Architecture specific parts of the Floppy driver | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1995 - 2000 Ralf Baechle | ||
9 | */ | ||
10 | #ifndef _ASM_FLOPPY_H | ||
11 | #define _ASM_FLOPPY_H | ||
12 | |||
13 | #include <linux/dma-mapping.h> | ||
14 | |||
15 | static inline void fd_cacheflush(char * addr, long size) | ||
16 | { | ||
17 | dma_cache_sync(NULL, addr, size, DMA_BIDIRECTIONAL); | ||
18 | } | ||
19 | |||
20 | #define MAX_BUFFER_SECTORS 24 | ||
21 | |||
22 | |||
23 | /* | ||
24 | * And on Mips's the CMOS info fails also ... | ||
25 | * | ||
26 | * FIXME: This information should come from the ARC configuration tree | ||
27 | * or whereever a particular machine has stored this ... | ||
28 | */ | ||
29 | #define FLOPPY0_TYPE fd_drive_type(0) | ||
30 | #define FLOPPY1_TYPE fd_drive_type(1) | ||
31 | |||
32 | #define FDC1 fd_getfdaddr1(); | ||
33 | |||
34 | #define N_FDC 1 /* do you *really* want a second controller? */ | ||
35 | #define N_DRIVE 8 | ||
36 | |||
37 | /* | ||
38 | * The DMA channel used by the floppy controller cannot access data at | ||
39 | * addresses >= 16MB | ||
40 | * | ||
41 | * Went back to the 1MB limit, as some people had problems with the floppy | ||
42 | * driver otherwise. It doesn't matter much for performance anyway, as most | ||
43 | * floppy accesses go through the track buffer. | ||
44 | * | ||
45 | * On MIPSes using vdma, this actually means that *all* transfers go thru | ||
46 | * the * track buffer since 0x1000000 is always smaller than KSEG0/1. | ||
47 | * Actually this needs to be a bit more complicated since the so much different | ||
48 | * hardware available with MIPS CPUs ... | ||
49 | */ | ||
50 | #define CROSS_64KB(a, s) ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64) | ||
51 | |||
52 | #define EXTRA_FLOPPY_PARAMS | ||
53 | |||
54 | #include <floppy.h> | ||
55 | |||
56 | #endif /* _ASM_FLOPPY_H */ | ||
diff --git a/include/asm-mips/fpregdef.h b/include/asm-mips/fpregdef.h deleted file mode 100644 index 2b5fddc8f487..000000000000 --- a/include/asm-mips/fpregdef.h +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for the FPU register names | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1995, 1999 Ralf Baechle | ||
9 | * Copyright (C) 1985 MIPS Computer Systems, Inc. | ||
10 | * Copyright (C) 1990 - 1992, 1999 Silicon Graphics, Inc. | ||
11 | */ | ||
12 | #ifndef _ASM_FPREGDEF_H | ||
13 | #define _ASM_FPREGDEF_H | ||
14 | |||
15 | #include <asm/sgidefs.h> | ||
16 | |||
17 | #if _MIPS_SIM == _MIPS_SIM_ABI32 | ||
18 | |||
19 | /* | ||
20 | * These definitions only cover the R3000-ish 16/32 register model. | ||
21 | * But we're trying to be R3000 friendly anyway ... | ||
22 | */ | ||
23 | #define fv0 $f0 /* return value */ | ||
24 | #define fv0f $f1 | ||
25 | #define fv1 $f2 | ||
26 | #define fv1f $f3 | ||
27 | #define fa0 $f12 /* argument registers */ | ||
28 | #define fa0f $f13 | ||
29 | #define fa1 $f14 | ||
30 | #define fa1f $f15 | ||
31 | #define ft0 $f4 /* caller saved */ | ||
32 | #define ft0f $f5 | ||
33 | #define ft1 $f6 | ||
34 | #define ft1f $f7 | ||
35 | #define ft2 $f8 | ||
36 | #define ft2f $f9 | ||
37 | #define ft3 $f10 | ||
38 | #define ft3f $f11 | ||
39 | #define ft4 $f16 | ||
40 | #define ft4f $f17 | ||
41 | #define ft5 $f18 | ||
42 | #define ft5f $f19 | ||
43 | #define fs0 $f20 /* callee saved */ | ||
44 | #define fs0f $f21 | ||
45 | #define fs1 $f22 | ||
46 | #define fs1f $f23 | ||
47 | #define fs2 $f24 | ||
48 | #define fs2f $f25 | ||
49 | #define fs3 $f26 | ||
50 | #define fs3f $f27 | ||
51 | #define fs4 $f28 | ||
52 | #define fs4f $f29 | ||
53 | #define fs5 $f30 | ||
54 | #define fs5f $f31 | ||
55 | |||
56 | #define fcr31 $31 /* FPU status register */ | ||
57 | |||
58 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | ||
59 | |||
60 | #if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 | ||
61 | |||
62 | #define fv0 $f0 /* return value */ | ||
63 | #define fv1 $f2 | ||
64 | #define fa0 $f12 /* argument registers */ | ||
65 | #define fa1 $f13 | ||
66 | #define fa2 $f14 | ||
67 | #define fa3 $f15 | ||
68 | #define fa4 $f16 | ||
69 | #define fa5 $f17 | ||
70 | #define fa6 $f18 | ||
71 | #define fa7 $f19 | ||
72 | #define ft0 $f4 /* caller saved */ | ||
73 | #define ft1 $f5 | ||
74 | #define ft2 $f6 | ||
75 | #define ft3 $f7 | ||
76 | #define ft4 $f8 | ||
77 | #define ft5 $f9 | ||
78 | #define ft6 $f10 | ||
79 | #define ft7 $f11 | ||
80 | #define ft8 $f20 | ||
81 | #define ft9 $f21 | ||
82 | #define ft10 $f22 | ||
83 | #define ft11 $f23 | ||
84 | #define ft12 $f1 | ||
85 | #define ft13 $f3 | ||
86 | #define fs0 $f24 /* callee saved */ | ||
87 | #define fs1 $f25 | ||
88 | #define fs2 $f26 | ||
89 | #define fs3 $f27 | ||
90 | #define fs4 $f28 | ||
91 | #define fs5 $f29 | ||
92 | #define fs6 $f30 | ||
93 | #define fs7 $f31 | ||
94 | |||
95 | #define fcr31 $31 | ||
96 | |||
97 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */ | ||
98 | |||
99 | #endif /* _ASM_FPREGDEF_H */ | ||
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h deleted file mode 100644 index 8a3ef247659a..000000000000 --- a/include/asm-mips/fpu.h +++ /dev/null | |||
@@ -1,153 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 MontaVista Software Inc. | ||
3 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | */ | ||
10 | #ifndef _ASM_FPU_H | ||
11 | #define _ASM_FPU_H | ||
12 | |||
13 | #include <linux/sched.h> | ||
14 | #include <linux/thread_info.h> | ||
15 | #include <linux/bitops.h> | ||
16 | |||
17 | #include <asm/mipsregs.h> | ||
18 | #include <asm/cpu.h> | ||
19 | #include <asm/cpu-features.h> | ||
20 | #include <asm/hazards.h> | ||
21 | #include <asm/processor.h> | ||
22 | #include <asm/current.h> | ||
23 | |||
24 | #ifdef CONFIG_MIPS_MT_FPAFF | ||
25 | #include <asm/mips_mt.h> | ||
26 | #endif | ||
27 | |||
28 | struct sigcontext; | ||
29 | struct sigcontext32; | ||
30 | |||
31 | extern asmlinkage int (*save_fp_context)(struct sigcontext __user *sc); | ||
32 | extern asmlinkage int (*restore_fp_context)(struct sigcontext __user *sc); | ||
33 | |||
34 | extern asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc); | ||
35 | extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc); | ||
36 | |||
37 | extern void fpu_emulator_init_fpu(void); | ||
38 | extern int fpu_emulator_save_context(struct sigcontext __user *sc); | ||
39 | extern int fpu_emulator_restore_context(struct sigcontext __user *sc); | ||
40 | extern void _init_fpu(void); | ||
41 | extern void _save_fp(struct task_struct *); | ||
42 | extern void _restore_fp(struct task_struct *); | ||
43 | |||
44 | #define __enable_fpu() \ | ||
45 | do { \ | ||
46 | set_c0_status(ST0_CU1); \ | ||
47 | enable_fpu_hazard(); \ | ||
48 | } while (0) | ||
49 | |||
50 | #define __disable_fpu() \ | ||
51 | do { \ | ||
52 | clear_c0_status(ST0_CU1); \ | ||
53 | disable_fpu_hazard(); \ | ||
54 | } while (0) | ||
55 | |||
56 | #define enable_fpu() \ | ||
57 | do { \ | ||
58 | if (cpu_has_fpu) \ | ||
59 | __enable_fpu(); \ | ||
60 | } while (0) | ||
61 | |||
62 | #define disable_fpu() \ | ||
63 | do { \ | ||
64 | if (cpu_has_fpu) \ | ||
65 | __disable_fpu(); \ | ||
66 | } while (0) | ||
67 | |||
68 | |||
69 | #define clear_fpu_owner() clear_thread_flag(TIF_USEDFPU) | ||
70 | |||
71 | static inline int __is_fpu_owner(void) | ||
72 | { | ||
73 | return test_thread_flag(TIF_USEDFPU); | ||
74 | } | ||
75 | |||
76 | static inline int is_fpu_owner(void) | ||
77 | { | ||
78 | return cpu_has_fpu && __is_fpu_owner(); | ||
79 | } | ||
80 | |||
81 | static inline void __own_fpu(void) | ||
82 | { | ||
83 | __enable_fpu(); | ||
84 | KSTK_STATUS(current) |= ST0_CU1; | ||
85 | set_thread_flag(TIF_USEDFPU); | ||
86 | } | ||
87 | |||
88 | static inline void own_fpu_inatomic(int restore) | ||
89 | { | ||
90 | if (cpu_has_fpu && !__is_fpu_owner()) { | ||
91 | __own_fpu(); | ||
92 | if (restore) | ||
93 | _restore_fp(current); | ||
94 | } | ||
95 | } | ||
96 | |||
97 | static inline void own_fpu(int restore) | ||
98 | { | ||
99 | preempt_disable(); | ||
100 | own_fpu_inatomic(restore); | ||
101 | preempt_enable(); | ||
102 | } | ||
103 | |||
104 | static inline void lose_fpu(int save) | ||
105 | { | ||
106 | preempt_disable(); | ||
107 | if (is_fpu_owner()) { | ||
108 | if (save) | ||
109 | _save_fp(current); | ||
110 | KSTK_STATUS(current) &= ~ST0_CU1; | ||
111 | clear_thread_flag(TIF_USEDFPU); | ||
112 | __disable_fpu(); | ||
113 | } | ||
114 | preempt_enable(); | ||
115 | } | ||
116 | |||
117 | static inline void init_fpu(void) | ||
118 | { | ||
119 | preempt_disable(); | ||
120 | if (cpu_has_fpu) { | ||
121 | __own_fpu(); | ||
122 | _init_fpu(); | ||
123 | } else { | ||
124 | fpu_emulator_init_fpu(); | ||
125 | } | ||
126 | preempt_enable(); | ||
127 | } | ||
128 | |||
129 | static inline void save_fp(struct task_struct *tsk) | ||
130 | { | ||
131 | if (cpu_has_fpu) | ||
132 | _save_fp(tsk); | ||
133 | } | ||
134 | |||
135 | static inline void restore_fp(struct task_struct *tsk) | ||
136 | { | ||
137 | if (cpu_has_fpu) | ||
138 | _restore_fp(tsk); | ||
139 | } | ||
140 | |||
141 | static inline fpureg_t *get_fpu_regs(struct task_struct *tsk) | ||
142 | { | ||
143 | if (tsk == current) { | ||
144 | preempt_disable(); | ||
145 | if (is_fpu_owner()) | ||
146 | _save_fp(current); | ||
147 | preempt_enable(); | ||
148 | } | ||
149 | |||
150 | return tsk->thread.fpu.fpr; | ||
151 | } | ||
152 | |||
153 | #endif /* _ASM_FPU_H */ | ||
diff --git a/include/asm-mips/fpu_emulator.h b/include/asm-mips/fpu_emulator.h deleted file mode 100644 index 2731c38bd7ae..000000000000 --- a/include/asm-mips/fpu_emulator.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * This program is free software; you can distribute it and/or modify it | ||
3 | * under the terms of the GNU General Public License (Version 2) as | ||
4 | * published by the Free Software Foundation. | ||
5 | * | ||
6 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
7 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
8 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
9 | * for more details. | ||
10 | * | ||
11 | * You should have received a copy of the GNU General Public License along | ||
12 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
13 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
14 | * | ||
15 | * Further private data for which no space exists in mips_fpu_struct. | ||
16 | * This should be subsumed into the mips_fpu_struct structure as | ||
17 | * defined in processor.h as soon as the absurd wired absolute assembler | ||
18 | * offsets become dynamic at compile time. | ||
19 | * | ||
20 | * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com | ||
21 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
22 | */ | ||
23 | #ifndef _ASM_FPU_EMULATOR_H | ||
24 | #define _ASM_FPU_EMULATOR_H | ||
25 | |||
26 | struct mips_fpu_emulator_stats { | ||
27 | unsigned int emulated; | ||
28 | unsigned int loads; | ||
29 | unsigned int stores; | ||
30 | unsigned int cp1ops; | ||
31 | unsigned int cp1xops; | ||
32 | unsigned int errors; | ||
33 | }; | ||
34 | |||
35 | extern struct mips_fpu_emulator_stats fpuemustats; | ||
36 | |||
37 | #endif /* _ASM_FPU_EMULATOR_H */ | ||
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h deleted file mode 100644 index b9cce90346cf..000000000000 --- a/include/asm-mips/futex.h +++ /dev/null | |||
@@ -1,203 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 2006 Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #ifndef _ASM_FUTEX_H | ||
9 | #define _ASM_FUTEX_H | ||
10 | |||
11 | #ifdef __KERNEL__ | ||
12 | |||
13 | #include <linux/futex.h> | ||
14 | #include <linux/uaccess.h> | ||
15 | #include <asm/barrier.h> | ||
16 | #include <asm/errno.h> | ||
17 | #include <asm/war.h> | ||
18 | |||
19 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ | ||
20 | { \ | ||
21 | if (cpu_has_llsc && R10000_LLSC_WAR) { \ | ||
22 | __asm__ __volatile__( \ | ||
23 | " .set push \n" \ | ||
24 | " .set noat \n" \ | ||
25 | " .set mips3 \n" \ | ||
26 | "1: ll %1, %4 # __futex_atomic_op \n" \ | ||
27 | " .set mips0 \n" \ | ||
28 | " " insn " \n" \ | ||
29 | " .set mips3 \n" \ | ||
30 | "2: sc $1, %2 \n" \ | ||
31 | " beqzl $1, 1b \n" \ | ||
32 | __WEAK_LLSC_MB \ | ||
33 | "3: \n" \ | ||
34 | " .set pop \n" \ | ||
35 | " .set mips0 \n" \ | ||
36 | " .section .fixup,\"ax\" \n" \ | ||
37 | "4: li %0, %6 \n" \ | ||
38 | " j 3b \n" \ | ||
39 | " .previous \n" \ | ||
40 | " .section __ex_table,\"a\" \n" \ | ||
41 | " "__UA_ADDR "\t1b, 4b \n" \ | ||
42 | " "__UA_ADDR "\t2b, 4b \n" \ | ||
43 | " .previous \n" \ | ||
44 | : "=r" (ret), "=&r" (oldval), "=R" (*uaddr) \ | ||
45 | : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT) \ | ||
46 | : "memory"); \ | ||
47 | } else if (cpu_has_llsc) { \ | ||
48 | __asm__ __volatile__( \ | ||
49 | " .set push \n" \ | ||
50 | " .set noat \n" \ | ||
51 | " .set mips3 \n" \ | ||
52 | "1: ll %1, %4 # __futex_atomic_op \n" \ | ||
53 | " .set mips0 \n" \ | ||
54 | " " insn " \n" \ | ||
55 | " .set mips3 \n" \ | ||
56 | "2: sc $1, %2 \n" \ | ||
57 | " beqz $1, 1b \n" \ | ||
58 | __WEAK_LLSC_MB \ | ||
59 | "3: \n" \ | ||
60 | " .set pop \n" \ | ||
61 | " .set mips0 \n" \ | ||
62 | " .section .fixup,\"ax\" \n" \ | ||
63 | "4: li %0, %6 \n" \ | ||
64 | " j 3b \n" \ | ||
65 | " .previous \n" \ | ||
66 | " .section __ex_table,\"a\" \n" \ | ||
67 | " "__UA_ADDR "\t1b, 4b \n" \ | ||
68 | " "__UA_ADDR "\t2b, 4b \n" \ | ||
69 | " .previous \n" \ | ||
70 | : "=r" (ret), "=&r" (oldval), "=R" (*uaddr) \ | ||
71 | : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT) \ | ||
72 | : "memory"); \ | ||
73 | } else \ | ||
74 | ret = -ENOSYS; \ | ||
75 | } | ||
76 | |||
77 | static inline int | ||
78 | futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | ||
79 | { | ||
80 | int op = (encoded_op >> 28) & 7; | ||
81 | int cmp = (encoded_op >> 24) & 15; | ||
82 | int oparg = (encoded_op << 8) >> 20; | ||
83 | int cmparg = (encoded_op << 20) >> 20; | ||
84 | int oldval = 0, ret; | ||
85 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | ||
86 | oparg = 1 << oparg; | ||
87 | |||
88 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) | ||
89 | return -EFAULT; | ||
90 | |||
91 | pagefault_disable(); | ||
92 | |||
93 | switch (op) { | ||
94 | case FUTEX_OP_SET: | ||
95 | __futex_atomic_op("move $1, %z5", ret, oldval, uaddr, oparg); | ||
96 | break; | ||
97 | |||
98 | case FUTEX_OP_ADD: | ||
99 | __futex_atomic_op("addu $1, %1, %z5", | ||
100 | ret, oldval, uaddr, oparg); | ||
101 | break; | ||
102 | case FUTEX_OP_OR: | ||
103 | __futex_atomic_op("or $1, %1, %z5", | ||
104 | ret, oldval, uaddr, oparg); | ||
105 | break; | ||
106 | case FUTEX_OP_ANDN: | ||
107 | __futex_atomic_op("and $1, %1, %z5", | ||
108 | ret, oldval, uaddr, ~oparg); | ||
109 | break; | ||
110 | case FUTEX_OP_XOR: | ||
111 | __futex_atomic_op("xor $1, %1, %z5", | ||
112 | ret, oldval, uaddr, oparg); | ||
113 | break; | ||
114 | default: | ||
115 | ret = -ENOSYS; | ||
116 | } | ||
117 | |||
118 | pagefault_enable(); | ||
119 | |||
120 | if (!ret) { | ||
121 | switch (cmp) { | ||
122 | case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; | ||
123 | case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; | ||
124 | case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; | ||
125 | case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; | ||
126 | case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; | ||
127 | case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; | ||
128 | default: ret = -ENOSYS; | ||
129 | } | ||
130 | } | ||
131 | return ret; | ||
132 | } | ||
133 | |||
134 | static inline int | ||
135 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | ||
136 | { | ||
137 | int retval; | ||
138 | |||
139 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | ||
140 | return -EFAULT; | ||
141 | |||
142 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
143 | __asm__ __volatile__( | ||
144 | "# futex_atomic_cmpxchg_inatomic \n" | ||
145 | " .set push \n" | ||
146 | " .set noat \n" | ||
147 | " .set mips3 \n" | ||
148 | "1: ll %0, %2 \n" | ||
149 | " bne %0, %z3, 3f \n" | ||
150 | " .set mips0 \n" | ||
151 | " move $1, %z4 \n" | ||
152 | " .set mips3 \n" | ||
153 | "2: sc $1, %1 \n" | ||
154 | " beqzl $1, 1b \n" | ||
155 | __WEAK_LLSC_MB | ||
156 | "3: \n" | ||
157 | " .set pop \n" | ||
158 | " .section .fixup,\"ax\" \n" | ||
159 | "4: li %0, %5 \n" | ||
160 | " j 3b \n" | ||
161 | " .previous \n" | ||
162 | " .section __ex_table,\"a\" \n" | ||
163 | " "__UA_ADDR "\t1b, 4b \n" | ||
164 | " "__UA_ADDR "\t2b, 4b \n" | ||
165 | " .previous \n" | ||
166 | : "=&r" (retval), "=R" (*uaddr) | ||
167 | : "R" (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT) | ||
168 | : "memory"); | ||
169 | } else if (cpu_has_llsc) { | ||
170 | __asm__ __volatile__( | ||
171 | "# futex_atomic_cmpxchg_inatomic \n" | ||
172 | " .set push \n" | ||
173 | " .set noat \n" | ||
174 | " .set mips3 \n" | ||
175 | "1: ll %0, %2 \n" | ||
176 | " bne %0, %z3, 3f \n" | ||
177 | " .set mips0 \n" | ||
178 | " move $1, %z4 \n" | ||
179 | " .set mips3 \n" | ||
180 | "2: sc $1, %1 \n" | ||
181 | " beqz $1, 1b \n" | ||
182 | __WEAK_LLSC_MB | ||
183 | "3: \n" | ||
184 | " .set pop \n" | ||
185 | " .section .fixup,\"ax\" \n" | ||
186 | "4: li %0, %5 \n" | ||
187 | " j 3b \n" | ||
188 | " .previous \n" | ||
189 | " .section __ex_table,\"a\" \n" | ||
190 | " "__UA_ADDR "\t1b, 4b \n" | ||
191 | " "__UA_ADDR "\t2b, 4b \n" | ||
192 | " .previous \n" | ||
193 | : "=&r" (retval), "=R" (*uaddr) | ||
194 | : "R" (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT) | ||
195 | : "memory"); | ||
196 | } else | ||
197 | return -ENOSYS; | ||
198 | |||
199 | return retval; | ||
200 | } | ||
201 | |||
202 | #endif | ||
203 | #endif /* _ASM_FUTEX_H */ | ||
diff --git a/include/asm-mips/fw/arc/hinv.h b/include/asm-mips/fw/arc/hinv.h deleted file mode 100644 index e6ff4add04e2..000000000000 --- a/include/asm-mips/fw/arc/hinv.h +++ /dev/null | |||
@@ -1,175 +0,0 @@ | |||
1 | /* | ||
2 | * ARCS hardware/memory inventory/configuration and system ID definitions. | ||
3 | */ | ||
4 | #ifndef _ASM_ARC_HINV_H | ||
5 | #define _ASM_ARC_HINV_H | ||
6 | |||
7 | #include <asm/sgidefs.h> | ||
8 | #include <asm/fw/arc/types.h> | ||
9 | |||
10 | /* configuration query defines */ | ||
11 | typedef enum configclass { | ||
12 | SystemClass, | ||
13 | ProcessorClass, | ||
14 | CacheClass, | ||
15 | #ifndef _NT_PROM | ||
16 | MemoryClass, | ||
17 | AdapterClass, | ||
18 | ControllerClass, | ||
19 | PeripheralClass | ||
20 | #else /* _NT_PROM */ | ||
21 | AdapterClass, | ||
22 | ControllerClass, | ||
23 | PeripheralClass, | ||
24 | MemoryClass | ||
25 | #endif /* _NT_PROM */ | ||
26 | } CONFIGCLASS; | ||
27 | |||
28 | typedef enum configtype { | ||
29 | ARC, | ||
30 | CPU, | ||
31 | FPU, | ||
32 | PrimaryICache, | ||
33 | PrimaryDCache, | ||
34 | SecondaryICache, | ||
35 | SecondaryDCache, | ||
36 | SecondaryCache, | ||
37 | #ifndef _NT_PROM | ||
38 | Memory, | ||
39 | #endif | ||
40 | EISAAdapter, | ||
41 | TCAdapter, | ||
42 | SCSIAdapter, | ||
43 | DTIAdapter, | ||
44 | MultiFunctionAdapter, | ||
45 | DiskController, | ||
46 | TapeController, | ||
47 | CDROMController, | ||
48 | WORMController, | ||
49 | SerialController, | ||
50 | NetworkController, | ||
51 | DisplayController, | ||
52 | ParallelController, | ||
53 | PointerController, | ||
54 | KeyboardController, | ||
55 | AudioController, | ||
56 | OtherController, | ||
57 | DiskPeripheral, | ||
58 | FloppyDiskPeripheral, | ||
59 | TapePeripheral, | ||
60 | ModemPeripheral, | ||
61 | MonitorPeripheral, | ||
62 | PrinterPeripheral, | ||
63 | PointerPeripheral, | ||
64 | KeyboardPeripheral, | ||
65 | TerminalPeripheral, | ||
66 | LinePeripheral, | ||
67 | NetworkPeripheral, | ||
68 | #ifdef _NT_PROM | ||
69 | Memory, | ||
70 | #endif | ||
71 | OtherPeripheral, | ||
72 | |||
73 | /* new stuff for IP30 */ | ||
74 | /* added without moving anything */ | ||
75 | /* except ANONYMOUS. */ | ||
76 | |||
77 | XTalkAdapter, | ||
78 | PCIAdapter, | ||
79 | GIOAdapter, | ||
80 | TPUAdapter, | ||
81 | |||
82 | Anonymous | ||
83 | } CONFIGTYPE; | ||
84 | |||
85 | typedef enum { | ||
86 | Failed = 1, | ||
87 | ReadOnly = 2, | ||
88 | Removable = 4, | ||
89 | ConsoleIn = 8, | ||
90 | ConsoleOut = 16, | ||
91 | Input = 32, | ||
92 | Output = 64 | ||
93 | } IDENTIFIERFLAG; | ||
94 | |||
95 | #ifndef NULL /* for GetChild(NULL); */ | ||
96 | #define NULL 0 | ||
97 | #endif | ||
98 | |||
99 | union key_u { | ||
100 | struct { | ||
101 | #ifdef _MIPSEB | ||
102 | unsigned char c_bsize; /* block size in lines */ | ||
103 | unsigned char c_lsize; /* line size in bytes/tag */ | ||
104 | unsigned short c_size; /* cache size in 4K pages */ | ||
105 | #else /* _MIPSEL */ | ||
106 | unsigned short c_size; /* cache size in 4K pages */ | ||
107 | unsigned char c_lsize; /* line size in bytes/tag */ | ||
108 | unsigned char c_bsize; /* block size in lines */ | ||
109 | #endif /* _MIPSEL */ | ||
110 | } cache; | ||
111 | ULONG FullKey; | ||
112 | }; | ||
113 | |||
114 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | ||
115 | #define SGI_ARCS_VERS 64 /* sgi 64-bit version */ | ||
116 | #define SGI_ARCS_REV 0 /* rev .00 */ | ||
117 | #else | ||
118 | #define SGI_ARCS_VERS 1 /* first version */ | ||
119 | #define SGI_ARCS_REV 10 /* rev .10, 3/04/92 */ | ||
120 | #endif | ||
121 | |||
122 | typedef struct component { | ||
123 | CONFIGCLASS Class; | ||
124 | CONFIGTYPE Type; | ||
125 | IDENTIFIERFLAG Flags; | ||
126 | USHORT Version; | ||
127 | USHORT Revision; | ||
128 | ULONG Key; | ||
129 | ULONG AffinityMask; | ||
130 | ULONG ConfigurationDataSize; | ||
131 | ULONG IdentifierLength; | ||
132 | char *Identifier; | ||
133 | } COMPONENT; | ||
134 | |||
135 | /* internal structure that holds pathname parsing data */ | ||
136 | struct cfgdata { | ||
137 | char *name; /* full name */ | ||
138 | int minlen; /* minimum length to match */ | ||
139 | CONFIGTYPE type; /* type of token */ | ||
140 | }; | ||
141 | |||
142 | /* System ID */ | ||
143 | typedef struct systemid { | ||
144 | CHAR VendorId[8]; | ||
145 | CHAR ProductId[8]; | ||
146 | } SYSTEMID; | ||
147 | |||
148 | /* memory query functions */ | ||
149 | typedef enum memorytype { | ||
150 | ExceptionBlock, | ||
151 | SPBPage, /* ARCS == SystemParameterBlock */ | ||
152 | #ifndef _NT_PROM | ||
153 | FreeContiguous, | ||
154 | FreeMemory, | ||
155 | BadMemory, | ||
156 | LoadedProgram, | ||
157 | FirmwareTemporary, | ||
158 | FirmwarePermanent | ||
159 | #else /* _NT_PROM */ | ||
160 | FreeMemory, | ||
161 | BadMemory, | ||
162 | LoadedProgram, | ||
163 | FirmwareTemporary, | ||
164 | FirmwarePermanent, | ||
165 | FreeContiguous | ||
166 | #endif /* _NT_PROM */ | ||
167 | } MEMORYTYPE; | ||
168 | |||
169 | typedef struct memorydescriptor { | ||
170 | MEMORYTYPE Type; | ||
171 | LONG BasePage; | ||
172 | LONG PageCount; | ||
173 | } MEMORYDESCRIPTOR; | ||
174 | |||
175 | #endif /* _ASM_ARC_HINV_H */ | ||
diff --git a/include/asm-mips/fw/arc/types.h b/include/asm-mips/fw/arc/types.h deleted file mode 100644 index b9adcd6f0860..000000000000 --- a/include/asm-mips/fw/arc/types.h +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright 1999 Ralf Baechle (ralf@gnu.org) | ||
7 | * Copyright 1999 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_ARC_TYPES_H | ||
10 | #define _ASM_ARC_TYPES_H | ||
11 | |||
12 | |||
13 | #ifdef CONFIG_ARC32 | ||
14 | |||
15 | typedef char CHAR; | ||
16 | typedef short SHORT; | ||
17 | typedef long LARGE_INTEGER __attribute__ ((__mode__ (__DI__))); | ||
18 | typedef long LONG __attribute__ ((__mode__ (__SI__))); | ||
19 | typedef unsigned char UCHAR; | ||
20 | typedef unsigned short USHORT; | ||
21 | typedef unsigned long ULONG __attribute__ ((__mode__ (__SI__))); | ||
22 | typedef void VOID; | ||
23 | |||
24 | /* The pointer types. Note that we're using a 64-bit compiler but all | ||
25 | pointer in the ARC structures are only 32-bit, so we need some disgusting | ||
26 | workarounds. Keep your vomit bag handy. */ | ||
27 | typedef LONG _PCHAR; | ||
28 | typedef LONG _PSHORT; | ||
29 | typedef LONG _PLARGE_INTEGER; | ||
30 | typedef LONG _PLONG; | ||
31 | typedef LONG _PUCHAR; | ||
32 | typedef LONG _PUSHORT; | ||
33 | typedef LONG _PULONG; | ||
34 | typedef LONG _PVOID; | ||
35 | |||
36 | #endif /* CONFIG_ARC32 */ | ||
37 | |||
38 | #ifdef CONFIG_ARC64 | ||
39 | |||
40 | typedef char CHAR; | ||
41 | typedef short SHORT; | ||
42 | typedef long LARGE_INTEGER __attribute__ ((__mode__ (__DI__))); | ||
43 | typedef long LONG __attribute__ ((__mode__ (__DI__))); | ||
44 | typedef unsigned char UCHAR; | ||
45 | typedef unsigned short USHORT; | ||
46 | typedef unsigned long ULONG __attribute__ ((__mode__ (__DI__))); | ||
47 | typedef void VOID; | ||
48 | |||
49 | /* The pointer types. We're 64-bit and the firmware is also 64-bit, so | ||
50 | live is sane ... */ | ||
51 | typedef CHAR *_PCHAR; | ||
52 | typedef SHORT *_PSHORT; | ||
53 | typedef LARGE_INTEGER *_PLARGE_INTEGER; | ||
54 | typedef LONG *_PLONG; | ||
55 | typedef UCHAR *_PUCHAR; | ||
56 | typedef USHORT *_PUSHORT; | ||
57 | typedef ULONG *_PULONG; | ||
58 | typedef VOID *_PVOID; | ||
59 | |||
60 | #endif /* CONFIG_ARC64 */ | ||
61 | |||
62 | typedef CHAR *PCHAR; | ||
63 | typedef SHORT *PSHORT; | ||
64 | typedef LARGE_INTEGER *PLARGE_INTEGER; | ||
65 | typedef LONG *PLONG; | ||
66 | typedef UCHAR *PUCHAR; | ||
67 | typedef USHORT *PUSHORT; | ||
68 | typedef ULONG *PULONG; | ||
69 | typedef VOID *PVOID; | ||
70 | |||
71 | /* | ||
72 | * Return type of ArcGetDisplayStatus() | ||
73 | */ | ||
74 | typedef struct { | ||
75 | USHORT CursorXPosition; | ||
76 | USHORT CursorYPosition; | ||
77 | USHORT CursorMaxXPosition; | ||
78 | USHORT CursorMaxYPosition; | ||
79 | USHORT ForegroundColor; | ||
80 | USHORT BackgroundColor; | ||
81 | UCHAR HighIntensity; | ||
82 | UCHAR Underscored; | ||
83 | UCHAR ReverseVideo; | ||
84 | } DISPLAY_STATUS; | ||
85 | |||
86 | #endif /* _ASM_ARC_TYPES_H */ | ||
diff --git a/include/asm-mips/fw/cfe/cfe_api.h b/include/asm-mips/fw/cfe/cfe_api.h deleted file mode 100644 index 0995575db320..000000000000 --- a/include/asm-mips/fw/cfe/cfe_api.h +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001, 2002 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 | /* | ||
19 | * Broadcom Common Firmware Environment (CFE) | ||
20 | * | ||
21 | * This file contains declarations for doing callbacks to | ||
22 | * cfe from an application. It should be the only header | ||
23 | * needed by the application to use this library | ||
24 | * | ||
25 | * Authors: Mitch Lichtenberg, Chris Demetriou | ||
26 | */ | ||
27 | #ifndef CFE_API_H | ||
28 | #define CFE_API_H | ||
29 | |||
30 | #include <linux/types.h> | ||
31 | #include <linux/string.h> | ||
32 | |||
33 | typedef long intptr_t; | ||
34 | |||
35 | |||
36 | /* | ||
37 | * Constants | ||
38 | */ | ||
39 | |||
40 | /* Seal indicating CFE's presence, passed to user program. */ | ||
41 | #define CFE_EPTSEAL 0x43464531 | ||
42 | |||
43 | #define CFE_MI_RESERVED 0 /* memory is reserved, do not use */ | ||
44 | #define CFE_MI_AVAILABLE 1 /* memory is available */ | ||
45 | |||
46 | #define CFE_FLG_WARMSTART 0x00000001 | ||
47 | #define CFE_FLG_FULL_ARENA 0x00000001 | ||
48 | #define CFE_FLG_ENV_PERMANENT 0x00000001 | ||
49 | |||
50 | #define CFE_CPU_CMD_START 1 | ||
51 | #define CFE_CPU_CMD_STOP 0 | ||
52 | |||
53 | #define CFE_STDHANDLE_CONSOLE 0 | ||
54 | |||
55 | #define CFE_DEV_NETWORK 1 | ||
56 | #define CFE_DEV_DISK 2 | ||
57 | #define CFE_DEV_FLASH 3 | ||
58 | #define CFE_DEV_SERIAL 4 | ||
59 | #define CFE_DEV_CPU 5 | ||
60 | #define CFE_DEV_NVRAM 6 | ||
61 | #define CFE_DEV_CLOCK 7 | ||
62 | #define CFE_DEV_OTHER 8 | ||
63 | #define CFE_DEV_MASK 0x0F | ||
64 | |||
65 | #define CFE_CACHE_FLUSH_D 1 | ||
66 | #define CFE_CACHE_INVAL_I 2 | ||
67 | #define CFE_CACHE_INVAL_D 4 | ||
68 | #define CFE_CACHE_INVAL_L2 8 | ||
69 | |||
70 | #define CFE_FWI_64BIT 0x00000001 | ||
71 | #define CFE_FWI_32BIT 0x00000002 | ||
72 | #define CFE_FWI_RELOC 0x00000004 | ||
73 | #define CFE_FWI_UNCACHED 0x00000008 | ||
74 | #define CFE_FWI_MULTICPU 0x00000010 | ||
75 | #define CFE_FWI_FUNCSIM 0x00000020 | ||
76 | #define CFE_FWI_RTLSIM 0x00000040 | ||
77 | |||
78 | typedef struct { | ||
79 | int64_t fwi_version; /* major, minor, eco version */ | ||
80 | int64_t fwi_totalmem; /* total installed mem */ | ||
81 | int64_t fwi_flags; /* various flags */ | ||
82 | int64_t fwi_boardid; /* board ID */ | ||
83 | int64_t fwi_bootarea_va; /* VA of boot area */ | ||
84 | int64_t fwi_bootarea_pa; /* PA of boot area */ | ||
85 | int64_t fwi_bootarea_size; /* size of boot area */ | ||
86 | } cfe_fwinfo_t; | ||
87 | |||
88 | |||
89 | /* | ||
90 | * Defines and prototypes for functions which take no arguments. | ||
91 | */ | ||
92 | int64_t cfe_getticks(void); | ||
93 | |||
94 | /* | ||
95 | * Defines and prototypes for the rest of the functions. | ||
96 | */ | ||
97 | int cfe_close(int handle); | ||
98 | int cfe_cpu_start(int cpu, void (*fn) (void), long sp, long gp, long a1); | ||
99 | int cfe_cpu_stop(int cpu); | ||
100 | int cfe_enumenv(int idx, char *name, int namelen, char *val, int vallen); | ||
101 | int cfe_enummem(int idx, int flags, uint64_t * start, uint64_t * length, | ||
102 | uint64_t * type); | ||
103 | int cfe_exit(int warm, int status); | ||
104 | int cfe_flushcache(int flg); | ||
105 | int cfe_getdevinfo(char *name); | ||
106 | int cfe_getenv(char *name, char *dest, int destlen); | ||
107 | int cfe_getfwinfo(cfe_fwinfo_t * info); | ||
108 | int cfe_getstdhandle(int flg); | ||
109 | int cfe_init(uint64_t handle, uint64_t ept); | ||
110 | int cfe_inpstat(int handle); | ||
111 | int cfe_ioctl(int handle, unsigned int ioctlnum, unsigned char *buffer, | ||
112 | int length, int *retlen, uint64_t offset); | ||
113 | int cfe_open(char *name); | ||
114 | int cfe_read(int handle, unsigned char *buffer, int length); | ||
115 | int cfe_readblk(int handle, int64_t offset, unsigned char *buffer, | ||
116 | int length); | ||
117 | int cfe_setenv(char *name, char *val); | ||
118 | int cfe_write(int handle, unsigned char *buffer, int length); | ||
119 | int cfe_writeblk(int handle, int64_t offset, unsigned char *buffer, | ||
120 | int length); | ||
121 | |||
122 | #endif /* CFE_API_H */ | ||
diff --git a/include/asm-mips/fw/cfe/cfe_error.h b/include/asm-mips/fw/cfe/cfe_error.h deleted file mode 100644 index b80374636279..000000000000 --- a/include/asm-mips/fw/cfe/cfe_error.h +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001, 2002 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 | |||
19 | /* | ||
20 | * Broadcom Common Firmware Environment (CFE) | ||
21 | * | ||
22 | * CFE's global error code list is here. | ||
23 | * | ||
24 | * Author: Mitch Lichtenberg | ||
25 | */ | ||
26 | |||
27 | #define CFE_OK 0 | ||
28 | #define CFE_ERR -1 /* generic error */ | ||
29 | #define CFE_ERR_INV_COMMAND -2 | ||
30 | #define CFE_ERR_EOF -3 | ||
31 | #define CFE_ERR_IOERR -4 | ||
32 | #define CFE_ERR_NOMEM -5 | ||
33 | #define CFE_ERR_DEVNOTFOUND -6 | ||
34 | #define CFE_ERR_DEVOPEN -7 | ||
35 | #define CFE_ERR_INV_PARAM -8 | ||
36 | #define CFE_ERR_ENVNOTFOUND -9 | ||
37 | #define CFE_ERR_ENVREADONLY -10 | ||
38 | |||
39 | #define CFE_ERR_NOTELF -11 | ||
40 | #define CFE_ERR_NOT32BIT -12 | ||
41 | #define CFE_ERR_WRONGENDIAN -13 | ||
42 | #define CFE_ERR_BADELFVERS -14 | ||
43 | #define CFE_ERR_NOTMIPS -15 | ||
44 | #define CFE_ERR_BADELFFMT -16 | ||
45 | #define CFE_ERR_BADADDR -17 | ||
46 | |||
47 | #define CFE_ERR_FILENOTFOUND -18 | ||
48 | #define CFE_ERR_UNSUPPORTED -19 | ||
49 | |||
50 | #define CFE_ERR_HOSTUNKNOWN -20 | ||
51 | |||
52 | #define CFE_ERR_TIMEOUT -21 | ||
53 | |||
54 | #define CFE_ERR_PROTOCOLERR -22 | ||
55 | |||
56 | #define CFE_ERR_NETDOWN -23 | ||
57 | #define CFE_ERR_NONAMESERVER -24 | ||
58 | |||
59 | #define CFE_ERR_NOHANDLES -25 | ||
60 | #define CFE_ERR_ALREADYBOUND -26 | ||
61 | |||
62 | #define CFE_ERR_CANNOTSET -27 | ||
63 | #define CFE_ERR_NOMORE -28 | ||
64 | #define CFE_ERR_BADFILESYS -29 | ||
65 | #define CFE_ERR_FSNOTAVAIL -30 | ||
66 | |||
67 | #define CFE_ERR_INVBOOTBLOCK -31 | ||
68 | #define CFE_ERR_WRONGDEVTYPE -32 | ||
69 | #define CFE_ERR_BBCHECKSUM -33 | ||
70 | #define CFE_ERR_BOOTPROGCHKSUM -34 | ||
71 | |||
72 | #define CFE_ERR_LDRNOTAVAIL -35 | ||
73 | |||
74 | #define CFE_ERR_NOTREADY -36 | ||
75 | |||
76 | #define CFE_ERR_GETMEM -37 | ||
77 | #define CFE_ERR_SETMEM -38 | ||
78 | |||
79 | #define CFE_ERR_NOTCONN -39 | ||
80 | #define CFE_ERR_ADDRINUSE -40 | ||
diff --git a/include/asm-mips/gcmpregs.h b/include/asm-mips/gcmpregs.h deleted file mode 100644 index d74a8a4ca861..000000000000 --- a/include/asm-mips/gcmpregs.h +++ /dev/null | |||
@@ -1,117 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000, 07 MIPS Technologies, Inc. | ||
7 | * | ||
8 | * Multiprocessor Subsystem Register Definitions | ||
9 | * | ||
10 | */ | ||
11 | #ifndef _ASM_GCMPREGS_H | ||
12 | #define _ASM_GCMPREGS_H | ||
13 | |||
14 | |||
15 | /* Offsets to major blocks within GCMP from GCMP base */ | ||
16 | #define GCMP_GCB_OFS 0x0000 /* Global Control Block */ | ||
17 | #define GCMP_CLCB_OFS 0x2000 /* Core Local Control Block */ | ||
18 | #define GCMP_COCB_OFS 0x4000 /* Core Other Control Block */ | ||
19 | #define GCMP_GDB_OFS 0x8000 /* Global Debug Block */ | ||
20 | |||
21 | /* Offsets to individual GCMP registers from GCMP base */ | ||
22 | #define GCMPOFS(block, tag, reg) (GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS) | ||
23 | |||
24 | #define GCMPGCBOFS(reg) GCMPOFS(GCB, GCB, reg) | ||
25 | #define GCMPCLCBOFS(reg) GCMPOFS(CLCB, CCB, reg) | ||
26 | #define GCMPCOCBOFS(reg) GCMPOFS(COCB, CCB, reg) | ||
27 | #define GCMPGDBOFS(reg) GCMPOFS(GDB, GDB, reg) | ||
28 | |||
29 | /* GCMP register access */ | ||
30 | #define GCMPGCB(reg) REGP(_gcmp_base, GCMPGCBOFS(reg)) | ||
31 | #define GCMPCLCB(reg) REGP(_gcmp_base, GCMPCLCBOFS(reg)) | ||
32 | #define GCMPCOCB(reg) REGP(_gcmp_base, GCMPCOCBOFS(reg)) | ||
33 | #define GCMPGDB(reg) REGP(_gcmp_base, GCMPGDBOFS(reg)) | ||
34 | |||
35 | /* Mask generation */ | ||
36 | #define GCMPMSK(block, reg, bits) (MSK(bits)<<GCMP_##block##_##reg##_SHF) | ||
37 | #define GCMPGCBMSK(reg, bits) GCMPMSK(GCB, reg, bits) | ||
38 | #define GCMPCCBMSK(reg, bits) GCMPMSK(CCB, reg, bits) | ||
39 | #define GCMPGDBMSK(reg, bits) GCMPMSK(GDB, reg, bits) | ||
40 | |||
41 | /* GCB registers */ | ||
42 | #define GCMP_GCB_GC_OFS 0x0000 /* Global Config Register */ | ||
43 | #define GCMP_GCB_GC_NUMIOCU_SHF 8 | ||
44 | #define GCMP_GCB_GC_NUMIOCU_MSK GCMPGCBMSK(GC_NUMIOCU, 4) | ||
45 | #define GCMP_GCB_GC_NUMCORES_SHF 0 | ||
46 | #define GCMP_GCB_GC_NUMCORES_MSK GCMPGCBMSK(GC_NUMCORES, 8) | ||
47 | #define GCMP_GCB_GCMPB_OFS 0x0008 /* Global GCMP Base */ | ||
48 | #define GCMP_GCB_GCMPB_GCMPBASE_SHF 15 | ||
49 | #define GCMP_GCB_GCMPB_GCMPBASE_MSK GCMPGCBMSK(GCMPB_GCMPBASE, 17) | ||
50 | #define GCMP_GCB_GCMPB_CMDEFTGT_SHF 0 | ||
51 | #define GCMP_GCB_GCMPB_CMDEFTGT_MSK GCMPGCBMSK(GCMPB_CMDEFTGT, 2) | ||
52 | #define GCMP_GCB_GCMPB_CMDEFTGT_MEM 0 | ||
53 | #define GCMP_GCB_GCMPB_CMDEFTGT_MEM1 1 | ||
54 | #define GCMP_GCB_GCMPB_CMDEFTGT_IOCU1 2 | ||
55 | #define GCMP_GCB_GCMPB_CMDEFTGT_IOCU2 3 | ||
56 | #define GCMP_GCB_CCMC_OFS 0x0010 /* Global CM Control */ | ||
57 | #define GCMP_GCB_GCSRAP_OFS 0x0020 /* Global CSR Access Privilege */ | ||
58 | #define GCMP_GCB_GCSRAP_CMACCESS_SHF 0 | ||
59 | #define GCMP_GCB_GCSRAP_CMACCESS_MSK GCMPGCBMSK(GCSRAP_CMACCESS, 8) | ||
60 | #define GCMP_GCB_GCMPREV_OFS 0x0030 /* GCMP Revision Register */ | ||
61 | #define GCMP_GCB_GCMEM_OFS 0x0040 /* Global CM Error Mask */ | ||
62 | #define GCMP_GCB_GCMEC_OFS 0x0048 /* Global CM Error Cause */ | ||
63 | #define GCMP_GCB_GMEC_ERROR_TYPE_SHF 27 | ||
64 | #define GCMP_GCB_GMEC_ERROR_TYPE_MSK GCMPGCBMSK(GMEC_ERROR_TYPE, 5) | ||
65 | #define GCMP_GCB_GMEC_ERROR_INFO_SHF 0 | ||
66 | #define GCMP_GCB_GMEC_ERROR_INFO_MSK GCMPGCBMSK(GMEC_ERROR_INFO, 27) | ||
67 | #define GCMP_GCB_GCMEA_OFS 0x0050 /* Global CM Error Address */ | ||
68 | #define GCMP_GCB_GCMEO_OFS 0x0058 /* Global CM Error Multiple */ | ||
69 | #define GCMP_GCB_GMEO_ERROR_2ND_SHF 0 | ||
70 | #define GCMP_GCB_GMEO_ERROR_2ND_MSK GCMPGCBMSK(GMEO_ERROR_2ND, 5) | ||
71 | #define GCMP_GCB_GICBA_OFS 0x0080 /* Global Interrupt Controller Base Address */ | ||
72 | #define GCMP_GCB_GICBA_BASE_SHF 17 | ||
73 | #define GCMP_GCB_GICBA_BASE_MSK GCMPGCBMSK(GICBA_BASE, 15) | ||
74 | #define GCMP_GCB_GICBA_EN_SHF 0 | ||
75 | #define GCMP_GCB_GICBA_EN_MSK GCMPGCBMSK(GICBA_EN, 1) | ||
76 | |||
77 | /* GCB Regions */ | ||
78 | #define GCMP_GCB_CMxBASE_OFS(n) (0x0090+16*(n)) /* Global Region[0-3] Base Address */ | ||
79 | #define GCMP_GCB_CMxBASE_BASE_SHF 16 | ||
80 | #define GCMP_GCB_CMxBASE_BASE_MSK GCMPGCBMSK(CMxBASE_BASE, 16) | ||
81 | #define GCMP_GCB_CMxMASK_OFS(n) (0x0098+16*(n)) /* Global Region[0-3] Address Mask */ | ||
82 | #define GCMP_GCB_CMxMASK_MASK_SHF 16 | ||
83 | #define GCMP_GCB_CMxMASK_MASK_MSK GCMPGCBMSK(CMxMASK_MASK, 16) | ||
84 | #define GCMP_GCB_CMxMASK_CMREGTGT_SHF 0 | ||
85 | #define GCMP_GCB_CMxMASK_CMREGTGT_MSK GCMPGCBMSK(CMxMASK_CMREGTGT, 2) | ||
86 | #define GCMP_GCB_CMxMASK_CMREGTGT_MEM 0 | ||
87 | #define GCMP_GCB_CMxMASK_CMREGTGT_MEM1 1 | ||
88 | #define GCMP_GCB_CMxMASK_CMREGTGT_IOCU1 2 | ||
89 | #define GCMP_GCB_CMxMASK_CMREGTGT_IOCU2 3 | ||
90 | |||
91 | |||
92 | /* Core local/Core other control block registers */ | ||
93 | #define GCMP_CCB_RESETR_OFS 0x0000 /* Reset Release */ | ||
94 | #define GCMP_CCB_RESETR_INRESET_SHF 0 | ||
95 | #define GCMP_CCB_RESETR_INRESET_MSK GCMPCCBMSK(RESETR_INRESET, 16) | ||
96 | #define GCMP_CCB_COHCTL_OFS 0x0008 /* Coherence Control */ | ||
97 | #define GCMP_CCB_COHCTL_DOMAIN_SHF 0 | ||
98 | #define GCMP_CCB_COHCTL_DOMAIN_MSK GCMPCCBMSK(COHCTL_DOMAIN, 8) | ||
99 | #define GCMP_CCB_CFG_OFS 0x0010 /* Config */ | ||
100 | #define GCMP_CCB_CFG_IOCUTYPE_SHF 10 | ||
101 | #define GCMP_CCB_CFG_IOCUTYPE_MSK GCMPCCBMSK(CFG_IOCUTYPE, 2) | ||
102 | #define GCMP_CCB_CFG_IOCUTYPE_CPU 0 | ||
103 | #define GCMP_CCB_CFG_IOCUTYPE_NCIOCU 1 | ||
104 | #define GCMP_CCB_CFG_IOCUTYPE_CIOCU 2 | ||
105 | #define GCMP_CCB_CFG_NUMVPE_SHF 0 | ||
106 | #define GCMP_CCB_CFG_NUMVPE_MSK GCMPCCBMSK(CFG_NUMVPE, 10) | ||
107 | #define GCMP_CCB_OTHER_OFS 0x0018 /* Other Address */ | ||
108 | #define GCMP_CCB_OTHER_CORENUM_SHF 16 | ||
109 | #define GCMP_CCB_OTHER_CORENUM_MSK GCMPCCBMSK(OTHER_CORENUM, 16) | ||
110 | #define GCMP_CCB_RESETBASE_OFS 0x0020 /* Reset Exception Base */ | ||
111 | #define GCMP_CCB_RESETBASE_BEV_SHF 12 | ||
112 | #define GCMP_CCB_RESETBASE_BEV_MSK GCMPCCBMSK(RESETBASE_BEV, 20) | ||
113 | #define GCMP_CCB_ID_OFS 0x0028 /* Identification */ | ||
114 | #define GCMP_CCB_DINTGROUP_OFS 0x0030 /* DINT Group Participate */ | ||
115 | #define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */ | ||
116 | |||
117 | #endif /* _ASM_GCMPREGS_H */ | ||
diff --git a/include/asm-mips/gic.h b/include/asm-mips/gic.h deleted file mode 100644 index 954807d9d66a..000000000000 --- a/include/asm-mips/gic.h +++ /dev/null | |||
@@ -1,487 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000, 07 MIPS Technologies, Inc. | ||
7 | * | ||
8 | * GIC Register Definitions | ||
9 | * | ||
10 | */ | ||
11 | #ifndef _ASM_GICREGS_H | ||
12 | #define _ASM_GICREGS_H | ||
13 | |||
14 | #undef GICISBYTELITTLEENDIAN | ||
15 | #define GICISWORDLITTLEENDIAN | ||
16 | |||
17 | /* Constants */ | ||
18 | #define GIC_POL_POS 1 | ||
19 | #define GIC_POL_NEG 0 | ||
20 | #define GIC_TRIG_EDGE 1 | ||
21 | #define GIC_TRIG_LEVEL 0 | ||
22 | |||
23 | #define GIC_NUM_INTRS 32 | ||
24 | |||
25 | #define MSK(n) ((1 << (n)) - 1) | ||
26 | #define REG32(addr) (*(volatile unsigned int *) (addr)) | ||
27 | #define REG(base, offs) REG32((unsigned long)(base) + offs##_##OFS) | ||
28 | #define REGP(base, phys) REG32((unsigned long)(base) + (phys)) | ||
29 | |||
30 | /* Accessors */ | ||
31 | #define GIC_REG(segment, offset) \ | ||
32 | REG32(_gic_base + segment##_##SECTION_OFS + offset##_##OFS) | ||
33 | #define GIC_REG_ADDR(segment, offset) \ | ||
34 | REG32(_gic_base + segment##_##SECTION_OFS + offset) | ||
35 | |||
36 | #define GIC_ABS_REG(segment, offset) \ | ||
37 | (_gic_base + segment##_##SECTION_OFS + offset##_##OFS) | ||
38 | #define GIC_REG_ABS_ADDR(segment, offset) \ | ||
39 | (_gic_base + segment##_##SECTION_OFS + offset) | ||
40 | |||
41 | #ifdef GICISBYTELITTLEENDIAN | ||
42 | #define GICREAD(reg, data) (data) = (reg), (data) = le32_to_cpu(data) | ||
43 | #define GICWRITE(reg, data) (reg) = cpu_to_le32(data) | ||
44 | #define GICBIS(reg, bits) \ | ||
45 | ({unsigned int data; \ | ||
46 | GICREAD(reg, data); \ | ||
47 | data |= bits; \ | ||
48 | GICWRITE(reg, data); \ | ||
49 | }) | ||
50 | |||
51 | #else | ||
52 | #define GICREAD(reg, data) (data) = (reg) | ||
53 | #define GICWRITE(reg, data) (reg) = (data) | ||
54 | #define GICBIS(reg, bits) (reg) |= (bits) | ||
55 | #endif | ||
56 | |||
57 | |||
58 | /* GIC Address Space */ | ||
59 | #define SHARED_SECTION_OFS 0x0000 | ||
60 | #define SHARED_SECTION_SIZE 0x8000 | ||
61 | #define VPE_LOCAL_SECTION_OFS 0x8000 | ||
62 | #define VPE_LOCAL_SECTION_SIZE 0x4000 | ||
63 | #define VPE_OTHER_SECTION_OFS 0xc000 | ||
64 | #define VPE_OTHER_SECTION_SIZE 0x4000 | ||
65 | #define USM_VISIBLE_SECTION_OFS 0x10000 | ||
66 | #define USM_VISIBLE_SECTION_SIZE 0x10000 | ||
67 | |||
68 | /* Register Map for Shared Section */ | ||
69 | #if defined(CONFIG_CPU_LITTLE_ENDIAN) || defined(GICISWORDLITTLEENDIAN) | ||
70 | |||
71 | #define GIC_SH_CONFIG_OFS 0x0000 | ||
72 | |||
73 | /* Shared Global Counter */ | ||
74 | #define GIC_SH_COUNTER_31_00_OFS 0x0010 | ||
75 | #define GIC_SH_COUNTER_63_32_OFS 0x0014 | ||
76 | |||
77 | /* Interrupt Polarity */ | ||
78 | #define GIC_SH_POL_31_0_OFS 0x0100 | ||
79 | #define GIC_SH_POL_63_32_OFS 0x0104 | ||
80 | #define GIC_SH_POL_95_64_OFS 0x0108 | ||
81 | #define GIC_SH_POL_127_96_OFS 0x010c | ||
82 | #define GIC_SH_POL_159_128_OFS 0x0110 | ||
83 | #define GIC_SH_POL_191_160_OFS 0x0114 | ||
84 | #define GIC_SH_POL_223_192_OFS 0x0118 | ||
85 | #define GIC_SH_POL_255_224_OFS 0x011c | ||
86 | |||
87 | /* Edge/Level Triggering */ | ||
88 | #define GIC_SH_TRIG_31_0_OFS 0x0180 | ||
89 | #define GIC_SH_TRIG_63_32_OFS 0x0184 | ||
90 | #define GIC_SH_TRIG_95_64_OFS 0x0188 | ||
91 | #define GIC_SH_TRIG_127_96_OFS 0x018c | ||
92 | #define GIC_SH_TRIG_159_128_OFS 0x0190 | ||
93 | #define GIC_SH_TRIG_191_160_OFS 0x0194 | ||
94 | #define GIC_SH_TRIG_223_192_OFS 0x0198 | ||
95 | #define GIC_SH_TRIG_255_224_OFS 0x019c | ||
96 | |||
97 | /* Dual Edge Triggering */ | ||
98 | #define GIC_SH_DUAL_31_0_OFS 0x0200 | ||
99 | #define GIC_SH_DUAL_63_32_OFS 0x0204 | ||
100 | #define GIC_SH_DUAL_95_64_OFS 0x0208 | ||
101 | #define GIC_SH_DUAL_127_96_OFS 0x020c | ||
102 | #define GIC_SH_DUAL_159_128_OFS 0x0210 | ||
103 | #define GIC_SH_DUAL_191_160_OFS 0x0214 | ||
104 | #define GIC_SH_DUAL_223_192_OFS 0x0218 | ||
105 | #define GIC_SH_DUAL_255_224_OFS 0x021c | ||
106 | |||
107 | /* Set/Clear corresponding bit in Edge Detect Register */ | ||
108 | #define GIC_SH_WEDGE_OFS 0x0280 | ||
109 | |||
110 | /* Reset Mask - Disables Interrupt */ | ||
111 | #define GIC_SH_RMASK_31_0_OFS 0x0300 | ||
112 | #define GIC_SH_RMASK_63_32_OFS 0x0304 | ||
113 | #define GIC_SH_RMASK_95_64_OFS 0x0308 | ||
114 | #define GIC_SH_RMASK_127_96_OFS 0x030c | ||
115 | #define GIC_SH_RMASK_159_128_OFS 0x0310 | ||
116 | #define GIC_SH_RMASK_191_160_OFS 0x0314 | ||
117 | #define GIC_SH_RMASK_223_192_OFS 0x0318 | ||
118 | #define GIC_SH_RMASK_255_224_OFS 0x031c | ||
119 | |||
120 | /* Set Mask (WO) - Enables Interrupt */ | ||
121 | #define GIC_SH_SMASK_31_0_OFS 0x0380 | ||
122 | #define GIC_SH_SMASK_63_32_OFS 0x0384 | ||
123 | #define GIC_SH_SMASK_95_64_OFS 0x0388 | ||
124 | #define GIC_SH_SMASK_127_96_OFS 0x038c | ||
125 | #define GIC_SH_SMASK_159_128_OFS 0x0390 | ||
126 | #define GIC_SH_SMASK_191_160_OFS 0x0394 | ||
127 | #define GIC_SH_SMASK_223_192_OFS 0x0398 | ||
128 | #define GIC_SH_SMASK_255_224_OFS 0x039c | ||
129 | |||
130 | /* Global Interrupt Mask Register (RO) - Bit Set == Interrupt enabled */ | ||
131 | #define GIC_SH_MASK_31_0_OFS 0x0400 | ||
132 | #define GIC_SH_MASK_63_32_OFS 0x0404 | ||
133 | #define GIC_SH_MASK_95_64_OFS 0x0408 | ||
134 | #define GIC_SH_MASK_127_96_OFS 0x040c | ||
135 | #define GIC_SH_MASK_159_128_OFS 0x0410 | ||
136 | #define GIC_SH_MASK_191_160_OFS 0x0414 | ||
137 | #define GIC_SH_MASK_223_192_OFS 0x0418 | ||
138 | #define GIC_SH_MASK_255_224_OFS 0x041c | ||
139 | |||
140 | /* Pending Global Interrupts (RO) */ | ||
141 | #define GIC_SH_PEND_31_0_OFS 0x0480 | ||
142 | #define GIC_SH_PEND_63_32_OFS 0x0484 | ||
143 | #define GIC_SH_PEND_95_64_OFS 0x0488 | ||
144 | #define GIC_SH_PEND_127_96_OFS 0x048c | ||
145 | #define GIC_SH_PEND_159_128_OFS 0x0490 | ||
146 | #define GIC_SH_PEND_191_160_OFS 0x0494 | ||
147 | #define GIC_SH_PEND_223_192_OFS 0x0498 | ||
148 | #define GIC_SH_PEND_255_224_OFS 0x049c | ||
149 | |||
150 | #define GIC_SH_INTR_MAP_TO_PIN_BASE_OFS 0x0500 | ||
151 | |||
152 | /* Maps Interrupt X to a Pin */ | ||
153 | #define GIC_SH_MAP_TO_PIN(intr) \ | ||
154 | (GIC_SH_INTR_MAP_TO_PIN_BASE_OFS + (4 * intr)) | ||
155 | |||
156 | #define GIC_SH_INTR_MAP_TO_VPE_BASE_OFS 0x2000 | ||
157 | |||
158 | /* Maps Interrupt X to a VPE */ | ||
159 | #define GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe) \ | ||
160 | (GIC_SH_INTR_MAP_TO_VPE_BASE_OFS + (32 * (intr)) + (((vpe) / 32) * 4)) | ||
161 | #define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32)) | ||
162 | |||
163 | /* Polarity : Reset Value is always 0 */ | ||
164 | #define GIC_SH_SET_POLARITY_OFS 0x0100 | ||
165 | #define GIC_SET_POLARITY(intr, pol) \ | ||
166 | GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_POLARITY_OFS + (((intr) / 32) * 4)), (pol) << ((intr) % 32)) | ||
167 | |||
168 | /* Triggering : Reset Value is always 0 */ | ||
169 | #define GIC_SH_SET_TRIGGER_OFS 0x0180 | ||
170 | #define GIC_SET_TRIGGER(intr, trig) \ | ||
171 | GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_TRIGGER_OFS + (((intr) / 32) * 4)), (trig) << ((intr) % 32)) | ||
172 | |||
173 | /* Mask manipulation */ | ||
174 | #define GIC_SH_SMASK_OFS 0x0380 | ||
175 | #define GIC_SET_INTR_MASK(intr, val) \ | ||
176 | GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_SMASK_OFS + (((intr) / 32) * 4)), ((val) << ((intr) % 32))) | ||
177 | |||
178 | #define GIC_SH_RMASK_OFS 0x0300 | ||
179 | #define GIC_CLR_INTR_MASK(intr, val) \ | ||
180 | GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + (((intr) / 32) * 4)), ((val) << ((intr) % 32))) | ||
181 | |||
182 | /* Register Map for Local Section */ | ||
183 | #define GIC_VPE_CTL_OFS 0x0000 | ||
184 | #define GIC_VPE_PEND_OFS 0x0004 | ||
185 | #define GIC_VPE_MASK_OFS 0x0008 | ||
186 | #define GIC_VPE_RMASK_OFS 0x000c | ||
187 | #define GIC_VPE_SMASK_OFS 0x0010 | ||
188 | #define GIC_VPE_WD_MAP_OFS 0x0040 | ||
189 | #define GIC_VPE_COMPARE_MAP_OFS 0x0044 | ||
190 | #define GIC_VPE_TIMER_MAP_OFS 0x0048 | ||
191 | #define GIC_VPE_PERFCTR_MAP_OFS 0x0050 | ||
192 | #define GIC_VPE_SWINT0_MAP_OFS 0x0054 | ||
193 | #define GIC_VPE_SWINT1_MAP_OFS 0x0058 | ||
194 | #define GIC_VPE_OTHER_ADDR_OFS 0x0080 | ||
195 | #define GIC_VPE_WD_CONFIG0_OFS 0x0090 | ||
196 | #define GIC_VPE_WD_COUNT0_OFS 0x0094 | ||
197 | #define GIC_VPE_WD_INITIAL0_OFS 0x0098 | ||
198 | #define GIC_VPE_COMPARE_LO_OFS 0x00a0 | ||
199 | #define GIC_VPE_COMPARE_HI 0x00a4 | ||
200 | |||
201 | #define GIC_VPE_EIC_SHADOW_SET_BASE 0x0100 | ||
202 | #define GIC_VPE_EIC_SS(intr) \ | ||
203 | (GIC_EIC_SHADOW_SET_BASE + (4 * intr)) | ||
204 | |||
205 | #define GIC_VPE_EIC_VEC_BASE 0x0800 | ||
206 | #define GIC_VPE_EIC_VEC(intr) \ | ||
207 | (GIC_VPE_EIC_VEC_BASE + (4 * intr)) | ||
208 | |||
209 | #define GIC_VPE_TENABLE_NMI_OFS 0x1000 | ||
210 | #define GIC_VPE_TENABLE_YQ_OFS 0x1004 | ||
211 | #define GIC_VPE_TENABLE_INT_31_0_OFS 0x1080 | ||
212 | #define GIC_VPE_TENABLE_INT_63_32_OFS 0x1084 | ||
213 | |||
214 | /* User Mode Visible Section Register Map */ | ||
215 | #define GIC_UMV_SH_COUNTER_31_00_OFS 0x0000 | ||
216 | #define GIC_UMV_SH_COUNTER_63_32_OFS 0x0004 | ||
217 | |||
218 | #else /* CONFIG_CPU_BIG_ENDIAN */ | ||
219 | |||
220 | #define GIC_SH_CONFIG_OFS 0x0000 | ||
221 | |||
222 | /* Shared Global Counter */ | ||
223 | #define GIC_SH_COUNTER_31_00_OFS 0x0014 | ||
224 | #define GIC_SH_COUNTER_63_32_OFS 0x0010 | ||
225 | |||
226 | /* Interrupt Polarity */ | ||
227 | #define GIC_SH_POL_31_0_OFS 0x0104 | ||
228 | #define GIC_SH_POL_63_32_OFS 0x0100 | ||
229 | #define GIC_SH_POL_95_64_OFS 0x010c | ||
230 | #define GIC_SH_POL_127_96_OFS 0x0108 | ||
231 | #define GIC_SH_POL_159_128_OFS 0x0114 | ||
232 | #define GIC_SH_POL_191_160_OFS 0x0110 | ||
233 | #define GIC_SH_POL_223_192_OFS 0x011c | ||
234 | #define GIC_SH_POL_255_224_OFS 0x0118 | ||
235 | |||
236 | /* Edge/Level Triggering */ | ||
237 | #define GIC_SH_TRIG_31_0_OFS 0x0184 | ||
238 | #define GIC_SH_TRIG_63_32_OFS 0x0180 | ||
239 | #define GIC_SH_TRIG_95_64_OFS 0x018c | ||
240 | #define GIC_SH_TRIG_127_96_OFS 0x0188 | ||
241 | #define GIC_SH_TRIG_159_128_OFS 0x0194 | ||
242 | #define GIC_SH_TRIG_191_160_OFS 0x0190 | ||
243 | #define GIC_SH_TRIG_223_192_OFS 0x019c | ||
244 | #define GIC_SH_TRIG_255_224_OFS 0x0198 | ||
245 | |||
246 | /* Dual Edge Triggering */ | ||
247 | #define GIC_SH_DUAL_31_0_OFS 0x0204 | ||
248 | #define GIC_SH_DUAL_63_32_OFS 0x0200 | ||
249 | #define GIC_SH_DUAL_95_64_OFS 0x020c | ||
250 | #define GIC_SH_DUAL_127_96_OFS 0x0208 | ||
251 | #define GIC_SH_DUAL_159_128_OFS 0x0214 | ||
252 | #define GIC_SH_DUAL_191_160_OFS 0x0210 | ||
253 | #define GIC_SH_DUAL_223_192_OFS 0x021c | ||
254 | #define GIC_SH_DUAL_255_224_OFS 0x0218 | ||
255 | |||
256 | /* Set/Clear corresponding bit in Edge Detect Register */ | ||
257 | #define GIC_SH_WEDGE_OFS 0x0280 | ||
258 | |||
259 | /* Reset Mask - Disables Interrupt */ | ||
260 | #define GIC_SH_RMASK_31_0_OFS 0x0304 | ||
261 | #define GIC_SH_RMASK_63_32_OFS 0x0300 | ||
262 | #define GIC_SH_RMASK_95_64_OFS 0x030c | ||
263 | #define GIC_SH_RMASK_127_96_OFS 0x0308 | ||
264 | #define GIC_SH_RMASK_159_128_OFS 0x0314 | ||
265 | #define GIC_SH_RMASK_191_160_OFS 0x0310 | ||
266 | #define GIC_SH_RMASK_223_192_OFS 0x031c | ||
267 | #define GIC_SH_RMASK_255_224_OFS 0x0318 | ||
268 | |||
269 | /* Set Mask (WO) - Enables Interrupt */ | ||
270 | #define GIC_SH_SMASK_31_0_OFS 0x0384 | ||
271 | #define GIC_SH_SMASK_63_32_OFS 0x0380 | ||
272 | #define GIC_SH_SMASK_95_64_OFS 0x038c | ||
273 | #define GIC_SH_SMASK_127_96_OFS 0x0388 | ||
274 | #define GIC_SH_SMASK_159_128_OFS 0x0394 | ||
275 | #define GIC_SH_SMASK_191_160_OFS 0x0390 | ||
276 | #define GIC_SH_SMASK_223_192_OFS 0x039c | ||
277 | #define GIC_SH_SMASK_255_224_OFS 0x0398 | ||
278 | |||
279 | /* Global Interrupt Mask Register (RO) - Bit Set == Interrupt enabled */ | ||
280 | #define GIC_SH_MASK_31_0_OFS 0x0404 | ||
281 | #define GIC_SH_MASK_63_32_OFS 0x0400 | ||
282 | #define GIC_SH_MASK_95_64_OFS 0x040c | ||
283 | #define GIC_SH_MASK_127_96_OFS 0x0408 | ||
284 | #define GIC_SH_MASK_159_128_OFS 0x0414 | ||
285 | #define GIC_SH_MASK_191_160_OFS 0x0410 | ||
286 | #define GIC_SH_MASK_223_192_OFS 0x041c | ||
287 | #define GIC_SH_MASK_255_224_OFS 0x0418 | ||
288 | |||
289 | /* Pending Global Interrupts (RO) */ | ||
290 | #define GIC_SH_PEND_31_0_OFS 0x0484 | ||
291 | #define GIC_SH_PEND_63_32_OFS 0x0480 | ||
292 | #define GIC_SH_PEND_95_64_OFS 0x048c | ||
293 | #define GIC_SH_PEND_127_96_OFS 0x0488 | ||
294 | #define GIC_SH_PEND_159_128_OFS 0x0494 | ||
295 | #define GIC_SH_PEND_191_160_OFS 0x0490 | ||
296 | #define GIC_SH_PEND_223_192_OFS 0x049c | ||
297 | #define GIC_SH_PEND_255_224_OFS 0x0498 | ||
298 | |||
299 | #define GIC_SH_INTR_MAP_TO_PIN_BASE_OFS 0x0500 | ||
300 | |||
301 | /* Maps Interrupt X to a Pin */ | ||
302 | #define GIC_SH_MAP_TO_PIN(intr) \ | ||
303 | (GIC_SH_INTR_MAP_TO_PIN_BASE_OFS + (4 * intr)) | ||
304 | |||
305 | #define GIC_SH_INTR_MAP_TO_VPE_BASE_OFS 0x2004 | ||
306 | |||
307 | /* | ||
308 | * Maps Interrupt X to a VPE. This is more complex than the LE case, as | ||
309 | * odd and even registers need to be transposed. It does work - trust me! | ||
310 | */ | ||
311 | #define GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe) \ | ||
312 | (GIC_SH_INTR_MAP_TO_VPE_BASE_OFS + (32 * (intr)) + \ | ||
313 | (((((vpe) / 32) ^ 1) - 1) * 4)) | ||
314 | #define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32)) | ||
315 | |||
316 | /* Polarity */ | ||
317 | #define GIC_SH_SET_POLARITY_OFS 0x0100 | ||
318 | #define GIC_SET_POLARITY(intr, pol) \ | ||
319 | GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_POLARITY_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), (pol) << ((intr) % 32)) | ||
320 | |||
321 | /* Triggering */ | ||
322 | #define GIC_SH_SET_TRIGGER_OFS 0x0180 | ||
323 | #define GIC_SET_TRIGGER(intr, trig) \ | ||
324 | GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_TRIGGER_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), (trig) << ((intr) % 32)) | ||
325 | |||
326 | /* Mask manipulation */ | ||
327 | #define GIC_SH_SMASK_OFS 0x0380 | ||
328 | #define GIC_SET_INTR_MASK(intr, val) \ | ||
329 | GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_SMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32))) | ||
330 | |||
331 | #define GIC_SH_RMASK_OFS 0x0300 | ||
332 | #define GIC_CLR_INTR_MASK(intr, val) \ | ||
333 | GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32))) | ||
334 | |||
335 | /* Register Map for Local Section */ | ||
336 | #define GIC_VPE_CTL_OFS 0x0000 | ||
337 | #define GIC_VPE_PEND_OFS 0x0004 | ||
338 | #define GIC_VPE_MASK_OFS 0x0008 | ||
339 | #define GIC_VPE_RMASK_OFS 0x000c | ||
340 | #define GIC_VPE_SMASK_OFS 0x0010 | ||
341 | #define GIC_VPE_WD_MAP_OFS 0x0040 | ||
342 | #define GIC_VPE_COMPARE_MAP_OFS 0x0044 | ||
343 | #define GIC_VPE_TIMER_MAP_OFS 0x0048 | ||
344 | #define GIC_VPE_PERFCTR_MAP_OFS 0x0050 | ||
345 | #define GIC_VPE_SWINT0_MAP_OFS 0x0054 | ||
346 | #define GIC_VPE_SWINT1_MAP_OFS 0x0058 | ||
347 | #define GIC_VPE_OTHER_ADDR_OFS 0x0080 | ||
348 | #define GIC_VPE_WD_CONFIG0_OFS 0x0090 | ||
349 | #define GIC_VPE_WD_COUNT0_OFS 0x0094 | ||
350 | #define GIC_VPE_WD_INITIAL0_OFS 0x0098 | ||
351 | #define GIC_VPE_COMPARE_LO_OFS 0x00a4 | ||
352 | #define GIC_VPE_COMPARE_HI_OFS 0x00a0 | ||
353 | |||
354 | #define GIC_VPE_EIC_SHADOW_SET_BASE 0x0100 | ||
355 | #define GIC_VPE_EIC_SS(intr) \ | ||
356 | (GIC_EIC_SHADOW_SET_BASE + (4 * intr)) | ||
357 | |||
358 | #define GIC_VPE_EIC_VEC_BASE 0x0800 | ||
359 | #define GIC_VPE_EIC_VEC(intr) \ | ||
360 | (GIC_VPE_EIC_VEC_BASE + (4 * intr)) | ||
361 | |||
362 | #define GIC_VPE_TENABLE_NMI_OFS 0x1000 | ||
363 | #define GIC_VPE_TENABLE_YQ_OFS 0x1004 | ||
364 | #define GIC_VPE_TENABLE_INT_31_0_OFS 0x1080 | ||
365 | #define GIC_VPE_TENABLE_INT_63_32_OFS 0x1084 | ||
366 | |||
367 | /* User Mode Visible Section Register Map */ | ||
368 | #define GIC_UMV_SH_COUNTER_31_00_OFS 0x0004 | ||
369 | #define GIC_UMV_SH_COUNTER_63_32_OFS 0x0000 | ||
370 | |||
371 | #endif /* !LE */ | ||
372 | |||
373 | /* Masks */ | ||
374 | #define GIC_SH_CONFIG_COUNTSTOP_SHF 28 | ||
375 | #define GIC_SH_CONFIG_COUNTSTOP_MSK (MSK(1) << GIC_SH_CONFIG_COUNTSTOP_SHF) | ||
376 | |||
377 | #define GIC_SH_CONFIG_COUNTBITS_SHF 24 | ||
378 | #define GIC_SH_CONFIG_COUNTBITS_MSK (MSK(4) << GIC_SH_CONFIG_COUNTBITS_SHF) | ||
379 | |||
380 | #define GIC_SH_CONFIG_NUMINTRS_SHF 16 | ||
381 | #define GIC_SH_CONFIG_NUMINTRS_MSK (MSK(8) << GIC_SH_CONFIG_NUMINTRS_SHF) | ||
382 | |||
383 | #define GIC_SH_CONFIG_NUMVPES_SHF 0 | ||
384 | #define GIC_SH_CONFIG_NUMVPES_MSK (MSK(8) << GIC_SH_CONFIG_NUMVPES_SHF) | ||
385 | |||
386 | #define GIC_SH_WEDGE_SET(intr) (intr | (0x1 << 31)) | ||
387 | #define GIC_SH_WEDGE_CLR(intr) (intr & ~(0x1 << 31)) | ||
388 | |||
389 | #define GIC_MAP_TO_PIN_SHF 31 | ||
390 | #define GIC_MAP_TO_PIN_MSK (MSK(1) << GIC_MAP_TO_PIN_SHF) | ||
391 | #define GIC_MAP_TO_NMI_SHF 30 | ||
392 | #define GIC_MAP_TO_NMI_MSK (MSK(1) << GIC_MAP_TO_NMI_SHF) | ||
393 | #define GIC_MAP_TO_YQ_SHF 29 | ||
394 | #define GIC_MAP_TO_YQ_MSK (MSK(1) << GIC_MAP_TO_YQ_SHF) | ||
395 | #define GIC_MAP_SHF 0 | ||
396 | #define GIC_MAP_MSK (MSK(6) << GIC_MAP_SHF) | ||
397 | |||
398 | /* GIC_VPE_CTL Masks */ | ||
399 | #define GIC_VPE_CTL_PERFCNT_RTBL_SHF 2 | ||
400 | #define GIC_VPE_CTL_PERFCNT_RTBL_MSK (MSK(1) << GIC_VPE_CTL_PERFCNT_RTBL_SHF) | ||
401 | #define GIC_VPE_CTL_TIMER_RTBL_SHF 1 | ||
402 | #define GIC_VPE_CTL_TIMER_RTBL_MSK (MSK(1) << GIC_VPE_CTL_TIMER_RTBL_SHF) | ||
403 | #define GIC_VPE_CTL_EIC_MODE_SHF 0 | ||
404 | #define GIC_VPE_CTL_EIC_MODE_MSK (MSK(1) << GIC_VPE_CTL_EIC_MODE_SHF) | ||
405 | |||
406 | /* GIC_VPE_PEND Masks */ | ||
407 | #define GIC_VPE_PEND_WD_SHF 0 | ||
408 | #define GIC_VPE_PEND_WD_MSK (MSK(1) << GIC_VPE_PEND_WD_SHF) | ||
409 | #define GIC_VPE_PEND_CMP_SHF 1 | ||
410 | #define GIC_VPE_PEND_CMP_MSK (MSK(1) << GIC_VPE_PEND_CMP_SHF) | ||
411 | #define GIC_VPE_PEND_TIMER_SHF 2 | ||
412 | #define GIC_VPE_PEND_TIMER_MSK (MSK(1) << GIC_VPE_PEND_TIMER_SHF) | ||
413 | #define GIC_VPE_PEND_PERFCOUNT_SHF 3 | ||
414 | #define GIC_VPE_PEND_PERFCOUNT_MSK (MSK(1) << GIC_VPE_PEND_PERFCOUNT_SHF) | ||
415 | #define GIC_VPE_PEND_SWINT0_SHF 4 | ||
416 | #define GIC_VPE_PEND_SWINT0_MSK (MSK(1) << GIC_VPE_PEND_SWINT0_SHF) | ||
417 | #define GIC_VPE_PEND_SWINT1_SHF 5 | ||
418 | #define GIC_VPE_PEND_SWINT1_MSK (MSK(1) << GIC_VPE_PEND_SWINT1_SHF) | ||
419 | |||
420 | /* GIC_VPE_RMASK Masks */ | ||
421 | #define GIC_VPE_RMASK_WD_SHF 0 | ||
422 | #define GIC_VPE_RMASK_WD_MSK (MSK(1) << GIC_VPE_RMASK_WD_SHF) | ||
423 | #define GIC_VPE_RMASK_CMP_SHF 1 | ||
424 | #define GIC_VPE_RMASK_CMP_MSK (MSK(1) << GIC_VPE_RMASK_CMP_SHF) | ||
425 | #define GIC_VPE_RMASK_TIMER_SHF 2 | ||
426 | #define GIC_VPE_RMASK_TIMER_MSK (MSK(1) << GIC_VPE_RMASK_TIMER_SHF) | ||
427 | #define GIC_VPE_RMASK_PERFCNT_SHF 3 | ||
428 | #define GIC_VPE_RMASK_PERFCNT_MSK (MSK(1) << GIC_VPE_RMASK_PERFCNT_SHF) | ||
429 | #define GIC_VPE_RMASK_SWINT0_SHF 4 | ||
430 | #define GIC_VPE_RMASK_SWINT0_MSK (MSK(1) << GIC_VPE_RMASK_SWINT0_SHF) | ||
431 | #define GIC_VPE_RMASK_SWINT1_SHF 5 | ||
432 | #define GIC_VPE_RMASK_SWINT1_MSK (MSK(1) << GIC_VPE_RMASK_SWINT1_SHF) | ||
433 | |||
434 | /* GIC_VPE_SMASK Masks */ | ||
435 | #define GIC_VPE_SMASK_WD_SHF 0 | ||
436 | #define GIC_VPE_SMASK_WD_MSK (MSK(1) << GIC_VPE_SMASK_WD_SHF) | ||
437 | #define GIC_VPE_SMASK_CMP_SHF 1 | ||
438 | #define GIC_VPE_SMASK_CMP_MSK (MSK(1) << GIC_VPE_SMASK_CMP_SHF) | ||
439 | #define GIC_VPE_SMASK_TIMER_SHF 2 | ||
440 | #define GIC_VPE_SMASK_TIMER_MSK (MSK(1) << GIC_VPE_SMASK_TIMER_SHF) | ||
441 | #define GIC_VPE_SMASK_PERFCNT_SHF 3 | ||
442 | #define GIC_VPE_SMASK_PERFCNT_MSK (MSK(1) << GIC_VPE_SMASK_PERFCNT_SHF) | ||
443 | #define GIC_VPE_SMASK_SWINT0_SHF 4 | ||
444 | #define GIC_VPE_SMASK_SWINT0_MSK (MSK(1) << GIC_VPE_SMASK_SWINT0_SHF) | ||
445 | #define GIC_VPE_SMASK_SWINT1_SHF 5 | ||
446 | #define GIC_VPE_SMASK_SWINT1_MSK (MSK(1) << GIC_VPE_SMASK_SWINT1_SHF) | ||
447 | |||
448 | /* | ||
449 | * Set the Mapping of Interrupt X to a VPE. | ||
450 | */ | ||
451 | #define GIC_SH_MAP_TO_VPE_SMASK(intr, vpe) \ | ||
452 | GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe)), \ | ||
453 | GIC_SH_MAP_TO_VPE_REG_BIT(vpe)) | ||
454 | |||
455 | struct gic_pcpu_mask { | ||
456 | DECLARE_BITMAP(pcpu_mask, GIC_NUM_INTRS); | ||
457 | }; | ||
458 | |||
459 | struct gic_pending_regs { | ||
460 | DECLARE_BITMAP(pending, GIC_NUM_INTRS); | ||
461 | }; | ||
462 | |||
463 | struct gic_intrmask_regs { | ||
464 | DECLARE_BITMAP(intrmask, GIC_NUM_INTRS); | ||
465 | }; | ||
466 | |||
467 | /* | ||
468 | * Interrupt Meta-data specification. The ipiflag helps | ||
469 | * in building ipi_map. | ||
470 | */ | ||
471 | struct gic_intr_map { | ||
472 | unsigned int intrnum; /* Ext Intr Num */ | ||
473 | unsigned int cpunum; /* Directed to this CPU */ | ||
474 | unsigned int pin; /* Directed to this Pin */ | ||
475 | unsigned int polarity; /* Polarity : +/- */ | ||
476 | unsigned int trigtype; /* Trigger : Edge/Levl */ | ||
477 | unsigned int ipiflag; /* Is used for IPI ? */ | ||
478 | }; | ||
479 | |||
480 | extern void gic_init(unsigned long gic_base_addr, | ||
481 | unsigned long gic_addrspace_size, struct gic_intr_map *intrmap, | ||
482 | unsigned int intrmap_size, unsigned int irqbase); | ||
483 | |||
484 | extern unsigned int gic_get_int(void); | ||
485 | extern void gic_send_ipi(unsigned int intr); | ||
486 | |||
487 | #endif /* _ASM_GICREGS_H */ | ||
diff --git a/include/asm-mips/gpio.h b/include/asm-mips/gpio.h deleted file mode 100644 index 06e46faf862d..000000000000 --- a/include/asm-mips/gpio.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_MIPS_GPIO_H | ||
2 | #define __ASM_MIPS_GPIO_H | ||
3 | |||
4 | #include <gpio.h> | ||
5 | |||
6 | #endif /* __ASM_MIPS_GPIO_H */ | ||
diff --git a/include/asm-mips/gt64120.h b/include/asm-mips/gt64120.h deleted file mode 100644 index e64b41093c49..000000000000 --- a/include/asm-mips/gt64120.h +++ /dev/null | |||
@@ -1,580 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2004, 2005 MIPS Technologies, Inc. | ||
3 | * All rights reserved. | ||
4 | * Authors: Carsten Langgaard <carstenl@mips.com> | ||
5 | * Maciej W. Rozycki <macro@mips.com> | ||
6 | * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | #ifndef _ASM_GT64120_H | ||
22 | #define _ASM_GT64120_H | ||
23 | |||
24 | #include <linux/clocksource.h> | ||
25 | |||
26 | #include <asm/addrspace.h> | ||
27 | #include <asm/byteorder.h> | ||
28 | |||
29 | #define MSK(n) ((1 << (n)) - 1) | ||
30 | |||
31 | /* | ||
32 | * Register offset addresses | ||
33 | */ | ||
34 | /* CPU Configuration. */ | ||
35 | #define GT_CPU_OFS 0x000 | ||
36 | |||
37 | #define GT_MULTI_OFS 0x120 | ||
38 | |||
39 | /* CPU Address Decode. */ | ||
40 | #define GT_SCS10LD_OFS 0x008 | ||
41 | #define GT_SCS10HD_OFS 0x010 | ||
42 | #define GT_SCS32LD_OFS 0x018 | ||
43 | #define GT_SCS32HD_OFS 0x020 | ||
44 | #define GT_CS20LD_OFS 0x028 | ||
45 | #define GT_CS20HD_OFS 0x030 | ||
46 | #define GT_CS3BOOTLD_OFS 0x038 | ||
47 | #define GT_CS3BOOTHD_OFS 0x040 | ||
48 | #define GT_PCI0IOLD_OFS 0x048 | ||
49 | #define GT_PCI0IOHD_OFS 0x050 | ||
50 | #define GT_PCI0M0LD_OFS 0x058 | ||
51 | #define GT_PCI0M0HD_OFS 0x060 | ||
52 | #define GT_ISD_OFS 0x068 | ||
53 | |||
54 | #define GT_PCI0M1LD_OFS 0x080 | ||
55 | #define GT_PCI0M1HD_OFS 0x088 | ||
56 | #define GT_PCI1IOLD_OFS 0x090 | ||
57 | #define GT_PCI1IOHD_OFS 0x098 | ||
58 | #define GT_PCI1M0LD_OFS 0x0a0 | ||
59 | #define GT_PCI1M0HD_OFS 0x0a8 | ||
60 | #define GT_PCI1M1LD_OFS 0x0b0 | ||
61 | #define GT_PCI1M1HD_OFS 0x0b8 | ||
62 | #define GT_PCI1M1LD_OFS 0x0b0 | ||
63 | #define GT_PCI1M1HD_OFS 0x0b8 | ||
64 | |||
65 | #define GT_SCS10AR_OFS 0x0d0 | ||
66 | #define GT_SCS32AR_OFS 0x0d8 | ||
67 | #define GT_CS20R_OFS 0x0e0 | ||
68 | #define GT_CS3BOOTR_OFS 0x0e8 | ||
69 | |||
70 | #define GT_PCI0IOREMAP_OFS 0x0f0 | ||
71 | #define GT_PCI0M0REMAP_OFS 0x0f8 | ||
72 | #define GT_PCI0M1REMAP_OFS 0x100 | ||
73 | #define GT_PCI1IOREMAP_OFS 0x108 | ||
74 | #define GT_PCI1M0REMAP_OFS 0x110 | ||
75 | #define GT_PCI1M1REMAP_OFS 0x118 | ||
76 | |||
77 | /* CPU Error Report. */ | ||
78 | #define GT_CPUERR_ADDRLO_OFS 0x070 | ||
79 | #define GT_CPUERR_ADDRHI_OFS 0x078 | ||
80 | |||
81 | #define GT_CPUERR_DATALO_OFS 0x128 /* GT-64120A only */ | ||
82 | #define GT_CPUERR_DATAHI_OFS 0x130 /* GT-64120A only */ | ||
83 | #define GT_CPUERR_PARITY_OFS 0x138 /* GT-64120A only */ | ||
84 | |||
85 | /* CPU Sync Barrier. */ | ||
86 | #define GT_PCI0SYNC_OFS 0x0c0 | ||
87 | #define GT_PCI1SYNC_OFS 0x0c8 | ||
88 | |||
89 | /* SDRAM and Device Address Decode. */ | ||
90 | #define GT_SCS0LD_OFS 0x400 | ||
91 | #define GT_SCS0HD_OFS 0x404 | ||
92 | #define GT_SCS1LD_OFS 0x408 | ||
93 | #define GT_SCS1HD_OFS 0x40c | ||
94 | #define GT_SCS2LD_OFS 0x410 | ||
95 | #define GT_SCS2HD_OFS 0x414 | ||
96 | #define GT_SCS3LD_OFS 0x418 | ||
97 | #define GT_SCS3HD_OFS 0x41c | ||
98 | #define GT_CS0LD_OFS 0x420 | ||
99 | #define GT_CS0HD_OFS 0x424 | ||
100 | #define GT_CS1LD_OFS 0x428 | ||
101 | #define GT_CS1HD_OFS 0x42c | ||
102 | #define GT_CS2LD_OFS 0x430 | ||
103 | #define GT_CS2HD_OFS 0x434 | ||
104 | #define GT_CS3LD_OFS 0x438 | ||
105 | #define GT_CS3HD_OFS 0x43c | ||
106 | #define GT_BOOTLD_OFS 0x440 | ||
107 | #define GT_BOOTHD_OFS 0x444 | ||
108 | |||
109 | #define GT_ADERR_OFS 0x470 | ||
110 | |||
111 | /* SDRAM Configuration. */ | ||
112 | #define GT_SDRAM_CFG_OFS 0x448 | ||
113 | |||
114 | #define GT_SDRAM_OPMODE_OFS 0x474 | ||
115 | #define GT_SDRAM_BM_OFS 0x478 | ||
116 | #define GT_SDRAM_ADDRDECODE_OFS 0x47c | ||
117 | |||
118 | /* SDRAM Parameters. */ | ||
119 | #define GT_SDRAM_B0_OFS 0x44c | ||
120 | #define GT_SDRAM_B1_OFS 0x450 | ||
121 | #define GT_SDRAM_B2_OFS 0x454 | ||
122 | #define GT_SDRAM_B3_OFS 0x458 | ||
123 | |||
124 | /* Device Parameters. */ | ||
125 | #define GT_DEV_B0_OFS 0x45c | ||
126 | #define GT_DEV_B1_OFS 0x460 | ||
127 | #define GT_DEV_B2_OFS 0x464 | ||
128 | #define GT_DEV_B3_OFS 0x468 | ||
129 | #define GT_DEV_BOOT_OFS 0x46c | ||
130 | |||
131 | /* ECC. */ | ||
132 | #define GT_ECC_ERRDATALO 0x480 /* GT-64120A only */ | ||
133 | #define GT_ECC_ERRDATAHI 0x484 /* GT-64120A only */ | ||
134 | #define GT_ECC_MEM 0x488 /* GT-64120A only */ | ||
135 | #define GT_ECC_CALC 0x48c /* GT-64120A only */ | ||
136 | #define GT_ECC_ERRADDR 0x490 /* GT-64120A only */ | ||
137 | |||
138 | /* DMA Record. */ | ||
139 | #define GT_DMA0_CNT_OFS 0x800 | ||
140 | #define GT_DMA1_CNT_OFS 0x804 | ||
141 | #define GT_DMA2_CNT_OFS 0x808 | ||
142 | #define GT_DMA3_CNT_OFS 0x80c | ||
143 | #define GT_DMA0_SA_OFS 0x810 | ||
144 | #define GT_DMA1_SA_OFS 0x814 | ||
145 | #define GT_DMA2_SA_OFS 0x818 | ||
146 | #define GT_DMA3_SA_OFS 0x81c | ||
147 | #define GT_DMA0_DA_OFS 0x820 | ||
148 | #define GT_DMA1_DA_OFS 0x824 | ||
149 | #define GT_DMA2_DA_OFS 0x828 | ||
150 | #define GT_DMA3_DA_OFS 0x82c | ||
151 | #define GT_DMA0_NEXT_OFS 0x830 | ||
152 | #define GT_DMA1_NEXT_OFS 0x834 | ||
153 | #define GT_DMA2_NEXT_OFS 0x838 | ||
154 | #define GT_DMA3_NEXT_OFS 0x83c | ||
155 | |||
156 | #define GT_DMA0_CUR_OFS 0x870 | ||
157 | #define GT_DMA1_CUR_OFS 0x874 | ||
158 | #define GT_DMA2_CUR_OFS 0x878 | ||
159 | #define GT_DMA3_CUR_OFS 0x87c | ||
160 | |||
161 | /* DMA Channel Control. */ | ||
162 | #define GT_DMA0_CTRL_OFS 0x840 | ||
163 | #define GT_DMA1_CTRL_OFS 0x844 | ||
164 | #define GT_DMA2_CTRL_OFS 0x848 | ||
165 | #define GT_DMA3_CTRL_OFS 0x84c | ||
166 | |||
167 | /* DMA Arbiter. */ | ||
168 | #define GT_DMA_ARB_OFS 0x860 | ||
169 | |||
170 | /* Timer/Counter. */ | ||
171 | #define GT_TC0_OFS 0x850 | ||
172 | #define GT_TC1_OFS 0x854 | ||
173 | #define GT_TC2_OFS 0x858 | ||
174 | #define GT_TC3_OFS 0x85c | ||
175 | |||
176 | #define GT_TC_CONTROL_OFS 0x864 | ||
177 | |||
178 | /* PCI Internal. */ | ||
179 | #define GT_PCI0_CMD_OFS 0xc00 | ||
180 | #define GT_PCI0_TOR_OFS 0xc04 | ||
181 | #define GT_PCI0_BS_SCS10_OFS 0xc08 | ||
182 | #define GT_PCI0_BS_SCS32_OFS 0xc0c | ||
183 | #define GT_PCI0_BS_CS20_OFS 0xc10 | ||
184 | #define GT_PCI0_BS_CS3BT_OFS 0xc14 | ||
185 | |||
186 | #define GT_PCI1_IACK_OFS 0xc30 | ||
187 | #define GT_PCI0_IACK_OFS 0xc34 | ||
188 | |||
189 | #define GT_PCI0_BARE_OFS 0xc3c | ||
190 | #define GT_PCI0_PREFMBR_OFS 0xc40 | ||
191 | |||
192 | #define GT_PCI0_SCS10_BAR_OFS 0xc48 | ||
193 | #define GT_PCI0_SCS32_BAR_OFS 0xc4c | ||
194 | #define GT_PCI0_CS20_BAR_OFS 0xc50 | ||
195 | #define GT_PCI0_CS3BT_BAR_OFS 0xc54 | ||
196 | #define GT_PCI0_SSCS10_BAR_OFS 0xc58 | ||
197 | #define GT_PCI0_SSCS32_BAR_OFS 0xc5c | ||
198 | |||
199 | #define GT_PCI0_SCS3BT_BAR_OFS 0xc64 | ||
200 | |||
201 | #define GT_PCI1_CMD_OFS 0xc80 | ||
202 | #define GT_PCI1_TOR_OFS 0xc84 | ||
203 | #define GT_PCI1_BS_SCS10_OFS 0xc88 | ||
204 | #define GT_PCI1_BS_SCS32_OFS 0xc8c | ||
205 | #define GT_PCI1_BS_CS20_OFS 0xc90 | ||
206 | #define GT_PCI1_BS_CS3BT_OFS 0xc94 | ||
207 | |||
208 | #define GT_PCI1_BARE_OFS 0xcbc | ||
209 | #define GT_PCI1_PREFMBR_OFS 0xcc0 | ||
210 | |||
211 | #define GT_PCI1_SCS10_BAR_OFS 0xcc8 | ||
212 | #define GT_PCI1_SCS32_BAR_OFS 0xccc | ||
213 | #define GT_PCI1_CS20_BAR_OFS 0xcd0 | ||
214 | #define GT_PCI1_CS3BT_BAR_OFS 0xcd4 | ||
215 | #define GT_PCI1_SSCS10_BAR_OFS 0xcd8 | ||
216 | #define GT_PCI1_SSCS32_BAR_OFS 0xcdc | ||
217 | |||
218 | #define GT_PCI1_SCS3BT_BAR_OFS 0xce4 | ||
219 | |||
220 | #define GT_PCI1_CFGADDR_OFS 0xcf0 | ||
221 | #define GT_PCI1_CFGDATA_OFS 0xcf4 | ||
222 | #define GT_PCI0_CFGADDR_OFS 0xcf8 | ||
223 | #define GT_PCI0_CFGDATA_OFS 0xcfc | ||
224 | |||
225 | /* Interrupts. */ | ||
226 | #define GT_INTRCAUSE_OFS 0xc18 | ||
227 | #define GT_INTRMASK_OFS 0xc1c | ||
228 | |||
229 | #define GT_PCI0_ICMASK_OFS 0xc24 | ||
230 | #define GT_PCI0_SERR0MASK_OFS 0xc28 | ||
231 | |||
232 | #define GT_CPU_INTSEL_OFS 0xc70 | ||
233 | #define GT_PCI0_INTSEL_OFS 0xc74 | ||
234 | |||
235 | #define GT_HINTRCAUSE_OFS 0xc98 | ||
236 | #define GT_HINTRMASK_OFS 0xc9c | ||
237 | |||
238 | #define GT_PCI0_HICMASK_OFS 0xca4 | ||
239 | #define GT_PCI1_SERR1MASK_OFS 0xca8 | ||
240 | |||
241 | |||
242 | /* | ||
243 | * I2O Support Registers | ||
244 | */ | ||
245 | #define INBOUND_MESSAGE_REGISTER0_PCI_SIDE 0x010 | ||
246 | #define INBOUND_MESSAGE_REGISTER1_PCI_SIDE 0x014 | ||
247 | #define OUTBOUND_MESSAGE_REGISTER0_PCI_SIDE 0x018 | ||
248 | #define OUTBOUND_MESSAGE_REGISTER1_PCI_SIDE 0x01c | ||
249 | #define INBOUND_DOORBELL_REGISTER_PCI_SIDE 0x020 | ||
250 | #define INBOUND_INTERRUPT_CAUSE_REGISTER_PCI_SIDE 0x024 | ||
251 | #define INBOUND_INTERRUPT_MASK_REGISTER_PCI_SIDE 0x028 | ||
252 | #define OUTBOUND_DOORBELL_REGISTER_PCI_SIDE 0x02c | ||
253 | #define OUTBOUND_INTERRUPT_CAUSE_REGISTER_PCI_SIDE 0x030 | ||
254 | #define OUTBOUND_INTERRUPT_MASK_REGISTER_PCI_SIDE 0x034 | ||
255 | #define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI_SIDE 0x040 | ||
256 | #define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI_SIDE 0x044 | ||
257 | #define QUEUE_CONTROL_REGISTER_PCI_SIDE 0x050 | ||
258 | #define QUEUE_BASE_ADDRESS_REGISTER_PCI_SIDE 0x054 | ||
259 | #define INBOUND_FREE_HEAD_POINTER_REGISTER_PCI_SIDE 0x060 | ||
260 | #define INBOUND_FREE_TAIL_POINTER_REGISTER_PCI_SIDE 0x064 | ||
261 | #define INBOUND_POST_HEAD_POINTER_REGISTER_PCI_SIDE 0x068 | ||
262 | #define INBOUND_POST_TAIL_POINTER_REGISTER_PCI_SIDE 0x06c | ||
263 | #define OUTBOUND_FREE_HEAD_POINTER_REGISTER_PCI_SIDE 0x070 | ||
264 | #define OUTBOUND_FREE_TAIL_POINTER_REGISTER_PCI_SIDE 0x074 | ||
265 | #define OUTBOUND_POST_HEAD_POINTER_REGISTER_PCI_SIDE 0x078 | ||
266 | #define OUTBOUND_POST_TAIL_POINTER_REGISTER_PCI_SIDE 0x07c | ||
267 | |||
268 | #define INBOUND_MESSAGE_REGISTER0_CPU_SIDE 0x1c10 | ||
269 | #define INBOUND_MESSAGE_REGISTER1_CPU_SIDE 0x1c14 | ||
270 | #define OUTBOUND_MESSAGE_REGISTER0_CPU_SIDE 0x1c18 | ||
271 | #define OUTBOUND_MESSAGE_REGISTER1_CPU_SIDE 0x1c1c | ||
272 | #define INBOUND_DOORBELL_REGISTER_CPU_SIDE 0x1c20 | ||
273 | #define INBOUND_INTERRUPT_CAUSE_REGISTER_CPU_SIDE 0x1c24 | ||
274 | #define INBOUND_INTERRUPT_MASK_REGISTER_CPU_SIDE 0x1c28 | ||
275 | #define OUTBOUND_DOORBELL_REGISTER_CPU_SIDE 0x1c2c | ||
276 | #define OUTBOUND_INTERRUPT_CAUSE_REGISTER_CPU_SIDE 0x1c30 | ||
277 | #define OUTBOUND_INTERRUPT_MASK_REGISTER_CPU_SIDE 0x1c34 | ||
278 | #define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU_SIDE 0x1c40 | ||
279 | #define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU_SIDE 0x1c44 | ||
280 | #define QUEUE_CONTROL_REGISTER_CPU_SIDE 0x1c50 | ||
281 | #define QUEUE_BASE_ADDRESS_REGISTER_CPU_SIDE 0x1c54 | ||
282 | #define INBOUND_FREE_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c60 | ||
283 | #define INBOUND_FREE_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c64 | ||
284 | #define INBOUND_POST_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c68 | ||
285 | #define INBOUND_POST_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c6c | ||
286 | #define OUTBOUND_FREE_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c70 | ||
287 | #define OUTBOUND_FREE_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c74 | ||
288 | #define OUTBOUND_POST_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c78 | ||
289 | #define OUTBOUND_POST_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c7c | ||
290 | |||
291 | /* | ||
292 | * Register encodings | ||
293 | */ | ||
294 | #define GT_CPU_ENDIAN_SHF 12 | ||
295 | #define GT_CPU_ENDIAN_MSK (MSK(1) << GT_CPU_ENDIAN_SHF) | ||
296 | #define GT_CPU_ENDIAN_BIT GT_CPU_ENDIAN_MSK | ||
297 | #define GT_CPU_WR_SHF 16 | ||
298 | #define GT_CPU_WR_MSK (MSK(1) << GT_CPU_WR_SHF) | ||
299 | #define GT_CPU_WR_BIT GT_CPU_WR_MSK | ||
300 | #define GT_CPU_WR_DXDXDXDX 0 | ||
301 | #define GT_CPU_WR_DDDD 1 | ||
302 | |||
303 | |||
304 | #define GT_PCI_DCRM_SHF 21 | ||
305 | #define GT_PCI_LD_SHF 0 | ||
306 | #define GT_PCI_LD_MSK (MSK(15) << GT_PCI_LD_SHF) | ||
307 | #define GT_PCI_HD_SHF 0 | ||
308 | #define GT_PCI_HD_MSK (MSK(7) << GT_PCI_HD_SHF) | ||
309 | #define GT_PCI_REMAP_SHF 0 | ||
310 | #define GT_PCI_REMAP_MSK (MSK(11) << GT_PCI_REMAP_SHF) | ||
311 | |||
312 | |||
313 | #define GT_CFGADDR_CFGEN_SHF 31 | ||
314 | #define GT_CFGADDR_CFGEN_MSK (MSK(1) << GT_CFGADDR_CFGEN_SHF) | ||
315 | #define GT_CFGADDR_CFGEN_BIT GT_CFGADDR_CFGEN_MSK | ||
316 | |||
317 | #define GT_CFGADDR_BUSNUM_SHF 16 | ||
318 | #define GT_CFGADDR_BUSNUM_MSK (MSK(8) << GT_CFGADDR_BUSNUM_SHF) | ||
319 | |||
320 | #define GT_CFGADDR_DEVNUM_SHF 11 | ||
321 | #define GT_CFGADDR_DEVNUM_MSK (MSK(5) << GT_CFGADDR_DEVNUM_SHF) | ||
322 | |||
323 | #define GT_CFGADDR_FUNCNUM_SHF 8 | ||
324 | #define GT_CFGADDR_FUNCNUM_MSK (MSK(3) << GT_CFGADDR_FUNCNUM_SHF) | ||
325 | |||
326 | #define GT_CFGADDR_REGNUM_SHF 2 | ||
327 | #define GT_CFGADDR_REGNUM_MSK (MSK(6) << GT_CFGADDR_REGNUM_SHF) | ||
328 | |||
329 | |||
330 | #define GT_SDRAM_BM_ORDER_SHF 2 | ||
331 | #define GT_SDRAM_BM_ORDER_MSK (MSK(1) << GT_SDRAM_BM_ORDER_SHF) | ||
332 | #define GT_SDRAM_BM_ORDER_BIT GT_SDRAM_BM_ORDER_MSK | ||
333 | #define GT_SDRAM_BM_ORDER_SUB 1 | ||
334 | #define GT_SDRAM_BM_ORDER_LIN 0 | ||
335 | |||
336 | #define GT_SDRAM_BM_RSVD_ALL1 0xffb | ||
337 | |||
338 | |||
339 | #define GT_SDRAM_ADDRDECODE_ADDR_SHF 0 | ||
340 | #define GT_SDRAM_ADDRDECODE_ADDR_MSK (MSK(3) << GT_SDRAM_ADDRDECODE_ADDR_SHF) | ||
341 | #define GT_SDRAM_ADDRDECODE_ADDR_0 0 | ||
342 | #define GT_SDRAM_ADDRDECODE_ADDR_1 1 | ||
343 | #define GT_SDRAM_ADDRDECODE_ADDR_2 2 | ||
344 | #define GT_SDRAM_ADDRDECODE_ADDR_3 3 | ||
345 | #define GT_SDRAM_ADDRDECODE_ADDR_4 4 | ||
346 | #define GT_SDRAM_ADDRDECODE_ADDR_5 5 | ||
347 | #define GT_SDRAM_ADDRDECODE_ADDR_6 6 | ||
348 | #define GT_SDRAM_ADDRDECODE_ADDR_7 7 | ||
349 | |||
350 | |||
351 | #define GT_SDRAM_B0_CASLAT_SHF 0 | ||
352 | #define GT_SDRAM_B0_CASLAT_MSK (MSK(2) << GT_SDRAM_B0__SHF) | ||
353 | #define GT_SDRAM_B0_CASLAT_2 1 | ||
354 | #define GT_SDRAM_B0_CASLAT_3 2 | ||
355 | |||
356 | #define GT_SDRAM_B0_FTDIS_SHF 2 | ||
357 | #define GT_SDRAM_B0_FTDIS_MSK (MSK(1) << GT_SDRAM_B0_FTDIS_SHF) | ||
358 | #define GT_SDRAM_B0_FTDIS_BIT GT_SDRAM_B0_FTDIS_MSK | ||
359 | |||
360 | #define GT_SDRAM_B0_SRASPRCHG_SHF 3 | ||
361 | #define GT_SDRAM_B0_SRASPRCHG_MSK (MSK(1) << GT_SDRAM_B0_SRASPRCHG_SHF) | ||
362 | #define GT_SDRAM_B0_SRASPRCHG_BIT GT_SDRAM_B0_SRASPRCHG_MSK | ||
363 | #define GT_SDRAM_B0_SRASPRCHG_2 0 | ||
364 | #define GT_SDRAM_B0_SRASPRCHG_3 1 | ||
365 | |||
366 | #define GT_SDRAM_B0_B0COMPAB_SHF 4 | ||
367 | #define GT_SDRAM_B0_B0COMPAB_MSK (MSK(1) << GT_SDRAM_B0_B0COMPAB_SHF) | ||
368 | #define GT_SDRAM_B0_B0COMPAB_BIT GT_SDRAM_B0_B0COMPAB_MSK | ||
369 | |||
370 | #define GT_SDRAM_B0_64BITINT_SHF 5 | ||
371 | #define GT_SDRAM_B0_64BITINT_MSK (MSK(1) << GT_SDRAM_B0_64BITINT_SHF) | ||
372 | #define GT_SDRAM_B0_64BITINT_BIT GT_SDRAM_B0_64BITINT_MSK | ||
373 | #define GT_SDRAM_B0_64BITINT_2 0 | ||
374 | #define GT_SDRAM_B0_64BITINT_4 1 | ||
375 | |||
376 | #define GT_SDRAM_B0_BW_SHF 6 | ||
377 | #define GT_SDRAM_B0_BW_MSK (MSK(1) << GT_SDRAM_B0_BW_SHF) | ||
378 | #define GT_SDRAM_B0_BW_BIT GT_SDRAM_B0_BW_MSK | ||
379 | #define GT_SDRAM_B0_BW_32 0 | ||
380 | #define GT_SDRAM_B0_BW_64 1 | ||
381 | |||
382 | #define GT_SDRAM_B0_BLODD_SHF 7 | ||
383 | #define GT_SDRAM_B0_BLODD_MSK (MSK(1) << GT_SDRAM_B0_BLODD_SHF) | ||
384 | #define GT_SDRAM_B0_BLODD_BIT GT_SDRAM_B0_BLODD_MSK | ||
385 | |||
386 | #define GT_SDRAM_B0_PAR_SHF 8 | ||
387 | #define GT_SDRAM_B0_PAR_MSK (MSK(1) << GT_SDRAM_B0_PAR_SHF) | ||
388 | #define GT_SDRAM_B0_PAR_BIT GT_SDRAM_B0_PAR_MSK | ||
389 | |||
390 | #define GT_SDRAM_B0_BYPASS_SHF 9 | ||
391 | #define GT_SDRAM_B0_BYPASS_MSK (MSK(1) << GT_SDRAM_B0_BYPASS_SHF) | ||
392 | #define GT_SDRAM_B0_BYPASS_BIT GT_SDRAM_B0_BYPASS_MSK | ||
393 | |||
394 | #define GT_SDRAM_B0_SRAS2SCAS_SHF 10 | ||
395 | #define GT_SDRAM_B0_SRAS2SCAS_MSK (MSK(1) << GT_SDRAM_B0_SRAS2SCAS_SHF) | ||
396 | #define GT_SDRAM_B0_SRAS2SCAS_BIT GT_SDRAM_B0_SRAS2SCAS_MSK | ||
397 | #define GT_SDRAM_B0_SRAS2SCAS_2 0 | ||
398 | #define GT_SDRAM_B0_SRAS2SCAS_3 1 | ||
399 | |||
400 | #define GT_SDRAM_B0_SIZE_SHF 11 | ||
401 | #define GT_SDRAM_B0_SIZE_MSK (MSK(1) << GT_SDRAM_B0_SIZE_SHF) | ||
402 | #define GT_SDRAM_B0_SIZE_BIT GT_SDRAM_B0_SIZE_MSK | ||
403 | #define GT_SDRAM_B0_SIZE_16M 0 | ||
404 | #define GT_SDRAM_B0_SIZE_64M 1 | ||
405 | |||
406 | #define GT_SDRAM_B0_EXTPAR_SHF 12 | ||
407 | #define GT_SDRAM_B0_EXTPAR_MSK (MSK(1) << GT_SDRAM_B0_EXTPAR_SHF) | ||
408 | #define GT_SDRAM_B0_EXTPAR_BIT GT_SDRAM_B0_EXTPAR_MSK | ||
409 | |||
410 | #define GT_SDRAM_B0_BLEN_SHF 13 | ||
411 | #define GT_SDRAM_B0_BLEN_MSK (MSK(1) << GT_SDRAM_B0_BLEN_SHF) | ||
412 | #define GT_SDRAM_B0_BLEN_BIT GT_SDRAM_B0_BLEN_MSK | ||
413 | #define GT_SDRAM_B0_BLEN_8 0 | ||
414 | #define GT_SDRAM_B0_BLEN_4 1 | ||
415 | |||
416 | |||
417 | #define GT_SDRAM_CFG_REFINT_SHF 0 | ||
418 | #define GT_SDRAM_CFG_REFINT_MSK (MSK(14) << GT_SDRAM_CFG_REFINT_SHF) | ||
419 | |||
420 | #define GT_SDRAM_CFG_NINTERLEAVE_SHF 14 | ||
421 | #define GT_SDRAM_CFG_NINTERLEAVE_MSK (MSK(1) << GT_SDRAM_CFG_NINTERLEAVE_SHF) | ||
422 | #define GT_SDRAM_CFG_NINTERLEAVE_BIT GT_SDRAM_CFG_NINTERLEAVE_MSK | ||
423 | |||
424 | #define GT_SDRAM_CFG_RMW_SHF 15 | ||
425 | #define GT_SDRAM_CFG_RMW_MSK (MSK(1) << GT_SDRAM_CFG_RMW_SHF) | ||
426 | #define GT_SDRAM_CFG_RMW_BIT GT_SDRAM_CFG_RMW_MSK | ||
427 | |||
428 | #define GT_SDRAM_CFG_NONSTAGREF_SHF 16 | ||
429 | #define GT_SDRAM_CFG_NONSTAGREF_MSK (MSK(1) << GT_SDRAM_CFG_NONSTAGREF_SHF) | ||
430 | #define GT_SDRAM_CFG_NONSTAGREF_BIT GT_SDRAM_CFG_NONSTAGREF_MSK | ||
431 | |||
432 | #define GT_SDRAM_CFG_DUPCNTL_SHF 19 | ||
433 | #define GT_SDRAM_CFG_DUPCNTL_MSK (MSK(1) << GT_SDRAM_CFG_DUPCNTL_SHF) | ||
434 | #define GT_SDRAM_CFG_DUPCNTL_BIT GT_SDRAM_CFG_DUPCNTL_MSK | ||
435 | |||
436 | #define GT_SDRAM_CFG_DUPBA_SHF 20 | ||
437 | #define GT_SDRAM_CFG_DUPBA_MSK (MSK(1) << GT_SDRAM_CFG_DUPBA_SHF) | ||
438 | #define GT_SDRAM_CFG_DUPBA_BIT GT_SDRAM_CFG_DUPBA_MSK | ||
439 | |||
440 | #define GT_SDRAM_CFG_DUPEOT0_SHF 21 | ||
441 | #define GT_SDRAM_CFG_DUPEOT0_MSK (MSK(1) << GT_SDRAM_CFG_DUPEOT0_SHF) | ||
442 | #define GT_SDRAM_CFG_DUPEOT0_BIT GT_SDRAM_CFG_DUPEOT0_MSK | ||
443 | |||
444 | #define GT_SDRAM_CFG_DUPEOT1_SHF 22 | ||
445 | #define GT_SDRAM_CFG_DUPEOT1_MSK (MSK(1) << GT_SDRAM_CFG_DUPEOT1_SHF) | ||
446 | #define GT_SDRAM_CFG_DUPEOT1_BIT GT_SDRAM_CFG_DUPEOT1_MSK | ||
447 | |||
448 | #define GT_SDRAM_OPMODE_OP_SHF 0 | ||
449 | #define GT_SDRAM_OPMODE_OP_MSK (MSK(3) << GT_SDRAM_OPMODE_OP_SHF) | ||
450 | #define GT_SDRAM_OPMODE_OP_NORMAL 0 | ||
451 | #define GT_SDRAM_OPMODE_OP_NOP 1 | ||
452 | #define GT_SDRAM_OPMODE_OP_PRCHG 2 | ||
453 | #define GT_SDRAM_OPMODE_OP_MODE 3 | ||
454 | #define GT_SDRAM_OPMODE_OP_CBR 4 | ||
455 | |||
456 | #define GT_TC_CONTROL_ENTC0_SHF 0 | ||
457 | #define GT_TC_CONTROL_ENTC0_MSK (MSK(1) << GT_TC_CONTROL_ENTC0_SHF) | ||
458 | #define GT_TC_CONTROL_ENTC0_BIT GT_TC_CONTROL_ENTC0_MSK | ||
459 | #define GT_TC_CONTROL_SELTC0_SHF 1 | ||
460 | #define GT_TC_CONTROL_SELTC0_MSK (MSK(1) << GT_TC_CONTROL_SELTC0_SHF) | ||
461 | #define GT_TC_CONTROL_SELTC0_BIT GT_TC_CONTROL_SELTC0_MSK | ||
462 | |||
463 | |||
464 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_SHF 0 | ||
465 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS3BOOTDIS_SHF) | ||
466 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_BIT GT_PCI0_BARE_SWSCS3BOOTDIS_MSK | ||
467 | |||
468 | #define GT_PCI0_BARE_SWSCS32DIS_SHF 1 | ||
469 | #define GT_PCI0_BARE_SWSCS32DIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS32DIS_SHF) | ||
470 | #define GT_PCI0_BARE_SWSCS32DIS_BIT GT_PCI0_BARE_SWSCS32DIS_MSK | ||
471 | |||
472 | #define GT_PCI0_BARE_SWSCS10DIS_SHF 2 | ||
473 | #define GT_PCI0_BARE_SWSCS10DIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS10DIS_SHF) | ||
474 | #define GT_PCI0_BARE_SWSCS10DIS_BIT GT_PCI0_BARE_SWSCS10DIS_MSK | ||
475 | |||
476 | #define GT_PCI0_BARE_INTIODIS_SHF 3 | ||
477 | #define GT_PCI0_BARE_INTIODIS_MSK (MSK(1) << GT_PCI0_BARE_INTIODIS_SHF) | ||
478 | #define GT_PCI0_BARE_INTIODIS_BIT GT_PCI0_BARE_INTIODIS_MSK | ||
479 | |||
480 | #define GT_PCI0_BARE_INTMEMDIS_SHF 4 | ||
481 | #define GT_PCI0_BARE_INTMEMDIS_MSK (MSK(1) << GT_PCI0_BARE_INTMEMDIS_SHF) | ||
482 | #define GT_PCI0_BARE_INTMEMDIS_BIT GT_PCI0_BARE_INTMEMDIS_MSK | ||
483 | |||
484 | #define GT_PCI0_BARE_CS3BOOTDIS_SHF 5 | ||
485 | #define GT_PCI0_BARE_CS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_CS3BOOTDIS_SHF) | ||
486 | #define GT_PCI0_BARE_CS3BOOTDIS_BIT GT_PCI0_BARE_CS3BOOTDIS_MSK | ||
487 | |||
488 | #define GT_PCI0_BARE_CS20DIS_SHF 6 | ||
489 | #define GT_PCI0_BARE_CS20DIS_MSK (MSK(1) << GT_PCI0_BARE_CS20DIS_SHF) | ||
490 | #define GT_PCI0_BARE_CS20DIS_BIT GT_PCI0_BARE_CS20DIS_MSK | ||
491 | |||
492 | #define GT_PCI0_BARE_SCS32DIS_SHF 7 | ||
493 | #define GT_PCI0_BARE_SCS32DIS_MSK (MSK(1) << GT_PCI0_BARE_SCS32DIS_SHF) | ||
494 | #define GT_PCI0_BARE_SCS32DIS_BIT GT_PCI0_BARE_SCS32DIS_MSK | ||
495 | |||
496 | #define GT_PCI0_BARE_SCS10DIS_SHF 8 | ||
497 | #define GT_PCI0_BARE_SCS10DIS_MSK (MSK(1) << GT_PCI0_BARE_SCS10DIS_SHF) | ||
498 | #define GT_PCI0_BARE_SCS10DIS_BIT GT_PCI0_BARE_SCS10DIS_MSK | ||
499 | |||
500 | |||
501 | #define GT_INTRCAUSE_MASABORT0_SHF 18 | ||
502 | #define GT_INTRCAUSE_MASABORT0_MSK (MSK(1) << GT_INTRCAUSE_MASABORT0_SHF) | ||
503 | #define GT_INTRCAUSE_MASABORT0_BIT GT_INTRCAUSE_MASABORT0_MSK | ||
504 | |||
505 | #define GT_INTRCAUSE_TARABORT0_SHF 19 | ||
506 | #define GT_INTRCAUSE_TARABORT0_MSK (MSK(1) << GT_INTRCAUSE_TARABORT0_SHF) | ||
507 | #define GT_INTRCAUSE_TARABORT0_BIT GT_INTRCAUSE_TARABORT0_MSK | ||
508 | |||
509 | |||
510 | #define GT_PCI0_CFGADDR_REGNUM_SHF 2 | ||
511 | #define GT_PCI0_CFGADDR_REGNUM_MSK (MSK(6) << GT_PCI0_CFGADDR_REGNUM_SHF) | ||
512 | #define GT_PCI0_CFGADDR_FUNCTNUM_SHF 8 | ||
513 | #define GT_PCI0_CFGADDR_FUNCTNUM_MSK (MSK(3) << GT_PCI0_CFGADDR_FUNCTNUM_SHF) | ||
514 | #define GT_PCI0_CFGADDR_DEVNUM_SHF 11 | ||
515 | #define GT_PCI0_CFGADDR_DEVNUM_MSK (MSK(5) << GT_PCI0_CFGADDR_DEVNUM_SHF) | ||
516 | #define GT_PCI0_CFGADDR_BUSNUM_SHF 16 | ||
517 | #define GT_PCI0_CFGADDR_BUSNUM_MSK (MSK(8) << GT_PCI0_CFGADDR_BUSNUM_SHF) | ||
518 | #define GT_PCI0_CFGADDR_CONFIGEN_SHF 31 | ||
519 | #define GT_PCI0_CFGADDR_CONFIGEN_MSK (MSK(1) << GT_PCI0_CFGADDR_CONFIGEN_SHF) | ||
520 | #define GT_PCI0_CFGADDR_CONFIGEN_BIT GT_PCI0_CFGADDR_CONFIGEN_MSK | ||
521 | |||
522 | #define GT_PCI0_CMD_MBYTESWAP_SHF 0 | ||
523 | #define GT_PCI0_CMD_MBYTESWAP_MSK (MSK(1) << GT_PCI0_CMD_MBYTESWAP_SHF) | ||
524 | #define GT_PCI0_CMD_MBYTESWAP_BIT GT_PCI0_CMD_MBYTESWAP_MSK | ||
525 | #define GT_PCI0_CMD_MWORDSWAP_SHF 10 | ||
526 | #define GT_PCI0_CMD_MWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_MWORDSWAP_SHF) | ||
527 | #define GT_PCI0_CMD_MWORDSWAP_BIT GT_PCI0_CMD_MWORDSWAP_MSK | ||
528 | #define GT_PCI0_CMD_SBYTESWAP_SHF 16 | ||
529 | #define GT_PCI0_CMD_SBYTESWAP_MSK (MSK(1) << GT_PCI0_CMD_SBYTESWAP_SHF) | ||
530 | #define GT_PCI0_CMD_SBYTESWAP_BIT GT_PCI0_CMD_SBYTESWAP_MSK | ||
531 | #define GT_PCI0_CMD_SWORDSWAP_SHF 11 | ||
532 | #define GT_PCI0_CMD_SWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_SWORDSWAP_SHF) | ||
533 | #define GT_PCI0_CMD_SWORDSWAP_BIT GT_PCI0_CMD_SWORDSWAP_MSK | ||
534 | |||
535 | #define GT_INTR_T0EXP_SHF 8 | ||
536 | #define GT_INTR_T0EXP_MSK (MSK(1) << GT_INTR_T0EXP_SHF) | ||
537 | #define GT_INTR_T0EXP_BIT GT_INTR_T0EXP_MSK | ||
538 | #define GT_INTR_RETRYCTR0_SHF 20 | ||
539 | #define GT_INTR_RETRYCTR0_MSK (MSK(1) << GT_INTR_RETRYCTR0_SHF) | ||
540 | #define GT_INTR_RETRYCTR0_BIT GT_INTR_RETRYCTR0_MSK | ||
541 | |||
542 | /* | ||
543 | * Misc | ||
544 | */ | ||
545 | #define GT_DEF_PCI0_IO_BASE 0x10000000UL | ||
546 | #define GT_DEF_PCI0_IO_SIZE 0x02000000UL | ||
547 | #define GT_DEF_PCI0_MEM0_BASE 0x12000000UL | ||
548 | #define GT_DEF_PCI0_MEM0_SIZE 0x02000000UL | ||
549 | #define GT_DEF_BASE 0x14000000UL | ||
550 | |||
551 | #define GT_MAX_BANKSIZE (256 * 1024 * 1024) /* Max 256MB bank */ | ||
552 | #define GT_LATTIM_MIN 6 /* Minimum lat */ | ||
553 | |||
554 | /* | ||
555 | * The gt64120_dep.h file must define the following macros | ||
556 | * | ||
557 | * GT_READ(ofs, data_pointer) | ||
558 | * GT_WRITE(ofs, data) - read/write GT64120 registers in 32bit | ||
559 | * | ||
560 | * TIMER - gt64120 timer irq, temporary solution until | ||
561 | * full gt64120 cascade interrupt support is in place | ||
562 | */ | ||
563 | |||
564 | #include <mach-gt64120.h> | ||
565 | |||
566 | /* | ||
567 | * Because of an error/peculiarity in the Galileo chip, we need to swap the | ||
568 | * bytes when running bigendian. We also provide non-swapping versions. | ||
569 | */ | ||
570 | #define __GT_READ(ofs) \ | ||
571 | (*(volatile u32 *)(GT64120_BASE+(ofs))) | ||
572 | #define __GT_WRITE(ofs, data) \ | ||
573 | do { *(volatile u32 *)(GT64120_BASE+(ofs)) = (data); } while (0) | ||
574 | #define GT_READ(ofs) le32_to_cpu(__GT_READ(ofs)) | ||
575 | #define GT_WRITE(ofs, data) __GT_WRITE(ofs, cpu_to_le32(data)) | ||
576 | |||
577 | extern void gt641xx_set_base_clock(unsigned int clock); | ||
578 | extern int gt641xx_timer0_state(void); | ||
579 | |||
580 | #endif /* _ASM_GT64120_H */ | ||
diff --git a/include/asm-mips/hardirq.h b/include/asm-mips/hardirq.h deleted file mode 100644 index 90bf399e6dd9..000000000000 --- a/include/asm-mips/hardirq.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1997, 98, 99, 2000, 01, 05 Ralf Baechle (ralf@linux-mips.org) | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | * Copyright (C) 2001 MIPS Technologies, Inc. | ||
9 | */ | ||
10 | #ifndef _ASM_HARDIRQ_H | ||
11 | #define _ASM_HARDIRQ_H | ||
12 | |||
13 | #include <linux/threads.h> | ||
14 | #include <linux/irq.h> | ||
15 | |||
16 | typedef struct { | ||
17 | unsigned int __softirq_pending; | ||
18 | } ____cacheline_aligned irq_cpustat_t; | ||
19 | |||
20 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | ||
21 | |||
22 | extern void ack_bad_irq(unsigned int irq); | ||
23 | |||
24 | #endif /* _ASM_HARDIRQ_H */ | ||
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h deleted file mode 100644 index 2de638f84c86..000000000000 --- a/include/asm-mips/hazards.h +++ /dev/null | |||
@@ -1,271 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 04, 07 Ralf Baechle <ralf@linux-mips.org> | ||
7 | * Copyright (C) MIPS Technologies, Inc. | ||
8 | * written by Ralf Baechle <ralf@linux-mips.org> | ||
9 | */ | ||
10 | #ifndef _ASM_HAZARDS_H | ||
11 | #define _ASM_HAZARDS_H | ||
12 | |||
13 | #ifdef __ASSEMBLY__ | ||
14 | #define ASMMACRO(name, code...) .macro name; code; .endm | ||
15 | #else | ||
16 | |||
17 | #include <asm/cpu-features.h> | ||
18 | |||
19 | #define ASMMACRO(name, code...) \ | ||
20 | __asm__(".macro " #name "; " #code "; .endm"); \ | ||
21 | \ | ||
22 | static inline void name(void) \ | ||
23 | { \ | ||
24 | __asm__ __volatile__ (#name); \ | ||
25 | } | ||
26 | |||
27 | /* | ||
28 | * MIPS R2 instruction hazard barrier. Needs to be called as a subroutine. | ||
29 | */ | ||
30 | extern void mips_ihb(void); | ||
31 | |||
32 | #endif | ||
33 | |||
34 | ASMMACRO(_ssnop, | ||
35 | sll $0, $0, 1 | ||
36 | ) | ||
37 | |||
38 | ASMMACRO(_ehb, | ||
39 | sll $0, $0, 3 | ||
40 | ) | ||
41 | |||
42 | /* | ||
43 | * TLB hazards | ||
44 | */ | ||
45 | #if defined(CONFIG_CPU_MIPSR2) | ||
46 | |||
47 | /* | ||
48 | * MIPSR2 defines ehb for hazard avoidance | ||
49 | */ | ||
50 | |||
51 | ASMMACRO(mtc0_tlbw_hazard, | ||
52 | _ehb | ||
53 | ) | ||
54 | ASMMACRO(tlbw_use_hazard, | ||
55 | _ehb | ||
56 | ) | ||
57 | ASMMACRO(tlb_probe_hazard, | ||
58 | _ehb | ||
59 | ) | ||
60 | ASMMACRO(irq_enable_hazard, | ||
61 | _ehb | ||
62 | ) | ||
63 | ASMMACRO(irq_disable_hazard, | ||
64 | _ehb | ||
65 | ) | ||
66 | ASMMACRO(back_to_back_c0_hazard, | ||
67 | _ehb | ||
68 | ) | ||
69 | /* | ||
70 | * gcc has a tradition of misscompiling the previous construct using the | ||
71 | * address of a label as argument to inline assembler. Gas otoh has the | ||
72 | * annoying difference between la and dla which are only usable for 32-bit | ||
73 | * rsp. 64-bit code, so can't be used without conditional compilation. | ||
74 | * The alterantive is switching the assembler to 64-bit code which happens | ||
75 | * to work right even for 32-bit code ... | ||
76 | */ | ||
77 | #define instruction_hazard() \ | ||
78 | do { \ | ||
79 | unsigned long tmp; \ | ||
80 | \ | ||
81 | __asm__ __volatile__( \ | ||
82 | " .set mips64r2 \n" \ | ||
83 | " dla %0, 1f \n" \ | ||
84 | " jr.hb %0 \n" \ | ||
85 | " .set mips0 \n" \ | ||
86 | "1: \n" \ | ||
87 | : "=r" (tmp)); \ | ||
88 | } while (0) | ||
89 | |||
90 | #elif defined(CONFIG_CPU_MIPSR1) | ||
91 | |||
92 | /* | ||
93 | * These are slightly complicated by the fact that we guarantee R1 kernels to | ||
94 | * run fine on R2 processors. | ||
95 | */ | ||
96 | ASMMACRO(mtc0_tlbw_hazard, | ||
97 | _ssnop; _ssnop; _ehb | ||
98 | ) | ||
99 | ASMMACRO(tlbw_use_hazard, | ||
100 | _ssnop; _ssnop; _ssnop; _ehb | ||
101 | ) | ||
102 | ASMMACRO(tlb_probe_hazard, | ||
103 | _ssnop; _ssnop; _ssnop; _ehb | ||
104 | ) | ||
105 | ASMMACRO(irq_enable_hazard, | ||
106 | _ssnop; _ssnop; _ssnop; _ehb | ||
107 | ) | ||
108 | ASMMACRO(irq_disable_hazard, | ||
109 | _ssnop; _ssnop; _ssnop; _ehb | ||
110 | ) | ||
111 | ASMMACRO(back_to_back_c0_hazard, | ||
112 | _ssnop; _ssnop; _ssnop; _ehb | ||
113 | ) | ||
114 | /* | ||
115 | * gcc has a tradition of misscompiling the previous construct using the | ||
116 | * address of a label as argument to inline assembler. Gas otoh has the | ||
117 | * annoying difference between la and dla which are only usable for 32-bit | ||
118 | * rsp. 64-bit code, so can't be used without conditional compilation. | ||
119 | * The alterantive is switching the assembler to 64-bit code which happens | ||
120 | * to work right even for 32-bit code ... | ||
121 | */ | ||
122 | #define __instruction_hazard() \ | ||
123 | do { \ | ||
124 | unsigned long tmp; \ | ||
125 | \ | ||
126 | __asm__ __volatile__( \ | ||
127 | " .set mips64r2 \n" \ | ||
128 | " dla %0, 1f \n" \ | ||
129 | " jr.hb %0 \n" \ | ||
130 | " .set mips0 \n" \ | ||
131 | "1: \n" \ | ||
132 | : "=r" (tmp)); \ | ||
133 | } while (0) | ||
134 | |||
135 | #define instruction_hazard() \ | ||
136 | do { \ | ||
137 | if (cpu_has_mips_r2) \ | ||
138 | __instruction_hazard(); \ | ||
139 | } while (0) | ||
140 | |||
141 | #elif defined(CONFIG_CPU_R10000) | ||
142 | |||
143 | /* | ||
144 | * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. | ||
145 | */ | ||
146 | |||
147 | ASMMACRO(mtc0_tlbw_hazard, | ||
148 | ) | ||
149 | ASMMACRO(tlbw_use_hazard, | ||
150 | ) | ||
151 | ASMMACRO(tlb_probe_hazard, | ||
152 | ) | ||
153 | ASMMACRO(irq_enable_hazard, | ||
154 | ) | ||
155 | ASMMACRO(irq_disable_hazard, | ||
156 | ) | ||
157 | ASMMACRO(back_to_back_c0_hazard, | ||
158 | ) | ||
159 | #define instruction_hazard() do { } while (0) | ||
160 | |||
161 | #elif defined(CONFIG_CPU_RM9000) | ||
162 | |||
163 | /* | ||
164 | * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent | ||
165 | * use of the JTLB for instructions should not occur for 4 cpu cycles and use | ||
166 | * for data translations should not occur for 3 cpu cycles. | ||
167 | */ | ||
168 | |||
169 | ASMMACRO(mtc0_tlbw_hazard, | ||
170 | _ssnop; _ssnop; _ssnop; _ssnop | ||
171 | ) | ||
172 | ASMMACRO(tlbw_use_hazard, | ||
173 | _ssnop; _ssnop; _ssnop; _ssnop | ||
174 | ) | ||
175 | ASMMACRO(tlb_probe_hazard, | ||
176 | _ssnop; _ssnop; _ssnop; _ssnop | ||
177 | ) | ||
178 | ASMMACRO(irq_enable_hazard, | ||
179 | ) | ||
180 | ASMMACRO(irq_disable_hazard, | ||
181 | ) | ||
182 | ASMMACRO(back_to_back_c0_hazard, | ||
183 | ) | ||
184 | #define instruction_hazard() do { } while (0) | ||
185 | |||
186 | #elif defined(CONFIG_CPU_SB1) | ||
187 | |||
188 | /* | ||
189 | * Mostly like R4000 for historic reasons | ||
190 | */ | ||
191 | ASMMACRO(mtc0_tlbw_hazard, | ||
192 | ) | ||
193 | ASMMACRO(tlbw_use_hazard, | ||
194 | ) | ||
195 | ASMMACRO(tlb_probe_hazard, | ||
196 | ) | ||
197 | ASMMACRO(irq_enable_hazard, | ||
198 | ) | ||
199 | ASMMACRO(irq_disable_hazard, | ||
200 | _ssnop; _ssnop; _ssnop | ||
201 | ) | ||
202 | ASMMACRO(back_to_back_c0_hazard, | ||
203 | ) | ||
204 | #define instruction_hazard() do { } while (0) | ||
205 | |||
206 | #else | ||
207 | |||
208 | /* | ||
209 | * Finally the catchall case for all other processors including R4000, R4400, | ||
210 | * R4600, R4700, R5000, RM7000, NEC VR41xx etc. | ||
211 | * | ||
212 | * The taken branch will result in a two cycle penalty for the two killed | ||
213 | * instructions on R4000 / R4400. Other processors only have a single cycle | ||
214 | * hazard so this is nice trick to have an optimal code for a range of | ||
215 | * processors. | ||
216 | */ | ||
217 | ASMMACRO(mtc0_tlbw_hazard, | ||
218 | nop; nop | ||
219 | ) | ||
220 | ASMMACRO(tlbw_use_hazard, | ||
221 | nop; nop; nop | ||
222 | ) | ||
223 | ASMMACRO(tlb_probe_hazard, | ||
224 | nop; nop; nop | ||
225 | ) | ||
226 | ASMMACRO(irq_enable_hazard, | ||
227 | _ssnop; _ssnop; _ssnop; | ||
228 | ) | ||
229 | ASMMACRO(irq_disable_hazard, | ||
230 | nop; nop; nop | ||
231 | ) | ||
232 | ASMMACRO(back_to_back_c0_hazard, | ||
233 | _ssnop; _ssnop; _ssnop; | ||
234 | ) | ||
235 | #define instruction_hazard() do { } while (0) | ||
236 | |||
237 | #endif | ||
238 | |||
239 | |||
240 | /* FPU hazards */ | ||
241 | |||
242 | #if defined(CONFIG_CPU_SB1) | ||
243 | ASMMACRO(enable_fpu_hazard, | ||
244 | .set push; | ||
245 | .set mips64; | ||
246 | .set noreorder; | ||
247 | _ssnop; | ||
248 | bnezl $0, .+4; | ||
249 | _ssnop; | ||
250 | .set pop | ||
251 | ) | ||
252 | ASMMACRO(disable_fpu_hazard, | ||
253 | ) | ||
254 | |||
255 | #elif defined(CONFIG_CPU_MIPSR2) | ||
256 | ASMMACRO(enable_fpu_hazard, | ||
257 | _ehb | ||
258 | ) | ||
259 | ASMMACRO(disable_fpu_hazard, | ||
260 | _ehb | ||
261 | ) | ||
262 | #else | ||
263 | ASMMACRO(enable_fpu_hazard, | ||
264 | nop; nop; nop; nop | ||
265 | ) | ||
266 | ASMMACRO(disable_fpu_hazard, | ||
267 | _ehb | ||
268 | ) | ||
269 | #endif | ||
270 | |||
271 | #endif /* _ASM_HAZARDS_H */ | ||
diff --git a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h deleted file mode 100644 index 4374ab2adc75..000000000000 --- a/include/asm-mips/highmem.h +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | /* | ||
2 | * highmem.h: virtual kernel memory mappings for high memory | ||
3 | * | ||
4 | * Used in CONFIG_HIGHMEM systems for memory pages which | ||
5 | * are not addressable by direct kernel virtual addresses. | ||
6 | * | ||
7 | * Copyright (C) 1999 Gerhard Wichert, Siemens AG | ||
8 | * Gerhard.Wichert@pdb.siemens.de | ||
9 | * | ||
10 | * | ||
11 | * Redesigned the x86 32-bit VM architecture to deal with | ||
12 | * up to 16 Terabyte physical memory. With current x86 CPUs | ||
13 | * we now support up to 64 Gigabytes physical RAM. | ||
14 | * | ||
15 | * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com> | ||
16 | */ | ||
17 | #ifndef _ASM_HIGHMEM_H | ||
18 | #define _ASM_HIGHMEM_H | ||
19 | |||
20 | #ifdef __KERNEL__ | ||
21 | |||
22 | #include <linux/init.h> | ||
23 | #include <linux/interrupt.h> | ||
24 | #include <linux/uaccess.h> | ||
25 | #include <asm/kmap_types.h> | ||
26 | |||
27 | /* undef for production */ | ||
28 | #define HIGHMEM_DEBUG 1 | ||
29 | |||
30 | /* declarations for highmem.c */ | ||
31 | extern unsigned long highstart_pfn, highend_pfn; | ||
32 | |||
33 | extern pte_t *kmap_pte; | ||
34 | extern pgprot_t kmap_prot; | ||
35 | extern pte_t *pkmap_page_table; | ||
36 | |||
37 | /* | ||
38 | * Right now we initialize only a single pte table. It can be extended | ||
39 | * easily, subsequent pte tables have to be allocated in one physical | ||
40 | * chunk of RAM. | ||
41 | */ | ||
42 | #define LAST_PKMAP 1024 | ||
43 | #define LAST_PKMAP_MASK (LAST_PKMAP-1) | ||
44 | #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT) | ||
45 | #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) | ||
46 | |||
47 | extern void * kmap_high(struct page *page); | ||
48 | extern void kunmap_high(struct page *page); | ||
49 | |||
50 | extern void *__kmap(struct page *page); | ||
51 | extern void __kunmap(struct page *page); | ||
52 | extern void *__kmap_atomic(struct page *page, enum km_type type); | ||
53 | extern void __kunmap_atomic(void *kvaddr, enum km_type type); | ||
54 | extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type); | ||
55 | extern struct page *__kmap_atomic_to_page(void *ptr); | ||
56 | |||
57 | #define kmap __kmap | ||
58 | #define kunmap __kunmap | ||
59 | #define kmap_atomic __kmap_atomic | ||
60 | #define kunmap_atomic __kunmap_atomic | ||
61 | #define kmap_atomic_to_page __kmap_atomic_to_page | ||
62 | |||
63 | #define flush_cache_kmaps() flush_cache_all() | ||
64 | |||
65 | #endif /* __KERNEL__ */ | ||
66 | |||
67 | #endif /* _ASM_HIGHMEM_H */ | ||
diff --git a/include/asm-mips/hw_irq.h b/include/asm-mips/hw_irq.h deleted file mode 100644 index aca05a43a97b..000000000000 --- a/include/asm-mips/hw_irq.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000, 2001, 2002 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_HW_IRQ_H | ||
9 | #define __ASM_HW_IRQ_H | ||
10 | |||
11 | #include <asm/atomic.h> | ||
12 | |||
13 | extern atomic_t irq_err_count; | ||
14 | |||
15 | /* | ||
16 | * interrupt-retrigger: NOP for now. This may not be apropriate for all | ||
17 | * machines, we'll see ... | ||
18 | */ | ||
19 | |||
20 | #endif /* __ASM_HW_IRQ_H */ | ||
diff --git a/include/asm-mips/i8253.h b/include/asm-mips/i8253.h deleted file mode 100644 index 5dabc870b322..000000000000 --- a/include/asm-mips/i8253.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * Machine specific IO port address definition for generic. | ||
3 | * Written by Osamu Tomita <tomita@cinet.co.jp> | ||
4 | */ | ||
5 | #ifndef __ASM_I8253_H | ||
6 | #define __ASM_I8253_H | ||
7 | |||
8 | #include <linux/spinlock.h> | ||
9 | |||
10 | /* i8253A PIT registers */ | ||
11 | #define PIT_MODE 0x43 | ||
12 | #define PIT_CH0 0x40 | ||
13 | #define PIT_CH2 0x42 | ||
14 | |||
15 | #define PIT_TICK_RATE 1193182UL | ||
16 | |||
17 | extern spinlock_t i8253_lock; | ||
18 | |||
19 | extern void setup_pit_timer(void); | ||
20 | |||
21 | #endif /* __ASM_I8253_H */ | ||
diff --git a/include/asm-mips/i8259.h b/include/asm-mips/i8259.h deleted file mode 100644 index 8572a2d90484..000000000000 --- a/include/asm-mips/i8259.h +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/i8259.h | ||
3 | * | ||
4 | * i8259A interrupt definitions. | ||
5 | * | ||
6 | * Copyright (C) 2003 Maciej W. Rozycki | ||
7 | * Copyright (C) 2003 Ralf Baechle <ralf@linux-mips.org> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | */ | ||
14 | #ifndef _ASM_I8259_H | ||
15 | #define _ASM_I8259_H | ||
16 | |||
17 | #include <linux/compiler.h> | ||
18 | #include <linux/spinlock.h> | ||
19 | |||
20 | #include <asm/io.h> | ||
21 | #include <irq.h> | ||
22 | |||
23 | /* i8259A PIC registers */ | ||
24 | #define PIC_MASTER_CMD 0x20 | ||
25 | #define PIC_MASTER_IMR 0x21 | ||
26 | #define PIC_MASTER_ISR PIC_MASTER_CMD | ||
27 | #define PIC_MASTER_POLL PIC_MASTER_ISR | ||
28 | #define PIC_MASTER_OCW3 PIC_MASTER_ISR | ||
29 | #define PIC_SLAVE_CMD 0xa0 | ||
30 | #define PIC_SLAVE_IMR 0xa1 | ||
31 | |||
32 | /* i8259A PIC related value */ | ||
33 | #define PIC_CASCADE_IR 2 | ||
34 | #define MASTER_ICW4_DEFAULT 0x01 | ||
35 | #define SLAVE_ICW4_DEFAULT 0x01 | ||
36 | #define PIC_ICW4_AEOI 2 | ||
37 | |||
38 | extern spinlock_t i8259A_lock; | ||
39 | |||
40 | extern int i8259A_irq_pending(unsigned int irq); | ||
41 | extern void make_8259A_irq(unsigned int irq); | ||
42 | |||
43 | extern void init_i8259_irqs(void); | ||
44 | |||
45 | /* | ||
46 | * Do the traditional i8259 interrupt polling thing. This is for the few | ||
47 | * cases where no better interrupt acknowledge method is available and we | ||
48 | * absolutely must touch the i8259. | ||
49 | */ | ||
50 | static inline int i8259_irq(void) | ||
51 | { | ||
52 | int irq; | ||
53 | |||
54 | spin_lock(&i8259A_lock); | ||
55 | |||
56 | /* Perform an interrupt acknowledge cycle on controller 1. */ | ||
57 | outb(0x0C, PIC_MASTER_CMD); /* prepare for poll */ | ||
58 | irq = inb(PIC_MASTER_CMD) & 7; | ||
59 | if (irq == PIC_CASCADE_IR) { | ||
60 | /* | ||
61 | * Interrupt is cascaded so perform interrupt | ||
62 | * acknowledge on controller 2. | ||
63 | */ | ||
64 | outb(0x0C, PIC_SLAVE_CMD); /* prepare for poll */ | ||
65 | irq = (inb(PIC_SLAVE_CMD) & 7) + 8; | ||
66 | } | ||
67 | |||
68 | if (unlikely(irq == 7)) { | ||
69 | /* | ||
70 | * This may be a spurious interrupt. | ||
71 | * | ||
72 | * Read the interrupt status register (ISR). If the most | ||
73 | * significant bit is not set then there is no valid | ||
74 | * interrupt. | ||
75 | */ | ||
76 | outb(0x0B, PIC_MASTER_ISR); /* ISR register */ | ||
77 | if(~inb(PIC_MASTER_ISR) & 0x80) | ||
78 | irq = -1; | ||
79 | } | ||
80 | |||
81 | spin_unlock(&i8259A_lock); | ||
82 | |||
83 | return likely(irq >= 0) ? irq + I8259A_IRQ_BASE : irq; | ||
84 | } | ||
85 | |||
86 | #endif /* _ASM_I8259_H */ | ||
diff --git a/include/asm-mips/ide.h b/include/asm-mips/ide.h deleted file mode 100644 index bb674c3b0303..000000000000 --- a/include/asm-mips/ide.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * This file contains the MIPS architecture specific IDE code. | ||
7 | */ | ||
8 | #ifndef __ASM_IDE_H | ||
9 | #define __ASM_IDE_H | ||
10 | |||
11 | #include <ide.h> | ||
12 | |||
13 | #endif /* __ASM_IDE_H */ | ||
diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h deleted file mode 100644 index 6489f00731ca..000000000000 --- a/include/asm-mips/inst.h +++ /dev/null | |||
@@ -1,394 +0,0 @@ | |||
1 | /* | ||
2 | * Format of an instruction in memory. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1996, 2000 by Ralf Baechle | ||
9 | * Copyright (C) 2006 by Thiemo Seufer | ||
10 | */ | ||
11 | #ifndef _ASM_INST_H | ||
12 | #define _ASM_INST_H | ||
13 | |||
14 | /* | ||
15 | * Major opcodes; before MIPS IV cop1x was called cop3. | ||
16 | */ | ||
17 | enum major_op { | ||
18 | spec_op, bcond_op, j_op, jal_op, | ||
19 | beq_op, bne_op, blez_op, bgtz_op, | ||
20 | addi_op, addiu_op, slti_op, sltiu_op, | ||
21 | andi_op, ori_op, xori_op, lui_op, | ||
22 | cop0_op, cop1_op, cop2_op, cop1x_op, | ||
23 | beql_op, bnel_op, blezl_op, bgtzl_op, | ||
24 | daddi_op, daddiu_op, ldl_op, ldr_op, | ||
25 | spec2_op, jalx_op, mdmx_op, spec3_op, | ||
26 | lb_op, lh_op, lwl_op, lw_op, | ||
27 | lbu_op, lhu_op, lwr_op, lwu_op, | ||
28 | sb_op, sh_op, swl_op, sw_op, | ||
29 | sdl_op, sdr_op, swr_op, cache_op, | ||
30 | ll_op, lwc1_op, lwc2_op, pref_op, | ||
31 | lld_op, ldc1_op, ldc2_op, ld_op, | ||
32 | sc_op, swc1_op, swc2_op, major_3b_op, | ||
33 | scd_op, sdc1_op, sdc2_op, sd_op | ||
34 | }; | ||
35 | |||
36 | /* | ||
37 | * func field of spec opcode. | ||
38 | */ | ||
39 | enum spec_op { | ||
40 | sll_op, movc_op, srl_op, sra_op, | ||
41 | sllv_op, pmon_op, srlv_op, srav_op, | ||
42 | jr_op, jalr_op, movz_op, movn_op, | ||
43 | syscall_op, break_op, spim_op, sync_op, | ||
44 | mfhi_op, mthi_op, mflo_op, mtlo_op, | ||
45 | dsllv_op, spec2_unused_op, dsrlv_op, dsrav_op, | ||
46 | mult_op, multu_op, div_op, divu_op, | ||
47 | dmult_op, dmultu_op, ddiv_op, ddivu_op, | ||
48 | add_op, addu_op, sub_op, subu_op, | ||
49 | and_op, or_op, xor_op, nor_op, | ||
50 | spec3_unused_op, spec4_unused_op, slt_op, sltu_op, | ||
51 | dadd_op, daddu_op, dsub_op, dsubu_op, | ||
52 | tge_op, tgeu_op, tlt_op, tltu_op, | ||
53 | teq_op, spec5_unused_op, tne_op, spec6_unused_op, | ||
54 | dsll_op, spec7_unused_op, dsrl_op, dsra_op, | ||
55 | dsll32_op, spec8_unused_op, dsrl32_op, dsra32_op | ||
56 | }; | ||
57 | |||
58 | /* | ||
59 | * func field of spec2 opcode. | ||
60 | */ | ||
61 | enum spec2_op { | ||
62 | madd_op, maddu_op, mul_op, spec2_3_unused_op, | ||
63 | msub_op, msubu_op, /* more unused ops */ | ||
64 | clz_op = 0x20, clo_op, | ||
65 | dclz_op = 0x24, dclo_op, | ||
66 | sdbpp_op = 0x3f | ||
67 | }; | ||
68 | |||
69 | /* | ||
70 | * func field of spec3 opcode. | ||
71 | */ | ||
72 | enum spec3_op { | ||
73 | ext_op, dextm_op, dextu_op, dext_op, | ||
74 | ins_op, dinsm_op, dinsu_op, dins_op, | ||
75 | bshfl_op = 0x20, | ||
76 | dbshfl_op = 0x24, | ||
77 | rdhwr_op = 0x3b | ||
78 | }; | ||
79 | |||
80 | /* | ||
81 | * rt field of bcond opcodes. | ||
82 | */ | ||
83 | enum rt_op { | ||
84 | bltz_op, bgez_op, bltzl_op, bgezl_op, | ||
85 | spimi_op, unused_rt_op_0x05, unused_rt_op_0x06, unused_rt_op_0x07, | ||
86 | tgei_op, tgeiu_op, tlti_op, tltiu_op, | ||
87 | teqi_op, unused_0x0d_rt_op, tnei_op, unused_0x0f_rt_op, | ||
88 | bltzal_op, bgezal_op, bltzall_op, bgezall_op, | ||
89 | rt_op_0x14, rt_op_0x15, rt_op_0x16, rt_op_0x17, | ||
90 | rt_op_0x18, rt_op_0x19, rt_op_0x1a, rt_op_0x1b, | ||
91 | bposge32_op, rt_op_0x1d, rt_op_0x1e, rt_op_0x1f | ||
92 | }; | ||
93 | |||
94 | /* | ||
95 | * rs field of cop opcodes. | ||
96 | */ | ||
97 | enum cop_op { | ||
98 | mfc_op = 0x00, dmfc_op = 0x01, | ||
99 | cfc_op = 0x02, mtc_op = 0x04, | ||
100 | dmtc_op = 0x05, ctc_op = 0x06, | ||
101 | bc_op = 0x08, cop_op = 0x10, | ||
102 | copm_op = 0x18 | ||
103 | }; | ||
104 | |||
105 | /* | ||
106 | * rt field of cop.bc_op opcodes | ||
107 | */ | ||
108 | enum bcop_op { | ||
109 | bcf_op, bct_op, bcfl_op, bctl_op | ||
110 | }; | ||
111 | |||
112 | /* | ||
113 | * func field of cop0 coi opcodes. | ||
114 | */ | ||
115 | enum cop0_coi_func { | ||
116 | tlbr_op = 0x01, tlbwi_op = 0x02, | ||
117 | tlbwr_op = 0x06, tlbp_op = 0x08, | ||
118 | rfe_op = 0x10, eret_op = 0x18 | ||
119 | }; | ||
120 | |||
121 | /* | ||
122 | * func field of cop0 com opcodes. | ||
123 | */ | ||
124 | enum cop0_com_func { | ||
125 | tlbr1_op = 0x01, tlbw_op = 0x02, | ||
126 | tlbp1_op = 0x08, dctr_op = 0x09, | ||
127 | dctw_op = 0x0a | ||
128 | }; | ||
129 | |||
130 | /* | ||
131 | * fmt field of cop1 opcodes. | ||
132 | */ | ||
133 | enum cop1_fmt { | ||
134 | s_fmt, d_fmt, e_fmt, q_fmt, | ||
135 | w_fmt, l_fmt | ||
136 | }; | ||
137 | |||
138 | /* | ||
139 | * func field of cop1 instructions using d, s or w format. | ||
140 | */ | ||
141 | enum cop1_sdw_func { | ||
142 | fadd_op = 0x00, fsub_op = 0x01, | ||
143 | fmul_op = 0x02, fdiv_op = 0x03, | ||
144 | fsqrt_op = 0x04, fabs_op = 0x05, | ||
145 | fmov_op = 0x06, fneg_op = 0x07, | ||
146 | froundl_op = 0x08, ftruncl_op = 0x09, | ||
147 | fceill_op = 0x0a, ffloorl_op = 0x0b, | ||
148 | fround_op = 0x0c, ftrunc_op = 0x0d, | ||
149 | fceil_op = 0x0e, ffloor_op = 0x0f, | ||
150 | fmovc_op = 0x11, fmovz_op = 0x12, | ||
151 | fmovn_op = 0x13, frecip_op = 0x15, | ||
152 | frsqrt_op = 0x16, fcvts_op = 0x20, | ||
153 | fcvtd_op = 0x21, fcvte_op = 0x22, | ||
154 | fcvtw_op = 0x24, fcvtl_op = 0x25, | ||
155 | fcmp_op = 0x30 | ||
156 | }; | ||
157 | |||
158 | /* | ||
159 | * func field of cop1x opcodes (MIPS IV). | ||
160 | */ | ||
161 | enum cop1x_func { | ||
162 | lwxc1_op = 0x00, ldxc1_op = 0x01, | ||
163 | pfetch_op = 0x07, swxc1_op = 0x08, | ||
164 | sdxc1_op = 0x09, madd_s_op = 0x20, | ||
165 | madd_d_op = 0x21, madd_e_op = 0x22, | ||
166 | msub_s_op = 0x28, msub_d_op = 0x29, | ||
167 | msub_e_op = 0x2a, nmadd_s_op = 0x30, | ||
168 | nmadd_d_op = 0x31, nmadd_e_op = 0x32, | ||
169 | nmsub_s_op = 0x38, nmsub_d_op = 0x39, | ||
170 | nmsub_e_op = 0x3a | ||
171 | }; | ||
172 | |||
173 | /* | ||
174 | * func field for mad opcodes (MIPS IV). | ||
175 | */ | ||
176 | enum mad_func { | ||
177 | madd_fp_op = 0x08, msub_fp_op = 0x0a, | ||
178 | nmadd_fp_op = 0x0c, nmsub_fp_op = 0x0e | ||
179 | }; | ||
180 | |||
181 | /* | ||
182 | * Damn ... bitfields depend from byteorder :-( | ||
183 | */ | ||
184 | #ifdef __MIPSEB__ | ||
185 | struct j_format { /* Jump format */ | ||
186 | unsigned int opcode : 6; | ||
187 | unsigned int target : 26; | ||
188 | }; | ||
189 | |||
190 | struct i_format { /* Immediate format (addi, lw, ...) */ | ||
191 | unsigned int opcode : 6; | ||
192 | unsigned int rs : 5; | ||
193 | unsigned int rt : 5; | ||
194 | signed int simmediate : 16; | ||
195 | }; | ||
196 | |||
197 | struct u_format { /* Unsigned immediate format (ori, xori, ...) */ | ||
198 | unsigned int opcode : 6; | ||
199 | unsigned int rs : 5; | ||
200 | unsigned int rt : 5; | ||
201 | unsigned int uimmediate : 16; | ||
202 | }; | ||
203 | |||
204 | struct c_format { /* Cache (>= R6000) format */ | ||
205 | unsigned int opcode : 6; | ||
206 | unsigned int rs : 5; | ||
207 | unsigned int c_op : 3; | ||
208 | unsigned int cache : 2; | ||
209 | unsigned int simmediate : 16; | ||
210 | }; | ||
211 | |||
212 | struct r_format { /* Register format */ | ||
213 | unsigned int opcode : 6; | ||
214 | unsigned int rs : 5; | ||
215 | unsigned int rt : 5; | ||
216 | unsigned int rd : 5; | ||
217 | unsigned int re : 5; | ||
218 | unsigned int func : 6; | ||
219 | }; | ||
220 | |||
221 | struct p_format { /* Performance counter format (R10000) */ | ||
222 | unsigned int opcode : 6; | ||
223 | unsigned int rs : 5; | ||
224 | unsigned int rt : 5; | ||
225 | unsigned int rd : 5; | ||
226 | unsigned int re : 5; | ||
227 | unsigned int func : 6; | ||
228 | }; | ||
229 | |||
230 | struct f_format { /* FPU register format */ | ||
231 | unsigned int opcode : 6; | ||
232 | unsigned int : 1; | ||
233 | unsigned int fmt : 4; | ||
234 | unsigned int rt : 5; | ||
235 | unsigned int rd : 5; | ||
236 | unsigned int re : 5; | ||
237 | unsigned int func : 6; | ||
238 | }; | ||
239 | |||
240 | struct ma_format { /* FPU multipy and add format (MIPS IV) */ | ||
241 | unsigned int opcode : 6; | ||
242 | unsigned int fr : 5; | ||
243 | unsigned int ft : 5; | ||
244 | unsigned int fs : 5; | ||
245 | unsigned int fd : 5; | ||
246 | unsigned int func : 4; | ||
247 | unsigned int fmt : 2; | ||
248 | }; | ||
249 | |||
250 | #elif defined(__MIPSEL__) | ||
251 | |||
252 | struct j_format { /* Jump format */ | ||
253 | unsigned int target : 26; | ||
254 | unsigned int opcode : 6; | ||
255 | }; | ||
256 | |||
257 | struct i_format { /* Immediate format */ | ||
258 | signed int simmediate : 16; | ||
259 | unsigned int rt : 5; | ||
260 | unsigned int rs : 5; | ||
261 | unsigned int opcode : 6; | ||
262 | }; | ||
263 | |||
264 | struct u_format { /* Unsigned immediate format */ | ||
265 | unsigned int uimmediate : 16; | ||
266 | unsigned int rt : 5; | ||
267 | unsigned int rs : 5; | ||
268 | unsigned int opcode : 6; | ||
269 | }; | ||
270 | |||
271 | struct c_format { /* Cache (>= R6000) format */ | ||
272 | unsigned int simmediate : 16; | ||
273 | unsigned int cache : 2; | ||
274 | unsigned int c_op : 3; | ||
275 | unsigned int rs : 5; | ||
276 | unsigned int opcode : 6; | ||
277 | }; | ||
278 | |||
279 | struct r_format { /* Register format */ | ||
280 | unsigned int func : 6; | ||
281 | unsigned int re : 5; | ||
282 | unsigned int rd : 5; | ||
283 | unsigned int rt : 5; | ||
284 | unsigned int rs : 5; | ||
285 | unsigned int opcode : 6; | ||
286 | }; | ||
287 | |||
288 | struct p_format { /* Performance counter format (R10000) */ | ||
289 | unsigned int func : 6; | ||
290 | unsigned int re : 5; | ||
291 | unsigned int rd : 5; | ||
292 | unsigned int rt : 5; | ||
293 | unsigned int rs : 5; | ||
294 | unsigned int opcode : 6; | ||
295 | }; | ||
296 | |||
297 | struct f_format { /* FPU register format */ | ||
298 | unsigned int func : 6; | ||
299 | unsigned int re : 5; | ||
300 | unsigned int rd : 5; | ||
301 | unsigned int rt : 5; | ||
302 | unsigned int fmt : 4; | ||
303 | unsigned int : 1; | ||
304 | unsigned int opcode : 6; | ||
305 | }; | ||
306 | |||
307 | struct ma_format { /* FPU multipy and add format (MIPS IV) */ | ||
308 | unsigned int fmt : 2; | ||
309 | unsigned int func : 4; | ||
310 | unsigned int fd : 5; | ||
311 | unsigned int fs : 5; | ||
312 | unsigned int ft : 5; | ||
313 | unsigned int fr : 5; | ||
314 | unsigned int opcode : 6; | ||
315 | }; | ||
316 | |||
317 | #else /* !defined (__MIPSEB__) && !defined (__MIPSEL__) */ | ||
318 | #error "MIPS but neither __MIPSEL__ nor __MIPSEB__?" | ||
319 | #endif | ||
320 | |||
321 | union mips_instruction { | ||
322 | unsigned int word; | ||
323 | unsigned short halfword[2]; | ||
324 | unsigned char byte[4]; | ||
325 | struct j_format j_format; | ||
326 | struct i_format i_format; | ||
327 | struct u_format u_format; | ||
328 | struct c_format c_format; | ||
329 | struct r_format r_format; | ||
330 | struct f_format f_format; | ||
331 | struct ma_format ma_format; | ||
332 | }; | ||
333 | |||
334 | /* HACHACHAHCAHC ... */ | ||
335 | |||
336 | /* In case some other massaging is needed, keep MIPSInst as wrapper */ | ||
337 | |||
338 | #define MIPSInst(x) x | ||
339 | |||
340 | #define I_OPCODE_SFT 26 | ||
341 | #define MIPSInst_OPCODE(x) (MIPSInst(x) >> I_OPCODE_SFT) | ||
342 | |||
343 | #define I_JTARGET_SFT 0 | ||
344 | #define MIPSInst_JTARGET(x) (MIPSInst(x) & 0x03ffffff) | ||
345 | |||
346 | #define I_RS_SFT 21 | ||
347 | #define MIPSInst_RS(x) ((MIPSInst(x) & 0x03e00000) >> I_RS_SFT) | ||
348 | |||
349 | #define I_RT_SFT 16 | ||
350 | #define MIPSInst_RT(x) ((MIPSInst(x) & 0x001f0000) >> I_RT_SFT) | ||
351 | |||
352 | #define I_IMM_SFT 0 | ||
353 | #define MIPSInst_SIMM(x) ((int)((short)(MIPSInst(x) & 0xffff))) | ||
354 | #define MIPSInst_UIMM(x) (MIPSInst(x) & 0xffff) | ||
355 | |||
356 | #define I_CACHEOP_SFT 18 | ||
357 | #define MIPSInst_CACHEOP(x) ((MIPSInst(x) & 0x001c0000) >> I_CACHEOP_SFT) | ||
358 | |||
359 | #define I_CACHESEL_SFT 16 | ||
360 | #define MIPSInst_CACHESEL(x) ((MIPSInst(x) & 0x00030000) >> I_CACHESEL_SFT) | ||
361 | |||
362 | #define I_RD_SFT 11 | ||
363 | #define MIPSInst_RD(x) ((MIPSInst(x) & 0x0000f800) >> I_RD_SFT) | ||
364 | |||
365 | #define I_RE_SFT 6 | ||
366 | #define MIPSInst_RE(x) ((MIPSInst(x) & 0x000007c0) >> I_RE_SFT) | ||
367 | |||
368 | #define I_FUNC_SFT 0 | ||
369 | #define MIPSInst_FUNC(x) (MIPSInst(x) & 0x0000003f) | ||
370 | |||
371 | #define I_FFMT_SFT 21 | ||
372 | #define MIPSInst_FFMT(x) ((MIPSInst(x) & 0x01e00000) >> I_FFMT_SFT) | ||
373 | |||
374 | #define I_FT_SFT 16 | ||
375 | #define MIPSInst_FT(x) ((MIPSInst(x) & 0x001f0000) >> I_FT_SFT) | ||
376 | |||
377 | #define I_FS_SFT 11 | ||
378 | #define MIPSInst_FS(x) ((MIPSInst(x) & 0x0000f800) >> I_FS_SFT) | ||
379 | |||
380 | #define I_FD_SFT 6 | ||
381 | #define MIPSInst_FD(x) ((MIPSInst(x) & 0x000007c0) >> I_FD_SFT) | ||
382 | |||
383 | #define I_FR_SFT 21 | ||
384 | #define MIPSInst_FR(x) ((MIPSInst(x) & 0x03e00000) >> I_FR_SFT) | ||
385 | |||
386 | #define I_FMA_FUNC_SFT 2 | ||
387 | #define MIPSInst_FMA_FUNC(x) ((MIPSInst(x) & 0x0000003c) >> I_FMA_FUNC_SFT) | ||
388 | |||
389 | #define I_FMA_FFMT_SFT 0 | ||
390 | #define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000003) | ||
391 | |||
392 | typedef unsigned int mips_instruction; | ||
393 | |||
394 | #endif /* _ASM_INST_H */ | ||
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h deleted file mode 100644 index 501a40b9f18d..000000000000 --- a/include/asm-mips/io.h +++ /dev/null | |||
@@ -1,589 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 1995 Waldorf GmbH | ||
7 | * Copyright (C) 1994 - 2000, 06 Ralf Baechle | ||
8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved. | ||
10 | * Author: Maciej W. Rozycki <macro@mips.com> | ||
11 | */ | ||
12 | #ifndef _ASM_IO_H | ||
13 | #define _ASM_IO_H | ||
14 | |||
15 | #include <linux/compiler.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/types.h> | ||
18 | |||
19 | #include <asm/addrspace.h> | ||
20 | #include <asm/byteorder.h> | ||
21 | #include <asm/cpu.h> | ||
22 | #include <asm/cpu-features.h> | ||
23 | #include <asm-generic/iomap.h> | ||
24 | #include <asm/page.h> | ||
25 | #include <asm/pgtable-bits.h> | ||
26 | #include <asm/processor.h> | ||
27 | #include <asm/string.h> | ||
28 | |||
29 | #include <ioremap.h> | ||
30 | #include <mangle-port.h> | ||
31 | |||
32 | /* | ||
33 | * Slowdown I/O port space accesses for antique hardware. | ||
34 | */ | ||
35 | #undef CONF_SLOWDOWN_IO | ||
36 | |||
37 | /* | ||
38 | * Raw operations are never swapped in software. OTOH values that raw | ||
39 | * operations are working on may or may not have been swapped by the bus | ||
40 | * hardware. An example use would be for flash memory that's used for | ||
41 | * execute in place. | ||
42 | */ | ||
43 | # define __raw_ioswabb(a, x) (x) | ||
44 | # define __raw_ioswabw(a, x) (x) | ||
45 | # define __raw_ioswabl(a, x) (x) | ||
46 | # define __raw_ioswabq(a, x) (x) | ||
47 | # define ____raw_ioswabq(a, x) (x) | ||
48 | |||
49 | /* ioswab[bwlq], __mem_ioswab[bwlq] are defined in mangle-port.h */ | ||
50 | |||
51 | #define IO_SPACE_LIMIT 0xffff | ||
52 | |||
53 | /* | ||
54 | * On MIPS I/O ports are memory mapped, so we access them using normal | ||
55 | * load/store instructions. mips_io_port_base is the virtual address to | ||
56 | * which all ports are being mapped. For sake of efficiency some code | ||
57 | * assumes that this is an address that can be loaded with a single lui | ||
58 | * instruction, so the lower 16 bits must be zero. Should be true on | ||
59 | * on any sane architecture; generic code does not use this assumption. | ||
60 | */ | ||
61 | extern const unsigned long mips_io_port_base; | ||
62 | |||
63 | /* | ||
64 | * Gcc will generate code to load the value of mips_io_port_base after each | ||
65 | * function call which may be fairly wasteful in some cases. So we don't | ||
66 | * play quite by the book. We tell gcc mips_io_port_base is a long variable | ||
67 | * which solves the code generation issue. Now we need to violate the | ||
68 | * aliasing rules a little to make initialization possible and finally we | ||
69 | * will need the barrier() to fight side effects of the aliasing chat. | ||
70 | * This trickery will eventually collapse under gcc's optimizer. Oh well. | ||
71 | */ | ||
72 | static inline void set_io_port_base(unsigned long base) | ||
73 | { | ||
74 | * (unsigned long *) &mips_io_port_base = base; | ||
75 | barrier(); | ||
76 | } | ||
77 | |||
78 | /* | ||
79 | * Thanks to James van Artsdalen for a better timing-fix than | ||
80 | * the two short jumps: using outb's to a nonexistent port seems | ||
81 | * to guarantee better timings even on fast machines. | ||
82 | * | ||
83 | * On the other hand, I'd like to be sure of a non-existent port: | ||
84 | * I feel a bit unsafe about using 0x80 (should be safe, though) | ||
85 | * | ||
86 | * Linus | ||
87 | * | ||
88 | */ | ||
89 | |||
90 | #define __SLOW_DOWN_IO \ | ||
91 | __asm__ __volatile__( \ | ||
92 | "sb\t$0,0x80(%0)" \ | ||
93 | : : "r" (mips_io_port_base)); | ||
94 | |||
95 | #ifdef CONF_SLOWDOWN_IO | ||
96 | #ifdef REALLY_SLOW_IO | ||
97 | #define SLOW_DOWN_IO { __SLOW_DOWN_IO; __SLOW_DOWN_IO; __SLOW_DOWN_IO; __SLOW_DOWN_IO; } | ||
98 | #else | ||
99 | #define SLOW_DOWN_IO __SLOW_DOWN_IO | ||
100 | #endif | ||
101 | #else | ||
102 | #define SLOW_DOWN_IO | ||
103 | #endif | ||
104 | |||
105 | /* | ||
106 | * virt_to_phys - map virtual addresses to physical | ||
107 | * @address: address to remap | ||
108 | * | ||
109 | * The returned physical address is the physical (CPU) mapping for | ||
110 | * the memory address given. It is only valid to use this function on | ||
111 | * addresses directly mapped or allocated via kmalloc. | ||
112 | * | ||
113 | * This function does not give bus mappings for DMA transfers. In | ||
114 | * almost all conceivable cases a device driver should not be using | ||
115 | * this function | ||
116 | */ | ||
117 | static inline unsigned long virt_to_phys(volatile const void *address) | ||
118 | { | ||
119 | return (unsigned long)address - PAGE_OFFSET + PHYS_OFFSET; | ||
120 | } | ||
121 | |||
122 | /* | ||
123 | * phys_to_virt - map physical address to virtual | ||
124 | * @address: address to remap | ||
125 | * | ||
126 | * The returned virtual address is a current CPU mapping for | ||
127 | * the memory address given. It is only valid to use this function on | ||
128 | * addresses that have a kernel mapping | ||
129 | * | ||
130 | * This function does not handle bus mappings for DMA transfers. In | ||
131 | * almost all conceivable cases a device driver should not be using | ||
132 | * this function | ||
133 | */ | ||
134 | static inline void * phys_to_virt(unsigned long address) | ||
135 | { | ||
136 | return (void *)(address + PAGE_OFFSET - PHYS_OFFSET); | ||
137 | } | ||
138 | |||
139 | /* | ||
140 | * ISA I/O bus memory addresses are 1:1 with the physical address. | ||
141 | */ | ||
142 | static inline unsigned long isa_virt_to_bus(volatile void * address) | ||
143 | { | ||
144 | return (unsigned long)address - PAGE_OFFSET; | ||
145 | } | ||
146 | |||
147 | static inline void * isa_bus_to_virt(unsigned long address) | ||
148 | { | ||
149 | return (void *)(address + PAGE_OFFSET); | ||
150 | } | ||
151 | |||
152 | #define isa_page_to_bus page_to_phys | ||
153 | |||
154 | /* | ||
155 | * However PCI ones are not necessarily 1:1 and therefore these interfaces | ||
156 | * are forbidden in portable PCI drivers. | ||
157 | * | ||
158 | * Allow them for x86 for legacy drivers, though. | ||
159 | */ | ||
160 | #define virt_to_bus virt_to_phys | ||
161 | #define bus_to_virt phys_to_virt | ||
162 | |||
163 | /* | ||
164 | * Change "struct page" to physical address. | ||
165 | */ | ||
166 | #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) | ||
167 | |||
168 | extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags); | ||
169 | extern void __iounmap(const volatile void __iomem *addr); | ||
170 | |||
171 | static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, | ||
172 | unsigned long flags) | ||
173 | { | ||
174 | void __iomem *addr = plat_ioremap(offset, size, flags); | ||
175 | |||
176 | if (addr) | ||
177 | return addr; | ||
178 | |||
179 | #define __IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL)) | ||
180 | |||
181 | if (cpu_has_64bit_addresses) { | ||
182 | u64 base = UNCAC_BASE; | ||
183 | |||
184 | /* | ||
185 | * R10000 supports a 2 bit uncached attribute therefore | ||
186 | * UNCAC_BASE may not equal IO_BASE. | ||
187 | */ | ||
188 | if (flags == _CACHE_UNCACHED) | ||
189 | base = (u64) IO_BASE; | ||
190 | return (void __iomem *) (unsigned long) (base + offset); | ||
191 | } else if (__builtin_constant_p(offset) && | ||
192 | __builtin_constant_p(size) && __builtin_constant_p(flags)) { | ||
193 | phys_t phys_addr, last_addr; | ||
194 | |||
195 | phys_addr = fixup_bigphys_addr(offset, size); | ||
196 | |||
197 | /* Don't allow wraparound or zero size. */ | ||
198 | last_addr = phys_addr + size - 1; | ||
199 | if (!size || last_addr < phys_addr) | ||
200 | return NULL; | ||
201 | |||
202 | /* | ||
203 | * Map uncached objects in the low 512MB of address | ||
204 | * space using KSEG1. | ||
205 | */ | ||
206 | if (__IS_LOW512(phys_addr) && __IS_LOW512(last_addr) && | ||
207 | flags == _CACHE_UNCACHED) | ||
208 | return (void __iomem *) | ||
209 | (unsigned long)CKSEG1ADDR(phys_addr); | ||
210 | } | ||
211 | |||
212 | return __ioremap(offset, size, flags); | ||
213 | |||
214 | #undef __IS_LOW512 | ||
215 | } | ||
216 | |||
217 | /* | ||
218 | * ioremap - map bus memory into CPU space | ||
219 | * @offset: bus address of the memory | ||
220 | * @size: size of the resource to map | ||
221 | * | ||
222 | * ioremap performs a platform specific sequence of operations to | ||
223 | * make bus memory CPU accessible via the readb/readw/readl/writeb/ | ||
224 | * writew/writel functions and the other mmio helpers. The returned | ||
225 | * address is not guaranteed to be usable directly as a virtual | ||
226 | * address. | ||
227 | */ | ||
228 | #define ioremap(offset, size) \ | ||
229 | __ioremap_mode((offset), (size), _CACHE_UNCACHED) | ||
230 | |||
231 | /* | ||
232 | * ioremap_nocache - map bus memory into CPU space | ||
233 | * @offset: bus address of the memory | ||
234 | * @size: size of the resource to map | ||
235 | * | ||
236 | * ioremap_nocache performs a platform specific sequence of operations to | ||
237 | * make bus memory CPU accessible via the readb/readw/readl/writeb/ | ||
238 | * writew/writel functions and the other mmio helpers. The returned | ||
239 | * address is not guaranteed to be usable directly as a virtual | ||
240 | * address. | ||
241 | * | ||
242 | * This version of ioremap ensures that the memory is marked uncachable | ||
243 | * on the CPU as well as honouring existing caching rules from things like | ||
244 | * the PCI bus. Note that there are other caches and buffers on many | ||
245 | * busses. In paticular driver authors should read up on PCI writes | ||
246 | * | ||
247 | * It's useful if some control registers are in such an area and | ||
248 | * write combining or read caching is not desirable: | ||
249 | */ | ||
250 | #define ioremap_nocache(offset, size) \ | ||
251 | __ioremap_mode((offset), (size), _CACHE_UNCACHED) | ||
252 | |||
253 | /* | ||
254 | * ioremap_cachable - map bus memory into CPU space | ||
255 | * @offset: bus address of the memory | ||
256 | * @size: size of the resource to map | ||
257 | * | ||
258 | * ioremap_nocache performs a platform specific sequence of operations to | ||
259 | * make bus memory CPU accessible via the readb/readw/readl/writeb/ | ||
260 | * writew/writel functions and the other mmio helpers. The returned | ||
261 | * address is not guaranteed to be usable directly as a virtual | ||
262 | * address. | ||
263 | * | ||
264 | * This version of ioremap ensures that the memory is marked cachable by | ||
265 | * the CPU. Also enables full write-combining. Useful for some | ||
266 | * memory-like regions on I/O busses. | ||
267 | */ | ||
268 | #define ioremap_cachable(offset, size) \ | ||
269 | __ioremap_mode((offset), (size), _page_cachable_default) | ||
270 | |||
271 | /* | ||
272 | * These two are MIPS specific ioremap variant. ioremap_cacheable_cow | ||
273 | * requests a cachable mapping, ioremap_uncached_accelerated requests a | ||
274 | * mapping using the uncached accelerated mode which isn't supported on | ||
275 | * all processors. | ||
276 | */ | ||
277 | #define ioremap_cacheable_cow(offset, size) \ | ||
278 | __ioremap_mode((offset), (size), _CACHE_CACHABLE_COW) | ||
279 | #define ioremap_uncached_accelerated(offset, size) \ | ||
280 | __ioremap_mode((offset), (size), _CACHE_UNCACHED_ACCELERATED) | ||
281 | |||
282 | static inline void iounmap(const volatile void __iomem *addr) | ||
283 | { | ||
284 | if (plat_iounmap(addr)) | ||
285 | return; | ||
286 | |||
287 | #define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) | ||
288 | |||
289 | if (cpu_has_64bit_addresses || | ||
290 | (__builtin_constant_p(addr) && __IS_KSEG1(addr))) | ||
291 | return; | ||
292 | |||
293 | __iounmap(addr); | ||
294 | |||
295 | #undef __IS_KSEG1 | ||
296 | } | ||
297 | |||
298 | #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ | ||
299 | \ | ||
300 | static inline void pfx##write##bwlq(type val, \ | ||
301 | volatile void __iomem *mem) \ | ||
302 | { \ | ||
303 | volatile type *__mem; \ | ||
304 | type __val; \ | ||
305 | \ | ||
306 | __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \ | ||
307 | \ | ||
308 | __val = pfx##ioswab##bwlq(__mem, val); \ | ||
309 | \ | ||
310 | if (sizeof(type) != sizeof(u64) || sizeof(u64) == sizeof(long)) \ | ||
311 | *__mem = __val; \ | ||
312 | else if (cpu_has_64bits) { \ | ||
313 | unsigned long __flags; \ | ||
314 | type __tmp; \ | ||
315 | \ | ||
316 | if (irq) \ | ||
317 | local_irq_save(__flags); \ | ||
318 | __asm__ __volatile__( \ | ||
319 | ".set mips3" "\t\t# __writeq""\n\t" \ | ||
320 | "dsll32 %L0, %L0, 0" "\n\t" \ | ||
321 | "dsrl32 %L0, %L0, 0" "\n\t" \ | ||
322 | "dsll32 %M0, %M0, 0" "\n\t" \ | ||
323 | "or %L0, %L0, %M0" "\n\t" \ | ||
324 | "sd %L0, %2" "\n\t" \ | ||
325 | ".set mips0" "\n" \ | ||
326 | : "=r" (__tmp) \ | ||
327 | : "0" (__val), "m" (*__mem)); \ | ||
328 | if (irq) \ | ||
329 | local_irq_restore(__flags); \ | ||
330 | } else \ | ||
331 | BUG(); \ | ||
332 | } \ | ||
333 | \ | ||
334 | static inline type pfx##read##bwlq(const volatile void __iomem *mem) \ | ||
335 | { \ | ||
336 | volatile type *__mem; \ | ||
337 | type __val; \ | ||
338 | \ | ||
339 | __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \ | ||
340 | \ | ||
341 | if (sizeof(type) != sizeof(u64) || sizeof(u64) == sizeof(long)) \ | ||
342 | __val = *__mem; \ | ||
343 | else if (cpu_has_64bits) { \ | ||
344 | unsigned long __flags; \ | ||
345 | \ | ||
346 | if (irq) \ | ||
347 | local_irq_save(__flags); \ | ||
348 | __asm__ __volatile__( \ | ||
349 | ".set mips3" "\t\t# __readq" "\n\t" \ | ||
350 | "ld %L0, %1" "\n\t" \ | ||
351 | "dsra32 %M0, %L0, 0" "\n\t" \ | ||
352 | "sll %L0, %L0, 0" "\n\t" \ | ||
353 | ".set mips0" "\n" \ | ||
354 | : "=r" (__val) \ | ||
355 | : "m" (*__mem)); \ | ||
356 | if (irq) \ | ||
357 | local_irq_restore(__flags); \ | ||
358 | } else { \ | ||
359 | __val = 0; \ | ||
360 | BUG(); \ | ||
361 | } \ | ||
362 | \ | ||
363 | return pfx##ioswab##bwlq(__mem, __val); \ | ||
364 | } | ||
365 | |||
366 | #define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p, slow) \ | ||
367 | \ | ||
368 | static inline void pfx##out##bwlq##p(type val, unsigned long port) \ | ||
369 | { \ | ||
370 | volatile type *__addr; \ | ||
371 | type __val; \ | ||
372 | \ | ||
373 | __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \ | ||
374 | \ | ||
375 | __val = pfx##ioswab##bwlq(__addr, val); \ | ||
376 | \ | ||
377 | /* Really, we want this to be atomic */ \ | ||
378 | BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \ | ||
379 | \ | ||
380 | *__addr = __val; \ | ||
381 | slow; \ | ||
382 | } \ | ||
383 | \ | ||
384 | static inline type pfx##in##bwlq##p(unsigned long port) \ | ||
385 | { \ | ||
386 | volatile type *__addr; \ | ||
387 | type __val; \ | ||
388 | \ | ||
389 | __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \ | ||
390 | \ | ||
391 | BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \ | ||
392 | \ | ||
393 | __val = *__addr; \ | ||
394 | slow; \ | ||
395 | \ | ||
396 | return pfx##ioswab##bwlq(__addr, __val); \ | ||
397 | } | ||
398 | |||
399 | #define __BUILD_MEMORY_PFX(bus, bwlq, type) \ | ||
400 | \ | ||
401 | __BUILD_MEMORY_SINGLE(bus, bwlq, type, 1) | ||
402 | |||
403 | #define BUILDIO_MEM(bwlq, type) \ | ||
404 | \ | ||
405 | __BUILD_MEMORY_PFX(__raw_, bwlq, type) \ | ||
406 | __BUILD_MEMORY_PFX(, bwlq, type) \ | ||
407 | __BUILD_MEMORY_PFX(__mem_, bwlq, type) \ | ||
408 | |||
409 | BUILDIO_MEM(b, u8) | ||
410 | BUILDIO_MEM(w, u16) | ||
411 | BUILDIO_MEM(l, u32) | ||
412 | BUILDIO_MEM(q, u64) | ||
413 | |||
414 | #define __BUILD_IOPORT_PFX(bus, bwlq, type) \ | ||
415 | __BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \ | ||
416 | __BUILD_IOPORT_SINGLE(bus, bwlq, type, _p, SLOW_DOWN_IO) | ||
417 | |||
418 | #define BUILDIO_IOPORT(bwlq, type) \ | ||
419 | __BUILD_IOPORT_PFX(, bwlq, type) \ | ||
420 | __BUILD_IOPORT_PFX(__mem_, bwlq, type) | ||
421 | |||
422 | BUILDIO_IOPORT(b, u8) | ||
423 | BUILDIO_IOPORT(w, u16) | ||
424 | BUILDIO_IOPORT(l, u32) | ||
425 | #ifdef CONFIG_64BIT | ||
426 | BUILDIO_IOPORT(q, u64) | ||
427 | #endif | ||
428 | |||
429 | #define __BUILDIO(bwlq, type) \ | ||
430 | \ | ||
431 | __BUILD_MEMORY_SINGLE(____raw_, bwlq, type, 0) | ||
432 | |||
433 | __BUILDIO(q, u64) | ||
434 | |||
435 | #define readb_relaxed readb | ||
436 | #define readw_relaxed readw | ||
437 | #define readl_relaxed readl | ||
438 | #define readq_relaxed readq | ||
439 | |||
440 | /* | ||
441 | * Some code tests for these symbols | ||
442 | */ | ||
443 | #define readq readq | ||
444 | #define writeq writeq | ||
445 | |||
446 | #define __BUILD_MEMORY_STRING(bwlq, type) \ | ||
447 | \ | ||
448 | static inline void writes##bwlq(volatile void __iomem *mem, \ | ||
449 | const void *addr, unsigned int count) \ | ||
450 | { \ | ||
451 | const volatile type *__addr = addr; \ | ||
452 | \ | ||
453 | while (count--) { \ | ||
454 | __mem_write##bwlq(*__addr, mem); \ | ||
455 | __addr++; \ | ||
456 | } \ | ||
457 | } \ | ||
458 | \ | ||
459 | static inline void reads##bwlq(volatile void __iomem *mem, void *addr, \ | ||
460 | unsigned int count) \ | ||
461 | { \ | ||
462 | volatile type *__addr = addr; \ | ||
463 | \ | ||
464 | while (count--) { \ | ||
465 | *__addr = __mem_read##bwlq(mem); \ | ||
466 | __addr++; \ | ||
467 | } \ | ||
468 | } | ||
469 | |||
470 | #define __BUILD_IOPORT_STRING(bwlq, type) \ | ||
471 | \ | ||
472 | static inline void outs##bwlq(unsigned long port, const void *addr, \ | ||
473 | unsigned int count) \ | ||
474 | { \ | ||
475 | const volatile type *__addr = addr; \ | ||
476 | \ | ||
477 | while (count--) { \ | ||
478 | __mem_out##bwlq(*__addr, port); \ | ||
479 | __addr++; \ | ||
480 | } \ | ||
481 | } \ | ||
482 | \ | ||
483 | static inline void ins##bwlq(unsigned long port, void *addr, \ | ||
484 | unsigned int count) \ | ||
485 | { \ | ||
486 | volatile type *__addr = addr; \ | ||
487 | \ | ||
488 | while (count--) { \ | ||
489 | *__addr = __mem_in##bwlq(port); \ | ||
490 | __addr++; \ | ||
491 | } \ | ||
492 | } | ||
493 | |||
494 | #define BUILDSTRING(bwlq, type) \ | ||
495 | \ | ||
496 | __BUILD_MEMORY_STRING(bwlq, type) \ | ||
497 | __BUILD_IOPORT_STRING(bwlq, type) | ||
498 | |||
499 | BUILDSTRING(b, u8) | ||
500 | BUILDSTRING(w, u16) | ||
501 | BUILDSTRING(l, u32) | ||
502 | #ifdef CONFIG_64BIT | ||
503 | BUILDSTRING(q, u64) | ||
504 | #endif | ||
505 | |||
506 | |||
507 | /* Depends on MIPS II instruction set */ | ||
508 | #define mmiowb() asm volatile ("sync" ::: "memory") | ||
509 | |||
510 | static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) | ||
511 | { | ||
512 | memset((void __force *) addr, val, count); | ||
513 | } | ||
514 | static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count) | ||
515 | { | ||
516 | memcpy(dst, (void __force *) src, count); | ||
517 | } | ||
518 | static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count) | ||
519 | { | ||
520 | memcpy((void __force *) dst, src, count); | ||
521 | } | ||
522 | |||
523 | /* | ||
524 | * The caches on some architectures aren't dma-coherent and have need to | ||
525 | * handle this in software. There are three types of operations that | ||
526 | * can be applied to dma buffers. | ||
527 | * | ||
528 | * - dma_cache_wback_inv(start, size) makes caches and coherent by | ||
529 | * writing the content of the caches back to memory, if necessary. | ||
530 | * The function also invalidates the affected part of the caches as | ||
531 | * necessary before DMA transfers from outside to memory. | ||
532 | * - dma_cache_wback(start, size) makes caches and coherent by | ||
533 | * writing the content of the caches back to memory, if necessary. | ||
534 | * The function also invalidates the affected part of the caches as | ||
535 | * necessary before DMA transfers from outside to memory. | ||
536 | * - dma_cache_inv(start, size) invalidates the affected parts of the | ||
537 | * caches. Dirty lines of the caches may be written back or simply | ||
538 | * be discarded. This operation is necessary before dma operations | ||
539 | * to the memory. | ||
540 | * | ||
541 | * This API used to be exported; it now is for arch code internal use only. | ||
542 | */ | ||
543 | #ifdef CONFIG_DMA_NONCOHERENT | ||
544 | |||
545 | extern void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size); | ||
546 | extern void (*_dma_cache_wback)(unsigned long start, unsigned long size); | ||
547 | extern void (*_dma_cache_inv)(unsigned long start, unsigned long size); | ||
548 | |||
549 | #define dma_cache_wback_inv(start, size) _dma_cache_wback_inv(start, size) | ||
550 | #define dma_cache_wback(start, size) _dma_cache_wback(start, size) | ||
551 | #define dma_cache_inv(start, size) _dma_cache_inv(start, size) | ||
552 | |||
553 | #else /* Sane hardware */ | ||
554 | |||
555 | #define dma_cache_wback_inv(start,size) \ | ||
556 | do { (void) (start); (void) (size); } while (0) | ||
557 | #define dma_cache_wback(start,size) \ | ||
558 | do { (void) (start); (void) (size); } while (0) | ||
559 | #define dma_cache_inv(start,size) \ | ||
560 | do { (void) (start); (void) (size); } while (0) | ||
561 | |||
562 | #endif /* CONFIG_DMA_NONCOHERENT */ | ||
563 | |||
564 | /* | ||
565 | * Read a 32-bit register that requires a 64-bit read cycle on the bus. | ||
566 | * Avoid interrupt mucking, just adjust the address for 4-byte access. | ||
567 | * Assume the addresses are 8-byte aligned. | ||
568 | */ | ||
569 | #ifdef __MIPSEB__ | ||
570 | #define __CSR_32_ADJUST 4 | ||
571 | #else | ||
572 | #define __CSR_32_ADJUST 0 | ||
573 | #endif | ||
574 | |||
575 | #define csr_out32(v, a) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST) = (v)) | ||
576 | #define csr_in32(a) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST)) | ||
577 | |||
578 | /* | ||
579 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | ||
580 | * access | ||
581 | */ | ||
582 | #define xlate_dev_mem_ptr(p) __va(p) | ||
583 | |||
584 | /* | ||
585 | * Convert a virtual cached pointer to an uncached pointer | ||
586 | */ | ||
587 | #define xlate_dev_kmem_ptr(p) p | ||
588 | |||
589 | #endif /* _ASM_IO_H */ | ||
diff --git a/include/asm-mips/ioctl.h b/include/asm-mips/ioctl.h deleted file mode 100644 index 85067e248a83..000000000000 --- a/include/asm-mips/ioctl.h +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 96, 99, 2001 Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_IOCTL_H | ||
9 | #define _ASM_IOCTL_H | ||
10 | |||
11 | /* | ||
12 | * The original linux ioctl numbering scheme was just a general | ||
13 | * "anything goes" setup, where more or less random numbers were | ||
14 | * assigned. Sorry, I was clueless when I started out on this. | ||
15 | * | ||
16 | * On the alpha, we'll try to clean it up a bit, using a more sane | ||
17 | * ioctl numbering, and also trying to be compatible with OSF/1 in | ||
18 | * the process. I'd like to clean it up for the i386 as well, but | ||
19 | * it's so painful recognizing both the new and the old numbers.. | ||
20 | * | ||
21 | * The same applies for for the MIPS ABI; in fact even the macros | ||
22 | * from Linux/Alpha fit almost perfectly. | ||
23 | */ | ||
24 | |||
25 | #define _IOC_NRBITS 8 | ||
26 | #define _IOC_TYPEBITS 8 | ||
27 | #define _IOC_SIZEBITS 13 | ||
28 | #define _IOC_DIRBITS 3 | ||
29 | |||
30 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
31 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
32 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
33 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
34 | |||
35 | #define _IOC_NRSHIFT 0 | ||
36 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
37 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
38 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
39 | |||
40 | /* | ||
41 | * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit. | ||
42 | * And this turns out useful to catch old ioctl numbers in header | ||
43 | * files for us. | ||
44 | */ | ||
45 | #define _IOC_NONE 1U | ||
46 | #define _IOC_READ 2U | ||
47 | #define _IOC_WRITE 4U | ||
48 | |||
49 | /* | ||
50 | * The following are included for compatibility | ||
51 | */ | ||
52 | #define _IOC_VOID 0x20000000 | ||
53 | #define _IOC_OUT 0x40000000 | ||
54 | #define _IOC_IN 0x80000000 | ||
55 | #define _IOC_INOUT (IOC_IN|IOC_OUT) | ||
56 | |||
57 | #define _IOC(dir, type, nr, size) \ | ||
58 | (((dir) << _IOC_DIRSHIFT) | \ | ||
59 | ((type) << _IOC_TYPESHIFT) | \ | ||
60 | ((nr) << _IOC_NRSHIFT) | \ | ||
61 | ((size) << _IOC_SIZESHIFT)) | ||
62 | |||
63 | /* provoke compile error for invalid uses of size argument */ | ||
64 | extern unsigned int __invalid_size_argument_for_IOC; | ||
65 | #define _IOC_TYPECHECK(t) \ | ||
66 | ((sizeof(t) == sizeof(t[1]) && \ | ||
67 | sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ | ||
68 | sizeof(t) : __invalid_size_argument_for_IOC) | ||
69 | |||
70 | /* used to create numbers */ | ||
71 | #define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0) | ||
72 | #define _IOR(type, nr, size) _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size))) | ||
73 | #define _IOW(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size))) | ||
74 | #define _IOWR(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size))) | ||
75 | #define _IOR_BAD(type, nr, size) _IOC(_IOC_READ, (type), (nr), sizeof(size)) | ||
76 | #define _IOW_BAD(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), sizeof(size)) | ||
77 | #define _IOWR_BAD(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, (type), (nr), sizeof(size)) | ||
78 | |||
79 | |||
80 | /* used to decode them.. */ | ||
81 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
82 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
83 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
84 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
85 | |||
86 | /* ...and for the drivers/sound files... */ | ||
87 | |||
88 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
89 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
90 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
91 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
92 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
93 | |||
94 | #endif /* _ASM_IOCTL_H */ | ||
diff --git a/include/asm-mips/ioctls.h b/include/asm-mips/ioctls.h deleted file mode 100644 index 3f04a995ec54..000000000000 --- a/include/asm-mips/ioctls.h +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 1996, 2001 Ralf Baechle | ||
7 | * Copyright (C) 2001 MIPS Technologies, Inc. | ||
8 | */ | ||
9 | #ifndef __ASM_IOCTLS_H | ||
10 | #define __ASM_IOCTLS_H | ||
11 | |||
12 | #include <asm/ioctl.h> | ||
13 | |||
14 | #define TCGETA 0x5401 | ||
15 | #define TCSETA 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */ | ||
16 | #define TCSETAW 0x5403 | ||
17 | #define TCSETAF 0x5404 | ||
18 | |||
19 | #define TCSBRK 0x5405 | ||
20 | #define TCXONC 0x5406 | ||
21 | #define TCFLSH 0x5407 | ||
22 | |||
23 | #define TCGETS 0x540d | ||
24 | #define TCSETS 0x540e | ||
25 | #define TCSETSW 0x540f | ||
26 | #define TCSETSF 0x5410 | ||
27 | |||
28 | #define TIOCEXCL 0x740d /* set exclusive use of tty */ | ||
29 | #define TIOCNXCL 0x740e /* reset exclusive use of tty */ | ||
30 | #define TIOCOUTQ 0x7472 /* output queue size */ | ||
31 | #define TIOCSTI 0x5472 /* simulate terminal input */ | ||
32 | #define TIOCMGET 0x741d /* get all modem bits */ | ||
33 | #define TIOCMBIS 0x741b /* bis modem bits */ | ||
34 | #define TIOCMBIC 0x741c /* bic modem bits */ | ||
35 | #define TIOCMSET 0x741a /* set all modem bits */ | ||
36 | #define TIOCPKT 0x5470 /* pty: set/clear packet mode */ | ||
37 | #define TIOCPKT_DATA 0x00 /* data packet */ | ||
38 | #define TIOCPKT_FLUSHREAD 0x01 /* flush packet */ | ||
39 | #define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */ | ||
40 | #define TIOCPKT_STOP 0x04 /* stop output */ | ||
41 | #define TIOCPKT_START 0x08 /* start output */ | ||
42 | #define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */ | ||
43 | #define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */ | ||
44 | /* #define TIOCPKT_IOCTL 0x40 state change of pty driver */ | ||
45 | #define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */ | ||
46 | #define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */ | ||
47 | #define TIOCNOTTY 0x5471 /* void tty association */ | ||
48 | #define TIOCSETD 0x7401 | ||
49 | #define TIOCGETD 0x7400 | ||
50 | |||
51 | #define FIOCLEX 0x6601 | ||
52 | #define FIONCLEX 0x6602 | ||
53 | #define FIOASYNC 0x667d | ||
54 | #define FIONBIO 0x667e | ||
55 | #define FIOQSIZE 0x667f | ||
56 | |||
57 | #define TIOCGLTC 0x7474 /* get special local chars */ | ||
58 | #define TIOCSLTC 0x7475 /* set special local chars */ | ||
59 | #define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */ | ||
60 | #define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */ | ||
61 | #define TIOCCONS _IOW('t', 120, int) /* become virtual console */ | ||
62 | |||
63 | #define FIONREAD 0x467f | ||
64 | #define TIOCINQ FIONREAD | ||
65 | |||
66 | #define TIOCGETP 0x7408 | ||
67 | #define TIOCSETP 0x7409 | ||
68 | #define TIOCSETN 0x740a /* TIOCSETP wo flush */ | ||
69 | |||
70 | /* #define TIOCSETA _IOW('t', 20, struct termios) set termios struct */ | ||
71 | /* #define TIOCSETAW _IOW('t', 21, struct termios) drain output, set */ | ||
72 | /* #define TIOCSETAF _IOW('t', 22, struct termios) drn out, fls in, set */ | ||
73 | /* #define TIOCGETD _IOR('t', 26, int) get line discipline */ | ||
74 | /* #define TIOCSETD _IOW('t', 27, int) set line discipline */ | ||
75 | /* 127-124 compat */ | ||
76 | |||
77 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | ||
78 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | ||
79 | #define TIOCGSID 0x7416 /* Return the session ID of FD */ | ||
80 | #define TCGETS2 _IOR('T', 0x2A, struct termios2) | ||
81 | #define TCSETS2 _IOW('T', 0x2B, struct termios2) | ||
82 | #define TCSETSW2 _IOW('T', 0x2C, struct termios2) | ||
83 | #define TCSETSF2 _IOW('T', 0x2D, struct termios2) | ||
84 | #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | ||
85 | #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ | ||
86 | |||
87 | /* I hope the range from 0x5480 on is free ... */ | ||
88 | #define TIOCSCTTY 0x5480 /* become controlling tty */ | ||
89 | #define TIOCGSOFTCAR 0x5481 | ||
90 | #define TIOCSSOFTCAR 0x5482 | ||
91 | #define TIOCLINUX 0x5483 | ||
92 | #define TIOCGSERIAL 0x5484 | ||
93 | #define TIOCSSERIAL 0x5485 | ||
94 | #define TCSBRKP 0x5486 /* Needed for POSIX tcsendbreak() */ | ||
95 | #define TIOCSERCONFIG 0x5488 | ||
96 | #define TIOCSERGWILD 0x5489 | ||
97 | #define TIOCSERSWILD 0x548a | ||
98 | #define TIOCGLCKTRMIOS 0x548b | ||
99 | #define TIOCSLCKTRMIOS 0x548c | ||
100 | #define TIOCSERGSTRUCT 0x548d /* For debugging only */ | ||
101 | #define TIOCSERGETLSR 0x548e /* Get line status register */ | ||
102 | #define TIOCSERGETMULTI 0x548f /* Get multiport config */ | ||
103 | #define TIOCSERSETMULTI 0x5490 /* Set multiport config */ | ||
104 | #define TIOCMIWAIT 0x5491 /* wait for a change on serial input line(s) */ | ||
105 | #define TIOCGICOUNT 0x5492 /* read serial port inline interrupt counts */ | ||
106 | #define TIOCGHAYESESP 0x5493 /* Get Hayes ESP configuration */ | ||
107 | #define TIOCSHAYESESP 0x5494 /* Set Hayes ESP configuration */ | ||
108 | |||
109 | #endif /* __ASM_IOCTLS_H */ | ||
diff --git a/include/asm-mips/ip32/crime.h b/include/asm-mips/ip32/crime.h deleted file mode 100644 index 7c36b0e5b1c6..000000000000 --- a/include/asm-mips/ip32/crime.h +++ /dev/null | |||
@@ -1,158 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for the SGI CRIME (CPU, Rendering, Interconnect and Memory | ||
3 | * Engine) | ||
4 | * | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * Copyright (C) 2000 Harald Koerfgen | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASM_CRIME_H__ | ||
13 | #define __ASM_CRIME_H__ | ||
14 | |||
15 | /* | ||
16 | * Address map | ||
17 | */ | ||
18 | #define CRIME_BASE 0x14000000 /* physical */ | ||
19 | |||
20 | struct sgi_crime { | ||
21 | volatile unsigned long id; | ||
22 | #define CRIME_ID_MASK 0xff | ||
23 | #define CRIME_ID_IDBITS 0xf0 | ||
24 | #define CRIME_ID_IDVALUE 0xa0 | ||
25 | #define CRIME_ID_REV 0x0f | ||
26 | #define CRIME_REV_PETTY 0x00 | ||
27 | #define CRIME_REV_11 0x11 | ||
28 | #define CRIME_REV_13 0x13 | ||
29 | #define CRIME_REV_14 0x14 | ||
30 | |||
31 | volatile unsigned long control; | ||
32 | #define CRIME_CONTROL_MASK 0x3fff | ||
33 | #define CRIME_CONTROL_TRITON_SYSADC 0x2000 | ||
34 | #define CRIME_CONTROL_CRIME_SYSADC 0x1000 | ||
35 | #define CRIME_CONTROL_HARD_RESET 0x0800 | ||
36 | #define CRIME_CONTROL_SOFT_RESET 0x0400 | ||
37 | #define CRIME_CONTROL_DOG_ENA 0x0200 | ||
38 | #define CRIME_CONTROL_ENDIANESS 0x0100 | ||
39 | #define CRIME_CONTROL_ENDIAN_BIG 0x0100 | ||
40 | #define CRIME_CONTROL_ENDIAN_LITTLE 0x0000 | ||
41 | #define CRIME_CONTROL_CQUEUE_HWM 0x000f | ||
42 | #define CRIME_CONTROL_CQUEUE_SHFT 0 | ||
43 | #define CRIME_CONTROL_WBUF_HWM 0x00f0 | ||
44 | #define CRIME_CONTROL_WBUF_SHFT 8 | ||
45 | |||
46 | volatile unsigned long istat; | ||
47 | volatile unsigned long imask; | ||
48 | volatile unsigned long soft_int; | ||
49 | volatile unsigned long hard_int; | ||
50 | #define MACE_VID_IN1_INT BIT(0) | ||
51 | #define MACE_VID_IN2_INT BIT(1) | ||
52 | #define MACE_VID_OUT_INT BIT(2) | ||
53 | #define MACE_ETHERNET_INT BIT(3) | ||
54 | #define MACE_SUPERIO_INT BIT(4) | ||
55 | #define MACE_MISC_INT BIT(5) | ||
56 | #define MACE_AUDIO_INT BIT(6) | ||
57 | #define MACE_PCI_BRIDGE_INT BIT(7) | ||
58 | #define MACEPCI_SCSI0_INT BIT(8) | ||
59 | #define MACEPCI_SCSI1_INT BIT(9) | ||
60 | #define MACEPCI_SLOT0_INT BIT(10) | ||
61 | #define MACEPCI_SLOT1_INT BIT(11) | ||
62 | #define MACEPCI_SLOT2_INT BIT(12) | ||
63 | #define MACEPCI_SHARED0_INT BIT(13) | ||
64 | #define MACEPCI_SHARED1_INT BIT(14) | ||
65 | #define MACEPCI_SHARED2_INT BIT(15) | ||
66 | #define CRIME_GBE0_INT BIT(16) | ||
67 | #define CRIME_GBE1_INT BIT(17) | ||
68 | #define CRIME_GBE2_INT BIT(18) | ||
69 | #define CRIME_GBE3_INT BIT(19) | ||
70 | #define CRIME_CPUERR_INT BIT(20) | ||
71 | #define CRIME_MEMERR_INT BIT(21) | ||
72 | #define CRIME_RE_EMPTY_E_INT BIT(22) | ||
73 | #define CRIME_RE_FULL_E_INT BIT(23) | ||
74 | #define CRIME_RE_IDLE_E_INT BIT(24) | ||
75 | #define CRIME_RE_EMPTY_L_INT BIT(25) | ||
76 | #define CRIME_RE_FULL_L_INT BIT(26) | ||
77 | #define CRIME_RE_IDLE_L_INT BIT(27) | ||
78 | #define CRIME_SOFT0_INT BIT(28) | ||
79 | #define CRIME_SOFT1_INT BIT(29) | ||
80 | #define CRIME_SOFT2_INT BIT(30) | ||
81 | #define CRIME_SYSCORERR_INT CRIME_SOFT2_INT | ||
82 | #define CRIME_VICE_INT BIT(31) | ||
83 | /* Masks for deciding who handles the interrupt */ | ||
84 | #define CRIME_MACE_INT_MASK 0x8f | ||
85 | #define CRIME_MACEISA_INT_MASK 0x70 | ||
86 | #define CRIME_MACEPCI_INT_MASK 0xff00 | ||
87 | #define CRIME_CRIME_INT_MASK 0xffff0000 | ||
88 | |||
89 | volatile unsigned long watchdog; | ||
90 | #define CRIME_DOG_POWER_ON_RESET 0x00010000 | ||
91 | #define CRIME_DOG_WARM_RESET 0x00080000 | ||
92 | #define CRIME_DOG_TIMEOUT (CRIME_DOG_POWER_ON_RESET|CRIME_DOG_WARM_RESET) | ||
93 | #define CRIME_DOG_VALUE 0x00007fff | ||
94 | |||
95 | volatile unsigned long timer; | ||
96 | #define CRIME_MASTER_FREQ 66666500 /* Crime upcounter frequency */ | ||
97 | #define CRIME_NS_PER_TICK 15 /* for delay_calibrate */ | ||
98 | |||
99 | volatile unsigned long cpu_error_addr; | ||
100 | #define CRIME_CPU_ERROR_ADDR_MASK 0x3ffffffff | ||
101 | |||
102 | volatile unsigned long cpu_error_stat; | ||
103 | #define CRIME_CPU_ERROR_MASK 0x7 /* cpu error stat is 3 bits */ | ||
104 | #define CRIME_CPU_ERROR_CPU_ILL_ADDR 0x4 | ||
105 | #define CRIME_CPU_ERROR_VICE_WRT_PRTY 0x2 | ||
106 | #define CRIME_CPU_ERROR_CPU_WRT_PRTY 0x1 | ||
107 | |||
108 | unsigned long _pad0[54]; | ||
109 | |||
110 | volatile unsigned long mc_ctrl; | ||
111 | volatile unsigned long bank_ctrl[8]; | ||
112 | #define CRIME_MEM_BANK_CONTROL_MASK 0x11f /* 9 bits 7:5 reserved */ | ||
113 | #define CRIME_MEM_BANK_CONTROL_ADDR 0x01f | ||
114 | #define CRIME_MEM_BANK_CONTROL_SDRAM_SIZE 0x100 | ||
115 | #define CRIME_MAXBANKS 8 | ||
116 | |||
117 | volatile unsigned long mem_ref_counter; | ||
118 | #define CRIME_MEM_REF_COUNTER_MASK 0x3ff /* 10bit */ | ||
119 | |||
120 | volatile unsigned long mem_error_stat; | ||
121 | #define CRIME_MEM_ERROR_STAT_MASK 0x0ff7ffff /* 28-bit register */ | ||
122 | #define CRIME_MEM_ERROR_MACE_ID 0x0000007f | ||
123 | #define CRIME_MEM_ERROR_MACE_ACCESS 0x00000080 | ||
124 | #define CRIME_MEM_ERROR_RE_ID 0x00007f00 | ||
125 | #define CRIME_MEM_ERROR_RE_ACCESS 0x00008000 | ||
126 | #define CRIME_MEM_ERROR_GBE_ACCESS 0x00010000 | ||
127 | #define CRIME_MEM_ERROR_VICE_ACCESS 0x00020000 | ||
128 | #define CRIME_MEM_ERROR_CPU_ACCESS 0x00040000 | ||
129 | #define CRIME_MEM_ERROR_RESERVED 0x00080000 | ||
130 | #define CRIME_MEM_ERROR_SOFT_ERR 0x00100000 | ||
131 | #define CRIME_MEM_ERROR_HARD_ERR 0x00200000 | ||
132 | #define CRIME_MEM_ERROR_MULTIPLE 0x00400000 | ||
133 | #define CRIME_MEM_ERROR_ECC 0x01800000 | ||
134 | #define CRIME_MEM_ERROR_MEM_ECC_RD 0x00800000 | ||
135 | #define CRIME_MEM_ERROR_MEM_ECC_RMW 0x01000000 | ||
136 | #define CRIME_MEM_ERROR_INV 0x0e000000 | ||
137 | #define CRIME_MEM_ERROR_INV_MEM_ADDR_RD 0x02000000 | ||
138 | #define CRIME_MEM_ERROR_INV_MEM_ADDR_WR 0x04000000 | ||
139 | #define CRIME_MEM_ERROR_INV_MEM_ADDR_RMW 0x08000000 | ||
140 | |||
141 | volatile unsigned long mem_error_addr; | ||
142 | #define CRIME_MEM_ERROR_ADDR_MASK 0x3fffffff | ||
143 | |||
144 | volatile unsigned long mem_ecc_syn; | ||
145 | #define CRIME_MEM_ERROR_ECC_SYN_MASK 0xffffffff | ||
146 | |||
147 | volatile unsigned long mem_ecc_chk; | ||
148 | #define CRIME_MEM_ERROR_ECC_CHK_MASK 0xffffffff | ||
149 | |||
150 | volatile unsigned long mem_ecc_repl; | ||
151 | #define CRIME_MEM_ERROR_ECC_REPL_MASK 0xffffffff | ||
152 | }; | ||
153 | |||
154 | extern struct sgi_crime __iomem *crime; | ||
155 | |||
156 | #define CRIME_HI_MEM_BASE 0x40000000 /* this is where whole 1G of RAM is mapped */ | ||
157 | |||
158 | #endif /* __ASM_CRIME_H__ */ | ||
diff --git a/include/asm-mips/ip32/ip32_ints.h b/include/asm-mips/ip32/ip32_ints.h deleted file mode 100644 index 85bc5302bce0..000000000000 --- a/include/asm-mips/ip32/ip32_ints.h +++ /dev/null | |||
@@ -1,114 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000 Harald Koerfgen | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_IP32_INTS_H | ||
10 | #define __ASM_IP32_INTS_H | ||
11 | |||
12 | #include <asm/irq.h> | ||
13 | |||
14 | /* | ||
15 | * This list reflects the assignment of interrupt numbers to | ||
16 | * interrupting events. Order is fairly irrelevant to handling | ||
17 | * priority. This differs from irix. | ||
18 | */ | ||
19 | |||
20 | enum ip32_irq_no { | ||
21 | /* | ||
22 | * CPU interrupts are 0 ... 7 | ||
23 | */ | ||
24 | |||
25 | CRIME_IRQ_BASE = MIPS_CPU_IRQ_BASE + 8, | ||
26 | |||
27 | /* | ||
28 | * MACE | ||
29 | */ | ||
30 | MACE_VID_IN1_IRQ = CRIME_IRQ_BASE, | ||
31 | MACE_VID_IN2_IRQ, | ||
32 | MACE_VID_OUT_IRQ, | ||
33 | MACE_ETHERNET_IRQ, | ||
34 | /* SUPERIO, MISC, and AUDIO are MACEISA */ | ||
35 | __MACE_SUPERIO, | ||
36 | __MACE_MISC, | ||
37 | __MACE_AUDIO, | ||
38 | MACE_PCI_BRIDGE_IRQ, | ||
39 | |||
40 | /* | ||
41 | * MACEPCI | ||
42 | */ | ||
43 | MACEPCI_SCSI0_IRQ, | ||
44 | MACEPCI_SCSI1_IRQ, | ||
45 | MACEPCI_SLOT0_IRQ, | ||
46 | MACEPCI_SLOT1_IRQ, | ||
47 | MACEPCI_SLOT2_IRQ, | ||
48 | MACEPCI_SHARED0_IRQ, | ||
49 | MACEPCI_SHARED1_IRQ, | ||
50 | MACEPCI_SHARED2_IRQ, | ||
51 | |||
52 | /* | ||
53 | * CRIME | ||
54 | */ | ||
55 | CRIME_GBE0_IRQ, | ||
56 | CRIME_GBE1_IRQ, | ||
57 | CRIME_GBE2_IRQ, | ||
58 | CRIME_GBE3_IRQ, | ||
59 | CRIME_CPUERR_IRQ, | ||
60 | CRIME_MEMERR_IRQ, | ||
61 | CRIME_RE_EMPTY_E_IRQ, | ||
62 | CRIME_RE_FULL_E_IRQ, | ||
63 | CRIME_RE_IDLE_E_IRQ, | ||
64 | CRIME_RE_EMPTY_L_IRQ, | ||
65 | CRIME_RE_FULL_L_IRQ, | ||
66 | CRIME_RE_IDLE_L_IRQ, | ||
67 | CRIME_SOFT0_IRQ, | ||
68 | CRIME_SOFT1_IRQ, | ||
69 | CRIME_SOFT2_IRQ, | ||
70 | CRIME_SYSCORERR_IRQ = CRIME_SOFT2_IRQ, | ||
71 | CRIME_VICE_IRQ, | ||
72 | |||
73 | /* | ||
74 | * MACEISA | ||
75 | */ | ||
76 | MACEISA_AUDIO_SW_IRQ, | ||
77 | MACEISA_AUDIO_SC_IRQ, | ||
78 | MACEISA_AUDIO1_DMAT_IRQ, | ||
79 | MACEISA_AUDIO1_OF_IRQ, | ||
80 | MACEISA_AUDIO2_DMAT_IRQ, | ||
81 | MACEISA_AUDIO2_MERR_IRQ, | ||
82 | MACEISA_AUDIO3_DMAT_IRQ, | ||
83 | MACEISA_AUDIO3_MERR_IRQ, | ||
84 | MACEISA_RTC_IRQ, | ||
85 | MACEISA_KEYB_IRQ, | ||
86 | /* MACEISA_KEYB_POLL is not an IRQ */ | ||
87 | __MACEISA_KEYB_POLL, | ||
88 | MACEISA_MOUSE_IRQ, | ||
89 | /* MACEISA_MOUSE_POLL is not an IRQ */ | ||
90 | __MACEISA_MOUSE_POLL, | ||
91 | MACEISA_TIMER0_IRQ, | ||
92 | MACEISA_TIMER1_IRQ, | ||
93 | MACEISA_TIMER2_IRQ, | ||
94 | MACEISA_PARALLEL_IRQ, | ||
95 | MACEISA_PAR_CTXA_IRQ, | ||
96 | MACEISA_PAR_CTXB_IRQ, | ||
97 | MACEISA_PAR_MERR_IRQ, | ||
98 | MACEISA_SERIAL1_IRQ, | ||
99 | MACEISA_SERIAL1_TDMAT_IRQ, | ||
100 | MACEISA_SERIAL1_TDMAPR_IRQ, | ||
101 | MACEISA_SERIAL1_TDMAME_IRQ, | ||
102 | MACEISA_SERIAL1_RDMAT_IRQ, | ||
103 | MACEISA_SERIAL1_RDMAOR_IRQ, | ||
104 | MACEISA_SERIAL2_IRQ, | ||
105 | MACEISA_SERIAL2_TDMAT_IRQ, | ||
106 | MACEISA_SERIAL2_TDMAPR_IRQ, | ||
107 | MACEISA_SERIAL2_TDMAME_IRQ, | ||
108 | MACEISA_SERIAL2_RDMAT_IRQ, | ||
109 | MACEISA_SERIAL2_RDMAOR_IRQ, | ||
110 | |||
111 | IP32_IRQ_MAX = MACEISA_SERIAL2_RDMAOR_IRQ | ||
112 | }; | ||
113 | |||
114 | #endif /* __ASM_IP32_INTS_H */ | ||
diff --git a/include/asm-mips/ip32/mace.h b/include/asm-mips/ip32/mace.h deleted file mode 100644 index d08d7c672139..000000000000 --- a/include/asm-mips/ip32/mace.h +++ /dev/null | |||
@@ -1,365 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for the SGI MACE (Multimedia, Audio and Communications Engine) | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2000 Harald Koerfgen | ||
9 | * Copyright (C) 2004 Ladislav Michl | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASM_MACE_H__ | ||
13 | #define __ASM_MACE_H__ | ||
14 | |||
15 | /* | ||
16 | * Address map | ||
17 | */ | ||
18 | #define MACE_BASE 0x1f000000 /* physical */ | ||
19 | |||
20 | /* | ||
21 | * PCI interface | ||
22 | */ | ||
23 | struct mace_pci { | ||
24 | volatile unsigned int error_addr; | ||
25 | volatile unsigned int error; | ||
26 | #define MACEPCI_ERROR_MASTER_ABORT BIT(31) | ||
27 | #define MACEPCI_ERROR_TARGET_ABORT BIT(30) | ||
28 | #define MACEPCI_ERROR_DATA_PARITY_ERR BIT(29) | ||
29 | #define MACEPCI_ERROR_RETRY_ERR BIT(28) | ||
30 | #define MACEPCI_ERROR_ILLEGAL_CMD BIT(27) | ||
31 | #define MACEPCI_ERROR_SYSTEM_ERR BIT(26) | ||
32 | #define MACEPCI_ERROR_INTERRUPT_TEST BIT(25) | ||
33 | #define MACEPCI_ERROR_PARITY_ERR BIT(24) | ||
34 | #define MACEPCI_ERROR_OVERRUN BIT(23) | ||
35 | #define MACEPCI_ERROR_RSVD BIT(22) | ||
36 | #define MACEPCI_ERROR_MEMORY_ADDR BIT(21) | ||
37 | #define MACEPCI_ERROR_CONFIG_ADDR BIT(20) | ||
38 | #define MACEPCI_ERROR_MASTER_ABORT_ADDR_VALID BIT(19) | ||
39 | #define MACEPCI_ERROR_TARGET_ABORT_ADDR_VALID BIT(18) | ||
40 | #define MACEPCI_ERROR_DATA_PARITY_ADDR_VALID BIT(17) | ||
41 | #define MACEPCI_ERROR_RETRY_ADDR_VALID BIT(16) | ||
42 | #define MACEPCI_ERROR_SIG_TABORT BIT(4) | ||
43 | #define MACEPCI_ERROR_DEVSEL_MASK 0xc0 | ||
44 | #define MACEPCI_ERROR_DEVSEL_FAST 0 | ||
45 | #define MACEPCI_ERROR_DEVSEL_MED 0x40 | ||
46 | #define MACEPCI_ERROR_DEVSEL_SLOW 0x80 | ||
47 | #define MACEPCI_ERROR_FBB BIT(1) | ||
48 | #define MACEPCI_ERROR_66MHZ BIT(0) | ||
49 | volatile unsigned int control; | ||
50 | #define MACEPCI_CONTROL_INT(x) BIT(x) | ||
51 | #define MACEPCI_CONTROL_INT_MASK 0xff | ||
52 | #define MACEPCI_CONTROL_SERR_ENA BIT(8) | ||
53 | #define MACEPCI_CONTROL_ARB_N6 BIT(9) | ||
54 | #define MACEPCI_CONTROL_PARITY_ERR BIT(10) | ||
55 | #define MACEPCI_CONTROL_MRMRA_ENA BIT(11) | ||
56 | #define MACEPCI_CONTROL_ARB_N3 BIT(12) | ||
57 | #define MACEPCI_CONTROL_ARB_N4 BIT(13) | ||
58 | #define MACEPCI_CONTROL_ARB_N5 BIT(14) | ||
59 | #define MACEPCI_CONTROL_PARK_LIU BIT(15) | ||
60 | #define MACEPCI_CONTROL_INV_INT(x) BIT(16+x) | ||
61 | #define MACEPCI_CONTROL_INV_INT_MASK 0x00ff0000 | ||
62 | #define MACEPCI_CONTROL_OVERRUN_INT BIT(24) | ||
63 | #define MACEPCI_CONTROL_PARITY_INT BIT(25) | ||
64 | #define MACEPCI_CONTROL_SERR_INT BIT(26) | ||
65 | #define MACEPCI_CONTROL_IT_INT BIT(27) | ||
66 | #define MACEPCI_CONTROL_RE_INT BIT(28) | ||
67 | #define MACEPCI_CONTROL_DPED_INT BIT(29) | ||
68 | #define MACEPCI_CONTROL_TAR_INT BIT(30) | ||
69 | #define MACEPCI_CONTROL_MAR_INT BIT(31) | ||
70 | volatile unsigned int rev; | ||
71 | unsigned int _pad[0xcf8/4 - 4]; | ||
72 | volatile unsigned int config_addr; | ||
73 | union { | ||
74 | volatile unsigned char b[4]; | ||
75 | volatile unsigned short w[2]; | ||
76 | volatile unsigned int l; | ||
77 | } config_data; | ||
78 | }; | ||
79 | #define MACEPCI_LOW_MEMORY 0x1a000000 | ||
80 | #define MACEPCI_LOW_IO 0x18000000 | ||
81 | #define MACEPCI_SWAPPED_VIEW 0 | ||
82 | #define MACEPCI_NATIVE_VIEW 0x40000000 | ||
83 | #define MACEPCI_IO 0x80000000 | ||
84 | #define MACEPCI_HI_MEMORY 0x280000000 | ||
85 | #define MACEPCI_HI_IO 0x100000000 | ||
86 | |||
87 | /* | ||
88 | * Video interface | ||
89 | */ | ||
90 | struct mace_video { | ||
91 | unsigned long xxx; /* later... */ | ||
92 | }; | ||
93 | |||
94 | /* | ||
95 | * Ethernet interface | ||
96 | */ | ||
97 | struct mace_ethernet { | ||
98 | volatile unsigned long mac_ctrl; | ||
99 | volatile unsigned long int_stat; | ||
100 | volatile unsigned long dma_ctrl; | ||
101 | volatile unsigned long timer; | ||
102 | volatile unsigned long tx_int_al; | ||
103 | volatile unsigned long rx_int_al; | ||
104 | volatile unsigned long tx_info; | ||
105 | volatile unsigned long tx_info_al; | ||
106 | volatile unsigned long rx_buff; | ||
107 | volatile unsigned long rx_buff_al1; | ||
108 | volatile unsigned long rx_buff_al2; | ||
109 | volatile unsigned long diag; | ||
110 | volatile unsigned long phy_data; | ||
111 | volatile unsigned long phy_regs; | ||
112 | volatile unsigned long phy_trans_go; | ||
113 | volatile unsigned long backoff_seed; | ||
114 | /*===================================*/ | ||
115 | volatile unsigned long imq_reserved[4]; | ||
116 | volatile unsigned long mac_addr; | ||
117 | volatile unsigned long mac_addr2; | ||
118 | volatile unsigned long mcast_filter; | ||
119 | volatile unsigned long tx_ring_base; | ||
120 | /* Following are read-only registers for debugging */ | ||
121 | volatile unsigned long tx_pkt1_hdr; | ||
122 | volatile unsigned long tx_pkt1_ptr[3]; | ||
123 | volatile unsigned long tx_pkt2_hdr; | ||
124 | volatile unsigned long tx_pkt2_ptr[3]; | ||
125 | /*===================================*/ | ||
126 | volatile unsigned long rx_fifo; | ||
127 | }; | ||
128 | |||
129 | /* | ||
130 | * Peripherals | ||
131 | */ | ||
132 | |||
133 | /* Audio registers */ | ||
134 | struct mace_audio { | ||
135 | volatile unsigned long control; | ||
136 | volatile unsigned long codec_control; /* codec status control */ | ||
137 | volatile unsigned long codec_mask; /* codec status input mask */ | ||
138 | volatile unsigned long codec_read; /* codec status read data */ | ||
139 | struct { | ||
140 | volatile unsigned long control; /* channel control */ | ||
141 | volatile unsigned long read_ptr; /* channel read pointer */ | ||
142 | volatile unsigned long write_ptr; /* channel write pointer */ | ||
143 | volatile unsigned long depth; /* channel depth */ | ||
144 | } chan[3]; | ||
145 | }; | ||
146 | |||
147 | |||
148 | /* register definitions for parallel port DMA */ | ||
149 | struct mace_parport { | ||
150 | /* 0 - do nothing, | ||
151 | * 1 - pulse terminal count to the device after buffer is drained */ | ||
152 | #define MACEPAR_CONTEXT_LASTFLAG BIT(63) | ||
153 | /* Should not cross 4K page boundary */ | ||
154 | #define MACEPAR_CONTEXT_DATA_BOUND 0x0000000000001000UL | ||
155 | #define MACEPAR_CONTEXT_DATALEN_MASK 0x00000fff00000000UL | ||
156 | #define MACEPAR_CONTEXT_DATALEN_SHIFT 32 | ||
157 | /* Can be arbitrarily aligned on any byte boundary on output, | ||
158 | * 64 byte aligned on input */ | ||
159 | #define MACEPAR_CONTEXT_BASEADDR_MASK 0x00000000ffffffffUL | ||
160 | volatile u64 context_a; | ||
161 | volatile u64 context_b; | ||
162 | /* 0 - mem->device, 1 - device->mem */ | ||
163 | #define MACEPAR_CTLSTAT_DIRECTION BIT(0) | ||
164 | /* 0 - channel frozen, 1 - channel enabled */ | ||
165 | #define MACEPAR_CTLSTAT_ENABLE BIT(1) | ||
166 | /* 0 - channel active, 1 - complete channel reset */ | ||
167 | #define MACEPAR_CTLSTAT_RESET BIT(2) | ||
168 | #define MACEPAR_CTLSTAT_CTXB_VALID BIT(3) | ||
169 | #define MACEPAR_CTLSTAT_CTXA_VALID BIT(4) | ||
170 | volatile u64 cntlstat; /* Control/Status register */ | ||
171 | #define MACEPAR_DIAG_CTXINUSE BIT(0) | ||
172 | /* 1 - Dma engine is enabled and processing something */ | ||
173 | #define MACEPAR_DIAG_DMACTIVE BIT(1) | ||
174 | /* Counter of bytes left */ | ||
175 | #define MACEPAR_DIAG_CTRMASK 0x0000000000003ffcUL | ||
176 | #define MACEPAR_DIAG_CTRSHIFT 2 | ||
177 | volatile u64 diagnostic; /* RO: diagnostic register */ | ||
178 | }; | ||
179 | |||
180 | /* ISA Control and DMA registers */ | ||
181 | struct mace_isactrl { | ||
182 | volatile unsigned long ringbase; | ||
183 | #define MACEISA_RINGBUFFERS_SIZE (8 * 4096) | ||
184 | |||
185 | volatile unsigned long misc; | ||
186 | #define MACEISA_FLASH_WE BIT(0) /* 1=> Enable FLASH writes */ | ||
187 | #define MACEISA_PWD_CLEAR BIT(1) /* 1=> PWD CLEAR jumper detected */ | ||
188 | #define MACEISA_NIC_DEASSERT BIT(2) | ||
189 | #define MACEISA_NIC_DATA BIT(3) | ||
190 | #define MACEISA_LED_RED BIT(4) /* 0=> Illuminate red LED */ | ||
191 | #define MACEISA_LED_GREEN BIT(5) /* 0=> Illuminate green LED */ | ||
192 | #define MACEISA_DP_RAM_ENABLE BIT(6) | ||
193 | |||
194 | volatile unsigned long istat; | ||
195 | volatile unsigned long imask; | ||
196 | #define MACEISA_AUDIO_SW_INT BIT(0) | ||
197 | #define MACEISA_AUDIO_SC_INT BIT(1) | ||
198 | #define MACEISA_AUDIO1_DMAT_INT BIT(2) | ||
199 | #define MACEISA_AUDIO1_OF_INT BIT(3) | ||
200 | #define MACEISA_AUDIO2_DMAT_INT BIT(4) | ||
201 | #define MACEISA_AUDIO2_MERR_INT BIT(5) | ||
202 | #define MACEISA_AUDIO3_DMAT_INT BIT(6) | ||
203 | #define MACEISA_AUDIO3_MERR_INT BIT(7) | ||
204 | #define MACEISA_RTC_INT BIT(8) | ||
205 | #define MACEISA_KEYB_INT BIT(9) | ||
206 | #define MACEISA_KEYB_POLL_INT BIT(10) | ||
207 | #define MACEISA_MOUSE_INT BIT(11) | ||
208 | #define MACEISA_MOUSE_POLL_INT BIT(12) | ||
209 | #define MACEISA_TIMER0_INT BIT(13) | ||
210 | #define MACEISA_TIMER1_INT BIT(14) | ||
211 | #define MACEISA_TIMER2_INT BIT(15) | ||
212 | #define MACEISA_PARALLEL_INT BIT(16) | ||
213 | #define MACEISA_PAR_CTXA_INT BIT(17) | ||
214 | #define MACEISA_PAR_CTXB_INT BIT(18) | ||
215 | #define MACEISA_PAR_MERR_INT BIT(19) | ||
216 | #define MACEISA_SERIAL1_INT BIT(20) | ||
217 | #define MACEISA_SERIAL1_TDMAT_INT BIT(21) | ||
218 | #define MACEISA_SERIAL1_TDMAPR_INT BIT(22) | ||
219 | #define MACEISA_SERIAL1_TDMAME_INT BIT(23) | ||
220 | #define MACEISA_SERIAL1_RDMAT_INT BIT(24) | ||
221 | #define MACEISA_SERIAL1_RDMAOR_INT BIT(25) | ||
222 | #define MACEISA_SERIAL2_INT BIT(26) | ||
223 | #define MACEISA_SERIAL2_TDMAT_INT BIT(27) | ||
224 | #define MACEISA_SERIAL2_TDMAPR_INT BIT(28) | ||
225 | #define MACEISA_SERIAL2_TDMAME_INT BIT(29) | ||
226 | #define MACEISA_SERIAL2_RDMAT_INT BIT(30) | ||
227 | #define MACEISA_SERIAL2_RDMAOR_INT BIT(31) | ||
228 | |||
229 | volatile unsigned long _pad[0x2000/8 - 4]; | ||
230 | |||
231 | volatile unsigned long dp_ram[0x400]; | ||
232 | struct mace_parport parport; | ||
233 | }; | ||
234 | |||
235 | /* Keyboard & Mouse registers | ||
236 | * -> drivers/input/serio/maceps2.c */ | ||
237 | struct mace_ps2port { | ||
238 | volatile unsigned long tx; | ||
239 | volatile unsigned long rx; | ||
240 | volatile unsigned long control; | ||
241 | volatile unsigned long status; | ||
242 | }; | ||
243 | |||
244 | struct mace_ps2 { | ||
245 | struct mace_ps2port keyb; | ||
246 | struct mace_ps2port mouse; | ||
247 | }; | ||
248 | |||
249 | /* I2C registers | ||
250 | * -> drivers/i2c/algos/i2c-algo-sgi.c */ | ||
251 | struct mace_i2c { | ||
252 | volatile unsigned long config; | ||
253 | #define MACEI2C_RESET BIT(0) | ||
254 | #define MACEI2C_FAST BIT(1) | ||
255 | #define MACEI2C_DATA_OVERRIDE BIT(2) | ||
256 | #define MACEI2C_CLOCK_OVERRIDE BIT(3) | ||
257 | #define MACEI2C_DATA_STATUS BIT(4) | ||
258 | #define MACEI2C_CLOCK_STATUS BIT(5) | ||
259 | volatile unsigned long control; | ||
260 | volatile unsigned long data; | ||
261 | }; | ||
262 | |||
263 | /* Timer registers */ | ||
264 | typedef union { | ||
265 | volatile unsigned long ust_msc; | ||
266 | struct reg { | ||
267 | volatile unsigned int ust; | ||
268 | volatile unsigned int msc; | ||
269 | } reg; | ||
270 | } timer_reg; | ||
271 | |||
272 | struct mace_timers { | ||
273 | volatile unsigned long ust; | ||
274 | #define MACE_UST_PERIOD_NS 960 | ||
275 | |||
276 | volatile unsigned long compare1; | ||
277 | volatile unsigned long compare2; | ||
278 | volatile unsigned long compare3; | ||
279 | |||
280 | timer_reg audio_in; | ||
281 | timer_reg audio_out1; | ||
282 | timer_reg audio_out2; | ||
283 | timer_reg video_in1; | ||
284 | timer_reg video_in2; | ||
285 | timer_reg video_out; | ||
286 | }; | ||
287 | |||
288 | struct mace_perif { | ||
289 | struct mace_audio audio; | ||
290 | char _pad0[0x10000 - sizeof(struct mace_audio)]; | ||
291 | |||
292 | struct mace_isactrl ctrl; | ||
293 | char _pad1[0x10000 - sizeof(struct mace_isactrl)]; | ||
294 | |||
295 | struct mace_ps2 ps2; | ||
296 | char _pad2[0x10000 - sizeof(struct mace_ps2)]; | ||
297 | |||
298 | struct mace_i2c i2c; | ||
299 | char _pad3[0x10000 - sizeof(struct mace_i2c)]; | ||
300 | |||
301 | struct mace_timers timers; | ||
302 | char _pad4[0x10000 - sizeof(struct mace_timers)]; | ||
303 | }; | ||
304 | |||
305 | |||
306 | /* | ||
307 | * ISA peripherals | ||
308 | */ | ||
309 | |||
310 | /* Parallel port */ | ||
311 | struct mace_parallel { | ||
312 | }; | ||
313 | |||
314 | struct mace_ecp1284 { /* later... */ | ||
315 | }; | ||
316 | |||
317 | /* Serial port */ | ||
318 | struct mace_serial { | ||
319 | volatile unsigned long xxx; /* later... */ | ||
320 | }; | ||
321 | |||
322 | struct mace_isa { | ||
323 | struct mace_parallel parallel; | ||
324 | char _pad1[0x8000 - sizeof(struct mace_parallel)]; | ||
325 | |||
326 | struct mace_ecp1284 ecp1284; | ||
327 | char _pad2[0x8000 - sizeof(struct mace_ecp1284)]; | ||
328 | |||
329 | struct mace_serial serial1; | ||
330 | char _pad3[0x8000 - sizeof(struct mace_serial)]; | ||
331 | |||
332 | struct mace_serial serial2; | ||
333 | char _pad4[0x8000 - sizeof(struct mace_serial)]; | ||
334 | |||
335 | volatile unsigned char rtc[0x10000]; | ||
336 | }; | ||
337 | |||
338 | struct sgi_mace { | ||
339 | char _reserved[0x80000]; | ||
340 | |||
341 | struct mace_pci pci; | ||
342 | char _pad0[0x80000 - sizeof(struct mace_pci)]; | ||
343 | |||
344 | struct mace_video video_in1; | ||
345 | char _pad1[0x80000 - sizeof(struct mace_video)]; | ||
346 | |||
347 | struct mace_video video_in2; | ||
348 | char _pad2[0x80000 - sizeof(struct mace_video)]; | ||
349 | |||
350 | struct mace_video video_out; | ||
351 | char _pad3[0x80000 - sizeof(struct mace_video)]; | ||
352 | |||
353 | struct mace_ethernet eth; | ||
354 | char _pad4[0x80000 - sizeof(struct mace_ethernet)]; | ||
355 | |||
356 | struct mace_perif perif; | ||
357 | char _pad5[0x80000 - sizeof(struct mace_perif)]; | ||
358 | |||
359 | struct mace_isa isa; | ||
360 | char _pad6[0x80000 - sizeof(struct mace_isa)]; | ||
361 | }; | ||
362 | |||
363 | extern struct sgi_mace __iomem *mace; | ||
364 | |||
365 | #endif /* __ASM_MACE_H__ */ | ||
diff --git a/include/asm-mips/ipcbuf.h b/include/asm-mips/ipcbuf.h deleted file mode 100644 index d47d08f264e7..000000000000 --- a/include/asm-mips/ipcbuf.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | #ifndef _ASM_IPCBUF_H | ||
2 | #define _ASM_IPCBUF_H | ||
3 | |||
4 | /* | ||
5 | * The ipc64_perm structure for alpha architecture. | ||
6 | * Note extra padding because this structure is passed back and forth | ||
7 | * between kernel and user space. | ||
8 | * | ||
9 | * Pad space is left for: | ||
10 | * - 32-bit seq | ||
11 | * - 2 miscellaneous 64-bit values | ||
12 | */ | ||
13 | |||
14 | struct ipc64_perm | ||
15 | { | ||
16 | __kernel_key_t key; | ||
17 | __kernel_uid_t uid; | ||
18 | __kernel_gid_t gid; | ||
19 | __kernel_uid_t cuid; | ||
20 | __kernel_gid_t cgid; | ||
21 | __kernel_mode_t mode; | ||
22 | unsigned short seq; | ||
23 | unsigned short __pad1; | ||
24 | unsigned long __unused1; | ||
25 | unsigned long __unused2; | ||
26 | }; | ||
27 | |||
28 | #endif /* _ASM_IPCBUF_H */ | ||
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h deleted file mode 100644 index a58f0eecc68f..000000000000 --- a/include/asm-mips/irq.h +++ /dev/null | |||
@@ -1,163 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle | ||
7 | * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02, 03 by Ralf Baechle | ||
8 | */ | ||
9 | #ifndef _ASM_IRQ_H | ||
10 | #define _ASM_IRQ_H | ||
11 | |||
12 | #include <linux/linkage.h> | ||
13 | |||
14 | #include <asm/mipsmtregs.h> | ||
15 | |||
16 | #include <irq.h> | ||
17 | |||
18 | #ifdef CONFIG_I8259 | ||
19 | static inline int irq_canonicalize(int irq) | ||
20 | { | ||
21 | return ((irq == I8259A_IRQ_BASE + 2) ? I8259A_IRQ_BASE + 9 : irq); | ||
22 | } | ||
23 | #else | ||
24 | #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */ | ||
25 | #endif | ||
26 | |||
27 | #ifdef CONFIG_MIPS_MT_SMTC | ||
28 | |||
29 | struct irqaction; | ||
30 | |||
31 | extern unsigned long irq_hwmask[]; | ||
32 | extern int setup_irq_smtc(unsigned int irq, struct irqaction * new, | ||
33 | unsigned long hwmask); | ||
34 | |||
35 | static inline void smtc_im_ack_irq(unsigned int irq) | ||
36 | { | ||
37 | if (irq_hwmask[irq] & ST0_IM) | ||
38 | set_c0_status(irq_hwmask[irq] & ST0_IM); | ||
39 | } | ||
40 | |||
41 | #else | ||
42 | |||
43 | static inline void smtc_im_ack_irq(unsigned int irq) | ||
44 | { | ||
45 | } | ||
46 | |||
47 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
48 | |||
49 | #ifdef CONFIG_MIPS_MT_SMTC_IRQAFF | ||
50 | #include <linux/cpumask.h> | ||
51 | |||
52 | extern void plat_set_irq_affinity(unsigned int irq, cpumask_t affinity); | ||
53 | extern void smtc_forward_irq(unsigned int irq); | ||
54 | |||
55 | /* | ||
56 | * IRQ affinity hook invoked at the beginning of interrupt dispatch | ||
57 | * if option is enabled. | ||
58 | * | ||
59 | * Up through Linux 2.6.22 (at least) cpumask operations are very | ||
60 | * inefficient on MIPS. Initial prototypes of SMTC IRQ affinity | ||
61 | * used a "fast path" per-IRQ-descriptor cache of affinity information | ||
62 | * to reduce latency. As there is a project afoot to optimize the | ||
63 | * cpumask implementations, this version is optimistically assuming | ||
64 | * that cpumask.h macro overhead is reasonable during interrupt dispatch. | ||
65 | */ | ||
66 | #define IRQ_AFFINITY_HOOK(irq) \ | ||
67 | do { \ | ||
68 | if (!cpu_isset(smp_processor_id(), irq_desc[irq].affinity)) { \ | ||
69 | smtc_forward_irq(irq); \ | ||
70 | irq_exit(); \ | ||
71 | return; \ | ||
72 | } \ | ||
73 | } while (0) | ||
74 | |||
75 | #else /* Not doing SMTC affinity */ | ||
76 | |||
77 | #define IRQ_AFFINITY_HOOK(irq) do { } while (0) | ||
78 | |||
79 | #endif /* CONFIG_MIPS_MT_SMTC_IRQAFF */ | ||
80 | |||
81 | #ifdef CONFIG_MIPS_MT_SMTC_IM_BACKSTOP | ||
82 | |||
83 | /* | ||
84 | * Clear interrupt mask handling "backstop" if irq_hwmask | ||
85 | * entry so indicates. This implies that the ack() or end() | ||
86 | * functions will take over re-enabling the low-level mask. | ||
87 | * Otherwise it will be done on return from exception. | ||
88 | */ | ||
89 | #define __DO_IRQ_SMTC_HOOK(irq) \ | ||
90 | do { \ | ||
91 | IRQ_AFFINITY_HOOK(irq); \ | ||
92 | if (irq_hwmask[irq] & 0x0000ff00) \ | ||
93 | write_c0_tccontext(read_c0_tccontext() & \ | ||
94 | ~(irq_hwmask[irq] & 0x0000ff00)); \ | ||
95 | } while (0) | ||
96 | |||
97 | #define __NO_AFFINITY_IRQ_SMTC_HOOK(irq) \ | ||
98 | do { \ | ||
99 | if (irq_hwmask[irq] & 0x0000ff00) \ | ||
100 | write_c0_tccontext(read_c0_tccontext() & \ | ||
101 | ~(irq_hwmask[irq] & 0x0000ff00)); \ | ||
102 | } while (0) | ||
103 | |||
104 | #else | ||
105 | |||
106 | #define __DO_IRQ_SMTC_HOOK(irq) \ | ||
107 | do { \ | ||
108 | IRQ_AFFINITY_HOOK(irq); \ | ||
109 | } while (0) | ||
110 | #define __NO_AFFINITY_IRQ_SMTC_HOOK(irq) do { } while (0) | ||
111 | |||
112 | #endif | ||
113 | |||
114 | /* | ||
115 | * do_IRQ handles all normal device IRQ's (the special | ||
116 | * SMP cross-CPU interrupts have their own specific | ||
117 | * handlers). | ||
118 | * | ||
119 | * Ideally there should be away to get this into kernel/irq/handle.c to | ||
120 | * avoid the overhead of a call for just a tiny function ... | ||
121 | */ | ||
122 | #define do_IRQ(irq) \ | ||
123 | do { \ | ||
124 | irq_enter(); \ | ||
125 | __DO_IRQ_SMTC_HOOK(irq); \ | ||
126 | generic_handle_irq(irq); \ | ||
127 | irq_exit(); \ | ||
128 | } while (0) | ||
129 | |||
130 | #ifdef CONFIG_MIPS_MT_SMTC_IRQAFF | ||
131 | /* | ||
132 | * To avoid inefficient and in some cases pathological re-checking of | ||
133 | * IRQ affinity, we have this variant that skips the affinity check. | ||
134 | */ | ||
135 | |||
136 | |||
137 | #define do_IRQ_no_affinity(irq) \ | ||
138 | do { \ | ||
139 | irq_enter(); \ | ||
140 | __NO_AFFINITY_IRQ_SMTC_HOOK(irq); \ | ||
141 | generic_handle_irq(irq); \ | ||
142 | irq_exit(); \ | ||
143 | } while (0) | ||
144 | |||
145 | #endif /* CONFIG_MIPS_MT_SMTC_IRQAFF */ | ||
146 | |||
147 | extern void arch_init_irq(void); | ||
148 | extern void spurious_interrupt(void); | ||
149 | |||
150 | extern int allocate_irqno(void); | ||
151 | extern void alloc_legacy_irqno(void); | ||
152 | extern void free_irqno(unsigned int irq); | ||
153 | |||
154 | /* | ||
155 | * Before R2 the timer and performance counter interrupts were both fixed to | ||
156 | * IE7. Since R2 their number has to be read from the c0_intctl register. | ||
157 | */ | ||
158 | #define CP0_LEGACY_COMPARE_IRQ 7 | ||
159 | |||
160 | extern int cp0_compare_irq; | ||
161 | extern int cp0_perfcount_irq; | ||
162 | |||
163 | #endif /* _ASM_IRQ_H */ | ||
diff --git a/include/asm-mips/irq_cpu.h b/include/asm-mips/irq_cpu.h deleted file mode 100644 index ef6a07cddb23..000000000000 --- a/include/asm-mips/irq_cpu.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/irq_cpu.h | ||
3 | * | ||
4 | * MIPS CPU interrupt definitions. | ||
5 | * | ||
6 | * Copyright (C) 2002 Maciej W. Rozycki | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | #ifndef _ASM_IRQ_CPU_H | ||
14 | #define _ASM_IRQ_CPU_H | ||
15 | |||
16 | extern void mips_cpu_irq_init(void); | ||
17 | extern void rm7k_cpu_irq_init(void); | ||
18 | extern void rm9k_cpu_irq_init(void); | ||
19 | |||
20 | #endif /* _ASM_IRQ_CPU_H */ | ||
diff --git a/include/asm-mips/irq_gt641xx.h b/include/asm-mips/irq_gt641xx.h deleted file mode 100644 index f9a7c3ac2e66..000000000000 --- a/include/asm-mips/irq_gt641xx.h +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | /* | ||
2 | * Galileo/Marvell GT641xx IRQ definitions. | ||
3 | * | ||
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | */ | ||
20 | #ifndef _ASM_IRQ_GT641XX_H | ||
21 | #define _ASM_IRQ_GT641XX_H | ||
22 | |||
23 | #ifndef GT641XX_IRQ_BASE | ||
24 | #define GT641XX_IRQ_BASE 8 | ||
25 | #endif | ||
26 | |||
27 | #define GT641XX_MEMORY_OUT_OF_RANGE_IRQ (GT641XX_IRQ_BASE + 1) | ||
28 | #define GT641XX_DMA_OUT_OF_RANGE_IRQ (GT641XX_IRQ_BASE + 2) | ||
29 | #define GT641XX_CPU_ACCESS_OUT_OF_RANGE_IRQ (GT641XX_IRQ_BASE + 3) | ||
30 | #define GT641XX_DMA0_IRQ (GT641XX_IRQ_BASE + 4) | ||
31 | #define GT641XX_DMA1_IRQ (GT641XX_IRQ_BASE + 5) | ||
32 | #define GT641XX_DMA2_IRQ (GT641XX_IRQ_BASE + 6) | ||
33 | #define GT641XX_DMA3_IRQ (GT641XX_IRQ_BASE + 7) | ||
34 | #define GT641XX_TIMER0_IRQ (GT641XX_IRQ_BASE + 8) | ||
35 | #define GT641XX_TIMER1_IRQ (GT641XX_IRQ_BASE + 9) | ||
36 | #define GT641XX_TIMER2_IRQ (GT641XX_IRQ_BASE + 10) | ||
37 | #define GT641XX_TIMER3_IRQ (GT641XX_IRQ_BASE + 11) | ||
38 | #define GT641XX_PCI_0_MASTER_READ_ERROR_IRQ (GT641XX_IRQ_BASE + 12) | ||
39 | #define GT641XX_PCI_0_SLAVE_WRITE_ERROR_IRQ (GT641XX_IRQ_BASE + 13) | ||
40 | #define GT641XX_PCI_0_MASTER_WRITE_ERROR_IRQ (GT641XX_IRQ_BASE + 14) | ||
41 | #define GT641XX_PCI_0_SLAVE_READ_ERROR_IRQ (GT641XX_IRQ_BASE + 15) | ||
42 | #define GT641XX_PCI_0_ADDRESS_ERROR_IRQ (GT641XX_IRQ_BASE + 16) | ||
43 | #define GT641XX_MEMORY_ERROR_IRQ (GT641XX_IRQ_BASE + 17) | ||
44 | #define GT641XX_PCI_0_MASTER_ABORT_IRQ (GT641XX_IRQ_BASE + 18) | ||
45 | #define GT641XX_PCI_0_TARGET_ABORT_IRQ (GT641XX_IRQ_BASE + 19) | ||
46 | #define GT641XX_PCI_0_RETRY_TIMEOUT_IRQ (GT641XX_IRQ_BASE + 20) | ||
47 | #define GT641XX_CPU_INT0_IRQ (GT641XX_IRQ_BASE + 21) | ||
48 | #define GT641XX_CPU_INT1_IRQ (GT641XX_IRQ_BASE + 22) | ||
49 | #define GT641XX_CPU_INT2_IRQ (GT641XX_IRQ_BASE + 23) | ||
50 | #define GT641XX_CPU_INT3_IRQ (GT641XX_IRQ_BASE + 24) | ||
51 | #define GT641XX_CPU_INT4_IRQ (GT641XX_IRQ_BASE + 25) | ||
52 | #define GT641XX_PCI_INT0_IRQ (GT641XX_IRQ_BASE + 26) | ||
53 | #define GT641XX_PCI_INT1_IRQ (GT641XX_IRQ_BASE + 27) | ||
54 | #define GT641XX_PCI_INT2_IRQ (GT641XX_IRQ_BASE + 28) | ||
55 | #define GT641XX_PCI_INT3_IRQ (GT641XX_IRQ_BASE + 29) | ||
56 | |||
57 | extern void gt641xx_irq_dispatch(void); | ||
58 | extern void gt641xx_irq_init(void); | ||
59 | |||
60 | #endif /* _ASM_IRQ_GT641XX_H */ | ||
diff --git a/include/asm-mips/irq_regs.h b/include/asm-mips/irq_regs.h deleted file mode 100644 index 33bd2a06de57..000000000000 --- a/include/asm-mips/irq_regs.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or | ||
3 | * modify it under the terms of the GNU General Public License | ||
4 | * as published by the Free Software Foundation; either version | ||
5 | * 2 of the License, or (at your option) any later version. | ||
6 | * | ||
7 | * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) | ||
8 | */ | ||
9 | #ifndef __ASM_IRQ_REGS_H | ||
10 | #define __ASM_IRQ_REGS_H | ||
11 | |||
12 | #define ARCH_HAS_OWN_IRQ_REGS | ||
13 | |||
14 | #include <linux/thread_info.h> | ||
15 | |||
16 | static inline struct pt_regs *get_irq_regs(void) | ||
17 | { | ||
18 | return current_thread_info()->regs; | ||
19 | } | ||
20 | |||
21 | #endif /* __ASM_IRQ_REGS_H */ | ||
diff --git a/include/asm-mips/irqflags.h b/include/asm-mips/irqflags.h deleted file mode 100644 index 701ec0ba8fa9..000000000000 --- a/include/asm-mips/irqflags.h +++ /dev/null | |||
@@ -1,283 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003 by Ralf Baechle | ||
7 | * Copyright (C) 1996 by Paul M. Antoine | ||
8 | * Copyright (C) 1999 Silicon Graphics | ||
9 | * Copyright (C) 2000 MIPS Technologies, Inc. | ||
10 | */ | ||
11 | #ifndef _ASM_IRQFLAGS_H | ||
12 | #define _ASM_IRQFLAGS_H | ||
13 | |||
14 | #ifndef __ASSEMBLY__ | ||
15 | |||
16 | #include <linux/compiler.h> | ||
17 | #include <asm/hazards.h> | ||
18 | |||
19 | __asm__( | ||
20 | " .macro raw_local_irq_enable \n" | ||
21 | " .set push \n" | ||
22 | " .set reorder \n" | ||
23 | " .set noat \n" | ||
24 | #ifdef CONFIG_MIPS_MT_SMTC | ||
25 | " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n" | ||
26 | " ori $1, 0x400 \n" | ||
27 | " xori $1, 0x400 \n" | ||
28 | " mtc0 $1, $2, 1 \n" | ||
29 | #elif defined(CONFIG_CPU_MIPSR2) | ||
30 | " ei \n" | ||
31 | #else | ||
32 | " mfc0 $1,$12 \n" | ||
33 | " ori $1,0x1f \n" | ||
34 | " xori $1,0x1e \n" | ||
35 | " mtc0 $1,$12 \n" | ||
36 | #endif | ||
37 | " irq_enable_hazard \n" | ||
38 | " .set pop \n" | ||
39 | " .endm"); | ||
40 | |||
41 | extern void smtc_ipi_replay(void); | ||
42 | |||
43 | static inline void raw_local_irq_enable(void) | ||
44 | { | ||
45 | #ifdef CONFIG_MIPS_MT_SMTC | ||
46 | /* | ||
47 | * SMTC kernel needs to do a software replay of queued | ||
48 | * IPIs, at the cost of call overhead on each local_irq_enable() | ||
49 | */ | ||
50 | smtc_ipi_replay(); | ||
51 | #endif | ||
52 | __asm__ __volatile__( | ||
53 | "raw_local_irq_enable" | ||
54 | : /* no outputs */ | ||
55 | : /* no inputs */ | ||
56 | : "memory"); | ||
57 | } | ||
58 | |||
59 | |||
60 | /* | ||
61 | * For cli() we have to insert nops to make sure that the new value | ||
62 | * has actually arrived in the status register before the end of this | ||
63 | * macro. | ||
64 | * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs | ||
65 | * no nops at all. | ||
66 | */ | ||
67 | /* | ||
68 | * For TX49, operating only IE bit is not enough. | ||
69 | * | ||
70 | * If mfc0 $12 follows store and the mfc0 is last instruction of a | ||
71 | * page and fetching the next instruction causes TLB miss, the result | ||
72 | * of the mfc0 might wrongly contain EXL bit. | ||
73 | * | ||
74 | * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008 | ||
75 | * | ||
76 | * Workaround: mask EXL bit of the result or place a nop before mfc0. | ||
77 | */ | ||
78 | __asm__( | ||
79 | " .macro raw_local_irq_disable\n" | ||
80 | " .set push \n" | ||
81 | " .set noat \n" | ||
82 | #ifdef CONFIG_MIPS_MT_SMTC | ||
83 | " mfc0 $1, $2, 1 \n" | ||
84 | " ori $1, 0x400 \n" | ||
85 | " .set noreorder \n" | ||
86 | " mtc0 $1, $2, 1 \n" | ||
87 | #elif defined(CONFIG_CPU_MIPSR2) | ||
88 | " di \n" | ||
89 | #else | ||
90 | " mfc0 $1,$12 \n" | ||
91 | " ori $1,0x1f \n" | ||
92 | " xori $1,0x1f \n" | ||
93 | " .set noreorder \n" | ||
94 | " mtc0 $1,$12 \n" | ||
95 | #endif | ||
96 | " irq_disable_hazard \n" | ||
97 | " .set pop \n" | ||
98 | " .endm \n"); | ||
99 | |||
100 | static inline void raw_local_irq_disable(void) | ||
101 | { | ||
102 | __asm__ __volatile__( | ||
103 | "raw_local_irq_disable" | ||
104 | : /* no outputs */ | ||
105 | : /* no inputs */ | ||
106 | : "memory"); | ||
107 | } | ||
108 | |||
109 | __asm__( | ||
110 | " .macro raw_local_save_flags flags \n" | ||
111 | " .set push \n" | ||
112 | " .set reorder \n" | ||
113 | #ifdef CONFIG_MIPS_MT_SMTC | ||
114 | " mfc0 \\flags, $2, 1 \n" | ||
115 | #else | ||
116 | " mfc0 \\flags, $12 \n" | ||
117 | #endif | ||
118 | " .set pop \n" | ||
119 | " .endm \n"); | ||
120 | |||
121 | #define raw_local_save_flags(x) \ | ||
122 | __asm__ __volatile__( \ | ||
123 | "raw_local_save_flags %0" \ | ||
124 | : "=r" (x)) | ||
125 | |||
126 | __asm__( | ||
127 | " .macro raw_local_irq_save result \n" | ||
128 | " .set push \n" | ||
129 | " .set reorder \n" | ||
130 | " .set noat \n" | ||
131 | #ifdef CONFIG_MIPS_MT_SMTC | ||
132 | " mfc0 \\result, $2, 1 \n" | ||
133 | " ori $1, \\result, 0x400 \n" | ||
134 | " .set noreorder \n" | ||
135 | " mtc0 $1, $2, 1 \n" | ||
136 | " andi \\result, \\result, 0x400 \n" | ||
137 | #elif defined(CONFIG_CPU_MIPSR2) | ||
138 | " di \\result \n" | ||
139 | " andi \\result, 1 \n" | ||
140 | #else | ||
141 | " mfc0 \\result, $12 \n" | ||
142 | " ori $1, \\result, 0x1f \n" | ||
143 | " xori $1, 0x1f \n" | ||
144 | " .set noreorder \n" | ||
145 | " mtc0 $1, $12 \n" | ||
146 | #endif | ||
147 | " irq_disable_hazard \n" | ||
148 | " .set pop \n" | ||
149 | " .endm \n"); | ||
150 | |||
151 | #define raw_local_irq_save(x) \ | ||
152 | __asm__ __volatile__( \ | ||
153 | "raw_local_irq_save\t%0" \ | ||
154 | : "=r" (x) \ | ||
155 | : /* no inputs */ \ | ||
156 | : "memory") | ||
157 | |||
158 | __asm__( | ||
159 | " .macro raw_local_irq_restore flags \n" | ||
160 | " .set push \n" | ||
161 | " .set noreorder \n" | ||
162 | " .set noat \n" | ||
163 | #ifdef CONFIG_MIPS_MT_SMTC | ||
164 | "mfc0 $1, $2, 1 \n" | ||
165 | "andi \\flags, 0x400 \n" | ||
166 | "ori $1, 0x400 \n" | ||
167 | "xori $1, 0x400 \n" | ||
168 | "or \\flags, $1 \n" | ||
169 | "mtc0 \\flags, $2, 1 \n" | ||
170 | #elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) | ||
171 | /* | ||
172 | * Slow, but doesn't suffer from a relativly unlikely race | ||
173 | * condition we're having since days 1. | ||
174 | */ | ||
175 | " beqz \\flags, 1f \n" | ||
176 | " di \n" | ||
177 | " ei \n" | ||
178 | "1: \n" | ||
179 | #elif defined(CONFIG_CPU_MIPSR2) | ||
180 | /* | ||
181 | * Fast, dangerous. Life is fun, life is good. | ||
182 | */ | ||
183 | " mfc0 $1, $12 \n" | ||
184 | " ins $1, \\flags, 0, 1 \n" | ||
185 | " mtc0 $1, $12 \n" | ||
186 | #else | ||
187 | " mfc0 $1, $12 \n" | ||
188 | " andi \\flags, 1 \n" | ||
189 | " ori $1, 0x1f \n" | ||
190 | " xori $1, 0x1f \n" | ||
191 | " or \\flags, $1 \n" | ||
192 | " mtc0 \\flags, $12 \n" | ||
193 | #endif | ||
194 | " irq_disable_hazard \n" | ||
195 | " .set pop \n" | ||
196 | " .endm \n"); | ||
197 | |||
198 | |||
199 | static inline void raw_local_irq_restore(unsigned long flags) | ||
200 | { | ||
201 | unsigned long __tmp1; | ||
202 | |||
203 | #ifdef CONFIG_MIPS_MT_SMTC | ||
204 | /* | ||
205 | * SMTC kernel needs to do a software replay of queued | ||
206 | * IPIs, at the cost of branch and call overhead on each | ||
207 | * local_irq_restore() | ||
208 | */ | ||
209 | if (unlikely(!(flags & 0x0400))) | ||
210 | smtc_ipi_replay(); | ||
211 | #endif | ||
212 | |||
213 | __asm__ __volatile__( | ||
214 | "raw_local_irq_restore\t%0" | ||
215 | : "=r" (__tmp1) | ||
216 | : "0" (flags) | ||
217 | : "memory"); | ||
218 | } | ||
219 | |||
220 | static inline void __raw_local_irq_restore(unsigned long flags) | ||
221 | { | ||
222 | unsigned long __tmp1; | ||
223 | |||
224 | __asm__ __volatile__( | ||
225 | "raw_local_irq_restore\t%0" | ||
226 | : "=r" (__tmp1) | ||
227 | : "0" (flags) | ||
228 | : "memory"); | ||
229 | } | ||
230 | |||
231 | static inline int raw_irqs_disabled_flags(unsigned long flags) | ||
232 | { | ||
233 | #ifdef CONFIG_MIPS_MT_SMTC | ||
234 | /* | ||
235 | * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU | ||
236 | */ | ||
237 | return flags & 0x400; | ||
238 | #else | ||
239 | return !(flags & 1); | ||
240 | #endif | ||
241 | } | ||
242 | |||
243 | #endif | ||
244 | |||
245 | /* | ||
246 | * Do the CPU's IRQ-state tracing from assembly code. | ||
247 | */ | ||
248 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
249 | /* Reload some registers clobbered by trace_hardirqs_on */ | ||
250 | #ifdef CONFIG_64BIT | ||
251 | # define TRACE_IRQS_RELOAD_REGS \ | ||
252 | LONG_L $11, PT_R11(sp); \ | ||
253 | LONG_L $10, PT_R10(sp); \ | ||
254 | LONG_L $9, PT_R9(sp); \ | ||
255 | LONG_L $8, PT_R8(sp); \ | ||
256 | LONG_L $7, PT_R7(sp); \ | ||
257 | LONG_L $6, PT_R6(sp); \ | ||
258 | LONG_L $5, PT_R5(sp); \ | ||
259 | LONG_L $4, PT_R4(sp); \ | ||
260 | LONG_L $2, PT_R2(sp) | ||
261 | #else | ||
262 | # define TRACE_IRQS_RELOAD_REGS \ | ||
263 | LONG_L $7, PT_R7(sp); \ | ||
264 | LONG_L $6, PT_R6(sp); \ | ||
265 | LONG_L $5, PT_R5(sp); \ | ||
266 | LONG_L $4, PT_R4(sp); \ | ||
267 | LONG_L $2, PT_R2(sp) | ||
268 | #endif | ||
269 | # define TRACE_IRQS_ON \ | ||
270 | CLI; /* make sure trace_hardirqs_on() is called in kernel level */ \ | ||
271 | jal trace_hardirqs_on | ||
272 | # define TRACE_IRQS_ON_RELOAD \ | ||
273 | TRACE_IRQS_ON; \ | ||
274 | TRACE_IRQS_RELOAD_REGS | ||
275 | # define TRACE_IRQS_OFF \ | ||
276 | jal trace_hardirqs_off | ||
277 | #else | ||
278 | # define TRACE_IRQS_ON | ||
279 | # define TRACE_IRQS_ON_RELOAD | ||
280 | # define TRACE_IRQS_OFF | ||
281 | #endif | ||
282 | |||
283 | #endif /* _ASM_IRQFLAGS_H */ | ||
diff --git a/include/asm-mips/isadep.h b/include/asm-mips/isadep.h deleted file mode 100644 index 24c6cda79377..000000000000 --- a/include/asm-mips/isadep.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * Various ISA level dependent constants. | ||
3 | * Most of the following constants reflect the different layout | ||
4 | * of Coprocessor 0 registers. | ||
5 | * | ||
6 | * Copyright (c) 1998 Harald Koerfgen | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_ISADEP_H | ||
10 | #define __ASM_ISADEP_H | ||
11 | |||
12 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
13 | /* | ||
14 | * R2000 or R3000 | ||
15 | */ | ||
16 | |||
17 | /* | ||
18 | * kernel or user mode? (CP0_STATUS) | ||
19 | */ | ||
20 | #define KU_MASK 0x08 | ||
21 | #define KU_USER 0x08 | ||
22 | #define KU_KERN 0x00 | ||
23 | |||
24 | #else | ||
25 | /* | ||
26 | * kernel or user mode? | ||
27 | */ | ||
28 | #define KU_MASK 0x18 | ||
29 | #define KU_USER 0x10 | ||
30 | #define KU_KERN 0x00 | ||
31 | |||
32 | #endif | ||
33 | |||
34 | #endif /* __ASM_ISADEP_H */ | ||
diff --git a/include/asm-mips/jazz.h b/include/asm-mips/jazz.h deleted file mode 100644 index 83f449dec95e..000000000000 --- a/include/asm-mips/jazz.h +++ /dev/null | |||
@@ -1,310 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995 - 1998 by Andreas Busse and Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_JAZZ_H | ||
9 | #define __ASM_JAZZ_H | ||
10 | |||
11 | /* | ||
12 | * The addresses below are virtual address. The mappings are | ||
13 | * created on startup via wired entries in the tlb. The Mips | ||
14 | * Magnum R3000 and R4000 machines are similar in many aspects, | ||
15 | * but many hardware register are accessible at 0xb9000000 in | ||
16 | * instead of 0xe0000000. | ||
17 | */ | ||
18 | |||
19 | #define JAZZ_LOCAL_IO_SPACE 0xe0000000 | ||
20 | |||
21 | /* | ||
22 | * Revision numbers in PICA_ASIC_REVISION | ||
23 | * | ||
24 | * 0xf0000000 - Rev1 | ||
25 | * 0xf0000001 - Rev2 | ||
26 | * 0xf0000002 - Rev3 | ||
27 | */ | ||
28 | #define PICA_ASIC_REVISION 0xe0000008 | ||
29 | |||
30 | /* | ||
31 | * The segments of the seven segment LED are mapped | ||
32 | * to the control bits as follows: | ||
33 | * | ||
34 | * (7) | ||
35 | * --------- | ||
36 | * | | | ||
37 | * (2) | | (6) | ||
38 | * | (1) | | ||
39 | * --------- | ||
40 | * | | | ||
41 | * (3) | | (5) | ||
42 | * | (4) | | ||
43 | * --------- . (0) | ||
44 | */ | ||
45 | #define PICA_LED 0xe000f000 | ||
46 | |||
47 | /* | ||
48 | * Some characters for the LED control registers | ||
49 | * The original Mips machines seem to have a LED display | ||
50 | * with integrated decoder while the Acer machines can | ||
51 | * control each of the seven segments and the dot independently. | ||
52 | * It's only a toy, anyway... | ||
53 | */ | ||
54 | #define LED_DOT 0x01 | ||
55 | #define LED_SPACE 0x00 | ||
56 | #define LED_0 0xfc | ||
57 | #define LED_1 0x60 | ||
58 | #define LED_2 0xda | ||
59 | #define LED_3 0xf2 | ||
60 | #define LED_4 0x66 | ||
61 | #define LED_5 0xb6 | ||
62 | #define LED_6 0xbe | ||
63 | #define LED_7 0xe0 | ||
64 | #define LED_8 0xfe | ||
65 | #define LED_9 0xf6 | ||
66 | #define LED_A 0xee | ||
67 | #define LED_b 0x3e | ||
68 | #define LED_C 0x9c | ||
69 | #define LED_d 0x7a | ||
70 | #define LED_E 0x9e | ||
71 | #define LED_F 0x8e | ||
72 | |||
73 | #ifndef __ASSEMBLY__ | ||
74 | |||
75 | static __inline__ void pica_set_led(unsigned int bits) | ||
76 | { | ||
77 | volatile unsigned int *led_register = (unsigned int *) PICA_LED; | ||
78 | |||
79 | *led_register = bits; | ||
80 | } | ||
81 | |||
82 | #endif /* !__ASSEMBLY__ */ | ||
83 | |||
84 | /* | ||
85 | * Base address of the Sonic Ethernet adapter in Jazz machines. | ||
86 | */ | ||
87 | #define JAZZ_ETHERNET_BASE 0xe0001000 | ||
88 | |||
89 | /* | ||
90 | * Base address of the 53C94 SCSI hostadapter in Jazz machines. | ||
91 | */ | ||
92 | #define JAZZ_SCSI_BASE 0xe0002000 | ||
93 | |||
94 | /* | ||
95 | * i8042 keyboard controller for JAZZ and PICA chipsets. | ||
96 | * This address is just a guess and seems to differ from | ||
97 | * other mips machines such as RC3xxx... | ||
98 | */ | ||
99 | #define JAZZ_KEYBOARD_ADDRESS 0xe0005000 | ||
100 | #define JAZZ_KEYBOARD_DATA 0xe0005000 | ||
101 | #define JAZZ_KEYBOARD_COMMAND 0xe0005001 | ||
102 | |||
103 | #ifndef __ASSEMBLY__ | ||
104 | |||
105 | typedef struct { | ||
106 | unsigned char data; | ||
107 | unsigned char command; | ||
108 | } jazz_keyboard_hardware; | ||
109 | |||
110 | #define jazz_kh ((keyboard_hardware *) JAZZ_KEYBOARD_ADDRESS) | ||
111 | |||
112 | typedef struct { | ||
113 | unsigned char pad0[3]; | ||
114 | unsigned char data; | ||
115 | unsigned char pad1[3]; | ||
116 | unsigned char command; | ||
117 | } mips_keyboard_hardware; | ||
118 | |||
119 | /* | ||
120 | * For now. Needs to be changed for RC3xxx support. See below. | ||
121 | */ | ||
122 | #define keyboard_hardware jazz_keyboard_hardware | ||
123 | |||
124 | #endif /* !__ASSEMBLY__ */ | ||
125 | |||
126 | /* | ||
127 | * i8042 keyboard controller for most other Mips machines. | ||
128 | */ | ||
129 | #define MIPS_KEYBOARD_ADDRESS 0xb9005000 | ||
130 | #define MIPS_KEYBOARD_DATA 0xb9005003 | ||
131 | #define MIPS_KEYBOARD_COMMAND 0xb9005007 | ||
132 | |||
133 | /* | ||
134 | * Serial and parallel ports (WD 16C552) on the Mips JAZZ | ||
135 | */ | ||
136 | #define JAZZ_SERIAL1_BASE (unsigned int)0xe0006000 | ||
137 | #define JAZZ_SERIAL2_BASE (unsigned int)0xe0007000 | ||
138 | #define JAZZ_PARALLEL_BASE (unsigned int)0xe0008000 | ||
139 | |||
140 | /* | ||
141 | * Dummy Device Address. Used in jazzdma.c | ||
142 | */ | ||
143 | #define JAZZ_DUMMY_DEVICE 0xe000d000 | ||
144 | |||
145 | /* | ||
146 | * JAZZ timer registers and interrupt no. | ||
147 | * Note that the hardware timer interrupt is actually on | ||
148 | * cpu level 6, but to keep compatibility with PC stuff | ||
149 | * it is remapped to vector 0. See arch/mips/kernel/entry.S. | ||
150 | */ | ||
151 | #define JAZZ_TIMER_INTERVAL 0xe0000228 | ||
152 | #define JAZZ_TIMER_REGISTER 0xe0000230 | ||
153 | |||
154 | /* | ||
155 | * DRAM configuration register | ||
156 | */ | ||
157 | #ifndef __ASSEMBLY__ | ||
158 | #ifdef __MIPSEL__ | ||
159 | typedef struct { | ||
160 | unsigned int bank2 : 3; | ||
161 | unsigned int bank1 : 3; | ||
162 | unsigned int mem_bus_width : 1; | ||
163 | unsigned int reserved2 : 1; | ||
164 | unsigned int page_mode : 1; | ||
165 | unsigned int reserved1 : 23; | ||
166 | } dram_configuration; | ||
167 | #else /* defined (__MIPSEB__) */ | ||
168 | typedef struct { | ||
169 | unsigned int reserved1 : 23; | ||
170 | unsigned int page_mode : 1; | ||
171 | unsigned int reserved2 : 1; | ||
172 | unsigned int mem_bus_width : 1; | ||
173 | unsigned int bank1 : 3; | ||
174 | unsigned int bank2 : 3; | ||
175 | } dram_configuration; | ||
176 | #endif | ||
177 | #endif /* !__ASSEMBLY__ */ | ||
178 | |||
179 | #define PICA_DRAM_CONFIG 0xe00fffe0 | ||
180 | |||
181 | /* | ||
182 | * JAZZ interrupt control registers | ||
183 | */ | ||
184 | #define JAZZ_IO_IRQ_SOURCE 0xe0010000 | ||
185 | #define JAZZ_IO_IRQ_ENABLE 0xe0010002 | ||
186 | |||
187 | /* | ||
188 | * JAZZ Interrupt Level definitions | ||
189 | * | ||
190 | * This is somewhat broken. For reasons which nobody can remember anymore | ||
191 | * we remap the Jazz interrupts to the usual ISA style interrupt numbers. | ||
192 | */ | ||
193 | #define JAZZ_IRQ_START 24 | ||
194 | #define JAZZ_IRQ_END (24 + 9) | ||
195 | #define JAZZ_PARALLEL_IRQ (JAZZ_IRQ_START + 0) | ||
196 | #define JAZZ_FLOPPY_IRQ (JAZZ_IRQ_START + 1) | ||
197 | #define JAZZ_SOUND_IRQ (JAZZ_IRQ_START + 2) | ||
198 | #define JAZZ_VIDEO_IRQ (JAZZ_IRQ_START + 3) | ||
199 | #define JAZZ_ETHERNET_IRQ (JAZZ_IRQ_START + 4) | ||
200 | #define JAZZ_SCSI_IRQ (JAZZ_IRQ_START + 5) | ||
201 | #define JAZZ_KEYBOARD_IRQ (JAZZ_IRQ_START + 6) | ||
202 | #define JAZZ_MOUSE_IRQ (JAZZ_IRQ_START + 7) | ||
203 | #define JAZZ_SERIAL1_IRQ (JAZZ_IRQ_START + 8) | ||
204 | #define JAZZ_SERIAL2_IRQ (JAZZ_IRQ_START + 9) | ||
205 | |||
206 | #define JAZZ_TIMER_IRQ (MIPS_CPU_IRQ_BASE+6) | ||
207 | |||
208 | |||
209 | /* | ||
210 | * JAZZ DMA Channels | ||
211 | * Note: Channels 4...7 are not used with respect to the Acer PICA-61 | ||
212 | * chipset which does not provide these DMA channels. | ||
213 | */ | ||
214 | #define JAZZ_SCSI_DMA 0 /* SCSI */ | ||
215 | #define JAZZ_FLOPPY_DMA 1 /* FLOPPY */ | ||
216 | #define JAZZ_AUDIOL_DMA 2 /* AUDIO L */ | ||
217 | #define JAZZ_AUDIOR_DMA 3 /* AUDIO R */ | ||
218 | |||
219 | /* | ||
220 | * JAZZ R4030 MCT_ADR chip (DMA controller) | ||
221 | * Note: Virtual Addresses ! | ||
222 | */ | ||
223 | #define JAZZ_R4030_CONFIG 0xE0000000 /* R4030 config register */ | ||
224 | #define JAZZ_R4030_REVISION 0xE0000008 /* same as PICA_ASIC_REVISION */ | ||
225 | #define JAZZ_R4030_INV_ADDR 0xE0000010 /* Invalid Address register */ | ||
226 | |||
227 | #define JAZZ_R4030_TRSTBL_BASE 0xE0000018 /* Translation Table Base */ | ||
228 | #define JAZZ_R4030_TRSTBL_LIM 0xE0000020 /* Translation Table Limit */ | ||
229 | #define JAZZ_R4030_TRSTBL_INV 0xE0000028 /* Translation Table Invalidate */ | ||
230 | |||
231 | #define JAZZ_R4030_CACHE_MTNC 0xE0000030 /* Cache Maintenance */ | ||
232 | #define JAZZ_R4030_R_FAIL_ADDR 0xE0000038 /* Remote Failed Address */ | ||
233 | #define JAZZ_R4030_M_FAIL_ADDR 0xE0000040 /* Memory Failed Address */ | ||
234 | |||
235 | #define JAZZ_R4030_CACHE_PTAG 0xE0000048 /* I/O Cache Physical Tag */ | ||
236 | #define JAZZ_R4030_CACHE_LTAG 0xE0000050 /* I/O Cache Logical Tag */ | ||
237 | #define JAZZ_R4030_CACHE_BMASK 0xE0000058 /* I/O Cache Byte Mask */ | ||
238 | #define JAZZ_R4030_CACHE_BWIN 0xE0000060 /* I/O Cache Buffer Window */ | ||
239 | |||
240 | /* | ||
241 | * Remote Speed Registers. | ||
242 | * | ||
243 | * 0: free, 1: Ethernet, 2: SCSI, 3: Floppy, | ||
244 | * 4: RTC, 5: Kb./Mouse 6: serial 1, 7: serial 2, | ||
245 | * 8: parallel, 9: NVRAM, 10: CPU, 11: PROM, | ||
246 | * 12: reserved, 13: free, 14: 7seg LED, 15: ??? | ||
247 | */ | ||
248 | #define JAZZ_R4030_REM_SPEED 0xE0000070 /* 16 Remote Speed Registers */ | ||
249 | /* 0xE0000070,78,80... 0xE00000E8 */ | ||
250 | #define JAZZ_R4030_IRQ_ENABLE 0xE00000E8 /* Internal Interrupt Enable */ | ||
251 | #define JAZZ_R4030_INVAL_ADDR 0xE0000010 /* Invalid address Register */ | ||
252 | #define JAZZ_R4030_IRQ_SOURCE 0xE0000200 /* Interrupt Source Register */ | ||
253 | #define JAZZ_R4030_I386_ERROR 0xE0000208 /* i386/EISA Bus Error */ | ||
254 | |||
255 | /* | ||
256 | * Virtual (E)ISA controller address | ||
257 | */ | ||
258 | #define JAZZ_EISA_IRQ_ACK 0xE0000238 /* EISA interrupt acknowledge */ | ||
259 | |||
260 | /* | ||
261 | * Access the R4030 DMA and I/O Controller | ||
262 | */ | ||
263 | #ifndef __ASSEMBLY__ | ||
264 | |||
265 | static inline void r4030_delay(void) | ||
266 | { | ||
267 | __asm__ __volatile__( | ||
268 | ".set\tnoreorder\n\t" | ||
269 | "nop\n\t" | ||
270 | "nop\n\t" | ||
271 | "nop\n\t" | ||
272 | "nop\n\t" | ||
273 | ".set\treorder"); | ||
274 | } | ||
275 | |||
276 | static inline unsigned short r4030_read_reg16(unsigned long addr) | ||
277 | { | ||
278 | unsigned short ret = *((volatile unsigned short *)addr); | ||
279 | r4030_delay(); | ||
280 | return ret; | ||
281 | } | ||
282 | |||
283 | static inline unsigned int r4030_read_reg32(unsigned long addr) | ||
284 | { | ||
285 | unsigned int ret = *((volatile unsigned int *)addr); | ||
286 | r4030_delay(); | ||
287 | return ret; | ||
288 | } | ||
289 | |||
290 | static inline void r4030_write_reg16(unsigned long addr, unsigned val) | ||
291 | { | ||
292 | *((volatile unsigned short *)addr) = val; | ||
293 | r4030_delay(); | ||
294 | } | ||
295 | |||
296 | static inline void r4030_write_reg32(unsigned long addr, unsigned val) | ||
297 | { | ||
298 | *((volatile unsigned int *)addr) = val; | ||
299 | r4030_delay(); | ||
300 | } | ||
301 | |||
302 | #endif /* !__ASSEMBLY__ */ | ||
303 | |||
304 | #define JAZZ_FDC_BASE 0xe0003000 | ||
305 | #define JAZZ_RTC_BASE 0xe0004000 | ||
306 | #define JAZZ_PORT_BASE 0xe2000000 | ||
307 | |||
308 | #define JAZZ_EISA_BASE 0xe3000000 | ||
309 | |||
310 | #endif /* __ASM_JAZZ_H */ | ||
diff --git a/include/asm-mips/jazzdma.h b/include/asm-mips/jazzdma.h deleted file mode 100644 index 8bb37bba68f0..000000000000 --- a/include/asm-mips/jazzdma.h +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | /* | ||
2 | * Helpfile for jazzdma.c -- Mips Jazz R4030 DMA controller support | ||
3 | */ | ||
4 | #ifndef _ASM_JAZZDMA_H | ||
5 | #define _ASM_JAZZDMA_H | ||
6 | |||
7 | /* | ||
8 | * Prototypes and macros | ||
9 | */ | ||
10 | extern unsigned long vdma_alloc(unsigned long paddr, unsigned long size); | ||
11 | extern int vdma_free(unsigned long laddr); | ||
12 | extern int vdma_remap(unsigned long laddr, unsigned long paddr, | ||
13 | unsigned long size); | ||
14 | extern unsigned long vdma_phys2log(unsigned long paddr); | ||
15 | extern unsigned long vdma_log2phys(unsigned long laddr); | ||
16 | extern void vdma_stats(void); /* for debugging only */ | ||
17 | |||
18 | extern void vdma_enable(int channel); | ||
19 | extern void vdma_disable(int channel); | ||
20 | extern void vdma_set_mode(int channel, int mode); | ||
21 | extern void vdma_set_addr(int channel, long addr); | ||
22 | extern void vdma_set_count(int channel, int count); | ||
23 | extern int vdma_get_residue(int channel); | ||
24 | extern int vdma_get_enable(int channel); | ||
25 | |||
26 | /* | ||
27 | * some definitions used by the driver functions | ||
28 | */ | ||
29 | #define VDMA_PAGESIZE 4096 | ||
30 | #define VDMA_PGTBL_ENTRIES 4096 | ||
31 | #define VDMA_PGTBL_SIZE (sizeof(VDMA_PGTBL_ENTRY) * VDMA_PGTBL_ENTRIES) | ||
32 | #define VDMA_PAGE_EMPTY 0xff000000 | ||
33 | |||
34 | /* | ||
35 | * Macros to get page no. and offset of a given address | ||
36 | * Note that VDMA_PAGE() works for physical addresses only | ||
37 | */ | ||
38 | #define VDMA_PAGE(a) ((unsigned int)(a) >> 12) | ||
39 | #define VDMA_OFFSET(a) ((unsigned int)(a) & (VDMA_PAGESIZE-1)) | ||
40 | |||
41 | /* | ||
42 | * error code returned by vdma_alloc() | ||
43 | * (See also arch/mips/kernel/jazzdma.c) | ||
44 | */ | ||
45 | #define VDMA_ERROR 0xffffffff | ||
46 | |||
47 | /* | ||
48 | * VDMA pagetable entry description | ||
49 | */ | ||
50 | typedef volatile struct VDMA_PGTBL_ENTRY { | ||
51 | unsigned int frame; /* physical frame no. */ | ||
52 | unsigned int owner; /* owner of this entry (0=free) */ | ||
53 | } VDMA_PGTBL_ENTRY; | ||
54 | |||
55 | |||
56 | /* | ||
57 | * DMA channel control registers | ||
58 | * in the R4030 MCT_ADR chip | ||
59 | */ | ||
60 | #define JAZZ_R4030_CHNL_MODE 0xE0000100 /* 8 DMA Channel Mode Registers, */ | ||
61 | /* 0xE0000100,120,140... */ | ||
62 | #define JAZZ_R4030_CHNL_ENABLE 0xE0000108 /* 8 DMA Channel Enable Regs, */ | ||
63 | /* 0xE0000108,128,148... */ | ||
64 | #define JAZZ_R4030_CHNL_COUNT 0xE0000110 /* 8 DMA Channel Byte Cnt Regs, */ | ||
65 | /* 0xE0000110,130,150... */ | ||
66 | #define JAZZ_R4030_CHNL_ADDR 0xE0000118 /* 8 DMA Channel Address Regs, */ | ||
67 | /* 0xE0000118,138,158... */ | ||
68 | |||
69 | /* channel enable register bits */ | ||
70 | |||
71 | #define R4030_CHNL_ENABLE (1<<0) | ||
72 | #define R4030_CHNL_WRITE (1<<1) | ||
73 | #define R4030_TC_INTR (1<<8) | ||
74 | #define R4030_MEM_INTR (1<<9) | ||
75 | #define R4030_ADDR_INTR (1<<10) | ||
76 | |||
77 | /* | ||
78 | * Channel mode register bits | ||
79 | */ | ||
80 | #define R4030_MODE_ATIME_40 (0) /* device access time on remote bus */ | ||
81 | #define R4030_MODE_ATIME_80 (1) | ||
82 | #define R4030_MODE_ATIME_120 (2) | ||
83 | #define R4030_MODE_ATIME_160 (3) | ||
84 | #define R4030_MODE_ATIME_200 (4) | ||
85 | #define R4030_MODE_ATIME_240 (5) | ||
86 | #define R4030_MODE_ATIME_280 (6) | ||
87 | #define R4030_MODE_ATIME_320 (7) | ||
88 | #define R4030_MODE_WIDTH_8 (1<<3) /* device data bus width */ | ||
89 | #define R4030_MODE_WIDTH_16 (2<<3) | ||
90 | #define R4030_MODE_WIDTH_32 (3<<3) | ||
91 | #define R4030_MODE_INTR_EN (1<<5) | ||
92 | #define R4030_MODE_BURST (1<<6) /* Rev. 2 only */ | ||
93 | #define R4030_MODE_FAST_ACK (1<<7) /* Rev. 2 only */ | ||
94 | |||
95 | #endif /* _ASM_JAZZDMA_H */ | ||
diff --git a/include/asm-mips/kdebug.h b/include/asm-mips/kdebug.h deleted file mode 100644 index 5bf62aafc890..000000000000 --- a/include/asm-mips/kdebug.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #ifndef _ASM_MIPS_KDEBUG_H | ||
2 | #define _ASM_MIPS_KDEBUG_H | ||
3 | |||
4 | #include <linux/notifier.h> | ||
5 | |||
6 | enum die_val { | ||
7 | DIE_OOPS = 1, | ||
8 | DIE_FP, | ||
9 | DIE_TRAP, | ||
10 | DIE_RI, | ||
11 | }; | ||
12 | |||
13 | #endif /* _ASM_MIPS_KDEBUG_H */ | ||
diff --git a/include/asm-mips/kexec.h b/include/asm-mips/kexec.h deleted file mode 100644 index 4314892aaebb..000000000000 --- a/include/asm-mips/kexec.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* | ||
2 | * kexec.h for kexec | ||
3 | * Created by <nschichan@corp.free.fr> on Thu Oct 12 14:59:34 2006 | ||
4 | * | ||
5 | * This source code is licensed under the GNU General Public License, | ||
6 | * Version 2. See the file COPYING for more details. | ||
7 | */ | ||
8 | |||
9 | #ifndef _MIPS_KEXEC | ||
10 | # define _MIPS_KEXEC | ||
11 | |||
12 | /* Maximum physical address we can use pages from */ | ||
13 | #define KEXEC_SOURCE_MEMORY_LIMIT (0x20000000) | ||
14 | /* Maximum address we can reach in physical address mode */ | ||
15 | #define KEXEC_DESTINATION_MEMORY_LIMIT (0x20000000) | ||
16 | /* Maximum address we can use for the control code buffer */ | ||
17 | #define KEXEC_CONTROL_MEMORY_LIMIT (0x20000000) | ||
18 | |||
19 | #define KEXEC_CONTROL_PAGE_SIZE 4096 | ||
20 | |||
21 | /* The native architecture */ | ||
22 | #define KEXEC_ARCH KEXEC_ARCH_MIPS | ||
23 | |||
24 | static inline void crash_setup_regs(struct pt_regs *newregs, | ||
25 | struct pt_regs *oldregs) | ||
26 | { | ||
27 | /* Dummy implementation for now */ | ||
28 | } | ||
29 | |||
30 | #endif /* !_MIPS_KEXEC */ | ||
diff --git a/include/asm-mips/kgdb.h b/include/asm-mips/kgdb.h deleted file mode 100644 index 48223b09396c..000000000000 --- a/include/asm-mips/kgdb.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | #ifndef __ASM_KGDB_H_ | ||
2 | #define __ASM_KGDB_H_ | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <asm/sgidefs.h> | ||
7 | |||
8 | #if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \ | ||
9 | (_MIPS_ISA == _MIPS_ISA_MIPS32) | ||
10 | |||
11 | #define KGDB_GDB_REG_SIZE 32 | ||
12 | |||
13 | #elif (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \ | ||
14 | (_MIPS_ISA == _MIPS_ISA_MIPS64) | ||
15 | |||
16 | #ifdef CONFIG_32BIT | ||
17 | #define KGDB_GDB_REG_SIZE 32 | ||
18 | #else /* CONFIG_CPU_32BIT */ | ||
19 | #define KGDB_GDB_REG_SIZE 64 | ||
20 | #endif | ||
21 | #else | ||
22 | #error "Need to set KGDB_GDB_REG_SIZE for MIPS ISA" | ||
23 | #endif /* _MIPS_ISA */ | ||
24 | |||
25 | #define BUFMAX 2048 | ||
26 | #if (KGDB_GDB_REG_SIZE == 32) | ||
27 | #define NUMREGBYTES (90*sizeof(u32)) | ||
28 | #define NUMCRITREGBYTES (12*sizeof(u32)) | ||
29 | #else | ||
30 | #define NUMREGBYTES (90*sizeof(u64)) | ||
31 | #define NUMCRITREGBYTES (12*sizeof(u64)) | ||
32 | #endif | ||
33 | #define BREAK_INSTR_SIZE 4 | ||
34 | #define CACHE_FLUSH_IS_SAFE 0 | ||
35 | |||
36 | extern void arch_kgdb_breakpoint(void); | ||
37 | extern int kgdb_early_setup; | ||
38 | extern void *saved_vectors[32]; | ||
39 | extern void handle_exception(struct pt_regs *regs); | ||
40 | extern void breakinst(void); | ||
41 | |||
42 | #endif /* __KERNEL__ */ | ||
43 | |||
44 | #endif /* __ASM_KGDB_H_ */ | ||
diff --git a/include/asm-mips/kmap_types.h b/include/asm-mips/kmap_types.h deleted file mode 100644 index 806aae3c5338..000000000000 --- a/include/asm-mips/kmap_types.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | #ifndef _ASM_KMAP_TYPES_H | ||
2 | #define _ASM_KMAP_TYPES_H | ||
3 | |||
4 | |||
5 | #ifdef CONFIG_DEBUG_HIGHMEM | ||
6 | # define D(n) __KM_FENCE_##n , | ||
7 | #else | ||
8 | # define D(n) | ||
9 | #endif | ||
10 | |||
11 | enum km_type { | ||
12 | D(0) KM_BOUNCE_READ, | ||
13 | D(1) KM_SKB_SUNRPC_DATA, | ||
14 | D(2) KM_SKB_DATA_SOFTIRQ, | ||
15 | D(3) KM_USER0, | ||
16 | D(4) KM_USER1, | ||
17 | D(5) KM_BIO_SRC_IRQ, | ||
18 | D(6) KM_BIO_DST_IRQ, | ||
19 | D(7) KM_PTE0, | ||
20 | D(8) KM_PTE1, | ||
21 | D(9) KM_IRQ0, | ||
22 | D(10) KM_IRQ1, | ||
23 | D(11) KM_SOFTIRQ0, | ||
24 | D(12) KM_SOFTIRQ1, | ||
25 | D(13) KM_TYPE_NR | ||
26 | }; | ||
27 | |||
28 | #undef D | ||
29 | |||
30 | #endif | ||
diff --git a/include/asm-mips/kspd.h b/include/asm-mips/kspd.h deleted file mode 100644 index 4e9e724c8935..000000000000 --- a/include/asm-mips/kspd.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can distribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License (Version 2) as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
11 | * for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef _ASM_KSPD_H | ||
20 | #define _ASM_KSPD_H | ||
21 | |||
22 | struct kspd_notifications { | ||
23 | void (*kspd_sp_exit)(int sp_id); | ||
24 | |||
25 | struct list_head list; | ||
26 | }; | ||
27 | |||
28 | #ifdef CONFIG_MIPS_APSP_KSPD | ||
29 | extern void kspd_notify(struct kspd_notifications *notify); | ||
30 | #else | ||
31 | static inline void kspd_notify(struct kspd_notifications *notify) | ||
32 | { | ||
33 | } | ||
34 | #endif | ||
35 | |||
36 | #endif | ||
diff --git a/include/asm-mips/lasat/ds1603.h b/include/asm-mips/lasat/ds1603.h deleted file mode 100644 index edcd7544b358..000000000000 --- a/include/asm-mips/lasat/ds1603.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | #include <asm/addrspace.h> | ||
2 | |||
3 | /* Lasat 100 */ | ||
4 | #define DS1603_REG_100 (KSEG1ADDR(0x1c810000)) | ||
5 | #define DS1603_RST_100 (1 << 2) | ||
6 | #define DS1603_CLK_100 (1 << 0) | ||
7 | #define DS1603_DATA_SHIFT_100 1 | ||
8 | #define DS1603_DATA_100 (1 << DS1603_DATA_SHIFT_100) | ||
9 | |||
10 | /* Lasat 200 */ | ||
11 | #define DS1603_REG_200 (KSEG1ADDR(0x11000000)) | ||
12 | #define DS1603_RST_200 (1 << 3) | ||
13 | #define DS1603_CLK_200 (1 << 4) | ||
14 | #define DS1603_DATA_200 (1 << 5) | ||
15 | |||
16 | #define DS1603_DATA_REG_200 (DS1603_REG_200 + 0x10000) | ||
17 | #define DS1603_DATA_READ_SHIFT_200 9 | ||
18 | #define DS1603_DATA_READ_200 (1 << DS1603_DATA_READ_SHIFT_200) | ||
diff --git a/include/asm-mips/lasat/eeprom.h b/include/asm-mips/lasat/eeprom.h deleted file mode 100644 index 3dac203697fa..000000000000 --- a/include/asm-mips/lasat/eeprom.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #include <asm/addrspace.h> | ||
2 | |||
3 | /* lasat 100 */ | ||
4 | #define AT93C_REG_100 KSEG1ADDR(0x1c810000) | ||
5 | #define AT93C_RDATA_REG_100 AT93C_REG_100 | ||
6 | #define AT93C_RDATA_SHIFT_100 4 | ||
7 | #define AT93C_WDATA_SHIFT_100 4 | ||
8 | #define AT93C_CS_M_100 (1 << 5) | ||
9 | #define AT93C_CLK_M_100 (1 << 3) | ||
10 | |||
11 | /* lasat 200 */ | ||
12 | #define AT93C_REG_200 KSEG1ADDR(0x11000000) | ||
13 | #define AT93C_RDATA_REG_200 (AT93C_REG_200+0x10000) | ||
14 | #define AT93C_RDATA_SHIFT_200 8 | ||
15 | #define AT93C_WDATA_SHIFT_200 2 | ||
16 | #define AT93C_CS_M_200 (1 << 0) | ||
17 | #define AT93C_CLK_M_200 (1 << 1) | ||
diff --git a/include/asm-mips/lasat/head.h b/include/asm-mips/lasat/head.h deleted file mode 100644 index f5589f31a197..000000000000 --- a/include/asm-mips/lasat/head.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * Image header stuff | ||
3 | */ | ||
4 | #ifndef _HEAD_H | ||
5 | #define _HEAD_H | ||
6 | |||
7 | #define LASAT_K_MAGIC0_VAL 0xfedeabba | ||
8 | #define LASAT_K_MAGIC1_VAL 0x00bedead | ||
9 | |||
10 | #ifndef _LANGUAGE_ASSEMBLY | ||
11 | #include <linux/types.h> | ||
12 | struct bootloader_header { | ||
13 | u32 magic[2]; | ||
14 | u32 version; | ||
15 | u32 image_start; | ||
16 | u32 image_size; | ||
17 | u32 kernel_start; | ||
18 | u32 kernel_entry; | ||
19 | }; | ||
20 | #endif | ||
21 | |||
22 | #endif /* _HEAD_H */ | ||
diff --git a/include/asm-mips/lasat/lasat.h b/include/asm-mips/lasat/lasat.h deleted file mode 100644 index caeba1e302a2..000000000000 --- a/include/asm-mips/lasat/lasat.h +++ /dev/null | |||
@@ -1,258 +0,0 @@ | |||
1 | /* | ||
2 | * lasat.h | ||
3 | * | ||
4 | * Thomas Horsten <thh@lasat.com> | ||
5 | * Copyright (C) 2000 LASAT Networks A/S. | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | ||
20 | * Configuration for LASAT boards, loads the appropriate include files. | ||
21 | */ | ||
22 | #ifndef _LASAT_H | ||
23 | #define _LASAT_H | ||
24 | |||
25 | #ifndef _LANGUAGE_ASSEMBLY | ||
26 | |||
27 | extern struct lasat_misc { | ||
28 | volatile u32 *reset_reg; | ||
29 | volatile u32 *flash_wp_reg; | ||
30 | u32 flash_wp_bit; | ||
31 | } *lasat_misc; | ||
32 | |||
33 | enum lasat_mtdparts { | ||
34 | LASAT_MTD_BOOTLOADER, | ||
35 | LASAT_MTD_SERVICE, | ||
36 | LASAT_MTD_NORMAL, | ||
37 | LASAT_MTD_CONFIG, | ||
38 | LASAT_MTD_FS, | ||
39 | LASAT_MTD_LAST | ||
40 | }; | ||
41 | |||
42 | /* | ||
43 | * The format of the data record in the EEPROM. | ||
44 | * See Documentation/LASAT/eeprom.txt for a detailed description | ||
45 | * of the fields in this struct, and the LASAT Hardware Configuration | ||
46 | * field specification for a detailed description of the config | ||
47 | * field. | ||
48 | */ | ||
49 | #include <linux/types.h> | ||
50 | |||
51 | #define LASAT_EEPROM_VERSION 7 | ||
52 | struct lasat_eeprom_struct { | ||
53 | unsigned int version; | ||
54 | unsigned int cfg[3]; | ||
55 | unsigned char hwaddr[6]; | ||
56 | unsigned char print_partno[12]; | ||
57 | unsigned char term0; | ||
58 | unsigned char print_serial[14]; | ||
59 | unsigned char term1; | ||
60 | unsigned char prod_partno[12]; | ||
61 | unsigned char term2; | ||
62 | unsigned char prod_serial[14]; | ||
63 | unsigned char term3; | ||
64 | unsigned char passwd_hash[16]; | ||
65 | unsigned char pwdnull; | ||
66 | unsigned char vendid; | ||
67 | unsigned char ts_ref; | ||
68 | unsigned char ts_signoff; | ||
69 | unsigned char reserved[11]; | ||
70 | unsigned char debugaccess; | ||
71 | unsigned short prid; | ||
72 | unsigned int serviceflag; | ||
73 | unsigned int ipaddr; | ||
74 | unsigned int netmask; | ||
75 | unsigned int crc32; | ||
76 | }; | ||
77 | |||
78 | struct lasat_eeprom_struct_pre7 { | ||
79 | unsigned int version; | ||
80 | unsigned int flags[3]; | ||
81 | unsigned char hwaddr0[6]; | ||
82 | unsigned char hwaddr1[6]; | ||
83 | unsigned char print_partno[9]; | ||
84 | unsigned char term0; | ||
85 | unsigned char print_serial[14]; | ||
86 | unsigned char term1; | ||
87 | unsigned char prod_partno[9]; | ||
88 | unsigned char term2; | ||
89 | unsigned char prod_serial[14]; | ||
90 | unsigned char term3; | ||
91 | unsigned char passwd_hash[24]; | ||
92 | unsigned char pwdnull; | ||
93 | unsigned char vendor; | ||
94 | unsigned char ts_ref; | ||
95 | unsigned char ts_signoff; | ||
96 | unsigned char reserved[6]; | ||
97 | unsigned int writecount; | ||
98 | unsigned int ipaddr; | ||
99 | unsigned int netmask; | ||
100 | unsigned int crc32; | ||
101 | }; | ||
102 | |||
103 | /* Configuration descriptor encoding - see the doc for details */ | ||
104 | |||
105 | #define LASAT_W0_DSCTYPE(v) (((v)) & 0xf) | ||
106 | #define LASAT_W0_BMID(v) (((v) >> 0x04) & 0xf) | ||
107 | #define LASAT_W0_CPUTYPE(v) (((v) >> 0x08) & 0xf) | ||
108 | #define LASAT_W0_BUSSPEED(v) (((v) >> 0x0c) & 0xf) | ||
109 | #define LASAT_W0_CPUCLK(v) (((v) >> 0x10) & 0xf) | ||
110 | #define LASAT_W0_SDRAMBANKSZ(v) (((v) >> 0x14) & 0xf) | ||
111 | #define LASAT_W0_SDRAMBANKS(v) (((v) >> 0x18) & 0xf) | ||
112 | #define LASAT_W0_L2CACHE(v) (((v) >> 0x1c) & 0xf) | ||
113 | |||
114 | #define LASAT_W1_EDHAC(v) (((v)) & 0xf) | ||
115 | #define LASAT_W1_HIFN(v) (((v) >> 0x04) & 0x1) | ||
116 | #define LASAT_W1_ISDN(v) (((v) >> 0x05) & 0x1) | ||
117 | #define LASAT_W1_IDE(v) (((v) >> 0x06) & 0x1) | ||
118 | #define LASAT_W1_HDLC(v) (((v) >> 0x07) & 0x1) | ||
119 | #define LASAT_W1_USVERSION(v) (((v) >> 0x08) & 0x1) | ||
120 | #define LASAT_W1_4MACS(v) (((v) >> 0x09) & 0x1) | ||
121 | #define LASAT_W1_EXTSERIAL(v) (((v) >> 0x0a) & 0x1) | ||
122 | #define LASAT_W1_FLASHSIZE(v) (((v) >> 0x0c) & 0xf) | ||
123 | #define LASAT_W1_PCISLOTS(v) (((v) >> 0x10) & 0xf) | ||
124 | #define LASAT_W1_PCI1OPT(v) (((v) >> 0x14) & 0xf) | ||
125 | #define LASAT_W1_PCI2OPT(v) (((v) >> 0x18) & 0xf) | ||
126 | #define LASAT_W1_PCI3OPT(v) (((v) >> 0x1c) & 0xf) | ||
127 | |||
128 | /* Routines specific to LASAT boards */ | ||
129 | |||
130 | #define LASAT_BMID_MASQUERADE2 0 | ||
131 | #define LASAT_BMID_MASQUERADEPRO 1 | ||
132 | #define LASAT_BMID_SAFEPIPE25 2 | ||
133 | #define LASAT_BMID_SAFEPIPE50 3 | ||
134 | #define LASAT_BMID_SAFEPIPE100 4 | ||
135 | #define LASAT_BMID_SAFEPIPE5000 5 | ||
136 | #define LASAT_BMID_SAFEPIPE7000 6 | ||
137 | #define LASAT_BMID_SAFEPIPE1000 7 | ||
138 | #if 0 | ||
139 | #define LASAT_BMID_SAFEPIPE30 7 | ||
140 | #define LASAT_BMID_SAFEPIPE5100 8 | ||
141 | #define LASAT_BMID_SAFEPIPE7100 9 | ||
142 | #endif | ||
143 | #define LASAT_BMID_UNKNOWN 0xf | ||
144 | #define LASAT_MAX_BMID_NAMES 9 /* no larger than 15! */ | ||
145 | |||
146 | #define LASAT_HAS_EDHAC (1 << 0) | ||
147 | #define LASAT_EDHAC_FAST (1 << 1) | ||
148 | #define LASAT_HAS_EADI (1 << 2) | ||
149 | #define LASAT_HAS_HIFN (1 << 3) | ||
150 | #define LASAT_HAS_ISDN (1 << 4) | ||
151 | #define LASAT_HAS_LEASEDLINE_IF (1 << 5) | ||
152 | #define LASAT_HAS_HDC (1 << 6) | ||
153 | |||
154 | #define LASAT_PRID_MASQUERADE2 0 | ||
155 | #define LASAT_PRID_MASQUERADEPRO 1 | ||
156 | #define LASAT_PRID_SAFEPIPE25 2 | ||
157 | #define LASAT_PRID_SAFEPIPE50 3 | ||
158 | #define LASAT_PRID_SAFEPIPE100 4 | ||
159 | #define LASAT_PRID_SAFEPIPE5000 5 | ||
160 | #define LASAT_PRID_SAFEPIPE7000 6 | ||
161 | #define LASAT_PRID_SAFEPIPE30 7 | ||
162 | #define LASAT_PRID_SAFEPIPE5100 8 | ||
163 | #define LASAT_PRID_SAFEPIPE7100 9 | ||
164 | |||
165 | #define LASAT_PRID_SAFEPIPE1110 10 | ||
166 | #define LASAT_PRID_SAFEPIPE3020 11 | ||
167 | #define LASAT_PRID_SAFEPIPE3030 12 | ||
168 | #define LASAT_PRID_SAFEPIPE5020 13 | ||
169 | #define LASAT_PRID_SAFEPIPE5030 14 | ||
170 | #define LASAT_PRID_SAFEPIPE1120 15 | ||
171 | #define LASAT_PRID_SAFEPIPE1130 16 | ||
172 | #define LASAT_PRID_SAFEPIPE6010 17 | ||
173 | #define LASAT_PRID_SAFEPIPE6110 18 | ||
174 | #define LASAT_PRID_SAFEPIPE6210 19 | ||
175 | #define LASAT_PRID_SAFEPIPE1020 20 | ||
176 | #define LASAT_PRID_SAFEPIPE1040 21 | ||
177 | #define LASAT_PRID_SAFEPIPE1060 22 | ||
178 | |||
179 | struct lasat_info { | ||
180 | unsigned int li_cpu_hz; | ||
181 | unsigned int li_bus_hz; | ||
182 | unsigned int li_bmid; | ||
183 | unsigned int li_memsize; | ||
184 | unsigned int li_flash_size; | ||
185 | unsigned int li_prid; | ||
186 | unsigned char li_bmstr[16]; | ||
187 | unsigned char li_namestr[32]; | ||
188 | unsigned char li_typestr[16]; | ||
189 | /* Info on the Flash layout */ | ||
190 | unsigned int li_flash_base; | ||
191 | unsigned long li_flashpart_base[LASAT_MTD_LAST]; | ||
192 | unsigned long li_flashpart_size[LASAT_MTD_LAST]; | ||
193 | struct lasat_eeprom_struct li_eeprom_info; | ||
194 | unsigned int li_eeprom_upgrade_version; | ||
195 | unsigned int li_debugaccess; | ||
196 | }; | ||
197 | |||
198 | extern struct lasat_info lasat_board_info; | ||
199 | |||
200 | static inline unsigned long lasat_flash_partition_start(int partno) | ||
201 | { | ||
202 | if (partno < 0 || partno >= LASAT_MTD_LAST) | ||
203 | return 0; | ||
204 | |||
205 | return lasat_board_info.li_flashpart_base[partno]; | ||
206 | } | ||
207 | |||
208 | static inline unsigned long lasat_flash_partition_size(int partno) | ||
209 | { | ||
210 | if (partno < 0 || partno >= LASAT_MTD_LAST) | ||
211 | return 0; | ||
212 | |||
213 | return lasat_board_info.li_flashpart_size[partno]; | ||
214 | } | ||
215 | |||
216 | /* Called from setup() to initialize the global board_info struct */ | ||
217 | extern int lasat_init_board_info(void); | ||
218 | |||
219 | /* Write the modified EEPROM info struct */ | ||
220 | extern void lasat_write_eeprom_info(void); | ||
221 | |||
222 | #define N_MACHTYPES 2 | ||
223 | /* for calibration of delays */ | ||
224 | |||
225 | /* the lasat_ndelay function is necessary because it is used at an | ||
226 | * early stage of the boot process where ndelay is not calibrated. | ||
227 | * It is used for the bit-banging rtc and eeprom drivers */ | ||
228 | |||
229 | #include <linux/delay.h> | ||
230 | |||
231 | /* calculating with the slowest board with 100 MHz clock */ | ||
232 | #define LASAT_100_DIVIDER 20 | ||
233 | /* All 200's run at 250 MHz clock */ | ||
234 | #define LASAT_200_DIVIDER 8 | ||
235 | |||
236 | extern unsigned int lasat_ndelay_divider; | ||
237 | |||
238 | static inline void lasat_ndelay(unsigned int ns) | ||
239 | { | ||
240 | __delay(ns / lasat_ndelay_divider); | ||
241 | } | ||
242 | |||
243 | #define IS_LASAT_200() (current_cpu_data.cputype == CPU_R5000) | ||
244 | |||
245 | #endif /* !defined (_LANGUAGE_ASSEMBLY) */ | ||
246 | |||
247 | #define LASAT_SERVICEMODE_MAGIC_1 0xdeadbeef | ||
248 | #define LASAT_SERVICEMODE_MAGIC_2 0xfedeabba | ||
249 | |||
250 | /* Lasat 100 boards */ | ||
251 | #define LASAT_GT_BASE (KSEG1ADDR(0x14000000)) | ||
252 | |||
253 | /* Lasat 200 boards */ | ||
254 | #define Vrc5074_PHYS_BASE 0x1fa00000 | ||
255 | #define Vrc5074_BASE (KSEG1ADDR(Vrc5074_PHYS_BASE)) | ||
256 | #define PCI_WINDOW1 0x1a000000 | ||
257 | |||
258 | #endif /* _LASAT_H */ | ||
diff --git a/include/asm-mips/lasat/lasatint.h b/include/asm-mips/lasat/lasatint.h deleted file mode 100644 index e0d2458b43d0..000000000000 --- a/include/asm-mips/lasat/lasatint.h +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #ifndef __ASM_LASAT_LASATINT_H | ||
2 | #define __ASM_LASAT_LASATINT_H | ||
3 | |||
4 | /* lasat 100 */ | ||
5 | #define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000)) | ||
6 | #define LASAT_INT_MASK_REG_100 (KSEG1ADDR(0x1c890000)) | ||
7 | #define LASATINT_MASK_SHIFT_100 0 | ||
8 | |||
9 | /* lasat 200 */ | ||
10 | #define LASAT_INT_STATUS_REG_200 (KSEG1ADDR(0x1104003c)) | ||
11 | #define LASAT_INT_MASK_REG_200 (KSEG1ADDR(0x1104003c)) | ||
12 | #define LASATINT_MASK_SHIFT_200 16 | ||
13 | |||
14 | #endif /* __ASM_LASAT_LASATINT_H */ | ||
diff --git a/include/asm-mips/lasat/picvue.h b/include/asm-mips/lasat/picvue.h deleted file mode 100644 index 42a492edc40e..000000000000 --- a/include/asm-mips/lasat/picvue.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | /* Lasat 100 */ | ||
2 | #define PVC_REG_100 KSEG1ADDR(0x1c820000) | ||
3 | #define PVC_DATA_SHIFT_100 0 | ||
4 | #define PVC_DATA_M_100 0xFF | ||
5 | #define PVC_E_100 (1 << 8) | ||
6 | #define PVC_RW_100 (1 << 9) | ||
7 | #define PVC_RS_100 (1 << 10) | ||
8 | |||
9 | /* Lasat 200 */ | ||
10 | #define PVC_REG_200 KSEG1ADDR(0x11000000) | ||
11 | #define PVC_DATA_SHIFT_200 24 | ||
12 | #define PVC_DATA_M_200 (0xFF << PVC_DATA_SHIFT_200) | ||
13 | #define PVC_E_200 (1 << 16) | ||
14 | #define PVC_RW_200 (1 << 17) | ||
15 | #define PVC_RS_200 (1 << 18) | ||
diff --git a/include/asm-mips/lasat/serial.h b/include/asm-mips/lasat/serial.h deleted file mode 100644 index 1c37d70579b8..000000000000 --- a/include/asm-mips/lasat/serial.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #include <asm/lasat/lasat.h> | ||
2 | |||
3 | /* Lasat 100 boards serial configuration */ | ||
4 | #define LASAT_BASE_BAUD_100 (7372800 / 16) | ||
5 | #define LASAT_UART_REGS_BASE_100 0x1c8b0000 | ||
6 | #define LASAT_UART_REGS_SHIFT_100 2 | ||
7 | #define LASATINT_UART_100 16 | ||
8 | |||
9 | /* * LASAT 200 boards serial configuration */ | ||
10 | #define LASAT_BASE_BAUD_200 (100000000 / 16 / 12) | ||
11 | #define LASAT_UART_REGS_BASE_200 (Vrc5074_PHYS_BASE + 0x0300) | ||
12 | #define LASAT_UART_REGS_SHIFT_200 3 | ||
13 | #define LASATINT_UART_200 21 | ||
diff --git a/include/asm-mips/linkage.h b/include/asm-mips/linkage.h deleted file mode 100644 index e9a940d1b0c6..000000000000 --- a/include/asm-mips/linkage.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef __ASM_LINKAGE_H | ||
2 | #define __ASM_LINKAGE_H | ||
3 | |||
4 | #ifdef __ASSEMBLY__ | ||
5 | #include <asm/asm.h> | ||
6 | #endif | ||
7 | |||
8 | #define __weak __attribute__((weak)) | ||
9 | |||
10 | #endif | ||
diff --git a/include/asm-mips/local.h b/include/asm-mips/local.h deleted file mode 100644 index f96fd59e0845..000000000000 --- a/include/asm-mips/local.h +++ /dev/null | |||
@@ -1,221 +0,0 @@ | |||
1 | #ifndef _ARCH_MIPS_LOCAL_H | ||
2 | #define _ARCH_MIPS_LOCAL_H | ||
3 | |||
4 | #include <linux/percpu.h> | ||
5 | #include <linux/bitops.h> | ||
6 | #include <asm/atomic.h> | ||
7 | #include <asm/cmpxchg.h> | ||
8 | #include <asm/war.h> | ||
9 | |||
10 | typedef struct | ||
11 | { | ||
12 | atomic_long_t a; | ||
13 | } local_t; | ||
14 | |||
15 | #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } | ||
16 | |||
17 | #define local_read(l) atomic_long_read(&(l)->a) | ||
18 | #define local_set(l, i) atomic_long_set(&(l)->a, (i)) | ||
19 | |||
20 | #define local_add(i, l) atomic_long_add((i), (&(l)->a)) | ||
21 | #define local_sub(i, l) atomic_long_sub((i), (&(l)->a)) | ||
22 | #define local_inc(l) atomic_long_inc(&(l)->a) | ||
23 | #define local_dec(l) atomic_long_dec(&(l)->a) | ||
24 | |||
25 | /* | ||
26 | * Same as above, but return the result value | ||
27 | */ | ||
28 | static __inline__ long local_add_return(long i, local_t * l) | ||
29 | { | ||
30 | unsigned long result; | ||
31 | |||
32 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
33 | unsigned long temp; | ||
34 | |||
35 | __asm__ __volatile__( | ||
36 | " .set mips3 \n" | ||
37 | "1:" __LL "%1, %2 # local_add_return \n" | ||
38 | " addu %0, %1, %3 \n" | ||
39 | __SC "%0, %2 \n" | ||
40 | " beqzl %0, 1b \n" | ||
41 | " addu %0, %1, %3 \n" | ||
42 | " .set mips0 \n" | ||
43 | : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) | ||
44 | : "Ir" (i), "m" (l->a.counter) | ||
45 | : "memory"); | ||
46 | } else if (cpu_has_llsc) { | ||
47 | unsigned long temp; | ||
48 | |||
49 | __asm__ __volatile__( | ||
50 | " .set mips3 \n" | ||
51 | "1:" __LL "%1, %2 # local_add_return \n" | ||
52 | " addu %0, %1, %3 \n" | ||
53 | __SC "%0, %2 \n" | ||
54 | " beqz %0, 1b \n" | ||
55 | " addu %0, %1, %3 \n" | ||
56 | " .set mips0 \n" | ||
57 | : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) | ||
58 | : "Ir" (i), "m" (l->a.counter) | ||
59 | : "memory"); | ||
60 | } else { | ||
61 | unsigned long flags; | ||
62 | |||
63 | local_irq_save(flags); | ||
64 | result = l->a.counter; | ||
65 | result += i; | ||
66 | l->a.counter = result; | ||
67 | local_irq_restore(flags); | ||
68 | } | ||
69 | |||
70 | return result; | ||
71 | } | ||
72 | |||
73 | static __inline__ long local_sub_return(long i, local_t * l) | ||
74 | { | ||
75 | unsigned long result; | ||
76 | |||
77 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
78 | unsigned long temp; | ||
79 | |||
80 | __asm__ __volatile__( | ||
81 | " .set mips3 \n" | ||
82 | "1:" __LL "%1, %2 # local_sub_return \n" | ||
83 | " subu %0, %1, %3 \n" | ||
84 | __SC "%0, %2 \n" | ||
85 | " beqzl %0, 1b \n" | ||
86 | " subu %0, %1, %3 \n" | ||
87 | " .set mips0 \n" | ||
88 | : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) | ||
89 | : "Ir" (i), "m" (l->a.counter) | ||
90 | : "memory"); | ||
91 | } else if (cpu_has_llsc) { | ||
92 | unsigned long temp; | ||
93 | |||
94 | __asm__ __volatile__( | ||
95 | " .set mips3 \n" | ||
96 | "1:" __LL "%1, %2 # local_sub_return \n" | ||
97 | " subu %0, %1, %3 \n" | ||
98 | __SC "%0, %2 \n" | ||
99 | " beqz %0, 1b \n" | ||
100 | " subu %0, %1, %3 \n" | ||
101 | " .set mips0 \n" | ||
102 | : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) | ||
103 | : "Ir" (i), "m" (l->a.counter) | ||
104 | : "memory"); | ||
105 | } else { | ||
106 | unsigned long flags; | ||
107 | |||
108 | local_irq_save(flags); | ||
109 | result = l->a.counter; | ||
110 | result -= i; | ||
111 | l->a.counter = result; | ||
112 | local_irq_restore(flags); | ||
113 | } | ||
114 | |||
115 | return result; | ||
116 | } | ||
117 | |||
118 | #define local_cmpxchg(l, o, n) \ | ||
119 | ((long)cmpxchg_local(&((l)->a.counter), (o), (n))) | ||
120 | #define local_xchg(l, n) (xchg_local(&((l)->a.counter), (n))) | ||
121 | |||
122 | /** | ||
123 | * local_add_unless - add unless the number is a given value | ||
124 | * @l: pointer of type local_t | ||
125 | * @a: the amount to add to l... | ||
126 | * @u: ...unless l is equal to u. | ||
127 | * | ||
128 | * Atomically adds @a to @l, so long as it was not @u. | ||
129 | * Returns non-zero if @l was not @u, and zero otherwise. | ||
130 | */ | ||
131 | #define local_add_unless(l, a, u) \ | ||
132 | ({ \ | ||
133 | long c, old; \ | ||
134 | c = local_read(l); \ | ||
135 | while (c != (u) && (old = local_cmpxchg((l), c, c + (a))) != c) \ | ||
136 | c = old; \ | ||
137 | c != (u); \ | ||
138 | }) | ||
139 | #define local_inc_not_zero(l) local_add_unless((l), 1, 0) | ||
140 | |||
141 | #define local_dec_return(l) local_sub_return(1, (l)) | ||
142 | #define local_inc_return(l) local_add_return(1, (l)) | ||
143 | |||
144 | /* | ||
145 | * local_sub_and_test - subtract value from variable and test result | ||
146 | * @i: integer value to subtract | ||
147 | * @l: pointer of type local_t | ||
148 | * | ||
149 | * Atomically subtracts @i from @l and returns | ||
150 | * true if the result is zero, or false for all | ||
151 | * other cases. | ||
152 | */ | ||
153 | #define local_sub_and_test(i, l) (local_sub_return((i), (l)) == 0) | ||
154 | |||
155 | /* | ||
156 | * local_inc_and_test - increment and test | ||
157 | * @l: pointer of type local_t | ||
158 | * | ||
159 | * Atomically increments @l by 1 | ||
160 | * and returns true if the result is zero, or false for all | ||
161 | * other cases. | ||
162 | */ | ||
163 | #define local_inc_and_test(l) (local_inc_return(l) == 0) | ||
164 | |||
165 | /* | ||
166 | * local_dec_and_test - decrement by 1 and test | ||
167 | * @l: pointer of type local_t | ||
168 | * | ||
169 | * Atomically decrements @l by 1 and | ||
170 | * returns true if the result is 0, or false for all other | ||
171 | * cases. | ||
172 | */ | ||
173 | #define local_dec_and_test(l) (local_sub_return(1, (l)) == 0) | ||
174 | |||
175 | /* | ||
176 | * local_add_negative - add and test if negative | ||
177 | * @l: pointer of type local_t | ||
178 | * @i: integer value to add | ||
179 | * | ||
180 | * Atomically adds @i to @l and returns true | ||
181 | * if the result is negative, or false when | ||
182 | * result is greater than or equal to zero. | ||
183 | */ | ||
184 | #define local_add_negative(i, l) (local_add_return(i, (l)) < 0) | ||
185 | |||
186 | /* Use these for per-cpu local_t variables: on some archs they are | ||
187 | * much more efficient than these naive implementations. Note they take | ||
188 | * a variable, not an address. | ||
189 | */ | ||
190 | |||
191 | #define __local_inc(l) ((l)->a.counter++) | ||
192 | #define __local_dec(l) ((l)->a.counter++) | ||
193 | #define __local_add(i, l) ((l)->a.counter+=(i)) | ||
194 | #define __local_sub(i, l) ((l)->a.counter-=(i)) | ||
195 | |||
196 | /* Need to disable preemption for the cpu local counters otherwise we could | ||
197 | still access a variable of a previous CPU in a non atomic way. */ | ||
198 | #define cpu_local_wrap_v(l) \ | ||
199 | ({ local_t res__; \ | ||
200 | preempt_disable(); \ | ||
201 | res__ = (l); \ | ||
202 | preempt_enable(); \ | ||
203 | res__; }) | ||
204 | #define cpu_local_wrap(l) \ | ||
205 | ({ preempt_disable(); \ | ||
206 | l; \ | ||
207 | preempt_enable(); }) \ | ||
208 | |||
209 | #define cpu_local_read(l) cpu_local_wrap_v(local_read(&__get_cpu_var(l))) | ||
210 | #define cpu_local_set(l, i) cpu_local_wrap(local_set(&__get_cpu_var(l), (i))) | ||
211 | #define cpu_local_inc(l) cpu_local_wrap(local_inc(&__get_cpu_var(l))) | ||
212 | #define cpu_local_dec(l) cpu_local_wrap(local_dec(&__get_cpu_var(l))) | ||
213 | #define cpu_local_add(i, l) cpu_local_wrap(local_add((i), &__get_cpu_var(l))) | ||
214 | #define cpu_local_sub(i, l) cpu_local_wrap(local_sub((i), &__get_cpu_var(l))) | ||
215 | |||
216 | #define __cpu_local_inc(l) cpu_local_inc(l) | ||
217 | #define __cpu_local_dec(l) cpu_local_dec(l) | ||
218 | #define __cpu_local_add(i, l) cpu_local_add((i), (l)) | ||
219 | #define __cpu_local_sub(i, l) cpu_local_sub((i), (l)) | ||
220 | |||
221 | #endif /* _ARCH_MIPS_LOCAL_H */ | ||
diff --git a/include/asm-mips/m48t35.h b/include/asm-mips/m48t35.h deleted file mode 100644 index f44852e9a96d..000000000000 --- a/include/asm-mips/m48t35.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * Registers for the SGS-Thomson M48T35 Timekeeper RAM chip | ||
3 | */ | ||
4 | #ifndef _ASM_M48T35_H | ||
5 | #define _ASM_M48T35_H | ||
6 | |||
7 | #include <linux/spinlock.h> | ||
8 | |||
9 | extern spinlock_t rtc_lock; | ||
10 | |||
11 | struct m48t35_rtc { | ||
12 | volatile u8 pad[0x7ff8]; /* starts at 0x7ff8 */ | ||
13 | volatile u8 control; | ||
14 | volatile u8 sec; | ||
15 | volatile u8 min; | ||
16 | volatile u8 hour; | ||
17 | volatile u8 day; | ||
18 | volatile u8 date; | ||
19 | volatile u8 month; | ||
20 | volatile u8 year; | ||
21 | }; | ||
22 | |||
23 | #define M48T35_RTC_SET 0x80 | ||
24 | #define M48T35_RTC_STOPPED 0x80 | ||
25 | #define M48T35_RTC_READ 0x40 | ||
26 | |||
27 | #endif /* _ASM_M48T35_H */ | ||
diff --git a/include/asm-mips/m48t37.h b/include/asm-mips/m48t37.h deleted file mode 100644 index cabf86264f36..000000000000 --- a/include/asm-mips/m48t37.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * Registers for the SGS-Thomson M48T37 Timekeeper RAM chip | ||
3 | */ | ||
4 | #ifndef _ASM_M48T37_H | ||
5 | #define _ASM_M48T37_H | ||
6 | |||
7 | #include <linux/spinlock.h> | ||
8 | |||
9 | extern spinlock_t rtc_lock; | ||
10 | |||
11 | struct m48t37_rtc { | ||
12 | volatile u8 pad[0x7ff0]; /* NVRAM */ | ||
13 | volatile u8 flags; | ||
14 | volatile u8 century; | ||
15 | volatile u8 alarm_sec; | ||
16 | volatile u8 alarm_min; | ||
17 | volatile u8 alarm_hour; | ||
18 | volatile u8 alarm_data; | ||
19 | volatile u8 interrupts; | ||
20 | volatile u8 watchdog; | ||
21 | volatile u8 control; | ||
22 | volatile u8 sec; | ||
23 | volatile u8 min; | ||
24 | volatile u8 hour; | ||
25 | volatile u8 day; | ||
26 | volatile u8 date; | ||
27 | volatile u8 month; | ||
28 | volatile u8 year; | ||
29 | }; | ||
30 | |||
31 | #define M48T37_RTC_SET 0x80 | ||
32 | #define M48T37_RTC_STOPPED 0x80 | ||
33 | #define M48T37_RTC_READ 0x40 | ||
34 | |||
35 | #endif /* _ASM_M48T37_H */ | ||
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h deleted file mode 100644 index 0d302bad4492..000000000000 --- a/include/asm-mips/mach-au1x00/au1000.h +++ /dev/null | |||
@@ -1,1772 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * Include file for Alchemy Semiconductor's Au1k CPU. | ||
5 | * | ||
6 | * Copyright 2000-2001, 2006-2008 MontaVista Software Inc. | ||
7 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
15 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
17 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
20 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
21 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | */ | ||
29 | |||
30 | /* | ||
31 | * some definitions add by takuzo@sm.sony.co.jp and sato@sm.sony.co.jp | ||
32 | */ | ||
33 | |||
34 | #ifndef _AU1000_H_ | ||
35 | #define _AU1000_H_ | ||
36 | |||
37 | |||
38 | #ifndef _LANGUAGE_ASSEMBLY | ||
39 | |||
40 | #include <linux/delay.h> | ||
41 | #include <linux/types.h> | ||
42 | |||
43 | #include <linux/io.h> | ||
44 | #include <linux/irq.h> | ||
45 | |||
46 | /* cpu pipeline flush */ | ||
47 | void static inline au_sync(void) | ||
48 | { | ||
49 | __asm__ volatile ("sync"); | ||
50 | } | ||
51 | |||
52 | void static inline au_sync_udelay(int us) | ||
53 | { | ||
54 | __asm__ volatile ("sync"); | ||
55 | udelay(us); | ||
56 | } | ||
57 | |||
58 | void static inline au_sync_delay(int ms) | ||
59 | { | ||
60 | __asm__ volatile ("sync"); | ||
61 | mdelay(ms); | ||
62 | } | ||
63 | |||
64 | void static inline au_writeb(u8 val, unsigned long reg) | ||
65 | { | ||
66 | *(volatile u8 *)reg = val; | ||
67 | } | ||
68 | |||
69 | void static inline au_writew(u16 val, unsigned long reg) | ||
70 | { | ||
71 | *(volatile u16 *)reg = val; | ||
72 | } | ||
73 | |||
74 | void static inline au_writel(u32 val, unsigned long reg) | ||
75 | { | ||
76 | *(volatile u32 *)reg = val; | ||
77 | } | ||
78 | |||
79 | static inline u8 au_readb(unsigned long reg) | ||
80 | { | ||
81 | return *(volatile u8 *)reg; | ||
82 | } | ||
83 | |||
84 | static inline u16 au_readw(unsigned long reg) | ||
85 | { | ||
86 | return *(volatile u16 *)reg; | ||
87 | } | ||
88 | |||
89 | static inline u32 au_readl(unsigned long reg) | ||
90 | { | ||
91 | return *(volatile u32 *)reg; | ||
92 | } | ||
93 | |||
94 | |||
95 | /* arch/mips/au1000/common/clocks.c */ | ||
96 | extern void set_au1x00_speed(unsigned int new_freq); | ||
97 | extern unsigned int get_au1x00_speed(void); | ||
98 | extern void set_au1x00_uart_baud_base(unsigned long new_baud_base); | ||
99 | extern unsigned long get_au1x00_uart_baud_base(void); | ||
100 | extern void set_au1x00_lcd_clock(void); | ||
101 | extern unsigned int get_au1x00_lcd_clock(void); | ||
102 | |||
103 | /* | ||
104 | * Every board describes its IRQ mapping with this table. | ||
105 | */ | ||
106 | struct au1xxx_irqmap { | ||
107 | int im_irq; | ||
108 | int im_type; | ||
109 | int im_request; | ||
110 | }; | ||
111 | |||
112 | /* | ||
113 | * init_IRQ looks for a table with this name. | ||
114 | */ | ||
115 | extern struct au1xxx_irqmap au1xxx_irq_map[]; | ||
116 | |||
117 | #endif /* !defined (_LANGUAGE_ASSEMBLY) */ | ||
118 | |||
119 | /* | ||
120 | * SDRAM register offsets | ||
121 | */ | ||
122 | #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || \ | ||
123 | defined(CONFIG_SOC_AU1100) | ||
124 | #define MEM_SDMODE0 0x0000 | ||
125 | #define MEM_SDMODE1 0x0004 | ||
126 | #define MEM_SDMODE2 0x0008 | ||
127 | #define MEM_SDADDR0 0x000C | ||
128 | #define MEM_SDADDR1 0x0010 | ||
129 | #define MEM_SDADDR2 0x0014 | ||
130 | #define MEM_SDREFCFG 0x0018 | ||
131 | #define MEM_SDPRECMD 0x001C | ||
132 | #define MEM_SDAUTOREF 0x0020 | ||
133 | #define MEM_SDWRMD0 0x0024 | ||
134 | #define MEM_SDWRMD1 0x0028 | ||
135 | #define MEM_SDWRMD2 0x002C | ||
136 | #define MEM_SDSLEEP 0x0030 | ||
137 | #define MEM_SDSMCKE 0x0034 | ||
138 | |||
139 | /* | ||
140 | * MEM_SDMODE register content definitions | ||
141 | */ | ||
142 | #define MEM_SDMODE_F (1 << 22) | ||
143 | #define MEM_SDMODE_SR (1 << 21) | ||
144 | #define MEM_SDMODE_BS (1 << 20) | ||
145 | #define MEM_SDMODE_RS (3 << 18) | ||
146 | #define MEM_SDMODE_CS (7 << 15) | ||
147 | #define MEM_SDMODE_TRAS (15 << 11) | ||
148 | #define MEM_SDMODE_TMRD (3 << 9) | ||
149 | #define MEM_SDMODE_TWR (3 << 7) | ||
150 | #define MEM_SDMODE_TRP (3 << 5) | ||
151 | #define MEM_SDMODE_TRCD (3 << 3) | ||
152 | #define MEM_SDMODE_TCL (7 << 0) | ||
153 | |||
154 | #define MEM_SDMODE_BS_2Bank (0 << 20) | ||
155 | #define MEM_SDMODE_BS_4Bank (1 << 20) | ||
156 | #define MEM_SDMODE_RS_11Row (0 << 18) | ||
157 | #define MEM_SDMODE_RS_12Row (1 << 18) | ||
158 | #define MEM_SDMODE_RS_13Row (2 << 18) | ||
159 | #define MEM_SDMODE_RS_N(N) ((N) << 18) | ||
160 | #define MEM_SDMODE_CS_7Col (0 << 15) | ||
161 | #define MEM_SDMODE_CS_8Col (1 << 15) | ||
162 | #define MEM_SDMODE_CS_9Col (2 << 15) | ||
163 | #define MEM_SDMODE_CS_10Col (3 << 15) | ||
164 | #define MEM_SDMODE_CS_11Col (4 << 15) | ||
165 | #define MEM_SDMODE_CS_N(N) ((N) << 15) | ||
166 | #define MEM_SDMODE_TRAS_N(N) ((N) << 11) | ||
167 | #define MEM_SDMODE_TMRD_N(N) ((N) << 9) | ||
168 | #define MEM_SDMODE_TWR_N(N) ((N) << 7) | ||
169 | #define MEM_SDMODE_TRP_N(N) ((N) << 5) | ||
170 | #define MEM_SDMODE_TRCD_N(N) ((N) << 3) | ||
171 | #define MEM_SDMODE_TCL_N(N) ((N) << 0) | ||
172 | |||
173 | /* | ||
174 | * MEM_SDADDR register contents definitions | ||
175 | */ | ||
176 | #define MEM_SDADDR_E (1 << 20) | ||
177 | #define MEM_SDADDR_CSBA (0x03FF << 10) | ||
178 | #define MEM_SDADDR_CSMASK (0x03FF << 0) | ||
179 | #define MEM_SDADDR_CSBA_N(N) ((N) & (0x03FF << 22) >> 12) | ||
180 | #define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF << 22) >> 22) | ||
181 | |||
182 | /* | ||
183 | * MEM_SDREFCFG register content definitions | ||
184 | */ | ||
185 | #define MEM_SDREFCFG_TRC (15 << 28) | ||
186 | #define MEM_SDREFCFG_TRPM (3 << 26) | ||
187 | #define MEM_SDREFCFG_E (1 << 25) | ||
188 | #define MEM_SDREFCFG_RE (0x1ffffff << 0) | ||
189 | #define MEM_SDREFCFG_TRC_N(N) ((N) << MEM_SDREFCFG_TRC) | ||
190 | #define MEM_SDREFCFG_TRPM_N(N) ((N) << MEM_SDREFCFG_TRPM) | ||
191 | #define MEM_SDREFCFG_REF_N(N) (N) | ||
192 | #endif | ||
193 | |||
194 | /***********************************************************************/ | ||
195 | |||
196 | /* | ||
197 | * Au1550 SDRAM Register Offsets | ||
198 | */ | ||
199 | |||
200 | /***********************************************************************/ | ||
201 | |||
202 | #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) | ||
203 | #define MEM_SDMODE0 0x0800 | ||
204 | #define MEM_SDMODE1 0x0808 | ||
205 | #define MEM_SDMODE2 0x0810 | ||
206 | #define MEM_SDADDR0 0x0820 | ||
207 | #define MEM_SDADDR1 0x0828 | ||
208 | #define MEM_SDADDR2 0x0830 | ||
209 | #define MEM_SDCONFIGA 0x0840 | ||
210 | #define MEM_SDCONFIGB 0x0848 | ||
211 | #define MEM_SDSTAT 0x0850 | ||
212 | #define MEM_SDERRADDR 0x0858 | ||
213 | #define MEM_SDSTRIDE0 0x0860 | ||
214 | #define MEM_SDSTRIDE1 0x0868 | ||
215 | #define MEM_SDSTRIDE2 0x0870 | ||
216 | #define MEM_SDWRMD0 0x0880 | ||
217 | #define MEM_SDWRMD1 0x0888 | ||
218 | #define MEM_SDWRMD2 0x0890 | ||
219 | #define MEM_SDPRECMD 0x08C0 | ||
220 | #define MEM_SDAUTOREF 0x08C8 | ||
221 | #define MEM_SDSREF 0x08D0 | ||
222 | #define MEM_SDSLEEP MEM_SDSREF | ||
223 | |||
224 | #endif | ||
225 | |||
226 | /* | ||
227 | * Physical base addresses for integrated peripherals | ||
228 | */ | ||
229 | |||
230 | #ifdef CONFIG_SOC_AU1000 | ||
231 | #define MEM_PHYS_ADDR 0x14000000 | ||
232 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | ||
233 | #define DMA0_PHYS_ADDR 0x14002000 | ||
234 | #define DMA1_PHYS_ADDR 0x14002100 | ||
235 | #define DMA2_PHYS_ADDR 0x14002200 | ||
236 | #define DMA3_PHYS_ADDR 0x14002300 | ||
237 | #define DMA4_PHYS_ADDR 0x14002400 | ||
238 | #define DMA5_PHYS_ADDR 0x14002500 | ||
239 | #define DMA6_PHYS_ADDR 0x14002600 | ||
240 | #define DMA7_PHYS_ADDR 0x14002700 | ||
241 | #define IC0_PHYS_ADDR 0x10400000 | ||
242 | #define IC1_PHYS_ADDR 0x11800000 | ||
243 | #define AC97_PHYS_ADDR 0x10000000 | ||
244 | #define USBH_PHYS_ADDR 0x10100000 | ||
245 | #define USBD_PHYS_ADDR 0x10200000 | ||
246 | #define IRDA_PHYS_ADDR 0x10300000 | ||
247 | #define MAC0_PHYS_ADDR 0x10500000 | ||
248 | #define MAC1_PHYS_ADDR 0x10510000 | ||
249 | #define MACEN_PHYS_ADDR 0x10520000 | ||
250 | #define MACDMA0_PHYS_ADDR 0x14004000 | ||
251 | #define MACDMA1_PHYS_ADDR 0x14004200 | ||
252 | #define I2S_PHYS_ADDR 0x11000000 | ||
253 | #define UART0_PHYS_ADDR 0x11100000 | ||
254 | #define UART1_PHYS_ADDR 0x11200000 | ||
255 | #define UART2_PHYS_ADDR 0x11300000 | ||
256 | #define UART3_PHYS_ADDR 0x11400000 | ||
257 | #define SSI0_PHYS_ADDR 0x11600000 | ||
258 | #define SSI1_PHYS_ADDR 0x11680000 | ||
259 | #define SYS_PHYS_ADDR 0x11900000 | ||
260 | #define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL | ||
261 | #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL | ||
262 | #define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL | ||
263 | #endif | ||
264 | |||
265 | /********************************************************************/ | ||
266 | |||
267 | #ifdef CONFIG_SOC_AU1500 | ||
268 | #define MEM_PHYS_ADDR 0x14000000 | ||
269 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | ||
270 | #define DMA0_PHYS_ADDR 0x14002000 | ||
271 | #define DMA1_PHYS_ADDR 0x14002100 | ||
272 | #define DMA2_PHYS_ADDR 0x14002200 | ||
273 | #define DMA3_PHYS_ADDR 0x14002300 | ||
274 | #define DMA4_PHYS_ADDR 0x14002400 | ||
275 | #define DMA5_PHYS_ADDR 0x14002500 | ||
276 | #define DMA6_PHYS_ADDR 0x14002600 | ||
277 | #define DMA7_PHYS_ADDR 0x14002700 | ||
278 | #define IC0_PHYS_ADDR 0x10400000 | ||
279 | #define IC1_PHYS_ADDR 0x11800000 | ||
280 | #define AC97_PHYS_ADDR 0x10000000 | ||
281 | #define USBH_PHYS_ADDR 0x10100000 | ||
282 | #define USBD_PHYS_ADDR 0x10200000 | ||
283 | #define PCI_PHYS_ADDR 0x14005000 | ||
284 | #define MAC0_PHYS_ADDR 0x11500000 | ||
285 | #define MAC1_PHYS_ADDR 0x11510000 | ||
286 | #define MACEN_PHYS_ADDR 0x11520000 | ||
287 | #define MACDMA0_PHYS_ADDR 0x14004000 | ||
288 | #define MACDMA1_PHYS_ADDR 0x14004200 | ||
289 | #define I2S_PHYS_ADDR 0x11000000 | ||
290 | #define UART0_PHYS_ADDR 0x11100000 | ||
291 | #define UART3_PHYS_ADDR 0x11400000 | ||
292 | #define GPIO2_PHYS_ADDR 0x11700000 | ||
293 | #define SYS_PHYS_ADDR 0x11900000 | ||
294 | #define PCI_MEM_PHYS_ADDR 0x400000000ULL | ||
295 | #define PCI_IO_PHYS_ADDR 0x500000000ULL | ||
296 | #define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL | ||
297 | #define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL | ||
298 | #define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL | ||
299 | #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL | ||
300 | #define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL | ||
301 | #endif | ||
302 | |||
303 | /********************************************************************/ | ||
304 | |||
305 | #ifdef CONFIG_SOC_AU1100 | ||
306 | #define MEM_PHYS_ADDR 0x14000000 | ||
307 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | ||
308 | #define DMA0_PHYS_ADDR 0x14002000 | ||
309 | #define DMA1_PHYS_ADDR 0x14002100 | ||
310 | #define DMA2_PHYS_ADDR 0x14002200 | ||
311 | #define DMA3_PHYS_ADDR 0x14002300 | ||
312 | #define DMA4_PHYS_ADDR 0x14002400 | ||
313 | #define DMA5_PHYS_ADDR 0x14002500 | ||
314 | #define DMA6_PHYS_ADDR 0x14002600 | ||
315 | #define DMA7_PHYS_ADDR 0x14002700 | ||
316 | #define IC0_PHYS_ADDR 0x10400000 | ||
317 | #define SD0_PHYS_ADDR 0x10600000 | ||
318 | #define SD1_PHYS_ADDR 0x10680000 | ||
319 | #define IC1_PHYS_ADDR 0x11800000 | ||
320 | #define AC97_PHYS_ADDR 0x10000000 | ||
321 | #define USBH_PHYS_ADDR 0x10100000 | ||
322 | #define USBD_PHYS_ADDR 0x10200000 | ||
323 | #define IRDA_PHYS_ADDR 0x10300000 | ||
324 | #define MAC0_PHYS_ADDR 0x10500000 | ||
325 | #define MACEN_PHYS_ADDR 0x10520000 | ||
326 | #define MACDMA0_PHYS_ADDR 0x14004000 | ||
327 | #define MACDMA1_PHYS_ADDR 0x14004200 | ||
328 | #define I2S_PHYS_ADDR 0x11000000 | ||
329 | #define UART0_PHYS_ADDR 0x11100000 | ||
330 | #define UART1_PHYS_ADDR 0x11200000 | ||
331 | #define UART3_PHYS_ADDR 0x11400000 | ||
332 | #define SSI0_PHYS_ADDR 0x11600000 | ||
333 | #define SSI1_PHYS_ADDR 0x11680000 | ||
334 | #define GPIO2_PHYS_ADDR 0x11700000 | ||
335 | #define SYS_PHYS_ADDR 0x11900000 | ||
336 | #define LCD_PHYS_ADDR 0x15000000 | ||
337 | #define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL | ||
338 | #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL | ||
339 | #define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL | ||
340 | #endif | ||
341 | |||
342 | /***********************************************************************/ | ||
343 | |||
344 | #ifdef CONFIG_SOC_AU1550 | ||
345 | #define MEM_PHYS_ADDR 0x14000000 | ||
346 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | ||
347 | #define IC0_PHYS_ADDR 0x10400000 | ||
348 | #define IC1_PHYS_ADDR 0x11800000 | ||
349 | #define USBH_PHYS_ADDR 0x14020000 | ||
350 | #define USBD_PHYS_ADDR 0x10200000 | ||
351 | #define PCI_PHYS_ADDR 0x14005000 | ||
352 | #define MAC0_PHYS_ADDR 0x10500000 | ||
353 | #define MAC1_PHYS_ADDR 0x10510000 | ||
354 | #define MACEN_PHYS_ADDR 0x10520000 | ||
355 | #define MACDMA0_PHYS_ADDR 0x14004000 | ||
356 | #define MACDMA1_PHYS_ADDR 0x14004200 | ||
357 | #define UART0_PHYS_ADDR 0x11100000 | ||
358 | #define UART1_PHYS_ADDR 0x11200000 | ||
359 | #define UART3_PHYS_ADDR 0x11400000 | ||
360 | #define GPIO2_PHYS_ADDR 0x11700000 | ||
361 | #define SYS_PHYS_ADDR 0x11900000 | ||
362 | #define DDMA_PHYS_ADDR 0x14002000 | ||
363 | #define PE_PHYS_ADDR 0x14008000 | ||
364 | #define PSC0_PHYS_ADDR 0x11A00000 | ||
365 | #define PSC1_PHYS_ADDR 0x11B00000 | ||
366 | #define PSC2_PHYS_ADDR 0x10A00000 | ||
367 | #define PSC3_PHYS_ADDR 0x10B00000 | ||
368 | #define PCI_MEM_PHYS_ADDR 0x400000000ULL | ||
369 | #define PCI_IO_PHYS_ADDR 0x500000000ULL | ||
370 | #define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL | ||
371 | #define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL | ||
372 | #define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL | ||
373 | #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL | ||
374 | #define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL | ||
375 | #endif | ||
376 | |||
377 | /***********************************************************************/ | ||
378 | |||
379 | #ifdef CONFIG_SOC_AU1200 | ||
380 | #define MEM_PHYS_ADDR 0x14000000 | ||
381 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | ||
382 | #define AES_PHYS_ADDR 0x10300000 | ||
383 | #define CIM_PHYS_ADDR 0x14004000 | ||
384 | #define IC0_PHYS_ADDR 0x10400000 | ||
385 | #define IC1_PHYS_ADDR 0x11800000 | ||
386 | #define USBM_PHYS_ADDR 0x14020000 | ||
387 | #define USBH_PHYS_ADDR 0x14020100 | ||
388 | #define UART0_PHYS_ADDR 0x11100000 | ||
389 | #define UART1_PHYS_ADDR 0x11200000 | ||
390 | #define GPIO2_PHYS_ADDR 0x11700000 | ||
391 | #define SYS_PHYS_ADDR 0x11900000 | ||
392 | #define DDMA_PHYS_ADDR 0x14002000 | ||
393 | #define PSC0_PHYS_ADDR 0x11A00000 | ||
394 | #define PSC1_PHYS_ADDR 0x11B00000 | ||
395 | #define SD0_PHYS_ADDR 0x10600000 | ||
396 | #define SD1_PHYS_ADDR 0x10680000 | ||
397 | #define LCD_PHYS_ADDR 0x15000000 | ||
398 | #define SWCNT_PHYS_ADDR 0x1110010C | ||
399 | #define MAEFE_PHYS_ADDR 0x14012000 | ||
400 | #define MAEBE_PHYS_ADDR 0x14010000 | ||
401 | #define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL | ||
402 | #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL | ||
403 | #define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL | ||
404 | #endif | ||
405 | |||
406 | /* Static Bus Controller */ | ||
407 | #define MEM_STCFG0 0xB4001000 | ||
408 | #define MEM_STTIME0 0xB4001004 | ||
409 | #define MEM_STADDR0 0xB4001008 | ||
410 | |||
411 | #define MEM_STCFG1 0xB4001010 | ||
412 | #define MEM_STTIME1 0xB4001014 | ||
413 | #define MEM_STADDR1 0xB4001018 | ||
414 | |||
415 | #define MEM_STCFG2 0xB4001020 | ||
416 | #define MEM_STTIME2 0xB4001024 | ||
417 | #define MEM_STADDR2 0xB4001028 | ||
418 | |||
419 | #define MEM_STCFG3 0xB4001030 | ||
420 | #define MEM_STTIME3 0xB4001034 | ||
421 | #define MEM_STADDR3 0xB4001038 | ||
422 | |||
423 | #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) | ||
424 | #define MEM_STNDCTL 0xB4001100 | ||
425 | #define MEM_STSTAT 0xB4001104 | ||
426 | |||
427 | #define MEM_STNAND_CMD 0x0 | ||
428 | #define MEM_STNAND_ADDR 0x4 | ||
429 | #define MEM_STNAND_DATA 0x20 | ||
430 | #endif | ||
431 | |||
432 | /* Interrupt Controller 0 */ | ||
433 | #define IC0_CFG0RD 0xB0400040 | ||
434 | #define IC0_CFG0SET 0xB0400040 | ||
435 | #define IC0_CFG0CLR 0xB0400044 | ||
436 | |||
437 | #define IC0_CFG1RD 0xB0400048 | ||
438 | #define IC0_CFG1SET 0xB0400048 | ||
439 | #define IC0_CFG1CLR 0xB040004C | ||
440 | |||
441 | #define IC0_CFG2RD 0xB0400050 | ||
442 | #define IC0_CFG2SET 0xB0400050 | ||
443 | #define IC0_CFG2CLR 0xB0400054 | ||
444 | |||
445 | #define IC0_REQ0INT 0xB0400054 | ||
446 | #define IC0_SRCRD 0xB0400058 | ||
447 | #define IC0_SRCSET 0xB0400058 | ||
448 | #define IC0_SRCCLR 0xB040005C | ||
449 | #define IC0_REQ1INT 0xB040005C | ||
450 | |||
451 | #define IC0_ASSIGNRD 0xB0400060 | ||
452 | #define IC0_ASSIGNSET 0xB0400060 | ||
453 | #define IC0_ASSIGNCLR 0xB0400064 | ||
454 | |||
455 | #define IC0_WAKERD 0xB0400068 | ||
456 | #define IC0_WAKESET 0xB0400068 | ||
457 | #define IC0_WAKECLR 0xB040006C | ||
458 | |||
459 | #define IC0_MASKRD 0xB0400070 | ||
460 | #define IC0_MASKSET 0xB0400070 | ||
461 | #define IC0_MASKCLR 0xB0400074 | ||
462 | |||
463 | #define IC0_RISINGRD 0xB0400078 | ||
464 | #define IC0_RISINGCLR 0xB0400078 | ||
465 | #define IC0_FALLINGRD 0xB040007C | ||
466 | #define IC0_FALLINGCLR 0xB040007C | ||
467 | |||
468 | #define IC0_TESTBIT 0xB0400080 | ||
469 | |||
470 | /* Interrupt Controller 1 */ | ||
471 | #define IC1_CFG0RD 0xB1800040 | ||
472 | #define IC1_CFG0SET 0xB1800040 | ||
473 | #define IC1_CFG0CLR 0xB1800044 | ||
474 | |||
475 | #define IC1_CFG1RD 0xB1800048 | ||
476 | #define IC1_CFG1SET 0xB1800048 | ||
477 | #define IC1_CFG1CLR 0xB180004C | ||
478 | |||
479 | #define IC1_CFG2RD 0xB1800050 | ||
480 | #define IC1_CFG2SET 0xB1800050 | ||
481 | #define IC1_CFG2CLR 0xB1800054 | ||
482 | |||
483 | #define IC1_REQ0INT 0xB1800054 | ||
484 | #define IC1_SRCRD 0xB1800058 | ||
485 | #define IC1_SRCSET 0xB1800058 | ||
486 | #define IC1_SRCCLR 0xB180005C | ||
487 | #define IC1_REQ1INT 0xB180005C | ||
488 | |||
489 | #define IC1_ASSIGNRD 0xB1800060 | ||
490 | #define IC1_ASSIGNSET 0xB1800060 | ||
491 | #define IC1_ASSIGNCLR 0xB1800064 | ||
492 | |||
493 | #define IC1_WAKERD 0xB1800068 | ||
494 | #define IC1_WAKESET 0xB1800068 | ||
495 | #define IC1_WAKECLR 0xB180006C | ||
496 | |||
497 | #define IC1_MASKRD 0xB1800070 | ||
498 | #define IC1_MASKSET 0xB1800070 | ||
499 | #define IC1_MASKCLR 0xB1800074 | ||
500 | |||
501 | #define IC1_RISINGRD 0xB1800078 | ||
502 | #define IC1_RISINGCLR 0xB1800078 | ||
503 | #define IC1_FALLINGRD 0xB180007C | ||
504 | #define IC1_FALLINGCLR 0xB180007C | ||
505 | |||
506 | #define IC1_TESTBIT 0xB1800080 | ||
507 | |||
508 | /* Interrupt Configuration Modes */ | ||
509 | #define INTC_INT_DISABLED 0x0 | ||
510 | #define INTC_INT_RISE_EDGE 0x1 | ||
511 | #define INTC_INT_FALL_EDGE 0x2 | ||
512 | #define INTC_INT_RISE_AND_FALL_EDGE 0x3 | ||
513 | #define INTC_INT_HIGH_LEVEL 0x5 | ||
514 | #define INTC_INT_LOW_LEVEL 0x6 | ||
515 | #define INTC_INT_HIGH_AND_LOW_LEVEL 0x7 | ||
516 | |||
517 | /* Interrupt Numbers */ | ||
518 | /* Au1000 */ | ||
519 | #ifdef CONFIG_SOC_AU1000 | ||
520 | enum soc_au1000_ints { | ||
521 | AU1000_FIRST_INT = MIPS_CPU_IRQ_BASE + 8, | ||
522 | AU1000_UART0_INT = AU1000_FIRST_INT, | ||
523 | AU1000_UART1_INT, /* au1000 */ | ||
524 | AU1000_UART2_INT, /* au1000 */ | ||
525 | AU1000_UART3_INT, | ||
526 | AU1000_SSI0_INT, /* au1000 */ | ||
527 | AU1000_SSI1_INT, /* au1000 */ | ||
528 | AU1000_DMA_INT_BASE, | ||
529 | |||
530 | AU1000_TOY_INT = AU1000_FIRST_INT + 14, | ||
531 | AU1000_TOY_MATCH0_INT, | ||
532 | AU1000_TOY_MATCH1_INT, | ||
533 | AU1000_TOY_MATCH2_INT, | ||
534 | AU1000_RTC_INT, | ||
535 | AU1000_RTC_MATCH0_INT, | ||
536 | AU1000_RTC_MATCH1_INT, | ||
537 | AU1000_RTC_MATCH2_INT, | ||
538 | AU1000_IRDA_TX_INT, /* au1000 */ | ||
539 | AU1000_IRDA_RX_INT, /* au1000 */ | ||
540 | AU1000_USB_DEV_REQ_INT, | ||
541 | AU1000_USB_DEV_SUS_INT, | ||
542 | AU1000_USB_HOST_INT, | ||
543 | AU1000_ACSYNC_INT, | ||
544 | AU1000_MAC0_DMA_INT, | ||
545 | AU1000_MAC1_DMA_INT, | ||
546 | AU1000_I2S_UO_INT, /* au1000 */ | ||
547 | AU1000_AC97C_INT, | ||
548 | AU1000_GPIO_0, | ||
549 | AU1000_GPIO_1, | ||
550 | AU1000_GPIO_2, | ||
551 | AU1000_GPIO_3, | ||
552 | AU1000_GPIO_4, | ||
553 | AU1000_GPIO_5, | ||
554 | AU1000_GPIO_6, | ||
555 | AU1000_GPIO_7, | ||
556 | AU1000_GPIO_8, | ||
557 | AU1000_GPIO_9, | ||
558 | AU1000_GPIO_10, | ||
559 | AU1000_GPIO_11, | ||
560 | AU1000_GPIO_12, | ||
561 | AU1000_GPIO_13, | ||
562 | AU1000_GPIO_14, | ||
563 | AU1000_GPIO_15, | ||
564 | AU1000_GPIO_16, | ||
565 | AU1000_GPIO_17, | ||
566 | AU1000_GPIO_18, | ||
567 | AU1000_GPIO_19, | ||
568 | AU1000_GPIO_20, | ||
569 | AU1000_GPIO_21, | ||
570 | AU1000_GPIO_22, | ||
571 | AU1000_GPIO_23, | ||
572 | AU1000_GPIO_24, | ||
573 | AU1000_GPIO_25, | ||
574 | AU1000_GPIO_26, | ||
575 | AU1000_GPIO_27, | ||
576 | AU1000_GPIO_28, | ||
577 | AU1000_GPIO_29, | ||
578 | AU1000_GPIO_30, | ||
579 | AU1000_GPIO_31, | ||
580 | }; | ||
581 | |||
582 | #define UART0_ADDR 0xB1100000 | ||
583 | #define UART1_ADDR 0xB1200000 | ||
584 | #define UART2_ADDR 0xB1300000 | ||
585 | #define UART3_ADDR 0xB1400000 | ||
586 | |||
587 | #define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */ | ||
588 | #define USB_HOST_CONFIG 0xB017FFFC | ||
589 | |||
590 | #define AU1000_ETH0_BASE 0xB0500000 | ||
591 | #define AU1000_ETH1_BASE 0xB0510000 | ||
592 | #define AU1000_MAC0_ENABLE 0xB0520000 | ||
593 | #define AU1000_MAC1_ENABLE 0xB0520004 | ||
594 | #define NUM_ETH_INTERFACES 2 | ||
595 | #endif /* CONFIG_SOC_AU1000 */ | ||
596 | |||
597 | /* Au1500 */ | ||
598 | #ifdef CONFIG_SOC_AU1500 | ||
599 | enum soc_au1500_ints { | ||
600 | AU1500_FIRST_INT = MIPS_CPU_IRQ_BASE + 8, | ||
601 | AU1500_UART0_INT = AU1500_FIRST_INT, | ||
602 | AU1000_PCI_INTA, /* au1500 */ | ||
603 | AU1000_PCI_INTB, /* au1500 */ | ||
604 | AU1500_UART3_INT, | ||
605 | AU1000_PCI_INTC, /* au1500 */ | ||
606 | AU1000_PCI_INTD, /* au1500 */ | ||
607 | AU1000_DMA_INT_BASE, | ||
608 | |||
609 | AU1000_TOY_INT = AU1500_FIRST_INT + 14, | ||
610 | AU1000_TOY_MATCH0_INT, | ||
611 | AU1000_TOY_MATCH1_INT, | ||
612 | AU1000_TOY_MATCH2_INT, | ||
613 | AU1000_RTC_INT, | ||
614 | AU1000_RTC_MATCH0_INT, | ||
615 | AU1000_RTC_MATCH1_INT, | ||
616 | AU1000_RTC_MATCH2_INT, | ||
617 | AU1500_PCI_ERR_INT, | ||
618 | AU1500_RESERVED_INT, | ||
619 | AU1000_USB_DEV_REQ_INT, | ||
620 | AU1000_USB_DEV_SUS_INT, | ||
621 | AU1000_USB_HOST_INT, | ||
622 | AU1000_ACSYNC_INT, | ||
623 | AU1500_MAC0_DMA_INT, | ||
624 | AU1500_MAC1_DMA_INT, | ||
625 | AU1000_AC97C_INT = AU1500_FIRST_INT + 31, | ||
626 | AU1000_GPIO_0, | ||
627 | AU1000_GPIO_1, | ||
628 | AU1000_GPIO_2, | ||
629 | AU1000_GPIO_3, | ||
630 | AU1000_GPIO_4, | ||
631 | AU1000_GPIO_5, | ||
632 | AU1000_GPIO_6, | ||
633 | AU1000_GPIO_7, | ||
634 | AU1000_GPIO_8, | ||
635 | AU1000_GPIO_9, | ||
636 | AU1000_GPIO_10, | ||
637 | AU1000_GPIO_11, | ||
638 | AU1000_GPIO_12, | ||
639 | AU1000_GPIO_13, | ||
640 | AU1000_GPIO_14, | ||
641 | AU1000_GPIO_15, | ||
642 | AU1500_GPIO_200, | ||
643 | AU1500_GPIO_201, | ||
644 | AU1500_GPIO_202, | ||
645 | AU1500_GPIO_203, | ||
646 | AU1500_GPIO_20, | ||
647 | AU1500_GPIO_204, | ||
648 | AU1500_GPIO_205, | ||
649 | AU1500_GPIO_23, | ||
650 | AU1500_GPIO_24, | ||
651 | AU1500_GPIO_25, | ||
652 | AU1500_GPIO_26, | ||
653 | AU1500_GPIO_27, | ||
654 | AU1500_GPIO_28, | ||
655 | AU1500_GPIO_206, | ||
656 | AU1500_GPIO_207, | ||
657 | AU1500_GPIO_208_215, | ||
658 | }; | ||
659 | |||
660 | /* shortcuts */ | ||
661 | #define INTA AU1000_PCI_INTA | ||
662 | #define INTB AU1000_PCI_INTB | ||
663 | #define INTC AU1000_PCI_INTC | ||
664 | #define INTD AU1000_PCI_INTD | ||
665 | |||
666 | #define UART0_ADDR 0xB1100000 | ||
667 | #define UART3_ADDR 0xB1400000 | ||
668 | |||
669 | #define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */ | ||
670 | #define USB_HOST_CONFIG 0xB017fffc | ||
671 | |||
672 | #define AU1500_ETH0_BASE 0xB1500000 | ||
673 | #define AU1500_ETH1_BASE 0xB1510000 | ||
674 | #define AU1500_MAC0_ENABLE 0xB1520000 | ||
675 | #define AU1500_MAC1_ENABLE 0xB1520004 | ||
676 | #define NUM_ETH_INTERFACES 2 | ||
677 | #endif /* CONFIG_SOC_AU1500 */ | ||
678 | |||
679 | /* Au1100 */ | ||
680 | #ifdef CONFIG_SOC_AU1100 | ||
681 | enum soc_au1100_ints { | ||
682 | AU1100_FIRST_INT = MIPS_CPU_IRQ_BASE + 8, | ||
683 | AU1100_UART0_INT, | ||
684 | AU1100_UART1_INT, | ||
685 | AU1100_SD_INT, | ||
686 | AU1100_UART3_INT, | ||
687 | AU1000_SSI0_INT, | ||
688 | AU1000_SSI1_INT, | ||
689 | AU1000_DMA_INT_BASE, | ||
690 | |||
691 | AU1000_TOY_INT = AU1100_FIRST_INT + 14, | ||
692 | AU1000_TOY_MATCH0_INT, | ||
693 | AU1000_TOY_MATCH1_INT, | ||
694 | AU1000_TOY_MATCH2_INT, | ||
695 | AU1000_RTC_INT, | ||
696 | AU1000_RTC_MATCH0_INT, | ||
697 | AU1000_RTC_MATCH1_INT, | ||
698 | AU1000_RTC_MATCH2_INT, | ||
699 | AU1000_IRDA_TX_INT, | ||
700 | AU1000_IRDA_RX_INT, | ||
701 | AU1000_USB_DEV_REQ_INT, | ||
702 | AU1000_USB_DEV_SUS_INT, | ||
703 | AU1000_USB_HOST_INT, | ||
704 | AU1000_ACSYNC_INT, | ||
705 | AU1100_MAC0_DMA_INT, | ||
706 | AU1100_GPIO_208_215, | ||
707 | AU1100_LCD_INT, | ||
708 | AU1000_AC97C_INT, | ||
709 | AU1000_GPIO_0, | ||
710 | AU1000_GPIO_1, | ||
711 | AU1000_GPIO_2, | ||
712 | AU1000_GPIO_3, | ||
713 | AU1000_GPIO_4, | ||
714 | AU1000_GPIO_5, | ||
715 | AU1000_GPIO_6, | ||
716 | AU1000_GPIO_7, | ||
717 | AU1000_GPIO_8, | ||
718 | AU1000_GPIO_9, | ||
719 | AU1000_GPIO_10, | ||
720 | AU1000_GPIO_11, | ||
721 | AU1000_GPIO_12, | ||
722 | AU1000_GPIO_13, | ||
723 | AU1000_GPIO_14, | ||
724 | AU1000_GPIO_15, | ||
725 | AU1000_GPIO_16, | ||
726 | AU1000_GPIO_17, | ||
727 | AU1000_GPIO_18, | ||
728 | AU1000_GPIO_19, | ||
729 | AU1000_GPIO_20, | ||
730 | AU1000_GPIO_21, | ||
731 | AU1000_GPIO_22, | ||
732 | AU1000_GPIO_23, | ||
733 | AU1000_GPIO_24, | ||
734 | AU1000_GPIO_25, | ||
735 | AU1000_GPIO_26, | ||
736 | AU1000_GPIO_27, | ||
737 | AU1000_GPIO_28, | ||
738 | AU1000_GPIO_29, | ||
739 | AU1000_GPIO_30, | ||
740 | AU1000_GPIO_31, | ||
741 | }; | ||
742 | |||
743 | #define UART0_ADDR 0xB1100000 | ||
744 | #define UART1_ADDR 0xB1200000 | ||
745 | #define UART3_ADDR 0xB1400000 | ||
746 | |||
747 | #define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */ | ||
748 | #define USB_HOST_CONFIG 0xB017FFFC | ||
749 | |||
750 | #define AU1100_ETH0_BASE 0xB0500000 | ||
751 | #define AU1100_MAC0_ENABLE 0xB0520000 | ||
752 | #define NUM_ETH_INTERFACES 1 | ||
753 | #endif /* CONFIG_SOC_AU1100 */ | ||
754 | |||
755 | #ifdef CONFIG_SOC_AU1550 | ||
756 | enum soc_au1550_ints { | ||
757 | AU1550_FIRST_INT = MIPS_CPU_IRQ_BASE + 8, | ||
758 | AU1550_UART0_INT = AU1550_FIRST_INT, | ||
759 | AU1550_PCI_INTA, | ||
760 | AU1550_PCI_INTB, | ||
761 | AU1550_DDMA_INT, | ||
762 | AU1550_CRYPTO_INT, | ||
763 | AU1550_PCI_INTC, | ||
764 | AU1550_PCI_INTD, | ||
765 | AU1550_PCI_RST_INT, | ||
766 | AU1550_UART1_INT, | ||
767 | AU1550_UART3_INT, | ||
768 | AU1550_PSC0_INT, | ||
769 | AU1550_PSC1_INT, | ||
770 | AU1550_PSC2_INT, | ||
771 | AU1550_PSC3_INT, | ||
772 | AU1000_TOY_INT, | ||
773 | AU1000_TOY_MATCH0_INT, | ||
774 | AU1000_TOY_MATCH1_INT, | ||
775 | AU1000_TOY_MATCH2_INT, | ||
776 | AU1000_RTC_INT, | ||
777 | AU1000_RTC_MATCH0_INT, | ||
778 | AU1000_RTC_MATCH1_INT, | ||
779 | AU1000_RTC_MATCH2_INT, | ||
780 | |||
781 | AU1550_NAND_INT = AU1550_FIRST_INT + 23, | ||
782 | AU1550_USB_DEV_REQ_INT, | ||
783 | AU1000_USB_DEV_REQ_INT = AU1550_USB_DEV_REQ_INT, | ||
784 | AU1550_USB_DEV_SUS_INT, | ||
785 | AU1000_USB_DEV_SUS_INT = AU1550_USB_DEV_SUS_INT, | ||
786 | AU1550_USB_HOST_INT, | ||
787 | AU1000_USB_HOST_INT = AU1550_USB_HOST_INT, | ||
788 | AU1550_MAC0_DMA_INT, | ||
789 | AU1550_MAC1_DMA_INT, | ||
790 | AU1000_GPIO_0 = AU1550_FIRST_INT + 32, | ||
791 | AU1000_GPIO_1, | ||
792 | AU1000_GPIO_2, | ||
793 | AU1000_GPIO_3, | ||
794 | AU1000_GPIO_4, | ||
795 | AU1000_GPIO_5, | ||
796 | AU1000_GPIO_6, | ||
797 | AU1000_GPIO_7, | ||
798 | AU1000_GPIO_8, | ||
799 | AU1000_GPIO_9, | ||
800 | AU1000_GPIO_10, | ||
801 | AU1000_GPIO_11, | ||
802 | AU1000_GPIO_12, | ||
803 | AU1000_GPIO_13, | ||
804 | AU1000_GPIO_14, | ||
805 | AU1000_GPIO_15, | ||
806 | AU1550_GPIO_200, | ||
807 | AU1500_GPIO_201_205, /* Logical or of GPIO201:205 */ | ||
808 | AU1500_GPIO_16, | ||
809 | AU1500_GPIO_17, | ||
810 | AU1500_GPIO_20, | ||
811 | AU1500_GPIO_21, | ||
812 | AU1500_GPIO_22, | ||
813 | AU1500_GPIO_23, | ||
814 | AU1500_GPIO_24, | ||
815 | AU1500_GPIO_25, | ||
816 | AU1500_GPIO_26, | ||
817 | AU1500_GPIO_27, | ||
818 | AU1500_GPIO_28, | ||
819 | AU1500_GPIO_206, | ||
820 | AU1500_GPIO_207, | ||
821 | AU1500_GPIO_208_218, /* Logical or of GPIO208:218 */ | ||
822 | }; | ||
823 | |||
824 | /* shortcuts */ | ||
825 | #define INTA AU1550_PCI_INTA | ||
826 | #define INTB AU1550_PCI_INTB | ||
827 | #define INTC AU1550_PCI_INTC | ||
828 | #define INTD AU1550_PCI_INTD | ||
829 | |||
830 | #define UART0_ADDR 0xB1100000 | ||
831 | #define UART1_ADDR 0xB1200000 | ||
832 | #define UART3_ADDR 0xB1400000 | ||
833 | |||
834 | #define USB_OHCI_BASE 0x14020000 /* phys addr for ioremap */ | ||
835 | #define USB_OHCI_LEN 0x00060000 | ||
836 | #define USB_HOST_CONFIG 0xB4027ffc | ||
837 | |||
838 | #define AU1550_ETH0_BASE 0xB0500000 | ||
839 | #define AU1550_ETH1_BASE 0xB0510000 | ||
840 | #define AU1550_MAC0_ENABLE 0xB0520000 | ||
841 | #define AU1550_MAC1_ENABLE 0xB0520004 | ||
842 | #define NUM_ETH_INTERFACES 2 | ||
843 | #endif /* CONFIG_SOC_AU1550 */ | ||
844 | |||
845 | #ifdef CONFIG_SOC_AU1200 | ||
846 | enum soc_au1200_ints { | ||
847 | AU1200_FIRST_INT = MIPS_CPU_IRQ_BASE + 8, | ||
848 | AU1200_UART0_INT = AU1200_FIRST_INT, | ||
849 | AU1200_SWT_INT, | ||
850 | AU1200_SD_INT, | ||
851 | AU1200_DDMA_INT, | ||
852 | AU1200_MAE_BE_INT, | ||
853 | AU1200_GPIO_200, | ||
854 | AU1200_GPIO_201, | ||
855 | AU1200_GPIO_202, | ||
856 | AU1200_UART1_INT, | ||
857 | AU1200_MAE_FE_INT, | ||
858 | AU1200_PSC0_INT, | ||
859 | AU1200_PSC1_INT, | ||
860 | AU1200_AES_INT, | ||
861 | AU1200_CAMERA_INT, | ||
862 | AU1000_TOY_INT, | ||
863 | AU1000_TOY_MATCH0_INT, | ||
864 | AU1000_TOY_MATCH1_INT, | ||
865 | AU1000_TOY_MATCH2_INT, | ||
866 | AU1000_RTC_INT, | ||
867 | AU1000_RTC_MATCH0_INT, | ||
868 | AU1000_RTC_MATCH1_INT, | ||
869 | AU1000_RTC_MATCH2_INT, | ||
870 | |||
871 | AU1200_NAND_INT = AU1200_FIRST_INT + 23, | ||
872 | AU1200_GPIO_204, | ||
873 | AU1200_GPIO_205, | ||
874 | AU1200_GPIO_206, | ||
875 | AU1200_GPIO_207, | ||
876 | AU1200_GPIO_208_215, /* Logical OR of 208:215 */ | ||
877 | AU1200_USB_INT, | ||
878 | AU1000_USB_HOST_INT = AU1200_USB_INT, | ||
879 | AU1200_LCD_INT, | ||
880 | AU1200_MAE_BOTH_INT, | ||
881 | AU1000_GPIO_0, | ||
882 | AU1000_GPIO_1, | ||
883 | AU1000_GPIO_2, | ||
884 | AU1000_GPIO_3, | ||
885 | AU1000_GPIO_4, | ||
886 | AU1000_GPIO_5, | ||
887 | AU1000_GPIO_6, | ||
888 | AU1000_GPIO_7, | ||
889 | AU1000_GPIO_8, | ||
890 | AU1000_GPIO_9, | ||
891 | AU1000_GPIO_10, | ||
892 | AU1000_GPIO_11, | ||
893 | AU1000_GPIO_12, | ||
894 | AU1000_GPIO_13, | ||
895 | AU1000_GPIO_14, | ||
896 | AU1000_GPIO_15, | ||
897 | AU1000_GPIO_16, | ||
898 | AU1000_GPIO_17, | ||
899 | AU1000_GPIO_18, | ||
900 | AU1000_GPIO_19, | ||
901 | AU1000_GPIO_20, | ||
902 | AU1000_GPIO_21, | ||
903 | AU1000_GPIO_22, | ||
904 | AU1000_GPIO_23, | ||
905 | AU1000_GPIO_24, | ||
906 | AU1000_GPIO_25, | ||
907 | AU1000_GPIO_26, | ||
908 | AU1000_GPIO_27, | ||
909 | AU1000_GPIO_28, | ||
910 | AU1000_GPIO_29, | ||
911 | AU1000_GPIO_30, | ||
912 | AU1000_GPIO_31, | ||
913 | }; | ||
914 | |||
915 | #define UART0_ADDR 0xB1100000 | ||
916 | #define UART1_ADDR 0xB1200000 | ||
917 | |||
918 | #define USB_UOC_BASE 0x14020020 | ||
919 | #define USB_UOC_LEN 0x20 | ||
920 | #define USB_OHCI_BASE 0x14020100 | ||
921 | #define USB_OHCI_LEN 0x100 | ||
922 | #define USB_EHCI_BASE 0x14020200 | ||
923 | #define USB_EHCI_LEN 0x100 | ||
924 | #define USB_UDC_BASE 0x14022000 | ||
925 | #define USB_UDC_LEN 0x2000 | ||
926 | #define USB_MSR_BASE 0xB4020000 | ||
927 | #define USB_MSR_MCFG 4 | ||
928 | #define USBMSRMCFG_OMEMEN 0 | ||
929 | #define USBMSRMCFG_OBMEN 1 | ||
930 | #define USBMSRMCFG_EMEMEN 2 | ||
931 | #define USBMSRMCFG_EBMEN 3 | ||
932 | #define USBMSRMCFG_DMEMEN 4 | ||
933 | #define USBMSRMCFG_DBMEN 5 | ||
934 | #define USBMSRMCFG_GMEMEN 6 | ||
935 | #define USBMSRMCFG_OHCCLKEN 16 | ||
936 | #define USBMSRMCFG_EHCCLKEN 17 | ||
937 | #define USBMSRMCFG_UDCCLKEN 18 | ||
938 | #define USBMSRMCFG_PHYPLLEN 19 | ||
939 | #define USBMSRMCFG_RDCOMB 30 | ||
940 | #define USBMSRMCFG_PFEN 31 | ||
941 | |||
942 | #endif /* CONFIG_SOC_AU1200 */ | ||
943 | |||
944 | #define AU1000_INTC0_INT_BASE (MIPS_CPU_IRQ_BASE + 8) | ||
945 | #define AU1000_INTC0_INT_LAST (AU1000_INTC0_INT_BASE + 31) | ||
946 | #define AU1000_INTC1_INT_BASE (AU1000_INTC0_INT_BASE + 32) | ||
947 | #define AU1000_INTC1_INT_LAST (AU1000_INTC1_INT_BASE + 31) | ||
948 | |||
949 | #define AU1000_MAX_INTR AU1000_INTC1_INT_LAST | ||
950 | #define INTX 0xFF /* not valid */ | ||
951 | |||
952 | /* Programmable Counters 0 and 1 */ | ||
953 | #define SYS_BASE 0xB1900000 | ||
954 | #define SYS_COUNTER_CNTRL (SYS_BASE + 0x14) | ||
955 | # define SYS_CNTRL_E1S (1 << 23) | ||
956 | # define SYS_CNTRL_T1S (1 << 20) | ||
957 | # define SYS_CNTRL_M21 (1 << 19) | ||
958 | # define SYS_CNTRL_M11 (1 << 18) | ||
959 | # define SYS_CNTRL_M01 (1 << 17) | ||
960 | # define SYS_CNTRL_C1S (1 << 16) | ||
961 | # define SYS_CNTRL_BP (1 << 14) | ||
962 | # define SYS_CNTRL_EN1 (1 << 13) | ||
963 | # define SYS_CNTRL_BT1 (1 << 12) | ||
964 | # define SYS_CNTRL_EN0 (1 << 11) | ||
965 | # define SYS_CNTRL_BT0 (1 << 10) | ||
966 | # define SYS_CNTRL_E0 (1 << 8) | ||
967 | # define SYS_CNTRL_E0S (1 << 7) | ||
968 | # define SYS_CNTRL_32S (1 << 5) | ||
969 | # define SYS_CNTRL_T0S (1 << 4) | ||
970 | # define SYS_CNTRL_M20 (1 << 3) | ||
971 | # define SYS_CNTRL_M10 (1 << 2) | ||
972 | # define SYS_CNTRL_M00 (1 << 1) | ||
973 | # define SYS_CNTRL_C0S (1 << 0) | ||
974 | |||
975 | /* Programmable Counter 0 Registers */ | ||
976 | #define SYS_TOYTRIM (SYS_BASE + 0) | ||
977 | #define SYS_TOYWRITE (SYS_BASE + 4) | ||
978 | #define SYS_TOYMATCH0 (SYS_BASE + 8) | ||
979 | #define SYS_TOYMATCH1 (SYS_BASE + 0xC) | ||
980 | #define SYS_TOYMATCH2 (SYS_BASE + 0x10) | ||
981 | #define SYS_TOYREAD (SYS_BASE + 0x40) | ||
982 | |||
983 | /* Programmable Counter 1 Registers */ | ||
984 | #define SYS_RTCTRIM (SYS_BASE + 0x44) | ||
985 | #define SYS_RTCWRITE (SYS_BASE + 0x48) | ||
986 | #define SYS_RTCMATCH0 (SYS_BASE + 0x4C) | ||
987 | #define SYS_RTCMATCH1 (SYS_BASE + 0x50) | ||
988 | #define SYS_RTCMATCH2 (SYS_BASE + 0x54) | ||
989 | #define SYS_RTCREAD (SYS_BASE + 0x58) | ||
990 | |||
991 | /* I2S Controller */ | ||
992 | #define I2S_DATA 0xB1000000 | ||
993 | # define I2S_DATA_MASK 0xffffff | ||
994 | #define I2S_CONFIG 0xB1000004 | ||
995 | # define I2S_CONFIG_XU (1 << 25) | ||
996 | # define I2S_CONFIG_XO (1 << 24) | ||
997 | # define I2S_CONFIG_RU (1 << 23) | ||
998 | # define I2S_CONFIG_RO (1 << 22) | ||
999 | # define I2S_CONFIG_TR (1 << 21) | ||
1000 | # define I2S_CONFIG_TE (1 << 20) | ||
1001 | # define I2S_CONFIG_TF (1 << 19) | ||
1002 | # define I2S_CONFIG_RR (1 << 18) | ||
1003 | # define I2S_CONFIG_RE (1 << 17) | ||
1004 | # define I2S_CONFIG_RF (1 << 16) | ||
1005 | # define I2S_CONFIG_PD (1 << 11) | ||
1006 | # define I2S_CONFIG_LB (1 << 10) | ||
1007 | # define I2S_CONFIG_IC (1 << 9) | ||
1008 | # define I2S_CONFIG_FM_BIT 7 | ||
1009 | # define I2S_CONFIG_FM_MASK (0x3 << I2S_CONFIG_FM_BIT) | ||
1010 | # define I2S_CONFIG_FM_I2S (0x0 << I2S_CONFIG_FM_BIT) | ||
1011 | # define I2S_CONFIG_FM_LJ (0x1 << I2S_CONFIG_FM_BIT) | ||
1012 | # define I2S_CONFIG_FM_RJ (0x2 << I2S_CONFIG_FM_BIT) | ||
1013 | # define I2S_CONFIG_TN (1 << 6) | ||
1014 | # define I2S_CONFIG_RN (1 << 5) | ||
1015 | # define I2S_CONFIG_SZ_BIT 0 | ||
1016 | # define I2S_CONFIG_SZ_MASK (0x1F << I2S_CONFIG_SZ_BIT) | ||
1017 | |||
1018 | #define I2S_CONTROL 0xB1000008 | ||
1019 | # define I2S_CONTROL_D (1 << 1) | ||
1020 | # define I2S_CONTROL_CE (1 << 0) | ||
1021 | |||
1022 | /* USB Host Controller */ | ||
1023 | #ifndef USB_OHCI_LEN | ||
1024 | #define USB_OHCI_LEN 0x00100000 | ||
1025 | #endif | ||
1026 | |||
1027 | #ifndef CONFIG_SOC_AU1200 | ||
1028 | |||
1029 | /* USB Device Controller */ | ||
1030 | #define USBD_EP0RD 0xB0200000 | ||
1031 | #define USBD_EP0WR 0xB0200004 | ||
1032 | #define USBD_EP2WR 0xB0200008 | ||
1033 | #define USBD_EP3WR 0xB020000C | ||
1034 | #define USBD_EP4RD 0xB0200010 | ||
1035 | #define USBD_EP5RD 0xB0200014 | ||
1036 | #define USBD_INTEN 0xB0200018 | ||
1037 | #define USBD_INTSTAT 0xB020001C | ||
1038 | # define USBDEV_INT_SOF (1 << 12) | ||
1039 | # define USBDEV_INT_HF_BIT 6 | ||
1040 | # define USBDEV_INT_HF_MASK (0x3f << USBDEV_INT_HF_BIT) | ||
1041 | # define USBDEV_INT_CMPLT_BIT 0 | ||
1042 | # define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT) | ||
1043 | #define USBD_CONFIG 0xB0200020 | ||
1044 | #define USBD_EP0CS 0xB0200024 | ||
1045 | #define USBD_EP2CS 0xB0200028 | ||
1046 | #define USBD_EP3CS 0xB020002C | ||
1047 | #define USBD_EP4CS 0xB0200030 | ||
1048 | #define USBD_EP5CS 0xB0200034 | ||
1049 | # define USBDEV_CS_SU (1 << 14) | ||
1050 | # define USBDEV_CS_NAK (1 << 13) | ||
1051 | # define USBDEV_CS_ACK (1 << 12) | ||
1052 | # define USBDEV_CS_BUSY (1 << 11) | ||
1053 | # define USBDEV_CS_TSIZE_BIT 1 | ||
1054 | # define USBDEV_CS_TSIZE_MASK (0x3ff << USBDEV_CS_TSIZE_BIT) | ||
1055 | # define USBDEV_CS_STALL (1 << 0) | ||
1056 | #define USBD_EP0RDSTAT 0xB0200040 | ||
1057 | #define USBD_EP0WRSTAT 0xB0200044 | ||
1058 | #define USBD_EP2WRSTAT 0xB0200048 | ||
1059 | #define USBD_EP3WRSTAT 0xB020004C | ||
1060 | #define USBD_EP4RDSTAT 0xB0200050 | ||
1061 | #define USBD_EP5RDSTAT 0xB0200054 | ||
1062 | # define USBDEV_FSTAT_FLUSH (1 << 6) | ||
1063 | # define USBDEV_FSTAT_UF (1 << 5) | ||
1064 | # define USBDEV_FSTAT_OF (1 << 4) | ||
1065 | # define USBDEV_FSTAT_FCNT_BIT 0 | ||
1066 | # define USBDEV_FSTAT_FCNT_MASK (0x0f << USBDEV_FSTAT_FCNT_BIT) | ||
1067 | #define USBD_ENABLE 0xB0200058 | ||
1068 | # define USBDEV_ENABLE (1 << 1) | ||
1069 | # define USBDEV_CE (1 << 0) | ||
1070 | |||
1071 | #endif /* !CONFIG_SOC_AU1200 */ | ||
1072 | |||
1073 | /* Ethernet Controllers */ | ||
1074 | |||
1075 | /* 4 byte offsets from AU1000_ETH_BASE */ | ||
1076 | #define MAC_CONTROL 0x0 | ||
1077 | # define MAC_RX_ENABLE (1 << 2) | ||
1078 | # define MAC_TX_ENABLE (1 << 3) | ||
1079 | # define MAC_DEF_CHECK (1 << 5) | ||
1080 | # define MAC_SET_BL(X) (((X) & 0x3) << 6) | ||
1081 | # define MAC_AUTO_PAD (1 << 8) | ||
1082 | # define MAC_DISABLE_RETRY (1 << 10) | ||
1083 | # define MAC_DISABLE_BCAST (1 << 11) | ||
1084 | # define MAC_LATE_COL (1 << 12) | ||
1085 | # define MAC_HASH_MODE (1 << 13) | ||
1086 | # define MAC_HASH_ONLY (1 << 15) | ||
1087 | # define MAC_PASS_ALL (1 << 16) | ||
1088 | # define MAC_INVERSE_FILTER (1 << 17) | ||
1089 | # define MAC_PROMISCUOUS (1 << 18) | ||
1090 | # define MAC_PASS_ALL_MULTI (1 << 19) | ||
1091 | # define MAC_FULL_DUPLEX (1 << 20) | ||
1092 | # define MAC_NORMAL_MODE 0 | ||
1093 | # define MAC_INT_LOOPBACK (1 << 21) | ||
1094 | # define MAC_EXT_LOOPBACK (1 << 22) | ||
1095 | # define MAC_DISABLE_RX_OWN (1 << 23) | ||
1096 | # define MAC_BIG_ENDIAN (1 << 30) | ||
1097 | # define MAC_RX_ALL (1 << 31) | ||
1098 | #define MAC_ADDRESS_HIGH 0x4 | ||
1099 | #define MAC_ADDRESS_LOW 0x8 | ||
1100 | #define MAC_MCAST_HIGH 0xC | ||
1101 | #define MAC_MCAST_LOW 0x10 | ||
1102 | #define MAC_MII_CNTRL 0x14 | ||
1103 | # define MAC_MII_BUSY (1 << 0) | ||
1104 | # define MAC_MII_READ 0 | ||
1105 | # define MAC_MII_WRITE (1 << 1) | ||
1106 | # define MAC_SET_MII_SELECT_REG(X) (((X) & 0x1f) << 6) | ||
1107 | # define MAC_SET_MII_SELECT_PHY(X) (((X) & 0x1f) << 11) | ||
1108 | #define MAC_MII_DATA 0x18 | ||
1109 | #define MAC_FLOW_CNTRL 0x1C | ||
1110 | # define MAC_FLOW_CNTRL_BUSY (1 << 0) | ||
1111 | # define MAC_FLOW_CNTRL_ENABLE (1 << 1) | ||
1112 | # define MAC_PASS_CONTROL (1 << 2) | ||
1113 | # define MAC_SET_PAUSE(X) (((X) & 0xffff) << 16) | ||
1114 | #define MAC_VLAN1_TAG 0x20 | ||
1115 | #define MAC_VLAN2_TAG 0x24 | ||
1116 | |||
1117 | /* Ethernet Controller Enable */ | ||
1118 | |||
1119 | # define MAC_EN_CLOCK_ENABLE (1 << 0) | ||
1120 | # define MAC_EN_RESET0 (1 << 1) | ||
1121 | # define MAC_EN_TOSS (0 << 2) | ||
1122 | # define MAC_EN_CACHEABLE (1 << 3) | ||
1123 | # define MAC_EN_RESET1 (1 << 4) | ||
1124 | # define MAC_EN_RESET2 (1 << 5) | ||
1125 | # define MAC_DMA_RESET (1 << 6) | ||
1126 | |||
1127 | /* Ethernet Controller DMA Channels */ | ||
1128 | |||
1129 | #define MAC0_TX_DMA_ADDR 0xB4004000 | ||
1130 | #define MAC1_TX_DMA_ADDR 0xB4004200 | ||
1131 | /* offsets from MAC_TX_RING_ADDR address */ | ||
1132 | #define MAC_TX_BUFF0_STATUS 0x0 | ||
1133 | # define TX_FRAME_ABORTED (1 << 0) | ||
1134 | # define TX_JAB_TIMEOUT (1 << 1) | ||
1135 | # define TX_NO_CARRIER (1 << 2) | ||
1136 | # define TX_LOSS_CARRIER (1 << 3) | ||
1137 | # define TX_EXC_DEF (1 << 4) | ||
1138 | # define TX_LATE_COLL_ABORT (1 << 5) | ||
1139 | # define TX_EXC_COLL (1 << 6) | ||
1140 | # define TX_UNDERRUN (1 << 7) | ||
1141 | # define TX_DEFERRED (1 << 8) | ||
1142 | # define TX_LATE_COLL (1 << 9) | ||
1143 | # define TX_COLL_CNT_MASK (0xF << 10) | ||
1144 | # define TX_PKT_RETRY (1 << 31) | ||
1145 | #define MAC_TX_BUFF0_ADDR 0x4 | ||
1146 | # define TX_DMA_ENABLE (1 << 0) | ||
1147 | # define TX_T_DONE (1 << 1) | ||
1148 | # define TX_GET_DMA_BUFFER(X) (((X) >> 2) & 0x3) | ||
1149 | #define MAC_TX_BUFF0_LEN 0x8 | ||
1150 | #define MAC_TX_BUFF1_STATUS 0x10 | ||
1151 | #define MAC_TX_BUFF1_ADDR 0x14 | ||
1152 | #define MAC_TX_BUFF1_LEN 0x18 | ||
1153 | #define MAC_TX_BUFF2_STATUS 0x20 | ||
1154 | #define MAC_TX_BUFF2_ADDR 0x24 | ||
1155 | #define MAC_TX_BUFF2_LEN 0x28 | ||
1156 | #define MAC_TX_BUFF3_STATUS 0x30 | ||
1157 | #define MAC_TX_BUFF3_ADDR 0x34 | ||
1158 | #define MAC_TX_BUFF3_LEN 0x38 | ||
1159 | |||
1160 | #define MAC0_RX_DMA_ADDR 0xB4004100 | ||
1161 | #define MAC1_RX_DMA_ADDR 0xB4004300 | ||
1162 | /* offsets from MAC_RX_RING_ADDR */ | ||
1163 | #define MAC_RX_BUFF0_STATUS 0x0 | ||
1164 | # define RX_FRAME_LEN_MASK 0x3fff | ||
1165 | # define RX_WDOG_TIMER (1 << 14) | ||
1166 | # define RX_RUNT (1 << 15) | ||
1167 | # define RX_OVERLEN (1 << 16) | ||
1168 | # define RX_COLL (1 << 17) | ||
1169 | # define RX_ETHER (1 << 18) | ||
1170 | # define RX_MII_ERROR (1 << 19) | ||
1171 | # define RX_DRIBBLING (1 << 20) | ||
1172 | # define RX_CRC_ERROR (1 << 21) | ||
1173 | # define RX_VLAN1 (1 << 22) | ||
1174 | # define RX_VLAN2 (1 << 23) | ||
1175 | # define RX_LEN_ERROR (1 << 24) | ||
1176 | # define RX_CNTRL_FRAME (1 << 25) | ||
1177 | # define RX_U_CNTRL_FRAME (1 << 26) | ||
1178 | # define RX_MCAST_FRAME (1 << 27) | ||
1179 | # define RX_BCAST_FRAME (1 << 28) | ||
1180 | # define RX_FILTER_FAIL (1 << 29) | ||
1181 | # define RX_PACKET_FILTER (1 << 30) | ||
1182 | # define RX_MISSED_FRAME (1 << 31) | ||
1183 | |||
1184 | # define RX_ERROR (RX_WDOG_TIMER | RX_RUNT | RX_OVERLEN | \ | ||
1185 | RX_COLL | RX_MII_ERROR | RX_CRC_ERROR | \ | ||
1186 | RX_LEN_ERROR | RX_U_CNTRL_FRAME | RX_MISSED_FRAME) | ||
1187 | #define MAC_RX_BUFF0_ADDR 0x4 | ||
1188 | # define RX_DMA_ENABLE (1 << 0) | ||
1189 | # define RX_T_DONE (1 << 1) | ||
1190 | # define RX_GET_DMA_BUFFER(X) (((X) >> 2) & 0x3) | ||
1191 | # define RX_SET_BUFF_ADDR(X) ((X) & 0xffffffc0) | ||
1192 | #define MAC_RX_BUFF1_STATUS 0x10 | ||
1193 | #define MAC_RX_BUFF1_ADDR 0x14 | ||
1194 | #define MAC_RX_BUFF2_STATUS 0x20 | ||
1195 | #define MAC_RX_BUFF2_ADDR 0x24 | ||
1196 | #define MAC_RX_BUFF3_STATUS 0x30 | ||
1197 | #define MAC_RX_BUFF3_ADDR 0x34 | ||
1198 | |||
1199 | /* UARTS 0-3 */ | ||
1200 | #define UART_BASE UART0_ADDR | ||
1201 | #ifdef CONFIG_SOC_AU1200 | ||
1202 | #define UART_DEBUG_BASE UART1_ADDR | ||
1203 | #else | ||
1204 | #define UART_DEBUG_BASE UART3_ADDR | ||
1205 | #endif | ||
1206 | |||
1207 | #define UART_RX 0 /* Receive buffer */ | ||
1208 | #define UART_TX 4 /* Transmit buffer */ | ||
1209 | #define UART_IER 8 /* Interrupt Enable Register */ | ||
1210 | #define UART_IIR 0xC /* Interrupt ID Register */ | ||
1211 | #define UART_FCR 0x10 /* FIFO Control Register */ | ||
1212 | #define UART_LCR 0x14 /* Line Control Register */ | ||
1213 | #define UART_MCR 0x18 /* Modem Control Register */ | ||
1214 | #define UART_LSR 0x1C /* Line Status Register */ | ||
1215 | #define UART_MSR 0x20 /* Modem Status Register */ | ||
1216 | #define UART_CLK 0x28 /* Baud Rate Clock Divider */ | ||
1217 | #define UART_MOD_CNTRL 0x100 /* Module Control */ | ||
1218 | |||
1219 | #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */ | ||
1220 | #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */ | ||
1221 | #define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */ | ||
1222 | #define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */ | ||
1223 | #define UART_FCR_TRIGGER_MASK 0xF0 /* Mask for the FIFO trigger range */ | ||
1224 | #define UART_FCR_R_TRIGGER_1 0x00 /* Mask for receive trigger set at 1 */ | ||
1225 | #define UART_FCR_R_TRIGGER_4 0x40 /* Mask for receive trigger set at 4 */ | ||
1226 | #define UART_FCR_R_TRIGGER_8 0x80 /* Mask for receive trigger set at 8 */ | ||
1227 | #define UART_FCR_R_TRIGGER_14 0xA0 /* Mask for receive trigger set at 14 */ | ||
1228 | #define UART_FCR_T_TRIGGER_0 0x00 /* Mask for transmit trigger set at 0 */ | ||
1229 | #define UART_FCR_T_TRIGGER_4 0x10 /* Mask for transmit trigger set at 4 */ | ||
1230 | #define UART_FCR_T_TRIGGER_8 0x20 /* Mask for transmit trigger set at 8 */ | ||
1231 | #define UART_FCR_T_TRIGGER_12 0x30 /* Mask for transmit trigger set at 12 */ | ||
1232 | |||
1233 | /* | ||
1234 | * These are the definitions for the Line Control Register | ||
1235 | */ | ||
1236 | #define UART_LCR_SBC 0x40 /* Set break control */ | ||
1237 | #define UART_LCR_SPAR 0x20 /* Stick parity (?) */ | ||
1238 | #define UART_LCR_EPAR 0x10 /* Even parity select */ | ||
1239 | #define UART_LCR_PARITY 0x08 /* Parity Enable */ | ||
1240 | #define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */ | ||
1241 | #define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */ | ||
1242 | #define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */ | ||
1243 | #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */ | ||
1244 | #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */ | ||
1245 | |||
1246 | /* | ||
1247 | * These are the definitions for the Line Status Register | ||
1248 | */ | ||
1249 | #define UART_LSR_TEMT 0x40 /* Transmitter empty */ | ||
1250 | #define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ | ||
1251 | #define UART_LSR_BI 0x10 /* Break interrupt indicator */ | ||
1252 | #define UART_LSR_FE 0x08 /* Frame error indicator */ | ||
1253 | #define UART_LSR_PE 0x04 /* Parity error indicator */ | ||
1254 | #define UART_LSR_OE 0x02 /* Overrun error indicator */ | ||
1255 | #define UART_LSR_DR 0x01 /* Receiver data ready */ | ||
1256 | |||
1257 | /* | ||
1258 | * These are the definitions for the Interrupt Identification Register | ||
1259 | */ | ||
1260 | #define UART_IIR_NO_INT 0x01 /* No interrupts pending */ | ||
1261 | #define UART_IIR_ID 0x06 /* Mask for the interrupt ID */ | ||
1262 | #define UART_IIR_MSI 0x00 /* Modem status interrupt */ | ||
1263 | #define UART_IIR_THRI 0x02 /* Transmitter holding register empty */ | ||
1264 | #define UART_IIR_RDI 0x04 /* Receiver data interrupt */ | ||
1265 | #define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */ | ||
1266 | |||
1267 | /* | ||
1268 | * These are the definitions for the Interrupt Enable Register | ||
1269 | */ | ||
1270 | #define UART_IER_MSI 0x08 /* Enable Modem status interrupt */ | ||
1271 | #define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */ | ||
1272 | #define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */ | ||
1273 | #define UART_IER_RDI 0x01 /* Enable receiver data interrupt */ | ||
1274 | |||
1275 | /* | ||
1276 | * These are the definitions for the Modem Control Register | ||
1277 | */ | ||
1278 | #define UART_MCR_LOOP 0x10 /* Enable loopback test mode */ | ||
1279 | #define UART_MCR_OUT2 0x08 /* Out2 complement */ | ||
1280 | #define UART_MCR_OUT1 0x04 /* Out1 complement */ | ||
1281 | #define UART_MCR_RTS 0x02 /* RTS complement */ | ||
1282 | #define UART_MCR_DTR 0x01 /* DTR complement */ | ||
1283 | |||
1284 | /* | ||
1285 | * These are the definitions for the Modem Status Register | ||
1286 | */ | ||
1287 | #define UART_MSR_DCD 0x80 /* Data Carrier Detect */ | ||
1288 | #define UART_MSR_RI 0x40 /* Ring Indicator */ | ||
1289 | #define UART_MSR_DSR 0x20 /* Data Set Ready */ | ||
1290 | #define UART_MSR_CTS 0x10 /* Clear to Send */ | ||
1291 | #define UART_MSR_DDCD 0x08 /* Delta DCD */ | ||
1292 | #define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */ | ||
1293 | #define UART_MSR_DDSR 0x02 /* Delta DSR */ | ||
1294 | #define UART_MSR_DCTS 0x01 /* Delta CTS */ | ||
1295 | #define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */ | ||
1296 | |||
1297 | /* SSIO */ | ||
1298 | #define SSI0_STATUS 0xB1600000 | ||
1299 | # define SSI_STATUS_BF (1 << 4) | ||
1300 | # define SSI_STATUS_OF (1 << 3) | ||
1301 | # define SSI_STATUS_UF (1 << 2) | ||
1302 | # define SSI_STATUS_D (1 << 1) | ||
1303 | # define SSI_STATUS_B (1 << 0) | ||
1304 | #define SSI0_INT 0xB1600004 | ||
1305 | # define SSI_INT_OI (1 << 3) | ||
1306 | # define SSI_INT_UI (1 << 2) | ||
1307 | # define SSI_INT_DI (1 << 1) | ||
1308 | #define SSI0_INT_ENABLE 0xB1600008 | ||
1309 | # define SSI_INTE_OIE (1 << 3) | ||
1310 | # define SSI_INTE_UIE (1 << 2) | ||
1311 | # define SSI_INTE_DIE (1 << 1) | ||
1312 | #define SSI0_CONFIG 0xB1600020 | ||
1313 | # define SSI_CONFIG_AO (1 << 24) | ||
1314 | # define SSI_CONFIG_DO (1 << 23) | ||
1315 | # define SSI_CONFIG_ALEN_BIT 20 | ||
1316 | # define SSI_CONFIG_ALEN_MASK (0x7 << 20) | ||
1317 | # define SSI_CONFIG_DLEN_BIT 16 | ||
1318 | # define SSI_CONFIG_DLEN_MASK (0x7 << 16) | ||
1319 | # define SSI_CONFIG_DD (1 << 11) | ||
1320 | # define SSI_CONFIG_AD (1 << 10) | ||
1321 | # define SSI_CONFIG_BM_BIT 8 | ||
1322 | # define SSI_CONFIG_BM_MASK (0x3 << 8) | ||
1323 | # define SSI_CONFIG_CE (1 << 7) | ||
1324 | # define SSI_CONFIG_DP (1 << 6) | ||
1325 | # define SSI_CONFIG_DL (1 << 5) | ||
1326 | # define SSI_CONFIG_EP (1 << 4) | ||
1327 | #define SSI0_ADATA 0xB1600024 | ||
1328 | # define SSI_AD_D (1 << 24) | ||
1329 | # define SSI_AD_ADDR_BIT 16 | ||
1330 | # define SSI_AD_ADDR_MASK (0xff << 16) | ||
1331 | # define SSI_AD_DATA_BIT 0 | ||
1332 | # define SSI_AD_DATA_MASK (0xfff << 0) | ||
1333 | #define SSI0_CLKDIV 0xB1600028 | ||
1334 | #define SSI0_CONTROL 0xB1600100 | ||
1335 | # define SSI_CONTROL_CD (1 << 1) | ||
1336 | # define SSI_CONTROL_E (1 << 0) | ||
1337 | |||
1338 | /* SSI1 */ | ||
1339 | #define SSI1_STATUS 0xB1680000 | ||
1340 | #define SSI1_INT 0xB1680004 | ||
1341 | #define SSI1_INT_ENABLE 0xB1680008 | ||
1342 | #define SSI1_CONFIG 0xB1680020 | ||
1343 | #define SSI1_ADATA 0xB1680024 | ||
1344 | #define SSI1_CLKDIV 0xB1680028 | ||
1345 | #define SSI1_ENABLE 0xB1680100 | ||
1346 | |||
1347 | /* | ||
1348 | * Register content definitions | ||
1349 | */ | ||
1350 | #define SSI_STATUS_BF (1 << 4) | ||
1351 | #define SSI_STATUS_OF (1 << 3) | ||
1352 | #define SSI_STATUS_UF (1 << 2) | ||
1353 | #define SSI_STATUS_D (1 << 1) | ||
1354 | #define SSI_STATUS_B (1 << 0) | ||
1355 | |||
1356 | /* SSI_INT */ | ||
1357 | #define SSI_INT_OI (1 << 3) | ||
1358 | #define SSI_INT_UI (1 << 2) | ||
1359 | #define SSI_INT_DI (1 << 1) | ||
1360 | |||
1361 | /* SSI_INTEN */ | ||
1362 | #define SSI_INTEN_OIE (1 << 3) | ||
1363 | #define SSI_INTEN_UIE (1 << 2) | ||
1364 | #define SSI_INTEN_DIE (1 << 1) | ||
1365 | |||
1366 | #define SSI_CONFIG_AO (1 << 24) | ||
1367 | #define SSI_CONFIG_DO (1 << 23) | ||
1368 | #define SSI_CONFIG_ALEN (7 << 20) | ||
1369 | #define SSI_CONFIG_DLEN (15 << 16) | ||
1370 | #define SSI_CONFIG_DD (1 << 11) | ||
1371 | #define SSI_CONFIG_AD (1 << 10) | ||
1372 | #define SSI_CONFIG_BM (3 << 8) | ||
1373 | #define SSI_CONFIG_CE (1 << 7) | ||
1374 | #define SSI_CONFIG_DP (1 << 6) | ||
1375 | #define SSI_CONFIG_DL (1 << 5) | ||
1376 | #define SSI_CONFIG_EP (1 << 4) | ||
1377 | #define SSI_CONFIG_ALEN_N(N) ((N-1) << 20) | ||
1378 | #define SSI_CONFIG_DLEN_N(N) ((N-1) << 16) | ||
1379 | #define SSI_CONFIG_BM_HI (0 << 8) | ||
1380 | #define SSI_CONFIG_BM_LO (1 << 8) | ||
1381 | #define SSI_CONFIG_BM_CY (2 << 8) | ||
1382 | |||
1383 | #define SSI_ADATA_D (1 << 24) | ||
1384 | #define SSI_ADATA_ADDR (0xFF << 16) | ||
1385 | #define SSI_ADATA_DATA 0x0FFF | ||
1386 | #define SSI_ADATA_ADDR_N(N) (N << 16) | ||
1387 | |||
1388 | #define SSI_ENABLE_CD (1 << 1) | ||
1389 | #define SSI_ENABLE_E (1 << 0) | ||
1390 | |||
1391 | /* IrDA Controller */ | ||
1392 | #define IRDA_BASE 0xB0300000 | ||
1393 | #define IR_RING_PTR_STATUS (IRDA_BASE + 0x00) | ||
1394 | #define IR_RING_BASE_ADDR_H (IRDA_BASE + 0x04) | ||
1395 | #define IR_RING_BASE_ADDR_L (IRDA_BASE + 0x08) | ||
1396 | #define IR_RING_SIZE (IRDA_BASE + 0x0C) | ||
1397 | #define IR_RING_PROMPT (IRDA_BASE + 0x10) | ||
1398 | #define IR_RING_ADDR_CMPR (IRDA_BASE + 0x14) | ||
1399 | #define IR_INT_CLEAR (IRDA_BASE + 0x18) | ||
1400 | #define IR_CONFIG_1 (IRDA_BASE + 0x20) | ||
1401 | # define IR_RX_INVERT_LED (1 << 0) | ||
1402 | # define IR_TX_INVERT_LED (1 << 1) | ||
1403 | # define IR_ST (1 << 2) | ||
1404 | # define IR_SF (1 << 3) | ||
1405 | # define IR_SIR (1 << 4) | ||
1406 | # define IR_MIR (1 << 5) | ||
1407 | # define IR_FIR (1 << 6) | ||
1408 | # define IR_16CRC (1 << 7) | ||
1409 | # define IR_TD (1 << 8) | ||
1410 | # define IR_RX_ALL (1 << 9) | ||
1411 | # define IR_DMA_ENABLE (1 << 10) | ||
1412 | # define IR_RX_ENABLE (1 << 11) | ||
1413 | # define IR_TX_ENABLE (1 << 12) | ||
1414 | # define IR_LOOPBACK (1 << 14) | ||
1415 | # define IR_SIR_MODE (IR_SIR | IR_DMA_ENABLE | \ | ||
1416 | IR_RX_ALL | IR_RX_ENABLE | IR_SF | IR_16CRC) | ||
1417 | #define IR_SIR_FLAGS (IRDA_BASE + 0x24) | ||
1418 | #define IR_ENABLE (IRDA_BASE + 0x28) | ||
1419 | # define IR_RX_STATUS (1 << 9) | ||
1420 | # define IR_TX_STATUS (1 << 10) | ||
1421 | #define IR_READ_PHY_CONFIG (IRDA_BASE + 0x2C) | ||
1422 | #define IR_WRITE_PHY_CONFIG (IRDA_BASE + 0x30) | ||
1423 | #define IR_MAX_PKT_LEN (IRDA_BASE + 0x34) | ||
1424 | #define IR_RX_BYTE_CNT (IRDA_BASE + 0x38) | ||
1425 | #define IR_CONFIG_2 (IRDA_BASE + 0x3C) | ||
1426 | # define IR_MODE_INV (1 << 0) | ||
1427 | # define IR_ONE_PIN (1 << 1) | ||
1428 | #define IR_INTERFACE_CONFIG (IRDA_BASE + 0x40) | ||
1429 | |||
1430 | /* GPIO */ | ||
1431 | #define SYS_PINFUNC 0xB190002C | ||
1432 | # define SYS_PF_USB (1 << 15) /* 2nd USB device/host */ | ||
1433 | # define SYS_PF_U3 (1 << 14) /* GPIO23/U3TXD */ | ||
1434 | # define SYS_PF_U2 (1 << 13) /* GPIO22/U2TXD */ | ||
1435 | # define SYS_PF_U1 (1 << 12) /* GPIO21/U1TXD */ | ||
1436 | # define SYS_PF_SRC (1 << 11) /* GPIO6/SROMCKE */ | ||
1437 | # define SYS_PF_CK5 (1 << 10) /* GPIO3/CLK5 */ | ||
1438 | # define SYS_PF_CK4 (1 << 9) /* GPIO2/CLK4 */ | ||
1439 | # define SYS_PF_IRF (1 << 8) /* GPIO15/IRFIRSEL */ | ||
1440 | # define SYS_PF_UR3 (1 << 7) /* GPIO[14:9]/UART3 */ | ||
1441 | # define SYS_PF_I2D (1 << 6) /* GPIO8/I2SDI */ | ||
1442 | # define SYS_PF_I2S (1 << 5) /* I2S/GPIO[29:31] */ | ||
1443 | # define SYS_PF_NI2 (1 << 4) /* NI2/GPIO[24:28] */ | ||
1444 | # define SYS_PF_U0 (1 << 3) /* U0TXD/GPIO20 */ | ||
1445 | # define SYS_PF_RD (1 << 2) /* IRTXD/GPIO19 */ | ||
1446 | # define SYS_PF_A97 (1 << 1) /* AC97/SSL1 */ | ||
1447 | # define SYS_PF_S0 (1 << 0) /* SSI_0/GPIO[16:18] */ | ||
1448 | |||
1449 | /* Au1100 only */ | ||
1450 | # define SYS_PF_PC (1 << 18) /* PCMCIA/GPIO[207:204] */ | ||
1451 | # define SYS_PF_LCD (1 << 17) /* extern lcd/GPIO[203:200] */ | ||
1452 | # define SYS_PF_CS (1 << 16) /* EXTCLK0/32KHz to gpio2 */ | ||
1453 | # define SYS_PF_EX0 (1 << 9) /* GPIO2/clock */ | ||
1454 | |||
1455 | /* Au1550 only. Redefines lots of pins */ | ||
1456 | # define SYS_PF_PSC2_MASK (7 << 17) | ||
1457 | # define SYS_PF_PSC2_AC97 0 | ||
1458 | # define SYS_PF_PSC2_SPI 0 | ||
1459 | # define SYS_PF_PSC2_I2S (1 << 17) | ||
1460 | # define SYS_PF_PSC2_SMBUS (3 << 17) | ||
1461 | # define SYS_PF_PSC2_GPIO (7 << 17) | ||
1462 | # define SYS_PF_PSC3_MASK (7 << 20) | ||
1463 | # define SYS_PF_PSC3_AC97 0 | ||
1464 | # define SYS_PF_PSC3_SPI 0 | ||
1465 | # define SYS_PF_PSC3_I2S (1 << 20) | ||
1466 | # define SYS_PF_PSC3_SMBUS (3 << 20) | ||
1467 | # define SYS_PF_PSC3_GPIO (7 << 20) | ||
1468 | # define SYS_PF_PSC1_S1 (1 << 1) | ||
1469 | # define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2)) | ||
1470 | |||
1471 | /* Au1200 only */ | ||
1472 | #ifdef CONFIG_SOC_AU1200 | ||
1473 | #define SYS_PINFUNC_DMA (1 << 31) | ||
1474 | #define SYS_PINFUNC_S0A (1 << 30) | ||
1475 | #define SYS_PINFUNC_S1A (1 << 29) | ||
1476 | #define SYS_PINFUNC_LP0 (1 << 28) | ||
1477 | #define SYS_PINFUNC_LP1 (1 << 27) | ||
1478 | #define SYS_PINFUNC_LD16 (1 << 26) | ||
1479 | #define SYS_PINFUNC_LD8 (1 << 25) | ||
1480 | #define SYS_PINFUNC_LD1 (1 << 24) | ||
1481 | #define SYS_PINFUNC_LD0 (1 << 23) | ||
1482 | #define SYS_PINFUNC_P1A (3 << 21) | ||
1483 | #define SYS_PINFUNC_P1B (1 << 20) | ||
1484 | #define SYS_PINFUNC_FS3 (1 << 19) | ||
1485 | #define SYS_PINFUNC_P0A (3 << 17) | ||
1486 | #define SYS_PINFUNC_CS (1 << 16) | ||
1487 | #define SYS_PINFUNC_CIM (1 << 15) | ||
1488 | #define SYS_PINFUNC_P1C (1 << 14) | ||
1489 | #define SYS_PINFUNC_U1T (1 << 12) | ||
1490 | #define SYS_PINFUNC_U1R (1 << 11) | ||
1491 | #define SYS_PINFUNC_EX1 (1 << 10) | ||
1492 | #define SYS_PINFUNC_EX0 (1 << 9) | ||
1493 | #define SYS_PINFUNC_U0R (1 << 8) | ||
1494 | #define SYS_PINFUNC_MC (1 << 7) | ||
1495 | #define SYS_PINFUNC_S0B (1 << 6) | ||
1496 | #define SYS_PINFUNC_S0C (1 << 5) | ||
1497 | #define SYS_PINFUNC_P0B (1 << 4) | ||
1498 | #define SYS_PINFUNC_U0T (1 << 3) | ||
1499 | #define SYS_PINFUNC_S1B (1 << 2) | ||
1500 | #endif | ||
1501 | |||
1502 | #define SYS_TRIOUTRD 0xB1900100 | ||
1503 | #define SYS_TRIOUTCLR 0xB1900100 | ||
1504 | #define SYS_OUTPUTRD 0xB1900108 | ||
1505 | #define SYS_OUTPUTSET 0xB1900108 | ||
1506 | #define SYS_OUTPUTCLR 0xB190010C | ||
1507 | #define SYS_PINSTATERD 0xB1900110 | ||
1508 | #define SYS_PININPUTEN 0xB1900110 | ||
1509 | |||
1510 | /* GPIO2, Au1500, Au1550 only */ | ||
1511 | #define GPIO2_BASE 0xB1700000 | ||
1512 | #define GPIO2_DIR (GPIO2_BASE + 0) | ||
1513 | #define GPIO2_OUTPUT (GPIO2_BASE + 8) | ||
1514 | #define GPIO2_PINSTATE (GPIO2_BASE + 0xC) | ||
1515 | #define GPIO2_INTENABLE (GPIO2_BASE + 0x10) | ||
1516 | #define GPIO2_ENABLE (GPIO2_BASE + 0x14) | ||
1517 | |||
1518 | /* Power Management */ | ||
1519 | #define SYS_SCRATCH0 0xB1900018 | ||
1520 | #define SYS_SCRATCH1 0xB190001C | ||
1521 | #define SYS_WAKEMSK 0xB1900034 | ||
1522 | #define SYS_ENDIAN 0xB1900038 | ||
1523 | #define SYS_POWERCTRL 0xB190003C | ||
1524 | #define SYS_WAKESRC 0xB190005C | ||
1525 | #define SYS_SLPPWR 0xB1900078 | ||
1526 | #define SYS_SLEEP 0xB190007C | ||
1527 | |||
1528 | /* Clock Controller */ | ||
1529 | #define SYS_FREQCTRL0 0xB1900020 | ||
1530 | # define SYS_FC_FRDIV2_BIT 22 | ||
1531 | # define SYS_FC_FRDIV2_MASK (0xff << SYS_FC_FRDIV2_BIT) | ||
1532 | # define SYS_FC_FE2 (1 << 21) | ||
1533 | # define SYS_FC_FS2 (1 << 20) | ||
1534 | # define SYS_FC_FRDIV1_BIT 12 | ||
1535 | # define SYS_FC_FRDIV1_MASK (0xff << SYS_FC_FRDIV1_BIT) | ||
1536 | # define SYS_FC_FE1 (1 << 11) | ||
1537 | # define SYS_FC_FS1 (1 << 10) | ||
1538 | # define SYS_FC_FRDIV0_BIT 2 | ||
1539 | # define SYS_FC_FRDIV0_MASK (0xff << SYS_FC_FRDIV0_BIT) | ||
1540 | # define SYS_FC_FE0 (1 << 1) | ||
1541 | # define SYS_FC_FS0 (1 << 0) | ||
1542 | #define SYS_FREQCTRL1 0xB1900024 | ||
1543 | # define SYS_FC_FRDIV5_BIT 22 | ||
1544 | # define SYS_FC_FRDIV5_MASK (0xff << SYS_FC_FRDIV5_BIT) | ||
1545 | # define SYS_FC_FE5 (1 << 21) | ||
1546 | # define SYS_FC_FS5 (1 << 20) | ||
1547 | # define SYS_FC_FRDIV4_BIT 12 | ||
1548 | # define SYS_FC_FRDIV4_MASK (0xff << SYS_FC_FRDIV4_BIT) | ||
1549 | # define SYS_FC_FE4 (1 << 11) | ||
1550 | # define SYS_FC_FS4 (1 << 10) | ||
1551 | # define SYS_FC_FRDIV3_BIT 2 | ||
1552 | # define SYS_FC_FRDIV3_MASK (0xff << SYS_FC_FRDIV3_BIT) | ||
1553 | # define SYS_FC_FE3 (1 << 1) | ||
1554 | # define SYS_FC_FS3 (1 << 0) | ||
1555 | #define SYS_CLKSRC 0xB1900028 | ||
1556 | # define SYS_CS_ME1_BIT 27 | ||
1557 | # define SYS_CS_ME1_MASK (0x7 << SYS_CS_ME1_BIT) | ||
1558 | # define SYS_CS_DE1 (1 << 26) | ||
1559 | # define SYS_CS_CE1 (1 << 25) | ||
1560 | # define SYS_CS_ME0_BIT 22 | ||
1561 | # define SYS_CS_ME0_MASK (0x7 << SYS_CS_ME0_BIT) | ||
1562 | # define SYS_CS_DE0 (1 << 21) | ||
1563 | # define SYS_CS_CE0 (1 << 20) | ||
1564 | # define SYS_CS_MI2_BIT 17 | ||
1565 | # define SYS_CS_MI2_MASK (0x7 << SYS_CS_MI2_BIT) | ||
1566 | # define SYS_CS_DI2 (1 << 16) | ||
1567 | # define SYS_CS_CI2 (1 << 15) | ||
1568 | #ifdef CONFIG_SOC_AU1100 | ||
1569 | # define SYS_CS_ML_BIT 7 | ||
1570 | # define SYS_CS_ML_MASK (0x7 << SYS_CS_ML_BIT) | ||
1571 | # define SYS_CS_DL (1 << 6) | ||
1572 | # define SYS_CS_CL (1 << 5) | ||
1573 | #else | ||
1574 | # define SYS_CS_MUH_BIT 12 | ||
1575 | # define SYS_CS_MUH_MASK (0x7 << SYS_CS_MUH_BIT) | ||
1576 | # define SYS_CS_DUH (1 << 11) | ||
1577 | # define SYS_CS_CUH (1 << 10) | ||
1578 | # define SYS_CS_MUD_BIT 7 | ||
1579 | # define SYS_CS_MUD_MASK (0x7 << SYS_CS_MUD_BIT) | ||
1580 | # define SYS_CS_DUD (1 << 6) | ||
1581 | # define SYS_CS_CUD (1 << 5) | ||
1582 | #endif | ||
1583 | # define SYS_CS_MIR_BIT 2 | ||
1584 | # define SYS_CS_MIR_MASK (0x7 << SYS_CS_MIR_BIT) | ||
1585 | # define SYS_CS_DIR (1 << 1) | ||
1586 | # define SYS_CS_CIR (1 << 0) | ||
1587 | |||
1588 | # define SYS_CS_MUX_AUX 0x1 | ||
1589 | # define SYS_CS_MUX_FQ0 0x2 | ||
1590 | # define SYS_CS_MUX_FQ1 0x3 | ||
1591 | # define SYS_CS_MUX_FQ2 0x4 | ||
1592 | # define SYS_CS_MUX_FQ3 0x5 | ||
1593 | # define SYS_CS_MUX_FQ4 0x6 | ||
1594 | # define SYS_CS_MUX_FQ5 0x7 | ||
1595 | #define SYS_CPUPLL 0xB1900060 | ||
1596 | #define SYS_AUXPLL 0xB1900064 | ||
1597 | |||
1598 | /* AC97 Controller */ | ||
1599 | #define AC97C_CONFIG 0xB0000000 | ||
1600 | # define AC97C_RECV_SLOTS_BIT 13 | ||
1601 | # define AC97C_RECV_SLOTS_MASK (0x3ff << AC97C_RECV_SLOTS_BIT) | ||
1602 | # define AC97C_XMIT_SLOTS_BIT 3 | ||
1603 | # define AC97C_XMIT_SLOTS_MASK (0x3ff << AC97C_XMIT_SLOTS_BIT) | ||
1604 | # define AC97C_SG (1 << 2) | ||
1605 | # define AC97C_SYNC (1 << 1) | ||
1606 | # define AC97C_RESET (1 << 0) | ||
1607 | #define AC97C_STATUS 0xB0000004 | ||
1608 | # define AC97C_XU (1 << 11) | ||
1609 | # define AC97C_XO (1 << 10) | ||
1610 | # define AC97C_RU (1 << 9) | ||
1611 | # define AC97C_RO (1 << 8) | ||
1612 | # define AC97C_READY (1 << 7) | ||
1613 | # define AC97C_CP (1 << 6) | ||
1614 | # define AC97C_TR (1 << 5) | ||
1615 | # define AC97C_TE (1 << 4) | ||
1616 | # define AC97C_TF (1 << 3) | ||
1617 | # define AC97C_RR (1 << 2) | ||
1618 | # define AC97C_RE (1 << 1) | ||
1619 | # define AC97C_RF (1 << 0) | ||
1620 | #define AC97C_DATA 0xB0000008 | ||
1621 | #define AC97C_CMD 0xB000000C | ||
1622 | # define AC97C_WD_BIT 16 | ||
1623 | # define AC97C_READ (1 << 7) | ||
1624 | # define AC97C_INDEX_MASK 0x7f | ||
1625 | #define AC97C_CNTRL 0xB0000010 | ||
1626 | # define AC97C_RS (1 << 1) | ||
1627 | # define AC97C_CE (1 << 0) | ||
1628 | |||
1629 | /* Secure Digital (SD) Controller */ | ||
1630 | #define SD0_XMIT_FIFO 0xB0600000 | ||
1631 | #define SD0_RECV_FIFO 0xB0600004 | ||
1632 | #define SD1_XMIT_FIFO 0xB0680000 | ||
1633 | #define SD1_RECV_FIFO 0xB0680004 | ||
1634 | |||
1635 | #if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550) | ||
1636 | /* Au1500 PCI Controller */ | ||
1637 | #define Au1500_CFG_BASE 0xB4005000 /* virtual, KSEG1 addr */ | ||
1638 | #define Au1500_PCI_CMEM (Au1500_CFG_BASE + 0) | ||
1639 | #define Au1500_PCI_CFG (Au1500_CFG_BASE + 4) | ||
1640 | # define PCI_ERROR ((1 << 22) | (1 << 23) | (1 << 24) | \ | ||
1641 | (1 << 25) | (1 << 26) | (1 << 27)) | ||
1642 | #define Au1500_PCI_B2BMASK_CCH (Au1500_CFG_BASE + 8) | ||
1643 | #define Au1500_PCI_B2B0_VID (Au1500_CFG_BASE + 0xC) | ||
1644 | #define Au1500_PCI_B2B1_ID (Au1500_CFG_BASE + 0x10) | ||
1645 | #define Au1500_PCI_MWMASK_DEV (Au1500_CFG_BASE + 0x14) | ||
1646 | #define Au1500_PCI_MWBASE_REV_CCL (Au1500_CFG_BASE + 0x18) | ||
1647 | #define Au1500_PCI_ERR_ADDR (Au1500_CFG_BASE + 0x1C) | ||
1648 | #define Au1500_PCI_SPEC_INTACK (Au1500_CFG_BASE + 0x20) | ||
1649 | #define Au1500_PCI_ID (Au1500_CFG_BASE + 0x100) | ||
1650 | #define Au1500_PCI_STATCMD (Au1500_CFG_BASE + 0x104) | ||
1651 | #define Au1500_PCI_CLASSREV (Au1500_CFG_BASE + 0x108) | ||
1652 | #define Au1500_PCI_HDRTYPE (Au1500_CFG_BASE + 0x10C) | ||
1653 | #define Au1500_PCI_MBAR (Au1500_CFG_BASE + 0x110) | ||
1654 | |||
1655 | #define Au1500_PCI_HDR 0xB4005100 /* virtual, KSEG1 addr */ | ||
1656 | |||
1657 | /* | ||
1658 | * All of our structures, like PCI resource, have 32-bit members. | ||
1659 | * Drivers are expected to do an ioremap on the PCI MEM resource, but it's | ||
1660 | * hard to store 0x4 0000 0000 in a 32-bit type. We require a small patch | ||
1661 | * to __ioremap to check for addresses between (u32)Au1500_PCI_MEM_START and | ||
1662 | * (u32)Au1500_PCI_MEM_END and change those to the full 36-bit PCI MEM | ||
1663 | * addresses. For PCI I/O, it's simpler because we get to do the ioremap | ||
1664 | * ourselves and then adjust the device's resources. | ||
1665 | */ | ||
1666 | #define Au1500_EXT_CFG 0x600000000ULL | ||
1667 | #define Au1500_EXT_CFG_TYPE1 0x680000000ULL | ||
1668 | #define Au1500_PCI_IO_START 0x500000000ULL | ||
1669 | #define Au1500_PCI_IO_END 0x5000FFFFFULL | ||
1670 | #define Au1500_PCI_MEM_START 0x440000000ULL | ||
1671 | #define Au1500_PCI_MEM_END 0x44FFFFFFFULL | ||
1672 | |||
1673 | #define PCI_IO_START 0x00001000 | ||
1674 | #define PCI_IO_END 0x000FFFFF | ||
1675 | #define PCI_MEM_START 0x40000000 | ||
1676 | #define PCI_MEM_END 0x4FFFFFFF | ||
1677 | |||
1678 | #define PCI_FIRST_DEVFN (0 << 3) | ||
1679 | #define PCI_LAST_DEVFN (19 << 3) | ||
1680 | |||
1681 | #define IOPORT_RESOURCE_START 0x00001000 /* skip legacy probing */ | ||
1682 | #define IOPORT_RESOURCE_END 0xffffffff | ||
1683 | #define IOMEM_RESOURCE_START 0x10000000 | ||
1684 | #define IOMEM_RESOURCE_END 0xffffffff | ||
1685 | |||
1686 | #else /* Au1000 and Au1100 and Au1200 */ | ||
1687 | |||
1688 | /* Don't allow any legacy ports probing */ | ||
1689 | #define IOPORT_RESOURCE_START 0x10000000 | ||
1690 | #define IOPORT_RESOURCE_END 0xffffffff | ||
1691 | #define IOMEM_RESOURCE_START 0x10000000 | ||
1692 | #define IOMEM_RESOURCE_END 0xffffffff | ||
1693 | |||
1694 | #define PCI_IO_START 0 | ||
1695 | #define PCI_IO_END 0 | ||
1696 | #define PCI_MEM_START 0 | ||
1697 | #define PCI_MEM_END 0 | ||
1698 | #define PCI_FIRST_DEVFN 0 | ||
1699 | #define PCI_LAST_DEVFN 0 | ||
1700 | |||
1701 | #endif | ||
1702 | |||
1703 | #ifndef _LANGUAGE_ASSEMBLY | ||
1704 | typedef volatile struct { | ||
1705 | /* 0x0000 */ u32 toytrim; | ||
1706 | /* 0x0004 */ u32 toywrite; | ||
1707 | /* 0x0008 */ u32 toymatch0; | ||
1708 | /* 0x000C */ u32 toymatch1; | ||
1709 | /* 0x0010 */ u32 toymatch2; | ||
1710 | /* 0x0014 */ u32 cntrctrl; | ||
1711 | /* 0x0018 */ u32 scratch0; | ||
1712 | /* 0x001C */ u32 scratch1; | ||
1713 | /* 0x0020 */ u32 freqctrl0; | ||
1714 | /* 0x0024 */ u32 freqctrl1; | ||
1715 | /* 0x0028 */ u32 clksrc; | ||
1716 | /* 0x002C */ u32 pinfunc; | ||
1717 | /* 0x0030 */ u32 reserved0; | ||
1718 | /* 0x0034 */ u32 wakemsk; | ||
1719 | /* 0x0038 */ u32 endian; | ||
1720 | /* 0x003C */ u32 powerctrl; | ||
1721 | /* 0x0040 */ u32 toyread; | ||
1722 | /* 0x0044 */ u32 rtctrim; | ||
1723 | /* 0x0048 */ u32 rtcwrite; | ||
1724 | /* 0x004C */ u32 rtcmatch0; | ||
1725 | /* 0x0050 */ u32 rtcmatch1; | ||
1726 | /* 0x0054 */ u32 rtcmatch2; | ||
1727 | /* 0x0058 */ u32 rtcread; | ||
1728 | /* 0x005C */ u32 wakesrc; | ||
1729 | /* 0x0060 */ u32 cpupll; | ||
1730 | /* 0x0064 */ u32 auxpll; | ||
1731 | /* 0x0068 */ u32 reserved1; | ||
1732 | /* 0x006C */ u32 reserved2; | ||
1733 | /* 0x0070 */ u32 reserved3; | ||
1734 | /* 0x0074 */ u32 reserved4; | ||
1735 | /* 0x0078 */ u32 slppwr; | ||
1736 | /* 0x007C */ u32 sleep; | ||
1737 | /* 0x0080 */ u32 reserved5[32]; | ||
1738 | /* 0x0100 */ u32 trioutrd; | ||
1739 | #define trioutclr trioutrd | ||
1740 | /* 0x0104 */ u32 reserved6; | ||
1741 | /* 0x0108 */ u32 outputrd; | ||
1742 | #define outputset outputrd | ||
1743 | /* 0x010C */ u32 outputclr; | ||
1744 | /* 0x0110 */ u32 pinstaterd; | ||
1745 | #define pininputen pinstaterd | ||
1746 | } AU1X00_SYS; | ||
1747 | |||
1748 | static AU1X00_SYS * const sys = (AU1X00_SYS *)SYS_BASE; | ||
1749 | |||
1750 | #endif | ||
1751 | |||
1752 | /* | ||
1753 | * Processor information based on PRID. | ||
1754 | * Copied from PowerPC. | ||
1755 | */ | ||
1756 | #ifndef _LANGUAGE_ASSEMBLY | ||
1757 | struct cpu_spec { | ||
1758 | /* CPU is matched via (PRID & prid_mask) == prid_value */ | ||
1759 | unsigned int prid_mask; | ||
1760 | unsigned int prid_value; | ||
1761 | |||
1762 | char *cpu_name; | ||
1763 | unsigned char cpu_od; /* Set Config[OD] */ | ||
1764 | unsigned char cpu_bclk; /* Enable BCLK switching */ | ||
1765 | unsigned char cpu_pll_wo; /* sys_cpupll reg. write-only */ | ||
1766 | }; | ||
1767 | |||
1768 | extern struct cpu_spec cpu_specs[]; | ||
1769 | extern struct cpu_spec *cur_cpu_spec[]; | ||
1770 | #endif | ||
1771 | |||
1772 | #endif | ||
diff --git a/include/asm-mips/mach-au1x00/au1000_dma.h b/include/asm-mips/mach-au1x00/au1000_dma.h deleted file mode 100644 index c333b4e1cd44..000000000000 --- a/include/asm-mips/mach-au1x00/au1000_dma.h +++ /dev/null | |||
@@ -1,458 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * Defines for using and allocating DMA channels on the Alchemy | ||
4 | * Au1x00 MIPS processors. | ||
5 | * | ||
6 | * Copyright 2000, 2008 MontaVista Software Inc. | ||
7 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
15 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
17 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
20 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
21 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | * | ||
29 | */ | ||
30 | #ifndef __ASM_AU1000_DMA_H | ||
31 | #define __ASM_AU1000_DMA_H | ||
32 | |||
33 | #include <linux/io.h> /* need byte IO */ | ||
34 | #include <linux/spinlock.h> /* And spinlocks */ | ||
35 | #include <linux/delay.h> | ||
36 | #include <asm/system.h> | ||
37 | |||
38 | #define NUM_AU1000_DMA_CHANNELS 8 | ||
39 | |||
40 | /* DMA Channel Base Addresses */ | ||
41 | #define DMA_CHANNEL_BASE 0xB4002000 | ||
42 | #define DMA_CHANNEL_LEN 0x00000100 | ||
43 | |||
44 | /* DMA Channel Register Offsets */ | ||
45 | #define DMA_MODE_SET 0x00000000 | ||
46 | #define DMA_MODE_READ DMA_MODE_SET | ||
47 | #define DMA_MODE_CLEAR 0x00000004 | ||
48 | /* DMA Mode register bits follow */ | ||
49 | #define DMA_DAH_MASK (0x0f << 20) | ||
50 | #define DMA_DID_BIT 16 | ||
51 | #define DMA_DID_MASK (0x0f << DMA_DID_BIT) | ||
52 | #define DMA_DS (1 << 15) | ||
53 | #define DMA_BE (1 << 13) | ||
54 | #define DMA_DR (1 << 12) | ||
55 | #define DMA_TS8 (1 << 11) | ||
56 | #define DMA_DW_BIT 9 | ||
57 | #define DMA_DW_MASK (0x03 << DMA_DW_BIT) | ||
58 | #define DMA_DW8 (0 << DMA_DW_BIT) | ||
59 | #define DMA_DW16 (1 << DMA_DW_BIT) | ||
60 | #define DMA_DW32 (2 << DMA_DW_BIT) | ||
61 | #define DMA_NC (1 << 8) | ||
62 | #define DMA_IE (1 << 7) | ||
63 | #define DMA_HALT (1 << 6) | ||
64 | #define DMA_GO (1 << 5) | ||
65 | #define DMA_AB (1 << 4) | ||
66 | #define DMA_D1 (1 << 3) | ||
67 | #define DMA_BE1 (1 << 2) | ||
68 | #define DMA_D0 (1 << 1) | ||
69 | #define DMA_BE0 (1 << 0) | ||
70 | |||
71 | #define DMA_PERIPHERAL_ADDR 0x00000008 | ||
72 | #define DMA_BUFFER0_START 0x0000000C | ||
73 | #define DMA_BUFFER1_START 0x00000014 | ||
74 | #define DMA_BUFFER0_COUNT 0x00000010 | ||
75 | #define DMA_BUFFER1_COUNT 0x00000018 | ||
76 | #define DMA_BAH_BIT 16 | ||
77 | #define DMA_BAH_MASK (0x0f << DMA_BAH_BIT) | ||
78 | #define DMA_COUNT_BIT 0 | ||
79 | #define DMA_COUNT_MASK (0xffff << DMA_COUNT_BIT) | ||
80 | |||
81 | /* DMA Device IDs follow */ | ||
82 | enum { | ||
83 | DMA_ID_UART0_TX = 0, | ||
84 | DMA_ID_UART0_RX, | ||
85 | DMA_ID_GP04, | ||
86 | DMA_ID_GP05, | ||
87 | DMA_ID_AC97C_TX, | ||
88 | DMA_ID_AC97C_RX, | ||
89 | DMA_ID_UART3_TX, | ||
90 | DMA_ID_UART3_RX, | ||
91 | DMA_ID_USBDEV_EP0_RX, | ||
92 | DMA_ID_USBDEV_EP0_TX, | ||
93 | DMA_ID_USBDEV_EP2_TX, | ||
94 | DMA_ID_USBDEV_EP3_TX, | ||
95 | DMA_ID_USBDEV_EP4_RX, | ||
96 | DMA_ID_USBDEV_EP5_RX, | ||
97 | DMA_ID_I2S_TX, | ||
98 | DMA_ID_I2S_RX, | ||
99 | DMA_NUM_DEV | ||
100 | }; | ||
101 | |||
102 | /* DMA Device ID's for 2nd bank (AU1100) follow */ | ||
103 | enum { | ||
104 | DMA_ID_SD0_TX = 0, | ||
105 | DMA_ID_SD0_RX, | ||
106 | DMA_ID_SD1_TX, | ||
107 | DMA_ID_SD1_RX, | ||
108 | DMA_NUM_DEV_BANK2 | ||
109 | }; | ||
110 | |||
111 | struct dma_chan { | ||
112 | int dev_id; /* this channel is allocated if >= 0, */ | ||
113 | /* free otherwise */ | ||
114 | unsigned int io; | ||
115 | const char *dev_str; | ||
116 | int irq; | ||
117 | void *irq_dev; | ||
118 | unsigned int fifo_addr; | ||
119 | unsigned int mode; | ||
120 | }; | ||
121 | |||
122 | /* These are in arch/mips/au1000/common/dma.c */ | ||
123 | extern struct dma_chan au1000_dma_table[]; | ||
124 | extern int request_au1000_dma(int dev_id, | ||
125 | const char *dev_str, | ||
126 | irq_handler_t irqhandler, | ||
127 | unsigned long irqflags, | ||
128 | void *irq_dev_id); | ||
129 | extern void free_au1000_dma(unsigned int dmanr); | ||
130 | extern int au1000_dma_read_proc(char *buf, char **start, off_t fpos, | ||
131 | int length, int *eof, void *data); | ||
132 | extern void dump_au1000_dma_channel(unsigned int dmanr); | ||
133 | extern spinlock_t au1000_dma_spin_lock; | ||
134 | |||
135 | static inline struct dma_chan *get_dma_chan(unsigned int dmanr) | ||
136 | { | ||
137 | if (dmanr >= NUM_AU1000_DMA_CHANNELS || | ||
138 | au1000_dma_table[dmanr].dev_id < 0) | ||
139 | return NULL; | ||
140 | return &au1000_dma_table[dmanr]; | ||
141 | } | ||
142 | |||
143 | static inline unsigned long claim_dma_lock(void) | ||
144 | { | ||
145 | unsigned long flags; | ||
146 | |||
147 | spin_lock_irqsave(&au1000_dma_spin_lock, flags); | ||
148 | return flags; | ||
149 | } | ||
150 | |||
151 | static inline void release_dma_lock(unsigned long flags) | ||
152 | { | ||
153 | spin_unlock_irqrestore(&au1000_dma_spin_lock, flags); | ||
154 | } | ||
155 | |||
156 | /* | ||
157 | * Set the DMA buffer enable bits in the mode register. | ||
158 | */ | ||
159 | static inline void enable_dma_buffer0(unsigned int dmanr) | ||
160 | { | ||
161 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
162 | |||
163 | if (!chan) | ||
164 | return; | ||
165 | au_writel(DMA_BE0, chan->io + DMA_MODE_SET); | ||
166 | } | ||
167 | |||
168 | static inline void enable_dma_buffer1(unsigned int dmanr) | ||
169 | { | ||
170 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
171 | |||
172 | if (!chan) | ||
173 | return; | ||
174 | au_writel(DMA_BE1, chan->io + DMA_MODE_SET); | ||
175 | } | ||
176 | static inline void enable_dma_buffers(unsigned int dmanr) | ||
177 | { | ||
178 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
179 | |||
180 | if (!chan) | ||
181 | return; | ||
182 | au_writel(DMA_BE0 | DMA_BE1, chan->io + DMA_MODE_SET); | ||
183 | } | ||
184 | |||
185 | static inline void start_dma(unsigned int dmanr) | ||
186 | { | ||
187 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
188 | |||
189 | if (!chan) | ||
190 | return; | ||
191 | au_writel(DMA_GO, chan->io + DMA_MODE_SET); | ||
192 | } | ||
193 | |||
194 | #define DMA_HALT_POLL 0x5000 | ||
195 | |||
196 | static inline void halt_dma(unsigned int dmanr) | ||
197 | { | ||
198 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
199 | int i; | ||
200 | |||
201 | if (!chan) | ||
202 | return; | ||
203 | au_writel(DMA_GO, chan->io + DMA_MODE_CLEAR); | ||
204 | |||
205 | /* Poll the halt bit */ | ||
206 | for (i = 0; i < DMA_HALT_POLL; i++) | ||
207 | if (au_readl(chan->io + DMA_MODE_READ) & DMA_HALT) | ||
208 | break; | ||
209 | if (i == DMA_HALT_POLL) | ||
210 | printk(KERN_INFO "halt_dma: HALT poll expired!\n"); | ||
211 | } | ||
212 | |||
213 | static inline void disable_dma(unsigned int dmanr) | ||
214 | { | ||
215 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
216 | |||
217 | if (!chan) | ||
218 | return; | ||
219 | |||
220 | halt_dma(dmanr); | ||
221 | |||
222 | /* Now we can disable the buffers */ | ||
223 | au_writel(~DMA_GO, chan->io + DMA_MODE_CLEAR); | ||
224 | } | ||
225 | |||
226 | static inline int dma_halted(unsigned int dmanr) | ||
227 | { | ||
228 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
229 | |||
230 | if (!chan) | ||
231 | return 1; | ||
232 | return (au_readl(chan->io + DMA_MODE_READ) & DMA_HALT) ? 1 : 0; | ||
233 | } | ||
234 | |||
235 | /* Initialize a DMA channel. */ | ||
236 | static inline void init_dma(unsigned int dmanr) | ||
237 | { | ||
238 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
239 | u32 mode; | ||
240 | |||
241 | if (!chan) | ||
242 | return; | ||
243 | |||
244 | disable_dma(dmanr); | ||
245 | |||
246 | /* Set device FIFO address */ | ||
247 | au_writel(CPHYSADDR(chan->fifo_addr), chan->io + DMA_PERIPHERAL_ADDR); | ||
248 | |||
249 | mode = chan->mode | (chan->dev_id << DMA_DID_BIT); | ||
250 | if (chan->irq) | ||
251 | mode |= DMA_IE; | ||
252 | |||
253 | au_writel(~mode, chan->io + DMA_MODE_CLEAR); | ||
254 | au_writel(mode, chan->io + DMA_MODE_SET); | ||
255 | } | ||
256 | |||
257 | /* | ||
258 | * Set mode for a specific DMA channel | ||
259 | */ | ||
260 | static inline void set_dma_mode(unsigned int dmanr, unsigned int mode) | ||
261 | { | ||
262 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
263 | |||
264 | if (!chan) | ||
265 | return; | ||
266 | /* | ||
267 | * set_dma_mode is only allowed to change endianess, direction, | ||
268 | * transfer size, device FIFO width, and coherency settings. | ||
269 | * Make sure anything else is masked off. | ||
270 | */ | ||
271 | mode &= (DMA_BE | DMA_DR | DMA_TS8 | DMA_DW_MASK | DMA_NC); | ||
272 | chan->mode &= ~(DMA_BE | DMA_DR | DMA_TS8 | DMA_DW_MASK | DMA_NC); | ||
273 | chan->mode |= mode; | ||
274 | } | ||
275 | |||
276 | static inline unsigned int get_dma_mode(unsigned int dmanr) | ||
277 | { | ||
278 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
279 | |||
280 | if (!chan) | ||
281 | return 0; | ||
282 | return chan->mode; | ||
283 | } | ||
284 | |||
285 | static inline int get_dma_active_buffer(unsigned int dmanr) | ||
286 | { | ||
287 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
288 | |||
289 | if (!chan) | ||
290 | return -1; | ||
291 | return (au_readl(chan->io + DMA_MODE_READ) & DMA_AB) ? 1 : 0; | ||
292 | } | ||
293 | |||
294 | /* | ||
295 | * Set the device FIFO address for a specific DMA channel - only | ||
296 | * applicable to GPO4 and GPO5. All the other devices have fixed | ||
297 | * FIFO addresses. | ||
298 | */ | ||
299 | static inline void set_dma_fifo_addr(unsigned int dmanr, unsigned int a) | ||
300 | { | ||
301 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
302 | |||
303 | if (!chan) | ||
304 | return; | ||
305 | |||
306 | if (chan->mode & DMA_DS) /* second bank of device IDs */ | ||
307 | return; | ||
308 | |||
309 | if (chan->dev_id != DMA_ID_GP04 && chan->dev_id != DMA_ID_GP05) | ||
310 | return; | ||
311 | |||
312 | au_writel(CPHYSADDR(a), chan->io + DMA_PERIPHERAL_ADDR); | ||
313 | } | ||
314 | |||
315 | /* | ||
316 | * Clear the DMA buffer done bits in the mode register. | ||
317 | */ | ||
318 | static inline void clear_dma_done0(unsigned int dmanr) | ||
319 | { | ||
320 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
321 | |||
322 | if (!chan) | ||
323 | return; | ||
324 | au_writel(DMA_D0, chan->io + DMA_MODE_CLEAR); | ||
325 | } | ||
326 | |||
327 | static inline void clear_dma_done1(unsigned int dmanr) | ||
328 | { | ||
329 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
330 | |||
331 | if (!chan) | ||
332 | return; | ||
333 | au_writel(DMA_D1, chan->io + DMA_MODE_CLEAR); | ||
334 | } | ||
335 | |||
336 | /* | ||
337 | * This does nothing - not applicable to Au1000 DMA. | ||
338 | */ | ||
339 | static inline void set_dma_page(unsigned int dmanr, char pagenr) | ||
340 | { | ||
341 | } | ||
342 | |||
343 | /* | ||
344 | * Set Buffer 0 transfer address for specific DMA channel. | ||
345 | */ | ||
346 | static inline void set_dma_addr0(unsigned int dmanr, unsigned int a) | ||
347 | { | ||
348 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
349 | |||
350 | if (!chan) | ||
351 | return; | ||
352 | au_writel(a, chan->io + DMA_BUFFER0_START); | ||
353 | } | ||
354 | |||
355 | /* | ||
356 | * Set Buffer 1 transfer address for specific DMA channel. | ||
357 | */ | ||
358 | static inline void set_dma_addr1(unsigned int dmanr, unsigned int a) | ||
359 | { | ||
360 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
361 | |||
362 | if (!chan) | ||
363 | return; | ||
364 | au_writel(a, chan->io + DMA_BUFFER1_START); | ||
365 | } | ||
366 | |||
367 | |||
368 | /* | ||
369 | * Set Buffer 0 transfer size (max 64k) for a specific DMA channel. | ||
370 | */ | ||
371 | static inline void set_dma_count0(unsigned int dmanr, unsigned int count) | ||
372 | { | ||
373 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
374 | |||
375 | if (!chan) | ||
376 | return; | ||
377 | count &= DMA_COUNT_MASK; | ||
378 | au_writel(count, chan->io + DMA_BUFFER0_COUNT); | ||
379 | } | ||
380 | |||
381 | /* | ||
382 | * Set Buffer 1 transfer size (max 64k) for a specific DMA channel. | ||
383 | */ | ||
384 | static inline void set_dma_count1(unsigned int dmanr, unsigned int count) | ||
385 | { | ||
386 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
387 | |||
388 | if (!chan) | ||
389 | return; | ||
390 | count &= DMA_COUNT_MASK; | ||
391 | au_writel(count, chan->io + DMA_BUFFER1_COUNT); | ||
392 | } | ||
393 | |||
394 | /* | ||
395 | * Set both buffer transfer sizes (max 64k) for a specific DMA channel. | ||
396 | */ | ||
397 | static inline void set_dma_count(unsigned int dmanr, unsigned int count) | ||
398 | { | ||
399 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
400 | |||
401 | if (!chan) | ||
402 | return; | ||
403 | count &= DMA_COUNT_MASK; | ||
404 | au_writel(count, chan->io + DMA_BUFFER0_COUNT); | ||
405 | au_writel(count, chan->io + DMA_BUFFER1_COUNT); | ||
406 | } | ||
407 | |||
408 | /* | ||
409 | * Returns which buffer has its done bit set in the mode register. | ||
410 | * Returns -1 if neither or both done bits set. | ||
411 | */ | ||
412 | static inline unsigned int get_dma_buffer_done(unsigned int dmanr) | ||
413 | { | ||
414 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
415 | |||
416 | if (!chan) | ||
417 | return 0; | ||
418 | return au_readl(chan->io + DMA_MODE_READ) & (DMA_D0 | DMA_D1); | ||
419 | } | ||
420 | |||
421 | |||
422 | /* | ||
423 | * Returns the DMA channel's Buffer Done IRQ number. | ||
424 | */ | ||
425 | static inline int get_dma_done_irq(unsigned int dmanr) | ||
426 | { | ||
427 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
428 | |||
429 | if (!chan) | ||
430 | return -1; | ||
431 | return chan->irq; | ||
432 | } | ||
433 | |||
434 | /* | ||
435 | * Get DMA residue count. Returns the number of _bytes_ left to transfer. | ||
436 | */ | ||
437 | static inline int get_dma_residue(unsigned int dmanr) | ||
438 | { | ||
439 | int curBufCntReg, count; | ||
440 | struct dma_chan *chan = get_dma_chan(dmanr); | ||
441 | |||
442 | if (!chan) | ||
443 | return 0; | ||
444 | |||
445 | curBufCntReg = (au_readl(chan->io + DMA_MODE_READ) & DMA_AB) ? | ||
446 | DMA_BUFFER1_COUNT : DMA_BUFFER0_COUNT; | ||
447 | |||
448 | count = au_readl(chan->io + curBufCntReg) & DMA_COUNT_MASK; | ||
449 | |||
450 | if ((chan->mode & DMA_DW_MASK) == DMA_DW16) | ||
451 | count <<= 1; | ||
452 | else if ((chan->mode & DMA_DW_MASK) == DMA_DW32) | ||
453 | count <<= 2; | ||
454 | |||
455 | return count; | ||
456 | } | ||
457 | |||
458 | #endif /* __ASM_AU1000_DMA_H */ | ||
diff --git a/include/asm-mips/mach-au1x00/au1000_gpio.h b/include/asm-mips/mach-au1x00/au1000_gpio.h deleted file mode 100644 index d8c96fda5549..000000000000 --- a/include/asm-mips/mach-au1x00/au1000_gpio.h +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /* | ||
2 | * FILE NAME au1000_gpio.h | ||
3 | * | ||
4 | * BRIEF MODULE DESCRIPTION | ||
5 | * API to Alchemy Au1xx0 GPIO device. | ||
6 | * | ||
7 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
8 | * Steve Longerbeam | ||
9 | * | ||
10 | * Copyright 2001, 2008 MontaVista Software Inc. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify it | ||
13 | * under the terms of the GNU General Public License as published by the | ||
14 | * Free Software Foundation; either version 2 of the License, or (at your | ||
15 | * option) any later version. | ||
16 | * | ||
17 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
20 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
23 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
24 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
27 | * | ||
28 | * You should have received a copy of the GNU General Public License along | ||
29 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
30 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
31 | */ | ||
32 | |||
33 | #ifndef __AU1000_GPIO_H | ||
34 | #define __AU1000_GPIO_H | ||
35 | |||
36 | #include <linux/ioctl.h> | ||
37 | |||
38 | #define AU1000GPIO_IOC_MAGIC 'A' | ||
39 | |||
40 | #define AU1000GPIO_IN _IOR(AU1000GPIO_IOC_MAGIC, 0, int) | ||
41 | #define AU1000GPIO_SET _IOW(AU1000GPIO_IOC_MAGIC, 1, int) | ||
42 | #define AU1000GPIO_CLEAR _IOW(AU1000GPIO_IOC_MAGIC, 2, int) | ||
43 | #define AU1000GPIO_OUT _IOW(AU1000GPIO_IOC_MAGIC, 3, int) | ||
44 | #define AU1000GPIO_TRISTATE _IOW(AU1000GPIO_IOC_MAGIC, 4, int) | ||
45 | #define AU1000GPIO_AVAIL_MASK _IOR(AU1000GPIO_IOC_MAGIC, 5, int) | ||
46 | |||
47 | #ifdef __KERNEL__ | ||
48 | extern u32 get_au1000_avail_gpio_mask(void); | ||
49 | extern int au1000gpio_tristate(u32 data); | ||
50 | extern int au1000gpio_in(u32 *data); | ||
51 | extern int au1000gpio_set(u32 data); | ||
52 | extern int au1000gpio_clear(u32 data); | ||
53 | extern int au1000gpio_out(u32 data); | ||
54 | #endif | ||
55 | |||
56 | #endif | ||
diff --git a/include/asm-mips/mach-au1x00/au1100_mmc.h b/include/asm-mips/mach-au1x00/au1100_mmc.h deleted file mode 100644 index c35e20918490..000000000000 --- a/include/asm-mips/mach-au1x00/au1100_mmc.h +++ /dev/null | |||
@@ -1,208 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * Defines for using the MMC/SD controllers on the | ||
4 | * Alchemy Au1100 mips processor. | ||
5 | * | ||
6 | * Copyright (c) 2003 Embedded Edge, LLC. | ||
7 | * Author: Embedded Edge, LLC. | ||
8 | * dan@embeddededge.com or tim@embeddededge.com | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | * | ||
15 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
16 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
17 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
18 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
21 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
22 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License along | ||
27 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
28 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
29 | * | ||
30 | */ | ||
31 | /* | ||
32 | * AU1100 MMC/SD definitions. | ||
33 | * | ||
34 | * From "AMD Alchemy Solutions Au1100 Processor Data Book - Preliminary" | ||
35 | * June, 2003 | ||
36 | */ | ||
37 | |||
38 | #ifndef __ASM_AU1100_MMC_H | ||
39 | #define __ASM_AU1100_MMC_H | ||
40 | |||
41 | #include <linux/leds.h> | ||
42 | |||
43 | struct au1xmmc_platform_data { | ||
44 | int(*cd_setup)(void *mmc_host, int on); | ||
45 | int(*card_inserted)(void *mmc_host); | ||
46 | int(*card_readonly)(void *mmc_host); | ||
47 | void(*set_power)(void *mmc_host, int state); | ||
48 | struct led_classdev *led; | ||
49 | }; | ||
50 | |||
51 | #define SD0_BASE 0xB0600000 | ||
52 | #define SD1_BASE 0xB0680000 | ||
53 | |||
54 | |||
55 | /* | ||
56 | * Register offsets. | ||
57 | */ | ||
58 | #define SD_TXPORT (0x0000) | ||
59 | #define SD_RXPORT (0x0004) | ||
60 | #define SD_CONFIG (0x0008) | ||
61 | #define SD_ENABLE (0x000C) | ||
62 | #define SD_CONFIG2 (0x0010) | ||
63 | #define SD_BLKSIZE (0x0014) | ||
64 | #define SD_STATUS (0x0018) | ||
65 | #define SD_DEBUG (0x001C) | ||
66 | #define SD_CMD (0x0020) | ||
67 | #define SD_CMDARG (0x0024) | ||
68 | #define SD_RESP3 (0x0028) | ||
69 | #define SD_RESP2 (0x002C) | ||
70 | #define SD_RESP1 (0x0030) | ||
71 | #define SD_RESP0 (0x0034) | ||
72 | #define SD_TIMEOUT (0x0038) | ||
73 | |||
74 | |||
75 | /* | ||
76 | * SD_TXPORT bit definitions. | ||
77 | */ | ||
78 | #define SD_TXPORT_TXD (0x000000ff) | ||
79 | |||
80 | |||
81 | /* | ||
82 | * SD_RXPORT bit definitions. | ||
83 | */ | ||
84 | #define SD_RXPORT_RXD (0x000000ff) | ||
85 | |||
86 | |||
87 | /* | ||
88 | * SD_CONFIG bit definitions. | ||
89 | */ | ||
90 | #define SD_CONFIG_DIV (0x000001ff) | ||
91 | #define SD_CONFIG_DE (0x00000200) | ||
92 | #define SD_CONFIG_NE (0x00000400) | ||
93 | #define SD_CONFIG_TU (0x00000800) | ||
94 | #define SD_CONFIG_TO (0x00001000) | ||
95 | #define SD_CONFIG_RU (0x00002000) | ||
96 | #define SD_CONFIG_RO (0x00004000) | ||
97 | #define SD_CONFIG_I (0x00008000) | ||
98 | #define SD_CONFIG_CR (0x00010000) | ||
99 | #define SD_CONFIG_RAT (0x00020000) | ||
100 | #define SD_CONFIG_DD (0x00040000) | ||
101 | #define SD_CONFIG_DT (0x00080000) | ||
102 | #define SD_CONFIG_SC (0x00100000) | ||
103 | #define SD_CONFIG_RC (0x00200000) | ||
104 | #define SD_CONFIG_WC (0x00400000) | ||
105 | #define SD_CONFIG_xxx (0x00800000) | ||
106 | #define SD_CONFIG_TH (0x01000000) | ||
107 | #define SD_CONFIG_TE (0x02000000) | ||
108 | #define SD_CONFIG_TA (0x04000000) | ||
109 | #define SD_CONFIG_RH (0x08000000) | ||
110 | #define SD_CONFIG_RA (0x10000000) | ||
111 | #define SD_CONFIG_RF (0x20000000) | ||
112 | #define SD_CONFIG_CD (0x40000000) | ||
113 | #define SD_CONFIG_SI (0x80000000) | ||
114 | |||
115 | |||
116 | /* | ||
117 | * SD_ENABLE bit definitions. | ||
118 | */ | ||
119 | #define SD_ENABLE_CE (0x00000001) | ||
120 | #define SD_ENABLE_R (0x00000002) | ||
121 | |||
122 | |||
123 | /* | ||
124 | * SD_CONFIG2 bit definitions. | ||
125 | */ | ||
126 | #define SD_CONFIG2_EN (0x00000001) | ||
127 | #define SD_CONFIG2_FF (0x00000002) | ||
128 | #define SD_CONFIG2_xx1 (0x00000004) | ||
129 | #define SD_CONFIG2_DF (0x00000008) | ||
130 | #define SD_CONFIG2_DC (0x00000010) | ||
131 | #define SD_CONFIG2_xx2 (0x000000e0) | ||
132 | #define SD_CONFIG2_WB (0x00000100) | ||
133 | #define SD_CONFIG2_RW (0x00000200) | ||
134 | |||
135 | |||
136 | /* | ||
137 | * SD_BLKSIZE bit definitions. | ||
138 | */ | ||
139 | #define SD_BLKSIZE_BS (0x000007ff) | ||
140 | #define SD_BLKSIZE_BS_SHIFT (0) | ||
141 | #define SD_BLKSIZE_BC (0x01ff0000) | ||
142 | #define SD_BLKSIZE_BC_SHIFT (16) | ||
143 | |||
144 | |||
145 | /* | ||
146 | * SD_STATUS bit definitions. | ||
147 | */ | ||
148 | #define SD_STATUS_DCRCW (0x00000007) | ||
149 | #define SD_STATUS_xx1 (0x00000008) | ||
150 | #define SD_STATUS_CB (0x00000010) | ||
151 | #define SD_STATUS_DB (0x00000020) | ||
152 | #define SD_STATUS_CF (0x00000040) | ||
153 | #define SD_STATUS_D3 (0x00000080) | ||
154 | #define SD_STATUS_xx2 (0x00000300) | ||
155 | #define SD_STATUS_NE (0x00000400) | ||
156 | #define SD_STATUS_TU (0x00000800) | ||
157 | #define SD_STATUS_TO (0x00001000) | ||
158 | #define SD_STATUS_RU (0x00002000) | ||
159 | #define SD_STATUS_RO (0x00004000) | ||
160 | #define SD_STATUS_I (0x00008000) | ||
161 | #define SD_STATUS_CR (0x00010000) | ||
162 | #define SD_STATUS_RAT (0x00020000) | ||
163 | #define SD_STATUS_DD (0x00040000) | ||
164 | #define SD_STATUS_DT (0x00080000) | ||
165 | #define SD_STATUS_SC (0x00100000) | ||
166 | #define SD_STATUS_RC (0x00200000) | ||
167 | #define SD_STATUS_WC (0x00400000) | ||
168 | #define SD_STATUS_xx3 (0x00800000) | ||
169 | #define SD_STATUS_TH (0x01000000) | ||
170 | #define SD_STATUS_TE (0x02000000) | ||
171 | #define SD_STATUS_TA (0x04000000) | ||
172 | #define SD_STATUS_RH (0x08000000) | ||
173 | #define SD_STATUS_RA (0x10000000) | ||
174 | #define SD_STATUS_RF (0x20000000) | ||
175 | #define SD_STATUS_CD (0x40000000) | ||
176 | #define SD_STATUS_SI (0x80000000) | ||
177 | |||
178 | |||
179 | /* | ||
180 | * SD_CMD bit definitions. | ||
181 | */ | ||
182 | #define SD_CMD_GO (0x00000001) | ||
183 | #define SD_CMD_RY (0x00000002) | ||
184 | #define SD_CMD_xx1 (0x0000000c) | ||
185 | #define SD_CMD_CT_MASK (0x000000f0) | ||
186 | #define SD_CMD_CT_0 (0x00000000) | ||
187 | #define SD_CMD_CT_1 (0x00000010) | ||
188 | #define SD_CMD_CT_2 (0x00000020) | ||
189 | #define SD_CMD_CT_3 (0x00000030) | ||
190 | #define SD_CMD_CT_4 (0x00000040) | ||
191 | #define SD_CMD_CT_5 (0x00000050) | ||
192 | #define SD_CMD_CT_6 (0x00000060) | ||
193 | #define SD_CMD_CT_7 (0x00000070) | ||
194 | #define SD_CMD_CI (0x0000ff00) | ||
195 | #define SD_CMD_CI_SHIFT (8) | ||
196 | #define SD_CMD_RT_MASK (0x00ff0000) | ||
197 | #define SD_CMD_RT_0 (0x00000000) | ||
198 | #define SD_CMD_RT_1 (0x00010000) | ||
199 | #define SD_CMD_RT_2 (0x00020000) | ||
200 | #define SD_CMD_RT_3 (0x00030000) | ||
201 | #define SD_CMD_RT_4 (0x00040000) | ||
202 | #define SD_CMD_RT_5 (0x00050000) | ||
203 | #define SD_CMD_RT_6 (0x00060000) | ||
204 | #define SD_CMD_RT_1B (0x00810000) | ||
205 | |||
206 | |||
207 | #endif /* __ASM_AU1100_MMC_H */ | ||
208 | |||
diff --git a/include/asm-mips/mach-au1x00/au1550_spi.h b/include/asm-mips/mach-au1x00/au1550_spi.h deleted file mode 100644 index 08e1958e9410..000000000000 --- a/include/asm-mips/mach-au1x00/au1550_spi.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | /* | ||
2 | * au1550_spi.h - Au1550 PSC SPI controller driver - platform data structure | ||
3 | */ | ||
4 | |||
5 | #ifndef _AU1550_SPI_H_ | ||
6 | #define _AU1550_SPI_H_ | ||
7 | |||
8 | struct au1550_spi_info { | ||
9 | u32 mainclk_hz; /* main input clock frequency of PSC */ | ||
10 | u16 num_chipselect; /* number of chipselects supported */ | ||
11 | void (*activate_cs)(struct au1550_spi_info *spi, int cs, int polarity); | ||
12 | void (*deactivate_cs)(struct au1550_spi_info *spi, int cs, int polarity); | ||
13 | }; | ||
14 | |||
15 | #endif | ||
diff --git a/include/asm-mips/mach-au1x00/au1xxx.h b/include/asm-mips/mach-au1x00/au1xxx.h deleted file mode 100644 index 1b3655090ed3..000000000000 --- a/include/asm-mips/mach-au1x00/au1xxx.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify it | ||
3 | * under the terms of the GNU General Public License as published by the | ||
4 | * Free Software Foundation; either version 2 of the License, or (at your | ||
5 | * option) any later version. | ||
6 | * | ||
7 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
8 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
9 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
10 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
11 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
12 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
13 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
14 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
15 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
16 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
21 | */ | ||
22 | |||
23 | #ifndef _AU1XXX_H_ | ||
24 | #define _AU1XXX_H_ | ||
25 | |||
26 | #include <asm/mach-au1x00/au1000.h> | ||
27 | |||
28 | #if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || \ | ||
29 | defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550) | ||
30 | #include <asm/mach-db1x00/db1x00.h> | ||
31 | |||
32 | #elif defined(CONFIG_MIPS_PB1550) | ||
33 | #include <asm/mach-pb1x00/pb1550.h> | ||
34 | |||
35 | #elif defined(CONFIG_MIPS_PB1200) | ||
36 | #include <asm/mach-pb1x00/pb1200.h> | ||
37 | |||
38 | #elif defined(CONFIG_MIPS_DB1200) | ||
39 | #include <asm/mach-db1x00/db1200.h> | ||
40 | |||
41 | #endif | ||
42 | |||
43 | #endif /* _AU1XXX_H_ */ | ||
diff --git a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h deleted file mode 100644 index 44a67bf05dc1..000000000000 --- a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h +++ /dev/null | |||
@@ -1,386 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * Include file for Alchemy Semiconductor's Au1550 Descriptor | ||
5 | * Based DMA Controller. | ||
6 | * | ||
7 | * Copyright 2004 Embedded Edge, LLC | ||
8 | * dan@embeddededge.com | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | * | ||
15 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
16 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
17 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
18 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
21 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
22 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License along | ||
27 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
28 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
29 | */ | ||
30 | |||
31 | /* | ||
32 | * Specifics for the Au1xxx Descriptor-Based DMA Controller, | ||
33 | * first seen in the AU1550 part. | ||
34 | */ | ||
35 | #ifndef _AU1000_DBDMA_H_ | ||
36 | #define _AU1000_DBDMA_H_ | ||
37 | |||
38 | #ifndef _LANGUAGE_ASSEMBLY | ||
39 | |||
40 | /* | ||
41 | * The DMA base addresses. | ||
42 | * The channels are every 256 bytes (0x0100) from the channel 0 base. | ||
43 | * Interrupt status/enable is bits 15:0 for channels 15 to zero. | ||
44 | */ | ||
45 | #define DDMA_GLOBAL_BASE 0xb4003000 | ||
46 | #define DDMA_CHANNEL_BASE 0xb4002000 | ||
47 | |||
48 | typedef volatile struct dbdma_global { | ||
49 | u32 ddma_config; | ||
50 | u32 ddma_intstat; | ||
51 | u32 ddma_throttle; | ||
52 | u32 ddma_inten; | ||
53 | } dbdma_global_t; | ||
54 | |||
55 | /* General Configuration. */ | ||
56 | #define DDMA_CONFIG_AF (1 << 2) | ||
57 | #define DDMA_CONFIG_AH (1 << 1) | ||
58 | #define DDMA_CONFIG_AL (1 << 0) | ||
59 | |||
60 | #define DDMA_THROTTLE_EN (1 << 31) | ||
61 | |||
62 | /* The structure of a DMA Channel. */ | ||
63 | typedef volatile struct au1xxx_dma_channel { | ||
64 | u32 ddma_cfg; /* See below */ | ||
65 | u32 ddma_desptr; /* 32-byte aligned pointer to descriptor */ | ||
66 | u32 ddma_statptr; /* word aligned pointer to status word */ | ||
67 | u32 ddma_dbell; /* A write activates channel operation */ | ||
68 | u32 ddma_irq; /* If bit 0 set, interrupt pending */ | ||
69 | u32 ddma_stat; /* See below */ | ||
70 | u32 ddma_bytecnt; /* Byte count, valid only when chan idle */ | ||
71 | /* Remainder, up to the 256 byte boundary, is reserved. */ | ||
72 | } au1x_dma_chan_t; | ||
73 | |||
74 | #define DDMA_CFG_SED (1 << 9) /* source DMA level/edge detect */ | ||
75 | #define DDMA_CFG_SP (1 << 8) /* source DMA polarity */ | ||
76 | #define DDMA_CFG_DED (1 << 7) /* destination DMA level/edge detect */ | ||
77 | #define DDMA_CFG_DP (1 << 6) /* destination DMA polarity */ | ||
78 | #define DDMA_CFG_SYNC (1 << 5) /* Sync static bus controller */ | ||
79 | #define DDMA_CFG_PPR (1 << 4) /* PCI posted read/write control */ | ||
80 | #define DDMA_CFG_DFN (1 << 3) /* Descriptor fetch non-coherent */ | ||
81 | #define DDMA_CFG_SBE (1 << 2) /* Source big endian */ | ||
82 | #define DDMA_CFG_DBE (1 << 1) /* Destination big endian */ | ||
83 | #define DDMA_CFG_EN (1 << 0) /* Channel enable */ | ||
84 | |||
85 | /* | ||
86 | * Always set when descriptor processing done, regardless of | ||
87 | * interrupt enable state. Reflected in global intstat, don't | ||
88 | * clear this until global intstat is read/used. | ||
89 | */ | ||
90 | #define DDMA_IRQ_IN (1 << 0) | ||
91 | |||
92 | #define DDMA_STAT_DB (1 << 2) /* Doorbell pushed */ | ||
93 | #define DDMA_STAT_V (1 << 1) /* Descriptor valid */ | ||
94 | #define DDMA_STAT_H (1 << 0) /* Channel Halted */ | ||
95 | |||
96 | /* | ||
97 | * "Standard" DDMA Descriptor. | ||
98 | * Must be 32-byte aligned. | ||
99 | */ | ||
100 | typedef volatile struct au1xxx_ddma_desc { | ||
101 | u32 dscr_cmd0; /* See below */ | ||
102 | u32 dscr_cmd1; /* See below */ | ||
103 | u32 dscr_source0; /* source phys address */ | ||
104 | u32 dscr_source1; /* See below */ | ||
105 | u32 dscr_dest0; /* Destination address */ | ||
106 | u32 dscr_dest1; /* See below */ | ||
107 | u32 dscr_stat; /* completion status */ | ||
108 | u32 dscr_nxtptr; /* Next descriptor pointer (mostly) */ | ||
109 | /* | ||
110 | * First 32 bytes are HW specific!!! | ||
111 | * Lets have some SW data following -- make sure it's 32 bytes. | ||
112 | */ | ||
113 | u32 sw_status; | ||
114 | u32 sw_context; | ||
115 | u32 sw_reserved[6]; | ||
116 | } au1x_ddma_desc_t; | ||
117 | |||
118 | #define DSCR_CMD0_V (1 << 31) /* Descriptor valid */ | ||
119 | #define DSCR_CMD0_MEM (1 << 30) /* mem-mem transfer */ | ||
120 | #define DSCR_CMD0_SID_MASK (0x1f << 25) /* Source ID */ | ||
121 | #define DSCR_CMD0_DID_MASK (0x1f << 20) /* Destination ID */ | ||
122 | #define DSCR_CMD0_SW_MASK (0x3 << 18) /* Source Width */ | ||
123 | #define DSCR_CMD0_DW_MASK (0x3 << 16) /* Destination Width */ | ||
124 | #define DSCR_CMD0_ARB (0x1 << 15) /* Set for Hi Pri */ | ||
125 | #define DSCR_CMD0_DT_MASK (0x3 << 13) /* Descriptor Type */ | ||
126 | #define DSCR_CMD0_SN (0x1 << 12) /* Source non-coherent */ | ||
127 | #define DSCR_CMD0_DN (0x1 << 11) /* Destination non-coherent */ | ||
128 | #define DSCR_CMD0_SM (0x1 << 10) /* Stride mode */ | ||
129 | #define DSCR_CMD0_IE (0x1 << 8) /* Interrupt Enable */ | ||
130 | #define DSCR_CMD0_SP (0x1 << 4) /* Status pointer select */ | ||
131 | #define DSCR_CMD0_CV (0x1 << 2) /* Clear Valid when done */ | ||
132 | #define DSCR_CMD0_ST_MASK (0x3 << 0) /* Status instruction */ | ||
133 | |||
134 | #define SW_STATUS_INUSE (1 << 0) | ||
135 | |||
136 | /* Command 0 device IDs. */ | ||
137 | #ifdef CONFIG_SOC_AU1550 | ||
138 | #define DSCR_CMD0_UART0_TX 0 | ||
139 | #define DSCR_CMD0_UART0_RX 1 | ||
140 | #define DSCR_CMD0_UART3_TX 2 | ||
141 | #define DSCR_CMD0_UART3_RX 3 | ||
142 | #define DSCR_CMD0_DMA_REQ0 4 | ||
143 | #define DSCR_CMD0_DMA_REQ1 5 | ||
144 | #define DSCR_CMD0_DMA_REQ2 6 | ||
145 | #define DSCR_CMD0_DMA_REQ3 7 | ||
146 | #define DSCR_CMD0_USBDEV_RX0 8 | ||
147 | #define DSCR_CMD0_USBDEV_TX0 9 | ||
148 | #define DSCR_CMD0_USBDEV_TX1 10 | ||
149 | #define DSCR_CMD0_USBDEV_TX2 11 | ||
150 | #define DSCR_CMD0_USBDEV_RX3 12 | ||
151 | #define DSCR_CMD0_USBDEV_RX4 13 | ||
152 | #define DSCR_CMD0_PSC0_TX 14 | ||
153 | #define DSCR_CMD0_PSC0_RX 15 | ||
154 | #define DSCR_CMD0_PSC1_TX 16 | ||
155 | #define DSCR_CMD0_PSC1_RX 17 | ||
156 | #define DSCR_CMD0_PSC2_TX 18 | ||
157 | #define DSCR_CMD0_PSC2_RX 19 | ||
158 | #define DSCR_CMD0_PSC3_TX 20 | ||
159 | #define DSCR_CMD0_PSC3_RX 21 | ||
160 | #define DSCR_CMD0_PCI_WRITE 22 | ||
161 | #define DSCR_CMD0_NAND_FLASH 23 | ||
162 | #define DSCR_CMD0_MAC0_RX 24 | ||
163 | #define DSCR_CMD0_MAC0_TX 25 | ||
164 | #define DSCR_CMD0_MAC1_RX 26 | ||
165 | #define DSCR_CMD0_MAC1_TX 27 | ||
166 | #endif /* CONFIG_SOC_AU1550 */ | ||
167 | |||
168 | #ifdef CONFIG_SOC_AU1200 | ||
169 | #define DSCR_CMD0_UART0_TX 0 | ||
170 | #define DSCR_CMD0_UART0_RX 1 | ||
171 | #define DSCR_CMD0_UART1_TX 2 | ||
172 | #define DSCR_CMD0_UART1_RX 3 | ||
173 | #define DSCR_CMD0_DMA_REQ0 4 | ||
174 | #define DSCR_CMD0_DMA_REQ1 5 | ||
175 | #define DSCR_CMD0_MAE_BE 6 | ||
176 | #define DSCR_CMD0_MAE_FE 7 | ||
177 | #define DSCR_CMD0_SDMS_TX0 8 | ||
178 | #define DSCR_CMD0_SDMS_RX0 9 | ||
179 | #define DSCR_CMD0_SDMS_TX1 10 | ||
180 | #define DSCR_CMD0_SDMS_RX1 11 | ||
181 | #define DSCR_CMD0_AES_TX 13 | ||
182 | #define DSCR_CMD0_AES_RX 12 | ||
183 | #define DSCR_CMD0_PSC0_TX 14 | ||
184 | #define DSCR_CMD0_PSC0_RX 15 | ||
185 | #define DSCR_CMD0_PSC1_TX 16 | ||
186 | #define DSCR_CMD0_PSC1_RX 17 | ||
187 | #define DSCR_CMD0_CIM_RXA 18 | ||
188 | #define DSCR_CMD0_CIM_RXB 19 | ||
189 | #define DSCR_CMD0_CIM_RXC 20 | ||
190 | #define DSCR_CMD0_MAE_BOTH 21 | ||
191 | #define DSCR_CMD0_LCD 22 | ||
192 | #define DSCR_CMD0_NAND_FLASH 23 | ||
193 | #define DSCR_CMD0_PSC0_SYNC 24 | ||
194 | #define DSCR_CMD0_PSC1_SYNC 25 | ||
195 | #define DSCR_CMD0_CIM_SYNC 26 | ||
196 | #endif /* CONFIG_SOC_AU1200 */ | ||
197 | |||
198 | #define DSCR_CMD0_THROTTLE 30 | ||
199 | #define DSCR_CMD0_ALWAYS 31 | ||
200 | #define DSCR_NDEV_IDS 32 | ||
201 | /* This macro is used to find/create custom device types */ | ||
202 | #define DSCR_DEV2CUSTOM_ID(x, d) (((((x) & 0xFFFF) << 8) | 0x32000000) | \ | ||
203 | ((d) & 0xFF)) | ||
204 | #define DSCR_CUSTOM2DEV_ID(x) ((x) & 0xFF) | ||
205 | |||
206 | #define DSCR_CMD0_SID(x) (((x) & 0x1f) << 25) | ||
207 | #define DSCR_CMD0_DID(x) (((x) & 0x1f) << 20) | ||
208 | |||
209 | /* Source/Destination transfer width. */ | ||
210 | #define DSCR_CMD0_BYTE 0 | ||
211 | #define DSCR_CMD0_HALFWORD 1 | ||
212 | #define DSCR_CMD0_WORD 2 | ||
213 | |||
214 | #define DSCR_CMD0_SW(x) (((x) & 0x3) << 18) | ||
215 | #define DSCR_CMD0_DW(x) (((x) & 0x3) << 16) | ||
216 | |||
217 | /* DDMA Descriptor Type. */ | ||
218 | #define DSCR_CMD0_STANDARD 0 | ||
219 | #define DSCR_CMD0_LITERAL 1 | ||
220 | #define DSCR_CMD0_CMP_BRANCH 2 | ||
221 | |||
222 | #define DSCR_CMD0_DT(x) (((x) & 0x3) << 13) | ||
223 | |||
224 | /* Status Instruction. */ | ||
225 | #define DSCR_CMD0_ST_NOCHANGE 0 /* Don't change */ | ||
226 | #define DSCR_CMD0_ST_CURRENT 1 /* Write current status */ | ||
227 | #define DSCR_CMD0_ST_CMD0 2 /* Write cmd0 with V cleared */ | ||
228 | #define DSCR_CMD0_ST_BYTECNT 3 /* Write remaining byte count */ | ||
229 | |||
230 | #define DSCR_CMD0_ST(x) (((x) & 0x3) << 0) | ||
231 | |||
232 | /* Descriptor Command 1. */ | ||
233 | #define DSCR_CMD1_SUPTR_MASK (0xf << 28) /* upper 4 bits of src addr */ | ||
234 | #define DSCR_CMD1_DUPTR_MASK (0xf << 24) /* upper 4 bits of dest addr */ | ||
235 | #define DSCR_CMD1_FL_MASK (0x3 << 22) /* Flag bits */ | ||
236 | #define DSCR_CMD1_BC_MASK (0x3fffff) /* Byte count */ | ||
237 | |||
238 | /* Flag description. */ | ||
239 | #define DSCR_CMD1_FL_MEM_STRIDE0 0 | ||
240 | #define DSCR_CMD1_FL_MEM_STRIDE1 1 | ||
241 | #define DSCR_CMD1_FL_MEM_STRIDE2 2 | ||
242 | |||
243 | #define DSCR_CMD1_FL(x) (((x) & 0x3) << 22) | ||
244 | |||
245 | /* Source1, 1-dimensional stride. */ | ||
246 | #define DSCR_SRC1_STS_MASK (3 << 30) /* Src xfer size */ | ||
247 | #define DSCR_SRC1_SAM_MASK (3 << 28) /* Src xfer movement */ | ||
248 | #define DSCR_SRC1_SB_MASK (0x3fff << 14) /* Block size */ | ||
249 | #define DSCR_SRC1_SB(x) (((x) & 0x3fff) << 14) | ||
250 | #define DSCR_SRC1_SS_MASK (0x3fff << 0) /* Stride */ | ||
251 | #define DSCR_SRC1_SS(x) (((x) & 0x3fff) << 0) | ||
252 | |||
253 | /* Dest1, 1-dimensional stride. */ | ||
254 | #define DSCR_DEST1_DTS_MASK (3 << 30) /* Dest xfer size */ | ||
255 | #define DSCR_DEST1_DAM_MASK (3 << 28) /* Dest xfer movement */ | ||
256 | #define DSCR_DEST1_DB_MASK (0x3fff << 14) /* Block size */ | ||
257 | #define DSCR_DEST1_DB(x) (((x) & 0x3fff) << 14) | ||
258 | #define DSCR_DEST1_DS_MASK (0x3fff << 0) /* Stride */ | ||
259 | #define DSCR_DEST1_DS(x) (((x) & 0x3fff) << 0) | ||
260 | |||
261 | #define DSCR_xTS_SIZE1 0 | ||
262 | #define DSCR_xTS_SIZE2 1 | ||
263 | #define DSCR_xTS_SIZE4 2 | ||
264 | #define DSCR_xTS_SIZE8 3 | ||
265 | #define DSCR_SRC1_STS(x) (((x) & 3) << 30) | ||
266 | #define DSCR_DEST1_DTS(x) (((x) & 3) << 30) | ||
267 | |||
268 | #define DSCR_xAM_INCREMENT 0 | ||
269 | #define DSCR_xAM_DECREMENT 1 | ||
270 | #define DSCR_xAM_STATIC 2 | ||
271 | #define DSCR_xAM_BURST 3 | ||
272 | #define DSCR_SRC1_SAM(x) (((x) & 3) << 28) | ||
273 | #define DSCR_DEST1_DAM(x) (((x) & 3) << 28) | ||
274 | |||
275 | /* The next descriptor pointer. */ | ||
276 | #define DSCR_NXTPTR_MASK (0x07ffffff) | ||
277 | #define DSCR_NXTPTR(x) ((x) >> 5) | ||
278 | #define DSCR_GET_NXTPTR(x) ((x) << 5) | ||
279 | #define DSCR_NXTPTR_MS (1 << 27) | ||
280 | |||
281 | /* The number of DBDMA channels. */ | ||
282 | #define NUM_DBDMA_CHANS 16 | ||
283 | |||
284 | /* | ||
285 | * DDMA API definitions | ||
286 | * FIXME: may not fit to this header file | ||
287 | */ | ||
288 | typedef struct dbdma_device_table { | ||
289 | u32 dev_id; | ||
290 | u32 dev_flags; | ||
291 | u32 dev_tsize; | ||
292 | u32 dev_devwidth; | ||
293 | u32 dev_physaddr; /* If FIFO */ | ||
294 | u32 dev_intlevel; | ||
295 | u32 dev_intpolarity; | ||
296 | } dbdev_tab_t; | ||
297 | |||
298 | |||
299 | typedef struct dbdma_chan_config { | ||
300 | spinlock_t lock; | ||
301 | |||
302 | u32 chan_flags; | ||
303 | u32 chan_index; | ||
304 | dbdev_tab_t *chan_src; | ||
305 | dbdev_tab_t *chan_dest; | ||
306 | au1x_dma_chan_t *chan_ptr; | ||
307 | au1x_ddma_desc_t *chan_desc_base; | ||
308 | au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr; | ||
309 | void *chan_callparam; | ||
310 | void (*chan_callback)(int, void *); | ||
311 | } chan_tab_t; | ||
312 | |||
313 | #define DEV_FLAGS_INUSE (1 << 0) | ||
314 | #define DEV_FLAGS_ANYUSE (1 << 1) | ||
315 | #define DEV_FLAGS_OUT (1 << 2) | ||
316 | #define DEV_FLAGS_IN (1 << 3) | ||
317 | #define DEV_FLAGS_BURSTABLE (1 << 4) | ||
318 | #define DEV_FLAGS_SYNC (1 << 5) | ||
319 | /* end DDMA API definitions */ | ||
320 | |||
321 | /* | ||
322 | * External functions for drivers to use. | ||
323 | * Use this to allocate a DBDMA channel. The device IDs are one of | ||
324 | * the DSCR_CMD0 devices IDs, which is usually redefined to a more | ||
325 | * meaningful name. The 'callback' is called during DMA completion | ||
326 | * interrupt. | ||
327 | */ | ||
328 | extern u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid, | ||
329 | void (*callback)(int, void *), | ||
330 | void *callparam); | ||
331 | |||
332 | #define DBDMA_MEM_CHAN DSCR_CMD0_ALWAYS | ||
333 | |||
334 | /* Set the device width of an in/out FIFO. */ | ||
335 | u32 au1xxx_dbdma_set_devwidth(u32 chanid, int bits); | ||
336 | |||
337 | /* Allocate a ring of descriptors for DBDMA. */ | ||
338 | u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries); | ||
339 | |||
340 | /* Put buffers on source/destination descriptors. */ | ||
341 | u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags); | ||
342 | u32 _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags); | ||
343 | |||
344 | /* Get a buffer from the destination descriptor. */ | ||
345 | u32 au1xxx_dbdma_get_dest(u32 chanid, void **buf, int *nbytes); | ||
346 | |||
347 | void au1xxx_dbdma_stop(u32 chanid); | ||
348 | void au1xxx_dbdma_start(u32 chanid); | ||
349 | void au1xxx_dbdma_reset(u32 chanid); | ||
350 | u32 au1xxx_get_dma_residue(u32 chanid); | ||
351 | |||
352 | void au1xxx_dbdma_chan_free(u32 chanid); | ||
353 | void au1xxx_dbdma_dump(u32 chanid); | ||
354 | |||
355 | u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr); | ||
356 | |||
357 | u32 au1xxx_ddma_add_device(dbdev_tab_t *dev); | ||
358 | extern void au1xxx_ddma_del_device(u32 devid); | ||
359 | void *au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp); | ||
360 | |||
361 | /* | ||
362 | * Some compatibilty macros -- needed to make changes to API | ||
363 | * without breaking existing drivers. | ||
364 | */ | ||
365 | #define au1xxx_dbdma_put_source(chanid, buf, nbytes) \ | ||
366 | _au1xxx_dbdma_put_source(chanid, buf, nbytes, DDMA_FLAGS_IE) | ||
367 | #define au1xxx_dbdma_put_source_flags(chanid, buf, nbytes, flags) \ | ||
368 | _au1xxx_dbdma_put_source(chanid, buf, nbytes, flags) | ||
369 | #define put_source_flags(chanid, buf, nbytes, flags) \ | ||
370 | au1xxx_dbdma_put_source_flags(chanid, buf, nbytes, flags) | ||
371 | |||
372 | #define au1xxx_dbdma_put_dest(chanid, buf, nbytes) \ | ||
373 | _au1xxx_dbdma_put_dest(chanid, buf, nbytes, DDMA_FLAGS_IE) | ||
374 | #define au1xxx_dbdma_put_dest_flags(chanid, buf, nbytes, flags) \ | ||
375 | _au1xxx_dbdma_put_dest(chanid, buf, nbytes, flags) | ||
376 | #define put_dest_flags(chanid, buf, nbytes, flags) \ | ||
377 | au1xxx_dbdma_put_dest_flags(chanid, buf, nbytes, flags) | ||
378 | |||
379 | /* | ||
380 | * Flags for the put_source/put_dest functions. | ||
381 | */ | ||
382 | #define DDMA_FLAGS_IE (1 << 0) | ||
383 | #define DDMA_FLAGS_NOIE (1 << 1) | ||
384 | |||
385 | #endif /* _LANGUAGE_ASSEMBLY */ | ||
386 | #endif /* _AU1000_DBDMA_H_ */ | ||
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h deleted file mode 100644 index 60638b8969ba..000000000000 --- a/include/asm-mips/mach-au1x00/au1xxx_ide.h +++ /dev/null | |||
@@ -1,194 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/mach-au1x00/au1xxx_ide.h version 01.30.00 Aug. 02 2005 | ||
3 | * | ||
4 | * BRIEF MODULE DESCRIPTION | ||
5 | * AMD Alchemy Au1xxx IDE interface routines over the Static Bus | ||
6 | * | ||
7 | * Copyright (c) 2003-2005 AMD, Personal Connectivity Solutions | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it under | ||
10 | * the terms of the GNU General Public License as published by the Free Software | ||
11 | * Foundation; either version 2 of the License, or (at your option) any later | ||
12 | * version. | ||
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
15 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR | ||
17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
23 | * POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along with | ||
26 | * this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | * | ||
29 | * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE | ||
30 | * Interface and Linux Device Driver" Application Note. | ||
31 | */ | ||
32 | |||
33 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
34 | #define DMA_WAIT_TIMEOUT 100 | ||
35 | #define NUM_DESCRIPTORS PRD_ENTRIES | ||
36 | #else /* CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA */ | ||
37 | #define NUM_DESCRIPTORS 2 | ||
38 | #endif | ||
39 | |||
40 | #ifndef AU1XXX_ATA_RQSIZE | ||
41 | #define AU1XXX_ATA_RQSIZE 128 | ||
42 | #endif | ||
43 | |||
44 | /* Disable Burstable-Support for DBDMA */ | ||
45 | #ifndef CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON | ||
46 | #define CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON 0 | ||
47 | #endif | ||
48 | |||
49 | #ifdef CONFIG_PM | ||
50 | /* | ||
51 | * This will enable the device to be powered up when write() or read() | ||
52 | * is called. If this is not defined, the driver will return -EBUSY. | ||
53 | */ | ||
54 | #define WAKE_ON_ACCESS 1 | ||
55 | |||
56 | typedef struct { | ||
57 | spinlock_t lock; /* Used to block on state transitions */ | ||
58 | au1xxx_power_dev_t *dev; /* Power Managers device structure */ | ||
59 | unsigned stopped; /* Used to signal device is stopped */ | ||
60 | } pm_state; | ||
61 | #endif | ||
62 | |||
63 | typedef struct { | ||
64 | u32 tx_dev_id, rx_dev_id, target_dev_id; | ||
65 | u32 tx_chan, rx_chan; | ||
66 | void *tx_desc_head, *rx_desc_head; | ||
67 | ide_hwif_t *hwif; | ||
68 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
69 | ide_drive_t *drive; | ||
70 | struct dbdma_cmd *dma_table_cpu; | ||
71 | dma_addr_t dma_table_dma; | ||
72 | #endif | ||
73 | int irq; | ||
74 | u32 regbase; | ||
75 | #ifdef CONFIG_PM | ||
76 | pm_state pm; | ||
77 | #endif | ||
78 | } _auide_hwif; | ||
79 | |||
80 | /******************************************************************************/ | ||
81 | /* PIO Mode timing calculation : */ | ||
82 | /* */ | ||
83 | /* Static Bus Spec ATA Spec */ | ||
84 | /* Tcsoe = t1 */ | ||
85 | /* Toecs = t9 */ | ||
86 | /* Twcs = t9 */ | ||
87 | /* Tcsh = t2i | t2 */ | ||
88 | /* Tcsoff = t2i | t2 */ | ||
89 | /* Twp = t2 */ | ||
90 | /* Tcsw = t1 */ | ||
91 | /* Tpm = 0 */ | ||
92 | /* Ta = t1+t2 */ | ||
93 | /******************************************************************************/ | ||
94 | |||
95 | #define TCSOE_MASK (0x07 << 29) | ||
96 | #define TOECS_MASK (0x07 << 26) | ||
97 | #define TWCS_MASK (0x07 << 28) | ||
98 | #define TCSH_MASK (0x0F << 24) | ||
99 | #define TCSOFF_MASK (0x07 << 20) | ||
100 | #define TWP_MASK (0x3F << 14) | ||
101 | #define TCSW_MASK (0x0F << 10) | ||
102 | #define TPM_MASK (0x0F << 6) | ||
103 | #define TA_MASK (0x3F << 0) | ||
104 | #define TS_MASK (1 << 8) | ||
105 | |||
106 | /* Timing parameters PIO mode 0 */ | ||
107 | #define SBC_IDE_PIO0_TCSOE (0x04 << 29) | ||
108 | #define SBC_IDE_PIO0_TOECS (0x01 << 26) | ||
109 | #define SBC_IDE_PIO0_TWCS (0x02 << 28) | ||
110 | #define SBC_IDE_PIO0_TCSH (0x08 << 24) | ||
111 | #define SBC_IDE_PIO0_TCSOFF (0x07 << 20) | ||
112 | #define SBC_IDE_PIO0_TWP (0x10 << 14) | ||
113 | #define SBC_IDE_PIO0_TCSW (0x04 << 10) | ||
114 | #define SBC_IDE_PIO0_TPM (0x00 << 6) | ||
115 | #define SBC_IDE_PIO0_TA (0x15 << 0) | ||
116 | /* Timing parameters PIO mode 1 */ | ||
117 | #define SBC_IDE_PIO1_TCSOE (0x03 << 29) | ||
118 | #define SBC_IDE_PIO1_TOECS (0x01 << 26) | ||
119 | #define SBC_IDE_PIO1_TWCS (0x01 << 28) | ||
120 | #define SBC_IDE_PIO1_TCSH (0x06 << 24) | ||
121 | #define SBC_IDE_PIO1_TCSOFF (0x06 << 20) | ||
122 | #define SBC_IDE_PIO1_TWP (0x08 << 14) | ||
123 | #define SBC_IDE_PIO1_TCSW (0x03 << 10) | ||
124 | #define SBC_IDE_PIO1_TPM (0x00 << 6) | ||
125 | #define SBC_IDE_PIO1_TA (0x0B << 0) | ||
126 | /* Timing parameters PIO mode 2 */ | ||
127 | #define SBC_IDE_PIO2_TCSOE (0x05 << 29) | ||
128 | #define SBC_IDE_PIO2_TOECS (0x01 << 26) | ||
129 | #define SBC_IDE_PIO2_TWCS (0x01 << 28) | ||
130 | #define SBC_IDE_PIO2_TCSH (0x07 << 24) | ||
131 | #define SBC_IDE_PIO2_TCSOFF (0x07 << 20) | ||
132 | #define SBC_IDE_PIO2_TWP (0x1F << 14) | ||
133 | #define SBC_IDE_PIO2_TCSW (0x05 << 10) | ||
134 | #define SBC_IDE_PIO2_TPM (0x00 << 6) | ||
135 | #define SBC_IDE_PIO2_TA (0x22 << 0) | ||
136 | /* Timing parameters PIO mode 3 */ | ||
137 | #define SBC_IDE_PIO3_TCSOE (0x05 << 29) | ||
138 | #define SBC_IDE_PIO3_TOECS (0x01 << 26) | ||
139 | #define SBC_IDE_PIO3_TWCS (0x01 << 28) | ||
140 | #define SBC_IDE_PIO3_TCSH (0x0D << 24) | ||
141 | #define SBC_IDE_PIO3_TCSOFF (0x0D << 20) | ||
142 | #define SBC_IDE_PIO3_TWP (0x15 << 14) | ||
143 | #define SBC_IDE_PIO3_TCSW (0x05 << 10) | ||
144 | #define SBC_IDE_PIO3_TPM (0x00 << 6) | ||
145 | #define SBC_IDE_PIO3_TA (0x1A << 0) | ||
146 | /* Timing parameters PIO mode 4 */ | ||
147 | #define SBC_IDE_PIO4_TCSOE (0x04 << 29) | ||
148 | #define SBC_IDE_PIO4_TOECS (0x01 << 26) | ||
149 | #define SBC_IDE_PIO4_TWCS (0x01 << 28) | ||
150 | #define SBC_IDE_PIO4_TCSH (0x04 << 24) | ||
151 | #define SBC_IDE_PIO4_TCSOFF (0x04 << 20) | ||
152 | #define SBC_IDE_PIO4_TWP (0x0D << 14) | ||
153 | #define SBC_IDE_PIO4_TCSW (0x03 << 10) | ||
154 | #define SBC_IDE_PIO4_TPM (0x00 << 6) | ||
155 | #define SBC_IDE_PIO4_TA (0x12 << 0) | ||
156 | /* Timing parameters MDMA mode 0 */ | ||
157 | #define SBC_IDE_MDMA0_TCSOE (0x03 << 29) | ||
158 | #define SBC_IDE_MDMA0_TOECS (0x01 << 26) | ||
159 | #define SBC_IDE_MDMA0_TWCS (0x01 << 28) | ||
160 | #define SBC_IDE_MDMA0_TCSH (0x07 << 24) | ||
161 | #define SBC_IDE_MDMA0_TCSOFF (0x07 << 20) | ||
162 | #define SBC_IDE_MDMA0_TWP (0x0C << 14) | ||
163 | #define SBC_IDE_MDMA0_TCSW (0x03 << 10) | ||
164 | #define SBC_IDE_MDMA0_TPM (0x00 << 6) | ||
165 | #define SBC_IDE_MDMA0_TA (0x0F << 0) | ||
166 | /* Timing parameters MDMA mode 1 */ | ||
167 | #define SBC_IDE_MDMA1_TCSOE (0x05 << 29) | ||
168 | #define SBC_IDE_MDMA1_TOECS (0x01 << 26) | ||
169 | #define SBC_IDE_MDMA1_TWCS (0x01 << 28) | ||
170 | #define SBC_IDE_MDMA1_TCSH (0x05 << 24) | ||
171 | #define SBC_IDE_MDMA1_TCSOFF (0x05 << 20) | ||
172 | #define SBC_IDE_MDMA1_TWP (0x0F << 14) | ||
173 | #define SBC_IDE_MDMA1_TCSW (0x05 << 10) | ||
174 | #define SBC_IDE_MDMA1_TPM (0x00 << 6) | ||
175 | #define SBC_IDE_MDMA1_TA (0x15 << 0) | ||
176 | /* Timing parameters MDMA mode 2 */ | ||
177 | #define SBC_IDE_MDMA2_TCSOE (0x04 << 29) | ||
178 | #define SBC_IDE_MDMA2_TOECS (0x01 << 26) | ||
179 | #define SBC_IDE_MDMA2_TWCS (0x01 << 28) | ||
180 | #define SBC_IDE_MDMA2_TCSH (0x04 << 24) | ||
181 | #define SBC_IDE_MDMA2_TCSOFF (0x04 << 20) | ||
182 | #define SBC_IDE_MDMA2_TWP (0x0D << 14) | ||
183 | #define SBC_IDE_MDMA2_TCSW (0x04 << 10) | ||
184 | #define SBC_IDE_MDMA2_TPM (0x00 << 6) | ||
185 | #define SBC_IDE_MDMA2_TA (0x12 << 0) | ||
186 | |||
187 | #define SBC_IDE_TIMING(mode) \ | ||
188 | (SBC_IDE_##mode##_TWCS | \ | ||
189 | SBC_IDE_##mode##_TCSH | \ | ||
190 | SBC_IDE_##mode##_TCSOFF | \ | ||
191 | SBC_IDE_##mode##_TWP | \ | ||
192 | SBC_IDE_##mode##_TCSW | \ | ||
193 | SBC_IDE_##mode##_TPM | \ | ||
194 | SBC_IDE_##mode##_TA) | ||
diff --git a/include/asm-mips/mach-au1x00/au1xxx_psc.h b/include/asm-mips/mach-au1x00/au1xxx_psc.h deleted file mode 100644 index 892b7f168eb4..000000000000 --- a/include/asm-mips/mach-au1x00/au1xxx_psc.h +++ /dev/null | |||
@@ -1,505 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * Include file for Alchemy Semiconductor's Au1k CPU. | ||
5 | * | ||
6 | * Copyright 2004 Embedded Edge, LLC | ||
7 | * dan@embeddededge.com | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
15 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
17 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
20 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
21 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | */ | ||
29 | |||
30 | /* Specifics for the Au1xxx Programmable Serial Controllers, first | ||
31 | * seen in the AU1550 part. | ||
32 | */ | ||
33 | #ifndef _AU1000_PSC_H_ | ||
34 | #define _AU1000_PSC_H_ | ||
35 | |||
36 | /* The PSC base addresses. */ | ||
37 | #ifdef CONFIG_SOC_AU1550 | ||
38 | #define PSC0_BASE_ADDR 0xb1a00000 | ||
39 | #define PSC1_BASE_ADDR 0xb1b00000 | ||
40 | #define PSC2_BASE_ADDR 0xb0a00000 | ||
41 | #define PSC3_BASE_ADDR 0xb0b00000 | ||
42 | #endif | ||
43 | |||
44 | #ifdef CONFIG_SOC_AU1200 | ||
45 | #define PSC0_BASE_ADDR 0xb1a00000 | ||
46 | #define PSC1_BASE_ADDR 0xb1b00000 | ||
47 | #endif | ||
48 | |||
49 | /* | ||
50 | * The PSC select and control registers are common to all protocols. | ||
51 | */ | ||
52 | #define PSC_SEL_OFFSET 0x00000000 | ||
53 | #define PSC_CTRL_OFFSET 0x00000004 | ||
54 | |||
55 | #define PSC_SEL_CLK_MASK (3 << 4) | ||
56 | #define PSC_SEL_CLK_INTCLK (0 << 4) | ||
57 | #define PSC_SEL_CLK_EXTCLK (1 << 4) | ||
58 | #define PSC_SEL_CLK_SERCLK (2 << 4) | ||
59 | |||
60 | #define PSC_SEL_PS_MASK 0x00000007 | ||
61 | #define PSC_SEL_PS_DISABLED 0 | ||
62 | #define PSC_SEL_PS_SPIMODE 2 | ||
63 | #define PSC_SEL_PS_I2SMODE 3 | ||
64 | #define PSC_SEL_PS_AC97MODE 4 | ||
65 | #define PSC_SEL_PS_SMBUSMODE 5 | ||
66 | |||
67 | #define PSC_CTRL_DISABLE 0 | ||
68 | #define PSC_CTRL_SUSPEND 2 | ||
69 | #define PSC_CTRL_ENABLE 3 | ||
70 | |||
71 | /* AC97 Registers. */ | ||
72 | #define PSC_AC97CFG_OFFSET 0x00000008 | ||
73 | #define PSC_AC97MSK_OFFSET 0x0000000c | ||
74 | #define PSC_AC97PCR_OFFSET 0x00000010 | ||
75 | #define PSC_AC97STAT_OFFSET 0x00000014 | ||
76 | #define PSC_AC97EVNT_OFFSET 0x00000018 | ||
77 | #define PSC_AC97TXRX_OFFSET 0x0000001c | ||
78 | #define PSC_AC97CDC_OFFSET 0x00000020 | ||
79 | #define PSC_AC97RST_OFFSET 0x00000024 | ||
80 | #define PSC_AC97GPO_OFFSET 0x00000028 | ||
81 | #define PSC_AC97GPI_OFFSET 0x0000002c | ||
82 | |||
83 | #define AC97_PSC_SEL (AC97_PSC_BASE + PSC_SEL_OFFSET) | ||
84 | #define AC97_PSC_CTRL (AC97_PSC_BASE + PSC_CTRL_OFFSET) | ||
85 | #define PSC_AC97CFG (AC97_PSC_BASE + PSC_AC97CFG_OFFSET) | ||
86 | #define PSC_AC97MSK (AC97_PSC_BASE + PSC_AC97MSK_OFFSET) | ||
87 | #define PSC_AC97PCR (AC97_PSC_BASE + PSC_AC97PCR_OFFSET) | ||
88 | #define PSC_AC97STAT (AC97_PSC_BASE + PSC_AC97STAT_OFFSET) | ||
89 | #define PSC_AC97EVNT (AC97_PSC_BASE + PSC_AC97EVNT_OFFSET) | ||
90 | #define PSC_AC97TXRX (AC97_PSC_BASE + PSC_AC97TXRX_OFFSET) | ||
91 | #define PSC_AC97CDC (AC97_PSC_BASE + PSC_AC97CDC_OFFSET) | ||
92 | #define PSC_AC97RST (AC97_PSC_BASE + PSC_AC97RST_OFFSET) | ||
93 | #define PSC_AC97GPO (AC97_PSC_BASE + PSC_AC97GPO_OFFSET) | ||
94 | #define PSC_AC97GPI (AC97_PSC_BASE + PSC_AC97GPI_OFFSET) | ||
95 | |||
96 | /* AC97 Config Register. */ | ||
97 | #define PSC_AC97CFG_RT_MASK (3 << 30) | ||
98 | #define PSC_AC97CFG_RT_FIFO1 (0 << 30) | ||
99 | #define PSC_AC97CFG_RT_FIFO2 (1 << 30) | ||
100 | #define PSC_AC97CFG_RT_FIFO4 (2 << 30) | ||
101 | #define PSC_AC97CFG_RT_FIFO8 (3 << 30) | ||
102 | |||
103 | #define PSC_AC97CFG_TT_MASK (3 << 28) | ||
104 | #define PSC_AC97CFG_TT_FIFO1 (0 << 28) | ||
105 | #define PSC_AC97CFG_TT_FIFO2 (1 << 28) | ||
106 | #define PSC_AC97CFG_TT_FIFO4 (2 << 28) | ||
107 | #define PSC_AC97CFG_TT_FIFO8 (3 << 28) | ||
108 | |||
109 | #define PSC_AC97CFG_DD_DISABLE (1 << 27) | ||
110 | #define PSC_AC97CFG_DE_ENABLE (1 << 26) | ||
111 | #define PSC_AC97CFG_SE_ENABLE (1 << 25) | ||
112 | |||
113 | #define PSC_AC97CFG_LEN_MASK (0xf << 21) | ||
114 | #define PSC_AC97CFG_TXSLOT_MASK (0x3ff << 11) | ||
115 | #define PSC_AC97CFG_RXSLOT_MASK (0x3ff << 1) | ||
116 | #define PSC_AC97CFG_GE_ENABLE (1) | ||
117 | |||
118 | /* Enable slots 3-12. */ | ||
119 | #define PSC_AC97CFG_TXSLOT_ENA(x) (1 << (((x) - 3) + 11)) | ||
120 | #define PSC_AC97CFG_RXSLOT_ENA(x) (1 << (((x) - 3) + 1)) | ||
121 | |||
122 | /* | ||
123 | * The word length equation is ((x) * 2) + 2, so choose 'x' appropriately. | ||
124 | * The only sensible numbers are 7, 9, or possibly 11. Nah, just do the | ||
125 | * arithmetic in the macro. | ||
126 | */ | ||
127 | #define PSC_AC97CFG_SET_LEN(x) (((((x) - 2) / 2) & 0xf) << 21) | ||
128 | #define PSC_AC97CFG_GET_LEN(x) (((((x) >> 21) & 0xf) * 2) + 2) | ||
129 | |||
130 | /* AC97 Mask Register. */ | ||
131 | #define PSC_AC97MSK_GR (1 << 25) | ||
132 | #define PSC_AC97MSK_CD (1 << 24) | ||
133 | #define PSC_AC97MSK_RR (1 << 13) | ||
134 | #define PSC_AC97MSK_RO (1 << 12) | ||
135 | #define PSC_AC97MSK_RU (1 << 11) | ||
136 | #define PSC_AC97MSK_TR (1 << 10) | ||
137 | #define PSC_AC97MSK_TO (1 << 9) | ||
138 | #define PSC_AC97MSK_TU (1 << 8) | ||
139 | #define PSC_AC97MSK_RD (1 << 5) | ||
140 | #define PSC_AC97MSK_TD (1 << 4) | ||
141 | #define PSC_AC97MSK_ALLMASK (PSC_AC97MSK_GR | PSC_AC97MSK_CD | \ | ||
142 | PSC_AC97MSK_RR | PSC_AC97MSK_RO | \ | ||
143 | PSC_AC97MSK_RU | PSC_AC97MSK_TR | \ | ||
144 | PSC_AC97MSK_TO | PSC_AC97MSK_TU | \ | ||
145 | PSC_AC97MSK_RD | PSC_AC97MSK_TD) | ||
146 | |||
147 | /* AC97 Protocol Control Register. */ | ||
148 | #define PSC_AC97PCR_RC (1 << 6) | ||
149 | #define PSC_AC97PCR_RP (1 << 5) | ||
150 | #define PSC_AC97PCR_RS (1 << 4) | ||
151 | #define PSC_AC97PCR_TC (1 << 2) | ||
152 | #define PSC_AC97PCR_TP (1 << 1) | ||
153 | #define PSC_AC97PCR_TS (1 << 0) | ||
154 | |||
155 | /* AC97 Status register (read only). */ | ||
156 | #define PSC_AC97STAT_CB (1 << 26) | ||
157 | #define PSC_AC97STAT_CP (1 << 25) | ||
158 | #define PSC_AC97STAT_CR (1 << 24) | ||
159 | #define PSC_AC97STAT_RF (1 << 13) | ||
160 | #define PSC_AC97STAT_RE (1 << 12) | ||
161 | #define PSC_AC97STAT_RR (1 << 11) | ||
162 | #define PSC_AC97STAT_TF (1 << 10) | ||
163 | #define PSC_AC97STAT_TE (1 << 9) | ||
164 | #define PSC_AC97STAT_TR (1 << 8) | ||
165 | #define PSC_AC97STAT_RB (1 << 5) | ||
166 | #define PSC_AC97STAT_TB (1 << 4) | ||
167 | #define PSC_AC97STAT_DI (1 << 2) | ||
168 | #define PSC_AC97STAT_DR (1 << 1) | ||
169 | #define PSC_AC97STAT_SR (1 << 0) | ||
170 | |||
171 | /* AC97 Event Register. */ | ||
172 | #define PSC_AC97EVNT_GR (1 << 25) | ||
173 | #define PSC_AC97EVNT_CD (1 << 24) | ||
174 | #define PSC_AC97EVNT_RR (1 << 13) | ||
175 | #define PSC_AC97EVNT_RO (1 << 12) | ||
176 | #define PSC_AC97EVNT_RU (1 << 11) | ||
177 | #define PSC_AC97EVNT_TR (1 << 10) | ||
178 | #define PSC_AC97EVNT_TO (1 << 9) | ||
179 | #define PSC_AC97EVNT_TU (1 << 8) | ||
180 | #define PSC_AC97EVNT_RD (1 << 5) | ||
181 | #define PSC_AC97EVNT_TD (1 << 4) | ||
182 | |||
183 | /* CODEC Command Register. */ | ||
184 | #define PSC_AC97CDC_RD (1 << 25) | ||
185 | #define PSC_AC97CDC_ID_MASK (3 << 23) | ||
186 | #define PSC_AC97CDC_INDX_MASK (0x7f << 16) | ||
187 | #define PSC_AC97CDC_ID(x) (((x) & 0x03) << 23) | ||
188 | #define PSC_AC97CDC_INDX(x) (((x) & 0x7f) << 16) | ||
189 | |||
190 | /* AC97 Reset Control Register. */ | ||
191 | #define PSC_AC97RST_RST (1 << 1) | ||
192 | #define PSC_AC97RST_SNC (1 << 0) | ||
193 | |||
194 | /* PSC in I2S Mode. */ | ||
195 | typedef struct psc_i2s { | ||
196 | u32 psc_sel; | ||
197 | u32 psc_ctrl; | ||
198 | u32 psc_i2scfg; | ||
199 | u32 psc_i2smsk; | ||
200 | u32 psc_i2spcr; | ||
201 | u32 psc_i2sstat; | ||
202 | u32 psc_i2sevent; | ||
203 | u32 psc_i2stxrx; | ||
204 | u32 psc_i2sudf; | ||
205 | } psc_i2s_t; | ||
206 | |||
207 | #define PSC_I2SCFG_OFFSET 0x08 | ||
208 | #define PSC_I2SMASK_OFFSET 0x0C | ||
209 | #define PSC_I2SPCR_OFFSET 0x10 | ||
210 | #define PSC_I2SSTAT_OFFSET 0x14 | ||
211 | #define PSC_I2SEVENT_OFFSET 0x18 | ||
212 | #define PSC_I2SRXTX_OFFSET 0x1C | ||
213 | #define PSC_I2SUDF_OFFSET 0x20 | ||
214 | |||
215 | /* I2S Config Register. */ | ||
216 | #define PSC_I2SCFG_RT_MASK (3 << 30) | ||
217 | #define PSC_I2SCFG_RT_FIFO1 (0 << 30) | ||
218 | #define PSC_I2SCFG_RT_FIFO2 (1 << 30) | ||
219 | #define PSC_I2SCFG_RT_FIFO4 (2 << 30) | ||
220 | #define PSC_I2SCFG_RT_FIFO8 (3 << 30) | ||
221 | |||
222 | #define PSC_I2SCFG_TT_MASK (3 << 28) | ||
223 | #define PSC_I2SCFG_TT_FIFO1 (0 << 28) | ||
224 | #define PSC_I2SCFG_TT_FIFO2 (1 << 28) | ||
225 | #define PSC_I2SCFG_TT_FIFO4 (2 << 28) | ||
226 | #define PSC_I2SCFG_TT_FIFO8 (3 << 28) | ||
227 | |||
228 | #define PSC_I2SCFG_DD_DISABLE (1 << 27) | ||
229 | #define PSC_I2SCFG_DE_ENABLE (1 << 26) | ||
230 | #define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16) | ||
231 | #define PSC_I2SCFG_WS(n) ((n & 0xFF) << 16) | ||
232 | #define PSC_I2SCFG_WS_MASK (PSC_I2SCFG_WS(0x3F)) | ||
233 | #define PSC_I2SCFG_WI (1 << 15) | ||
234 | |||
235 | #define PSC_I2SCFG_DIV_MASK (3 << 13) | ||
236 | #define PSC_I2SCFG_DIV2 (0 << 13) | ||
237 | #define PSC_I2SCFG_DIV4 (1 << 13) | ||
238 | #define PSC_I2SCFG_DIV8 (2 << 13) | ||
239 | #define PSC_I2SCFG_DIV16 (3 << 13) | ||
240 | |||
241 | #define PSC_I2SCFG_BI (1 << 12) | ||
242 | #define PSC_I2SCFG_BUF (1 << 11) | ||
243 | #define PSC_I2SCFG_MLJ (1 << 10) | ||
244 | #define PSC_I2SCFG_XM (1 << 9) | ||
245 | |||
246 | /* The word length equation is simply LEN+1. */ | ||
247 | #define PSC_I2SCFG_SET_LEN(x) ((((x) - 1) & 0x1f) << 4) | ||
248 | #define PSC_I2SCFG_GET_LEN(x) ((((x) >> 4) & 0x1f) + 1) | ||
249 | |||
250 | #define PSC_I2SCFG_LB (1 << 2) | ||
251 | #define PSC_I2SCFG_MLF (1 << 1) | ||
252 | #define PSC_I2SCFG_MS (1 << 0) | ||
253 | |||
254 | /* I2S Mask Register. */ | ||
255 | #define PSC_I2SMSK_RR (1 << 13) | ||
256 | #define PSC_I2SMSK_RO (1 << 12) | ||
257 | #define PSC_I2SMSK_RU (1 << 11) | ||
258 | #define PSC_I2SMSK_TR (1 << 10) | ||
259 | #define PSC_I2SMSK_TO (1 << 9) | ||
260 | #define PSC_I2SMSK_TU (1 << 8) | ||
261 | #define PSC_I2SMSK_RD (1 << 5) | ||
262 | #define PSC_I2SMSK_TD (1 << 4) | ||
263 | #define PSC_I2SMSK_ALLMASK (PSC_I2SMSK_RR | PSC_I2SMSK_RO | \ | ||
264 | PSC_I2SMSK_RU | PSC_I2SMSK_TR | \ | ||
265 | PSC_I2SMSK_TO | PSC_I2SMSK_TU | \ | ||
266 | PSC_I2SMSK_RD | PSC_I2SMSK_TD) | ||
267 | |||
268 | /* I2S Protocol Control Register. */ | ||
269 | #define PSC_I2SPCR_RC (1 << 6) | ||
270 | #define PSC_I2SPCR_RP (1 << 5) | ||
271 | #define PSC_I2SPCR_RS (1 << 4) | ||
272 | #define PSC_I2SPCR_TC (1 << 2) | ||
273 | #define PSC_I2SPCR_TP (1 << 1) | ||
274 | #define PSC_I2SPCR_TS (1 << 0) | ||
275 | |||
276 | /* I2S Status register (read only). */ | ||
277 | #define PSC_I2SSTAT_RF (1 << 13) | ||
278 | #define PSC_I2SSTAT_RE (1 << 12) | ||
279 | #define PSC_I2SSTAT_RR (1 << 11) | ||
280 | #define PSC_I2SSTAT_TF (1 << 10) | ||
281 | #define PSC_I2SSTAT_TE (1 << 9) | ||
282 | #define PSC_I2SSTAT_TR (1 << 8) | ||
283 | #define PSC_I2SSTAT_RB (1 << 5) | ||
284 | #define PSC_I2SSTAT_TB (1 << 4) | ||
285 | #define PSC_I2SSTAT_DI (1 << 2) | ||
286 | #define PSC_I2SSTAT_DR (1 << 1) | ||
287 | #define PSC_I2SSTAT_SR (1 << 0) | ||
288 | |||
289 | /* I2S Event Register. */ | ||
290 | #define PSC_I2SEVNT_RR (1 << 13) | ||
291 | #define PSC_I2SEVNT_RO (1 << 12) | ||
292 | #define PSC_I2SEVNT_RU (1 << 11) | ||
293 | #define PSC_I2SEVNT_TR (1 << 10) | ||
294 | #define PSC_I2SEVNT_TO (1 << 9) | ||
295 | #define PSC_I2SEVNT_TU (1 << 8) | ||
296 | #define PSC_I2SEVNT_RD (1 << 5) | ||
297 | #define PSC_I2SEVNT_TD (1 << 4) | ||
298 | |||
299 | /* PSC in SPI Mode. */ | ||
300 | typedef struct psc_spi { | ||
301 | u32 psc_sel; | ||
302 | u32 psc_ctrl; | ||
303 | u32 psc_spicfg; | ||
304 | u32 psc_spimsk; | ||
305 | u32 psc_spipcr; | ||
306 | u32 psc_spistat; | ||
307 | u32 psc_spievent; | ||
308 | u32 psc_spitxrx; | ||
309 | } psc_spi_t; | ||
310 | |||
311 | /* SPI Config Register. */ | ||
312 | #define PSC_SPICFG_RT_MASK (3 << 30) | ||
313 | #define PSC_SPICFG_RT_FIFO1 (0 << 30) | ||
314 | #define PSC_SPICFG_RT_FIFO2 (1 << 30) | ||
315 | #define PSC_SPICFG_RT_FIFO4 (2 << 30) | ||
316 | #define PSC_SPICFG_RT_FIFO8 (3 << 30) | ||
317 | |||
318 | #define PSC_SPICFG_TT_MASK (3 << 28) | ||
319 | #define PSC_SPICFG_TT_FIFO1 (0 << 28) | ||
320 | #define PSC_SPICFG_TT_FIFO2 (1 << 28) | ||
321 | #define PSC_SPICFG_TT_FIFO4 (2 << 28) | ||
322 | #define PSC_SPICFG_TT_FIFO8 (3 << 28) | ||
323 | |||
324 | #define PSC_SPICFG_DD_DISABLE (1 << 27) | ||
325 | #define PSC_SPICFG_DE_ENABLE (1 << 26) | ||
326 | #define PSC_SPICFG_CLR_BAUD(x) ((x) & ~((0x3f) << 15)) | ||
327 | #define PSC_SPICFG_SET_BAUD(x) (((x) & 0x3f) << 15) | ||
328 | |||
329 | #define PSC_SPICFG_SET_DIV(x) (((x) & 0x03) << 13) | ||
330 | #define PSC_SPICFG_DIV2 0 | ||
331 | #define PSC_SPICFG_DIV4 1 | ||
332 | #define PSC_SPICFG_DIV8 2 | ||
333 | #define PSC_SPICFG_DIV16 3 | ||
334 | |||
335 | #define PSC_SPICFG_BI (1 << 12) | ||
336 | #define PSC_SPICFG_PSE (1 << 11) | ||
337 | #define PSC_SPICFG_CGE (1 << 10) | ||
338 | #define PSC_SPICFG_CDE (1 << 9) | ||
339 | |||
340 | #define PSC_SPICFG_CLR_LEN(x) ((x) & ~((0x1f) << 4)) | ||
341 | #define PSC_SPICFG_SET_LEN(x) (((x-1) & 0x1f) << 4) | ||
342 | |||
343 | #define PSC_SPICFG_LB (1 << 3) | ||
344 | #define PSC_SPICFG_MLF (1 << 1) | ||
345 | #define PSC_SPICFG_MO (1 << 0) | ||
346 | |||
347 | /* SPI Mask Register. */ | ||
348 | #define PSC_SPIMSK_MM (1 << 16) | ||
349 | #define PSC_SPIMSK_RR (1 << 13) | ||
350 | #define PSC_SPIMSK_RO (1 << 12) | ||
351 | #define PSC_SPIMSK_RU (1 << 11) | ||
352 | #define PSC_SPIMSK_TR (1 << 10) | ||
353 | #define PSC_SPIMSK_TO (1 << 9) | ||
354 | #define PSC_SPIMSK_TU (1 << 8) | ||
355 | #define PSC_SPIMSK_SD (1 << 5) | ||
356 | #define PSC_SPIMSK_MD (1 << 4) | ||
357 | #define PSC_SPIMSK_ALLMASK (PSC_SPIMSK_MM | PSC_SPIMSK_RR | \ | ||
358 | PSC_SPIMSK_RO | PSC_SPIMSK_TO | \ | ||
359 | PSC_SPIMSK_TU | PSC_SPIMSK_SD | \ | ||
360 | PSC_SPIMSK_MD) | ||
361 | |||
362 | /* SPI Protocol Control Register. */ | ||
363 | #define PSC_SPIPCR_RC (1 << 6) | ||
364 | #define PSC_SPIPCR_SP (1 << 5) | ||
365 | #define PSC_SPIPCR_SS (1 << 4) | ||
366 | #define PSC_SPIPCR_TC (1 << 2) | ||
367 | #define PSC_SPIPCR_MS (1 << 0) | ||
368 | |||
369 | /* SPI Status register (read only). */ | ||
370 | #define PSC_SPISTAT_RF (1 << 13) | ||
371 | #define PSC_SPISTAT_RE (1 << 12) | ||
372 | #define PSC_SPISTAT_RR (1 << 11) | ||
373 | #define PSC_SPISTAT_TF (1 << 10) | ||
374 | #define PSC_SPISTAT_TE (1 << 9) | ||
375 | #define PSC_SPISTAT_TR (1 << 8) | ||
376 | #define PSC_SPISTAT_SB (1 << 5) | ||
377 | #define PSC_SPISTAT_MB (1 << 4) | ||
378 | #define PSC_SPISTAT_DI (1 << 2) | ||
379 | #define PSC_SPISTAT_DR (1 << 1) | ||
380 | #define PSC_SPISTAT_SR (1 << 0) | ||
381 | |||
382 | /* SPI Event Register. */ | ||
383 | #define PSC_SPIEVNT_MM (1 << 16) | ||
384 | #define PSC_SPIEVNT_RR (1 << 13) | ||
385 | #define PSC_SPIEVNT_RO (1 << 12) | ||
386 | #define PSC_SPIEVNT_RU (1 << 11) | ||
387 | #define PSC_SPIEVNT_TR (1 << 10) | ||
388 | #define PSC_SPIEVNT_TO (1 << 9) | ||
389 | #define PSC_SPIEVNT_TU (1 << 8) | ||
390 | #define PSC_SPIEVNT_SD (1 << 5) | ||
391 | #define PSC_SPIEVNT_MD (1 << 4) | ||
392 | |||
393 | /* Transmit register control. */ | ||
394 | #define PSC_SPITXRX_LC (1 << 29) | ||
395 | #define PSC_SPITXRX_SR (1 << 28) | ||
396 | |||
397 | /* PSC in SMBus (I2C) Mode. */ | ||
398 | typedef struct psc_smb { | ||
399 | u32 psc_sel; | ||
400 | u32 psc_ctrl; | ||
401 | u32 psc_smbcfg; | ||
402 | u32 psc_smbmsk; | ||
403 | u32 psc_smbpcr; | ||
404 | u32 psc_smbstat; | ||
405 | u32 psc_smbevnt; | ||
406 | u32 psc_smbtxrx; | ||
407 | u32 psc_smbtmr; | ||
408 | } psc_smb_t; | ||
409 | |||
410 | /* SMBus Config Register. */ | ||
411 | #define PSC_SMBCFG_RT_MASK (3 << 30) | ||
412 | #define PSC_SMBCFG_RT_FIFO1 (0 << 30) | ||
413 | #define PSC_SMBCFG_RT_FIFO2 (1 << 30) | ||
414 | #define PSC_SMBCFG_RT_FIFO4 (2 << 30) | ||
415 | #define PSC_SMBCFG_RT_FIFO8 (3 << 30) | ||
416 | |||
417 | #define PSC_SMBCFG_TT_MASK (3 << 28) | ||
418 | #define PSC_SMBCFG_TT_FIFO1 (0 << 28) | ||
419 | #define PSC_SMBCFG_TT_FIFO2 (1 << 28) | ||
420 | #define PSC_SMBCFG_TT_FIFO4 (2 << 28) | ||
421 | #define PSC_SMBCFG_TT_FIFO8 (3 << 28) | ||
422 | |||
423 | #define PSC_SMBCFG_DD_DISABLE (1 << 27) | ||
424 | #define PSC_SMBCFG_DE_ENABLE (1 << 26) | ||
425 | |||
426 | #define PSC_SMBCFG_SET_DIV(x) (((x) & 0x03) << 13) | ||
427 | #define PSC_SMBCFG_DIV2 0 | ||
428 | #define PSC_SMBCFG_DIV4 1 | ||
429 | #define PSC_SMBCFG_DIV8 2 | ||
430 | #define PSC_SMBCFG_DIV16 3 | ||
431 | |||
432 | #define PSC_SMBCFG_GCE (1 << 9) | ||
433 | #define PSC_SMBCFG_SFM (1 << 8) | ||
434 | |||
435 | #define PSC_SMBCFG_SET_SLV(x) (((x) & 0x7f) << 1) | ||
436 | |||
437 | /* SMBus Mask Register. */ | ||
438 | #define PSC_SMBMSK_DN (1 << 30) | ||
439 | #define PSC_SMBMSK_AN (1 << 29) | ||
440 | #define PSC_SMBMSK_AL (1 << 28) | ||
441 | #define PSC_SMBMSK_RR (1 << 13) | ||
442 | #define PSC_SMBMSK_RO (1 << 12) | ||
443 | #define PSC_SMBMSK_RU (1 << 11) | ||
444 | #define PSC_SMBMSK_TR (1 << 10) | ||
445 | #define PSC_SMBMSK_TO (1 << 9) | ||
446 | #define PSC_SMBMSK_TU (1 << 8) | ||
447 | #define PSC_SMBMSK_SD (1 << 5) | ||
448 | #define PSC_SMBMSK_MD (1 << 4) | ||
449 | #define PSC_SMBMSK_ALLMASK (PSC_SMBMSK_DN | PSC_SMBMSK_AN | \ | ||
450 | PSC_SMBMSK_AL | PSC_SMBMSK_RR | \ | ||
451 | PSC_SMBMSK_RO | PSC_SMBMSK_TO | \ | ||
452 | PSC_SMBMSK_TU | PSC_SMBMSK_SD | \ | ||
453 | PSC_SMBMSK_MD) | ||
454 | |||
455 | /* SMBus Protocol Control Register. */ | ||
456 | #define PSC_SMBPCR_DC (1 << 2) | ||
457 | #define PSC_SMBPCR_MS (1 << 0) | ||
458 | |||
459 | /* SMBus Status register (read only). */ | ||
460 | #define PSC_SMBSTAT_BB (1 << 28) | ||
461 | #define PSC_SMBSTAT_RF (1 << 13) | ||
462 | #define PSC_SMBSTAT_RE (1 << 12) | ||
463 | #define PSC_SMBSTAT_RR (1 << 11) | ||
464 | #define PSC_SMBSTAT_TF (1 << 10) | ||
465 | #define PSC_SMBSTAT_TE (1 << 9) | ||
466 | #define PSC_SMBSTAT_TR (1 << 8) | ||
467 | #define PSC_SMBSTAT_SB (1 << 5) | ||
468 | #define PSC_SMBSTAT_MB (1 << 4) | ||
469 | #define PSC_SMBSTAT_DI (1 << 2) | ||
470 | #define PSC_SMBSTAT_DR (1 << 1) | ||
471 | #define PSC_SMBSTAT_SR (1 << 0) | ||
472 | |||
473 | /* SMBus Event Register. */ | ||
474 | #define PSC_SMBEVNT_DN (1 << 30) | ||
475 | #define PSC_SMBEVNT_AN (1 << 29) | ||
476 | #define PSC_SMBEVNT_AL (1 << 28) | ||
477 | #define PSC_SMBEVNT_RR (1 << 13) | ||
478 | #define PSC_SMBEVNT_RO (1 << 12) | ||
479 | #define PSC_SMBEVNT_RU (1 << 11) | ||
480 | #define PSC_SMBEVNT_TR (1 << 10) | ||
481 | #define PSC_SMBEVNT_TO (1 << 9) | ||
482 | #define PSC_SMBEVNT_TU (1 << 8) | ||
483 | #define PSC_SMBEVNT_SD (1 << 5) | ||
484 | #define PSC_SMBEVNT_MD (1 << 4) | ||
485 | #define PSC_SMBEVNT_ALLCLR (PSC_SMBEVNT_DN | PSC_SMBEVNT_AN | \ | ||
486 | PSC_SMBEVNT_AL | PSC_SMBEVNT_RR | \ | ||
487 | PSC_SMBEVNT_RO | PSC_SMBEVNT_TO | \ | ||
488 | PSC_SMBEVNT_TU | PSC_SMBEVNT_SD | \ | ||
489 | PSC_SMBEVNT_MD) | ||
490 | |||
491 | /* Transmit register control. */ | ||
492 | #define PSC_SMBTXRX_RSR (1 << 28) | ||
493 | #define PSC_SMBTXRX_STP (1 << 29) | ||
494 | #define PSC_SMBTXRX_DATAMASK 0xff | ||
495 | |||
496 | /* SMBus protocol timers register. */ | ||
497 | #define PSC_SMBTMR_SET_TH(x) (((x) & 0x03) << 30) | ||
498 | #define PSC_SMBTMR_SET_PS(x) (((x) & 0x1f) << 25) | ||
499 | #define PSC_SMBTMR_SET_PU(x) (((x) & 0x1f) << 20) | ||
500 | #define PSC_SMBTMR_SET_SH(x) (((x) & 0x1f) << 15) | ||
501 | #define PSC_SMBTMR_SET_SU(x) (((x) & 0x1f) << 10) | ||
502 | #define PSC_SMBTMR_SET_CL(x) (((x) & 0x1f) << 5) | ||
503 | #define PSC_SMBTMR_SET_CH(x) (((x) & 0x1f) << 0) | ||
504 | |||
505 | #endif /* _AU1000_PSC_H_ */ | ||
diff --git a/include/asm-mips/mach-au1x00/gpio.h b/include/asm-mips/mach-au1x00/gpio.h deleted file mode 100644 index 2dc61e009a08..000000000000 --- a/include/asm-mips/mach-au1x00/gpio.h +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | #ifndef _AU1XXX_GPIO_H_ | ||
2 | #define _AU1XXX_GPIO_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | #define AU1XXX_GPIO_BASE 200 | ||
7 | |||
8 | struct au1x00_gpio2 { | ||
9 | u32 dir; | ||
10 | u32 reserved; | ||
11 | u32 output; | ||
12 | u32 pinstate; | ||
13 | u32 inten; | ||
14 | u32 enable; | ||
15 | }; | ||
16 | |||
17 | extern int au1xxx_gpio_get_value(unsigned gpio); | ||
18 | extern void au1xxx_gpio_set_value(unsigned gpio, int value); | ||
19 | extern int au1xxx_gpio_direction_input(unsigned gpio); | ||
20 | extern int au1xxx_gpio_direction_output(unsigned gpio, int value); | ||
21 | |||
22 | |||
23 | /* Wrappers for the arch-neutral GPIO API */ | ||
24 | |||
25 | static inline int gpio_request(unsigned gpio, const char *label) | ||
26 | { | ||
27 | /* Not yet implemented */ | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | static inline void gpio_free(unsigned gpio) | ||
32 | { | ||
33 | /* Not yet implemented */ | ||
34 | } | ||
35 | |||
36 | static inline int gpio_direction_input(unsigned gpio) | ||
37 | { | ||
38 | return au1xxx_gpio_direction_input(gpio); | ||
39 | } | ||
40 | |||
41 | static inline int gpio_direction_output(unsigned gpio, int value) | ||
42 | { | ||
43 | return au1xxx_gpio_direction_output(gpio, value); | ||
44 | } | ||
45 | |||
46 | static inline int gpio_get_value(unsigned gpio) | ||
47 | { | ||
48 | return au1xxx_gpio_get_value(gpio); | ||
49 | } | ||
50 | |||
51 | static inline void gpio_set_value(unsigned gpio, int value) | ||
52 | { | ||
53 | au1xxx_gpio_set_value(gpio, value); | ||
54 | } | ||
55 | |||
56 | static inline int gpio_to_irq(unsigned gpio) | ||
57 | { | ||
58 | return gpio; | ||
59 | } | ||
60 | |||
61 | static inline int irq_to_gpio(unsigned irq) | ||
62 | { | ||
63 | return irq; | ||
64 | } | ||
65 | |||
66 | /* For cansleep */ | ||
67 | #include <asm-generic/gpio.h> | ||
68 | |||
69 | #endif /* _AU1XXX_GPIO_H_ */ | ||
diff --git a/include/asm-mips/mach-au1x00/ioremap.h b/include/asm-mips/mach-au1x00/ioremap.h deleted file mode 100644 index 364cea2dc71f..000000000000 --- a/include/asm-mips/mach-au1x00/ioremap.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/mach-au1x00/ioremap.h | ||
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 | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_AU1X00_IOREMAP_H | ||
10 | #define __ASM_MACH_AU1X00_IOREMAP_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | #ifdef CONFIG_64BIT_PHYS_ADDR | ||
15 | extern phys_t __fixup_bigphys_addr(phys_t, phys_t); | ||
16 | #else | ||
17 | static inline phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
18 | { | ||
19 | return phys_addr; | ||
20 | } | ||
21 | #endif | ||
22 | |||
23 | /* | ||
24 | * Allow physical addresses to be fixed up to help 36-bit peripherals. | ||
25 | */ | ||
26 | static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
27 | { | ||
28 | return __fixup_bigphys_addr(phys_addr, size); | ||
29 | } | ||
30 | |||
31 | static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, | ||
32 | unsigned long flags) | ||
33 | { | ||
34 | return NULL; | ||
35 | } | ||
36 | |||
37 | static inline int plat_iounmap(const volatile void __iomem *addr) | ||
38 | { | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | #endif /* __ASM_MACH_AU1X00_IOREMAP_H */ | ||
diff --git a/include/asm-mips/mach-au1x00/prom.h b/include/asm-mips/mach-au1x00/prom.h deleted file mode 100644 index e38715577c51..000000000000 --- a/include/asm-mips/mach-au1x00/prom.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #ifndef __AU1X00_PROM_H | ||
2 | #define __AU1X00_PROM_H | ||
3 | |||
4 | extern int prom_argc; | ||
5 | extern char **prom_argv; | ||
6 | extern char **prom_envp; | ||
7 | |||
8 | extern void prom_init_cmdline(void); | ||
9 | extern char *prom_getcmdline(void); | ||
10 | extern char *prom_getenv(char *envname); | ||
11 | extern int prom_get_ethernet_addr(char *ethernet_addr); | ||
12 | |||
13 | #endif | ||
diff --git a/include/asm-mips/mach-au1x00/war.h b/include/asm-mips/mach-au1x00/war.h deleted file mode 100644 index dd57d03d68ba..000000000000 --- a/include/asm-mips/mach-au1x00/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_AU1X00_WAR_H | ||
9 | #define __ASM_MIPS_MACH_AU1X00_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_AU1X00_WAR_H */ | ||
diff --git a/include/asm-mips/mach-bcm47xx/bcm47xx.h b/include/asm-mips/mach-bcm47xx/bcm47xx.h deleted file mode 100644 index d008f47a28bd..000000000000 --- a/include/asm-mips/mach-bcm47xx/bcm47xx.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net> | ||
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 | |||
19 | #ifndef __ASM_BCM47XX_H | ||
20 | #define __ASM_BCM47XX_H | ||
21 | |||
22 | /* SSB bus */ | ||
23 | extern struct ssb_bus ssb_bcm47xx; | ||
24 | |||
25 | #endif /* __ASM_BCM47XX_H */ | ||
diff --git a/include/asm-mips/mach-bcm47xx/gpio.h b/include/asm-mips/mach-bcm47xx/gpio.h deleted file mode 100644 index cfc8f4d618ce..000000000000 --- a/include/asm-mips/mach-bcm47xx/gpio.h +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net> | ||
7 | */ | ||
8 | |||
9 | #ifndef __BCM47XX_GPIO_H | ||
10 | #define __BCM47XX_GPIO_H | ||
11 | |||
12 | #define BCM47XX_EXTIF_GPIO_LINES 5 | ||
13 | #define BCM47XX_CHIPCO_GPIO_LINES 16 | ||
14 | |||
15 | extern int bcm47xx_gpio_to_irq(unsigned gpio); | ||
16 | extern int bcm47xx_gpio_get_value(unsigned gpio); | ||
17 | extern void bcm47xx_gpio_set_value(unsigned gpio, int value); | ||
18 | extern int bcm47xx_gpio_direction_input(unsigned gpio); | ||
19 | extern int bcm47xx_gpio_direction_output(unsigned gpio, int value); | ||
20 | |||
21 | static inline int gpio_request(unsigned gpio, const char *label) | ||
22 | { | ||
23 | return 0; | ||
24 | } | ||
25 | |||
26 | static inline void gpio_free(unsigned gpio) | ||
27 | { | ||
28 | } | ||
29 | |||
30 | static inline int gpio_to_irq(unsigned gpio) | ||
31 | { | ||
32 | return bcm47xx_gpio_to_irq(gpio); | ||
33 | } | ||
34 | |||
35 | static inline int gpio_get_value(unsigned gpio) | ||
36 | { | ||
37 | return bcm47xx_gpio_get_value(gpio); | ||
38 | } | ||
39 | |||
40 | static inline void gpio_set_value(unsigned gpio, int value) | ||
41 | { | ||
42 | bcm47xx_gpio_set_value(gpio, value); | ||
43 | } | ||
44 | |||
45 | static inline int gpio_direction_input(unsigned gpio) | ||
46 | { | ||
47 | return bcm47xx_gpio_direction_input(gpio); | ||
48 | } | ||
49 | |||
50 | static inline int gpio_direction_output(unsigned gpio, int value) | ||
51 | { | ||
52 | return bcm47xx_gpio_direction_output(gpio, value); | ||
53 | } | ||
54 | |||
55 | |||
56 | /* cansleep wrappers */ | ||
57 | #include <asm-generic/gpio.h> | ||
58 | |||
59 | #endif /* __BCM47XX_GPIO_H */ | ||
diff --git a/include/asm-mips/mach-bcm47xx/war.h b/include/asm-mips/mach-bcm47xx/war.h deleted file mode 100644 index 4a2b7986b582..000000000000 --- a/include/asm-mips/mach-bcm47xx/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_BCM947XX_WAR_H | ||
9 | #define __ASM_MIPS_MACH_BCM947XX_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_BCM947XX_WAR_H */ | ||
diff --git a/include/asm-mips/mach-cobalt/cobalt.h b/include/asm-mips/mach-cobalt/cobalt.h deleted file mode 100644 index 5b9fce73f11d..000000000000 --- a/include/asm-mips/mach-cobalt/cobalt.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * The Cobalt board ID information. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1997 Cobalt Microserver | ||
9 | * Copyright (C) 1997, 2003 Ralf Baechle | ||
10 | * Copyright (C) 2001, 2002, 2003 Liam Davies (ldavies@agile.tv) | ||
11 | */ | ||
12 | #ifndef __ASM_COBALT_H | ||
13 | #define __ASM_COBALT_H | ||
14 | |||
15 | extern int cobalt_board_id; | ||
16 | |||
17 | #define COBALT_BRD_ID_QUBE1 0x3 | ||
18 | #define COBALT_BRD_ID_RAQ1 0x4 | ||
19 | #define COBALT_BRD_ID_QUBE2 0x5 | ||
20 | #define COBALT_BRD_ID_RAQ2 0x6 | ||
21 | |||
22 | #endif /* __ASM_COBALT_H */ | ||
diff --git a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h deleted file mode 100644 index b3314cf53194..000000000000 --- a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006, 07 Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #ifndef __ASM_COBALT_CPU_FEATURE_OVERRIDES_H | ||
9 | #define __ASM_COBALT_CPU_FEATURE_OVERRIDES_H | ||
10 | |||
11 | |||
12 | #define cpu_has_tlb 1 | ||
13 | #define cpu_has_4kex 1 | ||
14 | #define cpu_has_3k_cache 0 | ||
15 | #define cpu_has_4k_cache 1 | ||
16 | #define cpu_has_tx39_cache 0 | ||
17 | #define cpu_has_fpu 1 | ||
18 | #define cpu_has_32fpr 1 | ||
19 | #define cpu_has_counter 1 | ||
20 | #define cpu_has_watch 0 | ||
21 | #define cpu_has_divec 1 | ||
22 | #define cpu_has_vce 0 | ||
23 | #define cpu_has_cache_cdex_p 0 | ||
24 | #define cpu_has_cache_cdex_s 0 | ||
25 | #define cpu_has_prefetch 0 | ||
26 | #define cpu_has_mcheck 0 | ||
27 | #define cpu_has_ejtag 0 | ||
28 | |||
29 | #define cpu_has_inclusive_pcaches 0 | ||
30 | #define cpu_dcache_line_size() 32 | ||
31 | #define cpu_icache_line_size() 32 | ||
32 | #define cpu_scache_line_size() 0 | ||
33 | |||
34 | #ifdef CONFIG_64BIT | ||
35 | #define cpu_has_llsc 0 | ||
36 | #else | ||
37 | #define cpu_has_llsc 1 | ||
38 | #endif | ||
39 | |||
40 | #define cpu_has_mips16 0 | ||
41 | #define cpu_has_mdmx 0 | ||
42 | #define cpu_has_mips3d 0 | ||
43 | #define cpu_has_smartmips 0 | ||
44 | #define cpu_has_vtag_icache 0 | ||
45 | #define cpu_has_ic_fills_f_dc 0 | ||
46 | #define cpu_icache_snoops_remote_store 0 | ||
47 | #define cpu_has_dsp 0 | ||
48 | #define cpu_has_mipsmt 0 | ||
49 | #define cpu_has_userlocal 0 | ||
50 | |||
51 | #define cpu_has_mips32r1 0 | ||
52 | #define cpu_has_mips32r2 0 | ||
53 | #define cpu_has_mips64r1 0 | ||
54 | #define cpu_has_mips64r2 0 | ||
55 | |||
56 | #endif /* __ASM_COBALT_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-cobalt/irq.h b/include/asm-mips/mach-cobalt/irq.h deleted file mode 100644 index 57c8c9ac5851..000000000000 --- a/include/asm-mips/mach-cobalt/irq.h +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | /* | ||
2 | * Cobalt IRQ definitions. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1997 Cobalt Microserver | ||
9 | * Copyright (C) 1997, 2003 Ralf Baechle | ||
10 | * Copyright (C) 2001-2003 Liam Davies (ldavies@agile.tv) | ||
11 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
12 | */ | ||
13 | #ifndef _ASM_COBALT_IRQ_H | ||
14 | #define _ASM_COBALT_IRQ_H | ||
15 | |||
16 | /* | ||
17 | * i8259 interrupts used on Cobalt: | ||
18 | * | ||
19 | * 8 - RTC | ||
20 | * 9 - PCI slot | ||
21 | * 14 - IDE0 | ||
22 | * 15 - IDE1(no connector on board) | ||
23 | */ | ||
24 | #define I8259A_IRQ_BASE 0 | ||
25 | |||
26 | #define PCISLOT_IRQ (I8259A_IRQ_BASE + 9) | ||
27 | |||
28 | /* | ||
29 | * CPU interrupts used on Cobalt: | ||
30 | * | ||
31 | * 0 - Software interrupt 0 (unused) | ||
32 | * 1 - Software interrupt 0 (unused) | ||
33 | * 2 - cascade GT64111 | ||
34 | * 3 - ethernet or SCSI host controller | ||
35 | * 4 - ethernet | ||
36 | * 5 - 16550 UART | ||
37 | * 6 - cascade i8259 | ||
38 | * 7 - CP0 counter | ||
39 | */ | ||
40 | #define MIPS_CPU_IRQ_BASE 16 | ||
41 | |||
42 | #define GT641XX_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 2) | ||
43 | #define RAQ2_SCSI_IRQ (MIPS_CPU_IRQ_BASE + 3) | ||
44 | #define ETH0_IRQ (MIPS_CPU_IRQ_BASE + 3) | ||
45 | #define QUBE1_ETH0_IRQ (MIPS_CPU_IRQ_BASE + 4) | ||
46 | #define ETH1_IRQ (MIPS_CPU_IRQ_BASE + 4) | ||
47 | #define SERIAL_IRQ (MIPS_CPU_IRQ_BASE + 5) | ||
48 | #define SCSI_IRQ (MIPS_CPU_IRQ_BASE + 5) | ||
49 | #define I8259_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 6) | ||
50 | |||
51 | #define GT641XX_IRQ_BASE 24 | ||
52 | |||
53 | #include <asm/irq_gt641xx.h> | ||
54 | |||
55 | #define NR_IRQS (GT641XX_PCI_INT3_IRQ + 1) | ||
56 | |||
57 | #endif /* _ASM_COBALT_IRQ_H */ | ||
diff --git a/include/asm-mips/mach-cobalt/mach-gt64120.h b/include/asm-mips/mach-cobalt/mach-gt64120.h deleted file mode 100644 index ae9c5523c7ef..000000000000 --- a/include/asm-mips/mach-cobalt/mach-gt64120.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | #ifndef _COBALT_MACH_GT64120_H | ||
19 | #define _COBALT_MACH_GT64120_H | ||
20 | |||
21 | /* | ||
22 | * Cobalt uses GT64111. GT64111 is almost the same as GT64120. | ||
23 | */ | ||
24 | |||
25 | #define GT64120_BASE CKSEG1ADDR(GT_DEF_BASE) | ||
26 | |||
27 | #endif /* _COBALT_MACH_GT64120_H */ | ||
diff --git a/include/asm-mips/mach-cobalt/war.h b/include/asm-mips/mach-cobalt/war.h deleted file mode 100644 index 97884fd18ac0..000000000000 --- a/include/asm-mips/mach-cobalt/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_COBALT_WAR_H | ||
9 | #define __ASM_MIPS_MACH_COBALT_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_COBALT_WAR_H */ | ||
diff --git a/include/asm-mips/mach-db1x00/db1200.h b/include/asm-mips/mach-db1x00/db1200.h deleted file mode 100644 index 27f26102b1bb..000000000000 --- a/include/asm-mips/mach-db1x00/db1200.h +++ /dev/null | |||
@@ -1,230 +0,0 @@ | |||
1 | /* | ||
2 | * AMD Alchemy DBAu1200 Reference Board | ||
3 | * Board register defines. | ||
4 | * | ||
5 | * ######################################################################## | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | ||
20 | * ######################################################################## | ||
21 | * | ||
22 | * | ||
23 | */ | ||
24 | #ifndef __ASM_DB1200_H | ||
25 | #define __ASM_DB1200_H | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | #include <asm/mach-au1x00/au1xxx_psc.h> | ||
29 | |||
30 | #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX | ||
31 | #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX | ||
32 | #define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX | ||
33 | #define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX | ||
34 | |||
35 | /* | ||
36 | * SPI and SMB are muxed on the DBAu1200 board. | ||
37 | * Refer to board documentation. | ||
38 | */ | ||
39 | #define SPI_PSC_BASE PSC0_BASE_ADDR | ||
40 | #define SMBUS_PSC_BASE PSC0_BASE_ADDR | ||
41 | /* | ||
42 | * AC'97 and I2S are muxed on the DBAu1200 board. | ||
43 | * Refer to board documentation. | ||
44 | */ | ||
45 | #define AC97_PSC_BASE PSC1_BASE_ADDR | ||
46 | #define I2S_PSC_BASE PSC1_BASE_ADDR | ||
47 | |||
48 | #define BCSR_KSEG1_ADDR 0xB9800000 | ||
49 | |||
50 | typedef volatile struct | ||
51 | { | ||
52 | /*00*/ u16 whoami; | ||
53 | u16 reserved0; | ||
54 | /*04*/ u16 status; | ||
55 | u16 reserved1; | ||
56 | /*08*/ u16 switches; | ||
57 | u16 reserved2; | ||
58 | /*0C*/ u16 resets; | ||
59 | u16 reserved3; | ||
60 | |||
61 | /*10*/ u16 pcmcia; | ||
62 | u16 reserved4; | ||
63 | /*14*/ u16 board; | ||
64 | u16 reserved5; | ||
65 | /*18*/ u16 disk_leds; | ||
66 | u16 reserved6; | ||
67 | /*1C*/ u16 system; | ||
68 | u16 reserved7; | ||
69 | |||
70 | /*20*/ u16 intclr; | ||
71 | u16 reserved8; | ||
72 | /*24*/ u16 intset; | ||
73 | u16 reserved9; | ||
74 | /*28*/ u16 intclr_mask; | ||
75 | u16 reserved10; | ||
76 | /*2C*/ u16 intset_mask; | ||
77 | u16 reserved11; | ||
78 | |||
79 | /*30*/ u16 sig_status; | ||
80 | u16 reserved12; | ||
81 | /*34*/ u16 int_status; | ||
82 | u16 reserved13; | ||
83 | /*38*/ u16 reserved14; | ||
84 | u16 reserved15; | ||
85 | /*3C*/ u16 reserved16; | ||
86 | u16 reserved17; | ||
87 | |||
88 | } BCSR; | ||
89 | |||
90 | static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; | ||
91 | |||
92 | /* | ||
93 | * Register bit definitions for the BCSRs | ||
94 | */ | ||
95 | #define BCSR_WHOAMI_DCID 0x000F | ||
96 | #define BCSR_WHOAMI_CPLD 0x00F0 | ||
97 | #define BCSR_WHOAMI_BOARD 0x0F00 | ||
98 | |||
99 | #define BCSR_STATUS_PCMCIA0VS 0x0003 | ||
100 | #define BCSR_STATUS_PCMCIA1VS 0x000C | ||
101 | #define BCSR_STATUS_SWAPBOOT 0x0040 | ||
102 | #define BCSR_STATUS_FLASHBUSY 0x0100 | ||
103 | #define BCSR_STATUS_IDECBLID 0x0200 | ||
104 | #define BCSR_STATUS_SD0WP 0x0400 | ||
105 | #define BCSR_STATUS_U0RXD 0x1000 | ||
106 | #define BCSR_STATUS_U1RXD 0x2000 | ||
107 | |||
108 | #define BCSR_SWITCHES_OCTAL 0x00FF | ||
109 | #define BCSR_SWITCHES_DIP_1 0x0080 | ||
110 | #define BCSR_SWITCHES_DIP_2 0x0040 | ||
111 | #define BCSR_SWITCHES_DIP_3 0x0020 | ||
112 | #define BCSR_SWITCHES_DIP_4 0x0010 | ||
113 | #define BCSR_SWITCHES_DIP_5 0x0008 | ||
114 | #define BCSR_SWITCHES_DIP_6 0x0004 | ||
115 | #define BCSR_SWITCHES_DIP_7 0x0002 | ||
116 | #define BCSR_SWITCHES_DIP_8 0x0001 | ||
117 | #define BCSR_SWITCHES_ROTARY 0x0F00 | ||
118 | |||
119 | #define BCSR_RESETS_ETH 0x0001 | ||
120 | #define BCSR_RESETS_CAMERA 0x0002 | ||
121 | #define BCSR_RESETS_DC 0x0004 | ||
122 | #define BCSR_RESETS_IDE 0x0008 | ||
123 | #define BCSR_RESETS_TV 0x0010 | ||
124 | /* Not resets but in the same register */ | ||
125 | #define BCSR_RESETS_PWMR1MUX 0x0800 | ||
126 | #define BCSR_RESETS_PCS0MUX 0x1000 | ||
127 | #define BCSR_RESETS_PCS1MUX 0x2000 | ||
128 | #define BCSR_RESETS_SPISEL 0x4000 | ||
129 | |||
130 | #define BCSR_PCMCIA_PC0VPP 0x0003 | ||
131 | #define BCSR_PCMCIA_PC0VCC 0x000C | ||
132 | #define BCSR_PCMCIA_PC0DRVEN 0x0010 | ||
133 | #define BCSR_PCMCIA_PC0RST 0x0080 | ||
134 | #define BCSR_PCMCIA_PC1VPP 0x0300 | ||
135 | #define BCSR_PCMCIA_PC1VCC 0x0C00 | ||
136 | #define BCSR_PCMCIA_PC1DRVEN 0x1000 | ||
137 | #define BCSR_PCMCIA_PC1RST 0x8000 | ||
138 | |||
139 | #define BCSR_BOARD_LCDVEE 0x0001 | ||
140 | #define BCSR_BOARD_LCDVDD 0x0002 | ||
141 | #define BCSR_BOARD_LCDBL 0x0004 | ||
142 | #define BCSR_BOARD_CAMSNAP 0x0010 | ||
143 | #define BCSR_BOARD_CAMPWR 0x0020 | ||
144 | #define BCSR_BOARD_SD0PWR 0x0040 | ||
145 | |||
146 | #define BCSR_LEDS_DECIMALS 0x0003 | ||
147 | #define BCSR_LEDS_LED0 0x0100 | ||
148 | #define BCSR_LEDS_LED1 0x0200 | ||
149 | #define BCSR_LEDS_LED2 0x0400 | ||
150 | #define BCSR_LEDS_LED3 0x0800 | ||
151 | |||
152 | #define BCSR_SYSTEM_POWEROFF 0x4000 | ||
153 | #define BCSR_SYSTEM_RESET 0x8000 | ||
154 | |||
155 | /* Bit positions for the different interrupt sources */ | ||
156 | #define BCSR_INT_IDE 0x0001 | ||
157 | #define BCSR_INT_ETH 0x0002 | ||
158 | #define BCSR_INT_PC0 0x0004 | ||
159 | #define BCSR_INT_PC0STSCHG 0x0008 | ||
160 | #define BCSR_INT_PC1 0x0010 | ||
161 | #define BCSR_INT_PC1STSCHG 0x0020 | ||
162 | #define BCSR_INT_DC 0x0040 | ||
163 | #define BCSR_INT_FLASHBUSY 0x0080 | ||
164 | #define BCSR_INT_PC0INSERT 0x0100 | ||
165 | #define BCSR_INT_PC0EJECT 0x0200 | ||
166 | #define BCSR_INT_PC1INSERT 0x0400 | ||
167 | #define BCSR_INT_PC1EJECT 0x0800 | ||
168 | #define BCSR_INT_SD0INSERT 0x1000 | ||
169 | #define BCSR_INT_SD0EJECT 0x2000 | ||
170 | |||
171 | #define SMC91C111_PHYS_ADDR 0x19000300 | ||
172 | #define SMC91C111_INT DB1200_ETH_INT | ||
173 | |||
174 | #define IDE_PHYS_ADDR 0x18800000 | ||
175 | #define IDE_REG_SHIFT 5 | ||
176 | #define IDE_PHYS_LEN (16 << IDE_REG_SHIFT) | ||
177 | #define IDE_INT DB1200_IDE_INT | ||
178 | #define IDE_DDMA_REQ DSCR_CMD0_DMA_REQ1 | ||
179 | #define IDE_RQSIZE 128 | ||
180 | |||
181 | #define NAND_PHYS_ADDR 0x20000000 | ||
182 | |||
183 | /* | ||
184 | * External Interrupts for DBAu1200 as of 8/6/2004. | ||
185 | * Bit positions in the CPLD registers can be calculated by taking | ||
186 | * the interrupt define and subtracting the DB1200_INT_BEGIN value. | ||
187 | * | ||
188 | * Example: IDE bis pos is = 64 - 64 | ||
189 | * ETH bit pos is = 65 - 64 | ||
190 | */ | ||
191 | enum external_pb1200_ints { | ||
192 | DB1200_INT_BEGIN = AU1000_MAX_INTR + 1, | ||
193 | |||
194 | DB1200_IDE_INT = DB1200_INT_BEGIN, | ||
195 | DB1200_ETH_INT, | ||
196 | DB1200_PC0_INT, | ||
197 | DB1200_PC0_STSCHG_INT, | ||
198 | DB1200_PC1_INT, | ||
199 | DB1200_PC1_STSCHG_INT, | ||
200 | DB1200_DC_INT, | ||
201 | DB1200_FLASHBUSY_INT, | ||
202 | DB1200_PC0_INSERT_INT, | ||
203 | DB1200_PC0_EJECT_INT, | ||
204 | DB1200_PC1_INSERT_INT, | ||
205 | DB1200_PC1_EJECT_INT, | ||
206 | DB1200_SD0_INSERT_INT, | ||
207 | DB1200_SD0_EJECT_INT, | ||
208 | |||
209 | DB1200_INT_END = DB1200_INT_BEGIN + 15, | ||
210 | }; | ||
211 | |||
212 | |||
213 | /* | ||
214 | * DBAu1200 specific PCMCIA defines for drivers/pcmcia/au1000_db1x00.c | ||
215 | */ | ||
216 | #define PCMCIA_MAX_SOCK 1 | ||
217 | #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) | ||
218 | |||
219 | /* VPP/VCC */ | ||
220 | #define SET_VCC_VPP(VCC, VPP, SLOT) \ | ||
221 | ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8)) | ||
222 | |||
223 | #define BOARD_PC0_INT DB1200_PC0_INT | ||
224 | #define BOARD_PC1_INT DB1200_PC1_INT | ||
225 | #define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1 << (8 + (2 * SOCKET))) | ||
226 | |||
227 | /* NAND chip select */ | ||
228 | #define NAND_CS 1 | ||
229 | |||
230 | #endif /* __ASM_DB1200_H */ | ||
diff --git a/include/asm-mips/mach-db1x00/db1x00.h b/include/asm-mips/mach-db1x00/db1x00.h deleted file mode 100644 index 1a515b8c870f..000000000000 --- a/include/asm-mips/mach-db1x00/db1x00.h +++ /dev/null | |||
@@ -1,179 +0,0 @@ | |||
1 | /* | ||
2 | * AMD Alchemy DBAu1x00 Reference Boards | ||
3 | * | ||
4 | * Copyright 2001, 2008 MontaVista Software Inc. | ||
5 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
6 | * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) | ||
7 | * | ||
8 | * ######################################################################## | ||
9 | * | ||
10 | * This program is free software; you can distribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License (Version 2) as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
17 | * for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
22 | * | ||
23 | * ######################################################################## | ||
24 | * | ||
25 | * | ||
26 | */ | ||
27 | #ifndef __ASM_DB1X00_H | ||
28 | #define __ASM_DB1X00_H | ||
29 | |||
30 | #include <asm/mach-au1x00/au1xxx_psc.h> | ||
31 | |||
32 | #ifdef CONFIG_MIPS_DB1550 | ||
33 | |||
34 | #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX | ||
35 | #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX | ||
36 | #define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX | ||
37 | #define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX | ||
38 | |||
39 | #define SPI_PSC_BASE PSC0_BASE_ADDR | ||
40 | #define AC97_PSC_BASE PSC1_BASE_ADDR | ||
41 | #define SMBUS_PSC_BASE PSC2_BASE_ADDR | ||
42 | #define I2S_PSC_BASE PSC3_BASE_ADDR | ||
43 | |||
44 | #define BCSR_KSEG1_ADDR 0xAF000000 | ||
45 | #define NAND_PHYS_ADDR 0x20000000 | ||
46 | |||
47 | #else | ||
48 | #define BCSR_KSEG1_ADDR 0xAE000000 | ||
49 | #endif | ||
50 | |||
51 | /* | ||
52 | * Overlay data structure of the DBAu1x00 board registers. | ||
53 | * Registers are located at physical 0E0000xx, KSEG1 0xAE0000xx. | ||
54 | */ | ||
55 | typedef volatile struct | ||
56 | { | ||
57 | /*00*/ unsigned short whoami; | ||
58 | unsigned short reserved0; | ||
59 | /*04*/ unsigned short status; | ||
60 | unsigned short reserved1; | ||
61 | /*08*/ unsigned short switches; | ||
62 | unsigned short reserved2; | ||
63 | /*0C*/ unsigned short resets; | ||
64 | unsigned short reserved3; | ||
65 | /*10*/ unsigned short pcmcia; | ||
66 | unsigned short reserved4; | ||
67 | /*14*/ unsigned short specific; | ||
68 | unsigned short reserved5; | ||
69 | /*18*/ unsigned short leds; | ||
70 | unsigned short reserved6; | ||
71 | /*1C*/ unsigned short swreset; | ||
72 | unsigned short reserved7; | ||
73 | |||
74 | } BCSR; | ||
75 | |||
76 | |||
77 | /* | ||
78 | * Register/mask bit definitions for the BCSRs | ||
79 | */ | ||
80 | #define BCSR_WHOAMI_DCID 0x000F | ||
81 | #define BCSR_WHOAMI_CPLD 0x00F0 | ||
82 | #define BCSR_WHOAMI_BOARD 0x0F00 | ||
83 | |||
84 | #define BCSR_STATUS_PC0VS 0x0003 | ||
85 | #define BCSR_STATUS_PC1VS 0x000C | ||
86 | #define BCSR_STATUS_PC0FI 0x0010 | ||
87 | #define BCSR_STATUS_PC1FI 0x0020 | ||
88 | #define BCSR_STATUS_FLASHBUSY 0x0100 | ||
89 | #define BCSR_STATUS_ROMBUSY 0x0400 | ||
90 | #define BCSR_STATUS_SWAPBOOT 0x2000 | ||
91 | #define BCSR_STATUS_FLASHDEN 0xC000 | ||
92 | |||
93 | #define BCSR_SWITCHES_DIP 0x00FF | ||
94 | #define BCSR_SWITCHES_DIP_1 0x0080 | ||
95 | #define BCSR_SWITCHES_DIP_2 0x0040 | ||
96 | #define BCSR_SWITCHES_DIP_3 0x0020 | ||
97 | #define BCSR_SWITCHES_DIP_4 0x0010 | ||
98 | #define BCSR_SWITCHES_DIP_5 0x0008 | ||
99 | #define BCSR_SWITCHES_DIP_6 0x0004 | ||
100 | #define BCSR_SWITCHES_DIP_7 0x0002 | ||
101 | #define BCSR_SWITCHES_DIP_8 0x0001 | ||
102 | #define BCSR_SWITCHES_ROTARY 0x0F00 | ||
103 | |||
104 | #define BCSR_RESETS_PHY0 0x0001 | ||
105 | #define BCSR_RESETS_PHY1 0x0002 | ||
106 | #define BCSR_RESETS_DC 0x0004 | ||
107 | #define BCSR_RESETS_FIR_SEL 0x2000 | ||
108 | #define BCSR_RESETS_IRDA_MODE_MASK 0xC000 | ||
109 | #define BCSR_RESETS_IRDA_MODE_FULL 0x0000 | ||
110 | #define BCSR_RESETS_IRDA_MODE_OFF 0x4000 | ||
111 | #define BCSR_RESETS_IRDA_MODE_2_3 0x8000 | ||
112 | #define BCSR_RESETS_IRDA_MODE_1_3 0xC000 | ||
113 | |||
114 | #define BCSR_PCMCIA_PC0VPP 0x0003 | ||
115 | #define BCSR_PCMCIA_PC0VCC 0x000C | ||
116 | #define BCSR_PCMCIA_PC0DRVEN 0x0010 | ||
117 | #define BCSR_PCMCIA_PC0RST 0x0080 | ||
118 | #define BCSR_PCMCIA_PC1VPP 0x0300 | ||
119 | #define BCSR_PCMCIA_PC1VCC 0x0C00 | ||
120 | #define BCSR_PCMCIA_PC1DRVEN 0x1000 | ||
121 | #define BCSR_PCMCIA_PC1RST 0x8000 | ||
122 | |||
123 | #define BCSR_BOARD_PCIM66EN 0x0001 | ||
124 | #define BCSR_BOARD_SD0_PWR 0x0040 | ||
125 | #define BCSR_BOARD_SD1_PWR 0x0080 | ||
126 | #define BCSR_BOARD_PCIM33 0x0100 | ||
127 | #define BCSR_BOARD_GPIO200RST 0x0400 | ||
128 | #define BCSR_BOARD_PCICFG 0x1000 | ||
129 | #define BCSR_BOARD_SD0_WP 0x4000 | ||
130 | #define BCSR_BOARD_SD1_WP 0x8000 | ||
131 | |||
132 | #define BCSR_LEDS_DECIMALS 0x0003 | ||
133 | #define BCSR_LEDS_LED0 0x0100 | ||
134 | #define BCSR_LEDS_LED1 0x0200 | ||
135 | #define BCSR_LEDS_LED2 0x0400 | ||
136 | #define BCSR_LEDS_LED3 0x0800 | ||
137 | |||
138 | #define BCSR_SWRESET_RESET 0x0080 | ||
139 | |||
140 | /* PCMCIA DBAu1x00 specific defines */ | ||
141 | #define PCMCIA_MAX_SOCK 1 | ||
142 | #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) | ||
143 | |||
144 | /* VPP/VCC */ | ||
145 | #define SET_VCC_VPP(VCC, VPP, SLOT)\ | ||
146 | ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8)) | ||
147 | |||
148 | /* | ||
149 | * NAND defines | ||
150 | * | ||
151 | * Timing values as described in databook, * ns value stripped of the | ||
152 | * lower 2 bits. | ||
153 | * These defines are here rather than an Au1550 generic file because | ||
154 | * the parts chosen on another board may be different and may require | ||
155 | * different timings. | ||
156 | */ | ||
157 | #define NAND_T_H (18 >> 2) | ||
158 | #define NAND_T_PUL (30 >> 2) | ||
159 | #define NAND_T_SU (30 >> 2) | ||
160 | #define NAND_T_WH (30 >> 2) | ||
161 | |||
162 | /* Bitfield shift amounts */ | ||
163 | #define NAND_T_H_SHIFT 0 | ||
164 | #define NAND_T_PUL_SHIFT 4 | ||
165 | #define NAND_T_SU_SHIFT 8 | ||
166 | #define NAND_T_WH_SHIFT 12 | ||
167 | |||
168 | #define NAND_TIMING (((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \ | ||
169 | ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \ | ||
170 | ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \ | ||
171 | ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)) | ||
172 | #define NAND_CS 1 | ||
173 | |||
174 | /* Should be done by YAMON */ | ||
175 | #define NAND_STCFG 0x00400005 /* 8-bit NAND */ | ||
176 | #define NAND_STTIME 0x00007774 /* valid for 396 MHz SD=2 only */ | ||
177 | #define NAND_STADDR 0x12000FFF /* physical address 0x20000000 */ | ||
178 | |||
179 | #endif /* __ASM_DB1X00_H */ | ||
diff --git a/include/asm-mips/mach-dec/mc146818rtc.h b/include/asm-mips/mach-dec/mc146818rtc.h deleted file mode 100644 index 6724e99e43e1..000000000000 --- a/include/asm-mips/mach-dec/mc146818rtc.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * RTC definitions for DECstation style attached Dallas DS1287 chip. | ||
3 | * | ||
4 | * Copyright (C) 1998, 2001 by Ralf Baechle | ||
5 | * Copyright (C) 1998 by Harald Koerfgen | ||
6 | * Copyright (C) 2002, 2005 Maciej W. Rozycki | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | #ifndef __ASM_MIPS_DEC_RTC_DEC_H | ||
14 | #define __ASM_MIPS_DEC_RTC_DEC_H | ||
15 | |||
16 | #include <linux/types.h> | ||
17 | #include <asm/addrspace.h> | ||
18 | #include <asm/dec/system.h> | ||
19 | |||
20 | extern volatile u8 *dec_rtc_base; | ||
21 | |||
22 | #define ARCH_RTC_LOCATION | ||
23 | |||
24 | #define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base) | ||
25 | #define RTC_IO_EXTENT dec_kn_slot_size | ||
26 | #define RTC_IOMAPPED 0 | ||
27 | #undef RTC_IRQ | ||
28 | |||
29 | #define RTC_DEC_YEAR 0x3f /* Where we store the real year on DECs. */ | ||
30 | |||
31 | static inline unsigned char CMOS_READ(unsigned long addr) | ||
32 | { | ||
33 | return dec_rtc_base[addr * 4]; | ||
34 | } | ||
35 | |||
36 | static inline void CMOS_WRITE(unsigned char data, unsigned long addr) | ||
37 | { | ||
38 | dec_rtc_base[addr * 4] = data; | ||
39 | } | ||
40 | |||
41 | #define RTC_ALWAYS_BCD 0 | ||
42 | |||
43 | #endif /* __ASM_MIPS_DEC_RTC_DEC_H */ | ||
diff --git a/include/asm-mips/mach-dec/war.h b/include/asm-mips/mach-dec/war.h deleted file mode 100644 index ca5e2ef909ad..000000000000 --- a/include/asm-mips/mach-dec/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_DEC_WAR_H | ||
9 | #define __ASM_MIPS_MACH_DEC_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_DEC_WAR_H */ | ||
diff --git a/include/asm-mips/mach-emma2rh/irq.h b/include/asm-mips/mach-emma2rh/irq.h deleted file mode 100644 index 5439eb856461..000000000000 --- a/include/asm-mips/mach-emma2rh/irq.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_EMMA2RH_IRQ_H | ||
9 | #define __ASM_MACH_EMMA2RH_IRQ_H | ||
10 | |||
11 | #define NR_IRQS 256 | ||
12 | |||
13 | #include_next <irq.h> | ||
14 | |||
15 | #endif /* __ASM_MACH_EMMA2RH_IRQ_H */ | ||
diff --git a/include/asm-mips/mach-emma2rh/war.h b/include/asm-mips/mach-emma2rh/war.h deleted file mode 100644 index b660a4c30e6a..000000000000 --- a/include/asm-mips/mach-emma2rh/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_EMMA2RH_WAR_H | ||
9 | #define __ASM_MIPS_MACH_EMMA2RH_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_EMMA2RH_WAR_H */ | ||
diff --git a/include/asm-mips/mach-excite/cpu-feature-overrides.h b/include/asm-mips/mach-excite/cpu-feature-overrides.h deleted file mode 100644 index 107104c3cd12..000000000000 --- a/include/asm-mips/mach-excite/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004 Thomas Koeller <thomas.koeller@baslerweb.com> | ||
7 | * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org) | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H | ||
10 | #define __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H | ||
11 | |||
12 | /* | ||
13 | * Basler eXcite has an RM9122 processor. | ||
14 | */ | ||
15 | #define cpu_has_watch 1 | ||
16 | #define cpu_has_mips16 0 | ||
17 | #define cpu_has_divec 0 | ||
18 | #define cpu_has_vce 0 | ||
19 | #define cpu_has_cache_cdex_p 0 | ||
20 | #define cpu_has_cache_cdex_s 0 | ||
21 | #define cpu_has_prefetch 1 | ||
22 | #define cpu_has_mcheck 0 | ||
23 | #define cpu_has_ejtag 0 | ||
24 | |||
25 | #define cpu_has_llsc 1 | ||
26 | #define cpu_has_vtag_icache 0 | ||
27 | #define cpu_has_dc_aliases 0 | ||
28 | #define cpu_has_ic_fills_f_dc 0 | ||
29 | #define cpu_has_dsp 0 | ||
30 | #define cpu_icache_snoops_remote_store 0 | ||
31 | #define cpu_has_mipsmt 0 | ||
32 | #define cpu_has_userlocal 0 | ||
33 | |||
34 | #define cpu_has_nofpuex 0 | ||
35 | #define cpu_has_64bits 1 | ||
36 | |||
37 | #define cpu_has_mips32r1 0 | ||
38 | #define cpu_has_mips32r2 0 | ||
39 | #define cpu_has_mips64r1 0 | ||
40 | #define cpu_has_mips64r2 0 | ||
41 | |||
42 | #define cpu_has_inclusive_pcaches 0 | ||
43 | |||
44 | #define cpu_dcache_line_size() 32 | ||
45 | #define cpu_icache_line_size() 32 | ||
46 | #define cpu_scache_line_size() 32 | ||
47 | |||
48 | #endif /* __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-excite/excite.h b/include/asm-mips/mach-excite/excite.h deleted file mode 100644 index 4c29ba44992c..000000000000 --- a/include/asm-mips/mach-excite/excite.h +++ /dev/null | |||
@@ -1,154 +0,0 @@ | |||
1 | #ifndef __EXCITE_H__ | ||
2 | #define __EXCITE_H__ | ||
3 | |||
4 | #include <linux/init.h> | ||
5 | #include <asm/addrspace.h> | ||
6 | #include <asm/types.h> | ||
7 | |||
8 | #define EXCITE_CPU_EXT_CLOCK 100000000 | ||
9 | |||
10 | #if !defined(__ASSEMBLY__) | ||
11 | void __init excite_kgdb_init(void); | ||
12 | void excite_procfs_init(void); | ||
13 | extern unsigned long memsize; | ||
14 | extern char modetty[]; | ||
15 | extern u32 unit_id; | ||
16 | #endif | ||
17 | |||
18 | /* Base name for XICAP devices */ | ||
19 | #define XICAP_NAME "xicap_gpi" | ||
20 | |||
21 | /* OCD register offsets */ | ||
22 | #define LKB0 0x0038 | ||
23 | #define LKB5 0x0128 | ||
24 | #define LKM5 0x012C | ||
25 | #define LKB7 0x0138 | ||
26 | #define LKM7 0x013c | ||
27 | #define LKB8 0x0140 | ||
28 | #define LKM8 0x0144 | ||
29 | #define LKB9 0x0148 | ||
30 | #define LKM9 0x014c | ||
31 | #define LKB10 0x0150 | ||
32 | #define LKM10 0x0154 | ||
33 | #define LKB11 0x0158 | ||
34 | #define LKM11 0x015c | ||
35 | #define LKB12 0x0160 | ||
36 | #define LKM12 0x0164 | ||
37 | #define LKB13 0x0168 | ||
38 | #define LKM13 0x016c | ||
39 | #define LDP0 0x0200 | ||
40 | #define LDP1 0x0210 | ||
41 | #define LDP2 0x0220 | ||
42 | #define LDP3 0x0230 | ||
43 | #define INTPIN0 0x0A40 | ||
44 | #define INTPIN1 0x0A44 | ||
45 | #define INTPIN2 0x0A48 | ||
46 | #define INTPIN3 0x0A4C | ||
47 | #define INTPIN4 0x0A50 | ||
48 | #define INTPIN5 0x0A54 | ||
49 | #define INTPIN6 0x0A58 | ||
50 | #define INTPIN7 0x0A5C | ||
51 | |||
52 | |||
53 | |||
54 | |||
55 | /* TITAN register offsets */ | ||
56 | #define CPRR 0x0004 | ||
57 | #define CPDSR 0x0008 | ||
58 | #define CPTC0R 0x000c | ||
59 | #define CPTC1R 0x0010 | ||
60 | #define CPCFG0 0x0020 | ||
61 | #define CPCFG1 0x0024 | ||
62 | #define CPDST0A 0x0028 | ||
63 | #define CPDST0B 0x002c | ||
64 | #define CPDST1A 0x0030 | ||
65 | #define CPDST1B 0x0034 | ||
66 | #define CPXDSTA 0x0038 | ||
67 | #define CPXDSTB 0x003c | ||
68 | #define CPXCISRA 0x0048 | ||
69 | #define CPXCISRB 0x004c | ||
70 | #define CPGIG0ER 0x0050 | ||
71 | #define CPGIG1ER 0x0054 | ||
72 | #define CPGRWL 0x0068 | ||
73 | #define CPURSLMT 0x00f8 | ||
74 | #define UACFG 0x0200 | ||
75 | #define UAINTS 0x0204 | ||
76 | #define SDRXFCIE 0x4828 | ||
77 | #define SDTXFCIE 0x4928 | ||
78 | #define INTP0Status0 0x1B00 | ||
79 | #define INTP0Mask0 0x1B04 | ||
80 | #define INTP0Set0 0x1B08 | ||
81 | #define INTP0Clear0 0x1B0C | ||
82 | #define GXCFG 0x5000 | ||
83 | #define GXDMADRPFX 0x5018 | ||
84 | #define GXDMA_DESCADR 0x501c | ||
85 | #define GXCH0TDESSTRT 0x5054 | ||
86 | |||
87 | /* IRQ definitions */ | ||
88 | #define NMICONFIG 0xac0 | ||
89 | #define TITAN_MSGINT 0xc4 | ||
90 | #define TITAN_IRQ ((TITAN_MSGINT / 0x20) + 2) | ||
91 | #define FPGA0_MSGINT 0x5a | ||
92 | #define FPGA0_IRQ ((FPGA0_MSGINT / 0x20) + 2) | ||
93 | #define FPGA1_MSGINT 0x7b | ||
94 | #define FPGA1_IRQ ((FPGA1_MSGINT / 0x20) + 2) | ||
95 | #define PHY_MSGINT 0x9c | ||
96 | #define PHY_IRQ ((PHY_MSGINT / 0x20) + 2) | ||
97 | |||
98 | #if defined(CONFIG_BASLER_EXCITE_PROTOTYPE) | ||
99 | /* Pre-release units used interrupt pin #9 */ | ||
100 | #define USB_IRQ 11 | ||
101 | #else | ||
102 | /* Re-designed units use interrupt pin #1 */ | ||
103 | #define USB_MSGINT 0x39 | ||
104 | #define USB_IRQ ((USB_MSGINT / 0x20) + 2) | ||
105 | #endif | ||
106 | #define TIMER_IRQ 12 | ||
107 | |||
108 | |||
109 | /* Device address ranges */ | ||
110 | #define EXCITE_OFFS_OCD 0x1fffc000 | ||
111 | #define EXCITE_SIZE_OCD (16 * 1024) | ||
112 | #define EXCITE_PHYS_OCD CPHYSADDR(EXCITE_OFFS_OCD) | ||
113 | #define EXCITE_ADDR_OCD CKSEG1ADDR(EXCITE_OFFS_OCD) | ||
114 | |||
115 | #define EXCITE_OFFS_SCRAM 0x1fffa000 | ||
116 | #define EXCITE_SIZE_SCRAM (8 << 10) | ||
117 | #define EXCITE_PHYS_SCRAM CPHYSADDR(EXCITE_OFFS_SCRAM) | ||
118 | #define EXCITE_ADDR_SCRAM CKSEG1ADDR(EXCITE_OFFS_SCRAM) | ||
119 | |||
120 | #define EXCITE_OFFS_PCI_IO 0x1fff8000 | ||
121 | #define EXCITE_SIZE_PCI_IO (8 << 10) | ||
122 | #define EXCITE_PHYS_PCI_IO CPHYSADDR(EXCITE_OFFS_PCI_IO) | ||
123 | #define EXCITE_ADDR_PCI_IO CKSEG1ADDR(EXCITE_OFFS_PCI_IO) | ||
124 | |||
125 | #define EXCITE_OFFS_TITAN 0x1fff0000 | ||
126 | #define EXCITE_SIZE_TITAN (32 << 10) | ||
127 | #define EXCITE_PHYS_TITAN CPHYSADDR(EXCITE_OFFS_TITAN) | ||
128 | #define EXCITE_ADDR_TITAN CKSEG1ADDR(EXCITE_OFFS_TITAN) | ||
129 | |||
130 | #define EXCITE_OFFS_PCI_MEM 0x1ffe0000 | ||
131 | #define EXCITE_SIZE_PCI_MEM (64 << 10) | ||
132 | #define EXCITE_PHYS_PCI_MEM CPHYSADDR(EXCITE_OFFS_PCI_MEM) | ||
133 | #define EXCITE_ADDR_PCI_MEM CKSEG1ADDR(EXCITE_OFFS_PCI_MEM) | ||
134 | |||
135 | #define EXCITE_OFFS_FPGA 0x1ffdc000 | ||
136 | #define EXCITE_SIZE_FPGA (16 << 10) | ||
137 | #define EXCITE_PHYS_FPGA CPHYSADDR(EXCITE_OFFS_FPGA) | ||
138 | #define EXCITE_ADDR_FPGA CKSEG1ADDR(EXCITE_OFFS_FPGA) | ||
139 | |||
140 | #define EXCITE_OFFS_NAND 0x1ffd8000 | ||
141 | #define EXCITE_SIZE_NAND (16 << 10) | ||
142 | #define EXCITE_PHYS_NAND CPHYSADDR(EXCITE_OFFS_NAND) | ||
143 | #define EXCITE_ADDR_NAND CKSEG1ADDR(EXCITE_OFFS_NAND) | ||
144 | |||
145 | #define EXCITE_OFFS_BOOTROM 0x1f000000 | ||
146 | #define EXCITE_SIZE_BOOTROM (8 << 20) | ||
147 | #define EXCITE_PHYS_BOOTROM CPHYSADDR(EXCITE_OFFS_BOOTROM) | ||
148 | #define EXCITE_ADDR_BOOTROM CKSEG1ADDR(EXCITE_OFFS_BOOTROM) | ||
149 | |||
150 | /* FPGA address offsets */ | ||
151 | #define EXCITE_FPGA_DPR 0x0104 /* dual-ported ram */ | ||
152 | #define EXCITE_FPGA_SYSCTL 0x0200 /* system control register block */ | ||
153 | |||
154 | #endif /* __EXCITE_H__ */ | ||
diff --git a/include/asm-mips/mach-excite/excite_fpga.h b/include/asm-mips/mach-excite/excite_fpga.h deleted file mode 100644 index 0a1ef69bece7..000000000000 --- a/include/asm-mips/mach-excite/excite_fpga.h +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | #ifndef EXCITE_FPGA_H_INCLUDED | ||
2 | #define EXCITE_FPGA_H_INCLUDED | ||
3 | |||
4 | |||
5 | /** | ||
6 | * Address alignment of the individual FPGA bytes. | ||
7 | * The address arrangement of the individual bytes of the FPGA is two | ||
8 | * byte aligned at the embedded MK2 platform. | ||
9 | */ | ||
10 | #ifdef EXCITE_CCI_FPGA_MK2 | ||
11 | typedef unsigned char excite_cci_fpga_align_t __attribute__ ((aligned(2))); | ||
12 | #else | ||
13 | typedef unsigned char excite_cci_fpga_align_t; | ||
14 | #endif | ||
15 | |||
16 | |||
17 | /** | ||
18 | * Size of Dual Ported RAM. | ||
19 | */ | ||
20 | #define EXCITE_DPR_SIZE 263 | ||
21 | |||
22 | |||
23 | /** | ||
24 | * Size of Reserved Status Fields in Dual Ported RAM. | ||
25 | */ | ||
26 | #define EXCITE_DPR_STATUS_SIZE 7 | ||
27 | |||
28 | |||
29 | |||
30 | /** | ||
31 | * FPGA. | ||
32 | * Hardware register layout of the FPGA interface. The FPGA must accessed | ||
33 | * byte wise solely. | ||
34 | * @see EXCITE_CCI_DPR_MK2 | ||
35 | */ | ||
36 | typedef struct excite_fpga { | ||
37 | |||
38 | /** | ||
39 | * Dual Ported RAM. | ||
40 | */ | ||
41 | excite_cci_fpga_align_t dpr[EXCITE_DPR_SIZE]; | ||
42 | |||
43 | /** | ||
44 | * Status. | ||
45 | */ | ||
46 | excite_cci_fpga_align_t status[EXCITE_DPR_STATUS_SIZE]; | ||
47 | |||
48 | #ifdef EXCITE_CCI_FPGA_MK2 | ||
49 | /** | ||
50 | * RM9000 Interrupt. | ||
51 | * Write access initiates interrupt at the RM9000 (MIPS) processor of the eXcite. | ||
52 | */ | ||
53 | excite_cci_fpga_align_t rm9k_int; | ||
54 | #else | ||
55 | /** | ||
56 | * MK2 Interrupt. | ||
57 | * Write access initiates interrupt at the ARM processor of the MK2. | ||
58 | */ | ||
59 | excite_cci_fpga_align_t mk2_int; | ||
60 | |||
61 | excite_cci_fpga_align_t gap[0x1000-0x10f]; | ||
62 | |||
63 | /** | ||
64 | * IRQ Source/Acknowledge. | ||
65 | */ | ||
66 | excite_cci_fpga_align_t rm9k_irq_src; | ||
67 | |||
68 | /** | ||
69 | * IRQ Mask. | ||
70 | * Set bits enable the related interrupt. | ||
71 | */ | ||
72 | excite_cci_fpga_align_t rm9k_irq_mask; | ||
73 | #endif | ||
74 | |||
75 | |||
76 | } excite_fpga; | ||
77 | |||
78 | |||
79 | |||
80 | #endif /* ndef EXCITE_FPGA_H_INCLUDED */ | ||
diff --git a/include/asm-mips/mach-excite/excite_nandflash.h b/include/asm-mips/mach-excite/excite_nandflash.h deleted file mode 100644 index c4cf6140622e..000000000000 --- a/include/asm-mips/mach-excite/excite_nandflash.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __EXCITE_NANDFLASH_H__ | ||
2 | #define __EXCITE_NANDFLASH_H__ | ||
3 | |||
4 | /* Resource names */ | ||
5 | #define EXCITE_NANDFLASH_RESOURCE_REGS "excite_nandflash_regs" | ||
6 | |||
7 | #endif /* __EXCITE_NANDFLASH_H__ */ | ||
diff --git a/include/asm-mips/mach-excite/rm9k_eth.h b/include/asm-mips/mach-excite/rm9k_eth.h deleted file mode 100644 index 94705a46f72e..000000000000 --- a/include/asm-mips/mach-excite/rm9k_eth.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #if !defined(__RM9K_ETH_H__) | ||
2 | #define __RM9K_ETH_H__ | ||
3 | |||
4 | #define RM9K_GE_NAME "rm9k_ge" | ||
5 | |||
6 | /* Resource names */ | ||
7 | #define RM9K_GE_RESOURCE_MAC "rm9k_ge_mac" | ||
8 | #define RM9K_GE_RESOURCE_MSTAT "rm9k_ge_mstat" | ||
9 | #define RM9K_GE_RESOURCE_PKTPROC "rm9k_ge_pktproc" | ||
10 | #define RM9K_GE_RESOURCE_XDMA "rm9k_ge_xdma" | ||
11 | #define RM9K_GE_RESOURCE_FIFO_RX "rm9k_ge_fifo_rx" | ||
12 | #define RM9K_GE_RESOURCE_FIFO_TX "rm9k_ge_fifo_tx" | ||
13 | #define RM9K_GE_RESOURCE_FIFOMEM_RX "rm9k_ge_fifo_memory_rx" | ||
14 | #define RM9K_GE_RESOURCE_FIFOMEM_TX "rm9k_ge_fifo_memory_tx" | ||
15 | #define RM9K_GE_RESOURCE_PHY "rm9k_ge_phy" | ||
16 | #define RM9K_GE_RESOURCE_DMADESC_RX "rm9k_ge_dmadesc_rx" | ||
17 | #define RM9K_GE_RESOURCE_DMADESC_TX "rm9k_ge_dmadesc_tx" | ||
18 | #define RM9K_GE_RESOURCE_IRQ_MAIN "rm9k_ge_irq_main" | ||
19 | #define RM9K_GE_RESOURCE_IRQ_PHY "rm9k_ge_irq_phy" | ||
20 | #define RM9K_GE_RESOURCE_GPI_SLICE "rm9k_ge_gpi_slice" | ||
21 | #define RM9K_GE_RESOURCE_MDIO_CHANNEL "rm9k_ge_mdio_channel" | ||
22 | |||
23 | #endif /* !defined(__RM9K_ETH_H__) */ | ||
diff --git a/include/asm-mips/mach-excite/rm9k_wdt.h b/include/asm-mips/mach-excite/rm9k_wdt.h deleted file mode 100644 index 3fa3c08d2da7..000000000000 --- a/include/asm-mips/mach-excite/rm9k_wdt.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef __RM9K_WDT_H__ | ||
2 | #define __RM9K_WDT_H__ | ||
3 | |||
4 | /* Device name */ | ||
5 | #define WDT_NAME "wdt_gpi" | ||
6 | |||
7 | /* Resource names */ | ||
8 | #define WDT_RESOURCE_REGS "excite_watchdog_regs" | ||
9 | #define WDT_RESOURCE_IRQ "excite_watchdog_irq" | ||
10 | #define WDT_RESOURCE_COUNTER "excite_watchdog_counter" | ||
11 | |||
12 | #endif /* __RM9K_WDT_H__ */ | ||
diff --git a/include/asm-mips/mach-excite/rm9k_xicap.h b/include/asm-mips/mach-excite/rm9k_xicap.h deleted file mode 100644 index 009577734a8d..000000000000 --- a/include/asm-mips/mach-excite/rm9k_xicap.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef __EXCITE_XICAP_H__ | ||
2 | #define __EXCITE_XICAP_H__ | ||
3 | |||
4 | |||
5 | /* Resource names */ | ||
6 | #define XICAP_RESOURCE_FIFO_RX "xicap_fifo_rx" | ||
7 | #define XICAP_RESOURCE_FIFO_TX "xicap_fifo_tx" | ||
8 | #define XICAP_RESOURCE_XDMA "xicap_xdma" | ||
9 | #define XICAP_RESOURCE_DMADESC "xicap_dmadesc" | ||
10 | #define XICAP_RESOURCE_PKTPROC "xicap_pktproc" | ||
11 | #define XICAP_RESOURCE_IRQ "xicap_irq" | ||
12 | #define XICAP_RESOURCE_GPI_SLICE "xicap_gpi_slice" | ||
13 | #define XICAP_RESOURCE_FIFO_BLK "xicap_fifo_blocks" | ||
14 | #define XICAP_RESOURCE_PKT_STREAM "xicap_pkt_stream" | ||
15 | |||
16 | #endif /* __EXCITE_XICAP_H__ */ | ||
diff --git a/include/asm-mips/mach-excite/war.h b/include/asm-mips/mach-excite/war.h deleted file mode 100644 index 1f82180c1598..000000000000 --- a/include/asm-mips/mach-excite/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_EXCITE_WAR_H | ||
9 | #define __ASM_MIPS_MACH_EXCITE_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 1 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 1 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_EXCITE_WAR_H */ | ||
diff --git a/include/asm-mips/mach-generic/cpu-feature-overrides.h b/include/asm-mips/mach-generic/cpu-feature-overrides.h deleted file mode 100644 index 7c185bb06f13..000000000000 --- a/include/asm-mips/mach-generic/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H | ||
9 | #define __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H | ||
10 | |||
11 | /* Intentionally empty file ... */ | ||
12 | |||
13 | #endif /* __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-generic/dma-coherence.h b/include/asm-mips/mach-generic/dma-coherence.h deleted file mode 100644 index 76e04e7feb84..000000000000 --- a/include/asm-mips/mach-generic/dma-coherence.h +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org> | ||
7 | * | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H | ||
10 | #define __ASM_MACH_GENERIC_DMA_COHERENCE_H | ||
11 | |||
12 | struct device; | ||
13 | |||
14 | static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, | ||
15 | size_t size) | ||
16 | { | ||
17 | return virt_to_phys(addr); | ||
18 | } | ||
19 | |||
20 | static inline dma_addr_t plat_map_dma_mem_page(struct device *dev, | ||
21 | struct page *page) | ||
22 | { | ||
23 | return page_to_phys(page); | ||
24 | } | ||
25 | |||
26 | static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | ||
27 | { | ||
28 | return dma_addr; | ||
29 | } | ||
30 | |||
31 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) | ||
32 | { | ||
33 | } | ||
34 | |||
35 | static inline int plat_device_is_coherent(struct device *dev) | ||
36 | { | ||
37 | #ifdef CONFIG_DMA_COHERENT | ||
38 | return 1; | ||
39 | #endif | ||
40 | #ifdef CONFIG_DMA_NONCOHERENT | ||
41 | return 0; | ||
42 | #endif | ||
43 | } | ||
44 | |||
45 | #endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */ | ||
diff --git a/include/asm-mips/mach-generic/floppy.h b/include/asm-mips/mach-generic/floppy.h deleted file mode 100644 index 001a8ce17c17..000000000000 --- a/include/asm-mips/mach-generic/floppy.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 1997, 1998, 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_GENERIC_FLOPPY_H | ||
9 | #define __ASM_MACH_GENERIC_FLOPPY_H | ||
10 | |||
11 | #include <linux/delay.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/ioport.h> | ||
14 | #include <linux/sched.h> | ||
15 | #include <linux/linkage.h> | ||
16 | #include <linux/types.h> | ||
17 | #include <linux/mm.h> | ||
18 | |||
19 | #include <asm/bootinfo.h> | ||
20 | #include <asm/cachectl.h> | ||
21 | #include <asm/dma.h> | ||
22 | #include <asm/floppy.h> | ||
23 | #include <asm/io.h> | ||
24 | #include <asm/irq.h> | ||
25 | #include <asm/pgtable.h> | ||
26 | |||
27 | /* | ||
28 | * How to access the FDC's registers. | ||
29 | */ | ||
30 | static inline unsigned char fd_inb(unsigned int port) | ||
31 | { | ||
32 | return inb_p(port); | ||
33 | } | ||
34 | |||
35 | static inline void fd_outb(unsigned char value, unsigned int port) | ||
36 | { | ||
37 | outb_p(value, port); | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | * How to access the floppy DMA functions. | ||
42 | */ | ||
43 | static inline void fd_enable_dma(void) | ||
44 | { | ||
45 | enable_dma(FLOPPY_DMA); | ||
46 | } | ||
47 | |||
48 | static inline void fd_disable_dma(void) | ||
49 | { | ||
50 | disable_dma(FLOPPY_DMA); | ||
51 | } | ||
52 | |||
53 | static inline int fd_request_dma(void) | ||
54 | { | ||
55 | return request_dma(FLOPPY_DMA, "floppy"); | ||
56 | } | ||
57 | |||
58 | static inline void fd_free_dma(void) | ||
59 | { | ||
60 | free_dma(FLOPPY_DMA); | ||
61 | } | ||
62 | |||
63 | static inline void fd_clear_dma_ff(void) | ||
64 | { | ||
65 | clear_dma_ff(FLOPPY_DMA); | ||
66 | } | ||
67 | |||
68 | static inline void fd_set_dma_mode(char mode) | ||
69 | { | ||
70 | set_dma_mode(FLOPPY_DMA, mode); | ||
71 | } | ||
72 | |||
73 | static inline void fd_set_dma_addr(char *addr) | ||
74 | { | ||
75 | set_dma_addr(FLOPPY_DMA, (unsigned long) addr); | ||
76 | } | ||
77 | |||
78 | static inline void fd_set_dma_count(unsigned int count) | ||
79 | { | ||
80 | set_dma_count(FLOPPY_DMA, count); | ||
81 | } | ||
82 | |||
83 | static inline int fd_get_dma_residue(void) | ||
84 | { | ||
85 | return get_dma_residue(FLOPPY_DMA); | ||
86 | } | ||
87 | |||
88 | static inline void fd_enable_irq(void) | ||
89 | { | ||
90 | enable_irq(FLOPPY_IRQ); | ||
91 | } | ||
92 | |||
93 | static inline void fd_disable_irq(void) | ||
94 | { | ||
95 | disable_irq(FLOPPY_IRQ); | ||
96 | } | ||
97 | |||
98 | static inline int fd_request_irq(void) | ||
99 | { | ||
100 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | ||
101 | IRQF_DISABLED, "floppy", NULL); | ||
102 | } | ||
103 | |||
104 | static inline void fd_free_irq(void) | ||
105 | { | ||
106 | free_irq(FLOPPY_IRQ, NULL); | ||
107 | } | ||
108 | |||
109 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); | ||
110 | |||
111 | |||
112 | static inline unsigned long fd_getfdaddr1(void) | ||
113 | { | ||
114 | return 0x3f0; | ||
115 | } | ||
116 | |||
117 | static inline unsigned long fd_dma_mem_alloc(unsigned long size) | ||
118 | { | ||
119 | unsigned long mem; | ||
120 | |||
121 | mem = __get_dma_pages(GFP_KERNEL, get_order(size)); | ||
122 | |||
123 | return mem; | ||
124 | } | ||
125 | |||
126 | static inline void fd_dma_mem_free(unsigned long addr, unsigned long size) | ||
127 | { | ||
128 | free_pages(addr, get_order(size)); | ||
129 | } | ||
130 | |||
131 | static inline unsigned long fd_drive_type(unsigned long n) | ||
132 | { | ||
133 | if (n == 0) | ||
134 | return 4; /* 3,5", 1.44mb */ | ||
135 | |||
136 | return 0; | ||
137 | } | ||
138 | |||
139 | #endif /* __ASM_MACH_GENERIC_FLOPPY_H */ | ||
diff --git a/include/asm-mips/mach-generic/gpio.h b/include/asm-mips/mach-generic/gpio.h deleted file mode 100644 index b4e70208da64..000000000000 --- a/include/asm-mips/mach-generic/gpio.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_GENERIC_GPIO_H | ||
2 | #define __ASM_MACH_GENERIC_GPIO_H | ||
3 | |||
4 | #ifdef CONFIG_GPIOLIB | ||
5 | #define gpio_get_value __gpio_get_value | ||
6 | #define gpio_set_value __gpio_set_value | ||
7 | #define gpio_cansleep __gpio_cansleep | ||
8 | #else | ||
9 | int gpio_request(unsigned gpio, const char *label); | ||
10 | void gpio_free(unsigned gpio); | ||
11 | int gpio_direction_input(unsigned gpio); | ||
12 | int gpio_direction_output(unsigned gpio, int value); | ||
13 | int gpio_get_value(unsigned gpio); | ||
14 | void gpio_set_value(unsigned gpio, int value); | ||
15 | #endif | ||
16 | int gpio_to_irq(unsigned gpio); | ||
17 | int irq_to_gpio(unsigned irq); | ||
18 | |||
19 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
20 | |||
21 | #endif /* __ASM_MACH_GENERIC_GPIO_H */ | ||
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h deleted file mode 100644 index 73008f7bdc93..000000000000 --- a/include/asm-mips/mach-generic/ide.h +++ /dev/null | |||
@@ -1,167 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994-1996 Linus Torvalds & authors | ||
7 | * | ||
8 | * Copied from i386; many of the especially older MIPS or ISA-based platforms | ||
9 | * are basically identical. Using this file probably implies i8259 PIC | ||
10 | * support in a system but the very least interrupt numbers 0 - 15 need to | ||
11 | * be put aside for legacy devices. | ||
12 | */ | ||
13 | #ifndef __ASM_MACH_GENERIC_IDE_H | ||
14 | #define __ASM_MACH_GENERIC_IDE_H | ||
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | |||
18 | #include <linux/pci.h> | ||
19 | #include <linux/stddef.h> | ||
20 | #include <asm/processor.h> | ||
21 | |||
22 | static __inline__ int ide_probe_legacy(void) | ||
23 | { | ||
24 | #ifdef CONFIG_PCI | ||
25 | struct pci_dev *dev; | ||
26 | /* | ||
27 | * This can be called on the ide_setup() path, super-early in | ||
28 | * boot. But the down_read() will enable local interrupts, | ||
29 | * which can cause some machines to crash. So here we detect | ||
30 | * and flag that situation and bail out early. | ||
31 | */ | ||
32 | if (no_pci_devices()) | ||
33 | return 0; | ||
34 | dev = pci_get_class(PCI_CLASS_BRIDGE_EISA << 8, NULL); | ||
35 | if (dev) | ||
36 | goto found; | ||
37 | dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); | ||
38 | if (dev) | ||
39 | goto found; | ||
40 | return 0; | ||
41 | found: | ||
42 | pci_dev_put(dev); | ||
43 | return 1; | ||
44 | #elif defined(CONFIG_EISA) || defined(CONFIG_ISA) | ||
45 | return 1; | ||
46 | #else | ||
47 | return 0; | ||
48 | #endif | ||
49 | } | ||
50 | |||
51 | /* MIPS port and memory-mapped I/O string operations. */ | ||
52 | static inline void __ide_flush_prologue(void) | ||
53 | { | ||
54 | #ifdef CONFIG_SMP | ||
55 | if (cpu_has_dc_aliases) | ||
56 | preempt_disable(); | ||
57 | #endif | ||
58 | } | ||
59 | |||
60 | static inline void __ide_flush_epilogue(void) | ||
61 | { | ||
62 | #ifdef CONFIG_SMP | ||
63 | if (cpu_has_dc_aliases) | ||
64 | preempt_enable(); | ||
65 | #endif | ||
66 | } | ||
67 | |||
68 | static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size) | ||
69 | { | ||
70 | if (cpu_has_dc_aliases) { | ||
71 | unsigned long end = addr + size; | ||
72 | |||
73 | while (addr < end) { | ||
74 | local_flush_data_cache_page((void *)addr); | ||
75 | addr += PAGE_SIZE; | ||
76 | } | ||
77 | } | ||
78 | } | ||
79 | |||
80 | /* | ||
81 | * insw() and gang might be called with interrupts disabled, so we can't | ||
82 | * send IPIs for flushing due to the potencial of deadlocks, see the comment | ||
83 | * above smp_call_function() in arch/mips/kernel/smp.c. We work around the | ||
84 | * problem by disabling preemption so we know we actually perform the flush | ||
85 | * on the processor that actually has the lines to be flushed which hopefully | ||
86 | * is even better for performance anyway. | ||
87 | */ | ||
88 | static inline void __ide_insw(unsigned long port, void *addr, | ||
89 | unsigned int count) | ||
90 | { | ||
91 | __ide_flush_prologue(); | ||
92 | insw(port, addr, count); | ||
93 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | ||
94 | __ide_flush_epilogue(); | ||
95 | } | ||
96 | |||
97 | static inline void __ide_insl(unsigned long port, void *addr, unsigned int count) | ||
98 | { | ||
99 | __ide_flush_prologue(); | ||
100 | insl(port, addr, count); | ||
101 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | ||
102 | __ide_flush_epilogue(); | ||
103 | } | ||
104 | |||
105 | static inline void __ide_outsw(unsigned long port, const void *addr, | ||
106 | unsigned long count) | ||
107 | { | ||
108 | __ide_flush_prologue(); | ||
109 | outsw(port, addr, count); | ||
110 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | ||
111 | __ide_flush_epilogue(); | ||
112 | } | ||
113 | |||
114 | static inline void __ide_outsl(unsigned long port, const void *addr, | ||
115 | unsigned long count) | ||
116 | { | ||
117 | __ide_flush_prologue(); | ||
118 | outsl(port, addr, count); | ||
119 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | ||
120 | __ide_flush_epilogue(); | ||
121 | } | ||
122 | |||
123 | static inline void __ide_mm_insw(void __iomem *port, void *addr, u32 count) | ||
124 | { | ||
125 | __ide_flush_prologue(); | ||
126 | readsw(port, addr, count); | ||
127 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | ||
128 | __ide_flush_epilogue(); | ||
129 | } | ||
130 | |||
131 | static inline void __ide_mm_insl(void __iomem *port, void *addr, u32 count) | ||
132 | { | ||
133 | __ide_flush_prologue(); | ||
134 | readsl(port, addr, count); | ||
135 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | ||
136 | __ide_flush_epilogue(); | ||
137 | } | ||
138 | |||
139 | static inline void __ide_mm_outsw(void __iomem *port, void *addr, u32 count) | ||
140 | { | ||
141 | __ide_flush_prologue(); | ||
142 | writesw(port, addr, count); | ||
143 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | ||
144 | __ide_flush_epilogue(); | ||
145 | } | ||
146 | |||
147 | static inline void __ide_mm_outsl(void __iomem * port, void *addr, u32 count) | ||
148 | { | ||
149 | __ide_flush_prologue(); | ||
150 | writesl(port, addr, count); | ||
151 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | ||
152 | __ide_flush_epilogue(); | ||
153 | } | ||
154 | |||
155 | /* ide_insw calls insw, not __ide_insw. Why? */ | ||
156 | #undef insw | ||
157 | #undef insl | ||
158 | #undef outsw | ||
159 | #undef outsl | ||
160 | #define insw(port, addr, count) __ide_insw(port, addr, count) | ||
161 | #define insl(port, addr, count) __ide_insl(port, addr, count) | ||
162 | #define outsw(port, addr, count) __ide_outsw(port, addr, count) | ||
163 | #define outsl(port, addr, count) __ide_outsl(port, addr, count) | ||
164 | |||
165 | #endif /* __KERNEL__ */ | ||
166 | |||
167 | #endif /* __ASM_MACH_GENERIC_IDE_H */ | ||
diff --git a/include/asm-mips/mach-generic/ioremap.h b/include/asm-mips/mach-generic/ioremap.h deleted file mode 100644 index b379938d47f0..000000000000 --- a/include/asm-mips/mach-generic/ioremap.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/mach-generic/ioremap.h | ||
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 | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_GENERIC_IOREMAP_H | ||
10 | #define __ASM_MACH_GENERIC_IOREMAP_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | /* | ||
15 | * Allow physical addresses to be fixed up to help peripherals located | ||
16 | * outside the low 32-bit range -- generic pass-through version. | ||
17 | */ | ||
18 | static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
19 | { | ||
20 | return phys_addr; | ||
21 | } | ||
22 | |||
23 | static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, | ||
24 | unsigned long flags) | ||
25 | { | ||
26 | return NULL; | ||
27 | } | ||
28 | |||
29 | static inline int plat_iounmap(const volatile void __iomem *addr) | ||
30 | { | ||
31 | return 0; | ||
32 | } | ||
33 | |||
34 | #endif /* __ASM_MACH_GENERIC_IOREMAP_H */ | ||
diff --git a/include/asm-mips/mach-generic/irq.h b/include/asm-mips/mach-generic/irq.h deleted file mode 100644 index 70d9a25132c5..000000000000 --- a/include/asm-mips/mach-generic/irq.h +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_GENERIC_IRQ_H | ||
9 | #define __ASM_MACH_GENERIC_IRQ_H | ||
10 | |||
11 | #ifndef NR_IRQS | ||
12 | #define NR_IRQS 128 | ||
13 | #endif | ||
14 | |||
15 | #ifdef CONFIG_I8259 | ||
16 | #ifndef I8259A_IRQ_BASE | ||
17 | #define I8259A_IRQ_BASE 0 | ||
18 | #endif | ||
19 | #endif | ||
20 | |||
21 | #ifdef CONFIG_IRQ_CPU | ||
22 | |||
23 | #ifndef MIPS_CPU_IRQ_BASE | ||
24 | #ifdef CONFIG_I8259 | ||
25 | #define MIPS_CPU_IRQ_BASE 16 | ||
26 | #else | ||
27 | #define MIPS_CPU_IRQ_BASE 0 | ||
28 | #endif /* CONFIG_I8259 */ | ||
29 | #endif | ||
30 | |||
31 | #ifdef CONFIG_IRQ_CPU_RM7K | ||
32 | #ifndef RM7K_CPU_IRQ_BASE | ||
33 | #define RM7K_CPU_IRQ_BASE (MIPS_CPU_IRQ_BASE+8) | ||
34 | #endif | ||
35 | #endif | ||
36 | |||
37 | #ifdef CONFIG_IRQ_CPU_RM9K | ||
38 | #ifndef RM9K_CPU_IRQ_BASE | ||
39 | #define RM9K_CPU_IRQ_BASE (MIPS_CPU_IRQ_BASE+12) | ||
40 | #endif | ||
41 | #endif | ||
42 | |||
43 | #endif /* CONFIG_IRQ_CPU */ | ||
44 | |||
45 | #endif /* __ASM_MACH_GENERIC_IRQ_H */ | ||
diff --git a/include/asm-mips/mach-generic/kernel-entry-init.h b/include/asm-mips/mach-generic/kernel-entry-init.h deleted file mode 100644 index 7e66505fa574..000000000000 --- a/include/asm-mips/mach-generic/kernel-entry-init.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2005 Embedded Alley Solutions, Inc | ||
7 | * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_GENERIC_KERNEL_ENTRY_H | ||
10 | #define __ASM_MACH_GENERIC_KERNEL_ENTRY_H | ||
11 | |||
12 | /* Intentionally empty macro, used in head.S. Override in | ||
13 | * arch/mips/mach-xxx/kernel-entry-init.h when necessary. | ||
14 | */ | ||
15 | .macro kernel_entry_setup | ||
16 | .endm | ||
17 | |||
18 | /* | ||
19 | * Do SMP slave processor setup necessary before we can savely execute C code. | ||
20 | */ | ||
21 | .macro smp_slave_setup | ||
22 | .endm | ||
23 | |||
24 | |||
25 | #endif /* __ASM_MACH_GENERIC_KERNEL_ENTRY_H */ | ||
diff --git a/include/asm-mips/mach-generic/kmalloc.h b/include/asm-mips/mach-generic/kmalloc.h deleted file mode 100644 index b8e6deba352f..000000000000 --- a/include/asm-mips/mach-generic/kmalloc.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_GENERIC_KMALLOC_H | ||
2 | #define __ASM_MACH_GENERIC_KMALLOC_H | ||
3 | |||
4 | |||
5 | #ifndef CONFIG_DMA_COHERENT | ||
6 | /* | ||
7 | * Total overkill for most systems but need as a safe default. | ||
8 | * Set this one if any device in the system might do non-coherent DMA. | ||
9 | */ | ||
10 | #define ARCH_KMALLOC_MINALIGN 128 | ||
11 | #endif | ||
12 | |||
13 | #endif /* __ASM_MACH_GENERIC_KMALLOC_H */ | ||
diff --git a/include/asm-mips/mach-generic/mangle-port.h b/include/asm-mips/mach-generic/mangle-port.h deleted file mode 100644 index f49dc990214b..000000000000 --- a/include/asm-mips/mach-generic/mangle-port.h +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 2004 Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_GENERIC_MANGLE_PORT_H | ||
9 | #define __ASM_MACH_GENERIC_MANGLE_PORT_H | ||
10 | |||
11 | #define __swizzle_addr_b(port) (port) | ||
12 | #define __swizzle_addr_w(port) (port) | ||
13 | #define __swizzle_addr_l(port) (port) | ||
14 | #define __swizzle_addr_q(port) (port) | ||
15 | |||
16 | /* | ||
17 | * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware; | ||
18 | * less sane hardware forces software to fiddle with this... | ||
19 | * | ||
20 | * Regardless, if the host bus endianness mismatches that of PCI/ISA, then | ||
21 | * you can't have the numerical value of data and byte addresses within | ||
22 | * multibyte quantities both preserved at the same time. Hence two | ||
23 | * variations of functions: non-prefixed ones that preserve the value | ||
24 | * and prefixed ones that preserve byte addresses. The latters are | ||
25 | * typically used for moving raw data between a peripheral and memory (cf. | ||
26 | * string I/O functions), hence the "__mem_" prefix. | ||
27 | */ | ||
28 | #if defined(CONFIG_SWAP_IO_SPACE) | ||
29 | |||
30 | # define ioswabb(a, x) (x) | ||
31 | # define __mem_ioswabb(a, x) (x) | ||
32 | # define ioswabw(a, x) le16_to_cpu(x) | ||
33 | # define __mem_ioswabw(a, x) (x) | ||
34 | # define ioswabl(a, x) le32_to_cpu(x) | ||
35 | # define __mem_ioswabl(a, x) (x) | ||
36 | # define ioswabq(a, x) le64_to_cpu(x) | ||
37 | # define __mem_ioswabq(a, x) (x) | ||
38 | |||
39 | #else | ||
40 | |||
41 | # define ioswabb(a, x) (x) | ||
42 | # define __mem_ioswabb(a, x) (x) | ||
43 | # define ioswabw(a, x) (x) | ||
44 | # define __mem_ioswabw(a, x) cpu_to_le16(x) | ||
45 | # define ioswabl(a, x) (x) | ||
46 | # define __mem_ioswabl(a, x) cpu_to_le32(x) | ||
47 | # define ioswabq(a, x) (x) | ||
48 | # define __mem_ioswabq(a, x) cpu_to_le32(x) | ||
49 | |||
50 | #endif | ||
51 | |||
52 | #endif /* __ASM_MACH_GENERIC_MANGLE_PORT_H */ | ||
diff --git a/include/asm-mips/mach-generic/mc146818rtc.h b/include/asm-mips/mach-generic/mc146818rtc.h deleted file mode 100644 index 0b9a942f079d..000000000000 --- a/include/asm-mips/mach-generic/mc146818rtc.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 2001, 03 by Ralf Baechle | ||
7 | * | ||
8 | * RTC routines for PC style attached Dallas chip. | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_GENERIC_MC146818RTC_H | ||
11 | #define __ASM_MACH_GENERIC_MC146818RTC_H | ||
12 | |||
13 | #include <asm/io.h> | ||
14 | |||
15 | #define RTC_PORT(x) (0x70 + (x)) | ||
16 | #define RTC_IRQ 8 | ||
17 | |||
18 | static inline unsigned char CMOS_READ(unsigned long addr) | ||
19 | { | ||
20 | outb_p(addr, RTC_PORT(0)); | ||
21 | return inb_p(RTC_PORT(1)); | ||
22 | } | ||
23 | |||
24 | static inline void CMOS_WRITE(unsigned char data, unsigned long addr) | ||
25 | { | ||
26 | outb_p(addr, RTC_PORT(0)); | ||
27 | outb_p(data, RTC_PORT(1)); | ||
28 | } | ||
29 | |||
30 | #define RTC_ALWAYS_BCD 1 | ||
31 | |||
32 | #ifndef mc146818_decode_year | ||
33 | #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) | ||
34 | #endif | ||
35 | |||
36 | #endif /* __ASM_MACH_GENERIC_MC146818RTC_H */ | ||
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h deleted file mode 100644 index c9fa4b14968d..000000000000 --- a/include/asm-mips/mach-generic/spaces.h +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle | ||
7 | * Copyright (C) 2000, 2002 Maciej W. Rozycki | ||
8 | * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc. | ||
9 | */ | ||
10 | #ifndef _ASM_MACH_GENERIC_SPACES_H | ||
11 | #define _ASM_MACH_GENERIC_SPACES_H | ||
12 | |||
13 | #include <linux/const.h> | ||
14 | |||
15 | /* | ||
16 | * This gives the physical RAM offset. | ||
17 | */ | ||
18 | #ifndef PHYS_OFFSET | ||
19 | #define PHYS_OFFSET _AC(0, UL) | ||
20 | #endif | ||
21 | |||
22 | #ifdef CONFIG_32BIT | ||
23 | |||
24 | #define CAC_BASE _AC(0x80000000, UL) | ||
25 | #define IO_BASE _AC(0xa0000000, UL) | ||
26 | #define UNCAC_BASE _AC(0xa0000000, UL) | ||
27 | |||
28 | #ifndef MAP_BASE | ||
29 | #define MAP_BASE _AC(0xc0000000, UL) | ||
30 | #endif | ||
31 | |||
32 | /* | ||
33 | * Memory above this physical address will be considered highmem. | ||
34 | */ | ||
35 | #ifndef HIGHMEM_START | ||
36 | #define HIGHMEM_START _AC(0x20000000, UL) | ||
37 | #endif | ||
38 | |||
39 | #endif /* CONFIG_32BIT */ | ||
40 | |||
41 | #ifdef CONFIG_64BIT | ||
42 | |||
43 | #ifndef CAC_BASE | ||
44 | #ifdef CONFIG_DMA_NONCOHERENT | ||
45 | #define CAC_BASE _AC(0x9800000000000000, UL) | ||
46 | #else | ||
47 | #define CAC_BASE _AC(0xa800000000000000, UL) | ||
48 | #endif | ||
49 | #endif | ||
50 | |||
51 | #ifndef IO_BASE | ||
52 | #define IO_BASE _AC(0x9000000000000000, UL) | ||
53 | #endif | ||
54 | |||
55 | #ifndef UNCAC_BASE | ||
56 | #define UNCAC_BASE _AC(0x9000000000000000, UL) | ||
57 | #endif | ||
58 | |||
59 | #ifndef MAP_BASE | ||
60 | #define MAP_BASE _AC(0xc000000000000000, UL) | ||
61 | #endif | ||
62 | |||
63 | /* | ||
64 | * Memory above this physical address will be considered highmem. | ||
65 | * Fixme: 59 bits is a fictive number and makes assumptions about processors | ||
66 | * in the distant future. Nobody will care for a few years :-) | ||
67 | */ | ||
68 | #ifndef HIGHMEM_START | ||
69 | #define HIGHMEM_START (_AC(1, UL) << _AC(59, UL)) | ||
70 | #endif | ||
71 | |||
72 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) | ||
73 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) | ||
74 | #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) | ||
75 | |||
76 | #endif /* CONFIG_64BIT */ | ||
77 | |||
78 | /* | ||
79 | * This handles the memory map. | ||
80 | */ | ||
81 | #ifndef PAGE_OFFSET | ||
82 | #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET) | ||
83 | #endif | ||
84 | |||
85 | #endif /* __ASM_MACH_GENERIC_SPACES_H */ | ||
diff --git a/include/asm-mips/mach-generic/topology.h b/include/asm-mips/mach-generic/topology.h deleted file mode 100644 index 5428f333a02c..000000000000 --- a/include/asm-mips/mach-generic/topology.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/topology.h> | ||
diff --git a/include/asm-mips/mach-ip22/cpu-feature-overrides.h b/include/asm-mips/mach-ip22/cpu-feature-overrides.h deleted file mode 100644 index 9c8735158da1..000000000000 --- a/include/asm-mips/mach-ip22/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 07 Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H | ||
9 | #define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H | ||
10 | |||
11 | /* | ||
12 | * IP22 with a variety of processors so we can't use defaults for everything. | ||
13 | */ | ||
14 | #define cpu_has_tlb 1 | ||
15 | #define cpu_has_4kex 1 | ||
16 | #define cpu_has_4k_cache 1 | ||
17 | #define cpu_has_fpu 1 | ||
18 | #define cpu_has_32fpr 1 | ||
19 | #define cpu_has_counter 1 | ||
20 | #define cpu_has_mips16 0 | ||
21 | #define cpu_has_divec 0 | ||
22 | #define cpu_has_cache_cdex_p 1 | ||
23 | #define cpu_has_prefetch 0 | ||
24 | #define cpu_has_mcheck 0 | ||
25 | #define cpu_has_ejtag 0 | ||
26 | |||
27 | #define cpu_has_llsc 1 | ||
28 | #define cpu_has_vtag_icache 0 /* Needs to change for R8000 */ | ||
29 | #define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) | ||
30 | #define cpu_has_ic_fills_f_dc 0 | ||
31 | |||
32 | #define cpu_has_dsp 0 | ||
33 | #define cpu_has_mipsmt 0 | ||
34 | #define cpu_has_userlocal 0 | ||
35 | |||
36 | #define cpu_has_nofpuex 0 | ||
37 | #define cpu_has_64bits 1 | ||
38 | |||
39 | #define cpu_has_mips32r1 0 | ||
40 | #define cpu_has_mips32r2 0 | ||
41 | #define cpu_has_mips64r1 0 | ||
42 | #define cpu_has_mips64r2 0 | ||
43 | |||
44 | #endif /* __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-ip22/ds1286.h b/include/asm-mips/mach-ip22/ds1286.h deleted file mode 100644 index f19f1eafbc71..000000000000 --- a/include/asm-mips/mach-ip22/ds1286.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 2001, 03 by Ralf Baechle | ||
7 | * | ||
8 | * RTC routines for PC style attached Dallas chip. | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_IP22_DS1286_H | ||
11 | #define __ASM_MACH_IP22_DS1286_H | ||
12 | |||
13 | #include <asm/sgi/hpc3.h> | ||
14 | |||
15 | #define rtc_read(reg) (hpc3c0->rtcregs[(reg)] & 0xff) | ||
16 | #define rtc_write(data, reg) do { hpc3c0->rtcregs[(reg)] = (data); } while(0) | ||
17 | |||
18 | #endif /* __ASM_MACH_IP22_DS1286_H */ | ||
diff --git a/include/asm-mips/mach-ip22/spaces.h b/include/asm-mips/mach-ip22/spaces.h deleted file mode 100644 index 7f9fa6f66059..000000000000 --- a/include/asm-mips/mach-ip22/spaces.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle | ||
7 | * Copyright (C) 2000, 2002 Maciej W. Rozycki | ||
8 | * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc. | ||
9 | */ | ||
10 | #ifndef _ASM_MACH_IP22_SPACES_H | ||
11 | #define _ASM_MACH_IP22_SPACES_H | ||
12 | |||
13 | |||
14 | #ifdef CONFIG_64BIT | ||
15 | |||
16 | #define PAGE_OFFSET 0xffffffff80000000UL | ||
17 | |||
18 | #define CAC_BASE 0xffffffff80000000 | ||
19 | #define IO_BASE 0xffffffffa0000000 | ||
20 | #define UNCAC_BASE 0xffffffffa0000000 | ||
21 | #define MAP_BASE 0xc000000000000000 | ||
22 | |||
23 | #endif /* CONFIG_64BIT */ | ||
24 | |||
25 | #include <asm/mach-generic/spaces.h> | ||
26 | |||
27 | #endif /* __ASM_MACH_IP22_SPACES_H */ | ||
diff --git a/include/asm-mips/mach-ip22/war.h b/include/asm-mips/mach-ip22/war.h deleted file mode 100644 index a44fa9656a82..000000000000 --- a/include/asm-mips/mach-ip22/war.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_IP22_WAR_H | ||
9 | #define __ASM_MIPS_MACH_IP22_WAR_H | ||
10 | |||
11 | /* | ||
12 | * R4600 CPU modules for the Indy come with both V1.7 and V2.0 processors. | ||
13 | */ | ||
14 | |||
15 | #define R4600_V1_INDEX_ICACHEOP_WAR 1 | ||
16 | #define R4600_V1_HIT_CACHEOP_WAR 1 | ||
17 | #define R4600_V2_HIT_CACHEOP_WAR 1 | ||
18 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
19 | #define BCM1250_M3_WAR 0 | ||
20 | #define SIBYTE_1956_WAR 0 | ||
21 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
22 | #define MIPS_CACHE_SYNC_WAR 0 | ||
23 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
24 | #define RM9000_CDEX_SMP_WAR 0 | ||
25 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
26 | #define R10000_LLSC_WAR 0 | ||
27 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
28 | |||
29 | #endif /* __ASM_MIPS_MACH_IP22_WAR_H */ | ||
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h deleted file mode 100644 index 7d3112b148d9..000000000000 --- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 07 Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H | ||
9 | #define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H | ||
10 | |||
11 | /* | ||
12 | * IP27 only comes with R10000 family processors all using the same config | ||
13 | */ | ||
14 | #define cpu_has_watch 1 | ||
15 | #define cpu_has_mips16 0 | ||
16 | #define cpu_has_divec 0 | ||
17 | #define cpu_has_vce 0 | ||
18 | #define cpu_has_cache_cdex_p 0 | ||
19 | #define cpu_has_cache_cdex_s 0 | ||
20 | #define cpu_has_prefetch 1 | ||
21 | #define cpu_has_mcheck 0 | ||
22 | #define cpu_has_ejtag 0 | ||
23 | |||
24 | #define cpu_has_llsc 1 | ||
25 | #define cpu_has_vtag_icache 0 | ||
26 | #define cpu_has_dc_aliases 0 | ||
27 | #define cpu_has_ic_fills_f_dc 0 | ||
28 | #define cpu_has_dsp 0 | ||
29 | #define cpu_icache_snoops_remote_store 1 | ||
30 | #define cpu_has_mipsmt 0 | ||
31 | #define cpu_has_userlocal 0 | ||
32 | |||
33 | #define cpu_has_nofpuex 0 | ||
34 | #define cpu_has_64bits 1 | ||
35 | |||
36 | #define cpu_has_4kex 1 | ||
37 | #define cpu_has_3k_cache 0 | ||
38 | #define cpu_has_6k_cache 0 | ||
39 | #define cpu_has_4k_cache 1 | ||
40 | #define cpu_has_8k_cache 0 | ||
41 | #define cpu_has_tx39_cache 0 | ||
42 | |||
43 | #define cpu_has_inclusive_pcaches 1 | ||
44 | |||
45 | #define cpu_dcache_line_size() 32 | ||
46 | #define cpu_icache_line_size() 64 | ||
47 | #define cpu_scache_line_size() 128 | ||
48 | |||
49 | #define cpu_has_mips32r1 0 | ||
50 | #define cpu_has_mips32r2 0 | ||
51 | #define cpu_has_mips64r1 0 | ||
52 | #define cpu_has_mips64r2 0 | ||
53 | |||
54 | #endif /* __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-ip27/dma-coherence.h b/include/asm-mips/mach-ip27/dma-coherence.h deleted file mode 100644 index ed7e6222dc15..000000000000 --- a/include/asm-mips/mach-ip27/dma-coherence.h +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org> | ||
7 | * | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_IP27_DMA_COHERENCE_H | ||
10 | #define __ASM_MACH_IP27_DMA_COHERENCE_H | ||
11 | |||
12 | #include <asm/pci/bridge.h> | ||
13 | |||
14 | #define pdev_to_baddr(pdev, addr) \ | ||
15 | (BRIDGE_CONTROLLER(pdev->bus)->baddr + (addr)) | ||
16 | #define dev_to_baddr(dev, addr) \ | ||
17 | pdev_to_baddr(to_pci_dev(dev), (addr)) | ||
18 | |||
19 | struct device; | ||
20 | |||
21 | static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, | ||
22 | size_t size) | ||
23 | { | ||
24 | dma_addr_t pa = dev_to_baddr(dev, virt_to_phys(addr)); | ||
25 | |||
26 | return pa; | ||
27 | } | ||
28 | |||
29 | static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page) | ||
30 | { | ||
31 | dma_addr_t pa = dev_to_baddr(dev, page_to_phys(page)); | ||
32 | |||
33 | return pa; | ||
34 | } | ||
35 | |||
36 | static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | ||
37 | { | ||
38 | return dma_addr & ~(0xffUL << 56); | ||
39 | } | ||
40 | |||
41 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) | ||
42 | { | ||
43 | } | ||
44 | |||
45 | static inline int plat_device_is_coherent(struct device *dev) | ||
46 | { | ||
47 | return 1; /* IP27 non-cohernet mode is unsupported */ | ||
48 | } | ||
49 | |||
50 | #endif /* __ASM_MACH_IP27_DMA_COHERENCE_H */ | ||
diff --git a/include/asm-mips/mach-ip27/irq.h b/include/asm-mips/mach-ip27/irq.h deleted file mode 100644 index cf4384bfa846..000000000000 --- a/include/asm-mips/mach-ip27/irq.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1999, 2000, 01, 02, 03 by Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | * Copyright (C) 2001 Kanoj Sarcar | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_IP27_IRQ_H | ||
11 | #define __ASM_MACH_IP27_IRQ_H | ||
12 | |||
13 | /* | ||
14 | * A hardwired interrupt number is completly stupid for this system - a | ||
15 | * large configuration might have thousands if not tenthousands of | ||
16 | * interrupts. | ||
17 | */ | ||
18 | #define NR_IRQS 256 | ||
19 | |||
20 | #include_next <irq.h> | ||
21 | |||
22 | #endif /* __ASM_MACH_IP27_IRQ_H */ | ||
diff --git a/include/asm-mips/mach-ip27/kernel-entry-init.h b/include/asm-mips/mach-ip27/kernel-entry-init.h deleted file mode 100644 index 624d66c7f290..000000000000 --- a/include/asm-mips/mach-ip27/kernel-entry-init.h +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000 Silicon Graphics, Inc. | ||
7 | * Copyright (C) 2005 Ralf Baechle <ralf@linux-mips.org> | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_IP27_KERNEL_ENTRY_H | ||
10 | #define __ASM_MACH_IP27_KERNEL_ENTRY_H | ||
11 | |||
12 | #include <asm/sn/addrs.h> | ||
13 | #include <asm/sn/sn0/hubni.h> | ||
14 | #include <asm/sn/klkernvars.h> | ||
15 | |||
16 | /* | ||
17 | * Returns the local nasid into res. | ||
18 | */ | ||
19 | .macro GET_NASID_ASM res | ||
20 | dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID) | ||
21 | ld \res, (\res) | ||
22 | and \res, NSRI_NODEID_MASK | ||
23 | dsrl \res, NSRI_NODEID_SHFT | ||
24 | .endm | ||
25 | |||
26 | /* | ||
27 | * Intentionally empty macro, used in head.S. Override in | ||
28 | * arch/mips/mach-xxx/kernel-entry-init.h when necessary. | ||
29 | */ | ||
30 | .macro kernel_entry_setup | ||
31 | GET_NASID_ASM t1 | ||
32 | move t2, t1 # text and data are here | ||
33 | MAPPED_KERNEL_SETUP_TLB | ||
34 | .endm | ||
35 | |||
36 | /* | ||
37 | * Do SMP slave processor setup necessary before we can savely execute C code. | ||
38 | */ | ||
39 | .macro smp_slave_setup | ||
40 | GET_NASID_ASM t1 | ||
41 | dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \ | ||
42 | KLDIR_OFF_POINTER + CAC_BASE | ||
43 | dsll t1, NASID_SHFT | ||
44 | or t0, t0, t1 | ||
45 | ld t0, 0(t0) # t0 points to kern_vars struct | ||
46 | lh t1, KV_RO_NASID_OFFSET(t0) | ||
47 | lh t2, KV_RW_NASID_OFFSET(t0) | ||
48 | MAPPED_KERNEL_SETUP_TLB | ||
49 | |||
50 | /* | ||
51 | * We might not get launched at the address the kernel is linked to, | ||
52 | * so we jump there. | ||
53 | */ | ||
54 | PTR_LA t0, 0f | ||
55 | jr t0 | ||
56 | 0: | ||
57 | .endm | ||
58 | |||
59 | #endif /* __ASM_MACH_IP27_KERNEL_ENTRY_H */ | ||
diff --git a/include/asm-mips/mach-ip27/kmalloc.h b/include/asm-mips/mach-ip27/kmalloc.h deleted file mode 100644 index 426bd049b2d7..000000000000 --- a/include/asm-mips/mach-ip27/kmalloc.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_IP27_KMALLOC_H | ||
2 | #define __ASM_MACH_IP27_KMALLOC_H | ||
3 | |||
4 | /* | ||
5 | * All happy, no need to define ARCH_KMALLOC_MINALIGN | ||
6 | */ | ||
7 | |||
8 | #endif /* __ASM_MACH_IP27_KMALLOC_H */ | ||
diff --git a/include/asm-mips/mach-ip27/mangle-port.h b/include/asm-mips/mach-ip27/mangle-port.h deleted file mode 100644 index f6e4912ea062..000000000000 --- a/include/asm-mips/mach-ip27/mangle-port.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 2004 Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_IP27_MANGLE_PORT_H | ||
9 | #define __ASM_MACH_IP27_MANGLE_PORT_H | ||
10 | |||
11 | #define __swizzle_addr_b(port) (port) | ||
12 | #define __swizzle_addr_w(port) ((port) ^ 2) | ||
13 | #define __swizzle_addr_l(port) (port) | ||
14 | #define __swizzle_addr_q(port) (port) | ||
15 | |||
16 | # define ioswabb(a, x) (x) | ||
17 | # define __mem_ioswabb(a, x) (x) | ||
18 | # define ioswabw(a, x) (x) | ||
19 | # define __mem_ioswabw(a, x) cpu_to_le16(x) | ||
20 | # define ioswabl(a, x) (x) | ||
21 | # define __mem_ioswabl(a, x) cpu_to_le32(x) | ||
22 | # define ioswabq(a, x) (x) | ||
23 | # define __mem_ioswabq(a, x) cpu_to_le32(x) | ||
24 | |||
25 | #endif /* __ASM_MACH_IP27_MANGLE_PORT_H */ | ||
diff --git a/include/asm-mips/mach-ip27/mmzone.h b/include/asm-mips/mach-ip27/mmzone.h deleted file mode 100644 index 986a3b9b59a7..000000000000 --- a/include/asm-mips/mach-ip27/mmzone.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | #ifndef _ASM_MACH_MMZONE_H | ||
2 | #define _ASM_MACH_MMZONE_H | ||
3 | |||
4 | #include <asm/sn/addrs.h> | ||
5 | #include <asm/sn/arch.h> | ||
6 | #include <asm/sn/hub.h> | ||
7 | |||
8 | #define pa_to_nid(addr) NASID_TO_COMPACT_NODEID(NASID_GET(addr)) | ||
9 | |||
10 | #define LEVELS_PER_SLICE 128 | ||
11 | |||
12 | struct slice_data { | ||
13 | unsigned long irq_enable_mask[2]; | ||
14 | int level_to_irq[LEVELS_PER_SLICE]; | ||
15 | }; | ||
16 | |||
17 | struct hub_data { | ||
18 | kern_vars_t kern_vars; | ||
19 | DECLARE_BITMAP(h_bigwin_used, HUB_NUM_BIG_WINDOW); | ||
20 | cpumask_t h_cpus; | ||
21 | unsigned long slice_map; | ||
22 | unsigned long irq_alloc_mask[2]; | ||
23 | struct slice_data slice[2]; | ||
24 | }; | ||
25 | |||
26 | struct node_data { | ||
27 | struct pglist_data pglist; | ||
28 | struct hub_data hub; | ||
29 | }; | ||
30 | |||
31 | extern struct node_data *__node_data[]; | ||
32 | |||
33 | #define NODE_DATA(n) (&__node_data[(n)]->pglist) | ||
34 | #define hub_data(n) (&__node_data[(n)]->hub) | ||
35 | |||
36 | #endif /* _ASM_MACH_MMZONE_H */ | ||
diff --git a/include/asm-mips/mach-ip27/spaces.h b/include/asm-mips/mach-ip27/spaces.h deleted file mode 100644 index b18802a0b17e..000000000000 --- a/include/asm-mips/mach-ip27/spaces.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 99 Ralf Baechle | ||
7 | * Copyright (C) 2000, 2002 Maciej W. Rozycki | ||
8 | * Copyright (C) 1990, 1999 by Silicon Graphics, Inc. | ||
9 | */ | ||
10 | #ifndef _ASM_MACH_IP27_SPACES_H | ||
11 | #define _ASM_MACH_IP27_SPACES_H | ||
12 | |||
13 | /* | ||
14 | * IP27 uses the R10000's uncached attribute feature. Attribute 3 selects | ||
15 | * uncached memory addressing. | ||
16 | */ | ||
17 | |||
18 | #define HSPEC_BASE 0x9000000000000000 | ||
19 | #define IO_BASE 0x9200000000000000 | ||
20 | #define MSPEC_BASE 0x9400000000000000 | ||
21 | #define UNCAC_BASE 0x9600000000000000 | ||
22 | |||
23 | #define TO_MSPEC(x) (MSPEC_BASE | ((x) & TO_PHYS_MASK)) | ||
24 | #define TO_HSPEC(x) (HSPEC_BASE | ((x) & TO_PHYS_MASK)) | ||
25 | |||
26 | #define HIGHMEM_START (~0UL) | ||
27 | |||
28 | #include <asm/mach-generic/spaces.h> | ||
29 | |||
30 | #endif /* _ASM_MACH_IP27_SPACES_H */ | ||
diff --git a/include/asm-mips/mach-ip27/topology.h b/include/asm-mips/mach-ip27/topology.h deleted file mode 100644 index 7785bec732f2..000000000000 --- a/include/asm-mips/mach-ip27/topology.h +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | #ifndef _ASM_MACH_TOPOLOGY_H | ||
2 | #define _ASM_MACH_TOPOLOGY_H 1 | ||
3 | |||
4 | #include <asm/sn/hub.h> | ||
5 | #include <asm/sn/types.h> | ||
6 | #include <asm/mmzone.h> | ||
7 | |||
8 | struct cpuinfo_ip27 { | ||
9 | // cpuid_t p_cpuid; /* PROM assigned cpuid */ | ||
10 | cnodeid_t p_nodeid; /* my node ID in compact-id-space */ | ||
11 | nasid_t p_nasid; /* my node ID in numa-as-id-space */ | ||
12 | unsigned char p_slice; /* Physical position on node board */ | ||
13 | #if 0 | ||
14 | unsigned long loops_per_sec; | ||
15 | unsigned long ipi_count; | ||
16 | unsigned long irq_attempt[NR_IRQS]; | ||
17 | unsigned long smp_local_irq_count; | ||
18 | unsigned long prof_multiplier; | ||
19 | unsigned long prof_counter; | ||
20 | #endif | ||
21 | }; | ||
22 | |||
23 | extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS]; | ||
24 | |||
25 | #define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid) | ||
26 | #define parent_node(node) (node) | ||
27 | #define node_to_cpumask(node) (hub_data(node)->h_cpus) | ||
28 | #define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node))) | ||
29 | struct pci_bus; | ||
30 | extern int pcibus_to_node(struct pci_bus *); | ||
31 | |||
32 | #define pcibus_to_cpumask(bus) (cpu_online_map) | ||
33 | |||
34 | extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; | ||
35 | |||
36 | #define node_distance(from, to) (__node_distances[(from)][(to)]) | ||
37 | |||
38 | /* sched_domains SD_NODE_INIT for SGI IP27 machines */ | ||
39 | #define SD_NODE_INIT (struct sched_domain) { \ | ||
40 | .span = CPU_MASK_NONE, \ | ||
41 | .parent = NULL, \ | ||
42 | .child = NULL, \ | ||
43 | .groups = NULL, \ | ||
44 | .min_interval = 8, \ | ||
45 | .max_interval = 32, \ | ||
46 | .busy_factor = 32, \ | ||
47 | .imbalance_pct = 125, \ | ||
48 | .cache_nice_tries = 1, \ | ||
49 | .flags = SD_LOAD_BALANCE \ | ||
50 | | SD_BALANCE_EXEC \ | ||
51 | | SD_WAKE_BALANCE, \ | ||
52 | .last_balance = jiffies, \ | ||
53 | .balance_interval = 1, \ | ||
54 | .nr_balance_failed = 0, \ | ||
55 | } | ||
56 | |||
57 | #include <asm-generic/topology.h> | ||
58 | |||
59 | #endif /* _ASM_MACH_TOPOLOGY_H */ | ||
diff --git a/include/asm-mips/mach-ip27/war.h b/include/asm-mips/mach-ip27/war.h deleted file mode 100644 index e2ddcc9b1fff..000000000000 --- a/include/asm-mips/mach-ip27/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_IP27_WAR_H | ||
9 | #define __ASM_MIPS_MACH_IP27_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 1 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_IP27_WAR_H */ | ||
diff --git a/include/asm-mips/mach-ip28/cpu-feature-overrides.h b/include/asm-mips/mach-ip28/cpu-feature-overrides.h deleted file mode 100644 index 9a53b326f848..000000000000 --- a/include/asm-mips/mach-ip28/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 Ralf Baechle | ||
7 | * 6/2004 pf | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H | ||
10 | #define __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H | ||
11 | |||
12 | /* | ||
13 | * IP28 only comes with R10000 family processors all using the same config | ||
14 | */ | ||
15 | #define cpu_has_watch 1 | ||
16 | #define cpu_has_mips16 0 | ||
17 | #define cpu_has_divec 0 | ||
18 | #define cpu_has_vce 0 | ||
19 | #define cpu_has_cache_cdex_p 0 | ||
20 | #define cpu_has_cache_cdex_s 0 | ||
21 | #define cpu_has_prefetch 1 | ||
22 | #define cpu_has_mcheck 0 | ||
23 | #define cpu_has_ejtag 0 | ||
24 | |||
25 | #define cpu_has_llsc 1 | ||
26 | #define cpu_has_vtag_icache 0 | ||
27 | #define cpu_has_dc_aliases 0 /* see probe_pcache() */ | ||
28 | #define cpu_has_ic_fills_f_dc 0 | ||
29 | #define cpu_has_dsp 0 | ||
30 | #define cpu_icache_snoops_remote_store 1 | ||
31 | #define cpu_has_mipsmt 0 | ||
32 | #define cpu_has_userlocal 0 | ||
33 | |||
34 | #define cpu_has_nofpuex 0 | ||
35 | #define cpu_has_64bits 1 | ||
36 | |||
37 | #define cpu_has_4kex 1 | ||
38 | #define cpu_has_4k_cache 1 | ||
39 | |||
40 | #define cpu_has_inclusive_pcaches 1 | ||
41 | |||
42 | #define cpu_dcache_line_size() 32 | ||
43 | #define cpu_icache_line_size() 64 | ||
44 | |||
45 | #define cpu_has_mips32r1 0 | ||
46 | #define cpu_has_mips32r2 0 | ||
47 | #define cpu_has_mips64r1 0 | ||
48 | #define cpu_has_mips64r2 0 | ||
49 | |||
50 | #endif /* __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-ip28/ds1286.h b/include/asm-mips/mach-ip28/ds1286.h deleted file mode 100644 index 471bb9a33e0f..000000000000 --- a/include/asm-mips/mach-ip28/ds1286.h +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_IP28_DS1286_H | ||
2 | #define __ASM_MACH_IP28_DS1286_H | ||
3 | #include <asm/mach-ip22/ds1286.h> | ||
4 | #endif /* __ASM_MACH_IP28_DS1286_H */ | ||
diff --git a/include/asm-mips/mach-ip28/spaces.h b/include/asm-mips/mach-ip28/spaces.h deleted file mode 100644 index 05aabb27e5e7..000000000000 --- a/include/asm-mips/mach-ip28/spaces.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle | ||
7 | * Copyright (C) 2000, 2002 Maciej W. Rozycki | ||
8 | * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc. | ||
9 | * 2004 pf | ||
10 | */ | ||
11 | #ifndef _ASM_MACH_IP28_SPACES_H | ||
12 | #define _ASM_MACH_IP28_SPACES_H | ||
13 | |||
14 | #define CAC_BASE 0xa800000000000000 | ||
15 | |||
16 | #define HIGHMEM_START (~0UL) | ||
17 | |||
18 | #define PHYS_OFFSET _AC(0x20000000, UL) | ||
19 | |||
20 | #include <asm/mach-generic/spaces.h> | ||
21 | |||
22 | #endif /* _ASM_MACH_IP28_SPACES_H */ | ||
diff --git a/include/asm-mips/mach-ip28/war.h b/include/asm-mips/mach-ip28/war.h deleted file mode 100644 index a1baafab486a..000000000000 --- a/include/asm-mips/mach-ip28/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_IP28_WAR_H | ||
9 | #define __ASM_MIPS_MACH_IP28_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 1 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_IP28_WAR_H */ | ||
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h deleted file mode 100644 index 6782fccebe8d..000000000000 --- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2005 Ilya A. Volynets-Evenbakh | ||
7 | * Copyright (C) 2005, 07 Ralf Baechle (ralf@linux-mips.org) | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H | ||
10 | #define __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H | ||
11 | |||
12 | |||
13 | /* | ||
14 | * R5000 has an interesting "restriction": ll(d)/sc(d) | ||
15 | * instructions to XKPHYS region simply do uncached bus | ||
16 | * requests. This breaks all the atomic bitops functions. | ||
17 | * so, for 64bit IP32 kernel we just don't use ll/sc. | ||
18 | * This does not affect luserland. | ||
19 | */ | ||
20 | #if (defined(CONFIG_CPU_R5000) || defined(CONFIG_CPU_NEVADA)) && defined(CONFIG_64BIT) | ||
21 | #define cpu_has_llsc 0 | ||
22 | #else | ||
23 | #define cpu_has_llsc 1 | ||
24 | #endif | ||
25 | |||
26 | /* Settings which are common for all ip32 CPUs */ | ||
27 | #define cpu_has_tlb 1 | ||
28 | #define cpu_has_4kex 1 | ||
29 | #define cpu_has_fpu 1 | ||
30 | #define cpu_has_32fpr 1 | ||
31 | #define cpu_has_counter 1 | ||
32 | #define cpu_has_mips16 0 | ||
33 | #define cpu_has_vce 0 | ||
34 | #define cpu_has_cache_cdex_s 0 | ||
35 | #define cpu_has_mcheck 0 | ||
36 | #define cpu_has_ejtag 0 | ||
37 | #define cpu_has_vtag_icache 0 | ||
38 | #define cpu_has_ic_fills_f_dc 0 | ||
39 | #define cpu_has_dsp 0 | ||
40 | #define cpu_has_4k_cache 1 | ||
41 | #define cpu_has_mipsmt 0 | ||
42 | #define cpu_has_userlocal 0 | ||
43 | |||
44 | |||
45 | #define cpu_has_mips32r1 0 | ||
46 | #define cpu_has_mips32r2 0 | ||
47 | #define cpu_has_mips64r1 0 | ||
48 | #define cpu_has_mips64r2 0 | ||
49 | |||
50 | #endif /* __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-ip32/dma-coherence.h b/include/asm-mips/mach-ip32/dma-coherence.h deleted file mode 100644 index a5511ebb2d53..000000000000 --- a/include/asm-mips/mach-ip32/dma-coherence.h +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org> | ||
7 | * | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_IP32_DMA_COHERENCE_H | ||
10 | #define __ASM_MACH_IP32_DMA_COHERENCE_H | ||
11 | |||
12 | #include <asm/ip32/crime.h> | ||
13 | |||
14 | struct device; | ||
15 | |||
16 | /* | ||
17 | * Few notes. | ||
18 | * 1. CPU sees memory as two chunks: 0-256M@0x0, and the rest @0x40000000+256M | ||
19 | * 2. PCI sees memory as one big chunk @0x0 (or we could use 0x40000000 for | ||
20 | * native-endian) | ||
21 | * 3. All other devices see memory as one big chunk at 0x40000000 | ||
22 | * 4. Non-PCI devices will pass NULL as struct device* | ||
23 | * | ||
24 | * Thus we translate differently, depending on device. | ||
25 | */ | ||
26 | |||
27 | #define RAM_OFFSET_MASK 0x3fffffffUL | ||
28 | |||
29 | static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, | ||
30 | size_t size) | ||
31 | { | ||
32 | dma_addr_t pa = virt_to_phys(addr) & RAM_OFFSET_MASK; | ||
33 | |||
34 | if (dev == NULL) | ||
35 | pa += CRIME_HI_MEM_BASE; | ||
36 | |||
37 | return pa; | ||
38 | } | ||
39 | |||
40 | static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page) | ||
41 | { | ||
42 | dma_addr_t pa; | ||
43 | |||
44 | pa = page_to_phys(page) & RAM_OFFSET_MASK; | ||
45 | |||
46 | if (dev == NULL) | ||
47 | pa += CRIME_HI_MEM_BASE; | ||
48 | |||
49 | return pa; | ||
50 | } | ||
51 | |||
52 | /* This is almost certainly wrong but it's what dma-ip32.c used to use */ | ||
53 | static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | ||
54 | { | ||
55 | unsigned long addr = dma_addr & RAM_OFFSET_MASK; | ||
56 | |||
57 | if (dma_addr >= 256*1024*1024) | ||
58 | addr += CRIME_HI_MEM_BASE; | ||
59 | |||
60 | return addr; | ||
61 | } | ||
62 | |||
63 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) | ||
64 | { | ||
65 | } | ||
66 | |||
67 | static inline int plat_device_is_coherent(struct device *dev) | ||
68 | { | ||
69 | return 0; /* IP32 is non-cohernet */ | ||
70 | } | ||
71 | |||
72 | #endif /* __ASM_MACH_IP32_DMA_COHERENCE_H */ | ||
diff --git a/include/asm-mips/mach-ip32/kmalloc.h b/include/asm-mips/mach-ip32/kmalloc.h deleted file mode 100644 index b1e0be60f720..000000000000 --- a/include/asm-mips/mach-ip32/kmalloc.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_IP32_KMALLOC_H | ||
2 | #define __ASM_MACH_IP32_KMALLOC_H | ||
3 | |||
4 | |||
5 | #if defined(CONFIG_CPU_R5000) || defined(CONFIG_CPU_RM7000) | ||
6 | #define ARCH_KMALLOC_MINALIGN 32 | ||
7 | #else | ||
8 | #define ARCH_KMALLOC_MINALIGN 128 | ||
9 | #endif | ||
10 | |||
11 | #endif /* __ASM_MACH_IP32_KMALLOC_H */ | ||
diff --git a/include/asm-mips/mach-ip32/mangle-port.h b/include/asm-mips/mach-ip32/mangle-port.h deleted file mode 100644 index f1d0f1756a9f..000000000000 --- a/include/asm-mips/mach-ip32/mangle-port.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 Ladislav Michl | ||
7 | * Copyright (C) 2004 Ralf Baechle | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_IP32_MANGLE_PORT_H | ||
10 | #define __ASM_MACH_IP32_MANGLE_PORT_H | ||
11 | |||
12 | #define __swizzle_addr_b(port) ((port) ^ 3) | ||
13 | #define __swizzle_addr_w(port) ((port) ^ 2) | ||
14 | #define __swizzle_addr_l(port) (port) | ||
15 | #define __swizzle_addr_q(port) (port) | ||
16 | |||
17 | # define ioswabb(a, x) (x) | ||
18 | # define __mem_ioswabb(a, x) (x) | ||
19 | # define ioswabw(a, x) (x) | ||
20 | # define __mem_ioswabw(a, x) cpu_to_le16(x) | ||
21 | # define ioswabl(a, x) (x) | ||
22 | # define __mem_ioswabl(a, x) cpu_to_le32(x) | ||
23 | # define ioswabq(a, x) (x) | ||
24 | # define __mem_ioswabq(a, x) cpu_to_le32(x) | ||
25 | |||
26 | #endif /* __ASM_MACH_IP32_MANGLE_PORT_H */ | ||
diff --git a/include/asm-mips/mach-ip32/mc146818rtc.h b/include/asm-mips/mach-ip32/mc146818rtc.h deleted file mode 100644 index c28ba8d84076..000000000000 --- a/include/asm-mips/mach-ip32/mc146818rtc.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 2001, 03 by Ralf Baechle | ||
7 | * Copyright (C) 2000 Harald Koerfgen | ||
8 | * | ||
9 | * RTC routines for IP32 style attached Dallas chip. | ||
10 | */ | ||
11 | #ifndef __ASM_MACH_IP32_MC146818RTC_H | ||
12 | #define __ASM_MACH_IP32_MC146818RTC_H | ||
13 | |||
14 | #include <asm/ip32/mace.h> | ||
15 | |||
16 | #define RTC_PORT(x) (0x70 + (x)) | ||
17 | |||
18 | static unsigned char CMOS_READ(unsigned long addr) | ||
19 | { | ||
20 | return mace->isa.rtc[addr << 8]; | ||
21 | } | ||
22 | |||
23 | static inline void CMOS_WRITE(unsigned char data, unsigned long addr) | ||
24 | { | ||
25 | mace->isa.rtc[addr << 8] = data; | ||
26 | } | ||
27 | |||
28 | /* | ||
29 | * FIXME: Do it right. For now just assume that noone lives in 20th century | ||
30 | * and no O2 user in 22th century ;-) | ||
31 | */ | ||
32 | #define mc146818_decode_year(year) ((year) + 2000) | ||
33 | |||
34 | #define RTC_ALWAYS_BCD 0 | ||
35 | |||
36 | #endif /* __ASM_MACH_IP32_MC146818RTC_H */ | ||
diff --git a/include/asm-mips/mach-ip32/war.h b/include/asm-mips/mach-ip32/war.h deleted file mode 100644 index d194056dcd7a..000000000000 --- a/include/asm-mips/mach-ip32/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_IP32_WAR_H | ||
9 | #define __ASM_MIPS_MACH_IP32_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 1 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_IP32_WAR_H */ | ||
diff --git a/include/asm-mips/mach-jazz/dma-coherence.h b/include/asm-mips/mach-jazz/dma-coherence.h deleted file mode 100644 index d66979a124a8..000000000000 --- a/include/asm-mips/mach-jazz/dma-coherence.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_JAZZ_DMA_COHERENCE_H | ||
9 | #define __ASM_MACH_JAZZ_DMA_COHERENCE_H | ||
10 | |||
11 | #include <asm/jazzdma.h> | ||
12 | |||
13 | struct device; | ||
14 | |||
15 | static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size) | ||
16 | { | ||
17 | return vdma_alloc(virt_to_phys(addr), size); | ||
18 | } | ||
19 | |||
20 | static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page) | ||
21 | { | ||
22 | return vdma_alloc(page_to_phys(page), PAGE_SIZE); | ||
23 | } | ||
24 | |||
25 | static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | ||
26 | { | ||
27 | return vdma_log2phys(dma_addr); | ||
28 | } | ||
29 | |||
30 | static void plat_unmap_dma_mem(dma_addr_t dma_addr) | ||
31 | { | ||
32 | vdma_free(dma_addr); | ||
33 | } | ||
34 | |||
35 | static inline int plat_device_is_coherent(struct device *dev) | ||
36 | { | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | #endif /* __ASM_MACH_JAZZ_DMA_COHERENCE_H */ | ||
diff --git a/include/asm-mips/mach-jazz/floppy.h b/include/asm-mips/mach-jazz/floppy.h deleted file mode 100644 index 56e9ca6ae426..000000000000 --- a/include/asm-mips/mach-jazz/floppy.h +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_JAZZ_FLOPPY_H | ||
9 | #define __ASM_MACH_JAZZ_FLOPPY_H | ||
10 | |||
11 | #include <linux/delay.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/linkage.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/mm.h> | ||
16 | #include <asm/addrspace.h> | ||
17 | #include <asm/jazz.h> | ||
18 | #include <asm/jazzdma.h> | ||
19 | #include <asm/pgtable.h> | ||
20 | |||
21 | static inline unsigned char fd_inb(unsigned int port) | ||
22 | { | ||
23 | unsigned char c; | ||
24 | |||
25 | c = *(volatile unsigned char *) port; | ||
26 | udelay(1); | ||
27 | |||
28 | return c; | ||
29 | } | ||
30 | |||
31 | static inline void fd_outb(unsigned char value, unsigned int port) | ||
32 | { | ||
33 | *(volatile unsigned char *) port = value; | ||
34 | } | ||
35 | |||
36 | /* | ||
37 | * How to access the floppy DMA functions. | ||
38 | */ | ||
39 | static inline void fd_enable_dma(void) | ||
40 | { | ||
41 | vdma_enable(JAZZ_FLOPPY_DMA); | ||
42 | } | ||
43 | |||
44 | static inline void fd_disable_dma(void) | ||
45 | { | ||
46 | vdma_disable(JAZZ_FLOPPY_DMA); | ||
47 | } | ||
48 | |||
49 | static inline int fd_request_dma(void) | ||
50 | { | ||
51 | return 0; | ||
52 | } | ||
53 | |||
54 | static inline void fd_free_dma(void) | ||
55 | { | ||
56 | } | ||
57 | |||
58 | static inline void fd_clear_dma_ff(void) | ||
59 | { | ||
60 | } | ||
61 | |||
62 | static inline void fd_set_dma_mode(char mode) | ||
63 | { | ||
64 | vdma_set_mode(JAZZ_FLOPPY_DMA, mode); | ||
65 | } | ||
66 | |||
67 | static inline void fd_set_dma_addr(char *a) | ||
68 | { | ||
69 | vdma_set_addr(JAZZ_FLOPPY_DMA, vdma_phys2log(CPHYSADDR((unsigned long)a))); | ||
70 | } | ||
71 | |||
72 | static inline void fd_set_dma_count(unsigned int count) | ||
73 | { | ||
74 | vdma_set_count(JAZZ_FLOPPY_DMA, count); | ||
75 | } | ||
76 | |||
77 | static inline int fd_get_dma_residue(void) | ||
78 | { | ||
79 | return vdma_get_residue(JAZZ_FLOPPY_DMA); | ||
80 | } | ||
81 | |||
82 | static inline void fd_enable_irq(void) | ||
83 | { | ||
84 | } | ||
85 | |||
86 | static inline void fd_disable_irq(void) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | static inline int fd_request_irq(void) | ||
91 | { | ||
92 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | ||
93 | IRQF_DISABLED, "floppy", NULL); | ||
94 | } | ||
95 | |||
96 | static inline void fd_free_irq(void) | ||
97 | { | ||
98 | free_irq(FLOPPY_IRQ, NULL); | ||
99 | } | ||
100 | |||
101 | static inline unsigned long fd_getfdaddr1(void) | ||
102 | { | ||
103 | return JAZZ_FDC_BASE; | ||
104 | } | ||
105 | |||
106 | static inline unsigned long fd_dma_mem_alloc(unsigned long size) | ||
107 | { | ||
108 | unsigned long mem; | ||
109 | |||
110 | mem = __get_dma_pages(GFP_KERNEL, get_order(size)); | ||
111 | if(!mem) | ||
112 | return 0; | ||
113 | vdma_alloc(CPHYSADDR(mem), size); /* XXX error checking */ | ||
114 | |||
115 | return mem; | ||
116 | } | ||
117 | |||
118 | static inline void fd_dma_mem_free(unsigned long addr, unsigned long size) | ||
119 | { | ||
120 | vdma_free(vdma_phys2log(CPHYSADDR(addr))); | ||
121 | free_pages(addr, get_order(size)); | ||
122 | } | ||
123 | |||
124 | static inline unsigned long fd_drive_type(unsigned long n) | ||
125 | { | ||
126 | /* XXX This is wrong for machines with ED 2.88mb disk drives like the | ||
127 | Olivetti M700. Anyway, we should suck this from the ARC | ||
128 | firmware. */ | ||
129 | if (n == 0) | ||
130 | return 4; /* 3,5", 1.44mb */ | ||
131 | |||
132 | return 0; | ||
133 | } | ||
134 | |||
135 | #endif /* __ASM_MACH_JAZZ_FLOPPY_H */ | ||
diff --git a/include/asm-mips/mach-jazz/mc146818rtc.h b/include/asm-mips/mach-jazz/mc146818rtc.h deleted file mode 100644 index 987f727afe25..000000000000 --- a/include/asm-mips/mach-jazz/mc146818rtc.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 2001, 03 by Ralf Baechle | ||
7 | * Copyright (C) 2007 Thomas Bogendoerfer | ||
8 | * | ||
9 | * RTC routines for Jazz style attached Dallas chip. | ||
10 | */ | ||
11 | #ifndef __ASM_MACH_JAZZ_MC146818RTC_H | ||
12 | #define __ASM_MACH_JAZZ_MC146818RTC_H | ||
13 | |||
14 | #include <linux/delay.h> | ||
15 | |||
16 | #include <asm/io.h> | ||
17 | #include <asm/jazz.h> | ||
18 | |||
19 | #define RTC_PORT(x) (0x70 + (x)) | ||
20 | #define RTC_IRQ 8 | ||
21 | |||
22 | static inline unsigned char CMOS_READ(unsigned long addr) | ||
23 | { | ||
24 | outb_p(addr, RTC_PORT(0)); | ||
25 | return *(volatile char *)JAZZ_RTC_BASE; | ||
26 | } | ||
27 | |||
28 | static inline void CMOS_WRITE(unsigned char data, unsigned long addr) | ||
29 | { | ||
30 | outb_p(addr, RTC_PORT(0)); | ||
31 | *(volatile char *)JAZZ_RTC_BASE = data; | ||
32 | } | ||
33 | |||
34 | #define RTC_ALWAYS_BCD 0 | ||
35 | |||
36 | #define mc146818_decode_year(year) ((year) + 1980) | ||
37 | |||
38 | #endif /* __ASM_MACH_JAZZ_MC146818RTC_H */ | ||
diff --git a/include/asm-mips/mach-jazz/war.h b/include/asm-mips/mach-jazz/war.h deleted file mode 100644 index 6158ee861bfd..000000000000 --- a/include/asm-mips/mach-jazz/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_JAZZ_WAR_H | ||
9 | #define __ASM_MIPS_MACH_JAZZ_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_JAZZ_WAR_H */ | ||
diff --git a/include/asm-mips/mach-lasat/irq.h b/include/asm-mips/mach-lasat/irq.h deleted file mode 100644 index 3a282419d5f9..000000000000 --- a/include/asm-mips/mach-lasat/irq.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #ifndef _ASM_MACH_LASAT_IRQ_H | ||
2 | #define _ASM_MACH_LASAT_IRQ_H | ||
3 | |||
4 | #define LASAT_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 2) | ||
5 | |||
6 | #define LASAT_IRQ_BASE 8 | ||
7 | #define LASAT_IRQ_END 23 | ||
8 | |||
9 | #define NR_IRQS 24 | ||
10 | |||
11 | #include_next <irq.h> | ||
12 | |||
13 | #endif /* _ASM_MACH_LASAT_IRQ_H */ | ||
diff --git a/include/asm-mips/mach-lasat/mach-gt64120.h b/include/asm-mips/mach-lasat/mach-gt64120.h deleted file mode 100644 index 1a9ad45cc135..000000000000 --- a/include/asm-mips/mach-lasat/mach-gt64120.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * This is a direct copy of the ev96100.h file, with a global | ||
3 | * search and replace. The numbers are the same. | ||
4 | * | ||
5 | * The reason I'm duplicating this is so that the 64120/96100 | ||
6 | * defines won't be confusing in the source code. | ||
7 | */ | ||
8 | #ifndef _ASM_GT64120_LASAT_GT64120_DEP_H | ||
9 | #define _ASM_GT64120_LASAT_GT64120_DEP_H | ||
10 | |||
11 | /* | ||
12 | * GT64120 config space base address on Lasat 100 | ||
13 | */ | ||
14 | #define GT64120_BASE (KSEG1ADDR(0x14000000)) | ||
15 | |||
16 | /* | ||
17 | * PCI Bus allocation | ||
18 | * | ||
19 | * (Guessing ...) | ||
20 | */ | ||
21 | #define GT_PCI_MEM_BASE 0x12000000UL | ||
22 | #define GT_PCI_MEM_SIZE 0x02000000UL | ||
23 | #define GT_PCI_IO_BASE 0x10000000UL | ||
24 | #define GT_PCI_IO_SIZE 0x02000000UL | ||
25 | #define GT_ISA_IO_BASE PCI_IO_BASE | ||
26 | |||
27 | #endif /* _ASM_GT64120_LASAT_GT64120_DEP_H */ | ||
diff --git a/include/asm-mips/mach-lasat/war.h b/include/asm-mips/mach-lasat/war.h deleted file mode 100644 index bb1e0325c9be..000000000000 --- a/include/asm-mips/mach-lasat/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_LASAT_WAR_H | ||
9 | #define __ASM_MIPS_MACH_LASAT_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_LASAT_WAR_H */ | ||
diff --git a/include/asm-mips/mach-lemote/dma-coherence.h b/include/asm-mips/mach-lemote/dma-coherence.h deleted file mode 100644 index 7e914777ebc4..000000000000 --- a/include/asm-mips/mach-lemote/dma-coherence.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006, 07 Ralf Baechle <ralf@linux-mips.org> | ||
7 | * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology | ||
8 | * Author: Fuxin Zhang, zhangfx@lemote.com | ||
9 | * | ||
10 | */ | ||
11 | #ifndef __ASM_MACH_LEMOTE_DMA_COHERENCE_H | ||
12 | #define __ASM_MACH_LEMOTE_DMA_COHERENCE_H | ||
13 | |||
14 | struct device; | ||
15 | |||
16 | static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, | ||
17 | size_t size) | ||
18 | { | ||
19 | return virt_to_phys(addr) | 0x80000000; | ||
20 | } | ||
21 | |||
22 | static inline dma_addr_t plat_map_dma_mem_page(struct device *dev, | ||
23 | struct page *page) | ||
24 | { | ||
25 | return page_to_phys(page) | 0x80000000; | ||
26 | } | ||
27 | |||
28 | static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | ||
29 | { | ||
30 | return dma_addr & 0x7fffffff; | ||
31 | } | ||
32 | |||
33 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) | ||
34 | { | ||
35 | } | ||
36 | |||
37 | static inline int plat_device_is_coherent(struct device *dev) | ||
38 | { | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | #endif /* __ASM_MACH_LEMOTE_DMA_COHERENCE_H */ | ||
diff --git a/include/asm-mips/mach-lemote/mc146818rtc.h b/include/asm-mips/mach-lemote/mc146818rtc.h deleted file mode 100644 index ed5147e11085..000000000000 --- a/include/asm-mips/mach-lemote/mc146818rtc.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 2001, 03, 07 by Ralf Baechle (ralf@linux-mips.org) | ||
7 | * | ||
8 | * RTC routines for PC style attached Dallas chip. | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_LEMOTE_MC146818RTC_H | ||
11 | #define __ASM_MACH_LEMOTE_MC146818RTC_H | ||
12 | |||
13 | #include <linux/io.h> | ||
14 | |||
15 | #define RTC_PORT(x) (0x70 + (x)) | ||
16 | #define RTC_IRQ 8 | ||
17 | |||
18 | static inline unsigned char CMOS_READ(unsigned long addr) | ||
19 | { | ||
20 | outb_p(addr, RTC_PORT(0)); | ||
21 | return inb_p(RTC_PORT(1)); | ||
22 | } | ||
23 | |||
24 | static inline void CMOS_WRITE(unsigned char data, unsigned long addr) | ||
25 | { | ||
26 | outb_p(addr, RTC_PORT(0)); | ||
27 | outb_p(data, RTC_PORT(1)); | ||
28 | } | ||
29 | |||
30 | #define RTC_ALWAYS_BCD 0 | ||
31 | |||
32 | #ifndef mc146818_decode_year | ||
33 | #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970) | ||
34 | #endif | ||
35 | |||
36 | #endif /* __ASM_MACH_LEMOTE_MC146818RTC_H */ | ||
diff --git a/include/asm-mips/mach-lemote/war.h b/include/asm-mips/mach-lemote/war.h deleted file mode 100644 index 05f89e0f2a11..000000000000 --- a/include/asm-mips/mach-lemote/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_LEMOTE_WAR_H | ||
9 | #define __ASM_MIPS_MACH_LEMOTE_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_LEMOTE_WAR_H */ | ||
diff --git a/include/asm-mips/mach-malta/cpu-feature-overrides.h b/include/asm-mips/mach-malta/cpu-feature-overrides.h deleted file mode 100644 index 7f3e3f9bd23a..000000000000 --- a/include/asm-mips/mach-malta/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 2004 Chris Dearman | ||
7 | * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H | ||
10 | #define __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H | ||
11 | |||
12 | |||
13 | /* | ||
14 | * CPU feature overrides for MIPS boards | ||
15 | */ | ||
16 | #ifdef CONFIG_CPU_MIPS32 | ||
17 | #define cpu_has_tlb 1 | ||
18 | #define cpu_has_4kex 1 | ||
19 | #define cpu_has_4k_cache 1 | ||
20 | /* #define cpu_has_fpu ? */ | ||
21 | /* #define cpu_has_32fpr ? */ | ||
22 | #define cpu_has_counter 1 | ||
23 | /* #define cpu_has_watch ? */ | ||
24 | #define cpu_has_divec 1 | ||
25 | #define cpu_has_vce 0 | ||
26 | /* #define cpu_has_cache_cdex_p ? */ | ||
27 | /* #define cpu_has_cache_cdex_s ? */ | ||
28 | /* #define cpu_has_prefetch ? */ | ||
29 | #define cpu_has_mcheck 1 | ||
30 | /* #define cpu_has_ejtag ? */ | ||
31 | #ifdef CONFIG_CPU_HAS_LLSC | ||
32 | #define cpu_has_llsc 1 | ||
33 | #else | ||
34 | #define cpu_has_llsc 0 | ||
35 | #endif | ||
36 | /* #define cpu_has_vtag_icache ? */ | ||
37 | /* #define cpu_has_dc_aliases ? */ | ||
38 | /* #define cpu_has_ic_fills_f_dc ? */ | ||
39 | #define cpu_has_nofpuex 0 | ||
40 | /* #define cpu_has_64bits ? */ | ||
41 | /* #define cpu_has_64bit_zero_reg ? */ | ||
42 | /* #define cpu_has_inclusive_pcaches ? */ | ||
43 | #define cpu_icache_snoops_remote_store 1 | ||
44 | #endif | ||
45 | |||
46 | #ifdef CONFIG_CPU_MIPS64 | ||
47 | #define cpu_has_tlb 1 | ||
48 | #define cpu_has_4kex 1 | ||
49 | #define cpu_has_4k_cache 1 | ||
50 | /* #define cpu_has_fpu ? */ | ||
51 | /* #define cpu_has_32fpr ? */ | ||
52 | #define cpu_has_counter 1 | ||
53 | /* #define cpu_has_watch ? */ | ||
54 | #define cpu_has_divec 1 | ||
55 | #define cpu_has_vce 0 | ||
56 | /* #define cpu_has_cache_cdex_p ? */ | ||
57 | /* #define cpu_has_cache_cdex_s ? */ | ||
58 | /* #define cpu_has_prefetch ? */ | ||
59 | #define cpu_has_mcheck 1 | ||
60 | /* #define cpu_has_ejtag ? */ | ||
61 | #define cpu_has_llsc 1 | ||
62 | /* #define cpu_has_vtag_icache ? */ | ||
63 | /* #define cpu_has_dc_aliases ? */ | ||
64 | /* #define cpu_has_ic_fills_f_dc ? */ | ||
65 | #define cpu_has_nofpuex 0 | ||
66 | /* #define cpu_has_64bits ? */ | ||
67 | /* #define cpu_has_64bit_zero_reg ? */ | ||
68 | /* #define cpu_has_inclusive_pcaches ? */ | ||
69 | #define cpu_icache_snoops_remote_store 1 | ||
70 | #endif | ||
71 | |||
72 | #endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-malta/irq.h b/include/asm-mips/mach-malta/irq.h deleted file mode 100644 index 9b9da26683c2..000000000000 --- a/include/asm-mips/mach-malta/irq.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_MIPS_IRQ_H | ||
2 | #define __ASM_MACH_MIPS_IRQ_H | ||
3 | |||
4 | |||
5 | #define NR_IRQS 256 | ||
6 | |||
7 | #include_next <irq.h> | ||
8 | |||
9 | #endif /* __ASM_MACH_MIPS_IRQ_H */ | ||
diff --git a/include/asm-mips/mach-malta/kernel-entry-init.h b/include/asm-mips/mach-malta/kernel-entry-init.h deleted file mode 100644 index 0b793e7bf67e..000000000000 --- a/include/asm-mips/mach-malta/kernel-entry-init.h +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Chris Dearman (chris@mips.com) | ||
7 | * Copyright (C) 2007 Mips Technologies, Inc. | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H | ||
10 | #define __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H | ||
11 | |||
12 | .macro kernel_entry_setup | ||
13 | #ifdef CONFIG_MIPS_MT_SMTC | ||
14 | mfc0 t0, CP0_CONFIG | ||
15 | bgez t0, 9f | ||
16 | mfc0 t0, CP0_CONFIG, 1 | ||
17 | bgez t0, 9f | ||
18 | mfc0 t0, CP0_CONFIG, 2 | ||
19 | bgez t0, 9f | ||
20 | mfc0 t0, CP0_CONFIG, 3 | ||
21 | and t0, 1<<2 | ||
22 | bnez t0, 0f | ||
23 | 9: | ||
24 | /* Assume we came from YAMON... */ | ||
25 | PTR_LA v0, 0x9fc00534 /* YAMON print */ | ||
26 | lw v0, (v0) | ||
27 | move a0, zero | ||
28 | PTR_LA a1, nonmt_processor | ||
29 | jal v0 | ||
30 | |||
31 | PTR_LA v0, 0x9fc00520 /* YAMON exit */ | ||
32 | lw v0, (v0) | ||
33 | li a0, 1 | ||
34 | jal v0 | ||
35 | |||
36 | 1: b 1b | ||
37 | |||
38 | __INITDATA | ||
39 | nonmt_processor: | ||
40 | .asciz "SMTC kernel requires the MT ASE to run\n" | ||
41 | __FINIT | ||
42 | 0: | ||
43 | #endif | ||
44 | .endm | ||
45 | |||
46 | /* | ||
47 | * Do SMP slave processor setup necessary before we can safely execute C code. | ||
48 | */ | ||
49 | .macro smp_slave_setup | ||
50 | .endm | ||
51 | |||
52 | #endif /* __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H */ | ||
diff --git a/include/asm-mips/mach-malta/mach-gt64120.h b/include/asm-mips/mach-malta/mach-gt64120.h deleted file mode 100644 index 0f863148f3b6..000000000000 --- a/include/asm-mips/mach-malta/mach-gt64120.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * This is a direct copy of the ev96100.h file, with a global | ||
3 | * search and replace. The numbers are the same. | ||
4 | * | ||
5 | * The reason I'm duplicating this is so that the 64120/96100 | ||
6 | * defines won't be confusing in the source code. | ||
7 | */ | ||
8 | #ifndef _ASM_MACH_MIPS_MACH_GT64120_DEP_H | ||
9 | #define _ASM_MACH_MIPS_MACH_GT64120_DEP_H | ||
10 | |||
11 | #define MIPS_GT_BASE 0x1be00000 | ||
12 | |||
13 | extern unsigned long _pcictrl_gt64120; | ||
14 | /* | ||
15 | * GT64120 config space base address | ||
16 | */ | ||
17 | #define GT64120_BASE _pcictrl_gt64120 | ||
18 | |||
19 | #endif /* _ASM_MACH_MIPS_MACH_GT64120_DEP_H */ | ||
diff --git a/include/asm-mips/mach-malta/mc146818rtc.h b/include/asm-mips/mach-malta/mc146818rtc.h deleted file mode 100644 index ea612f37f614..000000000000 --- a/include/asm-mips/mach-malta/mc146818rtc.h +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * Copyright (C) 2003 by Ralf Baechle | ||
5 | * | ||
6 | * This program is free software; you can distribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License (Version 2) as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
13 | * for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along | ||
16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
17 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
18 | * | ||
19 | * RTC routines for Malta style attached PIIX4 device, which contains a | ||
20 | * Motorola MC146818A-compatible Real Time Clock. | ||
21 | */ | ||
22 | #ifndef __ASM_MACH_MALTA_MC146818RTC_H | ||
23 | #define __ASM_MACH_MALTA_MC146818RTC_H | ||
24 | |||
25 | #include <asm/io.h> | ||
26 | #include <asm/mips-boards/generic.h> | ||
27 | #include <asm/mips-boards/malta.h> | ||
28 | |||
29 | #define RTC_PORT(x) (0x70 + (x)) | ||
30 | #define RTC_IRQ 8 | ||
31 | |||
32 | static inline unsigned char CMOS_READ(unsigned long addr) | ||
33 | { | ||
34 | outb(addr, MALTA_RTC_ADR_REG); | ||
35 | return inb(MALTA_RTC_DAT_REG); | ||
36 | } | ||
37 | |||
38 | static inline void CMOS_WRITE(unsigned char data, unsigned long addr) | ||
39 | { | ||
40 | outb(addr, MALTA_RTC_ADR_REG); | ||
41 | outb(data, MALTA_RTC_DAT_REG); | ||
42 | } | ||
43 | |||
44 | #define RTC_ALWAYS_BCD 0 | ||
45 | |||
46 | #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) | ||
47 | |||
48 | #endif /* __ASM_MACH_MALTA_MC146818RTC_H */ | ||
diff --git a/include/asm-mips/mach-malta/war.h b/include/asm-mips/mach-malta/war.h deleted file mode 100644 index 7c6931d5f45f..000000000000 --- a/include/asm-mips/mach-malta/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_MIPS_WAR_H | ||
9 | #define __ASM_MIPS_MACH_MIPS_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 1 | ||
18 | #define MIPS_CACHE_SYNC_WAR 1 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 1 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_MIPS_WAR_H */ | ||
diff --git a/include/asm-mips/mach-mipssim/cpu-feature-overrides.h b/include/asm-mips/mach-mipssim/cpu-feature-overrides.h deleted file mode 100644 index 779b02205737..000000000000 --- a/include/asm-mips/mach-mipssim/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 2004 Chris Dearman | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H | ||
9 | #define __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H | ||
10 | |||
11 | |||
12 | /* | ||
13 | * CPU feature overrides for MIPS boards | ||
14 | */ | ||
15 | #ifdef CONFIG_CPU_MIPS32 | ||
16 | #define cpu_has_tlb 1 | ||
17 | #define cpu_has_4kex 1 | ||
18 | #define cpu_has_4k_cache 1 | ||
19 | #define cpu_has_fpu 0 | ||
20 | /* #define cpu_has_32fpr ? */ | ||
21 | #define cpu_has_counter 1 | ||
22 | /* #define cpu_has_watch ? */ | ||
23 | #define cpu_has_divec 1 | ||
24 | #define cpu_has_vce 0 | ||
25 | /* #define cpu_has_cache_cdex_p ? */ | ||
26 | /* #define cpu_has_cache_cdex_s ? */ | ||
27 | /* #define cpu_has_prefetch ? */ | ||
28 | #define cpu_has_mcheck 1 | ||
29 | /* #define cpu_has_ejtag ? */ | ||
30 | #define cpu_has_llsc 1 | ||
31 | /* #define cpu_has_vtag_icache ? */ | ||
32 | /* #define cpu_has_dc_aliases ? */ | ||
33 | /* #define cpu_has_ic_fills_f_dc ? */ | ||
34 | #define cpu_has_nofpuex 0 | ||
35 | /* #define cpu_has_64bits ? */ | ||
36 | /* #define cpu_has_64bit_zero_reg ? */ | ||
37 | /* #define cpu_has_inclusive_pcaches ? */ | ||
38 | #endif | ||
39 | |||
40 | #ifdef CONFIG_CPU_MIPS64 | ||
41 | #define cpu_has_tlb 1 | ||
42 | #define cpu_has_4kex 1 | ||
43 | #define cpu_has_4k_cache 1 | ||
44 | /* #define cpu_has_fpu ? */ | ||
45 | /* #define cpu_has_32fpr ? */ | ||
46 | #define cpu_has_counter 1 | ||
47 | /* #define cpu_has_watch ? */ | ||
48 | #define cpu_has_divec 1 | ||
49 | #define cpu_has_vce 0 | ||
50 | /* #define cpu_has_cache_cdex_p ? */ | ||
51 | /* #define cpu_has_cache_cdex_s ? */ | ||
52 | /* #define cpu_has_prefetch ? */ | ||
53 | #define cpu_has_mcheck 1 | ||
54 | /* #define cpu_has_ejtag ? */ | ||
55 | #define cpu_has_llsc 1 | ||
56 | /* #define cpu_has_vtag_icache ? */ | ||
57 | /* #define cpu_has_dc_aliases ? */ | ||
58 | /* #define cpu_has_ic_fills_f_dc ? */ | ||
59 | #define cpu_has_nofpuex 0 | ||
60 | /* #define cpu_has_64bits ? */ | ||
61 | /* #define cpu_has_64bit_zero_reg ? */ | ||
62 | /* #define cpu_has_inclusive_pcaches ? */ | ||
63 | #endif | ||
64 | |||
65 | #endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-mipssim/war.h b/include/asm-mips/mach-mipssim/war.h deleted file mode 100644 index c8a74a3515e0..000000000000 --- a/include/asm-mips/mach-mipssim/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_MIPSSIM_WAR_H | ||
9 | #define __ASM_MIPS_MACH_MIPSSIM_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_MIPSSIM_WAR_H */ | ||
diff --git a/include/asm-mips/mach-pb1x00/mc146818rtc.h b/include/asm-mips/mach-pb1x00/mc146818rtc.h deleted file mode 100644 index 622c58710e5b..000000000000 --- a/include/asm-mips/mach-pb1x00/mc146818rtc.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 2001, 03 by Ralf Baechle | ||
7 | * | ||
8 | * RTC routines for PC style attached Dallas chip. | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_AU1XX_MC146818RTC_H | ||
11 | #define __ASM_MACH_AU1XX_MC146818RTC_H | ||
12 | |||
13 | #include <asm/io.h> | ||
14 | #include <asm/mach-au1x00/au1000.h> | ||
15 | |||
16 | #define RTC_PORT(x) (0x0c000000 + (x)) | ||
17 | #define RTC_IRQ 8 | ||
18 | #define PB1500_RTC_ADDR 0x0c000000 | ||
19 | |||
20 | static inline unsigned char CMOS_READ(unsigned long offset) | ||
21 | { | ||
22 | offset <<= 2; | ||
23 | return (u8)(au_readl(offset + PB1500_RTC_ADDR) & 0xff); | ||
24 | } | ||
25 | |||
26 | static inline void CMOS_WRITE(unsigned char data, unsigned long offset) | ||
27 | { | ||
28 | offset <<= 2; | ||
29 | au_writel(data, offset + PB1500_RTC_ADDR); | ||
30 | } | ||
31 | |||
32 | #define RTC_ALWAYS_BCD 1 | ||
33 | |||
34 | #endif /* __ASM_MACH_AU1XX_MC146818RTC_H */ | ||
diff --git a/include/asm-mips/mach-pb1x00/pb1000.h b/include/asm-mips/mach-pb1x00/pb1000.h deleted file mode 100644 index 6d1ff9060e44..000000000000 --- a/include/asm-mips/mach-pb1x00/pb1000.h +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | /* | ||
2 | * Alchemy Semi Pb1000 Referrence Board | ||
3 | * | ||
4 | * Copyright 2001, 2008 MontaVista Software Inc. | ||
5 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | * | ||
24 | * | ||
25 | */ | ||
26 | #ifndef __ASM_PB1000_H | ||
27 | #define __ASM_PB1000_H | ||
28 | |||
29 | /* PCMCIA PB1000 specific defines */ | ||
30 | #define PCMCIA_MAX_SOCK 1 | ||
31 | #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) | ||
32 | |||
33 | #define PB1000_PCR 0xBE000000 | ||
34 | # define PCR_SLOT_0_VPP0 (1 << 0) | ||
35 | # define PCR_SLOT_0_VPP1 (1 << 1) | ||
36 | # define PCR_SLOT_0_VCC0 (1 << 2) | ||
37 | # define PCR_SLOT_0_VCC1 (1 << 3) | ||
38 | # define PCR_SLOT_0_RST (1 << 4) | ||
39 | # define PCR_SLOT_1_VPP0 (1 << 8) | ||
40 | # define PCR_SLOT_1_VPP1 (1 << 9) | ||
41 | # define PCR_SLOT_1_VCC0 (1 << 10) | ||
42 | # define PCR_SLOT_1_VCC1 (1 << 11) | ||
43 | # define PCR_SLOT_1_RST (1 << 12) | ||
44 | |||
45 | #define PB1000_MDR 0xBE000004 | ||
46 | # define MDR_PI (1 << 5) /* PCMCIA int latch */ | ||
47 | # define MDR_EPI (1 << 14) /* enable PCMCIA int */ | ||
48 | # define MDR_CPI (1 << 15) /* clear PCMCIA int */ | ||
49 | |||
50 | #define PB1000_ACR1 0xBE000008 | ||
51 | # define ACR1_SLOT_0_CD1 (1 << 0) /* card detect 1 */ | ||
52 | # define ACR1_SLOT_0_CD2 (1 << 1) /* card detect 2 */ | ||
53 | # define ACR1_SLOT_0_READY (1 << 2) /* ready */ | ||
54 | # define ACR1_SLOT_0_STATUS (1 << 3) /* status change */ | ||
55 | # define ACR1_SLOT_0_VS1 (1 << 4) /* voltage sense 1 */ | ||
56 | # define ACR1_SLOT_0_VS2 (1 << 5) /* voltage sense 2 */ | ||
57 | # define ACR1_SLOT_0_INPACK (1 << 6) /* inpack pin status */ | ||
58 | # define ACR1_SLOT_1_CD1 (1 << 8) /* card detect 1 */ | ||
59 | # define ACR1_SLOT_1_CD2 (1 << 9) /* card detect 2 */ | ||
60 | # define ACR1_SLOT_1_READY (1 << 10) /* ready */ | ||
61 | # define ACR1_SLOT_1_STATUS (1 << 11) /* status change */ | ||
62 | # define ACR1_SLOT_1_VS1 (1 << 12) /* voltage sense 1 */ | ||
63 | # define ACR1_SLOT_1_VS2 (1 << 13) /* voltage sense 2 */ | ||
64 | # define ACR1_SLOT_1_INPACK (1 << 14) /* inpack pin status */ | ||
65 | |||
66 | #define CPLD_AUX0 0xBE00000C | ||
67 | #define CPLD_AUX1 0xBE000010 | ||
68 | #define CPLD_AUX2 0xBE000014 | ||
69 | |||
70 | /* Voltage levels */ | ||
71 | |||
72 | /* VPPEN1 - VPPEN0 */ | ||
73 | #define VPP_GND ((0 << 1) | (0 << 0)) | ||
74 | #define VPP_5V ((1 << 1) | (0 << 0)) | ||
75 | #define VPP_3V ((0 << 1) | (1 << 0)) | ||
76 | #define VPP_12V ((0 << 1) | (1 << 0)) | ||
77 | #define VPP_HIZ ((1 << 1) | (1 << 0)) | ||
78 | |||
79 | /* VCCEN1 - VCCEN0 */ | ||
80 | #define VCC_3V ((0 << 1) | (1 << 0)) | ||
81 | #define VCC_5V ((1 << 1) | (0 << 0)) | ||
82 | #define VCC_HIZ ((0 << 1) | (0 << 0)) | ||
83 | |||
84 | /* VPP/VCC */ | ||
85 | #define SET_VCC_VPP(VCC, VPP, SLOT) \ | ||
86 | ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8)) | ||
87 | #endif /* __ASM_PB1000_H */ | ||
diff --git a/include/asm-mips/mach-pb1x00/pb1100.h b/include/asm-mips/mach-pb1x00/pb1100.h deleted file mode 100644 index b1a60f1cbd02..000000000000 --- a/include/asm-mips/mach-pb1x00/pb1100.h +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /* | ||
2 | * Alchemy Semi Pb1100 Referrence Board | ||
3 | * | ||
4 | * Copyright 2001, 2008 MontaVista Software Inc. | ||
5 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | * | ||
24 | * | ||
25 | */ | ||
26 | #ifndef __ASM_PB1100_H | ||
27 | #define __ASM_PB1100_H | ||
28 | |||
29 | #define PB1100_IDENT 0xAE000000 | ||
30 | #define BOARD_STATUS_REG 0xAE000004 | ||
31 | # define PB1100_ROM_SEL (1 << 15) | ||
32 | # define PB1100_ROM_SIZ (1 << 14) | ||
33 | # define PB1100_SWAP_BOOT (1 << 13) | ||
34 | # define PB1100_FLASH_WP (1 << 12) | ||
35 | # define PB1100_ROM_H_STS (1 << 11) | ||
36 | # define PB1100_ROM_L_STS (1 << 10) | ||
37 | # define PB1100_FLASH_H_STS (1 << 9) | ||
38 | # define PB1100_FLASH_L_STS (1 << 8) | ||
39 | # define PB1100_SRAM_SIZ (1 << 7) | ||
40 | # define PB1100_TSC_BUSY (1 << 6) | ||
41 | # define PB1100_PCMCIA_VS_MASK (3 << 4) | ||
42 | # define PB1100_RS232_CD (1 << 3) | ||
43 | # define PB1100_RS232_CTS (1 << 2) | ||
44 | # define PB1100_RS232_DSR (1 << 1) | ||
45 | # define PB1100_RS232_RI (1 << 0) | ||
46 | |||
47 | #define PB1100_IRDA_RS232 0xAE00000C | ||
48 | # define PB1100_IRDA_FULL (0 << 14) /* full power */ | ||
49 | # define PB1100_IRDA_SHUTDOWN (1 << 14) | ||
50 | # define PB1100_IRDA_TT (2 << 14) /* 2/3 power */ | ||
51 | # define PB1100_IRDA_OT (3 << 14) /* 1/3 power */ | ||
52 | # define PB1100_IRDA_FIR (1 << 13) | ||
53 | |||
54 | #define PCMCIA_BOARD_REG 0xAE000010 | ||
55 | # define PB1100_SD_WP1_RO (1 << 15) /* read only */ | ||
56 | # define PB1100_SD_WP0_RO (1 << 14) /* read only */ | ||
57 | # define PB1100_SD_PWR1 (1 << 11) /* applies power to SD1 */ | ||
58 | # define PB1100_SD_PWR0 (1 << 10) /* applies power to SD0 */ | ||
59 | # define PB1100_SEL_SD_CONN1 (1 << 9) | ||
60 | # define PB1100_SEL_SD_CONN0 (1 << 8) | ||
61 | # define PC_DEASSERT_RST (1 << 7) | ||
62 | # define PC_DRV_EN (1 << 4) | ||
63 | |||
64 | #define PB1100_G_CONTROL 0xAE000014 /* graphics control */ | ||
65 | |||
66 | #define PB1100_RST_VDDI 0xAE00001C | ||
67 | # define PB1100_SOFT_RESET (1 << 15) /* clear to reset the board */ | ||
68 | # define PB1100_VDDI_MASK 0x1F | ||
69 | |||
70 | #define PB1100_LEDS 0xAE000018 | ||
71 | |||
72 | /* | ||
73 | * 11:8 is 4 discreet LEDs. Clearing a bit illuminates the LED. | ||
74 | * 7:0 is the LED Display's decimal points. | ||
75 | */ | ||
76 | #define PB1100_HEX_LED 0xAE000018 | ||
77 | |||
78 | /* PCMCIA Pb1100 specific defines */ | ||
79 | #define PCMCIA_MAX_SOCK 0 | ||
80 | #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) | ||
81 | |||
82 | /* VPP/VCC */ | ||
83 | #define SET_VCC_VPP(VCC, VPP) (((VCC) << 2) | ((VPP) << 0)) | ||
84 | |||
85 | #endif /* __ASM_PB1100_H */ | ||
diff --git a/include/asm-mips/mach-pb1x00/pb1200.h b/include/asm-mips/mach-pb1x00/pb1200.h deleted file mode 100644 index c8618df88cb5..000000000000 --- a/include/asm-mips/mach-pb1x00/pb1200.h +++ /dev/null | |||
@@ -1,259 +0,0 @@ | |||
1 | /* | ||
2 | * AMD Alchemy Pb1200 Referrence Board | ||
3 | * Board Registers defines. | ||
4 | * | ||
5 | * ######################################################################## | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | ||
20 | * ######################################################################## | ||
21 | * | ||
22 | * | ||
23 | */ | ||
24 | #ifndef __ASM_PB1200_H | ||
25 | #define __ASM_PB1200_H | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | #include <asm/mach-au1x00/au1xxx_psc.h> | ||
29 | |||
30 | #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX | ||
31 | #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX | ||
32 | #define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX | ||
33 | #define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX | ||
34 | |||
35 | /* | ||
36 | * SPI and SMB are muxed on the Pb1200 board. | ||
37 | * Refer to board documentation. | ||
38 | */ | ||
39 | #define SPI_PSC_BASE PSC0_BASE_ADDR | ||
40 | #define SMBUS_PSC_BASE PSC0_BASE_ADDR | ||
41 | /* | ||
42 | * AC97 and I2S are muxed on the Pb1200 board. | ||
43 | * Refer to board documentation. | ||
44 | */ | ||
45 | #define AC97_PSC_BASE PSC1_BASE_ADDR | ||
46 | #define I2S_PSC_BASE PSC1_BASE_ADDR | ||
47 | |||
48 | #define BCSR_KSEG1_ADDR 0xAD800000 | ||
49 | |||
50 | typedef volatile struct | ||
51 | { | ||
52 | /*00*/ u16 whoami; | ||
53 | u16 reserved0; | ||
54 | /*04*/ u16 status; | ||
55 | u16 reserved1; | ||
56 | /*08*/ u16 switches; | ||
57 | u16 reserved2; | ||
58 | /*0C*/ u16 resets; | ||
59 | u16 reserved3; | ||
60 | |||
61 | /*10*/ u16 pcmcia; | ||
62 | u16 reserved4; | ||
63 | /*14*/ u16 board; | ||
64 | u16 reserved5; | ||
65 | /*18*/ u16 disk_leds; | ||
66 | u16 reserved6; | ||
67 | /*1C*/ u16 system; | ||
68 | u16 reserved7; | ||
69 | |||
70 | /*20*/ u16 intclr; | ||
71 | u16 reserved8; | ||
72 | /*24*/ u16 intset; | ||
73 | u16 reserved9; | ||
74 | /*28*/ u16 intclr_mask; | ||
75 | u16 reserved10; | ||
76 | /*2C*/ u16 intset_mask; | ||
77 | u16 reserved11; | ||
78 | |||
79 | /*30*/ u16 sig_status; | ||
80 | u16 reserved12; | ||
81 | /*34*/ u16 int_status; | ||
82 | u16 reserved13; | ||
83 | /*38*/ u16 reserved14; | ||
84 | u16 reserved15; | ||
85 | /*3C*/ u16 reserved16; | ||
86 | u16 reserved17; | ||
87 | |||
88 | } BCSR; | ||
89 | |||
90 | static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; | ||
91 | |||
92 | /* | ||
93 | * Register bit definitions for the BCSRs | ||
94 | */ | ||
95 | #define BCSR_WHOAMI_DCID 0x000F | ||
96 | #define BCSR_WHOAMI_CPLD 0x00F0 | ||
97 | #define BCSR_WHOAMI_BOARD 0x0F00 | ||
98 | |||
99 | #define BCSR_STATUS_PCMCIA0VS 0x0003 | ||
100 | #define BCSR_STATUS_PCMCIA1VS 0x000C | ||
101 | #define BCSR_STATUS_SWAPBOOT 0x0040 | ||
102 | #define BCSR_STATUS_FLASHBUSY 0x0100 | ||
103 | #define BCSR_STATUS_IDECBLID 0x0200 | ||
104 | #define BCSR_STATUS_SD0WP 0x0400 | ||
105 | #define BCSR_STATUS_SD1WP 0x0800 | ||
106 | #define BCSR_STATUS_U0RXD 0x1000 | ||
107 | #define BCSR_STATUS_U1RXD 0x2000 | ||
108 | |||
109 | #define BCSR_SWITCHES_OCTAL 0x00FF | ||
110 | #define BCSR_SWITCHES_DIP_1 0x0080 | ||
111 | #define BCSR_SWITCHES_DIP_2 0x0040 | ||
112 | #define BCSR_SWITCHES_DIP_3 0x0020 | ||
113 | #define BCSR_SWITCHES_DIP_4 0x0010 | ||
114 | #define BCSR_SWITCHES_DIP_5 0x0008 | ||
115 | #define BCSR_SWITCHES_DIP_6 0x0004 | ||
116 | #define BCSR_SWITCHES_DIP_7 0x0002 | ||
117 | #define BCSR_SWITCHES_DIP_8 0x0001 | ||
118 | #define BCSR_SWITCHES_ROTARY 0x0F00 | ||
119 | |||
120 | #define BCSR_RESETS_ETH 0x0001 | ||
121 | #define BCSR_RESETS_CAMERA 0x0002 | ||
122 | #define BCSR_RESETS_DC 0x0004 | ||
123 | #define BCSR_RESETS_IDE 0x0008 | ||
124 | /* not resets but in the same register */ | ||
125 | #define BCSR_RESETS_WSCFSM 0x0800 | ||
126 | #define BCSR_RESETS_PCS0MUX 0x1000 | ||
127 | #define BCSR_RESETS_PCS1MUX 0x2000 | ||
128 | #define BCSR_RESETS_SPISEL 0x4000 | ||
129 | #define BCSR_RESETS_SD1MUX 0x8000 | ||
130 | |||
131 | #define BCSR_PCMCIA_PC0VPP 0x0003 | ||
132 | #define BCSR_PCMCIA_PC0VCC 0x000C | ||
133 | #define BCSR_PCMCIA_PC0DRVEN 0x0010 | ||
134 | #define BCSR_PCMCIA_PC0RST 0x0080 | ||
135 | #define BCSR_PCMCIA_PC1VPP 0x0300 | ||
136 | #define BCSR_PCMCIA_PC1VCC 0x0C00 | ||
137 | #define BCSR_PCMCIA_PC1DRVEN 0x1000 | ||
138 | #define BCSR_PCMCIA_PC1RST 0x8000 | ||
139 | |||
140 | #define BCSR_BOARD_LCDVEE 0x0001 | ||
141 | #define BCSR_BOARD_LCDVDD 0x0002 | ||
142 | #define BCSR_BOARD_LCDBL 0x0004 | ||
143 | #define BCSR_BOARD_CAMSNAP 0x0010 | ||
144 | #define BCSR_BOARD_CAMPWR 0x0020 | ||
145 | #define BCSR_BOARD_SD0PWR 0x0040 | ||
146 | #define BCSR_BOARD_SD1PWR 0x0080 | ||
147 | |||
148 | #define BCSR_LEDS_DECIMALS 0x00FF | ||
149 | #define BCSR_LEDS_LED0 0x0100 | ||
150 | #define BCSR_LEDS_LED1 0x0200 | ||
151 | #define BCSR_LEDS_LED2 0x0400 | ||
152 | #define BCSR_LEDS_LED3 0x0800 | ||
153 | |||
154 | #define BCSR_SYSTEM_VDDI 0x001F | ||
155 | #define BCSR_SYSTEM_POWEROFF 0x4000 | ||
156 | #define BCSR_SYSTEM_RESET 0x8000 | ||
157 | |||
158 | /* Bit positions for the different interrupt sources */ | ||
159 | #define BCSR_INT_IDE 0x0001 | ||
160 | #define BCSR_INT_ETH 0x0002 | ||
161 | #define BCSR_INT_PC0 0x0004 | ||
162 | #define BCSR_INT_PC0STSCHG 0x0008 | ||
163 | #define BCSR_INT_PC1 0x0010 | ||
164 | #define BCSR_INT_PC1STSCHG 0x0020 | ||
165 | #define BCSR_INT_DC 0x0040 | ||
166 | #define BCSR_INT_FLASHBUSY 0x0080 | ||
167 | #define BCSR_INT_PC0INSERT 0x0100 | ||
168 | #define BCSR_INT_PC0EJECT 0x0200 | ||
169 | #define BCSR_INT_PC1INSERT 0x0400 | ||
170 | #define BCSR_INT_PC1EJECT 0x0800 | ||
171 | #define BCSR_INT_SD0INSERT 0x1000 | ||
172 | #define BCSR_INT_SD0EJECT 0x2000 | ||
173 | #define BCSR_INT_SD1INSERT 0x4000 | ||
174 | #define BCSR_INT_SD1EJECT 0x8000 | ||
175 | |||
176 | #define SMC91C111_PHYS_ADDR 0x0D000300 | ||
177 | #define SMC91C111_INT PB1200_ETH_INT | ||
178 | |||
179 | #define IDE_PHYS_ADDR 0x0C800000 | ||
180 | #define IDE_REG_SHIFT 5 | ||
181 | #define IDE_PHYS_LEN (16 << IDE_REG_SHIFT) | ||
182 | #define IDE_INT PB1200_IDE_INT | ||
183 | #define IDE_DDMA_REQ DSCR_CMD0_DMA_REQ1 | ||
184 | #define IDE_RQSIZE 128 | ||
185 | |||
186 | #define NAND_PHYS_ADDR 0x1C000000 | ||
187 | |||
188 | /* | ||
189 | * Timing values as described in databook, * ns value stripped of | ||
190 | * lower 2 bits. | ||
191 | * These defines are here rather than an Au1200 generic file because | ||
192 | * the parts chosen on another board may be different and may require | ||
193 | * different timings. | ||
194 | */ | ||
195 | #define NAND_T_H (18 >> 2) | ||
196 | #define NAND_T_PUL (30 >> 2) | ||
197 | #define NAND_T_SU (30 >> 2) | ||
198 | #define NAND_T_WH (30 >> 2) | ||
199 | |||
200 | /* Bitfield shift amounts */ | ||
201 | #define NAND_T_H_SHIFT 0 | ||
202 | #define NAND_T_PUL_SHIFT 4 | ||
203 | #define NAND_T_SU_SHIFT 8 | ||
204 | #define NAND_T_WH_SHIFT 12 | ||
205 | |||
206 | #define NAND_TIMING (((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \ | ||
207 | ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \ | ||
208 | ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \ | ||
209 | ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)) | ||
210 | |||
211 | /* | ||
212 | * External Interrupts for Pb1200 as of 8/6/2004. | ||
213 | * Bit positions in the CPLD registers can be calculated by taking | ||
214 | * the interrupt define and subtracting the PB1200_INT_BEGIN value. | ||
215 | * | ||
216 | * Example: IDE bis pos is = 64 - 64 | ||
217 | * ETH bit pos is = 65 - 64 | ||
218 | */ | ||
219 | enum external_pb1200_ints { | ||
220 | PB1200_INT_BEGIN = AU1000_MAX_INTR + 1, | ||
221 | |||
222 | PB1200_IDE_INT = PB1200_INT_BEGIN, | ||
223 | PB1200_ETH_INT, | ||
224 | PB1200_PC0_INT, | ||
225 | PB1200_PC0_STSCHG_INT, | ||
226 | PB1200_PC1_INT, | ||
227 | PB1200_PC1_STSCHG_INT, | ||
228 | PB1200_DC_INT, | ||
229 | PB1200_FLASHBUSY_INT, | ||
230 | PB1200_PC0_INSERT_INT, | ||
231 | PB1200_PC0_EJECT_INT, | ||
232 | PB1200_PC1_INSERT_INT, | ||
233 | PB1200_PC1_EJECT_INT, | ||
234 | PB1200_SD0_INSERT_INT, | ||
235 | PB1200_SD0_EJECT_INT, | ||
236 | PB1200_SD1_INSERT_INT, | ||
237 | PB1200_SD1_EJECT_INT, | ||
238 | |||
239 | PB1200_INT_END = PB1200_INT_BEGIN + 15 | ||
240 | }; | ||
241 | |||
242 | /* | ||
243 | * Pb1200 specific PCMCIA defines for drivers/pcmcia/au1000_db1x00.c | ||
244 | */ | ||
245 | #define PCMCIA_MAX_SOCK 1 | ||
246 | #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) | ||
247 | |||
248 | /* VPP/VCC */ | ||
249 | #define SET_VCC_VPP(VCC, VPP, SLOT) \ | ||
250 | ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8)) | ||
251 | |||
252 | #define BOARD_PC0_INT PB1200_PC0_INT | ||
253 | #define BOARD_PC1_INT PB1200_PC1_INT | ||
254 | #define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1 << (8 + (2 * SOCKET))) | ||
255 | |||
256 | /* NAND chip select */ | ||
257 | #define NAND_CS 1 | ||
258 | |||
259 | #endif /* __ASM_PB1200_H */ | ||
diff --git a/include/asm-mips/mach-pb1x00/pb1500.h b/include/asm-mips/mach-pb1x00/pb1500.h deleted file mode 100644 index da51a2eb7b82..000000000000 --- a/include/asm-mips/mach-pb1x00/pb1500.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* | ||
2 | * Alchemy Semi Pb1500 Referrence Board | ||
3 | * | ||
4 | * Copyright 2001, 2008 MontaVista Software Inc. | ||
5 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | * | ||
24 | * | ||
25 | */ | ||
26 | #ifndef __ASM_PB1500_H | ||
27 | #define __ASM_PB1500_H | ||
28 | |||
29 | #define IDENT_BOARD_REG 0xAE000000 | ||
30 | #define BOARD_STATUS_REG 0xAE000004 | ||
31 | #define PCI_BOARD_REG 0xAE000010 | ||
32 | #define PCMCIA_BOARD_REG 0xAE000010 | ||
33 | # define PC_DEASSERT_RST 0x80 | ||
34 | # define PC_DRV_EN 0x10 | ||
35 | #define PB1500_G_CONTROL 0xAE000014 | ||
36 | #define PB1500_RST_VDDI 0xAE00001C | ||
37 | #define PB1500_LEDS 0xAE000018 | ||
38 | |||
39 | #define PB1500_HEX_LED 0xAF000004 | ||
40 | #define PB1500_HEX_LED_BLANK 0xAF000008 | ||
41 | |||
42 | /* PCMCIA Pb1500 specific defines */ | ||
43 | #define PCMCIA_MAX_SOCK 0 | ||
44 | #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) | ||
45 | |||
46 | /* VPP/VCC */ | ||
47 | #define SET_VCC_VPP(VCC, VPP) (((VCC) << 2) | ((VPP) << 0)) | ||
48 | |||
49 | #endif /* __ASM_PB1500_H */ | ||
diff --git a/include/asm-mips/mach-pb1x00/pb1550.h b/include/asm-mips/mach-pb1x00/pb1550.h deleted file mode 100644 index 6704a11497db..000000000000 --- a/include/asm-mips/mach-pb1x00/pb1550.h +++ /dev/null | |||
@@ -1,177 +0,0 @@ | |||
1 | /* | ||
2 | * AMD Alchemy Semi PB1550 Referrence Board | ||
3 | * Board Registers defines. | ||
4 | * | ||
5 | * Copyright 2004 Embedded Edge LLC. | ||
6 | * Copyright 2005 Ralf Baechle (ralf@linux-mips.org) | ||
7 | * | ||
8 | * ######################################################################## | ||
9 | * | ||
10 | * This program is free software; you can distribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License (Version 2) as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
17 | * for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
22 | * | ||
23 | * ######################################################################## | ||
24 | * | ||
25 | * | ||
26 | */ | ||
27 | #ifndef __ASM_PB1550_H | ||
28 | #define __ASM_PB1550_H | ||
29 | |||
30 | #include <linux/types.h> | ||
31 | #include <asm/mach-au1x00/au1xxx_psc.h> | ||
32 | |||
33 | #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX | ||
34 | #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX | ||
35 | #define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX | ||
36 | #define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX | ||
37 | |||
38 | #define SPI_PSC_BASE PSC0_BASE_ADDR | ||
39 | #define AC97_PSC_BASE PSC1_BASE_ADDR | ||
40 | #define SMBUS_PSC_BASE PSC2_BASE_ADDR | ||
41 | #define I2S_PSC_BASE PSC3_BASE_ADDR | ||
42 | |||
43 | #define BCSR_PHYS_ADDR 0xAF000000 | ||
44 | |||
45 | typedef volatile struct | ||
46 | { | ||
47 | /*00*/ u16 whoami; | ||
48 | u16 reserved0; | ||
49 | /*04*/ u16 status; | ||
50 | u16 reserved1; | ||
51 | /*08*/ u16 switches; | ||
52 | u16 reserved2; | ||
53 | /*0C*/ u16 resets; | ||
54 | u16 reserved3; | ||
55 | /*10*/ u16 pcmcia; | ||
56 | u16 reserved4; | ||
57 | /*14*/ u16 pci; | ||
58 | u16 reserved5; | ||
59 | /*18*/ u16 leds; | ||
60 | u16 reserved6; | ||
61 | /*1C*/ u16 system; | ||
62 | u16 reserved7; | ||
63 | |||
64 | } BCSR; | ||
65 | |||
66 | static BCSR * const bcsr = (BCSR *)BCSR_PHYS_ADDR; | ||
67 | |||
68 | /* | ||
69 | * Register bit definitions for the BCSRs | ||
70 | */ | ||
71 | #define BCSR_WHOAMI_DCID 0x000F | ||
72 | #define BCSR_WHOAMI_CPLD 0x00F0 | ||
73 | #define BCSR_WHOAMI_BOARD 0x0F00 | ||
74 | |||
75 | #define BCSR_STATUS_PCMCIA0VS 0x0003 | ||
76 | #define BCSR_STATUS_PCMCIA1VS 0x000C | ||
77 | #define BCSR_STATUS_PCMCIA0FI 0x0010 | ||
78 | #define BCSR_STATUS_PCMCIA1FI 0x0020 | ||
79 | #define BCSR_STATUS_SWAPBOOT 0x0040 | ||
80 | #define BCSR_STATUS_SRAMWIDTH 0x0080 | ||
81 | #define BCSR_STATUS_FLASHBUSY 0x0100 | ||
82 | #define BCSR_STATUS_ROMBUSY 0x0200 | ||
83 | #define BCSR_STATUS_USBOTGID 0x0800 | ||
84 | #define BCSR_STATUS_U0RXD 0x1000 | ||
85 | #define BCSR_STATUS_U1RXD 0x2000 | ||
86 | #define BCSR_STATUS_U3RXD 0x8000 | ||
87 | |||
88 | #define BCSR_SWITCHES_OCTAL 0x00FF | ||
89 | #define BCSR_SWITCHES_DIP_1 0x0080 | ||
90 | #define BCSR_SWITCHES_DIP_2 0x0040 | ||
91 | #define BCSR_SWITCHES_DIP_3 0x0020 | ||
92 | #define BCSR_SWITCHES_DIP_4 0x0010 | ||
93 | #define BCSR_SWITCHES_DIP_5 0x0008 | ||
94 | #define BCSR_SWITCHES_DIP_6 0x0004 | ||
95 | #define BCSR_SWITCHES_DIP_7 0x0002 | ||
96 | #define BCSR_SWITCHES_DIP_8 0x0001 | ||
97 | #define BCSR_SWITCHES_ROTARY 0x0F00 | ||
98 | |||
99 | #define BCSR_RESETS_PHY0 0x0001 | ||
100 | #define BCSR_RESETS_PHY1 0x0002 | ||
101 | #define BCSR_RESETS_DC 0x0004 | ||
102 | #define BCSR_RESETS_WSC 0x2000 | ||
103 | #define BCSR_RESETS_SPISEL 0x4000 | ||
104 | #define BCSR_RESETS_DMAREQ 0x8000 | ||
105 | |||
106 | #define BCSR_PCMCIA_PC0VPP 0x0003 | ||
107 | #define BCSR_PCMCIA_PC0VCC 0x000C | ||
108 | #define BCSR_PCMCIA_PC0DRVEN 0x0010 | ||
109 | #define BCSR_PCMCIA_PC0RST 0x0080 | ||
110 | #define BCSR_PCMCIA_PC1VPP 0x0300 | ||
111 | #define BCSR_PCMCIA_PC1VCC 0x0C00 | ||
112 | #define BCSR_PCMCIA_PC1DRVEN 0x1000 | ||
113 | #define BCSR_PCMCIA_PC1RST 0x8000 | ||
114 | |||
115 | #define BCSR_PCI_M66EN 0x0001 | ||
116 | #define BCSR_PCI_M33 0x0100 | ||
117 | #define BCSR_PCI_EXTERNARB 0x0200 | ||
118 | #define BCSR_PCI_GPIO200RST 0x0400 | ||
119 | #define BCSR_PCI_CLKOUT 0x0800 | ||
120 | #define BCSR_PCI_CFGHOST 0x1000 | ||
121 | |||
122 | #define BCSR_LEDS_DECIMALS 0x00FF | ||
123 | #define BCSR_LEDS_LED0 0x0100 | ||
124 | #define BCSR_LEDS_LED1 0x0200 | ||
125 | #define BCSR_LEDS_LED2 0x0400 | ||
126 | #define BCSR_LEDS_LED3 0x0800 | ||
127 | |||
128 | #define BCSR_SYSTEM_VDDI 0x001F | ||
129 | #define BCSR_SYSTEM_POWEROFF 0x4000 | ||
130 | #define BCSR_SYSTEM_RESET 0x8000 | ||
131 | |||
132 | #define PCMCIA_MAX_SOCK 1 | ||
133 | #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) | ||
134 | |||
135 | /* VPP/VCC */ | ||
136 | #define SET_VCC_VPP(VCC, VPP, SLOT) \ | ||
137 | ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8)) | ||
138 | |||
139 | #if defined(CONFIG_MTD_PB1550_BOOT) && defined(CONFIG_MTD_PB1550_USER) | ||
140 | #define PB1550_BOTH_BANKS | ||
141 | #elif defined(CONFIG_MTD_PB1550_BOOT) && !defined(CONFIG_MTD_PB1550_USER) | ||
142 | #define PB1550_BOOT_ONLY | ||
143 | #elif !defined(CONFIG_MTD_PB1550_BOOT) && defined(CONFIG_MTD_PB1550_USER) | ||
144 | #define PB1550_USER_ONLY | ||
145 | #endif | ||
146 | |||
147 | /* | ||
148 | * Timing values as described in databook, * ns value stripped of | ||
149 | * lower 2 bits. | ||
150 | * These defines are here rather than an SOC1550 generic file because | ||
151 | * the parts chosen on another board may be different and may require | ||
152 | * different timings. | ||
153 | */ | ||
154 | #define NAND_T_H (18 >> 2) | ||
155 | #define NAND_T_PUL (30 >> 2) | ||
156 | #define NAND_T_SU (30 >> 2) | ||
157 | #define NAND_T_WH (30 >> 2) | ||
158 | |||
159 | /* Bitfield shift amounts */ | ||
160 | #define NAND_T_H_SHIFT 0 | ||
161 | #define NAND_T_PUL_SHIFT 4 | ||
162 | #define NAND_T_SU_SHIFT 8 | ||
163 | #define NAND_T_WH_SHIFT 12 | ||
164 | |||
165 | #define NAND_TIMING (((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \ | ||
166 | ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \ | ||
167 | ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \ | ||
168 | ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)) | ||
169 | |||
170 | #define NAND_CS 1 | ||
171 | |||
172 | /* Should be done by YAMON */ | ||
173 | #define NAND_STCFG 0x00400005 /* 8-bit NAND */ | ||
174 | #define NAND_STTIME 0x00007774 /* valid for 396 MHz SD=2 only */ | ||
175 | #define NAND_STADDR 0x12000FFF /* physical address 0x20000000 */ | ||
176 | |||
177 | #endif /* __ASM_PB1550_H */ | ||
diff --git a/include/asm-mips/mach-pnx8550/cm.h b/include/asm-mips/mach-pnx8550/cm.h deleted file mode 100644 index bb0a56c7d011..000000000000 --- a/include/asm-mips/mach-pnx8550/cm.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * Clock module specific definitions | ||
5 | * | ||
6 | * Author: source@mvista.com | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __PNX8550_CM_H | ||
23 | #define __PNX8550_CM_H | ||
24 | |||
25 | #define PNX8550_CM_BASE 0xBBE47000 | ||
26 | |||
27 | #define PNX8550_CM_PLL0_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x000) | ||
28 | #define PNX8550_CM_PLL1_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x004) | ||
29 | #define PNX8550_CM_PLL2_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x008) | ||
30 | #define PNX8550_CM_PLL3_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x00C) | ||
31 | |||
32 | // Table not complete..... | ||
33 | |||
34 | #define PNX8550_CM_PLL_BLOCKED_MASK 0x80000000 | ||
35 | #define PNX8550_CM_PLL_LOCK_MASK 0x40000000 | ||
36 | #define PNX8550_CM_PLL_CURRENT_ADJ_MASK 0x3c000000 | ||
37 | #define PNX8550_CM_PLL_N_MASK 0x01ff0000 | ||
38 | #define PNX8550_CM_PLL_M_MASK 0x00003f00 | ||
39 | #define PNX8550_CM_PLL_P_MASK 0x0000000c | ||
40 | #define PNX8550_CM_PLL_PD_MASK 0x00000002 | ||
41 | |||
42 | |||
43 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/glb.h b/include/asm-mips/mach-pnx8550/glb.h deleted file mode 100644 index 07aa85e609bc..000000000000 --- a/include/asm-mips/mach-pnx8550/glb.h +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * PNX8550 global definitions | ||
5 | * | ||
6 | * Author: source@mvista.com | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __PNX8550_GLB_H | ||
23 | #define __PNX8550_GLB_H | ||
24 | |||
25 | #define PNX8550_GLB1_BASE 0xBBE63000 | ||
26 | #define PNX8550_GLB2_BASE 0xBBE4d000 | ||
27 | #define PNX8550_RESET_BASE 0xBBE60000 | ||
28 | |||
29 | /* PCI Inta Output Enable Registers */ | ||
30 | #define PNX8550_GLB2_ENAB_INTA_O *(volatile unsigned long *)(PNX8550_GLB2_BASE + 0x050) | ||
31 | |||
32 | /* Bit 1:Enable DAC Powerdown | ||
33 | 0:DACs are enabled and are working normally | ||
34 | 1:DACs are powerdown | ||
35 | */ | ||
36 | #define PNX8550_GLB_DAC_PD 0x2 | ||
37 | /* Bit 0:Enable of PCI inta output | ||
38 | 0 = Disable PCI inta output | ||
39 | 1 = Enable PCI inta output | ||
40 | */ | ||
41 | #define PNX8550_GLB_ENABLE_INTA_O 0x1 | ||
42 | |||
43 | /* PCI Direct Mappings */ | ||
44 | #define PNX8550_PCIMEM 0x12000000 | ||
45 | #define PNX8550_PCIMEM_SIZE 0x08000000 | ||
46 | #define PNX8550_PCIIO 0x1c000000 | ||
47 | #define PNX8550_PCIIO_SIZE 0x02000000 /* 32M */ | ||
48 | |||
49 | #define PNX8550_PORT_BASE KSEG1 | ||
50 | |||
51 | // GPIO def | ||
52 | #define PNX8550_GPIO_BASE 0x1Be00000 | ||
53 | |||
54 | #define PNX8550_GPIO_DIRQ0 (PNX8550_GPIO_BASE + 0x104500) | ||
55 | #define PNX8550_GPIO_MC1 (PNX8550_GPIO_BASE + 0x104004) | ||
56 | #define PNX8550_GPIO_MC_31_BIT 30 | ||
57 | #define PNX8550_GPIO_MC_30_BIT 28 | ||
58 | #define PNX8550_GPIO_MC_29_BIT 26 | ||
59 | #define PNX8550_GPIO_MC_28_BIT 24 | ||
60 | #define PNX8550_GPIO_MC_27_BIT 22 | ||
61 | #define PNX8550_GPIO_MC_26_BIT 20 | ||
62 | #define PNX8550_GPIO_MC_25_BIT 18 | ||
63 | #define PNX8550_GPIO_MC_24_BIT 16 | ||
64 | #define PNX8550_GPIO_MC_23_BIT 14 | ||
65 | #define PNX8550_GPIO_MC_22_BIT 12 | ||
66 | #define PNX8550_GPIO_MC_21_BIT 10 | ||
67 | #define PNX8550_GPIO_MC_20_BIT 8 | ||
68 | #define PNX8550_GPIO_MC_19_BIT 6 | ||
69 | #define PNX8550_GPIO_MC_18_BIT 4 | ||
70 | #define PNX8550_GPIO_MC_17_BIT 2 | ||
71 | #define PNX8550_GPIO_MC_16_BIT 0 | ||
72 | |||
73 | #define PNX8550_GPIO_MODE_PRIMOP 0x1 | ||
74 | #define PNX8550_GPIO_MODE_NO_OPENDR 0x2 | ||
75 | #define PNX8550_GPIO_MODE_OPENDR 0x3 | ||
76 | |||
77 | // RESET module | ||
78 | #define PNX8550_RST_CTL *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x0) | ||
79 | #define PNX8550_RST_CAUSE *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x4) | ||
80 | #define PNX8550_RST_EN_WATCHDOG *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x8) | ||
81 | |||
82 | #define PNX8550_RST_REL_MIPS_RST_N 0x8 | ||
83 | #define PNX8550_RST_DO_SW_RST 0x4 | ||
84 | #define PNX8550_RST_REL_SYS_RST_OUT 0x2 | ||
85 | #define PNX8550_RST_ASSERT_SYS_RST_OUT 0x1 | ||
86 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/int.h b/include/asm-mips/mach-pnx8550/int.h deleted file mode 100644 index 0e0668b524f4..000000000000 --- a/include/asm-mips/mach-pnx8550/int.h +++ /dev/null | |||
@@ -1,140 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * Interrupt specific definitions | ||
5 | * | ||
6 | * Author: source@mvista.com | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __PNX8550_INT_H | ||
23 | #define __PNX8550_INT_H | ||
24 | |||
25 | #define PNX8550_GIC_BASE 0xBBE3E000 | ||
26 | |||
27 | #define PNX8550_GIC_PRIMASK_0 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x000) | ||
28 | #define PNX8550_GIC_PRIMASK_1 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x004) | ||
29 | #define PNX8550_GIC_VECTOR_0 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x100) | ||
30 | #define PNX8550_GIC_VECTOR_1 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x104) | ||
31 | #define PNX8550_GIC_PEND_1_31 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x200) | ||
32 | #define PNX8550_GIC_PEND_32_63 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x204) | ||
33 | #define PNX8550_GIC_PEND_64_70 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x208) | ||
34 | #define PNX8550_GIC_FEATURES *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x300) | ||
35 | #define PNX8550_GIC_REQ(x) *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x400 + (x)*4) | ||
36 | #define PNX8550_GIC_MOD_ID *(volatile unsigned long *)(PNX8550_GIC_BASE + 0xFFC) | ||
37 | |||
38 | // cp0 is two software + six hw exceptions | ||
39 | #define PNX8550_INT_CP0_TOTINT 8 | ||
40 | #define PNX8550_INT_CP0_MIN 0 | ||
41 | #define PNX8550_INT_CP0_MAX (PNX8550_INT_CP0_MIN + PNX8550_INT_CP0_TOTINT - 1) | ||
42 | |||
43 | #define MIPS_CPU_GIC_IRQ 2 | ||
44 | #define MIPS_CPU_TIMER_IRQ 7 | ||
45 | |||
46 | // GIC are 71 exceptions connected to cp0's first hardware exception | ||
47 | #define PNX8550_INT_GIC_TOTINT 71 | ||
48 | #define PNX8550_INT_GIC_MIN (PNX8550_INT_CP0_MAX+1) | ||
49 | #define PNX8550_INT_GIC_MAX (PNX8550_INT_GIC_MIN + PNX8550_INT_GIC_TOTINT - 1) | ||
50 | |||
51 | #define PNX8550_INT_UNDEF (PNX8550_INT_GIC_MIN+0) | ||
52 | #define PNX8550_INT_IPC_TARGET0_MIPS (PNX8550_INT_GIC_MIN+1) | ||
53 | #define PNX8550_INT_IPC_TARGET1_TM32_1 (PNX8550_INT_GIC_MIN+2) | ||
54 | #define PNX8550_INT_IPC_TARGET1_TM32_2 (PNX8550_INT_GIC_MIN+3) | ||
55 | #define PNX8550_INT_RESERVED_4 (PNX8550_INT_GIC_MIN+4) | ||
56 | #define PNX8550_INT_USB (PNX8550_INT_GIC_MIN+5) | ||
57 | #define PNX8550_INT_GPIO_EQ1 (PNX8550_INT_GIC_MIN+6) | ||
58 | #define PNX8550_INT_GPIO_EQ2 (PNX8550_INT_GIC_MIN+7) | ||
59 | #define PNX8550_INT_GPIO_EQ3 (PNX8550_INT_GIC_MIN+8) | ||
60 | #define PNX8550_INT_GPIO_EQ4 (PNX8550_INT_GIC_MIN+9) | ||
61 | |||
62 | #define PNX8550_INT_GPIO_EQ5 (PNX8550_INT_GIC_MIN+10) | ||
63 | #define PNX8550_INT_GPIO_EQ6 (PNX8550_INT_GIC_MIN+11) | ||
64 | #define PNX8550_INT_RESERVED_12 (PNX8550_INT_GIC_MIN+12) | ||
65 | #define PNX8550_INT_QVCP1 (PNX8550_INT_GIC_MIN+13) | ||
66 | #define PNX8550_INT_QVCP2 (PNX8550_INT_GIC_MIN+14) | ||
67 | #define PNX8550_INT_I2C1 (PNX8550_INT_GIC_MIN+15) | ||
68 | #define PNX8550_INT_I2C2 (PNX8550_INT_GIC_MIN+16) | ||
69 | #define PNX8550_INT_ISO_UART1 (PNX8550_INT_GIC_MIN+17) | ||
70 | #define PNX8550_INT_ISO_UART2 (PNX8550_INT_GIC_MIN+18) | ||
71 | #define PNX8550_INT_UART1 (PNX8550_INT_GIC_MIN+19) | ||
72 | |||
73 | #define PNX8550_INT_UART2 (PNX8550_INT_GIC_MIN+20) | ||
74 | #define PNX8550_INT_QNTR (PNX8550_INT_GIC_MIN+21) | ||
75 | #define PNX8550_INT_RESERVED22 (PNX8550_INT_GIC_MIN+22) | ||
76 | #define PNX8550_INT_T_DSC (PNX8550_INT_GIC_MIN+23) | ||
77 | #define PNX8550_INT_M_DSC (PNX8550_INT_GIC_MIN+24) | ||
78 | #define PNX8550_INT_RESERVED25 (PNX8550_INT_GIC_MIN+25) | ||
79 | #define PNX8550_INT_2D_DRAW_ENG (PNX8550_INT_GIC_MIN+26) | ||
80 | #define PNX8550_INT_MEM_BASED_SCALAR1 (PNX8550_INT_GIC_MIN+27) | ||
81 | #define PNX8550_INT_VIDEO_MPEG (PNX8550_INT_GIC_MIN+28) | ||
82 | #define PNX8550_INT_VIDEO_INPUT_P1 (PNX8550_INT_GIC_MIN+29) | ||
83 | |||
84 | #define PNX8550_INT_VIDEO_INPUT_P2 (PNX8550_INT_GIC_MIN+30) | ||
85 | #define PNX8550_INT_SPDI1 (PNX8550_INT_GIC_MIN+31) | ||
86 | #define PNX8550_INT_SPDO (PNX8550_INT_GIC_MIN+32) | ||
87 | #define PNX8550_INT_AUDIO_INPUT1 (PNX8550_INT_GIC_MIN+33) | ||
88 | #define PNX8550_INT_AUDIO_OUTPUT1 (PNX8550_INT_GIC_MIN+34) | ||
89 | #define PNX8550_INT_AUDIO_INPUT2 (PNX8550_INT_GIC_MIN+35) | ||
90 | #define PNX8550_INT_AUDIO_OUTPUT2 (PNX8550_INT_GIC_MIN+36) | ||
91 | #define PNX8550_INT_MEMBASED_SCALAR2 (PNX8550_INT_GIC_MIN+37) | ||
92 | #define PNX8550_INT_VPK (PNX8550_INT_GIC_MIN+38) | ||
93 | #define PNX8550_INT_MPEG1_MIPS (PNX8550_INT_GIC_MIN+39) | ||
94 | |||
95 | #define PNX8550_INT_MPEG1_TM (PNX8550_INT_GIC_MIN+40) | ||
96 | #define PNX8550_INT_MPEG2_MIPS (PNX8550_INT_GIC_MIN+41) | ||
97 | #define PNX8550_INT_MPEG2_TM (PNX8550_INT_GIC_MIN+42) | ||
98 | #define PNX8550_INT_TS_DMA (PNX8550_INT_GIC_MIN+43) | ||
99 | #define PNX8550_INT_EDMA (PNX8550_INT_GIC_MIN+44) | ||
100 | #define PNX8550_INT_TM_DEBUG1 (PNX8550_INT_GIC_MIN+45) | ||
101 | #define PNX8550_INT_TM_DEBUG2 (PNX8550_INT_GIC_MIN+46) | ||
102 | #define PNX8550_INT_PCI_INTA (PNX8550_INT_GIC_MIN+47) | ||
103 | #define PNX8550_INT_CLOCK_MODULE (PNX8550_INT_GIC_MIN+48) | ||
104 | #define PNX8550_INT_PCI_XIO_INTA_PCI (PNX8550_INT_GIC_MIN+49) | ||
105 | |||
106 | #define PNX8550_INT_PCI_XIO_INTB_DMA (PNX8550_INT_GIC_MIN+50) | ||
107 | #define PNX8550_INT_PCI_XIO_INTC_GPPM (PNX8550_INT_GIC_MIN+51) | ||
108 | #define PNX8550_INT_PCI_XIO_INTD_GPXIO (PNX8550_INT_GIC_MIN+52) | ||
109 | #define PNX8550_INT_DVD_CSS (PNX8550_INT_GIC_MIN+53) | ||
110 | #define PNX8550_INT_VLD (PNX8550_INT_GIC_MIN+54) | ||
111 | #define PNX8550_INT_GPIO_TSU_7_0 (PNX8550_INT_GIC_MIN+55) | ||
112 | #define PNX8550_INT_GPIO_TSU_15_8 (PNX8550_INT_GIC_MIN+56) | ||
113 | #define PNX8550_INT_GPIO_CTU_IR (PNX8550_INT_GIC_MIN+57) | ||
114 | #define PNX8550_INT_GPIO0 (PNX8550_INT_GIC_MIN+58) | ||
115 | #define PNX8550_INT_GPIO1 (PNX8550_INT_GIC_MIN+59) | ||
116 | |||
117 | #define PNX8550_INT_GPIO2 (PNX8550_INT_GIC_MIN+60) | ||
118 | #define PNX8550_INT_GPIO3 (PNX8550_INT_GIC_MIN+61) | ||
119 | #define PNX8550_INT_GPIO4 (PNX8550_INT_GIC_MIN+62) | ||
120 | #define PNX8550_INT_GPIO5 (PNX8550_INT_GIC_MIN+63) | ||
121 | #define PNX8550_INT_GPIO6 (PNX8550_INT_GIC_MIN+64) | ||
122 | #define PNX8550_INT_GPIO7 (PNX8550_INT_GIC_MIN+65) | ||
123 | #define PNX8550_INT_PMAN_SECURITY (PNX8550_INT_GIC_MIN+66) | ||
124 | #define PNX8550_INT_I2C3 (PNX8550_INT_GIC_MIN+67) | ||
125 | #define PNX8550_INT_RESERVED_68 (PNX8550_INT_GIC_MIN+68) | ||
126 | #define PNX8550_INT_SPDI2 (PNX8550_INT_GIC_MIN+69) | ||
127 | |||
128 | #define PNX8550_INT_I2C4 (PNX8550_INT_GIC_MIN+70) | ||
129 | |||
130 | // Timer are 3 exceptions connected to cp0's 7th hardware exception | ||
131 | #define PNX8550_INT_TIMER_TOTINT 3 | ||
132 | #define PNX8550_INT_TIMER_MIN (PNX8550_INT_GIC_MAX+1) | ||
133 | #define PNX8550_INT_TIMER_MAX (PNX8550_INT_TIMER_MIN + PNX8550_INT_TIMER_TOTINT - 1) | ||
134 | |||
135 | #define PNX8550_INT_TIMER1 (PNX8550_INT_TIMER_MIN+0) | ||
136 | #define PNX8550_INT_TIMER2 (PNX8550_INT_TIMER_MIN+1) | ||
137 | #define PNX8550_INT_TIMER3 (PNX8550_INT_TIMER_MIN+2) | ||
138 | #define PNX8550_INT_WATCHDOG PNX8550_INT_TIMER3 | ||
139 | |||
140 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/kernel-entry-init.h b/include/asm-mips/mach-pnx8550/kernel-entry-init.h deleted file mode 100644 index bdde00c9199b..000000000000 --- a/include/asm-mips/mach-pnx8550/kernel-entry-init.h +++ /dev/null | |||
@@ -1,262 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2005 Embedded Alley Solutions, Inc | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_KERNEL_ENTRY_INIT_H | ||
9 | #define __ASM_MACH_KERNEL_ENTRY_INIT_H | ||
10 | |||
11 | #include <asm/cacheops.h> | ||
12 | #include <asm/addrspace.h> | ||
13 | |||
14 | #define CO_CONFIGPR_VALID 0x3F1F41FF /* valid bits to write to ConfigPR */ | ||
15 | #define HAZARD_CP0 nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; | ||
16 | #define CACHE_OPC 0xBC000000 /* MIPS cache instruction opcode */ | ||
17 | #define ICACHE_LINE_SIZE 32 /* Instruction cache line size bytes */ | ||
18 | #define DCACHE_LINE_SIZE 32 /* Data cache line size in bytes */ | ||
19 | |||
20 | #define ICACHE_SET_COUNT 256 /* Instruction cache set count */ | ||
21 | #define DCACHE_SET_COUNT 128 /* Data cache set count */ | ||
22 | |||
23 | #define ICACHE_SET_SIZE (ICACHE_SET_COUNT * ICACHE_LINE_SIZE) | ||
24 | #define DCACHE_SET_SIZE (DCACHE_SET_COUNT * DCACHE_LINE_SIZE) | ||
25 | |||
26 | .macro kernel_entry_setup | ||
27 | .set push | ||
28 | .set noreorder | ||
29 | /* | ||
30 | * PNX8550 entry point, when running a non compressed | ||
31 | * kernel. When loading a zImage, the head.S code in | ||
32 | * arch/mips/zboot/pnx8550 will init the caches and, | ||
33 | * decompress the kernel, and branch to kernel_entry. | ||
34 | */ | ||
35 | cache_begin: li t0, (1<<28) | ||
36 | mtc0 t0, CP0_STATUS /* cp0 usable */ | ||
37 | HAZARD_CP0 | ||
38 | |||
39 | mtc0 zero, CP0_CAUSE | ||
40 | HAZARD_CP0 | ||
41 | |||
42 | |||
43 | /* Set static virtual to phys address translation and TLB disabled */ | ||
44 | mfc0 t0, CP0_CONFIG, 7 | ||
45 | HAZARD_CP0 | ||
46 | |||
47 | and t0, ~((1<<19) | (1<<20)) /* TLB/MAP cleared */ | ||
48 | mtc0 t0, CP0_CONFIG, 7 | ||
49 | HAZARD_CP0 | ||
50 | |||
51 | /* CPU boots with kseg0 cache algo set to 0x2 -- uncached */ | ||
52 | |||
53 | init_icache | ||
54 | nop | ||
55 | init_dcache | ||
56 | nop | ||
57 | |||
58 | cachePr4450ICReset | ||
59 | nop | ||
60 | |||
61 | cachePr4450DCReset | ||
62 | nop | ||
63 | |||
64 | /* read ConfigPR into t0 */ | ||
65 | mfc0 t0, CP0_CONFIG, 7 | ||
66 | HAZARD_CP0 | ||
67 | |||
68 | /* enable the TLB */ | ||
69 | or t0, (1<<19) | ||
70 | |||
71 | /* disable the ICACHE: at least 10x slower */ | ||
72 | /* or t0, (1<<26) */ | ||
73 | |||
74 | /* disable the DCACHE; CONFIG_CPU_HAS_LLSC should not be set */ | ||
75 | /* or t0, (1<<27) */ | ||
76 | |||
77 | and t0, CO_CONFIGPR_VALID | ||
78 | |||
79 | /* enable TLB. */ | ||
80 | mtc0 t0, CP0_CONFIG, 7 | ||
81 | HAZARD_CP0 | ||
82 | cache_end: | ||
83 | /* Setup CMEM_0 to MMIO address space, 2MB */ | ||
84 | lui t0, 0x1BE0 | ||
85 | addi t0, t0, 0x3 | ||
86 | mtc0 $8, $22, 4 | ||
87 | nop | ||
88 | |||
89 | /* Setup CMEM_1, 128MB */ | ||
90 | lui t0, 0x1000 | ||
91 | addi t0, t0, 0xf | ||
92 | mtc0 $8, $22, 5 | ||
93 | nop | ||
94 | |||
95 | |||
96 | /* Setup CMEM_2, 32MB */ | ||
97 | lui t0, 0x1C00 | ||
98 | addi t0, t0, 0xb | ||
99 | mtc0 $8, $22, 6 | ||
100 | nop | ||
101 | |||
102 | /* Setup CMEM_3, 0MB */ | ||
103 | lui t0, 0x0 | ||
104 | addi t0, t0, 0x0 | ||
105 | mtc0 $8, $22, 7 | ||
106 | nop | ||
107 | |||
108 | /* Enable cache */ | ||
109 | mfc0 t0, CP0_CONFIG | ||
110 | HAZARD_CP0 | ||
111 | and t0, t0, 0xFFFFFFF8 | ||
112 | or t0, t0, 3 | ||
113 | mtc0 t0, CP0_CONFIG | ||
114 | HAZARD_CP0 | ||
115 | .set pop | ||
116 | .endm | ||
117 | |||
118 | .macro init_icache | ||
119 | .set push | ||
120 | .set noreorder | ||
121 | |||
122 | /* Get Cache Configuration */ | ||
123 | mfc0 t3, CP0_CONFIG, 1 | ||
124 | HAZARD_CP0 | ||
125 | |||
126 | /* get cache Line size */ | ||
127 | |||
128 | srl t1, t3, 19 /* C0_CONFIGPR_IL_SHIFT */ | ||
129 | andi t1, t1, 0x7 /* C0_CONFIGPR_IL_MASK */ | ||
130 | beq t1, zero, pr4450_instr_cache_invalidated /* if zero instruction cache is absent */ | ||
131 | nop | ||
132 | addiu t0, t1, 1 | ||
133 | ori t1, zero, 1 | ||
134 | sllv t1, t1, t0 | ||
135 | |||
136 | /* get max cache Index */ | ||
137 | srl t2, t3, 22 /* C0_CONFIGPR_IS_SHIFT */ | ||
138 | andi t2, t2, 0x7 /* C0_CONFIGPR_IS_MASK */ | ||
139 | addiu t0, t2, 6 | ||
140 | ori t2, zero, 1 | ||
141 | sllv t2, t2, t0 | ||
142 | |||
143 | /* get max cache way */ | ||
144 | srl t3, t3, 16 /* C0_CONFIGPR_IA_SHIFT */ | ||
145 | andi t3, t3, 0x7 /* C0_CONFIGPR_IA_MASK */ | ||
146 | addiu t3, t3, 1 | ||
147 | |||
148 | /* total no of cache lines */ | ||
149 | multu t2, t3 /* max index * max way */ | ||
150 | mflo t2 | ||
151 | addiu t2, t2, -1 | ||
152 | |||
153 | move t0, zero | ||
154 | pr4450_next_instruction_cache_set: | ||
155 | cache Index_Invalidate_I, 0(t0) | ||
156 | addu t0, t0, t1 /* add bytes in a line */ | ||
157 | bne t2, zero, pr4450_next_instruction_cache_set | ||
158 | addiu t2, t2, -1 /* reduce no of lines to invalidate by one */ | ||
159 | pr4450_instr_cache_invalidated: | ||
160 | .set pop | ||
161 | .endm | ||
162 | |||
163 | .macro init_dcache | ||
164 | .set push | ||
165 | .set noreorder | ||
166 | move t1, zero | ||
167 | |||
168 | /* Store Tag Information */ | ||
169 | mtc0 zero, CP0_TAGLO, 0 | ||
170 | HAZARD_CP0 | ||
171 | |||
172 | mtc0 zero, CP0_TAGHI, 0 | ||
173 | HAZARD_CP0 | ||
174 | |||
175 | /* Cache size is 16384 = 512 lines x 32 bytes per line */ | ||
176 | or t2, zero, (128*4)-1 /* 512 lines */ | ||
177 | /* Invalidate all lines */ | ||
178 | 2: | ||
179 | cache Index_Store_Tag_D, 0(t1) | ||
180 | addiu t2, t2, -1 | ||
181 | bne t2, zero, 2b | ||
182 | addiu t1, t1, 32 /* 32 bytes in a line */ | ||
183 | .set pop | ||
184 | .endm | ||
185 | |||
186 | .macro cachePr4450ICReset | ||
187 | .set push | ||
188 | .set noreorder | ||
189 | |||
190 | /* Save CP0 status reg on entry; */ | ||
191 | /* disable interrupts during cache reset */ | ||
192 | mfc0 t0, CP0_STATUS /* T0 = interrupt status on entry */ | ||
193 | HAZARD_CP0 | ||
194 | |||
195 | mtc0 zero, CP0_STATUS /* disable CPU interrupts */ | ||
196 | HAZARD_CP0 | ||
197 | |||
198 | or t1, zero, zero /* T1 = starting cache index (0) */ | ||
199 | ori t2, zero, (256 - 1) /* T2 = inst cache set cnt - 1 */ | ||
200 | |||
201 | icache_invd_loop: | ||
202 | /* 9 == register t1 */ | ||
203 | .word CACHE_OPC | (9 << 21) | (Index_Invalidate_I << 16) | \ | ||
204 | (0 * ICACHE_SET_SIZE) /* invalidate inst cache WAY0 */ | ||
205 | .word CACHE_OPC | (9 << 21) | (Index_Invalidate_I << 16) | \ | ||
206 | (1 * ICACHE_SET_SIZE) /* invalidate inst cache WAY1 */ | ||
207 | |||
208 | addiu t1, t1, ICACHE_LINE_SIZE /* T1 = next cache line index */ | ||
209 | bne t2, zero, icache_invd_loop /* T2 = 0 if all sets invalidated */ | ||
210 | addiu t2, t2, -1 /* decrement T2 set cnt (delay slot) */ | ||
211 | |||
212 | /* Initialize the latches in the instruction cache tag */ | ||
213 | /* that drive the way selection tri-state bus drivers, by doing a */ | ||
214 | /* dummy load while the instruction cache is still disabled. */ | ||
215 | /* TODO: Is this needed ? */ | ||
216 | la t1, KSEG0 /* T1 = cached memory base address */ | ||
217 | lw zero, 0x0000(t1) /* (dummy read of first memory word) */ | ||
218 | |||
219 | mtc0 t0, CP0_STATUS /* restore interrupt status on entry */ | ||
220 | HAZARD_CP0 | ||
221 | .set pop | ||
222 | .endm | ||
223 | |||
224 | .macro cachePr4450DCReset | ||
225 | .set push | ||
226 | .set noreorder | ||
227 | mfc0 t0, CP0_STATUS /* T0 = interrupt status on entry */ | ||
228 | HAZARD_CP0 | ||
229 | mtc0 zero, CP0_STATUS /* disable CPU interrupts */ | ||
230 | HAZARD_CP0 | ||
231 | |||
232 | /* Writeback/invalidate entire data cache sets/ways/lines */ | ||
233 | or t1, zero, zero /* T1 = starting cache index (0) */ | ||
234 | ori t2, zero, (DCACHE_SET_COUNT - 1) /* T2 = data cache set cnt - 1 */ | ||
235 | |||
236 | dcache_wbinvd_loop: | ||
237 | /* 9 == register t1 */ | ||
238 | .word CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \ | ||
239 | (0 * DCACHE_SET_SIZE) /* writeback/invalidate WAY0 */ | ||
240 | .word CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \ | ||
241 | (1 * DCACHE_SET_SIZE) /* writeback/invalidate WAY1 */ | ||
242 | .word CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \ | ||
243 | (2 * DCACHE_SET_SIZE) /* writeback/invalidate WAY2 */ | ||
244 | .word CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \ | ||
245 | (3 * DCACHE_SET_SIZE) /* writeback/invalidate WAY3 */ | ||
246 | |||
247 | addiu t1, t1, DCACHE_LINE_SIZE /* T1 = next data cache line index */ | ||
248 | bne t2, zero, dcache_wbinvd_loop /* T2 = 0 when wbinvd entire cache */ | ||
249 | addiu t2, t2, -1 /* decrement T2 set cnt (delay slot) */ | ||
250 | |||
251 | /* Initialize the latches in the data cache tag that drive the way | ||
252 | selection tri-state bus drivers, by doing a dummy load while the | ||
253 | data cache is still in the disabled mode. TODO: Is this needed ? */ | ||
254 | la t1, KSEG0 /* T1 = cached memory base address */ | ||
255 | lw zero, 0x0000(t1) /* (dummy read of first memory word) */ | ||
256 | |||
257 | mtc0 t0, CP0_STATUS /* restore interrupt status on entry */ | ||
258 | HAZARD_CP0 | ||
259 | .set pop | ||
260 | .endm | ||
261 | |||
262 | #endif /* __ASM_MACH_KERNEL_ENTRY_INIT_H */ | ||
diff --git a/include/asm-mips/mach-pnx8550/nand.h b/include/asm-mips/mach-pnx8550/nand.h deleted file mode 100644 index aefbc514ab09..000000000000 --- a/include/asm-mips/mach-pnx8550/nand.h +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | #ifndef __PNX8550_NAND_H | ||
2 | #define __PNX8550_NAND_H | ||
3 | |||
4 | #define PNX8550_NAND_BASE_ADDR 0x10000000 | ||
5 | #define PNX8550_PCIXIO_BASE 0xBBE40000 | ||
6 | |||
7 | #define PNX8550_DMA_EXT_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x800) | ||
8 | #define PNX8550_DMA_INT_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x804) | ||
9 | #define PNX8550_DMA_TRANS_SIZE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x808) | ||
10 | #define PNX8550_DMA_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x80c) | ||
11 | #define PNX8550_XIO_SEL0 *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x814) | ||
12 | #define PNX8550_GPXIO_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x820) | ||
13 | #define PNX8550_GPXIO_WR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x824) | ||
14 | #define PNX8550_GPXIO_RD *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x828) | ||
15 | #define PNX8550_GPXIO_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x82C) | ||
16 | #define PNX8550_XIO_FLASH_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x830) | ||
17 | #define PNX8550_GPXIO_INT_STATUS *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb0) | ||
18 | #define PNX8550_GPXIO_INT_ENABLE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb4) | ||
19 | #define PNX8550_GPXIO_INT_CLEAR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb8) | ||
20 | #define PNX8550_DMA_INT_STATUS *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd0) | ||
21 | #define PNX8550_DMA_INT_ENABLE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd4) | ||
22 | #define PNX8550_DMA_INT_CLEAR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd8) | ||
23 | |||
24 | #define PNX8550_XIO_SEL0_EN_16BIT 0x00800000 | ||
25 | #define PNX8550_XIO_SEL0_USE_ACK 0x00400000 | ||
26 | #define PNX8550_XIO_SEL0_REN_HIGH 0x00100000 | ||
27 | #define PNX8550_XIO_SEL0_REN_LOW 0x00040000 | ||
28 | #define PNX8550_XIO_SEL0_WEN_HIGH 0x00010000 | ||
29 | #define PNX8550_XIO_SEL0_WEN_LOW 0x00004000 | ||
30 | #define PNX8550_XIO_SEL0_WAIT 0x00000200 | ||
31 | #define PNX8550_XIO_SEL0_OFFSET 0x00000020 | ||
32 | #define PNX8550_XIO_SEL0_TYPE_68360 0x00000000 | ||
33 | #define PNX8550_XIO_SEL0_TYPE_NOR 0x00000008 | ||
34 | #define PNX8550_XIO_SEL0_TYPE_NAND 0x00000010 | ||
35 | #define PNX8550_XIO_SEL0_TYPE_IDE 0x00000018 | ||
36 | #define PNX8550_XIO_SEL0_SIZE_8MB 0x00000000 | ||
37 | #define PNX8550_XIO_SEL0_SIZE_16MB 0x00000002 | ||
38 | #define PNX8550_XIO_SEL0_SIZE_32MB 0x00000004 | ||
39 | #define PNX8550_XIO_SEL0_SIZE_64MB 0x00000006 | ||
40 | #define PNX8550_XIO_SEL0_ENAB 0x00000001 | ||
41 | |||
42 | #define PNX8550_SEL0_DEFAULT ((PNX8550_XIO_SEL0_EN_16BIT) | \ | ||
43 | (PNX8550_XIO_SEL0_REN_HIGH*0)| \ | ||
44 | (PNX8550_XIO_SEL0_REN_LOW*2) | \ | ||
45 | (PNX8550_XIO_SEL0_WEN_HIGH*0)| \ | ||
46 | (PNX8550_XIO_SEL0_WEN_LOW*2) | \ | ||
47 | (PNX8550_XIO_SEL0_WAIT*4) | \ | ||
48 | (PNX8550_XIO_SEL0_OFFSET*0) | \ | ||
49 | (PNX8550_XIO_SEL0_TYPE_NAND) | \ | ||
50 | (PNX8550_XIO_SEL0_SIZE_32MB) | \ | ||
51 | (PNX8550_XIO_SEL0_ENAB)) | ||
52 | |||
53 | #define PNX8550_GPXIO_PENDING 0x00000200 | ||
54 | #define PNX8550_GPXIO_DONE 0x00000100 | ||
55 | #define PNX8550_GPXIO_CLR_DONE 0x00000080 | ||
56 | #define PNX8550_GPXIO_INIT 0x00000040 | ||
57 | #define PNX8550_GPXIO_READ_CMD 0x00000010 | ||
58 | #define PNX8550_GPXIO_BEN 0x0000000F | ||
59 | |||
60 | #define PNX8550_XIO_FLASH_64MB 0x00200000 | ||
61 | #define PNX8550_XIO_FLASH_INC_DATA 0x00100000 | ||
62 | #define PNX8550_XIO_FLASH_CMD_PH 0x000C0000 | ||
63 | #define PNX8550_XIO_FLASH_CMD_PH2 0x00080000 | ||
64 | #define PNX8550_XIO_FLASH_CMD_PH1 0x00040000 | ||
65 | #define PNX8550_XIO_FLASH_CMD_PH0 0x00000000 | ||
66 | #define PNX8550_XIO_FLASH_ADR_PH 0x00030000 | ||
67 | #define PNX8550_XIO_FLASH_ADR_PH3 0x00030000 | ||
68 | #define PNX8550_XIO_FLASH_ADR_PH2 0x00020000 | ||
69 | #define PNX8550_XIO_FLASH_ADR_PH1 0x00010000 | ||
70 | #define PNX8550_XIO_FLASH_ADR_PH0 0x00000000 | ||
71 | #define PNX8550_XIO_FLASH_CMD_B(x) ((x<<8) & 0x0000FF00) | ||
72 | #define PNX8550_XIO_FLASH_CMD_A(x) (x & 0x000000FF) | ||
73 | |||
74 | #define PNX8550_XIO_INT_ACK 0x00004000 | ||
75 | #define PNX8550_XIO_INT_COMPL 0x00002000 | ||
76 | #define PNX8550_XIO_INT_NONSUP 0x00000200 | ||
77 | #define PNX8550_XIO_INT_ABORT 0x00000004 | ||
78 | |||
79 | #define PNX8550_DMA_CTRL_SINGLE_DATA 0x00000400 | ||
80 | #define PNX8550_DMA_CTRL_SND2XIO 0x00000200 | ||
81 | #define PNX8550_DMA_CTRL_FIX_ADDR 0x00000100 | ||
82 | #define PNX8550_DMA_CTRL_BURST_8 0x00000000 | ||
83 | #define PNX8550_DMA_CTRL_BURST_16 0x00000020 | ||
84 | #define PNX8550_DMA_CTRL_BURST_32 0x00000040 | ||
85 | #define PNX8550_DMA_CTRL_BURST_64 0x00000060 | ||
86 | #define PNX8550_DMA_CTRL_BURST_128 0x00000080 | ||
87 | #define PNX8550_DMA_CTRL_BURST_256 0x000000A0 | ||
88 | #define PNX8550_DMA_CTRL_BURST_512 0x000000C0 | ||
89 | #define PNX8550_DMA_CTRL_BURST_NORES 0x000000E0 | ||
90 | #define PNX8550_DMA_CTRL_INIT_DMA 0x00000010 | ||
91 | #define PNX8550_DMA_CTRL_CMD_TYPE 0x0000000F | ||
92 | |||
93 | /* see PCI system arch, page 100 for the full list: */ | ||
94 | #define PNX8550_DMA_CTRL_PCI_CMD_READ 0x00000006 | ||
95 | #define PNX8550_DMA_CTRL_PCI_CMD_WRITE 0x00000007 | ||
96 | |||
97 | #define PNX8550_DMA_INT_STAT_ACK_DONE (1<<14) | ||
98 | #define PNX8550_DMA_INT_STAT_DMA_DONE (1<<12) | ||
99 | #define PNX8550_DMA_INT_STAT_DMA_ERR (1<<9) | ||
100 | #define PNX8550_DMA_INT_STAT_PERR5 (1<<5) | ||
101 | #define PNX8550_DMA_INT_STAT_PERR4 (1<<4) | ||
102 | #define PNX8550_DMA_INT_STAT_M_ABORT (1<<2) | ||
103 | #define PNX8550_DMA_INT_STAT_T_ABORT (1<<1) | ||
104 | |||
105 | #define PNX8550_DMA_INT_EN_ACK_DONE (1<<14) | ||
106 | #define PNX8550_DMA_INT_EN_DMA_DONE (1<<12) | ||
107 | #define PNX8550_DMA_INT_EN_DMA_ERR (1<<9) | ||
108 | #define PNX8550_DMA_INT_EN_PERR5 (1<<5) | ||
109 | #define PNX8550_DMA_INT_EN_PERR4 (1<<4) | ||
110 | #define PNX8550_DMA_INT_EN_M_ABORT (1<<2) | ||
111 | #define PNX8550_DMA_INT_EN_T_ABORT (1<<1) | ||
112 | |||
113 | #define PNX8550_DMA_INT_CLR_ACK_DONE (1<<14) | ||
114 | #define PNX8550_DMA_INT_CLR_DMA_DONE (1<<12) | ||
115 | #define PNX8550_DMA_INT_CLR_DMA_ERR (1<<9) | ||
116 | #define PNX8550_DMA_INT_CLR_PERR5 (1<<5) | ||
117 | #define PNX8550_DMA_INT_CLR_PERR4 (1<<4) | ||
118 | #define PNX8550_DMA_INT_CLR_M_ABORT (1<<2) | ||
119 | #define PNX8550_DMA_INT_CLR_T_ABORT (1<<1) | ||
120 | |||
121 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/pci.h b/include/asm-mips/mach-pnx8550/pci.h deleted file mode 100644 index b921508d701b..000000000000 --- a/include/asm-mips/mach-pnx8550/pci.h +++ /dev/null | |||
@@ -1,185 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * PCI specific definitions | ||
5 | * | ||
6 | * Author: source@mvista.com | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __PNX8550_PCI_H | ||
23 | #define __PNX8550_PCI_H | ||
24 | |||
25 | #include <linux/types.h> | ||
26 | #include <linux/pci.h> | ||
27 | #include <linux/kernel.h> | ||
28 | #include <linux/init.h> | ||
29 | |||
30 | #define PCI_ACCESS_READ 0 | ||
31 | #define PCI_ACCESS_WRITE 1 | ||
32 | |||
33 | #define PCI_CMD_IOR 0x20 | ||
34 | #define PCI_CMD_IOW 0x30 | ||
35 | #define PCI_CMD_CONFIG_READ 0xa0 | ||
36 | #define PCI_CMD_CONFIG_WRITE 0xb0 | ||
37 | |||
38 | #define PCI_IO_TIMEOUT 1000 | ||
39 | #define PCI_IO_RETRY 5 | ||
40 | /* Timeout for IO and CFG accesses. | ||
41 | This is in 1/1024 th of a jiffie(=10ms) | ||
42 | i.e. approx 10us */ | ||
43 | #define PCI_IO_JIFFIES_TIMEOUT 40 | ||
44 | #define PCI_IO_JIFFIES_SHIFT 10 | ||
45 | |||
46 | #define PCI_BYTE_ENABLE_MASK 0x0000000f | ||
47 | #define PCI_CFG_BUS_SHIFT 16 | ||
48 | #define PCI_CFG_FUNC_SHIFT 8 | ||
49 | #define PCI_CFG_REG_SHIFT 2 | ||
50 | |||
51 | #define PCI_BASE 0x1be00000 | ||
52 | #define PCI_SETUP 0x00040010 | ||
53 | #define PCI_DIS_REQGNT (1<<30) | ||
54 | #define PCI_DIS_REQGNTA (1<<29) | ||
55 | #define PCI_DIS_REQGNTB (1<<28) | ||
56 | #define PCI_D2_SUPPORT (1<<27) | ||
57 | #define PCI_D1_SUPPORT (1<<26) | ||
58 | #define PCI_EN_TA (1<<24) | ||
59 | #define PCI_EN_PCI2MMI (1<<23) | ||
60 | #define PCI_EN_XIO (1<<22) | ||
61 | #define PCI_BASE18_PREF (1<<21) | ||
62 | #define SIZE_16M 0x3 | ||
63 | #define SIZE_32M 0x4 | ||
64 | #define SIZE_64M 0x5 | ||
65 | #define SIZE_128M 0x6 | ||
66 | #define PCI_SETUP_BASE18_SIZE(X) (X<<18) | ||
67 | #define PCI_SETUP_BASE18_EN (1<<17) | ||
68 | #define PCI_SETUP_BASE14_PREF (1<<16) | ||
69 | #define PCI_SETUP_BASE14_SIZE(X) (X<<12) | ||
70 | #define PCI_SETUP_BASE14_EN (1<<11) | ||
71 | #define PCI_SETUP_BASE10_PREF (1<<10) | ||
72 | #define PCI_SETUP_BASE10_SIZE(X) (X<<7) | ||
73 | #define PCI_SETUP_CFGMANAGE_EN (1<<1) | ||
74 | #define PCI_SETUP_PCIARB_EN (1<<0) | ||
75 | |||
76 | #define PCI_CTRL 0x040014 | ||
77 | #define PCI_SWPB_DCS_PCI (1<<16) | ||
78 | #define PCI_SWPB_PCI_PCI (1<<15) | ||
79 | #define PCI_SWPB_PCI_DCS (1<<14) | ||
80 | #define PCI_REG_WR_POST (1<<13) | ||
81 | #define PCI_XIO_WR_POST (1<<12) | ||
82 | #define PCI_PCI2_WR_POST (1<<13) | ||
83 | #define PCI_PCI1_WR_POST (1<<12) | ||
84 | #define PCI_SERR_SEEN (1<<11) | ||
85 | #define PCI_B10_SPEC_RD (1<<6) | ||
86 | #define PCI_B14_SPEC_RD (1<<5) | ||
87 | #define PCI_B18_SPEC_RD (1<<4) | ||
88 | #define PCI_B10_NOSUBWORD (1<<3) | ||
89 | #define PCI_B14_NOSUBWORD (1<<2) | ||
90 | #define PCI_B18_NOSUBWORD (1<<1) | ||
91 | #define PCI_RETRY_TMREN (1<<0) | ||
92 | |||
93 | #define PCI_BASE1_LO 0x040018 | ||
94 | #define PCI_BASE1_HI 0x04001C | ||
95 | #define PCI_BASE2_LO 0x040020 | ||
96 | #define PCI_BASE2_HI 0x040024 | ||
97 | #define PCI_RDLIFETIM 0x040028 | ||
98 | #define PCI_GPPM_ADDR 0x04002C | ||
99 | #define PCI_GPPM_WDAT 0x040030 | ||
100 | #define PCI_GPPM_RDAT 0x040034 | ||
101 | #define PCI_GPPM_CTRL 0x040038 | ||
102 | #define GPPM_DONE (1<<10) | ||
103 | #define INIT_PCI_CYCLE (1<<9) | ||
104 | #define GPPM_CMD(X) (((X)&0xf)<<4) | ||
105 | #define GPPM_BYTEEN(X) ((X)&0xf) | ||
106 | #define PCI_UNLOCKREG 0x04003C | ||
107 | #define UNLOCK_SSID(X) (((X)&0xff)<<8) | ||
108 | #define UNLOCK_SETUP(X) (((X)&0xff)<<0) | ||
109 | #define UNLOCK_MAGIC 0xCA | ||
110 | #define PCI_DEV_VEND_ID 0x040040 | ||
111 | #define DEVICE_ID(X) (((X)>>16)&0xffff) | ||
112 | #define VENDOR_ID(X) (((X)&0xffff)) | ||
113 | #define PCI_CFG_CMDSTAT 0x040044 | ||
114 | #define PCI_CFG_STATUS(X) (((X)>>16)&0xffff) | ||
115 | #define PCI_CFG_COMMAND(X) ((X)&0xffff) | ||
116 | #define PCI_CLASS_REV 0x040048 | ||
117 | #define PCI_CLASSCODE(X) (((X)>>8)&0xffffff) | ||
118 | #define PCI_REVID(X) ((X)&0xff) | ||
119 | #define PCI_LAT_TMR 0x04004c | ||
120 | #define PCI_BASE10 0x040050 | ||
121 | #define PCI_BASE14 0x040054 | ||
122 | #define PCI_BASE18 0x040058 | ||
123 | #define PCI_SUBSYS_ID 0x04006c | ||
124 | #define PCI_CAP_PTR 0x040074 | ||
125 | #define PCI_CFG_MISC 0x04007c | ||
126 | #define PCI_PMC 0x040080 | ||
127 | #define PCI_PWR_STATE 0x040084 | ||
128 | #define PCI_IO 0x040088 | ||
129 | #define PCI_SLVTUNING 0x04008C | ||
130 | #define PCI_DMATUNING 0x040090 | ||
131 | #define PCI_DMAEADDR 0x040800 | ||
132 | #define PCI_DMAIADDR 0x040804 | ||
133 | #define PCI_DMALEN 0x040808 | ||
134 | #define PCI_DMACTRL 0x04080C | ||
135 | #define PCI_XIOCTRL 0x040810 | ||
136 | #define PCI_SEL0PROF 0x040814 | ||
137 | #define PCI_SEL1PROF 0x040818 | ||
138 | #define PCI_SEL2PROF 0x04081C | ||
139 | #define PCI_GPXIOADDR 0x040820 | ||
140 | #define PCI_NANDCTRLS 0x400830 | ||
141 | #define PCI_SEL3PROF 0x040834 | ||
142 | #define PCI_SEL4PROF 0x040838 | ||
143 | #define PCI_GPXIO_STAT 0x040FB0 | ||
144 | #define PCI_GPXIO_IMASK 0x040FB4 | ||
145 | #define PCI_GPXIO_ICLR 0x040FB8 | ||
146 | #define PCI_GPXIO_ISET 0x040FBC | ||
147 | #define PCI_GPPM_STATUS 0x040FC0 | ||
148 | #define GPPM_DONE (1<<10) | ||
149 | #define GPPM_ERR (1<<9) | ||
150 | #define GPPM_MPAR_ERR (1<<8) | ||
151 | #define GPPM_PAR_ERR (1<<7) | ||
152 | #define GPPM_R_MABORT (1<<2) | ||
153 | #define GPPM_R_TABORT (1<<1) | ||
154 | #define PCI_GPPM_IMASK 0x040FC4 | ||
155 | #define PCI_GPPM_ICLR 0x040FC8 | ||
156 | #define PCI_GPPM_ISET 0x040FCC | ||
157 | #define PCI_DMA_STATUS 0x040FD0 | ||
158 | #define PCI_DMA_IMASK 0x040FD4 | ||
159 | #define PCI_DMA_ICLR 0x040FD8 | ||
160 | #define PCI_DMA_ISET 0x040FDC | ||
161 | #define PCI_ISTATUS 0x040FE0 | ||
162 | #define PCI_IMASK 0x040FE4 | ||
163 | #define PCI_ICLR 0x040FE8 | ||
164 | #define PCI_ISET 0x040FEC | ||
165 | #define PCI_MOD_ID 0x040FFC | ||
166 | |||
167 | /* | ||
168 | * PCI configuration cycle AD bus definition | ||
169 | */ | ||
170 | /* Type 0 */ | ||
171 | #define PCI_CFG_TYPE0_REG_SHF 0 | ||
172 | #define PCI_CFG_TYPE0_FUNC_SHF 8 | ||
173 | |||
174 | /* Type 1 */ | ||
175 | #define PCI_CFG_TYPE1_REG_SHF 0 | ||
176 | #define PCI_CFG_TYPE1_FUNC_SHF 8 | ||
177 | #define PCI_CFG_TYPE1_DEV_SHF 11 | ||
178 | #define PCI_CFG_TYPE1_BUS_SHF 16 | ||
179 | |||
180 | /* | ||
181 | * Ethernet device DP83816 definition | ||
182 | */ | ||
183 | #define DP83816_IRQ_ETHER 66 | ||
184 | |||
185 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/uart.h b/include/asm-mips/mach-pnx8550/uart.h deleted file mode 100644 index ad7608d44874..000000000000 --- a/include/asm-mips/mach-pnx8550/uart.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | #ifndef __IP3106_UART_H | ||
2 | #define __IP3106_UART_H | ||
3 | |||
4 | #include <int.h> | ||
5 | |||
6 | /* early macros for kgdb use. fixme: clean this up */ | ||
7 | |||
8 | #define UART_BASE 0xbbe4a000 /* PNX8550 */ | ||
9 | |||
10 | #define PNX8550_UART_PORT0 (UART_BASE) | ||
11 | #define PNX8550_UART_PORT1 (UART_BASE + 0x1000) | ||
12 | |||
13 | #define PNX8550_UART_INT(x) (PNX8550_INT_GIC_MIN+19+x) | ||
14 | #define IRQ_TO_UART(x) (x-PNX8550_INT_GIC_MIN-19) | ||
15 | |||
16 | /* early macros needed for prom/kgdb */ | ||
17 | |||
18 | #define ip3106_lcr(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x000) | ||
19 | #define ip3106_mcr(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x004) | ||
20 | #define ip3106_baud(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x008) | ||
21 | #define ip3106_cfg(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x00C) | ||
22 | #define ip3106_fifo(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x028) | ||
23 | #define ip3106_istat(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE0) | ||
24 | #define ip3106_ien(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE4) | ||
25 | #define ip3106_iclr(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE8) | ||
26 | #define ip3106_iset(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFEC) | ||
27 | #define ip3106_pd(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFF4) | ||
28 | #define ip3106_mid(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFFC) | ||
29 | |||
30 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/usb.h b/include/asm-mips/mach-pnx8550/usb.h deleted file mode 100644 index 483b7fc65d41..000000000000 --- a/include/asm-mips/mach-pnx8550/usb.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * USB specific definitions | ||
5 | * | ||
6 | * Author: source@mvista.com | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __PNX8550_USB_H | ||
23 | #define __PNX8550_USB_H | ||
24 | |||
25 | /* | ||
26 | * USB Host controller | ||
27 | */ | ||
28 | |||
29 | #define PNX8550_USB_OHCI_OP_BASE 0x1be48000 | ||
30 | #define PNX8550_USB_OHCI_OP_LEN 0x1000 | ||
31 | |||
32 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/war.h b/include/asm-mips/mach-pnx8550/war.h deleted file mode 100644 index d0458dd082f9..000000000000 --- a/include/asm-mips/mach-pnx8550/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_PNX8550_WAR_H | ||
9 | #define __ASM_MIPS_MACH_PNX8550_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_PNX8550_WAR_H */ | ||
diff --git a/include/asm-mips/mach-rc32434/cpu-feature-overrides.h b/include/asm-mips/mach-rc32434/cpu-feature-overrides.h deleted file mode 100644 index f3bc7efa2608..000000000000 --- a/include/asm-mips/mach-rc32434/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | /* | ||
2 | * IDT RC32434 specific CPU feature overrides | ||
3 | * | ||
4 | * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org> | ||
5 | * | ||
6 | * This file was derived from: include/asm-mips/cpu-features.h | ||
7 | * Copyright (C) 2003, 2004 Ralf Baechle | ||
8 | * Copyright (C) 2004 Maciej W. Rozycki | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version 2 | ||
13 | * of the License, or (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the | ||
22 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
23 | * Boston, MA 02110-1301, USA. | ||
24 | */ | ||
25 | #ifndef __ASM_MACH_RC32434_CPU_FEATURE_OVERRIDES_H | ||
26 | #define __ASM_MACH_RC32434_CPU_FEATURE_OVERRIDES_H | ||
27 | |||
28 | /* | ||
29 | * The IDT RC32434 SOC has a built-in MIPS 4Kc core. | ||
30 | */ | ||
31 | #define cpu_has_tlb 1 | ||
32 | #define cpu_has_4kex 1 | ||
33 | #define cpu_has_3k_cache 0 | ||
34 | #define cpu_has_4k_cache 1 | ||
35 | #define cpu_has_tx39_cache 0 | ||
36 | #define cpu_has_sb1_cache 0 | ||
37 | #define cpu_has_fpu 0 | ||
38 | #define cpu_has_32fpr 0 | ||
39 | #define cpu_has_counter 1 | ||
40 | #define cpu_has_watch 1 | ||
41 | #define cpu_has_divec 1 | ||
42 | #define cpu_has_vce 0 | ||
43 | #define cpu_has_cache_cdex_p 0 | ||
44 | #define cpu_has_cache_cdex_s 0 | ||
45 | #define cpu_has_prefetch 1 | ||
46 | #define cpu_has_mcheck 1 | ||
47 | #define cpu_has_ejtag 1 | ||
48 | #define cpu_has_llsc 1 | ||
49 | |||
50 | #define cpu_has_mips16 0 | ||
51 | #define cpu_has_mdmx 0 | ||
52 | #define cpu_has_mips3d 0 | ||
53 | #define cpu_has_smartmips 0 | ||
54 | |||
55 | #define cpu_has_vtag_icache 0 | ||
56 | /* #define cpu_has_dc_aliases ? */ | ||
57 | /* #define cpu_has_ic_fills_f_dc ? */ | ||
58 | /* #define cpu_has_pindexed_dcache ? */ | ||
59 | |||
60 | /* #define cpu_icache_snoops_remote_store ? */ | ||
61 | |||
62 | #define cpu_has_mips32r1 1 | ||
63 | #define cpu_has_mips32r2 0 | ||
64 | #define cpu_has_mips64r1 0 | ||
65 | #define cpu_has_mips64r2 0 | ||
66 | |||
67 | #define cpu_has_dsp 0 | ||
68 | #define cpu_has_mipsmt 0 | ||
69 | |||
70 | /* #define cpu_has_nofpuex ? */ | ||
71 | #define cpu_has_64bits 0 | ||
72 | #define cpu_has_64bit_zero_reg 0 | ||
73 | #define cpu_has_64bit_gp_regs 0 | ||
74 | #define cpu_has_64bit_addresses 0 | ||
75 | |||
76 | #define cpu_has_inclusive_pcaches 0 | ||
77 | |||
78 | #define cpu_dcache_line_size() 16 | ||
79 | #define cpu_icache_line_size() 16 | ||
80 | |||
81 | #endif /* __ASM_MACH_RC32434_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-rc32434/ddr.h b/include/asm-mips/mach-rc32434/ddr.h deleted file mode 100644 index 291e2cf9dde0..000000000000 --- a/include/asm-mips/mach-rc32434/ddr.h +++ /dev/null | |||
@@ -1,141 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for the DDR registers | ||
3 | * | ||
4 | * Copyright 2002 Ryan Holm <ryan.holmQVist@idt.com> | ||
5 | * Copyright 2008 Florian Fainelli <florian@openwrt.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
13 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
14 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
15 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
17 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
18 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
21 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License along | ||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | #ifndef _ASM_RC32434_DDR_H_ | ||
30 | #define _ASM_RC32434_DDR_H_ | ||
31 | |||
32 | #include <asm/mach-rc32434/rb.h> | ||
33 | |||
34 | /* DDR register structure */ | ||
35 | struct ddr_ram { | ||
36 | u32 ddrbase; | ||
37 | u32 ddrmask; | ||
38 | u32 res1; | ||
39 | u32 res2; | ||
40 | u32 ddrc; | ||
41 | u32 ddrabase; | ||
42 | u32 ddramask; | ||
43 | u32 ddramap; | ||
44 | u32 ddrcust; | ||
45 | u32 ddrrdc; | ||
46 | u32 ddrspare; | ||
47 | }; | ||
48 | |||
49 | #define DDR0_PHYS_ADDR 0x18018000 | ||
50 | |||
51 | /* DDR banks masks */ | ||
52 | #define DDR_MASK 0xffff0000 | ||
53 | #define DDR0_BASE_MSK DDR_MASK | ||
54 | #define DDR1_BASE_MSK DDR_MASK | ||
55 | |||
56 | /* DDR bank0 registers */ | ||
57 | #define RC32434_DDR0_ATA_BIT 5 | ||
58 | #define RC32434_DDR0_ATA_MSK 0x000000E0 | ||
59 | #define RC32434_DDR0_DBW_BIT 8 | ||
60 | #define RC32434_DDR0_DBW_MSK 0x00000100 | ||
61 | #define RC32434_DDR0_WR_BIT 9 | ||
62 | #define RC32434_DDR0_WR_MSK 0x00000600 | ||
63 | #define RC32434_DDR0_PS_BIT 11 | ||
64 | #define RC32434_DDR0_PS_MSK 0x00001800 | ||
65 | #define RC32434_DDR0_DTYPE_BIT 13 | ||
66 | #define RC32434_DDR0_DTYPE_MSK 0x0000e000 | ||
67 | #define RC32434_DDR0_RFC_BIT 16 | ||
68 | #define RC32434_DDR0_RFC_MSK 0x000f0000 | ||
69 | #define RC32434_DDR0_RP_BIT 20 | ||
70 | #define RC32434_DDR0_RP_MSK 0x00300000 | ||
71 | #define RC32434_DDR0_AP_BIT 22 | ||
72 | #define RC32434_DDR0_AP_MSK 0x00400000 | ||
73 | #define RC32434_DDR0_RCD_BIT 23 | ||
74 | #define RC32434_DDR0_RCD_MSK 0x01800000 | ||
75 | #define RC32434_DDR0_CL_BIT 25 | ||
76 | #define RC32434_DDR0_CL_MSK 0x06000000 | ||
77 | #define RC32434_DDR0_DBM_BIT 27 | ||
78 | #define RC32434_DDR0_DBM_MSK 0x08000000 | ||
79 | #define RC32434_DDR0_SDS_BIT 28 | ||
80 | #define RC32434_DDR0_SDS_MSK 0x10000000 | ||
81 | #define RC32434_DDR0_ATP_BIT 29 | ||
82 | #define RC32434_DDR0_ATP_MSK 0x60000000 | ||
83 | #define RC32434_DDR0_RE_BIT 31 | ||
84 | #define RC32434_DDR0_RE_MSK 0x80000000 | ||
85 | |||
86 | /* DDR bank C registers */ | ||
87 | #define RC32434_DDRC_MSK(x) BIT_TO_MASK(x) | ||
88 | #define RC32434_DDRC_CES_BIT 0 | ||
89 | #define RC32434_DDRC_ACE_BIT 1 | ||
90 | |||
91 | /* Custom DDR bank registers */ | ||
92 | #define RC32434_DCST_MSK(x) BIT_TO_MASK(x) | ||
93 | #define RC32434_DCST_CS_BIT 0 | ||
94 | #define RC32434_DCST_CS_MSK 0x00000003 | ||
95 | #define RC32434_DCST_WE_BIT 2 | ||
96 | #define RC32434_DCST_RAS_BIT 3 | ||
97 | #define RC32434_DCST_CAS_BIT 4 | ||
98 | #define RC32434_DSCT_CKE_BIT 5 | ||
99 | #define RC32434_DSCT_BA_BIT 6 | ||
100 | #define RC32434_DSCT_BA_MSK 0x000000c0 | ||
101 | |||
102 | /* DDR QSC registers */ | ||
103 | #define RC32434_QSC_DM_BIT 0 | ||
104 | #define RC32434_QSC_DM_MSK 0x00000003 | ||
105 | #define RC32434_QSC_DQSBS_BIT 2 | ||
106 | #define RC32434_QSC_DQSBS_MSK 0x000000fc | ||
107 | #define RC32434_QSC_DB_BIT 8 | ||
108 | #define RC32434_QSC_DB_MSK 0x00000100 | ||
109 | #define RC32434_QSC_DBSP_BIT 9 | ||
110 | #define RC32434_QSC_DBSP_MSK 0x01fffe00 | ||
111 | #define RC32434_QSC_BDP_BIT 25 | ||
112 | #define RC32434_QSC_BDP_MSK 0x7e000000 | ||
113 | |||
114 | /* DDR LLC registers */ | ||
115 | #define RC32434_LLC_EAO_BIT 0 | ||
116 | #define RC32434_LLC_EAO_MSK 0x00000001 | ||
117 | #define RC32434_LLC_EO_BIT 1 | ||
118 | #define RC32434_LLC_EO_MSK 0x0000003e | ||
119 | #define RC32434_LLC_FS_BIT 6 | ||
120 | #define RC32434_LLC_FS_MSK 0x000000c0 | ||
121 | #define RC32434_LLC_AS_BIT 8 | ||
122 | #define RC32434_LLC_AS_MSK 0x00000700 | ||
123 | #define RC32434_LLC_SP_BIT 11 | ||
124 | #define RC32434_LLC_SP_MSK 0x001ff800 | ||
125 | |||
126 | /* DDR LLFC registers */ | ||
127 | #define RC32434_LLFC_MSK(x) BIT_TO_MASK(x) | ||
128 | #define RC32434_LLFC_MEN_BIT 0 | ||
129 | #define RC32434_LLFC_EAN_BIT 1 | ||
130 | #define RC32434_LLFC_FF_BIT 2 | ||
131 | |||
132 | /* DDR DLLTA registers */ | ||
133 | #define RC32434_DLLTA_ADDR_BIT 2 | ||
134 | #define RC32434_DLLTA_ADDR_MSK 0xfffffffc | ||
135 | |||
136 | /* DDR DLLED registers */ | ||
137 | #define RC32434_DLLED_MSK(x) BIT_TO_MASK(x) | ||
138 | #define RC32434_DLLED_DBE_BIT 0 | ||
139 | #define RC32434_DLLED_DTE_BIT 1 | ||
140 | |||
141 | #endif /* _ASM_RC32434_DDR_H_ */ | ||
diff --git a/include/asm-mips/mach-rc32434/dma.h b/include/asm-mips/mach-rc32434/dma.h deleted file mode 100644 index 5f898b5873f7..000000000000 --- a/include/asm-mips/mach-rc32434/dma.h +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2002 Integrated Device Technology, Inc. | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * DMA register definition. | ||
6 | * | ||
7 | * Author : ryan.holmQVist@idt.com | ||
8 | * Date : 20011005 | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_RC32434_DMA_H | ||
12 | #define __ASM_RC32434_DMA_H | ||
13 | |||
14 | #include <asm/mach-rc32434/rb.h> | ||
15 | |||
16 | #define DMA0_BASE_ADDR 0x18040000 | ||
17 | |||
18 | /* | ||
19 | * DMA descriptor (in physical memory). | ||
20 | */ | ||
21 | |||
22 | struct dma_desc { | ||
23 | u32 control; /* Control. use DMAD_* */ | ||
24 | u32 ca; /* Current Address. */ | ||
25 | u32 devcs; /* Device control and status. */ | ||
26 | u32 link; /* Next descriptor in chain. */ | ||
27 | }; | ||
28 | |||
29 | #define DMA_DESC_SIZ sizeof(struct dma_desc) | ||
30 | #define DMA_DESC_COUNT_BIT 0 | ||
31 | #define DMA_DESC_COUNT_MSK 0x0003ffff | ||
32 | #define DMA_DESC_DS_BIT 20 | ||
33 | #define DMA_DESC_DS_MSK 0x00300000 | ||
34 | |||
35 | #define DMA_DESC_DEV_CMD_BIT 22 | ||
36 | #define DMA_DESC_DEV_CMD_MSK 0x01c00000 | ||
37 | |||
38 | /* DMA command sizes */ | ||
39 | #define DMA_DESC_DEV_CMD_BYTE 0 | ||
40 | #define DMA_DESC_DEV_CMD_HLF_WD 1 | ||
41 | #define DMA_DESC_DEV_CMD_WORD 2 | ||
42 | #define DMA_DESC_DEV_CMD_2WORDS 3 | ||
43 | #define DMA_DESC_DEV_CMD_4WORDS 4 | ||
44 | #define DMA_DESC_DEV_CMD_6WORDS 5 | ||
45 | #define DMA_DESC_DEV_CMD_8WORDS 6 | ||
46 | #define DMA_DESC_DEV_CMD_16WORDS 7 | ||
47 | |||
48 | /* DMA descriptors interrupts */ | ||
49 | #define DMA_DESC_COF (1 << 25) /* Chain on finished */ | ||
50 | #define DMA_DESC_COD (1 << 26) /* Chain on done */ | ||
51 | #define DMA_DESC_IOF (1 << 27) /* Interrupt on finished */ | ||
52 | #define DMA_DESC_IOD (1 << 28) /* Interrupt on done */ | ||
53 | #define DMA_DESC_TERM (1 << 29) /* Terminated */ | ||
54 | #define DMA_DESC_DONE (1 << 30) /* Done */ | ||
55 | #define DMA_DESC_FINI (1 << 31) /* Finished */ | ||
56 | |||
57 | /* | ||
58 | * DMA register (within Internal Register Map). | ||
59 | */ | ||
60 | |||
61 | struct dma_reg { | ||
62 | u32 dmac; /* Control. */ | ||
63 | u32 dmas; /* Status. */ | ||
64 | u32 dmasm; /* Mask. */ | ||
65 | u32 dmadptr; /* Descriptor pointer. */ | ||
66 | u32 dmandptr; /* Next descriptor pointer. */ | ||
67 | }; | ||
68 | |||
69 | /* DMA channels specific registers */ | ||
70 | #define DMA_CHAN_RUN_BIT (1 << 0) | ||
71 | #define DMA_CHAN_DONE_BIT (1 << 1) | ||
72 | #define DMA_CHAN_MODE_BIT (1 << 2) | ||
73 | #define DMA_CHAN_MODE_MSK 0x0000000c | ||
74 | #define DMA_CHAN_MODE_AUTO 0 | ||
75 | #define DMA_CHAN_MODE_BURST 1 | ||
76 | #define DMA_CHAN_MODE_XFRT 2 | ||
77 | #define DMA_CHAN_MODE_RSVD 3 | ||
78 | #define DMA_CHAN_ACT_BIT (1 << 4) | ||
79 | |||
80 | /* DMA status registers */ | ||
81 | #define DMA_STAT_FINI (1 << 0) | ||
82 | #define DMA_STAT_DONE (1 << 1) | ||
83 | #define DMA_STAT_CHAIN (1 << 2) | ||
84 | #define DMA_STAT_ERR (1 << 3) | ||
85 | #define DMA_STAT_HALT (1 << 4) | ||
86 | |||
87 | /* | ||
88 | * DMA channel definitions | ||
89 | */ | ||
90 | |||
91 | #define DMA_CHAN_ETH_RCV 0 | ||
92 | #define DMA_CHAN_ETH_XMT 1 | ||
93 | #define DMA_CHAN_MEM_TO_FIFO 2 | ||
94 | #define DMA_CHAN_FIFO_TO_MEM 3 | ||
95 | #define DMA_CHAN_PCI_TO_MEM 4 | ||
96 | #define DMA_CHAN_MEM_TO_PCI 5 | ||
97 | #define DMA_CHAN_COUNT 6 | ||
98 | |||
99 | struct dma_channel { | ||
100 | struct dma_reg ch[DMA_CHAN_COUNT]; | ||
101 | }; | ||
102 | |||
103 | #endif /* __ASM_RC32434_DMA_H */ | ||
diff --git a/include/asm-mips/mach-rc32434/dma_v.h b/include/asm-mips/mach-rc32434/dma_v.h deleted file mode 100644 index 173a9f9146cd..000000000000 --- a/include/asm-mips/mach-rc32434/dma_v.h +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2002 Integrated Device Technology, Inc. | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * DMA register definition. | ||
6 | * | ||
7 | * Author : ryan.holmQVist@idt.com | ||
8 | * Date : 20011005 | ||
9 | */ | ||
10 | |||
11 | #ifndef _ASM_RC32434_DMA_V_H_ | ||
12 | #define _ASM_RC32434_DMA_V_H_ | ||
13 | |||
14 | #include <asm/mach-rc32434/dma.h> | ||
15 | #include <asm/mach-rc32434/rc32434.h> | ||
16 | |||
17 | #define DMA_CHAN_OFFSET 0x14 | ||
18 | #define IS_DMA_USED(X) (((X) & \ | ||
19 | (DMA_DESC_FINI | DMA_DESC_DONE | DMA_DESC_TERM)) \ | ||
20 | != 0) | ||
21 | #define DMA_COUNT(count) ((count) & DMA_DESC_COUNT_MSK) | ||
22 | |||
23 | #define DMA_HALT_TIMEOUT 500 | ||
24 | |||
25 | static inline int rc32434_halt_dma(struct dma_reg *ch) | ||
26 | { | ||
27 | int timeout = 1; | ||
28 | if (__raw_readl(&ch->dmac) & DMA_CHAN_RUN_BIT) { | ||
29 | __raw_writel(0, &ch->dmac); | ||
30 | for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) { | ||
31 | if (__raw_readl(&ch->dmas) & DMA_STAT_HALT) { | ||
32 | __raw_writel(0, &ch->dmas); | ||
33 | break; | ||
34 | } | ||
35 | } | ||
36 | } | ||
37 | |||
38 | return timeout ? 0 : 1; | ||
39 | } | ||
40 | |||
41 | static inline void rc32434_start_dma(struct dma_reg *ch, u32 dma_addr) | ||
42 | { | ||
43 | __raw_writel(0, &ch->dmandptr); | ||
44 | __raw_writel(dma_addr, &ch->dmadptr); | ||
45 | } | ||
46 | |||
47 | static inline void rc32434_chain_dma(struct dma_reg *ch, u32 dma_addr) | ||
48 | { | ||
49 | __raw_writel(dma_addr, &ch->dmandptr); | ||
50 | } | ||
51 | |||
52 | #endif /* _ASM_RC32434_DMA_V_H_ */ | ||
diff --git a/include/asm-mips/mach-rc32434/eth.h b/include/asm-mips/mach-rc32434/eth.h deleted file mode 100644 index a25cbc56173d..000000000000 --- a/include/asm-mips/mach-rc32434/eth.h +++ /dev/null | |||
@@ -1,220 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for the Ethernet registers | ||
3 | * | ||
4 | * Copyright 2002 Allend Stichter <allen.stichter@idt.com> | ||
5 | * Copyright 2008 Florian Fainelli <florian@openwrt.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
13 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
14 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
15 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
17 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
18 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
21 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License along | ||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | #ifndef __ASM_RC32434_ETH_H | ||
30 | #define __ASM_RC32434_ETH_H | ||
31 | |||
32 | |||
33 | #define ETH0_BASE_ADDR 0x18060000 | ||
34 | |||
35 | struct eth_regs { | ||
36 | u32 ethintfc; | ||
37 | u32 ethfifott; | ||
38 | u32 etharc; | ||
39 | u32 ethhash0; | ||
40 | u32 ethhash1; | ||
41 | u32 ethu0[4]; /* Reserved. */ | ||
42 | u32 ethpfs; | ||
43 | u32 ethmcp; | ||
44 | u32 eth_u1[10]; /* Reserved. */ | ||
45 | u32 ethspare; | ||
46 | u32 eth_u2[42]; /* Reserved. */ | ||
47 | u32 ethsal0; | ||
48 | u32 ethsah0; | ||
49 | u32 ethsal1; | ||
50 | u32 ethsah1; | ||
51 | u32 ethsal2; | ||
52 | u32 ethsah2; | ||
53 | u32 ethsal3; | ||
54 | u32 ethsah3; | ||
55 | u32 ethrbc; | ||
56 | u32 ethrpc; | ||
57 | u32 ethrupc; | ||
58 | u32 ethrfc; | ||
59 | u32 ethtbc; | ||
60 | u32 ethgpf; | ||
61 | u32 eth_u9[50]; /* Reserved. */ | ||
62 | u32 ethmac1; | ||
63 | u32 ethmac2; | ||
64 | u32 ethipgt; | ||
65 | u32 ethipgr; | ||
66 | u32 ethclrt; | ||
67 | u32 ethmaxf; | ||
68 | u32 eth_u10; /* Reserved. */ | ||
69 | u32 ethmtest; | ||
70 | u32 miimcfg; | ||
71 | u32 miimcmd; | ||
72 | u32 miimaddr; | ||
73 | u32 miimwtd; | ||
74 | u32 miimrdd; | ||
75 | u32 miimind; | ||
76 | u32 eth_u11; /* Reserved. */ | ||
77 | u32 eth_u12; /* Reserved. */ | ||
78 | u32 ethcfsa0; | ||
79 | u32 ethcfsa1; | ||
80 | u32 ethcfsa2; | ||
81 | }; | ||
82 | |||
83 | /* Ethernet interrupt registers */ | ||
84 | #define ETH_INT_FC_EN (1 << 0) | ||
85 | #define ETH_INT_FC_ITS (1 << 1) | ||
86 | #define ETH_INT_FC_RIP (1 << 2) | ||
87 | #define ETH_INT_FC_JAM (1 << 3) | ||
88 | #define ETH_INT_FC_OVR (1 << 4) | ||
89 | #define ETH_INT_FC_UND (1 << 5) | ||
90 | #define ETH_INT_FC_IOC 0x000000c0 | ||
91 | |||
92 | /* Ethernet FIFO registers */ | ||
93 | #define ETH_FIFI_TT_TTH_BIT 0 | ||
94 | #define ETH_FIFO_TT_TTH 0x0000007f | ||
95 | |||
96 | /* Ethernet ARC/multicast registers */ | ||
97 | #define ETH_ARC_PRO (1 << 0) | ||
98 | #define ETH_ARC_AM (1 << 1) | ||
99 | #define ETH_ARC_AFM (1 << 2) | ||
100 | #define ETH_ARC_AB (1 << 3) | ||
101 | |||
102 | /* Ethernet SAL registers */ | ||
103 | #define ETH_SAL_BYTE_5 0x000000ff | ||
104 | #define ETH_SAL_BYTE_4 0x0000ff00 | ||
105 | #define ETH_SAL_BYTE_3 0x00ff0000 | ||
106 | #define ETH_SAL_BYTE_2 0xff000000 | ||
107 | |||
108 | /* Ethernet SAH registers */ | ||
109 | #define ETH_SAH_BYTE1 0x000000ff | ||
110 | #define ETH_SAH_BYTE0 0x0000ff00 | ||
111 | |||
112 | /* Ethernet GPF register */ | ||
113 | #define ETH_GPF_PTV 0x0000ffff | ||
114 | |||
115 | /* Ethernet PFG register */ | ||
116 | #define ETH_PFS_PFD (1 << 0) | ||
117 | |||
118 | /* Ethernet CFSA[0-3] registers */ | ||
119 | #define ETH_CFSA0_CFSA4 0x000000ff | ||
120 | #define ETH_CFSA0_CFSA5 0x0000ff00 | ||
121 | #define ETH_CFSA1_CFSA2 0x000000ff | ||
122 | #define ETH_CFSA1_CFSA3 0x0000ff00 | ||
123 | #define ETH_CFSA1_CFSA0 0x000000ff | ||
124 | #define ETH_CFSA1_CFSA1 0x0000ff00 | ||
125 | |||
126 | /* Ethernet MAC1 registers */ | ||
127 | #define ETH_MAC1_RE (1 << 0) | ||
128 | #define ETH_MAC1_PAF (1 << 1) | ||
129 | #define ETH_MAC1_RFC (1 << 2) | ||
130 | #define ETH_MAC1_TFC (1 << 3) | ||
131 | #define ETH_MAC1_LB (1 << 4) | ||
132 | #define ETH_MAC1_MR (1 << 31) | ||
133 | |||
134 | /* Ethernet MAC2 registers */ | ||
135 | #define ETH_MAC2_FD (1 << 0) | ||
136 | #define ETH_MAC2_FLC (1 << 1) | ||
137 | #define ETH_MAC2_HFE (1 << 2) | ||
138 | #define ETH_MAC2_DC (1 << 3) | ||
139 | #define ETH_MAC2_CEN (1 << 4) | ||
140 | #define ETH_MAC2_PE (1 << 5) | ||
141 | #define ETH_MAC2_VPE (1 << 6) | ||
142 | #define ETH_MAC2_APE (1 << 7) | ||
143 | #define ETH_MAC2_PPE (1 << 8) | ||
144 | #define ETH_MAC2_LPE (1 << 9) | ||
145 | #define ETH_MAC2_NB (1 << 12) | ||
146 | #define ETH_MAC2_BP (1 << 13) | ||
147 | #define ETH_MAC2_ED (1 << 14) | ||
148 | |||
149 | /* Ethernet IPGT register */ | ||
150 | #define ETH_IPGT 0x0000007f | ||
151 | |||
152 | /* Ethernet IPGR registers */ | ||
153 | #define ETH_IPGR_IPGR2 0x0000007f | ||
154 | #define ETH_IPGR_IPGR1 0x00007f00 | ||
155 | |||
156 | /* Ethernet CLRT registers */ | ||
157 | #define ETH_CLRT_MAX_RET 0x0000000f | ||
158 | #define ETH_CLRT_COL_WIN 0x00003f00 | ||
159 | |||
160 | /* Ethernet MAXF register */ | ||
161 | #define ETH_MAXF 0x0000ffff | ||
162 | |||
163 | /* Ethernet test registers */ | ||
164 | #define ETH_TEST_REG (1 << 2) | ||
165 | #define ETH_MCP_DIV 0x000000ff | ||
166 | |||
167 | /* MII registers */ | ||
168 | #define ETH_MII_CFG_RSVD 0x0000000c | ||
169 | #define ETH_MII_CMD_RD (1 << 0) | ||
170 | #define ETH_MII_CMD_SCN (1 << 1) | ||
171 | #define ETH_MII_REG_ADDR 0x0000001f | ||
172 | #define ETH_MII_PHY_ADDR 0x00001f00 | ||
173 | #define ETH_MII_WTD_DATA 0x0000ffff | ||
174 | #define ETH_MII_RDD_DATA 0x0000ffff | ||
175 | #define ETH_MII_IND_BSY (1 << 0) | ||
176 | #define ETH_MII_IND_SCN (1 << 1) | ||
177 | #define ETH_MII_IND_NV (1 << 2) | ||
178 | |||
179 | /* | ||
180 | * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors. | ||
181 | */ | ||
182 | |||
183 | #define ETH_RX_FD (1 << 0) | ||
184 | #define ETH_RX_LD (1 << 1) | ||
185 | #define ETH_RX_ROK (1 << 2) | ||
186 | #define ETH_RX_FM (1 << 3) | ||
187 | #define ETH_RX_MP (1 << 4) | ||
188 | #define ETH_RX_BP (1 << 5) | ||
189 | #define ETH_RX_VLT (1 << 6) | ||
190 | #define ETH_RX_CF (1 << 7) | ||
191 | #define ETH_RX_OVR (1 << 8) | ||
192 | #define ETH_RX_CRC (1 << 9) | ||
193 | #define ETH_RX_CV (1 << 10) | ||
194 | #define ETH_RX_DB (1 << 11) | ||
195 | #define ETH_RX_LE (1 << 12) | ||
196 | #define ETH_RX_LOR (1 << 13) | ||
197 | #define ETH_RX_CES (1 << 14) | ||
198 | #define ETH_RX_LEN_BIT 16 | ||
199 | #define ETH_RX_LEN 0xffff0000 | ||
200 | |||
201 | #define ETH_TX_FD (1 << 0) | ||
202 | #define ETH_TX_LD (1 << 1) | ||
203 | #define ETH_TX_OEN (1 << 2) | ||
204 | #define ETH_TX_PEN (1 << 3) | ||
205 | #define ETH_TX_CEN (1 << 4) | ||
206 | #define ETH_TX_HEN (1 << 5) | ||
207 | #define ETH_TX_TOK (1 << 6) | ||
208 | #define ETH_TX_MP (1 << 7) | ||
209 | #define ETH_TX_BP (1 << 8) | ||
210 | #define ETH_TX_UND (1 << 9) | ||
211 | #define ETH_TX_OF (1 << 10) | ||
212 | #define ETH_TX_ED (1 << 11) | ||
213 | #define ETH_TX_EC (1 << 12) | ||
214 | #define ETH_TX_LC (1 << 13) | ||
215 | #define ETH_TX_TD (1 << 14) | ||
216 | #define ETH_TX_CRC (1 << 15) | ||
217 | #define ETH_TX_LE (1 << 16) | ||
218 | #define ETH_TX_CC 0x001E0000 | ||
219 | |||
220 | #endif /* __ASM_RC32434_ETH_H */ | ||
diff --git a/include/asm-mips/mach-rc32434/gpio.h b/include/asm-mips/mach-rc32434/gpio.h deleted file mode 100644 index 3a70b41cd7a5..000000000000 --- a/include/asm-mips/mach-rc32434/gpio.h +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2002 Integrated Device Technology, Inc. | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * GPIO register definition. | ||
6 | * | ||
7 | * Author : ryan.holmQVist@idt.com | ||
8 | * Date : 20011005 | ||
9 | * Copyright (C) 2001, 2002 Ryan Holm <ryan.holmQVist@idt.com> | ||
10 | * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org> | ||
11 | */ | ||
12 | |||
13 | #ifndef _RC32434_GPIO_H_ | ||
14 | #define _RC32434_GPIO_H_ | ||
15 | |||
16 | #include <linux/types.h> | ||
17 | |||
18 | #define gpio_get_value __gpio_get_value | ||
19 | #define gpio_set_value __gpio_set_value | ||
20 | |||
21 | #define gpio_cansleep __gpio_cansleep | ||
22 | |||
23 | #define gpio_to_irq(gpio) IRQ_GPIO(gpio) | ||
24 | #define irq_to_gpio(irq) IRQ_TO_GPIO(irq) | ||
25 | |||
26 | #include <asm-generic/gpio.h> | ||
27 | |||
28 | struct rb532_gpio_reg { | ||
29 | u32 gpiofunc; /* GPIO Function Register | ||
30 | * gpiofunc[x]==0 bit = gpio | ||
31 | * func[x]==1 bit = altfunc | ||
32 | */ | ||
33 | u32 gpiocfg; /* GPIO Configuration Register | ||
34 | * gpiocfg[x]==0 bit = input | ||
35 | * gpiocfg[x]==1 bit = output | ||
36 | */ | ||
37 | u32 gpiod; /* GPIO Data Register | ||
38 | * gpiod[x] read/write gpio pinX status | ||
39 | */ | ||
40 | u32 gpioilevel; /* GPIO Interrupt Status Register | ||
41 | * interrupt level (see gpioistat) | ||
42 | */ | ||
43 | u32 gpioistat; /* Gpio Interrupt Status Register | ||
44 | * istat[x] = (gpiod[x] == level[x]) | ||
45 | * cleared in ISR (STICKY bits) | ||
46 | */ | ||
47 | u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */ | ||
48 | }; | ||
49 | |||
50 | /* UART GPIO signals */ | ||
51 | #define RC32434_UART0_SOUT (1 << 0) | ||
52 | #define RC32434_UART0_SIN (1 << 1) | ||
53 | #define RC32434_UART0_RTS (1 << 2) | ||
54 | #define RC32434_UART0_CTS (1 << 3) | ||
55 | |||
56 | /* M & P bus GPIO signals */ | ||
57 | #define RC32434_MP_BIT_22 (1 << 4) | ||
58 | #define RC32434_MP_BIT_23 (1 << 5) | ||
59 | #define RC32434_MP_BIT_24 (1 << 6) | ||
60 | #define RC32434_MP_BIT_25 (1 << 7) | ||
61 | |||
62 | /* CPU GPIO signals */ | ||
63 | #define RC32434_CPU_GPIO (1 << 8) | ||
64 | |||
65 | /* Reserved GPIO signals */ | ||
66 | #define RC32434_AF_SPARE_6 (1 << 9) | ||
67 | #define RC32434_AF_SPARE_4 (1 << 10) | ||
68 | #define RC32434_AF_SPARE_3 (1 << 11) | ||
69 | #define RC32434_AF_SPARE_2 (1 << 12) | ||
70 | |||
71 | /* PCI messaging unit */ | ||
72 | #define RC32434_PCI_MSU_GPIO (1 << 13) | ||
73 | |||
74 | /* NAND GPIO signals */ | ||
75 | #define GPIO_RDY 8 | ||
76 | #define GPIO_WPX 9 | ||
77 | #define GPIO_ALE 10 | ||
78 | #define GPIO_CLE 11 | ||
79 | |||
80 | /* Compact Flash GPIO pin */ | ||
81 | #define CF_GPIO_NUM 13 | ||
82 | |||
83 | extern void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val); | ||
84 | extern unsigned get_434_reg(unsigned reg_offs); | ||
85 | extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask); | ||
86 | extern unsigned char get_latch_u5(void); | ||
87 | |||
88 | #endif /* _RC32434_GPIO_H_ */ | ||
diff --git a/include/asm-mips/mach-rc32434/integ.h b/include/asm-mips/mach-rc32434/integ.h deleted file mode 100644 index fa65bc3d8807..000000000000 --- a/include/asm-mips/mach-rc32434/integ.h +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for the Watchdog registers | ||
3 | * | ||
4 | * Copyright 2002 Ryan Holm <ryan.holmQVist@idt.com> | ||
5 | * Copyright 2008 Florian Fainelli <florian@openwrt.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
13 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
14 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
15 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
17 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
18 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
21 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License along | ||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | #ifndef __RC32434_INTEG_H__ | ||
30 | #define __RC32434_INTEG_H__ | ||
31 | |||
32 | #include <asm/mach-rc32434/rb.h> | ||
33 | |||
34 | #define INTEG0_BASE_ADDR 0x18030030 | ||
35 | |||
36 | struct integ { | ||
37 | u32 errcs; /* sticky use ERRCS_ */ | ||
38 | u32 wtcount; /* Watchdog timer count reg. */ | ||
39 | u32 wtcompare; /* Watchdog timer timeout value. */ | ||
40 | u32 wtc; /* Watchdog timer control. use WTC_ */ | ||
41 | }; | ||
42 | |||
43 | /* Error counters */ | ||
44 | #define RC32434_ERR_WTO 0 | ||
45 | #define RC32434_ERR_WNE 1 | ||
46 | #define RC32434_ERR_UCW 2 | ||
47 | #define RC32434_ERR_UCR 3 | ||
48 | #define RC32434_ERR_UPW 4 | ||
49 | #define RC32434_ERR_UPR 5 | ||
50 | #define RC32434_ERR_UDW 6 | ||
51 | #define RC32434_ERR_UDR 7 | ||
52 | #define RC32434_ERR_SAE 8 | ||
53 | #define RC32434_ERR_WRE 9 | ||
54 | |||
55 | /* Watchdog control bits */ | ||
56 | #define RC32434_WTC_EN 0 | ||
57 | #define RC32434_WTC_TO 1 | ||
58 | |||
59 | #endif /* __RC32434_INTEG_H__ */ | ||
diff --git a/include/asm-mips/mach-rc32434/irq.h b/include/asm-mips/mach-rc32434/irq.h deleted file mode 100644 index 56738d8ec4e2..000000000000 --- a/include/asm-mips/mach-rc32434/irq.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | #ifndef __ASM_RC32434_IRQ_H | ||
2 | #define __ASM_RC32434_IRQ_H | ||
3 | |||
4 | #define NR_IRQS 256 | ||
5 | |||
6 | #include <asm/mach-generic/irq.h> | ||
7 | #include <asm/mach-rc32434/rb.h> | ||
8 | |||
9 | /* Interrupt Controller */ | ||
10 | #define IC_GROUP0_PEND (REGBASE + 0x38000) | ||
11 | #define IC_GROUP0_MASK (REGBASE + 0x38008) | ||
12 | #define IC_GROUP_OFFSET 0x0C | ||
13 | |||
14 | #define NUM_INTR_GROUPS 5 | ||
15 | |||
16 | /* 16550 UARTs */ | ||
17 | #define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */ | ||
18 | /* GRP3 IRQ numbers start here */ | ||
19 | #define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) | ||
20 | /* GRP4 IRQ numbers start here */ | ||
21 | #define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) | ||
22 | /* GRP5 IRQ numbers start here */ | ||
23 | #define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) | ||
24 | #define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) | ||
25 | |||
26 | #define UART0_IRQ (GROUP3_IRQ_BASE + 0) | ||
27 | |||
28 | #define ETH0_DMA_RX_IRQ (GROUP1_IRQ_BASE + 0) | ||
29 | #define ETH0_DMA_TX_IRQ (GROUP1_IRQ_BASE + 1) | ||
30 | #define ETH0_RX_OVR_IRQ (GROUP3_IRQ_BASE + 9) | ||
31 | #define ETH0_TX_UND_IRQ (GROUP3_IRQ_BASE + 10) | ||
32 | |||
33 | #endif /* __ASM_RC32434_IRQ_H */ | ||
diff --git a/include/asm-mips/mach-rc32434/pci.h b/include/asm-mips/mach-rc32434/pci.h deleted file mode 100644 index 410638f2af74..000000000000 --- a/include/asm-mips/mach-rc32434/pci.h +++ /dev/null | |||
@@ -1,481 +0,0 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify it | ||
3 | * under the terms of the GNU General Public License as published by the | ||
4 | * Free Software Foundation; either version 2 of the License, or (at your | ||
5 | * option) any later version. | ||
6 | * | ||
7 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
8 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
9 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
10 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
11 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
12 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
13 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
14 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
15 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
16 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
21 | * | ||
22 | * Copyright 2004 IDT Inc. (rischelp@idt.com) | ||
23 | * | ||
24 | * Initial Release | ||
25 | */ | ||
26 | |||
27 | #ifndef _ASM_RC32434_PCI_H_ | ||
28 | #define _ASM_RC32434_PCI_H_ | ||
29 | |||
30 | #define epld_mask ((volatile unsigned char *)0xB900000d) | ||
31 | |||
32 | #define PCI0_BASE_ADDR 0x18080000 | ||
33 | #define PCI_LBA_COUNT 4 | ||
34 | |||
35 | struct pci_map { | ||
36 | u32 address; /* Address. */ | ||
37 | u32 control; /* Control. */ | ||
38 | u32 mapping; /* mapping. */ | ||
39 | }; | ||
40 | |||
41 | struct pci_reg { | ||
42 | u32 pcic; | ||
43 | u32 pcis; | ||
44 | u32 pcism; | ||
45 | u32 pcicfga; | ||
46 | u32 pcicfgd; | ||
47 | volatile struct pci_map pcilba[PCI_LBA_COUNT]; | ||
48 | u32 pcidac; | ||
49 | u32 pcidas; | ||
50 | u32 pcidasm; | ||
51 | u32 pcidad; | ||
52 | u32 pcidma8c; | ||
53 | u32 pcidma9c; | ||
54 | u32 pcitc; | ||
55 | }; | ||
56 | |||
57 | #define PCI_MSU_COUNT 2 | ||
58 | |||
59 | struct pci_msu { | ||
60 | u32 pciim[PCI_MSU_COUNT]; | ||
61 | u32 pciom[PCI_MSU_COUNT]; | ||
62 | u32 pciid; | ||
63 | u32 pciiic; | ||
64 | u32 pciiim; | ||
65 | u32 pciiod; | ||
66 | u32 pciioic; | ||
67 | u32 pciioim; | ||
68 | }; | ||
69 | |||
70 | /* | ||
71 | * PCI Control Register | ||
72 | */ | ||
73 | |||
74 | #define PCI_CTL_EN (1 << 0) | ||
75 | #define PCI_CTL_TNR (1 << 1) | ||
76 | #define PCI_CTL_SCE (1 << 2) | ||
77 | #define PCI_CTL_IEN (1 << 3) | ||
78 | #define PCI_CTL_AAA (1 << 4) | ||
79 | #define PCI_CTL_EAP (1 << 5) | ||
80 | #define PCI_CTL_PCIM_BIT 6 | ||
81 | #define PCI_CTL_PCIM 0x000001c0 | ||
82 | |||
83 | #define PCI_CTL_PCIM_DIS 0 | ||
84 | #define PCI_CTL_PCIM_TNR 1 /* Satellite - target not ready */ | ||
85 | #define PCI_CTL_PCIM_SUS 2 /* Satellite - suspended CPU. */ | ||
86 | #define PCI_CTL_PCIM_EXT 3 /* Host - external arbiter. */ | ||
87 | #define PCI_CTL PCIM_PRIO 4 /* Host - fixed priority arb. */ | ||
88 | #define PCI_CTL_PCIM_RR 5 /* Host - round robin priority. */ | ||
89 | #define PCI_CTL_PCIM_RSVD6 6 | ||
90 | #define PCI_CTL_PCIM_RSVD7 7 | ||
91 | |||
92 | #define PCI_CTL_IGM (1 << 9) | ||
93 | |||
94 | /* | ||
95 | * PCI Status Register | ||
96 | */ | ||
97 | |||
98 | #define PCI_STAT_EED (1 << 0) | ||
99 | #define PCI_STAT_WR (1 << 1) | ||
100 | #define PCI_STAT_NMI (1 << 2) | ||
101 | #define PCI_STAT_II (1 << 3) | ||
102 | #define PCI_STAT_CWE (1 << 4) | ||
103 | #define PCI_STAT_CRE (1 << 5) | ||
104 | #define PCI_STAT_MDPE (1 << 6) | ||
105 | #define PCI_STAT_STA (1 << 7) | ||
106 | #define PCI_STAT_RTA (1 << 8) | ||
107 | #define PCI_STAT_RMA (1 << 9) | ||
108 | #define PCI_STAT_SSE (1 << 10) | ||
109 | #define PCI_STAT_OSE (1 << 11) | ||
110 | #define PCI_STAT_PE (1 << 12) | ||
111 | #define PCI_STAT_TAE (1 << 13) | ||
112 | #define PCI_STAT_RLE (1 << 14) | ||
113 | #define PCI_STAT_BME (1 << 15) | ||
114 | #define PCI_STAT_PRD (1 << 16) | ||
115 | #define PCI_STAT_RIP (1 << 17) | ||
116 | |||
117 | /* | ||
118 | * PCI Status Mask Register | ||
119 | */ | ||
120 | |||
121 | #define PCI_STATM_EED PCI_STAT_EED | ||
122 | #define PCI_STATM_WR PCI_STAT_WR | ||
123 | #define PCI_STATM_NMI PCI_STAT_NMI | ||
124 | #define PCI_STATM_II PCI_STAT_II | ||
125 | #define PCI_STATM_CWE PCI_STAT_CWE | ||
126 | #define PCI_STATM_CRE PCI_STAT_CRE | ||
127 | #define PCI_STATM_MDPE PCI_STAT_MDPE | ||
128 | #define PCI_STATM_STA PCI_STAT_STA | ||
129 | #define PCI_STATM_RTA PCI_STAT_RTA | ||
130 | #define PCI_STATM_RMA PCI_STAT_RMA | ||
131 | #define PCI_STATM_SSE PCI_STAT_SSE | ||
132 | #define PCI_STATM_OSE PCI_STAT_OSE | ||
133 | #define PCI_STATM_PE PCI_STAT_PE | ||
134 | #define PCI_STATM_TAE PCI_STAT_TAE | ||
135 | #define PCI_STATM_RLE PCI_STAT_RLE | ||
136 | #define PCI_STATM_BME PCI_STAT_BME | ||
137 | #define PCI_STATM_PRD PCI_STAT_PRD | ||
138 | #define PCI_STATM_RIP PCI_STAT_RIP | ||
139 | |||
140 | /* | ||
141 | * PCI Configuration Address Register | ||
142 | */ | ||
143 | #define PCI_CFGA_REG_BIT 2 | ||
144 | #define PCI_CFGA_REG 0x000000fc | ||
145 | #define PCI_CFGA_REG_ID (0x00 >> 2) /* use PCFGID */ | ||
146 | #define PCI_CFGA_REG_04 (0x04 >> 2) /* use PCFG04_ */ | ||
147 | #define PCI_CFGA_REG_08 (0x08 >> 2) /* use PCFG08_ */ | ||
148 | #define PCI_CFGA_REG_0C (0x0C >> 2) /* use PCFG0C_ */ | ||
149 | #define PCI_CFGA_REG_PBA0 (0x10 >> 2) /* use PCIPBA_ */ | ||
150 | #define PCI_CFGA_REG_PBA1 (0x14 >> 2) /* use PCIPBA_ */ | ||
151 | #define PCI_CFGA_REG_PBA2 (0x18 >> 2) /* use PCIPBA_ */ | ||
152 | #define PCI_CFGA_REG_PBA3 (0x1c >> 2) /* use PCIPBA_ */ | ||
153 | #define PCI_CFGA_REG_SUBSYS (0x2c >> 2) /* use PCFGSS_ */ | ||
154 | #define PCI_CFGA_REG_3C (0x3C >> 2) /* use PCFG3C_ */ | ||
155 | #define PCI_CFGA_REG_PBBA0C (0x44 >> 2) /* use PCIPBAC_ */ | ||
156 | #define PCI_CFGA_REG_PBA0M (0x48 >> 2) | ||
157 | #define PCI_CFGA_REG_PBA1C (0x4c >> 2) /* use PCIPBAC_ */ | ||
158 | #define PCI_CFGA_REG_PBA1M (0x50 >> 2) | ||
159 | #define PCI_CFGA_REG_PBA2C (0x54 >> 2) /* use PCIPBAC_ */ | ||
160 | #define PCI_CFGA_REG_PBA2M (0x58 >> 2) | ||
161 | #define PCI_CFGA_REG_PBA3C (0x5c >> 2) /* use PCIPBAC_ */ | ||
162 | #define PCI_CFGA_REG_PBA3M (0x60 >> 2) | ||
163 | #define PCI_CFGA_REG_PMGT (0x64 >> 2) | ||
164 | #define PCI_CFGA_FUNC_BIT 8 | ||
165 | #define PCI_CFGA_FUNC 0x00000700 | ||
166 | #define PCI_CFGA_DEV_BIT 11 | ||
167 | #define PCI_CFGA_DEV 0x0000f800 | ||
168 | #define PCI_CFGA_DEV_INTERN 0 | ||
169 | #define PCI_CFGA_BUS_BIT 16 | ||
170 | #define PCI CFGA_BUS 0x00ff0000 | ||
171 | #define PCI_CFGA_BUS_TYPE0 0 | ||
172 | #define PCI_CFGA_EN (1 << 31) | ||
173 | |||
174 | /* PCI CFG04 commands */ | ||
175 | #define PCI_CFG04_CMD_IO_ENA (1 << 0) | ||
176 | #define PCI_CFG04_CMD_MEM_ENA (1 << 1) | ||
177 | #define PCI_CFG04_CMD_BM_ENA (1 << 2) | ||
178 | #define PCI_CFG04_CMD_MW_INV (1 << 4) | ||
179 | #define PCI_CFG04_CMD_PAR_ENA (1 << 6) | ||
180 | #define PCI_CFG04_CMD_SER_ENA (1 << 8) | ||
181 | #define PCI_CFG04_CMD_FAST_ENA (1 << 9) | ||
182 | |||
183 | /* PCI CFG04 status fields */ | ||
184 | #define PCI_CFG04_STAT_BIT 16 | ||
185 | #define PCI_CFG04_STAT 0xffff0000 | ||
186 | #define PCI_CFG04_STAT_66_MHZ (1 << 21) | ||
187 | #define PCI_CFG04_STAT_FBB (1 << 23) | ||
188 | #define PCI_CFG04_STAT_MDPE (1 << 24) | ||
189 | #define PCI_CFG04_STAT_DST (1 << 25) | ||
190 | #define PCI_CFG04_STAT_STA (1 << 27) | ||
191 | #define PCI_CFG04_STAT_RTA (1 << 28) | ||
192 | #define PCI_CFG04_STAT_RMA (1 << 29) | ||
193 | #define PCI_CFG04_STAT_SSE (1 << 30) | ||
194 | #define PCI_CFG04_STAT_PE (1 << 31) | ||
195 | |||
196 | #define PCI_PBA_MSI (1 << 0) | ||
197 | #define PCI_PBA_P (1 << 2) | ||
198 | |||
199 | /* PCI PBAC registers */ | ||
200 | #define PCI_PBAC_MSI (1 << 0) | ||
201 | #define PCI_PBAC_P (1 << 1) | ||
202 | #define PCI_PBAC_SIZE_BIT 2 | ||
203 | #define PCI_PBAC_SIZE 0x0000007c | ||
204 | #define PCI_PBAC_SB (1 << 7) | ||
205 | #define PCI_PBAC_PP (1 << 8) | ||
206 | #define PCI_PBAC_MR_BIT 9 | ||
207 | #define PCI_PBAC_MR 0x00000600 | ||
208 | #define PCI_PBAC_MR_RD 0 | ||
209 | #define PCI_PBAC_MR_RD_LINE 1 | ||
210 | #define PCI_PBAC_MR_RD_MULT 2 | ||
211 | #define PCI_PBAC_MRL (1 << 11) | ||
212 | #define PCI_PBAC_MRM (1 << 12) | ||
213 | #define PCI_PBAC_TRP (1 << 13) | ||
214 | |||
215 | #define PCI_CFG40_TRDY_TIM 0x000000ff | ||
216 | #define PCI_CFG40_RET_LIM 0x0000ff00 | ||
217 | |||
218 | /* | ||
219 | * PCI Local Base Address [0|1|2|3] Register | ||
220 | */ | ||
221 | |||
222 | #define PCI_LBA_BADDR_BIT 0 | ||
223 | #define PCI_LBA_BADDR 0xffffff00 | ||
224 | |||
225 | /* | ||
226 | * PCI Local Base Address Control Register | ||
227 | */ | ||
228 | |||
229 | #define PCI_LBAC_MSI (1 << 0) | ||
230 | #define PCI_LBAC_MSI_MEM 0 | ||
231 | #define PCI_LBAC_MSI_IO 1 | ||
232 | #define PCI_LBAC_SIZE_BIT 2 | ||
233 | #define PCI_LBAC_SIZE 0x0000007c | ||
234 | #define PCI_LBAC_SB (1 << 7) | ||
235 | #define PCI_LBAC_RT (1 << 8) | ||
236 | #define PCI_LBAC_RT_NO_PREF 0 | ||
237 | #define PCI_LBAC_RT_PREF 1 | ||
238 | |||
239 | /* | ||
240 | * PCI Local Base Address [0|1|2|3] Mapping Register | ||
241 | */ | ||
242 | #define PCI_LBAM_MADDR_BIT 8 | ||
243 | #define PCI_LBAM_MADDR 0xffffff00 | ||
244 | |||
245 | /* | ||
246 | * PCI Decoupled Access Control Register | ||
247 | */ | ||
248 | #define PCI_DAC_DEN (1 << 0) | ||
249 | |||
250 | /* | ||
251 | * PCI Decoupled Access Status Register | ||
252 | */ | ||
253 | #define PCI_DAS_D (1 << 0) | ||
254 | #define PCI_DAS_B (1 << 1) | ||
255 | #define PCI_DAS_E (1 << 2) | ||
256 | #define PCI_DAS_OFE (1 << 3) | ||
257 | #define PCI_DAS_OFF (1 << 4) | ||
258 | #define PCI_DAS_IFE (1 << 5) | ||
259 | #define PCI_DAS_IFF (1 << 6) | ||
260 | |||
261 | /* | ||
262 | * PCI DMA Channel 8 Configuration Register | ||
263 | */ | ||
264 | #define PCI_DMA8C_MBS_BIT 0 | ||
265 | #define PCI_DMA8C_MBS 0x00000fff /* Maximum Burst Size. */ | ||
266 | #define PCI_DMA8C_OUR (1 << 12) | ||
267 | |||
268 | /* | ||
269 | * PCI DMA Channel 9 Configuration Register | ||
270 | */ | ||
271 | #define PCI_DMA9C_MBS_BIT 0 /* Maximum Burst Size. */ | ||
272 | #define PCI_DMA9C_MBS 0x00000fff | ||
273 | |||
274 | /* | ||
275 | * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors | ||
276 | */ | ||
277 | |||
278 | #define PCI_DMAD_PT_BIT 22 /* in DEVCMD field (descriptor) */ | ||
279 | #define PCI_DMAD_PT 0x00c00000 /* preferred transaction field */ | ||
280 | /* These are for reads (DMA channel 8) */ | ||
281 | #define PCI_DMAD_DEVCMD_MR 0 /* memory read */ | ||
282 | #define PCI_DMAD_DEVCMD_MRL 1 /* memory read line */ | ||
283 | #define PCI_DMAD_DEVCMD_MRM 2 /* memory read multiple */ | ||
284 | #define PCI_DMAD_DEVCMD_IOR 3 /* I/O read */ | ||
285 | /* These are for writes (DMA channel 9) */ | ||
286 | #define PCI_DMAD_DEVCMD_MW 0 /* memory write */ | ||
287 | #define PCI_DMAD_DEVCMD_MWI 1 /* memory write invalidate */ | ||
288 | #define PCI_DMAD_DEVCMD_IOW 3 /* I/O write */ | ||
289 | |||
290 | /* Swap byte field applies to both DMA channel 8 and 9 */ | ||
291 | #define PCI_DMAD_SB (1 << 24) /* swap byte field */ | ||
292 | |||
293 | |||
294 | /* | ||
295 | * PCI Target Control Register | ||
296 | */ | ||
297 | |||
298 | #define PCI_TC_RTIMER_BIT 0 | ||
299 | #define PCI_TC_RTIMER 0x000000ff | ||
300 | #define PCI_TC_DTIMER_BIT 8 | ||
301 | #define PCI_TC_DTIMER 0x0000ff00 | ||
302 | #define PCI_TC_RDR (1 << 18) | ||
303 | #define PCI_TC_DDT (1 << 19) | ||
304 | |||
305 | /* | ||
306 | * PCI messaging unit [applies to both inbound and outbound registers ] | ||
307 | */ | ||
308 | #define PCI_MSU_M0 (1 << 0) | ||
309 | #define PCI_MSU_M1 (1 << 1) | ||
310 | #define PCI_MSU_DB (1 << 2) | ||
311 | |||
312 | #define PCI_MSG_ADDR 0xB8088010 | ||
313 | #define PCI0_ADDR 0xB8080000 | ||
314 | #define rc32434_pci ((struct pci_reg *) PCI0_ADDR) | ||
315 | #define rc32434_pci_msg ((struct pci_msu *) PCI_MSG_ADDR) | ||
316 | |||
317 | #define PCIM_SHFT 0x6 | ||
318 | #define PCIM_BIT_LEN 0x7 | ||
319 | #define PCIM_H_EA 0x3 | ||
320 | #define PCIM_H_IA_FIX 0x4 | ||
321 | #define PCIM_H_IA_RR 0x5 | ||
322 | #if 0 | ||
323 | #define PCI_ADDR_START 0x13000000 | ||
324 | #endif | ||
325 | |||
326 | #define PCI_ADDR_START 0x50000000 | ||
327 | |||
328 | #define CPUTOPCI_MEM_WIN 0x02000000 | ||
329 | #define CPUTOPCI_IO_WIN 0x00100000 | ||
330 | #define PCILBA_SIZE_SHFT 2 | ||
331 | #define PCILBA_SIZE_MASK 0x1F | ||
332 | #define SIZE_256MB 0x1C | ||
333 | #define SIZE_128MB 0x1B | ||
334 | #define SIZE_64MB 0x1A | ||
335 | #define SIZE_32MB 0x19 | ||
336 | #define SIZE_16MB 0x18 | ||
337 | #define SIZE_4MB 0x16 | ||
338 | #define SIZE_2MB 0x15 | ||
339 | #define SIZE_1MB 0x14 | ||
340 | #define KORINA_CONFIG0_ADDR 0x80000000 | ||
341 | #define KORINA_CONFIG1_ADDR 0x80000004 | ||
342 | #define KORINA_CONFIG2_ADDR 0x80000008 | ||
343 | #define KORINA_CONFIG3_ADDR 0x8000000C | ||
344 | #define KORINA_CONFIG4_ADDR 0x80000010 | ||
345 | #define KORINA_CONFIG5_ADDR 0x80000014 | ||
346 | #define KORINA_CONFIG6_ADDR 0x80000018 | ||
347 | #define KORINA_CONFIG7_ADDR 0x8000001C | ||
348 | #define KORINA_CONFIG8_ADDR 0x80000020 | ||
349 | #define KORINA_CONFIG9_ADDR 0x80000024 | ||
350 | #define KORINA_CONFIG10_ADDR 0x80000028 | ||
351 | #define KORINA_CONFIG11_ADDR 0x8000002C | ||
352 | #define KORINA_CONFIG12_ADDR 0x80000030 | ||
353 | #define KORINA_CONFIG13_ADDR 0x80000034 | ||
354 | #define KORINA_CONFIG14_ADDR 0x80000038 | ||
355 | #define KORINA_CONFIG15_ADDR 0x8000003C | ||
356 | #define KORINA_CONFIG16_ADDR 0x80000040 | ||
357 | #define KORINA_CONFIG17_ADDR 0x80000044 | ||
358 | #define KORINA_CONFIG18_ADDR 0x80000048 | ||
359 | #define KORINA_CONFIG19_ADDR 0x8000004C | ||
360 | #define KORINA_CONFIG20_ADDR 0x80000050 | ||
361 | #define KORINA_CONFIG21_ADDR 0x80000054 | ||
362 | #define KORINA_CONFIG22_ADDR 0x80000058 | ||
363 | #define KORINA_CONFIG23_ADDR 0x8000005C | ||
364 | #define KORINA_CONFIG24_ADDR 0x80000060 | ||
365 | #define KORINA_CONFIG25_ADDR 0x80000064 | ||
366 | #define KORINA_CMD (PCI_CFG04_CMD_IO_ENA | \ | ||
367 | PCI_CFG04_CMD_MEM_ENA | \ | ||
368 | PCI_CFG04_CMD_BM_ENA | \ | ||
369 | PCI_CFG04_CMD_MW_INV | \ | ||
370 | PCI_CFG04_CMD_PAR_ENA | \ | ||
371 | PCI_CFG04_CMD_SER_ENA) | ||
372 | |||
373 | #define KORINA_STAT (PCI_CFG04_STAT_MDPE | \ | ||
374 | PCI_CFG04_STAT_STA | \ | ||
375 | PCI_CFG04_STAT_RTA | \ | ||
376 | PCI_CFG04_STAT_RMA | \ | ||
377 | PCI_CFG04_STAT_SSE | \ | ||
378 | PCI_CFG04_STAT_PE) | ||
379 | |||
380 | #define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD) | ||
381 | |||
382 | #define KORINA_REVID 0 | ||
383 | #define KORINA_CLASS_CODE 0 | ||
384 | #define KORINA_CNFG2 ((KORINA_CLASS_CODE<<8) | \ | ||
385 | KORINA_REVID) | ||
386 | |||
387 | #define KORINA_CACHE_LINE_SIZE 4 | ||
388 | #define KORINA_MASTER_LAT 0x3c | ||
389 | #define KORINA_HEADER_TYPE 0 | ||
390 | #define KORINA_BIST 0 | ||
391 | |||
392 | #define KORINA_CNFG3 ((KORINA_BIST << 24) | \ | ||
393 | (KORINA_HEADER_TYPE<<16) | \ | ||
394 | (KORINA_MASTER_LAT<<8) | \ | ||
395 | KORINA_CACHE_LINE_SIZE) | ||
396 | |||
397 | #define KORINA_BAR0 0x00000008 /* 128 MB Memory */ | ||
398 | #define KORINA_BAR1 0x18800001 /* 1 MB IO */ | ||
399 | #define KORINA_BAR2 0x18000001 /* 2 MB IO window for Korina | ||
400 | internal Registers */ | ||
401 | #define KORINA_BAR3 0x48000008 /* Spare 128 MB Memory */ | ||
402 | |||
403 | #define KORINA_CNFG4 KORINA_BAR0 | ||
404 | #define KORINA_CNFG5 KORINA_BAR1 | ||
405 | #define KORINA_CNFG6 KORINA_BAR2 | ||
406 | #define KORINA_CNFG7 KORINA_BAR3 | ||
407 | |||
408 | #define KORINA_SUBSYS_VENDOR_ID 0x011d | ||
409 | #define KORINA_SUBSYSTEM_ID 0x0214 | ||
410 | #define KORINA_CNFG8 0 | ||
411 | #define KORINA_CNFG9 0 | ||
412 | #define KORINA_CNFG10 0 | ||
413 | #define KORINA_CNFG11 ((KORINA_SUBSYS_VENDOR_ID<<16) | \ | ||
414 | KORINA_SUBSYSTEM_ID) | ||
415 | #define KORINA_INT_LINE 1 | ||
416 | #define KORINA_INT_PIN 1 | ||
417 | #define KORINA_MIN_GNT 8 | ||
418 | #define KORINA_MAX_LAT 0x38 | ||
419 | #define KORINA_CNFG12 0 | ||
420 | #define KORINA_CNFG13 0 | ||
421 | #define KORINA_CNFG14 0 | ||
422 | #define KORINA_CNFG15 ((KORINA_MAX_LAT<<24) | \ | ||
423 | (KORINA_MIN_GNT<<16) | \ | ||
424 | (KORINA_INT_PIN<<8) | \ | ||
425 | KORINA_INT_LINE) | ||
426 | #define KORINA_RETRY_LIMIT 0x80 | ||
427 | #define KORINA_TRDY_LIMIT 0x80 | ||
428 | #define KORINA_CNFG16 ((KORINA_RETRY_LIMIT<<8) | \ | ||
429 | KORINA_TRDY_LIMIT) | ||
430 | #define PCI_PBAxC_R 0x0 | ||
431 | #define PCI_PBAxC_RL 0x1 | ||
432 | #define PCI_PBAxC_RM 0x2 | ||
433 | #define SIZE_SHFT 2 | ||
434 | |||
435 | #if defined(__MIPSEB__) | ||
436 | #define KORINA_PBA0C (PCI_PBAC_MRL | PCI_PBAC_SB | \ | ||
437 | ((PCI_PBAxC_RM & 0x3) << PCI_PBAC_MR_BIT) | \ | ||
438 | PCI_PBAC_PP | \ | ||
439 | (SIZE_128MB<<SIZE_SHFT) | \ | ||
440 | PCI_PBAC_P) | ||
441 | #else | ||
442 | #define KORINA_PBA0C (PCI_PBAC_MRL | \ | ||
443 | ((PCI_PBAxC_RM & 0x3) << PCI_PBAC_MR_BIT) | \ | ||
444 | PCI_PBAC_PP | \ | ||
445 | (SIZE_128MB<<SIZE_SHFT) | \ | ||
446 | PCI_PBAC_P) | ||
447 | #endif | ||
448 | #define KORINA_CNFG17 KORINA_PBA0C | ||
449 | #define KORINA_PBA0M 0x0 | ||
450 | #define KORINA_CNFG18 KORINA_PBA0M | ||
451 | |||
452 | #if defined(__MIPSEB__) | ||
453 | #define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCI_PBAC_SB | \ | ||
454 | PCI_PBAC_MSI) | ||
455 | #else | ||
456 | #define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | \ | ||
457 | PCI_PBAC_MSI) | ||
458 | #endif | ||
459 | #define KORINA_CNFG19 KORINA_PBA1C | ||
460 | #define KORINA_PBA1M 0x0 | ||
461 | #define KORINA_CNFG20 KORINA_PBA1M | ||
462 | |||
463 | #if defined(__MIPSEB__) | ||
464 | #define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCI_PBAC_SB | \ | ||
465 | PCI_PBAC_MSI) | ||
466 | #else | ||
467 | #define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | \ | ||
468 | PCI_PBAC_MSI) | ||
469 | #endif | ||
470 | #define KORINA_CNFG21 KORINA_PBA2C | ||
471 | #define KORINA_PBA2M 0x18000000 | ||
472 | #define KORINA_CNFG22 KORINA_PBA2M | ||
473 | #define KORINA_PBA3C 0 | ||
474 | #define KORINA_CNFG23 KORINA_PBA3C | ||
475 | #define KORINA_PBA3M 0 | ||
476 | #define KORINA_CNFG24 KORINA_PBA3M | ||
477 | |||
478 | #define PCITC_DTIMER_VAL 8 | ||
479 | #define PCITC_RTIMER_VAL 0x10 | ||
480 | |||
481 | #endif /* __ASM_RC32434_PCI_H */ | ||
diff --git a/include/asm-mips/mach-rc32434/prom.h b/include/asm-mips/mach-rc32434/prom.h deleted file mode 100644 index 660707f1bcce..000000000000 --- a/include/asm-mips/mach-rc32434/prom.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for the PROM | ||
3 | * | ||
4 | * Copyright 2002 Ryan Holm <ryan.holmQVist@idt.com> | ||
5 | * Copyright 2008 Florian Fainelli <florian@openwrt.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
13 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
14 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
15 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
17 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
18 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
21 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License along | ||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | #define PROM_ENTRY(x) (0xbfc00000 + ((x) * 8)) | ||
30 | |||
31 | #define SR_NMI 0x00180000 | ||
32 | #define SERIAL_SPEED_ENTRY 0x00000001 | ||
33 | |||
34 | #define FREQ_TAG "HZ=" | ||
35 | #define KMAC_TAG "kmac=" | ||
36 | #define MEM_TAG "mem=" | ||
37 | #define BOARD_TAG "board=" | ||
38 | |||
39 | #define BOARD_RB532 "500" | ||
40 | #define BOARD_RB532A "500r5" | ||
diff --git a/include/asm-mips/mach-rc32434/rb.h b/include/asm-mips/mach-rc32434/rb.h deleted file mode 100644 index 79e8ef67d0d3..000000000000 --- a/include/asm-mips/mach-rc32434/rb.h +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License as published by | ||
4 | * the Free Software Foundation; either version 2 of the License, or | ||
5 | * (at your option) any later version. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | * | ||
12 | * Copyright (C) 2004 IDT Inc. | ||
13 | * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> | ||
14 | */ | ||
15 | #ifndef __ASM_RC32434_RB_H | ||
16 | #define __ASM_RC32434_RB_H | ||
17 | |||
18 | #include <linux/genhd.h> | ||
19 | |||
20 | #define REGBASE 0x18000000 | ||
21 | #define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(REGBASE)) | ||
22 | #define UART0BASE 0x58000 | ||
23 | #define RST (1 << 15) | ||
24 | #define DEV0BASE 0x010000 | ||
25 | #define DEV0MASK 0x010004 | ||
26 | #define DEV0C 0x010008 | ||
27 | #define DEV0T 0x01000C | ||
28 | #define DEV1BASE 0x010010 | ||
29 | #define DEV1MASK 0x010014 | ||
30 | #define DEV1C 0x010018 | ||
31 | #define DEV1TC 0x01001C | ||
32 | #define DEV2BASE 0x010020 | ||
33 | #define DEV2MASK 0x010024 | ||
34 | #define DEV2C 0x010028 | ||
35 | #define DEV2TC 0x01002C | ||
36 | #define DEV3BASE 0x010030 | ||
37 | #define DEV3MASK 0x010034 | ||
38 | #define DEV3C 0x010038 | ||
39 | #define DEV3TC 0x01003C | ||
40 | #define BTCS 0x010040 | ||
41 | #define BTCOMPARE 0x010044 | ||
42 | #define GPIOBASE 0x050000 | ||
43 | #define GPIOCFG 0x050004 | ||
44 | #define GPIOD 0x050008 | ||
45 | #define GPIOILEVEL 0x05000C | ||
46 | #define GPIOISTAT 0x050010 | ||
47 | #define GPIONMIEN 0x050014 | ||
48 | #define IMASK6 0x038038 | ||
49 | #define LO_WPX (1 << 0) | ||
50 | #define LO_ALE (1 << 1) | ||
51 | #define LO_CLE (1 << 2) | ||
52 | #define LO_CEX (1 << 3) | ||
53 | #define LO_FOFF (1 << 5) | ||
54 | #define LO_SPICS (1 << 6) | ||
55 | #define LO_ULED (1 << 7) | ||
56 | |||
57 | #define BIT_TO_MASK(x) (1 << x) | ||
58 | |||
59 | struct dev_reg { | ||
60 | u32 base; | ||
61 | u32 mask; | ||
62 | u32 ctl; | ||
63 | u32 timing; | ||
64 | }; | ||
65 | |||
66 | struct korina_device { | ||
67 | char *name; | ||
68 | unsigned char mac[6]; | ||
69 | struct net_device *dev; | ||
70 | }; | ||
71 | |||
72 | struct cf_device { | ||
73 | int gpio_pin; | ||
74 | void *dev; | ||
75 | struct gendisk *gd; | ||
76 | }; | ||
77 | |||
78 | struct mpmc_device { | ||
79 | unsigned char state; | ||
80 | spinlock_t lock; | ||
81 | void __iomem *base; | ||
82 | }; | ||
83 | |||
84 | #endif /* __ASM_RC32434_RB_H */ | ||
diff --git a/include/asm-mips/mach-rc32434/rc32434.h b/include/asm-mips/mach-rc32434/rc32434.h deleted file mode 100644 index fce25d4231fc..000000000000 --- a/include/asm-mips/mach-rc32434/rc32434.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for IDT RC323434 CPU. | ||
3 | */ | ||
4 | |||
5 | #ifndef _ASM_RC32434_RC32434_H_ | ||
6 | #define _ASM_RC32434_RC32434_H_ | ||
7 | |||
8 | #include <linux/delay.h> | ||
9 | #include <linux/io.h> | ||
10 | |||
11 | #define IDT_CLOCK_MULT 2 | ||
12 | |||
13 | /* cpu pipeline flush */ | ||
14 | static inline void rc32434_sync(void) | ||
15 | { | ||
16 | __asm__ volatile ("sync"); | ||
17 | } | ||
18 | |||
19 | #endif /* _ASM_RC32434_RC32434_H_ */ | ||
diff --git a/include/asm-mips/mach-rc32434/timer.h b/include/asm-mips/mach-rc32434/timer.h deleted file mode 100644 index e49b1d57a017..000000000000 --- a/include/asm-mips/mach-rc32434/timer.h +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for timer registers | ||
3 | * | ||
4 | * Copyright 2004 Philip Rischel <rischelp@idt.com> | ||
5 | * Copyright 2008 Florian Fainelli <florian@openwrt.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
13 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
14 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
15 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
17 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
18 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
21 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License along | ||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | #ifndef __ASM_RC32434_TIMER_H | ||
30 | #define __ASM_RC32434_TIMER_H | ||
31 | |||
32 | #include <asm/mach-rc32434/rb.h> | ||
33 | |||
34 | #define TIMER0_BASE_ADDR 0x18028000 | ||
35 | #define TIMER_COUNT 3 | ||
36 | |||
37 | struct timer_counter { | ||
38 | u32 count; | ||
39 | u32 compare; | ||
40 | u32 ctc; /*use CTC_ */ | ||
41 | }; | ||
42 | |||
43 | struct timer { | ||
44 | struct timer_counter tim[TIMER_COUNT]; | ||
45 | u32 rcount; /* use RCOUNT_ */ | ||
46 | u32 rcompare; /* use RCOMPARE_ */ | ||
47 | u32 rtc; /* use RTC_ */ | ||
48 | }; | ||
49 | |||
50 | #define RC32434_CTC_EN_BIT 0 | ||
51 | #define RC32434_CTC_TO_BIT 1 | ||
52 | |||
53 | /* Real time clock registers */ | ||
54 | #define RC32434_RTC_MSK(x) BIT_TO_MASK(x) | ||
55 | #define RC32434_RTC_CE_BIT 0 | ||
56 | #define RC32434_RTC_TO_BIT 1 | ||
57 | #define RC32434_RTC_RQE_BIT 2 | ||
58 | |||
59 | /* Counter registers */ | ||
60 | #define RC32434_RCOUNT_BIT 0 | ||
61 | #define RC32434_RCOUNT_MSK 0x0000ffff | ||
62 | #define RC32434_RCOMP_BIT 0 | ||
63 | #define RC32434_RCOMP_MSK 0x0000ffff | ||
64 | |||
65 | #endif /* __ASM_RC32434_TIMER_H */ | ||
diff --git a/include/asm-mips/mach-rc32434/war.h b/include/asm-mips/mach-rc32434/war.h deleted file mode 100644 index 3ddf187e98a6..000000000000 --- a/include/asm-mips/mach-rc32434/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_MIPS_WAR_H | ||
9 | #define __ASM_MIPS_MACH_MIPS_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 1 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_MIPS_WAR_H */ | ||
diff --git a/include/asm-mips/mach-rm/cpu-feature-overrides.h b/include/asm-mips/mach-rm/cpu-feature-overrides.h deleted file mode 100644 index ccf543363537..000000000000 --- a/include/asm-mips/mach-rm/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org) | ||
7 | * | ||
8 | * SNI RM200 C apparently was only shipped with R4600 V2.0 and R5000 processors. | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_RM200_CPU_FEATURE_OVERRIDES_H | ||
11 | #define __ASM_MACH_RM200_CPU_FEATURE_OVERRIDES_H | ||
12 | |||
13 | #include <cpu-feature-overrides.h> | ||
14 | |||
15 | #define cpu_has_tlb 1 | ||
16 | #define cpu_has_4kex 1 | ||
17 | #define cpu_has_4k_cache 1 | ||
18 | #define cpu_has_fpu 1 | ||
19 | #define cpu_has_32fpr 1 | ||
20 | #define cpu_has_counter 1 | ||
21 | #define cpu_has_watch 0 | ||
22 | #define cpu_has_mips16 0 | ||
23 | #define cpu_has_divec 0 | ||
24 | #define cpu_has_cache_cdex_p 1 | ||
25 | #define cpu_has_prefetch 0 | ||
26 | #define cpu_has_mcheck 0 | ||
27 | #define cpu_has_ejtag 0 | ||
28 | #define cpu_has_llsc 1 | ||
29 | #define cpu_has_vtag_icache 0 | ||
30 | #define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) | ||
31 | #define cpu_has_ic_fills_f_dc 0 | ||
32 | #define cpu_has_dsp 0 | ||
33 | #define cpu_has_nofpuex 0 | ||
34 | #define cpu_has_64bits 1 | ||
35 | #define cpu_has_mipsmt 0 | ||
36 | #define cpu_has_userlocal 0 | ||
37 | |||
38 | #define cpu_has_mips32r1 0 | ||
39 | #define cpu_has_mips32r2 0 | ||
40 | #define cpu_has_mips64r1 0 | ||
41 | #define cpu_has_mips64r2 0 | ||
42 | |||
43 | #endif /* __ASM_MACH_RM200_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-rm/mc146818rtc.h b/include/asm-mips/mach-rm/mc146818rtc.h deleted file mode 100644 index 145bce096fe9..000000000000 --- a/include/asm-mips/mach-rm/mc146818rtc.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004 by Ralf Baechle | ||
7 | * | ||
8 | * RTC routines for PC style attached Dallas chip with ARC epoch. | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_RM_MC146818RTC_H | ||
11 | #define __ASM_MACH_RM_MC146818RTC_H | ||
12 | |||
13 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
14 | #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) | ||
15 | #else | ||
16 | #define mc146818_decode_year(year) ((year) + 1980) | ||
17 | #endif | ||
18 | |||
19 | #include_next <mc146818rtc.h> | ||
20 | |||
21 | #endif /* __ASM_MACH_RM_MC146818RTC_H */ | ||
diff --git a/include/asm-mips/mach-rm/war.h b/include/asm-mips/mach-rm/war.h deleted file mode 100644 index 948d3129a114..000000000000 --- a/include/asm-mips/mach-rm/war.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_RM_WAR_H | ||
9 | #define __ASM_MIPS_MACH_RM_WAR_H | ||
10 | |||
11 | /* | ||
12 | * The RM200C seems to have been shipped only with V2.0 R4600s | ||
13 | */ | ||
14 | |||
15 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
16 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
17 | #define R4600_V2_HIT_CACHEOP_WAR 1 | ||
18 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
19 | #define BCM1250_M3_WAR 0 | ||
20 | #define SIBYTE_1956_WAR 0 | ||
21 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
22 | #define MIPS_CACHE_SYNC_WAR 0 | ||
23 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
24 | #define RM9000_CDEX_SMP_WAR 0 | ||
25 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
26 | #define R10000_LLSC_WAR 0 | ||
27 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
28 | |||
29 | #endif /* __ASM_MIPS_MACH_RM_WAR_H */ | ||
diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h deleted file mode 100644 index 1c1f92415b9a..000000000000 --- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H | ||
9 | #define __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H | ||
10 | |||
11 | /* | ||
12 | * Sibyte are MIPS64 processors wired to a specific configuration | ||
13 | */ | ||
14 | #define cpu_has_watch 1 | ||
15 | #define cpu_has_mips16 0 | ||
16 | #define cpu_has_divec 1 | ||
17 | #define cpu_has_vce 0 | ||
18 | #define cpu_has_cache_cdex_p 0 | ||
19 | #define cpu_has_cache_cdex_s 0 | ||
20 | #define cpu_has_prefetch 1 | ||
21 | #define cpu_has_mcheck 1 | ||
22 | #define cpu_has_ejtag 1 | ||
23 | |||
24 | #define cpu_has_llsc 1 | ||
25 | #define cpu_has_vtag_icache 1 | ||
26 | #define cpu_has_dc_aliases 0 | ||
27 | #define cpu_has_ic_fills_f_dc 0 | ||
28 | #define cpu_has_dsp 0 | ||
29 | #define cpu_has_mipsmt 0 | ||
30 | #define cpu_has_userlocal 0 | ||
31 | #define cpu_icache_snoops_remote_store 0 | ||
32 | |||
33 | #define cpu_has_nofpuex 0 | ||
34 | #define cpu_has_64bits 1 | ||
35 | |||
36 | #define cpu_has_mips32r1 1 | ||
37 | #define cpu_has_mips32r2 0 | ||
38 | #define cpu_has_mips64r1 1 | ||
39 | #define cpu_has_mips64r2 0 | ||
40 | |||
41 | #define cpu_has_inclusive_pcaches 0 | ||
42 | |||
43 | #define cpu_dcache_line_size() 32 | ||
44 | #define cpu_icache_line_size() 32 | ||
45 | #define cpu_scache_line_size() 32 | ||
46 | |||
47 | #endif /* __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-sibyte/war.h b/include/asm-mips/mach-sibyte/war.h deleted file mode 100644 index 7950ef4f032c..000000000000 --- a/include/asm-mips/mach-sibyte/war.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_SIBYTE_WAR_H | ||
9 | #define __ASM_MIPS_MACH_SIBYTE_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | |||
16 | #if defined(CONFIG_SB1_PASS_1_WORKAROUNDS) || \ | ||
17 | defined(CONFIG_SB1_PASS_2_WORKAROUNDS) | ||
18 | |||
19 | #define BCM1250_M3_WAR 1 | ||
20 | #define SIBYTE_1956_WAR 1 | ||
21 | |||
22 | #else | ||
23 | |||
24 | #define BCM1250_M3_WAR 0 | ||
25 | #define SIBYTE_1956_WAR 0 | ||
26 | |||
27 | #endif | ||
28 | |||
29 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
30 | #define MIPS_CACHE_SYNC_WAR 0 | ||
31 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
32 | #define RM9000_CDEX_SMP_WAR 0 | ||
33 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
34 | #define R10000_LLSC_WAR 0 | ||
35 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
36 | |||
37 | #endif /* __ASM_MIPS_MACH_SIBYTE_WAR_H */ | ||
diff --git a/include/asm-mips/mach-tx39xx/ioremap.h b/include/asm-mips/mach-tx39xx/ioremap.h deleted file mode 100644 index 93c6c04ffda3..000000000000 --- a/include/asm-mips/mach-tx39xx/ioremap.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/mach-tx39xx/ioremap.h | ||
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 | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_TX39XX_IOREMAP_H | ||
10 | #define __ASM_MACH_TX39XX_IOREMAP_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | /* | ||
15 | * Allow physical addresses to be fixed up to help peripherals located | ||
16 | * outside the low 32-bit range -- generic pass-through version. | ||
17 | */ | ||
18 | static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
19 | { | ||
20 | return phys_addr; | ||
21 | } | ||
22 | |||
23 | static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, | ||
24 | unsigned long flags) | ||
25 | { | ||
26 | #define TXX9_DIRECTMAP_BASE 0xff000000ul | ||
27 | if (offset >= TXX9_DIRECTMAP_BASE && | ||
28 | offset < TXX9_DIRECTMAP_BASE + 0xff0000) | ||
29 | return (void __iomem *)offset; | ||
30 | return NULL; | ||
31 | } | ||
32 | |||
33 | static inline int plat_iounmap(const volatile void __iomem *addr) | ||
34 | { | ||
35 | return (unsigned long)addr >= TXX9_DIRECTMAP_BASE; | ||
36 | } | ||
37 | |||
38 | #endif /* __ASM_MACH_TX39XX_IOREMAP_H */ | ||
diff --git a/include/asm-mips/mach-tx39xx/mangle-port.h b/include/asm-mips/mach-tx39xx/mangle-port.h deleted file mode 100644 index ef0b502fd8b7..000000000000 --- a/include/asm-mips/mach-tx39xx/mangle-port.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_TX39XX_MANGLE_PORT_H | ||
2 | #define __ASM_MACH_TX39XX_MANGLE_PORT_H | ||
3 | |||
4 | #if defined(CONFIG_TOSHIBA_JMR3927) | ||
5 | extern unsigned long (*__swizzle_addr_b)(unsigned long port); | ||
6 | #define NEEDS_TXX9_SWIZZLE_ADDR_B | ||
7 | #else | ||
8 | #define __swizzle_addr_b(port) (port) | ||
9 | #endif | ||
10 | #define __swizzle_addr_w(port) (port) | ||
11 | #define __swizzle_addr_l(port) (port) | ||
12 | #define __swizzle_addr_q(port) (port) | ||
13 | |||
14 | #define ioswabb(a, x) (x) | ||
15 | #define __mem_ioswabb(a, x) (x) | ||
16 | #define ioswabw(a, x) le16_to_cpu(x) | ||
17 | #define __mem_ioswabw(a, x) (x) | ||
18 | #define ioswabl(a, x) le32_to_cpu(x) | ||
19 | #define __mem_ioswabl(a, x) (x) | ||
20 | #define ioswabq(a, x) le64_to_cpu(x) | ||
21 | #define __mem_ioswabq(a, x) (x) | ||
22 | |||
23 | #endif /* __ASM_MACH_TX39XX_MANGLE_PORT_H */ | ||
diff --git a/include/asm-mips/mach-tx39xx/war.h b/include/asm-mips/mach-tx39xx/war.h deleted file mode 100644 index 433814616359..000000000000 --- a/include/asm-mips/mach-tx39xx/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_TX39XX_WAR_H | ||
9 | #define __ASM_MIPS_MACH_TX39XX_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_TX39XX_WAR_H */ | ||
diff --git a/include/asm-mips/mach-tx49xx/cpu-feature-overrides.h b/include/asm-mips/mach-tx49xx/cpu-feature-overrides.h deleted file mode 100644 index 275eaf92c748..000000000000 --- a/include/asm-mips/mach-tx49xx/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_TX49XX_CPU_FEATURE_OVERRIDES_H | ||
2 | #define __ASM_MACH_TX49XX_CPU_FEATURE_OVERRIDES_H | ||
3 | |||
4 | #define cpu_has_llsc 1 | ||
5 | #define cpu_has_64bits 1 | ||
6 | #define cpu_has_inclusive_pcaches 0 | ||
7 | |||
8 | #define cpu_has_mips16 0 | ||
9 | #define cpu_has_mdmx 0 | ||
10 | #define cpu_has_mips3d 0 | ||
11 | #define cpu_has_smartmips 0 | ||
12 | #define cpu_has_vtag_icache 0 | ||
13 | #define cpu_has_ic_fills_f_dc 0 | ||
14 | #define cpu_has_dsp 0 | ||
15 | #define cpu_has_mipsmt 0 | ||
16 | #define cpu_has_userlocal 0 | ||
17 | |||
18 | #define cpu_has_mips32r1 0 | ||
19 | #define cpu_has_mips32r2 0 | ||
20 | #define cpu_has_mips64r1 0 | ||
21 | #define cpu_has_mips64r2 0 | ||
22 | |||
23 | #endif /* __ASM_MACH_TX49XX_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-tx49xx/ioremap.h b/include/asm-mips/mach-tx49xx/ioremap.h deleted file mode 100644 index 1e7beae72229..000000000000 --- a/include/asm-mips/mach-tx49xx/ioremap.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/mach-tx49xx/ioremap.h | ||
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 | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_TX49XX_IOREMAP_H | ||
10 | #define __ASM_MACH_TX49XX_IOREMAP_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | /* | ||
15 | * Allow physical addresses to be fixed up to help peripherals located | ||
16 | * outside the low 32-bit range -- generic pass-through version. | ||
17 | */ | ||
18 | static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
19 | { | ||
20 | return phys_addr; | ||
21 | } | ||
22 | |||
23 | static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, | ||
24 | unsigned long flags) | ||
25 | { | ||
26 | #ifdef CONFIG_64BIT | ||
27 | #define TXX9_DIRECTMAP_BASE 0xfff000000ul | ||
28 | #else | ||
29 | #define TXX9_DIRECTMAP_BASE 0xff000000ul | ||
30 | #endif | ||
31 | if (offset >= TXX9_DIRECTMAP_BASE && | ||
32 | offset < TXX9_DIRECTMAP_BASE + 0x400000) | ||
33 | return (void __iomem *)(unsigned long)(int)offset; | ||
34 | return NULL; | ||
35 | } | ||
36 | |||
37 | static inline int plat_iounmap(const volatile void __iomem *addr) | ||
38 | { | ||
39 | return (unsigned long)addr >= | ||
40 | (unsigned long)(int)(TXX9_DIRECTMAP_BASE & 0xffffffff); | ||
41 | } | ||
42 | |||
43 | #endif /* __ASM_MACH_TX49XX_IOREMAP_H */ | ||
diff --git a/include/asm-mips/mach-tx49xx/kmalloc.h b/include/asm-mips/mach-tx49xx/kmalloc.h deleted file mode 100644 index 913ff196259d..000000000000 --- a/include/asm-mips/mach-tx49xx/kmalloc.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_TX49XX_KMALLOC_H | ||
2 | #define __ASM_MACH_TX49XX_KMALLOC_H | ||
3 | |||
4 | /* | ||
5 | * All happy, no need to define ARCH_KMALLOC_MINALIGN | ||
6 | */ | ||
7 | |||
8 | #endif /* __ASM_MACH_TX49XX_KMALLOC_H */ | ||
diff --git a/include/asm-mips/mach-tx49xx/war.h b/include/asm-mips/mach-tx49xx/war.h deleted file mode 100644 index 39b5d1177c57..000000000000 --- a/include/asm-mips/mach-tx49xx/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_TX49XX_WAR_H | ||
9 | #define __ASM_MIPS_MACH_TX49XX_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 1 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_TX49XX_WAR_H */ | ||
diff --git a/include/asm-mips/mach-vr41xx/irq.h b/include/asm-mips/mach-vr41xx/irq.h deleted file mode 100644 index 862058d3f81b..000000000000 --- a/include/asm-mips/mach-vr41xx/irq.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_VR41XX_IRQ_H | ||
2 | #define __ASM_MACH_VR41XX_IRQ_H | ||
3 | |||
4 | #include <asm/vr41xx/irq.h> /* for MIPS_CPU_IRQ_BASE */ | ||
5 | |||
6 | #include_next <irq.h> | ||
7 | |||
8 | #endif /* __ASM_MACH_VR41XX_IRQ_H */ | ||
diff --git a/include/asm-mips/mach-vr41xx/war.h b/include/asm-mips/mach-vr41xx/war.h deleted file mode 100644 index 56a38926412a..000000000000 --- a/include/asm-mips/mach-vr41xx/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_VR41XX_WAR_H | ||
9 | #define __ASM_MIPS_MACH_VR41XX_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_VR41XX_WAR_H */ | ||
diff --git a/include/asm-mips/mach-wrppmc/mach-gt64120.h b/include/asm-mips/mach-wrppmc/mach-gt64120.h deleted file mode 100644 index 83746b84a5ec..000000000000 --- a/include/asm-mips/mach-wrppmc/mach-gt64120.h +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | /* | ||
2 | * This is a direct copy of the ev96100.h file, with a global | ||
3 | * search and replace. The numbers are the same. | ||
4 | * | ||
5 | * The reason I'm duplicating this is so that the 64120/96100 | ||
6 | * defines won't be confusing in the source code. | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_GT64120_H | ||
9 | #define __ASM_MIPS_GT64120_H | ||
10 | |||
11 | /* | ||
12 | * This is the CPU physical memory map of PPMC Board: | ||
13 | * | ||
14 | * 0x00000000-0x03FFFFFF - 64MB SDRAM (SCS[0]#) | ||
15 | * 0x1C000000-0x1C000000 - LED (CS0) | ||
16 | * 0x1C800000-0x1C800007 - UART 16550 port (CS1) | ||
17 | * 0x1F000000-0x1F000000 - MailBox (CS3) | ||
18 | * 0x1FC00000-0x20000000 - 4MB Flash (BOOT CS) | ||
19 | */ | ||
20 | |||
21 | #define WRPPMC_SDRAM_SCS0_BASE 0x00000000 | ||
22 | #define WRPPMC_SDRAM_SCS0_SIZE 0x04000000 | ||
23 | |||
24 | #define WRPPMC_UART16550_BASE 0x1C800000 | ||
25 | #define WRPPMC_UART16550_CLOCK 3686400 /* 3.68MHZ */ | ||
26 | |||
27 | #define WRPPMC_LED_BASE 0x1C000000 | ||
28 | #define WRPPMC_MBOX_BASE 0x1F000000 | ||
29 | |||
30 | #define WRPPMC_BOOTROM_BASE 0x1FC00000 | ||
31 | #define WRPPMC_BOOTROM_SIZE 0x00400000 /* 4M Flash */ | ||
32 | |||
33 | #define WRPPMC_MIPS_TIMER_IRQ 7 /* MIPS compare/count timer interrupt */ | ||
34 | #define WRPPMC_UART16550_IRQ 6 | ||
35 | #define WRPPMC_PCI_INTA_IRQ 3 | ||
36 | |||
37 | /* | ||
38 | * PCI Bus I/O and Memory resources allocation | ||
39 | * | ||
40 | * NOTE: We only have PCI_0 hose interface | ||
41 | */ | ||
42 | #define GT_PCI_MEM_BASE 0x13000000UL | ||
43 | #define GT_PCI_MEM_SIZE 0x02000000UL | ||
44 | #define GT_PCI_IO_BASE 0x11000000UL | ||
45 | #define GT_PCI_IO_SIZE 0x02000000UL | ||
46 | |||
47 | /* | ||
48 | * PCI interrupts will come in on either the INTA or INTD interrupt lines, | ||
49 | * which are mapped to the #2 and #5 interrupt pins of the MIPS. On our | ||
50 | * boards, they all either come in on IntD or they all come in on IntA, they | ||
51 | * aren't mixed. There can be numerous PCI interrupts, so we keep a list of the | ||
52 | * "requested" interrupt numbers and go through the list whenever we get an | ||
53 | * IntA/D. | ||
54 | * | ||
55 | * Interrupts < 8 are directly wired to the processor; PCI INTA is 8 and | ||
56 | * INTD is 11. | ||
57 | */ | ||
58 | #define GT_TIMER 4 | ||
59 | #define GT_INTA 2 | ||
60 | #define GT_INTD 5 | ||
61 | |||
62 | #ifndef __ASSEMBLY__ | ||
63 | |||
64 | /* | ||
65 | * GT64120 internal register space base address | ||
66 | */ | ||
67 | extern unsigned long gt64120_base; | ||
68 | |||
69 | #define GT64120_BASE (gt64120_base) | ||
70 | |||
71 | /* define WRPPMC_EARLY_DEBUG to enable early output something to UART */ | ||
72 | #undef WRPPMC_EARLY_DEBUG | ||
73 | |||
74 | #ifdef WRPPMC_EARLY_DEBUG | ||
75 | extern void wrppmc_led_on(int mask); | ||
76 | extern void wrppmc_led_off(int mask); | ||
77 | extern void wrppmc_early_printk(const char *fmt, ...); | ||
78 | #else | ||
79 | #define wrppmc_early_printk(fmt, ...) do {} while (0) | ||
80 | #endif /* WRPPMC_EARLY_DEBUG */ | ||
81 | |||
82 | #endif /* __ASSEMBLY__ */ | ||
83 | #endif /* __ASM_MIPS_GT64120_H */ | ||
diff --git a/include/asm-mips/mach-wrppmc/war.h b/include/asm-mips/mach-wrppmc/war.h deleted file mode 100644 index ac48629bb1ce..000000000000 --- a/include/asm-mips/mach-wrppmc/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_WRPPMC_WAR_H | ||
9 | #define __ASM_MIPS_MACH_WRPPMC_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 1 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_WRPPMC_WAR_H */ | ||
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h deleted file mode 100644 index 470e5e9e10d6..000000000000 --- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H | ||
9 | #define __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H | ||
10 | |||
11 | /* | ||
12 | * Momentum Jaguar ATX always has the RM9000 processor. | ||
13 | */ | ||
14 | #define cpu_has_watch 1 | ||
15 | #define cpu_has_mips16 0 | ||
16 | #define cpu_has_divec 0 | ||
17 | #define cpu_has_vce 0 | ||
18 | #define cpu_has_cache_cdex_p 0 | ||
19 | #define cpu_has_cache_cdex_s 0 | ||
20 | #define cpu_has_prefetch 1 | ||
21 | #define cpu_has_mcheck 0 | ||
22 | #define cpu_has_ejtag 0 | ||
23 | |||
24 | #define cpu_has_llsc 1 | ||
25 | #define cpu_has_vtag_icache 0 | ||
26 | #define cpu_has_dc_aliases 0 | ||
27 | #define cpu_has_ic_fills_f_dc 0 | ||
28 | #define cpu_has_dsp 0 | ||
29 | #define cpu_has_mipsmt 0 | ||
30 | #define cpu_has_userlocal 0 | ||
31 | #define cpu_icache_snoops_remote_store 0 | ||
32 | |||
33 | #define cpu_has_nofpuex 0 | ||
34 | #define cpu_has_64bits 1 | ||
35 | |||
36 | #define cpu_has_inclusive_pcaches 0 | ||
37 | |||
38 | #define cpu_dcache_line_size() 32 | ||
39 | #define cpu_icache_line_size() 32 | ||
40 | #define cpu_scache_line_size() 32 | ||
41 | |||
42 | #define cpu_has_mips32r1 0 | ||
43 | #define cpu_has_mips32r2 0 | ||
44 | #define cpu_has_mips64r1 0 | ||
45 | #define cpu_has_mips64r2 0 | ||
46 | |||
47 | #endif /* __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-yosemite/war.h b/include/asm-mips/mach-yosemite/war.h deleted file mode 100644 index e5c6d53efc86..000000000000 --- a/include/asm-mips/mach-yosemite/war.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_YOSEMITE_WAR_H | ||
9 | #define __ASM_MIPS_MACH_YOSEMITE_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 1 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 1 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_YOSEMITE_WAR_H */ | ||
diff --git a/include/asm-mips/mc146818-time.h b/include/asm-mips/mc146818-time.h deleted file mode 100644 index cdc379a0a94e..000000000000 --- a/include/asm-mips/mc146818-time.h +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Machine dependent access functions for RTC registers. | ||
7 | */ | ||
8 | #ifndef __ASM_MC146818_TIME_H | ||
9 | #define __ASM_MC146818_TIME_H | ||
10 | |||
11 | #include <linux/bcd.h> | ||
12 | #include <linux/mc146818rtc.h> | ||
13 | #include <linux/time.h> | ||
14 | |||
15 | /* | ||
16 | * For check timing call set_rtc_mmss() 500ms; used in timer interrupt. | ||
17 | */ | ||
18 | #define USEC_AFTER 500000 | ||
19 | #define USEC_BEFORE 500000 | ||
20 | |||
21 | /* | ||
22 | * In order to set the CMOS clock precisely, set_rtc_mmss has to be | ||
23 | * called 500 ms after the second nowtime has started, because when | ||
24 | * nowtime is written into the registers of the CMOS clock, it will | ||
25 | * jump to the next second precisely 500 ms later. Check the Motorola | ||
26 | * MC146818A or Dallas DS12887 data sheet for details. | ||
27 | * | ||
28 | * BUG: This routine does not handle hour overflow properly; it just | ||
29 | * sets the minutes. Usually you'll only notice that after reboot! | ||
30 | */ | ||
31 | static inline int mc146818_set_rtc_mmss(unsigned long nowtime) | ||
32 | { | ||
33 | int real_seconds, real_minutes, cmos_minutes; | ||
34 | unsigned char save_control, save_freq_select; | ||
35 | int retval = 0; | ||
36 | unsigned long flags; | ||
37 | |||
38 | spin_lock_irqsave(&rtc_lock, flags); | ||
39 | save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */ | ||
40 | CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL); | ||
41 | |||
42 | save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */ | ||
43 | CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT); | ||
44 | |||
45 | cmos_minutes = CMOS_READ(RTC_MINUTES); | ||
46 | if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) | ||
47 | BCD_TO_BIN(cmos_minutes); | ||
48 | |||
49 | /* | ||
50 | * since we're only adjusting minutes and seconds, | ||
51 | * don't interfere with hour overflow. This avoids | ||
52 | * messing with unknown time zones but requires your | ||
53 | * RTC not to be off by more than 15 minutes | ||
54 | */ | ||
55 | real_seconds = nowtime % 60; | ||
56 | real_minutes = nowtime / 60; | ||
57 | if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) | ||
58 | real_minutes += 30; /* correct for half hour time zone */ | ||
59 | real_minutes %= 60; | ||
60 | |||
61 | if (abs(real_minutes - cmos_minutes) < 30) { | ||
62 | if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { | ||
63 | BIN_TO_BCD(real_seconds); | ||
64 | BIN_TO_BCD(real_minutes); | ||
65 | } | ||
66 | CMOS_WRITE(real_seconds, RTC_SECONDS); | ||
67 | CMOS_WRITE(real_minutes, RTC_MINUTES); | ||
68 | } else { | ||
69 | printk(KERN_WARNING | ||
70 | "set_rtc_mmss: can't update from %d to %d\n", | ||
71 | cmos_minutes, real_minutes); | ||
72 | retval = -1; | ||
73 | } | ||
74 | |||
75 | /* The following flags have to be released exactly in this order, | ||
76 | * otherwise the DS12887 (popular MC146818A clone with integrated | ||
77 | * battery and quartz) will not reset the oscillator and will not | ||
78 | * update precisely 500 ms later. You won't find this mentioned in | ||
79 | * the Dallas Semiconductor data sheets, but who believes data | ||
80 | * sheets anyway ... -- Markus Kuhn | ||
81 | */ | ||
82 | CMOS_WRITE(save_control, RTC_CONTROL); | ||
83 | CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); | ||
84 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
85 | |||
86 | return retval; | ||
87 | } | ||
88 | |||
89 | static inline unsigned long mc146818_get_cmos_time(void) | ||
90 | { | ||
91 | unsigned int year, mon, day, hour, min, sec; | ||
92 | unsigned long flags; | ||
93 | |||
94 | spin_lock_irqsave(&rtc_lock, flags); | ||
95 | |||
96 | do { | ||
97 | sec = CMOS_READ(RTC_SECONDS); | ||
98 | min = CMOS_READ(RTC_MINUTES); | ||
99 | hour = CMOS_READ(RTC_HOURS); | ||
100 | day = CMOS_READ(RTC_DAY_OF_MONTH); | ||
101 | mon = CMOS_READ(RTC_MONTH); | ||
102 | year = CMOS_READ(RTC_YEAR); | ||
103 | } while (sec != CMOS_READ(RTC_SECONDS)); | ||
104 | |||
105 | if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { | ||
106 | BCD_TO_BIN(sec); | ||
107 | BCD_TO_BIN(min); | ||
108 | BCD_TO_BIN(hour); | ||
109 | BCD_TO_BIN(day); | ||
110 | BCD_TO_BIN(mon); | ||
111 | BCD_TO_BIN(year); | ||
112 | } | ||
113 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
114 | year = mc146818_decode_year(year); | ||
115 | |||
116 | return mktime(year, mon, day, hour, min, sec); | ||
117 | } | ||
118 | |||
119 | #endif /* __ASM_MC146818_TIME_H */ | ||
diff --git a/include/asm-mips/mc146818rtc.h b/include/asm-mips/mc146818rtc.h deleted file mode 100644 index 68b4da6d520b..000000000000 --- a/include/asm-mips/mc146818rtc.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Machine dependent access functions for RTC registers. | ||
7 | * | ||
8 | * Copyright (C) 1996, 1997, 1998, 2000 Ralf Baechle | ||
9 | * Copyright (C) 2002 Maciej W. Rozycki | ||
10 | */ | ||
11 | #ifndef _ASM_MC146818RTC_H | ||
12 | #define _ASM_MC146818RTC_H | ||
13 | |||
14 | #include <mc146818rtc.h> | ||
15 | |||
16 | #endif /* _ASM_MC146818RTC_H */ | ||
diff --git a/include/asm-mips/mips-boards/bonito64.h b/include/asm-mips/mips-boards/bonito64.h deleted file mode 100644 index a0f04bb99c99..000000000000 --- a/include/asm-mips/mips-boards/bonito64.h +++ /dev/null | |||
@@ -1,436 +0,0 @@ | |||
1 | /* | ||
2 | * Bonito Register Map | ||
3 | * | ||
4 | * This file is the original bonito.h from Algorithmics with minor changes | ||
5 | * to fit into linux. | ||
6 | * | ||
7 | * Copyright (c) 1999 Algorithmics Ltd | ||
8 | * | ||
9 | * Carsten Langgaard, carstenl@mips.com | ||
10 | * Copyright (C) 2001 MIPS Technologies, Inc. All rights reserved. | ||
11 | * | ||
12 | * Algorithmics gives permission for anyone to use and modify this file | ||
13 | * without any obligation or license condition except that you retain | ||
14 | * this copyright message in any source redistribution in whole or part. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | /* Revision 1.48 autogenerated on 08/17/99 15:20:01 */ | ||
19 | /* This bonito64 version editted from bonito.h Revision 1.48 on 11/09/00 */ | ||
20 | |||
21 | #ifndef _ASM_MIPS_BOARDS_BONITO64_H | ||
22 | #define _ASM_MIPS_BOARDS_BONITO64_H | ||
23 | |||
24 | #ifdef __ASSEMBLY__ | ||
25 | |||
26 | /* offsets from base register */ | ||
27 | #define BONITO(x) (x) | ||
28 | |||
29 | #elif defined(CONFIG_LEMOTE_FULONG) | ||
30 | |||
31 | #define BONITO(x) (*(volatile u32 *)((char *)CKSEG1ADDR(BONITO_REG_BASE) + (x))) | ||
32 | #define BONITO_IRQ_BASE 32 | ||
33 | |||
34 | #else | ||
35 | |||
36 | /* | ||
37 | * Algorithmics Bonito64 system controller register base. | ||
38 | */ | ||
39 | extern unsigned long _pcictrl_bonito; | ||
40 | extern unsigned long _pcictrl_bonito_pcicfg; | ||
41 | |||
42 | #define BONITO(x) *(volatile u32 *)(_pcictrl_bonito + (x)) | ||
43 | |||
44 | #endif /* __ASSEMBLY__ */ | ||
45 | |||
46 | |||
47 | #define BONITO_BOOT_BASE 0x1fc00000 | ||
48 | #define BONITO_BOOT_SIZE 0x00100000 | ||
49 | #define BONITO_BOOT_TOP (BONITO_BOOT_BASE+BONITO_BOOT_SIZE-1) | ||
50 | #define BONITO_FLASH_BASE 0x1c000000 | ||
51 | #define BONITO_FLASH_SIZE 0x03000000 | ||
52 | #define BONITO_FLASH_TOP (BONITO_FLASH_BASE+BONITO_FLASH_SIZE-1) | ||
53 | #define BONITO_SOCKET_BASE 0x1f800000 | ||
54 | #define BONITO_SOCKET_SIZE 0x00400000 | ||
55 | #define BONITO_SOCKET_TOP (BONITO_SOCKET_BASE+BONITO_SOCKET_SIZE-1) | ||
56 | #define BONITO_REG_BASE 0x1fe00000 | ||
57 | #define BONITO_REG_SIZE 0x00040000 | ||
58 | #define BONITO_REG_TOP (BONITO_REG_BASE+BONITO_REG_SIZE-1) | ||
59 | #define BONITO_DEV_BASE 0x1ff00000 | ||
60 | #define BONITO_DEV_SIZE 0x00100000 | ||
61 | #define BONITO_DEV_TOP (BONITO_DEV_BASE+BONITO_DEV_SIZE-1) | ||
62 | #define BONITO_PCILO_BASE 0x10000000 | ||
63 | #define BONITO_PCILO_SIZE 0x0c000000 | ||
64 | #define BONITO_PCILO_TOP (BONITO_PCILO_BASE+BONITO_PCILO_SIZE-1) | ||
65 | #define BONITO_PCILO0_BASE 0x10000000 | ||
66 | #define BONITO_PCILO1_BASE 0x14000000 | ||
67 | #define BONITO_PCILO2_BASE 0x18000000 | ||
68 | #define BONITO_PCIHI_BASE 0x20000000 | ||
69 | #define BONITO_PCIHI_SIZE 0x20000000 | ||
70 | #define BONITO_PCIHI_TOP (BONITO_PCIHI_BASE+BONITO_PCIHI_SIZE-1) | ||
71 | #define BONITO_PCIIO_BASE 0x1fd00000 | ||
72 | #define BONITO_PCIIO_SIZE 0x00100000 | ||
73 | #define BONITO_PCIIO_TOP (BONITO_PCIIO_BASE+BONITO_PCIIO_SIZE-1) | ||
74 | #define BONITO_PCICFG_BASE 0x1fe80000 | ||
75 | #define BONITO_PCICFG_SIZE 0x00080000 | ||
76 | #define BONITO_PCICFG_TOP (BONITO_PCICFG_BASE+BONITO_PCICFG_SIZE-1) | ||
77 | |||
78 | |||
79 | /* Bonito Register Bases */ | ||
80 | |||
81 | #define BONITO_PCICONFIGBASE 0x00 | ||
82 | #define BONITO_REGBASE 0x100 | ||
83 | |||
84 | |||
85 | /* PCI Configuration Registers */ | ||
86 | |||
87 | #define BONITO_PCI_REG(x) BONITO(BONITO_PCICONFIGBASE + (x)) | ||
88 | #define BONITO_PCIDID BONITO_PCI_REG(0x00) | ||
89 | #define BONITO_PCICMD BONITO_PCI_REG(0x04) | ||
90 | #define BONITO_PCICLASS BONITO_PCI_REG(0x08) | ||
91 | #define BONITO_PCILTIMER BONITO_PCI_REG(0x0c) | ||
92 | #define BONITO_PCIBASE0 BONITO_PCI_REG(0x10) | ||
93 | #define BONITO_PCIBASE1 BONITO_PCI_REG(0x14) | ||
94 | #define BONITO_PCIBASE2 BONITO_PCI_REG(0x18) | ||
95 | #define BONITO_PCIEXPRBASE BONITO_PCI_REG(0x30) | ||
96 | #define BONITO_PCIINT BONITO_PCI_REG(0x3c) | ||
97 | |||
98 | #define BONITO_PCICMD_PERR_CLR 0x80000000 | ||
99 | #define BONITO_PCICMD_SERR_CLR 0x40000000 | ||
100 | #define BONITO_PCICMD_MABORT_CLR 0x20000000 | ||
101 | #define BONITO_PCICMD_MTABORT_CLR 0x10000000 | ||
102 | #define BONITO_PCICMD_TABORT_CLR 0x08000000 | ||
103 | #define BONITO_PCICMD_MPERR_CLR 0x01000000 | ||
104 | #define BONITO_PCICMD_PERRRESPEN 0x00000040 | ||
105 | #define BONITO_PCICMD_ASTEPEN 0x00000080 | ||
106 | #define BONITO_PCICMD_SERREN 0x00000100 | ||
107 | #define BONITO_PCILTIMER_BUSLATENCY 0x0000ff00 | ||
108 | #define BONITO_PCILTIMER_BUSLATENCY_SHIFT 8 | ||
109 | |||
110 | |||
111 | |||
112 | |||
113 | /* 1. Bonito h/w Configuration */ | ||
114 | /* Power on register */ | ||
115 | |||
116 | #define BONITO_BONPONCFG BONITO(BONITO_REGBASE + 0x00) | ||
117 | |||
118 | #define BONITO_BONPONCFG_SYSCONTROLLERRD 0x00040000 | ||
119 | #define BONITO_BONPONCFG_ROMCS1SAMP 0x00020000 | ||
120 | #define BONITO_BONPONCFG_ROMCS0SAMP 0x00010000 | ||
121 | #define BONITO_BONPONCFG_CPUBIGEND 0x00004000 | ||
122 | /* Added by RPF 11-9-00 */ | ||
123 | #define BONITO_BONPONCFG_BURSTORDER 0x00001000 | ||
124 | /* --- */ | ||
125 | #define BONITO_BONPONCFG_CPUPARITY 0x00002000 | ||
126 | #define BONITO_BONPONCFG_CPUTYPE 0x00000007 | ||
127 | #define BONITO_BONPONCFG_CPUTYPE_SHIFT 0 | ||
128 | #define BONITO_BONPONCFG_PCIRESET_OUT 0x00000008 | ||
129 | #define BONITO_BONPONCFG_IS_ARBITER 0x00000010 | ||
130 | #define BONITO_BONPONCFG_ROMBOOT 0x000000c0 | ||
131 | #define BONITO_BONPONCFG_ROMBOOT_SHIFT 6 | ||
132 | |||
133 | #define BONITO_BONPONCFG_ROMBOOT_FLASH (0x0<<BONITO_BONPONCFG_ROMBOOT_SHIFT) | ||
134 | #define BONITO_BONPONCFG_ROMBOOT_SOCKET (0x1<<BONITO_BONPONCFG_ROMBOOT_SHIFT) | ||
135 | #define BONITO_BONPONCFG_ROMBOOT_SDRAM (0x2<<BONITO_BONPONCFG_ROMBOOT_SHIFT) | ||
136 | #define BONITO_BONPONCFG_ROMBOOT_CPURESET (0x3<<BONITO_BONPONCFG_ROMBOOT_SHIFT) | ||
137 | |||
138 | #define BONITO_BONPONCFG_ROMCS0WIDTH 0x00000100 | ||
139 | #define BONITO_BONPONCFG_ROMCS1WIDTH 0x00000200 | ||
140 | #define BONITO_BONPONCFG_ROMCS0FAST 0x00000400 | ||
141 | #define BONITO_BONPONCFG_ROMCS1FAST 0x00000800 | ||
142 | #define BONITO_BONPONCFG_CONFIG_DIS 0x00000020 | ||
143 | |||
144 | |||
145 | /* Other Bonito configuration */ | ||
146 | |||
147 | #define BONITO_BONGENCFG_OFFSET 0x4 | ||
148 | #define BONITO_BONGENCFG BONITO(BONITO_REGBASE + BONITO_BONGENCFG_OFFSET) | ||
149 | |||
150 | #define BONITO_BONGENCFG_DEBUGMODE 0x00000001 | ||
151 | #define BONITO_BONGENCFG_SNOOPEN 0x00000002 | ||
152 | #define BONITO_BONGENCFG_CPUSELFRESET 0x00000004 | ||
153 | |||
154 | #define BONITO_BONGENCFG_FORCE_IRQA 0x00000008 | ||
155 | #define BONITO_BONGENCFG_IRQA_ISOUT 0x00000010 | ||
156 | #define BONITO_BONGENCFG_IRQA_FROM_INT1 0x00000020 | ||
157 | #define BONITO_BONGENCFG_BYTESWAP 0x00000040 | ||
158 | |||
159 | #define BONITO_BONGENCFG_UNCACHED 0x00000080 | ||
160 | #define BONITO_BONGENCFG_PREFETCHEN 0x00000100 | ||
161 | #define BONITO_BONGENCFG_WBEHINDEN 0x00000200 | ||
162 | #define BONITO_BONGENCFG_CACHEALG 0x00000c00 | ||
163 | #define BONITO_BONGENCFG_CACHEALG_SHIFT 10 | ||
164 | #define BONITO_BONGENCFG_PCIQUEUE 0x00001000 | ||
165 | #define BONITO_BONGENCFG_CACHESTOP 0x00002000 | ||
166 | #define BONITO_BONGENCFG_MSTRBYTESWAP 0x00004000 | ||
167 | #define BONITO_BONGENCFG_BUSERREN 0x00008000 | ||
168 | #define BONITO_BONGENCFG_NORETRYTIMEOUT 0x00010000 | ||
169 | #define BONITO_BONGENCFG_SHORTCOPYTIMEOUT 0x00020000 | ||
170 | |||
171 | /* 2. IO & IDE configuration */ | ||
172 | |||
173 | #define BONITO_IODEVCFG BONITO(BONITO_REGBASE + 0x08) | ||
174 | |||
175 | /* 3. IO & IDE configuration */ | ||
176 | |||
177 | #define BONITO_SDCFG BONITO(BONITO_REGBASE + 0x0c) | ||
178 | |||
179 | /* 4. PCI address map control */ | ||
180 | |||
181 | #define BONITO_PCIMAP BONITO(BONITO_REGBASE + 0x10) | ||
182 | #define BONITO_PCIMEMBASECFG BONITO(BONITO_REGBASE + 0x14) | ||
183 | #define BONITO_PCIMAP_CFG BONITO(BONITO_REGBASE + 0x18) | ||
184 | |||
185 | /* 5. ICU & GPIO regs */ | ||
186 | |||
187 | /* GPIO Regs - r/w */ | ||
188 | |||
189 | #define BONITO_GPIODATA_OFFSET 0x1c | ||
190 | #define BONITO_GPIODATA BONITO(BONITO_REGBASE + BONITO_GPIODATA_OFFSET) | ||
191 | #define BONITO_GPIOIE BONITO(BONITO_REGBASE + 0x20) | ||
192 | |||
193 | /* ICU Configuration Regs - r/w */ | ||
194 | |||
195 | #define BONITO_INTEDGE BONITO(BONITO_REGBASE + 0x24) | ||
196 | #define BONITO_INTSTEER BONITO(BONITO_REGBASE + 0x28) | ||
197 | #define BONITO_INTPOL BONITO(BONITO_REGBASE + 0x2c) | ||
198 | |||
199 | /* ICU Enable Regs - IntEn & IntISR are r/o. */ | ||
200 | |||
201 | #define BONITO_INTENSET BONITO(BONITO_REGBASE + 0x30) | ||
202 | #define BONITO_INTENCLR BONITO(BONITO_REGBASE + 0x34) | ||
203 | #define BONITO_INTEN BONITO(BONITO_REGBASE + 0x38) | ||
204 | #define BONITO_INTISR BONITO(BONITO_REGBASE + 0x3c) | ||
205 | |||
206 | /* PCI mail boxes */ | ||
207 | |||
208 | #define BONITO_PCIMAIL0_OFFSET 0x40 | ||
209 | #define BONITO_PCIMAIL1_OFFSET 0x44 | ||
210 | #define BONITO_PCIMAIL2_OFFSET 0x48 | ||
211 | #define BONITO_PCIMAIL3_OFFSET 0x4c | ||
212 | #define BONITO_PCIMAIL0 BONITO(BONITO_REGBASE + 0x40) | ||
213 | #define BONITO_PCIMAIL1 BONITO(BONITO_REGBASE + 0x44) | ||
214 | #define BONITO_PCIMAIL2 BONITO(BONITO_REGBASE + 0x48) | ||
215 | #define BONITO_PCIMAIL3 BONITO(BONITO_REGBASE + 0x4c) | ||
216 | |||
217 | |||
218 | /* 6. PCI cache */ | ||
219 | |||
220 | #define BONITO_PCICACHECTRL BONITO(BONITO_REGBASE + 0x50) | ||
221 | #define BONITO_PCICACHETAG BONITO(BONITO_REGBASE + 0x54) | ||
222 | |||
223 | #define BONITO_PCIBADADDR BONITO(BONITO_REGBASE + 0x58) | ||
224 | #define BONITO_PCIMSTAT BONITO(BONITO_REGBASE + 0x5c) | ||
225 | |||
226 | |||
227 | /* | ||
228 | #define BONITO_PCIRDPOST BONITO(BONITO_REGBASE + 0x60) | ||
229 | #define BONITO_PCIDATA BONITO(BONITO_REGBASE + 0x64) | ||
230 | */ | ||
231 | |||
232 | /* 7. IDE DMA & Copier */ | ||
233 | |||
234 | #define BONITO_CONFIGBASE 0x000 | ||
235 | #define BONITO_BONITOBASE 0x100 | ||
236 | #define BONITO_LDMABASE 0x200 | ||
237 | #define BONITO_COPBASE 0x300 | ||
238 | #define BONITO_REG_BLOCKMASK 0x300 | ||
239 | |||
240 | #define BONITO_LDMACTRL BONITO(BONITO_LDMABASE + 0x0) | ||
241 | #define BONITO_LDMASTAT BONITO(BONITO_LDMABASE + 0x0) | ||
242 | #define BONITO_LDMAADDR BONITO(BONITO_LDMABASE + 0x4) | ||
243 | #define BONITO_LDMAGO BONITO(BONITO_LDMABASE + 0x8) | ||
244 | #define BONITO_LDMADATA BONITO(BONITO_LDMABASE + 0xc) | ||
245 | |||
246 | #define BONITO_COPCTRL BONITO(BONITO_COPBASE + 0x0) | ||
247 | #define BONITO_COPSTAT BONITO(BONITO_COPBASE + 0x0) | ||
248 | #define BONITO_COPPADDR BONITO(BONITO_COPBASE + 0x4) | ||
249 | #define BONITO_COPDADDR BONITO(BONITO_COPBASE + 0x8) | ||
250 | #define BONITO_COPGO BONITO(BONITO_COPBASE + 0xc) | ||
251 | |||
252 | |||
253 | /* ###### Bit Definitions for individual Registers #### */ | ||
254 | |||
255 | /* Gen DMA. */ | ||
256 | |||
257 | #define BONITO_IDECOPDADDR_DMA_DADDR 0x0ffffffc | ||
258 | #define BONITO_IDECOPDADDR_DMA_DADDR_SHIFT 2 | ||
259 | #define BONITO_IDECOPPADDR_DMA_PADDR 0xfffffffc | ||
260 | #define BONITO_IDECOPPADDR_DMA_PADDR_SHIFT 2 | ||
261 | #define BONITO_IDECOPGO_DMA_SIZE 0x0000fffe | ||
262 | #define BONITO_IDECOPGO_DMA_SIZE_SHIFT 0 | ||
263 | #define BONITO_IDECOPGO_DMA_WRITE 0x00010000 | ||
264 | #define BONITO_IDECOPGO_DMAWCOUNT 0x000f0000 | ||
265 | #define BONITO_IDECOPGO_DMAWCOUNT_SHIFT 16 | ||
266 | |||
267 | #define BONITO_IDECOPCTRL_DMA_STARTBIT 0x80000000 | ||
268 | #define BONITO_IDECOPCTRL_DMA_RSTBIT 0x40000000 | ||
269 | |||
270 | /* DRAM - sdCfg */ | ||
271 | |||
272 | #define BONITO_SDCFG_AROWBITS 0x00000003 | ||
273 | #define BONITO_SDCFG_AROWBITS_SHIFT 0 | ||
274 | #define BONITO_SDCFG_ACOLBITS 0x0000000c | ||
275 | #define BONITO_SDCFG_ACOLBITS_SHIFT 2 | ||
276 | #define BONITO_SDCFG_ABANKBIT 0x00000010 | ||
277 | #define BONITO_SDCFG_ASIDES 0x00000020 | ||
278 | #define BONITO_SDCFG_AABSENT 0x00000040 | ||
279 | #define BONITO_SDCFG_AWIDTH64 0x00000080 | ||
280 | |||
281 | #define BONITO_SDCFG_BROWBITS 0x00000300 | ||
282 | #define BONITO_SDCFG_BROWBITS_SHIFT 8 | ||
283 | #define BONITO_SDCFG_BCOLBITS 0x00000c00 | ||
284 | #define BONITO_SDCFG_BCOLBITS_SHIFT 10 | ||
285 | #define BONITO_SDCFG_BBANKBIT 0x00001000 | ||
286 | #define BONITO_SDCFG_BSIDES 0x00002000 | ||
287 | #define BONITO_SDCFG_BABSENT 0x00004000 | ||
288 | #define BONITO_SDCFG_BWIDTH64 0x00008000 | ||
289 | |||
290 | #define BONITO_SDCFG_EXTRDDATA 0x00010000 | ||
291 | #define BONITO_SDCFG_EXTRASCAS 0x00020000 | ||
292 | #define BONITO_SDCFG_EXTPRECH 0x00040000 | ||
293 | #define BONITO_SDCFG_EXTRASWIDTH 0x00180000 | ||
294 | #define BONITO_SDCFG_EXTRASWIDTH_SHIFT 19 | ||
295 | /* Changed by RPF 11-9-00 */ | ||
296 | #define BONITO_SDCFG_DRAMMODESET 0x00200000 | ||
297 | /* --- */ | ||
298 | #define BONITO_SDCFG_DRAMEXTREGS 0x00400000 | ||
299 | #define BONITO_SDCFG_DRAMPARITY 0x00800000 | ||
300 | /* Added by RPF 11-9-00 */ | ||
301 | #define BONITO_SDCFG_DRAMBURSTLEN 0x03000000 | ||
302 | #define BONITO_SDCFG_DRAMBURSTLEN_SHIFT 24 | ||
303 | #define BONITO_SDCFG_DRAMMODESET_DONE 0x80000000 | ||
304 | /* --- */ | ||
305 | |||
306 | /* PCI Cache - pciCacheCtrl */ | ||
307 | |||
308 | #define BONITO_PCICACHECTRL_CACHECMD 0x00000007 | ||
309 | #define BONITO_PCICACHECTRL_CACHECMD_SHIFT 0 | ||
310 | #define BONITO_PCICACHECTRL_CACHECMDLINE 0x00000018 | ||
311 | #define BONITO_PCICACHECTRL_CACHECMDLINE_SHIFT 3 | ||
312 | #define BONITO_PCICACHECTRL_CMDEXEC 0x00000020 | ||
313 | |||
314 | #define BONITO_PCICACHECTRL_IOBCCOH_PRES 0x00000100 | ||
315 | #define BONITO_PCICACHECTRL_IOBCCOH_EN 0x00000200 | ||
316 | #define BONITO_PCICACHECTRL_CPUCOH_PRES 0x00000400 | ||
317 | #define BONITO_PCICACHECTRL_CPUCOH_EN 0x00000800 | ||
318 | |||
319 | #define BONITO_IODEVCFG_BUFFBIT_CS0 0x00000001 | ||
320 | #define BONITO_IODEVCFG_SPEEDBIT_CS0 0x00000002 | ||
321 | #define BONITO_IODEVCFG_MOREABITS_CS0 0x00000004 | ||
322 | |||
323 | #define BONITO_IODEVCFG_BUFFBIT_CS1 0x00000008 | ||
324 | #define BONITO_IODEVCFG_SPEEDBIT_CS1 0x00000010 | ||
325 | #define BONITO_IODEVCFG_MOREABITS_CS1 0x00000020 | ||
326 | |||
327 | #define BONITO_IODEVCFG_BUFFBIT_CS2 0x00000040 | ||
328 | #define BONITO_IODEVCFG_SPEEDBIT_CS2 0x00000080 | ||
329 | #define BONITO_IODEVCFG_MOREABITS_CS2 0x00000100 | ||
330 | |||
331 | #define BONITO_IODEVCFG_BUFFBIT_CS3 0x00000200 | ||
332 | #define BONITO_IODEVCFG_SPEEDBIT_CS3 0x00000400 | ||
333 | #define BONITO_IODEVCFG_MOREABITS_CS3 0x00000800 | ||
334 | |||
335 | #define BONITO_IODEVCFG_BUFFBIT_IDE 0x00001000 | ||
336 | #define BONITO_IODEVCFG_SPEEDBIT_IDE 0x00002000 | ||
337 | #define BONITO_IODEVCFG_WORDSWAPBIT_IDE 0x00004000 | ||
338 | #define BONITO_IODEVCFG_MODEBIT_IDE 0x00008000 | ||
339 | #define BONITO_IODEVCFG_DMAON_IDE 0x001f0000 | ||
340 | #define BONITO_IODEVCFG_DMAON_IDE_SHIFT 16 | ||
341 | #define BONITO_IODEVCFG_DMAOFF_IDE 0x01e00000 | ||
342 | #define BONITO_IODEVCFG_DMAOFF_IDE_SHIFT 21 | ||
343 | #define BONITO_IODEVCFG_EPROMSPLIT 0x02000000 | ||
344 | /* Added by RPF 11-9-00 */ | ||
345 | #define BONITO_IODEVCFG_CPUCLOCKPERIOD 0xfc000000 | ||
346 | #define BONITO_IODEVCFG_CPUCLOCKPERIOD_SHIFT 26 | ||
347 | /* --- */ | ||
348 | |||
349 | /* gpio */ | ||
350 | #define BONITO_GPIO_GPIOW 0x000003ff | ||
351 | #define BONITO_GPIO_GPIOW_SHIFT 0 | ||
352 | #define BONITO_GPIO_GPIOR 0x01ff0000 | ||
353 | #define BONITO_GPIO_GPIOR_SHIFT 16 | ||
354 | #define BONITO_GPIO_GPINR 0xfe000000 | ||
355 | #define BONITO_GPIO_GPINR_SHIFT 25 | ||
356 | #define BONITO_GPIO_IOW(N) (1<<(BONITO_GPIO_GPIOW_SHIFT+(N))) | ||
357 | #define BONITO_GPIO_IOR(N) (1<<(BONITO_GPIO_GPIOR_SHIFT+(N))) | ||
358 | #define BONITO_GPIO_INR(N) (1<<(BONITO_GPIO_GPINR_SHIFT+(N))) | ||
359 | |||
360 | /* ICU */ | ||
361 | #define BONITO_ICU_MBOXES 0x0000000f | ||
362 | #define BONITO_ICU_MBOXES_SHIFT 0 | ||
363 | #define BONITO_ICU_DMARDY 0x00000010 | ||
364 | #define BONITO_ICU_DMAEMPTY 0x00000020 | ||
365 | #define BONITO_ICU_COPYRDY 0x00000040 | ||
366 | #define BONITO_ICU_COPYEMPTY 0x00000080 | ||
367 | #define BONITO_ICU_COPYERR 0x00000100 | ||
368 | #define BONITO_ICU_PCIIRQ 0x00000200 | ||
369 | #define BONITO_ICU_MASTERERR 0x00000400 | ||
370 | #define BONITO_ICU_SYSTEMERR 0x00000800 | ||
371 | #define BONITO_ICU_DRAMPERR 0x00001000 | ||
372 | #define BONITO_ICU_RETRYERR 0x00002000 | ||
373 | #define BONITO_ICU_GPIOS 0x01ff0000 | ||
374 | #define BONITO_ICU_GPIOS_SHIFT 16 | ||
375 | #define BONITO_ICU_GPINS 0x7e000000 | ||
376 | #define BONITO_ICU_GPINS_SHIFT 25 | ||
377 | #define BONITO_ICU_MBOX(N) (1<<(BONITO_ICU_MBOXES_SHIFT+(N))) | ||
378 | #define BONITO_ICU_GPIO(N) (1<<(BONITO_ICU_GPIOS_SHIFT+(N))) | ||
379 | #define BONITO_ICU_GPIN(N) (1<<(BONITO_ICU_GPINS_SHIFT+(N))) | ||
380 | |||
381 | /* pcimap */ | ||
382 | |||
383 | #define BONITO_PCIMAP_PCIMAP_LO0 0x0000003f | ||
384 | #define BONITO_PCIMAP_PCIMAP_LO0_SHIFT 0 | ||
385 | #define BONITO_PCIMAP_PCIMAP_LO1 0x00000fc0 | ||
386 | #define BONITO_PCIMAP_PCIMAP_LO1_SHIFT 6 | ||
387 | #define BONITO_PCIMAP_PCIMAP_LO2 0x0003f000 | ||
388 | #define BONITO_PCIMAP_PCIMAP_LO2_SHIFT 12 | ||
389 | #define BONITO_PCIMAP_PCIMAP_2 0x00040000 | ||
390 | #define BONITO_PCIMAP_WIN(WIN, ADDR) ((((ADDR)>>26) & BONITO_PCIMAP_PCIMAP_LO0) << ((WIN)*6)) | ||
391 | |||
392 | #define BONITO_PCIMAP_WINSIZE (1<<26) | ||
393 | #define BONITO_PCIMAP_WINOFFSET(ADDR) ((ADDR) & (BONITO_PCIMAP_WINSIZE - 1)) | ||
394 | #define BONITO_PCIMAP_WINBASE(ADDR) ((ADDR) << 26) | ||
395 | |||
396 | /* pcimembaseCfg */ | ||
397 | |||
398 | #define BONITO_PCIMEMBASECFG_MASK 0xf0000000 | ||
399 | #define BONITO_PCIMEMBASECFG_MEMBASE0_MASK 0x0000001f | ||
400 | #define BONITO_PCIMEMBASECFG_MEMBASE0_MASK_SHIFT 0 | ||
401 | #define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS 0x000003e0 | ||
402 | #define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS_SHIFT 5 | ||
403 | #define BONITO_PCIMEMBASECFG_MEMBASE0_CACHED 0x00000400 | ||
404 | #define BONITO_PCIMEMBASECFG_MEMBASE0_IO 0x00000800 | ||
405 | |||
406 | #define BONITO_PCIMEMBASECFG_MEMBASE1_MASK 0x0001f000 | ||
407 | #define BONITO_PCIMEMBASECFG_MEMBASE1_MASK_SHIFT 12 | ||
408 | #define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS 0x003e0000 | ||
409 | #define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS_SHIFT 17 | ||
410 | #define BONITO_PCIMEMBASECFG_MEMBASE1_CACHED 0x00400000 | ||
411 | #define BONITO_PCIMEMBASECFG_MEMBASE1_IO 0x00800000 | ||
412 | |||
413 | #define BONITO_PCIMEMBASECFG_ASHIFT 23 | ||
414 | #define BONITO_PCIMEMBASECFG_AMASK 0x007fffff | ||
415 | #define BONITO_PCIMEMBASECFGSIZE(WIN, SIZE) (((~((SIZE)-1))>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) | ||
416 | #define BONITO_PCIMEMBASECFGBASE(WIN, BASE) (((BASE)>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS) | ||
417 | |||
418 | #define BONITO_PCIMEMBASECFG_SIZE(WIN, CFG) (((((~(CFG)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)) << (BONITO_PCIMEMBASECFG_ASHIFT - BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) | BONITO_PCIMEMBASECFG_AMASK) | ||
419 | |||
420 | |||
421 | #define BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT) | ||
422 | #define BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT) | ||
423 | #define BONITO_PCIMEMBASECFG_ADDRTRANS(WIN, CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT) | ||
424 | |||
425 | #define BONITO_PCITOPHYS(WIN, ADDR, CFG) ( \ | ||
426 | (((ADDR) & (~(BONITO_PCIMEMBASECFG_MASK))) & (~(BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG)))) | \ | ||
427 | (BONITO_PCIMEMBASECFG_ADDRTRANS(WIN, CFG)) \ | ||
428 | ) | ||
429 | |||
430 | /* PCICmd */ | ||
431 | |||
432 | #define BONITO_PCICMD_MEMEN 0x00000002 | ||
433 | #define BONITO_PCICMD_MSTREN 0x00000004 | ||
434 | |||
435 | |||
436 | #endif /* _ASM_MIPS_BOARDS_BONITO64_H */ | ||
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h deleted file mode 100644 index 7f0b034dd9a5..000000000000 --- a/include/asm-mips/mips-boards/generic.h +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can distribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License (Version 2) as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
12 | * for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
17 | * | ||
18 | * Defines of the MIPS boards specific address-MAP, registers, etc. | ||
19 | */ | ||
20 | #ifndef __ASM_MIPS_BOARDS_GENERIC_H | ||
21 | #define __ASM_MIPS_BOARDS_GENERIC_H | ||
22 | |||
23 | #include <asm/addrspace.h> | ||
24 | #include <asm/byteorder.h> | ||
25 | #include <asm/mips-boards/bonito64.h> | ||
26 | |||
27 | /* | ||
28 | * Display register base. | ||
29 | */ | ||
30 | #define ASCII_DISPLAY_WORD_BASE 0x1f000410 | ||
31 | #define ASCII_DISPLAY_POS_BASE 0x1f000418 | ||
32 | |||
33 | |||
34 | /* | ||
35 | * Yamon Prom print address. | ||
36 | */ | ||
37 | #define YAMON_PROM_PRINT_ADDR 0x1fc00504 | ||
38 | |||
39 | |||
40 | /* | ||
41 | * Reset register. | ||
42 | */ | ||
43 | #define SOFTRES_REG 0x1f000500 | ||
44 | #define GORESET 0x42 | ||
45 | |||
46 | /* | ||
47 | * Revision register. | ||
48 | */ | ||
49 | #define MIPS_REVISION_REG 0x1fc00010 | ||
50 | #define MIPS_REVISION_CORID_QED_RM5261 0 | ||
51 | #define MIPS_REVISION_CORID_CORE_LV 1 | ||
52 | #define MIPS_REVISION_CORID_BONITO64 2 | ||
53 | #define MIPS_REVISION_CORID_CORE_20K 3 | ||
54 | #define MIPS_REVISION_CORID_CORE_FPGA 4 | ||
55 | #define MIPS_REVISION_CORID_CORE_MSC 5 | ||
56 | #define MIPS_REVISION_CORID_CORE_EMUL 6 | ||
57 | #define MIPS_REVISION_CORID_CORE_FPGA2 7 | ||
58 | #define MIPS_REVISION_CORID_CORE_FPGAR2 8 | ||
59 | #define MIPS_REVISION_CORID_CORE_FPGA3 9 | ||
60 | #define MIPS_REVISION_CORID_CORE_24K 10 | ||
61 | #define MIPS_REVISION_CORID_CORE_FPGA4 11 | ||
62 | #define MIPS_REVISION_CORID_CORE_FPGA5 12 | ||
63 | |||
64 | /**** Artificial corid defines ****/ | ||
65 | /* | ||
66 | * CoreEMUL with Bonito System Controller is treated like a Core20K | ||
67 | * CoreEMUL with SOC-it 101 System Controller is treated like a CoreMSC | ||
68 | */ | ||
69 | #define MIPS_REVISION_CORID_CORE_EMUL_BON -1 | ||
70 | #define MIPS_REVISION_CORID_CORE_EMUL_MSC -2 | ||
71 | |||
72 | #define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f) | ||
73 | |||
74 | extern int mips_revision_corid; | ||
75 | |||
76 | #define MIPS_REVISION_SCON_OTHER 0 | ||
77 | #define MIPS_REVISION_SCON_SOCITSC 1 | ||
78 | #define MIPS_REVISION_SCON_SOCITSCP 2 | ||
79 | |||
80 | /* Artificial SCON defines for MIPS_REVISION_SCON_OTHER */ | ||
81 | #define MIPS_REVISION_SCON_UNKNOWN -1 | ||
82 | #define MIPS_REVISION_SCON_GT64120 -2 | ||
83 | #define MIPS_REVISION_SCON_BONITO -3 | ||
84 | #define MIPS_REVISION_SCON_BRTL -4 | ||
85 | #define MIPS_REVISION_SCON_SOCIT -5 | ||
86 | #define MIPS_REVISION_SCON_ROCIT -6 | ||
87 | |||
88 | #define MIPS_REVISION_SCONID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 24) & 0xff) | ||
89 | |||
90 | extern int mips_revision_sconid; | ||
91 | |||
92 | extern void mips_reboot_setup(void); | ||
93 | |||
94 | #ifdef CONFIG_PCI | ||
95 | extern void mips_pcibios_init(void); | ||
96 | #else | ||
97 | #define mips_pcibios_init() do { } while (0) | ||
98 | #endif | ||
99 | |||
100 | #ifdef CONFIG_KGDB | ||
101 | extern void kgdb_config(void); | ||
102 | #endif | ||
103 | |||
104 | #endif /* __ASM_MIPS_BOARDS_GENERIC_H */ | ||
diff --git a/include/asm-mips/mips-boards/launch.h b/include/asm-mips/mips-boards/launch.h deleted file mode 100644 index d8ae7f95a522..000000000000 --- a/include/asm-mips/mips-boards/launch.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | */ | ||
4 | |||
5 | #ifndef _ASSEMBLER_ | ||
6 | |||
7 | struct cpulaunch { | ||
8 | unsigned long pc; | ||
9 | unsigned long gp; | ||
10 | unsigned long sp; | ||
11 | unsigned long a0; | ||
12 | unsigned long _pad[3]; /* pad to cache line size to avoid thrashing */ | ||
13 | unsigned long flags; | ||
14 | }; | ||
15 | |||
16 | #else | ||
17 | |||
18 | #define LOG2CPULAUNCH 5 | ||
19 | #define LAUNCH_PC 0 | ||
20 | #define LAUNCH_GP 4 | ||
21 | #define LAUNCH_SP 8 | ||
22 | #define LAUNCH_A0 12 | ||
23 | #define LAUNCH_FLAGS 28 | ||
24 | |||
25 | #endif | ||
26 | |||
27 | #define LAUNCH_FREADY 1 | ||
28 | #define LAUNCH_FGO 2 | ||
29 | #define LAUNCH_FGONE 4 | ||
30 | |||
31 | #define CPULAUNCH 0x00000f00 | ||
32 | #define NCPULAUNCH 8 | ||
33 | |||
34 | /* Polling period in count cycles for secondary CPU's */ | ||
35 | #define LAUNCHPERIOD 10000 | ||
diff --git a/include/asm-mips/mips-boards/malta.h b/include/asm-mips/mips-boards/malta.h deleted file mode 100644 index c1891578fa65..000000000000 --- a/include/asm-mips/mips-boards/malta.h +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can distribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License (Version 2) as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
12 | * for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
17 | * | ||
18 | * Defines of the Malta board specific address-MAP, registers, etc. | ||
19 | */ | ||
20 | #ifndef __ASM_MIPS_BOARDS_MALTA_H | ||
21 | #define __ASM_MIPS_BOARDS_MALTA_H | ||
22 | |||
23 | #include <asm/addrspace.h> | ||
24 | #include <asm/io.h> | ||
25 | #include <asm/mips-boards/msc01_pci.h> | ||
26 | #include <asm/gt64120.h> | ||
27 | |||
28 | /* Mips interrupt controller found in SOCit variations */ | ||
29 | #define MIPS_MSC01_IC_REG_BASE 0x1bc40000 | ||
30 | #define MIPS_SOCITSC_IC_REG_BASE 0x1ffa0000 | ||
31 | |||
32 | /* | ||
33 | * Malta I/O ports base address for the Galileo GT64120 and Algorithmics | ||
34 | * Bonito system controllers. | ||
35 | */ | ||
36 | #define MALTA_GT_PORT_BASE get_gt_port_base(GT_PCI0IOLD_OFS) | ||
37 | #define MALTA_BONITO_PORT_BASE ((unsigned long)ioremap (0x1fd00000, 0x10000)) | ||
38 | #define MALTA_MSC_PORT_BASE get_msc_port_base(MSC01_PCI_SC2PIOBASL) | ||
39 | |||
40 | static inline unsigned long get_gt_port_base(unsigned long reg) | ||
41 | { | ||
42 | unsigned long addr; | ||
43 | addr = GT_READ(reg); | ||
44 | return (unsigned long) ioremap (((addr & 0xffff) << 21), 0x10000); | ||
45 | } | ||
46 | |||
47 | static inline unsigned long get_msc_port_base(unsigned long reg) | ||
48 | { | ||
49 | unsigned long addr; | ||
50 | MSC_READ(reg, addr); | ||
51 | return (unsigned long) ioremap(addr, 0x10000); | ||
52 | } | ||
53 | |||
54 | /* | ||
55 | * GCMP Specific definitions | ||
56 | */ | ||
57 | #define GCMP_BASE_ADDR 0x1fbf8000 | ||
58 | #define GCMP_ADDRSPACE_SZ (256 * 1024) | ||
59 | |||
60 | /* | ||
61 | * GIC Specific definitions | ||
62 | */ | ||
63 | #define GIC_BASE_ADDR 0x1bdc0000 | ||
64 | #define GIC_ADDRSPACE_SZ (128 * 1024) | ||
65 | |||
66 | /* | ||
67 | * MSC01 BIU Specific definitions | ||
68 | * FIXME : These should be elsewhere ? | ||
69 | */ | ||
70 | #define MSC01_BIU_REG_BASE 0x1bc80000 | ||
71 | #define MSC01_BIU_ADDRSPACE_SZ (256 * 1024) | ||
72 | #define MSC01_SC_CFG_OFS 0x0110 | ||
73 | #define MSC01_SC_CFG_GICPRES_MSK 0x00000004 | ||
74 | #define MSC01_SC_CFG_GICPRES_SHF 2 | ||
75 | #define MSC01_SC_CFG_GICENA_SHF 3 | ||
76 | |||
77 | /* | ||
78 | * Malta RTC-device indirect register access. | ||
79 | */ | ||
80 | #define MALTA_RTC_ADR_REG 0x70 | ||
81 | #define MALTA_RTC_DAT_REG 0x71 | ||
82 | |||
83 | /* | ||
84 | * Malta SMSC FDC37M817 Super I/O Controller register. | ||
85 | */ | ||
86 | #define SMSC_CONFIG_REG 0x3f0 | ||
87 | #define SMSC_DATA_REG 0x3f1 | ||
88 | |||
89 | #define SMSC_CONFIG_DEVNUM 0x7 | ||
90 | #define SMSC_CONFIG_ACTIVATE 0x30 | ||
91 | #define SMSC_CONFIG_ENTER 0x55 | ||
92 | #define SMSC_CONFIG_EXIT 0xaa | ||
93 | |||
94 | #define SMSC_CONFIG_DEVNUM_FLOPPY 0 | ||
95 | |||
96 | #define SMSC_CONFIG_ACTIVATE_ENABLE 1 | ||
97 | |||
98 | #define SMSC_WRITE(x, a) outb(x, a) | ||
99 | |||
100 | #define MALTA_JMPRS_REG 0x1f000210 | ||
101 | |||
102 | #endif /* __ASM_MIPS_BOARDS_MALTA_H */ | ||
diff --git a/include/asm-mips/mips-boards/maltaint.h b/include/asm-mips/mips-boards/maltaint.h deleted file mode 100644 index cea872fc6f5c..000000000000 --- a/include/asm-mips/mips-boards/maltaint.h +++ /dev/null | |||
@@ -1,110 +0,0 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * ######################################################################## | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | ||
20 | * ######################################################################## | ||
21 | * | ||
22 | * Defines for the Malta interrupt controller. | ||
23 | * | ||
24 | */ | ||
25 | #ifndef _MIPS_MALTAINT_H | ||
26 | #define _MIPS_MALTAINT_H | ||
27 | |||
28 | #include <irq.h> | ||
29 | |||
30 | /* | ||
31 | * Interrupts 0..15 are used for Malta ISA compatible interrupts | ||
32 | */ | ||
33 | #define MALTA_INT_BASE 0 | ||
34 | |||
35 | /* CPU interrupt offsets */ | ||
36 | #define MIPSCPU_INT_SW0 0 | ||
37 | #define MIPSCPU_INT_SW1 1 | ||
38 | #define MIPSCPU_INT_MB0 2 | ||
39 | #define MIPSCPU_INT_I8259A MIPSCPU_INT_MB0 | ||
40 | #define MIPSCPU_INT_MB1 3 | ||
41 | #define MIPSCPU_INT_SMI MIPSCPU_INT_MB1 | ||
42 | #define MIPSCPU_INT_IPI0 MIPSCPU_INT_MB1 /* GIC IPI */ | ||
43 | #define MIPSCPU_INT_MB2 4 | ||
44 | #define MIPSCPU_INT_IPI1 MIPSCPU_INT_MB2 /* GIC IPI */ | ||
45 | #define MIPSCPU_INT_MB3 5 | ||
46 | #define MIPSCPU_INT_COREHI MIPSCPU_INT_MB3 | ||
47 | #define MIPSCPU_INT_MB4 6 | ||
48 | #define MIPSCPU_INT_CORELO MIPSCPU_INT_MB4 | ||
49 | |||
50 | /* | ||
51 | * Interrupts 64..127 are used for Soc-it Classic interrupts | ||
52 | */ | ||
53 | #define MSC01C_INT_BASE 64 | ||
54 | |||
55 | /* SOC-it Classic interrupt offsets */ | ||
56 | #define MSC01C_INT_TMR 0 | ||
57 | #define MSC01C_INT_PCI 1 | ||
58 | |||
59 | /* | ||
60 | * Interrupts 64..127 are used for Soc-it EIC interrupts | ||
61 | */ | ||
62 | #define MSC01E_INT_BASE 64 | ||
63 | |||
64 | /* SOC-it EIC interrupt offsets */ | ||
65 | #define MSC01E_INT_SW0 1 | ||
66 | #define MSC01E_INT_SW1 2 | ||
67 | #define MSC01E_INT_MB0 3 | ||
68 | #define MSC01E_INT_I8259A MSC01E_INT_MB0 | ||
69 | #define MSC01E_INT_MB1 4 | ||
70 | #define MSC01E_INT_SMI MSC01E_INT_MB1 | ||
71 | #define MSC01E_INT_MB2 5 | ||
72 | #define MSC01E_INT_MB3 6 | ||
73 | #define MSC01E_INT_COREHI MSC01E_INT_MB3 | ||
74 | #define MSC01E_INT_MB4 7 | ||
75 | #define MSC01E_INT_CORELO MSC01E_INT_MB4 | ||
76 | #define MSC01E_INT_TMR 8 | ||
77 | #define MSC01E_INT_PCI 9 | ||
78 | #define MSC01E_INT_PERFCTR 10 | ||
79 | #define MSC01E_INT_CPUCTR 11 | ||
80 | |||
81 | /* GIC's Nomenclature for Core Interrupt Pins on the Malta */ | ||
82 | #define GIC_CPU_INT0 0 /* Core Interrupt 2 */ | ||
83 | #define GIC_CPU_INT1 1 /* . */ | ||
84 | #define GIC_CPU_INT2 2 /* . */ | ||
85 | #define GIC_CPU_INT3 3 /* . */ | ||
86 | #define GIC_CPU_INT4 4 /* . */ | ||
87 | #define GIC_CPU_INT5 5 /* Core Interrupt 5 */ | ||
88 | |||
89 | #define GIC_EXT_INTR(x) x | ||
90 | |||
91 | /* Dummy data */ | ||
92 | #define X 0xdead | ||
93 | |||
94 | /* External Interrupts used for IPI */ | ||
95 | #define GIC_IPI_EXT_INTR_RESCHED_VPE0 16 | ||
96 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17 | ||
97 | #define GIC_IPI_EXT_INTR_RESCHED_VPE1 18 | ||
98 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE1 19 | ||
99 | #define GIC_IPI_EXT_INTR_RESCHED_VPE2 20 | ||
100 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE2 21 | ||
101 | #define GIC_IPI_EXT_INTR_RESCHED_VPE3 22 | ||
102 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE3 23 | ||
103 | |||
104 | #define MIPS_GIC_IRQ_BASE (MIPS_CPU_IRQ_BASE + 8) | ||
105 | |||
106 | #ifndef __ASSEMBLY__ | ||
107 | extern void maltaint_init(void); | ||
108 | #endif | ||
109 | |||
110 | #endif /* !(_MIPS_MALTAINT_H) */ | ||
diff --git a/include/asm-mips/mips-boards/msc01_pci.h b/include/asm-mips/mips-boards/msc01_pci.h deleted file mode 100644 index e036b7dd6deb..000000000000 --- a/include/asm-mips/mips-boards/msc01_pci.h +++ /dev/null | |||
@@ -1,258 +0,0 @@ | |||
1 | /* | ||
2 | * PCI Register definitions for the MIPS System Controller. | ||
3 | * | ||
4 | * Copyright (C) 2002, 2005 MIPS Technologies, Inc. All rights reserved. | ||
5 | * Authors: Carsten Langgaard <carstenl@mips.com> | ||
6 | * Maciej W. Rozycki <macro@mips.com> | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #ifndef __ASM_MIPS_BOARDS_MSC01_PCI_H | ||
13 | #define __ASM_MIPS_BOARDS_MSC01_PCI_H | ||
14 | |||
15 | /* | ||
16 | * Register offset addresses | ||
17 | */ | ||
18 | |||
19 | #define MSC01_PCI_ID_OFS 0x0000 | ||
20 | #define MSC01_PCI_SC2PMBASL_OFS 0x0208 | ||
21 | #define MSC01_PCI_SC2PMMSKL_OFS 0x0218 | ||
22 | #define MSC01_PCI_SC2PMMAPL_OFS 0x0228 | ||
23 | #define MSC01_PCI_SC2PIOBASL_OFS 0x0248 | ||
24 | #define MSC01_PCI_SC2PIOMSKL_OFS 0x0258 | ||
25 | #define MSC01_PCI_SC2PIOMAPL_OFS 0x0268 | ||
26 | #define MSC01_PCI_P2SCMSKL_OFS 0x0308 | ||
27 | #define MSC01_PCI_P2SCMAPL_OFS 0x0318 | ||
28 | #define MSC01_PCI_INTCFG_OFS 0x0600 | ||
29 | #define MSC01_PCI_INTSTAT_OFS 0x0608 | ||
30 | #define MSC01_PCI_CFGADDR_OFS 0x0610 | ||
31 | #define MSC01_PCI_CFGDATA_OFS 0x0618 | ||
32 | #define MSC01_PCI_IACK_OFS 0x0620 | ||
33 | #define MSC01_PCI_HEAD0_OFS 0x2000 /* DevID, VendorID */ | ||
34 | #define MSC01_PCI_HEAD1_OFS 0x2008 /* Status, Command */ | ||
35 | #define MSC01_PCI_HEAD2_OFS 0x2010 /* Class code, RevID */ | ||
36 | #define MSC01_PCI_HEAD3_OFS 0x2018 /* bist, header, latency */ | ||
37 | #define MSC01_PCI_HEAD4_OFS 0x2020 /* BAR 0 */ | ||
38 | #define MSC01_PCI_HEAD5_OFS 0x2028 /* BAR 1 */ | ||
39 | #define MSC01_PCI_HEAD6_OFS 0x2030 /* BAR 2 */ | ||
40 | #define MSC01_PCI_HEAD7_OFS 0x2038 /* BAR 3 */ | ||
41 | #define MSC01_PCI_HEAD8_OFS 0x2040 /* BAR 4 */ | ||
42 | #define MSC01_PCI_HEAD9_OFS 0x2048 /* BAR 5 */ | ||
43 | #define MSC01_PCI_HEAD10_OFS 0x2050 /* CardBus CIS Ptr */ | ||
44 | #define MSC01_PCI_HEAD11_OFS 0x2058 /* SubSystem ID, -VendorID */ | ||
45 | #define MSC01_PCI_HEAD12_OFS 0x2060 /* ROM BAR */ | ||
46 | #define MSC01_PCI_HEAD13_OFS 0x2068 /* Capabilities ptr */ | ||
47 | #define MSC01_PCI_HEAD14_OFS 0x2070 /* reserved */ | ||
48 | #define MSC01_PCI_HEAD15_OFS 0x2078 /* Maxl, ming, intpin, int */ | ||
49 | #define MSC01_PCI_BAR0_OFS 0x2220 | ||
50 | #define MSC01_PCI_CFG_OFS 0x2380 | ||
51 | #define MSC01_PCI_SWAP_OFS 0x2388 | ||
52 | |||
53 | |||
54 | /***************************************************************************** | ||
55 | * Register encodings | ||
56 | ****************************************************************************/ | ||
57 | |||
58 | #define MSC01_PCI_ID_ID_SHF 16 | ||
59 | #define MSC01_PCI_ID_ID_MSK 0x00ff0000 | ||
60 | #define MSC01_PCI_ID_ID_HOSTBRIDGE 82 | ||
61 | #define MSC01_PCI_ID_MAR_SHF 8 | ||
62 | #define MSC01_PCI_ID_MAR_MSK 0x0000ff00 | ||
63 | #define MSC01_PCI_ID_MIR_SHF 0 | ||
64 | #define MSC01_PCI_ID_MIR_MSK 0x000000ff | ||
65 | |||
66 | #define MSC01_PCI_SC2PMBASL_BAS_SHF 24 | ||
67 | #define MSC01_PCI_SC2PMBASL_BAS_MSK 0xff000000 | ||
68 | |||
69 | #define MSC01_PCI_SC2PMMSKL_MSK_SHF 24 | ||
70 | #define MSC01_PCI_SC2PMMSKL_MSK_MSK 0xff000000 | ||
71 | |||
72 | #define MSC01_PCI_SC2PMMAPL_MAP_SHF 24 | ||
73 | #define MSC01_PCI_SC2PMMAPL_MAP_MSK 0xff000000 | ||
74 | |||
75 | #define MSC01_PCI_SC2PIOBASL_BAS_SHF 24 | ||
76 | #define MSC01_PCI_SC2PIOBASL_BAS_MSK 0xff000000 | ||
77 | |||
78 | #define MSC01_PCI_SC2PIOMSKL_MSK_SHF 24 | ||
79 | #define MSC01_PCI_SC2PIOMSKL_MSK_MSK 0xff000000 | ||
80 | |||
81 | #define MSC01_PCI_SC2PIOMAPL_MAP_SHF 24 | ||
82 | #define MSC01_PCI_SC2PIOMAPL_MAP_MSK 0xff000000 | ||
83 | |||
84 | #define MSC01_PCI_P2SCMSKL_MSK_SHF 24 | ||
85 | #define MSC01_PCI_P2SCMSKL_MSK_MSK 0xff000000 | ||
86 | |||
87 | #define MSC01_PCI_P2SCMAPL_MAP_SHF 24 | ||
88 | #define MSC01_PCI_P2SCMAPL_MAP_MSK 0xff000000 | ||
89 | |||
90 | #define MSC01_PCI_INTCFG_RST_SHF 10 | ||
91 | #define MSC01_PCI_INTCFG_RST_MSK 0x00000400 | ||
92 | #define MSC01_PCI_INTCFG_RST_BIT 0x00000400 | ||
93 | #define MSC01_PCI_INTCFG_MWE_SHF 9 | ||
94 | #define MSC01_PCI_INTCFG_MWE_MSK 0x00000200 | ||
95 | #define MSC01_PCI_INTCFG_MWE_BIT 0x00000200 | ||
96 | #define MSC01_PCI_INTCFG_DTO_SHF 8 | ||
97 | #define MSC01_PCI_INTCFG_DTO_MSK 0x00000100 | ||
98 | #define MSC01_PCI_INTCFG_DTO_BIT 0x00000100 | ||
99 | #define MSC01_PCI_INTCFG_MA_SHF 7 | ||
100 | #define MSC01_PCI_INTCFG_MA_MSK 0x00000080 | ||
101 | #define MSC01_PCI_INTCFG_MA_BIT 0x00000080 | ||
102 | #define MSC01_PCI_INTCFG_TA_SHF 6 | ||
103 | #define MSC01_PCI_INTCFG_TA_MSK 0x00000040 | ||
104 | #define MSC01_PCI_INTCFG_TA_BIT 0x00000040 | ||
105 | #define MSC01_PCI_INTCFG_RTY_SHF 5 | ||
106 | #define MSC01_PCI_INTCFG_RTY_MSK 0x00000020 | ||
107 | #define MSC01_PCI_INTCFG_RTY_BIT 0x00000020 | ||
108 | #define MSC01_PCI_INTCFG_MWP_SHF 4 | ||
109 | #define MSC01_PCI_INTCFG_MWP_MSK 0x00000010 | ||
110 | #define MSC01_PCI_INTCFG_MWP_BIT 0x00000010 | ||
111 | #define MSC01_PCI_INTCFG_MRP_SHF 3 | ||
112 | #define MSC01_PCI_INTCFG_MRP_MSK 0x00000008 | ||
113 | #define MSC01_PCI_INTCFG_MRP_BIT 0x00000008 | ||
114 | #define MSC01_PCI_INTCFG_SWP_SHF 2 | ||
115 | #define MSC01_PCI_INTCFG_SWP_MSK 0x00000004 | ||
116 | #define MSC01_PCI_INTCFG_SWP_BIT 0x00000004 | ||
117 | #define MSC01_PCI_INTCFG_SRP_SHF 1 | ||
118 | #define MSC01_PCI_INTCFG_SRP_MSK 0x00000002 | ||
119 | #define MSC01_PCI_INTCFG_SRP_BIT 0x00000002 | ||
120 | #define MSC01_PCI_INTCFG_SE_SHF 0 | ||
121 | #define MSC01_PCI_INTCFG_SE_MSK 0x00000001 | ||
122 | #define MSC01_PCI_INTCFG_SE_BIT 0x00000001 | ||
123 | |||
124 | #define MSC01_PCI_INTSTAT_RST_SHF 10 | ||
125 | #define MSC01_PCI_INTSTAT_RST_MSK 0x00000400 | ||
126 | #define MSC01_PCI_INTSTAT_RST_BIT 0x00000400 | ||
127 | #define MSC01_PCI_INTSTAT_MWE_SHF 9 | ||
128 | #define MSC01_PCI_INTSTAT_MWE_MSK 0x00000200 | ||
129 | #define MSC01_PCI_INTSTAT_MWE_BIT 0x00000200 | ||
130 | #define MSC01_PCI_INTSTAT_DTO_SHF 8 | ||
131 | #define MSC01_PCI_INTSTAT_DTO_MSK 0x00000100 | ||
132 | #define MSC01_PCI_INTSTAT_DTO_BIT 0x00000100 | ||
133 | #define MSC01_PCI_INTSTAT_MA_SHF 7 | ||
134 | #define MSC01_PCI_INTSTAT_MA_MSK 0x00000080 | ||
135 | #define MSC01_PCI_INTSTAT_MA_BIT 0x00000080 | ||
136 | #define MSC01_PCI_INTSTAT_TA_SHF 6 | ||
137 | #define MSC01_PCI_INTSTAT_TA_MSK 0x00000040 | ||
138 | #define MSC01_PCI_INTSTAT_TA_BIT 0x00000040 | ||
139 | #define MSC01_PCI_INTSTAT_RTY_SHF 5 | ||
140 | #define MSC01_PCI_INTSTAT_RTY_MSK 0x00000020 | ||
141 | #define MSC01_PCI_INTSTAT_RTY_BIT 0x00000020 | ||
142 | #define MSC01_PCI_INTSTAT_MWP_SHF 4 | ||
143 | #define MSC01_PCI_INTSTAT_MWP_MSK 0x00000010 | ||
144 | #define MSC01_PCI_INTSTAT_MWP_BIT 0x00000010 | ||
145 | #define MSC01_PCI_INTSTAT_MRP_SHF 3 | ||
146 | #define MSC01_PCI_INTSTAT_MRP_MSK 0x00000008 | ||
147 | #define MSC01_PCI_INTSTAT_MRP_BIT 0x00000008 | ||
148 | #define MSC01_PCI_INTSTAT_SWP_SHF 2 | ||
149 | #define MSC01_PCI_INTSTAT_SWP_MSK 0x00000004 | ||
150 | #define MSC01_PCI_INTSTAT_SWP_BIT 0x00000004 | ||
151 | #define MSC01_PCI_INTSTAT_SRP_SHF 1 | ||
152 | #define MSC01_PCI_INTSTAT_SRP_MSK 0x00000002 | ||
153 | #define MSC01_PCI_INTSTAT_SRP_BIT 0x00000002 | ||
154 | #define MSC01_PCI_INTSTAT_SE_SHF 0 | ||
155 | #define MSC01_PCI_INTSTAT_SE_MSK 0x00000001 | ||
156 | #define MSC01_PCI_INTSTAT_SE_BIT 0x00000001 | ||
157 | |||
158 | #define MSC01_PCI_CFGADDR_BNUM_SHF 16 | ||
159 | #define MSC01_PCI_CFGADDR_BNUM_MSK 0x00ff0000 | ||
160 | #define MSC01_PCI_CFGADDR_DNUM_SHF 11 | ||
161 | #define MSC01_PCI_CFGADDR_DNUM_MSK 0x0000f800 | ||
162 | #define MSC01_PCI_CFGADDR_FNUM_SHF 8 | ||
163 | #define MSC01_PCI_CFGADDR_FNUM_MSK 0x00000700 | ||
164 | #define MSC01_PCI_CFGADDR_RNUM_SHF 2 | ||
165 | #define MSC01_PCI_CFGADDR_RNUM_MSK 0x000000fc | ||
166 | |||
167 | #define MSC01_PCI_CFGDATA_DATA_SHF 0 | ||
168 | #define MSC01_PCI_CFGDATA_DATA_MSK 0xffffffff | ||
169 | |||
170 | /* The defines below are ONLY valid for a MEM bar! */ | ||
171 | #define MSC01_PCI_BAR0_SIZE_SHF 4 | ||
172 | #define MSC01_PCI_BAR0_SIZE_MSK 0xfffffff0 | ||
173 | #define MSC01_PCI_BAR0_P_SHF 3 | ||
174 | #define MSC01_PCI_BAR0_P_MSK 0x00000008 | ||
175 | #define MSC01_PCI_BAR0_P_BIT MSC01_PCI_BAR0_P_MSK | ||
176 | #define MSC01_PCI_BAR0_D_SHF 1 | ||
177 | #define MSC01_PCI_BAR0_D_MSK 0x00000006 | ||
178 | #define MSC01_PCI_BAR0_T_SHF 0 | ||
179 | #define MSC01_PCI_BAR0_T_MSK 0x00000001 | ||
180 | #define MSC01_PCI_BAR0_T_BIT MSC01_PCI_BAR0_T_MSK | ||
181 | |||
182 | |||
183 | #define MSC01_PCI_CFG_RA_SHF 17 | ||
184 | #define MSC01_PCI_CFG_RA_MSK 0x00020000 | ||
185 | #define MSC01_PCI_CFG_RA_BIT MSC01_PCI_CFG_RA_MSK | ||
186 | #define MSC01_PCI_CFG_G_SHF 16 | ||
187 | #define MSC01_PCI_CFG_G_MSK 0x00010000 | ||
188 | #define MSC01_PCI_CFG_G_BIT MSC01_PCI_CFG_G_MSK | ||
189 | #define MSC01_PCI_CFG_EN_SHF 15 | ||
190 | #define MSC01_PCI_CFG_EN_MSK 0x00008000 | ||
191 | #define MSC01_PCI_CFG_EN_BIT MSC01_PCI_CFG_EN_MSK | ||
192 | #define MSC01_PCI_CFG_MAXRTRY_SHF 0 | ||
193 | #define MSC01_PCI_CFG_MAXRTRY_MSK 0x00000fff | ||
194 | |||
195 | #define MSC01_PCI_SWAP_IO_SHF 18 | ||
196 | #define MSC01_PCI_SWAP_IO_MSK 0x000c0000 | ||
197 | #define MSC01_PCI_SWAP_MEM_SHF 16 | ||
198 | #define MSC01_PCI_SWAP_MEM_MSK 0x00030000 | ||
199 | #define MSC01_PCI_SWAP_BAR0_SHF 0 | ||
200 | #define MSC01_PCI_SWAP_BAR0_MSK 0x00000003 | ||
201 | #define MSC01_PCI_SWAP_NOSWAP 0 | ||
202 | #define MSC01_PCI_SWAP_BYTESWAP 1 | ||
203 | |||
204 | /* | ||
205 | * MIPS System controller PCI register base. | ||
206 | * | ||
207 | * FIXME - are these macros specific to Malta and co or to the MSC? If the | ||
208 | * latter, they should be moved elsewhere. | ||
209 | */ | ||
210 | #define MIPS_MSC01_PCI_REG_BASE 0x1bd00000 | ||
211 | #define MIPS_SOCITSC_PCI_REG_BASE 0x1ff10000 | ||
212 | |||
213 | extern unsigned long _pcictrl_msc; | ||
214 | |||
215 | #define MSC01_PCI_REG_BASE _pcictrl_msc | ||
216 | |||
217 | #define MSC_WRITE(reg, data) do { *(volatile u32 *)(reg) = data; } while (0) | ||
218 | #define MSC_READ(reg, data) do { data = *(volatile u32 *)(reg); } while (0) | ||
219 | |||
220 | /* | ||
221 | * Registers absolute addresses | ||
222 | */ | ||
223 | |||
224 | #define MSC01_PCI_ID (MSC01_PCI_REG_BASE + MSC01_PCI_ID_OFS) | ||
225 | #define MSC01_PCI_SC2PMBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMBASL_OFS) | ||
226 | #define MSC01_PCI_SC2PMMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMSKL_OFS) | ||
227 | #define MSC01_PCI_SC2PMMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMAPL_OFS) | ||
228 | #define MSC01_PCI_SC2PIOBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOBASL_OFS) | ||
229 | #define MSC01_PCI_SC2PIOMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMSKL_OFS) | ||
230 | #define MSC01_PCI_SC2PIOMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMAPL_OFS) | ||
231 | #define MSC01_PCI_P2SCMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMSKL_OFS) | ||
232 | #define MSC01_PCI_P2SCMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMAPL_OFS) | ||
233 | #define MSC01_PCI_INTCFG (MSC01_PCI_REG_BASE + MSC01_PCI_INTCFG_OFS) | ||
234 | #define MSC01_PCI_INTSTAT (MSC01_PCI_REG_BASE + MSC01_PCI_INTSTAT_OFS) | ||
235 | #define MSC01_PCI_CFGADDR (MSC01_PCI_REG_BASE + MSC01_PCI_CFGADDR_OFS) | ||
236 | #define MSC01_PCI_CFGDATA (MSC01_PCI_REG_BASE + MSC01_PCI_CFGDATA_OFS) | ||
237 | #define MSC01_PCI_IACK (MSC01_PCI_REG_BASE + MSC01_PCI_IACK_OFS) | ||
238 | #define MSC01_PCI_HEAD0 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD0_OFS) | ||
239 | #define MSC01_PCI_HEAD1 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD1_OFS) | ||
240 | #define MSC01_PCI_HEAD2 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD2_OFS) | ||
241 | #define MSC01_PCI_HEAD3 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD3_OFS) | ||
242 | #define MSC01_PCI_HEAD4 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD4_OFS) | ||
243 | #define MSC01_PCI_HEAD5 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD5_OFS) | ||
244 | #define MSC01_PCI_HEAD6 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD6_OFS) | ||
245 | #define MSC01_PCI_HEAD7 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD7_OFS) | ||
246 | #define MSC01_PCI_HEAD8 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD8_OFS) | ||
247 | #define MSC01_PCI_HEAD9 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD9_OFS) | ||
248 | #define MSC01_PCI_HEAD10 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD10_OFS) | ||
249 | #define MSC01_PCI_HEAD11 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) | ||
250 | #define MSC01_PCI_HEAD12 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) | ||
251 | #define MSC01_PCI_HEAD13 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) | ||
252 | #define MSC01_PCI_HEAD14 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) | ||
253 | #define MSC01_PCI_HEAD15 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) | ||
254 | #define MSC01_PCI_BAR0 (MSC01_PCI_REG_BASE + MSC01_PCI_BAR0_OFS) | ||
255 | #define MSC01_PCI_CFG (MSC01_PCI_REG_BASE + MSC01_PCI_CFG_OFS) | ||
256 | #define MSC01_PCI_SWAP (MSC01_PCI_REG_BASE + MSC01_PCI_SWAP_OFS) | ||
257 | |||
258 | #endif /* __ASM_MIPS_BOARDS_MSC01_PCI_H */ | ||
diff --git a/include/asm-mips/mips-boards/piix4.h b/include/asm-mips/mips-boards/piix4.h deleted file mode 100644 index 2971d60f2e95..000000000000 --- a/include/asm-mips/mips-boards/piix4.h +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can distribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License (Version 2) as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
12 | * for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
17 | * | ||
18 | * Register definitions for Intel PIIX4 South Bridge Device. | ||
19 | */ | ||
20 | #ifndef __ASM_MIPS_BOARDS_PIIX4_H | ||
21 | #define __ASM_MIPS_BOARDS_PIIX4_H | ||
22 | |||
23 | /************************************************************************ | ||
24 | * IO register offsets | ||
25 | ************************************************************************/ | ||
26 | #define PIIX4_ICTLR1_ICW1 0x20 | ||
27 | #define PIIX4_ICTLR1_ICW2 0x21 | ||
28 | #define PIIX4_ICTLR1_ICW3 0x21 | ||
29 | #define PIIX4_ICTLR1_ICW4 0x21 | ||
30 | #define PIIX4_ICTLR2_ICW1 0xa0 | ||
31 | #define PIIX4_ICTLR2_ICW2 0xa1 | ||
32 | #define PIIX4_ICTLR2_ICW3 0xa1 | ||
33 | #define PIIX4_ICTLR2_ICW4 0xa1 | ||
34 | #define PIIX4_ICTLR1_OCW1 0x21 | ||
35 | #define PIIX4_ICTLR1_OCW2 0x20 | ||
36 | #define PIIX4_ICTLR1_OCW3 0x20 | ||
37 | #define PIIX4_ICTLR1_OCW4 0x20 | ||
38 | #define PIIX4_ICTLR2_OCW1 0xa1 | ||
39 | #define PIIX4_ICTLR2_OCW2 0xa0 | ||
40 | #define PIIX4_ICTLR2_OCW3 0xa0 | ||
41 | #define PIIX4_ICTLR2_OCW4 0xa0 | ||
42 | |||
43 | |||
44 | /************************************************************************ | ||
45 | * Register encodings. | ||
46 | ************************************************************************/ | ||
47 | #define PIIX4_OCW2_NSEOI (0x1 << 5) | ||
48 | #define PIIX4_OCW2_SEOI (0x3 << 5) | ||
49 | #define PIIX4_OCW2_RNSEOI (0x5 << 5) | ||
50 | #define PIIX4_OCW2_RAEOIS (0x4 << 5) | ||
51 | #define PIIX4_OCW2_RAEOIC (0x0 << 5) | ||
52 | #define PIIX4_OCW2_RSEOI (0x7 << 5) | ||
53 | #define PIIX4_OCW2_SP (0x6 << 5) | ||
54 | #define PIIX4_OCW2_NOP (0x2 << 5) | ||
55 | |||
56 | #define PIIX4_OCW2_SEL (0x0 << 3) | ||
57 | |||
58 | #define PIIX4_OCW2_ILS_0 0 | ||
59 | #define PIIX4_OCW2_ILS_1 1 | ||
60 | #define PIIX4_OCW2_ILS_2 2 | ||
61 | #define PIIX4_OCW2_ILS_3 3 | ||
62 | #define PIIX4_OCW2_ILS_4 4 | ||
63 | #define PIIX4_OCW2_ILS_5 5 | ||
64 | #define PIIX4_OCW2_ILS_6 6 | ||
65 | #define PIIX4_OCW2_ILS_7 7 | ||
66 | #define PIIX4_OCW2_ILS_8 0 | ||
67 | #define PIIX4_OCW2_ILS_9 1 | ||
68 | #define PIIX4_OCW2_ILS_10 2 | ||
69 | #define PIIX4_OCW2_ILS_11 3 | ||
70 | #define PIIX4_OCW2_ILS_12 4 | ||
71 | #define PIIX4_OCW2_ILS_13 5 | ||
72 | #define PIIX4_OCW2_ILS_14 6 | ||
73 | #define PIIX4_OCW2_ILS_15 7 | ||
74 | |||
75 | #define PIIX4_OCW3_SEL (0x1 << 3) | ||
76 | |||
77 | #define PIIX4_OCW3_IRR 0x2 | ||
78 | #define PIIX4_OCW3_ISR 0x3 | ||
79 | |||
80 | #endif /* __ASM_MIPS_BOARDS_PIIX4_H */ | ||
diff --git a/include/asm-mips/mips-boards/prom.h b/include/asm-mips/mips-boards/prom.h deleted file mode 100644 index a9db576a9768..000000000000 --- a/include/asm-mips/mips-boards/prom.h +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * ######################################################################## | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | ||
20 | * ######################################################################## | ||
21 | * | ||
22 | * MIPS boards bootprom interface for the Linux kernel. | ||
23 | * | ||
24 | */ | ||
25 | |||
26 | #ifndef _MIPS_PROM_H | ||
27 | #define _MIPS_PROM_H | ||
28 | |||
29 | extern char *prom_getcmdline(void); | ||
30 | extern char *prom_getenv(char *name); | ||
31 | extern void prom_init_cmdline(void); | ||
32 | extern void prom_meminit(void); | ||
33 | extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem); | ||
34 | extern void mips_display_message(const char *str); | ||
35 | extern void mips_display_word(unsigned int num); | ||
36 | extern void mips_scroll_message(void); | ||
37 | extern int get_ethernet_addr(char *ethernet_addr); | ||
38 | |||
39 | /* Memory descriptor management. */ | ||
40 | #define PROM_MAX_PMEMBLOCKS 32 | ||
41 | struct prom_pmemblock { | ||
42 | unsigned long base; /* Within KSEG0. */ | ||
43 | unsigned int size; /* In bytes. */ | ||
44 | unsigned int type; /* free or prom memory */ | ||
45 | }; | ||
46 | |||
47 | #endif /* !(_MIPS_PROM_H) */ | ||
diff --git a/include/asm-mips/mips-boards/sim.h b/include/asm-mips/mips-boards/sim.h deleted file mode 100644 index acb7c2331d98..000000000000 --- a/include/asm-mips/mips-boards/sim.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can distribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License (Version 2) as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
11 | * for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef _ASM_MIPS_BOARDS_SIM_H | ||
20 | #define _ASM_MIPS_BOARDS_SIM_H | ||
21 | |||
22 | #define STATS_ON 1 | ||
23 | #define STATS_OFF 2 | ||
24 | #define STATS_CLEAR 3 | ||
25 | #define STATS_DUMP 4 | ||
26 | #define TRACE_ON 5 | ||
27 | #define TRACE_OFF 6 | ||
28 | |||
29 | |||
30 | #define simcfg(code) \ | ||
31 | ({ \ | ||
32 | __asm__ __volatile__( \ | ||
33 | "sltiu $0,$0, %0" \ | ||
34 | ::"i"(code) \ | ||
35 | ); \ | ||
36 | }) | ||
37 | |||
38 | |||
39 | |||
40 | #endif | ||
diff --git a/include/asm-mips/mips-boards/simint.h b/include/asm-mips/mips-boards/simint.h deleted file mode 100644 index 8ef6db76d5c1..000000000000 --- a/include/asm-mips/mips-boards/simint.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can distribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License (Version 2) as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
11 | * for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
16 | */ | ||
17 | #ifndef _MIPS_SIMINT_H | ||
18 | #define _MIPS_SIMINT_H | ||
19 | |||
20 | #include <irq.h> | ||
21 | |||
22 | #define SIM_INT_BASE 0 | ||
23 | #define MIPSCPU_INT_MB0 2 | ||
24 | #define MIPS_CPU_TIMER_IRQ 7 | ||
25 | |||
26 | |||
27 | #define MSC01E_INT_BASE 64 | ||
28 | |||
29 | #define MSC01E_INT_CPUCTR 11 | ||
30 | |||
31 | #endif | ||
diff --git a/include/asm-mips/mips_mt.h b/include/asm-mips/mips_mt.h deleted file mode 100644 index ac7935203f89..000000000000 --- a/include/asm-mips/mips_mt.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions and decalrations for MIPS MT support | ||
3 | * that are common between SMTC, VSMP, and/or AP/SP | ||
4 | * kernel models. | ||
5 | */ | ||
6 | #ifndef __ASM_MIPS_MT_H | ||
7 | #define __ASM_MIPS_MT_H | ||
8 | |||
9 | #include <linux/cpumask.h> | ||
10 | |||
11 | /* | ||
12 | * How many VPEs and TCs is Linux allowed to use? 0 means no limit. | ||
13 | */ | ||
14 | extern int tclimit; | ||
15 | extern int vpelimit; | ||
16 | |||
17 | extern cpumask_t mt_fpu_cpumask; | ||
18 | extern unsigned long mt_fpemul_threshold; | ||
19 | |||
20 | extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value); | ||
21 | extern void mips_mt_set_cpuoptions(void); | ||
22 | |||
23 | struct class; | ||
24 | extern struct class *mt_class; | ||
25 | |||
26 | #endif /* __ASM_MIPS_MT_H */ | ||
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h deleted file mode 100644 index c9420aa97e32..000000000000 --- a/include/asm-mips/mipsmtregs.h +++ /dev/null | |||
@@ -1,395 +0,0 @@ | |||
1 | /* | ||
2 | * MT regs definitions, follows on from mipsregs.h | ||
3 | * Copyright (C) 2004 - 2005 MIPS Technologies, Inc. All rights reserved. | ||
4 | * Elizabeth Clarke et. al. | ||
5 | * | ||
6 | */ | ||
7 | #ifndef _ASM_MIPSMTREGS_H | ||
8 | #define _ASM_MIPSMTREGS_H | ||
9 | |||
10 | #include <asm/mipsregs.h> | ||
11 | #include <asm/war.h> | ||
12 | |||
13 | #ifndef __ASSEMBLY__ | ||
14 | |||
15 | /* | ||
16 | * C macros | ||
17 | */ | ||
18 | |||
19 | #define read_c0_mvpcontrol() __read_32bit_c0_register($0, 1) | ||
20 | #define write_c0_mvpcontrol(val) __write_32bit_c0_register($0, 1, val) | ||
21 | |||
22 | #define read_c0_mvpconf0() __read_32bit_c0_register($0, 2) | ||
23 | #define read_c0_mvpconf1() __read_32bit_c0_register($0, 3) | ||
24 | |||
25 | #define read_c0_vpecontrol() __read_32bit_c0_register($1, 1) | ||
26 | #define write_c0_vpecontrol(val) __write_32bit_c0_register($1, 1, val) | ||
27 | |||
28 | #define read_c0_vpeconf0() __read_32bit_c0_register($1, 2) | ||
29 | #define write_c0_vpeconf0(val) __write_32bit_c0_register($1, 2, val) | ||
30 | |||
31 | #define read_c0_tcstatus() __read_32bit_c0_register($2, 1) | ||
32 | #define write_c0_tcstatus(val) __write_32bit_c0_register($2, 1, val) | ||
33 | |||
34 | #define read_c0_tcbind() __read_32bit_c0_register($2, 2) | ||
35 | |||
36 | #define read_c0_tccontext() __read_32bit_c0_register($2, 5) | ||
37 | #define write_c0_tccontext(val) __write_32bit_c0_register($2, 5, val) | ||
38 | |||
39 | #else /* Assembly */ | ||
40 | /* | ||
41 | * Macros for use in assembly language code | ||
42 | */ | ||
43 | |||
44 | #define CP0_MVPCONTROL $0, 1 | ||
45 | #define CP0_MVPCONF0 $0, 2 | ||
46 | #define CP0_MVPCONF1 $0, 3 | ||
47 | #define CP0_VPECONTROL $1, 1 | ||
48 | #define CP0_VPECONF0 $1, 2 | ||
49 | #define CP0_VPECONF1 $1, 3 | ||
50 | #define CP0_YQMASK $1, 4 | ||
51 | #define CP0_VPESCHEDULE $1, 5 | ||
52 | #define CP0_VPESCHEFBK $1, 6 | ||
53 | #define CP0_TCSTATUS $2, 1 | ||
54 | #define CP0_TCBIND $2, 2 | ||
55 | #define CP0_TCRESTART $2, 3 | ||
56 | #define CP0_TCHALT $2, 4 | ||
57 | #define CP0_TCCONTEXT $2, 5 | ||
58 | #define CP0_TCSCHEDULE $2, 6 | ||
59 | #define CP0_TCSCHEFBK $2, 7 | ||
60 | #define CP0_SRSCONF0 $6, 1 | ||
61 | #define CP0_SRSCONF1 $6, 2 | ||
62 | #define CP0_SRSCONF2 $6, 3 | ||
63 | #define CP0_SRSCONF3 $6, 4 | ||
64 | #define CP0_SRSCONF4 $6, 5 | ||
65 | |||
66 | #endif | ||
67 | |||
68 | /* MVPControl fields */ | ||
69 | #define MVPCONTROL_EVP (_ULCAST_(1)) | ||
70 | |||
71 | #define MVPCONTROL_VPC_SHIFT 1 | ||
72 | #define MVPCONTROL_VPC (_ULCAST_(1) << MVPCONTROL_VPC_SHIFT) | ||
73 | |||
74 | #define MVPCONTROL_STLB_SHIFT 2 | ||
75 | #define MVPCONTROL_STLB (_ULCAST_(1) << MVPCONTROL_STLB_SHIFT) | ||
76 | |||
77 | |||
78 | /* MVPConf0 fields */ | ||
79 | #define MVPCONF0_PTC_SHIFT 0 | ||
80 | #define MVPCONF0_PTC ( _ULCAST_(0xff)) | ||
81 | #define MVPCONF0_PVPE_SHIFT 10 | ||
82 | #define MVPCONF0_PVPE ( _ULCAST_(0xf) << MVPCONF0_PVPE_SHIFT) | ||
83 | #define MVPCONF0_TCA_SHIFT 15 | ||
84 | #define MVPCONF0_TCA ( _ULCAST_(1) << MVPCONF0_TCA_SHIFT) | ||
85 | #define MVPCONF0_PTLBE_SHIFT 16 | ||
86 | #define MVPCONF0_PTLBE (_ULCAST_(0x3ff) << MVPCONF0_PTLBE_SHIFT) | ||
87 | #define MVPCONF0_TLBS_SHIFT 29 | ||
88 | #define MVPCONF0_TLBS (_ULCAST_(1) << MVPCONF0_TLBS_SHIFT) | ||
89 | #define MVPCONF0_M_SHIFT 31 | ||
90 | #define MVPCONF0_M (_ULCAST_(0x1) << MVPCONF0_M_SHIFT) | ||
91 | |||
92 | |||
93 | /* config3 fields */ | ||
94 | #define CONFIG3_MT_SHIFT 2 | ||
95 | #define CONFIG3_MT (_ULCAST_(1) << CONFIG3_MT_SHIFT) | ||
96 | |||
97 | |||
98 | /* VPEControl fields (per VPE) */ | ||
99 | #define VPECONTROL_TARGTC (_ULCAST_(0xff)) | ||
100 | |||
101 | #define VPECONTROL_TE_SHIFT 15 | ||
102 | #define VPECONTROL_TE (_ULCAST_(1) << VPECONTROL_TE_SHIFT) | ||
103 | #define VPECONTROL_EXCPT_SHIFT 16 | ||
104 | #define VPECONTROL_EXCPT (_ULCAST_(0x7) << VPECONTROL_EXCPT_SHIFT) | ||
105 | |||
106 | /* Thread Exception Codes for EXCPT field */ | ||
107 | #define THREX_TU 0 | ||
108 | #define THREX_TO 1 | ||
109 | #define THREX_IYQ 2 | ||
110 | #define THREX_GSX 3 | ||
111 | #define THREX_YSCH 4 | ||
112 | #define THREX_GSSCH 5 | ||
113 | |||
114 | #define VPECONTROL_GSI_SHIFT 20 | ||
115 | #define VPECONTROL_GSI (_ULCAST_(1) << VPECONTROL_GSI_SHIFT) | ||
116 | #define VPECONTROL_YSI_SHIFT 21 | ||
117 | #define VPECONTROL_YSI (_ULCAST_(1) << VPECONTROL_YSI_SHIFT) | ||
118 | |||
119 | /* VPEConf0 fields (per VPE) */ | ||
120 | #define VPECONF0_VPA_SHIFT 0 | ||
121 | #define VPECONF0_VPA (_ULCAST_(1) << VPECONF0_VPA_SHIFT) | ||
122 | #define VPECONF0_MVP_SHIFT 1 | ||
123 | #define VPECONF0_MVP (_ULCAST_(1) << VPECONF0_MVP_SHIFT) | ||
124 | #define VPECONF0_XTC_SHIFT 21 | ||
125 | #define VPECONF0_XTC (_ULCAST_(0xff) << VPECONF0_XTC_SHIFT) | ||
126 | |||
127 | /* TCStatus fields (per TC) */ | ||
128 | #define TCSTATUS_TASID (_ULCAST_(0xff)) | ||
129 | #define TCSTATUS_IXMT_SHIFT 10 | ||
130 | #define TCSTATUS_IXMT (_ULCAST_(1) << TCSTATUS_IXMT_SHIFT) | ||
131 | #define TCSTATUS_TKSU_SHIFT 11 | ||
132 | #define TCSTATUS_TKSU (_ULCAST_(3) << TCSTATUS_TKSU_SHIFT) | ||
133 | #define TCSTATUS_A_SHIFT 13 | ||
134 | #define TCSTATUS_A (_ULCAST_(1) << TCSTATUS_A_SHIFT) | ||
135 | #define TCSTATUS_DA_SHIFT 15 | ||
136 | #define TCSTATUS_DA (_ULCAST_(1) << TCSTATUS_DA_SHIFT) | ||
137 | #define TCSTATUS_DT_SHIFT 20 | ||
138 | #define TCSTATUS_DT (_ULCAST_(1) << TCSTATUS_DT_SHIFT) | ||
139 | #define TCSTATUS_TDS_SHIFT 21 | ||
140 | #define TCSTATUS_TDS (_ULCAST_(1) << TCSTATUS_TDS_SHIFT) | ||
141 | #define TCSTATUS_TSST_SHIFT 22 | ||
142 | #define TCSTATUS_TSST (_ULCAST_(1) << TCSTATUS_TSST_SHIFT) | ||
143 | #define TCSTATUS_RNST_SHIFT 23 | ||
144 | #define TCSTATUS_RNST (_ULCAST_(3) << TCSTATUS_RNST_SHIFT) | ||
145 | /* Codes for RNST */ | ||
146 | #define TC_RUNNING 0 | ||
147 | #define TC_WAITING 1 | ||
148 | #define TC_YIELDING 2 | ||
149 | #define TC_GATED 3 | ||
150 | |||
151 | #define TCSTATUS_TMX_SHIFT 27 | ||
152 | #define TCSTATUS_TMX (_ULCAST_(1) << TCSTATUS_TMX_SHIFT) | ||
153 | /* TCStatus TCU bits can use same definitions/offsets as CU bits in Status */ | ||
154 | |||
155 | /* TCBind */ | ||
156 | #define TCBIND_CURVPE_SHIFT 0 | ||
157 | #define TCBIND_CURVPE (_ULCAST_(0xf)) | ||
158 | |||
159 | #define TCBIND_CURTC_SHIFT 21 | ||
160 | |||
161 | #define TCBIND_CURTC (_ULCAST_(0xff) << TCBIND_CURTC_SHIFT) | ||
162 | |||
163 | /* TCHalt */ | ||
164 | #define TCHALT_H (_ULCAST_(1)) | ||
165 | |||
166 | #ifndef __ASSEMBLY__ | ||
167 | |||
168 | static inline unsigned int dvpe(void) | ||
169 | { | ||
170 | int res = 0; | ||
171 | |||
172 | __asm__ __volatile__( | ||
173 | " .set push \n" | ||
174 | " .set noreorder \n" | ||
175 | " .set noat \n" | ||
176 | " .set mips32r2 \n" | ||
177 | " .word 0x41610001 # dvpe $1 \n" | ||
178 | " move %0, $1 \n" | ||
179 | " ehb \n" | ||
180 | " .set pop \n" | ||
181 | : "=r" (res)); | ||
182 | |||
183 | instruction_hazard(); | ||
184 | |||
185 | return res; | ||
186 | } | ||
187 | |||
188 | static inline void __raw_evpe(void) | ||
189 | { | ||
190 | __asm__ __volatile__( | ||
191 | " .set push \n" | ||
192 | " .set noreorder \n" | ||
193 | " .set noat \n" | ||
194 | " .set mips32r2 \n" | ||
195 | " .word 0x41600021 # evpe \n" | ||
196 | " ehb \n" | ||
197 | " .set pop \n"); | ||
198 | } | ||
199 | |||
200 | /* Enable virtual processor execution if previous suggested it should be. | ||
201 | EVPE_ENABLE to force */ | ||
202 | |||
203 | #define EVPE_ENABLE MVPCONTROL_EVP | ||
204 | |||
205 | static inline void evpe(int previous) | ||
206 | { | ||
207 | if ((previous & MVPCONTROL_EVP)) | ||
208 | __raw_evpe(); | ||
209 | } | ||
210 | |||
211 | static inline unsigned int dmt(void) | ||
212 | { | ||
213 | int res; | ||
214 | |||
215 | __asm__ __volatile__( | ||
216 | " .set push \n" | ||
217 | " .set mips32r2 \n" | ||
218 | " .set noat \n" | ||
219 | " .word 0x41610BC1 # dmt $1 \n" | ||
220 | " ehb \n" | ||
221 | " move %0, $1 \n" | ||
222 | " .set pop \n" | ||
223 | : "=r" (res)); | ||
224 | |||
225 | instruction_hazard(); | ||
226 | |||
227 | return res; | ||
228 | } | ||
229 | |||
230 | static inline void __raw_emt(void) | ||
231 | { | ||
232 | __asm__ __volatile__( | ||
233 | " .set noreorder \n" | ||
234 | " .set mips32r2 \n" | ||
235 | " .word 0x41600be1 # emt \n" | ||
236 | " ehb \n" | ||
237 | " .set mips0 \n" | ||
238 | " .set reorder"); | ||
239 | } | ||
240 | |||
241 | /* enable multi-threaded execution if previous suggested it should be. | ||
242 | EMT_ENABLE to force */ | ||
243 | |||
244 | #define EMT_ENABLE VPECONTROL_TE | ||
245 | |||
246 | static inline void emt(int previous) | ||
247 | { | ||
248 | if ((previous & EMT_ENABLE)) | ||
249 | __raw_emt(); | ||
250 | } | ||
251 | |||
252 | static inline void ehb(void) | ||
253 | { | ||
254 | __asm__ __volatile__( | ||
255 | " .set mips32r2 \n" | ||
256 | " ehb \n" | ||
257 | " .set mips0 \n"); | ||
258 | } | ||
259 | |||
260 | #define mftc0(rt,sel) \ | ||
261 | ({ \ | ||
262 | unsigned long __res; \ | ||
263 | \ | ||
264 | __asm__ __volatile__( \ | ||
265 | " .set push \n" \ | ||
266 | " .set mips32r2 \n" \ | ||
267 | " .set noat \n" \ | ||
268 | " # mftc0 $1, $" #rt ", " #sel " \n" \ | ||
269 | " .word 0x41000800 | (" #rt " << 16) | " #sel " \n" \ | ||
270 | " move %0, $1 \n" \ | ||
271 | " .set pop \n" \ | ||
272 | : "=r" (__res)); \ | ||
273 | \ | ||
274 | __res; \ | ||
275 | }) | ||
276 | |||
277 | #define mftgpr(rt) \ | ||
278 | ({ \ | ||
279 | unsigned long __res; \ | ||
280 | \ | ||
281 | __asm__ __volatile__( \ | ||
282 | " .set push \n" \ | ||
283 | " .set noat \n" \ | ||
284 | " .set mips32r2 \n" \ | ||
285 | " # mftgpr $1," #rt " \n" \ | ||
286 | " .word 0x41000820 | (" #rt " << 16) \n" \ | ||
287 | " move %0, $1 \n" \ | ||
288 | " .set pop \n" \ | ||
289 | : "=r" (__res)); \ | ||
290 | \ | ||
291 | __res; \ | ||
292 | }) | ||
293 | |||
294 | #define mftr(rt, u, sel) \ | ||
295 | ({ \ | ||
296 | unsigned long __res; \ | ||
297 | \ | ||
298 | __asm__ __volatile__( \ | ||
299 | " mftr %0, " #rt ", " #u ", " #sel " \n" \ | ||
300 | : "=r" (__res)); \ | ||
301 | \ | ||
302 | __res; \ | ||
303 | }) | ||
304 | |||
305 | #define mttgpr(rd,v) \ | ||
306 | do { \ | ||
307 | __asm__ __volatile__( \ | ||
308 | " .set push \n" \ | ||
309 | " .set mips32r2 \n" \ | ||
310 | " .set noat \n" \ | ||
311 | " move $1, %0 \n" \ | ||
312 | " # mttgpr $1, " #rd " \n" \ | ||
313 | " .word 0x41810020 | (" #rd " << 11) \n" \ | ||
314 | " .set pop \n" \ | ||
315 | : : "r" (v)); \ | ||
316 | } while (0) | ||
317 | |||
318 | #define mttc0(rd, sel, v) \ | ||
319 | ({ \ | ||
320 | __asm__ __volatile__( \ | ||
321 | " .set push \n" \ | ||
322 | " .set mips32r2 \n" \ | ||
323 | " .set noat \n" \ | ||
324 | " move $1, %0 \n" \ | ||
325 | " # mttc0 %0," #rd ", " #sel " \n" \ | ||
326 | " .word 0x41810000 | (" #rd " << 11) | " #sel " \n" \ | ||
327 | " .set pop \n" \ | ||
328 | : \ | ||
329 | : "r" (v)); \ | ||
330 | }) | ||
331 | |||
332 | |||
333 | #define mttr(rd, u, sel, v) \ | ||
334 | ({ \ | ||
335 | __asm__ __volatile__( \ | ||
336 | "mttr %0," #rd ", " #u ", " #sel \ | ||
337 | : : "r" (v)); \ | ||
338 | }) | ||
339 | |||
340 | |||
341 | #define settc(tc) \ | ||
342 | do { \ | ||
343 | write_c0_vpecontrol((read_c0_vpecontrol()&~VPECONTROL_TARGTC) | (tc)); \ | ||
344 | ehb(); \ | ||
345 | } while (0) | ||
346 | |||
347 | |||
348 | /* you *must* set the target tc (settc) before trying to use these */ | ||
349 | #define read_vpe_c0_vpecontrol() mftc0(1, 1) | ||
350 | #define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val) | ||
351 | #define read_vpe_c0_vpeconf0() mftc0(1, 2) | ||
352 | #define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val) | ||
353 | #define read_vpe_c0_count() mftc0(9, 0) | ||
354 | #define write_vpe_c0_count(val) mttc0(9, 0, val) | ||
355 | #define read_vpe_c0_status() mftc0(12, 0) | ||
356 | #define write_vpe_c0_status(val) mttc0(12, 0, val) | ||
357 | #define read_vpe_c0_cause() mftc0(13, 0) | ||
358 | #define write_vpe_c0_cause(val) mttc0(13, 0, val) | ||
359 | #define read_vpe_c0_config() mftc0(16, 0) | ||
360 | #define write_vpe_c0_config(val) mttc0(16, 0, val) | ||
361 | #define read_vpe_c0_config1() mftc0(16, 1) | ||
362 | #define write_vpe_c0_config1(val) mttc0(16, 1, val) | ||
363 | #define read_vpe_c0_config7() mftc0(16, 7) | ||
364 | #define write_vpe_c0_config7(val) mttc0(16, 7, val) | ||
365 | #define read_vpe_c0_ebase() mftc0(15, 1) | ||
366 | #define write_vpe_c0_ebase(val) mttc0(15, 1, val) | ||
367 | #define write_vpe_c0_compare(val) mttc0(11, 0, val) | ||
368 | #define read_vpe_c0_badvaddr() mftc0(8, 0) | ||
369 | #define read_vpe_c0_epc() mftc0(14, 0) | ||
370 | #define write_vpe_c0_epc(val) mttc0(14, 0, val) | ||
371 | |||
372 | |||
373 | /* TC */ | ||
374 | #define read_tc_c0_tcstatus() mftc0(2, 1) | ||
375 | #define write_tc_c0_tcstatus(val) mttc0(2, 1, val) | ||
376 | #define read_tc_c0_tcbind() mftc0(2, 2) | ||
377 | #define write_tc_c0_tcbind(val) mttc0(2, 2, val) | ||
378 | #define read_tc_c0_tcrestart() mftc0(2, 3) | ||
379 | #define write_tc_c0_tcrestart(val) mttc0(2, 3, val) | ||
380 | #define read_tc_c0_tchalt() mftc0(2, 4) | ||
381 | #define write_tc_c0_tchalt(val) mttc0(2, 4, val) | ||
382 | #define read_tc_c0_tccontext() mftc0(2, 5) | ||
383 | #define write_tc_c0_tccontext(val) mttc0(2, 5, val) | ||
384 | |||
385 | /* GPR */ | ||
386 | #define read_tc_gpr_sp() mftgpr(29) | ||
387 | #define write_tc_gpr_sp(val) mttgpr(29, val) | ||
388 | #define read_tc_gpr_gp() mftgpr(28) | ||
389 | #define write_tc_gpr_gp(val) mttgpr(28, val) | ||
390 | |||
391 | __BUILD_SET_C0(mvpcontrol) | ||
392 | |||
393 | #endif /* Not __ASSEMBLY__ */ | ||
394 | |||
395 | #endif | ||
diff --git a/include/asm-mips/mipsprom.h b/include/asm-mips/mipsprom.h deleted file mode 100644 index 146d41b67adc..000000000000 --- a/include/asm-mips/mipsprom.h +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | #ifndef __ASM_MIPS_PROM_H | ||
2 | #define __ASM_MIPS_PROM_H | ||
3 | |||
4 | #define PROM_RESET 0 | ||
5 | #define PROM_EXEC 1 | ||
6 | #define PROM_RESTART 2 | ||
7 | #define PROM_REINIT 3 | ||
8 | #define PROM_REBOOT 4 | ||
9 | #define PROM_AUTOBOOT 5 | ||
10 | #define PROM_OPEN 6 | ||
11 | #define PROM_READ 7 | ||
12 | #define PROM_WRITE 8 | ||
13 | #define PROM_IOCTL 9 | ||
14 | #define PROM_CLOSE 10 | ||
15 | #define PROM_GETCHAR 11 | ||
16 | #define PROM_PUTCHAR 12 | ||
17 | #define PROM_SHOWCHAR 13 /* XXX */ | ||
18 | #define PROM_GETS 14 /* XXX */ | ||
19 | #define PROM_PUTS 15 /* XXX */ | ||
20 | #define PROM_PRINTF 16 /* XXX */ | ||
21 | |||
22 | /* What are these for? */ | ||
23 | #define PROM_INITPROTO 17 /* XXX */ | ||
24 | #define PROM_PROTOENABLE 18 /* XXX */ | ||
25 | #define PROM_PROTODISABLE 19 /* XXX */ | ||
26 | #define PROM_GETPKT 20 /* XXX */ | ||
27 | #define PROM_PUTPKT 21 /* XXX */ | ||
28 | |||
29 | /* More PROM shit. Probably has to do with VME RMW cycles??? */ | ||
30 | #define PROM_ORW_RMW 22 /* XXX */ | ||
31 | #define PROM_ORH_RMW 23 /* XXX */ | ||
32 | #define PROM_ORB_RMW 24 /* XXX */ | ||
33 | #define PROM_ANDW_RMW 25 /* XXX */ | ||
34 | #define PROM_ANDH_RMW 26 /* XXX */ | ||
35 | #define PROM_ANDB_RMW 27 /* XXX */ | ||
36 | |||
37 | /* Cache handling stuff */ | ||
38 | #define PROM_FLUSHCACHE 28 /* XXX */ | ||
39 | #define PROM_CLEARCACHE 29 /* XXX */ | ||
40 | |||
41 | /* Libc alike stuff */ | ||
42 | #define PROM_SETJMP 30 /* XXX */ | ||
43 | #define PROM_LONGJMP 31 /* XXX */ | ||
44 | #define PROM_BEVUTLB 32 /* XXX */ | ||
45 | #define PROM_GETENV 33 /* XXX */ | ||
46 | #define PROM_SETENV 34 /* XXX */ | ||
47 | #define PROM_ATOB 35 /* XXX */ | ||
48 | #define PROM_STRCMP 36 /* XXX */ | ||
49 | #define PROM_STRLEN 37 /* XXX */ | ||
50 | #define PROM_STRCPY 38 /* XXX */ | ||
51 | #define PROM_STRCAT 39 /* XXX */ | ||
52 | |||
53 | /* Misc stuff */ | ||
54 | #define PROM_PARSER 40 /* XXX */ | ||
55 | #define PROM_RANGE 41 /* XXX */ | ||
56 | #define PROM_ARGVIZE 42 /* XXX */ | ||
57 | #define PROM_HELP 43 /* XXX */ | ||
58 | |||
59 | /* Entry points for some PROM commands */ | ||
60 | #define PROM_DUMPCMD 44 /* XXX */ | ||
61 | #define PROM_SETENVCMD 45 /* XXX */ | ||
62 | #define PROM_UNSETENVCMD 46 /* XXX */ | ||
63 | #define PROM_PRINTENVCMD 47 /* XXX */ | ||
64 | #define PROM_BEVEXCEPT 48 /* XXX */ | ||
65 | #define PROM_ENABLECMD 49 /* XXX */ | ||
66 | #define PROM_DISABLECMD 50 /* XXX */ | ||
67 | |||
68 | #define PROM_CLEARNOFAULT 51 /* XXX */ | ||
69 | #define PROM_NOTIMPLEMENT 52 /* XXX */ | ||
70 | |||
71 | #define PROM_NV_GET 53 /* XXX */ | ||
72 | #define PROM_NV_SET 54 /* XXX */ | ||
73 | |||
74 | extern char *prom_getenv(char *); | ||
75 | |||
76 | #endif /* __ASM_MIPS_PROM_H */ | ||
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h deleted file mode 100644 index 979866000da4..000000000000 --- a/include/asm-mips/mipsregs.h +++ /dev/null | |||
@@ -1,1526 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001 by Ralf Baechle | ||
7 | * Copyright (C) 2000 Silicon Graphics, Inc. | ||
8 | * Modified for further R[236]000 support by Paul M. Antoine, 1996. | ||
9 | * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com | ||
10 | * Copyright (C) 2000, 07 MIPS Technologies, Inc. | ||
11 | * Copyright (C) 2003, 2004 Maciej W. Rozycki | ||
12 | */ | ||
13 | #ifndef _ASM_MIPSREGS_H | ||
14 | #define _ASM_MIPSREGS_H | ||
15 | |||
16 | #include <linux/linkage.h> | ||
17 | #include <asm/hazards.h> | ||
18 | #include <asm/war.h> | ||
19 | |||
20 | /* | ||
21 | * The following macros are especially useful for __asm__ | ||
22 | * inline assembler. | ||
23 | */ | ||
24 | #ifndef __STR | ||
25 | #define __STR(x) #x | ||
26 | #endif | ||
27 | #ifndef STR | ||
28 | #define STR(x) __STR(x) | ||
29 | #endif | ||
30 | |||
31 | /* | ||
32 | * Configure language | ||
33 | */ | ||
34 | #ifdef __ASSEMBLY__ | ||
35 | #define _ULCAST_ | ||
36 | #else | ||
37 | #define _ULCAST_ (unsigned long) | ||
38 | #endif | ||
39 | |||
40 | /* | ||
41 | * Coprocessor 0 register names | ||
42 | */ | ||
43 | #define CP0_INDEX $0 | ||
44 | #define CP0_RANDOM $1 | ||
45 | #define CP0_ENTRYLO0 $2 | ||
46 | #define CP0_ENTRYLO1 $3 | ||
47 | #define CP0_CONF $3 | ||
48 | #define CP0_CONTEXT $4 | ||
49 | #define CP0_PAGEMASK $5 | ||
50 | #define CP0_WIRED $6 | ||
51 | #define CP0_INFO $7 | ||
52 | #define CP0_BADVADDR $8 | ||
53 | #define CP0_COUNT $9 | ||
54 | #define CP0_ENTRYHI $10 | ||
55 | #define CP0_COMPARE $11 | ||
56 | #define CP0_STATUS $12 | ||
57 | #define CP0_CAUSE $13 | ||
58 | #define CP0_EPC $14 | ||
59 | #define CP0_PRID $15 | ||
60 | #define CP0_CONFIG $16 | ||
61 | #define CP0_LLADDR $17 | ||
62 | #define CP0_WATCHLO $18 | ||
63 | #define CP0_WATCHHI $19 | ||
64 | #define CP0_XCONTEXT $20 | ||
65 | #define CP0_FRAMEMASK $21 | ||
66 | #define CP0_DIAGNOSTIC $22 | ||
67 | #define CP0_DEBUG $23 | ||
68 | #define CP0_DEPC $24 | ||
69 | #define CP0_PERFORMANCE $25 | ||
70 | #define CP0_ECC $26 | ||
71 | #define CP0_CACHEERR $27 | ||
72 | #define CP0_TAGLO $28 | ||
73 | #define CP0_TAGHI $29 | ||
74 | #define CP0_ERROREPC $30 | ||
75 | #define CP0_DESAVE $31 | ||
76 | |||
77 | /* | ||
78 | * R4640/R4650 cp0 register names. These registers are listed | ||
79 | * here only for completeness; without MMU these CPUs are not useable | ||
80 | * by Linux. A future ELKS port might take make Linux run on them | ||
81 | * though ... | ||
82 | */ | ||
83 | #define CP0_IBASE $0 | ||
84 | #define CP0_IBOUND $1 | ||
85 | #define CP0_DBASE $2 | ||
86 | #define CP0_DBOUND $3 | ||
87 | #define CP0_CALG $17 | ||
88 | #define CP0_IWATCH $18 | ||
89 | #define CP0_DWATCH $19 | ||
90 | |||
91 | /* | ||
92 | * Coprocessor 0 Set 1 register names | ||
93 | */ | ||
94 | #define CP0_S1_DERRADDR0 $26 | ||
95 | #define CP0_S1_DERRADDR1 $27 | ||
96 | #define CP0_S1_INTCONTROL $20 | ||
97 | |||
98 | /* | ||
99 | * Coprocessor 0 Set 2 register names | ||
100 | */ | ||
101 | #define CP0_S2_SRSCTL $12 /* MIPSR2 */ | ||
102 | |||
103 | /* | ||
104 | * Coprocessor 0 Set 3 register names | ||
105 | */ | ||
106 | #define CP0_S3_SRSMAP $12 /* MIPSR2 */ | ||
107 | |||
108 | /* | ||
109 | * TX39 Series | ||
110 | */ | ||
111 | #define CP0_TX39_CACHE $7 | ||
112 | |||
113 | /* | ||
114 | * Coprocessor 1 (FPU) register names | ||
115 | */ | ||
116 | #define CP1_REVISION $0 | ||
117 | #define CP1_STATUS $31 | ||
118 | |||
119 | /* | ||
120 | * FPU Status Register Values | ||
121 | */ | ||
122 | /* | ||
123 | * Status Register Values | ||
124 | */ | ||
125 | |||
126 | #define FPU_CSR_FLUSH 0x01000000 /* flush denormalised results to 0 */ | ||
127 | #define FPU_CSR_COND 0x00800000 /* $fcc0 */ | ||
128 | #define FPU_CSR_COND0 0x00800000 /* $fcc0 */ | ||
129 | #define FPU_CSR_COND1 0x02000000 /* $fcc1 */ | ||
130 | #define FPU_CSR_COND2 0x04000000 /* $fcc2 */ | ||
131 | #define FPU_CSR_COND3 0x08000000 /* $fcc3 */ | ||
132 | #define FPU_CSR_COND4 0x10000000 /* $fcc4 */ | ||
133 | #define FPU_CSR_COND5 0x20000000 /* $fcc5 */ | ||
134 | #define FPU_CSR_COND6 0x40000000 /* $fcc6 */ | ||
135 | #define FPU_CSR_COND7 0x80000000 /* $fcc7 */ | ||
136 | |||
137 | /* | ||
138 | * X the exception cause indicator | ||
139 | * E the exception enable | ||
140 | * S the sticky/flag bit | ||
141 | */ | ||
142 | #define FPU_CSR_ALL_X 0x0003f000 | ||
143 | #define FPU_CSR_UNI_X 0x00020000 | ||
144 | #define FPU_CSR_INV_X 0x00010000 | ||
145 | #define FPU_CSR_DIV_X 0x00008000 | ||
146 | #define FPU_CSR_OVF_X 0x00004000 | ||
147 | #define FPU_CSR_UDF_X 0x00002000 | ||
148 | #define FPU_CSR_INE_X 0x00001000 | ||
149 | |||
150 | #define FPU_CSR_ALL_E 0x00000f80 | ||
151 | #define FPU_CSR_INV_E 0x00000800 | ||
152 | #define FPU_CSR_DIV_E 0x00000400 | ||
153 | #define FPU_CSR_OVF_E 0x00000200 | ||
154 | #define FPU_CSR_UDF_E 0x00000100 | ||
155 | #define FPU_CSR_INE_E 0x00000080 | ||
156 | |||
157 | #define FPU_CSR_ALL_S 0x0000007c | ||
158 | #define FPU_CSR_INV_S 0x00000040 | ||
159 | #define FPU_CSR_DIV_S 0x00000020 | ||
160 | #define FPU_CSR_OVF_S 0x00000010 | ||
161 | #define FPU_CSR_UDF_S 0x00000008 | ||
162 | #define FPU_CSR_INE_S 0x00000004 | ||
163 | |||
164 | /* rounding mode */ | ||
165 | #define FPU_CSR_RN 0x0 /* nearest */ | ||
166 | #define FPU_CSR_RZ 0x1 /* towards zero */ | ||
167 | #define FPU_CSR_RU 0x2 /* towards +Infinity */ | ||
168 | #define FPU_CSR_RD 0x3 /* towards -Infinity */ | ||
169 | |||
170 | |||
171 | /* | ||
172 | * Values for PageMask register | ||
173 | */ | ||
174 | #ifdef CONFIG_CPU_VR41XX | ||
175 | |||
176 | /* Why doesn't stupidity hurt ... */ | ||
177 | |||
178 | #define PM_1K 0x00000000 | ||
179 | #define PM_4K 0x00001800 | ||
180 | #define PM_16K 0x00007800 | ||
181 | #define PM_64K 0x0001f800 | ||
182 | #define PM_256K 0x0007f800 | ||
183 | |||
184 | #else | ||
185 | |||
186 | #define PM_4K 0x00000000 | ||
187 | #define PM_16K 0x00006000 | ||
188 | #define PM_64K 0x0001e000 | ||
189 | #define PM_256K 0x0007e000 | ||
190 | #define PM_1M 0x001fe000 | ||
191 | #define PM_4M 0x007fe000 | ||
192 | #define PM_16M 0x01ffe000 | ||
193 | #define PM_64M 0x07ffe000 | ||
194 | #define PM_256M 0x1fffe000 | ||
195 | |||
196 | #endif | ||
197 | |||
198 | /* | ||
199 | * Default page size for a given kernel configuration | ||
200 | */ | ||
201 | #ifdef CONFIG_PAGE_SIZE_4KB | ||
202 | #define PM_DEFAULT_MASK PM_4K | ||
203 | #elif defined(CONFIG_PAGE_SIZE_16KB) | ||
204 | #define PM_DEFAULT_MASK PM_16K | ||
205 | #elif defined(CONFIG_PAGE_SIZE_64KB) | ||
206 | #define PM_DEFAULT_MASK PM_64K | ||
207 | #else | ||
208 | #error Bad page size configuration! | ||
209 | #endif | ||
210 | |||
211 | |||
212 | /* | ||
213 | * Values used for computation of new tlb entries | ||
214 | */ | ||
215 | #define PL_4K 12 | ||
216 | #define PL_16K 14 | ||
217 | #define PL_64K 16 | ||
218 | #define PL_256K 18 | ||
219 | #define PL_1M 20 | ||
220 | #define PL_4M 22 | ||
221 | #define PL_16M 24 | ||
222 | #define PL_64M 26 | ||
223 | #define PL_256M 28 | ||
224 | |||
225 | /* | ||
226 | * R4x00 interrupt enable / cause bits | ||
227 | */ | ||
228 | #define IE_SW0 (_ULCAST_(1) << 8) | ||
229 | #define IE_SW1 (_ULCAST_(1) << 9) | ||
230 | #define IE_IRQ0 (_ULCAST_(1) << 10) | ||
231 | #define IE_IRQ1 (_ULCAST_(1) << 11) | ||
232 | #define IE_IRQ2 (_ULCAST_(1) << 12) | ||
233 | #define IE_IRQ3 (_ULCAST_(1) << 13) | ||
234 | #define IE_IRQ4 (_ULCAST_(1) << 14) | ||
235 | #define IE_IRQ5 (_ULCAST_(1) << 15) | ||
236 | |||
237 | /* | ||
238 | * R4x00 interrupt cause bits | ||
239 | */ | ||
240 | #define C_SW0 (_ULCAST_(1) << 8) | ||
241 | #define C_SW1 (_ULCAST_(1) << 9) | ||
242 | #define C_IRQ0 (_ULCAST_(1) << 10) | ||
243 | #define C_IRQ1 (_ULCAST_(1) << 11) | ||
244 | #define C_IRQ2 (_ULCAST_(1) << 12) | ||
245 | #define C_IRQ3 (_ULCAST_(1) << 13) | ||
246 | #define C_IRQ4 (_ULCAST_(1) << 14) | ||
247 | #define C_IRQ5 (_ULCAST_(1) << 15) | ||
248 | |||
249 | /* | ||
250 | * Bitfields in the R4xx0 cp0 status register | ||
251 | */ | ||
252 | #define ST0_IE 0x00000001 | ||
253 | #define ST0_EXL 0x00000002 | ||
254 | #define ST0_ERL 0x00000004 | ||
255 | #define ST0_KSU 0x00000018 | ||
256 | # define KSU_USER 0x00000010 | ||
257 | # define KSU_SUPERVISOR 0x00000008 | ||
258 | # define KSU_KERNEL 0x00000000 | ||
259 | #define ST0_UX 0x00000020 | ||
260 | #define ST0_SX 0x00000040 | ||
261 | #define ST0_KX 0x00000080 | ||
262 | #define ST0_DE 0x00010000 | ||
263 | #define ST0_CE 0x00020000 | ||
264 | |||
265 | /* | ||
266 | * Setting c0_status.co enables Hit_Writeback and Hit_Writeback_Invalidate | ||
267 | * cacheops in userspace. This bit exists only on RM7000 and RM9000 | ||
268 | * processors. | ||
269 | */ | ||
270 | #define ST0_CO 0x08000000 | ||
271 | |||
272 | /* | ||
273 | * Bitfields in the R[23]000 cp0 status register. | ||
274 | */ | ||
275 | #define ST0_IEC 0x00000001 | ||
276 | #define ST0_KUC 0x00000002 | ||
277 | #define ST0_IEP 0x00000004 | ||
278 | #define ST0_KUP 0x00000008 | ||
279 | #define ST0_IEO 0x00000010 | ||
280 | #define ST0_KUO 0x00000020 | ||
281 | /* bits 6 & 7 are reserved on R[23]000 */ | ||
282 | #define ST0_ISC 0x00010000 | ||
283 | #define ST0_SWC 0x00020000 | ||
284 | #define ST0_CM 0x00080000 | ||
285 | |||
286 | /* | ||
287 | * Bits specific to the R4640/R4650 | ||
288 | */ | ||
289 | #define ST0_UM (_ULCAST_(1) << 4) | ||
290 | #define ST0_IL (_ULCAST_(1) << 23) | ||
291 | #define ST0_DL (_ULCAST_(1) << 24) | ||
292 | |||
293 | /* | ||
294 | * Enable the MIPS MDMX and DSP ASEs | ||
295 | */ | ||
296 | #define ST0_MX 0x01000000 | ||
297 | |||
298 | /* | ||
299 | * Bitfields in the TX39 family CP0 Configuration Register 3 | ||
300 | */ | ||
301 | #define TX39_CONF_ICS_SHIFT 19 | ||
302 | #define TX39_CONF_ICS_MASK 0x00380000 | ||
303 | #define TX39_CONF_ICS_1KB 0x00000000 | ||
304 | #define TX39_CONF_ICS_2KB 0x00080000 | ||
305 | #define TX39_CONF_ICS_4KB 0x00100000 | ||
306 | #define TX39_CONF_ICS_8KB 0x00180000 | ||
307 | #define TX39_CONF_ICS_16KB 0x00200000 | ||
308 | |||
309 | #define TX39_CONF_DCS_SHIFT 16 | ||
310 | #define TX39_CONF_DCS_MASK 0x00070000 | ||
311 | #define TX39_CONF_DCS_1KB 0x00000000 | ||
312 | #define TX39_CONF_DCS_2KB 0x00010000 | ||
313 | #define TX39_CONF_DCS_4KB 0x00020000 | ||
314 | #define TX39_CONF_DCS_8KB 0x00030000 | ||
315 | #define TX39_CONF_DCS_16KB 0x00040000 | ||
316 | |||
317 | #define TX39_CONF_CWFON 0x00004000 | ||
318 | #define TX39_CONF_WBON 0x00002000 | ||
319 | #define TX39_CONF_RF_SHIFT 10 | ||
320 | #define TX39_CONF_RF_MASK 0x00000c00 | ||
321 | #define TX39_CONF_DOZE 0x00000200 | ||
322 | #define TX39_CONF_HALT 0x00000100 | ||
323 | #define TX39_CONF_LOCK 0x00000080 | ||
324 | #define TX39_CONF_ICE 0x00000020 | ||
325 | #define TX39_CONF_DCE 0x00000010 | ||
326 | #define TX39_CONF_IRSIZE_SHIFT 2 | ||
327 | #define TX39_CONF_IRSIZE_MASK 0x0000000c | ||
328 | #define TX39_CONF_DRSIZE_SHIFT 0 | ||
329 | #define TX39_CONF_DRSIZE_MASK 0x00000003 | ||
330 | |||
331 | /* | ||
332 | * Status register bits available in all MIPS CPUs. | ||
333 | */ | ||
334 | #define ST0_IM 0x0000ff00 | ||
335 | #define STATUSB_IP0 8 | ||
336 | #define STATUSF_IP0 (_ULCAST_(1) << 8) | ||
337 | #define STATUSB_IP1 9 | ||
338 | #define STATUSF_IP1 (_ULCAST_(1) << 9) | ||
339 | #define STATUSB_IP2 10 | ||
340 | #define STATUSF_IP2 (_ULCAST_(1) << 10) | ||
341 | #define STATUSB_IP3 11 | ||
342 | #define STATUSF_IP3 (_ULCAST_(1) << 11) | ||
343 | #define STATUSB_IP4 12 | ||
344 | #define STATUSF_IP4 (_ULCAST_(1) << 12) | ||
345 | #define STATUSB_IP5 13 | ||
346 | #define STATUSF_IP5 (_ULCAST_(1) << 13) | ||
347 | #define STATUSB_IP6 14 | ||
348 | #define STATUSF_IP6 (_ULCAST_(1) << 14) | ||
349 | #define STATUSB_IP7 15 | ||
350 | #define STATUSF_IP7 (_ULCAST_(1) << 15) | ||
351 | #define STATUSB_IP8 0 | ||
352 | #define STATUSF_IP8 (_ULCAST_(1) << 0) | ||
353 | #define STATUSB_IP9 1 | ||
354 | #define STATUSF_IP9 (_ULCAST_(1) << 1) | ||
355 | #define STATUSB_IP10 2 | ||
356 | #define STATUSF_IP10 (_ULCAST_(1) << 2) | ||
357 | #define STATUSB_IP11 3 | ||
358 | #define STATUSF_IP11 (_ULCAST_(1) << 3) | ||
359 | #define STATUSB_IP12 4 | ||
360 | #define STATUSF_IP12 (_ULCAST_(1) << 4) | ||
361 | #define STATUSB_IP13 5 | ||
362 | #define STATUSF_IP13 (_ULCAST_(1) << 5) | ||
363 | #define STATUSB_IP14 6 | ||
364 | #define STATUSF_IP14 (_ULCAST_(1) << 6) | ||
365 | #define STATUSB_IP15 7 | ||
366 | #define STATUSF_IP15 (_ULCAST_(1) << 7) | ||
367 | #define ST0_CH 0x00040000 | ||
368 | #define ST0_SR 0x00100000 | ||
369 | #define ST0_TS 0x00200000 | ||
370 | #define ST0_BEV 0x00400000 | ||
371 | #define ST0_RE 0x02000000 | ||
372 | #define ST0_FR 0x04000000 | ||
373 | #define ST0_CU 0xf0000000 | ||
374 | #define ST0_CU0 0x10000000 | ||
375 | #define ST0_CU1 0x20000000 | ||
376 | #define ST0_CU2 0x40000000 | ||
377 | #define ST0_CU3 0x80000000 | ||
378 | #define ST0_XX 0x80000000 /* MIPS IV naming */ | ||
379 | |||
380 | /* | ||
381 | * Bitfields and bit numbers in the coprocessor 0 cause register. | ||
382 | * | ||
383 | * Refer to your MIPS R4xx0 manual, chapter 5 for explanation. | ||
384 | */ | ||
385 | #define CAUSEB_EXCCODE 2 | ||
386 | #define CAUSEF_EXCCODE (_ULCAST_(31) << 2) | ||
387 | #define CAUSEB_IP 8 | ||
388 | #define CAUSEF_IP (_ULCAST_(255) << 8) | ||
389 | #define CAUSEB_IP0 8 | ||
390 | #define CAUSEF_IP0 (_ULCAST_(1) << 8) | ||
391 | #define CAUSEB_IP1 9 | ||
392 | #define CAUSEF_IP1 (_ULCAST_(1) << 9) | ||
393 | #define CAUSEB_IP2 10 | ||
394 | #define CAUSEF_IP2 (_ULCAST_(1) << 10) | ||
395 | #define CAUSEB_IP3 11 | ||
396 | #define CAUSEF_IP3 (_ULCAST_(1) << 11) | ||
397 | #define CAUSEB_IP4 12 | ||
398 | #define CAUSEF_IP4 (_ULCAST_(1) << 12) | ||
399 | #define CAUSEB_IP5 13 | ||
400 | #define CAUSEF_IP5 (_ULCAST_(1) << 13) | ||
401 | #define CAUSEB_IP6 14 | ||
402 | #define CAUSEF_IP6 (_ULCAST_(1) << 14) | ||
403 | #define CAUSEB_IP7 15 | ||
404 | #define CAUSEF_IP7 (_ULCAST_(1) << 15) | ||
405 | #define CAUSEB_IV 23 | ||
406 | #define CAUSEF_IV (_ULCAST_(1) << 23) | ||
407 | #define CAUSEB_CE 28 | ||
408 | #define CAUSEF_CE (_ULCAST_(3) << 28) | ||
409 | #define CAUSEB_BD 31 | ||
410 | #define CAUSEF_BD (_ULCAST_(1) << 31) | ||
411 | |||
412 | /* | ||
413 | * Bits in the coprocessor 0 config register. | ||
414 | */ | ||
415 | /* Generic bits. */ | ||
416 | #define CONF_CM_CACHABLE_NO_WA 0 | ||
417 | #define CONF_CM_CACHABLE_WA 1 | ||
418 | #define CONF_CM_UNCACHED 2 | ||
419 | #define CONF_CM_CACHABLE_NONCOHERENT 3 | ||
420 | #define CONF_CM_CACHABLE_CE 4 | ||
421 | #define CONF_CM_CACHABLE_COW 5 | ||
422 | #define CONF_CM_CACHABLE_CUW 6 | ||
423 | #define CONF_CM_CACHABLE_ACCELERATED 7 | ||
424 | #define CONF_CM_CMASK 7 | ||
425 | #define CONF_BE (_ULCAST_(1) << 15) | ||
426 | |||
427 | /* Bits common to various processors. */ | ||
428 | #define CONF_CU (_ULCAST_(1) << 3) | ||
429 | #define CONF_DB (_ULCAST_(1) << 4) | ||
430 | #define CONF_IB (_ULCAST_(1) << 5) | ||
431 | #define CONF_DC (_ULCAST_(7) << 6) | ||
432 | #define CONF_IC (_ULCAST_(7) << 9) | ||
433 | #define CONF_EB (_ULCAST_(1) << 13) | ||
434 | #define CONF_EM (_ULCAST_(1) << 14) | ||
435 | #define CONF_SM (_ULCAST_(1) << 16) | ||
436 | #define CONF_SC (_ULCAST_(1) << 17) | ||
437 | #define CONF_EW (_ULCAST_(3) << 18) | ||
438 | #define CONF_EP (_ULCAST_(15)<< 24) | ||
439 | #define CONF_EC (_ULCAST_(7) << 28) | ||
440 | #define CONF_CM (_ULCAST_(1) << 31) | ||
441 | |||
442 | /* Bits specific to the R4xx0. */ | ||
443 | #define R4K_CONF_SW (_ULCAST_(1) << 20) | ||
444 | #define R4K_CONF_SS (_ULCAST_(1) << 21) | ||
445 | #define R4K_CONF_SB (_ULCAST_(3) << 22) | ||
446 | |||
447 | /* Bits specific to the R5000. */ | ||
448 | #define R5K_CONF_SE (_ULCAST_(1) << 12) | ||
449 | #define R5K_CONF_SS (_ULCAST_(3) << 20) | ||
450 | |||
451 | /* Bits specific to the RM7000. */ | ||
452 | #define RM7K_CONF_SE (_ULCAST_(1) << 3) | ||
453 | #define RM7K_CONF_TE (_ULCAST_(1) << 12) | ||
454 | #define RM7K_CONF_CLK (_ULCAST_(1) << 16) | ||
455 | #define RM7K_CONF_TC (_ULCAST_(1) << 17) | ||
456 | #define RM7K_CONF_SI (_ULCAST_(3) << 20) | ||
457 | #define RM7K_CONF_SC (_ULCAST_(1) << 31) | ||
458 | |||
459 | /* Bits specific to the R10000. */ | ||
460 | #define R10K_CONF_DN (_ULCAST_(3) << 3) | ||
461 | #define R10K_CONF_CT (_ULCAST_(1) << 5) | ||
462 | #define R10K_CONF_PE (_ULCAST_(1) << 6) | ||
463 | #define R10K_CONF_PM (_ULCAST_(3) << 7) | ||
464 | #define R10K_CONF_EC (_ULCAST_(15)<< 9) | ||
465 | #define R10K_CONF_SB (_ULCAST_(1) << 13) | ||
466 | #define R10K_CONF_SK (_ULCAST_(1) << 14) | ||
467 | #define R10K_CONF_SS (_ULCAST_(7) << 16) | ||
468 | #define R10K_CONF_SC (_ULCAST_(7) << 19) | ||
469 | #define R10K_CONF_DC (_ULCAST_(7) << 26) | ||
470 | #define R10K_CONF_IC (_ULCAST_(7) << 29) | ||
471 | |||
472 | /* Bits specific to the VR41xx. */ | ||
473 | #define VR41_CONF_CS (_ULCAST_(1) << 12) | ||
474 | #define VR41_CONF_P4K (_ULCAST_(1) << 13) | ||
475 | #define VR41_CONF_BP (_ULCAST_(1) << 16) | ||
476 | #define VR41_CONF_M16 (_ULCAST_(1) << 20) | ||
477 | #define VR41_CONF_AD (_ULCAST_(1) << 23) | ||
478 | |||
479 | /* Bits specific to the R30xx. */ | ||
480 | #define R30XX_CONF_FDM (_ULCAST_(1) << 19) | ||
481 | #define R30XX_CONF_REV (_ULCAST_(1) << 22) | ||
482 | #define R30XX_CONF_AC (_ULCAST_(1) << 23) | ||
483 | #define R30XX_CONF_RF (_ULCAST_(1) << 24) | ||
484 | #define R30XX_CONF_HALT (_ULCAST_(1) << 25) | ||
485 | #define R30XX_CONF_FPINT (_ULCAST_(7) << 26) | ||
486 | #define R30XX_CONF_DBR (_ULCAST_(1) << 29) | ||
487 | #define R30XX_CONF_SB (_ULCAST_(1) << 30) | ||
488 | #define R30XX_CONF_LOCK (_ULCAST_(1) << 31) | ||
489 | |||
490 | /* Bits specific to the TX49. */ | ||
491 | #define TX49_CONF_DC (_ULCAST_(1) << 16) | ||
492 | #define TX49_CONF_IC (_ULCAST_(1) << 17) /* conflict with CONF_SC */ | ||
493 | #define TX49_CONF_HALT (_ULCAST_(1) << 18) | ||
494 | #define TX49_CONF_CWFON (_ULCAST_(1) << 27) | ||
495 | |||
496 | /* Bits specific to the MIPS32/64 PRA. */ | ||
497 | #define MIPS_CONF_MT (_ULCAST_(7) << 7) | ||
498 | #define MIPS_CONF_AR (_ULCAST_(7) << 10) | ||
499 | #define MIPS_CONF_AT (_ULCAST_(3) << 13) | ||
500 | #define MIPS_CONF_M (_ULCAST_(1) << 31) | ||
501 | |||
502 | /* | ||
503 | * Bits in the MIPS32/64 PRA coprocessor 0 config registers 1 and above. | ||
504 | */ | ||
505 | #define MIPS_CONF1_FP (_ULCAST_(1) << 0) | ||
506 | #define MIPS_CONF1_EP (_ULCAST_(1) << 1) | ||
507 | #define MIPS_CONF1_CA (_ULCAST_(1) << 2) | ||
508 | #define MIPS_CONF1_WR (_ULCAST_(1) << 3) | ||
509 | #define MIPS_CONF1_PC (_ULCAST_(1) << 4) | ||
510 | #define MIPS_CONF1_MD (_ULCAST_(1) << 5) | ||
511 | #define MIPS_CONF1_C2 (_ULCAST_(1) << 6) | ||
512 | #define MIPS_CONF1_DA (_ULCAST_(7) << 7) | ||
513 | #define MIPS_CONF1_DL (_ULCAST_(7) << 10) | ||
514 | #define MIPS_CONF1_DS (_ULCAST_(7) << 13) | ||
515 | #define MIPS_CONF1_IA (_ULCAST_(7) << 16) | ||
516 | #define MIPS_CONF1_IL (_ULCAST_(7) << 19) | ||
517 | #define MIPS_CONF1_IS (_ULCAST_(7) << 22) | ||
518 | #define MIPS_CONF1_TLBS (_ULCAST_(63)<< 25) | ||
519 | |||
520 | #define MIPS_CONF2_SA (_ULCAST_(15)<< 0) | ||
521 | #define MIPS_CONF2_SL (_ULCAST_(15)<< 4) | ||
522 | #define MIPS_CONF2_SS (_ULCAST_(15)<< 8) | ||
523 | #define MIPS_CONF2_SU (_ULCAST_(15)<< 12) | ||
524 | #define MIPS_CONF2_TA (_ULCAST_(15)<< 16) | ||
525 | #define MIPS_CONF2_TL (_ULCAST_(15)<< 20) | ||
526 | #define MIPS_CONF2_TS (_ULCAST_(15)<< 24) | ||
527 | #define MIPS_CONF2_TU (_ULCAST_(7) << 28) | ||
528 | |||
529 | #define MIPS_CONF3_TL (_ULCAST_(1) << 0) | ||
530 | #define MIPS_CONF3_SM (_ULCAST_(1) << 1) | ||
531 | #define MIPS_CONF3_MT (_ULCAST_(1) << 2) | ||
532 | #define MIPS_CONF3_SP (_ULCAST_(1) << 4) | ||
533 | #define MIPS_CONF3_VINT (_ULCAST_(1) << 5) | ||
534 | #define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) | ||
535 | #define MIPS_CONF3_LPA (_ULCAST_(1) << 7) | ||
536 | #define MIPS_CONF3_DSP (_ULCAST_(1) << 10) | ||
537 | #define MIPS_CONF3_ULRI (_ULCAST_(1) << 13) | ||
538 | |||
539 | #define MIPS_CONF7_WII (_ULCAST_(1) << 31) | ||
540 | |||
541 | #define MIPS_CONF7_RPS (_ULCAST_(1) << 2) | ||
542 | |||
543 | |||
544 | /* | ||
545 | * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register. | ||
546 | */ | ||
547 | #define MIPS_FPIR_S (_ULCAST_(1) << 16) | ||
548 | #define MIPS_FPIR_D (_ULCAST_(1) << 17) | ||
549 | #define MIPS_FPIR_PS (_ULCAST_(1) << 18) | ||
550 | #define MIPS_FPIR_3D (_ULCAST_(1) << 19) | ||
551 | #define MIPS_FPIR_W (_ULCAST_(1) << 20) | ||
552 | #define MIPS_FPIR_L (_ULCAST_(1) << 21) | ||
553 | #define MIPS_FPIR_F64 (_ULCAST_(1) << 22) | ||
554 | |||
555 | #ifndef __ASSEMBLY__ | ||
556 | |||
557 | /* | ||
558 | * Functions to access the R10000 performance counters. These are basically | ||
559 | * mfc0 and mtc0 instructions from and to coprocessor register with a 5-bit | ||
560 | * performance counter number encoded into bits 1 ... 5 of the instruction. | ||
561 | * Only performance counters 0 to 1 actually exist, so for a non-R10000 aware | ||
562 | * disassembler these will look like an access to sel 0 or 1. | ||
563 | */ | ||
564 | #define read_r10k_perf_cntr(counter) \ | ||
565 | ({ \ | ||
566 | unsigned int __res; \ | ||
567 | __asm__ __volatile__( \ | ||
568 | "mfpc\t%0, %1" \ | ||
569 | : "=r" (__res) \ | ||
570 | : "i" (counter)); \ | ||
571 | \ | ||
572 | __res; \ | ||
573 | }) | ||
574 | |||
575 | #define write_r10k_perf_cntr(counter,val) \ | ||
576 | do { \ | ||
577 | __asm__ __volatile__( \ | ||
578 | "mtpc\t%0, %1" \ | ||
579 | : \ | ||
580 | : "r" (val), "i" (counter)); \ | ||
581 | } while (0) | ||
582 | |||
583 | #define read_r10k_perf_event(counter) \ | ||
584 | ({ \ | ||
585 | unsigned int __res; \ | ||
586 | __asm__ __volatile__( \ | ||
587 | "mfps\t%0, %1" \ | ||
588 | : "=r" (__res) \ | ||
589 | : "i" (counter)); \ | ||
590 | \ | ||
591 | __res; \ | ||
592 | }) | ||
593 | |||
594 | #define write_r10k_perf_cntl(counter,val) \ | ||
595 | do { \ | ||
596 | __asm__ __volatile__( \ | ||
597 | "mtps\t%0, %1" \ | ||
598 | : \ | ||
599 | : "r" (val), "i" (counter)); \ | ||
600 | } while (0) | ||
601 | |||
602 | |||
603 | /* | ||
604 | * Macros to access the system control coprocessor | ||
605 | */ | ||
606 | |||
607 | #define __read_32bit_c0_register(source, sel) \ | ||
608 | ({ int __res; \ | ||
609 | if (sel == 0) \ | ||
610 | __asm__ __volatile__( \ | ||
611 | "mfc0\t%0, " #source "\n\t" \ | ||
612 | : "=r" (__res)); \ | ||
613 | else \ | ||
614 | __asm__ __volatile__( \ | ||
615 | ".set\tmips32\n\t" \ | ||
616 | "mfc0\t%0, " #source ", " #sel "\n\t" \ | ||
617 | ".set\tmips0\n\t" \ | ||
618 | : "=r" (__res)); \ | ||
619 | __res; \ | ||
620 | }) | ||
621 | |||
622 | #define __read_64bit_c0_register(source, sel) \ | ||
623 | ({ unsigned long long __res; \ | ||
624 | if (sizeof(unsigned long) == 4) \ | ||
625 | __res = __read_64bit_c0_split(source, sel); \ | ||
626 | else if (sel == 0) \ | ||
627 | __asm__ __volatile__( \ | ||
628 | ".set\tmips3\n\t" \ | ||
629 | "dmfc0\t%0, " #source "\n\t" \ | ||
630 | ".set\tmips0" \ | ||
631 | : "=r" (__res)); \ | ||
632 | else \ | ||
633 | __asm__ __volatile__( \ | ||
634 | ".set\tmips64\n\t" \ | ||
635 | "dmfc0\t%0, " #source ", " #sel "\n\t" \ | ||
636 | ".set\tmips0" \ | ||
637 | : "=r" (__res)); \ | ||
638 | __res; \ | ||
639 | }) | ||
640 | |||
641 | #define __write_32bit_c0_register(register, sel, value) \ | ||
642 | do { \ | ||
643 | if (sel == 0) \ | ||
644 | __asm__ __volatile__( \ | ||
645 | "mtc0\t%z0, " #register "\n\t" \ | ||
646 | : : "Jr" ((unsigned int)(value))); \ | ||
647 | else \ | ||
648 | __asm__ __volatile__( \ | ||
649 | ".set\tmips32\n\t" \ | ||
650 | "mtc0\t%z0, " #register ", " #sel "\n\t" \ | ||
651 | ".set\tmips0" \ | ||
652 | : : "Jr" ((unsigned int)(value))); \ | ||
653 | } while (0) | ||
654 | |||
655 | #define __write_64bit_c0_register(register, sel, value) \ | ||
656 | do { \ | ||
657 | if (sizeof(unsigned long) == 4) \ | ||
658 | __write_64bit_c0_split(register, sel, value); \ | ||
659 | else if (sel == 0) \ | ||
660 | __asm__ __volatile__( \ | ||
661 | ".set\tmips3\n\t" \ | ||
662 | "dmtc0\t%z0, " #register "\n\t" \ | ||
663 | ".set\tmips0" \ | ||
664 | : : "Jr" (value)); \ | ||
665 | else \ | ||
666 | __asm__ __volatile__( \ | ||
667 | ".set\tmips64\n\t" \ | ||
668 | "dmtc0\t%z0, " #register ", " #sel "\n\t" \ | ||
669 | ".set\tmips0" \ | ||
670 | : : "Jr" (value)); \ | ||
671 | } while (0) | ||
672 | |||
673 | #define __read_ulong_c0_register(reg, sel) \ | ||
674 | ((sizeof(unsigned long) == 4) ? \ | ||
675 | (unsigned long) __read_32bit_c0_register(reg, sel) : \ | ||
676 | (unsigned long) __read_64bit_c0_register(reg, sel)) | ||
677 | |||
678 | #define __write_ulong_c0_register(reg, sel, val) \ | ||
679 | do { \ | ||
680 | if (sizeof(unsigned long) == 4) \ | ||
681 | __write_32bit_c0_register(reg, sel, val); \ | ||
682 | else \ | ||
683 | __write_64bit_c0_register(reg, sel, val); \ | ||
684 | } while (0) | ||
685 | |||
686 | /* | ||
687 | * On RM7000/RM9000 these are uses to access cop0 set 1 registers | ||
688 | */ | ||
689 | #define __read_32bit_c0_ctrl_register(source) \ | ||
690 | ({ int __res; \ | ||
691 | __asm__ __volatile__( \ | ||
692 | "cfc0\t%0, " #source "\n\t" \ | ||
693 | : "=r" (__res)); \ | ||
694 | __res; \ | ||
695 | }) | ||
696 | |||
697 | #define __write_32bit_c0_ctrl_register(register, value) \ | ||
698 | do { \ | ||
699 | __asm__ __volatile__( \ | ||
700 | "ctc0\t%z0, " #register "\n\t" \ | ||
701 | : : "Jr" ((unsigned int)(value))); \ | ||
702 | } while (0) | ||
703 | |||
704 | /* | ||
705 | * These versions are only needed for systems with more than 38 bits of | ||
706 | * physical address space running the 32-bit kernel. That's none atm :-) | ||
707 | */ | ||
708 | #define __read_64bit_c0_split(source, sel) \ | ||
709 | ({ \ | ||
710 | unsigned long long __val; \ | ||
711 | unsigned long __flags; \ | ||
712 | \ | ||
713 | local_irq_save(__flags); \ | ||
714 | if (sel == 0) \ | ||
715 | __asm__ __volatile__( \ | ||
716 | ".set\tmips64\n\t" \ | ||
717 | "dmfc0\t%M0, " #source "\n\t" \ | ||
718 | "dsll\t%L0, %M0, 32\n\t" \ | ||
719 | "dsrl\t%M0, %M0, 32\n\t" \ | ||
720 | "dsrl\t%L0, %L0, 32\n\t" \ | ||
721 | ".set\tmips0" \ | ||
722 | : "=r" (__val)); \ | ||
723 | else \ | ||
724 | __asm__ __volatile__( \ | ||
725 | ".set\tmips64\n\t" \ | ||
726 | "dmfc0\t%M0, " #source ", " #sel "\n\t" \ | ||
727 | "dsll\t%L0, %M0, 32\n\t" \ | ||
728 | "dsrl\t%M0, %M0, 32\n\t" \ | ||
729 | "dsrl\t%L0, %L0, 32\n\t" \ | ||
730 | ".set\tmips0" \ | ||
731 | : "=r" (__val)); \ | ||
732 | local_irq_restore(__flags); \ | ||
733 | \ | ||
734 | __val; \ | ||
735 | }) | ||
736 | |||
737 | #define __write_64bit_c0_split(source, sel, val) \ | ||
738 | do { \ | ||
739 | unsigned long __flags; \ | ||
740 | \ | ||
741 | local_irq_save(__flags); \ | ||
742 | if (sel == 0) \ | ||
743 | __asm__ __volatile__( \ | ||
744 | ".set\tmips64\n\t" \ | ||
745 | "dsll\t%L0, %L0, 32\n\t" \ | ||
746 | "dsrl\t%L0, %L0, 32\n\t" \ | ||
747 | "dsll\t%M0, %M0, 32\n\t" \ | ||
748 | "or\t%L0, %L0, %M0\n\t" \ | ||
749 | "dmtc0\t%L0, " #source "\n\t" \ | ||
750 | ".set\tmips0" \ | ||
751 | : : "r" (val)); \ | ||
752 | else \ | ||
753 | __asm__ __volatile__( \ | ||
754 | ".set\tmips64\n\t" \ | ||
755 | "dsll\t%L0, %L0, 32\n\t" \ | ||
756 | "dsrl\t%L0, %L0, 32\n\t" \ | ||
757 | "dsll\t%M0, %M0, 32\n\t" \ | ||
758 | "or\t%L0, %L0, %M0\n\t" \ | ||
759 | "dmtc0\t%L0, " #source ", " #sel "\n\t" \ | ||
760 | ".set\tmips0" \ | ||
761 | : : "r" (val)); \ | ||
762 | local_irq_restore(__flags); \ | ||
763 | } while (0) | ||
764 | |||
765 | #define read_c0_index() __read_32bit_c0_register($0, 0) | ||
766 | #define write_c0_index(val) __write_32bit_c0_register($0, 0, val) | ||
767 | |||
768 | #define read_c0_random() __read_32bit_c0_register($1, 0) | ||
769 | #define write_c0_random(val) __write_32bit_c0_register($1, 0, val) | ||
770 | |||
771 | #define read_c0_entrylo0() __read_ulong_c0_register($2, 0) | ||
772 | #define write_c0_entrylo0(val) __write_ulong_c0_register($2, 0, val) | ||
773 | |||
774 | #define read_c0_entrylo1() __read_ulong_c0_register($3, 0) | ||
775 | #define write_c0_entrylo1(val) __write_ulong_c0_register($3, 0, val) | ||
776 | |||
777 | #define read_c0_conf() __read_32bit_c0_register($3, 0) | ||
778 | #define write_c0_conf(val) __write_32bit_c0_register($3, 0, val) | ||
779 | |||
780 | #define read_c0_context() __read_ulong_c0_register($4, 0) | ||
781 | #define write_c0_context(val) __write_ulong_c0_register($4, 0, val) | ||
782 | |||
783 | #define read_c0_userlocal() __read_ulong_c0_register($4, 2) | ||
784 | #define write_c0_userlocal(val) __write_ulong_c0_register($4, 2, val) | ||
785 | |||
786 | #define read_c0_pagemask() __read_32bit_c0_register($5, 0) | ||
787 | #define write_c0_pagemask(val) __write_32bit_c0_register($5, 0, val) | ||
788 | |||
789 | #define read_c0_wired() __read_32bit_c0_register($6, 0) | ||
790 | #define write_c0_wired(val) __write_32bit_c0_register($6, 0, val) | ||
791 | |||
792 | #define read_c0_info() __read_32bit_c0_register($7, 0) | ||
793 | |||
794 | #define read_c0_cache() __read_32bit_c0_register($7, 0) /* TX39xx */ | ||
795 | #define write_c0_cache(val) __write_32bit_c0_register($7, 0, val) | ||
796 | |||
797 | #define read_c0_badvaddr() __read_ulong_c0_register($8, 0) | ||
798 | #define write_c0_badvaddr(val) __write_ulong_c0_register($8, 0, val) | ||
799 | |||
800 | #define read_c0_count() __read_32bit_c0_register($9, 0) | ||
801 | #define write_c0_count(val) __write_32bit_c0_register($9, 0, val) | ||
802 | |||
803 | #define read_c0_count2() __read_32bit_c0_register($9, 6) /* pnx8550 */ | ||
804 | #define write_c0_count2(val) __write_32bit_c0_register($9, 6, val) | ||
805 | |||
806 | #define read_c0_count3() __read_32bit_c0_register($9, 7) /* pnx8550 */ | ||
807 | #define write_c0_count3(val) __write_32bit_c0_register($9, 7, val) | ||
808 | |||
809 | #define read_c0_entryhi() __read_ulong_c0_register($10, 0) | ||
810 | #define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val) | ||
811 | |||
812 | #define read_c0_compare() __read_32bit_c0_register($11, 0) | ||
813 | #define write_c0_compare(val) __write_32bit_c0_register($11, 0, val) | ||
814 | |||
815 | #define read_c0_compare2() __read_32bit_c0_register($11, 6) /* pnx8550 */ | ||
816 | #define write_c0_compare2(val) __write_32bit_c0_register($11, 6, val) | ||
817 | |||
818 | #define read_c0_compare3() __read_32bit_c0_register($11, 7) /* pnx8550 */ | ||
819 | #define write_c0_compare3(val) __write_32bit_c0_register($11, 7, val) | ||
820 | |||
821 | #define read_c0_status() __read_32bit_c0_register($12, 0) | ||
822 | #ifdef CONFIG_MIPS_MT_SMTC | ||
823 | #define write_c0_status(val) \ | ||
824 | do { \ | ||
825 | __write_32bit_c0_register($12, 0, val); \ | ||
826 | __ehb(); \ | ||
827 | } while (0) | ||
828 | #else | ||
829 | /* | ||
830 | * Legacy non-SMTC code, which may be hazardous | ||
831 | * but which might not support EHB | ||
832 | */ | ||
833 | #define write_c0_status(val) __write_32bit_c0_register($12, 0, val) | ||
834 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
835 | |||
836 | #define read_c0_cause() __read_32bit_c0_register($13, 0) | ||
837 | #define write_c0_cause(val) __write_32bit_c0_register($13, 0, val) | ||
838 | |||
839 | #define read_c0_epc() __read_ulong_c0_register($14, 0) | ||
840 | #define write_c0_epc(val) __write_ulong_c0_register($14, 0, val) | ||
841 | |||
842 | #define read_c0_prid() __read_32bit_c0_register($15, 0) | ||
843 | |||
844 | #define read_c0_config() __read_32bit_c0_register($16, 0) | ||
845 | #define read_c0_config1() __read_32bit_c0_register($16, 1) | ||
846 | #define read_c0_config2() __read_32bit_c0_register($16, 2) | ||
847 | #define read_c0_config3() __read_32bit_c0_register($16, 3) | ||
848 | #define read_c0_config4() __read_32bit_c0_register($16, 4) | ||
849 | #define read_c0_config5() __read_32bit_c0_register($16, 5) | ||
850 | #define read_c0_config6() __read_32bit_c0_register($16, 6) | ||
851 | #define read_c0_config7() __read_32bit_c0_register($16, 7) | ||
852 | #define write_c0_config(val) __write_32bit_c0_register($16, 0, val) | ||
853 | #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val) | ||
854 | #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val) | ||
855 | #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val) | ||
856 | #define write_c0_config4(val) __write_32bit_c0_register($16, 4, val) | ||
857 | #define write_c0_config5(val) __write_32bit_c0_register($16, 5, val) | ||
858 | #define write_c0_config6(val) __write_32bit_c0_register($16, 6, val) | ||
859 | #define write_c0_config7(val) __write_32bit_c0_register($16, 7, val) | ||
860 | |||
861 | /* | ||
862 | * The WatchLo register. There may be upto 8 of them. | ||
863 | */ | ||
864 | #define read_c0_watchlo0() __read_ulong_c0_register($18, 0) | ||
865 | #define read_c0_watchlo1() __read_ulong_c0_register($18, 1) | ||
866 | #define read_c0_watchlo2() __read_ulong_c0_register($18, 2) | ||
867 | #define read_c0_watchlo3() __read_ulong_c0_register($18, 3) | ||
868 | #define read_c0_watchlo4() __read_ulong_c0_register($18, 4) | ||
869 | #define read_c0_watchlo5() __read_ulong_c0_register($18, 5) | ||
870 | #define read_c0_watchlo6() __read_ulong_c0_register($18, 6) | ||
871 | #define read_c0_watchlo7() __read_ulong_c0_register($18, 7) | ||
872 | #define write_c0_watchlo0(val) __write_ulong_c0_register($18, 0, val) | ||
873 | #define write_c0_watchlo1(val) __write_ulong_c0_register($18, 1, val) | ||
874 | #define write_c0_watchlo2(val) __write_ulong_c0_register($18, 2, val) | ||
875 | #define write_c0_watchlo3(val) __write_ulong_c0_register($18, 3, val) | ||
876 | #define write_c0_watchlo4(val) __write_ulong_c0_register($18, 4, val) | ||
877 | #define write_c0_watchlo5(val) __write_ulong_c0_register($18, 5, val) | ||
878 | #define write_c0_watchlo6(val) __write_ulong_c0_register($18, 6, val) | ||
879 | #define write_c0_watchlo7(val) __write_ulong_c0_register($18, 7, val) | ||
880 | |||
881 | /* | ||
882 | * The WatchHi register. There may be upto 8 of them. | ||
883 | */ | ||
884 | #define read_c0_watchhi0() __read_32bit_c0_register($19, 0) | ||
885 | #define read_c0_watchhi1() __read_32bit_c0_register($19, 1) | ||
886 | #define read_c0_watchhi2() __read_32bit_c0_register($19, 2) | ||
887 | #define read_c0_watchhi3() __read_32bit_c0_register($19, 3) | ||
888 | #define read_c0_watchhi4() __read_32bit_c0_register($19, 4) | ||
889 | #define read_c0_watchhi5() __read_32bit_c0_register($19, 5) | ||
890 | #define read_c0_watchhi6() __read_32bit_c0_register($19, 6) | ||
891 | #define read_c0_watchhi7() __read_32bit_c0_register($19, 7) | ||
892 | |||
893 | #define write_c0_watchhi0(val) __write_32bit_c0_register($19, 0, val) | ||
894 | #define write_c0_watchhi1(val) __write_32bit_c0_register($19, 1, val) | ||
895 | #define write_c0_watchhi2(val) __write_32bit_c0_register($19, 2, val) | ||
896 | #define write_c0_watchhi3(val) __write_32bit_c0_register($19, 3, val) | ||
897 | #define write_c0_watchhi4(val) __write_32bit_c0_register($19, 4, val) | ||
898 | #define write_c0_watchhi5(val) __write_32bit_c0_register($19, 5, val) | ||
899 | #define write_c0_watchhi6(val) __write_32bit_c0_register($19, 6, val) | ||
900 | #define write_c0_watchhi7(val) __write_32bit_c0_register($19, 7, val) | ||
901 | |||
902 | #define read_c0_xcontext() __read_ulong_c0_register($20, 0) | ||
903 | #define write_c0_xcontext(val) __write_ulong_c0_register($20, 0, val) | ||
904 | |||
905 | #define read_c0_intcontrol() __read_32bit_c0_ctrl_register($20) | ||
906 | #define write_c0_intcontrol(val) __write_32bit_c0_ctrl_register($20, val) | ||
907 | |||
908 | #define read_c0_framemask() __read_32bit_c0_register($21, 0) | ||
909 | #define write_c0_framemask(val) __write_32bit_c0_register($21, 0, val) | ||
910 | |||
911 | /* RM9000 PerfControl performance counter control register */ | ||
912 | #define read_c0_perfcontrol() __read_32bit_c0_register($22, 0) | ||
913 | #define write_c0_perfcontrol(val) __write_32bit_c0_register($22, 0, val) | ||
914 | |||
915 | #define read_c0_diag() __read_32bit_c0_register($22, 0) | ||
916 | #define write_c0_diag(val) __write_32bit_c0_register($22, 0, val) | ||
917 | |||
918 | #define read_c0_diag1() __read_32bit_c0_register($22, 1) | ||
919 | #define write_c0_diag1(val) __write_32bit_c0_register($22, 1, val) | ||
920 | |||
921 | #define read_c0_diag2() __read_32bit_c0_register($22, 2) | ||
922 | #define write_c0_diag2(val) __write_32bit_c0_register($22, 2, val) | ||
923 | |||
924 | #define read_c0_diag3() __read_32bit_c0_register($22, 3) | ||
925 | #define write_c0_diag3(val) __write_32bit_c0_register($22, 3, val) | ||
926 | |||
927 | #define read_c0_diag4() __read_32bit_c0_register($22, 4) | ||
928 | #define write_c0_diag4(val) __write_32bit_c0_register($22, 4, val) | ||
929 | |||
930 | #define read_c0_diag5() __read_32bit_c0_register($22, 5) | ||
931 | #define write_c0_diag5(val) __write_32bit_c0_register($22, 5, val) | ||
932 | |||
933 | #define read_c0_debug() __read_32bit_c0_register($23, 0) | ||
934 | #define write_c0_debug(val) __write_32bit_c0_register($23, 0, val) | ||
935 | |||
936 | #define read_c0_depc() __read_ulong_c0_register($24, 0) | ||
937 | #define write_c0_depc(val) __write_ulong_c0_register($24, 0, val) | ||
938 | |||
939 | /* | ||
940 | * MIPS32 / MIPS64 performance counters | ||
941 | */ | ||
942 | #define read_c0_perfctrl0() __read_32bit_c0_register($25, 0) | ||
943 | #define write_c0_perfctrl0(val) __write_32bit_c0_register($25, 0, val) | ||
944 | #define read_c0_perfcntr0() __read_32bit_c0_register($25, 1) | ||
945 | #define write_c0_perfcntr0(val) __write_32bit_c0_register($25, 1, val) | ||
946 | #define read_c0_perfctrl1() __read_32bit_c0_register($25, 2) | ||
947 | #define write_c0_perfctrl1(val) __write_32bit_c0_register($25, 2, val) | ||
948 | #define read_c0_perfcntr1() __read_32bit_c0_register($25, 3) | ||
949 | #define write_c0_perfcntr1(val) __write_32bit_c0_register($25, 3, val) | ||
950 | #define read_c0_perfctrl2() __read_32bit_c0_register($25, 4) | ||
951 | #define write_c0_perfctrl2(val) __write_32bit_c0_register($25, 4, val) | ||
952 | #define read_c0_perfcntr2() __read_32bit_c0_register($25, 5) | ||
953 | #define write_c0_perfcntr2(val) __write_32bit_c0_register($25, 5, val) | ||
954 | #define read_c0_perfctrl3() __read_32bit_c0_register($25, 6) | ||
955 | #define write_c0_perfctrl3(val) __write_32bit_c0_register($25, 6, val) | ||
956 | #define read_c0_perfcntr3() __read_32bit_c0_register($25, 7) | ||
957 | #define write_c0_perfcntr3(val) __write_32bit_c0_register($25, 7, val) | ||
958 | |||
959 | /* RM9000 PerfCount performance counter register */ | ||
960 | #define read_c0_perfcount() __read_64bit_c0_register($25, 0) | ||
961 | #define write_c0_perfcount(val) __write_64bit_c0_register($25, 0, val) | ||
962 | |||
963 | #define read_c0_ecc() __read_32bit_c0_register($26, 0) | ||
964 | #define write_c0_ecc(val) __write_32bit_c0_register($26, 0, val) | ||
965 | |||
966 | #define read_c0_derraddr0() __read_ulong_c0_register($26, 1) | ||
967 | #define write_c0_derraddr0(val) __write_ulong_c0_register($26, 1, val) | ||
968 | |||
969 | #define read_c0_cacheerr() __read_32bit_c0_register($27, 0) | ||
970 | |||
971 | #define read_c0_derraddr1() __read_ulong_c0_register($27, 1) | ||
972 | #define write_c0_derraddr1(val) __write_ulong_c0_register($27, 1, val) | ||
973 | |||
974 | #define read_c0_taglo() __read_32bit_c0_register($28, 0) | ||
975 | #define write_c0_taglo(val) __write_32bit_c0_register($28, 0, val) | ||
976 | |||
977 | #define read_c0_dtaglo() __read_32bit_c0_register($28, 2) | ||
978 | #define write_c0_dtaglo(val) __write_32bit_c0_register($28, 2, val) | ||
979 | |||
980 | #define read_c0_taghi() __read_32bit_c0_register($29, 0) | ||
981 | #define write_c0_taghi(val) __write_32bit_c0_register($29, 0, val) | ||
982 | |||
983 | #define read_c0_errorepc() __read_ulong_c0_register($30, 0) | ||
984 | #define write_c0_errorepc(val) __write_ulong_c0_register($30, 0, val) | ||
985 | |||
986 | /* MIPSR2 */ | ||
987 | #define read_c0_hwrena() __read_32bit_c0_register($7, 0) | ||
988 | #define write_c0_hwrena(val) __write_32bit_c0_register($7, 0, val) | ||
989 | |||
990 | #define read_c0_intctl() __read_32bit_c0_register($12, 1) | ||
991 | #define write_c0_intctl(val) __write_32bit_c0_register($12, 1, val) | ||
992 | |||
993 | #define read_c0_srsctl() __read_32bit_c0_register($12, 2) | ||
994 | #define write_c0_srsctl(val) __write_32bit_c0_register($12, 2, val) | ||
995 | |||
996 | #define read_c0_srsmap() __read_32bit_c0_register($12, 3) | ||
997 | #define write_c0_srsmap(val) __write_32bit_c0_register($12, 3, val) | ||
998 | |||
999 | #define read_c0_ebase() __read_32bit_c0_register($15, 1) | ||
1000 | #define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val) | ||
1001 | |||
1002 | /* | ||
1003 | * Macros to access the floating point coprocessor control registers | ||
1004 | */ | ||
1005 | #define read_32bit_cp1_register(source) \ | ||
1006 | ({ int __res; \ | ||
1007 | __asm__ __volatile__( \ | ||
1008 | ".set\tpush\n\t" \ | ||
1009 | ".set\treorder\n\t" \ | ||
1010 | "cfc1\t%0,"STR(source)"\n\t" \ | ||
1011 | ".set\tpop" \ | ||
1012 | : "=r" (__res)); \ | ||
1013 | __res;}) | ||
1014 | |||
1015 | #define rddsp(mask) \ | ||
1016 | ({ \ | ||
1017 | unsigned int __res; \ | ||
1018 | \ | ||
1019 | __asm__ __volatile__( \ | ||
1020 | " .set push \n" \ | ||
1021 | " .set noat \n" \ | ||
1022 | " # rddsp $1, %x1 \n" \ | ||
1023 | " .word 0x7c000cb8 | (%x1 << 16) \n" \ | ||
1024 | " move %0, $1 \n" \ | ||
1025 | " .set pop \n" \ | ||
1026 | : "=r" (__res) \ | ||
1027 | : "i" (mask)); \ | ||
1028 | __res; \ | ||
1029 | }) | ||
1030 | |||
1031 | #define wrdsp(val, mask) \ | ||
1032 | do { \ | ||
1033 | __asm__ __volatile__( \ | ||
1034 | " .set push \n" \ | ||
1035 | " .set noat \n" \ | ||
1036 | " move $1, %0 \n" \ | ||
1037 | " # wrdsp $1, %x1 \n" \ | ||
1038 | " .word 0x7c2004f8 | (%x1 << 11) \n" \ | ||
1039 | " .set pop \n" \ | ||
1040 | : \ | ||
1041 | : "r" (val), "i" (mask)); \ | ||
1042 | } while (0) | ||
1043 | |||
1044 | #if 0 /* Need DSP ASE capable assembler ... */ | ||
1045 | #define mflo0() ({ long mflo0; __asm__("mflo %0, $ac0" : "=r" (mflo0)); mflo0;}) | ||
1046 | #define mflo1() ({ long mflo1; __asm__("mflo %0, $ac1" : "=r" (mflo1)); mflo1;}) | ||
1047 | #define mflo2() ({ long mflo2; __asm__("mflo %0, $ac2" : "=r" (mflo2)); mflo2;}) | ||
1048 | #define mflo3() ({ long mflo3; __asm__("mflo %0, $ac3" : "=r" (mflo3)); mflo3;}) | ||
1049 | |||
1050 | #define mfhi0() ({ long mfhi0; __asm__("mfhi %0, $ac0" : "=r" (mfhi0)); mfhi0;}) | ||
1051 | #define mfhi1() ({ long mfhi1; __asm__("mfhi %0, $ac1" : "=r" (mfhi1)); mfhi1;}) | ||
1052 | #define mfhi2() ({ long mfhi2; __asm__("mfhi %0, $ac2" : "=r" (mfhi2)); mfhi2;}) | ||
1053 | #define mfhi3() ({ long mfhi3; __asm__("mfhi %0, $ac3" : "=r" (mfhi3)); mfhi3;}) | ||
1054 | |||
1055 | #define mtlo0(x) __asm__("mtlo %0, $ac0" ::"r" (x)) | ||
1056 | #define mtlo1(x) __asm__("mtlo %0, $ac1" ::"r" (x)) | ||
1057 | #define mtlo2(x) __asm__("mtlo %0, $ac2" ::"r" (x)) | ||
1058 | #define mtlo3(x) __asm__("mtlo %0, $ac3" ::"r" (x)) | ||
1059 | |||
1060 | #define mthi0(x) __asm__("mthi %0, $ac0" ::"r" (x)) | ||
1061 | #define mthi1(x) __asm__("mthi %0, $ac1" ::"r" (x)) | ||
1062 | #define mthi2(x) __asm__("mthi %0, $ac2" ::"r" (x)) | ||
1063 | #define mthi3(x) __asm__("mthi %0, $ac3" ::"r" (x)) | ||
1064 | |||
1065 | #else | ||
1066 | |||
1067 | #define mfhi0() \ | ||
1068 | ({ \ | ||
1069 | unsigned long __treg; \ | ||
1070 | \ | ||
1071 | __asm__ __volatile__( \ | ||
1072 | " .set push \n" \ | ||
1073 | " .set noat \n" \ | ||
1074 | " # mfhi %0, $ac0 \n" \ | ||
1075 | " .word 0x00000810 \n" \ | ||
1076 | " move %0, $1 \n" \ | ||
1077 | " .set pop \n" \ | ||
1078 | : "=r" (__treg)); \ | ||
1079 | __treg; \ | ||
1080 | }) | ||
1081 | |||
1082 | #define mfhi1() \ | ||
1083 | ({ \ | ||
1084 | unsigned long __treg; \ | ||
1085 | \ | ||
1086 | __asm__ __volatile__( \ | ||
1087 | " .set push \n" \ | ||
1088 | " .set noat \n" \ | ||
1089 | " # mfhi %0, $ac1 \n" \ | ||
1090 | " .word 0x00200810 \n" \ | ||
1091 | " move %0, $1 \n" \ | ||
1092 | " .set pop \n" \ | ||
1093 | : "=r" (__treg)); \ | ||
1094 | __treg; \ | ||
1095 | }) | ||
1096 | |||
1097 | #define mfhi2() \ | ||
1098 | ({ \ | ||
1099 | unsigned long __treg; \ | ||
1100 | \ | ||
1101 | __asm__ __volatile__( \ | ||
1102 | " .set push \n" \ | ||
1103 | " .set noat \n" \ | ||
1104 | " # mfhi %0, $ac2 \n" \ | ||
1105 | " .word 0x00400810 \n" \ | ||
1106 | " move %0, $1 \n" \ | ||
1107 | " .set pop \n" \ | ||
1108 | : "=r" (__treg)); \ | ||
1109 | __treg; \ | ||
1110 | }) | ||
1111 | |||
1112 | #define mfhi3() \ | ||
1113 | ({ \ | ||
1114 | unsigned long __treg; \ | ||
1115 | \ | ||
1116 | __asm__ __volatile__( \ | ||
1117 | " .set push \n" \ | ||
1118 | " .set noat \n" \ | ||
1119 | " # mfhi %0, $ac3 \n" \ | ||
1120 | " .word 0x00600810 \n" \ | ||
1121 | " move %0, $1 \n" \ | ||
1122 | " .set pop \n" \ | ||
1123 | : "=r" (__treg)); \ | ||
1124 | __treg; \ | ||
1125 | }) | ||
1126 | |||
1127 | #define mflo0() \ | ||
1128 | ({ \ | ||
1129 | unsigned long __treg; \ | ||
1130 | \ | ||
1131 | __asm__ __volatile__( \ | ||
1132 | " .set push \n" \ | ||
1133 | " .set noat \n" \ | ||
1134 | " # mflo %0, $ac0 \n" \ | ||
1135 | " .word 0x00000812 \n" \ | ||
1136 | " move %0, $1 \n" \ | ||
1137 | " .set pop \n" \ | ||
1138 | : "=r" (__treg)); \ | ||
1139 | __treg; \ | ||
1140 | }) | ||
1141 | |||
1142 | #define mflo1() \ | ||
1143 | ({ \ | ||
1144 | unsigned long __treg; \ | ||
1145 | \ | ||
1146 | __asm__ __volatile__( \ | ||
1147 | " .set push \n" \ | ||
1148 | " .set noat \n" \ | ||
1149 | " # mflo %0, $ac1 \n" \ | ||
1150 | " .word 0x00200812 \n" \ | ||
1151 | " move %0, $1 \n" \ | ||
1152 | " .set pop \n" \ | ||
1153 | : "=r" (__treg)); \ | ||
1154 | __treg; \ | ||
1155 | }) | ||
1156 | |||
1157 | #define mflo2() \ | ||
1158 | ({ \ | ||
1159 | unsigned long __treg; \ | ||
1160 | \ | ||
1161 | __asm__ __volatile__( \ | ||
1162 | " .set push \n" \ | ||
1163 | " .set noat \n" \ | ||
1164 | " # mflo %0, $ac2 \n" \ | ||
1165 | " .word 0x00400812 \n" \ | ||
1166 | " move %0, $1 \n" \ | ||
1167 | " .set pop \n" \ | ||
1168 | : "=r" (__treg)); \ | ||
1169 | __treg; \ | ||
1170 | }) | ||
1171 | |||
1172 | #define mflo3() \ | ||
1173 | ({ \ | ||
1174 | unsigned long __treg; \ | ||
1175 | \ | ||
1176 | __asm__ __volatile__( \ | ||
1177 | " .set push \n" \ | ||
1178 | " .set noat \n" \ | ||
1179 | " # mflo %0, $ac3 \n" \ | ||
1180 | " .word 0x00600812 \n" \ | ||
1181 | " move %0, $1 \n" \ | ||
1182 | " .set pop \n" \ | ||
1183 | : "=r" (__treg)); \ | ||
1184 | __treg; \ | ||
1185 | }) | ||
1186 | |||
1187 | #define mthi0(x) \ | ||
1188 | do { \ | ||
1189 | __asm__ __volatile__( \ | ||
1190 | " .set push \n" \ | ||
1191 | " .set noat \n" \ | ||
1192 | " move $1, %0 \n" \ | ||
1193 | " # mthi $1, $ac0 \n" \ | ||
1194 | " .word 0x00200011 \n" \ | ||
1195 | " .set pop \n" \ | ||
1196 | : \ | ||
1197 | : "r" (x)); \ | ||
1198 | } while (0) | ||
1199 | |||
1200 | #define mthi1(x) \ | ||
1201 | do { \ | ||
1202 | __asm__ __volatile__( \ | ||
1203 | " .set push \n" \ | ||
1204 | " .set noat \n" \ | ||
1205 | " move $1, %0 \n" \ | ||
1206 | " # mthi $1, $ac1 \n" \ | ||
1207 | " .word 0x00200811 \n" \ | ||
1208 | " .set pop \n" \ | ||
1209 | : \ | ||
1210 | : "r" (x)); \ | ||
1211 | } while (0) | ||
1212 | |||
1213 | #define mthi2(x) \ | ||
1214 | do { \ | ||
1215 | __asm__ __volatile__( \ | ||
1216 | " .set push \n" \ | ||
1217 | " .set noat \n" \ | ||
1218 | " move $1, %0 \n" \ | ||
1219 | " # mthi $1, $ac2 \n" \ | ||
1220 | " .word 0x00201011 \n" \ | ||
1221 | " .set pop \n" \ | ||
1222 | : \ | ||
1223 | : "r" (x)); \ | ||
1224 | } while (0) | ||
1225 | |||
1226 | #define mthi3(x) \ | ||
1227 | do { \ | ||
1228 | __asm__ __volatile__( \ | ||
1229 | " .set push \n" \ | ||
1230 | " .set noat \n" \ | ||
1231 | " move $1, %0 \n" \ | ||
1232 | " # mthi $1, $ac3 \n" \ | ||
1233 | " .word 0x00201811 \n" \ | ||
1234 | " .set pop \n" \ | ||
1235 | : \ | ||
1236 | : "r" (x)); \ | ||
1237 | } while (0) | ||
1238 | |||
1239 | #define mtlo0(x) \ | ||
1240 | do { \ | ||
1241 | __asm__ __volatile__( \ | ||
1242 | " .set push \n" \ | ||
1243 | " .set noat \n" \ | ||
1244 | " move $1, %0 \n" \ | ||
1245 | " # mtlo $1, $ac0 \n" \ | ||
1246 | " .word 0x00200013 \n" \ | ||
1247 | " .set pop \n" \ | ||
1248 | : \ | ||
1249 | : "r" (x)); \ | ||
1250 | } while (0) | ||
1251 | |||
1252 | #define mtlo1(x) \ | ||
1253 | do { \ | ||
1254 | __asm__ __volatile__( \ | ||
1255 | " .set push \n" \ | ||
1256 | " .set noat \n" \ | ||
1257 | " move $1, %0 \n" \ | ||
1258 | " # mtlo $1, $ac1 \n" \ | ||
1259 | " .word 0x00200813 \n" \ | ||
1260 | " .set pop \n" \ | ||
1261 | : \ | ||
1262 | : "r" (x)); \ | ||
1263 | } while (0) | ||
1264 | |||
1265 | #define mtlo2(x) \ | ||
1266 | do { \ | ||
1267 | __asm__ __volatile__( \ | ||
1268 | " .set push \n" \ | ||
1269 | " .set noat \n" \ | ||
1270 | " move $1, %0 \n" \ | ||
1271 | " # mtlo $1, $ac2 \n" \ | ||
1272 | " .word 0x00201013 \n" \ | ||
1273 | " .set pop \n" \ | ||
1274 | : \ | ||
1275 | : "r" (x)); \ | ||
1276 | } while (0) | ||
1277 | |||
1278 | #define mtlo3(x) \ | ||
1279 | do { \ | ||
1280 | __asm__ __volatile__( \ | ||
1281 | " .set push \n" \ | ||
1282 | " .set noat \n" \ | ||
1283 | " move $1, %0 \n" \ | ||
1284 | " # mtlo $1, $ac3 \n" \ | ||
1285 | " .word 0x00201813 \n" \ | ||
1286 | " .set pop \n" \ | ||
1287 | : \ | ||
1288 | : "r" (x)); \ | ||
1289 | } while (0) | ||
1290 | |||
1291 | #endif | ||
1292 | |||
1293 | /* | ||
1294 | * TLB operations. | ||
1295 | * | ||
1296 | * It is responsibility of the caller to take care of any TLB hazards. | ||
1297 | */ | ||
1298 | static inline void tlb_probe(void) | ||
1299 | { | ||
1300 | __asm__ __volatile__( | ||
1301 | ".set noreorder\n\t" | ||
1302 | "tlbp\n\t" | ||
1303 | ".set reorder"); | ||
1304 | } | ||
1305 | |||
1306 | static inline void tlb_read(void) | ||
1307 | { | ||
1308 | #if MIPS34K_MISSED_ITLB_WAR | ||
1309 | int res = 0; | ||
1310 | |||
1311 | __asm__ __volatile__( | ||
1312 | " .set push \n" | ||
1313 | " .set noreorder \n" | ||
1314 | " .set noat \n" | ||
1315 | " .set mips32r2 \n" | ||
1316 | " .word 0x41610001 # dvpe $1 \n" | ||
1317 | " move %0, $1 \n" | ||
1318 | " ehb \n" | ||
1319 | " .set pop \n" | ||
1320 | : "=r" (res)); | ||
1321 | |||
1322 | instruction_hazard(); | ||
1323 | #endif | ||
1324 | |||
1325 | __asm__ __volatile__( | ||
1326 | ".set noreorder\n\t" | ||
1327 | "tlbr\n\t" | ||
1328 | ".set reorder"); | ||
1329 | |||
1330 | #if MIPS34K_MISSED_ITLB_WAR | ||
1331 | if ((res & _ULCAST_(1))) | ||
1332 | __asm__ __volatile__( | ||
1333 | " .set push \n" | ||
1334 | " .set noreorder \n" | ||
1335 | " .set noat \n" | ||
1336 | " .set mips32r2 \n" | ||
1337 | " .word 0x41600021 # evpe \n" | ||
1338 | " ehb \n" | ||
1339 | " .set pop \n"); | ||
1340 | #endif | ||
1341 | } | ||
1342 | |||
1343 | static inline void tlb_write_indexed(void) | ||
1344 | { | ||
1345 | __asm__ __volatile__( | ||
1346 | ".set noreorder\n\t" | ||
1347 | "tlbwi\n\t" | ||
1348 | ".set reorder"); | ||
1349 | } | ||
1350 | |||
1351 | static inline void tlb_write_random(void) | ||
1352 | { | ||
1353 | __asm__ __volatile__( | ||
1354 | ".set noreorder\n\t" | ||
1355 | "tlbwr\n\t" | ||
1356 | ".set reorder"); | ||
1357 | } | ||
1358 | |||
1359 | /* | ||
1360 | * Manipulate bits in a c0 register. | ||
1361 | */ | ||
1362 | #ifndef CONFIG_MIPS_MT_SMTC | ||
1363 | /* | ||
1364 | * SMTC Linux requires shutting-down microthread scheduling | ||
1365 | * during CP0 register read-modify-write sequences. | ||
1366 | */ | ||
1367 | #define __BUILD_SET_C0(name) \ | ||
1368 | static inline unsigned int \ | ||
1369 | set_c0_##name(unsigned int set) \ | ||
1370 | { \ | ||
1371 | unsigned int res; \ | ||
1372 | \ | ||
1373 | res = read_c0_##name(); \ | ||
1374 | res |= set; \ | ||
1375 | write_c0_##name(res); \ | ||
1376 | \ | ||
1377 | return res; \ | ||
1378 | } \ | ||
1379 | \ | ||
1380 | static inline unsigned int \ | ||
1381 | clear_c0_##name(unsigned int clear) \ | ||
1382 | { \ | ||
1383 | unsigned int res; \ | ||
1384 | \ | ||
1385 | res = read_c0_##name(); \ | ||
1386 | res &= ~clear; \ | ||
1387 | write_c0_##name(res); \ | ||
1388 | \ | ||
1389 | return res; \ | ||
1390 | } \ | ||
1391 | \ | ||
1392 | static inline unsigned int \ | ||
1393 | change_c0_##name(unsigned int change, unsigned int new) \ | ||
1394 | { \ | ||
1395 | unsigned int res; \ | ||
1396 | \ | ||
1397 | res = read_c0_##name(); \ | ||
1398 | res &= ~change; \ | ||
1399 | res |= (new & change); \ | ||
1400 | write_c0_##name(res); \ | ||
1401 | \ | ||
1402 | return res; \ | ||
1403 | } | ||
1404 | |||
1405 | #else /* SMTC versions that manage MT scheduling */ | ||
1406 | |||
1407 | #include <linux/irqflags.h> | ||
1408 | |||
1409 | /* | ||
1410 | * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with | ||
1411 | * header file recursion. | ||
1412 | */ | ||
1413 | static inline unsigned int __dmt(void) | ||
1414 | { | ||
1415 | int res; | ||
1416 | |||
1417 | __asm__ __volatile__( | ||
1418 | " .set push \n" | ||
1419 | " .set mips32r2 \n" | ||
1420 | " .set noat \n" | ||
1421 | " .word 0x41610BC1 # dmt $1 \n" | ||
1422 | " ehb \n" | ||
1423 | " move %0, $1 \n" | ||
1424 | " .set pop \n" | ||
1425 | : "=r" (res)); | ||
1426 | |||
1427 | instruction_hazard(); | ||
1428 | |||
1429 | return res; | ||
1430 | } | ||
1431 | |||
1432 | #define __VPECONTROL_TE_SHIFT 15 | ||
1433 | #define __VPECONTROL_TE (1UL << __VPECONTROL_TE_SHIFT) | ||
1434 | |||
1435 | #define __EMT_ENABLE __VPECONTROL_TE | ||
1436 | |||
1437 | static inline void __emt(unsigned int previous) | ||
1438 | { | ||
1439 | if ((previous & __EMT_ENABLE)) | ||
1440 | __asm__ __volatile__( | ||
1441 | " .set mips32r2 \n" | ||
1442 | " .word 0x41600be1 # emt \n" | ||
1443 | " ehb \n" | ||
1444 | " .set mips0 \n"); | ||
1445 | } | ||
1446 | |||
1447 | static inline void __ehb(void) | ||
1448 | { | ||
1449 | __asm__ __volatile__( | ||
1450 | " .set mips32r2 \n" | ||
1451 | " ehb \n" " .set mips0 \n"); | ||
1452 | } | ||
1453 | |||
1454 | /* | ||
1455 | * Note that local_irq_save/restore affect TC-specific IXMT state, | ||
1456 | * not Status.IE as in non-SMTC kernel. | ||
1457 | */ | ||
1458 | |||
1459 | #define __BUILD_SET_C0(name) \ | ||
1460 | static inline unsigned int \ | ||
1461 | set_c0_##name(unsigned int set) \ | ||
1462 | { \ | ||
1463 | unsigned int res; \ | ||
1464 | unsigned int omt; \ | ||
1465 | unsigned long flags; \ | ||
1466 | \ | ||
1467 | local_irq_save(flags); \ | ||
1468 | omt = __dmt(); \ | ||
1469 | res = read_c0_##name(); \ | ||
1470 | res |= set; \ | ||
1471 | write_c0_##name(res); \ | ||
1472 | __emt(omt); \ | ||
1473 | local_irq_restore(flags); \ | ||
1474 | \ | ||
1475 | return res; \ | ||
1476 | } \ | ||
1477 | \ | ||
1478 | static inline unsigned int \ | ||
1479 | clear_c0_##name(unsigned int clear) \ | ||
1480 | { \ | ||
1481 | unsigned int res; \ | ||
1482 | unsigned int omt; \ | ||
1483 | unsigned long flags; \ | ||
1484 | \ | ||
1485 | local_irq_save(flags); \ | ||
1486 | omt = __dmt(); \ | ||
1487 | res = read_c0_##name(); \ | ||
1488 | res &= ~clear; \ | ||
1489 | write_c0_##name(res); \ | ||
1490 | __emt(omt); \ | ||
1491 | local_irq_restore(flags); \ | ||
1492 | \ | ||
1493 | return res; \ | ||
1494 | } \ | ||
1495 | \ | ||
1496 | static inline unsigned int \ | ||
1497 | change_c0_##name(unsigned int change, unsigned int new) \ | ||
1498 | { \ | ||
1499 | unsigned int res; \ | ||
1500 | unsigned int omt; \ | ||
1501 | unsigned long flags; \ | ||
1502 | \ | ||
1503 | local_irq_save(flags); \ | ||
1504 | \ | ||
1505 | omt = __dmt(); \ | ||
1506 | res = read_c0_##name(); \ | ||
1507 | res &= ~change; \ | ||
1508 | res |= (new & change); \ | ||
1509 | write_c0_##name(res); \ | ||
1510 | __emt(omt); \ | ||
1511 | local_irq_restore(flags); \ | ||
1512 | \ | ||
1513 | return res; \ | ||
1514 | } | ||
1515 | #endif | ||
1516 | |||
1517 | __BUILD_SET_C0(status) | ||
1518 | __BUILD_SET_C0(cause) | ||
1519 | __BUILD_SET_C0(config) | ||
1520 | __BUILD_SET_C0(intcontrol) | ||
1521 | __BUILD_SET_C0(intctl) | ||
1522 | __BUILD_SET_C0(srsmap) | ||
1523 | |||
1524 | #endif /* !__ASSEMBLY__ */ | ||
1525 | |||
1526 | #endif /* _ASM_MIPSREGS_H */ | ||
diff --git a/include/asm-mips/mman.h b/include/asm-mips/mman.h deleted file mode 100644 index e4d6f1fb1cf7..000000000000 --- a/include/asm-mips/mman.h +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 1999, 2002 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_MMAN_H | ||
9 | #define _ASM_MMAN_H | ||
10 | |||
11 | /* | ||
12 | * Protections are chosen from these bits, OR'd together. The | ||
13 | * implementation does not necessarily support PROT_EXEC or PROT_WRITE | ||
14 | * without PROT_READ. The only guarantees are that no writing will be | ||
15 | * allowed without PROT_WRITE and no access will be allowed for PROT_NONE. | ||
16 | */ | ||
17 | #define PROT_NONE 0x00 /* page can not be accessed */ | ||
18 | #define PROT_READ 0x01 /* page can be read */ | ||
19 | #define PROT_WRITE 0x02 /* page can be written */ | ||
20 | #define PROT_EXEC 0x04 /* page can be executed */ | ||
21 | /* 0x08 reserved for PROT_EXEC_NOFLUSH */ | ||
22 | #define PROT_SEM 0x10 /* page may be used for atomic ops */ | ||
23 | #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ | ||
24 | #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ | ||
25 | |||
26 | /* | ||
27 | * Flags for mmap | ||
28 | */ | ||
29 | #define MAP_SHARED 0x001 /* Share changes */ | ||
30 | #define MAP_PRIVATE 0x002 /* Changes are private */ | ||
31 | #define MAP_TYPE 0x00f /* Mask for type of mapping */ | ||
32 | #define MAP_FIXED 0x010 /* Interpret addr exactly */ | ||
33 | |||
34 | /* not used by linux, but here to make sure we don't clash with ABI defines */ | ||
35 | #define MAP_RENAME 0x020 /* Assign page to file */ | ||
36 | #define MAP_AUTOGROW 0x040 /* File may grow by writing */ | ||
37 | #define MAP_LOCAL 0x080 /* Copy on fork/sproc */ | ||
38 | #define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */ | ||
39 | |||
40 | /* These are linux-specific */ | ||
41 | #define MAP_NORESERVE 0x0400 /* don't check for reservations */ | ||
42 | #define MAP_ANONYMOUS 0x0800 /* don't use a file */ | ||
43 | #define MAP_GROWSDOWN 0x1000 /* stack-like segment */ | ||
44 | #define MAP_DENYWRITE 0x2000 /* ETXTBSY */ | ||
45 | #define MAP_EXECUTABLE 0x4000 /* mark it as an executable */ | ||
46 | #define MAP_LOCKED 0x8000 /* pages are locked */ | ||
47 | #define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ | ||
48 | #define MAP_NONBLOCK 0x20000 /* do not block on IO */ | ||
49 | |||
50 | /* | ||
51 | * Flags for msync | ||
52 | */ | ||
53 | #define MS_ASYNC 0x0001 /* sync memory asynchronously */ | ||
54 | #define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */ | ||
55 | #define MS_SYNC 0x0004 /* synchronous memory sync */ | ||
56 | |||
57 | /* | ||
58 | * Flags for mlockall | ||
59 | */ | ||
60 | #define MCL_CURRENT 1 /* lock all current mappings */ | ||
61 | #define MCL_FUTURE 2 /* lock all future mappings */ | ||
62 | |||
63 | #define MADV_NORMAL 0 /* no further special treatment */ | ||
64 | #define MADV_RANDOM 1 /* expect random page references */ | ||
65 | #define MADV_SEQUENTIAL 2 /* expect sequential page references */ | ||
66 | #define MADV_WILLNEED 3 /* will need these pages */ | ||
67 | #define MADV_DONTNEED 4 /* don't need these pages */ | ||
68 | |||
69 | /* common parameters: try to keep these consistent across architectures */ | ||
70 | #define MADV_REMOVE 9 /* remove these pages & resources */ | ||
71 | #define MADV_DONTFORK 10 /* don't inherit across fork */ | ||
72 | #define MADV_DOFORK 11 /* do inherit across fork */ | ||
73 | |||
74 | /* compatibility flags */ | ||
75 | #define MAP_FILE 0 | ||
76 | |||
77 | #endif /* _ASM_MMAN_H */ | ||
diff --git a/include/asm-mips/mmu.h b/include/asm-mips/mmu.h deleted file mode 100644 index 4063edd79623..000000000000 --- a/include/asm-mips/mmu.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_MMU_H | ||
2 | #define __ASM_MMU_H | ||
3 | |||
4 | typedef unsigned long mm_context_t[NR_CPUS]; | ||
5 | |||
6 | #endif /* __ASM_MMU_H */ | ||
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h deleted file mode 100644 index 0c4f245eaeb2..000000000000 --- a/include/asm-mips/mmu_context.h +++ /dev/null | |||
@@ -1,297 +0,0 @@ | |||
1 | /* | ||
2 | * Switch a MMU context. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1996, 1997, 1998, 1999 by Ralf Baechle | ||
9 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
10 | */ | ||
11 | #ifndef _ASM_MMU_CONTEXT_H | ||
12 | #define _ASM_MMU_CONTEXT_H | ||
13 | |||
14 | #include <linux/errno.h> | ||
15 | #include <linux/sched.h> | ||
16 | #include <linux/slab.h> | ||
17 | #include <asm/cacheflush.h> | ||
18 | #include <asm/tlbflush.h> | ||
19 | #ifdef CONFIG_MIPS_MT_SMTC | ||
20 | #include <asm/mipsmtregs.h> | ||
21 | #include <asm/smtc.h> | ||
22 | #endif /* SMTC */ | ||
23 | #include <asm-generic/mm_hooks.h> | ||
24 | |||
25 | /* | ||
26 | * For the fast tlb miss handlers, we keep a per cpu array of pointers | ||
27 | * to the current pgd for each processor. Also, the proc. id is stuffed | ||
28 | * into the context register. | ||
29 | */ | ||
30 | extern unsigned long pgd_current[]; | ||
31 | |||
32 | #define TLBMISS_HANDLER_SETUP_PGD(pgd) \ | ||
33 | pgd_current[smp_processor_id()] = (unsigned long)(pgd) | ||
34 | |||
35 | #ifdef CONFIG_32BIT | ||
36 | #define TLBMISS_HANDLER_SETUP() \ | ||
37 | write_c0_context((unsigned long) smp_processor_id() << 25); \ | ||
38 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) | ||
39 | #endif | ||
40 | #ifdef CONFIG_64BIT | ||
41 | #define TLBMISS_HANDLER_SETUP() \ | ||
42 | write_c0_context((unsigned long) smp_processor_id() << 26); \ | ||
43 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) | ||
44 | #endif | ||
45 | |||
46 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
47 | |||
48 | #define ASID_INC 0x40 | ||
49 | #define ASID_MASK 0xfc0 | ||
50 | |||
51 | #elif defined(CONFIG_CPU_R8000) | ||
52 | |||
53 | #define ASID_INC 0x10 | ||
54 | #define ASID_MASK 0xff0 | ||
55 | |||
56 | #elif defined(CONFIG_CPU_RM9000) | ||
57 | |||
58 | #define ASID_INC 0x1 | ||
59 | #define ASID_MASK 0xfff | ||
60 | |||
61 | /* SMTC/34K debug hack - but maybe we'll keep it */ | ||
62 | #elif defined(CONFIG_MIPS_MT_SMTC) | ||
63 | |||
64 | #define ASID_INC 0x1 | ||
65 | extern unsigned long smtc_asid_mask; | ||
66 | #define ASID_MASK (smtc_asid_mask) | ||
67 | #define HW_ASID_MASK 0xff | ||
68 | /* End SMTC/34K debug hack */ | ||
69 | #else /* FIXME: not correct for R6000 */ | ||
70 | |||
71 | #define ASID_INC 0x1 | ||
72 | #define ASID_MASK 0xff | ||
73 | |||
74 | #endif | ||
75 | |||
76 | #define cpu_context(cpu, mm) ((mm)->context[cpu]) | ||
77 | #define cpu_asid(cpu, mm) (cpu_context((cpu), (mm)) & ASID_MASK) | ||
78 | #define asid_cache(cpu) (cpu_data[cpu].asid_cache) | ||
79 | |||
80 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | ||
81 | { | ||
82 | } | ||
83 | |||
84 | /* | ||
85 | * All unused by hardware upper bits will be considered | ||
86 | * as a software asid extension. | ||
87 | */ | ||
88 | #define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1))) | ||
89 | #define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1) | ||
90 | |||
91 | #ifndef CONFIG_MIPS_MT_SMTC | ||
92 | /* Normal, classic MIPS get_new_mmu_context */ | ||
93 | static inline void | ||
94 | get_new_mmu_context(struct mm_struct *mm, unsigned long cpu) | ||
95 | { | ||
96 | unsigned long asid = asid_cache(cpu); | ||
97 | |||
98 | if (! ((asid += ASID_INC) & ASID_MASK) ) { | ||
99 | if (cpu_has_vtag_icache) | ||
100 | flush_icache_all(); | ||
101 | local_flush_tlb_all(); /* start new asid cycle */ | ||
102 | if (!asid) /* fix version if needed */ | ||
103 | asid = ASID_FIRST_VERSION; | ||
104 | } | ||
105 | cpu_context(cpu, mm) = asid_cache(cpu) = asid; | ||
106 | } | ||
107 | |||
108 | #else /* CONFIG_MIPS_MT_SMTC */ | ||
109 | |||
110 | #define get_new_mmu_context(mm, cpu) smtc_get_new_mmu_context((mm), (cpu)) | ||
111 | |||
112 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
113 | |||
114 | /* | ||
115 | * Initialize the context related info for a new mm_struct | ||
116 | * instance. | ||
117 | */ | ||
118 | static inline int | ||
119 | init_new_context(struct task_struct *tsk, struct mm_struct *mm) | ||
120 | { | ||
121 | int i; | ||
122 | |||
123 | for_each_online_cpu(i) | ||
124 | cpu_context(i, mm) = 0; | ||
125 | |||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | ||
130 | struct task_struct *tsk) | ||
131 | { | ||
132 | unsigned int cpu = smp_processor_id(); | ||
133 | unsigned long flags; | ||
134 | #ifdef CONFIG_MIPS_MT_SMTC | ||
135 | unsigned long oldasid; | ||
136 | unsigned long mtflags; | ||
137 | int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id; | ||
138 | local_irq_save(flags); | ||
139 | mtflags = dvpe(); | ||
140 | #else /* Not SMTC */ | ||
141 | local_irq_save(flags); | ||
142 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
143 | |||
144 | /* Check if our ASID is of an older version and thus invalid */ | ||
145 | if ((cpu_context(cpu, next) ^ asid_cache(cpu)) & ASID_VERSION_MASK) | ||
146 | get_new_mmu_context(next, cpu); | ||
147 | #ifdef CONFIG_MIPS_MT_SMTC | ||
148 | /* | ||
149 | * If the EntryHi ASID being replaced happens to be | ||
150 | * the value flagged at ASID recycling time as having | ||
151 | * an extended life, clear the bit showing it being | ||
152 | * in use by this "CPU", and if that's the last bit, | ||
153 | * free up the ASID value for use and flush any old | ||
154 | * instances of it from the TLB. | ||
155 | */ | ||
156 | oldasid = (read_c0_entryhi() & ASID_MASK); | ||
157 | if(smtc_live_asid[mytlb][oldasid]) { | ||
158 | smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu); | ||
159 | if(smtc_live_asid[mytlb][oldasid] == 0) | ||
160 | smtc_flush_tlb_asid(oldasid); | ||
161 | } | ||
162 | /* | ||
163 | * Tread softly on EntryHi, and so long as we support | ||
164 | * having ASID_MASK smaller than the hardware maximum, | ||
165 | * make sure no "soft" bits become "hard"... | ||
166 | */ | ||
167 | write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) | ||
168 | | (cpu_context(cpu, next) & ASID_MASK)); | ||
169 | ehb(); /* Make sure it propagates to TCStatus */ | ||
170 | evpe(mtflags); | ||
171 | #else | ||
172 | write_c0_entryhi(cpu_context(cpu, next)); | ||
173 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
174 | TLBMISS_HANDLER_SETUP_PGD(next->pgd); | ||
175 | |||
176 | /* | ||
177 | * Mark current->active_mm as not "active" anymore. | ||
178 | * We don't want to mislead possible IPI tlb flush routines. | ||
179 | */ | ||
180 | cpu_clear(cpu, prev->cpu_vm_mask); | ||
181 | cpu_set(cpu, next->cpu_vm_mask); | ||
182 | |||
183 | local_irq_restore(flags); | ||
184 | } | ||
185 | |||
186 | /* | ||
187 | * Destroy context related info for an mm_struct that is about | ||
188 | * to be put to rest. | ||
189 | */ | ||
190 | static inline void destroy_context(struct mm_struct *mm) | ||
191 | { | ||
192 | } | ||
193 | |||
194 | #define deactivate_mm(tsk, mm) do { } while (0) | ||
195 | |||
196 | /* | ||
197 | * After we have set current->mm to a new value, this activates | ||
198 | * the context for the new mm so we see the new mappings. | ||
199 | */ | ||
200 | static inline void | ||
201 | activate_mm(struct mm_struct *prev, struct mm_struct *next) | ||
202 | { | ||
203 | unsigned long flags; | ||
204 | unsigned int cpu = smp_processor_id(); | ||
205 | |||
206 | #ifdef CONFIG_MIPS_MT_SMTC | ||
207 | unsigned long oldasid; | ||
208 | unsigned long mtflags; | ||
209 | int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id; | ||
210 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
211 | |||
212 | local_irq_save(flags); | ||
213 | |||
214 | /* Unconditionally get a new ASID. */ | ||
215 | get_new_mmu_context(next, cpu); | ||
216 | |||
217 | #ifdef CONFIG_MIPS_MT_SMTC | ||
218 | /* See comments for similar code above */ | ||
219 | mtflags = dvpe(); | ||
220 | oldasid = read_c0_entryhi() & ASID_MASK; | ||
221 | if(smtc_live_asid[mytlb][oldasid]) { | ||
222 | smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu); | ||
223 | if(smtc_live_asid[mytlb][oldasid] == 0) | ||
224 | smtc_flush_tlb_asid(oldasid); | ||
225 | } | ||
226 | /* See comments for similar code above */ | ||
227 | write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) | | ||
228 | (cpu_context(cpu, next) & ASID_MASK)); | ||
229 | ehb(); /* Make sure it propagates to TCStatus */ | ||
230 | evpe(mtflags); | ||
231 | #else | ||
232 | write_c0_entryhi(cpu_context(cpu, next)); | ||
233 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
234 | TLBMISS_HANDLER_SETUP_PGD(next->pgd); | ||
235 | |||
236 | /* mark mmu ownership change */ | ||
237 | cpu_clear(cpu, prev->cpu_vm_mask); | ||
238 | cpu_set(cpu, next->cpu_vm_mask); | ||
239 | |||
240 | local_irq_restore(flags); | ||
241 | } | ||
242 | |||
243 | /* | ||
244 | * If mm is currently active_mm, we can't really drop it. Instead, | ||
245 | * we will get a new one for it. | ||
246 | */ | ||
247 | static inline void | ||
248 | drop_mmu_context(struct mm_struct *mm, unsigned cpu) | ||
249 | { | ||
250 | unsigned long flags; | ||
251 | #ifdef CONFIG_MIPS_MT_SMTC | ||
252 | unsigned long oldasid; | ||
253 | /* Can't use spinlock because called from TLB flush within DVPE */ | ||
254 | unsigned int prevvpe; | ||
255 | int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id; | ||
256 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
257 | |||
258 | local_irq_save(flags); | ||
259 | |||
260 | if (cpu_isset(cpu, mm->cpu_vm_mask)) { | ||
261 | get_new_mmu_context(mm, cpu); | ||
262 | #ifdef CONFIG_MIPS_MT_SMTC | ||
263 | /* See comments for similar code above */ | ||
264 | prevvpe = dvpe(); | ||
265 | oldasid = (read_c0_entryhi() & ASID_MASK); | ||
266 | if (smtc_live_asid[mytlb][oldasid]) { | ||
267 | smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu); | ||
268 | if(smtc_live_asid[mytlb][oldasid] == 0) | ||
269 | smtc_flush_tlb_asid(oldasid); | ||
270 | } | ||
271 | /* See comments for similar code above */ | ||
272 | write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) | ||
273 | | cpu_asid(cpu, mm)); | ||
274 | ehb(); /* Make sure it propagates to TCStatus */ | ||
275 | evpe(prevvpe); | ||
276 | #else /* not CONFIG_MIPS_MT_SMTC */ | ||
277 | write_c0_entryhi(cpu_asid(cpu, mm)); | ||
278 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
279 | } else { | ||
280 | /* will get a new context next time */ | ||
281 | #ifndef CONFIG_MIPS_MT_SMTC | ||
282 | cpu_context(cpu, mm) = 0; | ||
283 | #else /* SMTC */ | ||
284 | int i; | ||
285 | |||
286 | /* SMTC shares the TLB (and ASIDs) across VPEs */ | ||
287 | for_each_online_cpu(i) { | ||
288 | if((smtc_status & SMTC_TLB_SHARED) | ||
289 | || (cpu_data[i].vpe_id == cpu_data[cpu].vpe_id)) | ||
290 | cpu_context(i, mm) = 0; | ||
291 | } | ||
292 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
293 | } | ||
294 | local_irq_restore(flags); | ||
295 | } | ||
296 | |||
297 | #endif /* _ASM_MMU_CONTEXT_H */ | ||
diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h deleted file mode 100644 index f53ec54c92ff..000000000000 --- a/include/asm-mips/mmzone.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* | ||
2 | * Written by Kanoj Sarcar (kanoj@sgi.com) Aug 99 | ||
3 | * Rewritten for Linux 2.6 by Christoph Hellwig (hch@lst.de) Jan 2004 | ||
4 | */ | ||
5 | #ifndef _ASM_MMZONE_H_ | ||
6 | #define _ASM_MMZONE_H_ | ||
7 | |||
8 | #include <asm/page.h> | ||
9 | #include <mmzone.h> | ||
10 | |||
11 | #ifdef CONFIG_DISCONTIGMEM | ||
12 | |||
13 | #define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT) | ||
14 | |||
15 | #endif /* CONFIG_DISCONTIGMEM */ | ||
16 | |||
17 | #endif /* _ASM_MMZONE_H_ */ | ||
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h deleted file mode 100644 index de6d09ebbd80..000000000000 --- a/include/asm-mips/module.h +++ /dev/null | |||
@@ -1,136 +0,0 @@ | |||
1 | #ifndef _ASM_MODULE_H | ||
2 | #define _ASM_MODULE_H | ||
3 | |||
4 | #include <linux/list.h> | ||
5 | #include <asm/uaccess.h> | ||
6 | |||
7 | struct mod_arch_specific { | ||
8 | /* Data Bus Error exception tables */ | ||
9 | struct list_head dbe_list; | ||
10 | const struct exception_table_entry *dbe_start; | ||
11 | const struct exception_table_entry *dbe_end; | ||
12 | }; | ||
13 | |||
14 | typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */ | ||
15 | |||
16 | typedef struct { | ||
17 | Elf64_Addr r_offset; /* Address of relocation. */ | ||
18 | Elf64_Word r_sym; /* Symbol index. */ | ||
19 | Elf64_Byte r_ssym; /* Special symbol. */ | ||
20 | Elf64_Byte r_type3; /* Third relocation. */ | ||
21 | Elf64_Byte r_type2; /* Second relocation. */ | ||
22 | Elf64_Byte r_type; /* First relocation. */ | ||
23 | } Elf64_Mips_Rel; | ||
24 | |||
25 | typedef struct { | ||
26 | Elf64_Addr r_offset; /* Address of relocation. */ | ||
27 | Elf64_Word r_sym; /* Symbol index. */ | ||
28 | Elf64_Byte r_ssym; /* Special symbol. */ | ||
29 | Elf64_Byte r_type3; /* Third relocation. */ | ||
30 | Elf64_Byte r_type2; /* Second relocation. */ | ||
31 | Elf64_Byte r_type; /* First relocation. */ | ||
32 | Elf64_Sxword r_addend; /* Addend. */ | ||
33 | } Elf64_Mips_Rela; | ||
34 | |||
35 | #ifdef CONFIG_32BIT | ||
36 | |||
37 | #define Elf_Shdr Elf32_Shdr | ||
38 | #define Elf_Sym Elf32_Sym | ||
39 | #define Elf_Ehdr Elf32_Ehdr | ||
40 | #define Elf_Addr Elf32_Addr | ||
41 | |||
42 | #define Elf_Mips_Rel Elf32_Rel | ||
43 | #define Elf_Mips_Rela Elf32_Rela | ||
44 | |||
45 | #define ELF_MIPS_R_SYM(rel) ELF32_R_SYM(rel.r_info) | ||
46 | #define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE(rel.r_info) | ||
47 | |||
48 | #endif | ||
49 | |||
50 | #ifdef CONFIG_64BIT | ||
51 | |||
52 | #define Elf_Shdr Elf64_Shdr | ||
53 | #define Elf_Sym Elf64_Sym | ||
54 | #define Elf_Ehdr Elf64_Ehdr | ||
55 | #define Elf_Addr Elf64_Addr | ||
56 | |||
57 | #define Elf_Mips_Rel Elf64_Mips_Rel | ||
58 | #define Elf_Mips_Rela Elf64_Mips_Rela | ||
59 | |||
60 | #define ELF_MIPS_R_SYM(rel) (rel.r_sym) | ||
61 | #define ELF_MIPS_R_TYPE(rel) (rel.r_type) | ||
62 | |||
63 | #endif | ||
64 | |||
65 | #ifdef CONFIG_MODULES | ||
66 | /* Given an address, look for it in the exception tables. */ | ||
67 | const struct exception_table_entry*search_module_dbetables(unsigned long addr); | ||
68 | #else | ||
69 | /* Given an address, look for it in the exception tables. */ | ||
70 | static inline const struct exception_table_entry * | ||
71 | search_module_dbetables(unsigned long addr) | ||
72 | { | ||
73 | return NULL; | ||
74 | } | ||
75 | #endif | ||
76 | |||
77 | #ifdef CONFIG_CPU_MIPS32_R1 | ||
78 | #define MODULE_PROC_FAMILY "MIPS32_R1 " | ||
79 | #elif defined CONFIG_CPU_MIPS32_R2 | ||
80 | #define MODULE_PROC_FAMILY "MIPS32_R2 " | ||
81 | #elif defined CONFIG_CPU_MIPS64_R1 | ||
82 | #define MODULE_PROC_FAMILY "MIPS64_R1 " | ||
83 | #elif defined CONFIG_CPU_MIPS64_R2 | ||
84 | #define MODULE_PROC_FAMILY "MIPS64_R2 " | ||
85 | #elif defined CONFIG_CPU_R3000 | ||
86 | #define MODULE_PROC_FAMILY "R3000 " | ||
87 | #elif defined CONFIG_CPU_TX39XX | ||
88 | #define MODULE_PROC_FAMILY "TX39XX " | ||
89 | #elif defined CONFIG_CPU_VR41XX | ||
90 | #define MODULE_PROC_FAMILY "VR41XX " | ||
91 | #elif defined CONFIG_CPU_R4300 | ||
92 | #define MODULE_PROC_FAMILY "R4300 " | ||
93 | #elif defined CONFIG_CPU_R4X00 | ||
94 | #define MODULE_PROC_FAMILY "R4X00 " | ||
95 | #elif defined CONFIG_CPU_TX49XX | ||
96 | #define MODULE_PROC_FAMILY "TX49XX " | ||
97 | #elif defined CONFIG_CPU_R5000 | ||
98 | #define MODULE_PROC_FAMILY "R5000 " | ||
99 | #elif defined CONFIG_CPU_R5432 | ||
100 | #define MODULE_PROC_FAMILY "R5432 " | ||
101 | #elif defined CONFIG_CPU_R6000 | ||
102 | #define MODULE_PROC_FAMILY "R6000 " | ||
103 | #elif defined CONFIG_CPU_NEVADA | ||
104 | #define MODULE_PROC_FAMILY "NEVADA " | ||
105 | #elif defined CONFIG_CPU_R8000 | ||
106 | #define MODULE_PROC_FAMILY "R8000 " | ||
107 | #elif defined CONFIG_CPU_R10000 | ||
108 | #define MODULE_PROC_FAMILY "R10000 " | ||
109 | #elif defined CONFIG_CPU_RM7000 | ||
110 | #define MODULE_PROC_FAMILY "RM7000 " | ||
111 | #elif defined CONFIG_CPU_RM9000 | ||
112 | #define MODULE_PROC_FAMILY "RM9000 " | ||
113 | #elif defined CONFIG_CPU_SB1 | ||
114 | #define MODULE_PROC_FAMILY "SB1 " | ||
115 | #elif defined CONFIG_CPU_LOONGSON2 | ||
116 | #define MODULE_PROC_FAMILY "LOONGSON2 " | ||
117 | #else | ||
118 | #error MODULE_PROC_FAMILY undefined for your processor configuration | ||
119 | #endif | ||
120 | |||
121 | #ifdef CONFIG_32BIT | ||
122 | #define MODULE_KERNEL_TYPE "32BIT " | ||
123 | #elif defined CONFIG_64BIT | ||
124 | #define MODULE_KERNEL_TYPE "64BIT " | ||
125 | #endif | ||
126 | |||
127 | #ifdef CONFIG_MIPS_MT_SMTC | ||
128 | #define MODULE_KERNEL_SMTC "MT_SMTC " | ||
129 | #else | ||
130 | #define MODULE_KERNEL_SMTC "" | ||
131 | #endif | ||
132 | |||
133 | #define MODULE_ARCH_VERMAGIC \ | ||
134 | MODULE_PROC_FAMILY MODULE_KERNEL_TYPE MODULE_KERNEL_SMTC | ||
135 | |||
136 | #endif /* _ASM_MODULE_H */ | ||
diff --git a/include/asm-mips/msc01_ic.h b/include/asm-mips/msc01_ic.h deleted file mode 100644 index 7989b9ffc1d2..000000000000 --- a/include/asm-mips/msc01_ic.h +++ /dev/null | |||
@@ -1,148 +0,0 @@ | |||
1 | /* | ||
2 | * PCI Register definitions for the MIPS System Controller. | ||
3 | * | ||
4 | * Copyright (C) 2004 MIPS Technologies, Inc. All rights reserved. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_MIPS_BOARDS_MSC01_IC_H | ||
12 | #define __ASM_MIPS_BOARDS_MSC01_IC_H | ||
13 | |||
14 | /***************************************************************************** | ||
15 | * Register offset addresses | ||
16 | *****************************************************************************/ | ||
17 | |||
18 | #define MSC01_IC_RST_OFS 0x00008 /* Software reset */ | ||
19 | #define MSC01_IC_ENAL_OFS 0x00100 /* Int_in enable mask 31:0 */ | ||
20 | #define MSC01_IC_ENAH_OFS 0x00108 /* Int_in enable mask 63:32 */ | ||
21 | #define MSC01_IC_DISL_OFS 0x00120 /* Int_in disable mask 31:0 */ | ||
22 | #define MSC01_IC_DISH_OFS 0x00128 /* Int_in disable mask 63:32 */ | ||
23 | #define MSC01_IC_ISBL_OFS 0x00140 /* Raw int_in 31:0 */ | ||
24 | #define MSC01_IC_ISBH_OFS 0x00148 /* Raw int_in 63:32 */ | ||
25 | #define MSC01_IC_ISAL_OFS 0x00160 /* Masked int_in 31:0 */ | ||
26 | #define MSC01_IC_ISAH_OFS 0x00168 /* Masked int_in 63:32 */ | ||
27 | #define MSC01_IC_LVL_OFS 0x00180 /* Disable priority int_out */ | ||
28 | #define MSC01_IC_RAMW_OFS 0x00180 /* Shadow set RAM (EI) */ | ||
29 | #define MSC01_IC_OSB_OFS 0x00188 /* Raw int_out */ | ||
30 | #define MSC01_IC_OSA_OFS 0x00190 /* Masked int_out */ | ||
31 | #define MSC01_IC_GENA_OFS 0x00198 /* Global HW int enable */ | ||
32 | #define MSC01_IC_BASE_OFS 0x001a0 /* Base address of IC_VEC */ | ||
33 | #define MSC01_IC_VEC_OFS 0x001b0 /* Active int's vector address */ | ||
34 | #define MSC01_IC_EOI_OFS 0x001c0 /* Enable lower level ints */ | ||
35 | #define MSC01_IC_CFG_OFS 0x001c8 /* Configuration register */ | ||
36 | #define MSC01_IC_TRLD_OFS 0x001d0 /* Interval timer reload val */ | ||
37 | #define MSC01_IC_TVAL_OFS 0x001e0 /* Interval timer current val */ | ||
38 | #define MSC01_IC_TCFG_OFS 0x001f0 /* Interval timer config */ | ||
39 | #define MSC01_IC_SUP_OFS 0x00200 /* Set up int_in line 0 */ | ||
40 | #define MSC01_IC_ENA_OFS 0x00800 /* Int_in enable mask 63:0 */ | ||
41 | #define MSC01_IC_DIS_OFS 0x00820 /* Int_in disable mask 63:0 */ | ||
42 | #define MSC01_IC_ISB_OFS 0x00840 /* Raw int_in 63:0 */ | ||
43 | #define MSC01_IC_ISA_OFS 0x00860 /* Masked int_in 63:0 */ | ||
44 | |||
45 | /***************************************************************************** | ||
46 | * Register field encodings | ||
47 | *****************************************************************************/ | ||
48 | |||
49 | #define MSC01_IC_RST_RST_SHF 0 | ||
50 | #define MSC01_IC_RST_RST_MSK 0x00000001 | ||
51 | #define MSC01_IC_RST_RST_BIT MSC01_IC_RST_RST_MSK | ||
52 | #define MSC01_IC_LVL_LVL_SHF 0 | ||
53 | #define MSC01_IC_LVL_LVL_MSK 0x000000ff | ||
54 | #define MSC01_IC_LVL_SPUR_SHF 16 | ||
55 | #define MSC01_IC_LVL_SPUR_MSK 0x00010000 | ||
56 | #define MSC01_IC_LVL_SPUR_BIT MSC01_IC_LVL_SPUR_MSK | ||
57 | #define MSC01_IC_RAMW_RIPL_SHF 0 | ||
58 | #define MSC01_IC_RAMW_RIPL_MSK 0x0000003f | ||
59 | #define MSC01_IC_RAMW_DATA_SHF 6 | ||
60 | #define MSC01_IC_RAMW_DATA_MSK 0x00000fc0 | ||
61 | #define MSC01_IC_RAMW_ADDR_SHF 25 | ||
62 | #define MSC01_IC_RAMW_ADDR_MSK 0x7e000000 | ||
63 | #define MSC01_IC_RAMW_READ_SHF 31 | ||
64 | #define MSC01_IC_RAMW_READ_MSK 0x80000000 | ||
65 | #define MSC01_IC_RAMW_READ_BIT MSC01_IC_RAMW_READ_MSK | ||
66 | #define MSC01_IC_OSB_OSB_SHF 0 | ||
67 | #define MSC01_IC_OSB_OSB_MSK 0x000000ff | ||
68 | #define MSC01_IC_OSA_OSA_SHF 0 | ||
69 | #define MSC01_IC_OSA_OSA_MSK 0x000000ff | ||
70 | #define MSC01_IC_GENA_GENA_SHF 0 | ||
71 | #define MSC01_IC_GENA_GENA_MSK 0x00000001 | ||
72 | #define MSC01_IC_GENA_GENA_BIT MSC01_IC_GENA_GENA_MSK | ||
73 | #define MSC01_IC_CFG_DIS_SHF 0 | ||
74 | #define MSC01_IC_CFG_DIS_MSK 0x00000001 | ||
75 | #define MSC01_IC_CFG_DIS_BIT MSC01_IC_CFG_DIS_MSK | ||
76 | #define MSC01_IC_CFG_SHFT_SHF 8 | ||
77 | #define MSC01_IC_CFG_SHFT_MSK 0x00000f00 | ||
78 | #define MSC01_IC_TCFG_ENA_SHF 0 | ||
79 | #define MSC01_IC_TCFG_ENA_MSK 0x00000001 | ||
80 | #define MSC01_IC_TCFG_ENA_BIT MSC01_IC_TCFG_ENA_MSK | ||
81 | #define MSC01_IC_TCFG_INT_SHF 8 | ||
82 | #define MSC01_IC_TCFG_INT_MSK 0x00000100 | ||
83 | #define MSC01_IC_TCFG_INT_BIT MSC01_IC_TCFG_INT_MSK | ||
84 | #define MSC01_IC_TCFG_EDGE_SHF 16 | ||
85 | #define MSC01_IC_TCFG_EDGE_MSK 0x00010000 | ||
86 | #define MSC01_IC_TCFG_EDGE_BIT MSC01_IC_TCFG_EDGE_MSK | ||
87 | #define MSC01_IC_SUP_PRI_SHF 0 | ||
88 | #define MSC01_IC_SUP_PRI_MSK 0x00000007 | ||
89 | #define MSC01_IC_SUP_EDGE_SHF 8 | ||
90 | #define MSC01_IC_SUP_EDGE_MSK 0x00000100 | ||
91 | #define MSC01_IC_SUP_EDGE_BIT MSC01_IC_SUP_EDGE_MSK | ||
92 | #define MSC01_IC_SUP_STEP 8 | ||
93 | |||
94 | /* | ||
95 | * MIPS System controller interrupt register base. | ||
96 | * | ||
97 | */ | ||
98 | |||
99 | /***************************************************************************** | ||
100 | * Absolute register addresses | ||
101 | *****************************************************************************/ | ||
102 | |||
103 | #define MSC01_IC_RST (MSC01_IC_REG_BASE + MSC01_IC_RST_OFS) | ||
104 | #define MSC01_IC_ENAL (MSC01_IC_REG_BASE + MSC01_IC_ENAL_OFS) | ||
105 | #define MSC01_IC_ENAH (MSC01_IC_REG_BASE + MSC01_IC_ENAH_OFS) | ||
106 | #define MSC01_IC_DISL (MSC01_IC_REG_BASE + MSC01_IC_DISL_OFS) | ||
107 | #define MSC01_IC_DISH (MSC01_IC_REG_BASE + MSC01_IC_DISH_OFS) | ||
108 | #define MSC01_IC_ISBL (MSC01_IC_REG_BASE + MSC01_IC_ISBL_OFS) | ||
109 | #define MSC01_IC_ISBH (MSC01_IC_REG_BASE + MSC01_IC_ISBH_OFS) | ||
110 | #define MSC01_IC_ISAL (MSC01_IC_REG_BASE + MSC01_IC_ISAL_OFS) | ||
111 | #define MSC01_IC_ISAH (MSC01_IC_REG_BASE + MSC01_IC_ISAH_OFS) | ||
112 | #define MSC01_IC_LVL (MSC01_IC_REG_BASE + MSC01_IC_LVL_OFS) | ||
113 | #define MSC01_IC_RAMW (MSC01_IC_REG_BASE + MSC01_IC_RAMW_OFS) | ||
114 | #define MSC01_IC_OSB (MSC01_IC_REG_BASE + MSC01_IC_OSB_OFS) | ||
115 | #define MSC01_IC_OSA (MSC01_IC_REG_BASE + MSC01_IC_OSA_OFS) | ||
116 | #define MSC01_IC_GENA (MSC01_IC_REG_BASE + MSC01_IC_GENA_OFS) | ||
117 | #define MSC01_IC_BASE (MSC01_IC_REG_BASE + MSC01_IC_BASE_OFS) | ||
118 | #define MSC01_IC_VEC (MSC01_IC_REG_BASE + MSC01_IC_VEC_OFS) | ||
119 | #define MSC01_IC_EOI (MSC01_IC_REG_BASE + MSC01_IC_EOI_OFS) | ||
120 | #define MSC01_IC_CFG (MSC01_IC_REG_BASE + MSC01_IC_CFG_OFS) | ||
121 | #define MSC01_IC_TRLD (MSC01_IC_REG_BASE + MSC01_IC_TRLD_OFS) | ||
122 | #define MSC01_IC_TVAL (MSC01_IC_REG_BASE + MSC01_IC_TVAL_OFS) | ||
123 | #define MSC01_IC_TCFG (MSC01_IC_REG_BASE + MSC01_IC_TCFG_OFS) | ||
124 | #define MSC01_IC_SUP (MSC01_IC_REG_BASE + MSC01_IC_SUP_OFS) | ||
125 | #define MSC01_IC_ENA (MSC01_IC_REG_BASE + MSC01_IC_ENA_OFS) | ||
126 | #define MSC01_IC_DIS (MSC01_IC_REG_BASE + MSC01_IC_DIS_OFS) | ||
127 | #define MSC01_IC_ISB (MSC01_IC_REG_BASE + MSC01_IC_ISB_OFS) | ||
128 | #define MSC01_IC_ISA (MSC01_IC_REG_BASE + MSC01_IC_ISA_OFS) | ||
129 | |||
130 | /* | ||
131 | * Soc-it interrupts are configurable. | ||
132 | * Every board describes its IRQ mapping with this table. | ||
133 | */ | ||
134 | typedef struct msc_irqmap { | ||
135 | int im_irq; | ||
136 | int im_type; | ||
137 | int im_lvl; | ||
138 | } msc_irqmap_t; | ||
139 | |||
140 | /* im_type */ | ||
141 | #define MSC01_IRQ_LEVEL 0 | ||
142 | #define MSC01_IRQ_EDGE 1 | ||
143 | |||
144 | extern void __init init_msc_irqs(unsigned long icubase, unsigned int base, msc_irqmap_t *imp, int nirq); | ||
145 | extern void ll_msc_irq(void); | ||
146 | |||
147 | #endif /* __ASM_MIPS_BOARDS_MSC01_IC_H */ | ||
148 | |||
diff --git a/include/asm-mips/msgbuf.h b/include/asm-mips/msgbuf.h deleted file mode 100644 index 0d6c7f14de31..000000000000 --- a/include/asm-mips/msgbuf.h +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | #ifndef _ASM_MSGBUF_H | ||
2 | #define _ASM_MSGBUF_H | ||
3 | |||
4 | |||
5 | /* | ||
6 | * The msqid64_ds structure for the MIPS architecture. | ||
7 | * Note extra padding because this structure is passed back and forth | ||
8 | * between kernel and user space. | ||
9 | * | ||
10 | * Pad space is left for: | ||
11 | * - extension of time_t to 64-bit on 32-bitsystem to solve the y2038 problem | ||
12 | * - 2 miscellaneous unsigned long values | ||
13 | */ | ||
14 | |||
15 | struct msqid64_ds { | ||
16 | struct ipc64_perm msg_perm; | ||
17 | #if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN) | ||
18 | unsigned long __unused1; | ||
19 | #endif | ||
20 | __kernel_time_t msg_stime; /* last msgsnd time */ | ||
21 | #if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN) | ||
22 | unsigned long __unused1; | ||
23 | #endif | ||
24 | #if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN) | ||
25 | unsigned long __unused2; | ||
26 | #endif | ||
27 | __kernel_time_t msg_rtime; /* last msgrcv time */ | ||
28 | #if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN) | ||
29 | unsigned long __unused2; | ||
30 | #endif | ||
31 | #if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN) | ||
32 | unsigned long __unused3; | ||
33 | #endif | ||
34 | __kernel_time_t msg_ctime; /* last change time */ | ||
35 | #if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN) | ||
36 | unsigned long __unused3; | ||
37 | #endif | ||
38 | unsigned long msg_cbytes; /* current number of bytes on queue */ | ||
39 | unsigned long msg_qnum; /* number of messages in queue */ | ||
40 | unsigned long msg_qbytes; /* max number of bytes on queue */ | ||
41 | __kernel_pid_t msg_lspid; /* pid of last msgsnd */ | ||
42 | __kernel_pid_t msg_lrpid; /* last receive pid */ | ||
43 | unsigned long __unused4; | ||
44 | unsigned long __unused5; | ||
45 | }; | ||
46 | |||
47 | #endif /* _ASM_MSGBUF_H */ | ||
diff --git a/include/asm-mips/mutex.h b/include/asm-mips/mutex.h deleted file mode 100644 index 458c1f7fbc18..000000000000 --- a/include/asm-mips/mutex.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | /* | ||
2 | * Pull in the generic implementation for the mutex fastpath. | ||
3 | * | ||
4 | * TODO: implement optimized primitives instead, or leave the generic | ||
5 | * implementation in place, or pick the atomic_xchg() based generic | ||
6 | * implementation. (see asm-generic/mutex-xchg.h for details) | ||
7 | */ | ||
8 | |||
9 | #include <asm-generic/mutex-dec.h> | ||
diff --git a/include/asm-mips/nile4.h b/include/asm-mips/nile4.h deleted file mode 100644 index c3ca959aa4d9..000000000000 --- a/include/asm-mips/nile4.h +++ /dev/null | |||
@@ -1,310 +0,0 @@ | |||
1 | /* | ||
2 | * asm-mips/nile4.h -- NEC Vrc-5074 Nile 4 definitions | ||
3 | * | ||
4 | * Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com> | ||
5 | * Sony Software Development Center Europe (SDCE), Brussels | ||
6 | * | ||
7 | * This file is based on the following documentation: | ||
8 | * | ||
9 | * NEC Vrc 5074 System Controller Data Sheet, June 1998 | ||
10 | */ | ||
11 | |||
12 | #ifndef _ASM_NILE4_H | ||
13 | #define _ASM_NILE4_H | ||
14 | |||
15 | #define NILE4_BASE 0xbfa00000 | ||
16 | #define NILE4_SIZE 0x00200000 /* 2 MB */ | ||
17 | |||
18 | |||
19 | /* | ||
20 | * Physical Device Address Registers (PDARs) | ||
21 | */ | ||
22 | |||
23 | #define NILE4_SDRAM0 0x0000 /* SDRAM Bank 0 [R/W] */ | ||
24 | #define NILE4_SDRAM1 0x0008 /* SDRAM Bank 1 [R/W] */ | ||
25 | #define NILE4_DCS2 0x0010 /* Device Chip-Select 2 [R/W] */ | ||
26 | #define NILE4_DCS3 0x0018 /* Device Chip-Select 3 [R/W] */ | ||
27 | #define NILE4_DCS4 0x0020 /* Device Chip-Select 4 [R/W] */ | ||
28 | #define NILE4_DCS5 0x0028 /* Device Chip-Select 5 [R/W] */ | ||
29 | #define NILE4_DCS6 0x0030 /* Device Chip-Select 6 [R/W] */ | ||
30 | #define NILE4_DCS7 0x0038 /* Device Chip-Select 7 [R/W] */ | ||
31 | #define NILE4_DCS8 0x0040 /* Device Chip-Select 8 [R/W] */ | ||
32 | #define NILE4_PCIW0 0x0060 /* PCI Address Window 0 [R/W] */ | ||
33 | #define NILE4_PCIW1 0x0068 /* PCI Address Window 1 [R/W] */ | ||
34 | #define NILE4_INTCS 0x0070 /* Controller Internal Registers and Devices */ | ||
35 | /* [R/W] */ | ||
36 | #define NILE4_BOOTCS 0x0078 /* Boot ROM Chip-Select [R/W] */ | ||
37 | |||
38 | |||
39 | /* | ||
40 | * CPU Interface Registers | ||
41 | */ | ||
42 | |||
43 | #define NILE4_CPUSTAT 0x0080 /* CPU Status [R/W] */ | ||
44 | #define NILE4_INTCTRL 0x0088 /* Interrupt Control [R/W] */ | ||
45 | #define NILE4_INTSTAT0 0x0090 /* Interrupt Status 0 [R] */ | ||
46 | #define NILE4_INTSTAT1 0x0098 /* Interrupt Status 1 and CPU Interrupt */ | ||
47 | /* Enable [R/W] */ | ||
48 | #define NILE4_INTCLR 0x00A0 /* Interrupt Clear [R/W] */ | ||
49 | #define NILE4_INTPPES 0x00A8 /* PCI Interrupt Control [R/W] */ | ||
50 | |||
51 | |||
52 | /* | ||
53 | * Memory-Interface Registers | ||
54 | */ | ||
55 | |||
56 | #define NILE4_MEMCTRL 0x00C0 /* Memory Control */ | ||
57 | #define NILE4_ACSTIME 0x00C8 /* Memory Access Timing [R/W] */ | ||
58 | #define NILE4_CHKERR 0x00D0 /* Memory Check Error Status [R] */ | ||
59 | |||
60 | |||
61 | /* | ||
62 | * PCI-Bus Registers | ||
63 | */ | ||
64 | |||
65 | #define NILE4_PCICTRL 0x00E0 /* PCI Control [R/W] */ | ||
66 | #define NILE4_PCIARB 0x00E8 /* PCI Arbiter [R/W] */ | ||
67 | #define NILE4_PCIINIT0 0x00F0 /* PCI Master (Initiator) 0 [R/W] */ | ||
68 | #define NILE4_PCIINIT1 0x00F8 /* PCI Master (Initiator) 1 [R/W] */ | ||
69 | #define NILE4_PCIERR 0x00B8 /* PCI Error [R/W] */ | ||
70 | |||
71 | |||
72 | /* | ||
73 | * Local-Bus Registers | ||
74 | */ | ||
75 | |||
76 | #define NILE4_LCNFG 0x0100 /* Local Bus Configuration [R/W] */ | ||
77 | #define NILE4_LCST2 0x0110 /* Local Bus Chip-Select Timing 2 [R/W] */ | ||
78 | #define NILE4_LCST3 0x0118 /* Local Bus Chip-Select Timing 3 [R/W] */ | ||
79 | #define NILE4_LCST4 0x0120 /* Local Bus Chip-Select Timing 4 [R/W] */ | ||
80 | #define NILE4_LCST5 0x0128 /* Local Bus Chip-Select Timing 5 [R/W] */ | ||
81 | #define NILE4_LCST6 0x0130 /* Local Bus Chip-Select Timing 6 [R/W] */ | ||
82 | #define NILE4_LCST7 0x0138 /* Local Bus Chip-Select Timing 7 [R/W] */ | ||
83 | #define NILE4_LCST8 0x0140 /* Local Bus Chip-Select Timing 8 [R/W] */ | ||
84 | #define NILE4_DCSFN 0x0150 /* Device Chip-Select Muxing and Output */ | ||
85 | /* Enables [R/W] */ | ||
86 | #define NILE4_DCSIO 0x0158 /* Device Chip-Selects As I/O Bits [R/W] */ | ||
87 | #define NILE4_BCST 0x0178 /* Local Boot Chip-Select Timing [R/W] */ | ||
88 | |||
89 | |||
90 | /* | ||
91 | * DMA Registers | ||
92 | */ | ||
93 | |||
94 | #define NILE4_DMACTRL0 0x0180 /* DMA Control 0 [R/W] */ | ||
95 | #define NILE4_DMASRCA0 0x0188 /* DMA Source Address 0 [R/W] */ | ||
96 | #define NILE4_DMADESA0 0x0190 /* DMA Destination Address 0 [R/W] */ | ||
97 | #define NILE4_DMACTRL1 0x0198 /* DMA Control 1 [R/W] */ | ||
98 | #define NILE4_DMASRCA1 0x01A0 /* DMA Source Address 1 [R/W] */ | ||
99 | #define NILE4_DMADESA1 0x01A8 /* DMA Destination Address 1 [R/W] */ | ||
100 | |||
101 | |||
102 | /* | ||
103 | * Timer Registers | ||
104 | */ | ||
105 | |||
106 | #define NILE4_T0CTRL 0x01C0 /* SDRAM Refresh Control [R/W] */ | ||
107 | #define NILE4_T0CNTR 0x01C8 /* SDRAM Refresh Counter [R/W] */ | ||
108 | #define NILE4_T1CTRL 0x01D0 /* CPU-Bus Read Time-Out Control [R/W] */ | ||
109 | #define NILE4_T1CNTR 0x01D8 /* CPU-Bus Read Time-Out Counter [R/W] */ | ||
110 | #define NILE4_T2CTRL 0x01E0 /* General-Purpose Timer Control [R/W] */ | ||
111 | #define NILE4_T2CNTR 0x01E8 /* General-Purpose Timer Counter [R/W] */ | ||
112 | #define NILE4_T3CTRL 0x01F0 /* Watchdog Timer Control [R/W] */ | ||
113 | #define NILE4_T3CNTR 0x01F8 /* Watchdog Timer Counter [R/W] */ | ||
114 | |||
115 | |||
116 | /* | ||
117 | * PCI Configuration Space Registers | ||
118 | */ | ||
119 | |||
120 | #define NILE4_PCI_BASE 0x0200 | ||
121 | |||
122 | #define NILE4_VID 0x0200 /* PCI Vendor ID [R] */ | ||
123 | #define NILE4_DID 0x0202 /* PCI Device ID [R] */ | ||
124 | #define NILE4_PCICMD 0x0204 /* PCI Command [R/W] */ | ||
125 | #define NILE4_PCISTS 0x0206 /* PCI Status [R/W] */ | ||
126 | #define NILE4_REVID 0x0208 /* PCI Revision ID [R] */ | ||
127 | #define NILE4_CLASS 0x0209 /* PCI Class Code [R] */ | ||
128 | #define NILE4_CLSIZ 0x020C /* PCI Cache Line Size [R/W] */ | ||
129 | #define NILE4_MLTIM 0x020D /* PCI Latency Timer [R/W] */ | ||
130 | #define NILE4_HTYPE 0x020E /* PCI Header Type [R] */ | ||
131 | #define NILE4_BIST 0x020F /* BIST [R] (unimplemented) */ | ||
132 | #define NILE4_BARC 0x0210 /* PCI Base Address Register Control [R/W] */ | ||
133 | #define NILE4_BAR0 0x0218 /* PCI Base Address Register 0 [R/W] */ | ||
134 | #define NILE4_BAR1 0x0220 /* PCI Base Address Register 1 [R/W] */ | ||
135 | #define NILE4_CIS 0x0228 /* PCI Cardbus CIS Pointer [R] */ | ||
136 | /* (unimplemented) */ | ||
137 | #define NILE4_SSVID 0x022C /* PCI Sub-System Vendor ID [R/W] */ | ||
138 | #define NILE4_SSID 0x022E /* PCI Sub-System ID [R/W] */ | ||
139 | #define NILE4_ROM 0x0230 /* Expansion ROM Base Address [R] */ | ||
140 | /* (unimplemented) */ | ||
141 | #define NILE4_INTLIN 0x023C /* PCI Interrupt Line [R/W] */ | ||
142 | #define NILE4_INTPIN 0x023D /* PCI Interrupt Pin [R] */ | ||
143 | #define NILE4_MINGNT 0x023E /* PCI Min_Gnt [R] (unimplemented) */ | ||
144 | #define NILE4_MAXLAT 0x023F /* PCI Max_Lat [R] (unimplemented) */ | ||
145 | #define NILE4_BAR2 0x0240 /* PCI Base Address Register 2 [R/W] */ | ||
146 | #define NILE4_BAR3 0x0248 /* PCI Base Address Register 3 [R/W] */ | ||
147 | #define NILE4_BAR4 0x0250 /* PCI Base Address Register 4 [R/W] */ | ||
148 | #define NILE4_BAR5 0x0258 /* PCI Base Address Register 5 [R/W] */ | ||
149 | #define NILE4_BAR6 0x0260 /* PCI Base Address Register 6 [R/W] */ | ||
150 | #define NILE4_BAR7 0x0268 /* PCI Base Address Register 7 [R/W] */ | ||
151 | #define NILE4_BAR8 0x0270 /* PCI Base Address Register 8 [R/W] */ | ||
152 | #define NILE4_BARB 0x0278 /* PCI Base Address Register BOOT [R/W] */ | ||
153 | |||
154 | |||
155 | /* | ||
156 | * Serial-Port Registers | ||
157 | */ | ||
158 | |||
159 | #define NILE4_UART_BASE 0x0300 | ||
160 | |||
161 | #define NILE4_UARTRBR 0x0300 /* UART Receiver Data Buffer [R] */ | ||
162 | #define NILE4_UARTTHR 0x0300 /* UART Transmitter Data Holding [W] */ | ||
163 | #define NILE4_UARTIER 0x0308 /* UART Interrupt Enable [R/W] */ | ||
164 | #define NILE4_UARTDLL 0x0300 /* UART Divisor Latch LSB [R/W] */ | ||
165 | #define NILE4_UARTDLM 0x0308 /* UART Divisor Latch MSB [R/W] */ | ||
166 | #define NILE4_UARTIIR 0x0310 /* UART Interrupt ID [R] */ | ||
167 | #define NILE4_UARTFCR 0x0310 /* UART FIFO Control [W] */ | ||
168 | #define NILE4_UARTLCR 0x0318 /* UART Line Control [R/W] */ | ||
169 | #define NILE4_UARTMCR 0x0320 /* UART Modem Control [R/W] */ | ||
170 | #define NILE4_UARTLSR 0x0328 /* UART Line Status [R/W] */ | ||
171 | #define NILE4_UARTMSR 0x0330 /* UART Modem Status [R/W] */ | ||
172 | #define NILE4_UARTSCR 0x0338 /* UART Scratch [R/W] */ | ||
173 | |||
174 | #define NILE4_UART_BASE_BAUD 520833 /* 100 MHz / 12 / 16 */ | ||
175 | |||
176 | |||
177 | /* | ||
178 | * Interrupt Lines | ||
179 | */ | ||
180 | |||
181 | #define NILE4_INT_CPCE 0 /* CPU-Interface Parity-Error Interrupt */ | ||
182 | #define NILE4_INT_CNTD 1 /* CPU No-Target Decode Interrupt */ | ||
183 | #define NILE4_INT_MCE 2 /* Memory-Check Error Interrupt */ | ||
184 | #define NILE4_INT_DMA 3 /* DMA Controller Interrupt */ | ||
185 | #define NILE4_INT_UART 4 /* UART Interrupt */ | ||
186 | #define NILE4_INT_WDOG 5 /* Watchdog Timer Interrupt */ | ||
187 | #define NILE4_INT_GPT 6 /* General-Purpose Timer Interrupt */ | ||
188 | #define NILE4_INT_LBRTD 7 /* Local-Bus Ready Timer Interrupt */ | ||
189 | #define NILE4_INT_INTA 8 /* PCI Interrupt Signal INTA# */ | ||
190 | #define NILE4_INT_INTB 9 /* PCI Interrupt Signal INTB# */ | ||
191 | #define NILE4_INT_INTC 10 /* PCI Interrupt Signal INTC# */ | ||
192 | #define NILE4_INT_INTD 11 /* PCI Interrupt Signal INTD# */ | ||
193 | #define NILE4_INT_INTE 12 /* PCI Interrupt Signal INTE# (ISA cascade) */ | ||
194 | #define NILE4_INT_RESV 13 /* Reserved */ | ||
195 | #define NILE4_INT_PCIS 14 /* PCI SERR# Interrupt */ | ||
196 | #define NILE4_INT_PCIE 15 /* PCI Internal Error Interrupt */ | ||
197 | |||
198 | |||
199 | /* | ||
200 | * Nile 4 Register Access | ||
201 | */ | ||
202 | |||
203 | static inline void nile4_sync(void) | ||
204 | { | ||
205 | volatile u32 *p = (volatile u32 *)0xbfc00000; | ||
206 | (void)(*p); | ||
207 | } | ||
208 | |||
209 | static inline void nile4_out32(u32 offset, u32 val) | ||
210 | { | ||
211 | *(volatile u32 *)(NILE4_BASE+offset) = val; | ||
212 | nile4_sync(); | ||
213 | } | ||
214 | |||
215 | static inline u32 nile4_in32(u32 offset) | ||
216 | { | ||
217 | u32 val = *(volatile u32 *)(NILE4_BASE+offset); | ||
218 | nile4_sync(); | ||
219 | return val; | ||
220 | } | ||
221 | |||
222 | static inline void nile4_out16(u32 offset, u16 val) | ||
223 | { | ||
224 | *(volatile u16 *)(NILE4_BASE+offset) = val; | ||
225 | nile4_sync(); | ||
226 | } | ||
227 | |||
228 | static inline u16 nile4_in16(u32 offset) | ||
229 | { | ||
230 | u16 val = *(volatile u16 *)(NILE4_BASE+offset); | ||
231 | nile4_sync(); | ||
232 | return val; | ||
233 | } | ||
234 | |||
235 | static inline void nile4_out8(u32 offset, u8 val) | ||
236 | { | ||
237 | *(volatile u8 *)(NILE4_BASE+offset) = val; | ||
238 | nile4_sync(); | ||
239 | } | ||
240 | |||
241 | static inline u8 nile4_in8(u32 offset) | ||
242 | { | ||
243 | u8 val = *(volatile u8 *)(NILE4_BASE+offset); | ||
244 | nile4_sync(); | ||
245 | return val; | ||
246 | } | ||
247 | |||
248 | |||
249 | /* | ||
250 | * Physical Device Address Registers | ||
251 | */ | ||
252 | |||
253 | extern void nile4_set_pdar(u32 pdar, u32 phys, u32 size, int width, | ||
254 | int on_memory_bus, int visible); | ||
255 | |||
256 | |||
257 | /* | ||
258 | * PCI Master Registers | ||
259 | */ | ||
260 | |||
261 | #define NILE4_PCICMD_IACK 0 /* PCI Interrupt Acknowledge */ | ||
262 | #define NILE4_PCICMD_IO 1 /* PCI I/O Space */ | ||
263 | #define NILE4_PCICMD_MEM 3 /* PCI Memory Space */ | ||
264 | #define NILE4_PCICMD_CFG 5 /* PCI Configuration Space */ | ||
265 | |||
266 | |||
267 | /* | ||
268 | * PCI Address Spaces | ||
269 | * | ||
270 | * Note that these are multiplexed using PCIINIT[01]! | ||
271 | */ | ||
272 | |||
273 | #define NILE4_PCI_IO_BASE 0xa6000000 | ||
274 | #define NILE4_PCI_MEM_BASE 0xa8000000 | ||
275 | #define NILE4_PCI_CFG_BASE NILE4_PCI_MEM_BASE | ||
276 | #define NILE4_PCI_IACK_BASE NILE4_PCI_IO_BASE | ||
277 | |||
278 | |||
279 | extern void nile4_set_pmr(u32 pmr, u32 type, u32 addr); | ||
280 | |||
281 | |||
282 | /* | ||
283 | * Interrupt Programming | ||
284 | */ | ||
285 | |||
286 | #define NUM_I8259_INTERRUPTS 16 | ||
287 | #define NUM_NILE4_INTERRUPTS 16 | ||
288 | |||
289 | #define IRQ_I8259_CASCADE NILE4_INT_INTE | ||
290 | #define is_i8259_irq(irq) ((irq) < NUM_I8259_INTERRUPTS) | ||
291 | #define nile4_to_irq(n) ((n)+NUM_I8259_INTERRUPTS) | ||
292 | #define irq_to_nile4(n) ((n)-NUM_I8259_INTERRUPTS) | ||
293 | |||
294 | extern void nile4_map_irq(int nile4_irq, int cpu_irq); | ||
295 | extern void nile4_map_irq_all(int cpu_irq); | ||
296 | extern void nile4_enable_irq(unsigned int nile4_irq); | ||
297 | extern void nile4_disable_irq(unsigned int nile4_irq); | ||
298 | extern void nile4_disable_irq_all(void); | ||
299 | extern u16 nile4_get_irq_stat(int cpu_irq); | ||
300 | extern void nile4_enable_irq_output(int cpu_irq); | ||
301 | extern void nile4_disable_irq_output(int cpu_irq); | ||
302 | extern void nile4_set_pci_irq_polarity(int pci_irq, int high); | ||
303 | extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level); | ||
304 | extern void nile4_clear_irq(int nile4_irq); | ||
305 | extern void nile4_clear_irq_mask(u32 mask); | ||
306 | extern u8 nile4_i8259_iack(void); | ||
307 | extern void nile4_dump_irq_status(void); /* Debug */ | ||
308 | |||
309 | #endif | ||
310 | |||
diff --git a/include/asm-mips/paccess.h b/include/asm-mips/paccess.h deleted file mode 100644 index c2394f8b0fe1..000000000000 --- a/include/asm-mips/paccess.h +++ /dev/null | |||
@@ -1,112 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 1997, 1998, 1999, 2000 by Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | * | ||
9 | * Protected memory access. Used for everything that might take revenge | ||
10 | * by sending a DBE error like accessing possibly non-existant memory or | ||
11 | * devices. | ||
12 | */ | ||
13 | #ifndef _ASM_PACCESS_H | ||
14 | #define _ASM_PACCESS_H | ||
15 | |||
16 | #include <linux/errno.h> | ||
17 | |||
18 | #ifdef CONFIG_32BIT | ||
19 | #define __PA_ADDR ".word" | ||
20 | #endif | ||
21 | #ifdef CONFIG_64BIT | ||
22 | #define __PA_ADDR ".dword" | ||
23 | #endif | ||
24 | |||
25 | extern asmlinkage void handle_ibe(void); | ||
26 | extern asmlinkage void handle_dbe(void); | ||
27 | |||
28 | #define put_dbe(x, ptr) __put_dbe((x), (ptr), sizeof(*(ptr))) | ||
29 | #define get_dbe(x, ptr) __get_dbe((x), (ptr), sizeof(*(ptr))) | ||
30 | |||
31 | struct __large_pstruct { unsigned long buf[100]; }; | ||
32 | #define __mp(x) (*(struct __large_pstruct *)(x)) | ||
33 | |||
34 | #define __get_dbe(x, ptr, size) \ | ||
35 | ({ \ | ||
36 | long __gu_err; \ | ||
37 | __typeof__(*(ptr)) __gu_val; \ | ||
38 | unsigned long __gu_addr; \ | ||
39 | __asm__("":"=r" (__gu_val)); \ | ||
40 | __gu_addr = (unsigned long) (ptr); \ | ||
41 | __asm__("":"=r" (__gu_err)); \ | ||
42 | switch (size) { \ | ||
43 | case 1: __get_dbe_asm("lb"); break; \ | ||
44 | case 2: __get_dbe_asm("lh"); break; \ | ||
45 | case 4: __get_dbe_asm("lw"); break; \ | ||
46 | case 8: __get_dbe_asm("ld"); break; \ | ||
47 | default: __get_dbe_unknown(); break; \ | ||
48 | } \ | ||
49 | x = (__typeof__(*(ptr))) __gu_val; \ | ||
50 | __gu_err; \ | ||
51 | }) | ||
52 | |||
53 | #define __get_dbe_asm(insn) \ | ||
54 | { \ | ||
55 | __asm__ __volatile__( \ | ||
56 | "1:\t" insn "\t%1,%2\n\t" \ | ||
57 | "move\t%0,$0\n" \ | ||
58 | "2:\n\t" \ | ||
59 | ".section\t.fixup,\"ax\"\n" \ | ||
60 | "3:\tli\t%0,%3\n\t" \ | ||
61 | "move\t%1,$0\n\t" \ | ||
62 | "j\t2b\n\t" \ | ||
63 | ".previous\n\t" \ | ||
64 | ".section\t__dbe_table,\"a\"\n\t" \ | ||
65 | __PA_ADDR "\t1b, 3b\n\t" \ | ||
66 | ".previous" \ | ||
67 | :"=r" (__gu_err), "=r" (__gu_val) \ | ||
68 | :"o" (__mp(__gu_addr)), "i" (-EFAULT)); \ | ||
69 | } | ||
70 | |||
71 | extern void __get_dbe_unknown(void); | ||
72 | |||
73 | #define __put_dbe(x, ptr, size) \ | ||
74 | ({ \ | ||
75 | long __pu_err; \ | ||
76 | __typeof__(*(ptr)) __pu_val; \ | ||
77 | long __pu_addr; \ | ||
78 | __pu_val = (x); \ | ||
79 | __pu_addr = (long) (ptr); \ | ||
80 | __asm__("":"=r" (__pu_err)); \ | ||
81 | switch (size) { \ | ||
82 | case 1: __put_dbe_asm("sb"); break; \ | ||
83 | case 2: __put_dbe_asm("sh"); break; \ | ||
84 | case 4: __put_dbe_asm("sw"); break; \ | ||
85 | case 8: __put_dbe_asm("sd"); break; \ | ||
86 | default: __put_dbe_unknown(); break; \ | ||
87 | } \ | ||
88 | __pu_err; \ | ||
89 | }) | ||
90 | |||
91 | #define __put_dbe_asm(insn) \ | ||
92 | { \ | ||
93 | __asm__ __volatile__( \ | ||
94 | "1:\t" insn "\t%1,%2\n\t" \ | ||
95 | "move\t%0,$0\n" \ | ||
96 | "2:\n\t" \ | ||
97 | ".section\t.fixup,\"ax\"\n" \ | ||
98 | "3:\tli\t%0,%3\n\t" \ | ||
99 | "j\t2b\n\t" \ | ||
100 | ".previous\n\t" \ | ||
101 | ".section\t__dbe_table,\"a\"\n\t" \ | ||
102 | __PA_ADDR "\t1b, 3b\n\t" \ | ||
103 | ".previous" \ | ||
104 | : "=r" (__pu_err) \ | ||
105 | : "r" (__pu_val), "o" (__mp(__pu_addr)), "i" (-EFAULT)); \ | ||
106 | } | ||
107 | |||
108 | extern void __put_dbe_unknown(void); | ||
109 | |||
110 | extern unsigned long search_dbe_table(unsigned long addr); | ||
111 | |||
112 | #endif /* _ASM_PACCESS_H */ | ||
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h deleted file mode 100644 index fe7a88ea066e..000000000000 --- a/include/asm-mips/page.h +++ /dev/null | |||
@@ -1,191 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 - 1999, 2000, 03 Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_PAGE_H | ||
10 | #define _ASM_PAGE_H | ||
11 | |||
12 | #include <spaces.h> | ||
13 | |||
14 | /* | ||
15 | * PAGE_SHIFT determines the page size | ||
16 | */ | ||
17 | #ifdef CONFIG_PAGE_SIZE_4KB | ||
18 | #define PAGE_SHIFT 12 | ||
19 | #endif | ||
20 | #ifdef CONFIG_PAGE_SIZE_8KB | ||
21 | #define PAGE_SHIFT 13 | ||
22 | #endif | ||
23 | #ifdef CONFIG_PAGE_SIZE_16KB | ||
24 | #define PAGE_SHIFT 14 | ||
25 | #endif | ||
26 | #ifdef CONFIG_PAGE_SIZE_64KB | ||
27 | #define PAGE_SHIFT 16 | ||
28 | #endif | ||
29 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | ||
30 | #define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) | ||
31 | |||
32 | #ifndef __ASSEMBLY__ | ||
33 | |||
34 | #include <linux/pfn.h> | ||
35 | #include <asm/io.h> | ||
36 | |||
37 | extern void build_clear_page(void); | ||
38 | extern void build_copy_page(void); | ||
39 | |||
40 | /* | ||
41 | * It's normally defined only for FLATMEM config but it's | ||
42 | * used in our early mem init code for all memory models. | ||
43 | * So always define it. | ||
44 | */ | ||
45 | #define ARCH_PFN_OFFSET PFN_UP(PHYS_OFFSET) | ||
46 | |||
47 | extern void clear_page(void * page); | ||
48 | extern void copy_page(void * to, void * from); | ||
49 | |||
50 | extern unsigned long shm_align_mask; | ||
51 | |||
52 | static inline unsigned long pages_do_alias(unsigned long addr1, | ||
53 | unsigned long addr2) | ||
54 | { | ||
55 | return (addr1 ^ addr2) & shm_align_mask; | ||
56 | } | ||
57 | |||
58 | struct page; | ||
59 | |||
60 | static inline void clear_user_page(void *addr, unsigned long vaddr, | ||
61 | struct page *page) | ||
62 | { | ||
63 | extern void (*flush_data_cache_page)(unsigned long addr); | ||
64 | |||
65 | clear_page(addr); | ||
66 | if (pages_do_alias((unsigned long) addr, vaddr & PAGE_MASK)) | ||
67 | flush_data_cache_page((unsigned long)addr); | ||
68 | } | ||
69 | |||
70 | extern void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, | ||
71 | struct page *to); | ||
72 | struct vm_area_struct; | ||
73 | extern void copy_user_highpage(struct page *to, struct page *from, | ||
74 | unsigned long vaddr, struct vm_area_struct *vma); | ||
75 | |||
76 | #define __HAVE_ARCH_COPY_USER_HIGHPAGE | ||
77 | |||
78 | /* | ||
79 | * These are used to make use of C type-checking.. | ||
80 | */ | ||
81 | #ifdef CONFIG_64BIT_PHYS_ADDR | ||
82 | #ifdef CONFIG_CPU_MIPS32 | ||
83 | typedef struct { unsigned long pte_low, pte_high; } pte_t; | ||
84 | #define pte_val(x) ((x).pte_low | ((unsigned long long)(x).pte_high << 32)) | ||
85 | #define __pte(x) ({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; }) | ||
86 | #else | ||
87 | typedef struct { unsigned long long pte; } pte_t; | ||
88 | #define pte_val(x) ((x).pte) | ||
89 | #define __pte(x) ((pte_t) { (x) } ) | ||
90 | #endif | ||
91 | #else | ||
92 | typedef struct { unsigned long pte; } pte_t; | ||
93 | #define pte_val(x) ((x).pte) | ||
94 | #define __pte(x) ((pte_t) { (x) } ) | ||
95 | #endif | ||
96 | typedef struct page *pgtable_t; | ||
97 | |||
98 | /* | ||
99 | * For 3-level pagetables we defines these ourselves, for 2-level the | ||
100 | * definitions are supplied by <asm-generic/pgtable-nopmd.h>. | ||
101 | */ | ||
102 | #ifdef CONFIG_64BIT | ||
103 | |||
104 | typedef struct { unsigned long pmd; } pmd_t; | ||
105 | #define pmd_val(x) ((x).pmd) | ||
106 | #define __pmd(x) ((pmd_t) { (x) } ) | ||
107 | |||
108 | #endif | ||
109 | |||
110 | /* | ||
111 | * Right now we don't support 4-level pagetables, so all pud-related | ||
112 | * definitions come from <asm-generic/pgtable-nopud.h>. | ||
113 | */ | ||
114 | |||
115 | /* | ||
116 | * Finall the top of the hierarchy, the pgd | ||
117 | */ | ||
118 | typedef struct { unsigned long pgd; } pgd_t; | ||
119 | #define pgd_val(x) ((x).pgd) | ||
120 | #define __pgd(x) ((pgd_t) { (x) } ) | ||
121 | |||
122 | /* | ||
123 | * Manipulate page protection bits | ||
124 | */ | ||
125 | typedef struct { unsigned long pgprot; } pgprot_t; | ||
126 | #define pgprot_val(x) ((x).pgprot) | ||
127 | #define __pgprot(x) ((pgprot_t) { (x) } ) | ||
128 | |||
129 | /* | ||
130 | * On R4000-style MMUs where a TLB entry is mapping a adjacent even / odd | ||
131 | * pair of pages we only have a single global bit per pair of pages. When | ||
132 | * writing to the TLB make sure we always have the bit set for both pages | ||
133 | * or none. This macro is used to access the `buddy' of the pte we're just | ||
134 | * working on. | ||
135 | */ | ||
136 | #define ptep_buddy(x) ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t))) | ||
137 | |||
138 | #endif /* !__ASSEMBLY__ */ | ||
139 | |||
140 | /* | ||
141 | * __pa()/__va() should be used only during mem init. | ||
142 | */ | ||
143 | #ifdef CONFIG_64BIT | ||
144 | #define __pa(x) \ | ||
145 | ({ \ | ||
146 | unsigned long __x = (unsigned long)(x); \ | ||
147 | __x < CKSEG0 ? XPHYSADDR(__x) : CPHYSADDR(__x); \ | ||
148 | }) | ||
149 | #else | ||
150 | #define __pa(x) \ | ||
151 | ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) | ||
152 | #endif | ||
153 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) | ||
154 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) | ||
155 | |||
156 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | ||
157 | |||
158 | #ifdef CONFIG_FLATMEM | ||
159 | |||
160 | #define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr) | ||
161 | |||
162 | #elif defined(CONFIG_SPARSEMEM) | ||
163 | |||
164 | /* pfn_valid is defined in linux/mmzone.h */ | ||
165 | |||
166 | #elif defined(CONFIG_NEED_MULTIPLE_NODES) | ||
167 | |||
168 | #define pfn_valid(pfn) \ | ||
169 | ({ \ | ||
170 | unsigned long __pfn = (pfn); \ | ||
171 | int __n = pfn_to_nid(__pfn); \ | ||
172 | ((__n >= 0) ? (__pfn < NODE_DATA(__n)->node_start_pfn + \ | ||
173 | NODE_DATA(__n)->node_spanned_pages) \ | ||
174 | : 0); \ | ||
175 | }) | ||
176 | |||
177 | #endif | ||
178 | |||
179 | #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) | ||
180 | #define virt_addr_valid(kaddr) pfn_valid(PFN_DOWN(virt_to_phys(kaddr))) | ||
181 | |||
182 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | ||
183 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | ||
184 | |||
185 | #define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE) | ||
186 | #define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET) | ||
187 | |||
188 | #include <asm-generic/memory_model.h> | ||
189 | #include <asm-generic/page.h> | ||
190 | |||
191 | #endif /* _ASM_PAGE_H */ | ||
diff --git a/include/asm-mips/param.h b/include/asm-mips/param.h deleted file mode 100644 index 1d9bb8c5ab24..000000000000 --- a/include/asm-mips/param.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright 1994 - 2000, 2002 Ralf Baechle (ralf@gnu.org) | ||
7 | * Copyright 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_PARAM_H | ||
10 | #define _ASM_PARAM_H | ||
11 | |||
12 | #ifdef __KERNEL__ | ||
13 | |||
14 | # define HZ CONFIG_HZ /* Internal kernel timer frequency */ | ||
15 | # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ | ||
16 | # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | ||
17 | #endif | ||
18 | |||
19 | #ifndef HZ | ||
20 | #define HZ 100 | ||
21 | #endif | ||
22 | |||
23 | #define EXEC_PAGESIZE 65536 | ||
24 | |||
25 | #ifndef NOGROUP | ||
26 | #define NOGROUP (-1) | ||
27 | #endif | ||
28 | |||
29 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
30 | |||
31 | #endif /* _ASM_PARAM_H */ | ||
diff --git a/include/asm-mips/parport.h b/include/asm-mips/parport.h deleted file mode 100644 index f52656826cce..000000000000 --- a/include/asm-mips/parport.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk> | ||
3 | * | ||
4 | * This file should only be included by drivers/parport/parport_pc.c. | ||
5 | */ | ||
6 | #ifndef _ASM_PARPORT_H | ||
7 | #define _ASM_PARPORT_H | ||
8 | |||
9 | static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma); | ||
10 | static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma) | ||
11 | { | ||
12 | return parport_pc_find_isa_ports(autoirq, autodma); | ||
13 | } | ||
14 | |||
15 | #endif /* _ASM_PARPORT_H */ | ||
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h deleted file mode 100644 index 5510c53b7feb..000000000000 --- a/include/asm-mips/pci.h +++ /dev/null | |||
@@ -1,179 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | */ | ||
6 | #ifndef _ASM_PCI_H | ||
7 | #define _ASM_PCI_H | ||
8 | |||
9 | #include <linux/mm.h> | ||
10 | |||
11 | #ifdef __KERNEL__ | ||
12 | |||
13 | /* | ||
14 | * This file essentially defines the interface between board | ||
15 | * specific PCI code and MIPS common PCI code. Should potentially put | ||
16 | * into include/asm/pci.h file. | ||
17 | */ | ||
18 | |||
19 | #include <linux/ioport.h> | ||
20 | |||
21 | /* | ||
22 | * Each pci channel is a top-level PCI bus seem by CPU. A machine with | ||
23 | * multiple PCI channels may have multiple PCI host controllers or a | ||
24 | * single controller supporting multiple channels. | ||
25 | */ | ||
26 | struct pci_controller { | ||
27 | struct pci_controller *next; | ||
28 | struct pci_bus *bus; | ||
29 | |||
30 | struct pci_ops *pci_ops; | ||
31 | struct resource *mem_resource; | ||
32 | unsigned long mem_offset; | ||
33 | struct resource *io_resource; | ||
34 | unsigned long io_offset; | ||
35 | unsigned long io_map_base; | ||
36 | |||
37 | unsigned int index; | ||
38 | /* For compatibility with current (as of July 2003) pciutils | ||
39 | and XFree86. Eventually will be removed. */ | ||
40 | unsigned int need_domain_info; | ||
41 | |||
42 | int iommu; | ||
43 | |||
44 | /* Optional access methods for reading/writing the bus number | ||
45 | of the PCI controller */ | ||
46 | int (*get_busno)(void); | ||
47 | void (*set_busno)(int busno); | ||
48 | }; | ||
49 | |||
50 | /* | ||
51 | * Used by boards to register their PCI busses before the actual scanning. | ||
52 | */ | ||
53 | extern struct pci_controller * alloc_pci_controller(void); | ||
54 | extern void register_pci_controller(struct pci_controller *hose); | ||
55 | |||
56 | /* | ||
57 | * board supplied pci irq fixup routine | ||
58 | */ | ||
59 | extern int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); | ||
60 | |||
61 | |||
62 | /* Can be used to override the logic in pci_scan_bus for skipping | ||
63 | already-configured bus numbers - to be used for buggy BIOSes | ||
64 | or architectures with incomplete PCI setup by the loader */ | ||
65 | |||
66 | extern unsigned int pcibios_assign_all_busses(void); | ||
67 | |||
68 | #define pcibios_scan_all_fns(a, b) 0 | ||
69 | |||
70 | extern unsigned long PCIBIOS_MIN_IO; | ||
71 | extern unsigned long PCIBIOS_MIN_MEM; | ||
72 | |||
73 | #define PCIBIOS_MIN_CARDBUS_IO 0x4000 | ||
74 | |||
75 | extern void pcibios_set_master(struct pci_dev *dev); | ||
76 | |||
77 | static inline void pcibios_penalize_isa_irq(int irq, int active) | ||
78 | { | ||
79 | /* We don't do dynamic PCI IRQ allocation */ | ||
80 | } | ||
81 | |||
82 | /* | ||
83 | * Dynamic DMA mapping stuff. | ||
84 | * MIPS has everything mapped statically. | ||
85 | */ | ||
86 | |||
87 | #include <linux/types.h> | ||
88 | #include <linux/slab.h> | ||
89 | #include <asm/scatterlist.h> | ||
90 | #include <linux/string.h> | ||
91 | #include <asm/io.h> | ||
92 | |||
93 | struct pci_dev; | ||
94 | |||
95 | /* | ||
96 | * The PCI address space does equal the physical memory address space. The | ||
97 | * networking and block device layers use this boolean for bounce buffer | ||
98 | * decisions. This is set if any hose does not have an IOMMU. | ||
99 | */ | ||
100 | extern unsigned int PCI_DMA_BUS_IS_PHYS; | ||
101 | |||
102 | #ifdef CONFIG_DMA_NEED_PCI_MAP_STATE | ||
103 | |||
104 | /* pci_unmap_{single,page} is not a nop, thus... */ | ||
105 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME; | ||
106 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME; | ||
107 | #define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME) | ||
108 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL)) | ||
109 | #define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME) | ||
110 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL)) | ||
111 | |||
112 | #else /* CONFIG_DMA_NEED_PCI_MAP_STATE */ | ||
113 | |||
114 | /* pci_unmap_{page,single} is a nop so... */ | ||
115 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) | ||
116 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) | ||
117 | #define pci_unmap_addr(PTR, ADDR_NAME) (0) | ||
118 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) | ||
119 | #define pci_unmap_len(PTR, LEN_NAME) (0) | ||
120 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | ||
121 | |||
122 | #endif /* CONFIG_DMA_NEED_PCI_MAP_STATE */ | ||
123 | |||
124 | #ifdef CONFIG_PCI | ||
125 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | ||
126 | enum pci_dma_burst_strategy *strat, | ||
127 | unsigned long *strategy_parameter) | ||
128 | { | ||
129 | *strat = PCI_DMA_BURST_INFINITY; | ||
130 | *strategy_parameter = ~0UL; | ||
131 | } | ||
132 | #endif | ||
133 | |||
134 | extern void pcibios_resource_to_bus(struct pci_dev *dev, | ||
135 | struct pci_bus_region *region, struct resource *res); | ||
136 | |||
137 | extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
138 | struct pci_bus_region *region); | ||
139 | |||
140 | static inline struct resource * | ||
141 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | ||
142 | { | ||
143 | struct resource *root = NULL; | ||
144 | |||
145 | if (res->flags & IORESOURCE_IO) | ||
146 | root = &ioport_resource; | ||
147 | if (res->flags & IORESOURCE_MEM) | ||
148 | root = &iomem_resource; | ||
149 | |||
150 | return root; | ||
151 | } | ||
152 | |||
153 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index | ||
154 | |||
155 | static inline int pci_proc_domain(struct pci_bus *bus) | ||
156 | { | ||
157 | struct pci_controller *hose = bus->sysdata; | ||
158 | return hose->need_domain_info; | ||
159 | } | ||
160 | |||
161 | #endif /* __KERNEL__ */ | ||
162 | |||
163 | /* implement the pci_ DMA API in terms of the generic device dma_ one */ | ||
164 | #include <asm-generic/pci-dma-compat.h> | ||
165 | |||
166 | /* Do platform specific device initialization at pci_enable_device() time */ | ||
167 | extern int pcibios_plat_dev_init(struct pci_dev *dev); | ||
168 | |||
169 | /* Chances are this interrupt is wired PC-style ... */ | ||
170 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | ||
171 | { | ||
172 | return channel ? 15 : 14; | ||
173 | } | ||
174 | |||
175 | extern int pci_probe_only; | ||
176 | |||
177 | extern char * (*pcibios_plat_setup)(char *str); | ||
178 | |||
179 | #endif /* _ASM_PCI_H */ | ||
diff --git a/include/asm-mips/pci/bridge.h b/include/asm-mips/pci/bridge.h deleted file mode 100644 index 5f4b9d4e4114..000000000000 --- a/include/asm-mips/pci/bridge.h +++ /dev/null | |||
@@ -1,854 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * bridge.h - bridge chip header file, derived from IRIX <sys/PCI/bridge.h>, | ||
7 | * revision 1.76. | ||
8 | * | ||
9 | * Copyright (C) 1996, 1999 Silcon Graphics, Inc. | ||
10 | * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) | ||
11 | */ | ||
12 | #ifndef _ASM_PCI_BRIDGE_H | ||
13 | #define _ASM_PCI_BRIDGE_H | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | #include <linux/pci.h> | ||
17 | #include <asm/xtalk/xwidget.h> /* generic widget header */ | ||
18 | #include <asm/sn/types.h> | ||
19 | |||
20 | /* I/O page size */ | ||
21 | |||
22 | #define IOPFNSHIFT 12 /* 4K per mapped page */ | ||
23 | |||
24 | #define IOPGSIZE (1 << IOPFNSHIFT) | ||
25 | #define IOPG(x) ((x) >> IOPFNSHIFT) | ||
26 | #define IOPGOFF(x) ((x) & (IOPGSIZE-1)) | ||
27 | |||
28 | /* Bridge RAM sizes */ | ||
29 | |||
30 | #define BRIDGE_ATE_RAM_SIZE 0x00000400 /* 1kB ATE RAM */ | ||
31 | |||
32 | #define BRIDGE_CONFIG_BASE 0x20000 | ||
33 | #define BRIDGE_CONFIG1_BASE 0x28000 | ||
34 | #define BRIDGE_CONFIG_END 0x30000 | ||
35 | #define BRIDGE_CONFIG_SLOT_SIZE 0x1000 | ||
36 | |||
37 | #define BRIDGE_SSRAM_512K 0x00080000 /* 512kB */ | ||
38 | #define BRIDGE_SSRAM_128K 0x00020000 /* 128kB */ | ||
39 | #define BRIDGE_SSRAM_64K 0x00010000 /* 64kB */ | ||
40 | #define BRIDGE_SSRAM_0K 0x00000000 /* 0kB */ | ||
41 | |||
42 | /* ======================================================================== | ||
43 | * Bridge address map | ||
44 | */ | ||
45 | |||
46 | #ifndef __ASSEMBLY__ | ||
47 | |||
48 | /* | ||
49 | * All accesses to bridge hardware registers must be done | ||
50 | * using 32-bit loads and stores. | ||
51 | */ | ||
52 | typedef u32 bridgereg_t; | ||
53 | |||
54 | typedef u64 bridge_ate_t; | ||
55 | |||
56 | /* pointers to bridge ATEs | ||
57 | * are always "pointer to volatile" | ||
58 | */ | ||
59 | typedef volatile bridge_ate_t *bridge_ate_p; | ||
60 | |||
61 | /* | ||
62 | * It is generally preferred that hardware registers on the bridge | ||
63 | * are located from C code via this structure. | ||
64 | * | ||
65 | * Generated from Bridge spec dated 04oct95 | ||
66 | */ | ||
67 | |||
68 | typedef volatile struct bridge_s { | ||
69 | /* Local Registers 0x000000-0x00FFFF */ | ||
70 | |||
71 | /* standard widget configuration 0x000000-0x000057 */ | ||
72 | widget_cfg_t b_widget; /* 0x000000 */ | ||
73 | |||
74 | /* helper fieldnames for accessing bridge widget */ | ||
75 | |||
76 | #define b_wid_id b_widget.w_id | ||
77 | #define b_wid_stat b_widget.w_status | ||
78 | #define b_wid_err_upper b_widget.w_err_upper_addr | ||
79 | #define b_wid_err_lower b_widget.w_err_lower_addr | ||
80 | #define b_wid_control b_widget.w_control | ||
81 | #define b_wid_req_timeout b_widget.w_req_timeout | ||
82 | #define b_wid_int_upper b_widget.w_intdest_upper_addr | ||
83 | #define b_wid_int_lower b_widget.w_intdest_lower_addr | ||
84 | #define b_wid_err_cmdword b_widget.w_err_cmd_word | ||
85 | #define b_wid_llp b_widget.w_llp_cfg | ||
86 | #define b_wid_tflush b_widget.w_tflush | ||
87 | |||
88 | /* bridge-specific widget configuration 0x000058-0x00007F */ | ||
89 | bridgereg_t _pad_000058; | ||
90 | bridgereg_t b_wid_aux_err; /* 0x00005C */ | ||
91 | bridgereg_t _pad_000060; | ||
92 | bridgereg_t b_wid_resp_upper; /* 0x000064 */ | ||
93 | bridgereg_t _pad_000068; | ||
94 | bridgereg_t b_wid_resp_lower; /* 0x00006C */ | ||
95 | bridgereg_t _pad_000070; | ||
96 | bridgereg_t b_wid_tst_pin_ctrl; /* 0x000074 */ | ||
97 | bridgereg_t _pad_000078[2]; | ||
98 | |||
99 | /* PMU & Map 0x000080-0x00008F */ | ||
100 | bridgereg_t _pad_000080; | ||
101 | bridgereg_t b_dir_map; /* 0x000084 */ | ||
102 | bridgereg_t _pad_000088[2]; | ||
103 | |||
104 | /* SSRAM 0x000090-0x00009F */ | ||
105 | bridgereg_t _pad_000090; | ||
106 | bridgereg_t b_ram_perr; /* 0x000094 */ | ||
107 | bridgereg_t _pad_000098[2]; | ||
108 | |||
109 | /* Arbitration 0x0000A0-0x0000AF */ | ||
110 | bridgereg_t _pad_0000A0; | ||
111 | bridgereg_t b_arb; /* 0x0000A4 */ | ||
112 | bridgereg_t _pad_0000A8[2]; | ||
113 | |||
114 | /* Number In A Can 0x0000B0-0x0000BF */ | ||
115 | bridgereg_t _pad_0000B0; | ||
116 | bridgereg_t b_nic; /* 0x0000B4 */ | ||
117 | bridgereg_t _pad_0000B8[2]; | ||
118 | |||
119 | /* PCI/GIO 0x0000C0-0x0000FF */ | ||
120 | bridgereg_t _pad_0000C0; | ||
121 | bridgereg_t b_bus_timeout; /* 0x0000C4 */ | ||
122 | #define b_pci_bus_timeout b_bus_timeout | ||
123 | |||
124 | bridgereg_t _pad_0000C8; | ||
125 | bridgereg_t b_pci_cfg; /* 0x0000CC */ | ||
126 | bridgereg_t _pad_0000D0; | ||
127 | bridgereg_t b_pci_err_upper; /* 0x0000D4 */ | ||
128 | bridgereg_t _pad_0000D8; | ||
129 | bridgereg_t b_pci_err_lower; /* 0x0000DC */ | ||
130 | bridgereg_t _pad_0000E0[8]; | ||
131 | #define b_gio_err_lower b_pci_err_lower | ||
132 | #define b_gio_err_upper b_pci_err_upper | ||
133 | |||
134 | /* Interrupt 0x000100-0x0001FF */ | ||
135 | bridgereg_t _pad_000100; | ||
136 | bridgereg_t b_int_status; /* 0x000104 */ | ||
137 | bridgereg_t _pad_000108; | ||
138 | bridgereg_t b_int_enable; /* 0x00010C */ | ||
139 | bridgereg_t _pad_000110; | ||
140 | bridgereg_t b_int_rst_stat; /* 0x000114 */ | ||
141 | bridgereg_t _pad_000118; | ||
142 | bridgereg_t b_int_mode; /* 0x00011C */ | ||
143 | bridgereg_t _pad_000120; | ||
144 | bridgereg_t b_int_device; /* 0x000124 */ | ||
145 | bridgereg_t _pad_000128; | ||
146 | bridgereg_t b_int_host_err; /* 0x00012C */ | ||
147 | |||
148 | struct { | ||
149 | bridgereg_t __pad; /* 0x0001{30,,,68} */ | ||
150 | bridgereg_t addr; /* 0x0001{34,,,6C} */ | ||
151 | } b_int_addr[8]; /* 0x000130 */ | ||
152 | |||
153 | bridgereg_t _pad_000170[36]; | ||
154 | |||
155 | /* Device 0x000200-0x0003FF */ | ||
156 | struct { | ||
157 | bridgereg_t __pad; /* 0x0002{00,,,38} */ | ||
158 | bridgereg_t reg; /* 0x0002{04,,,3C} */ | ||
159 | } b_device[8]; /* 0x000200 */ | ||
160 | |||
161 | struct { | ||
162 | bridgereg_t __pad; /* 0x0002{40,,,78} */ | ||
163 | bridgereg_t reg; /* 0x0002{44,,,7C} */ | ||
164 | } b_wr_req_buf[8]; /* 0x000240 */ | ||
165 | |||
166 | struct { | ||
167 | bridgereg_t __pad; /* 0x0002{80,,,88} */ | ||
168 | bridgereg_t reg; /* 0x0002{84,,,8C} */ | ||
169 | } b_rrb_map[2]; /* 0x000280 */ | ||
170 | #define b_even_resp b_rrb_map[0].reg /* 0x000284 */ | ||
171 | #define b_odd_resp b_rrb_map[1].reg /* 0x00028C */ | ||
172 | |||
173 | bridgereg_t _pad_000290; | ||
174 | bridgereg_t b_resp_status; /* 0x000294 */ | ||
175 | bridgereg_t _pad_000298; | ||
176 | bridgereg_t b_resp_clear; /* 0x00029C */ | ||
177 | |||
178 | bridgereg_t _pad_0002A0[24]; | ||
179 | |||
180 | char _pad_000300[0x10000 - 0x000300]; | ||
181 | |||
182 | /* Internal Address Translation Entry RAM 0x010000-0x0103FF */ | ||
183 | union { | ||
184 | bridge_ate_t wr; /* write-only */ | ||
185 | struct { | ||
186 | bridgereg_t _p_pad; | ||
187 | bridgereg_t rd; /* read-only */ | ||
188 | } hi; | ||
189 | } b_int_ate_ram[128]; | ||
190 | |||
191 | char _pad_010400[0x11000 - 0x010400]; | ||
192 | |||
193 | /* Internal Address Translation Entry RAM LOW 0x011000-0x0113FF */ | ||
194 | struct { | ||
195 | bridgereg_t _p_pad; | ||
196 | bridgereg_t rd; /* read-only */ | ||
197 | } b_int_ate_ram_lo[128]; | ||
198 | |||
199 | char _pad_011400[0x20000 - 0x011400]; | ||
200 | |||
201 | /* PCI Device Configuration Spaces 0x020000-0x027FFF */ | ||
202 | union { /* make all access sizes available. */ | ||
203 | u8 c[0x1000 / 1]; | ||
204 | u16 s[0x1000 / 2]; | ||
205 | u32 l[0x1000 / 4]; | ||
206 | u64 d[0x1000 / 8]; | ||
207 | union { | ||
208 | u8 c[0x100 / 1]; | ||
209 | u16 s[0x100 / 2]; | ||
210 | u32 l[0x100 / 4]; | ||
211 | u64 d[0x100 / 8]; | ||
212 | } f[8]; | ||
213 | } b_type0_cfg_dev[8]; /* 0x020000 */ | ||
214 | |||
215 | /* PCI Type 1 Configuration Space 0x028000-0x028FFF */ | ||
216 | union { /* make all access sizes available. */ | ||
217 | u8 c[0x1000 / 1]; | ||
218 | u16 s[0x1000 / 2]; | ||
219 | u32 l[0x1000 / 4]; | ||
220 | u64 d[0x1000 / 8]; | ||
221 | } b_type1_cfg; /* 0x028000-0x029000 */ | ||
222 | |||
223 | char _pad_029000[0x007000]; /* 0x029000-0x030000 */ | ||
224 | |||
225 | /* PCI Interrupt Acknowledge Cycle 0x030000 */ | ||
226 | union { | ||
227 | u8 c[8 / 1]; | ||
228 | u16 s[8 / 2]; | ||
229 | u32 l[8 / 4]; | ||
230 | u64 d[8 / 8]; | ||
231 | } b_pci_iack; /* 0x030000 */ | ||
232 | |||
233 | u8 _pad_030007[0x04fff8]; /* 0x030008-0x07FFFF */ | ||
234 | |||
235 | /* External Address Translation Entry RAM 0x080000-0x0FFFFF */ | ||
236 | bridge_ate_t b_ext_ate_ram[0x10000]; | ||
237 | |||
238 | /* Reserved 0x100000-0x1FFFFF */ | ||
239 | char _pad_100000[0x200000-0x100000]; | ||
240 | |||
241 | /* PCI/GIO Device Spaces 0x200000-0xBFFFFF */ | ||
242 | union { /* make all access sizes available. */ | ||
243 | u8 c[0x100000 / 1]; | ||
244 | u16 s[0x100000 / 2]; | ||
245 | u32 l[0x100000 / 4]; | ||
246 | u64 d[0x100000 / 8]; | ||
247 | } b_devio_raw[10]; /* 0x200000 */ | ||
248 | |||
249 | /* b_devio macro is a bit strange; it reflects the | ||
250 | * fact that the Bridge ASIC provides 2M for the | ||
251 | * first two DevIO windows and 1M for the other six. | ||
252 | */ | ||
253 | #define b_devio(n) b_devio_raw[((n)<2)?(n*2):(n+2)] | ||
254 | |||
255 | /* External Flash Proms 1,0 0xC00000-0xFFFFFF */ | ||
256 | union { /* make all access sizes available. */ | ||
257 | u8 c[0x400000 / 1]; /* read-only */ | ||
258 | u16 s[0x400000 / 2]; /* read-write */ | ||
259 | u32 l[0x400000 / 4]; /* read-only */ | ||
260 | u64 d[0x400000 / 8]; /* read-only */ | ||
261 | } b_external_flash; /* 0xC00000 */ | ||
262 | } bridge_t; | ||
263 | |||
264 | /* | ||
265 | * Field formats for Error Command Word and Auxillary Error Command Word | ||
266 | * of bridge. | ||
267 | */ | ||
268 | typedef struct bridge_err_cmdword_s { | ||
269 | union { | ||
270 | u32 cmd_word; | ||
271 | struct { | ||
272 | u32 didn:4, /* Destination ID */ | ||
273 | sidn:4, /* Source ID */ | ||
274 | pactyp:4, /* Packet type */ | ||
275 | tnum:5, /* Trans Number */ | ||
276 | coh:1, /* Coh Transacti */ | ||
277 | ds:2, /* Data size */ | ||
278 | gbr:1, /* GBR enable */ | ||
279 | vbpm:1, /* VBPM message */ | ||
280 | error:1, /* Error occurred */ | ||
281 | barr:1, /* Barrier op */ | ||
282 | rsvd:8; | ||
283 | } berr_st; | ||
284 | } berr_un; | ||
285 | } bridge_err_cmdword_t; | ||
286 | |||
287 | #define berr_field berr_un.berr_st | ||
288 | #endif /* !__ASSEMBLY__ */ | ||
289 | |||
290 | /* | ||
291 | * The values of these macros can and should be crosschecked | ||
292 | * regularly against the offsets of the like-named fields | ||
293 | * within the "bridge_t" structure above. | ||
294 | */ | ||
295 | |||
296 | /* Byte offset macros for Bridge internal registers */ | ||
297 | |||
298 | #define BRIDGE_WID_ID WIDGET_ID | ||
299 | #define BRIDGE_WID_STAT WIDGET_STATUS | ||
300 | #define BRIDGE_WID_ERR_UPPER WIDGET_ERR_UPPER_ADDR | ||
301 | #define BRIDGE_WID_ERR_LOWER WIDGET_ERR_LOWER_ADDR | ||
302 | #define BRIDGE_WID_CONTROL WIDGET_CONTROL | ||
303 | #define BRIDGE_WID_REQ_TIMEOUT WIDGET_REQ_TIMEOUT | ||
304 | #define BRIDGE_WID_INT_UPPER WIDGET_INTDEST_UPPER_ADDR | ||
305 | #define BRIDGE_WID_INT_LOWER WIDGET_INTDEST_LOWER_ADDR | ||
306 | #define BRIDGE_WID_ERR_CMDWORD WIDGET_ERR_CMD_WORD | ||
307 | #define BRIDGE_WID_LLP WIDGET_LLP_CFG | ||
308 | #define BRIDGE_WID_TFLUSH WIDGET_TFLUSH | ||
309 | |||
310 | #define BRIDGE_WID_AUX_ERR 0x00005C /* Aux Error Command Word */ | ||
311 | #define BRIDGE_WID_RESP_UPPER 0x000064 /* Response Buf Upper Addr */ | ||
312 | #define BRIDGE_WID_RESP_LOWER 0x00006C /* Response Buf Lower Addr */ | ||
313 | #define BRIDGE_WID_TST_PIN_CTRL 0x000074 /* Test pin control */ | ||
314 | |||
315 | #define BRIDGE_DIR_MAP 0x000084 /* Direct Map reg */ | ||
316 | |||
317 | #define BRIDGE_RAM_PERR 0x000094 /* SSRAM Parity Error */ | ||
318 | |||
319 | #define BRIDGE_ARB 0x0000A4 /* Arbitration Priority reg */ | ||
320 | |||
321 | #define BRIDGE_NIC 0x0000B4 /* Number In A Can */ | ||
322 | |||
323 | #define BRIDGE_BUS_TIMEOUT 0x0000C4 /* Bus Timeout Register */ | ||
324 | #define BRIDGE_PCI_BUS_TIMEOUT BRIDGE_BUS_TIMEOUT | ||
325 | #define BRIDGE_PCI_CFG 0x0000CC /* PCI Type 1 Config reg */ | ||
326 | #define BRIDGE_PCI_ERR_UPPER 0x0000D4 /* PCI error Upper Addr */ | ||
327 | #define BRIDGE_PCI_ERR_LOWER 0x0000DC /* PCI error Lower Addr */ | ||
328 | |||
329 | #define BRIDGE_INT_STATUS 0x000104 /* Interrupt Status */ | ||
330 | #define BRIDGE_INT_ENABLE 0x00010C /* Interrupt Enables */ | ||
331 | #define BRIDGE_INT_RST_STAT 0x000114 /* Reset Intr Status */ | ||
332 | #define BRIDGE_INT_MODE 0x00011C /* Interrupt Mode */ | ||
333 | #define BRIDGE_INT_DEVICE 0x000124 /* Interrupt Device */ | ||
334 | #define BRIDGE_INT_HOST_ERR 0x00012C /* Host Error Field */ | ||
335 | |||
336 | #define BRIDGE_INT_ADDR0 0x000134 /* Host Address Reg */ | ||
337 | #define BRIDGE_INT_ADDR_OFF 0x000008 /* Host Addr offset (1..7) */ | ||
338 | #define BRIDGE_INT_ADDR(x) (BRIDGE_INT_ADDR0+(x)*BRIDGE_INT_ADDR_OFF) | ||
339 | |||
340 | #define BRIDGE_DEVICE0 0x000204 /* Device 0 */ | ||
341 | #define BRIDGE_DEVICE_OFF 0x000008 /* Device offset (1..7) */ | ||
342 | #define BRIDGE_DEVICE(x) (BRIDGE_DEVICE0+(x)*BRIDGE_DEVICE_OFF) | ||
343 | |||
344 | #define BRIDGE_WR_REQ_BUF0 0x000244 /* Write Request Buffer 0 */ | ||
345 | #define BRIDGE_WR_REQ_BUF_OFF 0x000008 /* Buffer Offset (1..7) */ | ||
346 | #define BRIDGE_WR_REQ_BUF(x) (BRIDGE_WR_REQ_BUF0+(x)*BRIDGE_WR_REQ_BUF_OFF) | ||
347 | |||
348 | #define BRIDGE_EVEN_RESP 0x000284 /* Even Device Response Buf */ | ||
349 | #define BRIDGE_ODD_RESP 0x00028C /* Odd Device Response Buf */ | ||
350 | |||
351 | #define BRIDGE_RESP_STATUS 0x000294 /* Read Response Status reg */ | ||
352 | #define BRIDGE_RESP_CLEAR 0x00029C /* Read Response Clear reg */ | ||
353 | |||
354 | /* Byte offset macros for Bridge I/O space */ | ||
355 | |||
356 | #define BRIDGE_ATE_RAM 0x00010000 /* Internal Addr Xlat Ram */ | ||
357 | |||
358 | #define BRIDGE_TYPE0_CFG_DEV0 0x00020000 /* Type 0 Cfg, Device 0 */ | ||
359 | #define BRIDGE_TYPE0_CFG_SLOT_OFF 0x00001000 /* Type 0 Cfg Slot Offset (1..7) */ | ||
360 | #define BRIDGE_TYPE0_CFG_FUNC_OFF 0x00000100 /* Type 0 Cfg Func Offset (1..7) */ | ||
361 | #define BRIDGE_TYPE0_CFG_DEV(s) (BRIDGE_TYPE0_CFG_DEV0+\ | ||
362 | (s)*BRIDGE_TYPE0_CFG_SLOT_OFF) | ||
363 | #define BRIDGE_TYPE0_CFG_DEVF(s, f) (BRIDGE_TYPE0_CFG_DEV0+\ | ||
364 | (s)*BRIDGE_TYPE0_CFG_SLOT_OFF+\ | ||
365 | (f)*BRIDGE_TYPE0_CFG_FUNC_OFF) | ||
366 | |||
367 | #define BRIDGE_TYPE1_CFG 0x00028000 /* Type 1 Cfg space */ | ||
368 | |||
369 | #define BRIDGE_PCI_IACK 0x00030000 /* PCI Interrupt Ack */ | ||
370 | #define BRIDGE_EXT_SSRAM 0x00080000 /* Extern SSRAM (ATE) */ | ||
371 | |||
372 | /* Byte offset macros for Bridge device IO spaces */ | ||
373 | |||
374 | #define BRIDGE_DEV_CNT 8 /* Up to 8 devices per bridge */ | ||
375 | #define BRIDGE_DEVIO0 0x00200000 /* Device IO 0 Addr */ | ||
376 | #define BRIDGE_DEVIO1 0x00400000 /* Device IO 1 Addr */ | ||
377 | #define BRIDGE_DEVIO2 0x00600000 /* Device IO 2 Addr */ | ||
378 | #define BRIDGE_DEVIO_OFF 0x00100000 /* Device IO Offset (3..7) */ | ||
379 | |||
380 | #define BRIDGE_DEVIO_2MB 0x00200000 /* Device IO Offset (0..1) */ | ||
381 | #define BRIDGE_DEVIO_1MB 0x00100000 /* Device IO Offset (2..7) */ | ||
382 | |||
383 | #define BRIDGE_DEVIO(x) ((x)<=1 ? BRIDGE_DEVIO0+(x)*BRIDGE_DEVIO_2MB : BRIDGE_DEVIO2+((x)-2)*BRIDGE_DEVIO_1MB) | ||
384 | |||
385 | #define BRIDGE_EXTERNAL_FLASH 0x00C00000 /* External Flash PROMS */ | ||
386 | |||
387 | /* ======================================================================== | ||
388 | * Bridge register bit field definitions | ||
389 | */ | ||
390 | |||
391 | /* Widget part number of bridge */ | ||
392 | #define BRIDGE_WIDGET_PART_NUM 0xc002 | ||
393 | #define XBRIDGE_WIDGET_PART_NUM 0xd002 | ||
394 | |||
395 | /* Manufacturer of bridge */ | ||
396 | #define BRIDGE_WIDGET_MFGR_NUM 0x036 | ||
397 | #define XBRIDGE_WIDGET_MFGR_NUM 0x024 | ||
398 | |||
399 | /* Revision numbers for known Bridge revisions */ | ||
400 | #define BRIDGE_REV_A 0x1 | ||
401 | #define BRIDGE_REV_B 0x2 | ||
402 | #define BRIDGE_REV_C 0x3 | ||
403 | #define BRIDGE_REV_D 0x4 | ||
404 | |||
405 | /* Bridge widget status register bits definition */ | ||
406 | |||
407 | #define BRIDGE_STAT_LLP_REC_CNT (0xFFu << 24) | ||
408 | #define BRIDGE_STAT_LLP_TX_CNT (0xFF << 16) | ||
409 | #define BRIDGE_STAT_FLASH_SELECT (0x1 << 6) | ||
410 | #define BRIDGE_STAT_PCI_GIO_N (0x1 << 5) | ||
411 | #define BRIDGE_STAT_PENDING (0x1F << 0) | ||
412 | |||
413 | /* Bridge widget control register bits definition */ | ||
414 | #define BRIDGE_CTRL_FLASH_WR_EN (0x1ul << 31) | ||
415 | #define BRIDGE_CTRL_EN_CLK50 (0x1 << 30) | ||
416 | #define BRIDGE_CTRL_EN_CLK40 (0x1 << 29) | ||
417 | #define BRIDGE_CTRL_EN_CLK33 (0x1 << 28) | ||
418 | #define BRIDGE_CTRL_RST(n) ((n) << 24) | ||
419 | #define BRIDGE_CTRL_RST_MASK (BRIDGE_CTRL_RST(0xF)) | ||
420 | #define BRIDGE_CTRL_RST_PIN(x) (BRIDGE_CTRL_RST(0x1 << (x))) | ||
421 | #define BRIDGE_CTRL_IO_SWAP (0x1 << 23) | ||
422 | #define BRIDGE_CTRL_MEM_SWAP (0x1 << 22) | ||
423 | #define BRIDGE_CTRL_PAGE_SIZE (0x1 << 21) | ||
424 | #define BRIDGE_CTRL_SS_PAR_BAD (0x1 << 20) | ||
425 | #define BRIDGE_CTRL_SS_PAR_EN (0x1 << 19) | ||
426 | #define BRIDGE_CTRL_SSRAM_SIZE(n) ((n) << 17) | ||
427 | #define BRIDGE_CTRL_SSRAM_SIZE_MASK (BRIDGE_CTRL_SSRAM_SIZE(0x3)) | ||
428 | #define BRIDGE_CTRL_SSRAM_512K (BRIDGE_CTRL_SSRAM_SIZE(0x3)) | ||
429 | #define BRIDGE_CTRL_SSRAM_128K (BRIDGE_CTRL_SSRAM_SIZE(0x2)) | ||
430 | #define BRIDGE_CTRL_SSRAM_64K (BRIDGE_CTRL_SSRAM_SIZE(0x1)) | ||
431 | #define BRIDGE_CTRL_SSRAM_1K (BRIDGE_CTRL_SSRAM_SIZE(0x0)) | ||
432 | #define BRIDGE_CTRL_F_BAD_PKT (0x1 << 16) | ||
433 | #define BRIDGE_CTRL_LLP_XBAR_CRD(n) ((n) << 12) | ||
434 | #define BRIDGE_CTRL_LLP_XBAR_CRD_MASK (BRIDGE_CTRL_LLP_XBAR_CRD(0xf)) | ||
435 | #define BRIDGE_CTRL_CLR_RLLP_CNT (0x1 << 11) | ||
436 | #define BRIDGE_CTRL_CLR_TLLP_CNT (0x1 << 10) | ||
437 | #define BRIDGE_CTRL_SYS_END (0x1 << 9) | ||
438 | #define BRIDGE_CTRL_MAX_TRANS(n) ((n) << 4) | ||
439 | #define BRIDGE_CTRL_MAX_TRANS_MASK (BRIDGE_CTRL_MAX_TRANS(0x1f)) | ||
440 | #define BRIDGE_CTRL_WIDGET_ID(n) ((n) << 0) | ||
441 | #define BRIDGE_CTRL_WIDGET_ID_MASK (BRIDGE_CTRL_WIDGET_ID(0xf)) | ||
442 | |||
443 | /* Bridge Response buffer Error Upper Register bit fields definition */ | ||
444 | #define BRIDGE_RESP_ERRUPPR_DEVNUM_SHFT (20) | ||
445 | #define BRIDGE_RESP_ERRUPPR_DEVNUM_MASK (0x7 << BRIDGE_RESP_ERRUPPR_DEVNUM_SHFT) | ||
446 | #define BRIDGE_RESP_ERRUPPR_BUFNUM_SHFT (16) | ||
447 | #define BRIDGE_RESP_ERRUPPR_BUFNUM_MASK (0xF << BRIDGE_RESP_ERRUPPR_BUFNUM_SHFT) | ||
448 | #define BRIDGE_RESP_ERRRUPPR_BUFMASK (0xFFFF) | ||
449 | |||
450 | #define BRIDGE_RESP_ERRUPPR_BUFNUM(x) \ | ||
451 | (((x) & BRIDGE_RESP_ERRUPPR_BUFNUM_MASK) >> \ | ||
452 | BRIDGE_RESP_ERRUPPR_BUFNUM_SHFT) | ||
453 | |||
454 | #define BRIDGE_RESP_ERRUPPR_DEVICE(x) \ | ||
455 | (((x) & BRIDGE_RESP_ERRUPPR_DEVNUM_MASK) >> \ | ||
456 | BRIDGE_RESP_ERRUPPR_DEVNUM_SHFT) | ||
457 | |||
458 | /* Bridge direct mapping register bits definition */ | ||
459 | #define BRIDGE_DIRMAP_W_ID_SHFT 20 | ||
460 | #define BRIDGE_DIRMAP_W_ID (0xf << BRIDGE_DIRMAP_W_ID_SHFT) | ||
461 | #define BRIDGE_DIRMAP_RMF_64 (0x1 << 18) | ||
462 | #define BRIDGE_DIRMAP_ADD512 (0x1 << 17) | ||
463 | #define BRIDGE_DIRMAP_OFF (0x1ffff << 0) | ||
464 | #define BRIDGE_DIRMAP_OFF_ADDRSHFT (31) /* lsbit of DIRMAP_OFF is xtalk address bit 31 */ | ||
465 | |||
466 | /* Bridge Arbitration register bits definition */ | ||
467 | #define BRIDGE_ARB_REQ_WAIT_TICK(x) ((x) << 16) | ||
468 | #define BRIDGE_ARB_REQ_WAIT_TICK_MASK BRIDGE_ARB_REQ_WAIT_TICK(0x3) | ||
469 | #define BRIDGE_ARB_REQ_WAIT_EN(x) ((x) << 8) | ||
470 | #define BRIDGE_ARB_REQ_WAIT_EN_MASK BRIDGE_ARB_REQ_WAIT_EN(0xff) | ||
471 | #define BRIDGE_ARB_FREEZE_GNT (1 << 6) | ||
472 | #define BRIDGE_ARB_HPRI_RING_B2 (1 << 5) | ||
473 | #define BRIDGE_ARB_HPRI_RING_B1 (1 << 4) | ||
474 | #define BRIDGE_ARB_HPRI_RING_B0 (1 << 3) | ||
475 | #define BRIDGE_ARB_LPRI_RING_B2 (1 << 2) | ||
476 | #define BRIDGE_ARB_LPRI_RING_B1 (1 << 1) | ||
477 | #define BRIDGE_ARB_LPRI_RING_B0 (1 << 0) | ||
478 | |||
479 | /* Bridge Bus time-out register bits definition */ | ||
480 | #define BRIDGE_BUS_PCI_RETRY_HLD(x) ((x) << 16) | ||
481 | #define BRIDGE_BUS_PCI_RETRY_HLD_MASK BRIDGE_BUS_PCI_RETRY_HLD(0x1f) | ||
482 | #define BRIDGE_BUS_GIO_TIMEOUT (1 << 12) | ||
483 | #define BRIDGE_BUS_PCI_RETRY_CNT(x) ((x) << 0) | ||
484 | #define BRIDGE_BUS_PCI_RETRY_MASK BRIDGE_BUS_PCI_RETRY_CNT(0x3ff) | ||
485 | |||
486 | /* Bridge interrupt status register bits definition */ | ||
487 | #define BRIDGE_ISR_MULTI_ERR (0x1u << 31) | ||
488 | #define BRIDGE_ISR_PMU_ESIZE_FAULT (0x1 << 30) | ||
489 | #define BRIDGE_ISR_UNEXP_RESP (0x1 << 29) | ||
490 | #define BRIDGE_ISR_BAD_XRESP_PKT (0x1 << 28) | ||
491 | #define BRIDGE_ISR_BAD_XREQ_PKT (0x1 << 27) | ||
492 | #define BRIDGE_ISR_RESP_XTLK_ERR (0x1 << 26) | ||
493 | #define BRIDGE_ISR_REQ_XTLK_ERR (0x1 << 25) | ||
494 | #define BRIDGE_ISR_INVLD_ADDR (0x1 << 24) | ||
495 | #define BRIDGE_ISR_UNSUPPORTED_XOP (0x1 << 23) | ||
496 | #define BRIDGE_ISR_XREQ_FIFO_OFLOW (0x1 << 22) | ||
497 | #define BRIDGE_ISR_LLP_REC_SNERR (0x1 << 21) | ||
498 | #define BRIDGE_ISR_LLP_REC_CBERR (0x1 << 20) | ||
499 | #define BRIDGE_ISR_LLP_RCTY (0x1 << 19) | ||
500 | #define BRIDGE_ISR_LLP_TX_RETRY (0x1 << 18) | ||
501 | #define BRIDGE_ISR_LLP_TCTY (0x1 << 17) | ||
502 | #define BRIDGE_ISR_SSRAM_PERR (0x1 << 16) | ||
503 | #define BRIDGE_ISR_PCI_ABORT (0x1 << 15) | ||
504 | #define BRIDGE_ISR_PCI_PARITY (0x1 << 14) | ||
505 | #define BRIDGE_ISR_PCI_SERR (0x1 << 13) | ||
506 | #define BRIDGE_ISR_PCI_PERR (0x1 << 12) | ||
507 | #define BRIDGE_ISR_PCI_MST_TIMEOUT (0x1 << 11) | ||
508 | #define BRIDGE_ISR_GIO_MST_TIMEOUT BRIDGE_ISR_PCI_MST_TIMEOUT | ||
509 | #define BRIDGE_ISR_PCI_RETRY_CNT (0x1 << 10) | ||
510 | #define BRIDGE_ISR_XREAD_REQ_TIMEOUT (0x1 << 9) | ||
511 | #define BRIDGE_ISR_GIO_B_ENBL_ERR (0x1 << 8) | ||
512 | #define BRIDGE_ISR_INT_MSK (0xff << 0) | ||
513 | #define BRIDGE_ISR_INT(x) (0x1 << (x)) | ||
514 | |||
515 | #define BRIDGE_ISR_LINK_ERROR \ | ||
516 | (BRIDGE_ISR_LLP_REC_SNERR|BRIDGE_ISR_LLP_REC_CBERR| \ | ||
517 | BRIDGE_ISR_LLP_RCTY|BRIDGE_ISR_LLP_TX_RETRY| \ | ||
518 | BRIDGE_ISR_LLP_TCTY) | ||
519 | |||
520 | #define BRIDGE_ISR_PCIBUS_PIOERR \ | ||
521 | (BRIDGE_ISR_PCI_MST_TIMEOUT|BRIDGE_ISR_PCI_ABORT) | ||
522 | |||
523 | #define BRIDGE_ISR_PCIBUS_ERROR \ | ||
524 | (BRIDGE_ISR_PCIBUS_PIOERR|BRIDGE_ISR_PCI_PERR| \ | ||
525 | BRIDGE_ISR_PCI_SERR|BRIDGE_ISR_PCI_RETRY_CNT| \ | ||
526 | BRIDGE_ISR_PCI_PARITY) | ||
527 | |||
528 | #define BRIDGE_ISR_XTALK_ERROR \ | ||
529 | (BRIDGE_ISR_XREAD_REQ_TIMEOUT|BRIDGE_ISR_XREQ_FIFO_OFLOW|\ | ||
530 | BRIDGE_ISR_UNSUPPORTED_XOP|BRIDGE_ISR_INVLD_ADDR| \ | ||
531 | BRIDGE_ISR_REQ_XTLK_ERR|BRIDGE_ISR_RESP_XTLK_ERR| \ | ||
532 | BRIDGE_ISR_BAD_XREQ_PKT|BRIDGE_ISR_BAD_XRESP_PKT| \ | ||
533 | BRIDGE_ISR_UNEXP_RESP) | ||
534 | |||
535 | #define BRIDGE_ISR_ERRORS \ | ||
536 | (BRIDGE_ISR_LINK_ERROR|BRIDGE_ISR_PCIBUS_ERROR| \ | ||
537 | BRIDGE_ISR_XTALK_ERROR|BRIDGE_ISR_SSRAM_PERR| \ | ||
538 | BRIDGE_ISR_PMU_ESIZE_FAULT) | ||
539 | |||
540 | /* | ||
541 | * List of Errors which are fatal and kill the system | ||
542 | */ | ||
543 | #define BRIDGE_ISR_ERROR_FATAL \ | ||
544 | ((BRIDGE_ISR_XTALK_ERROR & ~BRIDGE_ISR_XREAD_REQ_TIMEOUT)|\ | ||
545 | BRIDGE_ISR_PCI_SERR|BRIDGE_ISR_PCI_PARITY ) | ||
546 | |||
547 | #define BRIDGE_ISR_ERROR_DUMP \ | ||
548 | (BRIDGE_ISR_PCIBUS_ERROR|BRIDGE_ISR_PMU_ESIZE_FAULT| \ | ||
549 | BRIDGE_ISR_XTALK_ERROR|BRIDGE_ISR_SSRAM_PERR) | ||
550 | |||
551 | /* Bridge interrupt enable register bits definition */ | ||
552 | #define BRIDGE_IMR_UNEXP_RESP BRIDGE_ISR_UNEXP_RESP | ||
553 | #define BRIDGE_IMR_PMU_ESIZE_FAULT BRIDGE_ISR_PMU_ESIZE_FAULT | ||
554 | #define BRIDGE_IMR_BAD_XRESP_PKT BRIDGE_ISR_BAD_XRESP_PKT | ||
555 | #define BRIDGE_IMR_BAD_XREQ_PKT BRIDGE_ISR_BAD_XREQ_PKT | ||
556 | #define BRIDGE_IMR_RESP_XTLK_ERR BRIDGE_ISR_RESP_XTLK_ERR | ||
557 | #define BRIDGE_IMR_REQ_XTLK_ERR BRIDGE_ISR_REQ_XTLK_ERR | ||
558 | #define BRIDGE_IMR_INVLD_ADDR BRIDGE_ISR_INVLD_ADDR | ||
559 | #define BRIDGE_IMR_UNSUPPORTED_XOP BRIDGE_ISR_UNSUPPORTED_XOP | ||
560 | #define BRIDGE_IMR_XREQ_FIFO_OFLOW BRIDGE_ISR_XREQ_FIFO_OFLOW | ||
561 | #define BRIDGE_IMR_LLP_REC_SNERR BRIDGE_ISR_LLP_REC_SNERR | ||
562 | #define BRIDGE_IMR_LLP_REC_CBERR BRIDGE_ISR_LLP_REC_CBERR | ||
563 | #define BRIDGE_IMR_LLP_RCTY BRIDGE_ISR_LLP_RCTY | ||
564 | #define BRIDGE_IMR_LLP_TX_RETRY BRIDGE_ISR_LLP_TX_RETRY | ||
565 | #define BRIDGE_IMR_LLP_TCTY BRIDGE_ISR_LLP_TCTY | ||
566 | #define BRIDGE_IMR_SSRAM_PERR BRIDGE_ISR_SSRAM_PERR | ||
567 | #define BRIDGE_IMR_PCI_ABORT BRIDGE_ISR_PCI_ABORT | ||
568 | #define BRIDGE_IMR_PCI_PARITY BRIDGE_ISR_PCI_PARITY | ||
569 | #define BRIDGE_IMR_PCI_SERR BRIDGE_ISR_PCI_SERR | ||
570 | #define BRIDGE_IMR_PCI_PERR BRIDGE_ISR_PCI_PERR | ||
571 | #define BRIDGE_IMR_PCI_MST_TIMEOUT BRIDGE_ISR_PCI_MST_TIMEOUT | ||
572 | #define BRIDGE_IMR_GIO_MST_TIMEOUT BRIDGE_ISR_GIO_MST_TIMEOUT | ||
573 | #define BRIDGE_IMR_PCI_RETRY_CNT BRIDGE_ISR_PCI_RETRY_CNT | ||
574 | #define BRIDGE_IMR_XREAD_REQ_TIMEOUT BRIDGE_ISR_XREAD_REQ_TIMEOUT | ||
575 | #define BRIDGE_IMR_GIO_B_ENBL_ERR BRIDGE_ISR_GIO_B_ENBL_ERR | ||
576 | #define BRIDGE_IMR_INT_MSK BRIDGE_ISR_INT_MSK | ||
577 | #define BRIDGE_IMR_INT(x) BRIDGE_ISR_INT(x) | ||
578 | |||
579 | /* Bridge interrupt reset register bits definition */ | ||
580 | #define BRIDGE_IRR_MULTI_CLR (0x1 << 6) | ||
581 | #define BRIDGE_IRR_CRP_GRP_CLR (0x1 << 5) | ||
582 | #define BRIDGE_IRR_RESP_BUF_GRP_CLR (0x1 << 4) | ||
583 | #define BRIDGE_IRR_REQ_DSP_GRP_CLR (0x1 << 3) | ||
584 | #define BRIDGE_IRR_LLP_GRP_CLR (0x1 << 2) | ||
585 | #define BRIDGE_IRR_SSRAM_GRP_CLR (0x1 << 1) | ||
586 | #define BRIDGE_IRR_PCI_GRP_CLR (0x1 << 0) | ||
587 | #define BRIDGE_IRR_GIO_GRP_CLR (0x1 << 0) | ||
588 | #define BRIDGE_IRR_ALL_CLR 0x7f | ||
589 | |||
590 | #define BRIDGE_IRR_CRP_GRP (BRIDGE_ISR_UNEXP_RESP | \ | ||
591 | BRIDGE_ISR_XREQ_FIFO_OFLOW) | ||
592 | #define BRIDGE_IRR_RESP_BUF_GRP (BRIDGE_ISR_BAD_XRESP_PKT | \ | ||
593 | BRIDGE_ISR_RESP_XTLK_ERR | \ | ||
594 | BRIDGE_ISR_XREAD_REQ_TIMEOUT) | ||
595 | #define BRIDGE_IRR_REQ_DSP_GRP (BRIDGE_ISR_UNSUPPORTED_XOP | \ | ||
596 | BRIDGE_ISR_BAD_XREQ_PKT | \ | ||
597 | BRIDGE_ISR_REQ_XTLK_ERR | \ | ||
598 | BRIDGE_ISR_INVLD_ADDR) | ||
599 | #define BRIDGE_IRR_LLP_GRP (BRIDGE_ISR_LLP_REC_SNERR | \ | ||
600 | BRIDGE_ISR_LLP_REC_CBERR | \ | ||
601 | BRIDGE_ISR_LLP_RCTY | \ | ||
602 | BRIDGE_ISR_LLP_TX_RETRY | \ | ||
603 | BRIDGE_ISR_LLP_TCTY) | ||
604 | #define BRIDGE_IRR_SSRAM_GRP (BRIDGE_ISR_SSRAM_PERR | \ | ||
605 | BRIDGE_ISR_PMU_ESIZE_FAULT) | ||
606 | #define BRIDGE_IRR_PCI_GRP (BRIDGE_ISR_PCI_ABORT | \ | ||
607 | BRIDGE_ISR_PCI_PARITY | \ | ||
608 | BRIDGE_ISR_PCI_SERR | \ | ||
609 | BRIDGE_ISR_PCI_PERR | \ | ||
610 | BRIDGE_ISR_PCI_MST_TIMEOUT | \ | ||
611 | BRIDGE_ISR_PCI_RETRY_CNT) | ||
612 | |||
613 | #define BRIDGE_IRR_GIO_GRP (BRIDGE_ISR_GIO_B_ENBL_ERR | \ | ||
614 | BRIDGE_ISR_GIO_MST_TIMEOUT) | ||
615 | |||
616 | /* Bridge INT_DEV register bits definition */ | ||
617 | #define BRIDGE_INT_DEV_SHFT(n) ((n)*3) | ||
618 | #define BRIDGE_INT_DEV_MASK(n) (0x7 << BRIDGE_INT_DEV_SHFT(n)) | ||
619 | #define BRIDGE_INT_DEV_SET(_dev, _line) (_dev << BRIDGE_INT_DEV_SHFT(_line)) | ||
620 | |||
621 | /* Bridge interrupt(x) register bits definition */ | ||
622 | #define BRIDGE_INT_ADDR_HOST 0x0003FF00 | ||
623 | #define BRIDGE_INT_ADDR_FLD 0x000000FF | ||
624 | |||
625 | #define BRIDGE_TMO_PCI_RETRY_HLD_MASK 0x1f0000 | ||
626 | #define BRIDGE_TMO_GIO_TIMEOUT_MASK 0x001000 | ||
627 | #define BRIDGE_TMO_PCI_RETRY_CNT_MASK 0x0003ff | ||
628 | |||
629 | #define BRIDGE_TMO_PCI_RETRY_CNT_MAX 0x3ff | ||
630 | |||
631 | /* | ||
632 | * The NASID should be shifted by this amount and stored into the | ||
633 | * interrupt(x) register. | ||
634 | */ | ||
635 | #define BRIDGE_INT_ADDR_NASID_SHFT 8 | ||
636 | |||
637 | /* | ||
638 | * The BRIDGE_INT_ADDR_DEST_IO bit should be set to send an interrupt to | ||
639 | * memory. | ||
640 | */ | ||
641 | #define BRIDGE_INT_ADDR_DEST_IO (1 << 17) | ||
642 | #define BRIDGE_INT_ADDR_DEST_MEM 0 | ||
643 | #define BRIDGE_INT_ADDR_MASK (1 << 17) | ||
644 | |||
645 | /* Bridge device(x) register bits definition */ | ||
646 | #define BRIDGE_DEV_ERR_LOCK_EN 0x10000000 | ||
647 | #define BRIDGE_DEV_PAGE_CHK_DIS 0x08000000 | ||
648 | #define BRIDGE_DEV_FORCE_PCI_PAR 0x04000000 | ||
649 | #define BRIDGE_DEV_VIRTUAL_EN 0x02000000 | ||
650 | #define BRIDGE_DEV_PMU_WRGA_EN 0x01000000 | ||
651 | #define BRIDGE_DEV_DIR_WRGA_EN 0x00800000 | ||
652 | #define BRIDGE_DEV_DEV_SIZE 0x00400000 | ||
653 | #define BRIDGE_DEV_RT 0x00200000 | ||
654 | #define BRIDGE_DEV_SWAP_PMU 0x00100000 | ||
655 | #define BRIDGE_DEV_SWAP_DIR 0x00080000 | ||
656 | #define BRIDGE_DEV_PREF 0x00040000 | ||
657 | #define BRIDGE_DEV_PRECISE 0x00020000 | ||
658 | #define BRIDGE_DEV_COH 0x00010000 | ||
659 | #define BRIDGE_DEV_BARRIER 0x00008000 | ||
660 | #define BRIDGE_DEV_GBR 0x00004000 | ||
661 | #define BRIDGE_DEV_DEV_SWAP 0x00002000 | ||
662 | #define BRIDGE_DEV_DEV_IO_MEM 0x00001000 | ||
663 | #define BRIDGE_DEV_OFF_MASK 0x00000fff | ||
664 | #define BRIDGE_DEV_OFF_ADDR_SHFT 20 | ||
665 | |||
666 | #define BRIDGE_DEV_PMU_BITS (BRIDGE_DEV_PMU_WRGA_EN | \ | ||
667 | BRIDGE_DEV_SWAP_PMU) | ||
668 | #define BRIDGE_DEV_D32_BITS (BRIDGE_DEV_DIR_WRGA_EN | \ | ||
669 | BRIDGE_DEV_SWAP_DIR | \ | ||
670 | BRIDGE_DEV_PREF | \ | ||
671 | BRIDGE_DEV_PRECISE | \ | ||
672 | BRIDGE_DEV_COH | \ | ||
673 | BRIDGE_DEV_BARRIER) | ||
674 | #define BRIDGE_DEV_D64_BITS (BRIDGE_DEV_DIR_WRGA_EN | \ | ||
675 | BRIDGE_DEV_SWAP_DIR | \ | ||
676 | BRIDGE_DEV_COH | \ | ||
677 | BRIDGE_DEV_BARRIER) | ||
678 | |||
679 | /* Bridge Error Upper register bit field definition */ | ||
680 | #define BRIDGE_ERRUPPR_DEVMASTER (0x1 << 20) /* Device was master */ | ||
681 | #define BRIDGE_ERRUPPR_PCIVDEV (0x1 << 19) /* Virtual Req value */ | ||
682 | #define BRIDGE_ERRUPPR_DEVNUM_SHFT (16) | ||
683 | #define BRIDGE_ERRUPPR_DEVNUM_MASK (0x7 << BRIDGE_ERRUPPR_DEVNUM_SHFT) | ||
684 | #define BRIDGE_ERRUPPR_DEVICE(err) (((err) >> BRIDGE_ERRUPPR_DEVNUM_SHFT) & 0x7) | ||
685 | #define BRIDGE_ERRUPPR_ADDRMASK (0xFFFF) | ||
686 | |||
687 | /* Bridge interrupt mode register bits definition */ | ||
688 | #define BRIDGE_INTMODE_CLR_PKT_EN(x) (0x1 << (x)) | ||
689 | |||
690 | /* this should be written to the xbow's link_control(x) register */ | ||
691 | #define BRIDGE_CREDIT 3 | ||
692 | |||
693 | /* RRB assignment register */ | ||
694 | #define BRIDGE_RRB_EN 0x8 /* after shifting down */ | ||
695 | #define BRIDGE_RRB_DEV 0x7 /* after shifting down */ | ||
696 | #define BRIDGE_RRB_VDEV 0x4 /* after shifting down */ | ||
697 | #define BRIDGE_RRB_PDEV 0x3 /* after shifting down */ | ||
698 | |||
699 | /* RRB status register */ | ||
700 | #define BRIDGE_RRB_VALID(r) (0x00010000<<(r)) | ||
701 | #define BRIDGE_RRB_INUSE(r) (0x00000001<<(r)) | ||
702 | |||
703 | /* RRB clear register */ | ||
704 | #define BRIDGE_RRB_CLEAR(r) (0x00000001<<(r)) | ||
705 | |||
706 | /* xbox system controller declarations */ | ||
707 | #define XBOX_BRIDGE_WID 8 | ||
708 | #define FLASH_PROM1_BASE 0xE00000 /* To read the xbox sysctlr status */ | ||
709 | #define XBOX_RPS_EXISTS 1 << 6 /* RPS bit in status register */ | ||
710 | #define XBOX_RPS_FAIL 1 << 4 /* RPS status bit in register */ | ||
711 | |||
712 | /* ======================================================================== | ||
713 | */ | ||
714 | /* | ||
715 | * Macros for Xtalk to Bridge bus (PCI/GIO) PIO | ||
716 | * refer to section 4.2.1 of Bridge Spec for xtalk to PCI/GIO PIO mappings | ||
717 | */ | ||
718 | /* XTALK addresses that map into Bridge Bus addr space */ | ||
719 | #define BRIDGE_PIO32_XTALK_ALIAS_BASE 0x000040000000L | ||
720 | #define BRIDGE_PIO32_XTALK_ALIAS_LIMIT 0x00007FFFFFFFL | ||
721 | #define BRIDGE_PIO64_XTALK_ALIAS_BASE 0x000080000000L | ||
722 | #define BRIDGE_PIO64_XTALK_ALIAS_LIMIT 0x0000BFFFFFFFL | ||
723 | #define BRIDGE_PCIIO_XTALK_ALIAS_BASE 0x000100000000L | ||
724 | #define BRIDGE_PCIIO_XTALK_ALIAS_LIMIT 0x0001FFFFFFFFL | ||
725 | |||
726 | /* Ranges of PCI bus space that can be accessed via PIO from xtalk */ | ||
727 | #define BRIDGE_MIN_PIO_ADDR_MEM 0x00000000 /* 1G PCI memory space */ | ||
728 | #define BRIDGE_MAX_PIO_ADDR_MEM 0x3fffffff | ||
729 | #define BRIDGE_MIN_PIO_ADDR_IO 0x00000000 /* 4G PCI IO space */ | ||
730 | #define BRIDGE_MAX_PIO_ADDR_IO 0xffffffff | ||
731 | |||
732 | /* XTALK addresses that map into PCI addresses */ | ||
733 | #define BRIDGE_PCI_MEM32_BASE BRIDGE_PIO32_XTALK_ALIAS_BASE | ||
734 | #define BRIDGE_PCI_MEM32_LIMIT BRIDGE_PIO32_XTALK_ALIAS_LIMIT | ||
735 | #define BRIDGE_PCI_MEM64_BASE BRIDGE_PIO64_XTALK_ALIAS_BASE | ||
736 | #define BRIDGE_PCI_MEM64_LIMIT BRIDGE_PIO64_XTALK_ALIAS_LIMIT | ||
737 | #define BRIDGE_PCI_IO_BASE BRIDGE_PCIIO_XTALK_ALIAS_BASE | ||
738 | #define BRIDGE_PCI_IO_LIMIT BRIDGE_PCIIO_XTALK_ALIAS_LIMIT | ||
739 | |||
740 | /* | ||
741 | * Macros for Bridge bus (PCI/GIO) to Xtalk DMA | ||
742 | */ | ||
743 | /* Bridge Bus DMA addresses */ | ||
744 | #define BRIDGE_LOCAL_BASE 0 | ||
745 | #define BRIDGE_DMA_MAPPED_BASE 0x40000000 | ||
746 | #define BRIDGE_DMA_MAPPED_SIZE 0x40000000 /* 1G Bytes */ | ||
747 | #define BRIDGE_DMA_DIRECT_BASE 0x80000000 | ||
748 | #define BRIDGE_DMA_DIRECT_SIZE 0x80000000 /* 2G Bytes */ | ||
749 | |||
750 | #define PCI32_LOCAL_BASE BRIDGE_LOCAL_BASE | ||
751 | |||
752 | /* PCI addresses of regions decoded by Bridge for DMA */ | ||
753 | #define PCI32_MAPPED_BASE BRIDGE_DMA_MAPPED_BASE | ||
754 | #define PCI32_DIRECT_BASE BRIDGE_DMA_DIRECT_BASE | ||
755 | |||
756 | #define IS_PCI32_LOCAL(x) ((ulong_t)(x) < PCI32_MAPPED_BASE) | ||
757 | #define IS_PCI32_MAPPED(x) ((ulong_t)(x) < PCI32_DIRECT_BASE && \ | ||
758 | (ulong_t)(x) >= PCI32_MAPPED_BASE) | ||
759 | #define IS_PCI32_DIRECT(x) ((ulong_t)(x) >= PCI32_MAPPED_BASE) | ||
760 | #define IS_PCI64(x) ((ulong_t)(x) >= PCI64_BASE) | ||
761 | |||
762 | /* | ||
763 | * The GIO address space. | ||
764 | */ | ||
765 | /* Xtalk to GIO PIO */ | ||
766 | #define BRIDGE_GIO_MEM32_BASE BRIDGE_PIO32_XTALK_ALIAS_BASE | ||
767 | #define BRIDGE_GIO_MEM32_LIMIT BRIDGE_PIO32_XTALK_ALIAS_LIMIT | ||
768 | |||
769 | #define GIO_LOCAL_BASE BRIDGE_LOCAL_BASE | ||
770 | |||
771 | /* GIO addresses of regions decoded by Bridge for DMA */ | ||
772 | #define GIO_MAPPED_BASE BRIDGE_DMA_MAPPED_BASE | ||
773 | #define GIO_DIRECT_BASE BRIDGE_DMA_DIRECT_BASE | ||
774 | |||
775 | #define IS_GIO_LOCAL(x) ((ulong_t)(x) < GIO_MAPPED_BASE) | ||
776 | #define IS_GIO_MAPPED(x) ((ulong_t)(x) < GIO_DIRECT_BASE && \ | ||
777 | (ulong_t)(x) >= GIO_MAPPED_BASE) | ||
778 | #define IS_GIO_DIRECT(x) ((ulong_t)(x) >= GIO_MAPPED_BASE) | ||
779 | |||
780 | /* PCI to xtalk mapping */ | ||
781 | |||
782 | /* given a DIR_OFF value and a pci/gio 32 bits direct address, determine | ||
783 | * which xtalk address is accessed | ||
784 | */ | ||
785 | #define BRIDGE_DIRECT_32_SEG_SIZE BRIDGE_DMA_DIRECT_SIZE | ||
786 | #define BRIDGE_DIRECT_32_TO_XTALK(dir_off,adr) \ | ||
787 | ((dir_off) * BRIDGE_DIRECT_32_SEG_SIZE + \ | ||
788 | ((adr) & (BRIDGE_DIRECT_32_SEG_SIZE - 1)) + PHYS_RAMBASE) | ||
789 | |||
790 | /* 64-bit address attribute masks */ | ||
791 | #define PCI64_ATTR_TARG_MASK 0xf000000000000000 | ||
792 | #define PCI64_ATTR_TARG_SHFT 60 | ||
793 | #define PCI64_ATTR_PREF 0x0800000000000000 | ||
794 | #define PCI64_ATTR_PREC 0x0400000000000000 | ||
795 | #define PCI64_ATTR_VIRTUAL 0x0200000000000000 | ||
796 | #define PCI64_ATTR_BAR 0x0100000000000000 | ||
797 | #define PCI64_ATTR_RMF_MASK 0x00ff000000000000 | ||
798 | #define PCI64_ATTR_RMF_SHFT 48 | ||
799 | |||
800 | #ifndef __ASSEMBLY__ | ||
801 | /* Address translation entry for mapped pci32 accesses */ | ||
802 | typedef union ate_u { | ||
803 | u64 ent; | ||
804 | struct ate_s { | ||
805 | u64 rmf:16; | ||
806 | u64 addr:36; | ||
807 | u64 targ:4; | ||
808 | u64 reserved:3; | ||
809 | u64 barrier:1; | ||
810 | u64 prefetch:1; | ||
811 | u64 precise:1; | ||
812 | u64 coherent:1; | ||
813 | u64 valid:1; | ||
814 | } field; | ||
815 | } ate_t; | ||
816 | #endif /* !__ASSEMBLY__ */ | ||
817 | |||
818 | #define ATE_V 0x01 | ||
819 | #define ATE_CO 0x02 | ||
820 | #define ATE_PREC 0x04 | ||
821 | #define ATE_PREF 0x08 | ||
822 | #define ATE_BAR 0x10 | ||
823 | |||
824 | #define ATE_PFNSHIFT 12 | ||
825 | #define ATE_TIDSHIFT 8 | ||
826 | #define ATE_RMFSHIFT 48 | ||
827 | |||
828 | #define mkate(xaddr, xid, attr) ((xaddr) & 0x0000fffffffff000ULL) | \ | ||
829 | ((xid)<<ATE_TIDSHIFT) | \ | ||
830 | (attr) | ||
831 | |||
832 | #define BRIDGE_INTERNAL_ATES 128 | ||
833 | |||
834 | struct bridge_controller { | ||
835 | struct pci_controller pc; | ||
836 | struct resource mem; | ||
837 | struct resource io; | ||
838 | bridge_t *base; | ||
839 | nasid_t nasid; | ||
840 | unsigned int widget_id; | ||
841 | unsigned int irq_cpu; | ||
842 | dma64_addr_t baddr; | ||
843 | unsigned int pci_int[8]; | ||
844 | }; | ||
845 | |||
846 | #define BRIDGE_CONTROLLER(bus) \ | ||
847 | ((struct bridge_controller *)((bus)->sysdata)) | ||
848 | |||
849 | extern void register_bridge_irq(unsigned int irq); | ||
850 | extern int request_bridge_irq(struct bridge_controller *bc); | ||
851 | |||
852 | extern struct pci_ops bridge_pci_ops; | ||
853 | |||
854 | #endif /* _ASM_PCI_BRIDGE_H */ | ||
diff --git a/include/asm-mips/percpu.h b/include/asm-mips/percpu.h deleted file mode 100644 index 844e763e9332..000000000000 --- a/include/asm-mips/percpu.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_PERCPU_H | ||
2 | #define __ASM_PERCPU_H | ||
3 | |||
4 | #include <asm-generic/percpu.h> | ||
5 | |||
6 | #endif /* __ASM_PERCPU_H */ | ||
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h deleted file mode 100644 index 1275831dda29..000000000000 --- a/include/asm-mips/pgalloc.h +++ /dev/null | |||
@@ -1,143 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 - 2001, 2003 by Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_PGALLOC_H | ||
10 | #define _ASM_PGALLOC_H | ||
11 | |||
12 | #include <linux/highmem.h> | ||
13 | #include <linux/mm.h> | ||
14 | #include <linux/sched.h> | ||
15 | |||
16 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, | ||
17 | pte_t *pte) | ||
18 | { | ||
19 | set_pmd(pmd, __pmd((unsigned long)pte)); | ||
20 | } | ||
21 | |||
22 | static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | ||
23 | pgtable_t pte) | ||
24 | { | ||
25 | set_pmd(pmd, __pmd((unsigned long)page_address(pte))); | ||
26 | } | ||
27 | #define pmd_pgtable(pmd) pmd_page(pmd) | ||
28 | |||
29 | /* | ||
30 | * Initialize a new pmd table with invalid pointers. | ||
31 | */ | ||
32 | extern void pmd_init(unsigned long page, unsigned long pagetable); | ||
33 | |||
34 | #ifdef CONFIG_64BIT | ||
35 | |||
36 | static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) | ||
37 | { | ||
38 | set_pud(pud, __pud((unsigned long)pmd)); | ||
39 | } | ||
40 | #endif | ||
41 | |||
42 | /* | ||
43 | * Initialize a new pgd / pmd table with invalid pointers. | ||
44 | */ | ||
45 | extern void pgd_init(unsigned long page); | ||
46 | |||
47 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | ||
48 | { | ||
49 | pgd_t *ret, *init; | ||
50 | |||
51 | ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER); | ||
52 | if (ret) { | ||
53 | init = pgd_offset(&init_mm, 0UL); | ||
54 | pgd_init((unsigned long)ret); | ||
55 | memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, | ||
56 | (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); | ||
57 | } | ||
58 | |||
59 | return ret; | ||
60 | } | ||
61 | |||
62 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | ||
63 | { | ||
64 | free_pages((unsigned long)pgd, PGD_ORDER); | ||
65 | } | ||
66 | |||
67 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | ||
68 | unsigned long address) | ||
69 | { | ||
70 | pte_t *pte; | ||
71 | |||
72 | pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, PTE_ORDER); | ||
73 | |||
74 | return pte; | ||
75 | } | ||
76 | |||
77 | static inline struct page *pte_alloc_one(struct mm_struct *mm, | ||
78 | unsigned long address) | ||
79 | { | ||
80 | struct page *pte; | ||
81 | |||
82 | pte = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER); | ||
83 | if (pte) { | ||
84 | clear_highpage(pte); | ||
85 | pgtable_page_ctor(pte); | ||
86 | } | ||
87 | return pte; | ||
88 | } | ||
89 | |||
90 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) | ||
91 | { | ||
92 | free_pages((unsigned long)pte, PTE_ORDER); | ||
93 | } | ||
94 | |||
95 | static inline void pte_free(struct mm_struct *mm, pgtable_t pte) | ||
96 | { | ||
97 | pgtable_page_dtor(pte); | ||
98 | __free_pages(pte, PTE_ORDER); | ||
99 | } | ||
100 | |||
101 | #define __pte_free_tlb(tlb,pte) \ | ||
102 | do { \ | ||
103 | pgtable_page_dtor(pte); \ | ||
104 | tlb_remove_page((tlb), pte); \ | ||
105 | } while (0) | ||
106 | |||
107 | #ifdef CONFIG_32BIT | ||
108 | |||
109 | /* | ||
110 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | ||
111 | * inside the pgd, so has no extra memory associated with it. | ||
112 | */ | ||
113 | #define pmd_free(mm, x) do { } while (0) | ||
114 | #define __pmd_free_tlb(tlb, x) do { } while (0) | ||
115 | |||
116 | #endif | ||
117 | |||
118 | #ifdef CONFIG_64BIT | ||
119 | |||
120 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | ||
121 | { | ||
122 | pmd_t *pmd; | ||
123 | |||
124 | pmd = (pmd_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT, PMD_ORDER); | ||
125 | if (pmd) | ||
126 | pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table); | ||
127 | return pmd; | ||
128 | } | ||
129 | |||
130 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | ||
131 | { | ||
132 | free_pages((unsigned long)pmd, PMD_ORDER); | ||
133 | } | ||
134 | |||
135 | #define __pmd_free_tlb(tlb, x) pmd_free((tlb)->mm, x) | ||
136 | |||
137 | #endif | ||
138 | |||
139 | #define check_pgt_cache() do { } while (0) | ||
140 | |||
141 | extern void pagetable_init(void); | ||
142 | |||
143 | #endif /* _ASM_PGALLOC_H */ | ||
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h deleted file mode 100644 index 55813d6150c7..000000000000 --- a/include/asm-mips/pgtable-32.h +++ /dev/null | |||
@@ -1,234 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 2003 Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_PGTABLE_32_H | ||
10 | #define _ASM_PGTABLE_32_H | ||
11 | |||
12 | #include <asm/addrspace.h> | ||
13 | #include <asm/page.h> | ||
14 | |||
15 | #include <linux/linkage.h> | ||
16 | #include <asm/cachectl.h> | ||
17 | #include <asm/fixmap.h> | ||
18 | |||
19 | #include <asm-generic/pgtable-nopmd.h> | ||
20 | |||
21 | /* | ||
22 | * - add_wired_entry() add a fixed TLB entry, and move wired register | ||
23 | */ | ||
24 | extern void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1, | ||
25 | unsigned long entryhi, unsigned long pagemask); | ||
26 | |||
27 | /* | ||
28 | * - add_temporary_entry() add a temporary TLB entry. We use TLB entries | ||
29 | * starting at the top and working down. This is for populating the | ||
30 | * TLB before trap_init() puts the TLB miss handler in place. It | ||
31 | * should be used only for entries matching the actual page tables, | ||
32 | * to prevent inconsistencies. | ||
33 | */ | ||
34 | extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1, | ||
35 | unsigned long entryhi, unsigned long pagemask); | ||
36 | |||
37 | |||
38 | /* Basically we have the same two-level (which is the logical three level | ||
39 | * Linux page table layout folded) page tables as the i386. Some day | ||
40 | * when we have proper page coloring support we can have a 1% quicker | ||
41 | * tlb refill handling mechanism, but for now it is a bit slower but | ||
42 | * works even with the cache aliasing problem the R4k and above have. | ||
43 | */ | ||
44 | |||
45 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ | ||
46 | #define PGDIR_SHIFT (2 * PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2) | ||
47 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | ||
48 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | ||
49 | |||
50 | /* | ||
51 | * Entries per page directory level: we use two-level, so | ||
52 | * we don't really have any PUD/PMD directory physically. | ||
53 | */ | ||
54 | #define __PGD_ORDER (32 - 3 * PAGE_SHIFT + PGD_T_LOG2 + PTE_T_LOG2) | ||
55 | #define PGD_ORDER (__PGD_ORDER >= 0 ? __PGD_ORDER : 0) | ||
56 | #define PUD_ORDER aieeee_attempt_to_allocate_pud | ||
57 | #define PMD_ORDER 1 | ||
58 | #define PTE_ORDER 0 | ||
59 | |||
60 | #define PTRS_PER_PGD (USER_PTRS_PER_PGD * 2) | ||
61 | #define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) | ||
62 | |||
63 | #define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE) | ||
64 | #define FIRST_USER_ADDRESS 0 | ||
65 | |||
66 | #define VMALLOC_START MAP_BASE | ||
67 | |||
68 | #define PKMAP_BASE (0xfe000000UL) | ||
69 | |||
70 | #ifdef CONFIG_HIGHMEM | ||
71 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) | ||
72 | #else | ||
73 | # define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) | ||
74 | #endif | ||
75 | |||
76 | #ifdef CONFIG_64BIT_PHYS_ADDR | ||
77 | #define pte_ERROR(e) \ | ||
78 | printk("%s:%d: bad pte %016Lx.\n", __FILE__, __LINE__, pte_val(e)) | ||
79 | #else | ||
80 | #define pte_ERROR(e) \ | ||
81 | printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) | ||
82 | #endif | ||
83 | #define pgd_ERROR(e) \ | ||
84 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) | ||
85 | |||
86 | extern void load_pgd(unsigned long pg_dir); | ||
87 | |||
88 | extern pte_t invalid_pte_table[PAGE_SIZE/sizeof(pte_t)]; | ||
89 | |||
90 | /* | ||
91 | * Empty pgd/pmd entries point to the invalid_pte_table. | ||
92 | */ | ||
93 | static inline int pmd_none(pmd_t pmd) | ||
94 | { | ||
95 | return pmd_val(pmd) == (unsigned long) invalid_pte_table; | ||
96 | } | ||
97 | |||
98 | #define pmd_bad(pmd) (pmd_val(pmd) & ~PAGE_MASK) | ||
99 | |||
100 | static inline int pmd_present(pmd_t pmd) | ||
101 | { | ||
102 | return pmd_val(pmd) != (unsigned long) invalid_pte_table; | ||
103 | } | ||
104 | |||
105 | static inline void pmd_clear(pmd_t *pmdp) | ||
106 | { | ||
107 | pmd_val(*pmdp) = ((unsigned long) invalid_pte_table); | ||
108 | } | ||
109 | |||
110 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
111 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | ||
112 | #define pte_pfn(x) ((unsigned long)((x).pte_high >> 6)) | ||
113 | static inline pte_t | ||
114 | pfn_pte(unsigned long pfn, pgprot_t prot) | ||
115 | { | ||
116 | pte_t pte; | ||
117 | pte.pte_high = (pfn << 6) | (pgprot_val(prot) & 0x3f); | ||
118 | pte.pte_low = pgprot_val(prot); | ||
119 | return pte; | ||
120 | } | ||
121 | |||
122 | #else | ||
123 | |||
124 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | ||
125 | |||
126 | #ifdef CONFIG_CPU_VR41XX | ||
127 | #define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) | ||
128 | #define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) | ||
129 | #else | ||
130 | #define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT)) | ||
131 | #define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot)) | ||
132 | #endif | ||
133 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */ | ||
134 | |||
135 | #define __pgd_offset(address) pgd_index(address) | ||
136 | #define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) | ||
137 | #define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | ||
138 | |||
139 | /* to find an entry in a kernel page-table-directory */ | ||
140 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) | ||
141 | |||
142 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) | ||
143 | |||
144 | /* to find an entry in a page-table-directory */ | ||
145 | #define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr)) | ||
146 | |||
147 | /* Find an entry in the third-level page table.. */ | ||
148 | #define __pte_offset(address) \ | ||
149 | (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) | ||
150 | #define pte_offset(dir, address) \ | ||
151 | ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address)) | ||
152 | #define pte_offset_kernel(dir, address) \ | ||
153 | ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address)) | ||
154 | |||
155 | #define pte_offset_map(dir, address) \ | ||
156 | ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address)) | ||
157 | #define pte_offset_map_nested(dir, address) \ | ||
158 | ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address)) | ||
159 | #define pte_unmap(pte) ((void)(pte)) | ||
160 | #define pte_unmap_nested(pte) ((void)(pte)) | ||
161 | |||
162 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
163 | |||
164 | /* Swap entries must have VALID bit cleared. */ | ||
165 | #define __swp_type(x) (((x).val >> 10) & 0x1f) | ||
166 | #define __swp_offset(x) ((x).val >> 15) | ||
167 | #define __swp_entry(type,offset) \ | ||
168 | ((swp_entry_t) { ((type) << 10) | ((offset) << 15) }) | ||
169 | |||
170 | /* | ||
171 | * Bits 0, 4, 8, and 9 are taken, split up 28 bits of offset into this range: | ||
172 | */ | ||
173 | #define PTE_FILE_MAX_BITS 28 | ||
174 | |||
175 | #define pte_to_pgoff(_pte) ((((_pte).pte >> 1 ) & 0x07) | \ | ||
176 | (((_pte).pte >> 2 ) & 0x38) | \ | ||
177 | (((_pte).pte >> 10) << 6 )) | ||
178 | |||
179 | #define pgoff_to_pte(off) ((pte_t) { (((off) & 0x07) << 1 ) | \ | ||
180 | (((off) & 0x38) << 2 ) | \ | ||
181 | (((off) >> 6 ) << 10) | \ | ||
182 | _PAGE_FILE }) | ||
183 | |||
184 | #else | ||
185 | |||
186 | /* Swap entries must have VALID and GLOBAL bits cleared. */ | ||
187 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
188 | #define __swp_type(x) (((x).val >> 2) & 0x1f) | ||
189 | #define __swp_offset(x) ((x).val >> 7) | ||
190 | #define __swp_entry(type,offset) \ | ||
191 | ((swp_entry_t) { ((type) << 2) | ((offset) << 7) }) | ||
192 | #else | ||
193 | #define __swp_type(x) (((x).val >> 8) & 0x1f) | ||
194 | #define __swp_offset(x) ((x).val >> 13) | ||
195 | #define __swp_entry(type,offset) \ | ||
196 | ((swp_entry_t) { ((type) << 8) | ((offset) << 13) }) | ||
197 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */ | ||
198 | |||
199 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
200 | /* | ||
201 | * Bits 0 and 1 of pte_high are taken, use the rest for the page offset... | ||
202 | */ | ||
203 | #define PTE_FILE_MAX_BITS 30 | ||
204 | |||
205 | #define pte_to_pgoff(_pte) ((_pte).pte_high >> 2) | ||
206 | #define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) << 2 }) | ||
207 | |||
208 | #else | ||
209 | /* | ||
210 | * Bits 0, 4, 6, and 7 are taken, split up 28 bits of offset into this range: | ||
211 | */ | ||
212 | #define PTE_FILE_MAX_BITS 28 | ||
213 | |||
214 | #define pte_to_pgoff(_pte) ((((_pte).pte >> 1) & 0x7) | \ | ||
215 | (((_pte).pte >> 2) & 0x8) | \ | ||
216 | (((_pte).pte >> 8) << 4)) | ||
217 | |||
218 | #define pgoff_to_pte(off) ((pte_t) { (((off) & 0x7) << 1) | \ | ||
219 | (((off) & 0x8) << 2) | \ | ||
220 | (((off) >> 4) << 8) | \ | ||
221 | _PAGE_FILE }) | ||
222 | #endif | ||
223 | |||
224 | #endif | ||
225 | |||
226 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
227 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high }) | ||
228 | #define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val }) | ||
229 | #else | ||
230 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | ||
231 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | ||
232 | #endif | ||
233 | |||
234 | #endif /* _ASM_PGTABLE_32_H */ | ||
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h deleted file mode 100644 index 943515f0ef87..000000000000 --- a/include/asm-mips/pgtable-64.h +++ /dev/null | |||
@@ -1,253 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 2003 Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_PGTABLE_64_H | ||
10 | #define _ASM_PGTABLE_64_H | ||
11 | |||
12 | #include <linux/linkage.h> | ||
13 | |||
14 | #include <asm/addrspace.h> | ||
15 | #include <asm/page.h> | ||
16 | #include <asm/cachectl.h> | ||
17 | #include <asm/fixmap.h> | ||
18 | |||
19 | #include <asm-generic/pgtable-nopud.h> | ||
20 | |||
21 | /* | ||
22 | * Each address space has 2 4K pages as its page directory, giving 1024 | ||
23 | * (== PTRS_PER_PGD) 8 byte pointers to pmd tables. Each pmd table is a | ||
24 | * single 4K page, giving 512 (== PTRS_PER_PMD) 8 byte pointers to page | ||
25 | * tables. Each page table is also a single 4K page, giving 512 (== | ||
26 | * PTRS_PER_PTE) 8 byte ptes. Each pud entry is initialized to point to | ||
27 | * invalid_pmd_table, each pmd entry is initialized to point to | ||
28 | * invalid_pte_table, each pte is initialized to 0. When memory is low, | ||
29 | * and a pmd table or a page table allocation fails, empty_bad_pmd_table | ||
30 | * and empty_bad_page_table is returned back to higher layer code, so | ||
31 | * that the failure is recognized later on. Linux does not seem to | ||
32 | * handle these failures very well though. The empty_bad_page_table has | ||
33 | * invalid pte entries in it, to force page faults. | ||
34 | * | ||
35 | * Kernel mappings: kernel mappings are held in the swapper_pg_table. | ||
36 | * The layout is identical to userspace except it's indexed with the | ||
37 | * fault address - VMALLOC_START. | ||
38 | */ | ||
39 | |||
40 | /* PMD_SHIFT determines the size of the area a second-level page table can map */ | ||
41 | #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3)) | ||
42 | #define PMD_SIZE (1UL << PMD_SHIFT) | ||
43 | #define PMD_MASK (~(PMD_SIZE-1)) | ||
44 | |||
45 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ | ||
46 | #define PGDIR_SHIFT (PMD_SHIFT + (PAGE_SHIFT + PMD_ORDER - 3)) | ||
47 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | ||
48 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | ||
49 | |||
50 | /* | ||
51 | * For 4kB page size we use a 3 level page tree and an 8kB pud, which | ||
52 | * permits us mapping 40 bits of virtual address space. | ||
53 | * | ||
54 | * We used to implement 41 bits by having an order 1 pmd level but that seemed | ||
55 | * rather pointless. | ||
56 | * | ||
57 | * For 8kB page size we use a 3 level page tree which permits a total of | ||
58 | * 8TB of address space. Alternatively a 33-bit / 8GB organization using | ||
59 | * two levels would be easy to implement. | ||
60 | * | ||
61 | * For 16kB page size we use a 2 level page tree which permits a total of | ||
62 | * 36 bits of virtual address space. We could add a third level but it seems | ||
63 | * like at the moment there's no need for this. | ||
64 | * | ||
65 | * For 64kB page size we use a 2 level page table tree for a total of 42 bits | ||
66 | * of virtual address space. | ||
67 | */ | ||
68 | #ifdef CONFIG_PAGE_SIZE_4KB | ||
69 | #define PGD_ORDER 1 | ||
70 | #define PUD_ORDER aieeee_attempt_to_allocate_pud | ||
71 | #define PMD_ORDER 0 | ||
72 | #define PTE_ORDER 0 | ||
73 | #endif | ||
74 | #ifdef CONFIG_PAGE_SIZE_8KB | ||
75 | #define PGD_ORDER 0 | ||
76 | #define PUD_ORDER aieeee_attempt_to_allocate_pud | ||
77 | #define PMD_ORDER 0 | ||
78 | #define PTE_ORDER 0 | ||
79 | #endif | ||
80 | #ifdef CONFIG_PAGE_SIZE_16KB | ||
81 | #define PGD_ORDER 0 | ||
82 | #define PUD_ORDER aieeee_attempt_to_allocate_pud | ||
83 | #define PMD_ORDER 0 | ||
84 | #define PTE_ORDER 0 | ||
85 | #endif | ||
86 | #ifdef CONFIG_PAGE_SIZE_64KB | ||
87 | #define PGD_ORDER 0 | ||
88 | #define PUD_ORDER aieeee_attempt_to_allocate_pud | ||
89 | #define PMD_ORDER 0 | ||
90 | #define PTE_ORDER 0 | ||
91 | #endif | ||
92 | |||
93 | #define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t)) | ||
94 | #define PTRS_PER_PMD ((PAGE_SIZE << PMD_ORDER) / sizeof(pmd_t)) | ||
95 | #define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) | ||
96 | |||
97 | #if PGDIR_SIZE >= TASK_SIZE | ||
98 | #define USER_PTRS_PER_PGD (1) | ||
99 | #else | ||
100 | #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) | ||
101 | #endif | ||
102 | #define FIRST_USER_ADDRESS 0UL | ||
103 | |||
104 | #define VMALLOC_START MAP_BASE | ||
105 | #define VMALLOC_END \ | ||
106 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) | ||
107 | #if defined(CONFIG_MODULES) && defined(KBUILD_64BIT_SYM32) && \ | ||
108 | VMALLOC_START != CKSSEG | ||
109 | /* Load modules into 32bit-compatible segment. */ | ||
110 | #define MODULE_START CKSSEG | ||
111 | #define MODULE_END (FIXADDR_START-2*PAGE_SIZE) | ||
112 | extern pgd_t module_pg_dir[PTRS_PER_PGD]; | ||
113 | #endif | ||
114 | |||
115 | #define pte_ERROR(e) \ | ||
116 | printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) | ||
117 | #define pmd_ERROR(e) \ | ||
118 | printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e)) | ||
119 | #define pgd_ERROR(e) \ | ||
120 | printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e)) | ||
121 | |||
122 | extern pte_t invalid_pte_table[PTRS_PER_PTE]; | ||
123 | extern pte_t empty_bad_page_table[PTRS_PER_PTE]; | ||
124 | extern pmd_t invalid_pmd_table[PTRS_PER_PMD]; | ||
125 | extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD]; | ||
126 | |||
127 | /* | ||
128 | * Empty pgd/pmd entries point to the invalid_pte_table. | ||
129 | */ | ||
130 | static inline int pmd_none(pmd_t pmd) | ||
131 | { | ||
132 | return pmd_val(pmd) == (unsigned long) invalid_pte_table; | ||
133 | } | ||
134 | |||
135 | #define pmd_bad(pmd) (pmd_val(pmd) & ~PAGE_MASK) | ||
136 | |||
137 | static inline int pmd_present(pmd_t pmd) | ||
138 | { | ||
139 | return pmd_val(pmd) != (unsigned long) invalid_pte_table; | ||
140 | } | ||
141 | |||
142 | static inline void pmd_clear(pmd_t *pmdp) | ||
143 | { | ||
144 | pmd_val(*pmdp) = ((unsigned long) invalid_pte_table); | ||
145 | } | ||
146 | |||
147 | /* | ||
148 | * Empty pud entries point to the invalid_pmd_table. | ||
149 | */ | ||
150 | static inline int pud_none(pud_t pud) | ||
151 | { | ||
152 | return pud_val(pud) == (unsigned long) invalid_pmd_table; | ||
153 | } | ||
154 | |||
155 | static inline int pud_bad(pud_t pud) | ||
156 | { | ||
157 | return pud_val(pud) & ~PAGE_MASK; | ||
158 | } | ||
159 | |||
160 | static inline int pud_present(pud_t pud) | ||
161 | { | ||
162 | return pud_val(pud) != (unsigned long) invalid_pmd_table; | ||
163 | } | ||
164 | |||
165 | static inline void pud_clear(pud_t *pudp) | ||
166 | { | ||
167 | pud_val(*pudp) = ((unsigned long) invalid_pmd_table); | ||
168 | } | ||
169 | |||
170 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | ||
171 | |||
172 | #ifdef CONFIG_CPU_VR41XX | ||
173 | #define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) | ||
174 | #define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) | ||
175 | #else | ||
176 | #define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT)) | ||
177 | #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | ||
178 | #endif | ||
179 | |||
180 | #define __pgd_offset(address) pgd_index(address) | ||
181 | #define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) | ||
182 | #define __pmd_offset(address) pmd_index(address) | ||
183 | |||
184 | /* to find an entry in a kernel page-table-directory */ | ||
185 | #ifdef MODULE_START | ||
186 | #define pgd_offset_k(address) \ | ||
187 | ((address) >= MODULE_START ? module_pg_dir : pgd_offset(&init_mm, 0UL)) | ||
188 | #else | ||
189 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0UL) | ||
190 | #endif | ||
191 | |||
192 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) | ||
193 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | ||
194 | |||
195 | /* to find an entry in a page-table-directory */ | ||
196 | #define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr)) | ||
197 | |||
198 | static inline unsigned long pud_page_vaddr(pud_t pud) | ||
199 | { | ||
200 | return pud_val(pud); | ||
201 | } | ||
202 | #define pud_phys(pud) virt_to_phys((void *)pud_val(pud)) | ||
203 | #define pud_page(pud) (pfn_to_page(pud_phys(pud) >> PAGE_SHIFT)) | ||
204 | |||
205 | /* Find an entry in the second-level page table.. */ | ||
206 | static inline pmd_t *pmd_offset(pud_t * pud, unsigned long address) | ||
207 | { | ||
208 | return (pmd_t *) pud_page_vaddr(*pud) + pmd_index(address); | ||
209 | } | ||
210 | |||
211 | /* Find an entry in the third-level page table.. */ | ||
212 | #define __pte_offset(address) \ | ||
213 | (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) | ||
214 | #define pte_offset(dir, address) \ | ||
215 | ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address)) | ||
216 | #define pte_offset_kernel(dir, address) \ | ||
217 | ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address)) | ||
218 | #define pte_offset_map(dir, address) \ | ||
219 | ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address)) | ||
220 | #define pte_offset_map_nested(dir, address) \ | ||
221 | ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address)) | ||
222 | #define pte_unmap(pte) ((void)(pte)) | ||
223 | #define pte_unmap_nested(pte) ((void)(pte)) | ||
224 | |||
225 | /* | ||
226 | * Initialize a new pgd / pmd table with invalid pointers. | ||
227 | */ | ||
228 | extern void pgd_init(unsigned long page); | ||
229 | extern void pmd_init(unsigned long page, unsigned long pagetable); | ||
230 | |||
231 | /* | ||
232 | * Non-present pages: high 24 bits are offset, next 8 bits type, | ||
233 | * low 32 bits zero. | ||
234 | */ | ||
235 | static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) | ||
236 | { pte_t pte; pte_val(pte) = (type << 32) | (offset << 40); return pte; } | ||
237 | |||
238 | #define __swp_type(x) (((x).val >> 32) & 0xff) | ||
239 | #define __swp_offset(x) ((x).val >> 40) | ||
240 | #define __swp_entry(type, offset) ((swp_entry_t) { pte_val(mk_swap_pte((type), (offset))) }) | ||
241 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | ||
242 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | ||
243 | |||
244 | /* | ||
245 | * Bits 0, 4, 6, and 7 are taken. Let's leave bits 1, 2, 3, and 5 alone to | ||
246 | * make things easier, and only use the upper 56 bits for the page offset... | ||
247 | */ | ||
248 | #define PTE_FILE_MAX_BITS 56 | ||
249 | |||
250 | #define pte_to_pgoff(_pte) ((_pte).pte >> 8) | ||
251 | #define pgoff_to_pte(off) ((pte_t) { ((off) << 8) | _PAGE_FILE }) | ||
252 | |||
253 | #endif /* _ASM_PGTABLE_64_H */ | ||
diff --git a/include/asm-mips/pgtable-bits.h b/include/asm-mips/pgtable-bits.h deleted file mode 100644 index 51b34a48c84a..000000000000 --- a/include/asm-mips/pgtable-bits.h +++ /dev/null | |||
@@ -1,137 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 - 2002 by Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc. | ||
8 | * Copyright (C) 2002 Maciej W. Rozycki | ||
9 | */ | ||
10 | #ifndef _ASM_PGTABLE_BITS_H | ||
11 | #define _ASM_PGTABLE_BITS_H | ||
12 | |||
13 | |||
14 | /* | ||
15 | * Note that we shift the lower 32bits of each EntryLo[01] entry | ||
16 | * 6 bits to the left. That way we can convert the PFN into the | ||
17 | * physical address by a single 'and' operation and gain 6 additional | ||
18 | * bits for storing information which isn't present in a normal | ||
19 | * MIPS page table. | ||
20 | * | ||
21 | * Similar to the Alpha port, we need to keep track of the ref | ||
22 | * and mod bits in software. We have a software "yeah you can read | ||
23 | * from this page" bit, and a hardware one which actually lets the | ||
24 | * process read from the page. On the same token we have a software | ||
25 | * writable bit and the real hardware one which actually lets the | ||
26 | * process write to the page, this keeps a mod bit via the hardware | ||
27 | * dirty bit. | ||
28 | * | ||
29 | * Certain revisions of the R4000 and R5000 have a bug where if a | ||
30 | * certain sequence occurs in the last 3 instructions of an executable | ||
31 | * page, and the following page is not mapped, the cpu can do | ||
32 | * unpredictable things. The code (when it is written) to deal with | ||
33 | * this problem will be in the update_mmu_cache() code for the r4k. | ||
34 | */ | ||
35 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
36 | |||
37 | #define _PAGE_PRESENT (1<<6) /* implemented in software */ | ||
38 | #define _PAGE_READ (1<<7) /* implemented in software */ | ||
39 | #define _PAGE_WRITE (1<<8) /* implemented in software */ | ||
40 | #define _PAGE_ACCESSED (1<<9) /* implemented in software */ | ||
41 | #define _PAGE_MODIFIED (1<<10) /* implemented in software */ | ||
42 | #define _PAGE_FILE (1<<10) /* set:pagecache unset:swap */ | ||
43 | |||
44 | #define _PAGE_R4KBUG (1<<0) /* workaround for r4k bug */ | ||
45 | #define _PAGE_GLOBAL (1<<0) | ||
46 | #define _PAGE_VALID (1<<1) | ||
47 | #define _PAGE_SILENT_READ (1<<1) /* synonym */ | ||
48 | #define _PAGE_DIRTY (1<<2) /* The MIPS dirty bit */ | ||
49 | #define _PAGE_SILENT_WRITE (1<<2) | ||
50 | #define _CACHE_SHIFT 3 | ||
51 | #define _CACHE_MASK (7<<3) | ||
52 | |||
53 | #else | ||
54 | |||
55 | #define _PAGE_PRESENT (1<<0) /* implemented in software */ | ||
56 | #define _PAGE_READ (1<<1) /* implemented in software */ | ||
57 | #define _PAGE_WRITE (1<<2) /* implemented in software */ | ||
58 | #define _PAGE_ACCESSED (1<<3) /* implemented in software */ | ||
59 | #define _PAGE_MODIFIED (1<<4) /* implemented in software */ | ||
60 | #define _PAGE_FILE (1<<4) /* set:pagecache unset:swap */ | ||
61 | |||
62 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
63 | |||
64 | #define _PAGE_GLOBAL (1<<8) | ||
65 | #define _PAGE_VALID (1<<9) | ||
66 | #define _PAGE_SILENT_READ (1<<9) /* synonym */ | ||
67 | #define _PAGE_DIRTY (1<<10) /* The MIPS dirty bit */ | ||
68 | #define _PAGE_SILENT_WRITE (1<<10) | ||
69 | #define _CACHE_UNCACHED (1<<11) | ||
70 | #define _CACHE_MASK (1<<11) | ||
71 | |||
72 | #else | ||
73 | |||
74 | #define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */ | ||
75 | #define _PAGE_GLOBAL (1<<6) | ||
76 | #define _PAGE_VALID (1<<7) | ||
77 | #define _PAGE_SILENT_READ (1<<7) /* synonym */ | ||
78 | #define _PAGE_DIRTY (1<<8) /* The MIPS dirty bit */ | ||
79 | #define _PAGE_SILENT_WRITE (1<<8) | ||
80 | #define _CACHE_SHIFT 9 | ||
81 | #define _CACHE_MASK (7<<9) | ||
82 | |||
83 | #endif | ||
84 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR && defined(CONFIG_CPU_MIPS32) */ | ||
85 | |||
86 | |||
87 | /* | ||
88 | * Cache attributes | ||
89 | */ | ||
90 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
91 | |||
92 | #define _CACHE_CACHABLE_NONCOHERENT 0 | ||
93 | |||
94 | #elif defined(CONFIG_CPU_SB1) | ||
95 | |||
96 | /* No penalty for being coherent on the SB1, so just | ||
97 | use it for "noncoherent" spaces, too. Shouldn't hurt. */ | ||
98 | |||
99 | #define _CACHE_UNCACHED (2<<_CACHE_SHIFT) | ||
100 | #define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT) | ||
101 | #define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT) | ||
102 | #define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) | ||
103 | |||
104 | #elif defined(CONFIG_CPU_RM9000) | ||
105 | |||
106 | #define _CACHE_WT (0<<_CACHE_SHIFT) | ||
107 | #define _CACHE_WTWA (1<<_CACHE_SHIFT) | ||
108 | #define _CACHE_UC_B (2<<_CACHE_SHIFT) | ||
109 | #define _CACHE_WB (3<<_CACHE_SHIFT) | ||
110 | #define _CACHE_CWBEA (4<<_CACHE_SHIFT) | ||
111 | #define _CACHE_CWB (5<<_CACHE_SHIFT) | ||
112 | #define _CACHE_UCNB (6<<_CACHE_SHIFT) | ||
113 | #define _CACHE_FPC (7<<_CACHE_SHIFT) | ||
114 | |||
115 | #define _CACHE_UNCACHED _CACHE_UC_B | ||
116 | #define _CACHE_CACHABLE_NONCOHERENT _CACHE_WB | ||
117 | |||
118 | #else | ||
119 | |||
120 | #define _CACHE_CACHABLE_NO_WA (0<<_CACHE_SHIFT) /* R4600 only */ | ||
121 | #define _CACHE_CACHABLE_WA (1<<_CACHE_SHIFT) /* R4600 only */ | ||
122 | #define _CACHE_UNCACHED (2<<_CACHE_SHIFT) /* R4[0246]00 */ | ||
123 | #define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT) /* R4[0246]00 */ | ||
124 | #define _CACHE_CACHABLE_CE (4<<_CACHE_SHIFT) /* R4[04]00MC only */ | ||
125 | #define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT) /* R4[04]00MC only */ | ||
126 | #define _CACHE_CACHABLE_COHERENT (5<<_CACHE_SHIFT) /* MIPS32R2 CMP */ | ||
127 | #define _CACHE_CACHABLE_CUW (6<<_CACHE_SHIFT) /* R4[04]00MC only */ | ||
128 | #define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) /* R10000 only */ | ||
129 | |||
130 | #endif | ||
131 | |||
132 | #define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED) | ||
133 | #define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) | ||
134 | |||
135 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK) | ||
136 | |||
137 | #endif /* _ASM_PGTABLE_BITS_H */ | ||
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h deleted file mode 100644 index 6a0edf72ffbc..000000000000 --- a/include/asm-mips/pgtable.h +++ /dev/null | |||
@@ -1,383 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_PGTABLE_H | ||
9 | #define _ASM_PGTABLE_H | ||
10 | |||
11 | #ifdef CONFIG_32BIT | ||
12 | #include <asm/pgtable-32.h> | ||
13 | #endif | ||
14 | #ifdef CONFIG_64BIT | ||
15 | #include <asm/pgtable-64.h> | ||
16 | #endif | ||
17 | |||
18 | #include <asm/io.h> | ||
19 | #include <asm/pgtable-bits.h> | ||
20 | |||
21 | struct mm_struct; | ||
22 | struct vm_area_struct; | ||
23 | |||
24 | #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) | ||
25 | #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ | ||
26 | _page_cachable_default) | ||
27 | #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | \ | ||
28 | _page_cachable_default) | ||
29 | #define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | \ | ||
30 | _page_cachable_default) | ||
31 | #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ | ||
32 | _PAGE_GLOBAL | _page_cachable_default) | ||
33 | #define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ | ||
34 | _page_cachable_default) | ||
35 | #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ | ||
36 | __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED) | ||
37 | |||
38 | /* | ||
39 | * MIPS can't do page protection for execute, and considers that the same like | ||
40 | * read. Also, write permissions imply read permissions. This is the closest | ||
41 | * we can get by reasonable means.. | ||
42 | */ | ||
43 | |||
44 | /* | ||
45 | * Dummy values to fill the table in mmap.c | ||
46 | * The real values will be generated at runtime | ||
47 | */ | ||
48 | #define __P000 __pgprot(0) | ||
49 | #define __P001 __pgprot(0) | ||
50 | #define __P010 __pgprot(0) | ||
51 | #define __P011 __pgprot(0) | ||
52 | #define __P100 __pgprot(0) | ||
53 | #define __P101 __pgprot(0) | ||
54 | #define __P110 __pgprot(0) | ||
55 | #define __P111 __pgprot(0) | ||
56 | |||
57 | #define __S000 __pgprot(0) | ||
58 | #define __S001 __pgprot(0) | ||
59 | #define __S010 __pgprot(0) | ||
60 | #define __S011 __pgprot(0) | ||
61 | #define __S100 __pgprot(0) | ||
62 | #define __S101 __pgprot(0) | ||
63 | #define __S110 __pgprot(0) | ||
64 | #define __S111 __pgprot(0) | ||
65 | |||
66 | extern unsigned long _page_cachable_default; | ||
67 | |||
68 | /* | ||
69 | * ZERO_PAGE is a global shared page that is always zero; used | ||
70 | * for zero-mapped memory areas etc.. | ||
71 | */ | ||
72 | |||
73 | extern unsigned long empty_zero_page; | ||
74 | extern unsigned long zero_page_mask; | ||
75 | |||
76 | #define ZERO_PAGE(vaddr) \ | ||
77 | (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))) | ||
78 | |||
79 | extern void paging_init(void); | ||
80 | |||
81 | /* | ||
82 | * Conversion functions: convert a page and protection to a page entry, | ||
83 | * and a page entry and page directory to the page they refer to. | ||
84 | */ | ||
85 | #define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd)) | ||
86 | #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) | ||
87 | #define pmd_page_vaddr(pmd) pmd_val(pmd) | ||
88 | |||
89 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
90 | |||
91 | #define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL)) | ||
92 | #define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT) | ||
93 | |||
94 | static inline void set_pte(pte_t *ptep, pte_t pte) | ||
95 | { | ||
96 | ptep->pte_high = pte.pte_high; | ||
97 | smp_wmb(); | ||
98 | ptep->pte_low = pte.pte_low; | ||
99 | //printk("pte_high %x pte_low %x\n", ptep->pte_high, ptep->pte_low); | ||
100 | |||
101 | if (pte.pte_low & _PAGE_GLOBAL) { | ||
102 | pte_t *buddy = ptep_buddy(ptep); | ||
103 | /* | ||
104 | * Make sure the buddy is global too (if it's !none, | ||
105 | * it better already be global) | ||
106 | */ | ||
107 | if (pte_none(*buddy)) { | ||
108 | buddy->pte_low |= _PAGE_GLOBAL; | ||
109 | buddy->pte_high |= _PAGE_GLOBAL; | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | #define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval) | ||
114 | |||
115 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | ||
116 | { | ||
117 | pte_t null = __pte(0); | ||
118 | |||
119 | /* Preserve global status for the pair */ | ||
120 | if (ptep_buddy(ptep)->pte_low & _PAGE_GLOBAL) | ||
121 | null.pte_low = null.pte_high = _PAGE_GLOBAL; | ||
122 | |||
123 | set_pte_at(mm, addr, ptep, null); | ||
124 | } | ||
125 | #else | ||
126 | |||
127 | #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) | ||
128 | #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) | ||
129 | |||
130 | /* | ||
131 | * Certain architectures need to do special things when pte's | ||
132 | * within a page table are directly modified. Thus, the following | ||
133 | * hook is made available. | ||
134 | */ | ||
135 | static inline void set_pte(pte_t *ptep, pte_t pteval) | ||
136 | { | ||
137 | *ptep = pteval; | ||
138 | #if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX) | ||
139 | if (pte_val(pteval) & _PAGE_GLOBAL) { | ||
140 | pte_t *buddy = ptep_buddy(ptep); | ||
141 | /* | ||
142 | * Make sure the buddy is global too (if it's !none, | ||
143 | * it better already be global) | ||
144 | */ | ||
145 | if (pte_none(*buddy)) | ||
146 | pte_val(*buddy) = pte_val(*buddy) | _PAGE_GLOBAL; | ||
147 | } | ||
148 | #endif | ||
149 | } | ||
150 | #define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval) | ||
151 | |||
152 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | ||
153 | { | ||
154 | #if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX) | ||
155 | /* Preserve global status for the pair */ | ||
156 | if (pte_val(*ptep_buddy(ptep)) & _PAGE_GLOBAL) | ||
157 | set_pte_at(mm, addr, ptep, __pte(_PAGE_GLOBAL)); | ||
158 | else | ||
159 | #endif | ||
160 | set_pte_at(mm, addr, ptep, __pte(0)); | ||
161 | } | ||
162 | #endif | ||
163 | |||
164 | /* | ||
165 | * (pmds are folded into puds so this doesn't get actually called, | ||
166 | * but the define is needed for a generic inline function.) | ||
167 | */ | ||
168 | #define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0) | ||
169 | |||
170 | #ifdef CONFIG_64BIT | ||
171 | /* | ||
172 | * (puds are folded into pgds so this doesn't get actually called, | ||
173 | * but the define is needed for a generic inline function.) | ||
174 | */ | ||
175 | #define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0) | ||
176 | #endif | ||
177 | |||
178 | #define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1) | ||
179 | #define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1) | ||
180 | #define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1) | ||
181 | |||
182 | /* | ||
183 | * We used to declare this array with size but gcc 3.3 and older are not able | ||
184 | * to find that this expression is a constant, so the size is dropped. | ||
185 | */ | ||
186 | extern pgd_t swapper_pg_dir[]; | ||
187 | |||
188 | /* | ||
189 | * The following only work if pte_present() is true. | ||
190 | * Undefined behaviour if not.. | ||
191 | */ | ||
192 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
193 | static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; } | ||
194 | static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; } | ||
195 | static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } | ||
196 | static inline int pte_file(pte_t pte) { return pte.pte_low & _PAGE_FILE; } | ||
197 | |||
198 | static inline pte_t pte_wrprotect(pte_t pte) | ||
199 | { | ||
200 | pte.pte_low &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); | ||
201 | pte.pte_high &= ~_PAGE_SILENT_WRITE; | ||
202 | return pte; | ||
203 | } | ||
204 | |||
205 | static inline pte_t pte_mkclean(pte_t pte) | ||
206 | { | ||
207 | pte.pte_low &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); | ||
208 | pte.pte_high &= ~_PAGE_SILENT_WRITE; | ||
209 | return pte; | ||
210 | } | ||
211 | |||
212 | static inline pte_t pte_mkold(pte_t pte) | ||
213 | { | ||
214 | pte.pte_low &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ); | ||
215 | pte.pte_high &= ~_PAGE_SILENT_READ; | ||
216 | return pte; | ||
217 | } | ||
218 | |||
219 | static inline pte_t pte_mkwrite(pte_t pte) | ||
220 | { | ||
221 | pte.pte_low |= _PAGE_WRITE; | ||
222 | if (pte.pte_low & _PAGE_MODIFIED) { | ||
223 | pte.pte_low |= _PAGE_SILENT_WRITE; | ||
224 | pte.pte_high |= _PAGE_SILENT_WRITE; | ||
225 | } | ||
226 | return pte; | ||
227 | } | ||
228 | |||
229 | static inline pte_t pte_mkdirty(pte_t pte) | ||
230 | { | ||
231 | pte.pte_low |= _PAGE_MODIFIED; | ||
232 | if (pte.pte_low & _PAGE_WRITE) { | ||
233 | pte.pte_low |= _PAGE_SILENT_WRITE; | ||
234 | pte.pte_high |= _PAGE_SILENT_WRITE; | ||
235 | } | ||
236 | return pte; | ||
237 | } | ||
238 | |||
239 | static inline pte_t pte_mkyoung(pte_t pte) | ||
240 | { | ||
241 | pte.pte_low |= _PAGE_ACCESSED; | ||
242 | if (pte.pte_low & _PAGE_READ) { | ||
243 | pte.pte_low |= _PAGE_SILENT_READ; | ||
244 | pte.pte_high |= _PAGE_SILENT_READ; | ||
245 | } | ||
246 | return pte; | ||
247 | } | ||
248 | #else | ||
249 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } | ||
250 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } | ||
251 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | ||
252 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | ||
253 | |||
254 | static inline pte_t pte_wrprotect(pte_t pte) | ||
255 | { | ||
256 | pte_val(pte) &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); | ||
257 | return pte; | ||
258 | } | ||
259 | |||
260 | static inline pte_t pte_mkclean(pte_t pte) | ||
261 | { | ||
262 | pte_val(pte) &= ~(_PAGE_MODIFIED|_PAGE_SILENT_WRITE); | ||
263 | return pte; | ||
264 | } | ||
265 | |||
266 | static inline pte_t pte_mkold(pte_t pte) | ||
267 | { | ||
268 | pte_val(pte) &= ~(_PAGE_ACCESSED|_PAGE_SILENT_READ); | ||
269 | return pte; | ||
270 | } | ||
271 | |||
272 | static inline pte_t pte_mkwrite(pte_t pte) | ||
273 | { | ||
274 | pte_val(pte) |= _PAGE_WRITE; | ||
275 | if (pte_val(pte) & _PAGE_MODIFIED) | ||
276 | pte_val(pte) |= _PAGE_SILENT_WRITE; | ||
277 | return pte; | ||
278 | } | ||
279 | |||
280 | static inline pte_t pte_mkdirty(pte_t pte) | ||
281 | { | ||
282 | pte_val(pte) |= _PAGE_MODIFIED; | ||
283 | if (pte_val(pte) & _PAGE_WRITE) | ||
284 | pte_val(pte) |= _PAGE_SILENT_WRITE; | ||
285 | return pte; | ||
286 | } | ||
287 | |||
288 | static inline pte_t pte_mkyoung(pte_t pte) | ||
289 | { | ||
290 | pte_val(pte) |= _PAGE_ACCESSED; | ||
291 | if (pte_val(pte) & _PAGE_READ) | ||
292 | pte_val(pte) |= _PAGE_SILENT_READ; | ||
293 | return pte; | ||
294 | } | ||
295 | #endif | ||
296 | static inline int pte_special(pte_t pte) { return 0; } | ||
297 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | ||
298 | |||
299 | /* | ||
300 | * Macro to make mark a page protection value as "uncacheable". Note | ||
301 | * that "protection" is really a misnomer here as the protection value | ||
302 | * contains the memory attribute bits, dirty bits, and various other | ||
303 | * bits as well. | ||
304 | */ | ||
305 | #define pgprot_noncached pgprot_noncached | ||
306 | |||
307 | static inline pgprot_t pgprot_noncached(pgprot_t _prot) | ||
308 | { | ||
309 | unsigned long prot = pgprot_val(_prot); | ||
310 | |||
311 | prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED; | ||
312 | |||
313 | return __pgprot(prot); | ||
314 | } | ||
315 | |||
316 | /* | ||
317 | * Conversion functions: convert a page and protection to a page entry, | ||
318 | * and a page entry and page directory to the page they refer to. | ||
319 | */ | ||
320 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) | ||
321 | |||
322 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
323 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | ||
324 | { | ||
325 | pte.pte_low &= _PAGE_CHG_MASK; | ||
326 | pte.pte_high &= ~0x3f; | ||
327 | pte.pte_low |= pgprot_val(newprot); | ||
328 | pte.pte_high |= pgprot_val(newprot) & 0x3f; | ||
329 | return pte; | ||
330 | } | ||
331 | #else | ||
332 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | ||
333 | { | ||
334 | return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)); | ||
335 | } | ||
336 | #endif | ||
337 | |||
338 | |||
339 | extern void __update_tlb(struct vm_area_struct *vma, unsigned long address, | ||
340 | pte_t pte); | ||
341 | extern void __update_cache(struct vm_area_struct *vma, unsigned long address, | ||
342 | pte_t pte); | ||
343 | |||
344 | static inline void update_mmu_cache(struct vm_area_struct *vma, | ||
345 | unsigned long address, pte_t pte) | ||
346 | { | ||
347 | __update_tlb(vma, address, pte); | ||
348 | __update_cache(vma, address, pte); | ||
349 | } | ||
350 | |||
351 | #define kern_addr_valid(addr) (1) | ||
352 | |||
353 | #ifdef CONFIG_64BIT_PHYS_ADDR | ||
354 | extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot); | ||
355 | |||
356 | static inline int io_remap_pfn_range(struct vm_area_struct *vma, | ||
357 | unsigned long vaddr, | ||
358 | unsigned long pfn, | ||
359 | unsigned long size, | ||
360 | pgprot_t prot) | ||
361 | { | ||
362 | phys_t phys_addr_high = fixup_bigphys_addr(pfn << PAGE_SHIFT, size); | ||
363 | return remap_pfn_range(vma, vaddr, phys_addr_high >> PAGE_SHIFT, size, prot); | ||
364 | } | ||
365 | #else | ||
366 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | ||
367 | remap_pfn_range(vma, vaddr, pfn, size, prot) | ||
368 | #endif | ||
369 | |||
370 | #include <asm-generic/pgtable.h> | ||
371 | |||
372 | /* | ||
373 | * We provide our own get_unmapped area to cope with the virtual aliasing | ||
374 | * constraints placed on us by the cache architecture. | ||
375 | */ | ||
376 | #define HAVE_ARCH_UNMAPPED_AREA | ||
377 | |||
378 | /* | ||
379 | * No page table caches to initialise | ||
380 | */ | ||
381 | #define pgtable_cache_init() do { } while (0) | ||
382 | |||
383 | #endif /* _ASM_PGTABLE_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/gpio.h b/include/asm-mips/pmc-sierra/msp71xx/gpio.h deleted file mode 100644 index ebdbab973e41..000000000000 --- a/include/asm-mips/pmc-sierra/msp71xx/gpio.h +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/pmc-sierra/msp71xx/gpio.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * @author Patrick Glass <patrickglass@gmail.com> | ||
9 | */ | ||
10 | |||
11 | #ifndef __PMC_MSP71XX_GPIO_H | ||
12 | #define __PMC_MSP71XX_GPIO_H | ||
13 | |||
14 | /* Max number of gpio's is 28 on chip plus 3 banks of I2C IO Expanders */ | ||
15 | #define ARCH_NR_GPIOS (28 + (3 * 8)) | ||
16 | |||
17 | /* new generic GPIO API - see Documentation/gpio.txt */ | ||
18 | #include <asm-generic/gpio.h> | ||
19 | |||
20 | #define gpio_get_value __gpio_get_value | ||
21 | #define gpio_set_value __gpio_set_value | ||
22 | #define gpio_cansleep __gpio_cansleep | ||
23 | |||
24 | /* Setup calls for the gpio and gpio extended */ | ||
25 | extern void msp71xx_init_gpio(void); | ||
26 | extern void msp71xx_init_gpio_extended(void); | ||
27 | extern int msp71xx_set_output_drive(unsigned gpio, int value); | ||
28 | |||
29 | /* Custom output drive functionss */ | ||
30 | static inline int gpio_set_output_drive(unsigned gpio, int value) | ||
31 | { | ||
32 | return msp71xx_set_output_drive(gpio, value); | ||
33 | } | ||
34 | |||
35 | /* IRQ's are not supported for gpio lines */ | ||
36 | static inline int gpio_to_irq(unsigned gpio) | ||
37 | { | ||
38 | return -EINVAL; | ||
39 | } | ||
40 | |||
41 | static inline int irq_to_gpio(unsigned irq) | ||
42 | { | ||
43 | return -EINVAL; | ||
44 | } | ||
45 | |||
46 | #endif /* __PMC_MSP71XX_GPIO_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h deleted file mode 100644 index c84bcf9570b1..000000000000 --- a/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
1 | /* | ||
2 | * Defines for the MSP interrupt controller. | ||
3 | * | ||
4 | * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved. | ||
5 | * Author: Carsten Langgaard, carstenl@mips.com | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | */ | ||
24 | |||
25 | #ifndef _MSP_CIC_INT_H | ||
26 | #define _MSP_CIC_INT_H | ||
27 | |||
28 | /* | ||
29 | * The PMC-Sierra CIC interrupts are all centrally managed by the | ||
30 | * CIC sub-system. | ||
31 | * We attempt to keep the interrupt numbers as consistent as possible | ||
32 | * across all of the MSP devices, but some differences will creep in ... | ||
33 | * The interrupts which are directly forwarded to the MIPS core interrupts | ||
34 | * are assigned interrupts in the range 0-7, interrupts cascaded through | ||
35 | * the CIC are assigned interrupts 8-39. The cascade occurs on C_IRQ4 | ||
36 | * (MSP_INT_CIC). Currently we don't really distinguish between VPE1 | ||
37 | * and VPE0 (or thread contexts for that matter). Will have to fix. | ||
38 | * The PER interrupts are assigned interrupts in the range 40-71. | ||
39 | */ | ||
40 | |||
41 | |||
42 | /* | ||
43 | * IRQs directly forwarded to the CPU | ||
44 | */ | ||
45 | #define MSP_MIPS_INTBASE 0 | ||
46 | #define MSP_INT_SW0 0 /* IRQ for swint0, C_SW0 */ | ||
47 | #define MSP_INT_SW1 1 /* IRQ for swint1, C_SW1 */ | ||
48 | #define MSP_INT_MAC0 2 /* IRQ for MAC 0, C_IRQ0 */ | ||
49 | #define MSP_INT_MAC1 3 /* IRQ for MAC 1, C_IRQ1 */ | ||
50 | #define MSP_INT_USB 4 /* IRQ for USB, C_IRQ2 */ | ||
51 | #define MSP_INT_SAR 5 /* IRQ for ADSL2+ SAR, C_IRQ3 */ | ||
52 | #define MSP_INT_CIC 6 /* IRQ for CIC block, C_IRQ4 */ | ||
53 | #define MSP_INT_SEC 7 /* IRQ for Sec engine, C_IRQ5 */ | ||
54 | |||
55 | /* | ||
56 | * IRQs cascaded on CPU interrupt 4 (CAUSE bit 12, C_IRQ4) | ||
57 | * These defines should be tied to the register definitions for the CIC | ||
58 | * interrupt routine. For now, just use hard-coded values. | ||
59 | */ | ||
60 | #define MSP_CIC_INTBASE (MSP_MIPS_INTBASE + 8) | ||
61 | #define MSP_INT_EXT0 (MSP_CIC_INTBASE + 0) | ||
62 | /* External interrupt 0 */ | ||
63 | #define MSP_INT_EXT1 (MSP_CIC_INTBASE + 1) | ||
64 | /* External interrupt 1 */ | ||
65 | #define MSP_INT_EXT2 (MSP_CIC_INTBASE + 2) | ||
66 | /* External interrupt 2 */ | ||
67 | #define MSP_INT_EXT3 (MSP_CIC_INTBASE + 3) | ||
68 | /* External interrupt 3 */ | ||
69 | #define MSP_INT_CPUIF (MSP_CIC_INTBASE + 4) | ||
70 | /* CPU interface interrupt */ | ||
71 | #define MSP_INT_EXT4 (MSP_CIC_INTBASE + 5) | ||
72 | /* External interrupt 4 */ | ||
73 | #define MSP_INT_CIC_USB (MSP_CIC_INTBASE + 6) | ||
74 | /* Cascaded IRQ for USB */ | ||
75 | #define MSP_INT_MBOX (MSP_CIC_INTBASE + 7) | ||
76 | /* Sec engine mailbox IRQ */ | ||
77 | #define MSP_INT_EXT5 (MSP_CIC_INTBASE + 8) | ||
78 | /* External interrupt 5 */ | ||
79 | #define MSP_INT_TDM (MSP_CIC_INTBASE + 9) | ||
80 | /* TDM interrupt */ | ||
81 | #define MSP_INT_CIC_MAC0 (MSP_CIC_INTBASE + 10) | ||
82 | /* Cascaded IRQ for MAC 0 */ | ||
83 | #define MSP_INT_CIC_MAC1 (MSP_CIC_INTBASE + 11) | ||
84 | /* Cascaded IRQ for MAC 1 */ | ||
85 | #define MSP_INT_CIC_SEC (MSP_CIC_INTBASE + 12) | ||
86 | /* Cascaded IRQ for sec engine */ | ||
87 | #define MSP_INT_PER (MSP_CIC_INTBASE + 13) | ||
88 | /* Peripheral interrupt */ | ||
89 | #define MSP_INT_TIMER0 (MSP_CIC_INTBASE + 14) | ||
90 | /* SLP timer 0 */ | ||
91 | #define MSP_INT_TIMER1 (MSP_CIC_INTBASE + 15) | ||
92 | /* SLP timer 1 */ | ||
93 | #define MSP_INT_TIMER2 (MSP_CIC_INTBASE + 16) | ||
94 | /* SLP timer 2 */ | ||
95 | #define MSP_INT_VPE0_TIMER (MSP_CIC_INTBASE + 17) | ||
96 | /* VPE0 MIPS timer */ | ||
97 | #define MSP_INT_BLKCP (MSP_CIC_INTBASE + 18) | ||
98 | /* Block Copy */ | ||
99 | #define MSP_INT_UART0 (MSP_CIC_INTBASE + 19) | ||
100 | /* UART 0 */ | ||
101 | #define MSP_INT_PCI (MSP_CIC_INTBASE + 20) | ||
102 | /* PCI subsystem */ | ||
103 | #define MSP_INT_EXT6 (MSP_CIC_INTBASE + 21) | ||
104 | /* External interrupt 5 */ | ||
105 | #define MSP_INT_PCI_MSI (MSP_CIC_INTBASE + 22) | ||
106 | /* PCI Message Signal */ | ||
107 | #define MSP_INT_CIC_SAR (MSP_CIC_INTBASE + 23) | ||
108 | /* Cascaded ADSL2+ SAR IRQ */ | ||
109 | #define MSP_INT_DSL (MSP_CIC_INTBASE + 24) | ||
110 | /* ADSL2+ IRQ */ | ||
111 | #define MSP_INT_CIC_ERR (MSP_CIC_INTBASE + 25) | ||
112 | /* SLP error condition */ | ||
113 | #define MSP_INT_VPE1_TIMER (MSP_CIC_INTBASE + 26) | ||
114 | /* VPE1 MIPS timer */ | ||
115 | #define MSP_INT_VPE0_PC (MSP_CIC_INTBASE + 27) | ||
116 | /* VPE0 Performance counter */ | ||
117 | #define MSP_INT_VPE1_PC (MSP_CIC_INTBASE + 28) | ||
118 | /* VPE1 Performance counter */ | ||
119 | #define MSP_INT_EXT7 (MSP_CIC_INTBASE + 29) | ||
120 | /* External interrupt 5 */ | ||
121 | #define MSP_INT_VPE0_SW (MSP_CIC_INTBASE + 30) | ||
122 | /* VPE0 Software interrupt */ | ||
123 | #define MSP_INT_VPE1_SW (MSP_CIC_INTBASE + 31) | ||
124 | /* VPE0 Software interrupt */ | ||
125 | |||
126 | /* | ||
127 | * IRQs cascaded on CIC PER interrupt (MSP_INT_PER) | ||
128 | */ | ||
129 | #define MSP_PER_INTBASE (MSP_CIC_INTBASE + 32) | ||
130 | /* Reserved 0-1 */ | ||
131 | #define MSP_INT_UART1 (MSP_PER_INTBASE + 2) | ||
132 | /* UART 1 */ | ||
133 | /* Reserved 3-5 */ | ||
134 | #define MSP_INT_2WIRE (MSP_PER_INTBASE + 6) | ||
135 | /* 2-wire */ | ||
136 | #define MSP_INT_TM0 (MSP_PER_INTBASE + 7) | ||
137 | /* Peripheral timer block out 0 */ | ||
138 | #define MSP_INT_TM1 (MSP_PER_INTBASE + 8) | ||
139 | /* Peripheral timer block out 1 */ | ||
140 | /* Reserved 9 */ | ||
141 | #define MSP_INT_SPRX (MSP_PER_INTBASE + 10) | ||
142 | /* SPI RX complete */ | ||
143 | #define MSP_INT_SPTX (MSP_PER_INTBASE + 11) | ||
144 | /* SPI TX complete */ | ||
145 | #define MSP_INT_GPIO (MSP_PER_INTBASE + 12) | ||
146 | /* GPIO */ | ||
147 | #define MSP_INT_PER_ERR (MSP_PER_INTBASE + 13) | ||
148 | /* Peripheral error */ | ||
149 | /* Reserved 14-31 */ | ||
150 | |||
151 | #endif /* !_MSP_CIC_INT_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_int.h deleted file mode 100644 index 1d9f05474820..000000000000 --- a/include/asm-mips/pmc-sierra/msp71xx/msp_int.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * Defines for the MSP interrupt handlers. | ||
3 | * | ||
4 | * Copyright (C) 2005, PMC-Sierra, Inc. All rights reserved. | ||
5 | * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | */ | ||
24 | |||
25 | #ifndef _MSP_INT_H | ||
26 | #define _MSP_INT_H | ||
27 | |||
28 | /* | ||
29 | * The PMC-Sierra MSP product line has at least two different interrupt | ||
30 | * controllers, the SLP register based scheme and the CIC interrupt | ||
31 | * controller block mechanism. This file distinguishes between them | ||
32 | * so that devices see a uniform interface. | ||
33 | */ | ||
34 | |||
35 | #if defined(CONFIG_IRQ_MSP_SLP) | ||
36 | #include "msp_slp_int.h" | ||
37 | #elif defined(CONFIG_IRQ_MSP_CIC) | ||
38 | #include "msp_cic_int.h" | ||
39 | #else | ||
40 | #error "What sort of interrupt controller does *your* MSP have?" | ||
41 | #endif | ||
42 | |||
43 | #endif /* !_MSP_INT_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h b/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h deleted file mode 100644 index 415606903617..000000000000 --- a/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h +++ /dev/null | |||
@@ -1,205 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2000-2006 PMC-Sierra INC. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it | ||
5 | * and/or modify it under the terms of the GNU General | ||
6 | * Public License as published by the Free Software | ||
7 | * Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be | ||
11 | * useful, but WITHOUT ANY WARRANTY; without even the implied | ||
12 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
13 | * PURPOSE. See the GNU General Public License for more | ||
14 | * details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public | ||
17 | * License along with this program; if not, write to the Free | ||
18 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA | ||
19 | * 02139, USA. | ||
20 | * | ||
21 | * PMC-SIERRA INC. DISCLAIMS ANY LIABILITY OF ANY KIND | ||
22 | * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS | ||
23 | * SOFTWARE. | ||
24 | */ | ||
25 | |||
26 | #ifndef _MSP_PCI_H_ | ||
27 | #define _MSP_PCI_H_ | ||
28 | |||
29 | #define MSP_HAS_PCI(ID) (((u32)(ID) <= 0x4236) && ((u32)(ID) >= 0x4220)) | ||
30 | |||
31 | /* | ||
32 | * It is convenient to program the OATRAN register so that | ||
33 | * Athena virtual address space and PCI address space are | ||
34 | * the same. This is not a requirement, just a convenience. | ||
35 | * | ||
36 | * The only hard restrictions on the value of OATRAN is that | ||
37 | * OATRAN must not be programmed to allow translated memory | ||
38 | * addresses to fall within the lowest 512MB of | ||
39 | * PCI address space. This region is hardcoded | ||
40 | * for use as Athena PCI Host Controller target | ||
41 | * access memory space to the Athena's SDRAM. | ||
42 | * | ||
43 | * Note that OATRAN applies only to memory accesses, not | ||
44 | * to I/O accesses. | ||
45 | * | ||
46 | * To program OATRAN to make Athena virtual address space | ||
47 | * and PCI address space have the same values, OATRAN | ||
48 | * is to be programmed to 0xB8000000. The top seven | ||
49 | * bits of the value mimic the seven bits clipped off | ||
50 | * by the PCI Host controller. | ||
51 | * | ||
52 | * With OATRAN at the said value, when the CPU does | ||
53 | * an access to its virtual address at, say 0xB900_5000, | ||
54 | * the address appearing on the PCI bus will be | ||
55 | * 0xB900_5000. | ||
56 | * - Michael Penner | ||
57 | */ | ||
58 | #define MSP_PCI_OATRAN 0xB8000000UL | ||
59 | |||
60 | #define MSP_PCI_SPACE_BASE (MSP_PCI_OATRAN + 0x1002000UL) | ||
61 | #define MSP_PCI_SPACE_SIZE (0x3000000UL - 0x2000) | ||
62 | #define MSP_PCI_SPACE_END \ | ||
63 | (MSP_PCI_SPACE_BASE + MSP_PCI_SPACE_SIZE - 1) | ||
64 | #define MSP_PCI_IOSPACE_BASE (MSP_PCI_OATRAN + 0x1001000UL) | ||
65 | #define MSP_PCI_IOSPACE_SIZE 0x1000 | ||
66 | #define MSP_PCI_IOSPACE_END \ | ||
67 | (MSP_PCI_IOSPACE_BASE + MSP_PCI_IOSPACE_SIZE - 1) | ||
68 | |||
69 | /* IRQ for PCI status interrupts */ | ||
70 | #define PCI_STAT_IRQ 20 | ||
71 | |||
72 | #define QFLUSH_REG_1 0xB7F40000 | ||
73 | |||
74 | typedef volatile unsigned int pcireg; | ||
75 | typedef void * volatile ppcireg; | ||
76 | |||
77 | struct pci_block_copy | ||
78 | { | ||
79 | pcireg unused1; /* +0x00 */ | ||
80 | pcireg unused2; /* +0x04 */ | ||
81 | ppcireg unused3; /* +0x08 */ | ||
82 | ppcireg unused4; /* +0x0C */ | ||
83 | pcireg unused5; /* +0x10 */ | ||
84 | pcireg unused6; /* +0x14 */ | ||
85 | pcireg unused7; /* +0x18 */ | ||
86 | ppcireg unused8; /* +0x1C */ | ||
87 | ppcireg unused9; /* +0x20 */ | ||
88 | pcireg unusedA; /* +0x24 */ | ||
89 | ppcireg unusedB; /* +0x28 */ | ||
90 | ppcireg unusedC; /* +0x2C */ | ||
91 | }; | ||
92 | |||
93 | enum | ||
94 | { | ||
95 | config_device_vendor, /* 0 */ | ||
96 | config_status_command, /* 1 */ | ||
97 | config_class_revision, /* 2 */ | ||
98 | config_BIST_header_latency_cache, /* 3 */ | ||
99 | config_BAR0, /* 4 */ | ||
100 | config_BAR1, /* 5 */ | ||
101 | config_BAR2, /* 6 */ | ||
102 | config_not_used7, /* 7 */ | ||
103 | config_not_used8, /* 8 */ | ||
104 | config_not_used9, /* 9 */ | ||
105 | config_CIS, /* 10 */ | ||
106 | config_subsystem, /* 11 */ | ||
107 | config_not_used12, /* 12 */ | ||
108 | config_capabilities, /* 13 */ | ||
109 | config_not_used14, /* 14 */ | ||
110 | config_lat_grant_irq, /* 15 */ | ||
111 | config_message_control,/* 16 */ | ||
112 | config_message_addr, /* 17 */ | ||
113 | config_message_data, /* 18 */ | ||
114 | config_VPD_addr, /* 19 */ | ||
115 | config_VPD_data, /* 20 */ | ||
116 | config_maxregs /* 21 - number of registers */ | ||
117 | }; | ||
118 | |||
119 | struct msp_pci_regs | ||
120 | { | ||
121 | pcireg hop_unused_00; /* +0x00 */ | ||
122 | pcireg hop_unused_04; /* +0x04 */ | ||
123 | pcireg hop_unused_08; /* +0x08 */ | ||
124 | pcireg hop_unused_0C; /* +0x0C */ | ||
125 | pcireg hop_unused_10; /* +0x10 */ | ||
126 | pcireg hop_unused_14; /* +0x14 */ | ||
127 | pcireg hop_unused_18; /* +0x18 */ | ||
128 | pcireg hop_unused_1C; /* +0x1C */ | ||
129 | pcireg hop_unused_20; /* +0x20 */ | ||
130 | pcireg hop_unused_24; /* +0x24 */ | ||
131 | pcireg hop_unused_28; /* +0x28 */ | ||
132 | pcireg hop_unused_2C; /* +0x2C */ | ||
133 | pcireg hop_unused_30; /* +0x30 */ | ||
134 | pcireg hop_unused_34; /* +0x34 */ | ||
135 | pcireg if_control; /* +0x38 */ | ||
136 | pcireg oatran; /* +0x3C */ | ||
137 | pcireg reset_ctl; /* +0x40 */ | ||
138 | pcireg config_addr; /* +0x44 */ | ||
139 | pcireg hop_unused_48; /* +0x48 */ | ||
140 | pcireg msg_signaled_int_status; /* +0x4C */ | ||
141 | pcireg msg_signaled_int_mask; /* +0x50 */ | ||
142 | pcireg if_status; /* +0x54 */ | ||
143 | pcireg if_mask; /* +0x58 */ | ||
144 | pcireg hop_unused_5C; /* +0x5C */ | ||
145 | pcireg hop_unused_60; /* +0x60 */ | ||
146 | pcireg hop_unused_64; /* +0x64 */ | ||
147 | pcireg hop_unused_68; /* +0x68 */ | ||
148 | pcireg hop_unused_6C; /* +0x6C */ | ||
149 | pcireg hop_unused_70; /* +0x70 */ | ||
150 | |||
151 | struct pci_block_copy pci_bc[2] __attribute__((aligned(64))); | ||
152 | |||
153 | pcireg error_hdr1; /* +0xE0 */ | ||
154 | pcireg error_hdr2; /* +0xE4 */ | ||
155 | |||
156 | pcireg config[config_maxregs] __attribute__((aligned(256))); | ||
157 | |||
158 | }; | ||
159 | |||
160 | #define BPCI_CFGADDR_BUSNUM_SHF 16 | ||
161 | #define BPCI_CFGADDR_FUNCTNUM_SHF 8 | ||
162 | #define BPCI_CFGADDR_REGNUM_SHF 2 | ||
163 | #define BPCI_CFGADDR_ENABLE (1<<31) | ||
164 | |||
165 | #define BPCI_IFCONTROL_RTO (1<<20) /* Retry timeout */ | ||
166 | #define BPCI_IFCONTROL_HCE (1<<16) /* Host configuration enable */ | ||
167 | #define BPCI_IFCONTROL_CTO_SHF 12 /* Shift count for CTO bits */ | ||
168 | #define BPCI_IFCONTROL_SE (1<<5) /* Enable exceptions on errors */ | ||
169 | #define BPCI_IFCONTROL_BIST (1<<4) /* Use BIST in per. mode */ | ||
170 | #define BPCI_IFCONTROL_CAP (1<<3) /* Enable capabilities */ | ||
171 | #define BPCI_IFCONTROL_MMC_SHF 0 /* Shift count for MMC bits */ | ||
172 | |||
173 | #define BPCI_IFSTATUS_MGT (1<<8) /* Master Grant timeout */ | ||
174 | #define BPCI_IFSTATUS_MTT (1<<9) /* Master TRDY timeout */ | ||
175 | #define BPCI_IFSTATUS_MRT (1<<10) /* Master retry timeout */ | ||
176 | #define BPCI_IFSTATUS_BC0F (1<<13) /* Block copy 0 fault */ | ||
177 | #define BPCI_IFSTATUS_BC1F (1<<14) /* Block copy 1 fault */ | ||
178 | #define BPCI_IFSTATUS_PCIU (1<<15) /* PCI unable to respond */ | ||
179 | #define BPCI_IFSTATUS_BSIZ (1<<16) /* PCI access with illegal size */ | ||
180 | #define BPCI_IFSTATUS_BADD (1<<17) /* PCI access with illegal addr */ | ||
181 | #define BPCI_IFSTATUS_RTO (1<<18) /* Retry time out */ | ||
182 | #define BPCI_IFSTATUS_SER (1<<19) /* System error */ | ||
183 | #define BPCI_IFSTATUS_PER (1<<20) /* Parity error */ | ||
184 | #define BPCI_IFSTATUS_LCA (1<<21) /* Local CPU abort */ | ||
185 | #define BPCI_IFSTATUS_MEM (1<<22) /* Memory prot. violation */ | ||
186 | #define BPCI_IFSTATUS_ARB (1<<23) /* Arbiter timed out */ | ||
187 | #define BPCI_IFSTATUS_STA (1<<27) /* Signaled target abort */ | ||
188 | #define BPCI_IFSTATUS_TA (1<<28) /* Target abort */ | ||
189 | #define BPCI_IFSTATUS_MA (1<<29) /* Master abort */ | ||
190 | #define BPCI_IFSTATUS_PEI (1<<30) /* Parity error as initiator */ | ||
191 | #define BPCI_IFSTATUS_PET (1<<31) /* Parity error as target */ | ||
192 | |||
193 | #define BPCI_RESETCTL_PR (1<<0) /* True if reset asserted */ | ||
194 | #define BPCI_RESETCTL_RT (1<<4) /* Release time */ | ||
195 | #define BPCI_RESETCTL_CT (1<<8) /* Config time */ | ||
196 | #define BPCI_RESETCTL_PE (1<<12) /* PCI enabled */ | ||
197 | #define BPCI_RESETCTL_HM (1<<13) /* PCI host mode */ | ||
198 | #define BPCI_RESETCTL_RI (1<<14) /* PCI reset in */ | ||
199 | |||
200 | extern struct msp_pci_regs msp_pci_regs | ||
201 | __attribute__((section(".register"))); | ||
202 | extern unsigned long msp_pci_config_space | ||
203 | __attribute__((section(".register"))); | ||
204 | |||
205 | #endif /* !_MSP_PCI_H_ */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h b/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h deleted file mode 100644 index 14ca7dc382a8..000000000000 --- a/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h +++ /dev/null | |||
@@ -1,176 +0,0 @@ | |||
1 | /* | ||
2 | * MIPS boards bootprom interface for the Linux kernel. | ||
3 | * | ||
4 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
5 | * Author: Carsten Langgaard, carstenl@mips.com | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | */ | ||
24 | |||
25 | #ifndef _ASM_MSP_PROM_H | ||
26 | #define _ASM_MSP_PROM_H | ||
27 | |||
28 | #include <linux/types.h> | ||
29 | |||
30 | #define DEVICEID "deviceid" | ||
31 | #define FEATURES "features" | ||
32 | #define PROM_ENV "prom_env" | ||
33 | #define PROM_ENV_FILE "/proc/"PROM_ENV | ||
34 | #define PROM_ENV_SIZE 256 | ||
35 | |||
36 | #define CPU_DEVID_FAMILY 0x0000ff00 | ||
37 | #define CPU_DEVID_REVISION 0x000000ff | ||
38 | |||
39 | #define FPGA_IS_POLO(revision) \ | ||
40 | (((revision >= 0xb0) && (revision < 0xd0))) | ||
41 | #define FPGA_IS_5000(revision) \ | ||
42 | ((revision >= 0x80) && (revision <= 0x90)) | ||
43 | #define FPGA_IS_ZEUS(revision) ((revision < 0x7f)) | ||
44 | #define FPGA_IS_DUET(revision) \ | ||
45 | (((revision >= 0xa0) && (revision < 0xb0))) | ||
46 | #define FPGA_IS_MSP4200(revision) ((revision >= 0xd0)) | ||
47 | #define FPGA_IS_MSP7100(revision) ((revision >= 0xd0)) | ||
48 | |||
49 | #define MACHINE_TYPE_POLO "POLO" | ||
50 | #define MACHINE_TYPE_DUET "DUET" | ||
51 | #define MACHINE_TYPE_ZEUS "ZEUS" | ||
52 | #define MACHINE_TYPE_MSP2000REVB "MSP2000REVB" | ||
53 | #define MACHINE_TYPE_MSP5000 "MSP5000" | ||
54 | #define MACHINE_TYPE_MSP4200 "MSP4200" | ||
55 | #define MACHINE_TYPE_MSP7120 "MSP7120" | ||
56 | #define MACHINE_TYPE_MSP7130 "MSP7130" | ||
57 | #define MACHINE_TYPE_OTHER "OTHER" | ||
58 | |||
59 | #define MACHINE_TYPE_POLO_FPGA "POLO-FPGA" | ||
60 | #define MACHINE_TYPE_DUET_FPGA "DUET-FPGA" | ||
61 | #define MACHINE_TYPE_ZEUS_FPGA "ZEUS_FPGA" | ||
62 | #define MACHINE_TYPE_MSP2000REVB_FPGA "MSP2000REVB-FPGA" | ||
63 | #define MACHINE_TYPE_MSP5000_FPGA "MSP5000-FPGA" | ||
64 | #define MACHINE_TYPE_MSP4200_FPGA "MSP4200-FPGA" | ||
65 | #define MACHINE_TYPE_MSP7100_FPGA "MSP7100-FPGA" | ||
66 | #define MACHINE_TYPE_OTHER_FPGA "OTHER-FPGA" | ||
67 | |||
68 | /* Device Family definitions */ | ||
69 | #define FAMILY_FPGA 0x0000 | ||
70 | #define FAMILY_ZEUS 0x1000 | ||
71 | #define FAMILY_POLO 0x2000 | ||
72 | #define FAMILY_DUET 0x4000 | ||
73 | #define FAMILY_TRIAD 0x5000 | ||
74 | #define FAMILY_MSP4200 0x4200 | ||
75 | #define FAMILY_MSP4200_FPGA 0x4f00 | ||
76 | #define FAMILY_MSP7100 0x7100 | ||
77 | #define FAMILY_MSP7100_FPGA 0x7f00 | ||
78 | |||
79 | /* Device Type definitions */ | ||
80 | #define TYPE_MSP7120 0x7120 | ||
81 | #define TYPE_MSP7130 0x7130 | ||
82 | |||
83 | #define ENET_KEY 'E' | ||
84 | #define ENETTXD_KEY 'e' | ||
85 | #define PCI_KEY 'P' | ||
86 | #define PCIMUX_KEY 'p' | ||
87 | #define SEC_KEY 'S' | ||
88 | #define SPAD_KEY 'D' | ||
89 | #define TDM_KEY 'T' | ||
90 | #define ZSP_KEY 'Z' | ||
91 | |||
92 | #define FEATURE_NOEXIST '-' | ||
93 | #define FEATURE_EXIST '+' | ||
94 | |||
95 | #define ENET_MII 'M' | ||
96 | #define ENET_RMII 'R' | ||
97 | |||
98 | #define ENETTXD_FALLING 'F' | ||
99 | #define ENETTXD_RISING 'R' | ||
100 | |||
101 | #define PCI_HOST 'H' | ||
102 | #define PCI_PERIPHERAL 'P' | ||
103 | |||
104 | #define PCIMUX_FULL 'F' | ||
105 | #define PCIMUX_SINGLE 'S' | ||
106 | |||
107 | #define SEC_DUET 'D' | ||
108 | #define SEC_POLO 'P' | ||
109 | #define SEC_SLOW 'S' | ||
110 | #define SEC_TRIAD 'T' | ||
111 | |||
112 | #define SPAD_POLO 'P' | ||
113 | |||
114 | #define TDM_DUET 'D' /* DUET TDMs might exist */ | ||
115 | #define TDM_POLO 'P' /* POLO TDMs might exist */ | ||
116 | #define TDM_TRIAD 'T' /* TRIAD TDMs might exist */ | ||
117 | |||
118 | #define ZSP_DUET 'D' /* one DUET zsp engine */ | ||
119 | #define ZSP_TRIAD 'T' /* two TRIAD zsp engines */ | ||
120 | |||
121 | extern char *prom_getcmdline(void); | ||
122 | extern char *prom_getenv(char *name); | ||
123 | extern void prom_init_cmdline(void); | ||
124 | extern void prom_meminit(void); | ||
125 | extern void prom_fixup_mem_map(unsigned long start_mem, | ||
126 | unsigned long end_mem); | ||
127 | |||
128 | #ifdef CONFIG_MTD_PMC_MSP_RAMROOT | ||
129 | extern bool get_ramroot(void **start, unsigned long *size); | ||
130 | #endif | ||
131 | |||
132 | extern int get_ethernet_addr(char *ethaddr_name, char *ethernet_addr); | ||
133 | extern unsigned long get_deviceid(void); | ||
134 | extern char identify_enet(unsigned long interface_num); | ||
135 | extern char identify_enetTxD(unsigned long interface_num); | ||
136 | extern char identify_pci(void); | ||
137 | extern char identify_sec(void); | ||
138 | extern char identify_spad(void); | ||
139 | extern char identify_sec(void); | ||
140 | extern char identify_tdm(void); | ||
141 | extern char identify_zsp(void); | ||
142 | extern unsigned long identify_family(void); | ||
143 | extern unsigned long identify_revision(void); | ||
144 | |||
145 | /* | ||
146 | * The following macro calls prom_printf and puts the format string | ||
147 | * into an init section so it can be reclaimed. | ||
148 | */ | ||
149 | #define ppfinit(f, x...) \ | ||
150 | do { \ | ||
151 | static char _f[] __initdata = KERN_INFO f; \ | ||
152 | printk(_f, ## x); \ | ||
153 | } while (0) | ||
154 | |||
155 | /* Memory descriptor management. */ | ||
156 | #define PROM_MAX_PMEMBLOCKS 7 /* 6 used */ | ||
157 | |||
158 | enum yamon_memtypes { | ||
159 | yamon_dontuse, | ||
160 | yamon_prom, | ||
161 | yamon_free, | ||
162 | }; | ||
163 | |||
164 | struct prom_pmemblock { | ||
165 | unsigned long base; /* Within KSEG0. */ | ||
166 | unsigned int size; /* In bytes. */ | ||
167 | unsigned int type; /* free or prom memory */ | ||
168 | }; | ||
169 | |||
170 | extern int prom_argc; | ||
171 | extern char **prom_argv; | ||
172 | extern char **prom_envp; | ||
173 | extern int *prom_vec; | ||
174 | extern struct prom_pmemblock *prom_getmdesc(void); | ||
175 | |||
176 | #endif /* !_ASM_MSP_PROM_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h b/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h deleted file mode 100644 index 60a5a38dd5b2..000000000000 --- a/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h +++ /dev/null | |||
@@ -1,236 +0,0 @@ | |||
1 | /* | ||
2 | * SMP/VPE-safe functions to access "registers" (see note). | ||
3 | * | ||
4 | * NOTES: | ||
5 | * - These macros use ll/sc instructions, so it is your responsibility to | ||
6 | * ensure these are available on your platform before including this file. | ||
7 | * - The MIPS32 spec states that ll/sc results are undefined for uncached | ||
8 | * accesses. This means they can't be used on HW registers accessed | ||
9 | * through kseg1. Code which requires these macros for this purpose must | ||
10 | * front-end the registers with cached memory "registers" and have a single | ||
11 | * thread update the actual HW registers. | ||
12 | * - A maximum of 2k of code can be inserted between ll and sc. Every | ||
13 | * memory accesses between the instructions will increase the chance of | ||
14 | * sc failing and having to loop. | ||
15 | * - When using custom_read_reg32/custom_write_reg32 only perform the | ||
16 | * necessary logical operations on the register value in between these | ||
17 | * two calls. All other logic should be performed before the first call. | ||
18 | * - There is a bug on the R10000 chips which has a workaround. If you | ||
19 | * are affected by this bug, make sure to define the symbol 'R10000_LLSC_WAR' | ||
20 | * to be non-zero. If you are using this header from within linux, you may | ||
21 | * include <asm/war.h> before including this file to have this defined | ||
22 | * appropriately for you. | ||
23 | * | ||
24 | * Copyright 2005-2007 PMC-Sierra, Inc. | ||
25 | * | ||
26 | * This program is free software; you can redistribute it and/or modify it | ||
27 | * under the terms of the GNU General Public License as published by the | ||
28 | * Free Software Foundation; either version 2 of the License, or (at your | ||
29 | * option) any later version. | ||
30 | * | ||
31 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
32 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
33 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | ||
34 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
35 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
36 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
37 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
38 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
39 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
40 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
41 | * | ||
42 | * You should have received a copy of the GNU General Public License along | ||
43 | * with this program; if not, write to the Free Software Foundation, Inc., 675 | ||
44 | * Mass Ave, Cambridge, MA 02139, USA. | ||
45 | */ | ||
46 | |||
47 | #ifndef __ASM_REGOPS_H__ | ||
48 | #define __ASM_REGOPS_H__ | ||
49 | |||
50 | #include <linux/types.h> | ||
51 | |||
52 | #include <asm/war.h> | ||
53 | |||
54 | #ifndef R10000_LLSC_WAR | ||
55 | #define R10000_LLSC_WAR 0 | ||
56 | #endif | ||
57 | |||
58 | #if R10000_LLSC_WAR == 1 | ||
59 | #define __beqz "beqzl " | ||
60 | #else | ||
61 | #define __beqz "beqz " | ||
62 | #endif | ||
63 | |||
64 | #ifndef _LINUX_TYPES_H | ||
65 | typedef unsigned int u32; | ||
66 | #endif | ||
67 | |||
68 | /* | ||
69 | * Sets all the masked bits to the corresponding value bits | ||
70 | */ | ||
71 | static inline void set_value_reg32(volatile u32 *const addr, | ||
72 | u32 const mask, | ||
73 | u32 const value) | ||
74 | { | ||
75 | u32 temp; | ||
76 | |||
77 | __asm__ __volatile__( | ||
78 | " .set push \n" | ||
79 | " .set mips3 \n" | ||
80 | "1: ll %0, %1 # set_value_reg32 \n" | ||
81 | " and %0, %2 \n" | ||
82 | " or %0, %3 \n" | ||
83 | " sc %0, %1 \n" | ||
84 | " "__beqz"%0, 1b \n" | ||
85 | " nop \n" | ||
86 | " .set pop \n" | ||
87 | : "=&r" (temp), "=m" (*addr) | ||
88 | : "ir" (~mask), "ir" (value), "m" (*addr)); | ||
89 | } | ||
90 | |||
91 | /* | ||
92 | * Sets all the masked bits to '1' | ||
93 | */ | ||
94 | static inline void set_reg32(volatile u32 *const addr, | ||
95 | u32 const mask) | ||
96 | { | ||
97 | u32 temp; | ||
98 | |||
99 | __asm__ __volatile__( | ||
100 | " .set push \n" | ||
101 | " .set mips3 \n" | ||
102 | "1: ll %0, %1 # set_reg32 \n" | ||
103 | " or %0, %2 \n" | ||
104 | " sc %0, %1 \n" | ||
105 | " "__beqz"%0, 1b \n" | ||
106 | " nop \n" | ||
107 | " .set pop \n" | ||
108 | : "=&r" (temp), "=m" (*addr) | ||
109 | : "ir" (mask), "m" (*addr)); | ||
110 | } | ||
111 | |||
112 | /* | ||
113 | * Sets all the masked bits to '0' | ||
114 | */ | ||
115 | static inline void clear_reg32(volatile u32 *const addr, | ||
116 | u32 const mask) | ||
117 | { | ||
118 | u32 temp; | ||
119 | |||
120 | __asm__ __volatile__( | ||
121 | " .set push \n" | ||
122 | " .set mips3 \n" | ||
123 | "1: ll %0, %1 # clear_reg32 \n" | ||
124 | " and %0, %2 \n" | ||
125 | " sc %0, %1 \n" | ||
126 | " "__beqz"%0, 1b \n" | ||
127 | " nop \n" | ||
128 | " .set pop \n" | ||
129 | : "=&r" (temp), "=m" (*addr) | ||
130 | : "ir" (~mask), "m" (*addr)); | ||
131 | } | ||
132 | |||
133 | /* | ||
134 | * Toggles all masked bits from '0' to '1' and '1' to '0' | ||
135 | */ | ||
136 | static inline void toggle_reg32(volatile u32 *const addr, | ||
137 | u32 const mask) | ||
138 | { | ||
139 | u32 temp; | ||
140 | |||
141 | __asm__ __volatile__( | ||
142 | " .set push \n" | ||
143 | " .set mips3 \n" | ||
144 | "1: ll %0, %1 # toggle_reg32 \n" | ||
145 | " xor %0, %2 \n" | ||
146 | " sc %0, %1 \n" | ||
147 | " "__beqz"%0, 1b \n" | ||
148 | " nop \n" | ||
149 | " .set pop \n" | ||
150 | : "=&r" (temp), "=m" (*addr) | ||
151 | : "ir" (mask), "m" (*addr)); | ||
152 | } | ||
153 | |||
154 | /* | ||
155 | * Read all masked bits others are returned as '0' | ||
156 | */ | ||
157 | static inline u32 read_reg32(volatile u32 *const addr, | ||
158 | u32 const mask) | ||
159 | { | ||
160 | u32 temp; | ||
161 | |||
162 | __asm__ __volatile__( | ||
163 | " .set push \n" | ||
164 | " .set noreorder \n" | ||
165 | " lw %0, %1 # read \n" | ||
166 | " and %0, %2 # mask \n" | ||
167 | " .set pop \n" | ||
168 | : "=&r" (temp) | ||
169 | : "m" (*addr), "ir" (mask)); | ||
170 | |||
171 | return temp; | ||
172 | } | ||
173 | |||
174 | /* | ||
175 | * blocking_read_reg32 - Read address with blocking load | ||
176 | * | ||
177 | * Uncached writes need to be read back to ensure they reach RAM. | ||
178 | * The returned value must be 'used' to prevent from becoming a | ||
179 | * non-blocking load. | ||
180 | */ | ||
181 | static inline u32 blocking_read_reg32(volatile u32 *const addr) | ||
182 | { | ||
183 | u32 temp; | ||
184 | |||
185 | __asm__ __volatile__( | ||
186 | " .set push \n" | ||
187 | " .set noreorder \n" | ||
188 | " lw %0, %1 # read \n" | ||
189 | " move %0, %0 # block \n" | ||
190 | " .set pop \n" | ||
191 | : "=&r" (temp) | ||
192 | : "m" (*addr)); | ||
193 | |||
194 | return temp; | ||
195 | } | ||
196 | |||
197 | /* | ||
198 | * For special strange cases only: | ||
199 | * | ||
200 | * If you need custom processing within a ll/sc loop, use the following macros | ||
201 | * VERY CAREFULLY: | ||
202 | * | ||
203 | * u32 tmp; <-- Define a variable to hold the data | ||
204 | * | ||
205 | * custom_read_reg32(address, tmp); <-- Reads the address and put the value | ||
206 | * in the 'tmp' variable given | ||
207 | * | ||
208 | * From here on out, you are (basicly) atomic, so don't do anything too | ||
209 | * fancy! | ||
210 | * Also, this code may loop if the end of this block fails to write | ||
211 | * everything back safely due do the other CPU, so do NOT do anything | ||
212 | * with side-effects! | ||
213 | * | ||
214 | * custom_write_reg32(address, tmp); <-- Writes back 'tmp' safely. | ||
215 | */ | ||
216 | #define custom_read_reg32(address, tmp) \ | ||
217 | __asm__ __volatile__( \ | ||
218 | " .set push \n" \ | ||
219 | " .set mips3 \n" \ | ||
220 | "1: ll %0, %1 #custom_read_reg32 \n" \ | ||
221 | " .set pop \n" \ | ||
222 | : "=r" (tmp), "=m" (*address) \ | ||
223 | : "m" (*address)) | ||
224 | |||
225 | #define custom_write_reg32(address, tmp) \ | ||
226 | __asm__ __volatile__( \ | ||
227 | " .set push \n" \ | ||
228 | " .set mips3 \n" \ | ||
229 | " sc %0, %1 #custom_write_reg32 \n" \ | ||
230 | " "__beqz"%0, 1b \n" \ | ||
231 | " nop \n" \ | ||
232 | " .set pop \n" \ | ||
233 | : "=&r" (tmp), "=m" (*address) \ | ||
234 | : "0" (tmp), "m" (*address)) | ||
235 | |||
236 | #endif /* __ASM_REGOPS_H__ */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h b/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h deleted file mode 100644 index 603eb737b4a8..000000000000 --- a/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h +++ /dev/null | |||
@@ -1,663 +0,0 @@ | |||
1 | /* | ||
2 | * Defines for the address space, registers and register configuration | ||
3 | * (bit masks, access macros etc) for the PMC-Sierra line of MSP products. | ||
4 | * This file contains addess maps for all the devices in the line of | ||
5 | * products but only has register definitions and configuration masks for | ||
6 | * registers which aren't definitely associated with any device. Things | ||
7 | * like clock settings, reset access, the ELB etc. Individual device | ||
8 | * drivers will reference the appropriate XXX_BASE value defined here | ||
9 | * and have individual registers offset from that. | ||
10 | * | ||
11 | * Copyright (C) 2005-2007 PMC-Sierra, Inc. All rights reserved. | ||
12 | * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com | ||
13 | * | ||
14 | * ######################################################################## | ||
15 | * | ||
16 | * This program is free software; you can distribute it and/or modify it | ||
17 | * under the terms of the GNU General Public License (Version 2) as | ||
18 | * published by the Free Software Foundation. | ||
19 | * | ||
20 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
22 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
23 | * for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
28 | * | ||
29 | * ######################################################################## | ||
30 | */ | ||
31 | |||
32 | #include <asm/addrspace.h> | ||
33 | #include <linux/types.h> | ||
34 | |||
35 | #ifndef _ASM_MSP_REGS_H | ||
36 | #define _ASM_MSP_REGS_H | ||
37 | |||
38 | /* | ||
39 | ######################################################################## | ||
40 | # Address space and device base definitions # | ||
41 | ######################################################################## | ||
42 | */ | ||
43 | |||
44 | /* | ||
45 | *************************************************************************** | ||
46 | * System Logic and Peripherals (ELB, UART0, etc) device address space * | ||
47 | *************************************************************************** | ||
48 | */ | ||
49 | #define MSP_SLP_BASE 0x1c000000 | ||
50 | /* System Logic and Peripherals */ | ||
51 | #define MSP_RST_BASE (MSP_SLP_BASE + 0x10) | ||
52 | /* System reset register base */ | ||
53 | #define MSP_RST_SIZE 0x0C /* System reset register space */ | ||
54 | |||
55 | #define MSP_WTIMER_BASE (MSP_SLP_BASE + 0x04C) | ||
56 | /* watchdog timer base */ | ||
57 | #define MSP_ITIMER_BASE (MSP_SLP_BASE + 0x054) | ||
58 | /* internal timer base */ | ||
59 | #define MSP_UART0_BASE (MSP_SLP_BASE + 0x100) | ||
60 | /* UART0 controller base */ | ||
61 | #define MSP_BCPY_CTRL_BASE (MSP_SLP_BASE + 0x120) | ||
62 | /* Block Copy controller base */ | ||
63 | #define MSP_BCPY_DESC_BASE (MSP_SLP_BASE + 0x160) | ||
64 | /* Block Copy descriptor base */ | ||
65 | |||
66 | /* | ||
67 | *************************************************************************** | ||
68 | * PCI address space * | ||
69 | *************************************************************************** | ||
70 | */ | ||
71 | #define MSP_PCI_BASE 0x19000000 | ||
72 | |||
73 | /* | ||
74 | *************************************************************************** | ||
75 | * MSbus device address space * | ||
76 | *************************************************************************** | ||
77 | */ | ||
78 | #define MSP_MSB_BASE 0x18000000 | ||
79 | /* MSbus address start */ | ||
80 | #define MSP_PER_BASE (MSP_MSB_BASE + 0x400000) | ||
81 | /* Peripheral device registers */ | ||
82 | #define MSP_MAC0_BASE (MSP_MSB_BASE + 0x600000) | ||
83 | /* MAC A device registers */ | ||
84 | #define MSP_MAC1_BASE (MSP_MSB_BASE + 0x700000) | ||
85 | /* MAC B device registers */ | ||
86 | #define MSP_MAC_SIZE 0xE0 /* MAC register space */ | ||
87 | |||
88 | #define MSP_SEC_BASE (MSP_MSB_BASE + 0x800000) | ||
89 | /* Security Engine registers */ | ||
90 | #define MSP_MAC2_BASE (MSP_MSB_BASE + 0x900000) | ||
91 | /* MAC C device registers */ | ||
92 | #define MSP_ADSL2_BASE (MSP_MSB_BASE + 0xA80000) | ||
93 | /* ADSL2 device registers */ | ||
94 | #define MSP_USB_BASE (MSP_MSB_BASE + 0xB40000) | ||
95 | /* USB device registers */ | ||
96 | #define MSP_USB_BASE_START (MSP_MSB_BASE + 0xB40100) | ||
97 | /* USB device registers */ | ||
98 | #define MSP_USB_BASE_END (MSP_MSB_BASE + 0xB401FF) | ||
99 | /* USB device registers */ | ||
100 | #define MSP_CPUIF_BASE (MSP_MSB_BASE + 0xC00000) | ||
101 | /* CPU interface registers */ | ||
102 | |||
103 | /* Devices within the MSbus peripheral block */ | ||
104 | #define MSP_UART1_BASE (MSP_PER_BASE + 0x030) | ||
105 | /* UART1 controller base */ | ||
106 | #define MSP_SPI_BASE (MSP_PER_BASE + 0x058) | ||
107 | /* SPI/MPI control registers */ | ||
108 | #define MSP_TWI_BASE (MSP_PER_BASE + 0x090) | ||
109 | /* Two-wire control registers */ | ||
110 | #define MSP_PTIMER_BASE (MSP_PER_BASE + 0x0F0) | ||
111 | /* Programmable timer control */ | ||
112 | |||
113 | /* | ||
114 | *************************************************************************** | ||
115 | * Physical Memory configuration address space * | ||
116 | *************************************************************************** | ||
117 | */ | ||
118 | #define MSP_MEM_CFG_BASE 0x17f00000 | ||
119 | |||
120 | #define MSP_MEM_INDIRECT_CTL_10 0x10 | ||
121 | |||
122 | /* | ||
123 | * Notes: | ||
124 | * 1) The SPI registers are split into two blocks, one offset from the | ||
125 | * MSP_SPI_BASE by 0x00 and the other offset from the MSP_SPI_BASE by | ||
126 | * 0x68. The SPI driver definitions for the register must be aware | ||
127 | * of this. | ||
128 | * 2) The block copy engine register are divided into two regions, one | ||
129 | * for the control/configuration of the engine proper and one for the | ||
130 | * values of the descriptors used in the copy process. These have | ||
131 | * different base defines (CTRL_BASE vs DESC_BASE) | ||
132 | * 3) These constants are for physical addresses which means that they | ||
133 | * work correctly with "ioremap" and friends. This means that device | ||
134 | * drivers will need to remap these addresses using ioremap and perhaps | ||
135 | * the readw/writew macros. Or they could use the regptr() macro | ||
136 | * defined below, but the readw/writew calls are the correct thing. | ||
137 | * 4) The UARTs have an additional status register offset from the base | ||
138 | * address. This register isn't used in the standard 8250 driver but | ||
139 | * may be used in other software. Consult the hardware datasheet for | ||
140 | * offset details. | ||
141 | * 5) For some unknown reason the security engine (MSP_SEC_BASE) registers | ||
142 | * start at an offset of 0x84 from the base address but the block of | ||
143 | * registers before this is reserved for the security engine. The | ||
144 | * driver will have to be aware of this but it makes the register | ||
145 | * definitions line up better with the documentation. | ||
146 | */ | ||
147 | |||
148 | /* | ||
149 | ######################################################################## | ||
150 | # System register definitions. Not associated with a specific device # | ||
151 | ######################################################################## | ||
152 | */ | ||
153 | |||
154 | /* | ||
155 | * This macro maps the physical register number into uncached space | ||
156 | * and (for C code) casts it into a u32 pointer so it can be dereferenced | ||
157 | * Normally these would be accessed with ioremap and readX/writeX, but | ||
158 | * these are convenient for a lot of internal kernel code. | ||
159 | */ | ||
160 | #ifdef __ASSEMBLER__ | ||
161 | #define regptr(addr) (KSEG1ADDR(addr)) | ||
162 | #else | ||
163 | #define regptr(addr) ((volatile u32 *const)(KSEG1ADDR(addr))) | ||
164 | #endif | ||
165 | |||
166 | /* | ||
167 | *************************************************************************** | ||
168 | * System Logic and Peripherals (RESET, ELB, etc) registers * | ||
169 | *************************************************************************** | ||
170 | */ | ||
171 | |||
172 | /* System Control register definitions */ | ||
173 | #define DEV_ID_REG regptr(MSP_SLP_BASE + 0x00) | ||
174 | /* Device-ID RO */ | ||
175 | #define FWR_ID_REG regptr(MSP_SLP_BASE + 0x04) | ||
176 | /* Firmware-ID Register RW */ | ||
177 | #define SYS_ID_REG0 regptr(MSP_SLP_BASE + 0x08) | ||
178 | /* System-ID Register-0 RW */ | ||
179 | #define SYS_ID_REG1 regptr(MSP_SLP_BASE + 0x0C) | ||
180 | /* System-ID Register-1 RW */ | ||
181 | |||
182 | /* System Reset register definitions */ | ||
183 | #define RST_STS_REG regptr(MSP_SLP_BASE + 0x10) | ||
184 | /* System Reset Status RO */ | ||
185 | #define RST_SET_REG regptr(MSP_SLP_BASE + 0x14) | ||
186 | /* System Set Reset WO */ | ||
187 | #define RST_CLR_REG regptr(MSP_SLP_BASE + 0x18) | ||
188 | /* System Clear Reset WO */ | ||
189 | |||
190 | /* System Clock Registers */ | ||
191 | #define PCI_SLP_REG regptr(MSP_SLP_BASE + 0x1C) | ||
192 | /* PCI clock generator RW */ | ||
193 | #define URT_SLP_REG regptr(MSP_SLP_BASE + 0x20) | ||
194 | /* UART clock generator RW */ | ||
195 | /* reserved (MSP_SLP_BASE + 0x24) */ | ||
196 | /* reserved (MSP_SLP_BASE + 0x28) */ | ||
197 | #define PLL1_SLP_REG regptr(MSP_SLP_BASE + 0x2C) | ||
198 | /* PLL1 clock generator RW */ | ||
199 | #define PLL0_SLP_REG regptr(MSP_SLP_BASE + 0x30) | ||
200 | /* PLL0 clock generator RW */ | ||
201 | #define MIPS_SLP_REG regptr(MSP_SLP_BASE + 0x34) | ||
202 | /* MIPS clock generator RW */ | ||
203 | #define VE_SLP_REG regptr(MSP_SLP_BASE + 0x38) | ||
204 | /* Voice Eng clock generator RW */ | ||
205 | /* reserved (MSP_SLP_BASE + 0x3C) */ | ||
206 | #define MSB_SLP_REG regptr(MSP_SLP_BASE + 0x40) | ||
207 | /* MS-Bus clock generator RW */ | ||
208 | #define SMAC_SLP_REG regptr(MSP_SLP_BASE + 0x44) | ||
209 | /* Sec & MAC clock generator RW */ | ||
210 | #define PERF_SLP_REG regptr(MSP_SLP_BASE + 0x48) | ||
211 | /* Per & TDM clock generator RW */ | ||
212 | |||
213 | /* Interrupt Controller Registers */ | ||
214 | #define SLP_INT_STS_REG regptr(MSP_SLP_BASE + 0x70) | ||
215 | /* Interrupt status register RW */ | ||
216 | #define SLP_INT_MSK_REG regptr(MSP_SLP_BASE + 0x74) | ||
217 | /* Interrupt enable/mask RW */ | ||
218 | #define SE_MBOX_REG regptr(MSP_SLP_BASE + 0x78) | ||
219 | /* Security Engine mailbox RW */ | ||
220 | #define VE_MBOX_REG regptr(MSP_SLP_BASE + 0x7C) | ||
221 | /* Voice Engine mailbox RW */ | ||
222 | |||
223 | /* ELB Controller Registers */ | ||
224 | #define CS0_CNFG_REG regptr(MSP_SLP_BASE + 0x80) | ||
225 | /* ELB CS0 Configuration Reg */ | ||
226 | #define CS0_ADDR_REG regptr(MSP_SLP_BASE + 0x84) | ||
227 | /* ELB CS0 Base Address Reg */ | ||
228 | #define CS0_MASK_REG regptr(MSP_SLP_BASE + 0x88) | ||
229 | /* ELB CS0 Mask Register */ | ||
230 | #define CS0_ACCESS_REG regptr(MSP_SLP_BASE + 0x8C) | ||
231 | /* ELB CS0 access register */ | ||
232 | |||
233 | #define CS1_CNFG_REG regptr(MSP_SLP_BASE + 0x90) | ||
234 | /* ELB CS1 Configuration Reg */ | ||
235 | #define CS1_ADDR_REG regptr(MSP_SLP_BASE + 0x94) | ||
236 | /* ELB CS1 Base Address Reg */ | ||
237 | #define CS1_MASK_REG regptr(MSP_SLP_BASE + 0x98) | ||
238 | /* ELB CS1 Mask Register */ | ||
239 | #define CS1_ACCESS_REG regptr(MSP_SLP_BASE + 0x9C) | ||
240 | /* ELB CS1 access register */ | ||
241 | |||
242 | #define CS2_CNFG_REG regptr(MSP_SLP_BASE + 0xA0) | ||
243 | /* ELB CS2 Configuration Reg */ | ||
244 | #define CS2_ADDR_REG regptr(MSP_SLP_BASE + 0xA4) | ||
245 | /* ELB CS2 Base Address Reg */ | ||
246 | #define CS2_MASK_REG regptr(MSP_SLP_BASE + 0xA8) | ||
247 | /* ELB CS2 Mask Register */ | ||
248 | #define CS2_ACCESS_REG regptr(MSP_SLP_BASE + 0xAC) | ||
249 | /* ELB CS2 access register */ | ||
250 | |||
251 | #define CS3_CNFG_REG regptr(MSP_SLP_BASE + 0xB0) | ||
252 | /* ELB CS3 Configuration Reg */ | ||
253 | #define CS3_ADDR_REG regptr(MSP_SLP_BASE + 0xB4) | ||
254 | /* ELB CS3 Base Address Reg */ | ||
255 | #define CS3_MASK_REG regptr(MSP_SLP_BASE + 0xB8) | ||
256 | /* ELB CS3 Mask Register */ | ||
257 | #define CS3_ACCESS_REG regptr(MSP_SLP_BASE + 0xBC) | ||
258 | /* ELB CS3 access register */ | ||
259 | |||
260 | #define CS4_CNFG_REG regptr(MSP_SLP_BASE + 0xC0) | ||
261 | /* ELB CS4 Configuration Reg */ | ||
262 | #define CS4_ADDR_REG regptr(MSP_SLP_BASE + 0xC4) | ||
263 | /* ELB CS4 Base Address Reg */ | ||
264 | #define CS4_MASK_REG regptr(MSP_SLP_BASE + 0xC8) | ||
265 | /* ELB CS4 Mask Register */ | ||
266 | #define CS4_ACCESS_REG regptr(MSP_SLP_BASE + 0xCC) | ||
267 | /* ELB CS4 access register */ | ||
268 | |||
269 | #define CS5_CNFG_REG regptr(MSP_SLP_BASE + 0xD0) | ||
270 | /* ELB CS5 Configuration Reg */ | ||
271 | #define CS5_ADDR_REG regptr(MSP_SLP_BASE + 0xD4) | ||
272 | /* ELB CS5 Base Address Reg */ | ||
273 | #define CS5_MASK_REG regptr(MSP_SLP_BASE + 0xD8) | ||
274 | /* ELB CS5 Mask Register */ | ||
275 | #define CS5_ACCESS_REG regptr(MSP_SLP_BASE + 0xDC) | ||
276 | /* ELB CS5 access register */ | ||
277 | |||
278 | /* reserved 0xE0 - 0xE8 */ | ||
279 | #define ELB_1PC_EN_REG regptr(MSP_SLP_BASE + 0xEC) | ||
280 | /* ELB single PC card detect */ | ||
281 | |||
282 | /* reserved 0xF0 - 0xF8 */ | ||
283 | #define ELB_CLK_CFG_REG regptr(MSP_SLP_BASE + 0xFC) | ||
284 | /* SDRAM read/ELB timing Reg */ | ||
285 | |||
286 | /* Extended UART status registers */ | ||
287 | #define UART0_STATUS_REG regptr(MSP_UART0_BASE + 0x0c0) | ||
288 | /* UART Status Register 0 */ | ||
289 | #define UART1_STATUS_REG regptr(MSP_UART1_BASE + 0x170) | ||
290 | /* UART Status Register 1 */ | ||
291 | |||
292 | /* Performance monitoring registers */ | ||
293 | #define PERF_MON_CTRL_REG regptr(MSP_SLP_BASE + 0x140) | ||
294 | /* Performance monitor control */ | ||
295 | #define PERF_MON_CLR_REG regptr(MSP_SLP_BASE + 0x144) | ||
296 | /* Performance monitor clear */ | ||
297 | #define PERF_MON_CNTH_REG regptr(MSP_SLP_BASE + 0x148) | ||
298 | /* Perf monitor counter high */ | ||
299 | #define PERF_MON_CNTL_REG regptr(MSP_SLP_BASE + 0x14C) | ||
300 | /* Perf monitor counter low */ | ||
301 | |||
302 | /* System control registers */ | ||
303 | #define SYS_CTRL_REG regptr(MSP_SLP_BASE + 0x150) | ||
304 | /* System control register */ | ||
305 | #define SYS_ERR1_REG regptr(MSP_SLP_BASE + 0x154) | ||
306 | /* System Error status 1 */ | ||
307 | #define SYS_ERR2_REG regptr(MSP_SLP_BASE + 0x158) | ||
308 | /* System Error status 2 */ | ||
309 | #define SYS_INT_CFG_REG regptr(MSP_SLP_BASE + 0x15C) | ||
310 | /* System Interrupt config */ | ||
311 | |||
312 | /* Voice Engine Memory configuration */ | ||
313 | #define VE_MEM_REG regptr(MSP_SLP_BASE + 0x17C) | ||
314 | /* Voice engine memory config */ | ||
315 | |||
316 | /* CPU/SLP Error Status registers */ | ||
317 | #define CPU_ERR1_REG regptr(MSP_SLP_BASE + 0x180) | ||
318 | /* CPU/SLP Error status 1 */ | ||
319 | #define CPU_ERR2_REG regptr(MSP_SLP_BASE + 0x184) | ||
320 | /* CPU/SLP Error status 1 */ | ||
321 | |||
322 | #define EXTENDED_GPIO_REG regptr(MSP_SLP_BASE + 0x188) | ||
323 | /* Extended GPIO register */ | ||
324 | |||
325 | /* System Error registers */ | ||
326 | #define SLP_ERR_STS_REG regptr(MSP_SLP_BASE + 0x190) | ||
327 | /* Int status for SLP errors */ | ||
328 | #define SLP_ERR_MSK_REG regptr(MSP_SLP_BASE + 0x194) | ||
329 | /* Int mask for SLP errors */ | ||
330 | #define SLP_ELB_ERST_REG regptr(MSP_SLP_BASE + 0x198) | ||
331 | /* External ELB reset */ | ||
332 | #define SLP_BOOT_STS_REG regptr(MSP_SLP_BASE + 0x19C) | ||
333 | /* Boot Status */ | ||
334 | |||
335 | /* Extended ELB addressing */ | ||
336 | #define CS0_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A0) | ||
337 | /* CS0 Extended address */ | ||
338 | #define CS1_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A4) | ||
339 | /* CS1 Extended address */ | ||
340 | #define CS2_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A8) | ||
341 | /* CS2 Extended address */ | ||
342 | #define CS3_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1AC) | ||
343 | /* CS3 Extended address */ | ||
344 | /* reserved 0x1B0 */ | ||
345 | #define CS5_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1B4) | ||
346 | /* CS5 Extended address */ | ||
347 | |||
348 | /* PLL Adjustment registers */ | ||
349 | #define PLL_LOCK_REG regptr(MSP_SLP_BASE + 0x200) | ||
350 | /* PLL0 lock status */ | ||
351 | #define PLL_ARST_REG regptr(MSP_SLP_BASE + 0x204) | ||
352 | /* PLL Analog reset status */ | ||
353 | #define PLL0_ADJ_REG regptr(MSP_SLP_BASE + 0x208) | ||
354 | /* PLL0 Adjustment value */ | ||
355 | #define PLL1_ADJ_REG regptr(MSP_SLP_BASE + 0x20C) | ||
356 | /* PLL1 Adjustment value */ | ||
357 | |||
358 | /* | ||
359 | *************************************************************************** | ||
360 | * Peripheral Register definitions * | ||
361 | *************************************************************************** | ||
362 | */ | ||
363 | |||
364 | /* Peripheral status */ | ||
365 | #define PER_CTRL_REG regptr(MSP_PER_BASE + 0x50) | ||
366 | /* Peripheral control register */ | ||
367 | #define PER_STS_REG regptr(MSP_PER_BASE + 0x54) | ||
368 | /* Peripheral status register */ | ||
369 | |||
370 | /* SPI/MPI Registers */ | ||
371 | #define SMPI_TX_SZ_REG regptr(MSP_PER_BASE + 0x58) | ||
372 | /* SPI/MPI Tx Size register */ | ||
373 | #define SMPI_RX_SZ_REG regptr(MSP_PER_BASE + 0x5C) | ||
374 | /* SPI/MPI Rx Size register */ | ||
375 | #define SMPI_CTL_REG regptr(MSP_PER_BASE + 0x60) | ||
376 | /* SPI/MPI Control register */ | ||
377 | #define SMPI_MS_REG regptr(MSP_PER_BASE + 0x64) | ||
378 | /* SPI/MPI Chip Select reg */ | ||
379 | #define SMPI_CORE_DATA_REG regptr(MSP_PER_BASE + 0xC0) | ||
380 | /* SPI/MPI Core Data reg */ | ||
381 | #define SMPI_CORE_CTRL_REG regptr(MSP_PER_BASE + 0xC4) | ||
382 | /* SPI/MPI Core Control reg */ | ||
383 | #define SMPI_CORE_STAT_REG regptr(MSP_PER_BASE + 0xC8) | ||
384 | /* SPI/MPI Core Status reg */ | ||
385 | #define SMPI_CORE_SSEL_REG regptr(MSP_PER_BASE + 0xCC) | ||
386 | /* SPI/MPI Core Ssel reg */ | ||
387 | #define SMPI_FIFO_REG regptr(MSP_PER_BASE + 0xD0) | ||
388 | /* SPI/MPI Data FIFO reg */ | ||
389 | |||
390 | /* Peripheral Block Error Registers */ | ||
391 | #define PER_ERR_STS_REG regptr(MSP_PER_BASE + 0x70) | ||
392 | /* Error Bit Status Register */ | ||
393 | #define PER_ERR_MSK_REG regptr(MSP_PER_BASE + 0x74) | ||
394 | /* Error Bit Mask Register */ | ||
395 | #define PER_HDR1_REG regptr(MSP_PER_BASE + 0x78) | ||
396 | /* Error Header 1 Register */ | ||
397 | #define PER_HDR2_REG regptr(MSP_PER_BASE + 0x7C) | ||
398 | /* Error Header 2 Register */ | ||
399 | |||
400 | /* Peripheral Block Interrupt Registers */ | ||
401 | #define PER_INT_STS_REG regptr(MSP_PER_BASE + 0x80) | ||
402 | /* Interrupt status register */ | ||
403 | #define PER_INT_MSK_REG regptr(MSP_PER_BASE + 0x84) | ||
404 | /* Interrupt Mask Register */ | ||
405 | #define GPIO_INT_STS_REG regptr(MSP_PER_BASE + 0x88) | ||
406 | /* GPIO interrupt status reg */ | ||
407 | #define GPIO_INT_MSK_REG regptr(MSP_PER_BASE + 0x8C) | ||
408 | /* GPIO interrupt MASK Reg */ | ||
409 | |||
410 | /* POLO GPIO registers */ | ||
411 | #define POLO_GPIO_DAT1_REG regptr(MSP_PER_BASE + 0x0E0) | ||
412 | /* Polo GPIO[8:0] data reg */ | ||
413 | #define POLO_GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x0E4) | ||
414 | /* Polo GPIO[7:0] config reg */ | ||
415 | #define POLO_GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x0E8) | ||
416 | /* Polo GPIO[15:8] config reg */ | ||
417 | #define POLO_GPIO_OD1_REG regptr(MSP_PER_BASE + 0x0EC) | ||
418 | /* Polo GPIO[31:0] output drive */ | ||
419 | #define POLO_GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x170) | ||
420 | /* Polo GPIO[23:16] config reg */ | ||
421 | #define POLO_GPIO_DAT2_REG regptr(MSP_PER_BASE + 0x174) | ||
422 | /* Polo GPIO[15:9] data reg */ | ||
423 | #define POLO_GPIO_DAT3_REG regptr(MSP_PER_BASE + 0x178) | ||
424 | /* Polo GPIO[23:16] data reg */ | ||
425 | #define POLO_GPIO_DAT4_REG regptr(MSP_PER_BASE + 0x17C) | ||
426 | /* Polo GPIO[31:24] data reg */ | ||
427 | #define POLO_GPIO_DAT5_REG regptr(MSP_PER_BASE + 0x180) | ||
428 | /* Polo GPIO[39:32] data reg */ | ||
429 | #define POLO_GPIO_DAT6_REG regptr(MSP_PER_BASE + 0x184) | ||
430 | /* Polo GPIO[47:40] data reg */ | ||
431 | #define POLO_GPIO_DAT7_REG regptr(MSP_PER_BASE + 0x188) | ||
432 | /* Polo GPIO[54:48] data reg */ | ||
433 | #define POLO_GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C) | ||
434 | /* Polo GPIO[31:24] config reg */ | ||
435 | #define POLO_GPIO_CFG5_REG regptr(MSP_PER_BASE + 0x190) | ||
436 | /* Polo GPIO[39:32] config reg */ | ||
437 | #define POLO_GPIO_CFG6_REG regptr(MSP_PER_BASE + 0x194) | ||
438 | /* Polo GPIO[47:40] config reg */ | ||
439 | #define POLO_GPIO_CFG7_REG regptr(MSP_PER_BASE + 0x198) | ||
440 | /* Polo GPIO[54:48] config reg */ | ||
441 | #define POLO_GPIO_OD2_REG regptr(MSP_PER_BASE + 0x19C) | ||
442 | /* Polo GPIO[54:32] output drive */ | ||
443 | |||
444 | /* Generic GPIO registers */ | ||
445 | #define GPIO_DATA1_REG regptr(MSP_PER_BASE + 0x170) | ||
446 | /* GPIO[1:0] data register */ | ||
447 | #define GPIO_DATA2_REG regptr(MSP_PER_BASE + 0x174) | ||
448 | /* GPIO[5:2] data register */ | ||
449 | #define GPIO_DATA3_REG regptr(MSP_PER_BASE + 0x178) | ||
450 | /* GPIO[9:6] data register */ | ||
451 | #define GPIO_DATA4_REG regptr(MSP_PER_BASE + 0x17C) | ||
452 | /* GPIO[15:10] data register */ | ||
453 | #define GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x180) | ||
454 | /* GPIO[1:0] config register */ | ||
455 | #define GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x184) | ||
456 | /* GPIO[5:2] config register */ | ||
457 | #define GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x188) | ||
458 | /* GPIO[9:6] config register */ | ||
459 | #define GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C) | ||
460 | /* GPIO[15:10] config register */ | ||
461 | #define GPIO_OD_REG regptr(MSP_PER_BASE + 0x190) | ||
462 | /* GPIO[15:0] output drive */ | ||
463 | |||
464 | /* | ||
465 | *************************************************************************** | ||
466 | * CPU Interface register definitions * | ||
467 | *************************************************************************** | ||
468 | */ | ||
469 | #define PCI_FLUSH_REG regptr(MSP_CPUIF_BASE + 0x00) | ||
470 | /* PCI-SDRAM queue flush trigger */ | ||
471 | #define OCP_ERR1_REG regptr(MSP_CPUIF_BASE + 0x04) | ||
472 | /* OCP Error Attribute 1 */ | ||
473 | #define OCP_ERR2_REG regptr(MSP_CPUIF_BASE + 0x08) | ||
474 | /* OCP Error Attribute 2 */ | ||
475 | #define OCP_STS_REG regptr(MSP_CPUIF_BASE + 0x0C) | ||
476 | /* OCP Error Status */ | ||
477 | #define CPUIF_PM_REG regptr(MSP_CPUIF_BASE + 0x10) | ||
478 | /* CPU policy configuration */ | ||
479 | #define CPUIF_CFG_REG regptr(MSP_CPUIF_BASE + 0x10) | ||
480 | /* Misc configuration options */ | ||
481 | |||
482 | /* Central Interrupt Controller Registers */ | ||
483 | #define MSP_CIC_BASE (MSP_CPUIF_BASE + 0x8000) | ||
484 | /* Central Interrupt registers */ | ||
485 | #define CIC_EXT_CFG_REG regptr(MSP_CIC_BASE + 0x00) | ||
486 | /* External interrupt config */ | ||
487 | #define CIC_STS_REG regptr(MSP_CIC_BASE + 0x04) | ||
488 | /* CIC Interrupt Status */ | ||
489 | #define CIC_VPE0_MSK_REG regptr(MSP_CIC_BASE + 0x08) | ||
490 | /* VPE0 Interrupt Mask */ | ||
491 | #define CIC_VPE1_MSK_REG regptr(MSP_CIC_BASE + 0x0C) | ||
492 | /* VPE1 Interrupt Mask */ | ||
493 | #define CIC_TC0_MSK_REG regptr(MSP_CIC_BASE + 0x10) | ||
494 | /* Thread Context 0 Int Mask */ | ||
495 | #define CIC_TC1_MSK_REG regptr(MSP_CIC_BASE + 0x14) | ||
496 | /* Thread Context 1 Int Mask */ | ||
497 | #define CIC_TC2_MSK_REG regptr(MSP_CIC_BASE + 0x18) | ||
498 | /* Thread Context 2 Int Mask */ | ||
499 | #define CIC_TC3_MSK_REG regptr(MSP_CIC_BASE + 0x18) | ||
500 | /* Thread Context 3 Int Mask */ | ||
501 | #define CIC_TC4_MSK_REG regptr(MSP_CIC_BASE + 0x18) | ||
502 | /* Thread Context 4 Int Mask */ | ||
503 | #define CIC_PCIMSI_STS_REG regptr(MSP_CIC_BASE + 0x18) | ||
504 | #define CIC_PCIMSI_MSK_REG regptr(MSP_CIC_BASE + 0x18) | ||
505 | #define CIC_PCIFLSH_REG regptr(MSP_CIC_BASE + 0x18) | ||
506 | #define CIC_VPE0_SWINT_REG regptr(MSP_CIC_BASE + 0x08) | ||
507 | |||
508 | |||
509 | /* | ||
510 | *************************************************************************** | ||
511 | * Memory controller registers * | ||
512 | *************************************************************************** | ||
513 | */ | ||
514 | #define MEM_CFG1_REG regptr(MSP_MEM_CFG_BASE + 0x00) | ||
515 | #define MEM_SS_ADDR regptr(MSP_MEM_CFG_BASE + 0x00) | ||
516 | #define MEM_SS_DATA regptr(MSP_MEM_CFG_BASE + 0x04) | ||
517 | #define MEM_SS_WRITE regptr(MSP_MEM_CFG_BASE + 0x08) | ||
518 | |||
519 | /* | ||
520 | *************************************************************************** | ||
521 | * PCI controller registers * | ||
522 | *************************************************************************** | ||
523 | */ | ||
524 | #define PCI_BASE_REG regptr(MSP_PCI_BASE + 0x00) | ||
525 | #define PCI_CONFIG_SPACE_REG regptr(MSP_PCI_BASE + 0x800) | ||
526 | #define PCI_JTAG_DEVID_REG regptr(MSP_SLP_BASE + 0x13c) | ||
527 | |||
528 | /* | ||
529 | ######################################################################## | ||
530 | # Register content & macro definitions # | ||
531 | ######################################################################## | ||
532 | */ | ||
533 | |||
534 | /* | ||
535 | *************************************************************************** | ||
536 | * DEV_ID defines * | ||
537 | *************************************************************************** | ||
538 | */ | ||
539 | #define DEV_ID_PCI_DIS (1 << 26) /* Set if PCI disabled */ | ||
540 | #define DEV_ID_PCI_HOST (1 << 20) /* Set if PCI host */ | ||
541 | #define DEV_ID_SINGLE_PC (1 << 19) /* Set if single PC Card */ | ||
542 | #define DEV_ID_FAMILY (0xff << 8) /* family ID code */ | ||
543 | #define POLO_ZEUS_SUB_FAMILY (0x7 << 16) /* sub family for Polo/Zeus */ | ||
544 | |||
545 | #define MSPFPGA_ID (0x00 << 8) /* you are on your own here */ | ||
546 | #define MSP5000_ID (0x50 << 8) | ||
547 | #define MSP4F00_ID (0x4f << 8) /* FPGA version of MSP4200 */ | ||
548 | #define MSP4E00_ID (0x4f << 8) /* FPGA version of MSP7120 */ | ||
549 | #define MSP4200_ID (0x42 << 8) | ||
550 | #define MSP4000_ID (0x40 << 8) | ||
551 | #define MSP2XXX_ID (0x20 << 8) | ||
552 | #define MSPZEUS_ID (0x10 << 8) | ||
553 | |||
554 | #define MSP2004_SUB_ID (0x0 << 16) | ||
555 | #define MSP2005_SUB_ID (0x1 << 16) | ||
556 | #define MSP2006_SUB_ID (0x1 << 16) | ||
557 | #define MSP2007_SUB_ID (0x2 << 16) | ||
558 | #define MSP2010_SUB_ID (0x3 << 16) | ||
559 | #define MSP2015_SUB_ID (0x4 << 16) | ||
560 | #define MSP2020_SUB_ID (0x5 << 16) | ||
561 | #define MSP2100_SUB_ID (0x6 << 16) | ||
562 | |||
563 | /* | ||
564 | *************************************************************************** | ||
565 | * RESET defines * | ||
566 | *************************************************************************** | ||
567 | */ | ||
568 | #define MSP_GR_RST (0x01 << 0) /* Global reset bit */ | ||
569 | #define MSP_MR_RST (0x01 << 1) /* MIPS reset bit */ | ||
570 | #define MSP_PD_RST (0x01 << 2) /* PVC DMA reset bit */ | ||
571 | #define MSP_PP_RST (0x01 << 3) /* PVC reset bit */ | ||
572 | /* reserved */ | ||
573 | #define MSP_EA_RST (0x01 << 6) /* Mac A reset bit */ | ||
574 | #define MSP_EB_RST (0x01 << 7) /* Mac B reset bit */ | ||
575 | #define MSP_SE_RST (0x01 << 8) /* Security Eng reset bit */ | ||
576 | #define MSP_PB_RST (0x01 << 9) /* Per block reset bit */ | ||
577 | #define MSP_EC_RST (0x01 << 10) /* Mac C reset bit */ | ||
578 | #define MSP_TW_RST (0x01 << 11) /* TWI reset bit */ | ||
579 | #define MSP_SPI_RST (0x01 << 12) /* SPI/MPI reset bit */ | ||
580 | #define MSP_U1_RST (0x01 << 13) /* UART1 reset bit */ | ||
581 | #define MSP_U0_RST (0x01 << 14) /* UART0 reset bit */ | ||
582 | |||
583 | /* | ||
584 | *************************************************************************** | ||
585 | * UART defines * | ||
586 | *************************************************************************** | ||
587 | */ | ||
588 | #define MSP_BASE_BAUD 25000000 | ||
589 | #define MSP_UART_REG_LEN 0x20 | ||
590 | |||
591 | /* | ||
592 | *************************************************************************** | ||
593 | * ELB defines * | ||
594 | *************************************************************************** | ||
595 | */ | ||
596 | #define PCCARD_32 0x02 /* Set if is PCCARD 32 (Cardbus) */ | ||
597 | #define SINGLE_PCCARD 0x01 /* Set to enable single PC card */ | ||
598 | |||
599 | /* | ||
600 | *************************************************************************** | ||
601 | * CIC defines * | ||
602 | *************************************************************************** | ||
603 | */ | ||
604 | |||
605 | /* CIC_EXT_CFG_REG */ | ||
606 | #define EXT_INT_POL(eirq) (1 << (eirq + 8)) | ||
607 | #define EXT_INT_EDGE(eirq) (1 << eirq) | ||
608 | |||
609 | #define CIC_EXT_SET_TRIGGER_LEVEL(reg, eirq) (reg &= ~EXT_INT_EDGE(eirq)) | ||
610 | #define CIC_EXT_SET_TRIGGER_EDGE(reg, eirq) (reg |= EXT_INT_EDGE(eirq)) | ||
611 | #define CIC_EXT_SET_ACTIVE_HI(reg, eirq) (reg |= EXT_INT_POL(eirq)) | ||
612 | #define CIC_EXT_SET_ACTIVE_LO(reg, eirq) (reg &= ~EXT_INT_POL(eirq)) | ||
613 | #define CIC_EXT_SET_ACTIVE_RISING CIC_EXT_SET_ACTIVE_HI | ||
614 | #define CIC_EXT_SET_ACTIVE_FALLING CIC_EXT_SET_ACTIVE_LO | ||
615 | |||
616 | #define CIC_EXT_IS_TRIGGER_LEVEL(reg, eirq) \ | ||
617 | ((reg & EXT_INT_EDGE(eirq)) == 0) | ||
618 | #define CIC_EXT_IS_TRIGGER_EDGE(reg, eirq) (reg & EXT_INT_EDGE(eirq)) | ||
619 | #define CIC_EXT_IS_ACTIVE_HI(reg, eirq) (reg & EXT_INT_POL(eirq)) | ||
620 | #define CIC_EXT_IS_ACTIVE_LO(reg, eirq) \ | ||
621 | ((reg & EXT_INT_POL(eirq)) == 0) | ||
622 | #define CIC_EXT_IS_ACTIVE_RISING CIC_EXT_IS_ACTIVE_HI | ||
623 | #define CIC_EXT_IS_ACTIVE_FALLING CIC_EXT_IS_ACTIVE_LO | ||
624 | |||
625 | /* | ||
626 | *************************************************************************** | ||
627 | * Memory Controller defines * | ||
628 | *************************************************************************** | ||
629 | */ | ||
630 | |||
631 | /* Indirect memory controller registers */ | ||
632 | #define DDRC_CFG(n) (n) | ||
633 | #define DDRC_DEBUG(n) (0x04 + n) | ||
634 | #define DDRC_CTL(n) (0x40 + n) | ||
635 | |||
636 | /* Macro to perform DDRC indirect write */ | ||
637 | #define DDRC_INDIRECT_WRITE(reg, mask, value) \ | ||
638 | ({ \ | ||
639 | *MEM_SS_ADDR = (((mask) & 0xf) << 8) | ((reg) & 0xff); \ | ||
640 | *MEM_SS_DATA = (value); \ | ||
641 | *MEM_SS_WRITE = 1; \ | ||
642 | }) | ||
643 | |||
644 | /* | ||
645 | *************************************************************************** | ||
646 | * SPI/MPI Mode * | ||
647 | *************************************************************************** | ||
648 | */ | ||
649 | #define SPI_MPI_RX_BUSY 0x00008000 /* SPI/MPI Receive Busy */ | ||
650 | #define SPI_MPI_FIFO_EMPTY 0x00004000 /* SPI/MPI Fifo Empty */ | ||
651 | #define SPI_MPI_TX_BUSY 0x00002000 /* SPI/MPI Transmit Busy */ | ||
652 | #define SPI_MPI_FIFO_FULL 0x00001000 /* SPI/MPU FIFO full */ | ||
653 | |||
654 | /* | ||
655 | *************************************************************************** | ||
656 | * SPI/MPI Control Register * | ||
657 | *************************************************************************** | ||
658 | */ | ||
659 | #define SPI_MPI_RX_START 0x00000004 /* Start receive command */ | ||
660 | #define SPI_MPI_FLUSH_Q 0x00000002 /* Flush SPI/MPI Queue */ | ||
661 | #define SPI_MPI_TX_START 0x00000001 /* Start Transmit Command */ | ||
662 | |||
663 | #endif /* !_ASM_MSP_REGS_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h deleted file mode 100644 index 96d4c8ce8c83..000000000000 --- a/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h +++ /dev/null | |||
@@ -1,141 +0,0 @@ | |||
1 | /* | ||
2 | * Defines for the MSP interrupt controller. | ||
3 | * | ||
4 | * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved. | ||
5 | * Author: Carsten Langgaard, carstenl@mips.com | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | */ | ||
24 | |||
25 | #ifndef _MSP_SLP_INT_H | ||
26 | #define _MSP_SLP_INT_H | ||
27 | |||
28 | /* | ||
29 | * The PMC-Sierra SLP interrupts are arranged in a 3 level cascaded | ||
30 | * hierarchical system. The first level are the direct MIPS interrupts | ||
31 | * and are assigned the interrupt range 0-7. The second level is the SLM | ||
32 | * interrupt controller and is assigned the range 8-39. The third level | ||
33 | * comprises the Peripherial block, the PCI block, the PCI MSI block and | ||
34 | * the SLP. The PCI interrupts and the SLP errors are handled by the | ||
35 | * relevant subsystems so the core interrupt code needs only concern | ||
36 | * itself with the Peripheral block. These are assigned interrupts in | ||
37 | * the range 40-71. | ||
38 | */ | ||
39 | |||
40 | /* | ||
41 | * IRQs directly connected to CPU | ||
42 | */ | ||
43 | #define MSP_MIPS_INTBASE 0 | ||
44 | #define MSP_INT_SW0 0 /* IRQ for swint0, C_SW0 */ | ||
45 | #define MSP_INT_SW1 1 /* IRQ for swint1, C_SW1 */ | ||
46 | #define MSP_INT_MAC0 2 /* IRQ for MAC 0, C_IRQ0 */ | ||
47 | #define MSP_INT_MAC1 3 /* IRQ for MAC 1, C_IRQ1 */ | ||
48 | #define MSP_INT_C_IRQ2 4 /* Wired off, C_IRQ2 */ | ||
49 | #define MSP_INT_VE 5 /* IRQ for Voice Engine, C_IRQ3 */ | ||
50 | #define MSP_INT_SLP 6 /* IRQ for SLM block, C_IRQ4 */ | ||
51 | #define MSP_INT_TIMER 7 /* IRQ for the MIPS timer, C_IRQ5 */ | ||
52 | |||
53 | /* | ||
54 | * IRQs cascaded on CPU interrupt 4 (CAUSE bit 12, C_IRQ4) | ||
55 | * These defines should be tied to the register definition for the SLM | ||
56 | * interrupt routine. For now, just use hard-coded values. | ||
57 | */ | ||
58 | #define MSP_SLP_INTBASE (MSP_MIPS_INTBASE + 8) | ||
59 | #define MSP_INT_EXT0 (MSP_SLP_INTBASE + 0) | ||
60 | /* External interrupt 0 */ | ||
61 | #define MSP_INT_EXT1 (MSP_SLP_INTBASE + 1) | ||
62 | /* External interrupt 1 */ | ||
63 | #define MSP_INT_EXT2 (MSP_SLP_INTBASE + 2) | ||
64 | /* External interrupt 2 */ | ||
65 | #define MSP_INT_EXT3 (MSP_SLP_INTBASE + 3) | ||
66 | /* External interrupt 3 */ | ||
67 | /* Reserved 4-7 */ | ||
68 | |||
69 | /* | ||
70 | ************************************************************************* | ||
71 | * DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER * | ||
72 | * Some MSP produces have this interrupt labelled as Voice and some are * | ||
73 | * SEC mbox ... * | ||
74 | ************************************************************************* | ||
75 | */ | ||
76 | #define MSP_INT_SLP_VE (MSP_SLP_INTBASE + 8) | ||
77 | /* Cascaded IRQ for Voice Engine*/ | ||
78 | #define MSP_INT_SLP_TDM (MSP_SLP_INTBASE + 9) | ||
79 | /* TDM interrupt */ | ||
80 | #define MSP_INT_SLP_MAC0 (MSP_SLP_INTBASE + 10) | ||
81 | /* Cascaded IRQ for MAC 0 */ | ||
82 | #define MSP_INT_SLP_MAC1 (MSP_SLP_INTBASE + 11) | ||
83 | /* Cascaded IRQ for MAC 1 */ | ||
84 | #define MSP_INT_SEC (MSP_SLP_INTBASE + 12) | ||
85 | /* IRQ for security engine */ | ||
86 | #define MSP_INT_PER (MSP_SLP_INTBASE + 13) | ||
87 | /* Peripheral interrupt */ | ||
88 | #define MSP_INT_TIMER0 (MSP_SLP_INTBASE + 14) | ||
89 | /* SLP timer 0 */ | ||
90 | #define MSP_INT_TIMER1 (MSP_SLP_INTBASE + 15) | ||
91 | /* SLP timer 1 */ | ||
92 | #define MSP_INT_TIMER2 (MSP_SLP_INTBASE + 16) | ||
93 | /* SLP timer 2 */ | ||
94 | #define MSP_INT_SLP_TIMER (MSP_SLP_INTBASE + 17) | ||
95 | /* Cascaded MIPS timer */ | ||
96 | #define MSP_INT_BLKCP (MSP_SLP_INTBASE + 18) | ||
97 | /* Block Copy */ | ||
98 | #define MSP_INT_UART0 (MSP_SLP_INTBASE + 19) | ||
99 | /* UART 0 */ | ||
100 | #define MSP_INT_PCI (MSP_SLP_INTBASE + 20) | ||
101 | /* PCI subsystem */ | ||
102 | #define MSP_INT_PCI_DBELL (MSP_SLP_INTBASE + 21) | ||
103 | /* PCI doorbell */ | ||
104 | #define MSP_INT_PCI_MSI (MSP_SLP_INTBASE + 22) | ||
105 | /* PCI Message Signal */ | ||
106 | #define MSP_INT_PCI_BC0 (MSP_SLP_INTBASE + 23) | ||
107 | /* PCI Block Copy 0 */ | ||
108 | #define MSP_INT_PCI_BC1 (MSP_SLP_INTBASE + 24) | ||
109 | /* PCI Block Copy 1 */ | ||
110 | #define MSP_INT_SLP_ERR (MSP_SLP_INTBASE + 25) | ||
111 | /* SLP error condition */ | ||
112 | #define MSP_INT_MAC2 (MSP_SLP_INTBASE + 26) | ||
113 | /* IRQ for MAC2 */ | ||
114 | /* Reserved 26-31 */ | ||
115 | |||
116 | /* | ||
117 | * IRQs cascaded on SLP PER interrupt (MSP_INT_PER) | ||
118 | */ | ||
119 | #define MSP_PER_INTBASE (MSP_SLP_INTBASE + 32) | ||
120 | /* Reserved 0-1 */ | ||
121 | #define MSP_INT_UART1 (MSP_PER_INTBASE + 2) | ||
122 | /* UART 1 */ | ||
123 | /* Reserved 3-5 */ | ||
124 | #define MSP_INT_2WIRE (MSP_PER_INTBASE + 6) | ||
125 | /* 2-wire */ | ||
126 | #define MSP_INT_TM0 (MSP_PER_INTBASE + 7) | ||
127 | /* Peripheral timer block out 0 */ | ||
128 | #define MSP_INT_TM1 (MSP_PER_INTBASE + 8) | ||
129 | /* Peripheral timer block out 1 */ | ||
130 | /* Reserved 9 */ | ||
131 | #define MSP_INT_SPRX (MSP_PER_INTBASE + 10) | ||
132 | /* SPI RX complete */ | ||
133 | #define MSP_INT_SPTX (MSP_PER_INTBASE + 11) | ||
134 | /* SPI TX complete */ | ||
135 | #define MSP_INT_GPIO (MSP_PER_INTBASE + 12) | ||
136 | /* GPIO */ | ||
137 | #define MSP_INT_PER_ERR (MSP_PER_INTBASE + 13) | ||
138 | /* Peripheral error */ | ||
139 | /* Reserved 14-31 */ | ||
140 | |||
141 | #endif /* !_MSP_SLP_INT_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/war.h b/include/asm-mips/pmc-sierra/msp71xx/war.h deleted file mode 100644 index 0bf48fc1892b..000000000000 --- a/include/asm-mips/pmc-sierra/msp71xx/war.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_PMC_SIERRA_WAR_H | ||
9 | #define __ASM_MIPS_PMC_SIERRA_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #if defined(CONFIG_PMC_MSP7120_EVAL) || defined(CONFIG_PMC_MSP7120_GW) || \ | ||
24 | defined(CONFIG_PMC_MSP7120_FPGA) | ||
25 | #define MIPS34K_MISSED_ITLB_WAR 1 | ||
26 | #endif | ||
27 | |||
28 | #endif /* __ASM_MIPS_PMC_SIERRA_WAR_H */ | ||
diff --git a/include/asm-mips/pmon.h b/include/asm-mips/pmon.h deleted file mode 100644 index 6ad519189ce2..000000000000 --- a/include/asm-mips/pmon.h +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004 by Ralf Baechle | ||
7 | * | ||
8 | * The cpustart method is a PMC-Sierra's function to start the secondary CPU. | ||
9 | * Stock PMON 2000 has the smpfork, semlock and semunlock methods instead. | ||
10 | */ | ||
11 | #ifndef _ASM_PMON_H | ||
12 | #define _ASM_PMON_H | ||
13 | |||
14 | struct callvectors { | ||
15 | int (*open) (char*, int, int); | ||
16 | int (*close) (int); | ||
17 | int (*read) (int, void*, int); | ||
18 | int (*write) (int, void*, int); | ||
19 | off_t (*lseek) (int, off_t, int); | ||
20 | int (*printf) (const char*, ...); | ||
21 | void (*cacheflush) (void); | ||
22 | char* (*gets) (char*); | ||
23 | union { | ||
24 | int (*smpfork) (unsigned long cp, char *sp); | ||
25 | int (*cpustart) (long, void (*)(void), void *, long); | ||
26 | } _s; | ||
27 | int (*semlock) (int sem); | ||
28 | void (*semunlock) (int sem); | ||
29 | }; | ||
30 | |||
31 | extern struct callvectors *debug_vectors; | ||
32 | |||
33 | #define pmon_open(name, flags, mode) debug_vectors->open(name, flage, mode) | ||
34 | #define pmon_close(fd) debug_vectors->close(fd) | ||
35 | #define pmon_read(fd, buf, count) debug_vectors->read(fd, buf, count) | ||
36 | #define pmon_write(fd, buf, count) debug_vectors->write(fd, buf, count) | ||
37 | #define pmon_lseek(fd, off, whence) debug_vectors->lseek(fd, off, whence) | ||
38 | #define pmon_printf(fmt...) debug_vectors->printf(fmt) | ||
39 | #define pmon_cacheflush() debug_vectors->cacheflush() | ||
40 | #define pmon_gets(s) debug_vectors->gets(s) | ||
41 | #define pmon_cpustart(n, f, sp, gp) debug_vectors->_s.cpustart(n, f, sp, gp) | ||
42 | #define pmon_smpfork(cp, sp) debug_vectors->_s.smpfork(cp, sp) | ||
43 | #define pmon_semlock(sem) debug_vectors->semlock(sem) | ||
44 | #define pmon_semunlock(sem) debug_vectors->semunlock(sem) | ||
45 | |||
46 | #endif /* _ASM_PMON_H */ | ||
diff --git a/include/asm-mips/poll.h b/include/asm-mips/poll.h deleted file mode 100644 index 47b952080431..000000000000 --- a/include/asm-mips/poll.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef __ASM_POLL_H | ||
2 | #define __ASM_POLL_H | ||
3 | |||
4 | #define POLLWRNORM POLLOUT | ||
5 | #define POLLWRBAND 0x0100 | ||
6 | |||
7 | #include <asm-generic/poll.h> | ||
8 | |||
9 | #endif /* __ASM_POLL_H */ | ||
diff --git a/include/asm-mips/posix_types.h b/include/asm-mips/posix_types.h deleted file mode 100644 index c200102c8586..000000000000 --- a/include/asm-mips/posix_types.h +++ /dev/null | |||
@@ -1,144 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 97, 98, 99, 2000 by Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_POSIX_TYPES_H | ||
10 | #define _ASM_POSIX_TYPES_H | ||
11 | |||
12 | #include <asm/sgidefs.h> | ||
13 | |||
14 | /* | ||
15 | * This file is generally used by user-level software, so you need to | ||
16 | * be a little careful about namespace pollution etc. Also, we cannot | ||
17 | * assume GCC is being used. | ||
18 | */ | ||
19 | |||
20 | typedef unsigned long __kernel_ino_t; | ||
21 | typedef unsigned int __kernel_mode_t; | ||
22 | #if (_MIPS_SZLONG == 32) | ||
23 | typedef unsigned long __kernel_nlink_t; | ||
24 | #endif | ||
25 | #if (_MIPS_SZLONG == 64) | ||
26 | typedef unsigned int __kernel_nlink_t; | ||
27 | #endif | ||
28 | typedef long __kernel_off_t; | ||
29 | typedef int __kernel_pid_t; | ||
30 | typedef int __kernel_ipc_pid_t; | ||
31 | typedef unsigned int __kernel_uid_t; | ||
32 | typedef unsigned int __kernel_gid_t; | ||
33 | #if (_MIPS_SZLONG == 32) | ||
34 | typedef unsigned int __kernel_size_t; | ||
35 | typedef int __kernel_ssize_t; | ||
36 | typedef int __kernel_ptrdiff_t; | ||
37 | #endif | ||
38 | #if (_MIPS_SZLONG == 64) | ||
39 | typedef unsigned long __kernel_size_t; | ||
40 | typedef long __kernel_ssize_t; | ||
41 | typedef long __kernel_ptrdiff_t; | ||
42 | #endif | ||
43 | typedef long __kernel_time_t; | ||
44 | typedef long __kernel_suseconds_t; | ||
45 | typedef long __kernel_clock_t; | ||
46 | typedef int __kernel_timer_t; | ||
47 | typedef int __kernel_clockid_t; | ||
48 | typedef long __kernel_daddr_t; | ||
49 | typedef char * __kernel_caddr_t; | ||
50 | |||
51 | typedef unsigned short __kernel_uid16_t; | ||
52 | typedef unsigned short __kernel_gid16_t; | ||
53 | typedef unsigned int __kernel_uid32_t; | ||
54 | typedef unsigned int __kernel_gid32_t; | ||
55 | typedef __kernel_uid_t __kernel_old_uid_t; | ||
56 | typedef __kernel_gid_t __kernel_old_gid_t; | ||
57 | typedef unsigned int __kernel_old_dev_t; | ||
58 | |||
59 | #ifdef __GNUC__ | ||
60 | typedef long long __kernel_loff_t; | ||
61 | #endif | ||
62 | |||
63 | typedef struct { | ||
64 | #if (_MIPS_SZLONG == 32) | ||
65 | long val[2]; | ||
66 | #endif | ||
67 | #if (_MIPS_SZLONG == 64) | ||
68 | int val[2]; | ||
69 | #endif | ||
70 | } __kernel_fsid_t; | ||
71 | |||
72 | #if defined(__KERNEL__) | ||
73 | |||
74 | #undef __FD_SET | ||
75 | static __inline__ void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
76 | { | ||
77 | unsigned long __tmp = __fd / __NFDBITS; | ||
78 | unsigned long __rem = __fd % __NFDBITS; | ||
79 | __fdsetp->fds_bits[__tmp] |= (1UL<<__rem); | ||
80 | } | ||
81 | |||
82 | #undef __FD_CLR | ||
83 | static __inline__ void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
84 | { | ||
85 | unsigned long __tmp = __fd / __NFDBITS; | ||
86 | unsigned long __rem = __fd % __NFDBITS; | ||
87 | __fdsetp->fds_bits[__tmp] &= ~(1UL<<__rem); | ||
88 | } | ||
89 | |||
90 | #undef __FD_ISSET | ||
91 | static __inline__ int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p) | ||
92 | { | ||
93 | unsigned long __tmp = __fd / __NFDBITS; | ||
94 | unsigned long __rem = __fd % __NFDBITS; | ||
95 | return (__p->fds_bits[__tmp] & (1UL<<__rem)) != 0; | ||
96 | } | ||
97 | |||
98 | /* | ||
99 | * This will unroll the loop for the normal constant case (8 ints, | ||
100 | * for a 256-bit fd_set) | ||
101 | */ | ||
102 | #undef __FD_ZERO | ||
103 | static __inline__ void __FD_ZERO(__kernel_fd_set *__p) | ||
104 | { | ||
105 | unsigned long *__tmp = __p->fds_bits; | ||
106 | int __i; | ||
107 | |||
108 | if (__builtin_constant_p(__FDSET_LONGS)) { | ||
109 | switch (__FDSET_LONGS) { | ||
110 | case 16: | ||
111 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
112 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
113 | __tmp[ 4] = 0; __tmp[ 5] = 0; | ||
114 | __tmp[ 6] = 0; __tmp[ 7] = 0; | ||
115 | __tmp[ 8] = 0; __tmp[ 9] = 0; | ||
116 | __tmp[10] = 0; __tmp[11] = 0; | ||
117 | __tmp[12] = 0; __tmp[13] = 0; | ||
118 | __tmp[14] = 0; __tmp[15] = 0; | ||
119 | return; | ||
120 | |||
121 | case 8: | ||
122 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
123 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
124 | __tmp[ 4] = 0; __tmp[ 5] = 0; | ||
125 | __tmp[ 6] = 0; __tmp[ 7] = 0; | ||
126 | return; | ||
127 | |||
128 | case 4: | ||
129 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
130 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
131 | return; | ||
132 | } | ||
133 | } | ||
134 | __i = __FDSET_LONGS; | ||
135 | while (__i) { | ||
136 | __i--; | ||
137 | *__tmp = 0; | ||
138 | __tmp++; | ||
139 | } | ||
140 | } | ||
141 | |||
142 | #endif /* defined(__KERNEL__) */ | ||
143 | |||
144 | #endif /* _ASM_POSIX_TYPES_H */ | ||
diff --git a/include/asm-mips/prefetch.h b/include/asm-mips/prefetch.h deleted file mode 100644 index 17850834ccb0..000000000000 --- a/include/asm-mips/prefetch.h +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_PREFETCH_H | ||
9 | #define __ASM_PREFETCH_H | ||
10 | |||
11 | |||
12 | /* | ||
13 | * R5000 and RM5200 implements pref and prefx instructions but they're nops, so | ||
14 | * rather than wasting time we pretend these processors don't support | ||
15 | * prefetching at all. | ||
16 | * | ||
17 | * R5432 implements Load, Store, LoadStreamed, StoreStreamed, LoadRetained, | ||
18 | * StoreRetained and WriteBackInvalidate but not Pref_PrepareForStore. | ||
19 | * | ||
20 | * Hell (and the book on my shelf I can't open ...) know what the R8000 does. | ||
21 | * | ||
22 | * RM7000 version 1.0 interprets all hints as Pref_Load; version 2.0 implements | ||
23 | * Pref_PrepareForStore also. | ||
24 | * | ||
25 | * RM9000 is MIPS IV but implements prefetching like MIPS32/MIPS64; it's | ||
26 | * Pref_WriteBackInvalidate is a nop and Pref_PrepareForStore is broken in | ||
27 | * current versions due to erratum G105. | ||
28 | * | ||
29 | * VR7701 only implements the Load prefetch. | ||
30 | * | ||
31 | * Finally MIPS32 and MIPS64 implement all of the following hints. | ||
32 | */ | ||
33 | |||
34 | #define Pref_Load 0 | ||
35 | #define Pref_Store 1 | ||
36 | /* 2 and 3 are reserved */ | ||
37 | #define Pref_LoadStreamed 4 | ||
38 | #define Pref_StoreStreamed 5 | ||
39 | #define Pref_LoadRetained 6 | ||
40 | #define Pref_StoreRetained 7 | ||
41 | /* 8 ... 24 are reserved */ | ||
42 | #define Pref_WriteBackInvalidate 25 | ||
43 | #define Pref_PrepareForStore 30 | ||
44 | |||
45 | #ifdef __ASSEMBLY__ | ||
46 | |||
47 | .macro __pref hint addr | ||
48 | #ifdef CONFIG_CPU_HAS_PREFETCH | ||
49 | pref \hint, \addr | ||
50 | #endif | ||
51 | .endm | ||
52 | |||
53 | .macro pref_load addr | ||
54 | __pref Pref_Load, \addr | ||
55 | .endm | ||
56 | |||
57 | .macro pref_store addr | ||
58 | __pref Pref_Store, \addr | ||
59 | .endm | ||
60 | |||
61 | .macro pref_load_streamed addr | ||
62 | __pref Pref_LoadStreamed, \addr | ||
63 | .endm | ||
64 | |||
65 | .macro pref_store_streamed addr | ||
66 | __pref Pref_StoreStreamed, \addr | ||
67 | .endm | ||
68 | |||
69 | .macro pref_load_retained addr | ||
70 | __pref Pref_LoadRetained, \addr | ||
71 | .endm | ||
72 | |||
73 | .macro pref_store_retained addr | ||
74 | __pref Pref_StoreRetained, \addr | ||
75 | .endm | ||
76 | |||
77 | .macro pref_wback_inv addr | ||
78 | __pref Pref_WriteBackInvalidate, \addr | ||
79 | .endm | ||
80 | |||
81 | .macro pref_prepare_for_store addr | ||
82 | __pref Pref_PrepareForStore, \addr | ||
83 | .endm | ||
84 | |||
85 | #endif | ||
86 | |||
87 | #endif /* __ASM_PREFETCH_H */ | ||
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h deleted file mode 100644 index a1e4453469f9..000000000000 --- a/include/asm-mips/processor.h +++ /dev/null | |||
@@ -1,263 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 Waldorf GMBH | ||
7 | * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle | ||
8 | * Copyright (C) 1996 Paul M. Antoine | ||
9 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
10 | */ | ||
11 | #ifndef _ASM_PROCESSOR_H | ||
12 | #define _ASM_PROCESSOR_H | ||
13 | |||
14 | #include <linux/cpumask.h> | ||
15 | #include <linux/threads.h> | ||
16 | |||
17 | #include <asm/cachectl.h> | ||
18 | #include <asm/cpu.h> | ||
19 | #include <asm/cpu-info.h> | ||
20 | #include <asm/mipsregs.h> | ||
21 | #include <asm/prefetch.h> | ||
22 | #include <asm/system.h> | ||
23 | |||
24 | /* | ||
25 | * Return current * instruction pointer ("program counter"). | ||
26 | */ | ||
27 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) | ||
28 | |||
29 | /* | ||
30 | * System setup and hardware flags.. | ||
31 | */ | ||
32 | extern void (*cpu_wait)(void); | ||
33 | |||
34 | extern unsigned int vced_count, vcei_count; | ||
35 | |||
36 | #ifdef CONFIG_32BIT | ||
37 | /* | ||
38 | * User space process size: 2GB. This is hardcoded into a few places, | ||
39 | * so don't change it unless you know what you are doing. | ||
40 | */ | ||
41 | #define TASK_SIZE 0x7fff8000UL | ||
42 | #define STACK_TOP TASK_SIZE | ||
43 | |||
44 | /* | ||
45 | * This decides where the kernel will search for a free chunk of vm | ||
46 | * space during mmap's. | ||
47 | */ | ||
48 | #define TASK_UNMAPPED_BASE ((TASK_SIZE / 3) & ~(PAGE_SIZE)) | ||
49 | #endif | ||
50 | |||
51 | #ifdef CONFIG_64BIT | ||
52 | /* | ||
53 | * User space process size: 1TB. This is hardcoded into a few places, | ||
54 | * so don't change it unless you know what you are doing. TASK_SIZE | ||
55 | * is limited to 1TB by the R4000 architecture; R10000 and better can | ||
56 | * support 16TB; the architectural reserve for future expansion is | ||
57 | * 8192EB ... | ||
58 | */ | ||
59 | #define TASK_SIZE32 0x7fff8000UL | ||
60 | #define TASK_SIZE 0x10000000000UL | ||
61 | #define STACK_TOP \ | ||
62 | (test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE) | ||
63 | |||
64 | /* | ||
65 | * This decides where the kernel will search for a free chunk of vm | ||
66 | * space during mmap's. | ||
67 | */ | ||
68 | #define TASK_UNMAPPED_BASE \ | ||
69 | (test_thread_flag(TIF_32BIT_ADDR) ? \ | ||
70 | PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3)) | ||
71 | #define TASK_SIZE_OF(tsk) \ | ||
72 | (test_tsk_thread_flag(tsk, TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE) | ||
73 | #endif | ||
74 | |||
75 | #ifdef __KERNEL__ | ||
76 | #define STACK_TOP_MAX TASK_SIZE | ||
77 | #endif | ||
78 | |||
79 | #define NUM_FPU_REGS 32 | ||
80 | |||
81 | typedef __u64 fpureg_t; | ||
82 | |||
83 | /* | ||
84 | * It would be nice to add some more fields for emulator statistics, but there | ||
85 | * are a number of fixed offsets in offset.h and elsewhere that would have to | ||
86 | * be recalculated by hand. So the additional information will be private to | ||
87 | * the FPU emulator for now. See asm-mips/fpu_emulator.h. | ||
88 | */ | ||
89 | |||
90 | struct mips_fpu_struct { | ||
91 | fpureg_t fpr[NUM_FPU_REGS]; | ||
92 | unsigned int fcr31; | ||
93 | }; | ||
94 | |||
95 | #define NUM_DSP_REGS 6 | ||
96 | |||
97 | typedef __u32 dspreg_t; | ||
98 | |||
99 | struct mips_dsp_state { | ||
100 | dspreg_t dspr[NUM_DSP_REGS]; | ||
101 | unsigned int dspcontrol; | ||
102 | }; | ||
103 | |||
104 | #define INIT_CPUMASK { \ | ||
105 | {0,} \ | ||
106 | } | ||
107 | |||
108 | typedef struct { | ||
109 | unsigned long seg; | ||
110 | } mm_segment_t; | ||
111 | |||
112 | #define ARCH_MIN_TASKALIGN 8 | ||
113 | |||
114 | struct mips_abi; | ||
115 | |||
116 | /* | ||
117 | * If you change thread_struct remember to change the #defines below too! | ||
118 | */ | ||
119 | struct thread_struct { | ||
120 | /* Saved main processor registers. */ | ||
121 | unsigned long reg16; | ||
122 | unsigned long reg17, reg18, reg19, reg20, reg21, reg22, reg23; | ||
123 | unsigned long reg29, reg30, reg31; | ||
124 | |||
125 | /* Saved cp0 stuff. */ | ||
126 | unsigned long cp0_status; | ||
127 | |||
128 | /* Saved fpu/fpu emulator stuff. */ | ||
129 | struct mips_fpu_struct fpu; | ||
130 | #ifdef CONFIG_MIPS_MT_FPAFF | ||
131 | /* Emulated instruction count */ | ||
132 | unsigned long emulated_fp; | ||
133 | /* Saved per-thread scheduler affinity mask */ | ||
134 | cpumask_t user_cpus_allowed; | ||
135 | #endif /* CONFIG_MIPS_MT_FPAFF */ | ||
136 | |||
137 | /* Saved state of the DSP ASE, if available. */ | ||
138 | struct mips_dsp_state dsp; | ||
139 | |||
140 | /* Other stuff associated with the thread. */ | ||
141 | unsigned long cp0_badvaddr; /* Last user fault */ | ||
142 | unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */ | ||
143 | unsigned long error_code; | ||
144 | unsigned long trap_no; | ||
145 | unsigned long irix_trampoline; /* Wheee... */ | ||
146 | unsigned long irix_oldctx; | ||
147 | struct mips_abi *abi; | ||
148 | }; | ||
149 | |||
150 | #ifdef CONFIG_MIPS_MT_FPAFF | ||
151 | #define FPAFF_INIT \ | ||
152 | .emulated_fp = 0, \ | ||
153 | .user_cpus_allowed = INIT_CPUMASK, | ||
154 | #else | ||
155 | #define FPAFF_INIT | ||
156 | #endif /* CONFIG_MIPS_MT_FPAFF */ | ||
157 | |||
158 | #define INIT_THREAD { \ | ||
159 | /* \ | ||
160 | * Saved main processor registers \ | ||
161 | */ \ | ||
162 | .reg16 = 0, \ | ||
163 | .reg17 = 0, \ | ||
164 | .reg18 = 0, \ | ||
165 | .reg19 = 0, \ | ||
166 | .reg20 = 0, \ | ||
167 | .reg21 = 0, \ | ||
168 | .reg22 = 0, \ | ||
169 | .reg23 = 0, \ | ||
170 | .reg29 = 0, \ | ||
171 | .reg30 = 0, \ | ||
172 | .reg31 = 0, \ | ||
173 | /* \ | ||
174 | * Saved cp0 stuff \ | ||
175 | */ \ | ||
176 | .cp0_status = 0, \ | ||
177 | /* \ | ||
178 | * Saved FPU/FPU emulator stuff \ | ||
179 | */ \ | ||
180 | .fpu = { \ | ||
181 | .fpr = {0,}, \ | ||
182 | .fcr31 = 0, \ | ||
183 | }, \ | ||
184 | /* \ | ||
185 | * FPU affinity state (null if not FPAFF) \ | ||
186 | */ \ | ||
187 | FPAFF_INIT \ | ||
188 | /* \ | ||
189 | * Saved DSP stuff \ | ||
190 | */ \ | ||
191 | .dsp = { \ | ||
192 | .dspr = {0, }, \ | ||
193 | .dspcontrol = 0, \ | ||
194 | }, \ | ||
195 | /* \ | ||
196 | * Other stuff associated with the process \ | ||
197 | */ \ | ||
198 | .cp0_badvaddr = 0, \ | ||
199 | .cp0_baduaddr = 0, \ | ||
200 | .error_code = 0, \ | ||
201 | .trap_no = 0, \ | ||
202 | .irix_trampoline = 0, \ | ||
203 | .irix_oldctx = 0, \ | ||
204 | } | ||
205 | |||
206 | struct task_struct; | ||
207 | |||
208 | /* Free all resources held by a thread. */ | ||
209 | #define release_thread(thread) do { } while(0) | ||
210 | |||
211 | /* Prepare to copy thread state - unlazy all lazy status */ | ||
212 | #define prepare_to_copy(tsk) do { } while (0) | ||
213 | |||
214 | extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | ||
215 | |||
216 | extern unsigned long thread_saved_pc(struct task_struct *tsk); | ||
217 | |||
218 | /* | ||
219 | * Do necessary setup to start up a newly executed thread. | ||
220 | */ | ||
221 | extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp); | ||
222 | |||
223 | unsigned long get_wchan(struct task_struct *p); | ||
224 | |||
225 | #define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32) | ||
226 | #define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk) - 1) | ||
227 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc) | ||
228 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29]) | ||
229 | #define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status) | ||
230 | |||
231 | #define cpu_relax() barrier() | ||
232 | |||
233 | /* | ||
234 | * Return_address is a replacement for __builtin_return_address(count) | ||
235 | * which on certain architectures cannot reasonably be implemented in GCC | ||
236 | * (MIPS, Alpha) or is unuseable with -fomit-frame-pointer (i386). | ||
237 | * Note that __builtin_return_address(x>=1) is forbidden because GCC | ||
238 | * aborts compilation on some CPUs. It's simply not possible to unwind | ||
239 | * some CPU's stackframes. | ||
240 | * | ||
241 | * __builtin_return_address works only for non-leaf functions. We avoid the | ||
242 | * overhead of a function call by forcing the compiler to save the return | ||
243 | * address register on the stack. | ||
244 | */ | ||
245 | #define return_address() ({__asm__ __volatile__("":::"$31");__builtin_return_address(0);}) | ||
246 | |||
247 | #ifdef CONFIG_CPU_HAS_PREFETCH | ||
248 | |||
249 | #define ARCH_HAS_PREFETCH | ||
250 | |||
251 | static inline void prefetch(const void *addr) | ||
252 | { | ||
253 | __asm__ __volatile__( | ||
254 | " .set mips4 \n" | ||
255 | " pref %0, (%1) \n" | ||
256 | " .set mips0 \n" | ||
257 | : | ||
258 | : "i" (Pref_Load), "r" (addr)); | ||
259 | } | ||
260 | |||
261 | #endif | ||
262 | |||
263 | #endif /* _ASM_PROCESSOR_H */ | ||
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h deleted file mode 100644 index c00cca24dae0..000000000000 --- a/include/asm-mips/ptrace.h +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_PTRACE_H | ||
10 | #define _ASM_PTRACE_H | ||
11 | |||
12 | #ifdef CONFIG_64BIT | ||
13 | #define __ARCH_WANT_COMPAT_SYS_PTRACE | ||
14 | #endif | ||
15 | |||
16 | /* 0 - 31 are integer registers, 32 - 63 are fp registers. */ | ||
17 | #define FPR_BASE 32 | ||
18 | #define PC 64 | ||
19 | #define CAUSE 65 | ||
20 | #define BADVADDR 66 | ||
21 | #define MMHI 67 | ||
22 | #define MMLO 68 | ||
23 | #define FPC_CSR 69 | ||
24 | #define FPC_EIR 70 | ||
25 | #define DSP_BASE 71 /* 3 more hi / lo register pairs */ | ||
26 | #define DSP_CONTROL 77 | ||
27 | #define ACX 78 | ||
28 | |||
29 | /* | ||
30 | * This struct defines the way the registers are stored on the stack during a | ||
31 | * system call/exception. As usual the registers k0/k1 aren't being saved. | ||
32 | */ | ||
33 | struct pt_regs { | ||
34 | #ifdef CONFIG_32BIT | ||
35 | /* Pad bytes for argument save space on the stack. */ | ||
36 | unsigned long pad0[6]; | ||
37 | #endif | ||
38 | |||
39 | /* Saved main processor registers. */ | ||
40 | unsigned long regs[32]; | ||
41 | |||
42 | /* Saved special registers. */ | ||
43 | unsigned long cp0_status; | ||
44 | unsigned long hi; | ||
45 | unsigned long lo; | ||
46 | #ifdef CONFIG_CPU_HAS_SMARTMIPS | ||
47 | unsigned long acx; | ||
48 | #endif | ||
49 | unsigned long cp0_badvaddr; | ||
50 | unsigned long cp0_cause; | ||
51 | unsigned long cp0_epc; | ||
52 | #ifdef CONFIG_MIPS_MT_SMTC | ||
53 | unsigned long cp0_tcstatus; | ||
54 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
55 | } __attribute__ ((aligned (8))); | ||
56 | |||
57 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | ||
58 | #define PTRACE_GETREGS 12 | ||
59 | #define PTRACE_SETREGS 13 | ||
60 | #define PTRACE_GETFPREGS 14 | ||
61 | #define PTRACE_SETFPREGS 15 | ||
62 | /* #define PTRACE_GETFPXREGS 18 */ | ||
63 | /* #define PTRACE_SETFPXREGS 19 */ | ||
64 | |||
65 | #define PTRACE_OLDSETOPTIONS 21 | ||
66 | |||
67 | #define PTRACE_GET_THREAD_AREA 25 | ||
68 | #define PTRACE_SET_THREAD_AREA 26 | ||
69 | |||
70 | /* Calls to trace a 64bit program from a 32bit program. */ | ||
71 | #define PTRACE_PEEKTEXT_3264 0xc0 | ||
72 | #define PTRACE_PEEKDATA_3264 0xc1 | ||
73 | #define PTRACE_POKETEXT_3264 0xc2 | ||
74 | #define PTRACE_POKEDATA_3264 0xc3 | ||
75 | #define PTRACE_GET_THREAD_AREA_3264 0xc4 | ||
76 | |||
77 | #ifdef __KERNEL__ | ||
78 | |||
79 | #include <linux/linkage.h> | ||
80 | #include <asm/isadep.h> | ||
81 | |||
82 | /* | ||
83 | * Does the process account for user or for system time? | ||
84 | */ | ||
85 | #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER) | ||
86 | |||
87 | #define instruction_pointer(regs) ((regs)->cp0_epc) | ||
88 | #define profile_pc(regs) instruction_pointer(regs) | ||
89 | |||
90 | extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); | ||
91 | |||
92 | extern NORET_TYPE void die(const char *, const struct pt_regs *) ATTRIB_NORET; | ||
93 | |||
94 | static inline void die_if_kernel(const char *str, const struct pt_regs *regs) | ||
95 | { | ||
96 | if (unlikely(!user_mode(regs))) | ||
97 | die(str, regs); | ||
98 | } | ||
99 | |||
100 | #endif | ||
101 | |||
102 | #endif /* _ASM_PTRACE_H */ | ||
diff --git a/include/asm-mips/r4k-timer.h b/include/asm-mips/r4k-timer.h deleted file mode 100644 index a37d12b3b61c..000000000000 --- a/include/asm-mips/r4k-timer.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2008 by Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #ifndef __ASM_R4K_TYPES_H | ||
9 | #define __ASM_R4K_TYPES_H | ||
10 | |||
11 | #include <linux/compiler.h> | ||
12 | |||
13 | #ifdef CONFIG_SYNC_R4K | ||
14 | |||
15 | extern void synchronise_count_master(void); | ||
16 | extern void synchronise_count_slave(void); | ||
17 | |||
18 | #else | ||
19 | |||
20 | static inline void synchronise_count_master(void) | ||
21 | { | ||
22 | } | ||
23 | |||
24 | static inline void synchronise_count_slave(void) | ||
25 | { | ||
26 | } | ||
27 | |||
28 | #endif | ||
29 | |||
30 | #endif /* __ASM_R4K_TYPES_H */ | ||
diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h deleted file mode 100644 index 4c140db36786..000000000000 --- a/include/asm-mips/r4kcache.h +++ /dev/null | |||
@@ -1,443 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Inline assembly cache operations. | ||
7 | * | ||
8 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | ||
9 | * Copyright (C) 1997 - 2002 Ralf Baechle (ralf@gnu.org) | ||
10 | * Copyright (C) 2004 Ralf Baechle (ralf@linux-mips.org) | ||
11 | */ | ||
12 | #ifndef _ASM_R4KCACHE_H | ||
13 | #define _ASM_R4KCACHE_H | ||
14 | |||
15 | #include <asm/asm.h> | ||
16 | #include <asm/cacheops.h> | ||
17 | #include <asm/cpu-features.h> | ||
18 | #include <asm/mipsmtregs.h> | ||
19 | |||
20 | /* | ||
21 | * This macro return a properly sign-extended address suitable as base address | ||
22 | * for indexed cache operations. Two issues here: | ||
23 | * | ||
24 | * - The MIPS32 and MIPS64 specs permit an implementation to directly derive | ||
25 | * the index bits from the virtual address. This breaks with tradition | ||
26 | * set by the R4000. To keep unpleasant surprises from happening we pick | ||
27 | * an address in KSEG0 / CKSEG0. | ||
28 | * - We need a properly sign extended address for 64-bit code. To get away | ||
29 | * without ifdefs we let the compiler do it by a type cast. | ||
30 | */ | ||
31 | #define INDEX_BASE CKSEG0 | ||
32 | |||
33 | #define cache_op(op,addr) \ | ||
34 | __asm__ __volatile__( \ | ||
35 | " .set push \n" \ | ||
36 | " .set noreorder \n" \ | ||
37 | " .set mips3\n\t \n" \ | ||
38 | " cache %0, %1 \n" \ | ||
39 | " .set pop \n" \ | ||
40 | : \ | ||
41 | : "i" (op), "R" (*(unsigned char *)(addr))) | ||
42 | |||
43 | #ifdef CONFIG_MIPS_MT | ||
44 | /* | ||
45 | * Temporary hacks for SMTC debug. Optionally force single-threaded | ||
46 | * execution during I-cache flushes. | ||
47 | */ | ||
48 | |||
49 | #define PROTECT_CACHE_FLUSHES 1 | ||
50 | |||
51 | #ifdef PROTECT_CACHE_FLUSHES | ||
52 | |||
53 | extern int mt_protiflush; | ||
54 | extern int mt_protdflush; | ||
55 | extern void mt_cflush_lockdown(void); | ||
56 | extern void mt_cflush_release(void); | ||
57 | |||
58 | #define BEGIN_MT_IPROT \ | ||
59 | unsigned long flags = 0; \ | ||
60 | unsigned long mtflags = 0; \ | ||
61 | if(mt_protiflush) { \ | ||
62 | local_irq_save(flags); \ | ||
63 | ehb(); \ | ||
64 | mtflags = dvpe(); \ | ||
65 | mt_cflush_lockdown(); \ | ||
66 | } | ||
67 | |||
68 | #define END_MT_IPROT \ | ||
69 | if(mt_protiflush) { \ | ||
70 | mt_cflush_release(); \ | ||
71 | evpe(mtflags); \ | ||
72 | local_irq_restore(flags); \ | ||
73 | } | ||
74 | |||
75 | #define BEGIN_MT_DPROT \ | ||
76 | unsigned long flags = 0; \ | ||
77 | unsigned long mtflags = 0; \ | ||
78 | if(mt_protdflush) { \ | ||
79 | local_irq_save(flags); \ | ||
80 | ehb(); \ | ||
81 | mtflags = dvpe(); \ | ||
82 | mt_cflush_lockdown(); \ | ||
83 | } | ||
84 | |||
85 | #define END_MT_DPROT \ | ||
86 | if(mt_protdflush) { \ | ||
87 | mt_cflush_release(); \ | ||
88 | evpe(mtflags); \ | ||
89 | local_irq_restore(flags); \ | ||
90 | } | ||
91 | |||
92 | #else | ||
93 | |||
94 | #define BEGIN_MT_IPROT | ||
95 | #define BEGIN_MT_DPROT | ||
96 | #define END_MT_IPROT | ||
97 | #define END_MT_DPROT | ||
98 | |||
99 | #endif /* PROTECT_CACHE_FLUSHES */ | ||
100 | |||
101 | #define __iflush_prologue \ | ||
102 | unsigned long redundance; \ | ||
103 | extern int mt_n_iflushes; \ | ||
104 | BEGIN_MT_IPROT \ | ||
105 | for (redundance = 0; redundance < mt_n_iflushes; redundance++) { | ||
106 | |||
107 | #define __iflush_epilogue \ | ||
108 | END_MT_IPROT \ | ||
109 | } | ||
110 | |||
111 | #define __dflush_prologue \ | ||
112 | unsigned long redundance; \ | ||
113 | extern int mt_n_dflushes; \ | ||
114 | BEGIN_MT_DPROT \ | ||
115 | for (redundance = 0; redundance < mt_n_dflushes; redundance++) { | ||
116 | |||
117 | #define __dflush_epilogue \ | ||
118 | END_MT_DPROT \ | ||
119 | } | ||
120 | |||
121 | #define __inv_dflush_prologue __dflush_prologue | ||
122 | #define __inv_dflush_epilogue __dflush_epilogue | ||
123 | #define __sflush_prologue { | ||
124 | #define __sflush_epilogue } | ||
125 | #define __inv_sflush_prologue __sflush_prologue | ||
126 | #define __inv_sflush_epilogue __sflush_epilogue | ||
127 | |||
128 | #else /* CONFIG_MIPS_MT */ | ||
129 | |||
130 | #define __iflush_prologue { | ||
131 | #define __iflush_epilogue } | ||
132 | #define __dflush_prologue { | ||
133 | #define __dflush_epilogue } | ||
134 | #define __inv_dflush_prologue { | ||
135 | #define __inv_dflush_epilogue } | ||
136 | #define __sflush_prologue { | ||
137 | #define __sflush_epilogue } | ||
138 | #define __inv_sflush_prologue { | ||
139 | #define __inv_sflush_epilogue } | ||
140 | |||
141 | #endif /* CONFIG_MIPS_MT */ | ||
142 | |||
143 | static inline void flush_icache_line_indexed(unsigned long addr) | ||
144 | { | ||
145 | __iflush_prologue | ||
146 | cache_op(Index_Invalidate_I, addr); | ||
147 | __iflush_epilogue | ||
148 | } | ||
149 | |||
150 | static inline void flush_dcache_line_indexed(unsigned long addr) | ||
151 | { | ||
152 | __dflush_prologue | ||
153 | cache_op(Index_Writeback_Inv_D, addr); | ||
154 | __dflush_epilogue | ||
155 | } | ||
156 | |||
157 | static inline void flush_scache_line_indexed(unsigned long addr) | ||
158 | { | ||
159 | cache_op(Index_Writeback_Inv_SD, addr); | ||
160 | } | ||
161 | |||
162 | static inline void flush_icache_line(unsigned long addr) | ||
163 | { | ||
164 | __iflush_prologue | ||
165 | cache_op(Hit_Invalidate_I, addr); | ||
166 | __iflush_epilogue | ||
167 | } | ||
168 | |||
169 | static inline void flush_dcache_line(unsigned long addr) | ||
170 | { | ||
171 | __dflush_prologue | ||
172 | cache_op(Hit_Writeback_Inv_D, addr); | ||
173 | __dflush_epilogue | ||
174 | } | ||
175 | |||
176 | static inline void invalidate_dcache_line(unsigned long addr) | ||
177 | { | ||
178 | __dflush_prologue | ||
179 | cache_op(Hit_Invalidate_D, addr); | ||
180 | __dflush_epilogue | ||
181 | } | ||
182 | |||
183 | static inline void invalidate_scache_line(unsigned long addr) | ||
184 | { | ||
185 | cache_op(Hit_Invalidate_SD, addr); | ||
186 | } | ||
187 | |||
188 | static inline void flush_scache_line(unsigned long addr) | ||
189 | { | ||
190 | cache_op(Hit_Writeback_Inv_SD, addr); | ||
191 | } | ||
192 | |||
193 | #define protected_cache_op(op,addr) \ | ||
194 | __asm__ __volatile__( \ | ||
195 | " .set push \n" \ | ||
196 | " .set noreorder \n" \ | ||
197 | " .set mips3 \n" \ | ||
198 | "1: cache %0, (%1) \n" \ | ||
199 | "2: .set pop \n" \ | ||
200 | " .section __ex_table,\"a\" \n" \ | ||
201 | " "STR(PTR)" 1b, 2b \n" \ | ||
202 | " .previous" \ | ||
203 | : \ | ||
204 | : "i" (op), "r" (addr)) | ||
205 | |||
206 | /* | ||
207 | * The next two are for badland addresses like signal trampolines. | ||
208 | */ | ||
209 | static inline void protected_flush_icache_line(unsigned long addr) | ||
210 | { | ||
211 | protected_cache_op(Hit_Invalidate_I, addr); | ||
212 | } | ||
213 | |||
214 | /* | ||
215 | * R10000 / R12000 hazard - these processors don't support the Hit_Writeback_D | ||
216 | * cacheop so we use Hit_Writeback_Inv_D which is supported by all R4000-style | ||
217 | * caches. We're talking about one cacheline unnecessarily getting invalidated | ||
218 | * here so the penalty isn't overly hard. | ||
219 | */ | ||
220 | static inline void protected_writeback_dcache_line(unsigned long addr) | ||
221 | { | ||
222 | protected_cache_op(Hit_Writeback_Inv_D, addr); | ||
223 | } | ||
224 | |||
225 | static inline void protected_writeback_scache_line(unsigned long addr) | ||
226 | { | ||
227 | protected_cache_op(Hit_Writeback_Inv_SD, addr); | ||
228 | } | ||
229 | |||
230 | /* | ||
231 | * This one is RM7000-specific | ||
232 | */ | ||
233 | static inline void invalidate_tcache_page(unsigned long addr) | ||
234 | { | ||
235 | cache_op(Page_Invalidate_T, addr); | ||
236 | } | ||
237 | |||
238 | #define cache16_unroll32(base,op) \ | ||
239 | __asm__ __volatile__( \ | ||
240 | " .set push \n" \ | ||
241 | " .set noreorder \n" \ | ||
242 | " .set mips3 \n" \ | ||
243 | " cache %1, 0x000(%0); cache %1, 0x010(%0) \n" \ | ||
244 | " cache %1, 0x020(%0); cache %1, 0x030(%0) \n" \ | ||
245 | " cache %1, 0x040(%0); cache %1, 0x050(%0) \n" \ | ||
246 | " cache %1, 0x060(%0); cache %1, 0x070(%0) \n" \ | ||
247 | " cache %1, 0x080(%0); cache %1, 0x090(%0) \n" \ | ||
248 | " cache %1, 0x0a0(%0); cache %1, 0x0b0(%0) \n" \ | ||
249 | " cache %1, 0x0c0(%0); cache %1, 0x0d0(%0) \n" \ | ||
250 | " cache %1, 0x0e0(%0); cache %1, 0x0f0(%0) \n" \ | ||
251 | " cache %1, 0x100(%0); cache %1, 0x110(%0) \n" \ | ||
252 | " cache %1, 0x120(%0); cache %1, 0x130(%0) \n" \ | ||
253 | " cache %1, 0x140(%0); cache %1, 0x150(%0) \n" \ | ||
254 | " cache %1, 0x160(%0); cache %1, 0x170(%0) \n" \ | ||
255 | " cache %1, 0x180(%0); cache %1, 0x190(%0) \n" \ | ||
256 | " cache %1, 0x1a0(%0); cache %1, 0x1b0(%0) \n" \ | ||
257 | " cache %1, 0x1c0(%0); cache %1, 0x1d0(%0) \n" \ | ||
258 | " cache %1, 0x1e0(%0); cache %1, 0x1f0(%0) \n" \ | ||
259 | " .set pop \n" \ | ||
260 | : \ | ||
261 | : "r" (base), \ | ||
262 | "i" (op)); | ||
263 | |||
264 | #define cache32_unroll32(base,op) \ | ||
265 | __asm__ __volatile__( \ | ||
266 | " .set push \n" \ | ||
267 | " .set noreorder \n" \ | ||
268 | " .set mips3 \n" \ | ||
269 | " cache %1, 0x000(%0); cache %1, 0x020(%0) \n" \ | ||
270 | " cache %1, 0x040(%0); cache %1, 0x060(%0) \n" \ | ||
271 | " cache %1, 0x080(%0); cache %1, 0x0a0(%0) \n" \ | ||
272 | " cache %1, 0x0c0(%0); cache %1, 0x0e0(%0) \n" \ | ||
273 | " cache %1, 0x100(%0); cache %1, 0x120(%0) \n" \ | ||
274 | " cache %1, 0x140(%0); cache %1, 0x160(%0) \n" \ | ||
275 | " cache %1, 0x180(%0); cache %1, 0x1a0(%0) \n" \ | ||
276 | " cache %1, 0x1c0(%0); cache %1, 0x1e0(%0) \n" \ | ||
277 | " cache %1, 0x200(%0); cache %1, 0x220(%0) \n" \ | ||
278 | " cache %1, 0x240(%0); cache %1, 0x260(%0) \n" \ | ||
279 | " cache %1, 0x280(%0); cache %1, 0x2a0(%0) \n" \ | ||
280 | " cache %1, 0x2c0(%0); cache %1, 0x2e0(%0) \n" \ | ||
281 | " cache %1, 0x300(%0); cache %1, 0x320(%0) \n" \ | ||
282 | " cache %1, 0x340(%0); cache %1, 0x360(%0) \n" \ | ||
283 | " cache %1, 0x380(%0); cache %1, 0x3a0(%0) \n" \ | ||
284 | " cache %1, 0x3c0(%0); cache %1, 0x3e0(%0) \n" \ | ||
285 | " .set pop \n" \ | ||
286 | : \ | ||
287 | : "r" (base), \ | ||
288 | "i" (op)); | ||
289 | |||
290 | #define cache64_unroll32(base,op) \ | ||
291 | __asm__ __volatile__( \ | ||
292 | " .set push \n" \ | ||
293 | " .set noreorder \n" \ | ||
294 | " .set mips3 \n" \ | ||
295 | " cache %1, 0x000(%0); cache %1, 0x040(%0) \n" \ | ||
296 | " cache %1, 0x080(%0); cache %1, 0x0c0(%0) \n" \ | ||
297 | " cache %1, 0x100(%0); cache %1, 0x140(%0) \n" \ | ||
298 | " cache %1, 0x180(%0); cache %1, 0x1c0(%0) \n" \ | ||
299 | " cache %1, 0x200(%0); cache %1, 0x240(%0) \n" \ | ||
300 | " cache %1, 0x280(%0); cache %1, 0x2c0(%0) \n" \ | ||
301 | " cache %1, 0x300(%0); cache %1, 0x340(%0) \n" \ | ||
302 | " cache %1, 0x380(%0); cache %1, 0x3c0(%0) \n" \ | ||
303 | " cache %1, 0x400(%0); cache %1, 0x440(%0) \n" \ | ||
304 | " cache %1, 0x480(%0); cache %1, 0x4c0(%0) \n" \ | ||
305 | " cache %1, 0x500(%0); cache %1, 0x540(%0) \n" \ | ||
306 | " cache %1, 0x580(%0); cache %1, 0x5c0(%0) \n" \ | ||
307 | " cache %1, 0x600(%0); cache %1, 0x640(%0) \n" \ | ||
308 | " cache %1, 0x680(%0); cache %1, 0x6c0(%0) \n" \ | ||
309 | " cache %1, 0x700(%0); cache %1, 0x740(%0) \n" \ | ||
310 | " cache %1, 0x780(%0); cache %1, 0x7c0(%0) \n" \ | ||
311 | " .set pop \n" \ | ||
312 | : \ | ||
313 | : "r" (base), \ | ||
314 | "i" (op)); | ||
315 | |||
316 | #define cache128_unroll32(base,op) \ | ||
317 | __asm__ __volatile__( \ | ||
318 | " .set push \n" \ | ||
319 | " .set noreorder \n" \ | ||
320 | " .set mips3 \n" \ | ||
321 | " cache %1, 0x000(%0); cache %1, 0x080(%0) \n" \ | ||
322 | " cache %1, 0x100(%0); cache %1, 0x180(%0) \n" \ | ||
323 | " cache %1, 0x200(%0); cache %1, 0x280(%0) \n" \ | ||
324 | " cache %1, 0x300(%0); cache %1, 0x380(%0) \n" \ | ||
325 | " cache %1, 0x400(%0); cache %1, 0x480(%0) \n" \ | ||
326 | " cache %1, 0x500(%0); cache %1, 0x580(%0) \n" \ | ||
327 | " cache %1, 0x600(%0); cache %1, 0x680(%0) \n" \ | ||
328 | " cache %1, 0x700(%0); cache %1, 0x780(%0) \n" \ | ||
329 | " cache %1, 0x800(%0); cache %1, 0x880(%0) \n" \ | ||
330 | " cache %1, 0x900(%0); cache %1, 0x980(%0) \n" \ | ||
331 | " cache %1, 0xa00(%0); cache %1, 0xa80(%0) \n" \ | ||
332 | " cache %1, 0xb00(%0); cache %1, 0xb80(%0) \n" \ | ||
333 | " cache %1, 0xc00(%0); cache %1, 0xc80(%0) \n" \ | ||
334 | " cache %1, 0xd00(%0); cache %1, 0xd80(%0) \n" \ | ||
335 | " cache %1, 0xe00(%0); cache %1, 0xe80(%0) \n" \ | ||
336 | " cache %1, 0xf00(%0); cache %1, 0xf80(%0) \n" \ | ||
337 | " .set pop \n" \ | ||
338 | : \ | ||
339 | : "r" (base), \ | ||
340 | "i" (op)); | ||
341 | |||
342 | /* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */ | ||
343 | #define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize) \ | ||
344 | static inline void blast_##pfx##cache##lsize(void) \ | ||
345 | { \ | ||
346 | unsigned long start = INDEX_BASE; \ | ||
347 | unsigned long end = start + current_cpu_data.desc.waysize; \ | ||
348 | unsigned long ws_inc = 1UL << current_cpu_data.desc.waybit; \ | ||
349 | unsigned long ws_end = current_cpu_data.desc.ways << \ | ||
350 | current_cpu_data.desc.waybit; \ | ||
351 | unsigned long ws, addr; \ | ||
352 | \ | ||
353 | __##pfx##flush_prologue \ | ||
354 | \ | ||
355 | for (ws = 0; ws < ws_end; ws += ws_inc) \ | ||
356 | for (addr = start; addr < end; addr += lsize * 32) \ | ||
357 | cache##lsize##_unroll32(addr|ws, indexop); \ | ||
358 | \ | ||
359 | __##pfx##flush_epilogue \ | ||
360 | } \ | ||
361 | \ | ||
362 | static inline void blast_##pfx##cache##lsize##_page(unsigned long page) \ | ||
363 | { \ | ||
364 | unsigned long start = page; \ | ||
365 | unsigned long end = page + PAGE_SIZE; \ | ||
366 | \ | ||
367 | __##pfx##flush_prologue \ | ||
368 | \ | ||
369 | do { \ | ||
370 | cache##lsize##_unroll32(start, hitop); \ | ||
371 | start += lsize * 32; \ | ||
372 | } while (start < end); \ | ||
373 | \ | ||
374 | __##pfx##flush_epilogue \ | ||
375 | } \ | ||
376 | \ | ||
377 | static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long page) \ | ||
378 | { \ | ||
379 | unsigned long indexmask = current_cpu_data.desc.waysize - 1; \ | ||
380 | unsigned long start = INDEX_BASE + (page & indexmask); \ | ||
381 | unsigned long end = start + PAGE_SIZE; \ | ||
382 | unsigned long ws_inc = 1UL << current_cpu_data.desc.waybit; \ | ||
383 | unsigned long ws_end = current_cpu_data.desc.ways << \ | ||
384 | current_cpu_data.desc.waybit; \ | ||
385 | unsigned long ws, addr; \ | ||
386 | \ | ||
387 | __##pfx##flush_prologue \ | ||
388 | \ | ||
389 | for (ws = 0; ws < ws_end; ws += ws_inc) \ | ||
390 | for (addr = start; addr < end; addr += lsize * 32) \ | ||
391 | cache##lsize##_unroll32(addr|ws, indexop); \ | ||
392 | \ | ||
393 | __##pfx##flush_epilogue \ | ||
394 | } | ||
395 | |||
396 | __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16) | ||
397 | __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16) | ||
398 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16) | ||
399 | __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32) | ||
400 | __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32) | ||
401 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32) | ||
402 | __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64) | ||
403 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64) | ||
404 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128) | ||
405 | |||
406 | __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16) | ||
407 | __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32) | ||
408 | __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16) | ||
409 | __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32) | ||
410 | __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64) | ||
411 | __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128) | ||
412 | |||
413 | /* build blast_xxx_range, protected_blast_xxx_range */ | ||
414 | #define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot) \ | ||
415 | static inline void prot##blast_##pfx##cache##_range(unsigned long start, \ | ||
416 | unsigned long end) \ | ||
417 | { \ | ||
418 | unsigned long lsize = cpu_##desc##_line_size(); \ | ||
419 | unsigned long addr = start & ~(lsize - 1); \ | ||
420 | unsigned long aend = (end - 1) & ~(lsize - 1); \ | ||
421 | \ | ||
422 | __##pfx##flush_prologue \ | ||
423 | \ | ||
424 | while (1) { \ | ||
425 | prot##cache_op(hitop, addr); \ | ||
426 | if (addr == aend) \ | ||
427 | break; \ | ||
428 | addr += lsize; \ | ||
429 | } \ | ||
430 | \ | ||
431 | __##pfx##flush_epilogue \ | ||
432 | } | ||
433 | |||
434 | __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_) | ||
435 | __BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_) | ||
436 | __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_) | ||
437 | __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, ) | ||
438 | __BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, ) | ||
439 | /* blast_inv_dcache_range */ | ||
440 | __BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, ) | ||
441 | __BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, ) | ||
442 | |||
443 | #endif /* _ASM_R4KCACHE_H */ | ||
diff --git a/include/asm-mips/reboot.h b/include/asm-mips/reboot.h deleted file mode 100644 index e48c0bfab257..000000000000 --- a/include/asm-mips/reboot.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1997, 1999, 2001, 06 by Ralf Baechle | ||
7 | * Copyright (C) 2001 MIPS Technologies, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_REBOOT_H | ||
10 | #define _ASM_REBOOT_H | ||
11 | |||
12 | extern void (*_machine_restart)(char *command); | ||
13 | extern void (*_machine_halt)(void); | ||
14 | |||
15 | #endif /* _ASM_REBOOT_H */ | ||
diff --git a/include/asm-mips/reg.h b/include/asm-mips/reg.h deleted file mode 100644 index 634b55d7e7f6..000000000000 --- a/include/asm-mips/reg.h +++ /dev/null | |||
@@ -1,128 +0,0 @@ | |||
1 | /* | ||
2 | * Various register offset definitions for debuggers, core file | ||
3 | * examiners and whatnot. | ||
4 | * | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * Copyright (C) 1995, 1999 Ralf Baechle | ||
10 | * Copyright (C) 1995, 1999 Silicon Graphics | ||
11 | */ | ||
12 | #ifndef __ASM_MIPS_REG_H | ||
13 | #define __ASM_MIPS_REG_H | ||
14 | |||
15 | |||
16 | #if defined(CONFIG_32BIT) || defined(WANT_COMPAT_REG_H) | ||
17 | |||
18 | #define EF_R0 6 | ||
19 | #define EF_R1 7 | ||
20 | #define EF_R2 8 | ||
21 | #define EF_R3 9 | ||
22 | #define EF_R4 10 | ||
23 | #define EF_R5 11 | ||
24 | #define EF_R6 12 | ||
25 | #define EF_R7 13 | ||
26 | #define EF_R8 14 | ||
27 | #define EF_R9 15 | ||
28 | #define EF_R10 16 | ||
29 | #define EF_R11 17 | ||
30 | #define EF_R12 18 | ||
31 | #define EF_R13 19 | ||
32 | #define EF_R14 20 | ||
33 | #define EF_R15 21 | ||
34 | #define EF_R16 22 | ||
35 | #define EF_R17 23 | ||
36 | #define EF_R18 24 | ||
37 | #define EF_R19 25 | ||
38 | #define EF_R20 26 | ||
39 | #define EF_R21 27 | ||
40 | #define EF_R22 28 | ||
41 | #define EF_R23 29 | ||
42 | #define EF_R24 30 | ||
43 | #define EF_R25 31 | ||
44 | |||
45 | /* | ||
46 | * k0/k1 unsaved | ||
47 | */ | ||
48 | #define EF_R26 32 | ||
49 | #define EF_R27 33 | ||
50 | |||
51 | #define EF_R28 34 | ||
52 | #define EF_R29 35 | ||
53 | #define EF_R30 36 | ||
54 | #define EF_R31 37 | ||
55 | |||
56 | /* | ||
57 | * Saved special registers | ||
58 | */ | ||
59 | #define EF_LO 38 | ||
60 | #define EF_HI 39 | ||
61 | |||
62 | #define EF_CP0_EPC 40 | ||
63 | #define EF_CP0_BADVADDR 41 | ||
64 | #define EF_CP0_STATUS 42 | ||
65 | #define EF_CP0_CAUSE 43 | ||
66 | #define EF_UNUSED0 44 | ||
67 | |||
68 | #define EF_SIZE 180 | ||
69 | |||
70 | #endif | ||
71 | |||
72 | #ifdef CONFIG_64BIT | ||
73 | |||
74 | #define EF_R0 0 | ||
75 | #define EF_R1 1 | ||
76 | #define EF_R2 2 | ||
77 | #define EF_R3 3 | ||
78 | #define EF_R4 4 | ||
79 | #define EF_R5 5 | ||
80 | #define EF_R6 6 | ||
81 | #define EF_R7 7 | ||
82 | #define EF_R8 8 | ||
83 | #define EF_R9 9 | ||
84 | #define EF_R10 10 | ||
85 | #define EF_R11 11 | ||
86 | #define EF_R12 12 | ||
87 | #define EF_R13 13 | ||
88 | #define EF_R14 14 | ||
89 | #define EF_R15 15 | ||
90 | #define EF_R16 16 | ||
91 | #define EF_R17 17 | ||
92 | #define EF_R18 18 | ||
93 | #define EF_R19 19 | ||
94 | #define EF_R20 20 | ||
95 | #define EF_R21 21 | ||
96 | #define EF_R22 22 | ||
97 | #define EF_R23 23 | ||
98 | #define EF_R24 24 | ||
99 | #define EF_R25 25 | ||
100 | |||
101 | /* | ||
102 | * k0/k1 unsaved | ||
103 | */ | ||
104 | #define EF_R26 26 | ||
105 | #define EF_R27 27 | ||
106 | |||
107 | |||
108 | #define EF_R28 28 | ||
109 | #define EF_R29 29 | ||
110 | #define EF_R30 30 | ||
111 | #define EF_R31 31 | ||
112 | |||
113 | /* | ||
114 | * Saved special registers | ||
115 | */ | ||
116 | #define EF_LO 32 | ||
117 | #define EF_HI 33 | ||
118 | |||
119 | #define EF_CP0_EPC 34 | ||
120 | #define EF_CP0_BADVADDR 35 | ||
121 | #define EF_CP0_STATUS 36 | ||
122 | #define EF_CP0_CAUSE 37 | ||
123 | |||
124 | #define EF_SIZE 304 /* size in bytes */ | ||
125 | |||
126 | #endif /* CONFIG_64BIT */ | ||
127 | |||
128 | #endif /* __ASM_MIPS_REG_H */ | ||
diff --git a/include/asm-mips/regdef.h b/include/asm-mips/regdef.h deleted file mode 100644 index 7c8ecb6b9c40..000000000000 --- a/include/asm-mips/regdef.h +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1985 MIPS Computer Systems, Inc. | ||
7 | * Copyright (C) 1994, 95, 99, 2003 by Ralf Baechle | ||
8 | * Copyright (C) 1990 - 1992, 1999 Silicon Graphics, Inc. | ||
9 | */ | ||
10 | #ifndef _ASM_REGDEF_H | ||
11 | #define _ASM_REGDEF_H | ||
12 | |||
13 | #include <asm/sgidefs.h> | ||
14 | |||
15 | #if _MIPS_SIM == _MIPS_SIM_ABI32 | ||
16 | |||
17 | /* | ||
18 | * Symbolic register names for 32 bit ABI | ||
19 | */ | ||
20 | #define zero $0 /* wired zero */ | ||
21 | #define AT $1 /* assembler temp - uppercase because of ".set at" */ | ||
22 | #define v0 $2 /* return value */ | ||
23 | #define v1 $3 | ||
24 | #define a0 $4 /* argument registers */ | ||
25 | #define a1 $5 | ||
26 | #define a2 $6 | ||
27 | #define a3 $7 | ||
28 | #define t0 $8 /* caller saved */ | ||
29 | #define t1 $9 | ||
30 | #define t2 $10 | ||
31 | #define t3 $11 | ||
32 | #define t4 $12 | ||
33 | #define t5 $13 | ||
34 | #define t6 $14 | ||
35 | #define t7 $15 | ||
36 | #define s0 $16 /* callee saved */ | ||
37 | #define s1 $17 | ||
38 | #define s2 $18 | ||
39 | #define s3 $19 | ||
40 | #define s4 $20 | ||
41 | #define s5 $21 | ||
42 | #define s6 $22 | ||
43 | #define s7 $23 | ||
44 | #define t8 $24 /* caller saved */ | ||
45 | #define t9 $25 | ||
46 | #define jp $25 /* PIC jump register */ | ||
47 | #define k0 $26 /* kernel scratch */ | ||
48 | #define k1 $27 | ||
49 | #define gp $28 /* global pointer */ | ||
50 | #define sp $29 /* stack pointer */ | ||
51 | #define fp $30 /* frame pointer */ | ||
52 | #define s8 $30 /* same like fp! */ | ||
53 | #define ra $31 /* return address */ | ||
54 | |||
55 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | ||
56 | |||
57 | #if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 | ||
58 | |||
59 | #define zero $0 /* wired zero */ | ||
60 | #define AT $at /* assembler temp - uppercase because of ".set at" */ | ||
61 | #define v0 $2 /* return value - caller saved */ | ||
62 | #define v1 $3 | ||
63 | #define a0 $4 /* argument registers */ | ||
64 | #define a1 $5 | ||
65 | #define a2 $6 | ||
66 | #define a3 $7 | ||
67 | #define a4 $8 /* arg reg 64 bit; caller saved in 32 bit */ | ||
68 | #define ta0 $8 | ||
69 | #define a5 $9 | ||
70 | #define ta1 $9 | ||
71 | #define a6 $10 | ||
72 | #define ta2 $10 | ||
73 | #define a7 $11 | ||
74 | #define ta3 $11 | ||
75 | #define t0 $12 /* caller saved */ | ||
76 | #define t1 $13 | ||
77 | #define t2 $14 | ||
78 | #define t3 $15 | ||
79 | #define s0 $16 /* callee saved */ | ||
80 | #define s1 $17 | ||
81 | #define s2 $18 | ||
82 | #define s3 $19 | ||
83 | #define s4 $20 | ||
84 | #define s5 $21 | ||
85 | #define s6 $22 | ||
86 | #define s7 $23 | ||
87 | #define t8 $24 /* caller saved */ | ||
88 | #define t9 $25 /* callee address for PIC/temp */ | ||
89 | #define jp $25 /* PIC jump register */ | ||
90 | #define k0 $26 /* kernel temporary */ | ||
91 | #define k1 $27 | ||
92 | #define gp $28 /* global pointer - caller saved for PIC */ | ||
93 | #define sp $29 /* stack pointer */ | ||
94 | #define fp $30 /* frame pointer */ | ||
95 | #define s8 $30 /* callee saved */ | ||
96 | #define ra $31 /* return address */ | ||
97 | |||
98 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */ | ||
99 | |||
100 | #endif /* _ASM_REGDEF_H */ | ||
diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h deleted file mode 100644 index 87cb3085269c..000000000000 --- a/include/asm-mips/resource.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 96, 98, 99, 2000 by Ralf Baechle | ||
7 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_RESOURCE_H | ||
10 | #define _ASM_RESOURCE_H | ||
11 | |||
12 | |||
13 | /* | ||
14 | * These five resource limit IDs have a MIPS/Linux-specific ordering, | ||
15 | * the rest comes from the generic header: | ||
16 | */ | ||
17 | #define RLIMIT_NOFILE 5 /* max number of open files */ | ||
18 | #define RLIMIT_AS 6 /* address space limit */ | ||
19 | #define RLIMIT_RSS 7 /* max resident set size */ | ||
20 | #define RLIMIT_NPROC 8 /* max number of processes */ | ||
21 | #define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */ | ||
22 | |||
23 | /* | ||
24 | * SuS says limits have to be unsigned. | ||
25 | * Which makes a ton more sense anyway, | ||
26 | * but we keep the old value on MIPS32, | ||
27 | * for compatibility: | ||
28 | */ | ||
29 | #ifdef CONFIG_32BIT | ||
30 | # define RLIM_INFINITY 0x7fffffffUL | ||
31 | #endif | ||
32 | |||
33 | #include <asm-generic/resource.h> | ||
34 | |||
35 | #endif /* _ASM_RESOURCE_H */ | ||
diff --git a/include/asm-mips/rm9k-ocd.h b/include/asm-mips/rm9k-ocd.h deleted file mode 100644 index b0b80d9ecf96..000000000000 --- a/include/asm-mips/rm9k-ocd.h +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 by Basler Vision Technologies AG | ||
3 | * Author: Thomas Koeller <thomas.koeller@baslerweb.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #if !defined(_ASM_RM9K_OCD_H) | ||
21 | #define _ASM_RM9K_OCD_H | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/spinlock.h> | ||
25 | #include <asm/io.h> | ||
26 | |||
27 | extern volatile void __iomem * const ocd_base; | ||
28 | extern volatile void __iomem * const titan_base; | ||
29 | |||
30 | #define ocd_addr(__x__) (ocd_base + (__x__)) | ||
31 | #define titan_addr(__x__) (titan_base + (__x__)) | ||
32 | #define scram_addr(__x__) (scram_base + (__x__)) | ||
33 | |||
34 | /* OCD register access */ | ||
35 | #define ocd_readl(__offs__) __raw_readl(ocd_addr(__offs__)) | ||
36 | #define ocd_readw(__offs__) __raw_readw(ocd_addr(__offs__)) | ||
37 | #define ocd_readb(__offs__) __raw_readb(ocd_addr(__offs__)) | ||
38 | #define ocd_writel(__val__, __offs__) \ | ||
39 | __raw_writel((__val__), ocd_addr(__offs__)) | ||
40 | #define ocd_writew(__val__, __offs__) \ | ||
41 | __raw_writew((__val__), ocd_addr(__offs__)) | ||
42 | #define ocd_writeb(__val__, __offs__) \ | ||
43 | __raw_writeb((__val__), ocd_addr(__offs__)) | ||
44 | |||
45 | /* TITAN register access - 32 bit-wide only */ | ||
46 | #define titan_readl(__offs__) __raw_readl(titan_addr(__offs__)) | ||
47 | #define titan_writel(__val__, __offs__) \ | ||
48 | __raw_writel((__val__), titan_addr(__offs__)) | ||
49 | |||
50 | /* Protect access to shared TITAN registers */ | ||
51 | extern spinlock_t titan_lock; | ||
52 | extern int titan_irqflags; | ||
53 | #define lock_titan_regs() spin_lock_irqsave(&titan_lock, titan_irqflags) | ||
54 | #define unlock_titan_regs() spin_unlock_irqrestore(&titan_lock, titan_irqflags) | ||
55 | |||
56 | #endif /* !defined(_ASM_RM9K_OCD_H) */ | ||
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h deleted file mode 100644 index 4ca3063ed2ce..000000000000 --- a/include/asm-mips/rtlx.h +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved. | ||
3 | * | ||
4 | */ | ||
5 | |||
6 | #ifndef __ASM_RTLX_H_ | ||
7 | #define __ASM_RTLX_H_ | ||
8 | |||
9 | #include <irq.h> | ||
10 | |||
11 | #define LX_NODE_BASE 10 | ||
12 | |||
13 | #define MIPS_CPU_RTLX_IRQ 0 | ||
14 | |||
15 | #define RTLX_VERSION 2 | ||
16 | #define RTLX_xID 0x12345600 | ||
17 | #define RTLX_ID (RTLX_xID | RTLX_VERSION) | ||
18 | #define RTLX_CHANNELS 8 | ||
19 | |||
20 | #define RTLX_CHANNEL_STDIO 0 | ||
21 | #define RTLX_CHANNEL_DBG 1 | ||
22 | #define RTLX_CHANNEL_SYSIO 2 | ||
23 | |||
24 | extern int rtlx_open(int index, int can_sleep); | ||
25 | extern int rtlx_release(int index); | ||
26 | extern ssize_t rtlx_read(int index, void __user *buff, size_t count); | ||
27 | extern ssize_t rtlx_write(int index, const void __user *buffer, size_t count); | ||
28 | extern unsigned int rtlx_read_poll(int index, int can_sleep); | ||
29 | extern unsigned int rtlx_write_poll(int index); | ||
30 | |||
31 | enum rtlx_state { | ||
32 | RTLX_STATE_UNUSED = 0, | ||
33 | RTLX_STATE_INITIALISED, | ||
34 | RTLX_STATE_REMOTE_READY, | ||
35 | RTLX_STATE_OPENED | ||
36 | }; | ||
37 | |||
38 | #define RTLX_BUFFER_SIZE 2048 | ||
39 | |||
40 | /* each channel supports read and write. | ||
41 | linux (vpe0) reads lx_buffer and writes rt_buffer | ||
42 | SP (vpe1) reads rt_buffer and writes lx_buffer | ||
43 | */ | ||
44 | struct rtlx_channel { | ||
45 | enum rtlx_state rt_state; | ||
46 | enum rtlx_state lx_state; | ||
47 | |||
48 | int buffer_size; | ||
49 | |||
50 | /* read and write indexes per buffer */ | ||
51 | int rt_write, rt_read; | ||
52 | char *rt_buffer; | ||
53 | |||
54 | int lx_write, lx_read; | ||
55 | char *lx_buffer; | ||
56 | }; | ||
57 | |||
58 | struct rtlx_info { | ||
59 | unsigned long id; | ||
60 | enum rtlx_state state; | ||
61 | |||
62 | struct rtlx_channel channel[RTLX_CHANNELS]; | ||
63 | }; | ||
64 | |||
65 | #endif /* __ASM_RTLX_H_ */ | ||
diff --git a/include/asm-mips/scatterlist.h b/include/asm-mips/scatterlist.h deleted file mode 100644 index 83d69fe17c9f..000000000000 --- a/include/asm-mips/scatterlist.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | #ifndef __ASM_SCATTERLIST_H | ||
2 | #define __ASM_SCATTERLIST_H | ||
3 | |||
4 | #include <asm/types.h> | ||
5 | |||
6 | struct scatterlist { | ||
7 | #ifdef CONFIG_DEBUG_SG | ||
8 | unsigned long sg_magic; | ||
9 | #endif | ||
10 | unsigned long page_link; | ||
11 | unsigned int offset; | ||
12 | dma_addr_t dma_address; | ||
13 | unsigned int length; | ||
14 | }; | ||
15 | |||
16 | /* | ||
17 | * These macros should be used after a pci_map_sg call has been done | ||
18 | * to get bus addresses of each of the SG entries and their lengths. | ||
19 | * You should only work with the number of sg entries pci_map_sg | ||
20 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
21 | * is 0. | ||
22 | */ | ||
23 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
24 | #define sg_dma_len(sg) ((sg)->length) | ||
25 | |||
26 | #define ISA_DMA_THRESHOLD (0x00ffffffUL) | ||
27 | |||
28 | #endif /* __ASM_SCATTERLIST_H */ | ||
diff --git a/include/asm-mips/seccomp.h b/include/asm-mips/seccomp.h deleted file mode 100644 index 36ed44070256..000000000000 --- a/include/asm-mips/seccomp.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | #ifndef __ASM_SECCOMP_H | ||
2 | |||
3 | #include <linux/thread_info.h> | ||
4 | #include <linux/unistd.h> | ||
5 | |||
6 | #define __NR_seccomp_read __NR_read | ||
7 | #define __NR_seccomp_write __NR_write | ||
8 | #define __NR_seccomp_exit __NR_exit | ||
9 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
10 | |||
11 | /* | ||
12 | * Kludge alert: | ||
13 | * | ||
14 | * The generic seccomp code currently allows only a single compat ABI. Until | ||
15 | * this is fixed we priorize O32 as the compat ABI over N32. | ||
16 | */ | ||
17 | #ifdef CONFIG_MIPS32_O32 | ||
18 | |||
19 | #define TIF_32BIT TIF_32BIT_REGS | ||
20 | |||
21 | #define __NR_seccomp_read_32 4003 | ||
22 | #define __NR_seccomp_write_32 4004 | ||
23 | #define __NR_seccomp_exit_32 4001 | ||
24 | #define __NR_seccomp_sigreturn_32 4193 /* rt_sigreturn */ | ||
25 | |||
26 | #elif defined(CONFIG_MIPS32_N32) | ||
27 | |||
28 | #define TIF_32BIT _TIF_32BIT_ADDR | ||
29 | |||
30 | #define __NR_seccomp_read_32 6000 | ||
31 | #define __NR_seccomp_write_32 6001 | ||
32 | #define __NR_seccomp_exit_32 6058 | ||
33 | #define __NR_seccomp_sigreturn_32 6211 /* rt_sigreturn */ | ||
34 | |||
35 | #endif /* CONFIG_MIPS32_O32 */ | ||
36 | |||
37 | #endif /* __ASM_SECCOMP_H */ | ||
diff --git a/include/asm-mips/sections.h b/include/asm-mips/sections.h deleted file mode 100644 index b7e37262c246..000000000000 --- a/include/asm-mips/sections.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_SECTIONS_H | ||
2 | #define _ASM_SECTIONS_H | ||
3 | |||
4 | #include <asm-generic/sections.h> | ||
5 | |||
6 | #endif /* _ASM_SECTIONS_H */ | ||
diff --git a/include/asm-mips/segment.h b/include/asm-mips/segment.h deleted file mode 100644 index 92ac001fc483..000000000000 --- a/include/asm-mips/segment.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_SEGMENT_H | ||
2 | #define _ASM_SEGMENT_H | ||
3 | |||
4 | /* Only here because we have some old header files that expect it.. */ | ||
5 | |||
6 | #endif /* _ASM_SEGMENT_H */ | ||
diff --git a/include/asm-mips/sembuf.h b/include/asm-mips/sembuf.h deleted file mode 100644 index 7281a4decaa0..000000000000 --- a/include/asm-mips/sembuf.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | #ifndef _ASM_SEMBUF_H | ||
2 | #define _ASM_SEMBUF_H | ||
3 | |||
4 | /* | ||
5 | * The semid64_ds structure for the MIPS architecture. | ||
6 | * Note extra padding because this structure is passed back and forth | ||
7 | * between kernel and user space. | ||
8 | * | ||
9 | * Pad space is left for: | ||
10 | * - 2 miscellaneous 64-bit values | ||
11 | */ | ||
12 | |||
13 | struct semid64_ds { | ||
14 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ | ||
15 | __kernel_time_t sem_otime; /* last semop time */ | ||
16 | __kernel_time_t sem_ctime; /* last change time */ | ||
17 | unsigned long sem_nsems; /* no. of semaphores in array */ | ||
18 | unsigned long __unused1; | ||
19 | unsigned long __unused2; | ||
20 | }; | ||
21 | |||
22 | #endif /* _ASM_SEMBUF_H */ | ||
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h deleted file mode 100644 index c07ebd8eb9e7..000000000000 --- a/include/asm-mips/serial.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1999 by Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_SERIAL_H | ||
10 | #define _ASM_SERIAL_H | ||
11 | |||
12 | |||
13 | /* | ||
14 | * This assumes you have a 1.8432 MHz clock for your UART. | ||
15 | * | ||
16 | * It'd be nice if someone built a serial card with a 24.576 MHz | ||
17 | * clock, since the 16550A is capable of handling a top speed of 1.5 | ||
18 | * megabits/second; but this requires the faster clock. | ||
19 | */ | ||
20 | #define BASE_BAUD (1843200 / 16) | ||
21 | |||
22 | #endif /* _ASM_SERIAL_H */ | ||
diff --git a/include/asm-mips/setup.h b/include/asm-mips/setup.h deleted file mode 100644 index e600cedda976..000000000000 --- a/include/asm-mips/setup.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef _MIPS_SETUP_H | ||
2 | #define _MIPS_SETUP_H | ||
3 | |||
4 | #define COMMAND_LINE_SIZE 256 | ||
5 | |||
6 | #ifdef __KERNEL__ | ||
7 | extern void setup_early_printk(void); | ||
8 | #endif /* __KERNEL__ */ | ||
9 | |||
10 | #endif /* __SETUP_H */ | ||
diff --git a/include/asm-mips/sgi/gio.h b/include/asm-mips/sgi/gio.h deleted file mode 100644 index 889cf028c95d..000000000000 --- a/include/asm-mips/sgi/gio.h +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * gio.h: Definitions for SGI GIO bus | ||
7 | * | ||
8 | * Copyright (C) 2002 Ladislav Michl | ||
9 | */ | ||
10 | |||
11 | #ifndef _SGI_GIO_H | ||
12 | #define _SGI_GIO_H | ||
13 | |||
14 | /* | ||
15 | * GIO bus addresses | ||
16 | * | ||
17 | * The Indigo and Indy have two GIO bus connectors. Indigo2 (all models) have | ||
18 | * three physical connectors, but only two slots, GFX and EXP0. | ||
19 | * | ||
20 | * There is 10MB of GIO address space for GIO64 slot devices | ||
21 | * slot# slot type address range size | ||
22 | * ----- --------- ----------------------- ----- | ||
23 | * 0 GFX 0x1f000000 - 0x1f3fffff 4MB | ||
24 | * 1 EXP0 0x1f400000 - 0x1f5fffff 2MB | ||
25 | * 2 EXP1 0x1f600000 - 0x1f9fffff 4MB | ||
26 | * | ||
27 | * There are un-slotted devices, HPC, I/O and misc devices, which are grouped | ||
28 | * into the HPC address space. | ||
29 | * - MISC 0x1fb00000 - 0x1fbfffff 1MB | ||
30 | * | ||
31 | * Following space is reserved and unused | ||
32 | * - RESERVED 0x18000000 - 0x1effffff 112MB | ||
33 | * | ||
34 | * GIO bus IDs | ||
35 | * | ||
36 | * Each GIO bus device identifies itself to the system by answering a | ||
37 | * read with an "ID" value. IDs are either 8 or 32 bits long. IDs less | ||
38 | * than 128 are 8 bits long, with the most significant 24 bits read from | ||
39 | * the slot undefined. | ||
40 | * | ||
41 | * 32-bit IDs are divided into | ||
42 | * bits 0:6 the product ID; ranges from 0x00 to 0x7F. | ||
43 | * bit 7 0=GIO Product ID is 8 bits wide | ||
44 | * 1=GIO Product ID is 32 bits wide. | ||
45 | * bits 8:15 manufacturer version for the product. | ||
46 | * bit 16 0=GIO32 and GIO32-bis, 1=GIO64. | ||
47 | * bit 17 0=no ROM present | ||
48 | * 1=ROM present on this board AND next three words | ||
49 | * space define the ROM. | ||
50 | * bits 18:31 up to manufacturer. | ||
51 | * | ||
52 | * IDs above 0x50/0xd0 are of 3rd party boards. | ||
53 | * | ||
54 | * 8-bit IDs | ||
55 | * 0x01 XPI low cost FDDI | ||
56 | * 0x02 GTR TokenRing | ||
57 | * 0x04 Synchronous ISDN | ||
58 | * 0x05 ATM board [*] | ||
59 | * 0x06 Canon Interface | ||
60 | * 0x07 16 bit SCSI Card [*] | ||
61 | * 0x08 JPEG (Double Wide) | ||
62 | * 0x09 JPEG (Single Wide) | ||
63 | * 0x0a XPI mez. FDDI device 0 | ||
64 | * 0x0b XPI mez. FDDI device 1 | ||
65 | * 0x0c SMPTE 259M Video [*] | ||
66 | * 0x0d Babblefish Compression [*] | ||
67 | * 0x0e E-Plex 8-port Ethernet | ||
68 | * 0x30 Lyon Lamb IVAS | ||
69 | * 0xb8 GIO 100BaseTX Fast Ethernet (gfe) | ||
70 | * | ||
71 | * [*] Device provide 32-bit ID. | ||
72 | * | ||
73 | */ | ||
74 | |||
75 | #define GIO_ID(x) (x & 0x7f) | ||
76 | #define GIO_32BIT_ID 0x80 | ||
77 | #define GIO_REV(x) ((x >> 8) & 0xff) | ||
78 | #define GIO_64BIT_IFACE 0x10000 | ||
79 | #define GIO_ROM_PRESENT 0x20000 | ||
80 | #define GIO_VENDOR_CODE(x) ((x >> 18) & 0x3fff) | ||
81 | |||
82 | #define GIO_SLOT_GFX_BASE 0x1f000000 | ||
83 | #define GIO_SLOT_EXP0_BASE 0x1f400000 | ||
84 | #define GIO_SLOT_EXP1_BASE 0x1f600000 | ||
85 | |||
86 | #endif /* _SGI_GIO_H */ | ||
diff --git a/include/asm-mips/sgi/hpc3.h b/include/asm-mips/sgi/hpc3.h deleted file mode 100644 index c4729f531919..000000000000 --- a/include/asm-mips/sgi/hpc3.h +++ /dev/null | |||
@@ -1,317 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * hpc3.h: Definitions for SGI HPC3 controller | ||
7 | * | ||
8 | * Copyright (C) 1996 David S. Miller | ||
9 | * Copyright (C) 1998 Ralf Baechle | ||
10 | */ | ||
11 | |||
12 | #ifndef _SGI_HPC3_H | ||
13 | #define _SGI_HPC3_H | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | #include <asm/page.h> | ||
17 | |||
18 | /* An HPC DMA descriptor. */ | ||
19 | struct hpc_dma_desc { | ||
20 | u32 pbuf; /* physical address of data buffer */ | ||
21 | u32 cntinfo; /* counter and info bits */ | ||
22 | #define HPCDMA_EOX 0x80000000 /* last desc in chain for tx */ | ||
23 | #define HPCDMA_EOR 0x80000000 /* last desc in chain for rx */ | ||
24 | #define HPCDMA_EOXP 0x40000000 /* end of packet for tx */ | ||
25 | #define HPCDMA_EORP 0x40000000 /* end of packet for rx */ | ||
26 | #define HPCDMA_XIE 0x20000000 /* irq generated when at end of this desc */ | ||
27 | #define HPCDMA_XIU 0x01000000 /* Tx buffer in use by CPU. */ | ||
28 | #define HPCDMA_EIPC 0x00ff0000 /* SEEQ ethernet special xternal bytecount */ | ||
29 | #define HPCDMA_ETXD 0x00008000 /* set to one by HPC when packet tx'd */ | ||
30 | #define HPCDMA_OWN 0x00004000 /* Denotes ring buffer ownership on rx */ | ||
31 | #define HPCDMA_BCNT 0x00003fff /* size in bytes of this dma buffer */ | ||
32 | |||
33 | u32 pnext; /* paddr of next hpc_dma_desc if any */ | ||
34 | }; | ||
35 | |||
36 | /* The set of regs for each HPC3 PBUS DMA channel. */ | ||
37 | struct hpc3_pbus_dmacregs { | ||
38 | volatile u32 pbdma_bptr; /* pbus dma channel buffer ptr */ | ||
39 | volatile u32 pbdma_dptr; /* pbus dma channel desc ptr */ | ||
40 | u32 _unused0[0x1000/4 - 2]; /* padding */ | ||
41 | volatile u32 pbdma_ctrl; /* pbus dma channel control register has | ||
42 | * copletely different meaning for read | ||
43 | * compared with write */ | ||
44 | /* read */ | ||
45 | #define HPC3_PDMACTRL_INT 0x00000001 /* interrupt (cleared after read) */ | ||
46 | #define HPC3_PDMACTRL_ISACT 0x00000002 /* channel active */ | ||
47 | /* write */ | ||
48 | #define HPC3_PDMACTRL_SEL 0x00000002 /* little endian transfer */ | ||
49 | #define HPC3_PDMACTRL_RCV 0x00000004 /* direction is receive */ | ||
50 | #define HPC3_PDMACTRL_FLSH 0x00000008 /* enable flush for receive DMA */ | ||
51 | #define HPC3_PDMACTRL_ACT 0x00000010 /* start dma transfer */ | ||
52 | #define HPC3_PDMACTRL_LD 0x00000020 /* load enable for ACT */ | ||
53 | #define HPC3_PDMACTRL_RT 0x00000040 /* Use realtime GIO bus servicing */ | ||
54 | #define HPC3_PDMACTRL_HW 0x0000ff00 /* DMA High-water mark */ | ||
55 | #define HPC3_PDMACTRL_FB 0x003f0000 /* Ptr to beginning of fifo */ | ||
56 | #define HPC3_PDMACTRL_FE 0x3f000000 /* Ptr to end of fifo */ | ||
57 | |||
58 | u32 _unused1[0x1000/4 - 1]; /* padding */ | ||
59 | }; | ||
60 | |||
61 | /* The HPC3 SCSI registers, this does not include external ones. */ | ||
62 | struct hpc3_scsiregs { | ||
63 | volatile u32 cbptr; /* current dma buffer ptr, diagnostic use only */ | ||
64 | volatile u32 ndptr; /* next dma descriptor ptr */ | ||
65 | u32 _unused0[0x1000/4 - 2]; /* padding */ | ||
66 | volatile u32 bcd; /* byte count info */ | ||
67 | #define HPC3_SBCD_BCNTMSK 0x00003fff /* bytes to transfer from/to memory */ | ||
68 | #define HPC3_SBCD_XIE 0x00004000 /* Send IRQ when done with cur buf */ | ||
69 | #define HPC3_SBCD_EOX 0x00008000 /* Indicates this is last buf in chain */ | ||
70 | |||
71 | volatile u32 ctrl; /* control register */ | ||
72 | #define HPC3_SCTRL_IRQ 0x01 /* IRQ asserted, either dma done or parity */ | ||
73 | #define HPC3_SCTRL_ENDIAN 0x02 /* DMA endian mode, 0=big 1=little */ | ||
74 | #define HPC3_SCTRL_DIR 0x04 /* DMA direction, 1=dev2mem 0=mem2dev */ | ||
75 | #define HPC3_SCTRL_FLUSH 0x08 /* Tells HPC3 to flush scsi fifos */ | ||
76 | #define HPC3_SCTRL_ACTIVE 0x10 /* SCSI DMA channel is active */ | ||
77 | #define HPC3_SCTRL_AMASK 0x20 /* DMA active inhibits PIO */ | ||
78 | #define HPC3_SCTRL_CRESET 0x40 /* Resets dma channel and external controller */ | ||
79 | #define HPC3_SCTRL_PERR 0x80 /* Bad parity on HPC3 iface to scsi controller */ | ||
80 | |||
81 | volatile u32 gfptr; /* current GIO fifo ptr */ | ||
82 | volatile u32 dfptr; /* current device fifo ptr */ | ||
83 | volatile u32 dconfig; /* DMA configuration register */ | ||
84 | #define HPC3_SDCFG_HCLK 0x00001 /* Enable DMA half clock mode */ | ||
85 | #define HPC3_SDCFG_D1 0x00006 /* Cycles to spend in D1 state */ | ||
86 | #define HPC3_SDCFG_D2 0x00038 /* Cycles to spend in D2 state */ | ||
87 | #define HPC3_SDCFG_D3 0x001c0 /* Cycles to spend in D3 state */ | ||
88 | #define HPC3_SDCFG_HWAT 0x00e00 /* DMA high water mark */ | ||
89 | #define HPC3_SDCFG_HW 0x01000 /* Enable 16-bit halfword DMA accesses to scsi */ | ||
90 | #define HPC3_SDCFG_SWAP 0x02000 /* Byte swap all DMA accesses */ | ||
91 | #define HPC3_SDCFG_EPAR 0x04000 /* Enable parity checking for DMA */ | ||
92 | #define HPC3_SDCFG_POLL 0x08000 /* hd_dreq polarity control */ | ||
93 | #define HPC3_SDCFG_ERLY 0x30000 /* hd_dreq behavior control bits */ | ||
94 | |||
95 | volatile u32 pconfig; /* PIO configuration register */ | ||
96 | #define HPC3_SPCFG_P3 0x0003 /* Cycles to spend in P3 state */ | ||
97 | #define HPC3_SPCFG_P2W 0x001c /* Cycles to spend in P2 state for writes */ | ||
98 | #define HPC3_SPCFG_P2R 0x01e0 /* Cycles to spend in P2 state for reads */ | ||
99 | #define HPC3_SPCFG_P1 0x0e00 /* Cycles to spend in P1 state */ | ||
100 | #define HPC3_SPCFG_HW 0x1000 /* Enable 16-bit halfword PIO accesses to scsi */ | ||
101 | #define HPC3_SPCFG_SWAP 0x2000 /* Byte swap all PIO accesses */ | ||
102 | #define HPC3_SPCFG_EPAR 0x4000 /* Enable parity checking for PIO */ | ||
103 | #define HPC3_SPCFG_FUJI 0x8000 /* Fujitsu scsi controller mode for faster dma/pio */ | ||
104 | |||
105 | u32 _unused1[0x1000/4 - 6]; /* padding */ | ||
106 | }; | ||
107 | |||
108 | /* SEEQ ethernet HPC3 registers, only one seeq per HPC3. */ | ||
109 | struct hpc3_ethregs { | ||
110 | /* Receiver registers. */ | ||
111 | volatile u32 rx_cbptr; /* current dma buffer ptr, diagnostic use only */ | ||
112 | volatile u32 rx_ndptr; /* next dma descriptor ptr */ | ||
113 | u32 _unused0[0x1000/4 - 2]; /* padding */ | ||
114 | volatile u32 rx_bcd; /* byte count info */ | ||
115 | #define HPC3_ERXBCD_BCNTMSK 0x00003fff /* bytes to be sent to memory */ | ||
116 | #define HPC3_ERXBCD_XIE 0x20000000 /* HPC3 interrupts cpu at end of this buf */ | ||
117 | #define HPC3_ERXBCD_EOX 0x80000000 /* flags this as end of descriptor chain */ | ||
118 | |||
119 | volatile u32 rx_ctrl; /* control register */ | ||
120 | #define HPC3_ERXCTRL_STAT50 0x0000003f /* Receive status reg bits of Seeq8003 */ | ||
121 | #define HPC3_ERXCTRL_STAT6 0x00000040 /* Rdonly irq status */ | ||
122 | #define HPC3_ERXCTRL_STAT7 0x00000080 /* Rdonlt old/new status bit from Seeq */ | ||
123 | #define HPC3_ERXCTRL_ENDIAN 0x00000100 /* Endian for dma channel, little=1 big=0 */ | ||
124 | #define HPC3_ERXCTRL_ACTIVE 0x00000200 /* Tells if DMA transfer is in progress */ | ||
125 | #define HPC3_ERXCTRL_AMASK 0x00000400 /* Tells if ACTIVE inhibits PIO's to hpc3 */ | ||
126 | #define HPC3_ERXCTRL_RBO 0x00000800 /* Receive buffer overflow if set to 1 */ | ||
127 | |||
128 | volatile u32 rx_gfptr; /* current GIO fifo ptr */ | ||
129 | volatile u32 rx_dfptr; /* current device fifo ptr */ | ||
130 | u32 _unused1; /* padding */ | ||
131 | volatile u32 reset; /* reset register */ | ||
132 | #define HPC3_ERST_CRESET 0x1 /* Reset dma channel and external controller */ | ||
133 | #define HPC3_ERST_CLRIRQ 0x2 /* Clear channel interrupt */ | ||
134 | #define HPC3_ERST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */ | ||
135 | |||
136 | volatile u32 dconfig; /* DMA configuration register */ | ||
137 | #define HPC3_EDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */ | ||
138 | #define HPC3_EDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */ | ||
139 | #define HPC3_EDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */ | ||
140 | #define HPC3_EDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */ | ||
141 | #define HPC3_EDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */ | ||
142 | #define HPC3_EDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */ | ||
143 | #define HPC3_EDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */ | ||
144 | #define HPC3_EDCFG_PTO 0x30000 /* Programmed timeout value for above two */ | ||
145 | |||
146 | volatile u32 pconfig; /* PIO configuration register */ | ||
147 | #define HPC3_EPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */ | ||
148 | #define HPC3_EPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */ | ||
149 | #define HPC3_EPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */ | ||
150 | #define HPC3_EPCFG_TST 0x1000 /* Diagnistic ram test feature bit */ | ||
151 | |||
152 | u32 _unused2[0x1000/4 - 8]; /* padding */ | ||
153 | |||
154 | /* Transmitter registers. */ | ||
155 | volatile u32 tx_cbptr; /* current dma buffer ptr, diagnostic use only */ | ||
156 | volatile u32 tx_ndptr; /* next dma descriptor ptr */ | ||
157 | u32 _unused3[0x1000/4 - 2]; /* padding */ | ||
158 | volatile u32 tx_bcd; /* byte count info */ | ||
159 | #define HPC3_ETXBCD_BCNTMSK 0x00003fff /* bytes to be read from memory */ | ||
160 | #define HPC3_ETXBCD_ESAMP 0x10000000 /* if set, too late to add descriptor */ | ||
161 | #define HPC3_ETXBCD_XIE 0x20000000 /* Interrupt cpu at end of cur desc */ | ||
162 | #define HPC3_ETXBCD_EOP 0x40000000 /* Last byte of cur buf is end of packet */ | ||
163 | #define HPC3_ETXBCD_EOX 0x80000000 /* This buf is the end of desc chain */ | ||
164 | |||
165 | volatile u32 tx_ctrl; /* control register */ | ||
166 | #define HPC3_ETXCTRL_STAT30 0x0000000f /* Rdonly copy of seeq tx stat reg */ | ||
167 | #define HPC3_ETXCTRL_STAT4 0x00000010 /* Indicate late collision occurred */ | ||
168 | #define HPC3_ETXCTRL_STAT75 0x000000e0 /* Rdonly irq status from seeq */ | ||
169 | #define HPC3_ETXCTRL_ENDIAN 0x00000100 /* DMA channel endian mode, 1=little 0=big */ | ||
170 | #define HPC3_ETXCTRL_ACTIVE 0x00000200 /* DMA tx channel is active */ | ||
171 | #define HPC3_ETXCTRL_AMASK 0x00000400 /* Indicates ACTIVE inhibits PIO's */ | ||
172 | |||
173 | volatile u32 tx_gfptr; /* current GIO fifo ptr */ | ||
174 | volatile u32 tx_dfptr; /* current device fifo ptr */ | ||
175 | u32 _unused4[0x1000/4 - 4]; /* padding */ | ||
176 | }; | ||
177 | |||
178 | struct hpc3_regs { | ||
179 | /* First regs for the PBUS 8 dma channels. */ | ||
180 | struct hpc3_pbus_dmacregs pbdma[8]; | ||
181 | |||
182 | /* Now the HPC scsi registers, we get two scsi reg sets. */ | ||
183 | struct hpc3_scsiregs scsi_chan0, scsi_chan1; | ||
184 | |||
185 | /* The SEEQ hpc3 ethernet dma/control registers. */ | ||
186 | struct hpc3_ethregs ethregs; | ||
187 | |||
188 | /* Here are where the hpc3 fifo's can be directly accessed | ||
189 | * via PIO accesses. Under normal operation we never stick | ||
190 | * our grubby paws in here so it's just padding. */ | ||
191 | u32 _unused0[0x18000/4]; | ||
192 | |||
193 | /* HPC3 irq status regs. Due to a peculiar bug you need to | ||
194 | * look at two different register addresses to get at all of | ||
195 | * the status bits. The first reg can only reliably report | ||
196 | * bits 4:0 of the status, and the second reg can only | ||
197 | * reliably report bits 9:5 of the hpc3 irq status. I told | ||
198 | * you it was a peculiar bug. ;-) | ||
199 | */ | ||
200 | volatile u32 istat0; /* Irq status, only bits <4:0> reliable. */ | ||
201 | #define HPC3_ISTAT_PBIMASK 0x0ff /* irq bits for pbus devs 0 --> 7 */ | ||
202 | #define HPC3_ISTAT_SC0MASK 0x100 /* irq bit for scsi channel 0 */ | ||
203 | #define HPC3_ISTAT_SC1MASK 0x200 /* irq bit for scsi channel 1 */ | ||
204 | |||
205 | volatile u32 gio_misc; /* GIO misc control bits. */ | ||
206 | #define HPC3_GIOMISC_ERTIME 0x1 /* Enable external timer real time. */ | ||
207 | #define HPC3_GIOMISC_DENDIAN 0x2 /* dma descriptor endian, 1=lit 0=big */ | ||
208 | |||
209 | u32 eeprom; /* EEPROM data reg. */ | ||
210 | #define HPC3_EEPROM_EPROT 0x01 /* Protect register enable */ | ||
211 | #define HPC3_EEPROM_CSEL 0x02 /* Chip select */ | ||
212 | #define HPC3_EEPROM_ECLK 0x04 /* EEPROM clock */ | ||
213 | #define HPC3_EEPROM_DATO 0x08 /* Data out */ | ||
214 | #define HPC3_EEPROM_DATI 0x10 /* Data in */ | ||
215 | |||
216 | volatile u32 istat1; /* Irq status, only bits <9:5> reliable. */ | ||
217 | volatile u32 bestat; /* Bus error interrupt status reg. */ | ||
218 | #define HPC3_BESTAT_BLMASK 0x000ff /* Bus lane where bad parity occurred */ | ||
219 | #define HPC3_BESTAT_CTYPE 0x00100 /* Bus cycle type, 0=PIO 1=DMA */ | ||
220 | #define HPC3_BESTAT_PIDSHIFT 9 | ||
221 | #define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */ | ||
222 | |||
223 | u32 _unused1[0x14000/4 - 5]; /* padding */ | ||
224 | |||
225 | /* Now direct PIO per-HPC3 peripheral access to external regs. */ | ||
226 | volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */ | ||
227 | u32 _unused2[0x7c00/4]; | ||
228 | volatile u32 scsi1_ext[256]; /* SCSI channel 1 external regs */ | ||
229 | u32 _unused3[0x7c00/4]; | ||
230 | volatile u32 eth_ext[320]; /* Ethernet external registers */ | ||
231 | u32 _unused4[0x3b00/4]; | ||
232 | |||
233 | /* Per-peripheral device external registers and DMA/PIO control. */ | ||
234 | volatile u32 pbus_extregs[16][256]; | ||
235 | volatile u32 pbus_dmacfg[8][128]; | ||
236 | /* Cycles to spend in D3 for reads */ | ||
237 | #define HPC3_DMACFG_D3R_MASK 0x00000001 | ||
238 | #define HPC3_DMACFG_D3R_SHIFT 0 | ||
239 | /* Cycles to spend in D4 for reads */ | ||
240 | #define HPC3_DMACFG_D4R_MASK 0x0000001e | ||
241 | #define HPC3_DMACFG_D4R_SHIFT 1 | ||
242 | /* Cycles to spend in D5 for reads */ | ||
243 | #define HPC3_DMACFG_D5R_MASK 0x000001e0 | ||
244 | #define HPC3_DMACFG_D5R_SHIFT 5 | ||
245 | /* Cycles to spend in D3 for writes */ | ||
246 | #define HPC3_DMACFG_D3W_MASK 0x00000200 | ||
247 | #define HPC3_DMACFG_D3W_SHIFT 9 | ||
248 | /* Cycles to spend in D4 for writes */ | ||
249 | #define HPC3_DMACFG_D4W_MASK 0x00003c00 | ||
250 | #define HPC3_DMACFG_D4W_SHIFT 10 | ||
251 | /* Cycles to spend in D5 for writes */ | ||
252 | #define HPC3_DMACFG_D5W_MASK 0x0003c000 | ||
253 | #define HPC3_DMACFG_D5W_SHIFT 14 | ||
254 | /* Enable 16-bit DMA access mode */ | ||
255 | #define HPC3_DMACFG_DS16 0x00040000 | ||
256 | /* Places halfwords on high 16 bits of bus */ | ||
257 | #define HPC3_DMACFG_EVENHI 0x00080000 | ||
258 | /* Make this device real time */ | ||
259 | #define HPC3_DMACFG_RTIME 0x00200000 | ||
260 | /* 5 bit burst count for DMA device */ | ||
261 | #define HPC3_DMACFG_BURST_MASK 0x07c00000 | ||
262 | #define HPC3_DMACFG_BURST_SHIFT 22 | ||
263 | /* Use live pbus_dreq unsynchronized signal */ | ||
264 | #define HPC3_DMACFG_DRQLIVE 0x08000000 | ||
265 | volatile u32 pbus_piocfg[16][64]; | ||
266 | /* Cycles to spend in P2 state for reads */ | ||
267 | #define HPC3_PIOCFG_P2R_MASK 0x00001 | ||
268 | #define HPC3_PIOCFG_P2R_SHIFT 0 | ||
269 | /* Cycles to spend in P3 state for reads */ | ||
270 | #define HPC3_PIOCFG_P3R_MASK 0x0001e | ||
271 | #define HPC3_PIOCFG_P3R_SHIFT 1 | ||
272 | /* Cycles to spend in P4 state for reads */ | ||
273 | #define HPC3_PIOCFG_P4R_MASK 0x001e0 | ||
274 | #define HPC3_PIOCFG_P4R_SHIFT 5 | ||
275 | /* Cycles to spend in P2 state for writes */ | ||
276 | #define HPC3_PIOCFG_P2W_MASK 0x00200 | ||
277 | #define HPC3_PIOCFG_P2W_SHIFT 9 | ||
278 | /* Cycles to spend in P3 state for writes */ | ||
279 | #define HPC3_PIOCFG_P3W_MASK 0x03c00 | ||
280 | #define HPC3_PIOCFG_P3W_SHIFT 10 | ||
281 | /* Cycles to spend in P4 state for writes */ | ||
282 | #define HPC3_PIOCFG_P4W_MASK 0x3c000 | ||
283 | #define HPC3_PIOCFG_P4W_SHIFT 14 | ||
284 | /* Enable 16-bit PIO accesses */ | ||
285 | #define HPC3_PIOCFG_DS16 0x40000 | ||
286 | /* Place even address bits in bits <15:8> */ | ||
287 | #define HPC3_PIOCFG_EVENHI 0x80000 | ||
288 | |||
289 | /* PBUS PROM control regs. */ | ||
290 | volatile u32 pbus_promwe; /* PROM write enable register */ | ||
291 | #define HPC3_PROM_WENAB 0x1 /* Enable writes to the PROM */ | ||
292 | |||
293 | u32 _unused5[0x0800/4 - 1]; | ||
294 | volatile u32 pbus_promswap; /* Chip select swap reg */ | ||
295 | #define HPC3_PROM_SWAP 0x1 /* invert GIO addr bit to select prom0 or prom1 */ | ||
296 | |||
297 | u32 _unused6[0x0800/4 - 1]; | ||
298 | volatile u32 pbus_gout; /* PROM general purpose output reg */ | ||
299 | #define HPC3_PROM_STAT 0x1 /* General purpose status bit in gout */ | ||
300 | |||
301 | u32 _unused7[0x1000/4 - 1]; | ||
302 | volatile u32 rtcregs[14]; /* Dallas clock registers */ | ||
303 | u32 _unused8[50]; | ||
304 | volatile u32 bbram[8192-50-14]; /* Battery backed ram */ | ||
305 | }; | ||
306 | |||
307 | /* | ||
308 | * It is possible to have two HPC3's within the address space on | ||
309 | * one machine, though only having one is more likely on an Indy. | ||
310 | */ | ||
311 | extern struct hpc3_regs *hpc3c0, *hpc3c1; | ||
312 | #define HPC3_CHIP0_BASE 0x1fb80000 /* physical */ | ||
313 | #define HPC3_CHIP1_BASE 0x1fb00000 /* physical */ | ||
314 | |||
315 | extern void sgihpc_init(void); | ||
316 | |||
317 | #endif /* _SGI_HPC3_H */ | ||
diff --git a/include/asm-mips/sgi/ioc.h b/include/asm-mips/sgi/ioc.h deleted file mode 100644 index 343ed15f8dc4..000000000000 --- a/include/asm-mips/sgi/ioc.h +++ /dev/null | |||
@@ -1,200 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * ioc.h: Definitions for SGI I/O Controller | ||
7 | * | ||
8 | * Copyright (C) 1996 David S. Miller | ||
9 | * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle | ||
10 | * Copyright (C) 2001, 2003 Ladislav Michl | ||
11 | */ | ||
12 | |||
13 | #ifndef _SGI_IOC_H | ||
14 | #define _SGI_IOC_H | ||
15 | |||
16 | #include <linux/types.h> | ||
17 | #include <asm/sgi/pi1.h> | ||
18 | |||
19 | /* | ||
20 | * All registers are 8-bit wide alligned on 32-bit boundary. Bad things | ||
21 | * happen if you try word access them. You have been warned. | ||
22 | */ | ||
23 | |||
24 | struct sgioc_uart_regs { | ||
25 | u8 _ctrl1[3]; | ||
26 | volatile u8 ctrl1; | ||
27 | u8 _data1[3]; | ||
28 | volatile u8 data1; | ||
29 | u8 _ctrl2[3]; | ||
30 | volatile u8 ctrl2; | ||
31 | u8 _data2[3]; | ||
32 | volatile u8 data2; | ||
33 | }; | ||
34 | |||
35 | struct sgioc_keyb_regs { | ||
36 | u8 _data[3]; | ||
37 | volatile u8 data; | ||
38 | u8 _command[3]; | ||
39 | volatile u8 command; | ||
40 | }; | ||
41 | |||
42 | struct sgint_regs { | ||
43 | u8 _istat0[3]; | ||
44 | volatile u8 istat0; /* Interrupt status zero */ | ||
45 | #define SGINT_ISTAT0_FFULL 0x01 | ||
46 | #define SGINT_ISTAT0_SCSI0 0x02 | ||
47 | #define SGINT_ISTAT0_SCSI1 0x04 | ||
48 | #define SGINT_ISTAT0_ENET 0x08 | ||
49 | #define SGINT_ISTAT0_GFXDMA 0x10 | ||
50 | #define SGINT_ISTAT0_PPORT 0x20 | ||
51 | #define SGINT_ISTAT0_HPC2 0x40 | ||
52 | #define SGINT_ISTAT0_LIO2 0x80 | ||
53 | u8 _imask0[3]; | ||
54 | volatile u8 imask0; /* Interrupt mask zero */ | ||
55 | u8 _istat1[3]; | ||
56 | volatile u8 istat1; /* Interrupt status one */ | ||
57 | #define SGINT_ISTAT1_ISDNI 0x01 | ||
58 | #define SGINT_ISTAT1_PWR 0x02 | ||
59 | #define SGINT_ISTAT1_ISDNH 0x04 | ||
60 | #define SGINT_ISTAT1_LIO3 0x08 | ||
61 | #define SGINT_ISTAT1_HPC3 0x10 | ||
62 | #define SGINT_ISTAT1_AFAIL 0x20 | ||
63 | #define SGINT_ISTAT1_VIDEO 0x40 | ||
64 | #define SGINT_ISTAT1_GIO2 0x80 | ||
65 | u8 _imask1[3]; | ||
66 | volatile u8 imask1; /* Interrupt mask one */ | ||
67 | u8 _vmeistat[3]; | ||
68 | volatile u8 vmeistat; /* VME interrupt status */ | ||
69 | u8 _cmeimask0[3]; | ||
70 | volatile u8 cmeimask0; /* VME interrupt mask zero */ | ||
71 | u8 _cmeimask1[3]; | ||
72 | volatile u8 cmeimask1; /* VME interrupt mask one */ | ||
73 | u8 _cmepol[3]; | ||
74 | volatile u8 cmepol; /* VME polarity */ | ||
75 | u8 _tclear[3]; | ||
76 | volatile u8 tclear; | ||
77 | u8 _errstat[3]; | ||
78 | volatile u8 errstat; /* Error status reg, reserved on INT2 */ | ||
79 | u32 _unused0[2]; | ||
80 | u8 _tcnt0[3]; | ||
81 | volatile u8 tcnt0; /* counter 0 */ | ||
82 | u8 _tcnt1[3]; | ||
83 | volatile u8 tcnt1; /* counter 1 */ | ||
84 | u8 _tcnt2[3]; | ||
85 | volatile u8 tcnt2; /* counter 2 */ | ||
86 | u8 _tcword[3]; | ||
87 | volatile u8 tcword; /* control word */ | ||
88 | #define SGINT_TCWORD_BCD 0x01 /* Use BCD mode for counters */ | ||
89 | #define SGINT_TCWORD_MMASK 0x0e /* Mode bitmask. */ | ||
90 | #define SGINT_TCWORD_MITC 0x00 /* IRQ on terminal count (doesn't work) */ | ||
91 | #define SGINT_TCWORD_MOS 0x02 /* One-shot IRQ mode. */ | ||
92 | #define SGINT_TCWORD_MRGEN 0x04 /* Normal rate generation */ | ||
93 | #define SGINT_TCWORD_MSWGEN 0x06 /* Square wave generator mode */ | ||
94 | #define SGINT_TCWORD_MSWST 0x08 /* Software strobe */ | ||
95 | #define SGINT_TCWORD_MHWST 0x0a /* Hardware strobe */ | ||
96 | #define SGINT_TCWORD_CMASK 0x30 /* Command mask */ | ||
97 | #define SGINT_TCWORD_CLAT 0x00 /* Latch command */ | ||
98 | #define SGINT_TCWORD_CLSB 0x10 /* LSB read/write */ | ||
99 | #define SGINT_TCWORD_CMSB 0x20 /* MSB read/write */ | ||
100 | #define SGINT_TCWORD_CALL 0x30 /* Full counter read/write */ | ||
101 | #define SGINT_TCWORD_CNT0 0x00 /* Select counter zero */ | ||
102 | #define SGINT_TCWORD_CNT1 0x40 /* Select counter one */ | ||
103 | #define SGINT_TCWORD_CNT2 0x80 /* Select counter two */ | ||
104 | #define SGINT_TCWORD_CRBCK 0xc0 /* Readback command */ | ||
105 | }; | ||
106 | |||
107 | /* | ||
108 | * The timer is the good old 8254. Unlike in PCs it's clocked at exactly 1MHz | ||
109 | */ | ||
110 | #define SGINT_TIMER_CLOCK 1000000 | ||
111 | |||
112 | /* | ||
113 | * This is the constant we're using for calibrating the counter. | ||
114 | */ | ||
115 | #define SGINT_TCSAMP_COUNTER ((SGINT_TIMER_CLOCK / HZ) + 255) | ||
116 | |||
117 | /* We need software copies of these because they are write only. */ | ||
118 | extern u8 sgi_ioc_reset, sgi_ioc_write; | ||
119 | |||
120 | struct sgioc_regs { | ||
121 | struct pi1_regs pport; | ||
122 | u32 _unused0[2]; | ||
123 | struct sgioc_uart_regs uart; | ||
124 | struct sgioc_keyb_regs kbdmouse; | ||
125 | u8 _gcsel[3]; | ||
126 | volatile u8 gcsel; | ||
127 | u8 _genctrl[3]; | ||
128 | volatile u8 genctrl; | ||
129 | u8 _panel[3]; | ||
130 | volatile u8 panel; | ||
131 | #define SGIOC_PANEL_POWERON 0x01 | ||
132 | #define SGIOC_PANEL_POWERINTR 0x02 | ||
133 | #define SGIOC_PANEL_VOLDNINTR 0x10 | ||
134 | #define SGIOC_PANEL_VOLDNHOLD 0x20 | ||
135 | #define SGIOC_PANEL_VOLUPINTR 0x40 | ||
136 | #define SGIOC_PANEL_VOLUPHOLD 0x80 | ||
137 | u32 _unused1; | ||
138 | u8 _sysid[3]; | ||
139 | volatile u8 sysid; | ||
140 | #define SGIOC_SYSID_FULLHOUSE 0x01 | ||
141 | #define SGIOC_SYSID_BOARDREV(x) (((x) & 0x1e) >> 1) | ||
142 | #define SGIOC_SYSID_CHIPREV(x) (((x) & 0xe0) >> 5) | ||
143 | u32 _unused2; | ||
144 | u8 _read[3]; | ||
145 | volatile u8 read; | ||
146 | u32 _unused3; | ||
147 | u8 _dmasel[3]; | ||
148 | volatile u8 dmasel; | ||
149 | #define SGIOC_DMASEL_SCLK10MHZ 0x00 /* use 10MHZ serial clock */ | ||
150 | #define SGIOC_DMASEL_ISDNB 0x01 /* enable isdn B */ | ||
151 | #define SGIOC_DMASEL_ISDNA 0x02 /* enable isdn A */ | ||
152 | #define SGIOC_DMASEL_PPORT 0x04 /* use parallel DMA */ | ||
153 | #define SGIOC_DMASEL_SCLK667MHZ 0x10 /* use 6.67MHZ serial clock */ | ||
154 | #define SGIOC_DMASEL_SCLKEXT 0x20 /* use external serial clock */ | ||
155 | u32 _unused4; | ||
156 | u8 _reset[3]; | ||
157 | volatile u8 reset; | ||
158 | #define SGIOC_RESET_PPORT 0x01 /* 0=parport reset, 1=nornal */ | ||
159 | #define SGIOC_RESET_KBDMOUSE 0x02 /* 0=kbdmouse reset, 1=normal */ | ||
160 | #define SGIOC_RESET_EISA 0x04 /* 0=eisa reset, 1=normal */ | ||
161 | #define SGIOC_RESET_ISDN 0x08 /* 0=isdn reset, 1=normal */ | ||
162 | #define SGIOC_RESET_LC0OFF 0x10 /* guiness: turn led off (red, else green) */ | ||
163 | #define SGIOC_RESET_LC1OFF 0x20 /* guiness: turn led off (green, else amber) */ | ||
164 | u32 _unused5; | ||
165 | u8 _write[3]; | ||
166 | volatile u8 write; | ||
167 | #define SGIOC_WRITE_NTHRESH 0x01 /* use 4.5db threshhold */ | ||
168 | #define SGIOC_WRITE_TPSPEED 0x02 /* use 100ohm TP speed */ | ||
169 | #define SGIOC_WRITE_EPSEL 0x04 /* force cable mode: 1=AUI 0=TP */ | ||
170 | #define SGIOC_WRITE_EASEL 0x08 /* 1=autoselect 0=manual cable selection */ | ||
171 | #define SGIOC_WRITE_U1AMODE 0x10 /* 1=PC 0=MAC UART mode */ | ||
172 | #define SGIOC_WRITE_U0AMODE 0x20 /* 1=PC 0=MAC UART mode */ | ||
173 | #define SGIOC_WRITE_MLO 0x40 /* 1=4.75V 0=+5V */ | ||
174 | #define SGIOC_WRITE_MHI 0x80 /* 1=5.25V 0=+5V */ | ||
175 | u32 _unused6; | ||
176 | struct sgint_regs int3; | ||
177 | u32 _unused7[16]; | ||
178 | volatile u32 extio; /* FullHouse only */ | ||
179 | #define EXTIO_S0_IRQ_3 0x8000 /* S0: vid.vsync */ | ||
180 | #define EXTIO_S0_IRQ_2 0x4000 /* S0: gfx.fifofull */ | ||
181 | #define EXTIO_S0_IRQ_1 0x2000 /* S0: gfx.int */ | ||
182 | #define EXTIO_S0_RETRACE 0x1000 | ||
183 | #define EXTIO_SG_IRQ_3 0x0800 /* SG: vid.vsync */ | ||
184 | #define EXTIO_SG_IRQ_2 0x0400 /* SG: gfx.fifofull */ | ||
185 | #define EXTIO_SG_IRQ_1 0x0200 /* SG: gfx.int */ | ||
186 | #define EXTIO_SG_RETRACE 0x0100 | ||
187 | #define EXTIO_GIO_33MHZ 0x0080 | ||
188 | #define EXTIO_EISA_BUSERR 0x0040 | ||
189 | #define EXTIO_MC_BUSERR 0x0020 | ||
190 | #define EXTIO_HPC3_BUSERR 0x0010 | ||
191 | #define EXTIO_S0_STAT_1 0x0008 | ||
192 | #define EXTIO_S0_STAT_0 0x0004 | ||
193 | #define EXTIO_SG_STAT_1 0x0002 | ||
194 | #define EXTIO_SG_STAT_0 0x0001 | ||
195 | }; | ||
196 | |||
197 | extern struct sgioc_regs *sgioc; | ||
198 | extern struct sgint_regs *sgint; | ||
199 | |||
200 | #endif | ||
diff --git a/include/asm-mips/sgi/ip22.h b/include/asm-mips/sgi/ip22.h deleted file mode 100644 index c0501f91719b..000000000000 --- a/include/asm-mips/sgi/ip22.h +++ /dev/null | |||
@@ -1,78 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * ip22.h: Definitions for SGI IP22 machines | ||
7 | * | ||
8 | * Copyright (C) 1996 David S. Miller | ||
9 | * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle | ||
10 | */ | ||
11 | |||
12 | #ifndef _SGI_IP22_H | ||
13 | #define _SGI_IP22_H | ||
14 | |||
15 | /* | ||
16 | * These are the virtual IRQ numbers, we divide all IRQ's into | ||
17 | * 'spaces', the 'space' determines where and how to enable/disable | ||
18 | * that particular IRQ on an SGI machine. HPC DMA and MC DMA interrupts | ||
19 | * are not supported this way. Driver is supposed to allocate HPC/MC | ||
20 | * interrupt as shareable and then look to proper status bit (see | ||
21 | * HAL2 driver). This will prevent many complications, trust me ;-) | ||
22 | */ | ||
23 | |||
24 | #include <irq.h> | ||
25 | #include <asm/sgi/ioc.h> | ||
26 | |||
27 | #define SGINT_EISA 0 /* 16 EISA irq levels (Indigo2) */ | ||
28 | #define SGINT_CPU MIPS_CPU_IRQ_BASE /* MIPS CPU define 8 interrupt sources */ | ||
29 | #define SGINT_LOCAL0 (SGINT_CPU+8) /* 8 local0 irq levels */ | ||
30 | #define SGINT_LOCAL1 (SGINT_CPU+16) /* 8 local1 irq levels */ | ||
31 | #define SGINT_LOCAL2 (SGINT_CPU+24) /* 8 local2 vectored irq levels */ | ||
32 | #define SGINT_LOCAL3 (SGINT_CPU+32) /* 8 local3 vectored irq levels */ | ||
33 | #define SGINT_END (SGINT_CPU+40) /* End of 'spaces' */ | ||
34 | |||
35 | /* | ||
36 | * Individual interrupt definitions for the Indy and Indigo2 | ||
37 | */ | ||
38 | |||
39 | #define SGI_SOFT_0_IRQ SGINT_CPU + 0 | ||
40 | #define SGI_SOFT_1_IRQ SGINT_CPU + 1 | ||
41 | #define SGI_LOCAL_0_IRQ SGINT_CPU + 2 | ||
42 | #define SGI_LOCAL_1_IRQ SGINT_CPU + 3 | ||
43 | #define SGI_8254_0_IRQ SGINT_CPU + 4 | ||
44 | #define SGI_8254_1_IRQ SGINT_CPU + 5 | ||
45 | #define SGI_BUSERR_IRQ SGINT_CPU + 6 | ||
46 | #define SGI_TIMER_IRQ SGINT_CPU + 7 | ||
47 | |||
48 | #define SGI_FIFO_IRQ SGINT_LOCAL0 + 0 /* FIFO full */ | ||
49 | #define SGI_GIO_0_IRQ SGI_FIFO_IRQ /* GIO-0 */ | ||
50 | #define SGI_WD93_0_IRQ SGINT_LOCAL0 + 1 /* 1st onboard WD93 */ | ||
51 | #define SGI_WD93_1_IRQ SGINT_LOCAL0 + 2 /* 2nd onboard WD93 */ | ||
52 | #define SGI_ENET_IRQ SGINT_LOCAL0 + 3 /* onboard ethernet */ | ||
53 | #define SGI_MCDMA_IRQ SGINT_LOCAL0 + 4 /* MC DMA done */ | ||
54 | #define SGI_PARPORT_IRQ SGINT_LOCAL0 + 5 /* Parallel port */ | ||
55 | #define SGI_GIO_1_IRQ SGINT_LOCAL0 + 6 /* GE / GIO-1 / 2nd-HPC */ | ||
56 | #define SGI_MAP_0_IRQ SGINT_LOCAL0 + 7 /* Mappable interrupt 0 */ | ||
57 | |||
58 | #define SGI_GPL0_IRQ SGINT_LOCAL1 + 0 /* General Purpose LOCAL1_N<0> */ | ||
59 | #define SGI_PANEL_IRQ SGINT_LOCAL1 + 1 /* front panel */ | ||
60 | #define SGI_GPL2_IRQ SGINT_LOCAL1 + 2 /* General Purpose LOCAL1_N<2> */ | ||
61 | #define SGI_MAP_1_IRQ SGINT_LOCAL1 + 3 /* Mappable interrupt 1 */ | ||
62 | #define SGI_HPCDMA_IRQ SGINT_LOCAL1 + 4 /* HPC DMA done */ | ||
63 | #define SGI_ACFAIL_IRQ SGINT_LOCAL1 + 5 /* AC fail */ | ||
64 | #define SGI_VINO_IRQ SGINT_LOCAL1 + 6 /* Indy VINO */ | ||
65 | #define SGI_GIO_2_IRQ SGINT_LOCAL1 + 7 /* Vert retrace / GIO-2 */ | ||
66 | |||
67 | /* Mapped interrupts. These interrupts may be mapped to either 0, or 1 */ | ||
68 | #define SGI_VERT_IRQ SGINT_LOCAL2 + 0 /* INT3: newport vertical status */ | ||
69 | #define SGI_EISA_IRQ SGINT_LOCAL2 + 3 /* EISA interrupts */ | ||
70 | #define SGI_KEYBD_IRQ SGINT_LOCAL2 + 4 /* keyboard */ | ||
71 | #define SGI_SERIAL_IRQ SGINT_LOCAL2 + 5 /* onboard serial */ | ||
72 | |||
73 | #define ip22_is_fullhouse() (sgioc->sysid & SGIOC_SYSID_FULLHOUSE) | ||
74 | |||
75 | extern unsigned short ip22_eeprom_read(unsigned int *ctrl, int reg); | ||
76 | extern unsigned short ip22_nvram_read(int reg); | ||
77 | |||
78 | #endif | ||
diff --git a/include/asm-mips/sgi/mc.h b/include/asm-mips/sgi/mc.h deleted file mode 100644 index 1576c2394de8..000000000000 --- a/include/asm-mips/sgi/mc.h +++ /dev/null | |||
@@ -1,231 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * mc.h: Definitions for SGI Memory Controller | ||
7 | * | ||
8 | * Copyright (C) 1996 David S. Miller | ||
9 | * Copyright (C) 1999 Ralf Baechle | ||
10 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _SGI_MC_H | ||
14 | #define _SGI_MC_H | ||
15 | |||
16 | struct sgimc_regs { | ||
17 | u32 _unused0; | ||
18 | volatile u32 cpuctrl0; /* CPU control register 0, readwrite */ | ||
19 | #define SGIMC_CCTRL0_REFS 0x0000000f /* REFS mask */ | ||
20 | #define SGIMC_CCTRL0_EREFRESH 0x00000010 /* Memory refresh enable */ | ||
21 | #define SGIMC_CCTRL0_EPERRGIO 0x00000020 /* GIO parity error enable */ | ||
22 | #define SGIMC_CCTRL0_EPERRMEM 0x00000040 /* Main mem parity error enable */ | ||
23 | #define SGIMC_CCTRL0_EPERRCPU 0x00000080 /* CPU bus parity error enable */ | ||
24 | #define SGIMC_CCTRL0_WDOG 0x00000100 /* Watchdog timer enable */ | ||
25 | #define SGIMC_CCTRL0_SYSINIT 0x00000200 /* System init bit */ | ||
26 | #define SGIMC_CCTRL0_GFXRESET 0x00000400 /* Graphics interface reset */ | ||
27 | #define SGIMC_CCTRL0_EISALOCK 0x00000800 /* Lock CPU from memory for EISA */ | ||
28 | #define SGIMC_CCTRL0_EPERRSCMD 0x00001000 /* SysCMD bus parity error enable */ | ||
29 | #define SGIMC_CCTRL0_IENAB 0x00002000 /* Allow interrupts from MC */ | ||
30 | #define SGIMC_CCTRL0_ESNOOP 0x00004000 /* Snooping I/O enable */ | ||
31 | #define SGIMC_CCTRL0_EPROMWR 0x00008000 /* Prom writes from cpu enable */ | ||
32 | #define SGIMC_CCTRL0_WRESETPMEM 0x00010000 /* Perform warm reset, preserves mem */ | ||
33 | #define SGIMC_CCTRL0_LENDIAN 0x00020000 /* Put MC in little-endian mode */ | ||
34 | #define SGIMC_CCTRL0_WRESETDMEM 0x00040000 /* Warm reset, destroys mem contents */ | ||
35 | #define SGIMC_CCTRL0_CMEMBADPAR 0x02000000 /* Generate bad perr from cpu to mem */ | ||
36 | #define SGIMC_CCTRL0_R4KNOCHKPARR 0x04000000 /* Don't chk parity on mem data reads */ | ||
37 | #define SGIMC_CCTRL0_GIOBTOB 0x08000000 /* Allow GIO back to back writes */ | ||
38 | u32 _unused1; | ||
39 | volatile u32 cpuctrl1; /* CPU control register 1, readwrite */ | ||
40 | #define SGIMC_CCTRL1_EGIOTIMEO 0x00000010 /* GIO bus timeout enable */ | ||
41 | #define SGIMC_CCTRL1_FIXEDEHPC 0x00001000 /* Fixed HPC endianness */ | ||
42 | #define SGIMC_CCTRL1_LITTLEHPC 0x00002000 /* Little endian HPC */ | ||
43 | #define SGIMC_CCTRL1_FIXEDEEXP0 0x00004000 /* Fixed EXP0 endianness */ | ||
44 | #define SGIMC_CCTRL1_LITTLEEXP0 0x00008000 /* Little endian EXP0 */ | ||
45 | #define SGIMC_CCTRL1_FIXEDEEXP1 0x00010000 /* Fixed EXP1 endianness */ | ||
46 | #define SGIMC_CCTRL1_LITTLEEXP1 0x00020000 /* Little endian EXP1 */ | ||
47 | |||
48 | u32 _unused2; | ||
49 | volatile u32 watchdogt; /* Watchdog reg rdonly, write clears */ | ||
50 | |||
51 | u32 _unused3; | ||
52 | volatile u32 systemid; /* MC system ID register, readonly */ | ||
53 | #define SGIMC_SYSID_MASKREV 0x0000000f /* Revision of MC controller */ | ||
54 | #define SGIMC_SYSID_EPRESENT 0x00000010 /* Indicates presence of EISA bus */ | ||
55 | |||
56 | u32 _unused4[3]; | ||
57 | volatile u32 divider; /* Divider reg for RPSS */ | ||
58 | |||
59 | u32 _unused5; | ||
60 | u32 eeprom; /* EEPROM byte reg for r4k */ | ||
61 | #define SGIMC_EEPROM_PRE 0x00000001 /* eeprom chip PRE pin assertion */ | ||
62 | #define SGIMC_EEPROM_CSEL 0x00000002 /* Active high, eeprom chip select */ | ||
63 | #define SGIMC_EEPROM_SECLOCK 0x00000004 /* EEPROM serial clock */ | ||
64 | #define SGIMC_EEPROM_SDATAO 0x00000008 /* Serial EEPROM data-out */ | ||
65 | #define SGIMC_EEPROM_SDATAI 0x00000010 /* Serial EEPROM data-in */ | ||
66 | |||
67 | u32 _unused6[3]; | ||
68 | volatile u32 rcntpre; /* Preload refresh counter */ | ||
69 | |||
70 | u32 _unused7; | ||
71 | volatile u32 rcounter; /* Readonly refresh counter */ | ||
72 | |||
73 | u32 _unused8[13]; | ||
74 | volatile u32 giopar; /* Parameter word for GIO64 */ | ||
75 | #define SGIMC_GIOPAR_HPC64 0x00000001 /* HPC talks to GIO using 64-bits */ | ||
76 | #define SGIMC_GIOPAR_GFX64 0x00000002 /* GFX talks to GIO using 64-bits */ | ||
77 | #define SGIMC_GIOPAR_EXP064 0x00000004 /* EXP(slot0) talks using 64-bits */ | ||
78 | #define SGIMC_GIOPAR_EXP164 0x00000008 /* EXP(slot1) talks using 64-bits */ | ||
79 | #define SGIMC_GIOPAR_EISA64 0x00000010 /* EISA bus talks 64-bits to GIO */ | ||
80 | #define SGIMC_GIOPAR_HPC264 0x00000020 /* 2nd HPX talks 64-bits to GIO */ | ||
81 | #define SGIMC_GIOPAR_RTIMEGFX 0x00000040 /* GFX device has realtime attr */ | ||
82 | #define SGIMC_GIOPAR_RTIMEEXP0 0x00000080 /* EXP(slot0) has realtime attr */ | ||
83 | #define SGIMC_GIOPAR_RTIMEEXP1 0x00000100 /* EXP(slot1) has realtime attr */ | ||
84 | #define SGIMC_GIOPAR_MASTEREISA 0x00000200 /* EISA bus can act as bus master */ | ||
85 | #define SGIMC_GIOPAR_ONEBUS 0x00000400 /* Exists one GIO64 pipelined bus */ | ||
86 | #define SGIMC_GIOPAR_MASTERGFX 0x00000800 /* GFX can act as a bus master */ | ||
87 | #define SGIMC_GIOPAR_MASTEREXP0 0x00001000 /* EXP(slot0) can bus master */ | ||
88 | #define SGIMC_GIOPAR_MASTEREXP1 0x00002000 /* EXP(slot1) can bus master */ | ||
89 | #define SGIMC_GIOPAR_PLINEEXP0 0x00004000 /* EXP(slot0) has pipeline attr */ | ||
90 | #define SGIMC_GIOPAR_PLINEEXP1 0x00008000 /* EXP(slot1) has pipeline attr */ | ||
91 | |||
92 | u32 _unused9; | ||
93 | volatile u32 cputp; /* CPU bus arb time period */ | ||
94 | |||
95 | u32 _unused10[3]; | ||
96 | volatile u32 lbursttp; /* Time period for long bursts */ | ||
97 | |||
98 | /* MC chip can drive up to 4 bank 4 SIMMs each. All SIMMs in bank must | ||
99 | * be the same size. The size encoding for supported SIMMs is bellow */ | ||
100 | u32 _unused11[9]; | ||
101 | volatile u32 mconfig0; /* Memory config register zero */ | ||
102 | u32 _unused12; | ||
103 | volatile u32 mconfig1; /* Memory config register one */ | ||
104 | #define SGIMC_MCONFIG_BASEADDR 0x000000ff /* Base address of bank*/ | ||
105 | #define SGIMC_MCONFIG_RMASK 0x00001f00 /* Ram config bitmask */ | ||
106 | #define SGIMC_MCONFIG_BVALID 0x00002000 /* Bank is valid */ | ||
107 | #define SGIMC_MCONFIG_SBANKS 0x00004000 /* Number of subbanks */ | ||
108 | |||
109 | u32 _unused13; | ||
110 | volatile u32 cmacc; /* Mem access config for CPU */ | ||
111 | u32 _unused14; | ||
112 | volatile u32 gmacc; /* Mem access config for GIO */ | ||
113 | |||
114 | /* This define applies to both cmacc and gmacc registers above. */ | ||
115 | #define SGIMC_MACC_ALIASBIG 0x20000000 /* 512MB home for alias */ | ||
116 | |||
117 | /* Error address/status regs from GIO and CPU perspectives. */ | ||
118 | u32 _unused15; | ||
119 | volatile u32 cerr; /* Error address reg for CPU */ | ||
120 | u32 _unused16; | ||
121 | volatile u32 cstat; /* Status reg for CPU */ | ||
122 | #define SGIMC_CSTAT_RD 0x00000100 /* read parity error */ | ||
123 | #define SGIMC_CSTAT_PAR 0x00000200 /* CPU parity error */ | ||
124 | #define SGIMC_CSTAT_ADDR 0x00000400 /* memory bus error bad addr */ | ||
125 | #define SGIMC_CSTAT_SYSAD_PAR 0x00000800 /* sysad parity error */ | ||
126 | #define SGIMC_CSTAT_SYSCMD_PAR 0x00001000 /* syscmd parity error */ | ||
127 | #define SGIMC_CSTAT_BAD_DATA 0x00002000 /* bad data identifier */ | ||
128 | #define SGIMC_CSTAT_PAR_MASK 0x00001f00 /* parity error mask */ | ||
129 | #define SGIMC_CSTAT_RD_PAR (SGIMC_CSTAT_RD | SGIMC_CSTAT_PAR) | ||
130 | |||
131 | u32 _unused17; | ||
132 | volatile u32 gerr; /* Error address reg for GIO */ | ||
133 | u32 _unused18; | ||
134 | volatile u32 gstat; /* Status reg for GIO */ | ||
135 | #define SGIMC_GSTAT_RD 0x00000100 /* read parity error */ | ||
136 | #define SGIMC_GSTAT_WR 0x00000200 /* write parity error */ | ||
137 | #define SGIMC_GSTAT_TIME 0x00000400 /* GIO bus timed out */ | ||
138 | #define SGIMC_GSTAT_PROM 0x00000800 /* write to PROM when PROM_EN not set */ | ||
139 | #define SGIMC_GSTAT_ADDR 0x00001000 /* parity error on addr cycle */ | ||
140 | #define SGIMC_GSTAT_BC 0x00002000 /* parity error on byte count cycle */ | ||
141 | #define SGIMC_GSTAT_PIO_RD 0x00004000 /* read data parity on pio */ | ||
142 | #define SGIMC_GSTAT_PIO_WR 0x00008000 /* write data parity on pio */ | ||
143 | |||
144 | /* Special hard bus locking registers. */ | ||
145 | u32 _unused19; | ||
146 | volatile u32 syssembit; /* Uni-bit system semaphore */ | ||
147 | u32 _unused20; | ||
148 | volatile u32 mlock; /* Global GIO memory access lock */ | ||
149 | u32 _unused21; | ||
150 | volatile u32 elock; /* Locks EISA from GIO accesses */ | ||
151 | |||
152 | /* GIO dma control registers. */ | ||
153 | u32 _unused22[15]; | ||
154 | volatile u32 gio_dma_trans; /* DMA mask to translation GIO addrs */ | ||
155 | u32 _unused23; | ||
156 | volatile u32 gio_dma_sbits; /* DMA GIO addr substitution bits */ | ||
157 | u32 _unused24; | ||
158 | volatile u32 dma_intr_cause; /* DMA IRQ cause indicator bits */ | ||
159 | u32 _unused25; | ||
160 | volatile u32 dma_ctrl; /* Main DMA control reg */ | ||
161 | |||
162 | /* DMA TLB entry 0 */ | ||
163 | u32 _unused26[5]; | ||
164 | volatile u32 dtlb_hi0; | ||
165 | u32 _unused27; | ||
166 | volatile u32 dtlb_lo0; | ||
167 | |||
168 | /* DMA TLB entry 1 */ | ||
169 | u32 _unused28; | ||
170 | volatile u32 dtlb_hi1; | ||
171 | u32 _unused29; | ||
172 | volatile u32 dtlb_lo1; | ||
173 | |||
174 | /* DMA TLB entry 2 */ | ||
175 | u32 _unused30; | ||
176 | volatile u32 dtlb_hi2; | ||
177 | u32 _unused31; | ||
178 | volatile u32 dtlb_lo2; | ||
179 | |||
180 | /* DMA TLB entry 3 */ | ||
181 | u32 _unused32; | ||
182 | volatile u32 dtlb_hi3; | ||
183 | u32 _unused33; | ||
184 | volatile u32 dtlb_lo3; | ||
185 | |||
186 | u32 _unused34[0x0392]; | ||
187 | |||
188 | u32 _unused35; | ||
189 | volatile u32 rpsscounter; /* Chirps at 100ns */ | ||
190 | |||
191 | u32 _unused36[0x1000/4-2*4]; | ||
192 | |||
193 | u32 _unused37; | ||
194 | volatile u32 maddronly; /* Address DMA goes at */ | ||
195 | u32 _unused38; | ||
196 | volatile u32 maddrpdeflts; /* Same as above, plus set defaults */ | ||
197 | u32 _unused39; | ||
198 | volatile u32 dmasz; /* DMA count */ | ||
199 | u32 _unused40; | ||
200 | volatile u32 ssize; /* DMA stride size */ | ||
201 | u32 _unused41; | ||
202 | volatile u32 gmaddronly; /* Set GIO DMA but don't start trans */ | ||
203 | u32 _unused42; | ||
204 | volatile u32 dmaddnpgo; /* Set GIO DMA addr + start transfer */ | ||
205 | u32 _unused43; | ||
206 | volatile u32 dmamode; /* DMA mode config bit settings */ | ||
207 | u32 _unused44; | ||
208 | volatile u32 dmaccount; /* Zoom and byte count for DMA */ | ||
209 | u32 _unused45; | ||
210 | volatile u32 dmastart; /* Pedal to the metal. */ | ||
211 | u32 _unused46; | ||
212 | volatile u32 dmarunning; /* DMA op is in progress */ | ||
213 | u32 _unused47; | ||
214 | volatile u32 maddrdefstart; /* Set dma addr, defaults, and kick it */ | ||
215 | }; | ||
216 | |||
217 | extern struct sgimc_regs *sgimc; | ||
218 | #define SGIMC_BASE 0x1fa00000 /* physical */ | ||
219 | |||
220 | /* Base location of the two ram banks found in IP2[0268] machines. */ | ||
221 | #define SGIMC_SEG0_BADDR 0x08000000 | ||
222 | #define SGIMC_SEG1_BADDR 0x20000000 | ||
223 | |||
224 | /* Maximum size of the above banks are per machine. */ | ||
225 | #define SGIMC_SEG0_SIZE_ALL 0x10000000 /* 256MB */ | ||
226 | #define SGIMC_SEG1_SIZE_IP20_IP22 0x08000000 /* 128MB */ | ||
227 | #define SGIMC_SEG1_SIZE_IP26_IP28 0x20000000 /* 512MB */ | ||
228 | |||
229 | extern void sgimc_init(void); | ||
230 | |||
231 | #endif /* _SGI_MC_H */ | ||
diff --git a/include/asm-mips/sgi/pi1.h b/include/asm-mips/sgi/pi1.h deleted file mode 100644 index c9506915dc5c..000000000000 --- a/include/asm-mips/sgi/pi1.h +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * pi1.h: Definitions for SGI PI1 parallel port | ||
3 | */ | ||
4 | |||
5 | #ifndef _SGI_PI1_H | ||
6 | #define _SGI_PI1_H | ||
7 | |||
8 | struct pi1_regs { | ||
9 | u8 _data[3]; | ||
10 | volatile u8 data; | ||
11 | u8 _ctrl[3]; | ||
12 | volatile u8 ctrl; | ||
13 | #define PI1_CTRL_STROBE_N 0x01 | ||
14 | #define PI1_CTRL_AFD_N 0x02 | ||
15 | #define PI1_CTRL_INIT_N 0x04 | ||
16 | #define PI1_CTRL_SLIN_N 0x08 | ||
17 | #define PI1_CTRL_IRQ_ENA 0x10 | ||
18 | #define PI1_CTRL_DIR 0x20 | ||
19 | #define PI1_CTRL_SEL 0x40 | ||
20 | u8 _status[3]; | ||
21 | volatile u8 status; | ||
22 | #define PI1_STAT_DEVID 0x03 /* bits 0-1 */ | ||
23 | #define PI1_STAT_NOINK 0x04 /* SGI MODE only */ | ||
24 | #define PI1_STAT_ERROR 0x08 | ||
25 | #define PI1_STAT_ONLINE 0x10 | ||
26 | #define PI1_STAT_PE 0x20 | ||
27 | #define PI1_STAT_ACK 0x40 | ||
28 | #define PI1_STAT_BUSY 0x80 | ||
29 | u8 _dmactrl[3]; | ||
30 | volatile u8 dmactrl; | ||
31 | #define PI1_DMACTRL_FIFO_EMPTY 0x01 /* fifo empty R/O */ | ||
32 | #define PI1_DMACTRL_ABORT 0x02 /* reset DMA and internal fifo W/O */ | ||
33 | #define PI1_DMACTRL_STDMODE 0x00 /* bits 2-3 */ | ||
34 | #define PI1_DMACTRL_SGIMODE 0x04 /* bits 2-3 */ | ||
35 | #define PI1_DMACTRL_RICOHMODE 0x08 /* bits 2-3 */ | ||
36 | #define PI1_DMACTRL_HPMODE 0x0c /* bits 2-3 */ | ||
37 | #define PI1_DMACTRL_BLKMODE 0x10 /* block mode */ | ||
38 | #define PI1_DMACTRL_FIFO_CLEAR 0x20 /* clear fifo W/O */ | ||
39 | #define PI1_DMACTRL_READ 0x40 /* read */ | ||
40 | #define PI1_DMACTRL_RUN 0x80 /* pedal to the metal */ | ||
41 | u8 _intstat[3]; | ||
42 | volatile u8 intstat; | ||
43 | #define PI1_INTSTAT_ACK 0x04 | ||
44 | #define PI1_INTSTAT_FEMPTY 0x08 | ||
45 | #define PI1_INTSTAT_NOINK 0x10 | ||
46 | #define PI1_INTSTAT_ONLINE 0x20 | ||
47 | #define PI1_INTSTAT_ERR 0x40 | ||
48 | #define PI1_INTSTAT_PE 0x80 | ||
49 | u8 _intmask[3]; | ||
50 | volatile u8 intmask; /* enabled low, reset high*/ | ||
51 | #define PI1_INTMASK_ACK 0x04 | ||
52 | #define PI1_INTMASK_FIFO_EMPTY 0x08 | ||
53 | #define PI1_INTMASK_NOINK 0x10 | ||
54 | #define PI1_INTMASK_ONLINE 0x20 | ||
55 | #define PI1_INTMASK_ERR 0x40 | ||
56 | #define PI1_INTMASK_PE 0x80 | ||
57 | u8 _timer1[3]; | ||
58 | volatile u8 timer1; | ||
59 | #define PI1_TIME1 0x27 | ||
60 | u8 _timer2[3]; | ||
61 | volatile u8 timer2; | ||
62 | #define PI1_TIME2 0x13 | ||
63 | u8 _timer3[3]; | ||
64 | volatile u8 timer3; | ||
65 | #define PI1_TIME3 0x10 | ||
66 | u8 _timer4[3]; | ||
67 | volatile u8 timer4; | ||
68 | #define PI1_TIME4 0x00 | ||
69 | }; | ||
70 | |||
71 | #endif | ||
diff --git a/include/asm-mips/sgi/seeq.h b/include/asm-mips/sgi/seeq.h deleted file mode 100644 index af0ffd76899d..000000000000 --- a/include/asm-mips/sgi/seeq.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2007 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_SGI_SEEQ_H | ||
9 | #define __ASM_SGI_SEEQ_H | ||
10 | |||
11 | #include <linux/if_ether.h> | ||
12 | |||
13 | #include <asm/sgi/hpc3.h> | ||
14 | |||
15 | struct sgiseeq_platform_data { | ||
16 | struct hpc3_regs *hpc; | ||
17 | unsigned int irq; | ||
18 | unsigned char mac[ETH_ALEN]; | ||
19 | }; | ||
20 | |||
21 | #endif /* __ASM_SGI_SEEQ_H */ | ||
diff --git a/include/asm-mips/sgi/sgi.h b/include/asm-mips/sgi/sgi.h deleted file mode 100644 index 645cea7c0f8e..000000000000 --- a/include/asm-mips/sgi/sgi.h +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * sgi.h: Definitions specific to SGI machines. | ||
7 | * | ||
8 | * Copyright (C) 1996 David S. Miller (dm@sgi.com) | ||
9 | */ | ||
10 | #ifndef _ASM_SGI_SGI_H | ||
11 | #define _ASM_SGI_SGI_H | ||
12 | |||
13 | /* UP=UniProcessor MP=MultiProcessor(capable) */ | ||
14 | enum sgi_mach { | ||
15 | ip4, /* R2k UP */ | ||
16 | ip5, /* R2k MP */ | ||
17 | ip6, /* R3k UP */ | ||
18 | ip7, /* R3k MP */ | ||
19 | ip9, /* R3k UP */ | ||
20 | ip12, /* R3kA UP, Indigo */ | ||
21 | ip15, /* R3kA MP */ | ||
22 | ip17, /* R4K UP */ | ||
23 | ip19, /* R4K MP */ | ||
24 | ip20, /* R4K UP, Indigo */ | ||
25 | ip21, /* TFP MP */ | ||
26 | ip22, /* R4x00 UP, Indigo2 */ | ||
27 | ip25, /* R10k MP */ | ||
28 | ip26, /* TFP UP, Indigo2 */ | ||
29 | ip27, /* R10k MP, R12k MP, Origin */ | ||
30 | ip28, /* R10k UP, Indigo2 */ | ||
31 | ip30, /* Octane */ | ||
32 | ip32, /* O2 */ | ||
33 | }; | ||
34 | |||
35 | extern enum sgi_mach sgimach; | ||
36 | extern void sgi_sysinit(void); | ||
37 | |||
38 | /* Many I/O space registers are byte sized and are contained within | ||
39 | * one byte per word, specifically the MSB, this macro helps out. | ||
40 | */ | ||
41 | #ifdef __MIPSEL__ | ||
42 | #define SGI_MSB(regaddr) (regaddr) | ||
43 | #else | ||
44 | #define SGI_MSB(regaddr) ((regaddr) | 0x3) | ||
45 | #endif | ||
46 | |||
47 | #endif /* _ASM_SGI_SGI_H */ | ||
diff --git a/include/asm-mips/sgi/wd.h b/include/asm-mips/sgi/wd.h deleted file mode 100644 index 0d6c3a4da891..000000000000 --- a/include/asm-mips/sgi/wd.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2007 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_SGI_WD_H | ||
9 | #define __ASM_SGI_WD_H | ||
10 | |||
11 | #include <asm/sgi/hpc3.h> | ||
12 | |||
13 | struct sgiwd93_platform_data { | ||
14 | unsigned int unit; | ||
15 | unsigned int irq; | ||
16 | struct hpc3_scsiregs *hregs; | ||
17 | unsigned char *wdregs; | ||
18 | }; | ||
19 | |||
20 | #endif /* __ASM_SGI_WD_H */ | ||
diff --git a/include/asm-mips/sgialib.h b/include/asm-mips/sgialib.h deleted file mode 100644 index bfce5c786f1c..000000000000 --- a/include/asm-mips/sgialib.h +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * SGI ARCS firmware interface library for the Linux kernel. | ||
7 | * | ||
8 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | ||
9 | * Copyright (C) 2001, 2002 Ralf Baechle (ralf@gnu.org) | ||
10 | */ | ||
11 | #ifndef _ASM_SGIALIB_H | ||
12 | #define _ASM_SGIALIB_H | ||
13 | |||
14 | #include <asm/sgiarcs.h> | ||
15 | |||
16 | extern struct linux_romvec *romvec; | ||
17 | extern int prom_argc; | ||
18 | |||
19 | extern LONG *_prom_argv, *_prom_envp; | ||
20 | |||
21 | /* A 32-bit ARC PROM pass arguments and environment as 32-bit pointer. | ||
22 | These macros take care of sign extension. */ | ||
23 | #define prom_argv(index) ((char *) (long) _prom_argv[(index)]) | ||
24 | #define prom_argc(index) ((char *) (long) _prom_argc[(index)]) | ||
25 | |||
26 | extern int prom_flags; | ||
27 | |||
28 | #define PROM_FLAG_ARCS 1 | ||
29 | #define PROM_FLAG_USE_AS_CONSOLE 2 | ||
30 | #define PROM_FLAG_DONT_FREE_TEMP 4 | ||
31 | |||
32 | /* Simple char-by-char console I/O. */ | ||
33 | extern void prom_putchar(char c); | ||
34 | extern char prom_getchar(void); | ||
35 | |||
36 | /* Memory descriptor management. */ | ||
37 | #define PROM_MAX_PMEMBLOCKS 32 | ||
38 | struct prom_pmemblock { | ||
39 | LONG base; /* Within KSEG0 or XKPHYS. */ | ||
40 | ULONG size; /* In bytes. */ | ||
41 | ULONG type; /* free or prom memory */ | ||
42 | }; | ||
43 | |||
44 | /* Get next memory descriptor after CURR, returns first descriptor | ||
45 | * in chain is CURR is NULL. | ||
46 | */ | ||
47 | extern struct linux_mdesc *prom_getmdesc(struct linux_mdesc *curr); | ||
48 | #define PROM_NULL_MDESC ((struct linux_mdesc *) 0) | ||
49 | |||
50 | /* Called by prom_init to setup the physical memory pmemblock | ||
51 | * array. | ||
52 | */ | ||
53 | extern void prom_meminit(void); | ||
54 | extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem); | ||
55 | |||
56 | /* PROM device tree library routines. */ | ||
57 | #define PROM_NULL_COMPONENT ((pcomponent *) 0) | ||
58 | |||
59 | /* Get sibling component of THIS. */ | ||
60 | extern pcomponent *ArcGetPeer(pcomponent *this); | ||
61 | |||
62 | /* Get child component of THIS. */ | ||
63 | extern pcomponent *ArcGetChild(pcomponent *this); | ||
64 | |||
65 | /* Get parent component of CHILD. */ | ||
66 | extern pcomponent *prom_getparent(pcomponent *child); | ||
67 | |||
68 | /* Copy component opaque data of component THIS into BUFFER | ||
69 | * if component THIS has opaque data. Returns success or | ||
70 | * failure status. | ||
71 | */ | ||
72 | extern long prom_getcdata(void *buffer, pcomponent *this); | ||
73 | |||
74 | /* Other misc. component routines. */ | ||
75 | extern pcomponent *prom_childadd(pcomponent *this, pcomponent *tmp, void *data); | ||
76 | extern long prom_delcomponent(pcomponent *this); | ||
77 | extern pcomponent *prom_componentbypath(char *path); | ||
78 | |||
79 | /* This is called at prom_init time to identify the | ||
80 | * ARC architecture we are running on | ||
81 | */ | ||
82 | extern void prom_identify_arch(void); | ||
83 | |||
84 | /* Environment variable routines. */ | ||
85 | extern PCHAR ArcGetEnvironmentVariable(PCHAR name); | ||
86 | extern LONG ArcSetEnvironmentVariable(PCHAR name, PCHAR value); | ||
87 | |||
88 | /* ARCS command line acquisition and parsing. */ | ||
89 | extern char *prom_getcmdline(void); | ||
90 | extern void prom_init_cmdline(void); | ||
91 | |||
92 | /* Acquiring info about the current time, etc. */ | ||
93 | extern struct linux_tinfo *prom_gettinfo(void); | ||
94 | extern unsigned long prom_getrtime(void); | ||
95 | |||
96 | /* File operations. */ | ||
97 | extern long prom_getvdirent(unsigned long fd, struct linux_vdirent *ent, unsigned long num, unsigned long *cnt); | ||
98 | extern long prom_open(char *name, enum linux_omode md, unsigned long *fd); | ||
99 | extern long prom_close(unsigned long fd); | ||
100 | extern LONG ArcRead(ULONG fd, PVOID buf, ULONG num, PULONG cnt); | ||
101 | extern long prom_getrstatus(unsigned long fd); | ||
102 | extern LONG ArcWrite(ULONG fd, PVOID buf, ULONG num, PULONG cnt); | ||
103 | extern long prom_seek(unsigned long fd, struct linux_bigint *off, enum linux_seekmode sm); | ||
104 | extern long prom_mount(char *name, enum linux_mountops op); | ||
105 | extern long prom_getfinfo(unsigned long fd, struct linux_finfo *buf); | ||
106 | extern long prom_setfinfo(unsigned long fd, unsigned long flags, unsigned long msk); | ||
107 | |||
108 | /* Running stand-along programs. */ | ||
109 | extern long prom_load(char *name, unsigned long end, unsigned long *pc, unsigned long *eaddr); | ||
110 | extern long prom_invoke(unsigned long pc, unsigned long sp, long argc, char **argv, char **envp); | ||
111 | extern long prom_exec(char *name, long argc, char **argv, char **envp); | ||
112 | |||
113 | /* Misc. routines. */ | ||
114 | extern VOID prom_halt(VOID) __attribute__((noreturn)); | ||
115 | extern VOID prom_powerdown(VOID) __attribute__((noreturn)); | ||
116 | extern VOID prom_restart(VOID) __attribute__((noreturn)); | ||
117 | extern VOID ArcReboot(VOID) __attribute__((noreturn)); | ||
118 | extern VOID ArcEnterInteractiveMode(VOID) __attribute__((noreturn)); | ||
119 | extern long prom_cfgsave(VOID); | ||
120 | extern struct linux_sysid *prom_getsysid(VOID); | ||
121 | extern VOID ArcFlushAllCaches(VOID); | ||
122 | extern DISPLAY_STATUS *ArcGetDisplayStatus(ULONG FileID); | ||
123 | |||
124 | #endif /* _ASM_SGIALIB_H */ | ||
diff --git a/include/asm-mips/sgiarcs.h b/include/asm-mips/sgiarcs.h deleted file mode 100644 index 721327f88601..000000000000 --- a/include/asm-mips/sgiarcs.h +++ /dev/null | |||
@@ -1,548 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * ARC firmware interface defines. | ||
7 | * | ||
8 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | ||
9 | * Copyright (C) 1999, 2001 Ralf Baechle (ralf@gnu.org) | ||
10 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
11 | */ | ||
12 | #ifndef _ASM_SGIARCS_H | ||
13 | #define _ASM_SGIARCS_H | ||
14 | |||
15 | #include <asm/types.h> | ||
16 | #include <asm/fw/arc/types.h> | ||
17 | |||
18 | /* Various ARCS error codes. */ | ||
19 | #define PROM_ESUCCESS 0x00 | ||
20 | #define PROM_E2BIG 0x01 | ||
21 | #define PROM_EACCESS 0x02 | ||
22 | #define PROM_EAGAIN 0x03 | ||
23 | #define PROM_EBADF 0x04 | ||
24 | #define PROM_EBUSY 0x05 | ||
25 | #define PROM_EFAULT 0x06 | ||
26 | #define PROM_EINVAL 0x07 | ||
27 | #define PROM_EIO 0x08 | ||
28 | #define PROM_EISDIR 0x09 | ||
29 | #define PROM_EMFILE 0x0a | ||
30 | #define PROM_EMLINK 0x0b | ||
31 | #define PROM_ENAMETOOLONG 0x0c | ||
32 | #define PROM_ENODEV 0x0d | ||
33 | #define PROM_ENOENT 0x0e | ||
34 | #define PROM_ENOEXEC 0x0f | ||
35 | #define PROM_ENOMEM 0x10 | ||
36 | #define PROM_ENOSPC 0x11 | ||
37 | #define PROM_ENOTDIR 0x12 | ||
38 | #define PROM_ENOTTY 0x13 | ||
39 | #define PROM_ENXIO 0x14 | ||
40 | #define PROM_EROFS 0x15 | ||
41 | /* SGI ARCS specific errno's. */ | ||
42 | #define PROM_EADDRNOTAVAIL 0x1f | ||
43 | #define PROM_ETIMEDOUT 0x20 | ||
44 | #define PROM_ECONNABORTED 0x21 | ||
45 | #define PROM_ENOCONNECT 0x22 | ||
46 | |||
47 | /* Device classes, types, and identifiers for prom | ||
48 | * device inventory queries. | ||
49 | */ | ||
50 | enum linux_devclass { | ||
51 | system, processor, cache, adapter, controller, peripheral, memory | ||
52 | }; | ||
53 | |||
54 | enum linux_devtypes { | ||
55 | /* Generic stuff. */ | ||
56 | Arc, Cpu, Fpu, | ||
57 | |||
58 | /* Primary insn and data caches. */ | ||
59 | picache, pdcache, | ||
60 | |||
61 | /* Secondary insn, data, and combined caches. */ | ||
62 | sicache, sdcache, sccache, | ||
63 | |||
64 | memdev, eisa_adapter, tc_adapter, scsi_adapter, dti_adapter, | ||
65 | multifunc_adapter, dsk_controller, tp_controller, cdrom_controller, | ||
66 | worm_controller, serial_controller, net_controller, disp_controller, | ||
67 | parallel_controller, ptr_controller, kbd_controller, audio_controller, | ||
68 | misc_controller, disk_peripheral, flpy_peripheral, tp_peripheral, | ||
69 | modem_peripheral, monitor_peripheral, printer_peripheral, | ||
70 | ptr_peripheral, kbd_peripheral, term_peripheral, line_peripheral, | ||
71 | net_peripheral, misc_peripheral, anon | ||
72 | }; | ||
73 | |||
74 | enum linux_identifier { | ||
75 | bogus, ronly, removable, consin, consout, input, output | ||
76 | }; | ||
77 | |||
78 | /* A prom device tree component. */ | ||
79 | struct linux_component { | ||
80 | enum linux_devclass class; /* node class */ | ||
81 | enum linux_devtypes type; /* node type */ | ||
82 | enum linux_identifier iflags; /* node flags */ | ||
83 | USHORT vers; /* node version */ | ||
84 | USHORT rev; /* node revision */ | ||
85 | ULONG key; /* completely magic */ | ||
86 | ULONG amask; /* XXX affinity mask??? */ | ||
87 | ULONG cdsize; /* size of configuration data */ | ||
88 | ULONG ilen; /* length of string identifier */ | ||
89 | _PULONG iname; /* string identifier */ | ||
90 | }; | ||
91 | typedef struct linux_component pcomponent; | ||
92 | |||
93 | struct linux_sysid { | ||
94 | char vend[8], prod[8]; | ||
95 | }; | ||
96 | |||
97 | /* ARCS prom memory descriptors. */ | ||
98 | enum arcs_memtypes { | ||
99 | arcs_eblock, /* exception block */ | ||
100 | arcs_rvpage, /* ARCS romvec page */ | ||
101 | arcs_fcontig, /* Contiguous and free */ | ||
102 | arcs_free, /* Generic free memory */ | ||
103 | arcs_bmem, /* Borken memory, don't use */ | ||
104 | arcs_prog, /* A loaded program resides here */ | ||
105 | arcs_atmp, /* ARCS temporary storage area, wish Sparc OpenBoot told this */ | ||
106 | arcs_aperm, /* ARCS permanent storage... */ | ||
107 | }; | ||
108 | |||
109 | /* ARC has slightly different types than ARCS */ | ||
110 | enum arc_memtypes { | ||
111 | arc_eblock, /* exception block */ | ||
112 | arc_rvpage, /* romvec page */ | ||
113 | arc_free, /* Generic free memory */ | ||
114 | arc_bmem, /* Borken memory, don't use */ | ||
115 | arc_prog, /* A loaded program resides here */ | ||
116 | arc_atmp, /* temporary storage area */ | ||
117 | arc_aperm, /* permanent storage */ | ||
118 | arc_fcontig, /* Contiguous and free */ | ||
119 | }; | ||
120 | |||
121 | union linux_memtypes { | ||
122 | enum arcs_memtypes arcs; | ||
123 | enum arc_memtypes arc; | ||
124 | }; | ||
125 | |||
126 | struct linux_mdesc { | ||
127 | union linux_memtypes type; | ||
128 | ULONG base; | ||
129 | ULONG pages; | ||
130 | }; | ||
131 | |||
132 | /* Time of day descriptor. */ | ||
133 | struct linux_tinfo { | ||
134 | unsigned short yr; | ||
135 | unsigned short mnth; | ||
136 | unsigned short day; | ||
137 | unsigned short hr; | ||
138 | unsigned short min; | ||
139 | unsigned short sec; | ||
140 | unsigned short msec; | ||
141 | }; | ||
142 | |||
143 | /* ARCS virtual dirents. */ | ||
144 | struct linux_vdirent { | ||
145 | ULONG namelen; | ||
146 | unsigned char attr; | ||
147 | char fname[32]; /* XXX imperical, should be a define */ | ||
148 | }; | ||
149 | |||
150 | /* Other stuff for files. */ | ||
151 | enum linux_omode { | ||
152 | rdonly, wronly, rdwr, wronly_creat, rdwr_creat, | ||
153 | wronly_ssede, rdwr_ssede, dirent, dirent_creat | ||
154 | }; | ||
155 | |||
156 | enum linux_seekmode { | ||
157 | absolute, relative | ||
158 | }; | ||
159 | |||
160 | enum linux_mountops { | ||
161 | media_load, media_unload | ||
162 | }; | ||
163 | |||
164 | /* This prom has a bolixed design. */ | ||
165 | struct linux_bigint { | ||
166 | #ifdef __MIPSEL__ | ||
167 | u32 lo; | ||
168 | s32 hi; | ||
169 | #else /* !(__MIPSEL__) */ | ||
170 | s32 hi; | ||
171 | u32 lo; | ||
172 | #endif | ||
173 | }; | ||
174 | |||
175 | struct linux_finfo { | ||
176 | struct linux_bigint begin; | ||
177 | struct linux_bigint end; | ||
178 | struct linux_bigint cur; | ||
179 | enum linux_devtypes dtype; | ||
180 | unsigned long namelen; | ||
181 | unsigned char attr; | ||
182 | char name[32]; /* XXX imperical, should be define */ | ||
183 | }; | ||
184 | |||
185 | /* This describes the vector containing function pointers to the ARC | ||
186 | firmware functions. */ | ||
187 | struct linux_romvec { | ||
188 | LONG load; /* Load an executable image. */ | ||
189 | LONG invoke; /* Invoke a standalong image. */ | ||
190 | LONG exec; /* Load and begin execution of a | ||
191 | standalone image. */ | ||
192 | LONG halt; /* Halt the machine. */ | ||
193 | LONG pdown; /* Power down the machine. */ | ||
194 | LONG restart; /* XXX soft reset??? */ | ||
195 | LONG reboot; /* Reboot the machine. */ | ||
196 | LONG imode; /* Enter PROM interactive mode. */ | ||
197 | LONG _unused1; /* Was ReturnFromMain(). */ | ||
198 | |||
199 | /* PROM device tree interface. */ | ||
200 | LONG next_component; | ||
201 | LONG child_component; | ||
202 | LONG parent_component; | ||
203 | LONG component_data; | ||
204 | LONG child_add; | ||
205 | LONG comp_del; | ||
206 | LONG component_by_path; | ||
207 | |||
208 | /* Misc. stuff. */ | ||
209 | LONG cfg_save; | ||
210 | LONG get_sysid; | ||
211 | |||
212 | /* Probing for memory. */ | ||
213 | LONG get_mdesc; | ||
214 | LONG _unused2; /* was Signal() */ | ||
215 | |||
216 | LONG get_tinfo; | ||
217 | LONG get_rtime; | ||
218 | |||
219 | /* File type operations. */ | ||
220 | LONG get_vdirent; | ||
221 | LONG open; | ||
222 | LONG close; | ||
223 | LONG read; | ||
224 | LONG get_rstatus; | ||
225 | LONG write; | ||
226 | LONG seek; | ||
227 | LONG mount; | ||
228 | |||
229 | /* Dealing with firmware environment variables. */ | ||
230 | LONG get_evar; | ||
231 | LONG set_evar; | ||
232 | |||
233 | LONG get_finfo; | ||
234 | LONG set_finfo; | ||
235 | |||
236 | /* Miscellaneous. */ | ||
237 | LONG cache_flush; | ||
238 | LONG TestUnicodeCharacter; /* ARC; not sure if ARCS too */ | ||
239 | LONG GetDisplayStatus; | ||
240 | }; | ||
241 | |||
242 | /* The SGI ARCS parameter block is in a fixed location for standalone | ||
243 | * programs to access PROM facilities easily. | ||
244 | */ | ||
245 | typedef struct _SYSTEM_PARAMETER_BLOCK { | ||
246 | ULONG magic; /* magic cookie */ | ||
247 | #define PROMBLOCK_MAGIC 0x53435241 | ||
248 | |||
249 | ULONG len; /* length of parm block */ | ||
250 | USHORT ver; /* ARCS firmware version */ | ||
251 | USHORT rev; /* ARCS firmware revision */ | ||
252 | _PLONG rs_block; /* Restart block. */ | ||
253 | _PLONG dbg_block; /* Debug block. */ | ||
254 | _PLONG gevect; /* XXX General vector??? */ | ||
255 | _PLONG utlbvect; /* XXX UTLB vector??? */ | ||
256 | ULONG rveclen; /* Size of romvec struct. */ | ||
257 | _PVOID romvec; /* Function interface. */ | ||
258 | ULONG pveclen; /* Length of private vector. */ | ||
259 | _PVOID pvector; /* Private vector. */ | ||
260 | ULONG adap_cnt; /* Adapter count. */ | ||
261 | ULONG adap_typ0; /* First adapter type. */ | ||
262 | ULONG adap_vcnt0; /* Adapter 0 vector count. */ | ||
263 | _PVOID adap_vector; /* Adapter 0 vector ptr. */ | ||
264 | ULONG adap_typ1; /* Second adapter type. */ | ||
265 | ULONG adap_vcnt1; /* Adapter 1 vector count. */ | ||
266 | _PVOID adap_vector1; /* Adapter 1 vector ptr. */ | ||
267 | /* More adapter vectors go here... */ | ||
268 | } SYSTEM_PARAMETER_BLOCK, *PSYSTEM_PARAMETER_BLOCK; | ||
269 | |||
270 | #define PROMBLOCK ((PSYSTEM_PARAMETER_BLOCK) (int)0xA0001000) | ||
271 | #define ROMVECTOR ((struct linux_romvec *) (long)(PROMBLOCK)->romvec) | ||
272 | |||
273 | /* Cache layout parameter block. */ | ||
274 | union linux_cache_key { | ||
275 | struct param { | ||
276 | #ifdef __MIPSEL__ | ||
277 | unsigned short size; | ||
278 | unsigned char lsize; | ||
279 | unsigned char bsize; | ||
280 | #else /* !(__MIPSEL__) */ | ||
281 | unsigned char bsize; | ||
282 | unsigned char lsize; | ||
283 | unsigned short size; | ||
284 | #endif | ||
285 | } info; | ||
286 | unsigned long allinfo; | ||
287 | }; | ||
288 | |||
289 | /* Configuration data. */ | ||
290 | struct linux_cdata { | ||
291 | char *name; | ||
292 | int mlen; | ||
293 | enum linux_devtypes type; | ||
294 | }; | ||
295 | |||
296 | /* Common SGI ARCS firmware file descriptors. */ | ||
297 | #define SGIPROM_STDIN 0 | ||
298 | #define SGIPROM_STDOUT 1 | ||
299 | |||
300 | /* Common SGI ARCS firmware file types. */ | ||
301 | #define SGIPROM_ROFILE 0x01 /* read-only file */ | ||
302 | #define SGIPROM_HFILE 0x02 /* hidden file */ | ||
303 | #define SGIPROM_SFILE 0x04 /* System file */ | ||
304 | #define SGIPROM_AFILE 0x08 /* Archive file */ | ||
305 | #define SGIPROM_DFILE 0x10 /* Directory file */ | ||
306 | #define SGIPROM_DELFILE 0x20 /* Deleted file */ | ||
307 | |||
308 | /* SGI ARCS boot record information. */ | ||
309 | struct sgi_partition { | ||
310 | unsigned char flag; | ||
311 | #define SGIPART_UNUSED 0x00 | ||
312 | #define SGIPART_ACTIVE 0x80 | ||
313 | |||
314 | unsigned char shead, ssect, scyl; /* unused */ | ||
315 | unsigned char systype; /* OS type, Irix or NT */ | ||
316 | unsigned char ehead, esect, ecyl; /* unused */ | ||
317 | unsigned char rsect0, rsect1, rsect2, rsect3; | ||
318 | unsigned char tsect0, tsect1, tsect2, tsect3; | ||
319 | }; | ||
320 | |||
321 | #define SGIBBLOCK_MAGIC 0xaa55 | ||
322 | #define SGIBBLOCK_MAXPART 0x0004 | ||
323 | |||
324 | struct sgi_bootblock { | ||
325 | unsigned char _unused[446]; | ||
326 | struct sgi_partition partitions[SGIBBLOCK_MAXPART]; | ||
327 | unsigned short magic; | ||
328 | }; | ||
329 | |||
330 | /* BIOS parameter block. */ | ||
331 | struct sgi_bparm_block { | ||
332 | unsigned short bytes_sect; /* bytes per sector */ | ||
333 | unsigned char sect_clust; /* sectors per cluster */ | ||
334 | unsigned short sect_resv; /* reserved sectors */ | ||
335 | unsigned char nfats; /* # of allocation tables */ | ||
336 | unsigned short nroot_dirents; /* # of root directory entries */ | ||
337 | unsigned short sect_volume; /* sectors in volume */ | ||
338 | unsigned char media_type; /* media descriptor */ | ||
339 | unsigned short sect_fat; /* sectors per allocation table */ | ||
340 | unsigned short sect_track; /* sectors per track */ | ||
341 | unsigned short nheads; /* # of heads */ | ||
342 | unsigned short nhsects; /* # of hidden sectors */ | ||
343 | }; | ||
344 | |||
345 | struct sgi_bsector { | ||
346 | unsigned char jmpinfo[3]; | ||
347 | unsigned char manuf_name[8]; | ||
348 | struct sgi_bparm_block info; | ||
349 | }; | ||
350 | |||
351 | /* Debugging block used with SGI symmon symbolic debugger. */ | ||
352 | #define SMB_DEBUG_MAGIC 0xfeeddead | ||
353 | struct linux_smonblock { | ||
354 | unsigned long magic; | ||
355 | void (*handler)(void); /* Breakpoint routine. */ | ||
356 | unsigned long dtable_base; /* Base addr of dbg table. */ | ||
357 | int (*printf)(const char *fmt, ...); | ||
358 | unsigned long btable_base; /* Breakpoint table. */ | ||
359 | unsigned long mpflushreqs; /* SMP cache flush request list. */ | ||
360 | unsigned long ntab; /* Name table. */ | ||
361 | unsigned long stab; /* Symbol table. */ | ||
362 | int smax; /* Max # of symbols. */ | ||
363 | }; | ||
364 | |||
365 | /* | ||
366 | * Macros for calling a 32-bit ARC implementation from 64-bit code | ||
367 | */ | ||
368 | |||
369 | #if defined(CONFIG_64BIT) && defined(CONFIG_ARC32) | ||
370 | |||
371 | #define __arc_clobbers \ | ||
372 | "$2", "$3" /* ... */, "$8", "$9", "$10", "$11", \ | ||
373 | "$12", "$13", "$14", "$15", "$16", "$24", "$25", "$31" | ||
374 | |||
375 | #define ARC_CALL0(dest) \ | ||
376 | ({ long __res; \ | ||
377 | long __vec = (long) romvec->dest; \ | ||
378 | __asm__ __volatile__( \ | ||
379 | "dsubu\t$29, 32\n\t" \ | ||
380 | "jalr\t%1\n\t" \ | ||
381 | "daddu\t$29, 32\n\t" \ | ||
382 | "move\t%0, $2" \ | ||
383 | : "=r" (__res), "=r" (__vec) \ | ||
384 | : "1" (__vec) \ | ||
385 | : __arc_clobbers, "$4", "$5", "$6", "$7"); \ | ||
386 | (unsigned long) __res; \ | ||
387 | }) | ||
388 | |||
389 | #define ARC_CALL1(dest, a1) \ | ||
390 | ({ long __res; \ | ||
391 | register signed int __a1 __asm__("$4") = (int) (long) (a1); \ | ||
392 | long __vec = (long) romvec->dest; \ | ||
393 | __asm__ __volatile__( \ | ||
394 | "dsubu\t$29, 32\n\t" \ | ||
395 | "jalr\t%1\n\t" \ | ||
396 | "daddu\t$29, 32\n\t" \ | ||
397 | "move\t%0, $2" \ | ||
398 | : "=r" (__res), "=r" (__vec) \ | ||
399 | : "1" (__vec), "r" (__a1) \ | ||
400 | : __arc_clobbers, "$5", "$6", "$7"); \ | ||
401 | (unsigned long) __res; \ | ||
402 | }) | ||
403 | |||
404 | #define ARC_CALL2(dest, a1, a2) \ | ||
405 | ({ long __res; \ | ||
406 | register signed int __a1 __asm__("$4") = (int) (long) (a1); \ | ||
407 | register signed int __a2 __asm__("$5") = (int) (long) (a2); \ | ||
408 | long __vec = (long) romvec->dest; \ | ||
409 | __asm__ __volatile__( \ | ||
410 | "dsubu\t$29, 32\n\t" \ | ||
411 | "jalr\t%1\n\t" \ | ||
412 | "daddu\t$29, 32\n\t" \ | ||
413 | "move\t%0, $2" \ | ||
414 | : "=r" (__res), "=r" (__vec) \ | ||
415 | : "1" (__vec), "r" (__a1), "r" (__a2) \ | ||
416 | : __arc_clobbers, "$6", "$7"); \ | ||
417 | __res; \ | ||
418 | }) | ||
419 | |||
420 | #define ARC_CALL3(dest, a1, a2, a3) \ | ||
421 | ({ long __res; \ | ||
422 | register signed int __a1 __asm__("$4") = (int) (long) (a1); \ | ||
423 | register signed int __a2 __asm__("$5") = (int) (long) (a2); \ | ||
424 | register signed int __a3 __asm__("$6") = (int) (long) (a3); \ | ||
425 | long __vec = (long) romvec->dest; \ | ||
426 | __asm__ __volatile__( \ | ||
427 | "dsubu\t$29, 32\n\t" \ | ||
428 | "jalr\t%1\n\t" \ | ||
429 | "daddu\t$29, 32\n\t" \ | ||
430 | "move\t%0, $2" \ | ||
431 | : "=r" (__res), "=r" (__vec) \ | ||
432 | : "1" (__vec), "r" (__a1), "r" (__a2), "r" (__a3) \ | ||
433 | : __arc_clobbers, "$7"); \ | ||
434 | __res; \ | ||
435 | }) | ||
436 | |||
437 | #define ARC_CALL4(dest, a1, a2, a3, a4) \ | ||
438 | ({ long __res; \ | ||
439 | register signed int __a1 __asm__("$4") = (int) (long) (a1); \ | ||
440 | register signed int __a2 __asm__("$5") = (int) (long) (a2); \ | ||
441 | register signed int __a3 __asm__("$6") = (int) (long) (a3); \ | ||
442 | register signed int __a4 __asm__("$7") = (int) (long) (a4); \ | ||
443 | long __vec = (long) romvec->dest; \ | ||
444 | __asm__ __volatile__( \ | ||
445 | "dsubu\t$29, 32\n\t" \ | ||
446 | "jalr\t%1\n\t" \ | ||
447 | "daddu\t$29, 32\n\t" \ | ||
448 | "move\t%0, $2" \ | ||
449 | : "=r" (__res), "=r" (__vec) \ | ||
450 | : "1" (__vec), "r" (__a1), "r" (__a2), "r" (__a3), \ | ||
451 | "r" (__a4) \ | ||
452 | : __arc_clobbers); \ | ||
453 | __res; \ | ||
454 | }) | ||
455 | |||
456 | #define ARC_CALL5(dest, a1, a2, a3, a4, a5) \ | ||
457 | ({ long __res; \ | ||
458 | register signed int __a1 __asm__("$4") = (int) (long) (a1); \ | ||
459 | register signed int __a2 __asm__("$5") = (int) (long) (a2); \ | ||
460 | register signed int __a3 __asm__("$6") = (int) (long) (a3); \ | ||
461 | register signed int __a4 __asm__("$7") = (int) (long) (a4); \ | ||
462 | register signed int __a5 = (int) (long) (a5); \ | ||
463 | long __vec = (long) romvec->dest; \ | ||
464 | __asm__ __volatile__( \ | ||
465 | "dsubu\t$29, 32\n\t" \ | ||
466 | "sw\t%7, 16($29)\n\t" \ | ||
467 | "jalr\t%1\n\t" \ | ||
468 | "daddu\t$29, 32\n\t" \ | ||
469 | "move\t%0, $2" \ | ||
470 | : "=r" (__res), "=r" (__vec) \ | ||
471 | : "1" (__vec), \ | ||
472 | "r" (__a1), "r" (__a2), "r" (__a3), "r" (__a4), \ | ||
473 | "r" (__a5) \ | ||
474 | : __arc_clobbers); \ | ||
475 | __res; \ | ||
476 | }) | ||
477 | |||
478 | #endif /* defined(CONFIG_64BIT) && defined(CONFIG_ARC32) */ | ||
479 | |||
480 | #if (defined(CONFIG_32BIT) && defined(CONFIG_ARC32)) || \ | ||
481 | (defined(CONFIG_64BIT) && defined(CONFIG_ARC64)) | ||
482 | |||
483 | #define ARC_CALL0(dest) \ | ||
484 | ({ long __res; \ | ||
485 | long (*__vec)(void) = (void *) romvec->dest; \ | ||
486 | \ | ||
487 | __res = __vec(); \ | ||
488 | __res; \ | ||
489 | }) | ||
490 | |||
491 | #define ARC_CALL1(dest, a1) \ | ||
492 | ({ long __res; \ | ||
493 | long __a1 = (long) (a1); \ | ||
494 | long (*__vec)(long) = (void *) romvec->dest; \ | ||
495 | \ | ||
496 | __res = __vec(__a1); \ | ||
497 | __res; \ | ||
498 | }) | ||
499 | |||
500 | #define ARC_CALL2(dest, a1, a2) \ | ||
501 | ({ long __res; \ | ||
502 | long __a1 = (long) (a1); \ | ||
503 | long __a2 = (long) (a2); \ | ||
504 | long (*__vec)(long, long) = (void *) romvec->dest; \ | ||
505 | \ | ||
506 | __res = __vec(__a1, __a2); \ | ||
507 | __res; \ | ||
508 | }) | ||
509 | |||
510 | #define ARC_CALL3(dest, a1, a2, a3) \ | ||
511 | ({ long __res; \ | ||
512 | long __a1 = (long) (a1); \ | ||
513 | long __a2 = (long) (a2); \ | ||
514 | long __a3 = (long) (a3); \ | ||
515 | long (*__vec)(long, long, long) = (void *) romvec->dest; \ | ||
516 | \ | ||
517 | __res = __vec(__a1, __a2, __a3); \ | ||
518 | __res; \ | ||
519 | }) | ||
520 | |||
521 | #define ARC_CALL4(dest, a1, a2, a3, a4) \ | ||
522 | ({ long __res; \ | ||
523 | long __a1 = (long) (a1); \ | ||
524 | long __a2 = (long) (a2); \ | ||
525 | long __a3 = (long) (a3); \ | ||
526 | long __a4 = (long) (a4); \ | ||
527 | long (*__vec)(long, long, long, long) = (void *) romvec->dest; \ | ||
528 | \ | ||
529 | __res = __vec(__a1, __a2, __a3, __a4); \ | ||
530 | __res; \ | ||
531 | }) | ||
532 | |||
533 | #define ARC_CALL5(dest, a1, a2, a3, a4, a5) \ | ||
534 | ({ long __res; \ | ||
535 | long __a1 = (long) (a1); \ | ||
536 | long __a2 = (long) (a2); \ | ||
537 | long __a3 = (long) (a3); \ | ||
538 | long __a4 = (long) (a4); \ | ||
539 | long __a5 = (long) (a5); \ | ||
540 | long (*__vec)(long, long, long, long, long); \ | ||
541 | __vec = (void *) romvec->dest; \ | ||
542 | \ | ||
543 | __res = __vec(__a1, __a2, __a3, __a4, __a5); \ | ||
544 | __res; \ | ||
545 | }) | ||
546 | #endif /* both kernel and ARC either 32-bit or 64-bit */ | ||
547 | |||
548 | #endif /* _ASM_SGIARCS_H */ | ||
diff --git a/include/asm-mips/sgidefs.h b/include/asm-mips/sgidefs.h deleted file mode 100644 index 876442fcfb32..000000000000 --- a/include/asm-mips/sgidefs.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 1999, 2001 Ralf Baechle | ||
7 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
8 | * Copyright (C) 2001 MIPS Technologies, Inc. | ||
9 | */ | ||
10 | #ifndef __ASM_SGIDEFS_H | ||
11 | #define __ASM_SGIDEFS_H | ||
12 | |||
13 | /* | ||
14 | * Using a Linux compiler for building Linux seems logic but not to | ||
15 | * everybody. | ||
16 | */ | ||
17 | #ifndef __linux__ | ||
18 | #error Use a Linux compiler or give up. | ||
19 | #endif | ||
20 | |||
21 | /* | ||
22 | * Definitions for the ISA levels | ||
23 | * | ||
24 | * With the introduction of MIPS32 / MIPS64 instruction sets definitions | ||
25 | * MIPS ISAs are no longer subsets of each other. Therefore comparisons | ||
26 | * on these symbols except with == may result in unexpected results and | ||
27 | * are forbidden! | ||
28 | */ | ||
29 | #define _MIPS_ISA_MIPS1 1 | ||
30 | #define _MIPS_ISA_MIPS2 2 | ||
31 | #define _MIPS_ISA_MIPS3 3 | ||
32 | #define _MIPS_ISA_MIPS4 4 | ||
33 | #define _MIPS_ISA_MIPS5 5 | ||
34 | #define _MIPS_ISA_MIPS32 6 | ||
35 | #define _MIPS_ISA_MIPS64 7 | ||
36 | |||
37 | /* | ||
38 | * Subprogram calling convention | ||
39 | */ | ||
40 | #define _MIPS_SIM_ABI32 1 | ||
41 | #define _MIPS_SIM_NABI32 2 | ||
42 | #define _MIPS_SIM_ABI64 3 | ||
43 | |||
44 | #endif /* __ASM_SGIDEFS_H */ | ||
diff --git a/include/asm-mips/shmbuf.h b/include/asm-mips/shmbuf.h deleted file mode 100644 index f994438277bf..000000000000 --- a/include/asm-mips/shmbuf.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | #ifndef _ASM_SHMBUF_H | ||
2 | #define _ASM_SHMBUF_H | ||
3 | |||
4 | /* | ||
5 | * The shmid64_ds structure for the MIPS architecture. | ||
6 | * Note extra padding because this structure is passed back and forth | ||
7 | * between kernel and user space. | ||
8 | * | ||
9 | * Pad space is left for: | ||
10 | * - 2 miscellaneous 32-bit rsp. 64-bit values | ||
11 | */ | ||
12 | |||
13 | struct shmid64_ds { | ||
14 | struct ipc64_perm shm_perm; /* operation perms */ | ||
15 | size_t shm_segsz; /* size of segment (bytes) */ | ||
16 | __kernel_time_t shm_atime; /* last attach time */ | ||
17 | __kernel_time_t shm_dtime; /* last detach time */ | ||
18 | __kernel_time_t shm_ctime; /* last change time */ | ||
19 | __kernel_pid_t shm_cpid; /* pid of creator */ | ||
20 | __kernel_pid_t shm_lpid; /* pid of last operator */ | ||
21 | unsigned long shm_nattch; /* no. of current attaches */ | ||
22 | unsigned long __unused1; | ||
23 | unsigned long __unused2; | ||
24 | }; | ||
25 | |||
26 | struct shminfo64 { | ||
27 | unsigned long shmmax; | ||
28 | unsigned long shmmin; | ||
29 | unsigned long shmmni; | ||
30 | unsigned long shmseg; | ||
31 | unsigned long shmall; | ||
32 | unsigned long __unused1; | ||
33 | unsigned long __unused2; | ||
34 | unsigned long __unused3; | ||
35 | unsigned long __unused4; | ||
36 | }; | ||
37 | |||
38 | #endif /* _ASM_SHMBUF_H */ | ||
diff --git a/include/asm-mips/shmparam.h b/include/asm-mips/shmparam.h deleted file mode 100644 index 09290720751c..000000000000 --- a/include/asm-mips/shmparam.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | */ | ||
6 | #ifndef _ASM_SHMPARAM_H | ||
7 | #define _ASM_SHMPARAM_H | ||
8 | |||
9 | #define __ARCH_FORCE_SHMLBA 1 | ||
10 | |||
11 | #define SHMLBA 0x40000 /* attach addr a multiple of this */ | ||
12 | |||
13 | #endif /* _ASM_SHMPARAM_H */ | ||
diff --git a/include/asm-mips/sibyte/bcm1480_int.h b/include/asm-mips/sibyte/bcm1480_int.h deleted file mode 100644 index 6109557c14e9..000000000000 --- a/include/asm-mips/sibyte/bcm1480_int.h +++ /dev/null | |||
@@ -1,312 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * BCM1280/BCM1480 Board Support Package | ||
3 | * | ||
4 | * Interrupt Mapper definitions File: bcm1480_int.h | ||
5 | * | ||
6 | * This module contains constants for manipulating the | ||
7 | * BCM1255/BCM1280/BCM1455/BCM1480's interrupt mapper and | ||
8 | * definitions for the interrupt sources. | ||
9 | * | ||
10 | * BCM1480 specification level: 1X55_1X80-UM100-D4 (11/24/03) | ||
11 | * | ||
12 | ********************************************************************* | ||
13 | * | ||
14 | * Copyright 2000,2001,2002,2003 | ||
15 | * Broadcom Corporation. All rights reserved. | ||
16 | * | ||
17 | * This program is free software; you can redistribute it and/or | ||
18 | * modify it under the terms of the GNU General Public License as | ||
19 | * published by the Free Software Foundation; either version 2 of | ||
20 | * the License, or (at your option) any later version. | ||
21 | * | ||
22 | * This program is distributed in the hope that it will be useful, | ||
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
25 | * GNU General Public License for more details. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public License | ||
28 | * along with this program; if not, write to the Free Software | ||
29 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
30 | * MA 02111-1307 USA | ||
31 | ********************************************************************* */ | ||
32 | |||
33 | |||
34 | #ifndef _BCM1480_INT_H | ||
35 | #define _BCM1480_INT_H | ||
36 | |||
37 | #include "sb1250_defs.h" | ||
38 | |||
39 | /* ********************************************************************* | ||
40 | * Interrupt Mapper Constants | ||
41 | ********************************************************************* */ | ||
42 | |||
43 | /* | ||
44 | * The interrupt mapper deals with 128-bit logical registers that are | ||
45 | * implemented as pairs of 64-bit registers, with the "low" 64 bits in | ||
46 | * a register that has an address 0x1000 higher(!) than the | ||
47 | * corresponding "high" register. | ||
48 | * | ||
49 | * For appropriate registers, bit 0 of the "high" register is a | ||
50 | * cascade bit that summarizes (as a bit-OR) the 64 bits of the "low" | ||
51 | * register. | ||
52 | */ | ||
53 | |||
54 | /* | ||
55 | * This entire file uses _BCM1480_ in all the symbols because it is | ||
56 | * entirely BCM1480 specific. | ||
57 | */ | ||
58 | |||
59 | /* | ||
60 | * Interrupt sources (Table 22) | ||
61 | */ | ||
62 | |||
63 | #define K_BCM1480_INT_SOURCES 128 | ||
64 | |||
65 | #define _BCM1480_INT_HIGH(k) (k) | ||
66 | #define _BCM1480_INT_LOW(k) ((k)+64) | ||
67 | |||
68 | #define K_BCM1480_INT_ADDR_TRAP _BCM1480_INT_HIGH(1) | ||
69 | #define K_BCM1480_INT_GPIO_0 _BCM1480_INT_HIGH(4) | ||
70 | #define K_BCM1480_INT_GPIO_1 _BCM1480_INT_HIGH(5) | ||
71 | #define K_BCM1480_INT_GPIO_2 _BCM1480_INT_HIGH(6) | ||
72 | #define K_BCM1480_INT_GPIO_3 _BCM1480_INT_HIGH(7) | ||
73 | #define K_BCM1480_INT_PCI_INTA _BCM1480_INT_HIGH(8) | ||
74 | #define K_BCM1480_INT_PCI_INTB _BCM1480_INT_HIGH(9) | ||
75 | #define K_BCM1480_INT_PCI_INTC _BCM1480_INT_HIGH(10) | ||
76 | #define K_BCM1480_INT_PCI_INTD _BCM1480_INT_HIGH(11) | ||
77 | #define K_BCM1480_INT_CYCLE_CP0 _BCM1480_INT_HIGH(12) | ||
78 | #define K_BCM1480_INT_CYCLE_CP1 _BCM1480_INT_HIGH(13) | ||
79 | #define K_BCM1480_INT_CYCLE_CP2 _BCM1480_INT_HIGH(14) | ||
80 | #define K_BCM1480_INT_CYCLE_CP3 _BCM1480_INT_HIGH(15) | ||
81 | #define K_BCM1480_INT_TIMER_0 _BCM1480_INT_HIGH(20) | ||
82 | #define K_BCM1480_INT_TIMER_1 _BCM1480_INT_HIGH(21) | ||
83 | #define K_BCM1480_INT_TIMER_2 _BCM1480_INT_HIGH(22) | ||
84 | #define K_BCM1480_INT_TIMER_3 _BCM1480_INT_HIGH(23) | ||
85 | #define K_BCM1480_INT_DM_CH_0 _BCM1480_INT_HIGH(28) | ||
86 | #define K_BCM1480_INT_DM_CH_1 _BCM1480_INT_HIGH(29) | ||
87 | #define K_BCM1480_INT_DM_CH_2 _BCM1480_INT_HIGH(30) | ||
88 | #define K_BCM1480_INT_DM_CH_3 _BCM1480_INT_HIGH(31) | ||
89 | #define K_BCM1480_INT_MAC_0 _BCM1480_INT_HIGH(36) | ||
90 | #define K_BCM1480_INT_MAC_0_CH1 _BCM1480_INT_HIGH(37) | ||
91 | #define K_BCM1480_INT_MAC_1 _BCM1480_INT_HIGH(38) | ||
92 | #define K_BCM1480_INT_MAC_1_CH1 _BCM1480_INT_HIGH(39) | ||
93 | #define K_BCM1480_INT_MAC_2 _BCM1480_INT_HIGH(40) | ||
94 | #define K_BCM1480_INT_MAC_2_CH1 _BCM1480_INT_HIGH(41) | ||
95 | #define K_BCM1480_INT_MAC_3 _BCM1480_INT_HIGH(42) | ||
96 | #define K_BCM1480_INT_MAC_3_CH1 _BCM1480_INT_HIGH(43) | ||
97 | #define K_BCM1480_INT_PMI_LOW _BCM1480_INT_HIGH(52) | ||
98 | #define K_BCM1480_INT_PMI_HIGH _BCM1480_INT_HIGH(53) | ||
99 | #define K_BCM1480_INT_PMO_LOW _BCM1480_INT_HIGH(54) | ||
100 | #define K_BCM1480_INT_PMO_HIGH _BCM1480_INT_HIGH(55) | ||
101 | #define K_BCM1480_INT_MBOX_0_0 _BCM1480_INT_HIGH(56) | ||
102 | #define K_BCM1480_INT_MBOX_0_1 _BCM1480_INT_HIGH(57) | ||
103 | #define K_BCM1480_INT_MBOX_0_2 _BCM1480_INT_HIGH(58) | ||
104 | #define K_BCM1480_INT_MBOX_0_3 _BCM1480_INT_HIGH(59) | ||
105 | #define K_BCM1480_INT_MBOX_1_0 _BCM1480_INT_HIGH(60) | ||
106 | #define K_BCM1480_INT_MBOX_1_1 _BCM1480_INT_HIGH(61) | ||
107 | #define K_BCM1480_INT_MBOX_1_2 _BCM1480_INT_HIGH(62) | ||
108 | #define K_BCM1480_INT_MBOX_1_3 _BCM1480_INT_HIGH(63) | ||
109 | |||
110 | #define K_BCM1480_INT_BAD_ECC _BCM1480_INT_LOW(1) | ||
111 | #define K_BCM1480_INT_COR_ECC _BCM1480_INT_LOW(2) | ||
112 | #define K_BCM1480_INT_IO_BUS _BCM1480_INT_LOW(3) | ||
113 | #define K_BCM1480_INT_PERF_CNT _BCM1480_INT_LOW(4) | ||
114 | #define K_BCM1480_INT_SW_PERF_CNT _BCM1480_INT_LOW(5) | ||
115 | #define K_BCM1480_INT_TRACE_FREEZE _BCM1480_INT_LOW(6) | ||
116 | #define K_BCM1480_INT_SW_TRACE_FREEZE _BCM1480_INT_LOW(7) | ||
117 | #define K_BCM1480_INT_WATCHDOG_TIMER_0 _BCM1480_INT_LOW(8) | ||
118 | #define K_BCM1480_INT_WATCHDOG_TIMER_1 _BCM1480_INT_LOW(9) | ||
119 | #define K_BCM1480_INT_WATCHDOG_TIMER_2 _BCM1480_INT_LOW(10) | ||
120 | #define K_BCM1480_INT_WATCHDOG_TIMER_3 _BCM1480_INT_LOW(11) | ||
121 | #define K_BCM1480_INT_PCI_ERROR _BCM1480_INT_LOW(16) | ||
122 | #define K_BCM1480_INT_PCI_RESET _BCM1480_INT_LOW(17) | ||
123 | #define K_BCM1480_INT_NODE_CONTROLLER _BCM1480_INT_LOW(18) | ||
124 | #define K_BCM1480_INT_HOST_BRIDGE _BCM1480_INT_LOW(19) | ||
125 | #define K_BCM1480_INT_PORT_0_FATAL _BCM1480_INT_LOW(20) | ||
126 | #define K_BCM1480_INT_PORT_0_NONFATAL _BCM1480_INT_LOW(21) | ||
127 | #define K_BCM1480_INT_PORT_1_FATAL _BCM1480_INT_LOW(22) | ||
128 | #define K_BCM1480_INT_PORT_1_NONFATAL _BCM1480_INT_LOW(23) | ||
129 | #define K_BCM1480_INT_PORT_2_FATAL _BCM1480_INT_LOW(24) | ||
130 | #define K_BCM1480_INT_PORT_2_NONFATAL _BCM1480_INT_LOW(25) | ||
131 | #define K_BCM1480_INT_LDT_SMI _BCM1480_INT_LOW(32) | ||
132 | #define K_BCM1480_INT_LDT_NMI _BCM1480_INT_LOW(33) | ||
133 | #define K_BCM1480_INT_LDT_INIT _BCM1480_INT_LOW(34) | ||
134 | #define K_BCM1480_INT_LDT_STARTUP _BCM1480_INT_LOW(35) | ||
135 | #define K_BCM1480_INT_LDT_EXT _BCM1480_INT_LOW(36) | ||
136 | #define K_BCM1480_INT_SMB_0 _BCM1480_INT_LOW(40) | ||
137 | #define K_BCM1480_INT_SMB_1 _BCM1480_INT_LOW(41) | ||
138 | #define K_BCM1480_INT_PCMCIA _BCM1480_INT_LOW(42) | ||
139 | #define K_BCM1480_INT_UART_0 _BCM1480_INT_LOW(44) | ||
140 | #define K_BCM1480_INT_UART_1 _BCM1480_INT_LOW(45) | ||
141 | #define K_BCM1480_INT_UART_2 _BCM1480_INT_LOW(46) | ||
142 | #define K_BCM1480_INT_UART_3 _BCM1480_INT_LOW(47) | ||
143 | #define K_BCM1480_INT_GPIO_4 _BCM1480_INT_LOW(52) | ||
144 | #define K_BCM1480_INT_GPIO_5 _BCM1480_INT_LOW(53) | ||
145 | #define K_BCM1480_INT_GPIO_6 _BCM1480_INT_LOW(54) | ||
146 | #define K_BCM1480_INT_GPIO_7 _BCM1480_INT_LOW(55) | ||
147 | #define K_BCM1480_INT_GPIO_8 _BCM1480_INT_LOW(56) | ||
148 | #define K_BCM1480_INT_GPIO_9 _BCM1480_INT_LOW(57) | ||
149 | #define K_BCM1480_INT_GPIO_10 _BCM1480_INT_LOW(58) | ||
150 | #define K_BCM1480_INT_GPIO_11 _BCM1480_INT_LOW(59) | ||
151 | #define K_BCM1480_INT_GPIO_12 _BCM1480_INT_LOW(60) | ||
152 | #define K_BCM1480_INT_GPIO_13 _BCM1480_INT_LOW(61) | ||
153 | #define K_BCM1480_INT_GPIO_14 _BCM1480_INT_LOW(62) | ||
154 | #define K_BCM1480_INT_GPIO_15 _BCM1480_INT_LOW(63) | ||
155 | |||
156 | /* | ||
157 | * Mask values for each interrupt | ||
158 | */ | ||
159 | |||
160 | #define _BCM1480_INT_MASK(w, n) _SB_MAKEMASK(w, ((n) & 0x3F)) | ||
161 | #define _BCM1480_INT_MASK1(n) _SB_MAKEMASK1(((n) & 0x3F)) | ||
162 | #define _BCM1480_INT_OFFSET(n) (((n) & 0x40) << 6) | ||
163 | |||
164 | #define M_BCM1480_INT_CASCADE _BCM1480_INT_MASK1(_BCM1480_INT_HIGH(0)) | ||
165 | |||
166 | #define M_BCM1480_INT_ADDR_TRAP _BCM1480_INT_MASK1(K_BCM1480_INT_ADDR_TRAP) | ||
167 | #define M_BCM1480_INT_GPIO_0 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_0) | ||
168 | #define M_BCM1480_INT_GPIO_1 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_1) | ||
169 | #define M_BCM1480_INT_GPIO_2 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_2) | ||
170 | #define M_BCM1480_INT_GPIO_3 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_3) | ||
171 | #define M_BCM1480_INT_PCI_INTA _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTA) | ||
172 | #define M_BCM1480_INT_PCI_INTB _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTB) | ||
173 | #define M_BCM1480_INT_PCI_INTC _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTC) | ||
174 | #define M_BCM1480_INT_PCI_INTD _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTD) | ||
175 | #define M_BCM1480_INT_CYCLE_CP0 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP0) | ||
176 | #define M_BCM1480_INT_CYCLE_CP1 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP1) | ||
177 | #define M_BCM1480_INT_CYCLE_CP2 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP2) | ||
178 | #define M_BCM1480_INT_CYCLE_CP3 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP3) | ||
179 | #define M_BCM1480_INT_TIMER_0 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_0) | ||
180 | #define M_BCM1480_INT_TIMER_1 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_1) | ||
181 | #define M_BCM1480_INT_TIMER_2 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_2) | ||
182 | #define M_BCM1480_INT_TIMER_3 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_3) | ||
183 | #define M_BCM1480_INT_DM_CH_0 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_0) | ||
184 | #define M_BCM1480_INT_DM_CH_1 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_1) | ||
185 | #define M_BCM1480_INT_DM_CH_2 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_2) | ||
186 | #define M_BCM1480_INT_DM_CH_3 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_3) | ||
187 | #define M_BCM1480_INT_MAC_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_0) | ||
188 | #define M_BCM1480_INT_MAC_0_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_0_CH1) | ||
189 | #define M_BCM1480_INT_MAC_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_1) | ||
190 | #define M_BCM1480_INT_MAC_1_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_1_CH1) | ||
191 | #define M_BCM1480_INT_MAC_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_2) | ||
192 | #define M_BCM1480_INT_MAC_2_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_2_CH1) | ||
193 | #define M_BCM1480_INT_MAC_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_3) | ||
194 | #define M_BCM1480_INT_MAC_3_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_3_CH1) | ||
195 | #define M_BCM1480_INT_PMI_LOW _BCM1480_INT_MASK1(K_BCM1480_INT_PMI_LOW) | ||
196 | #define M_BCM1480_INT_PMI_HIGH _BCM1480_INT_MASK1(K_BCM1480_INT_PMI_HIGH) | ||
197 | #define M_BCM1480_INT_PMO_LOW _BCM1480_INT_MASK1(K_BCM1480_INT_PMO_LOW) | ||
198 | #define M_BCM1480_INT_PMO_HIGH _BCM1480_INT_MASK1(K_BCM1480_INT_PMO_HIGH) | ||
199 | #define M_BCM1480_INT_MBOX_ALL _BCM1480_INT_MASK(8, K_BCM1480_INT_MBOX_0_0) | ||
200 | #define M_BCM1480_INT_MBOX_0_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_0) | ||
201 | #define M_BCM1480_INT_MBOX_0_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_1) | ||
202 | #define M_BCM1480_INT_MBOX_0_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_2) | ||
203 | #define M_BCM1480_INT_MBOX_0_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_3) | ||
204 | #define M_BCM1480_INT_MBOX_1_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_0) | ||
205 | #define M_BCM1480_INT_MBOX_1_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_1) | ||
206 | #define M_BCM1480_INT_MBOX_1_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_2) | ||
207 | #define M_BCM1480_INT_MBOX_1_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_3) | ||
208 | #define M_BCM1480_INT_BAD_ECC _BCM1480_INT_MASK1(K_BCM1480_INT_BAD_ECC) | ||
209 | #define M_BCM1480_INT_COR_ECC _BCM1480_INT_MASK1(K_BCM1480_INT_COR_ECC) | ||
210 | #define M_BCM1480_INT_IO_BUS _BCM1480_INT_MASK1(K_BCM1480_INT_IO_BUS) | ||
211 | #define M_BCM1480_INT_PERF_CNT _BCM1480_INT_MASK1(K_BCM1480_INT_PERF_CNT) | ||
212 | #define M_BCM1480_INT_SW_PERF_CNT _BCM1480_INT_MASK1(K_BCM1480_INT_SW_PERF_CNT) | ||
213 | #define M_BCM1480_INT_TRACE_FREEZE _BCM1480_INT_MASK1(K_BCM1480_INT_TRACE_FREEZE) | ||
214 | #define M_BCM1480_INT_SW_TRACE_FREEZE _BCM1480_INT_MASK1(K_BCM1480_INT_SW_TRACE_FREEZE) | ||
215 | #define M_BCM1480_INT_WATCHDOG_TIMER_0 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_0) | ||
216 | #define M_BCM1480_INT_WATCHDOG_TIMER_1 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_1) | ||
217 | #define M_BCM1480_INT_WATCHDOG_TIMER_2 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_2) | ||
218 | #define M_BCM1480_INT_WATCHDOG_TIMER_3 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_3) | ||
219 | #define M_BCM1480_INT_PCI_ERROR _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_ERROR) | ||
220 | #define M_BCM1480_INT_PCI_RESET _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_RESET) | ||
221 | #define M_BCM1480_INT_NODE_CONTROLLER _BCM1480_INT_MASK1(K_BCM1480_INT_NODE_CONTROLLER) | ||
222 | #define M_BCM1480_INT_HOST_BRIDGE _BCM1480_INT_MASK1(K_BCM1480_INT_HOST_BRIDGE) | ||
223 | #define M_BCM1480_INT_PORT_0_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_0_FATAL) | ||
224 | #define M_BCM1480_INT_PORT_0_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_0_NONFATAL) | ||
225 | #define M_BCM1480_INT_PORT_1_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_1_FATAL) | ||
226 | #define M_BCM1480_INT_PORT_1_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_1_NONFATAL) | ||
227 | #define M_BCM1480_INT_PORT_2_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_2_FATAL) | ||
228 | #define M_BCM1480_INT_PORT_2_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_2_NONFATAL) | ||
229 | #define M_BCM1480_INT_LDT_SMI _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_SMI) | ||
230 | #define M_BCM1480_INT_LDT_NMI _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_NMI) | ||
231 | #define M_BCM1480_INT_LDT_INIT _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_INIT) | ||
232 | #define M_BCM1480_INT_LDT_STARTUP _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_STARTUP) | ||
233 | #define M_BCM1480_INT_LDT_EXT _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_EXT) | ||
234 | #define M_BCM1480_INT_SMB_0 _BCM1480_INT_MASK1(K_BCM1480_INT_SMB_0) | ||
235 | #define M_BCM1480_INT_SMB_1 _BCM1480_INT_MASK1(K_BCM1480_INT_SMB_1) | ||
236 | #define M_BCM1480_INT_PCMCIA _BCM1480_INT_MASK1(K_BCM1480_INT_PCMCIA) | ||
237 | #define M_BCM1480_INT_UART_0 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_0) | ||
238 | #define M_BCM1480_INT_UART_1 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_1) | ||
239 | #define M_BCM1480_INT_UART_2 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_2) | ||
240 | #define M_BCM1480_INT_UART_3 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_3) | ||
241 | #define M_BCM1480_INT_GPIO_4 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_4) | ||
242 | #define M_BCM1480_INT_GPIO_5 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_5) | ||
243 | #define M_BCM1480_INT_GPIO_6 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_6) | ||
244 | #define M_BCM1480_INT_GPIO_7 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_7) | ||
245 | #define M_BCM1480_INT_GPIO_8 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_8) | ||
246 | #define M_BCM1480_INT_GPIO_9 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_9) | ||
247 | #define M_BCM1480_INT_GPIO_10 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_10) | ||
248 | #define M_BCM1480_INT_GPIO_11 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_11) | ||
249 | #define M_BCM1480_INT_GPIO_12 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_12) | ||
250 | #define M_BCM1480_INT_GPIO_13 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_13) | ||
251 | #define M_BCM1480_INT_GPIO_14 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_14) | ||
252 | #define M_BCM1480_INT_GPIO_15 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_15) | ||
253 | |||
254 | /* | ||
255 | * Interrupt mappings (Table 18) | ||
256 | */ | ||
257 | |||
258 | #define K_BCM1480_INT_MAP_I0 0 /* interrupt pins on processor */ | ||
259 | #define K_BCM1480_INT_MAP_I1 1 | ||
260 | #define K_BCM1480_INT_MAP_I2 2 | ||
261 | #define K_BCM1480_INT_MAP_I3 3 | ||
262 | #define K_BCM1480_INT_MAP_I4 4 | ||
263 | #define K_BCM1480_INT_MAP_I5 5 | ||
264 | #define K_BCM1480_INT_MAP_NMI 6 /* nonmaskable */ | ||
265 | #define K_BCM1480_INT_MAP_DINT 7 /* debug interrupt */ | ||
266 | |||
267 | /* | ||
268 | * Interrupt LDT Set Register (Table 19) | ||
269 | */ | ||
270 | |||
271 | #define S_BCM1480_INT_HT_INTMSG 0 | ||
272 | #define M_BCM1480_INT_HT_INTMSG _SB_MAKEMASK(3, S_BCM1480_INT_HT_INTMSG) | ||
273 | #define V_BCM1480_INT_HT_INTMSG(x) _SB_MAKEVALUE(x, S_BCM1480_INT_HT_INTMSG) | ||
274 | #define G_BCM1480_INT_HT_INTMSG(x) _SB_GETVALUE(x, S_BCM1480_INT_HT_INTMSG, M_BCM1480_INT_HT_INTMSG) | ||
275 | |||
276 | #define K_BCM1480_INT_HT_INTMSG_FIXED 0 | ||
277 | #define K_BCM1480_INT_HT_INTMSG_ARBITRATED 1 | ||
278 | #define K_BCM1480_INT_HT_INTMSG_SMI 2 | ||
279 | #define K_BCM1480_INT_HT_INTMSG_NMI 3 | ||
280 | #define K_BCM1480_INT_HT_INTMSG_INIT 4 | ||
281 | #define K_BCM1480_INT_HT_INTMSG_STARTUP 5 | ||
282 | #define K_BCM1480_INT_HT_INTMSG_EXTINT 6 | ||
283 | #define K_BCM1480_INT_HT_INTMSG_RESERVED 7 | ||
284 | |||
285 | #define M_BCM1480_INT_HT_TRIGGERMODE _SB_MAKEMASK1(3) | ||
286 | #define V_BCM1480_INT_HT_EDGETRIGGER 0 | ||
287 | #define V_BCM1480_INT_HT_LEVELTRIGGER M_BCM1480_INT_HT_TRIGGERMODE | ||
288 | |||
289 | #define M_BCM1480_INT_HT_DESTMODE _SB_MAKEMASK1(4) | ||
290 | #define V_BCM1480_INT_HT_PHYSICALDEST 0 | ||
291 | #define V_BCM1480_INT_HT_LOGICALDEST M_BCM1480_INT_HT_DESTMODE | ||
292 | |||
293 | #define S_BCM1480_INT_HT_INTDEST 5 | ||
294 | #define M_BCM1480_INT_HT_INTDEST _SB_MAKEMASK(8, S_BCM1480_INT_HT_INTDEST) | ||
295 | #define V_BCM1480_INT_HT_INTDEST(x) _SB_MAKEVALUE(x, S_BCM1480_INT_HT_INTDEST) | ||
296 | #define G_BCM1480_INT_HT_INTDEST(x) _SB_GETVALUE(x, S_BCM1480_INT_HT_INTDEST, M_BCM1480_INT_HT_INTDEST) | ||
297 | |||
298 | #define S_BCM1480_INT_HT_VECTOR 13 | ||
299 | #define M_BCM1480_INT_HT_VECTOR _SB_MAKEMASK(8, S_BCM1480_INT_HT_VECTOR) | ||
300 | #define V_BCM1480_INT_HT_VECTOR(x) _SB_MAKEVALUE(x, S_BCM1480_INT_HT_VECTOR) | ||
301 | #define G_BCM1480_INT_HT_VECTOR(x) _SB_GETVALUE(x, S_BCM1480_INT_HT_VECTOR, M_BCM1480_INT_HT_VECTOR) | ||
302 | |||
303 | /* | ||
304 | * Vector prefix (Table 4-7) | ||
305 | */ | ||
306 | |||
307 | #define M_BCM1480_HTVECT_RAISE_INTLDT_HIGH 0x00 | ||
308 | #define M_BCM1480_HTVECT_RAISE_MBOX_0 0x40 | ||
309 | #define M_BCM1480_HTVECT_RAISE_INTLDT_LO 0x80 | ||
310 | #define M_BCM1480_HTVECT_RAISE_MBOX_1 0xC0 | ||
311 | |||
312 | #endif /* _BCM1480_INT_H */ | ||
diff --git a/include/asm-mips/sibyte/bcm1480_l2c.h b/include/asm-mips/sibyte/bcm1480_l2c.h deleted file mode 100644 index fd75817f7ac4..000000000000 --- a/include/asm-mips/sibyte/bcm1480_l2c.h +++ /dev/null | |||
@@ -1,176 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * BCM1280/BCM1480 Board Support Package | ||
3 | * | ||
4 | * L2 Cache constants and macros File: bcm1480_l2c.h | ||
5 | * | ||
6 | * This module contains constants useful for manipulating the | ||
7 | * level 2 cache. | ||
8 | * | ||
9 | * BCM1400 specification level: 1280-UM100-D2 (11/14/03) | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _BCM1480_L2C_H | ||
34 | #define _BCM1480_L2C_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | /* | ||
39 | * Format of level 2 cache management address (Table 55) | ||
40 | */ | ||
41 | |||
42 | #define S_BCM1480_L2C_MGMT_INDEX 5 | ||
43 | #define M_BCM1480_L2C_MGMT_INDEX _SB_MAKEMASK(12, S_BCM1480_L2C_MGMT_INDEX) | ||
44 | #define V_BCM1480_L2C_MGMT_INDEX(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_INDEX) | ||
45 | #define G_BCM1480_L2C_MGMT_INDEX(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_INDEX, M_BCM1480_L2C_MGMT_INDEX) | ||
46 | |||
47 | #define S_BCM1480_L2C_MGMT_WAY 17 | ||
48 | #define M_BCM1480_L2C_MGMT_WAY _SB_MAKEMASK(3, S_BCM1480_L2C_MGMT_WAY) | ||
49 | #define V_BCM1480_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_WAY) | ||
50 | #define G_BCM1480_L2C_MGMT_WAY(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_WAY, M_BCM1480_L2C_MGMT_WAY) | ||
51 | |||
52 | #define M_BCM1480_L2C_MGMT_DIRTY _SB_MAKEMASK1(20) | ||
53 | #define M_BCM1480_L2C_MGMT_VALID _SB_MAKEMASK1(21) | ||
54 | |||
55 | #define S_BCM1480_L2C_MGMT_ECC_DIAG 22 | ||
56 | #define M_BCM1480_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2, S_BCM1480_L2C_MGMT_ECC_DIAG) | ||
57 | #define V_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_ECC_DIAG) | ||
58 | #define G_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_ECC_DIAG, M_BCM1480_L2C_MGMT_ECC_DIAG) | ||
59 | |||
60 | #define A_BCM1480_L2C_MGMT_TAG_BASE 0x00D0000000 | ||
61 | |||
62 | #define BCM1480_L2C_ENTRIES_PER_WAY 4096 | ||
63 | #define BCM1480_L2C_NUM_WAYS 8 | ||
64 | |||
65 | |||
66 | /* | ||
67 | * Level 2 Cache Tag register (Table 59) | ||
68 | */ | ||
69 | |||
70 | #define S_BCM1480_L2C_TAG_MBZ 0 | ||
71 | #define M_BCM1480_L2C_TAG_MBZ _SB_MAKEMASK(5, S_BCM1480_L2C_TAG_MBZ) | ||
72 | |||
73 | #define S_BCM1480_L2C_TAG_INDEX 5 | ||
74 | #define M_BCM1480_L2C_TAG_INDEX _SB_MAKEMASK(12, S_BCM1480_L2C_TAG_INDEX) | ||
75 | #define V_BCM1480_L2C_TAG_INDEX(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_INDEX) | ||
76 | #define G_BCM1480_L2C_TAG_INDEX(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_INDEX, M_BCM1480_L2C_TAG_INDEX) | ||
77 | |||
78 | /* Note that index bit 16 is also tag bit 40 */ | ||
79 | #define S_BCM1480_L2C_TAG_TAG 17 | ||
80 | #define M_BCM1480_L2C_TAG_TAG _SB_MAKEMASK(23, S_BCM1480_L2C_TAG_TAG) | ||
81 | #define V_BCM1480_L2C_TAG_TAG(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_TAG) | ||
82 | #define G_BCM1480_L2C_TAG_TAG(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_TAG, M_BCM1480_L2C_TAG_TAG) | ||
83 | |||
84 | #define S_BCM1480_L2C_TAG_ECC 40 | ||
85 | #define M_BCM1480_L2C_TAG_ECC _SB_MAKEMASK(6, S_BCM1480_L2C_TAG_ECC) | ||
86 | #define V_BCM1480_L2C_TAG_ECC(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_ECC) | ||
87 | #define G_BCM1480_L2C_TAG_ECC(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_ECC, M_BCM1480_L2C_TAG_ECC) | ||
88 | |||
89 | #define S_BCM1480_L2C_TAG_WAY 46 | ||
90 | #define M_BCM1480_L2C_TAG_WAY _SB_MAKEMASK(3, S_BCM1480_L2C_TAG_WAY) | ||
91 | #define V_BCM1480_L2C_TAG_WAY(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_WAY) | ||
92 | #define G_BCM1480_L2C_TAG_WAY(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_WAY, M_BCM1480_L2C_TAG_WAY) | ||
93 | |||
94 | #define M_BCM1480_L2C_TAG_DIRTY _SB_MAKEMASK1(49) | ||
95 | #define M_BCM1480_L2C_TAG_VALID _SB_MAKEMASK1(50) | ||
96 | |||
97 | #define S_BCM1480_L2C_DATA_ECC 51 | ||
98 | #define M_BCM1480_L2C_DATA_ECC _SB_MAKEMASK(10, S_BCM1480_L2C_DATA_ECC) | ||
99 | #define V_BCM1480_L2C_DATA_ECC(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_DATA_ECC) | ||
100 | #define G_BCM1480_L2C_DATA_ECC(x) _SB_GETVALUE(x, S_BCM1480_L2C_DATA_ECC, M_BCM1480_L2C_DATA_ECC) | ||
101 | |||
102 | |||
103 | /* | ||
104 | * L2 Misc0 Value Register (Table 60) | ||
105 | */ | ||
106 | |||
107 | #define S_BCM1480_L2C_MISC0_WAY_REMOTE 0 | ||
108 | #define M_BCM1480_L2C_MISC0_WAY_REMOTE _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_REMOTE) | ||
109 | #define G_BCM1480_L2C_MISC0_WAY_REMOTE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_REMOTE, M_BCM1480_L2C_MISC0_WAY_REMOTE) | ||
110 | |||
111 | #define S_BCM1480_L2C_MISC0_WAY_LOCAL 8 | ||
112 | #define M_BCM1480_L2C_MISC0_WAY_LOCAL _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_LOCAL) | ||
113 | #define G_BCM1480_L2C_MISC0_WAY_LOCAL(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_LOCAL, M_BCM1480_L2C_MISC0_WAY_LOCAL) | ||
114 | |||
115 | #define S_BCM1480_L2C_MISC0_WAY_ENABLE 16 | ||
116 | #define M_BCM1480_L2C_MISC0_WAY_ENABLE _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_ENABLE) | ||
117 | #define G_BCM1480_L2C_MISC0_WAY_ENABLE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_ENABLE, M_BCM1480_L2C_MISC0_WAY_ENABLE) | ||
118 | |||
119 | #define S_BCM1480_L2C_MISC0_CACHE_DISABLE 24 | ||
120 | #define M_BCM1480_L2C_MISC0_CACHE_DISABLE _SB_MAKEMASK(2, S_BCM1480_L2C_MISC0_CACHE_DISABLE) | ||
121 | #define G_BCM1480_L2C_MISC0_CACHE_DISABLE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_CACHE_DISABLE, M_BCM1480_L2C_MISC0_CACHE_DISABLE) | ||
122 | |||
123 | #define S_BCM1480_L2C_MISC0_CACHE_QUAD 26 | ||
124 | #define M_BCM1480_L2C_MISC0_CACHE_QUAD _SB_MAKEMASK(2, S_BCM1480_L2C_MISC0_CACHE_QUAD) | ||
125 | #define G_BCM1480_L2C_MISC0_CACHE_QUAD(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_CACHE_QUAD, M_BCM1480_L2C_MISC0_CACHE_QUAD) | ||
126 | |||
127 | #define S_BCM1480_L2C_MISC0_MC_PRIORITY 30 | ||
128 | #define M_BCM1480_L2C_MISC0_MC_PRIORITY _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_MC_PRIORITY) | ||
129 | |||
130 | #define S_BCM1480_L2C_MISC0_ECC_CLEANUP 31 | ||
131 | #define M_BCM1480_L2C_MISC0_ECC_CLEANUP _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_ECC_CLEANUP) | ||
132 | |||
133 | |||
134 | /* | ||
135 | * L2 Misc1 Value Register (Table 60) | ||
136 | */ | ||
137 | |||
138 | #define S_BCM1480_L2C_MISC1_WAY_AGENT_0 0 | ||
139 | #define M_BCM1480_L2C_MISC1_WAY_AGENT_0 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_0) | ||
140 | #define G_BCM1480_L2C_MISC1_WAY_AGENT_0(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_0, M_BCM1480_L2C_MISC1_WAY_AGENT_0) | ||
141 | |||
142 | #define S_BCM1480_L2C_MISC1_WAY_AGENT_1 8 | ||
143 | #define M_BCM1480_L2C_MISC1_WAY_AGENT_1 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_1) | ||
144 | #define G_BCM1480_L2C_MISC1_WAY_AGENT_1(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_1, M_BCM1480_L2C_MISC1_WAY_AGENT_1) | ||
145 | |||
146 | #define S_BCM1480_L2C_MISC1_WAY_AGENT_2 16 | ||
147 | #define M_BCM1480_L2C_MISC1_WAY_AGENT_2 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_2) | ||
148 | #define G_BCM1480_L2C_MISC1_WAY_AGENT_2(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_2, M_BCM1480_L2C_MISC1_WAY_AGENT_2) | ||
149 | |||
150 | #define S_BCM1480_L2C_MISC1_WAY_AGENT_3 24 | ||
151 | #define M_BCM1480_L2C_MISC1_WAY_AGENT_3 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_3) | ||
152 | #define G_BCM1480_L2C_MISC1_WAY_AGENT_3(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_3, M_BCM1480_L2C_MISC1_WAY_AGENT_3) | ||
153 | |||
154 | #define S_BCM1480_L2C_MISC1_WAY_AGENT_4 32 | ||
155 | #define M_BCM1480_L2C_MISC1_WAY_AGENT_4 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_4) | ||
156 | #define G_BCM1480_L2C_MISC1_WAY_AGENT_4(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_4, M_BCM1480_L2C_MISC1_WAY_AGENT_4) | ||
157 | |||
158 | |||
159 | /* | ||
160 | * L2 Misc2 Value Register (Table 60) | ||
161 | */ | ||
162 | |||
163 | #define S_BCM1480_L2C_MISC2_WAY_AGENT_8 0 | ||
164 | #define M_BCM1480_L2C_MISC2_WAY_AGENT_8 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_8) | ||
165 | #define G_BCM1480_L2C_MISC2_WAY_AGENT_8(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC2_WAY_AGENT_8, M_BCM1480_L2C_MISC2_WAY_AGENT_8) | ||
166 | |||
167 | #define S_BCM1480_L2C_MISC2_WAY_AGENT_9 8 | ||
168 | #define M_BCM1480_L2C_MISC2_WAY_AGENT_9 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_9) | ||
169 | #define G_BCM1480_L2C_MISC2_WAY_AGENT_9(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC2_WAY_AGENT_9, M_BCM1480_L2C_MISC2_WAY_AGENT_9) | ||
170 | |||
171 | #define S_BCM1480_L2C_MISC2_WAY_AGENT_A 16 | ||
172 | #define M_BCM1480_L2C_MISC2_WAY_AGENT_A _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_A) | ||
173 | #define G_BCM1480_L2C_MISC2_WAY_AGENT_A(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC2_WAY_AGENT_A, M_BCM1480_L2C_MISC2_WAY_AGENT_A) | ||
174 | |||
175 | |||
176 | #endif /* _BCM1480_L2C_H */ | ||
diff --git a/include/asm-mips/sibyte/bcm1480_mc.h b/include/asm-mips/sibyte/bcm1480_mc.h deleted file mode 100644 index f26a41a82b59..000000000000 --- a/include/asm-mips/sibyte/bcm1480_mc.h +++ /dev/null | |||
@@ -1,984 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * BCM1280/BCM1480 Board Support Package | ||
3 | * | ||
4 | * Memory Controller constants File: bcm1480_mc.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * programming the memory controller. | ||
8 | * | ||
9 | * BCM1400 specification level: 1280-UM100-D1 (11/14/03 Review Copy) | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _BCM1480_MC_H | ||
34 | #define _BCM1480_MC_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | /* | ||
39 | * Memory Channel Configuration Register (Table 81) | ||
40 | */ | ||
41 | |||
42 | #define S_BCM1480_MC_INTLV0 0 | ||
43 | #define M_BCM1480_MC_INTLV0 _SB_MAKEMASK(6, S_BCM1480_MC_INTLV0) | ||
44 | #define V_BCM1480_MC_INTLV0(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV0) | ||
45 | #define G_BCM1480_MC_INTLV0(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV0, M_BCM1480_MC_INTLV0) | ||
46 | #define V_BCM1480_MC_INTLV0_DEFAULT V_BCM1480_MC_INTLV0(0) | ||
47 | |||
48 | #define S_BCM1480_MC_INTLV1 8 | ||
49 | #define M_BCM1480_MC_INTLV1 _SB_MAKEMASK(6, S_BCM1480_MC_INTLV1) | ||
50 | #define V_BCM1480_MC_INTLV1(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV1) | ||
51 | #define G_BCM1480_MC_INTLV1(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV1, M_BCM1480_MC_INTLV1) | ||
52 | #define V_BCM1480_MC_INTLV1_DEFAULT V_BCM1480_MC_INTLV1(0) | ||
53 | |||
54 | #define S_BCM1480_MC_INTLV2 16 | ||
55 | #define M_BCM1480_MC_INTLV2 _SB_MAKEMASK(6, S_BCM1480_MC_INTLV2) | ||
56 | #define V_BCM1480_MC_INTLV2(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV2) | ||
57 | #define G_BCM1480_MC_INTLV2(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV2, M_BCM1480_MC_INTLV2) | ||
58 | #define V_BCM1480_MC_INTLV2_DEFAULT V_BCM1480_MC_INTLV2(0) | ||
59 | |||
60 | #define S_BCM1480_MC_CS_MODE 32 | ||
61 | #define M_BCM1480_MC_CS_MODE _SB_MAKEMASK(8, S_BCM1480_MC_CS_MODE) | ||
62 | #define V_BCM1480_MC_CS_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS_MODE) | ||
63 | #define G_BCM1480_MC_CS_MODE(x) _SB_GETVALUE(x, S_BCM1480_MC_CS_MODE, M_BCM1480_MC_CS_MODE) | ||
64 | #define V_BCM1480_MC_CS_MODE_DEFAULT V_BCM1480_MC_CS_MODE(0) | ||
65 | |||
66 | #define V_BCM1480_MC_CONFIG_DEFAULT (V_BCM1480_MC_INTLV0_DEFAULT | \ | ||
67 | V_BCM1480_MC_INTLV1_DEFAULT | \ | ||
68 | V_BCM1480_MC_INTLV2_DEFAULT | \ | ||
69 | V_BCM1480_MC_CS_MODE_DEFAULT) | ||
70 | |||
71 | #define K_BCM1480_MC_CS01_MODE 0x03 | ||
72 | #define K_BCM1480_MC_CS02_MODE 0x05 | ||
73 | #define K_BCM1480_MC_CS0123_MODE 0x0F | ||
74 | #define K_BCM1480_MC_CS0246_MODE 0x55 | ||
75 | #define K_BCM1480_MC_CS0145_MODE 0x33 | ||
76 | #define K_BCM1480_MC_CS0167_MODE 0xC3 | ||
77 | #define K_BCM1480_MC_CSFULL_MODE 0xFF | ||
78 | |||
79 | /* | ||
80 | * Chip Select Start Address Register (Table 82) | ||
81 | */ | ||
82 | |||
83 | #define S_BCM1480_MC_CS0_START 0 | ||
84 | #define M_BCM1480_MC_CS0_START _SB_MAKEMASK(12, S_BCM1480_MC_CS0_START) | ||
85 | #define V_BCM1480_MC_CS0_START(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS0_START) | ||
86 | #define G_BCM1480_MC_CS0_START(x) _SB_GETVALUE(x, S_BCM1480_MC_CS0_START, M_BCM1480_MC_CS0_START) | ||
87 | |||
88 | #define S_BCM1480_MC_CS1_START 16 | ||
89 | #define M_BCM1480_MC_CS1_START _SB_MAKEMASK(12, S_BCM1480_MC_CS1_START) | ||
90 | #define V_BCM1480_MC_CS1_START(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS1_START) | ||
91 | #define G_BCM1480_MC_CS1_START(x) _SB_GETVALUE(x, S_BCM1480_MC_CS1_START, M_BCM1480_MC_CS1_START) | ||
92 | |||
93 | #define S_BCM1480_MC_CS2_START 32 | ||
94 | #define M_BCM1480_MC_CS2_START _SB_MAKEMASK(12, S_BCM1480_MC_CS2_START) | ||
95 | #define V_BCM1480_MC_CS2_START(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS2_START) | ||
96 | #define G_BCM1480_MC_CS2_START(x) _SB_GETVALUE(x, S_BCM1480_MC_CS2_START, M_BCM1480_MC_CS2_START) | ||
97 | |||
98 | #define S_BCM1480_MC_CS3_START 48 | ||
99 | #define M_BCM1480_MC_CS3_START _SB_MAKEMASK(12, S_BCM1480_MC_CS3_START) | ||
100 | #define V_BCM1480_MC_CS3_START(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS3_START) | ||
101 | #define G_BCM1480_MC_CS3_START(x) _SB_GETVALUE(x, S_BCM1480_MC_CS3_START, M_BCM1480_MC_CS3_START) | ||
102 | |||
103 | /* | ||
104 | * Chip Select End Address Register (Table 83) | ||
105 | */ | ||
106 | |||
107 | #define S_BCM1480_MC_CS0_END 0 | ||
108 | #define M_BCM1480_MC_CS0_END _SB_MAKEMASK(12, S_BCM1480_MC_CS0_END) | ||
109 | #define V_BCM1480_MC_CS0_END(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS0_END) | ||
110 | #define G_BCM1480_MC_CS0_END(x) _SB_GETVALUE(x, S_BCM1480_MC_CS0_END, M_BCM1480_MC_CS0_END) | ||
111 | |||
112 | #define S_BCM1480_MC_CS1_END 16 | ||
113 | #define M_BCM1480_MC_CS1_END _SB_MAKEMASK(12, S_BCM1480_MC_CS1_END) | ||
114 | #define V_BCM1480_MC_CS1_END(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS1_END) | ||
115 | #define G_BCM1480_MC_CS1_END(x) _SB_GETVALUE(x, S_BCM1480_MC_CS1_END, M_BCM1480_MC_CS1_END) | ||
116 | |||
117 | #define S_BCM1480_MC_CS2_END 32 | ||
118 | #define M_BCM1480_MC_CS2_END _SB_MAKEMASK(12, S_BCM1480_MC_CS2_END) | ||
119 | #define V_BCM1480_MC_CS2_END(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS2_END) | ||
120 | #define G_BCM1480_MC_CS2_END(x) _SB_GETVALUE(x, S_BCM1480_MC_CS2_END, M_BCM1480_MC_CS2_END) | ||
121 | |||
122 | #define S_BCM1480_MC_CS3_END 48 | ||
123 | #define M_BCM1480_MC_CS3_END _SB_MAKEMASK(12, S_BCM1480_MC_CS3_END) | ||
124 | #define V_BCM1480_MC_CS3_END(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS3_END) | ||
125 | #define G_BCM1480_MC_CS3_END(x) _SB_GETVALUE(x, S_BCM1480_MC_CS3_END, M_BCM1480_MC_CS3_END) | ||
126 | |||
127 | /* | ||
128 | * Row Address Bit Select Register 0 (Table 84) | ||
129 | */ | ||
130 | |||
131 | #define S_BCM1480_MC_ROW00 0 | ||
132 | #define M_BCM1480_MC_ROW00 _SB_MAKEMASK(6, S_BCM1480_MC_ROW00) | ||
133 | #define V_BCM1480_MC_ROW00(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW00) | ||
134 | #define G_BCM1480_MC_ROW00(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW00, M_BCM1480_MC_ROW00) | ||
135 | |||
136 | #define S_BCM1480_MC_ROW01 8 | ||
137 | #define M_BCM1480_MC_ROW01 _SB_MAKEMASK(6, S_BCM1480_MC_ROW01) | ||
138 | #define V_BCM1480_MC_ROW01(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW01) | ||
139 | #define G_BCM1480_MC_ROW01(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW01, M_BCM1480_MC_ROW01) | ||
140 | |||
141 | #define S_BCM1480_MC_ROW02 16 | ||
142 | #define M_BCM1480_MC_ROW02 _SB_MAKEMASK(6, S_BCM1480_MC_ROW02) | ||
143 | #define V_BCM1480_MC_ROW02(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW02) | ||
144 | #define G_BCM1480_MC_ROW02(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW02, M_BCM1480_MC_ROW02) | ||
145 | |||
146 | #define S_BCM1480_MC_ROW03 24 | ||
147 | #define M_BCM1480_MC_ROW03 _SB_MAKEMASK(6, S_BCM1480_MC_ROW03) | ||
148 | #define V_BCM1480_MC_ROW03(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW03) | ||
149 | #define G_BCM1480_MC_ROW03(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW03, M_BCM1480_MC_ROW03) | ||
150 | |||
151 | #define S_BCM1480_MC_ROW04 32 | ||
152 | #define M_BCM1480_MC_ROW04 _SB_MAKEMASK(6, S_BCM1480_MC_ROW04) | ||
153 | #define V_BCM1480_MC_ROW04(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW04) | ||
154 | #define G_BCM1480_MC_ROW04(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW04, M_BCM1480_MC_ROW04) | ||
155 | |||
156 | #define S_BCM1480_MC_ROW05 40 | ||
157 | #define M_BCM1480_MC_ROW05 _SB_MAKEMASK(6, S_BCM1480_MC_ROW05) | ||
158 | #define V_BCM1480_MC_ROW05(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW05) | ||
159 | #define G_BCM1480_MC_ROW05(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW05, M_BCM1480_MC_ROW05) | ||
160 | |||
161 | #define S_BCM1480_MC_ROW06 48 | ||
162 | #define M_BCM1480_MC_ROW06 _SB_MAKEMASK(6, S_BCM1480_MC_ROW06) | ||
163 | #define V_BCM1480_MC_ROW06(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW06) | ||
164 | #define G_BCM1480_MC_ROW06(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW06, M_BCM1480_MC_ROW06) | ||
165 | |||
166 | #define S_BCM1480_MC_ROW07 56 | ||
167 | #define M_BCM1480_MC_ROW07 _SB_MAKEMASK(6, S_BCM1480_MC_ROW07) | ||
168 | #define V_BCM1480_MC_ROW07(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW07) | ||
169 | #define G_BCM1480_MC_ROW07(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW07, M_BCM1480_MC_ROW07) | ||
170 | |||
171 | /* | ||
172 | * Row Address Bit Select Register 1 (Table 85) | ||
173 | */ | ||
174 | |||
175 | #define S_BCM1480_MC_ROW08 0 | ||
176 | #define M_BCM1480_MC_ROW08 _SB_MAKEMASK(6, S_BCM1480_MC_ROW08) | ||
177 | #define V_BCM1480_MC_ROW08(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW08) | ||
178 | #define G_BCM1480_MC_ROW08(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW08, M_BCM1480_MC_ROW08) | ||
179 | |||
180 | #define S_BCM1480_MC_ROW09 8 | ||
181 | #define M_BCM1480_MC_ROW09 _SB_MAKEMASK(6, S_BCM1480_MC_ROW09) | ||
182 | #define V_BCM1480_MC_ROW09(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW09) | ||
183 | #define G_BCM1480_MC_ROW09(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW09, M_BCM1480_MC_ROW09) | ||
184 | |||
185 | #define S_BCM1480_MC_ROW10 16 | ||
186 | #define M_BCM1480_MC_ROW10 _SB_MAKEMASK(6, S_BCM1480_MC_ROW10) | ||
187 | #define V_BCM1480_MC_ROW10(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW10) | ||
188 | #define G_BCM1480_MC_ROW10(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW10, M_BCM1480_MC_ROW10) | ||
189 | |||
190 | #define S_BCM1480_MC_ROW11 24 | ||
191 | #define M_BCM1480_MC_ROW11 _SB_MAKEMASK(6, S_BCM1480_MC_ROW11) | ||
192 | #define V_BCM1480_MC_ROW11(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW11) | ||
193 | #define G_BCM1480_MC_ROW11(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW11, M_BCM1480_MC_ROW11) | ||
194 | |||
195 | #define S_BCM1480_MC_ROW12 32 | ||
196 | #define M_BCM1480_MC_ROW12 _SB_MAKEMASK(6, S_BCM1480_MC_ROW12) | ||
197 | #define V_BCM1480_MC_ROW12(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW12) | ||
198 | #define G_BCM1480_MC_ROW12(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW12, M_BCM1480_MC_ROW12) | ||
199 | |||
200 | #define S_BCM1480_MC_ROW13 40 | ||
201 | #define M_BCM1480_MC_ROW13 _SB_MAKEMASK(6, S_BCM1480_MC_ROW13) | ||
202 | #define V_BCM1480_MC_ROW13(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW13) | ||
203 | #define G_BCM1480_MC_ROW13(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW13, M_BCM1480_MC_ROW13) | ||
204 | |||
205 | #define S_BCM1480_MC_ROW14 48 | ||
206 | #define M_BCM1480_MC_ROW14 _SB_MAKEMASK(6, S_BCM1480_MC_ROW14) | ||
207 | #define V_BCM1480_MC_ROW14(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW14) | ||
208 | #define G_BCM1480_MC_ROW14(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW14, M_BCM1480_MC_ROW14) | ||
209 | |||
210 | #define K_BCM1480_MC_ROWX_BIT_SPACING 8 | ||
211 | |||
212 | /* | ||
213 | * Column Address Bit Select Register 0 (Table 86) | ||
214 | */ | ||
215 | |||
216 | #define S_BCM1480_MC_COL00 0 | ||
217 | #define M_BCM1480_MC_COL00 _SB_MAKEMASK(6, S_BCM1480_MC_COL00) | ||
218 | #define V_BCM1480_MC_COL00(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL00) | ||
219 | #define G_BCM1480_MC_COL00(x) _SB_GETVALUE(x, S_BCM1480_MC_COL00, M_BCM1480_MC_COL00) | ||
220 | |||
221 | #define S_BCM1480_MC_COL01 8 | ||
222 | #define M_BCM1480_MC_COL01 _SB_MAKEMASK(6, S_BCM1480_MC_COL01) | ||
223 | #define V_BCM1480_MC_COL01(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL01) | ||
224 | #define G_BCM1480_MC_COL01(x) _SB_GETVALUE(x, S_BCM1480_MC_COL01, M_BCM1480_MC_COL01) | ||
225 | |||
226 | #define S_BCM1480_MC_COL02 16 | ||
227 | #define M_BCM1480_MC_COL02 _SB_MAKEMASK(6, S_BCM1480_MC_COL02) | ||
228 | #define V_BCM1480_MC_COL02(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL02) | ||
229 | #define G_BCM1480_MC_COL02(x) _SB_GETVALUE(x, S_BCM1480_MC_COL02, M_BCM1480_MC_COL02) | ||
230 | |||
231 | #define S_BCM1480_MC_COL03 24 | ||
232 | #define M_BCM1480_MC_COL03 _SB_MAKEMASK(6, S_BCM1480_MC_COL03) | ||
233 | #define V_BCM1480_MC_COL03(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL03) | ||
234 | #define G_BCM1480_MC_COL03(x) _SB_GETVALUE(x, S_BCM1480_MC_COL03, M_BCM1480_MC_COL03) | ||
235 | |||
236 | #define S_BCM1480_MC_COL04 32 | ||
237 | #define M_BCM1480_MC_COL04 _SB_MAKEMASK(6, S_BCM1480_MC_COL04) | ||
238 | #define V_BCM1480_MC_COL04(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL04) | ||
239 | #define G_BCM1480_MC_COL04(x) _SB_GETVALUE(x, S_BCM1480_MC_COL04, M_BCM1480_MC_COL04) | ||
240 | |||
241 | #define S_BCM1480_MC_COL05 40 | ||
242 | #define M_BCM1480_MC_COL05 _SB_MAKEMASK(6, S_BCM1480_MC_COL05) | ||
243 | #define V_BCM1480_MC_COL05(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL05) | ||
244 | #define G_BCM1480_MC_COL05(x) _SB_GETVALUE(x, S_BCM1480_MC_COL05, M_BCM1480_MC_COL05) | ||
245 | |||
246 | #define S_BCM1480_MC_COL06 48 | ||
247 | #define M_BCM1480_MC_COL06 _SB_MAKEMASK(6, S_BCM1480_MC_COL06) | ||
248 | #define V_BCM1480_MC_COL06(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL06) | ||
249 | #define G_BCM1480_MC_COL06(x) _SB_GETVALUE(x, S_BCM1480_MC_COL06, M_BCM1480_MC_COL06) | ||
250 | |||
251 | #define S_BCM1480_MC_COL07 56 | ||
252 | #define M_BCM1480_MC_COL07 _SB_MAKEMASK(6, S_BCM1480_MC_COL07) | ||
253 | #define V_BCM1480_MC_COL07(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL07) | ||
254 | #define G_BCM1480_MC_COL07(x) _SB_GETVALUE(x, S_BCM1480_MC_COL07, M_BCM1480_MC_COL07) | ||
255 | |||
256 | /* | ||
257 | * Column Address Bit Select Register 1 (Table 87) | ||
258 | */ | ||
259 | |||
260 | #define S_BCM1480_MC_COL08 0 | ||
261 | #define M_BCM1480_MC_COL08 _SB_MAKEMASK(6, S_BCM1480_MC_COL08) | ||
262 | #define V_BCM1480_MC_COL08(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL08) | ||
263 | #define G_BCM1480_MC_COL08(x) _SB_GETVALUE(x, S_BCM1480_MC_COL08, M_BCM1480_MC_COL08) | ||
264 | |||
265 | #define S_BCM1480_MC_COL09 8 | ||
266 | #define M_BCM1480_MC_COL09 _SB_MAKEMASK(6, S_BCM1480_MC_COL09) | ||
267 | #define V_BCM1480_MC_COL09(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL09) | ||
268 | #define G_BCM1480_MC_COL09(x) _SB_GETVALUE(x, S_BCM1480_MC_COL09, M_BCM1480_MC_COL09) | ||
269 | |||
270 | #define S_BCM1480_MC_COL10 16 /* not a valid position, must be prog as 0 */ | ||
271 | |||
272 | #define S_BCM1480_MC_COL11 24 | ||
273 | #define M_BCM1480_MC_COL11 _SB_MAKEMASK(6, S_BCM1480_MC_COL11) | ||
274 | #define V_BCM1480_MC_COL11(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL11) | ||
275 | #define G_BCM1480_MC_COL11(x) _SB_GETVALUE(x, S_BCM1480_MC_COL11, M_BCM1480_MC_COL11) | ||
276 | |||
277 | #define S_BCM1480_MC_COL12 32 | ||
278 | #define M_BCM1480_MC_COL12 _SB_MAKEMASK(6, S_BCM1480_MC_COL12) | ||
279 | #define V_BCM1480_MC_COL12(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL12) | ||
280 | #define G_BCM1480_MC_COL12(x) _SB_GETVALUE(x, S_BCM1480_MC_COL12, M_BCM1480_MC_COL12) | ||
281 | |||
282 | #define S_BCM1480_MC_COL13 40 | ||
283 | #define M_BCM1480_MC_COL13 _SB_MAKEMASK(6, S_BCM1480_MC_COL13) | ||
284 | #define V_BCM1480_MC_COL13(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL13) | ||
285 | #define G_BCM1480_MC_COL13(x) _SB_GETVALUE(x, S_BCM1480_MC_COL13, M_BCM1480_MC_COL13) | ||
286 | |||
287 | #define S_BCM1480_MC_COL14 48 | ||
288 | #define M_BCM1480_MC_COL14 _SB_MAKEMASK(6, S_BCM1480_MC_COL14) | ||
289 | #define V_BCM1480_MC_COL14(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL14) | ||
290 | #define G_BCM1480_MC_COL14(x) _SB_GETVALUE(x, S_BCM1480_MC_COL14, M_BCM1480_MC_COL14) | ||
291 | |||
292 | #define K_BCM1480_MC_COLX_BIT_SPACING 8 | ||
293 | |||
294 | /* | ||
295 | * CS0 and CS1 Bank Address Bit Select Register (Table 88) | ||
296 | */ | ||
297 | |||
298 | #define S_BCM1480_MC_CS01_BANK0 0 | ||
299 | #define M_BCM1480_MC_CS01_BANK0 _SB_MAKEMASK(6, S_BCM1480_MC_CS01_BANK0) | ||
300 | #define V_BCM1480_MC_CS01_BANK0(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS01_BANK0) | ||
301 | #define G_BCM1480_MC_CS01_BANK0(x) _SB_GETVALUE(x, S_BCM1480_MC_CS01_BANK0, M_BCM1480_MC_CS01_BANK0) | ||
302 | |||
303 | #define S_BCM1480_MC_CS01_BANK1 8 | ||
304 | #define M_BCM1480_MC_CS01_BANK1 _SB_MAKEMASK(6, S_BCM1480_MC_CS01_BANK1) | ||
305 | #define V_BCM1480_MC_CS01_BANK1(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS01_BANK1) | ||
306 | #define G_BCM1480_MC_CS01_BANK1(x) _SB_GETVALUE(x, S_BCM1480_MC_CS01_BANK1, M_BCM1480_MC_CS01_BANK1) | ||
307 | |||
308 | #define S_BCM1480_MC_CS01_BANK2 16 | ||
309 | #define M_BCM1480_MC_CS01_BANK2 _SB_MAKEMASK(6, S_BCM1480_MC_CS01_BANK2) | ||
310 | #define V_BCM1480_MC_CS01_BANK2(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS01_BANK2) | ||
311 | #define G_BCM1480_MC_CS01_BANK2(x) _SB_GETVALUE(x, S_BCM1480_MC_CS01_BANK2, M_BCM1480_MC_CS01_BANK2) | ||
312 | |||
313 | /* | ||
314 | * CS2 and CS3 Bank Address Bit Select Register (Table 89) | ||
315 | */ | ||
316 | |||
317 | #define S_BCM1480_MC_CS23_BANK0 0 | ||
318 | #define M_BCM1480_MC_CS23_BANK0 _SB_MAKEMASK(6, S_BCM1480_MC_CS23_BANK0) | ||
319 | #define V_BCM1480_MC_CS23_BANK0(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS23_BANK0) | ||
320 | #define G_BCM1480_MC_CS23_BANK0(x) _SB_GETVALUE(x, S_BCM1480_MC_CS23_BANK0, M_BCM1480_MC_CS23_BANK0) | ||
321 | |||
322 | #define S_BCM1480_MC_CS23_BANK1 8 | ||
323 | #define M_BCM1480_MC_CS23_BANK1 _SB_MAKEMASK(6, S_BCM1480_MC_CS23_BANK1) | ||
324 | #define V_BCM1480_MC_CS23_BANK1(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS23_BANK1) | ||
325 | #define G_BCM1480_MC_CS23_BANK1(x) _SB_GETVALUE(x, S_BCM1480_MC_CS23_BANK1, M_BCM1480_MC_CS23_BANK1) | ||
326 | |||
327 | #define S_BCM1480_MC_CS23_BANK2 16 | ||
328 | #define M_BCM1480_MC_CS23_BANK2 _SB_MAKEMASK(6, S_BCM1480_MC_CS23_BANK2) | ||
329 | #define V_BCM1480_MC_CS23_BANK2(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS23_BANK2) | ||
330 | #define G_BCM1480_MC_CS23_BANK2(x) _SB_GETVALUE(x, S_BCM1480_MC_CS23_BANK2, M_BCM1480_MC_CS23_BANK2) | ||
331 | |||
332 | #define K_BCM1480_MC_CSXX_BANKX_BIT_SPACING 8 | ||
333 | |||
334 | /* | ||
335 | * DRAM Command Register (Table 90) | ||
336 | */ | ||
337 | |||
338 | #define S_BCM1480_MC_COMMAND 0 | ||
339 | #define M_BCM1480_MC_COMMAND _SB_MAKEMASK(4, S_BCM1480_MC_COMMAND) | ||
340 | #define V_BCM1480_MC_COMMAND(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COMMAND) | ||
341 | #define G_BCM1480_MC_COMMAND(x) _SB_GETVALUE(x, S_BCM1480_MC_COMMAND, M_BCM1480_MC_COMMAND) | ||
342 | |||
343 | #define K_BCM1480_MC_COMMAND_EMRS 0 | ||
344 | #define K_BCM1480_MC_COMMAND_MRS 1 | ||
345 | #define K_BCM1480_MC_COMMAND_PRE 2 | ||
346 | #define K_BCM1480_MC_COMMAND_AR 3 | ||
347 | #define K_BCM1480_MC_COMMAND_SETRFSH 4 | ||
348 | #define K_BCM1480_MC_COMMAND_CLRRFSH 5 | ||
349 | #define K_BCM1480_MC_COMMAND_SETPWRDN 6 | ||
350 | #define K_BCM1480_MC_COMMAND_CLRPWRDN 7 | ||
351 | |||
352 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
353 | #define K_BCM1480_MC_COMMAND_EMRS2 8 | ||
354 | #define K_BCM1480_MC_COMMAND_EMRS3 9 | ||
355 | #define K_BCM1480_MC_COMMAND_ENABLE_MCLK 10 | ||
356 | #define K_BCM1480_MC_COMMAND_DISABLE_MCLK 11 | ||
357 | #endif | ||
358 | |||
359 | #define V_BCM1480_MC_COMMAND_EMRS V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS) | ||
360 | #define V_BCM1480_MC_COMMAND_MRS V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_MRS) | ||
361 | #define V_BCM1480_MC_COMMAND_PRE V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_PRE) | ||
362 | #define V_BCM1480_MC_COMMAND_AR V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_AR) | ||
363 | #define V_BCM1480_MC_COMMAND_SETRFSH V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_SETRFSH) | ||
364 | #define V_BCM1480_MC_COMMAND_CLRRFSH V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_CLRRFSH) | ||
365 | #define V_BCM1480_MC_COMMAND_SETPWRDN V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_SETPWRDN) | ||
366 | #define V_BCM1480_MC_COMMAND_CLRPWRDN V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_CLRPWRDN) | ||
367 | |||
368 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
369 | #define V_BCM1480_MC_COMMAND_EMRS2 V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS2) | ||
370 | #define V_BCM1480_MC_COMMAND_EMRS3 V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS3) | ||
371 | #define V_BCM1480_MC_COMMAND_ENABLE_MCLK V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_ENABLE_MCLK) | ||
372 | #define V_BCM1480_MC_COMMAND_DISABLE_MCLK V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_DISABLE_MCLK) | ||
373 | #endif | ||
374 | |||
375 | #define S_BCM1480_MC_CS0 4 | ||
376 | #define M_BCM1480_MC_CS0 _SB_MAKEMASK1(4) | ||
377 | #define M_BCM1480_MC_CS1 _SB_MAKEMASK1(5) | ||
378 | #define M_BCM1480_MC_CS2 _SB_MAKEMASK1(6) | ||
379 | #define M_BCM1480_MC_CS3 _SB_MAKEMASK1(7) | ||
380 | #define M_BCM1480_MC_CS4 _SB_MAKEMASK1(8) | ||
381 | #define M_BCM1480_MC_CS5 _SB_MAKEMASK1(9) | ||
382 | #define M_BCM1480_MC_CS6 _SB_MAKEMASK1(10) | ||
383 | #define M_BCM1480_MC_CS7 _SB_MAKEMASK1(11) | ||
384 | |||
385 | #define M_BCM1480_MC_CS _SB_MAKEMASK(8, S_BCM1480_MC_CS0) | ||
386 | #define V_BCM1480_MC_CS(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS0) | ||
387 | #define G_BCM1480_MC_CS(x) _SB_GETVALUE(x, S_BCM1480_MC_CS0, M_BCM1480_MC_CS0) | ||
388 | |||
389 | #define M_BCM1480_MC_CMD_ACTIVE _SB_MAKEMASK1(16) | ||
390 | |||
391 | /* | ||
392 | * DRAM Mode Register (Table 91) | ||
393 | */ | ||
394 | |||
395 | #define S_BCM1480_MC_EMODE 0 | ||
396 | #define M_BCM1480_MC_EMODE _SB_MAKEMASK(15, S_BCM1480_MC_EMODE) | ||
397 | #define V_BCM1480_MC_EMODE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_EMODE) | ||
398 | #define G_BCM1480_MC_EMODE(x) _SB_GETVALUE(x, S_BCM1480_MC_EMODE, M_BCM1480_MC_EMODE) | ||
399 | #define V_BCM1480_MC_EMODE_DEFAULT V_BCM1480_MC_EMODE(0) | ||
400 | |||
401 | #define S_BCM1480_MC_MODE 16 | ||
402 | #define M_BCM1480_MC_MODE _SB_MAKEMASK(15, S_BCM1480_MC_MODE) | ||
403 | #define V_BCM1480_MC_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_MODE) | ||
404 | #define G_BCM1480_MC_MODE(x) _SB_GETVALUE(x, S_BCM1480_MC_MODE, M_BCM1480_MC_MODE) | ||
405 | #define V_BCM1480_MC_MODE_DEFAULT V_BCM1480_MC_MODE(0) | ||
406 | |||
407 | #define S_BCM1480_MC_DRAM_TYPE 32 | ||
408 | #define M_BCM1480_MC_DRAM_TYPE _SB_MAKEMASK(4, S_BCM1480_MC_DRAM_TYPE) | ||
409 | #define V_BCM1480_MC_DRAM_TYPE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DRAM_TYPE) | ||
410 | #define G_BCM1480_MC_DRAM_TYPE(x) _SB_GETVALUE(x, S_BCM1480_MC_DRAM_TYPE, M_BCM1480_MC_DRAM_TYPE) | ||
411 | |||
412 | #define K_BCM1480_MC_DRAM_TYPE_JEDEC 0 | ||
413 | #define K_BCM1480_MC_DRAM_TYPE_FCRAM 1 | ||
414 | |||
415 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
416 | #define K_BCM1480_MC_DRAM_TYPE_DDR2 2 | ||
417 | #endif | ||
418 | |||
419 | #define K_BCM1480_MC_DRAM_TYPE_DDR2_PASS1 0 | ||
420 | |||
421 | #define V_BCM1480_MC_DRAM_TYPE_JEDEC V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_JEDEC) | ||
422 | #define V_BCM1480_MC_DRAM_TYPE_FCRAM V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_FCRAM) | ||
423 | |||
424 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
425 | #define V_BCM1480_MC_DRAM_TYPE_DDR2 V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_DDR2) | ||
426 | #endif | ||
427 | |||
428 | #define M_BCM1480_MC_GANGED _SB_MAKEMASK1(36) | ||
429 | #define M_BCM1480_MC_BY9_INTF _SB_MAKEMASK1(37) | ||
430 | #define M_BCM1480_MC_FORCE_ECC64 _SB_MAKEMASK1(38) | ||
431 | #define M_BCM1480_MC_ECC_DISABLE _SB_MAKEMASK1(39) | ||
432 | |||
433 | #define S_BCM1480_MC_PG_POLICY 40 | ||
434 | #define M_BCM1480_MC_PG_POLICY _SB_MAKEMASK(2, S_BCM1480_MC_PG_POLICY) | ||
435 | #define V_BCM1480_MC_PG_POLICY(x) _SB_MAKEVALUE(x, S_BCM1480_MC_PG_POLICY) | ||
436 | #define G_BCM1480_MC_PG_POLICY(x) _SB_GETVALUE(x, S_BCM1480_MC_PG_POLICY, M_BCM1480_MC_PG_POLICY) | ||
437 | |||
438 | #define K_BCM1480_MC_PG_POLICY_CLOSED 0 | ||
439 | #define K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK 1 | ||
440 | |||
441 | #define V_BCM1480_MC_PG_POLICY_CLOSED V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CLOSED) | ||
442 | #define V_BCM1480_MC_PG_POLICY_CAS_TIME_CHK V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK) | ||
443 | |||
444 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
445 | #define M_BCM1480_MC_2T_CMD _SB_MAKEMASK1(42) | ||
446 | #define M_BCM1480_MC_ECC_COR_DIS _SB_MAKEMASK1(43) | ||
447 | #endif | ||
448 | |||
449 | #define V_BCM1480_MC_DRAMMODE_DEFAULT V_BCM1480_MC_EMODE_DEFAULT | V_BCM1480_MC_MODE_DEFAULT | V_BCM1480_MC_DRAM_TYPE_JEDEC | \ | ||
450 | V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK) | ||
451 | |||
452 | /* | ||
453 | * Memory Clock Configuration Register (Table 92) | ||
454 | */ | ||
455 | |||
456 | #define S_BCM1480_MC_CLK_RATIO 0 | ||
457 | #define M_BCM1480_MC_CLK_RATIO _SB_MAKEMASK(6, S_BCM1480_MC_CLK_RATIO) | ||
458 | #define V_BCM1480_MC_CLK_RATIO(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CLK_RATIO) | ||
459 | #define G_BCM1480_MC_CLK_RATIO(x) _SB_GETVALUE(x, S_BCM1480_MC_CLK_RATIO, M_BCM1480_MC_CLK_RATIO) | ||
460 | |||
461 | #define V_BCM1480_MC_CLK_RATIO_DEFAULT V_BCM1480_MC_CLK_RATIO(10) | ||
462 | |||
463 | #define S_BCM1480_MC_REF_RATE 8 | ||
464 | #define M_BCM1480_MC_REF_RATE _SB_MAKEMASK(8, S_BCM1480_MC_REF_RATE) | ||
465 | #define V_BCM1480_MC_REF_RATE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_REF_RATE) | ||
466 | #define G_BCM1480_MC_REF_RATE(x) _SB_GETVALUE(x, S_BCM1480_MC_REF_RATE, M_BCM1480_MC_REF_RATE) | ||
467 | |||
468 | #define K_BCM1480_MC_REF_RATE_100MHz 0x31 | ||
469 | #define K_BCM1480_MC_REF_RATE_200MHz 0x62 | ||
470 | #define K_BCM1480_MC_REF_RATE_400MHz 0xC4 | ||
471 | |||
472 | #define V_BCM1480_MC_REF_RATE_100MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_100MHz) | ||
473 | #define V_BCM1480_MC_REF_RATE_200MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_200MHz) | ||
474 | #define V_BCM1480_MC_REF_RATE_400MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_400MHz) | ||
475 | #define V_BCM1480_MC_REF_RATE_DEFAULT V_BCM1480_MC_REF_RATE_400MHz | ||
476 | |||
477 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
478 | #define M_BCM1480_MC_AUTO_REF_DIS _SB_MAKEMASK1(16) | ||
479 | #endif | ||
480 | |||
481 | /* | ||
482 | * ODT Register (Table 99) | ||
483 | */ | ||
484 | |||
485 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
486 | #define M_BCM1480_MC_RD_ODT0_CS0 _SB_MAKEMASK1(0) | ||
487 | #define M_BCM1480_MC_RD_ODT0_CS2 _SB_MAKEMASK1(1) | ||
488 | #define M_BCM1480_MC_RD_ODT0_CS4 _SB_MAKEMASK1(2) | ||
489 | #define M_BCM1480_MC_RD_ODT0_CS6 _SB_MAKEMASK1(3) | ||
490 | #define M_BCM1480_MC_WR_ODT0_CS0 _SB_MAKEMASK1(4) | ||
491 | #define M_BCM1480_MC_WR_ODT0_CS2 _SB_MAKEMASK1(5) | ||
492 | #define M_BCM1480_MC_WR_ODT0_CS4 _SB_MAKEMASK1(6) | ||
493 | #define M_BCM1480_MC_WR_ODT0_CS6 _SB_MAKEMASK1(7) | ||
494 | #define M_BCM1480_MC_RD_ODT2_CS0 _SB_MAKEMASK1(8) | ||
495 | #define M_BCM1480_MC_RD_ODT2_CS2 _SB_MAKEMASK1(9) | ||
496 | #define M_BCM1480_MC_RD_ODT2_CS4 _SB_MAKEMASK1(10) | ||
497 | #define M_BCM1480_MC_RD_ODT2_CS6 _SB_MAKEMASK1(11) | ||
498 | #define M_BCM1480_MC_WR_ODT2_CS0 _SB_MAKEMASK1(12) | ||
499 | #define M_BCM1480_MC_WR_ODT2_CS2 _SB_MAKEMASK1(13) | ||
500 | #define M_BCM1480_MC_WR_ODT2_CS4 _SB_MAKEMASK1(14) | ||
501 | #define M_BCM1480_MC_WR_ODT2_CS6 _SB_MAKEMASK1(15) | ||
502 | #define M_BCM1480_MC_RD_ODT4_CS0 _SB_MAKEMASK1(16) | ||
503 | #define M_BCM1480_MC_RD_ODT4_CS2 _SB_MAKEMASK1(17) | ||
504 | #define M_BCM1480_MC_RD_ODT4_CS4 _SB_MAKEMASK1(18) | ||
505 | #define M_BCM1480_MC_RD_ODT4_CS6 _SB_MAKEMASK1(19) | ||
506 | #define M_BCM1480_MC_WR_ODT4_CS0 _SB_MAKEMASK1(20) | ||
507 | #define M_BCM1480_MC_WR_ODT4_CS2 _SB_MAKEMASK1(21) | ||
508 | #define M_BCM1480_MC_WR_ODT4_CS4 _SB_MAKEMASK1(22) | ||
509 | #define M_BCM1480_MC_WR_ODT4_CS6 _SB_MAKEMASK1(23) | ||
510 | #define M_BCM1480_MC_RD_ODT6_CS0 _SB_MAKEMASK1(24) | ||
511 | #define M_BCM1480_MC_RD_ODT6_CS2 _SB_MAKEMASK1(25) | ||
512 | #define M_BCM1480_MC_RD_ODT6_CS4 _SB_MAKEMASK1(26) | ||
513 | #define M_BCM1480_MC_RD_ODT6_CS6 _SB_MAKEMASK1(27) | ||
514 | #define M_BCM1480_MC_WR_ODT6_CS0 _SB_MAKEMASK1(28) | ||
515 | #define M_BCM1480_MC_WR_ODT6_CS2 _SB_MAKEMASK1(29) | ||
516 | #define M_BCM1480_MC_WR_ODT6_CS4 _SB_MAKEMASK1(30) | ||
517 | #define M_BCM1480_MC_WR_ODT6_CS6 _SB_MAKEMASK1(31) | ||
518 | |||
519 | #define M_BCM1480_MC_CS_ODD_ODT_EN _SB_MAKEMASK1(32) | ||
520 | |||
521 | #define S_BCM1480_MC_ODT0 0 | ||
522 | #define M_BCM1480_MC_ODT0 _SB_MAKEMASK(8, S_BCM1480_MC_ODT0) | ||
523 | #define V_BCM1480_MC_ODT0(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ODT0) | ||
524 | |||
525 | #define S_BCM1480_MC_ODT2 8 | ||
526 | #define M_BCM1480_MC_ODT2 _SB_MAKEMASK(8, S_BCM1480_MC_ODT2) | ||
527 | #define V_BCM1480_MC_ODT2(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ODT2) | ||
528 | |||
529 | #define S_BCM1480_MC_ODT4 16 | ||
530 | #define M_BCM1480_MC_ODT4 _SB_MAKEMASK(8, S_BCM1480_MC_ODT4) | ||
531 | #define V_BCM1480_MC_ODT4(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ODT4) | ||
532 | |||
533 | #define S_BCM1480_MC_ODT6 24 | ||
534 | #define M_BCM1480_MC_ODT6 _SB_MAKEMASK(8, S_BCM1480_MC_ODT6) | ||
535 | #define V_BCM1480_MC_ODT6(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ODT6) | ||
536 | #endif | ||
537 | |||
538 | /* | ||
539 | * Memory DLL Configuration Register (Table 93) | ||
540 | */ | ||
541 | |||
542 | #define S_BCM1480_MC_ADDR_COARSE_ADJ 0 | ||
543 | #define M_BCM1480_MC_ADDR_COARSE_ADJ _SB_MAKEMASK(6, S_BCM1480_MC_ADDR_COARSE_ADJ) | ||
544 | #define V_BCM1480_MC_ADDR_COARSE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ADDR_COARSE_ADJ) | ||
545 | #define G_BCM1480_MC_ADDR_COARSE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_ADDR_COARSE_ADJ, M_BCM1480_MC_ADDR_COARSE_ADJ) | ||
546 | #define V_BCM1480_MC_ADDR_COARSE_ADJ_DEFAULT V_BCM1480_MC_ADDR_COARSE_ADJ(0x0) | ||
547 | |||
548 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
549 | #define S_BCM1480_MC_ADDR_FREQ_RANGE 8 | ||
550 | #define M_BCM1480_MC_ADDR_FREQ_RANGE _SB_MAKEMASK(4, S_BCM1480_MC_ADDR_FREQ_RANGE) | ||
551 | #define V_BCM1480_MC_ADDR_FREQ_RANGE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ADDR_FREQ_RANGE) | ||
552 | #define G_BCM1480_MC_ADDR_FREQ_RANGE(x) _SB_GETVALUE(x, S_BCM1480_MC_ADDR_FREQ_RANGE, M_BCM1480_MC_ADDR_FREQ_RANGE) | ||
553 | #define V_BCM1480_MC_ADDR_FREQ_RANGE_DEFAULT V_BCM1480_MC_ADDR_FREQ_RANGE(0x4) | ||
554 | #endif | ||
555 | |||
556 | #define S_BCM1480_MC_ADDR_FINE_ADJ 8 | ||
557 | #define M_BCM1480_MC_ADDR_FINE_ADJ _SB_MAKEMASK(4, S_BCM1480_MC_ADDR_FINE_ADJ) | ||
558 | #define V_BCM1480_MC_ADDR_FINE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ADDR_FINE_ADJ) | ||
559 | #define G_BCM1480_MC_ADDR_FINE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_ADDR_FINE_ADJ, M_BCM1480_MC_ADDR_FINE_ADJ) | ||
560 | #define V_BCM1480_MC_ADDR_FINE_ADJ_DEFAULT V_BCM1480_MC_ADDR_FINE_ADJ(0x8) | ||
561 | |||
562 | #define S_BCM1480_MC_DQI_COARSE_ADJ 16 | ||
563 | #define M_BCM1480_MC_DQI_COARSE_ADJ _SB_MAKEMASK(6, S_BCM1480_MC_DQI_COARSE_ADJ) | ||
564 | #define V_BCM1480_MC_DQI_COARSE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQI_COARSE_ADJ) | ||
565 | #define G_BCM1480_MC_DQI_COARSE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_DQI_COARSE_ADJ, M_BCM1480_MC_DQI_COARSE_ADJ) | ||
566 | #define V_BCM1480_MC_DQI_COARSE_ADJ_DEFAULT V_BCM1480_MC_DQI_COARSE_ADJ(0x0) | ||
567 | |||
568 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
569 | #define S_BCM1480_MC_DQI_FREQ_RANGE 24 | ||
570 | #define M_BCM1480_MC_DQI_FREQ_RANGE _SB_MAKEMASK(4, S_BCM1480_MC_DQI_FREQ_RANGE) | ||
571 | #define V_BCM1480_MC_DQI_FREQ_RANGE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQI_FREQ_RANGE) | ||
572 | #define G_BCM1480_MC_DQI_FREQ_RANGE(x) _SB_GETVALUE(x, S_BCM1480_MC_DQI_FREQ_RANGE, M_BCM1480_MC_DQI_FREQ_RANGE) | ||
573 | #define V_BCM1480_MC_DQI_FREQ_RANGE_DEFAULT V_BCM1480_MC_DQI_FREQ_RANGE(0x4) | ||
574 | #endif | ||
575 | |||
576 | #define S_BCM1480_MC_DQI_FINE_ADJ 24 | ||
577 | #define M_BCM1480_MC_DQI_FINE_ADJ _SB_MAKEMASK(4, S_BCM1480_MC_DQI_FINE_ADJ) | ||
578 | #define V_BCM1480_MC_DQI_FINE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQI_FINE_ADJ) | ||
579 | #define G_BCM1480_MC_DQI_FINE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_DQI_FINE_ADJ, M_BCM1480_MC_DQI_FINE_ADJ) | ||
580 | #define V_BCM1480_MC_DQI_FINE_ADJ_DEFAULT V_BCM1480_MC_DQI_FINE_ADJ(0x8) | ||
581 | |||
582 | #define S_BCM1480_MC_DQO_COARSE_ADJ 32 | ||
583 | #define M_BCM1480_MC_DQO_COARSE_ADJ _SB_MAKEMASK(6, S_BCM1480_MC_DQO_COARSE_ADJ) | ||
584 | #define V_BCM1480_MC_DQO_COARSE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQO_COARSE_ADJ) | ||
585 | #define G_BCM1480_MC_DQO_COARSE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_DQO_COARSE_ADJ, M_BCM1480_MC_DQO_COARSE_ADJ) | ||
586 | #define V_BCM1480_MC_DQO_COARSE_ADJ_DEFAULT V_BCM1480_MC_DQO_COARSE_ADJ(0x0) | ||
587 | |||
588 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
589 | #define S_BCM1480_MC_DQO_FREQ_RANGE 40 | ||
590 | #define M_BCM1480_MC_DQO_FREQ_RANGE _SB_MAKEMASK(4, S_BCM1480_MC_DQO_FREQ_RANGE) | ||
591 | #define V_BCM1480_MC_DQO_FREQ_RANGE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQO_FREQ_RANGE) | ||
592 | #define G_BCM1480_MC_DQO_FREQ_RANGE(x) _SB_GETVALUE(x, S_BCM1480_MC_DQO_FREQ_RANGE, M_BCM1480_MC_DQO_FREQ_RANGE) | ||
593 | #define V_BCM1480_MC_DQO_FREQ_RANGE_DEFAULT V_BCM1480_MC_DQO_FREQ_RANGE(0x4) | ||
594 | #endif | ||
595 | |||
596 | #define S_BCM1480_MC_DQO_FINE_ADJ 40 | ||
597 | #define M_BCM1480_MC_DQO_FINE_ADJ _SB_MAKEMASK(4, S_BCM1480_MC_DQO_FINE_ADJ) | ||
598 | #define V_BCM1480_MC_DQO_FINE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQO_FINE_ADJ) | ||
599 | #define G_BCM1480_MC_DQO_FINE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_DQO_FINE_ADJ, M_BCM1480_MC_DQO_FINE_ADJ) | ||
600 | #define V_BCM1480_MC_DQO_FINE_ADJ_DEFAULT V_BCM1480_MC_DQO_FINE_ADJ(0x8) | ||
601 | |||
602 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
603 | #define S_BCM1480_MC_DLL_PDSEL 44 | ||
604 | #define M_BCM1480_MC_DLL_PDSEL _SB_MAKEMASK(2, S_BCM1480_MC_DLL_PDSEL) | ||
605 | #define V_BCM1480_MC_DLL_PDSEL(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_PDSEL) | ||
606 | #define G_BCM1480_MC_DLL_PDSEL(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_PDSEL, M_BCM1480_MC_DLL_PDSEL) | ||
607 | #define V_BCM1480_MC_DLL_DEFAULT_PDSEL V_BCM1480_MC_DLL_PDSEL(0x0) | ||
608 | |||
609 | #define M_BCM1480_MC_DLL_REGBYPASS _SB_MAKEMASK1(46) | ||
610 | #define M_BCM1480_MC_DQO_SHIFT _SB_MAKEMASK1(47) | ||
611 | #endif | ||
612 | |||
613 | #define S_BCM1480_MC_DLL_DEFAULT 48 | ||
614 | #define M_BCM1480_MC_DLL_DEFAULT _SB_MAKEMASK(6, S_BCM1480_MC_DLL_DEFAULT) | ||
615 | #define V_BCM1480_MC_DLL_DEFAULT(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_DEFAULT) | ||
616 | #define G_BCM1480_MC_DLL_DEFAULT(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_DEFAULT, M_BCM1480_MC_DLL_DEFAULT) | ||
617 | #define V_BCM1480_MC_DLL_DEFAULT_DEFAULT V_BCM1480_MC_DLL_DEFAULT(0x10) | ||
618 | |||
619 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
620 | #define S_BCM1480_MC_DLL_REGCTRL 54 | ||
621 | #define M_BCM1480_MC_DLL_REGCTRL _SB_MAKEMASK(2, S_BCM1480_MC_DLL_REGCTRL) | ||
622 | #define V_BCM1480_MC_DLL_REGCTRL(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_REGCTRL) | ||
623 | #define G_BCM1480_MC_DLL_REGCTRL(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_REGCTRL, M_BCM1480_MC_DLL_REGCTRL) | ||
624 | #define V_BCM1480_MC_DLL_DEFAULT_REGCTRL V_BCM1480_MC_DLL_REGCTRL(0x0) | ||
625 | #endif | ||
626 | |||
627 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
628 | #define S_BCM1480_MC_DLL_FREQ_RANGE 56 | ||
629 | #define M_BCM1480_MC_DLL_FREQ_RANGE _SB_MAKEMASK(4, S_BCM1480_MC_DLL_FREQ_RANGE) | ||
630 | #define V_BCM1480_MC_DLL_FREQ_RANGE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_FREQ_RANGE) | ||
631 | #define G_BCM1480_MC_DLL_FREQ_RANGE(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_FREQ_RANGE, M_BCM1480_MC_DLL_FREQ_RANGE) | ||
632 | #define V_BCM1480_MC_DLL_FREQ_RANGE_DEFAULT V_BCM1480_MC_DLL_FREQ_RANGE(0x4) | ||
633 | #endif | ||
634 | |||
635 | #define S_BCM1480_MC_DLL_STEP_SIZE 56 | ||
636 | #define M_BCM1480_MC_DLL_STEP_SIZE _SB_MAKEMASK(4, S_BCM1480_MC_DLL_STEP_SIZE) | ||
637 | #define V_BCM1480_MC_DLL_STEP_SIZE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_STEP_SIZE) | ||
638 | #define G_BCM1480_MC_DLL_STEP_SIZE(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_STEP_SIZE, M_BCM1480_MC_DLL_STEP_SIZE) | ||
639 | #define V_BCM1480_MC_DLL_STEP_SIZE_DEFAULT V_BCM1480_MC_DLL_STEP_SIZE(0x8) | ||
640 | |||
641 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
642 | #define S_BCM1480_MC_DLL_BGCTRL 60 | ||
643 | #define M_BCM1480_MC_DLL_BGCTRL _SB_MAKEMASK(2, S_BCM1480_MC_DLL_BGCTRL) | ||
644 | #define V_BCM1480_MC_DLL_BGCTRL(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_BGCTRL) | ||
645 | #define G_BCM1480_MC_DLL_BGCTRL(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_BGCTRL, M_BCM1480_MC_DLL_BGCTRL) | ||
646 | #define V_BCM1480_MC_DLL_DEFAULT_BGCTRL V_BCM1480_MC_DLL_BGCTRL(0x0) | ||
647 | #endif | ||
648 | |||
649 | #define M_BCM1480_MC_DLL_BYPASS _SB_MAKEMASK1(63) | ||
650 | |||
651 | /* | ||
652 | * Memory Drive Configuration Register (Table 94) | ||
653 | */ | ||
654 | |||
655 | #define S_BCM1480_MC_RTT_BYP_PULLDOWN 0 | ||
656 | #define M_BCM1480_MC_RTT_BYP_PULLDOWN _SB_MAKEMASK(3, S_BCM1480_MC_RTT_BYP_PULLDOWN) | ||
657 | #define V_BCM1480_MC_RTT_BYP_PULLDOWN(x) _SB_MAKEVALUE(x, S_BCM1480_MC_RTT_BYP_PULLDOWN) | ||
658 | #define G_BCM1480_MC_RTT_BYP_PULLDOWN(x) _SB_GETVALUE(x, S_BCM1480_MC_RTT_BYP_PULLDOWN, M_BCM1480_MC_RTT_BYP_PULLDOWN) | ||
659 | |||
660 | #define S_BCM1480_MC_RTT_BYP_PULLUP 6 | ||
661 | #define M_BCM1480_MC_RTT_BYP_PULLUP _SB_MAKEMASK(3, S_BCM1480_MC_RTT_BYP_PULLUP) | ||
662 | #define V_BCM1480_MC_RTT_BYP_PULLUP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_RTT_BYP_PULLUP) | ||
663 | #define G_BCM1480_MC_RTT_BYP_PULLUP(x) _SB_GETVALUE(x, S_BCM1480_MC_RTT_BYP_PULLUP, M_BCM1480_MC_RTT_BYP_PULLUP) | ||
664 | |||
665 | #define M_BCM1480_MC_RTT_BYPASS _SB_MAKEMASK1(8) | ||
666 | #define M_BCM1480_MC_RTT_COMP_MOV_AVG _SB_MAKEMASK1(9) | ||
667 | |||
668 | #define S_BCM1480_MC_PVT_BYP_C1_PULLDOWN 10 | ||
669 | #define M_BCM1480_MC_PVT_BYP_C1_PULLDOWN _SB_MAKEMASK(4, S_BCM1480_MC_PVT_BYP_C1_PULLDOWN) | ||
670 | #define V_BCM1480_MC_PVT_BYP_C1_PULLDOWN(x) _SB_MAKEVALUE(x, S_BCM1480_MC_PVT_BYP_C1_PULLDOWN) | ||
671 | #define G_BCM1480_MC_PVT_BYP_C1_PULLDOWN(x) _SB_GETVALUE(x, S_BCM1480_MC_PVT_BYP_C1_PULLDOWN, M_BCM1480_MC_PVT_BYP_C1_PULLDOWN) | ||
672 | |||
673 | #define S_BCM1480_MC_PVT_BYP_C1_PULLUP 15 | ||
674 | #define M_BCM1480_MC_PVT_BYP_C1_PULLUP _SB_MAKEMASK(4, S_BCM1480_MC_PVT_BYP_C1_PULLUP) | ||
675 | #define V_BCM1480_MC_PVT_BYP_C1_PULLUP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_PVT_BYP_C1_PULLUP) | ||
676 | #define G_BCM1480_MC_PVT_BYP_C1_PULLUP(x) _SB_GETVALUE(x, S_BCM1480_MC_PVT_BYP_C1_PULLUP, M_BCM1480_MC_PVT_BYP_C1_PULLUP) | ||
677 | |||
678 | #define S_BCM1480_MC_PVT_BYP_C2_PULLDOWN 20 | ||
679 | #define M_BCM1480_MC_PVT_BYP_C2_PULLDOWN _SB_MAKEMASK(4, S_BCM1480_MC_PVT_BYP_C2_PULLDOWN) | ||
680 | #define V_BCM1480_MC_PVT_BYP_C2_PULLDOWN(x) _SB_MAKEVALUE(x, S_BCM1480_MC_PVT_BYP_C2_PULLDOWN) | ||
681 | #define G_BCM1480_MC_PVT_BYP_C2_PULLDOWN(x) _SB_GETVALUE(x, S_BCM1480_MC_PVT_BYP_C2_PULLDOWN, M_BCM1480_MC_PVT_BYP_C2_PULLDOWN) | ||
682 | |||
683 | #define S_BCM1480_MC_PVT_BYP_C2_PULLUP 25 | ||
684 | #define M_BCM1480_MC_PVT_BYP_C2_PULLUP _SB_MAKEMASK(4, S_BCM1480_MC_PVT_BYP_C2_PULLUP) | ||
685 | #define V_BCM1480_MC_PVT_BYP_C2_PULLUP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_PVT_BYP_C2_PULLUP) | ||
686 | #define G_BCM1480_MC_PVT_BYP_C2_PULLUP(x) _SB_GETVALUE(x, S_BCM1480_MC_PVT_BYP_C2_PULLUP, M_BCM1480_MC_PVT_BYP_C2_PULLUP) | ||
687 | |||
688 | #define M_BCM1480_MC_PVT_BYPASS _SB_MAKEMASK1(30) | ||
689 | #define M_BCM1480_MC_PVT_COMP_MOV_AVG _SB_MAKEMASK1(31) | ||
690 | |||
691 | #define M_BCM1480_MC_CLK_CLASS _SB_MAKEMASK1(34) | ||
692 | #define M_BCM1480_MC_DATA_CLASS _SB_MAKEMASK1(35) | ||
693 | #define M_BCM1480_MC_ADDR_CLASS _SB_MAKEMASK1(36) | ||
694 | |||
695 | #define M_BCM1480_MC_DQ_ODT_75 _SB_MAKEMASK1(37) | ||
696 | #define M_BCM1480_MC_DQ_ODT_150 _SB_MAKEMASK1(38) | ||
697 | #define M_BCM1480_MC_DQS_ODT_75 _SB_MAKEMASK1(39) | ||
698 | #define M_BCM1480_MC_DQS_ODT_150 _SB_MAKEMASK1(40) | ||
699 | #define M_BCM1480_MC_DQS_DIFF _SB_MAKEMASK1(41) | ||
700 | |||
701 | /* | ||
702 | * ECC Test Data Register (Table 95) | ||
703 | */ | ||
704 | |||
705 | #define S_BCM1480_MC_DATA_INVERT 0 | ||
706 | #define M_DATA_ECC_INVERT _SB_MAKEMASK(64, S_BCM1480_MC_ECC_INVERT) | ||
707 | |||
708 | /* | ||
709 | * ECC Test ECC Register (Table 96) | ||
710 | */ | ||
711 | |||
712 | #define S_BCM1480_MC_ECC_INVERT 0 | ||
713 | #define M_BCM1480_MC_ECC_INVERT _SB_MAKEMASK(8, S_BCM1480_MC_ECC_INVERT) | ||
714 | |||
715 | /* | ||
716 | * SDRAM Timing Register (Table 97) | ||
717 | */ | ||
718 | |||
719 | #define S_BCM1480_MC_tRCD 0 | ||
720 | #define M_BCM1480_MC_tRCD _SB_MAKEMASK(4, S_BCM1480_MC_tRCD) | ||
721 | #define V_BCM1480_MC_tRCD(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRCD) | ||
722 | #define G_BCM1480_MC_tRCD(x) _SB_GETVALUE(x, S_BCM1480_MC_tRCD, M_BCM1480_MC_tRCD) | ||
723 | #define K_BCM1480_MC_tRCD_DEFAULT 3 | ||
724 | #define V_BCM1480_MC_tRCD_DEFAULT V_BCM1480_MC_tRCD(K_BCM1480_MC_tRCD_DEFAULT) | ||
725 | |||
726 | #define S_BCM1480_MC_tCL 4 | ||
727 | #define M_BCM1480_MC_tCL _SB_MAKEMASK(4, S_BCM1480_MC_tCL) | ||
728 | #define V_BCM1480_MC_tCL(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tCL) | ||
729 | #define G_BCM1480_MC_tCL(x) _SB_GETVALUE(x, S_BCM1480_MC_tCL, M_BCM1480_MC_tCL) | ||
730 | #define K_BCM1480_MC_tCL_DEFAULT 2 | ||
731 | #define V_BCM1480_MC_tCL_DEFAULT V_BCM1480_MC_tCL(K_BCM1480_MC_tCL_DEFAULT) | ||
732 | |||
733 | #define M_BCM1480_MC_tCrDh _SB_MAKEMASK1(8) | ||
734 | |||
735 | #define S_BCM1480_MC_tWR 9 | ||
736 | #define M_BCM1480_MC_tWR _SB_MAKEMASK(3, S_BCM1480_MC_tWR) | ||
737 | #define V_BCM1480_MC_tWR(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tWR) | ||
738 | #define G_BCM1480_MC_tWR(x) _SB_GETVALUE(x, S_BCM1480_MC_tWR, M_BCM1480_MC_tWR) | ||
739 | #define K_BCM1480_MC_tWR_DEFAULT 2 | ||
740 | #define V_BCM1480_MC_tWR_DEFAULT V_BCM1480_MC_tWR(K_BCM1480_MC_tWR_DEFAULT) | ||
741 | |||
742 | #define S_BCM1480_MC_tCwD 12 | ||
743 | #define M_BCM1480_MC_tCwD _SB_MAKEMASK(4, S_BCM1480_MC_tCwD) | ||
744 | #define V_BCM1480_MC_tCwD(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tCwD) | ||
745 | #define G_BCM1480_MC_tCwD(x) _SB_GETVALUE(x, S_BCM1480_MC_tCwD, M_BCM1480_MC_tCwD) | ||
746 | #define K_BCM1480_MC_tCwD_DEFAULT 1 | ||
747 | #define V_BCM1480_MC_tCwD_DEFAULT V_BCM1480_MC_tCwD(K_BCM1480_MC_tCwD_DEFAULT) | ||
748 | |||
749 | #define S_BCM1480_MC_tRP 16 | ||
750 | #define M_BCM1480_MC_tRP _SB_MAKEMASK(4, S_BCM1480_MC_tRP) | ||
751 | #define V_BCM1480_MC_tRP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRP) | ||
752 | #define G_BCM1480_MC_tRP(x) _SB_GETVALUE(x, S_BCM1480_MC_tRP, M_BCM1480_MC_tRP) | ||
753 | #define K_BCM1480_MC_tRP_DEFAULT 4 | ||
754 | #define V_BCM1480_MC_tRP_DEFAULT V_BCM1480_MC_tRP(K_BCM1480_MC_tRP_DEFAULT) | ||
755 | |||
756 | #define S_BCM1480_MC_tRRD 20 | ||
757 | #define M_BCM1480_MC_tRRD _SB_MAKEMASK(4, S_BCM1480_MC_tRRD) | ||
758 | #define V_BCM1480_MC_tRRD(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRRD) | ||
759 | #define G_BCM1480_MC_tRRD(x) _SB_GETVALUE(x, S_BCM1480_MC_tRRD, M_BCM1480_MC_tRRD) | ||
760 | #define K_BCM1480_MC_tRRD_DEFAULT 2 | ||
761 | #define V_BCM1480_MC_tRRD_DEFAULT V_BCM1480_MC_tRRD(K_BCM1480_MC_tRRD_DEFAULT) | ||
762 | |||
763 | #define S_BCM1480_MC_tRCw 24 | ||
764 | #define M_BCM1480_MC_tRCw _SB_MAKEMASK(5, S_BCM1480_MC_tRCw) | ||
765 | #define V_BCM1480_MC_tRCw(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRCw) | ||
766 | #define G_BCM1480_MC_tRCw(x) _SB_GETVALUE(x, S_BCM1480_MC_tRCw, M_BCM1480_MC_tRCw) | ||
767 | #define K_BCM1480_MC_tRCw_DEFAULT 10 | ||
768 | #define V_BCM1480_MC_tRCw_DEFAULT V_BCM1480_MC_tRCw(K_BCM1480_MC_tRCw_DEFAULT) | ||
769 | |||
770 | #define S_BCM1480_MC_tRCr 32 | ||
771 | #define M_BCM1480_MC_tRCr _SB_MAKEMASK(5, S_BCM1480_MC_tRCr) | ||
772 | #define V_BCM1480_MC_tRCr(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRCr) | ||
773 | #define G_BCM1480_MC_tRCr(x) _SB_GETVALUE(x, S_BCM1480_MC_tRCr, M_BCM1480_MC_tRCr) | ||
774 | #define K_BCM1480_MC_tRCr_DEFAULT 9 | ||
775 | #define V_BCM1480_MC_tRCr_DEFAULT V_BCM1480_MC_tRCr(K_BCM1480_MC_tRCr_DEFAULT) | ||
776 | |||
777 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
778 | #define S_BCM1480_MC_tFAW 40 | ||
779 | #define M_BCM1480_MC_tFAW _SB_MAKEMASK(6, S_BCM1480_MC_tFAW) | ||
780 | #define V_BCM1480_MC_tFAW(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tFAW) | ||
781 | #define G_BCM1480_MC_tFAW(x) _SB_GETVALUE(x, S_BCM1480_MC_tFAW, M_BCM1480_MC_tFAW) | ||
782 | #define K_BCM1480_MC_tFAW_DEFAULT 0 | ||
783 | #define V_BCM1480_MC_tFAW_DEFAULT V_BCM1480_MC_tFAW(K_BCM1480_MC_tFAW_DEFAULT) | ||
784 | #endif | ||
785 | |||
786 | #define S_BCM1480_MC_tRFC 48 | ||
787 | #define M_BCM1480_MC_tRFC _SB_MAKEMASK(7, S_BCM1480_MC_tRFC) | ||
788 | #define V_BCM1480_MC_tRFC(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRFC) | ||
789 | #define G_BCM1480_MC_tRFC(x) _SB_GETVALUE(x, S_BCM1480_MC_tRFC, M_BCM1480_MC_tRFC) | ||
790 | #define K_BCM1480_MC_tRFC_DEFAULT 12 | ||
791 | #define V_BCM1480_MC_tRFC_DEFAULT V_BCM1480_MC_tRFC(K_BCM1480_MC_tRFC_DEFAULT) | ||
792 | |||
793 | #define S_BCM1480_MC_tFIFO 56 | ||
794 | #define M_BCM1480_MC_tFIFO _SB_MAKEMASK(2, S_BCM1480_MC_tFIFO) | ||
795 | #define V_BCM1480_MC_tFIFO(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tFIFO) | ||
796 | #define G_BCM1480_MC_tFIFO(x) _SB_GETVALUE(x, S_BCM1480_MC_tFIFO, M_BCM1480_MC_tFIFO) | ||
797 | #define K_BCM1480_MC_tFIFO_DEFAULT 0 | ||
798 | #define V_BCM1480_MC_tFIFO_DEFAULT V_BCM1480_MC_tFIFO(K_BCM1480_MC_tFIFO_DEFAULT) | ||
799 | |||
800 | #define S_BCM1480_MC_tW2R 58 | ||
801 | #define M_BCM1480_MC_tW2R _SB_MAKEMASK(2, S_BCM1480_MC_tW2R) | ||
802 | #define V_BCM1480_MC_tW2R(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tW2R) | ||
803 | #define G_BCM1480_MC_tW2R(x) _SB_GETVALUE(x, S_BCM1480_MC_tW2R, M_BCM1480_MC_tW2R) | ||
804 | #define K_BCM1480_MC_tW2R_DEFAULT 1 | ||
805 | #define V_BCM1480_MC_tW2R_DEFAULT V_BCM1480_MC_tW2R(K_BCM1480_MC_tW2R_DEFAULT) | ||
806 | |||
807 | #define S_BCM1480_MC_tR2W 60 | ||
808 | #define M_BCM1480_MC_tR2W _SB_MAKEMASK(2, S_BCM1480_MC_tR2W) | ||
809 | #define V_BCM1480_MC_tR2W(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tR2W) | ||
810 | #define G_BCM1480_MC_tR2W(x) _SB_GETVALUE(x, S_BCM1480_MC_tR2W, M_BCM1480_MC_tR2W) | ||
811 | #define K_BCM1480_MC_tR2W_DEFAULT 0 | ||
812 | #define V_BCM1480_MC_tR2W_DEFAULT V_BCM1480_MC_tR2W(K_BCM1480_MC_tR2W_DEFAULT) | ||
813 | |||
814 | #define M_BCM1480_MC_tR2R _SB_MAKEMASK1(62) | ||
815 | |||
816 | #define V_BCM1480_MC_TIMING_DEFAULT (M_BCM1480_MC_tR2R | \ | ||
817 | V_BCM1480_MC_tFIFO_DEFAULT | \ | ||
818 | V_BCM1480_MC_tR2W_DEFAULT | \ | ||
819 | V_BCM1480_MC_tW2R_DEFAULT | \ | ||
820 | V_BCM1480_MC_tRFC_DEFAULT | \ | ||
821 | V_BCM1480_MC_tRCr_DEFAULT | \ | ||
822 | V_BCM1480_MC_tRCw_DEFAULT | \ | ||
823 | V_BCM1480_MC_tRRD_DEFAULT | \ | ||
824 | V_BCM1480_MC_tRP_DEFAULT | \ | ||
825 | V_BCM1480_MC_tCwD_DEFAULT | \ | ||
826 | V_BCM1480_MC_tWR_DEFAULT | \ | ||
827 | M_BCM1480_MC_tCrDh | \ | ||
828 | V_BCM1480_MC_tCL_DEFAULT | \ | ||
829 | V_BCM1480_MC_tRCD_DEFAULT) | ||
830 | |||
831 | /* | ||
832 | * SDRAM Timing Register 2 | ||
833 | */ | ||
834 | |||
835 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
836 | |||
837 | #define S_BCM1480_MC_tAL 0 | ||
838 | #define M_BCM1480_MC_tAL _SB_MAKEMASK(4, S_BCM1480_MC_tAL) | ||
839 | #define V_BCM1480_MC_tAL(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tAL) | ||
840 | #define G_BCM1480_MC_tAL(x) _SB_GETVALUE(x, S_BCM1480_MC_tAL, M_BCM1480_MC_tAL) | ||
841 | #define K_BCM1480_MC_tAL_DEFAULT 0 | ||
842 | #define V_BCM1480_MC_tAL_DEFAULT V_BCM1480_MC_tAL(K_BCM1480_MC_tAL_DEFAULT) | ||
843 | |||
844 | #define S_BCM1480_MC_tRTP 4 | ||
845 | #define M_BCM1480_MC_tRTP _SB_MAKEMASK(3, S_BCM1480_MC_tRTP) | ||
846 | #define V_BCM1480_MC_tRTP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRTP) | ||
847 | #define G_BCM1480_MC_tRTP(x) _SB_GETVALUE(x, S_BCM1480_MC_tRTP, M_BCM1480_MC_tRTP) | ||
848 | #define K_BCM1480_MC_tRTP_DEFAULT 2 | ||
849 | #define V_BCM1480_MC_tRTP_DEFAULT V_BCM1480_MC_tRTP(K_BCM1480_MC_tRTP_DEFAULT) | ||
850 | |||
851 | #define S_BCM1480_MC_tW2W 8 | ||
852 | #define M_BCM1480_MC_tW2W _SB_MAKEMASK(2, S_BCM1480_MC_tW2W) | ||
853 | #define V_BCM1480_MC_tW2W(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tW2W) | ||
854 | #define G_BCM1480_MC_tW2W(x) _SB_GETVALUE(x, S_BCM1480_MC_tW2W, M_BCM1480_MC_tW2W) | ||
855 | #define K_BCM1480_MC_tW2W_DEFAULT 0 | ||
856 | #define V_BCM1480_MC_tW2W_DEFAULT V_BCM1480_MC_tW2W(K_BCM1480_MC_tW2W_DEFAULT) | ||
857 | |||
858 | #define S_BCM1480_MC_tRAP 12 | ||
859 | #define M_BCM1480_MC_tRAP _SB_MAKEMASK(4, S_BCM1480_MC_tRAP) | ||
860 | #define V_BCM1480_MC_tRAP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRAP) | ||
861 | #define G_BCM1480_MC_tRAP(x) _SB_GETVALUE(x, S_BCM1480_MC_tRAP, M_BCM1480_MC_tRAP) | ||
862 | #define K_BCM1480_MC_tRAP_DEFAULT 0 | ||
863 | #define V_BCM1480_MC_tRAP_DEFAULT V_BCM1480_MC_tRAP(K_BCM1480_MC_tRAP_DEFAULT) | ||
864 | |||
865 | #endif | ||
866 | |||
867 | |||
868 | |||
869 | /* | ||
870 | * Global Registers: single instances per BCM1480 | ||
871 | */ | ||
872 | |||
873 | /* | ||
874 | * Global Configuration Register (Table 99) | ||
875 | */ | ||
876 | |||
877 | #define S_BCM1480_MC_BLK_SET_MARK 8 | ||
878 | #define M_BCM1480_MC_BLK_SET_MARK _SB_MAKEMASK(4, S_BCM1480_MC_BLK_SET_MARK) | ||
879 | #define V_BCM1480_MC_BLK_SET_MARK(x) _SB_MAKEVALUE(x, S_BCM1480_MC_BLK_SET_MARK) | ||
880 | #define G_BCM1480_MC_BLK_SET_MARK(x) _SB_GETVALUE(x, S_BCM1480_MC_BLK_SET_MARK, M_BCM1480_MC_BLK_SET_MARK) | ||
881 | |||
882 | #define S_BCM1480_MC_BLK_CLR_MARK 12 | ||
883 | #define M_BCM1480_MC_BLK_CLR_MARK _SB_MAKEMASK(4, S_BCM1480_MC_BLK_CLR_MARK) | ||
884 | #define V_BCM1480_MC_BLK_CLR_MARK(x) _SB_MAKEVALUE(x, S_BCM1480_MC_BLK_CLR_MARK) | ||
885 | #define G_BCM1480_MC_BLK_CLR_MARK(x) _SB_GETVALUE(x, S_BCM1480_MC_BLK_CLR_MARK, M_BCM1480_MC_BLK_CLR_MARK) | ||
886 | |||
887 | #define M_BCM1480_MC_PKT_PRIORITY _SB_MAKEMASK1(16) | ||
888 | |||
889 | #define S_BCM1480_MC_MAX_AGE 20 | ||
890 | #define M_BCM1480_MC_MAX_AGE _SB_MAKEMASK(4, S_BCM1480_MC_MAX_AGE) | ||
891 | #define V_BCM1480_MC_MAX_AGE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_MAX_AGE) | ||
892 | #define G_BCM1480_MC_MAX_AGE(x) _SB_GETVALUE(x, S_BCM1480_MC_MAX_AGE, M_BCM1480_MC_MAX_AGE) | ||
893 | |||
894 | #define M_BCM1480_MC_BERR_DISABLE _SB_MAKEMASK1(29) | ||
895 | #define M_BCM1480_MC_FORCE_SEQ _SB_MAKEMASK1(30) | ||
896 | #define M_BCM1480_MC_VGEN _SB_MAKEMASK1(32) | ||
897 | |||
898 | #define S_BCM1480_MC_SLEW 33 | ||
899 | #define M_BCM1480_MC_SLEW _SB_MAKEMASK(2, S_BCM1480_MC_SLEW) | ||
900 | #define V_BCM1480_MC_SLEW(x) _SB_MAKEVALUE(x, S_BCM1480_MC_SLEW) | ||
901 | #define G_BCM1480_MC_SLEW(x) _SB_GETVALUE(x, S_BCM1480_MC_SLEW, M_BCM1480_MC_SLEW) | ||
902 | |||
903 | #define M_BCM1480_MC_SSTL_VOLTAGE _SB_MAKEMASK1(35) | ||
904 | |||
905 | /* | ||
906 | * Global Channel Interleave Register (Table 100) | ||
907 | */ | ||
908 | |||
909 | #define S_BCM1480_MC_INTLV0 0 | ||
910 | #define M_BCM1480_MC_INTLV0 _SB_MAKEMASK(6, S_BCM1480_MC_INTLV0) | ||
911 | #define V_BCM1480_MC_INTLV0(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV0) | ||
912 | #define G_BCM1480_MC_INTLV0(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV0, M_BCM1480_MC_INTLV0) | ||
913 | |||
914 | #define S_BCM1480_MC_INTLV1 8 | ||
915 | #define M_BCM1480_MC_INTLV1 _SB_MAKEMASK(6, S_BCM1480_MC_INTLV1) | ||
916 | #define V_BCM1480_MC_INTLV1(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV1) | ||
917 | #define G_BCM1480_MC_INTLV1(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV1, M_BCM1480_MC_INTLV1) | ||
918 | |||
919 | #define S_BCM1480_MC_INTLV_MODE 16 | ||
920 | #define M_BCM1480_MC_INTLV_MODE _SB_MAKEMASK(3, S_BCM1480_MC_INTLV_MODE) | ||
921 | #define V_BCM1480_MC_INTLV_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV_MODE) | ||
922 | #define G_BCM1480_MC_INTLV_MODE(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV_MODE, M_BCM1480_MC_INTLV_MODE) | ||
923 | |||
924 | #define K_BCM1480_MC_INTLV_MODE_NONE 0x0 | ||
925 | #define K_BCM1480_MC_INTLV_MODE_01 0x1 | ||
926 | #define K_BCM1480_MC_INTLV_MODE_23 0x2 | ||
927 | #define K_BCM1480_MC_INTLV_MODE_01_23 0x3 | ||
928 | #define K_BCM1480_MC_INTLV_MODE_0123 0x4 | ||
929 | |||
930 | #define V_BCM1480_MC_INTLV_MODE_NONE V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_NONE) | ||
931 | #define V_BCM1480_MC_INTLV_MODE_01 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_01) | ||
932 | #define V_BCM1480_MC_INTLV_MODE_23 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_23) | ||
933 | #define V_BCM1480_MC_INTLV_MODE_01_23 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_01_23) | ||
934 | #define V_BCM1480_MC_INTLV_MODE_0123 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_0123) | ||
935 | |||
936 | /* | ||
937 | * ECC Status Register | ||
938 | */ | ||
939 | |||
940 | #define S_BCM1480_MC_ECC_ERR_ADDR 0 | ||
941 | #define M_BCM1480_MC_ECC_ERR_ADDR _SB_MAKEMASK(37, S_BCM1480_MC_ECC_ERR_ADDR) | ||
942 | #define V_BCM1480_MC_ECC_ERR_ADDR(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ECC_ERR_ADDR) | ||
943 | #define G_BCM1480_MC_ECC_ERR_ADDR(x) _SB_GETVALUE(x, S_BCM1480_MC_ECC_ERR_ADDR, M_BCM1480_MC_ECC_ERR_ADDR) | ||
944 | |||
945 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
946 | #define M_BCM1480_MC_ECC_ERR_RMW _SB_MAKEMASK1(60) | ||
947 | #endif | ||
948 | |||
949 | #define M_BCM1480_MC_ECC_MULT_ERR_DET _SB_MAKEMASK1(61) | ||
950 | #define M_BCM1480_MC_ECC_UERR_DET _SB_MAKEMASK1(62) | ||
951 | #define M_BCM1480_MC_ECC_CERR_DET _SB_MAKEMASK1(63) | ||
952 | |||
953 | /* | ||
954 | * Global ECC Address Register (Table 102) | ||
955 | */ | ||
956 | |||
957 | #define S_BCM1480_MC_ECC_CORR_ADDR 0 | ||
958 | #define M_BCM1480_MC_ECC_CORR_ADDR _SB_MAKEMASK(37, S_BCM1480_MC_ECC_CORR_ADDR) | ||
959 | #define V_BCM1480_MC_ECC_CORR_ADDR(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ECC_CORR_ADDR) | ||
960 | #define G_BCM1480_MC_ECC_CORR_ADDR(x) _SB_GETVALUE(x, S_BCM1480_MC_ECC_CORR_ADDR, M_BCM1480_MC_ECC_CORR_ADDR) | ||
961 | |||
962 | /* | ||
963 | * Global ECC Correction Register (Table 103) | ||
964 | */ | ||
965 | |||
966 | #define S_BCM1480_MC_ECC_CORRECT 0 | ||
967 | #define M_BCM1480_MC_ECC_CORRECT _SB_MAKEMASK(64, S_BCM1480_MC_ECC_CORRECT) | ||
968 | #define V_BCM1480_MC_ECC_CORRECT(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ECC_CORRECT) | ||
969 | #define G_BCM1480_MC_ECC_CORRECT(x) _SB_GETVALUE(x, S_BCM1480_MC_ECC_CORRECT, M_BCM1480_MC_ECC_CORRECT) | ||
970 | |||
971 | /* | ||
972 | * Global ECC Performance Counters Control Register (Table 104) | ||
973 | */ | ||
974 | |||
975 | #define S_BCM1480_MC_CHANNEL_SELECT 0 | ||
976 | #define M_BCM1480_MC_CHANNEL_SELECT _SB_MAKEMASK(4, S_BCM1480_MC_CHANNEL_SELECT) | ||
977 | #define V_BCM1480_MC_CHANNEL_SELECT(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CHANNEL_SELECT) | ||
978 | #define G_BCM1480_MC_CHANNEL_SELECT(x) _SB_GETVALUE(x, S_BCM1480_MC_CHANNEL_SELECT, M_BCM1480_MC_CHANNEL_SELECT) | ||
979 | #define K_BCM1480_MC_CHANNEL_SELECT_0 0x1 | ||
980 | #define K_BCM1480_MC_CHANNEL_SELECT_1 0x2 | ||
981 | #define K_BCM1480_MC_CHANNEL_SELECT_2 0x4 | ||
982 | #define K_BCM1480_MC_CHANNEL_SELECT_3 0x8 | ||
983 | |||
984 | #endif /* _BCM1480_MC_H */ | ||
diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h deleted file mode 100644 index b4077bb72611..000000000000 --- a/include/asm-mips/sibyte/bcm1480_regs.h +++ /dev/null | |||
@@ -1,902 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * BCM1255/BCM1280/BCM1455/BCM1480 Board Support Package | ||
3 | * | ||
4 | * Register Definitions File: bcm1480_regs.h | ||
5 | * | ||
6 | * This module contains the addresses of the on-chip peripherals | ||
7 | * on the BCM1280 and BCM1480. | ||
8 | * | ||
9 | * BCM1480 specification level: 1X55_1X80-UM100-D4 (11/24/03) | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | #ifndef _BCM1480_REGS_H | ||
33 | #define _BCM1480_REGS_H | ||
34 | |||
35 | #include "sb1250_defs.h" | ||
36 | |||
37 | /* ********************************************************************* | ||
38 | * Pull in the BCM1250's registers since a great deal of the 1480's | ||
39 | * functions are the same as the BCM1250. | ||
40 | ********************************************************************* */ | ||
41 | |||
42 | #include "sb1250_regs.h" | ||
43 | |||
44 | |||
45 | /* ********************************************************************* | ||
46 | * Some general notes: | ||
47 | * | ||
48 | * Register addresses are grouped by function and follow the order | ||
49 | * of the User Manual. | ||
50 | * | ||
51 | * For the most part, when there is more than one peripheral | ||
52 | * of the same type on the SOC, the constants below will be | ||
53 | * offsets from the base of each peripheral. For example, | ||
54 | * the MAC registers are described as offsets from the first | ||
55 | * MAC register, and there will be a MAC_REGISTER() macro | ||
56 | * to calculate the base address of a given MAC. | ||
57 | * | ||
58 | * The information in this file is based on the BCM1X55/BCM1X80 | ||
59 | * User Manual, Document 1X55_1X80-UM100-R, 22/12/03. | ||
60 | * | ||
61 | * This file is basically a "what's new" header file. Since the | ||
62 | * BCM1250 and the new BCM1480 (and derivatives) share many common | ||
63 | * features, this file contains only what's new or changed from | ||
64 | * the 1250. (above, you can see that we include the 1250 symbols | ||
65 | * to get the base functionality). | ||
66 | * | ||
67 | * In software, be sure to use the correct symbols, particularly | ||
68 | * for blocks that are different between the two chip families. | ||
69 | * All BCM1480-specific symbols have _BCM1480_ in their names, | ||
70 | * and all BCM1250-specific and "base" functions that are common in | ||
71 | * both chips have no special names (this is for compatibility with | ||
72 | * older include files). Therefore, if you're working with the | ||
73 | * SCD, which is very different on each chip, A_SCD_xxx implies | ||
74 | * the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480 | ||
75 | * version. | ||
76 | ********************************************************************* */ | ||
77 | |||
78 | |||
79 | /* ********************************************************************* | ||
80 | * Memory Controller Registers (Section 6) | ||
81 | ********************************************************************* */ | ||
82 | |||
83 | #define A_BCM1480_MC_BASE_0 0x0010050000 | ||
84 | #define A_BCM1480_MC_BASE_1 0x0010051000 | ||
85 | #define A_BCM1480_MC_BASE_2 0x0010052000 | ||
86 | #define A_BCM1480_MC_BASE_3 0x0010053000 | ||
87 | #define BCM1480_MC_REGISTER_SPACING 0x1000 | ||
88 | |||
89 | #define A_BCM1480_MC_BASE(ctlid) (A_BCM1480_MC_BASE_0+(ctlid)*BCM1480_MC_REGISTER_SPACING) | ||
90 | #define A_BCM1480_MC_REGISTER(ctlid, reg) (A_BCM1480_MC_BASE(ctlid)+(reg)) | ||
91 | |||
92 | #define R_BCM1480_MC_CONFIG 0x0000000100 | ||
93 | #define R_BCM1480_MC_CS_START 0x0000000120 | ||
94 | #define R_BCM1480_MC_CS_END 0x0000000140 | ||
95 | #define S_BCM1480_MC_CS_STARTEND 24 | ||
96 | |||
97 | #define R_BCM1480_MC_CS01_ROW0 0x0000000180 | ||
98 | #define R_BCM1480_MC_CS01_ROW1 0x00000001A0 | ||
99 | #define R_BCM1480_MC_CS23_ROW0 0x0000000200 | ||
100 | #define R_BCM1480_MC_CS23_ROW1 0x0000000220 | ||
101 | #define R_BCM1480_MC_CS01_COL0 0x0000000280 | ||
102 | #define R_BCM1480_MC_CS01_COL1 0x00000002A0 | ||
103 | #define R_BCM1480_MC_CS23_COL0 0x0000000300 | ||
104 | #define R_BCM1480_MC_CS23_COL1 0x0000000320 | ||
105 | |||
106 | #define R_BCM1480_MC_CSX_BASE 0x0000000180 | ||
107 | #define R_BCM1480_MC_CSX_ROW0 0x0000000000 /* relative to CSX_BASE */ | ||
108 | #define R_BCM1480_MC_CSX_ROW1 0x0000000020 /* relative to CSX_BASE */ | ||
109 | #define R_BCM1480_MC_CSX_COL0 0x0000000100 /* relative to CSX_BASE */ | ||
110 | #define R_BCM1480_MC_CSX_COL1 0x0000000120 /* relative to CSX_BASE */ | ||
111 | #define BCM1480_MC_CSX_SPACING 0x0000000080 /* CS23 relative to CS01 */ | ||
112 | |||
113 | #define R_BCM1480_MC_CS01_BA 0x0000000380 | ||
114 | #define R_BCM1480_MC_CS23_BA 0x00000003A0 | ||
115 | #define R_BCM1480_MC_DRAMCMD 0x0000000400 | ||
116 | #define R_BCM1480_MC_DRAMMODE 0x0000000420 | ||
117 | #define R_BCM1480_MC_CLOCK_CFG 0x0000000440 | ||
118 | #define R_BCM1480_MC_MCLK_CFG R_BCM1480_MC_CLOCK_CFG | ||
119 | #define R_BCM1480_MC_TEST_DATA 0x0000000480 | ||
120 | #define R_BCM1480_MC_TEST_ECC 0x00000004A0 | ||
121 | #define R_BCM1480_MC_TIMING1 0x00000004C0 | ||
122 | #define R_BCM1480_MC_TIMING2 0x00000004E0 | ||
123 | #define R_BCM1480_MC_DLL_CFG 0x0000000500 | ||
124 | #define R_BCM1480_MC_DRIVE_CFG 0x0000000520 | ||
125 | |||
126 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
127 | #define R_BCM1480_MC_ODT 0x0000000460 | ||
128 | #define R_BCM1480_MC_ECC_STATUS 0x0000000540 | ||
129 | #endif | ||
130 | |||
131 | /* Global registers (single instance) */ | ||
132 | #define A_BCM1480_MC_GLB_CONFIG 0x0010054100 | ||
133 | #define A_BCM1480_MC_GLB_INTLV 0x0010054120 | ||
134 | #define A_BCM1480_MC_GLB_ECC_STATUS 0x0010054140 | ||
135 | #define A_BCM1480_MC_GLB_ECC_ADDR 0x0010054160 | ||
136 | #define A_BCM1480_MC_GLB_ECC_CORRECT 0x0010054180 | ||
137 | #define A_BCM1480_MC_GLB_PERF_CNT_CONTROL 0x00100541A0 | ||
138 | |||
139 | /* ********************************************************************* | ||
140 | * L2 Cache Control Registers (Section 5) | ||
141 | ********************************************************************* */ | ||
142 | |||
143 | #define A_BCM1480_L2_BASE 0x0010040000 | ||
144 | |||
145 | #define A_BCM1480_L2_READ_TAG 0x0010040018 | ||
146 | #define A_BCM1480_L2_ECC_TAG 0x0010040038 | ||
147 | #define A_BCM1480_L2_MISC0_VALUE 0x0010040058 | ||
148 | #define A_BCM1480_L2_MISC1_VALUE 0x0010040078 | ||
149 | #define A_BCM1480_L2_MISC2_VALUE 0x0010040098 | ||
150 | #define A_BCM1480_L2_MISC_CONFIG 0x0010040040 /* x040 */ | ||
151 | #define A_BCM1480_L2_CACHE_DISABLE 0x0010040060 /* x060 */ | ||
152 | #define A_BCM1480_L2_MAKECACHEDISABLE(x) (A_BCM1480_L2_CACHE_DISABLE | (((x)&0xF) << 12)) | ||
153 | #define A_BCM1480_L2_WAY_ENABLE_3_0 0x0010040080 /* x080 */ | ||
154 | #define A_BCM1480_L2_WAY_ENABLE_7_4 0x00100400A0 /* x0A0 */ | ||
155 | #define A_BCM1480_L2_MAKE_WAY_ENABLE_LO(x) (A_BCM1480_L2_WAY_ENABLE_3_0 | (((x)&0xF) << 12)) | ||
156 | #define A_BCM1480_L2_MAKE_WAY_ENABLE_HI(x) (A_BCM1480_L2_WAY_ENABLE_7_4 | (((x)&0xF) << 12)) | ||
157 | #define A_BCM1480_L2_MAKE_WAY_DISABLE_LO(x) (A_BCM1480_L2_WAY_ENABLE_3_0 | (((~x)&0xF) << 12)) | ||
158 | #define A_BCM1480_L2_MAKE_WAY_DISABLE_HI(x) (A_BCM1480_L2_WAY_ENABLE_7_4 | (((~x)&0xF) << 12)) | ||
159 | #define A_BCM1480_L2_WAY_LOCAL_3_0 0x0010040100 /* x100 */ | ||
160 | #define A_BCM1480_L2_WAY_LOCAL_7_4 0x0010040120 /* x120 */ | ||
161 | #define A_BCM1480_L2_WAY_REMOTE_3_0 0x0010040140 /* x140 */ | ||
162 | #define A_BCM1480_L2_WAY_REMOTE_7_4 0x0010040160 /* x160 */ | ||
163 | #define A_BCM1480_L2_WAY_AGENT_3_0 0x00100400C0 /* xxC0 */ | ||
164 | #define A_BCM1480_L2_WAY_AGENT_7_4 0x00100400E0 /* xxE0 */ | ||
165 | #define A_BCM1480_L2_WAY_ENABLE(A, banks) (A | (((~(banks))&0x0F) << 8)) | ||
166 | #define A_BCM1480_L2_BANK_BASE 0x00D0300000 | ||
167 | #define A_BCM1480_L2_BANK_ADDRESS(b) (A_BCM1480_L2_BANK_BASE | (((b)&0x7)<<17)) | ||
168 | #define A_BCM1480_L2_MGMT_TAG_BASE 0x00D0000000 | ||
169 | |||
170 | |||
171 | /* ********************************************************************* | ||
172 | * PCI-X Interface Registers (Section 7) | ||
173 | ********************************************************************* */ | ||
174 | |||
175 | #define A_BCM1480_PCI_BASE 0x0010061400 | ||
176 | |||
177 | #define A_BCM1480_PCI_RESET 0x0010061400 | ||
178 | #define A_BCM1480_PCI_DLL 0x0010061500 | ||
179 | |||
180 | #define A_BCM1480_PCI_TYPE00_HEADER 0x002E000000 | ||
181 | |||
182 | /* ********************************************************************* | ||
183 | * Ethernet MAC Registers (Section 11) and DMA Registers (Section 10.6) | ||
184 | ********************************************************************* */ | ||
185 | |||
186 | /* No register changes with Rev.C BCM1250, but one additional MAC */ | ||
187 | |||
188 | #define A_BCM1480_MAC_BASE_2 0x0010066000 | ||
189 | |||
190 | #ifndef A_MAC_BASE_2 | ||
191 | #define A_MAC_BASE_2 A_BCM1480_MAC_BASE_2 | ||
192 | #endif | ||
193 | |||
194 | #define A_BCM1480_MAC_BASE_3 0x0010067000 | ||
195 | #define A_MAC_BASE_3 A_BCM1480_MAC_BASE_3 | ||
196 | |||
197 | #define R_BCM1480_MAC_DMA_OODPKTLOST 0x00000038 | ||
198 | |||
199 | #ifndef R_MAC_DMA_OODPKTLOST | ||
200 | #define R_MAC_DMA_OODPKTLOST R_BCM1480_MAC_DMA_OODPKTLOST | ||
201 | #endif | ||
202 | |||
203 | |||
204 | /* ********************************************************************* | ||
205 | * DUART Registers (Section 14) | ||
206 | ********************************************************************* */ | ||
207 | |||
208 | /* No significant differences from BCM1250, two DUARTs */ | ||
209 | |||
210 | /* Conventions, per user manual: | ||
211 | * DUART generic, channels A,B,C,D | ||
212 | * DUART0 implementing channels A,B | ||
213 | * DUART1 inplementing channels C,D | ||
214 | */ | ||
215 | |||
216 | #define BCM1480_DUART_NUM_PORTS 4 | ||
217 | |||
218 | #define A_BCM1480_DUART0 0x0010060000 | ||
219 | #define A_BCM1480_DUART1 0x0010060400 | ||
220 | #define A_BCM1480_DUART(chan) ((((chan)&2) == 0)? A_BCM1480_DUART0 : A_BCM1480_DUART1) | ||
221 | |||
222 | #define BCM1480_DUART_CHANREG_SPACING 0x100 | ||
223 | #define A_BCM1480_DUART_CHANREG(chan, reg) \ | ||
224 | (A_BCM1480_DUART(chan) + \ | ||
225 | BCM1480_DUART_CHANREG_SPACING * (((chan) & 1) + 1) + (reg)) | ||
226 | #define A_BCM1480_DUART_CTRLREG(chan, reg) \ | ||
227 | (A_BCM1480_DUART(chan) + \ | ||
228 | BCM1480_DUART_CHANREG_SPACING * 3 + (reg)) | ||
229 | |||
230 | #define DUART_IMRISR_SPACING 0x20 | ||
231 | #define DUART_INCHNG_SPACING 0x10 | ||
232 | |||
233 | #define R_BCM1480_DUART_IMRREG(chan) \ | ||
234 | (R_DUART_IMR_A + ((chan) & 1) * DUART_IMRISR_SPACING) | ||
235 | #define R_BCM1480_DUART_ISRREG(chan) \ | ||
236 | (R_DUART_ISR_A + ((chan) & 1) * DUART_IMRISR_SPACING) | ||
237 | #define R_BCM1480_DUART_INCHREG(chan) \ | ||
238 | (R_DUART_IN_CHNG_A + ((chan) & 1) * DUART_INCHNG_SPACING) | ||
239 | |||
240 | #define A_BCM1480_DUART_IMRREG(chan) \ | ||
241 | (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_IMRREG(chan))) | ||
242 | #define A_BCM1480_DUART_ISRREG(chan) \ | ||
243 | (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_ISRREG(chan))) | ||
244 | |||
245 | #define A_BCM1480_DUART_IN_PORT(chan) \ | ||
246 | (A_BCM1480_DUART_CTRLREG((chan), R_DUART_IN_PORT)) | ||
247 | |||
248 | /* | ||
249 | * These constants are the absolute addresses. | ||
250 | */ | ||
251 | |||
252 | #define A_BCM1480_DUART_MODE_REG_1_C 0x0010060400 | ||
253 | #define A_BCM1480_DUART_MODE_REG_2_C 0x0010060410 | ||
254 | #define A_BCM1480_DUART_STATUS_C 0x0010060420 | ||
255 | #define A_BCM1480_DUART_CLK_SEL_C 0x0010060430 | ||
256 | #define A_BCM1480_DUART_FULL_CTL_C 0x0010060440 | ||
257 | #define A_BCM1480_DUART_CMD_C 0x0010060450 | ||
258 | #define A_BCM1480_DUART_RX_HOLD_C 0x0010060460 | ||
259 | #define A_BCM1480_DUART_TX_HOLD_C 0x0010060470 | ||
260 | #define A_BCM1480_DUART_OPCR_C 0x0010060480 | ||
261 | #define A_BCM1480_DUART_AUX_CTRL_C 0x0010060490 | ||
262 | |||
263 | #define A_BCM1480_DUART_MODE_REG_1_D 0x0010060500 | ||
264 | #define A_BCM1480_DUART_MODE_REG_2_D 0x0010060510 | ||
265 | #define A_BCM1480_DUART_STATUS_D 0x0010060520 | ||
266 | #define A_BCM1480_DUART_CLK_SEL_D 0x0010060530 | ||
267 | #define A_BCM1480_DUART_FULL_CTL_D 0x0010060540 | ||
268 | #define A_BCM1480_DUART_CMD_D 0x0010060550 | ||
269 | #define A_BCM1480_DUART_RX_HOLD_D 0x0010060560 | ||
270 | #define A_BCM1480_DUART_TX_HOLD_D 0x0010060570 | ||
271 | #define A_BCM1480_DUART_OPCR_D 0x0010060580 | ||
272 | #define A_BCM1480_DUART_AUX_CTRL_D 0x0010060590 | ||
273 | |||
274 | #define A_BCM1480_DUART_INPORT_CHNG_CD 0x0010060600 | ||
275 | #define A_BCM1480_DUART_AUX_CTRL_CD 0x0010060610 | ||
276 | #define A_BCM1480_DUART_ISR_C 0x0010060620 | ||
277 | #define A_BCM1480_DUART_IMR_C 0x0010060630 | ||
278 | #define A_BCM1480_DUART_ISR_D 0x0010060640 | ||
279 | #define A_BCM1480_DUART_IMR_D 0x0010060650 | ||
280 | #define A_BCM1480_DUART_OUT_PORT_CD 0x0010060660 | ||
281 | #define A_BCM1480_DUART_OPCR_CD 0x0010060670 | ||
282 | #define A_BCM1480_DUART_IN_PORT_CD 0x0010060680 | ||
283 | #define A_BCM1480_DUART_ISR_CD 0x0010060690 | ||
284 | #define A_BCM1480_DUART_IMR_CD 0x00100606A0 | ||
285 | #define A_BCM1480_DUART_SET_OPR_CD 0x00100606B0 | ||
286 | #define A_BCM1480_DUART_CLEAR_OPR_CD 0x00100606C0 | ||
287 | #define A_BCM1480_DUART_INPORT_CHNG_C 0x00100606D0 | ||
288 | #define A_BCM1480_DUART_INPORT_CHNG_D 0x00100606E0 | ||
289 | |||
290 | |||
291 | /* ********************************************************************* | ||
292 | * Generic Bus Registers (Section 15) and PCMCIA Registers (Section 16) | ||
293 | ********************************************************************* */ | ||
294 | |||
295 | #define A_BCM1480_IO_PCMCIA_CFG_B 0x0010061A58 | ||
296 | #define A_BCM1480_IO_PCMCIA_STATUS_B 0x0010061A68 | ||
297 | |||
298 | /* ********************************************************************* | ||
299 | * GPIO Registers (Section 17) | ||
300 | ********************************************************************* */ | ||
301 | |||
302 | /* One additional GPIO register, placed _before_ the BCM1250's GPIO block base */ | ||
303 | |||
304 | #define A_BCM1480_GPIO_INT_ADD_TYPE 0x0010061A78 | ||
305 | #define R_BCM1480_GPIO_INT_ADD_TYPE (-8) | ||
306 | |||
307 | #define A_GPIO_INT_ADD_TYPE A_BCM1480_GPIO_INT_ADD_TYPE | ||
308 | #define R_GPIO_INT_ADD_TYPE R_BCM1480_GPIO_INT_ADD_TYPE | ||
309 | |||
310 | /* ********************************************************************* | ||
311 | * SMBus Registers (Section 18) | ||
312 | ********************************************************************* */ | ||
313 | |||
314 | /* No changes from BCM1250 */ | ||
315 | |||
316 | /* ********************************************************************* | ||
317 | * Timer Registers (Sections 4.6) | ||
318 | ********************************************************************* */ | ||
319 | |||
320 | /* BCM1480 has two additional watchdogs */ | ||
321 | |||
322 | /* Watchdog timers */ | ||
323 | |||
324 | #define A_BCM1480_SCD_WDOG_2 0x0010022050 | ||
325 | #define A_BCM1480_SCD_WDOG_3 0x0010022150 | ||
326 | |||
327 | #define BCM1480_SCD_NUM_WDOGS 4 | ||
328 | |||
329 | #define A_BCM1480_SCD_WDOG_BASE(w) (A_BCM1480_SCD_WDOG_0+((w)&2)*0x1000 + ((w)&1)*0x100) | ||
330 | #define A_BCM1480_SCD_WDOG_REGISTER(w, r) (A_BCM1480_SCD_WDOG_BASE(w) + (r)) | ||
331 | |||
332 | #define A_BCM1480_SCD_WDOG_INIT_2 0x0010022050 | ||
333 | #define A_BCM1480_SCD_WDOG_CNT_2 0x0010022058 | ||
334 | #define A_BCM1480_SCD_WDOG_CFG_2 0x0010022060 | ||
335 | |||
336 | #define A_BCM1480_SCD_WDOG_INIT_3 0x0010022150 | ||
337 | #define A_BCM1480_SCD_WDOG_CNT_3 0x0010022158 | ||
338 | #define A_BCM1480_SCD_WDOG_CFG_3 0x0010022160 | ||
339 | |||
340 | /* BCM1480 has two additional compare registers */ | ||
341 | |||
342 | #define A_BCM1480_SCD_ZBBUS_CYCLE_COUNT A_SCD_ZBBUS_CYCLE_COUNT | ||
343 | #define A_BCM1480_SCD_ZBBUS_CYCLE_CP_BASE 0x0010020C00 | ||
344 | #define A_BCM1480_SCD_ZBBUS_CYCLE_CP0 A_SCD_ZBBUS_CYCLE_CP0 | ||
345 | #define A_BCM1480_SCD_ZBBUS_CYCLE_CP1 A_SCD_ZBBUS_CYCLE_CP1 | ||
346 | #define A_BCM1480_SCD_ZBBUS_CYCLE_CP2 0x0010020C10 | ||
347 | #define A_BCM1480_SCD_ZBBUS_CYCLE_CP3 0x0010020C18 | ||
348 | |||
349 | /* ********************************************************************* | ||
350 | * System Control Registers (Section 4.2) | ||
351 | ********************************************************************* */ | ||
352 | |||
353 | /* Scratch register in different place */ | ||
354 | |||
355 | #define A_BCM1480_SCD_SCRATCH 0x100200A0 | ||
356 | |||
357 | /* ********************************************************************* | ||
358 | * System Address Trap Registers (Section 4.9) | ||
359 | ********************************************************************* */ | ||
360 | |||
361 | /* No changes from BCM1250 */ | ||
362 | |||
363 | /* ********************************************************************* | ||
364 | * System Interrupt Mapper Registers (Sections 4.3-4.5) | ||
365 | ********************************************************************* */ | ||
366 | |||
367 | #define A_BCM1480_IMR_CPU0_BASE 0x0010020000 | ||
368 | #define A_BCM1480_IMR_CPU1_BASE 0x0010022000 | ||
369 | #define A_BCM1480_IMR_CPU2_BASE 0x0010024000 | ||
370 | #define A_BCM1480_IMR_CPU3_BASE 0x0010026000 | ||
371 | #define BCM1480_IMR_REGISTER_SPACING 0x2000 | ||
372 | #define BCM1480_IMR_REGISTER_SPACING_SHIFT 13 | ||
373 | |||
374 | #define A_BCM1480_IMR_MAPPER(cpu) (A_BCM1480_IMR_CPU0_BASE+(cpu)*BCM1480_IMR_REGISTER_SPACING) | ||
375 | #define A_BCM1480_IMR_REGISTER(cpu, reg) (A_BCM1480_IMR_MAPPER(cpu)+(reg)) | ||
376 | |||
377 | /* Most IMR registers are 128 bits, implemented as non-contiguous | ||
378 | 64-bit registers high (_H) and low (_L) */ | ||
379 | #define BCM1480_IMR_HL_SPACING 0x1000 | ||
380 | |||
381 | #define R_BCM1480_IMR_INTERRUPT_DIAG_H 0x0010 | ||
382 | #define R_BCM1480_IMR_LDT_INTERRUPT_H 0x0018 | ||
383 | #define R_BCM1480_IMR_LDT_INTERRUPT_CLR_H 0x0020 | ||
384 | #define R_BCM1480_IMR_INTERRUPT_MASK_H 0x0028 | ||
385 | #define R_BCM1480_IMR_INTERRUPT_TRACE_H 0x0038 | ||
386 | #define R_BCM1480_IMR_INTERRUPT_SOURCE_STATUS_H 0x0040 | ||
387 | #define R_BCM1480_IMR_LDT_INTERRUPT_SET 0x0048 | ||
388 | #define R_BCM1480_IMR_MAILBOX_0_CPU 0x00C0 | ||
389 | #define R_BCM1480_IMR_MAILBOX_0_SET_CPU 0x00C8 | ||
390 | #define R_BCM1480_IMR_MAILBOX_0_CLR_CPU 0x00D0 | ||
391 | #define R_BCM1480_IMR_MAILBOX_1_CPU 0x00E0 | ||
392 | #define R_BCM1480_IMR_MAILBOX_1_SET_CPU 0x00E8 | ||
393 | #define R_BCM1480_IMR_MAILBOX_1_CLR_CPU 0x00F0 | ||
394 | #define R_BCM1480_IMR_INTERRUPT_STATUS_BASE_H 0x0100 | ||
395 | #define BCM1480_IMR_INTERRUPT_STATUS_COUNT 8 | ||
396 | #define R_BCM1480_IMR_INTERRUPT_MAP_BASE_H 0x0200 | ||
397 | #define BCM1480_IMR_INTERRUPT_MAP_COUNT 64 | ||
398 | |||
399 | #define R_BCM1480_IMR_INTERRUPT_DIAG_L 0x1010 | ||
400 | #define R_BCM1480_IMR_LDT_INTERRUPT_L 0x1018 | ||
401 | #define R_BCM1480_IMR_LDT_INTERRUPT_CLR_L 0x1020 | ||
402 | #define R_BCM1480_IMR_INTERRUPT_MASK_L 0x1028 | ||
403 | #define R_BCM1480_IMR_INTERRUPT_TRACE_L 0x1038 | ||
404 | #define R_BCM1480_IMR_INTERRUPT_SOURCE_STATUS_L 0x1040 | ||
405 | #define R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L 0x1100 | ||
406 | #define R_BCM1480_IMR_INTERRUPT_MAP_BASE_L 0x1200 | ||
407 | |||
408 | #define A_BCM1480_IMR_ALIAS_MAILBOX_CPU0_BASE 0x0010028000 | ||
409 | #define A_BCM1480_IMR_ALIAS_MAILBOX_CPU1_BASE 0x0010028100 | ||
410 | #define A_BCM1480_IMR_ALIAS_MAILBOX_CPU2_BASE 0x0010028200 | ||
411 | #define A_BCM1480_IMR_ALIAS_MAILBOX_CPU3_BASE 0x0010028300 | ||
412 | #define BCM1480_IMR_ALIAS_MAILBOX_SPACING 0100 | ||
413 | |||
414 | #define A_BCM1480_IMR_ALIAS_MAILBOX(cpu) (A_BCM1480_IMR_ALIAS_MAILBOX_CPU0_BASE + \ | ||
415 | (cpu)*BCM1480_IMR_ALIAS_MAILBOX_SPACING) | ||
416 | #define A_BCM1480_IMR_ALIAS_MAILBOX_REGISTER(cpu, reg) (A_BCM1480_IMR_ALIAS_MAILBOX(cpu)+(reg)) | ||
417 | |||
418 | #define R_BCM1480_IMR_ALIAS_MAILBOX_0 0x0000 /* 0x0x0 */ | ||
419 | #define R_BCM1480_IMR_ALIAS_MAILBOX_0_SET 0x0008 /* 0x0x8 */ | ||
420 | |||
421 | /* | ||
422 | * these macros work together to build the address of a mailbox | ||
423 | * register, e.g., A_BCM1480_MAILBOX_REGISTER(0,R_BCM1480_IMR_MAILBOX_SET,2) | ||
424 | * for mbox_0_set_cpu2 returns 0x00100240C8 | ||
425 | */ | ||
426 | #define R_BCM1480_IMR_MAILBOX_CPU 0x00 | ||
427 | #define R_BCM1480_IMR_MAILBOX_SET 0x08 | ||
428 | #define R_BCM1480_IMR_MAILBOX_CLR 0x10 | ||
429 | #define R_BCM1480_IMR_MAILBOX_NUM_SPACING 0x20 | ||
430 | #define A_BCM1480_MAILBOX_REGISTER(num, reg, cpu) \ | ||
431 | (A_BCM1480_IMR_CPU0_BASE + \ | ||
432 | (num * R_BCM1480_IMR_MAILBOX_NUM_SPACING) + \ | ||
433 | (cpu * BCM1480_IMR_REGISTER_SPACING) + \ | ||
434 | (R_BCM1480_IMR_MAILBOX_0_CPU + reg)) | ||
435 | |||
436 | /* ********************************************************************* | ||
437 | * System Performance Counter Registers (Section 4.7) | ||
438 | ********************************************************************* */ | ||
439 | |||
440 | /* BCM1480 has four more performance counter registers, and two control | ||
441 | registers. */ | ||
442 | |||
443 | #define A_BCM1480_SCD_PERF_CNT_BASE 0x00100204C0 | ||
444 | |||
445 | #define A_BCM1480_SCD_PERF_CNT_CFG0 0x00100204C0 | ||
446 | #define A_BCM1480_SCD_PERF_CNT_CFG_0 A_BCM1480_SCD_PERF_CNT_CFG0 | ||
447 | #define A_BCM1480_SCD_PERF_CNT_CFG1 0x00100204C8 | ||
448 | #define A_BCM1480_SCD_PERF_CNT_CFG_1 A_BCM1480_SCD_PERF_CNT_CFG1 | ||
449 | |||
450 | #define A_BCM1480_SCD_PERF_CNT_0 A_SCD_PERF_CNT_0 | ||
451 | #define A_BCM1480_SCD_PERF_CNT_1 A_SCD_PERF_CNT_1 | ||
452 | #define A_BCM1480_SCD_PERF_CNT_2 A_SCD_PERF_CNT_2 | ||
453 | #define A_BCM1480_SCD_PERF_CNT_3 A_SCD_PERF_CNT_3 | ||
454 | |||
455 | #define A_BCM1480_SCD_PERF_CNT_4 0x00100204F0 | ||
456 | #define A_BCM1480_SCD_PERF_CNT_5 0x00100204F8 | ||
457 | #define A_BCM1480_SCD_PERF_CNT_6 0x0010020500 | ||
458 | #define A_BCM1480_SCD_PERF_CNT_7 0x0010020508 | ||
459 | |||
460 | #define BCM1480_SCD_NUM_PERF_CNT 8 | ||
461 | #define BCM1480_SCD_PERF_CNT_SPACING 8 | ||
462 | #define A_BCM1480_SCD_PERF_CNT(n) (A_SCD_PERF_CNT_0+(n*BCM1480_SCD_PERF_CNT_SPACING)) | ||
463 | |||
464 | /* ********************************************************************* | ||
465 | * System Bus Watcher Registers (Section 4.8) | ||
466 | ********************************************************************* */ | ||
467 | |||
468 | |||
469 | /* Same as 1250 except BUS_ERR_STATUS_DEBUG is in a different place. */ | ||
470 | |||
471 | #define A_BCM1480_BUS_ERR_STATUS_DEBUG 0x00100208D8 | ||
472 | |||
473 | /* ********************************************************************* | ||
474 | * System Debug Controller Registers (Section 19) | ||
475 | ********************************************************************* */ | ||
476 | |||
477 | /* Same as 1250 */ | ||
478 | |||
479 | /* ********************************************************************* | ||
480 | * System Trace Unit Registers (Sections 4.10) | ||
481 | ********************************************************************* */ | ||
482 | |||
483 | /* Same as 1250 */ | ||
484 | |||
485 | /* ********************************************************************* | ||
486 | * Data Mover DMA Registers (Section 10.7) | ||
487 | ********************************************************************* */ | ||
488 | |||
489 | /* Same as 1250 */ | ||
490 | |||
491 | |||
492 | /* ********************************************************************* | ||
493 | * HyperTransport Interface Registers (Section 8) | ||
494 | ********************************************************************* */ | ||
495 | |||
496 | #define BCM1480_HT_NUM_PORTS 3 | ||
497 | #define BCM1480_HT_PORT_SPACING 0x800 | ||
498 | #define A_BCM1480_HT_PORT_HEADER(x) (A_BCM1480_HT_PORT0_HEADER + ((x)*BCM1480_HT_PORT_SPACING)) | ||
499 | |||
500 | #define A_BCM1480_HT_PORT0_HEADER 0x00FE000000 | ||
501 | #define A_BCM1480_HT_PORT1_HEADER 0x00FE000800 | ||
502 | #define A_BCM1480_HT_PORT2_HEADER 0x00FE001000 | ||
503 | #define A_BCM1480_HT_TYPE00_HEADER 0x00FE002000 | ||
504 | |||
505 | |||
506 | /* ********************************************************************* | ||
507 | * Node Controller Registers (Section 9) | ||
508 | ********************************************************************* */ | ||
509 | |||
510 | #define A_BCM1480_NC_BASE 0x00DFBD0000 | ||
511 | |||
512 | #define A_BCM1480_NC_RLD_FIELD 0x00DFBD0000 | ||
513 | #define A_BCM1480_NC_RLD_TRIGGER 0x00DFBD0020 | ||
514 | #define A_BCM1480_NC_RLD_BAD_ERROR 0x00DFBD0040 | ||
515 | #define A_BCM1480_NC_RLD_COR_ERROR 0x00DFBD0060 | ||
516 | #define A_BCM1480_NC_RLD_ECC_STATUS 0x00DFBD0080 | ||
517 | #define A_BCM1480_NC_RLD_WAY_ENABLE 0x00DFBD00A0 | ||
518 | #define A_BCM1480_NC_RLD_RANDOM_LFSR 0x00DFBD00C0 | ||
519 | |||
520 | #define A_BCM1480_NC_INTERRUPT_STATUS 0x00DFBD00E0 | ||
521 | #define A_BCM1480_NC_INTERRUPT_ENABLE 0x00DFBD0100 | ||
522 | #define A_BCM1480_NC_TIMEOUT_COUNTER 0x00DFBD0120 | ||
523 | #define A_BCM1480_NC_TIMEOUT_COUNTER_SEL 0x00DFBD0140 | ||
524 | |||
525 | #define A_BCM1480_NC_CREDIT_STATUS_REG0 0x00DFBD0200 | ||
526 | #define A_BCM1480_NC_CREDIT_STATUS_REG1 0x00DFBD0220 | ||
527 | #define A_BCM1480_NC_CREDIT_STATUS_REG2 0x00DFBD0240 | ||
528 | #define A_BCM1480_NC_CREDIT_STATUS_REG3 0x00DFBD0260 | ||
529 | #define A_BCM1480_NC_CREDIT_STATUS_REG4 0x00DFBD0280 | ||
530 | #define A_BCM1480_NC_CREDIT_STATUS_REG5 0x00DFBD02A0 | ||
531 | #define A_BCM1480_NC_CREDIT_STATUS_REG6 0x00DFBD02C0 | ||
532 | #define A_BCM1480_NC_CREDIT_STATUS_REG7 0x00DFBD02E0 | ||
533 | #define A_BCM1480_NC_CREDIT_STATUS_REG8 0x00DFBD0300 | ||
534 | #define A_BCM1480_NC_CREDIT_STATUS_REG9 0x00DFBD0320 | ||
535 | #define A_BCM1480_NC_CREDIT_STATUS_REG10 0x00DFBE0000 | ||
536 | #define A_BCM1480_NC_CREDIT_STATUS_REG11 0x00DFBE0020 | ||
537 | #define A_BCM1480_NC_CREDIT_STATUS_REG12 0x00DFBE0040 | ||
538 | |||
539 | #define A_BCM1480_NC_SR_TIMEOUT_COUNTER 0x00DFBE0060 | ||
540 | #define A_BCM1480_NC_SR_TIMEOUT_COUNTER_SEL 0x00DFBE0080 | ||
541 | |||
542 | |||
543 | /* ********************************************************************* | ||
544 | * H&R Block Configuration Registers (Section 12.4) | ||
545 | ********************************************************************* */ | ||
546 | |||
547 | #define A_BCM1480_HR_BASE_0 0x00DF820000 | ||
548 | #define A_BCM1480_HR_BASE_1 0x00DF8A0000 | ||
549 | #define A_BCM1480_HR_BASE_2 0x00DF920000 | ||
550 | #define BCM1480_HR_REGISTER_SPACING 0x80000 | ||
551 | |||
552 | #define A_BCM1480_HR_BASE(idx) (A_BCM1480_HR_BASE_0 + ((idx)*BCM1480_HR_REGISTER_SPACING)) | ||
553 | #define A_BCM1480_HR_REGISTER(idx, reg) (A_BCM1480_HR_BASE(idx) + (reg)) | ||
554 | |||
555 | #define R_BCM1480_HR_CFG 0x0000000000 | ||
556 | |||
557 | #define R_BCM1480_HR_MAPPING 0x0000010010 | ||
558 | |||
559 | #define BCM1480_HR_RULE_SPACING 0x0000000010 | ||
560 | #define BCM1480_HR_NUM_RULES 16 | ||
561 | #define BCM1480_HR_OP_OFFSET 0x0000000100 | ||
562 | #define BCM1480_HR_TYPE_OFFSET 0x0000000108 | ||
563 | #define R_BCM1480_HR_RULE_OP(idx) (BCM1480_HR_OP_OFFSET + ((idx)*BCM1480_HR_RULE_SPACING)) | ||
564 | #define R_BCM1480_HR_RULE_TYPE(idx) (BCM1480_HR_TYPE_OFFSET + ((idx)*BCM1480_HR_RULE_SPACING)) | ||
565 | |||
566 | #define BCM1480_HR_LEAF_SPACING 0x0000000010 | ||
567 | #define BCM1480_HR_NUM_LEAVES 10 | ||
568 | #define BCM1480_HR_LEAF_OFFSET 0x0000000300 | ||
569 | #define R_BCM1480_HR_HA_LEAF0(idx) (BCM1480_HR_LEAF_OFFSET + ((idx)*BCM1480_HR_LEAF_SPACING)) | ||
570 | |||
571 | #define R_BCM1480_HR_EX_LEAF0 0x00000003A0 | ||
572 | |||
573 | #define BCM1480_HR_PATH_SPACING 0x0000000010 | ||
574 | #define BCM1480_HR_NUM_PATHS 16 | ||
575 | #define BCM1480_HR_PATH_OFFSET 0x0000000600 | ||
576 | #define R_BCM1480_HR_PATH(idx) (BCM1480_HR_PATH_OFFSET + ((idx)*BCM1480_HR_PATH_SPACING)) | ||
577 | |||
578 | #define R_BCM1480_HR_PATH_DEFAULT 0x0000000700 | ||
579 | |||
580 | #define BCM1480_HR_ROUTE_SPACING 8 | ||
581 | #define BCM1480_HR_NUM_ROUTES 512 | ||
582 | #define BCM1480_HR_ROUTE_OFFSET 0x0000001000 | ||
583 | #define R_BCM1480_HR_RT_WORD(idx) (BCM1480_HR_ROUTE_OFFSET + ((idx)*BCM1480_HR_ROUTE_SPACING)) | ||
584 | |||
585 | |||
586 | /* checked to here - ehs */ | ||
587 | /* ********************************************************************* | ||
588 | * Packet Manager DMA Registers (Section 12.5) | ||
589 | ********************************************************************* */ | ||
590 | |||
591 | #define A_BCM1480_PM_BASE 0x0010056000 | ||
592 | |||
593 | #define A_BCM1480_PMI_LCL_0 0x0010058000 | ||
594 | #define A_BCM1480_PMO_LCL_0 0x001005C000 | ||
595 | #define A_BCM1480_PMI_OFFSET_0 (A_BCM1480_PMI_LCL_0 - A_BCM1480_PM_BASE) | ||
596 | #define A_BCM1480_PMO_OFFSET_0 (A_BCM1480_PMO_LCL_0 - A_BCM1480_PM_BASE) | ||
597 | |||
598 | #define BCM1480_PM_LCL_REGISTER_SPACING 0x100 | ||
599 | #define BCM1480_PM_NUM_CHANNELS 32 | ||
600 | |||
601 | #define A_BCM1480_PMI_LCL_BASE(idx) (A_BCM1480_PMI_LCL_0 + ((idx)*BCM1480_PM_LCL_REGISTER_SPACING)) | ||
602 | #define A_BCM1480_PMI_LCL_REGISTER(idx, reg) (A_BCM1480_PMI_LCL_BASE(idx) + (reg)) | ||
603 | #define A_BCM1480_PMO_LCL_BASE(idx) (A_BCM1480_PMO_LCL_0 + ((idx)*BCM1480_PM_LCL_REGISTER_SPACING)) | ||
604 | #define A_BCM1480_PMO_LCL_REGISTER(idx, reg) (A_BCM1480_PMO_LCL_BASE(idx) + (reg)) | ||
605 | |||
606 | #define BCM1480_PM_INT_PACKING 8 | ||
607 | #define BCM1480_PM_INT_FUNCTION_SPACING 0x40 | ||
608 | #define BCM1480_PM_INT_NUM_FUNCTIONS 3 | ||
609 | |||
610 | /* | ||
611 | * DMA channel registers relative to A_BCM1480_PMI_LCL_BASE(n) and A_BCM1480_PMO_LCL_BASE(n) | ||
612 | */ | ||
613 | |||
614 | #define R_BCM1480_PM_BASE_SIZE 0x0000000000 | ||
615 | #define R_BCM1480_PM_CNT 0x0000000008 | ||
616 | #define R_BCM1480_PM_PFCNT 0x0000000010 | ||
617 | #define R_BCM1480_PM_LAST 0x0000000018 | ||
618 | #define R_BCM1480_PM_PFINDX 0x0000000020 | ||
619 | #define R_BCM1480_PM_INT_WMK 0x0000000028 | ||
620 | #define R_BCM1480_PM_CONFIG0 0x0000000030 | ||
621 | #define R_BCM1480_PM_LOCALDEBUG 0x0000000078 | ||
622 | #define R_BCM1480_PM_CACHEABILITY 0x0000000080 /* PMI only */ | ||
623 | #define R_BCM1480_PM_INT_CNFG 0x0000000088 | ||
624 | #define R_BCM1480_PM_DESC_MERGE_TIMER 0x0000000090 | ||
625 | #define R_BCM1480_PM_LOCALDEBUG_PIB 0x00000000F8 /* PMI only */ | ||
626 | #define R_BCM1480_PM_LOCALDEBUG_POB 0x00000000F8 /* PMO only */ | ||
627 | |||
628 | /* | ||
629 | * Global Registers (Not Channelized) | ||
630 | */ | ||
631 | |||
632 | #define A_BCM1480_PMI_GLB_0 0x0010056000 | ||
633 | #define A_BCM1480_PMO_GLB_0 0x0010057000 | ||
634 | |||
635 | /* | ||
636 | * PM to TX Mapping Register relative to A_BCM1480_PMI_GLB_0 and A_BCM1480_PMO_GLB_0 | ||
637 | */ | ||
638 | |||
639 | #define R_BCM1480_PM_PMO_MAPPING 0x00000008C8 /* PMO only */ | ||
640 | |||
641 | #define A_BCM1480_PM_PMO_MAPPING (A_BCM1480_PMO_GLB_0 + R_BCM1480_PM_PMO_MAPPING) | ||
642 | |||
643 | /* | ||
644 | * Interrupt mapping registers | ||
645 | */ | ||
646 | |||
647 | |||
648 | #define A_BCM1480_PMI_INT_0 0x0010056800 | ||
649 | #define A_BCM1480_PMI_INT(q) (A_BCM1480_PMI_INT_0 + ((q>>8)<<8)) | ||
650 | #define A_BCM1480_PMI_INT_OFFSET_0 (A_BCM1480_PMI_INT_0 - A_BCM1480_PM_BASE) | ||
651 | #define A_BCM1480_PMO_INT_0 0x0010057800 | ||
652 | #define A_BCM1480_PMO_INT(q) (A_BCM1480_PMO_INT_0 + ((q>>8)<<8)) | ||
653 | #define A_BCM1480_PMO_INT_OFFSET_0 (A_BCM1480_PMO_INT_0 - A_BCM1480_PM_BASE) | ||
654 | |||
655 | /* | ||
656 | * Interrupt registers relative to A_BCM1480_PMI_INT_0 and A_BCM1480_PMO_INT_0 | ||
657 | */ | ||
658 | |||
659 | #define R_BCM1480_PM_INT_ST 0x0000000000 | ||
660 | #define R_BCM1480_PM_INT_MSK 0x0000000040 | ||
661 | #define R_BCM1480_PM_INT_CLR 0x0000000080 | ||
662 | #define R_BCM1480_PM_MRGD_INT 0x00000000C0 | ||
663 | |||
664 | /* | ||
665 | * Debug registers (global) | ||
666 | */ | ||
667 | |||
668 | #define A_BCM1480_PM_GLOBALDEBUGMODE_PMI 0x0010056000 | ||
669 | #define A_BCM1480_PM_GLOBALDEBUG_PID 0x00100567F8 | ||
670 | #define A_BCM1480_PM_GLOBALDEBUG_PIB 0x0010056FF8 | ||
671 | #define A_BCM1480_PM_GLOBALDEBUGMODE_PMO 0x0010057000 | ||
672 | #define A_BCM1480_PM_GLOBALDEBUG_POD 0x00100577F8 | ||
673 | #define A_BCM1480_PM_GLOBALDEBUG_POB 0x0010057FF8 | ||
674 | |||
675 | /* ********************************************************************* | ||
676 | * Switch performance counters | ||
677 | ********************************************************************* */ | ||
678 | |||
679 | #define A_BCM1480_SWPERF_CFG 0xdfb91800 | ||
680 | #define A_BCM1480_SWPERF_CNT0 0xdfb91880 | ||
681 | #define A_BCM1480_SWPERF_CNT1 0xdfb91888 | ||
682 | #define A_BCM1480_SWPERF_CNT2 0xdfb91890 | ||
683 | #define A_BCM1480_SWPERF_CNT3 0xdfb91898 | ||
684 | |||
685 | |||
686 | /* ********************************************************************* | ||
687 | * Switch Trace Unit | ||
688 | ********************************************************************* */ | ||
689 | |||
690 | #define A_BCM1480_SWTRC_MATCH_CONTROL_0 0xDFB91000 | ||
691 | #define A_BCM1480_SWTRC_MATCH_DATA_VALUE_0 0xDFB91100 | ||
692 | #define A_BCM1480_SWTRC_MATCH_DATA_MASK_0 0xDFB91108 | ||
693 | #define A_BCM1480_SWTRC_MATCH_TAG_VALUE_0 0xDFB91200 | ||
694 | #define A_BCM1480_SWTRC_MATCH_TAG_MAKS_0 0xDFB91208 | ||
695 | #define A_BCM1480_SWTRC_EVENT_0 0xDFB91300 | ||
696 | #define A_BCM1480_SWTRC_SEQUENCE_0 0xDFB91400 | ||
697 | |||
698 | #define A_BCM1480_SWTRC_CFG 0xDFB91500 | ||
699 | #define A_BCM1480_SWTRC_READ 0xDFB91508 | ||
700 | |||
701 | #define A_BCM1480_SWDEBUG_SCHEDSTOP 0xDFB92000 | ||
702 | |||
703 | #define A_BCM1480_SWTRC_MATCH_CONTROL(x) (A_BCM1480_SWTRC_MATCH_CONTROL_0 + ((x)*8)) | ||
704 | #define A_BCM1480_SWTRC_EVENT(x) (A_BCM1480_SWTRC_EVENT_0 + ((x)*8)) | ||
705 | #define A_BCM1480_SWTRC_SEQUENCE(x) (A_BCM1480_SWTRC_SEQUENCE_0 + ((x)*8)) | ||
706 | |||
707 | #define A_BCM1480_SWTRC_MATCH_DATA_VALUE(x) (A_BCM1480_SWTRC_MATCH_DATA_VALUE_0 + ((x)*16)) | ||
708 | #define A_BCM1480_SWTRC_MATCH_DATA_MASK(x) (A_BCM1480_SWTRC_MATCH_DATA_MASK_0 + ((x)*16)) | ||
709 | #define A_BCM1480_SWTRC_MATCH_TAG_VALUE(x) (A_BCM1480_SWTRC_MATCH_TAG_VALUE_0 + ((x)*16)) | ||
710 | #define A_BCM1480_SWTRC_MATCH_TAG_MASK(x) (A_BCM1480_SWTRC_MATCH_TAG_MASK_0 + ((x)*16)) | ||
711 | |||
712 | |||
713 | |||
714 | /* ********************************************************************* | ||
715 | * High-Speed Port Registers (Section 13) | ||
716 | ********************************************************************* */ | ||
717 | |||
718 | #define A_BCM1480_HSP_BASE_0 0x00DF810000 | ||
719 | #define A_BCM1480_HSP_BASE_1 0x00DF890000 | ||
720 | #define A_BCM1480_HSP_BASE_2 0x00DF910000 | ||
721 | #define BCM1480_HSP_REGISTER_SPACING 0x80000 | ||
722 | |||
723 | #define A_BCM1480_HSP_BASE(idx) (A_BCM1480_HSP_BASE_0 + ((idx)*BCM1480_HSP_REGISTER_SPACING)) | ||
724 | #define A_BCM1480_HSP_REGISTER(idx, reg) (A_BCM1480_HSP_BASE(idx) + (reg)) | ||
725 | |||
726 | #define R_BCM1480_HSP_RX_SPI4_CFG_0 0x0000000000 | ||
727 | #define R_BCM1480_HSP_RX_SPI4_CFG_1 0x0000000008 | ||
728 | #define R_BCM1480_HSP_RX_SPI4_DESKEW_OVERRIDE 0x0000000010 | ||
729 | #define R_BCM1480_HSP_RX_SPI4_DESKEW_DATAPATH 0x0000000018 | ||
730 | #define R_BCM1480_HSP_RX_SPI4_PORT_INT_EN 0x0000000020 | ||
731 | #define R_BCM1480_HSP_RX_SPI4_PORT_INT_STATUS 0x0000000028 | ||
732 | |||
733 | #define R_BCM1480_HSP_RX_SPI4_CALENDAR_0 0x0000000200 | ||
734 | #define R_BCM1480_HSP_RX_SPI4_CALENDAR_1 0x0000000208 | ||
735 | |||
736 | #define R_BCM1480_HSP_RX_PLL_CNFG 0x0000000800 | ||
737 | #define R_BCM1480_HSP_RX_CALIBRATION 0x0000000808 | ||
738 | #define R_BCM1480_HSP_RX_TEST 0x0000000810 | ||
739 | #define R_BCM1480_HSP_RX_DIAG_DETAILS 0x0000000818 | ||
740 | #define R_BCM1480_HSP_RX_DIAG_CRC_0 0x0000000820 | ||
741 | #define R_BCM1480_HSP_RX_DIAG_CRC_1 0x0000000828 | ||
742 | #define R_BCM1480_HSP_RX_DIAG_HTCMD 0x0000000830 | ||
743 | #define R_BCM1480_HSP_RX_DIAG_PKTCTL 0x0000000838 | ||
744 | |||
745 | #define R_BCM1480_HSP_RX_VIS_FLCTRL_COUNTER 0x0000000870 | ||
746 | |||
747 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_0 0x0000020020 | ||
748 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_1 0x0000020028 | ||
749 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_2 0x0000020030 | ||
750 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_3 0x0000020038 | ||
751 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_4 0x0000020040 | ||
752 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_5 0x0000020048 | ||
753 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_6 0x0000020050 | ||
754 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_7 0x0000020058 | ||
755 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC(idx) (R_BCM1480_HSP_RX_PKT_RAMALLOC_0 + 8*(idx)) | ||
756 | |||
757 | /* XXX Following registers were shuffled. Renamed/renumbered per errata. */ | ||
758 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_0 0x0000020078 | ||
759 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_1 0x0000020080 | ||
760 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_2 0x0000020088 | ||
761 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_3 0x0000020090 | ||
762 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_4 0x0000020098 | ||
763 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_5 0x00000200A0 | ||
764 | |||
765 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_0 0x00000200B0 | ||
766 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_1 0x00000200B8 | ||
767 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_2 0x00000200C0 | ||
768 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_3 0x00000200C8 | ||
769 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_4 0x00000200D0 | ||
770 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_5 0x00000200D8 | ||
771 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_6 0x00000200E0 | ||
772 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_7 0x00000200E8 | ||
773 | #define R_BCM1480_HSP_RX_SPI_WATERMARK(idx) (R_BCM1480_HSP_RX_SPI_WATERMARK_0 + 8*(idx)) | ||
774 | |||
775 | #define R_BCM1480_HSP_RX_VIS_CMDQ_0 0x00000200F0 | ||
776 | #define R_BCM1480_HSP_RX_VIS_CMDQ_1 0x00000200F8 | ||
777 | #define R_BCM1480_HSP_RX_VIS_CMDQ_2 0x0000020100 | ||
778 | #define R_BCM1480_HSP_RX_RAM_READCTL 0x0000020108 | ||
779 | #define R_BCM1480_HSP_RX_RAM_READWINDOW 0x0000020110 | ||
780 | #define R_BCM1480_HSP_RX_RF_READCTL 0x0000020118 | ||
781 | #define R_BCM1480_HSP_RX_RF_READWINDOW 0x0000020120 | ||
782 | |||
783 | #define R_BCM1480_HSP_TX_SPI4_CFG_0 0x0000040000 | ||
784 | #define R_BCM1480_HSP_TX_SPI4_CFG_1 0x0000040008 | ||
785 | #define R_BCM1480_HSP_TX_SPI4_TRAINING_FMT 0x0000040010 | ||
786 | |||
787 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_0 0x0000040020 | ||
788 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_1 0x0000040028 | ||
789 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_2 0x0000040030 | ||
790 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_3 0x0000040038 | ||
791 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_4 0x0000040040 | ||
792 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_5 0x0000040048 | ||
793 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_6 0x0000040050 | ||
794 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_7 0x0000040058 | ||
795 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC(idx) (R_BCM1480_HSP_TX_PKT_RAMALLOC_0 + 8*(idx)) | ||
796 | #define R_BCM1480_HSP_TX_NPC_RAMALLOC 0x0000040078 | ||
797 | #define R_BCM1480_HSP_TX_RSP_RAMALLOC 0x0000040080 | ||
798 | #define R_BCM1480_HSP_TX_PC_RAMALLOC 0x0000040088 | ||
799 | #define R_BCM1480_HSP_TX_HTCC_RAMALLOC_0 0x0000040090 | ||
800 | #define R_BCM1480_HSP_TX_HTCC_RAMALLOC_1 0x0000040098 | ||
801 | #define R_BCM1480_HSP_TX_HTCC_RAMALLOC_2 0x00000400A0 | ||
802 | |||
803 | #define R_BCM1480_HSP_TX_PKT_RXPHITCNT_0 0x00000400B0 | ||
804 | #define R_BCM1480_HSP_TX_PKT_RXPHITCNT_1 0x00000400B8 | ||
805 | #define R_BCM1480_HSP_TX_PKT_RXPHITCNT_2 0x00000400C0 | ||
806 | #define R_BCM1480_HSP_TX_PKT_RXPHITCNT_3 0x00000400C8 | ||
807 | #define R_BCM1480_HSP_TX_PKT_RXPHITCNT(idx) (R_BCM1480_HSP_TX_PKT_RXPHITCNT_0 + 8*(idx)) | ||
808 | #define R_BCM1480_HSP_TX_HTIO_RXPHITCNT 0x00000400D0 | ||
809 | #define R_BCM1480_HSP_TX_HTCC_RXPHITCNT 0x00000400D8 | ||
810 | |||
811 | #define R_BCM1480_HSP_TX_PKT_TXPHITCNT_0 0x00000400E0 | ||
812 | #define R_BCM1480_HSP_TX_PKT_TXPHITCNT_1 0x00000400E8 | ||
813 | #define R_BCM1480_HSP_TX_PKT_TXPHITCNT_2 0x00000400F0 | ||
814 | #define R_BCM1480_HSP_TX_PKT_TXPHITCNT_3 0x00000400F8 | ||
815 | #define R_BCM1480_HSP_TX_PKT_TXPHITCNT(idx) (R_BCM1480_HSP_TX_PKT_TXPHITCNT_0 + 8*(idx)) | ||
816 | #define R_BCM1480_HSP_TX_HTIO_TXPHITCNT 0x0000040100 | ||
817 | #define R_BCM1480_HSP_TX_HTCC_TXPHITCNT 0x0000040108 | ||
818 | |||
819 | #define R_BCM1480_HSP_TX_SPI4_CALENDAR_0 0x0000040200 | ||
820 | #define R_BCM1480_HSP_TX_SPI4_CALENDAR_1 0x0000040208 | ||
821 | |||
822 | #define R_BCM1480_HSP_TX_PLL_CNFG 0x0000040800 | ||
823 | #define R_BCM1480_HSP_TX_CALIBRATION 0x0000040808 | ||
824 | #define R_BCM1480_HSP_TX_TEST 0x0000040810 | ||
825 | |||
826 | #define R_BCM1480_HSP_TX_VIS_CMDQ_0 0x0000040840 | ||
827 | #define R_BCM1480_HSP_TX_VIS_CMDQ_1 0x0000040848 | ||
828 | #define R_BCM1480_HSP_TX_VIS_CMDQ_2 0x0000040850 | ||
829 | #define R_BCM1480_HSP_TX_RAM_READCTL 0x0000040860 | ||
830 | #define R_BCM1480_HSP_TX_RAM_READWINDOW 0x0000040868 | ||
831 | #define R_BCM1480_HSP_TX_RF_READCTL 0x0000040870 | ||
832 | #define R_BCM1480_HSP_TX_RF_READWINDOW 0x0000040878 | ||
833 | |||
834 | #define R_BCM1480_HSP_TX_SPI4_PORT_INT_STATUS 0x0000040880 | ||
835 | #define R_BCM1480_HSP_TX_SPI4_PORT_INT_EN 0x0000040888 | ||
836 | |||
837 | #define R_BCM1480_HSP_TX_NEXT_ADDR_BASE 0x000040400 | ||
838 | #define R_BCM1480_HSP_TX_NEXT_ADDR_REGISTER(x) (R_BCM1480_HSP_TX_NEXT_ADDR_BASE+ 8*(x)) | ||
839 | |||
840 | |||
841 | |||
842 | /* ********************************************************************* | ||
843 | * Physical Address Map (Table 10 and Figure 7) | ||
844 | ********************************************************************* */ | ||
845 | |||
846 | #define A_BCM1480_PHYS_MEMORY_0 _SB_MAKE64(0x0000000000) | ||
847 | #define A_BCM1480_PHYS_MEMORY_SIZE _SB_MAKE64((256*1024*1024)) | ||
848 | #define A_BCM1480_PHYS_SYSTEM_CTL _SB_MAKE64(0x0010000000) | ||
849 | #define A_BCM1480_PHYS_IO_SYSTEM _SB_MAKE64(0x0010060000) | ||
850 | #define A_BCM1480_PHYS_GENBUS _SB_MAKE64(0x0010090000) | ||
851 | #define A_BCM1480_PHYS_GENBUS_END _SB_MAKE64(0x0028000000) | ||
852 | #define A_BCM1480_PHYS_PCI_MISC_MATCH_BYTES _SB_MAKE64(0x0028000000) | ||
853 | #define A_BCM1480_PHYS_PCI_IACK_MATCH_BYTES _SB_MAKE64(0x0029000000) | ||
854 | #define A_BCM1480_PHYS_PCI_IO_MATCH_BYTES _SB_MAKE64(0x002C000000) | ||
855 | #define A_BCM1480_PHYS_PCI_CFG_MATCH_BYTES _SB_MAKE64(0x002E000000) | ||
856 | #define A_BCM1480_PHYS_PCI_OMAP_MATCH_BYTES _SB_MAKE64(0x002F000000) | ||
857 | #define A_BCM1480_PHYS_PCI_MEM_MATCH_BYTES _SB_MAKE64(0x0030000000) | ||
858 | #define A_BCM1480_PHYS_HT_MEM_MATCH_BYTES _SB_MAKE64(0x0040000000) | ||
859 | #define A_BCM1480_PHYS_HT_MEM_MATCH_BITS _SB_MAKE64(0x0060000000) | ||
860 | #define A_BCM1480_PHYS_MEMORY_1 _SB_MAKE64(0x0080000000) | ||
861 | #define A_BCM1480_PHYS_MEMORY_2 _SB_MAKE64(0x0090000000) | ||
862 | #define A_BCM1480_PHYS_PCI_MISC_MATCH_BITS _SB_MAKE64(0x00A8000000) | ||
863 | #define A_BCM1480_PHYS_PCI_IACK_MATCH_BITS _SB_MAKE64(0x00A9000000) | ||
864 | #define A_BCM1480_PHYS_PCI_IO_MATCH_BITS _SB_MAKE64(0x00AC000000) | ||
865 | #define A_BCM1480_PHYS_PCI_CFG_MATCH_BITS _SB_MAKE64(0x00AE000000) | ||
866 | #define A_BCM1480_PHYS_PCI_OMAP_MATCH_BITS _SB_MAKE64(0x00AF000000) | ||
867 | #define A_BCM1480_PHYS_PCI_MEM_MATCH_BITS _SB_MAKE64(0x00B0000000) | ||
868 | #define A_BCM1480_PHYS_MEMORY_3 _SB_MAKE64(0x00C0000000) | ||
869 | #define A_BCM1480_PHYS_L2_CACHE_TEST _SB_MAKE64(0x00D0000000) | ||
870 | #define A_BCM1480_PHYS_HT_SPECIAL_MATCH_BYTES _SB_MAKE64(0x00D8000000) | ||
871 | #define A_BCM1480_PHYS_HT_IO_MATCH_BYTES _SB_MAKE64(0x00DC000000) | ||
872 | #define A_BCM1480_PHYS_HT_CFG_MATCH_BYTES _SB_MAKE64(0x00DE000000) | ||
873 | #define A_BCM1480_PHYS_HS_SUBSYS _SB_MAKE64(0x00DF000000) | ||
874 | #define A_BCM1480_PHYS_HT_SPECIAL_MATCH_BITS _SB_MAKE64(0x00F8000000) | ||
875 | #define A_BCM1480_PHYS_HT_IO_MATCH_BITS _SB_MAKE64(0x00FC000000) | ||
876 | #define A_BCM1480_PHYS_HT_CFG_MATCH_BITS _SB_MAKE64(0x00FE000000) | ||
877 | #define A_BCM1480_PHYS_MEMORY_EXP _SB_MAKE64(0x0100000000) | ||
878 | #define A_BCM1480_PHYS_MEMORY_EXP_SIZE _SB_MAKE64((508*1024*1024*1024)) | ||
879 | #define A_BCM1480_PHYS_PCI_UPPER _SB_MAKE64(0x1000000000) | ||
880 | #define A_BCM1480_PHYS_HT_UPPER_MATCH_BYTES _SB_MAKE64(0x2000000000) | ||
881 | #define A_BCM1480_PHYS_HT_UPPER_MATCH_BITS _SB_MAKE64(0x3000000000) | ||
882 | #define A_BCM1480_PHYS_HT_NODE_ALIAS _SB_MAKE64(0x4000000000) | ||
883 | #define A_BCM1480_PHYS_HT_FULLACCESS _SB_MAKE64(0xF000000000) | ||
884 | |||
885 | |||
886 | /* ********************************************************************* | ||
887 | * L2 Cache as RAM (Table 54) | ||
888 | ********************************************************************* */ | ||
889 | |||
890 | #define A_BCM1480_PHYS_L2CACHE_WAY_SIZE _SB_MAKE64(0x0000020000) | ||
891 | #define BCM1480_PHYS_L2CACHE_NUM_WAYS 8 | ||
892 | #define A_BCM1480_PHYS_L2CACHE_TOTAL_SIZE _SB_MAKE64(0x0000100000) | ||
893 | #define A_BCM1480_PHYS_L2CACHE_WAY0 _SB_MAKE64(0x00D0300000) | ||
894 | #define A_BCM1480_PHYS_L2CACHE_WAY1 _SB_MAKE64(0x00D0320000) | ||
895 | #define A_BCM1480_PHYS_L2CACHE_WAY2 _SB_MAKE64(0x00D0340000) | ||
896 | #define A_BCM1480_PHYS_L2CACHE_WAY3 _SB_MAKE64(0x00D0360000) | ||
897 | #define A_BCM1480_PHYS_L2CACHE_WAY4 _SB_MAKE64(0x00D0380000) | ||
898 | #define A_BCM1480_PHYS_L2CACHE_WAY5 _SB_MAKE64(0x00D03A0000) | ||
899 | #define A_BCM1480_PHYS_L2CACHE_WAY6 _SB_MAKE64(0x00D03C0000) | ||
900 | #define A_BCM1480_PHYS_L2CACHE_WAY7 _SB_MAKE64(0x00D03E0000) | ||
901 | |||
902 | #endif /* _BCM1480_REGS_H */ | ||
diff --git a/include/asm-mips/sibyte/bcm1480_scd.h b/include/asm-mips/sibyte/bcm1480_scd.h deleted file mode 100644 index 25ef24cbb92a..000000000000 --- a/include/asm-mips/sibyte/bcm1480_scd.h +++ /dev/null | |||
@@ -1,406 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * BCM1280/BCM1400 Board Support Package | ||
3 | * | ||
4 | * SCD Constants and Macros File: bcm1480_scd.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * manipulating the System Control and Debug module. | ||
8 | * | ||
9 | * BCM1400 specification level: 1X55_1X80-UM100-R (12/18/03) | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003,2004,2005 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | #ifndef _BCM1480_SCD_H | ||
33 | #define _BCM1480_SCD_H | ||
34 | |||
35 | #include "sb1250_defs.h" | ||
36 | |||
37 | /* ********************************************************************* | ||
38 | * Pull in the BCM1250's SCD since lots of stuff is the same. | ||
39 | ********************************************************************* */ | ||
40 | |||
41 | #include "sb1250_scd.h" | ||
42 | |||
43 | /* ********************************************************************* | ||
44 | * Some general notes: | ||
45 | * | ||
46 | * This file is basically a "what's new" header file. Since the | ||
47 | * BCM1250 and the new BCM1480 (and derivatives) share many common | ||
48 | * features, this file contains only what's new or changed from | ||
49 | * the 1250. (above, you can see that we include the 1250 symbols | ||
50 | * to get the base functionality). | ||
51 | * | ||
52 | * In software, be sure to use the correct symbols, particularly | ||
53 | * for blocks that are different between the two chip families. | ||
54 | * All BCM1480-specific symbols have _BCM1480_ in their names, | ||
55 | * and all BCM1250-specific and "base" functions that are common in | ||
56 | * both chips have no special names (this is for compatibility with | ||
57 | * older include files). Therefore, if you're working with the | ||
58 | * SCD, which is very different on each chip, A_SCD_xxx implies | ||
59 | * the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480 | ||
60 | * version. | ||
61 | ********************************************************************* */ | ||
62 | |||
63 | /* ********************************************************************* | ||
64 | * System control/debug registers | ||
65 | ********************************************************************* */ | ||
66 | |||
67 | /* | ||
68 | * System Identification and Revision Register (Table 12) | ||
69 | * Register: SCD_SYSTEM_REVISION | ||
70 | * This register is field compatible with the 1250. | ||
71 | */ | ||
72 | |||
73 | /* | ||
74 | * New part definitions | ||
75 | */ | ||
76 | |||
77 | #define K_SYS_PART_BCM1480 0x1406 | ||
78 | #define K_SYS_PART_BCM1280 0x1206 | ||
79 | #define K_SYS_PART_BCM1455 0x1407 | ||
80 | #define K_SYS_PART_BCM1255 0x1257 | ||
81 | #define K_SYS_PART_BCM1158 0x1156 | ||
82 | |||
83 | /* | ||
84 | * Manufacturing Information Register (Table 14) | ||
85 | * Register: SCD_SYSTEM_MANUF | ||
86 | */ | ||
87 | |||
88 | /* | ||
89 | * System Configuration Register (Table 15) | ||
90 | * Register: SCD_SYSTEM_CFG | ||
91 | * Entire register is different from 1250, all new constants below | ||
92 | */ | ||
93 | |||
94 | #define M_BCM1480_SYS_RESERVED0 _SB_MAKEMASK1(0) | ||
95 | #define M_BCM1480_SYS_HT_MINRSTCNT _SB_MAKEMASK1(1) | ||
96 | #define M_BCM1480_SYS_RESERVED2 _SB_MAKEMASK1(2) | ||
97 | #define M_BCM1480_SYS_RESERVED3 _SB_MAKEMASK1(3) | ||
98 | #define M_BCM1480_SYS_RESERVED4 _SB_MAKEMASK1(4) | ||
99 | #define M_BCM1480_SYS_IOB_DIV _SB_MAKEMASK1(5) | ||
100 | |||
101 | #define S_BCM1480_SYS_PLL_DIV _SB_MAKE64(6) | ||
102 | #define M_BCM1480_SYS_PLL_DIV _SB_MAKEMASK(5, S_BCM1480_SYS_PLL_DIV) | ||
103 | #define V_BCM1480_SYS_PLL_DIV(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_PLL_DIV) | ||
104 | #define G_BCM1480_SYS_PLL_DIV(x) _SB_GETVALUE(x, S_BCM1480_SYS_PLL_DIV, M_BCM1480_SYS_PLL_DIV) | ||
105 | |||
106 | #define S_BCM1480_SYS_SW_DIV _SB_MAKE64(11) | ||
107 | #define M_BCM1480_SYS_SW_DIV _SB_MAKEMASK(5, S_BCM1480_SYS_SW_DIV) | ||
108 | #define V_BCM1480_SYS_SW_DIV(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_SW_DIV) | ||
109 | #define G_BCM1480_SYS_SW_DIV(x) _SB_GETVALUE(x, S_BCM1480_SYS_SW_DIV, M_BCM1480_SYS_SW_DIV) | ||
110 | |||
111 | #define M_BCM1480_SYS_PCMCIA_ENABLE _SB_MAKEMASK1(16) | ||
112 | #define M_BCM1480_SYS_DUART1_ENABLE _SB_MAKEMASK1(17) | ||
113 | |||
114 | #define S_BCM1480_SYS_BOOT_MODE _SB_MAKE64(18) | ||
115 | #define M_BCM1480_SYS_BOOT_MODE _SB_MAKEMASK(2, S_BCM1480_SYS_BOOT_MODE) | ||
116 | #define V_BCM1480_SYS_BOOT_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_BOOT_MODE) | ||
117 | #define G_BCM1480_SYS_BOOT_MODE(x) _SB_GETVALUE(x, S_BCM1480_SYS_BOOT_MODE, M_BCM1480_SYS_BOOT_MODE) | ||
118 | #define K_BCM1480_SYS_BOOT_MODE_ROM32 0 | ||
119 | #define K_BCM1480_SYS_BOOT_MODE_ROM8 1 | ||
120 | #define K_BCM1480_SYS_BOOT_MODE_SMBUS_SMALL 2 | ||
121 | #define K_BCM1480_SYS_BOOT_MODE_SMBUS_BIG 3 | ||
122 | #define M_BCM1480_SYS_BOOT_MODE_SMBUS _SB_MAKEMASK1(19) | ||
123 | |||
124 | #define M_BCM1480_SYS_PCI_HOST _SB_MAKEMASK1(20) | ||
125 | #define M_BCM1480_SYS_PCI_ARBITER _SB_MAKEMASK1(21) | ||
126 | #define M_BCM1480_SYS_BIG_ENDIAN _SB_MAKEMASK1(22) | ||
127 | #define M_BCM1480_SYS_GENCLK_EN _SB_MAKEMASK1(23) | ||
128 | #define M_BCM1480_SYS_GEN_PARITY_EN _SB_MAKEMASK1(24) | ||
129 | #define M_BCM1480_SYS_RESERVED25 _SB_MAKEMASK1(25) | ||
130 | |||
131 | #define S_BCM1480_SYS_CONFIG 26 | ||
132 | #define M_BCM1480_SYS_CONFIG _SB_MAKEMASK(6, S_BCM1480_SYS_CONFIG) | ||
133 | #define V_BCM1480_SYS_CONFIG(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_CONFIG) | ||
134 | #define G_BCM1480_SYS_CONFIG(x) _SB_GETVALUE(x, S_BCM1480_SYS_CONFIG, M_BCM1480_SYS_CONFIG) | ||
135 | |||
136 | #define M_BCM1480_SYS_RESERVED32 _SB_MAKEMASK(32, 15) | ||
137 | |||
138 | #define S_BCM1480_SYS_NODEID 47 | ||
139 | #define M_BCM1480_SYS_NODEID _SB_MAKEMASK(4, S_BCM1480_SYS_NODEID) | ||
140 | #define V_BCM1480_SYS_NODEID(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_NODEID) | ||
141 | #define G_BCM1480_SYS_NODEID(x) _SB_GETVALUE(x, S_BCM1480_SYS_NODEID, M_BCM1480_SYS_NODEID) | ||
142 | |||
143 | #define M_BCM1480_SYS_CCNUMA_EN _SB_MAKEMASK1(51) | ||
144 | #define M_BCM1480_SYS_CPU_RESET_0 _SB_MAKEMASK1(52) | ||
145 | #define M_BCM1480_SYS_CPU_RESET_1 _SB_MAKEMASK1(53) | ||
146 | #define M_BCM1480_SYS_CPU_RESET_2 _SB_MAKEMASK1(54) | ||
147 | #define M_BCM1480_SYS_CPU_RESET_3 _SB_MAKEMASK1(55) | ||
148 | #define S_BCM1480_SYS_DISABLECPU0 56 | ||
149 | #define M_BCM1480_SYS_DISABLECPU0 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU0) | ||
150 | #define S_BCM1480_SYS_DISABLECPU1 57 | ||
151 | #define M_BCM1480_SYS_DISABLECPU1 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU1) | ||
152 | #define S_BCM1480_SYS_DISABLECPU2 58 | ||
153 | #define M_BCM1480_SYS_DISABLECPU2 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU2) | ||
154 | #define S_BCM1480_SYS_DISABLECPU3 59 | ||
155 | #define M_BCM1480_SYS_DISABLECPU3 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU3) | ||
156 | |||
157 | #define M_BCM1480_SYS_SB_SOFTRES _SB_MAKEMASK1(60) | ||
158 | #define M_BCM1480_SYS_EXT_RESET _SB_MAKEMASK1(61) | ||
159 | #define M_BCM1480_SYS_SYSTEM_RESET _SB_MAKEMASK1(62) | ||
160 | #define M_BCM1480_SYS_SW_FLAG _SB_MAKEMASK1(63) | ||
161 | |||
162 | /* | ||
163 | * Scratch Register (Table 16) | ||
164 | * Register: SCD_SYSTEM_SCRATCH | ||
165 | * Same as BCM1250 | ||
166 | */ | ||
167 | |||
168 | |||
169 | /* | ||
170 | * Mailbox Registers (Table 17) | ||
171 | * Registers: SCD_MBOX_{0,1}_CPU_x | ||
172 | * Same as BCM1250 | ||
173 | */ | ||
174 | |||
175 | |||
176 | /* | ||
177 | * See bcm1480_int.h for interrupt mapper registers. | ||
178 | */ | ||
179 | |||
180 | |||
181 | /* | ||
182 | * Watchdog Timer Initial Count Registers (Table 23) | ||
183 | * Registers: SCD_WDOG_INIT_CNT_x | ||
184 | * | ||
185 | * The watchdogs are almost the same as the 1250, except | ||
186 | * the configuration register has more bits to control the | ||
187 | * other CPUs. | ||
188 | */ | ||
189 | |||
190 | |||
191 | /* | ||
192 | * Watchdog Timer Configuration Registers (Table 25) | ||
193 | * Registers: SCD_WDOG_CFG_x | ||
194 | */ | ||
195 | |||
196 | #define M_BCM1480_SCD_WDOG_ENABLE _SB_MAKEMASK1(0) | ||
197 | |||
198 | #define S_BCM1480_SCD_WDOG_RESET_TYPE 2 | ||
199 | #define M_BCM1480_SCD_WDOG_RESET_TYPE _SB_MAKEMASK(5, S_BCM1480_SCD_WDOG_RESET_TYPE) | ||
200 | #define V_BCM1480_SCD_WDOG_RESET_TYPE(x) _SB_MAKEVALUE(x, S_BCM1480_SCD_WDOG_RESET_TYPE) | ||
201 | #define G_BCM1480_SCD_WDOG_RESET_TYPE(x) _SB_GETVALUE(x, S_BCM1480_SCD_WDOG_RESET_TYPE, M_BCM1480_SCD_WDOG_RESET_TYPE) | ||
202 | |||
203 | #define K_BCM1480_SCD_WDOG_RESET_FULL 0 /* actually, (x & 1) == 0 */ | ||
204 | #define K_BCM1480_SCD_WDOG_RESET_SOFT 1 | ||
205 | #define K_BCM1480_SCD_WDOG_RESET_CPU0 3 | ||
206 | #define K_BCM1480_SCD_WDOG_RESET_CPU1 5 | ||
207 | #define K_BCM1480_SCD_WDOG_RESET_CPU2 9 | ||
208 | #define K_BCM1480_SCD_WDOG_RESET_CPU3 17 | ||
209 | #define K_BCM1480_SCD_WDOG_RESET_ALL_CPUS 31 | ||
210 | |||
211 | |||
212 | #define M_BCM1480_SCD_WDOG_HAS_RESET _SB_MAKEMASK1(8) | ||
213 | |||
214 | /* | ||
215 | * General Timer Initial Count Registers (Table 26) | ||
216 | * Registers: SCD_TIMER_INIT_x | ||
217 | * | ||
218 | * The timer registers are the same as the BCM1250 | ||
219 | */ | ||
220 | |||
221 | |||
222 | /* | ||
223 | * ZBbus Count Register (Table 29) | ||
224 | * Register: ZBBUS_CYCLE_COUNT | ||
225 | * | ||
226 | * Same as BCM1250 | ||
227 | */ | ||
228 | |||
229 | /* | ||
230 | * ZBbus Compare Registers (Table 30) | ||
231 | * Registers: ZBBUS_CYCLE_CPx | ||
232 | * | ||
233 | * Same as BCM1250 | ||
234 | */ | ||
235 | |||
236 | |||
237 | /* | ||
238 | * System Performance Counter Configuration Register (Table 31) | ||
239 | * Register: PERF_CNT_CFG_0 | ||
240 | * | ||
241 | * SPC_CFG_SRC[0-3] is the same as the 1250. | ||
242 | * SPC_CFG_SRC[4-7] only exist on the 1480 | ||
243 | * The clear/enable bits are in different locations on the 1250 and 1480. | ||
244 | */ | ||
245 | |||
246 | #define S_SPC_CFG_SRC4 32 | ||
247 | #define M_SPC_CFG_SRC4 _SB_MAKEMASK(8, S_SPC_CFG_SRC4) | ||
248 | #define V_SPC_CFG_SRC4(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC4) | ||
249 | #define G_SPC_CFG_SRC4(x) _SB_GETVALUE(x, S_SPC_CFG_SRC4, M_SPC_CFG_SRC4) | ||
250 | |||
251 | #define S_SPC_CFG_SRC5 40 | ||
252 | #define M_SPC_CFG_SRC5 _SB_MAKEMASK(8, S_SPC_CFG_SRC5) | ||
253 | #define V_SPC_CFG_SRC5(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC5) | ||
254 | #define G_SPC_CFG_SRC5(x) _SB_GETVALUE(x, S_SPC_CFG_SRC5, M_SPC_CFG_SRC5) | ||
255 | |||
256 | #define S_SPC_CFG_SRC6 48 | ||
257 | #define M_SPC_CFG_SRC6 _SB_MAKEMASK(8, S_SPC_CFG_SRC6) | ||
258 | #define V_SPC_CFG_SRC6(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC6) | ||
259 | #define G_SPC_CFG_SRC6(x) _SB_GETVALUE(x, S_SPC_CFG_SRC6, M_SPC_CFG_SRC6) | ||
260 | |||
261 | #define S_SPC_CFG_SRC7 56 | ||
262 | #define M_SPC_CFG_SRC7 _SB_MAKEMASK(8, S_SPC_CFG_SRC7) | ||
263 | #define V_SPC_CFG_SRC7(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC7) | ||
264 | #define G_SPC_CFG_SRC7(x) _SB_GETVALUE(x, S_SPC_CFG_SRC7, M_SPC_CFG_SRC7) | ||
265 | |||
266 | /* | ||
267 | * System Performance Counter Control Register (Table 32) | ||
268 | * Register: PERF_CNT_CFG_1 | ||
269 | * BCM1480 specific | ||
270 | */ | ||
271 | #define M_BCM1480_SPC_CFG_CLEAR _SB_MAKEMASK1(0) | ||
272 | #define M_BCM1480_SPC_CFG_ENABLE _SB_MAKEMASK1(1) | ||
273 | #if SIBYTE_HDR_FEATURE_CHIP(1480) | ||
274 | #define M_SPC_CFG_CLEAR M_BCM1480_SPC_CFG_CLEAR | ||
275 | #define M_SPC_CFG_ENABLE M_BCM1480_SPC_CFG_ENABLE | ||
276 | #endif | ||
277 | |||
278 | /* | ||
279 | * System Performance Counters (Table 33) | ||
280 | * Registers: PERF_CNT_x | ||
281 | */ | ||
282 | |||
283 | #define S_BCM1480_SPC_CNT_COUNT 0 | ||
284 | #define M_BCM1480_SPC_CNT_COUNT _SB_MAKEMASK(40, S_BCM1480_SPC_CNT_COUNT) | ||
285 | #define V_BCM1480_SPC_CNT_COUNT(x) _SB_MAKEVALUE(x, S_BCM1480_SPC_CNT_COUNT) | ||
286 | #define G_BCM1480_SPC_CNT_COUNT(x) _SB_GETVALUE(x, S_BCM1480_SPC_CNT_COUNT, M_BCM1480_SPC_CNT_COUNT) | ||
287 | |||
288 | #define M_BCM1480_SPC_CNT_OFLOW _SB_MAKEMASK1(40) | ||
289 | |||
290 | |||
291 | /* | ||
292 | * Bus Watcher Error Status Register (Tables 36, 37) | ||
293 | * Registers: BUS_ERR_STATUS, BUS_ERR_STATUS_DEBUG | ||
294 | * Same as BCM1250. | ||
295 | */ | ||
296 | |||
297 | /* | ||
298 | * Bus Watcher Error Data Registers (Table 38) | ||
299 | * Registers: BUS_ERR_DATA_x | ||
300 | * Same as BCM1250. | ||
301 | */ | ||
302 | |||
303 | /* | ||
304 | * Bus Watcher L2 ECC Counter Register (Table 39) | ||
305 | * Register: BUS_L2_ERRORS | ||
306 | * Same as BCM1250. | ||
307 | */ | ||
308 | |||
309 | |||
310 | /* | ||
311 | * Bus Watcher Memory and I/O Error Counter Register (Table 40) | ||
312 | * Register: BUS_MEM_IO_ERRORS | ||
313 | * Same as BCM1250. | ||
314 | */ | ||
315 | |||
316 | |||
317 | /* | ||
318 | * Address Trap Registers | ||
319 | * | ||
320 | * Register layout same as BCM1250, almost. The bus agents | ||
321 | * are different, and the address trap configuration bits are | ||
322 | * slightly different. | ||
323 | */ | ||
324 | |||
325 | #define M_BCM1480_ATRAP_INDEX _SB_MAKEMASK(4, 0) | ||
326 | #define M_BCM1480_ATRAP_ADDRESS _SB_MAKEMASK(40, 0) | ||
327 | |||
328 | #define S_BCM1480_ATRAP_CFG_CNT 0 | ||
329 | #define M_BCM1480_ATRAP_CFG_CNT _SB_MAKEMASK(3, S_BCM1480_ATRAP_CFG_CNT) | ||
330 | #define V_BCM1480_ATRAP_CFG_CNT(x) _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_CNT) | ||
331 | #define G_BCM1480_ATRAP_CFG_CNT(x) _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_CNT, M_BCM1480_ATRAP_CFG_CNT) | ||
332 | |||
333 | #define M_BCM1480_ATRAP_CFG_WRITE _SB_MAKEMASK1(3) | ||
334 | #define M_BCM1480_ATRAP_CFG_ALL _SB_MAKEMASK1(4) | ||
335 | #define M_BCM1480_ATRAP_CFG_INV _SB_MAKEMASK1(5) | ||
336 | #define M_BCM1480_ATRAP_CFG_USESRC _SB_MAKEMASK1(6) | ||
337 | #define M_BCM1480_ATRAP_CFG_SRCINV _SB_MAKEMASK1(7) | ||
338 | |||
339 | #define S_BCM1480_ATRAP_CFG_AGENTID 8 | ||
340 | #define M_BCM1480_ATRAP_CFG_AGENTID _SB_MAKEMASK(4, S_BCM1480_ATRAP_CFG_AGENTID) | ||
341 | #define V_BCM1480_ATRAP_CFG_AGENTID(x) _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_AGENTID) | ||
342 | #define G_BCM1480_ATRAP_CFG_AGENTID(x) _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_AGENTID, M_BCM1480_ATRAP_CFG_AGENTID) | ||
343 | |||
344 | |||
345 | #define K_BCM1480_BUS_AGENT_CPU0 0 | ||
346 | #define K_BCM1480_BUS_AGENT_CPU1 1 | ||
347 | #define K_BCM1480_BUS_AGENT_NC 2 | ||
348 | #define K_BCM1480_BUS_AGENT_IOB 3 | ||
349 | #define K_BCM1480_BUS_AGENT_SCD 4 | ||
350 | #define K_BCM1480_BUS_AGENT_L2C 6 | ||
351 | #define K_BCM1480_BUS_AGENT_MC 7 | ||
352 | #define K_BCM1480_BUS_AGENT_CPU2 8 | ||
353 | #define K_BCM1480_BUS_AGENT_CPU3 9 | ||
354 | #define K_BCM1480_BUS_AGENT_PM 10 | ||
355 | |||
356 | #define S_BCM1480_ATRAP_CFG_CATTR 12 | ||
357 | #define M_BCM1480_ATRAP_CFG_CATTR _SB_MAKEMASK(2, S_BCM1480_ATRAP_CFG_CATTR) | ||
358 | #define V_BCM1480_ATRAP_CFG_CATTR(x) _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_CATTR) | ||
359 | #define G_BCM1480_ATRAP_CFG_CATTR(x) _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_CATTR, M_BCM1480_ATRAP_CFG_CATTR) | ||
360 | |||
361 | #define K_BCM1480_ATRAP_CFG_CATTR_IGNORE 0 | ||
362 | #define K_BCM1480_ATRAP_CFG_CATTR_UNC 1 | ||
363 | #define K_BCM1480_ATRAP_CFG_CATTR_NONCOH 2 | ||
364 | #define K_BCM1480_ATRAP_CFG_CATTR_COHERENT 3 | ||
365 | |||
366 | #define M_BCM1480_ATRAP_CFG_CATTRINV _SB_MAKEMASK1(14) | ||
367 | |||
368 | |||
369 | /* | ||
370 | * Trace Event Registers (Table 47) | ||
371 | * Same as BCM1250. | ||
372 | */ | ||
373 | |||
374 | /* | ||
375 | * Trace Sequence Control Registers (Table 48) | ||
376 | * Registers: TRACE_SEQUENCE_x | ||
377 | * | ||
378 | * Same as BCM1250 except for two new fields. | ||
379 | */ | ||
380 | |||
381 | |||
382 | #define M_BCM1480_SCD_TRSEQ_TID_MATCH_EN _SB_MAKEMASK1(25) | ||
383 | |||
384 | #define S_BCM1480_SCD_TRSEQ_SWFUNC 26 | ||
385 | #define M_BCM1480_SCD_TRSEQ_SWFUNC _SB_MAKEMASK(2, S_BCM1480_SCD_TRSEQ_SWFUNC) | ||
386 | #define V_BCM1480_SCD_TRSEQ_SWFUNC(x) _SB_MAKEVALUE(x, S_BCM1480_SCD_TRSEQ_SWFUNC) | ||
387 | #define G_BCM1480_SCD_TRSEQ_SWFUNC(x) _SB_GETVALUE(x, S_BCM1480_SCD_TRSEQ_SWFUNC, M_BCM1480_SCD_TRSEQ_SWFUNC) | ||
388 | |||
389 | /* | ||
390 | * Trace Control Register (Table 49) | ||
391 | * Register: TRACE_CFG | ||
392 | * | ||
393 | * BCM1480 changes to this register (other than location of the CUR_ADDR field) | ||
394 | * are defined below. | ||
395 | */ | ||
396 | |||
397 | #define S_BCM1480_SCD_TRACE_CFG_MODE 16 | ||
398 | #define M_BCM1480_SCD_TRACE_CFG_MODE _SB_MAKEMASK(2, S_BCM1480_SCD_TRACE_CFG_MODE) | ||
399 | #define V_BCM1480_SCD_TRACE_CFG_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_SCD_TRACE_CFG_MODE) | ||
400 | #define G_BCM1480_SCD_TRACE_CFG_MODE(x) _SB_GETVALUE(x, S_BCM1480_SCD_TRACE_CFG_MODE, M_BCM1480_SCD_TRACE_CFG_MODE) | ||
401 | |||
402 | #define K_BCM1480_SCD_TRACE_CFG_MODE_BLOCKERS 0 | ||
403 | #define K_BCM1480_SCD_TRACE_CFG_MODE_BYTEEN_INT 1 | ||
404 | #define K_BCM1480_SCD_TRACE_CFG_MODE_FLOW_ID 2 | ||
405 | |||
406 | #endif /* _BCM1480_SCD_H */ | ||
diff --git a/include/asm-mips/sibyte/bigsur.h b/include/asm-mips/sibyte/bigsur.h deleted file mode 100644 index ebefe797fc1d..000000000000 --- a/include/asm-mips/sibyte/bigsur.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000,2001,2002,2003,2004 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 | #ifndef __ASM_SIBYTE_BIGSUR_H | ||
19 | #define __ASM_SIBYTE_BIGSUR_H | ||
20 | |||
21 | #include <asm/sibyte/sb1250.h> | ||
22 | #include <asm/sibyte/bcm1480_int.h> | ||
23 | |||
24 | #ifdef CONFIG_SIBYTE_BIGSUR | ||
25 | #define SIBYTE_BOARD_NAME "BCM91x80A/B (BigSur)" | ||
26 | #define SIBYTE_HAVE_PCMCIA 1 | ||
27 | #define SIBYTE_HAVE_IDE 1 | ||
28 | #endif | ||
29 | |||
30 | /* Generic bus chip selects */ | ||
31 | #define LEDS_CS 3 | ||
32 | #define LEDS_PHYS 0x100a0000 | ||
33 | |||
34 | #ifdef SIBYTE_HAVE_IDE | ||
35 | #define IDE_CS 4 | ||
36 | #define IDE_PHYS 0x100b0000 | ||
37 | #define K_GPIO_GB_IDE 4 | ||
38 | #define K_INT_GB_IDE (K_INT_GPIO_0 + K_GPIO_GB_IDE) | ||
39 | #endif | ||
40 | |||
41 | #ifdef SIBYTE_HAVE_PCMCIA | ||
42 | #define PCMCIA_CS 6 | ||
43 | #define PCMCIA_PHYS 0x11000000 | ||
44 | #define K_GPIO_PC_READY 9 | ||
45 | #define K_INT_PC_READY (K_INT_GPIO_0 + K_GPIO_PC_READY) | ||
46 | #endif | ||
47 | |||
48 | #endif /* __ASM_SIBYTE_BIGSUR_H */ | ||
49 | |||
diff --git a/include/asm-mips/sibyte/board.h b/include/asm-mips/sibyte/board.h deleted file mode 100644 index 25372ae0e814..000000000000 --- a/include/asm-mips/sibyte/board.h +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000,2001,2002,2003,2004 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 | |||
19 | #ifndef _SIBYTE_BOARD_H | ||
20 | #define _SIBYTE_BOARD_H | ||
21 | |||
22 | #if defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_CRHONE) || \ | ||
23 | defined(CONFIG_SIBYTE_CRHINE) || defined(CONFIG_SIBYTE_LITTLESUR) | ||
24 | #include <asm/sibyte/swarm.h> | ||
25 | #endif | ||
26 | |||
27 | #if defined(CONFIG_SIBYTE_SENTOSA) || defined(CONFIG_SIBYTE_RHONE) | ||
28 | #include <asm/sibyte/sentosa.h> | ||
29 | #endif | ||
30 | |||
31 | #ifdef CONFIG_SIBYTE_CARMEL | ||
32 | #include <asm/sibyte/carmel.h> | ||
33 | #endif | ||
34 | |||
35 | #ifdef CONFIG_SIBYTE_BIGSUR | ||
36 | #include <asm/sibyte/bigsur.h> | ||
37 | #endif | ||
38 | |||
39 | #ifdef __ASSEMBLY__ | ||
40 | |||
41 | #ifdef LEDS_PHYS | ||
42 | #define setleds(t0, t1, c0, c1, c2, c3) \ | ||
43 | li t0, (LEDS_PHYS|0xa0000000); \ | ||
44 | li t1, c0; \ | ||
45 | sb t1, 0x18(t0); \ | ||
46 | li t1, c1; \ | ||
47 | sb t1, 0x10(t0); \ | ||
48 | li t1, c2; \ | ||
49 | sb t1, 0x08(t0); \ | ||
50 | li t1, c3; \ | ||
51 | sb t1, 0x00(t0) | ||
52 | #else | ||
53 | #define setleds(t0, t1, c0, c1, c2, c3) | ||
54 | #endif /* LEDS_PHYS */ | ||
55 | |||
56 | #else | ||
57 | |||
58 | void swarm_setup(void); | ||
59 | |||
60 | #ifdef LEDS_PHYS | ||
61 | extern void setleds(char *str); | ||
62 | #else | ||
63 | #define setleds(s) do { } while (0) | ||
64 | #endif /* LEDS_PHYS */ | ||
65 | |||
66 | #endif /* __ASSEMBLY__ */ | ||
67 | |||
68 | #endif /* _SIBYTE_BOARD_H */ | ||
diff --git a/include/asm-mips/sibyte/carmel.h b/include/asm-mips/sibyte/carmel.h deleted file mode 100644 index 11cad71323e8..000000000000 --- a/include/asm-mips/sibyte/carmel.h +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 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 | #ifndef __ASM_SIBYTE_CARMEL_H | ||
19 | #define __ASM_SIBYTE_CARMEL_H | ||
20 | |||
21 | #include <asm/sibyte/sb1250.h> | ||
22 | #include <asm/sibyte/sb1250_int.h> | ||
23 | |||
24 | #define SIBYTE_BOARD_NAME "Carmel" | ||
25 | |||
26 | #define GPIO_PHY_INTERRUPT 2 | ||
27 | #define GPIO_NONMASKABLE_INT 3 | ||
28 | #define GPIO_CF_INSERTED 6 | ||
29 | #define GPIO_MONTEREY_RESET 7 | ||
30 | #define GPIO_QUADUART_INT 8 | ||
31 | #define GPIO_CF_INT 9 | ||
32 | #define GPIO_FPGA_CCLK 10 | ||
33 | #define GPIO_FPGA_DOUT 11 | ||
34 | #define GPIO_FPGA_DIN 12 | ||
35 | #define GPIO_FPGA_PGM 13 | ||
36 | #define GPIO_FPGA_DONE 14 | ||
37 | #define GPIO_FPGA_INIT 15 | ||
38 | |||
39 | #define LEDS_CS 2 | ||
40 | #define LEDS_PHYS 0x100C0000 | ||
41 | #define MLEDS_CS 3 | ||
42 | #define MLEDS_PHYS 0x100A0000 | ||
43 | #define UART_CS 4 | ||
44 | #define UART_PHYS 0x100D0000 | ||
45 | #define ARAVALI_CS 5 | ||
46 | #define ARAVALI_PHYS 0x11000000 | ||
47 | #define IDE_CS 6 | ||
48 | #define IDE_PHYS 0x100B0000 | ||
49 | #define ARAVALI2_CS 7 | ||
50 | #define ARAVALI2_PHYS 0x100E0000 | ||
51 | |||
52 | #if defined(CONFIG_SIBYTE_CARMEL) | ||
53 | #define K_GPIO_GB_IDE 9 | ||
54 | #define K_INT_GB_IDE (K_INT_GPIO_0 + K_GPIO_GB_IDE) | ||
55 | #endif | ||
56 | |||
57 | |||
58 | #endif /* __ASM_SIBYTE_CARMEL_H */ | ||
diff --git a/include/asm-mips/sibyte/sb1250.h b/include/asm-mips/sibyte/sb1250.h deleted file mode 100644 index 80c1a052662a..000000000000 --- a/include/asm-mips/sibyte/sb1250.h +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 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 | |||
19 | #ifndef _ASM_SIBYTE_SB1250_H | ||
20 | #define _ASM_SIBYTE_SB1250_H | ||
21 | |||
22 | /* | ||
23 | * yymmddpp: year, month, day, patch. | ||
24 | * should sync with Makefile EXTRAVERSION | ||
25 | */ | ||
26 | #define SIBYTE_RELEASE 0x02111403 | ||
27 | |||
28 | #define SB1250_NR_IRQS 64 | ||
29 | |||
30 | #define BCM1480_NR_IRQS 128 | ||
31 | #define BCM1480_NR_IRQS_HALF 64 | ||
32 | |||
33 | #define SB1250_DUART_MINOR_BASE 64 | ||
34 | |||
35 | #ifndef __ASSEMBLY__ | ||
36 | |||
37 | #include <asm/addrspace.h> | ||
38 | |||
39 | /* For revision/pass information */ | ||
40 | #include <asm/sibyte/sb1250_scd.h> | ||
41 | #include <asm/sibyte/bcm1480_scd.h> | ||
42 | extern unsigned int sb1_pass; | ||
43 | extern unsigned int soc_pass; | ||
44 | extern unsigned int soc_type; | ||
45 | extern unsigned int periph_rev; | ||
46 | extern unsigned int zbbus_mhz; | ||
47 | |||
48 | extern void sb1250_time_init(void); | ||
49 | extern void sb1250_mask_irq(int cpu, int irq); | ||
50 | extern void sb1250_unmask_irq(int cpu, int irq); | ||
51 | |||
52 | extern void bcm1480_time_init(void); | ||
53 | extern void bcm1480_mask_irq(int cpu, int irq); | ||
54 | extern void bcm1480_unmask_irq(int cpu, int irq); | ||
55 | |||
56 | #define AT_spin \ | ||
57 | __asm__ __volatile__ ( \ | ||
58 | ".set noat\n" \ | ||
59 | "li $at, 0\n" \ | ||
60 | "1: beqz $at, 1b\n" \ | ||
61 | ".set at\n" \ | ||
62 | ) | ||
63 | |||
64 | #endif | ||
65 | |||
66 | #define IOADDR(a) ((void __iomem *)(IO_BASE + (a))) | ||
67 | |||
68 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_defs.h b/include/asm-mips/sibyte/sb1250_defs.h deleted file mode 100644 index 09365f9111fa..000000000000 --- a/include/asm-mips/sibyte/sb1250_defs.h +++ /dev/null | |||
@@ -1,259 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * Global constants and macros File: sb1250_defs.h | ||
5 | * | ||
6 | * This file contains macros and definitions used by the other | ||
7 | * include files. | ||
8 | * | ||
9 | * SB1250 specification level: User's manual 1/02/02 | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | #ifndef _SB1250_DEFS_H | ||
33 | #define _SB1250_DEFS_H | ||
34 | |||
35 | /* | ||
36 | * These headers require ANSI C89 string concatenation, and GCC or other | ||
37 | * 'long long' (64-bit integer) support. | ||
38 | */ | ||
39 | #if !defined(__STDC__) && !defined(_MSC_VER) | ||
40 | #error SiByte headers require ANSI C89 support | ||
41 | #endif | ||
42 | |||
43 | |||
44 | /* ********************************************************************* | ||
45 | * Macros for feature tests, used to enable include file features | ||
46 | * for chip features only present in certain chip revisions. | ||
47 | * | ||
48 | * SIBYTE_HDR_FEATURES may be defined to be the mask value chip/revision | ||
49 | * which is to be exposed by the headers. If undefined, it defaults to | ||
50 | * "all features." | ||
51 | * | ||
52 | * Use like: | ||
53 | * | ||
54 | * #define SIBYTE_HDR_FEATURES SIBYTE_HDR_FMASK_112x_PASS1 | ||
55 | * | ||
56 | * Generate defines only for that revision of chip. | ||
57 | * | ||
58 | * #if SIBYTE_HDR_FEATURE(chip,pass) | ||
59 | * | ||
60 | * True if header features for that revision or later of | ||
61 | * that particular chip type are enabled in SIBYTE_HDR_FEATURES. | ||
62 | * (Use this to bracket #defines for features present in a given | ||
63 | * revision and later.) | ||
64 | * | ||
65 | * Note that there is no implied ordering between chip types. | ||
66 | * | ||
67 | * Note also that 'chip' and 'pass' must textually exactly | ||
68 | * match the defines below. So, for example, | ||
69 | * SIBYTE_HDR_FEATURE(112x, PASS1) is OK, but | ||
70 | * SIBYTE_HDR_FEATURE(1120, pass1) is not (for two reasons). | ||
71 | * | ||
72 | * #if SIBYTE_HDR_FEATURE_UP_TO(chip,pass) | ||
73 | * | ||
74 | * Same as SIBYTE_HDR_FEATURE, but true for the named revision | ||
75 | * and earlier revisions of the named chip type. | ||
76 | * | ||
77 | * #if SIBYTE_HDR_FEATURE_EXACT(chip,pass) | ||
78 | * | ||
79 | * Same as SIBYTE_HDR_FEATURE, but only true for the named | ||
80 | * revision of the named chip type. (Note that this CANNOT | ||
81 | * be used to verify that you're compiling only for that | ||
82 | * particular chip/revision. It will be true any time this | ||
83 | * chip/revision is included in SIBYTE_HDR_FEATURES.) | ||
84 | * | ||
85 | * #if SIBYTE_HDR_FEATURE_CHIP(chip) | ||
86 | * | ||
87 | * True if header features for (any revision of) that chip type | ||
88 | * are enabled in SIBYTE_HDR_FEATURES. (Use this to bracket | ||
89 | * #defines for features specific to a given chip type.) | ||
90 | * | ||
91 | * Mask values currently include room for additional revisions of each | ||
92 | * chip type, but can be renumbered at will. Note that they MUST fit | ||
93 | * into 31 bits and may not include C type constructs, for safe use in | ||
94 | * CPP conditionals. Bit positions within chip types DO indicate | ||
95 | * ordering, so be careful when adding support for new minor revs. | ||
96 | ********************************************************************* */ | ||
97 | |||
98 | #define SIBYTE_HDR_FMASK_1250_ALL 0x000000ff | ||
99 | #define SIBYTE_HDR_FMASK_1250_PASS1 0x00000001 | ||
100 | #define SIBYTE_HDR_FMASK_1250_PASS2 0x00000002 | ||
101 | #define SIBYTE_HDR_FMASK_1250_PASS3 0x00000004 | ||
102 | |||
103 | #define SIBYTE_HDR_FMASK_112x_ALL 0x00000f00 | ||
104 | #define SIBYTE_HDR_FMASK_112x_PASS1 0x00000100 | ||
105 | |||
106 | #define SIBYTE_HDR_FMASK_1480_ALL 0x0000f000 | ||
107 | #define SIBYTE_HDR_FMASK_1480_PASS1 0x00001000 | ||
108 | #define SIBYTE_HDR_FMASK_1480_PASS2 0x00002000 | ||
109 | |||
110 | /* Bit mask for chip/revision. (use _ALL for all revisions of a chip). */ | ||
111 | #define SIBYTE_HDR_FMASK(chip, pass) \ | ||
112 | (SIBYTE_HDR_FMASK_ ## chip ## _ ## pass) | ||
113 | #define SIBYTE_HDR_FMASK_ALLREVS(chip) \ | ||
114 | (SIBYTE_HDR_FMASK_ ## chip ## _ALL) | ||
115 | |||
116 | /* Default constant value for all chips, all revisions */ | ||
117 | #define SIBYTE_HDR_FMASK_ALL \ | ||
118 | (SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL \ | ||
119 | | SIBYTE_HDR_FMASK_1480_ALL) | ||
120 | |||
121 | /* This one is used for the "original" BCM1250/BCM112x chips. We use this | ||
122 | to weed out constants and macros that do not exist on later chips like | ||
123 | the BCM1480 */ | ||
124 | #define SIBYTE_HDR_FMASK_1250_112x_ALL \ | ||
125 | (SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL) | ||
126 | #define SIBYTE_HDR_FMASK_1250_112x SIBYTE_HDR_FMASK_1250_112x_ALL | ||
127 | |||
128 | #ifndef SIBYTE_HDR_FEATURES | ||
129 | #define SIBYTE_HDR_FEATURES SIBYTE_HDR_FMASK_ALL | ||
130 | #endif | ||
131 | |||
132 | |||
133 | /* Bit mask for revisions of chip exclusively before the named revision. */ | ||
134 | #define SIBYTE_HDR_FMASK_BEFORE(chip, pass) \ | ||
135 | ((SIBYTE_HDR_FMASK(chip, pass) - 1) & SIBYTE_HDR_FMASK_ALLREVS(chip)) | ||
136 | |||
137 | /* Bit mask for revisions of chip exclusively after the named revision. */ | ||
138 | #define SIBYTE_HDR_FMASK_AFTER(chip, pass) \ | ||
139 | (~(SIBYTE_HDR_FMASK(chip, pass) \ | ||
140 | | (SIBYTE_HDR_FMASK(chip, pass) - 1)) & SIBYTE_HDR_FMASK_ALLREVS(chip)) | ||
141 | |||
142 | |||
143 | /* True if header features enabled for (any revision of) that chip type. */ | ||
144 | #define SIBYTE_HDR_FEATURE_CHIP(chip) \ | ||
145 | (!! (SIBYTE_HDR_FMASK_ALLREVS(chip) & SIBYTE_HDR_FEATURES)) | ||
146 | |||
147 | /* True for all versions of the BCM1250 and BCM1125, but not true for | ||
148 | anything else */ | ||
149 | #define SIBYTE_HDR_FEATURE_1250_112x \ | ||
150 | (SIBYTE_HDR_FEATURE_CHIP(1250) || SIBYTE_HDR_FEATURE_CHIP(112x)) | ||
151 | /* (!! (SIBYTE_HDR_FEATURES & SIBYHTE_HDR_FMASK_1250_112x)) */ | ||
152 | |||
153 | /* True if header features enabled for that rev or later, inclusive. */ | ||
154 | #define SIBYTE_HDR_FEATURE(chip, pass) \ | ||
155 | (!! ((SIBYTE_HDR_FMASK(chip, pass) \ | ||
156 | | SIBYTE_HDR_FMASK_AFTER(chip, pass)) & SIBYTE_HDR_FEATURES)) | ||
157 | |||
158 | /* True if header features enabled for exactly that rev. */ | ||
159 | #define SIBYTE_HDR_FEATURE_EXACT(chip, pass) \ | ||
160 | (!! (SIBYTE_HDR_FMASK(chip, pass) & SIBYTE_HDR_FEATURES)) | ||
161 | |||
162 | /* True if header features enabled for that rev or before, inclusive. */ | ||
163 | #define SIBYTE_HDR_FEATURE_UP_TO(chip, pass) \ | ||
164 | (!! ((SIBYTE_HDR_FMASK(chip, pass) \ | ||
165 | | SIBYTE_HDR_FMASK_BEFORE(chip, pass)) & SIBYTE_HDR_FEATURES)) | ||
166 | |||
167 | |||
168 | /* ********************************************************************* | ||
169 | * Naming schemes for constants in these files: | ||
170 | * | ||
171 | * M_xxx MASK constant (identifies bits in a register). | ||
172 | * For multi-bit fields, all bits in the field will | ||
173 | * be set. | ||
174 | * | ||
175 | * K_xxx "Code" constant (value for data in a multi-bit | ||
176 | * field). The value is right justified. | ||
177 | * | ||
178 | * V_xxx "Value" constant. This is the same as the | ||
179 | * corresponding "K_xxx" constant, except it is | ||
180 | * shifted to the correct position in the register. | ||
181 | * | ||
182 | * S_xxx SHIFT constant. This is the number of bits that | ||
183 | * a field value (code) needs to be shifted | ||
184 | * (towards the left) to put the value in the right | ||
185 | * position for the register. | ||
186 | * | ||
187 | * A_xxx ADDRESS constant. This will be a physical | ||
188 | * address. Use the PHYS_TO_K1 macro to generate | ||
189 | * a K1SEG address. | ||
190 | * | ||
191 | * R_xxx RELATIVE offset constant. This is an offset from | ||
192 | * an A_xxx constant (usually the first register in | ||
193 | * a group). | ||
194 | * | ||
195 | * G_xxx(X) GET value. This macro obtains a multi-bit field | ||
196 | * from a register, masks it, and shifts it to | ||
197 | * the bottom of the register (retrieving a K_xxx | ||
198 | * value, for example). | ||
199 | * | ||
200 | * V_xxx(X) VALUE. This macro computes the value of a | ||
201 | * K_xxx constant shifted to the correct position | ||
202 | * in the register. | ||
203 | ********************************************************************* */ | ||
204 | |||
205 | |||
206 | |||
207 | |||
208 | /* | ||
209 | * Cast to 64-bit number. Presumably the syntax is different in | ||
210 | * assembly language. | ||
211 | * | ||
212 | * Note: you'll need to define uint32_t and uint64_t in your headers. | ||
213 | */ | ||
214 | |||
215 | #if !defined(__ASSEMBLY__) | ||
216 | #define _SB_MAKE64(x) ((uint64_t)(x)) | ||
217 | #define _SB_MAKE32(x) ((uint32_t)(x)) | ||
218 | #else | ||
219 | #define _SB_MAKE64(x) (x) | ||
220 | #define _SB_MAKE32(x) (x) | ||
221 | #endif | ||
222 | |||
223 | |||
224 | /* | ||
225 | * Make a mask for 1 bit at position 'n' | ||
226 | */ | ||
227 | |||
228 | #define _SB_MAKEMASK1(n) (_SB_MAKE64(1) << _SB_MAKE64(n)) | ||
229 | #define _SB_MAKEMASK1_32(n) (_SB_MAKE32(1) << _SB_MAKE32(n)) | ||
230 | |||
231 | /* | ||
232 | * Make a mask for 'v' bits at position 'n' | ||
233 | */ | ||
234 | |||
235 | #define _SB_MAKEMASK(v, n) (_SB_MAKE64((_SB_MAKE64(1)<<(v))-1) << _SB_MAKE64(n)) | ||
236 | #define _SB_MAKEMASK_32(v, n) (_SB_MAKE32((_SB_MAKE32(1)<<(v))-1) << _SB_MAKE32(n)) | ||
237 | |||
238 | /* | ||
239 | * Make a value at 'v' at bit position 'n' | ||
240 | */ | ||
241 | |||
242 | #define _SB_MAKEVALUE(v, n) (_SB_MAKE64(v) << _SB_MAKE64(n)) | ||
243 | #define _SB_MAKEVALUE_32(v, n) (_SB_MAKE32(v) << _SB_MAKE32(n)) | ||
244 | |||
245 | #define _SB_GETVALUE(v, n, m) ((_SB_MAKE64(v) & _SB_MAKE64(m)) >> _SB_MAKE64(n)) | ||
246 | #define _SB_GETVALUE_32(v, n, m) ((_SB_MAKE32(v) & _SB_MAKE32(m)) >> _SB_MAKE32(n)) | ||
247 | |||
248 | /* | ||
249 | * Macros to read/write on-chip registers | ||
250 | * XXX should we do the PHYS_TO_K1 here? | ||
251 | */ | ||
252 | |||
253 | |||
254 | #if defined(__mips64) && !defined(__ASSEMBLY__) | ||
255 | #define SBWRITECSR(csr, val) *((volatile uint64_t *) PHYS_TO_K1(csr)) = (val) | ||
256 | #define SBREADCSR(csr) (*((volatile uint64_t *) PHYS_TO_K1(csr))) | ||
257 | #endif /* __ASSEMBLY__ */ | ||
258 | |||
259 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_dma.h b/include/asm-mips/sibyte/sb1250_dma.h deleted file mode 100644 index bad56171d747..000000000000 --- a/include/asm-mips/sibyte/sb1250_dma.h +++ /dev/null | |||
@@ -1,594 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * DMA definitions File: sb1250_dma.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * programming the SB1250's DMA controllers, both the data mover | ||
8 | * and the Ethernet DMA. | ||
9 | * | ||
10 | * SB1250 specification level: User's manual 10/21/02 | ||
11 | * BCM1280 specification level: User's manual 11/24/03 | ||
12 | * | ||
13 | ********************************************************************* | ||
14 | * | ||
15 | * Copyright 2000,2001,2002,2003 | ||
16 | * Broadcom Corporation. All rights reserved. | ||
17 | * | ||
18 | * This program is free software; you can redistribute it and/or | ||
19 | * modify it under the terms of the GNU General Public License as | ||
20 | * published by the Free Software Foundation; either version 2 of | ||
21 | * the License, or (at your option) any later version. | ||
22 | * | ||
23 | * This program is distributed in the hope that it will be useful, | ||
24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
26 | * GNU General Public License for more details. | ||
27 | * | ||
28 | * You should have received a copy of the GNU General Public License | ||
29 | * along with this program; if not, write to the Free Software | ||
30 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
31 | * MA 02111-1307 USA | ||
32 | ********************************************************************* */ | ||
33 | |||
34 | |||
35 | #ifndef _SB1250_DMA_H | ||
36 | #define _SB1250_DMA_H | ||
37 | |||
38 | |||
39 | #include "sb1250_defs.h" | ||
40 | |||
41 | /* ********************************************************************* | ||
42 | * DMA Registers | ||
43 | ********************************************************************* */ | ||
44 | |||
45 | /* | ||
46 | * Ethernet and Serial DMA Configuration Register 0 (Table 7-4) | ||
47 | * Registers: DMA_CONFIG0_MAC_x_RX_CH_0 | ||
48 | * Registers: DMA_CONFIG0_MAC_x_TX_CH_0 | ||
49 | * Registers: DMA_CONFIG0_SER_x_RX | ||
50 | * Registers: DMA_CONFIG0_SER_x_TX | ||
51 | */ | ||
52 | |||
53 | |||
54 | #define M_DMA_DROP _SB_MAKEMASK1(0) | ||
55 | |||
56 | #define M_DMA_CHAIN_SEL _SB_MAKEMASK1(1) | ||
57 | #define M_DMA_RESERVED1 _SB_MAKEMASK1(2) | ||
58 | |||
59 | #define S_DMA_DESC_TYPE _SB_MAKE64(1) | ||
60 | #define M_DMA_DESC_TYPE _SB_MAKEMASK(2, S_DMA_DESC_TYPE) | ||
61 | #define V_DMA_DESC_TYPE(x) _SB_MAKEVALUE(x, S_DMA_DESC_TYPE) | ||
62 | #define G_DMA_DESC_TYPE(x) _SB_GETVALUE(x, S_DMA_DESC_TYPE, M_DMA_DESC_TYPE) | ||
63 | |||
64 | #define K_DMA_DESC_TYPE_RING_AL 0 | ||
65 | #define K_DMA_DESC_TYPE_CHAIN_AL 1 | ||
66 | |||
67 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
68 | #define K_DMA_DESC_TYPE_RING_UAL_WI 2 | ||
69 | #define K_DMA_DESC_TYPE_RING_UAL_RMW 3 | ||
70 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
71 | |||
72 | #define M_DMA_EOP_INT_EN _SB_MAKEMASK1(3) | ||
73 | #define M_DMA_HWM_INT_EN _SB_MAKEMASK1(4) | ||
74 | #define M_DMA_LWM_INT_EN _SB_MAKEMASK1(5) | ||
75 | #define M_DMA_TBX_EN _SB_MAKEMASK1(6) | ||
76 | #define M_DMA_TDX_EN _SB_MAKEMASK1(7) | ||
77 | |||
78 | #define S_DMA_INT_PKTCNT _SB_MAKE64(8) | ||
79 | #define M_DMA_INT_PKTCNT _SB_MAKEMASK(8, S_DMA_INT_PKTCNT) | ||
80 | #define V_DMA_INT_PKTCNT(x) _SB_MAKEVALUE(x, S_DMA_INT_PKTCNT) | ||
81 | #define G_DMA_INT_PKTCNT(x) _SB_GETVALUE(x, S_DMA_INT_PKTCNT, M_DMA_INT_PKTCNT) | ||
82 | |||
83 | #define S_DMA_RINGSZ _SB_MAKE64(16) | ||
84 | #define M_DMA_RINGSZ _SB_MAKEMASK(16, S_DMA_RINGSZ) | ||
85 | #define V_DMA_RINGSZ(x) _SB_MAKEVALUE(x, S_DMA_RINGSZ) | ||
86 | #define G_DMA_RINGSZ(x) _SB_GETVALUE(x, S_DMA_RINGSZ, M_DMA_RINGSZ) | ||
87 | |||
88 | #define S_DMA_HIGH_WATERMARK _SB_MAKE64(32) | ||
89 | #define M_DMA_HIGH_WATERMARK _SB_MAKEMASK(16, S_DMA_HIGH_WATERMARK) | ||
90 | #define V_DMA_HIGH_WATERMARK(x) _SB_MAKEVALUE(x, S_DMA_HIGH_WATERMARK) | ||
91 | #define G_DMA_HIGH_WATERMARK(x) _SB_GETVALUE(x, S_DMA_HIGH_WATERMARK, M_DMA_HIGH_WATERMARK) | ||
92 | |||
93 | #define S_DMA_LOW_WATERMARK _SB_MAKE64(48) | ||
94 | #define M_DMA_LOW_WATERMARK _SB_MAKEMASK(16, S_DMA_LOW_WATERMARK) | ||
95 | #define V_DMA_LOW_WATERMARK(x) _SB_MAKEVALUE(x, S_DMA_LOW_WATERMARK) | ||
96 | #define G_DMA_LOW_WATERMARK(x) _SB_GETVALUE(x, S_DMA_LOW_WATERMARK, M_DMA_LOW_WATERMARK) | ||
97 | |||
98 | /* | ||
99 | * Ethernet and Serial DMA Configuration Register 1 (Table 7-5) | ||
100 | * Registers: DMA_CONFIG1_MAC_x_RX_CH_0 | ||
101 | * Registers: DMA_CONFIG1_DMA_x_TX_CH_0 | ||
102 | * Registers: DMA_CONFIG1_SER_x_RX | ||
103 | * Registers: DMA_CONFIG1_SER_x_TX | ||
104 | */ | ||
105 | |||
106 | #define M_DMA_HDR_CF_EN _SB_MAKEMASK1(0) | ||
107 | #define M_DMA_ASIC_XFR_EN _SB_MAKEMASK1(1) | ||
108 | #define M_DMA_PRE_ADDR_EN _SB_MAKEMASK1(2) | ||
109 | #define M_DMA_FLOW_CTL_EN _SB_MAKEMASK1(3) | ||
110 | #define M_DMA_NO_DSCR_UPDT _SB_MAKEMASK1(4) | ||
111 | #define M_DMA_L2CA _SB_MAKEMASK1(5) | ||
112 | |||
113 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
114 | #define M_DMA_RX_XTRA_STATUS _SB_MAKEMASK1(6) | ||
115 | #define M_DMA_TX_CPU_PAUSE _SB_MAKEMASK1(6) | ||
116 | #define M_DMA_TX_FC_PAUSE_EN _SB_MAKEMASK1(7) | ||
117 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
118 | |||
119 | #define M_DMA_MBZ1 _SB_MAKEMASK(6, 15) | ||
120 | |||
121 | #define S_DMA_HDR_SIZE _SB_MAKE64(21) | ||
122 | #define M_DMA_HDR_SIZE _SB_MAKEMASK(9, S_DMA_HDR_SIZE) | ||
123 | #define V_DMA_HDR_SIZE(x) _SB_MAKEVALUE(x, S_DMA_HDR_SIZE) | ||
124 | #define G_DMA_HDR_SIZE(x) _SB_GETVALUE(x, S_DMA_HDR_SIZE, M_DMA_HDR_SIZE) | ||
125 | |||
126 | #define M_DMA_MBZ2 _SB_MAKEMASK(5, 32) | ||
127 | |||
128 | #define S_DMA_ASICXFR_SIZE _SB_MAKE64(37) | ||
129 | #define M_DMA_ASICXFR_SIZE _SB_MAKEMASK(9, S_DMA_ASICXFR_SIZE) | ||
130 | #define V_DMA_ASICXFR_SIZE(x) _SB_MAKEVALUE(x, S_DMA_ASICXFR_SIZE) | ||
131 | #define G_DMA_ASICXFR_SIZE(x) _SB_GETVALUE(x, S_DMA_ASICXFR_SIZE, M_DMA_ASICXFR_SIZE) | ||
132 | |||
133 | #define S_DMA_INT_TIMEOUT _SB_MAKE64(48) | ||
134 | #define M_DMA_INT_TIMEOUT _SB_MAKEMASK(16, S_DMA_INT_TIMEOUT) | ||
135 | #define V_DMA_INT_TIMEOUT(x) _SB_MAKEVALUE(x, S_DMA_INT_TIMEOUT) | ||
136 | #define G_DMA_INT_TIMEOUT(x) _SB_GETVALUE(x, S_DMA_INT_TIMEOUT, M_DMA_INT_TIMEOUT) | ||
137 | |||
138 | /* | ||
139 | * Ethernet and Serial DMA Descriptor base address (Table 7-6) | ||
140 | */ | ||
141 | |||
142 | #define M_DMA_DSCRBASE_MBZ _SB_MAKEMASK(4, 0) | ||
143 | |||
144 | |||
145 | /* | ||
146 | * ASIC Mode Base Address (Table 7-7) | ||
147 | */ | ||
148 | |||
149 | #define M_DMA_ASIC_BASE_MBZ _SB_MAKEMASK(20, 0) | ||
150 | |||
151 | /* | ||
152 | * DMA Descriptor Count Registers (Table 7-8) | ||
153 | */ | ||
154 | |||
155 | /* No bitfields */ | ||
156 | |||
157 | |||
158 | /* | ||
159 | * Current Descriptor Address Register (Table 7-11) | ||
160 | */ | ||
161 | |||
162 | #define S_DMA_CURDSCR_ADDR _SB_MAKE64(0) | ||
163 | #define M_DMA_CURDSCR_ADDR _SB_MAKEMASK(40, S_DMA_CURDSCR_ADDR) | ||
164 | #define S_DMA_CURDSCR_COUNT _SB_MAKE64(40) | ||
165 | #define M_DMA_CURDSCR_COUNT _SB_MAKEMASK(16, S_DMA_CURDSCR_COUNT) | ||
166 | |||
167 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
168 | #define M_DMA_TX_CH_PAUSE_ON _SB_MAKEMASK1(56) | ||
169 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
170 | |||
171 | /* | ||
172 | * Receive Packet Drop Registers | ||
173 | */ | ||
174 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
175 | #define S_DMA_OODLOST_RX _SB_MAKE64(0) | ||
176 | #define M_DMA_OODLOST_RX _SB_MAKEMASK(16, S_DMA_OODLOST_RX) | ||
177 | #define G_DMA_OODLOST_RX(x) _SB_GETVALUE(x, S_DMA_OODLOST_RX, M_DMA_OODLOST_RX) | ||
178 | |||
179 | #define S_DMA_EOP_COUNT_RX _SB_MAKE64(16) | ||
180 | #define M_DMA_EOP_COUNT_RX _SB_MAKEMASK(8, S_DMA_EOP_COUNT_RX) | ||
181 | #define G_DMA_EOP_COUNT_RX(x) _SB_GETVALUE(x, S_DMA_EOP_COUNT_RX, M_DMA_EOP_COUNT_RX) | ||
182 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
183 | |||
184 | /* ********************************************************************* | ||
185 | * DMA Descriptors | ||
186 | ********************************************************************* */ | ||
187 | |||
188 | /* | ||
189 | * Descriptor doubleword "A" (Table 7-12) | ||
190 | */ | ||
191 | |||
192 | #define S_DMA_DSCRA_OFFSET _SB_MAKE64(0) | ||
193 | #define M_DMA_DSCRA_OFFSET _SB_MAKEMASK(5, S_DMA_DSCRA_OFFSET) | ||
194 | #define V_DMA_DSCRA_OFFSET(x) _SB_MAKEVALUE(x, S_DMA_DSCRA_OFFSET) | ||
195 | #define G_DMA_DSCRA_OFFSET(x) _SB_GETVALUE(x, S_DMA_DSCRA_OFFSET, M_DMA_DSCRA_OFFSET) | ||
196 | |||
197 | /* Note: Don't shift the address over, just mask it with the mask below */ | ||
198 | #define S_DMA_DSCRA_A_ADDR _SB_MAKE64(5) | ||
199 | #define M_DMA_DSCRA_A_ADDR _SB_MAKEMASK(35, S_DMA_DSCRA_A_ADDR) | ||
200 | |||
201 | #define M_DMA_DSCRA_A_ADDR_OFFSET (M_DMA_DSCRA_OFFSET | M_DMA_DSCRA_A_ADDR) | ||
202 | |||
203 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
204 | #define S_DMA_DSCRA_A_ADDR_UA _SB_MAKE64(0) | ||
205 | #define M_DMA_DSCRA_A_ADDR_UA _SB_MAKEMASK(40, S_DMA_DSCRA_A_ADDR_UA) | ||
206 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
207 | |||
208 | #define S_DMA_DSCRA_A_SIZE _SB_MAKE64(40) | ||
209 | #define M_DMA_DSCRA_A_SIZE _SB_MAKEMASK(9, S_DMA_DSCRA_A_SIZE) | ||
210 | #define V_DMA_DSCRA_A_SIZE(x) _SB_MAKEVALUE(x, S_DMA_DSCRA_A_SIZE) | ||
211 | #define G_DMA_DSCRA_A_SIZE(x) _SB_GETVALUE(x, S_DMA_DSCRA_A_SIZE, M_DMA_DSCRA_A_SIZE) | ||
212 | |||
213 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
214 | #define S_DMA_DSCRA_DSCR_CNT _SB_MAKE64(40) | ||
215 | #define M_DMA_DSCRA_DSCR_CNT _SB_MAKEMASK(8, S_DMA_DSCRA_DSCR_CNT) | ||
216 | #define G_DMA_DSCRA_DSCR_CNT(x) _SB_GETVALUE(x, S_DMA_DSCRA_DSCR_CNT, M_DMA_DSCRA_DSCR_CNT) | ||
217 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
218 | |||
219 | #define M_DMA_DSCRA_INTERRUPT _SB_MAKEMASK1(49) | ||
220 | #define M_DMA_DSCRA_OFFSETB _SB_MAKEMASK1(50) | ||
221 | |||
222 | #define S_DMA_DSCRA_STATUS _SB_MAKE64(51) | ||
223 | #define M_DMA_DSCRA_STATUS _SB_MAKEMASK(13, S_DMA_DSCRA_STATUS) | ||
224 | #define V_DMA_DSCRA_STATUS(x) _SB_MAKEVALUE(x, S_DMA_DSCRA_STATUS) | ||
225 | #define G_DMA_DSCRA_STATUS(x) _SB_GETVALUE(x, S_DMA_DSCRA_STATUS, M_DMA_DSCRA_STATUS) | ||
226 | |||
227 | /* | ||
228 | * Descriptor doubleword "B" (Table 7-13) | ||
229 | */ | ||
230 | |||
231 | |||
232 | #define S_DMA_DSCRB_OPTIONS _SB_MAKE64(0) | ||
233 | #define M_DMA_DSCRB_OPTIONS _SB_MAKEMASK(4, S_DMA_DSCRB_OPTIONS) | ||
234 | #define V_DMA_DSCRB_OPTIONS(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_OPTIONS) | ||
235 | #define G_DMA_DSCRB_OPTIONS(x) _SB_GETVALUE(x, S_DMA_DSCRB_OPTIONS, M_DMA_DSCRB_OPTIONS) | ||
236 | |||
237 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
238 | #define S_DMA_DSCRB_A_SIZE _SB_MAKE64(8) | ||
239 | #define M_DMA_DSCRB_A_SIZE _SB_MAKEMASK(14, S_DMA_DSCRB_A_SIZE) | ||
240 | #define V_DMA_DSCRB_A_SIZE(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_A_SIZE) | ||
241 | #define G_DMA_DSCRB_A_SIZE(x) _SB_GETVALUE(x, S_DMA_DSCRB_A_SIZE, M_DMA_DSCRB_A_SIZE) | ||
242 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
243 | |||
244 | #define R_DMA_DSCRB_ADDR _SB_MAKE64(0x10) | ||
245 | |||
246 | /* Note: Don't shift the address over, just mask it with the mask below */ | ||
247 | #define S_DMA_DSCRB_B_ADDR _SB_MAKE64(5) | ||
248 | #define M_DMA_DSCRB_B_ADDR _SB_MAKEMASK(35, S_DMA_DSCRB_B_ADDR) | ||
249 | |||
250 | #define S_DMA_DSCRB_B_SIZE _SB_MAKE64(40) | ||
251 | #define M_DMA_DSCRB_B_SIZE _SB_MAKEMASK(9, S_DMA_DSCRB_B_SIZE) | ||
252 | #define V_DMA_DSCRB_B_SIZE(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_B_SIZE) | ||
253 | #define G_DMA_DSCRB_B_SIZE(x) _SB_GETVALUE(x, S_DMA_DSCRB_B_SIZE, M_DMA_DSCRB_B_SIZE) | ||
254 | |||
255 | #define M_DMA_DSCRB_B_VALID _SB_MAKEMASK1(49) | ||
256 | |||
257 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
258 | #define S_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKE64(48) | ||
259 | #define M_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKEMASK(2, S_DMA_DSCRB_PKT_SIZE_MSB) | ||
260 | #define V_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_PKT_SIZE_MSB) | ||
261 | #define G_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_GETVALUE(x, S_DMA_DSCRB_PKT_SIZE_MSB, M_DMA_DSCRB_PKT_SIZE_MSB) | ||
262 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
263 | |||
264 | #define S_DMA_DSCRB_PKT_SIZE _SB_MAKE64(50) | ||
265 | #define M_DMA_DSCRB_PKT_SIZE _SB_MAKEMASK(14, S_DMA_DSCRB_PKT_SIZE) | ||
266 | #define V_DMA_DSCRB_PKT_SIZE(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_PKT_SIZE) | ||
267 | #define G_DMA_DSCRB_PKT_SIZE(x) _SB_GETVALUE(x, S_DMA_DSCRB_PKT_SIZE, M_DMA_DSCRB_PKT_SIZE) | ||
268 | |||
269 | /* | ||
270 | * from pass2 some bits in dscr_b are also used for rx status | ||
271 | */ | ||
272 | #define S_DMA_DSCRB_STATUS _SB_MAKE64(0) | ||
273 | #define M_DMA_DSCRB_STATUS _SB_MAKEMASK(1, S_DMA_DSCRB_STATUS) | ||
274 | #define V_DMA_DSCRB_STATUS(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_STATUS) | ||
275 | #define G_DMA_DSCRB_STATUS(x) _SB_GETVALUE(x, S_DMA_DSCRB_STATUS, M_DMA_DSCRB_STATUS) | ||
276 | |||
277 | /* | ||
278 | * Ethernet Descriptor Status Bits (Table 7-15) | ||
279 | */ | ||
280 | |||
281 | #define M_DMA_ETHRX_BADIP4CS _SB_MAKEMASK1(51) | ||
282 | #define M_DMA_ETHRX_DSCRERR _SB_MAKEMASK1(52) | ||
283 | |||
284 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
285 | /* Note: This bit is in the DSCR_B options field */ | ||
286 | #define M_DMA_ETHRX_BADTCPCS _SB_MAKEMASK1(0) | ||
287 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
288 | |||
289 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
290 | /* Note: These bits are in the DSCR_B options field */ | ||
291 | #define M_DMA_ETH_VLAN_FLAG _SB_MAKEMASK1(1) | ||
292 | #define M_DMA_ETH_CRC_FLAG _SB_MAKEMASK1(2) | ||
293 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
294 | |||
295 | #define S_DMA_ETHRX_RXCH 53 | ||
296 | #define M_DMA_ETHRX_RXCH _SB_MAKEMASK(2, S_DMA_ETHRX_RXCH) | ||
297 | #define V_DMA_ETHRX_RXCH(x) _SB_MAKEVALUE(x, S_DMA_ETHRX_RXCH) | ||
298 | #define G_DMA_ETHRX_RXCH(x) _SB_GETVALUE(x, S_DMA_ETHRX_RXCH, M_DMA_ETHRX_RXCH) | ||
299 | |||
300 | #define S_DMA_ETHRX_PKTTYPE 55 | ||
301 | #define M_DMA_ETHRX_PKTTYPE _SB_MAKEMASK(3, S_DMA_ETHRX_PKTTYPE) | ||
302 | #define V_DMA_ETHRX_PKTTYPE(x) _SB_MAKEVALUE(x, S_DMA_ETHRX_PKTTYPE) | ||
303 | #define G_DMA_ETHRX_PKTTYPE(x) _SB_GETVALUE(x, S_DMA_ETHRX_PKTTYPE, M_DMA_ETHRX_PKTTYPE) | ||
304 | |||
305 | #define K_DMA_ETHRX_PKTTYPE_IPV4 0 | ||
306 | #define K_DMA_ETHRX_PKTTYPE_ARPV4 1 | ||
307 | #define K_DMA_ETHRX_PKTTYPE_802 2 | ||
308 | #define K_DMA_ETHRX_PKTTYPE_OTHER 3 | ||
309 | #define K_DMA_ETHRX_PKTTYPE_USER0 4 | ||
310 | #define K_DMA_ETHRX_PKTTYPE_USER1 5 | ||
311 | #define K_DMA_ETHRX_PKTTYPE_USER2 6 | ||
312 | #define K_DMA_ETHRX_PKTTYPE_USER3 7 | ||
313 | |||
314 | #define M_DMA_ETHRX_MATCH_HASH _SB_MAKEMASK1(58) | ||
315 | #define M_DMA_ETHRX_MATCH_EXACT _SB_MAKEMASK1(59) | ||
316 | #define M_DMA_ETHRX_BCAST _SB_MAKEMASK1(60) | ||
317 | #define M_DMA_ETHRX_MCAST _SB_MAKEMASK1(61) | ||
318 | #define M_DMA_ETHRX_BAD _SB_MAKEMASK1(62) | ||
319 | #define M_DMA_ETHRX_SOP _SB_MAKEMASK1(63) | ||
320 | |||
321 | /* | ||
322 | * Ethernet Transmit Status Bits (Table 7-16) | ||
323 | */ | ||
324 | |||
325 | #define M_DMA_ETHTX_SOP _SB_MAKEMASK1(63) | ||
326 | |||
327 | /* | ||
328 | * Ethernet Transmit Options (Table 7-17) | ||
329 | */ | ||
330 | |||
331 | #define K_DMA_ETHTX_NOTSOP _SB_MAKE64(0x00) | ||
332 | #define K_DMA_ETHTX_APPENDCRC _SB_MAKE64(0x01) | ||
333 | #define K_DMA_ETHTX_REPLACECRC _SB_MAKE64(0x02) | ||
334 | #define K_DMA_ETHTX_APPENDCRC_APPENDPAD _SB_MAKE64(0x03) | ||
335 | #define K_DMA_ETHTX_APPENDVLAN_REPLACECRC _SB_MAKE64(0x04) | ||
336 | #define K_DMA_ETHTX_REMOVEVLAN_REPLACECRC _SB_MAKE64(0x05) | ||
337 | #define K_DMA_ETHTX_REPLACEVLAN_REPLACECRC _SB_MAKE64(0x6) | ||
338 | #define K_DMA_ETHTX_NOMODS _SB_MAKE64(0x07) | ||
339 | #define K_DMA_ETHTX_RESERVED1 _SB_MAKE64(0x08) | ||
340 | #define K_DMA_ETHTX_REPLACESADDR_APPENDCRC _SB_MAKE64(0x09) | ||
341 | #define K_DMA_ETHTX_REPLACESADDR_REPLACECRC _SB_MAKE64(0x0A) | ||
342 | #define K_DMA_ETHTX_REPLACESADDR_APPENDCRC_APPENDPAD _SB_MAKE64(0x0B) | ||
343 | #define K_DMA_ETHTX_REPLACESADDR_APPENDVLAN_REPLACECRC _SB_MAKE64(0x0C) | ||
344 | #define K_DMA_ETHTX_REPLACESADDR_REMOVEVLAN_REPLACECRC _SB_MAKE64(0x0D) | ||
345 | #define K_DMA_ETHTX_REPLACESADDR_REPLACEVLAN_REPLACECRC _SB_MAKE64(0x0E) | ||
346 | #define K_DMA_ETHTX_RESERVED2 _SB_MAKE64(0x0F) | ||
347 | |||
348 | /* | ||
349 | * Serial Receive Options (Table 7-18) | ||
350 | */ | ||
351 | #define M_DMA_SERRX_CRC_ERROR _SB_MAKEMASK1(56) | ||
352 | #define M_DMA_SERRX_ABORT _SB_MAKEMASK1(57) | ||
353 | #define M_DMA_SERRX_OCTET_ERROR _SB_MAKEMASK1(58) | ||
354 | #define M_DMA_SERRX_LONGFRAME_ERROR _SB_MAKEMASK1(59) | ||
355 | #define M_DMA_SERRX_SHORTFRAME_ERROR _SB_MAKEMASK1(60) | ||
356 | #define M_DMA_SERRX_OVERRUN_ERROR _SB_MAKEMASK1(61) | ||
357 | #define M_DMA_SERRX_GOOD _SB_MAKEMASK1(62) | ||
358 | #define M_DMA_SERRX_SOP _SB_MAKEMASK1(63) | ||
359 | |||
360 | /* | ||
361 | * Serial Transmit Status Bits (Table 7-20) | ||
362 | */ | ||
363 | |||
364 | #define M_DMA_SERTX_FLAG _SB_MAKEMASK1(63) | ||
365 | |||
366 | /* | ||
367 | * Serial Transmit Options (Table 7-21) | ||
368 | */ | ||
369 | |||
370 | #define K_DMA_SERTX_RESERVED _SB_MAKEMASK1(0) | ||
371 | #define K_DMA_SERTX_APPENDCRC _SB_MAKEMASK1(1) | ||
372 | #define K_DMA_SERTX_APPENDPAD _SB_MAKEMASK1(2) | ||
373 | #define K_DMA_SERTX_ABORT _SB_MAKEMASK1(3) | ||
374 | |||
375 | |||
376 | /* ********************************************************************* | ||
377 | * Data Mover Registers | ||
378 | ********************************************************************* */ | ||
379 | |||
380 | /* | ||
381 | * Data Mover Descriptor Base Address Register (Table 7-22) | ||
382 | * Register: DM_DSCR_BASE_0 | ||
383 | * Register: DM_DSCR_BASE_1 | ||
384 | * Register: DM_DSCR_BASE_2 | ||
385 | * Register: DM_DSCR_BASE_3 | ||
386 | */ | ||
387 | |||
388 | #define M_DM_DSCR_BASE_MBZ _SB_MAKEMASK(4, 0) | ||
389 | |||
390 | /* Note: Just mask the base address and then OR it in. */ | ||
391 | #define S_DM_DSCR_BASE_ADDR _SB_MAKE64(4) | ||
392 | #define M_DM_DSCR_BASE_ADDR _SB_MAKEMASK(36, S_DM_DSCR_BASE_ADDR) | ||
393 | |||
394 | #define S_DM_DSCR_BASE_RINGSZ _SB_MAKE64(40) | ||
395 | #define M_DM_DSCR_BASE_RINGSZ _SB_MAKEMASK(16, S_DM_DSCR_BASE_RINGSZ) | ||
396 | #define V_DM_DSCR_BASE_RINGSZ(x) _SB_MAKEVALUE(x, S_DM_DSCR_BASE_RINGSZ) | ||
397 | #define G_DM_DSCR_BASE_RINGSZ(x) _SB_GETVALUE(x, S_DM_DSCR_BASE_RINGSZ, M_DM_DSCR_BASE_RINGSZ) | ||
398 | |||
399 | #define S_DM_DSCR_BASE_PRIORITY _SB_MAKE64(56) | ||
400 | #define M_DM_DSCR_BASE_PRIORITY _SB_MAKEMASK(3, S_DM_DSCR_BASE_PRIORITY) | ||
401 | #define V_DM_DSCR_BASE_PRIORITY(x) _SB_MAKEVALUE(x, S_DM_DSCR_BASE_PRIORITY) | ||
402 | #define G_DM_DSCR_BASE_PRIORITY(x) _SB_GETVALUE(x, S_DM_DSCR_BASE_PRIORITY, M_DM_DSCR_BASE_PRIORITY) | ||
403 | |||
404 | #define K_DM_DSCR_BASE_PRIORITY_1 0 | ||
405 | #define K_DM_DSCR_BASE_PRIORITY_2 1 | ||
406 | #define K_DM_DSCR_BASE_PRIORITY_4 2 | ||
407 | #define K_DM_DSCR_BASE_PRIORITY_8 3 | ||
408 | #define K_DM_DSCR_BASE_PRIORITY_16 4 | ||
409 | |||
410 | #define M_DM_DSCR_BASE_ACTIVE _SB_MAKEMASK1(59) | ||
411 | #define M_DM_DSCR_BASE_INTERRUPT _SB_MAKEMASK1(60) | ||
412 | #define M_DM_DSCR_BASE_RESET _SB_MAKEMASK1(61) /* write register */ | ||
413 | #define M_DM_DSCR_BASE_ERROR _SB_MAKEMASK1(61) /* read register */ | ||
414 | #define M_DM_DSCR_BASE_ABORT _SB_MAKEMASK1(62) | ||
415 | #define M_DM_DSCR_BASE_ENABL _SB_MAKEMASK1(63) | ||
416 | |||
417 | /* | ||
418 | * Data Mover Descriptor Count Register (Table 7-25) | ||
419 | */ | ||
420 | |||
421 | /* no bitfields */ | ||
422 | |||
423 | /* | ||
424 | * Data Mover Current Descriptor Address (Table 7-24) | ||
425 | * Register: DM_CUR_DSCR_ADDR_0 | ||
426 | * Register: DM_CUR_DSCR_ADDR_1 | ||
427 | * Register: DM_CUR_DSCR_ADDR_2 | ||
428 | * Register: DM_CUR_DSCR_ADDR_3 | ||
429 | */ | ||
430 | |||
431 | #define S_DM_CUR_DSCR_DSCR_ADDR _SB_MAKE64(0) | ||
432 | #define M_DM_CUR_DSCR_DSCR_ADDR _SB_MAKEMASK(40, S_DM_CUR_DSCR_DSCR_ADDR) | ||
433 | |||
434 | #define S_DM_CUR_DSCR_DSCR_COUNT _SB_MAKE64(48) | ||
435 | #define M_DM_CUR_DSCR_DSCR_COUNT _SB_MAKEMASK(16, S_DM_CUR_DSCR_DSCR_COUNT) | ||
436 | #define V_DM_CUR_DSCR_DSCR_COUNT(r) _SB_MAKEVALUE(r, S_DM_CUR_DSCR_DSCR_COUNT) | ||
437 | #define G_DM_CUR_DSCR_DSCR_COUNT(r) _SB_GETVALUE(r, S_DM_CUR_DSCR_DSCR_COUNT,\ | ||
438 | M_DM_CUR_DSCR_DSCR_COUNT) | ||
439 | |||
440 | |||
441 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
442 | /* | ||
443 | * Data Mover Channel Partial Result Registers | ||
444 | * Register: DM_PARTIAL_0 | ||
445 | * Register: DM_PARTIAL_1 | ||
446 | * Register: DM_PARTIAL_2 | ||
447 | * Register: DM_PARTIAL_3 | ||
448 | */ | ||
449 | #define S_DM_PARTIAL_CRC_PARTIAL _SB_MAKE64(0) | ||
450 | #define M_DM_PARTIAL_CRC_PARTIAL _SB_MAKEMASK(32, S_DM_PARTIAL_CRC_PARTIAL) | ||
451 | #define V_DM_PARTIAL_CRC_PARTIAL(r) _SB_MAKEVALUE(r, S_DM_PARTIAL_CRC_PARTIAL) | ||
452 | #define G_DM_PARTIAL_CRC_PARTIAL(r) _SB_GETVALUE(r, S_DM_PARTIAL_CRC_PARTIAL,\ | ||
453 | M_DM_PARTIAL_CRC_PARTIAL) | ||
454 | |||
455 | #define S_DM_PARTIAL_TCPCS_PARTIAL _SB_MAKE64(32) | ||
456 | #define M_DM_PARTIAL_TCPCS_PARTIAL _SB_MAKEMASK(16, S_DM_PARTIAL_TCPCS_PARTIAL) | ||
457 | #define V_DM_PARTIAL_TCPCS_PARTIAL(r) _SB_MAKEVALUE(r, S_DM_PARTIAL_TCPCS_PARTIAL) | ||
458 | #define G_DM_PARTIAL_TCPCS_PARTIAL(r) _SB_GETVALUE(r, S_DM_PARTIAL_TCPCS_PARTIAL,\ | ||
459 | M_DM_PARTIAL_TCPCS_PARTIAL) | ||
460 | |||
461 | #define M_DM_PARTIAL_ODD_BYTE _SB_MAKEMASK1(48) | ||
462 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
463 | |||
464 | |||
465 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
466 | /* | ||
467 | * Data Mover CRC Definition Registers | ||
468 | * Register: CRC_DEF_0 | ||
469 | * Register: CRC_DEF_1 | ||
470 | */ | ||
471 | #define S_CRC_DEF_CRC_INIT _SB_MAKE64(0) | ||
472 | #define M_CRC_DEF_CRC_INIT _SB_MAKEMASK(32, S_CRC_DEF_CRC_INIT) | ||
473 | #define V_CRC_DEF_CRC_INIT(r) _SB_MAKEVALUE(r, S_CRC_DEF_CRC_INIT) | ||
474 | #define G_CRC_DEF_CRC_INIT(r) _SB_GETVALUE(r, S_CRC_DEF_CRC_INIT,\ | ||
475 | M_CRC_DEF_CRC_INIT) | ||
476 | |||
477 | #define S_CRC_DEF_CRC_POLY _SB_MAKE64(32) | ||
478 | #define M_CRC_DEF_CRC_POLY _SB_MAKEMASK(32, S_CRC_DEF_CRC_POLY) | ||
479 | #define V_CRC_DEF_CRC_POLY(r) _SB_MAKEVALUE(r, S_CRC_DEF_CRC_POLY) | ||
480 | #define G_CRC_DEF_CRC_POLY(r) _SB_GETVALUE(r, S_CRC_DEF_CRC_POLY,\ | ||
481 | M_CRC_DEF_CRC_POLY) | ||
482 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
483 | |||
484 | |||
485 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
486 | /* | ||
487 | * Data Mover CRC/Checksum Definition Registers | ||
488 | * Register: CTCP_DEF_0 | ||
489 | * Register: CTCP_DEF_1 | ||
490 | */ | ||
491 | #define S_CTCP_DEF_CRC_TXOR _SB_MAKE64(0) | ||
492 | #define M_CTCP_DEF_CRC_TXOR _SB_MAKEMASK(32, S_CTCP_DEF_CRC_TXOR) | ||
493 | #define V_CTCP_DEF_CRC_TXOR(r) _SB_MAKEVALUE(r, S_CTCP_DEF_CRC_TXOR) | ||
494 | #define G_CTCP_DEF_CRC_TXOR(r) _SB_GETVALUE(r, S_CTCP_DEF_CRC_TXOR,\ | ||
495 | M_CTCP_DEF_CRC_TXOR) | ||
496 | |||
497 | #define S_CTCP_DEF_TCPCS_INIT _SB_MAKE64(32) | ||
498 | #define M_CTCP_DEF_TCPCS_INIT _SB_MAKEMASK(16, S_CTCP_DEF_TCPCS_INIT) | ||
499 | #define V_CTCP_DEF_TCPCS_INIT(r) _SB_MAKEVALUE(r, S_CTCP_DEF_TCPCS_INIT) | ||
500 | #define G_CTCP_DEF_TCPCS_INIT(r) _SB_GETVALUE(r, S_CTCP_DEF_TCPCS_INIT,\ | ||
501 | M_CTCP_DEF_TCPCS_INIT) | ||
502 | |||
503 | #define S_CTCP_DEF_CRC_WIDTH _SB_MAKE64(48) | ||
504 | #define M_CTCP_DEF_CRC_WIDTH _SB_MAKEMASK(2, S_CTCP_DEF_CRC_WIDTH) | ||
505 | #define V_CTCP_DEF_CRC_WIDTH(r) _SB_MAKEVALUE(r, S_CTCP_DEF_CRC_WIDTH) | ||
506 | #define G_CTCP_DEF_CRC_WIDTH(r) _SB_GETVALUE(r, S_CTCP_DEF_CRC_WIDTH,\ | ||
507 | M_CTCP_DEF_CRC_WIDTH) | ||
508 | |||
509 | #define K_CTCP_DEF_CRC_WIDTH_4 0 | ||
510 | #define K_CTCP_DEF_CRC_WIDTH_2 1 | ||
511 | #define K_CTCP_DEF_CRC_WIDTH_1 2 | ||
512 | |||
513 | #define M_CTCP_DEF_CRC_BIT_ORDER _SB_MAKEMASK1(50) | ||
514 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
515 | |||
516 | |||
517 | /* | ||
518 | * Data Mover Descriptor Doubleword "A" (Table 7-26) | ||
519 | */ | ||
520 | |||
521 | #define S_DM_DSCRA_DST_ADDR _SB_MAKE64(0) | ||
522 | #define M_DM_DSCRA_DST_ADDR _SB_MAKEMASK(40, S_DM_DSCRA_DST_ADDR) | ||
523 | |||
524 | #define M_DM_DSCRA_UN_DEST _SB_MAKEMASK1(40) | ||
525 | #define M_DM_DSCRA_UN_SRC _SB_MAKEMASK1(41) | ||
526 | #define M_DM_DSCRA_INTERRUPT _SB_MAKEMASK1(42) | ||
527 | #if SIBYTE_HDR_FEATURE_UP_TO(1250, PASS1) | ||
528 | #define M_DM_DSCRA_THROTTLE _SB_MAKEMASK1(43) | ||
529 | #endif /* up to 1250 PASS1 */ | ||
530 | |||
531 | #define S_DM_DSCRA_DIR_DEST _SB_MAKE64(44) | ||
532 | #define M_DM_DSCRA_DIR_DEST _SB_MAKEMASK(2, S_DM_DSCRA_DIR_DEST) | ||
533 | #define V_DM_DSCRA_DIR_DEST(x) _SB_MAKEVALUE(x, S_DM_DSCRA_DIR_DEST) | ||
534 | #define G_DM_DSCRA_DIR_DEST(x) _SB_GETVALUE(x, S_DM_DSCRA_DIR_DEST, M_DM_DSCRA_DIR_DEST) | ||
535 | |||
536 | #define K_DM_DSCRA_DIR_DEST_INCR 0 | ||
537 | #define K_DM_DSCRA_DIR_DEST_DECR 1 | ||
538 | #define K_DM_DSCRA_DIR_DEST_CONST 2 | ||
539 | |||
540 | #define V_DM_DSCRA_DIR_DEST_INCR _SB_MAKEVALUE(K_DM_DSCRA_DIR_DEST_INCR, S_DM_DSCRA_DIR_DEST) | ||
541 | #define V_DM_DSCRA_DIR_DEST_DECR _SB_MAKEVALUE(K_DM_DSCRA_DIR_DEST_DECR, S_DM_DSCRA_DIR_DEST) | ||
542 | #define V_DM_DSCRA_DIR_DEST_CONST _SB_MAKEVALUE(K_DM_DSCRA_DIR_DEST_CONST, S_DM_DSCRA_DIR_DEST) | ||
543 | |||
544 | #define S_DM_DSCRA_DIR_SRC _SB_MAKE64(46) | ||
545 | #define M_DM_DSCRA_DIR_SRC _SB_MAKEMASK(2, S_DM_DSCRA_DIR_SRC) | ||
546 | #define V_DM_DSCRA_DIR_SRC(x) _SB_MAKEVALUE(x, S_DM_DSCRA_DIR_SRC) | ||
547 | #define G_DM_DSCRA_DIR_SRC(x) _SB_GETVALUE(x, S_DM_DSCRA_DIR_SRC, M_DM_DSCRA_DIR_SRC) | ||
548 | |||
549 | #define K_DM_DSCRA_DIR_SRC_INCR 0 | ||
550 | #define K_DM_DSCRA_DIR_SRC_DECR 1 | ||
551 | #define K_DM_DSCRA_DIR_SRC_CONST 2 | ||
552 | |||
553 | #define V_DM_DSCRA_DIR_SRC_INCR _SB_MAKEVALUE(K_DM_DSCRA_DIR_SRC_INCR, S_DM_DSCRA_DIR_SRC) | ||
554 | #define V_DM_DSCRA_DIR_SRC_DECR _SB_MAKEVALUE(K_DM_DSCRA_DIR_SRC_DECR, S_DM_DSCRA_DIR_SRC) | ||
555 | #define V_DM_DSCRA_DIR_SRC_CONST _SB_MAKEVALUE(K_DM_DSCRA_DIR_SRC_CONST, S_DM_DSCRA_DIR_SRC) | ||
556 | |||
557 | |||
558 | #define M_DM_DSCRA_ZERO_MEM _SB_MAKEMASK1(48) | ||
559 | #define M_DM_DSCRA_PREFETCH _SB_MAKEMASK1(49) | ||
560 | #define M_DM_DSCRA_L2C_DEST _SB_MAKEMASK1(50) | ||
561 | #define M_DM_DSCRA_L2C_SRC _SB_MAKEMASK1(51) | ||
562 | |||
563 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
564 | #define M_DM_DSCRA_RD_BKOFF _SB_MAKEMASK1(52) | ||
565 | #define M_DM_DSCRA_WR_BKOFF _SB_MAKEMASK1(53) | ||
566 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
567 | |||
568 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
569 | #define M_DM_DSCRA_TCPCS_EN _SB_MAKEMASK1(54) | ||
570 | #define M_DM_DSCRA_TCPCS_RES _SB_MAKEMASK1(55) | ||
571 | #define M_DM_DSCRA_TCPCS_AP _SB_MAKEMASK1(56) | ||
572 | #define M_DM_DSCRA_CRC_EN _SB_MAKEMASK1(57) | ||
573 | #define M_DM_DSCRA_CRC_RES _SB_MAKEMASK1(58) | ||
574 | #define M_DM_DSCRA_CRC_AP _SB_MAKEMASK1(59) | ||
575 | #define M_DM_DSCRA_CRC_DFN _SB_MAKEMASK1(60) | ||
576 | #define M_DM_DSCRA_CRC_XBIT _SB_MAKEMASK1(61) | ||
577 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
578 | |||
579 | #define M_DM_DSCRA_RESERVED2 _SB_MAKEMASK(3, 61) | ||
580 | |||
581 | /* | ||
582 | * Data Mover Descriptor Doubleword "B" (Table 7-25) | ||
583 | */ | ||
584 | |||
585 | #define S_DM_DSCRB_SRC_ADDR _SB_MAKE64(0) | ||
586 | #define M_DM_DSCRB_SRC_ADDR _SB_MAKEMASK(40, S_DM_DSCRB_SRC_ADDR) | ||
587 | |||
588 | #define S_DM_DSCRB_SRC_LENGTH _SB_MAKE64(40) | ||
589 | #define M_DM_DSCRB_SRC_LENGTH _SB_MAKEMASK(20, S_DM_DSCRB_SRC_LENGTH) | ||
590 | #define V_DM_DSCRB_SRC_LENGTH(x) _SB_MAKEVALUE(x, S_DM_DSCRB_SRC_LENGTH) | ||
591 | #define G_DM_DSCRB_SRC_LENGTH(x) _SB_GETVALUE(x, S_DM_DSCRB_SRC_LENGTH, M_DM_DSCRB_SRC_LENGTH) | ||
592 | |||
593 | |||
594 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_genbus.h b/include/asm-mips/sibyte/sb1250_genbus.h deleted file mode 100644 index 94e9c7c8e783..000000000000 --- a/include/asm-mips/sibyte/sb1250_genbus.h +++ /dev/null | |||
@@ -1,474 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * Generic Bus Constants File: sb1250_genbus.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * manipulating the SB1250's Generic Bus interface | ||
8 | * | ||
9 | * SB1250 specification level: User's manual 10/21/02 | ||
10 | * BCM1280 specification level: User's Manual 11/14/03 | ||
11 | * | ||
12 | ********************************************************************* | ||
13 | * | ||
14 | * Copyright 2000, 2001, 2002, 2003 | ||
15 | * Broadcom Corporation. All rights reserved. | ||
16 | * | ||
17 | * This program is free software; you can redistribute it and/or | ||
18 | * modify it under the terms of the GNU General Public License as | ||
19 | * published by the Free Software Foundation; either version 2 of | ||
20 | * the License, or (at your option) any later version. | ||
21 | * | ||
22 | * This program is distributed in the hope that it will be useful, | ||
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
25 | * GNU General Public License for more details. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public License | ||
28 | * along with this program; if not, write to the Free Software | ||
29 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
30 | * MA 02111-1307 USA | ||
31 | ********************************************************************* */ | ||
32 | |||
33 | |||
34 | #ifndef _SB1250_GENBUS_H | ||
35 | #define _SB1250_GENBUS_H | ||
36 | |||
37 | #include "sb1250_defs.h" | ||
38 | |||
39 | /* | ||
40 | * Generic Bus Region Configuration Registers (Table 11-4) | ||
41 | */ | ||
42 | |||
43 | #define S_IO_RDY_ACTIVE 0 | ||
44 | #define M_IO_RDY_ACTIVE _SB_MAKEMASK1(S_IO_RDY_ACTIVE) | ||
45 | |||
46 | #define S_IO_ENA_RDY 1 | ||
47 | #define M_IO_ENA_RDY _SB_MAKEMASK1(S_IO_ENA_RDY) | ||
48 | |||
49 | #define S_IO_WIDTH_SEL 2 | ||
50 | #define M_IO_WIDTH_SEL _SB_MAKEMASK(2, S_IO_WIDTH_SEL) | ||
51 | #define K_IO_WIDTH_SEL_1 0 | ||
52 | #define K_IO_WIDTH_SEL_2 1 | ||
53 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \ | ||
54 | || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
55 | #define K_IO_WIDTH_SEL_1L 2 | ||
56 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
57 | #define K_IO_WIDTH_SEL_4 3 | ||
58 | #define V_IO_WIDTH_SEL(x) _SB_MAKEVALUE(x, S_IO_WIDTH_SEL) | ||
59 | #define G_IO_WIDTH_SEL(x) _SB_GETVALUE(x, S_IO_WIDTH_SEL, M_IO_WIDTH_SEL) | ||
60 | |||
61 | #define S_IO_PARITY_ENA 4 | ||
62 | #define M_IO_PARITY_ENA _SB_MAKEMASK1(S_IO_PARITY_ENA) | ||
63 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \ | ||
64 | || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
65 | #define S_IO_BURST_EN 5 | ||
66 | #define M_IO_BURST_EN _SB_MAKEMASK1(S_IO_BURST_EN) | ||
67 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
68 | #define S_IO_PARITY_ODD 6 | ||
69 | #define M_IO_PARITY_ODD _SB_MAKEMASK1(S_IO_PARITY_ODD) | ||
70 | #define S_IO_NONMUX 7 | ||
71 | #define M_IO_NONMUX _SB_MAKEMASK1(S_IO_NONMUX) | ||
72 | |||
73 | #define S_IO_TIMEOUT 8 | ||
74 | #define M_IO_TIMEOUT _SB_MAKEMASK(8, S_IO_TIMEOUT) | ||
75 | #define V_IO_TIMEOUT(x) _SB_MAKEVALUE(x, S_IO_TIMEOUT) | ||
76 | #define G_IO_TIMEOUT(x) _SB_GETVALUE(x, S_IO_TIMEOUT, M_IO_TIMEOUT) | ||
77 | |||
78 | /* | ||
79 | * Generic Bus Region Size register (Table 11-5) | ||
80 | */ | ||
81 | |||
82 | #define S_IO_MULT_SIZE 0 | ||
83 | #define M_IO_MULT_SIZE _SB_MAKEMASK(12, S_IO_MULT_SIZE) | ||
84 | #define V_IO_MULT_SIZE(x) _SB_MAKEVALUE(x, S_IO_MULT_SIZE) | ||
85 | #define G_IO_MULT_SIZE(x) _SB_GETVALUE(x, S_IO_MULT_SIZE, M_IO_MULT_SIZE) | ||
86 | |||
87 | #define S_IO_REGSIZE 16 /* # bits to shift size for this reg */ | ||
88 | |||
89 | /* | ||
90 | * Generic Bus Region Address (Table 11-6) | ||
91 | */ | ||
92 | |||
93 | #define S_IO_START_ADDR 0 | ||
94 | #define M_IO_START_ADDR _SB_MAKEMASK(14, S_IO_START_ADDR) | ||
95 | #define V_IO_START_ADDR(x) _SB_MAKEVALUE(x, S_IO_START_ADDR) | ||
96 | #define G_IO_START_ADDR(x) _SB_GETVALUE(x, S_IO_START_ADDR, M_IO_START_ADDR) | ||
97 | |||
98 | #define S_IO_ADDRBASE 16 /* # bits to shift addr for this reg */ | ||
99 | |||
100 | #define M_IO_BLK_CACHE _SB_MAKEMASK1(15) | ||
101 | |||
102 | |||
103 | /* | ||
104 | * Generic Bus Timing 0 Registers (Table 11-7) | ||
105 | */ | ||
106 | |||
107 | #define S_IO_ALE_WIDTH 0 | ||
108 | #define M_IO_ALE_WIDTH _SB_MAKEMASK(3, S_IO_ALE_WIDTH) | ||
109 | #define V_IO_ALE_WIDTH(x) _SB_MAKEVALUE(x, S_IO_ALE_WIDTH) | ||
110 | #define G_IO_ALE_WIDTH(x) _SB_GETVALUE(x, S_IO_ALE_WIDTH, M_IO_ALE_WIDTH) | ||
111 | |||
112 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \ | ||
113 | || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
114 | #define M_IO_EARLY_CS _SB_MAKEMASK1(3) | ||
115 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
116 | |||
117 | #define S_IO_ALE_TO_CS 4 | ||
118 | #define M_IO_ALE_TO_CS _SB_MAKEMASK(2, S_IO_ALE_TO_CS) | ||
119 | #define V_IO_ALE_TO_CS(x) _SB_MAKEVALUE(x, S_IO_ALE_TO_CS) | ||
120 | #define G_IO_ALE_TO_CS(x) _SB_GETVALUE(x, S_IO_ALE_TO_CS, M_IO_ALE_TO_CS) | ||
121 | |||
122 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \ | ||
123 | || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
124 | #define S_IO_BURST_WIDTH _SB_MAKE64(6) | ||
125 | #define M_IO_BURST_WIDTH _SB_MAKEMASK(2, S_IO_BURST_WIDTH) | ||
126 | #define V_IO_BURST_WIDTH(x) _SB_MAKEVALUE(x, S_IO_BURST_WIDTH) | ||
127 | #define G_IO_BURST_WIDTH(x) _SB_GETVALUE(x, S_IO_BURST_WIDTH, M_IO_BURST_WIDTH) | ||
128 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
129 | |||
130 | #define S_IO_CS_WIDTH 8 | ||
131 | #define M_IO_CS_WIDTH _SB_MAKEMASK(5, S_IO_CS_WIDTH) | ||
132 | #define V_IO_CS_WIDTH(x) _SB_MAKEVALUE(x, S_IO_CS_WIDTH) | ||
133 | #define G_IO_CS_WIDTH(x) _SB_GETVALUE(x, S_IO_CS_WIDTH, M_IO_CS_WIDTH) | ||
134 | |||
135 | #define S_IO_RDY_SMPLE 13 | ||
136 | #define M_IO_RDY_SMPLE _SB_MAKEMASK(3, S_IO_RDY_SMPLE) | ||
137 | #define V_IO_RDY_SMPLE(x) _SB_MAKEVALUE(x, S_IO_RDY_SMPLE) | ||
138 | #define G_IO_RDY_SMPLE(x) _SB_GETVALUE(x, S_IO_RDY_SMPLE, M_IO_RDY_SMPLE) | ||
139 | |||
140 | |||
141 | /* | ||
142 | * Generic Bus Timing 1 Registers (Table 11-8) | ||
143 | */ | ||
144 | |||
145 | #define S_IO_ALE_TO_WRITE 0 | ||
146 | #define M_IO_ALE_TO_WRITE _SB_MAKEMASK(3, S_IO_ALE_TO_WRITE) | ||
147 | #define V_IO_ALE_TO_WRITE(x) _SB_MAKEVALUE(x, S_IO_ALE_TO_WRITE) | ||
148 | #define G_IO_ALE_TO_WRITE(x) _SB_GETVALUE(x, S_IO_ALE_TO_WRITE, M_IO_ALE_TO_WRITE) | ||
149 | |||
150 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \ | ||
151 | || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
152 | #define M_IO_RDY_SYNC _SB_MAKEMASK1(3) | ||
153 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
154 | |||
155 | #define S_IO_WRITE_WIDTH 4 | ||
156 | #define M_IO_WRITE_WIDTH _SB_MAKEMASK(4, S_IO_WRITE_WIDTH) | ||
157 | #define V_IO_WRITE_WIDTH(x) _SB_MAKEVALUE(x, S_IO_WRITE_WIDTH) | ||
158 | #define G_IO_WRITE_WIDTH(x) _SB_GETVALUE(x, S_IO_WRITE_WIDTH, M_IO_WRITE_WIDTH) | ||
159 | |||
160 | #define S_IO_IDLE_CYCLE 8 | ||
161 | #define M_IO_IDLE_CYCLE _SB_MAKEMASK(4, S_IO_IDLE_CYCLE) | ||
162 | #define V_IO_IDLE_CYCLE(x) _SB_MAKEVALUE(x, S_IO_IDLE_CYCLE) | ||
163 | #define G_IO_IDLE_CYCLE(x) _SB_GETVALUE(x, S_IO_IDLE_CYCLE, M_IO_IDLE_CYCLE) | ||
164 | |||
165 | #define S_IO_OE_TO_CS 12 | ||
166 | #define M_IO_OE_TO_CS _SB_MAKEMASK(2, S_IO_OE_TO_CS) | ||
167 | #define V_IO_OE_TO_CS(x) _SB_MAKEVALUE(x, S_IO_OE_TO_CS) | ||
168 | #define G_IO_OE_TO_CS(x) _SB_GETVALUE(x, S_IO_OE_TO_CS, M_IO_OE_TO_CS) | ||
169 | |||
170 | #define S_IO_CS_TO_OE 14 | ||
171 | #define M_IO_CS_TO_OE _SB_MAKEMASK(2, S_IO_CS_TO_OE) | ||
172 | #define V_IO_CS_TO_OE(x) _SB_MAKEVALUE(x, S_IO_CS_TO_OE) | ||
173 | #define G_IO_CS_TO_OE(x) _SB_GETVALUE(x, S_IO_CS_TO_OE, M_IO_CS_TO_OE) | ||
174 | |||
175 | /* | ||
176 | * Generic Bus Interrupt Status Register (Table 11-9) | ||
177 | */ | ||
178 | |||
179 | #define M_IO_CS_ERR_INT _SB_MAKEMASK(0, 8) | ||
180 | #define M_IO_CS0_ERR_INT _SB_MAKEMASK1(0) | ||
181 | #define M_IO_CS1_ERR_INT _SB_MAKEMASK1(1) | ||
182 | #define M_IO_CS2_ERR_INT _SB_MAKEMASK1(2) | ||
183 | #define M_IO_CS3_ERR_INT _SB_MAKEMASK1(3) | ||
184 | #define M_IO_CS4_ERR_INT _SB_MAKEMASK1(4) | ||
185 | #define M_IO_CS5_ERR_INT _SB_MAKEMASK1(5) | ||
186 | #define M_IO_CS6_ERR_INT _SB_MAKEMASK1(6) | ||
187 | #define M_IO_CS7_ERR_INT _SB_MAKEMASK1(7) | ||
188 | |||
189 | #define M_IO_RD_PAR_INT _SB_MAKEMASK1(9) | ||
190 | #define M_IO_TIMEOUT_INT _SB_MAKEMASK1(10) | ||
191 | #define M_IO_ILL_ADDR_INT _SB_MAKEMASK1(11) | ||
192 | #define M_IO_MULT_CS_INT _SB_MAKEMASK1(12) | ||
193 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
194 | #define M_IO_COH_ERR _SB_MAKEMASK1(14) | ||
195 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
196 | |||
197 | |||
198 | /* | ||
199 | * Generic Bus Output Drive Control Register 0 (Table 14-18) | ||
200 | */ | ||
201 | |||
202 | #define S_IO_SLEW0 0 | ||
203 | #define M_IO_SLEW0 _SB_MAKEMASK(2, S_IO_SLEW0) | ||
204 | #define V_IO_SLEW0(x) _SB_MAKEVALUE(x, S_IO_SLEW0) | ||
205 | #define G_IO_SLEW0(x) _SB_GETVALUE(x, S_IO_SLEW0, M_IO_SLEW0) | ||
206 | |||
207 | #define S_IO_DRV_A 2 | ||
208 | #define M_IO_DRV_A _SB_MAKEMASK(2, S_IO_DRV_A) | ||
209 | #define V_IO_DRV_A(x) _SB_MAKEVALUE(x, S_IO_DRV_A) | ||
210 | #define G_IO_DRV_A(x) _SB_GETVALUE(x, S_IO_DRV_A, M_IO_DRV_A) | ||
211 | |||
212 | #define S_IO_DRV_B 6 | ||
213 | #define M_IO_DRV_B _SB_MAKEMASK(2, S_IO_DRV_B) | ||
214 | #define V_IO_DRV_B(x) _SB_MAKEVALUE(x, S_IO_DRV_B) | ||
215 | #define G_IO_DRV_B(x) _SB_GETVALUE(x, S_IO_DRV_B, M_IO_DRV_B) | ||
216 | |||
217 | #define S_IO_DRV_C 10 | ||
218 | #define M_IO_DRV_C _SB_MAKEMASK(2, S_IO_DRV_C) | ||
219 | #define V_IO_DRV_C(x) _SB_MAKEVALUE(x, S_IO_DRV_C) | ||
220 | #define G_IO_DRV_C(x) _SB_GETVALUE(x, S_IO_DRV_C, M_IO_DRV_C) | ||
221 | |||
222 | #define S_IO_DRV_D 14 | ||
223 | #define M_IO_DRV_D _SB_MAKEMASK(2, S_IO_DRV_D) | ||
224 | #define V_IO_DRV_D(x) _SB_MAKEVALUE(x, S_IO_DRV_D) | ||
225 | #define G_IO_DRV_D(x) _SB_GETVALUE(x, S_IO_DRV_D, M_IO_DRV_D) | ||
226 | |||
227 | /* | ||
228 | * Generic Bus Output Drive Control Register 1 (Table 14-19) | ||
229 | */ | ||
230 | |||
231 | #define S_IO_DRV_E 2 | ||
232 | #define M_IO_DRV_E _SB_MAKEMASK(2, S_IO_DRV_E) | ||
233 | #define V_IO_DRV_E(x) _SB_MAKEVALUE(x, S_IO_DRV_E) | ||
234 | #define G_IO_DRV_E(x) _SB_GETVALUE(x, S_IO_DRV_E, M_IO_DRV_E) | ||
235 | |||
236 | #define S_IO_DRV_F 6 | ||
237 | #define M_IO_DRV_F _SB_MAKEMASK(2, S_IO_DRV_F) | ||
238 | #define V_IO_DRV_F(x) _SB_MAKEVALUE(x, S_IO_DRV_F) | ||
239 | #define G_IO_DRV_F(x) _SB_GETVALUE(x, S_IO_DRV_F, M_IO_DRV_F) | ||
240 | |||
241 | #define S_IO_SLEW1 8 | ||
242 | #define M_IO_SLEW1 _SB_MAKEMASK(2, S_IO_SLEW1) | ||
243 | #define V_IO_SLEW1(x) _SB_MAKEVALUE(x, S_IO_SLEW1) | ||
244 | #define G_IO_SLEW1(x) _SB_GETVALUE(x, S_IO_SLEW1, M_IO_SLEW1) | ||
245 | |||
246 | #define S_IO_DRV_G 10 | ||
247 | #define M_IO_DRV_G _SB_MAKEMASK(2, S_IO_DRV_G) | ||
248 | #define V_IO_DRV_G(x) _SB_MAKEVALUE(x, S_IO_DRV_G) | ||
249 | #define G_IO_DRV_G(x) _SB_GETVALUE(x, S_IO_DRV_G, M_IO_DRV_G) | ||
250 | |||
251 | #define S_IO_SLEW2 12 | ||
252 | #define M_IO_SLEW2 _SB_MAKEMASK(2, S_IO_SLEW2) | ||
253 | #define V_IO_SLEW2(x) _SB_MAKEVALUE(x, S_IO_SLEW2) | ||
254 | #define G_IO_SLEW2(x) _SB_GETVALUE(x, S_IO_SLEW2, M_IO_SLEW2) | ||
255 | |||
256 | #define S_IO_DRV_H 14 | ||
257 | #define M_IO_DRV_H _SB_MAKEMASK(2, S_IO_DRV_H) | ||
258 | #define V_IO_DRV_H(x) _SB_MAKEVALUE(x, S_IO_DRV_H) | ||
259 | #define G_IO_DRV_H(x) _SB_GETVALUE(x, S_IO_DRV_H, M_IO_DRV_H) | ||
260 | |||
261 | /* | ||
262 | * Generic Bus Output Drive Control Register 2 (Table 14-20) | ||
263 | */ | ||
264 | |||
265 | #define S_IO_DRV_J 2 | ||
266 | #define M_IO_DRV_J _SB_MAKEMASK(2, S_IO_DRV_J) | ||
267 | #define V_IO_DRV_J(x) _SB_MAKEVALUE(x, S_IO_DRV_J) | ||
268 | #define G_IO_DRV_J(x) _SB_GETVALUE(x, S_IO_DRV_J, M_IO_DRV_J) | ||
269 | |||
270 | #define S_IO_DRV_K 6 | ||
271 | #define M_IO_DRV_K _SB_MAKEMASK(2, S_IO_DRV_K) | ||
272 | #define V_IO_DRV_K(x) _SB_MAKEVALUE(x, S_IO_DRV_K) | ||
273 | #define G_IO_DRV_K(x) _SB_GETVALUE(x, S_IO_DRV_K, M_IO_DRV_K) | ||
274 | |||
275 | #define S_IO_DRV_L 10 | ||
276 | #define M_IO_DRV_L _SB_MAKEMASK(2, S_IO_DRV_L) | ||
277 | #define V_IO_DRV_L(x) _SB_MAKEVALUE(x, S_IO_DRV_L) | ||
278 | #define G_IO_DRV_L(x) _SB_GETVALUE(x, S_IO_DRV_L, M_IO_DRV_L) | ||
279 | |||
280 | #define S_IO_DRV_M 14 | ||
281 | #define M_IO_DRV_M _SB_MAKEMASK(2, S_IO_DRV_M) | ||
282 | #define V_IO_DRV_M(x) _SB_MAKEVALUE(x, S_IO_DRV_M) | ||
283 | #define G_IO_DRV_M(x) _SB_GETVALUE(x, S_IO_DRV_M, M_IO_DRV_M) | ||
284 | |||
285 | /* | ||
286 | * Generic Bus Output Drive Control Register 3 (Table 14-21) | ||
287 | */ | ||
288 | |||
289 | #define S_IO_SLEW3 0 | ||
290 | #define M_IO_SLEW3 _SB_MAKEMASK(2, S_IO_SLEW3) | ||
291 | #define V_IO_SLEW3(x) _SB_MAKEVALUE(x, S_IO_SLEW3) | ||
292 | #define G_IO_SLEW3(x) _SB_GETVALUE(x, S_IO_SLEW3, M_IO_SLEW3) | ||
293 | |||
294 | #define S_IO_DRV_N 2 | ||
295 | #define M_IO_DRV_N _SB_MAKEMASK(2, S_IO_DRV_N) | ||
296 | #define V_IO_DRV_N(x) _SB_MAKEVALUE(x, S_IO_DRV_N) | ||
297 | #define G_IO_DRV_N(x) _SB_GETVALUE(x, S_IO_DRV_N, M_IO_DRV_N) | ||
298 | |||
299 | #define S_IO_DRV_P 6 | ||
300 | #define M_IO_DRV_P _SB_MAKEMASK(2, S_IO_DRV_P) | ||
301 | #define V_IO_DRV_P(x) _SB_MAKEVALUE(x, S_IO_DRV_P) | ||
302 | #define G_IO_DRV_P(x) _SB_GETVALUE(x, S_IO_DRV_P, M_IO_DRV_P) | ||
303 | |||
304 | #define S_IO_DRV_Q 10 | ||
305 | #define M_IO_DRV_Q _SB_MAKEMASK(2, S_IO_DRV_Q) | ||
306 | #define V_IO_DRV_Q(x) _SB_MAKEVALUE(x, S_IO_DRV_Q) | ||
307 | #define G_IO_DRV_Q(x) _SB_GETVALUE(x, S_IO_DRV_Q, M_IO_DRV_Q) | ||
308 | |||
309 | #define S_IO_DRV_R 14 | ||
310 | #define M_IO_DRV_R _SB_MAKEMASK(2, S_IO_DRV_R) | ||
311 | #define V_IO_DRV_R(x) _SB_MAKEVALUE(x, S_IO_DRV_R) | ||
312 | #define G_IO_DRV_R(x) _SB_GETVALUE(x, S_IO_DRV_R, M_IO_DRV_R) | ||
313 | |||
314 | |||
315 | /* | ||
316 | * PCMCIA configuration register (Table 12-6) | ||
317 | */ | ||
318 | |||
319 | #define M_PCMCIA_CFG_ATTRMEM _SB_MAKEMASK1(0) | ||
320 | #define M_PCMCIA_CFG_3VEN _SB_MAKEMASK1(1) | ||
321 | #define M_PCMCIA_CFG_5VEN _SB_MAKEMASK1(2) | ||
322 | #define M_PCMCIA_CFG_VPPEN _SB_MAKEMASK1(3) | ||
323 | #define M_PCMCIA_CFG_RESET _SB_MAKEMASK1(4) | ||
324 | #define M_PCMCIA_CFG_APWRONEN _SB_MAKEMASK1(5) | ||
325 | #define M_PCMCIA_CFG_CDMASK _SB_MAKEMASK1(6) | ||
326 | #define M_PCMCIA_CFG_WPMASK _SB_MAKEMASK1(7) | ||
327 | #define M_PCMCIA_CFG_RDYMASK _SB_MAKEMASK1(8) | ||
328 | #define M_PCMCIA_CFG_PWRCTL _SB_MAKEMASK1(9) | ||
329 | |||
330 | #if SIBYTE_HDR_FEATURE_CHIP(1480) | ||
331 | #define S_PCMCIA_MODE 16 | ||
332 | #define M_PCMCIA_MODE _SB_MAKEMASK(3, S_PCMCIA_MODE) | ||
333 | #define V_PCMCIA_MODE(x) _SB_MAKEVALUE(x, S_PCMCIA_MODE) | ||
334 | #define G_PCMCIA_MODE(x) _SB_GETVALUE(x, S_PCMCIA_MODE, M_PCMCIA_MODE) | ||
335 | |||
336 | #define K_PCMCIA_MODE_PCMA_NOB 0 /* standard PCMCIA "A", no "B" */ | ||
337 | #define K_PCMCIA_MODE_IDEA_NOB 1 /* IDE "A", no "B" */ | ||
338 | #define K_PCMCIA_MODE_PCMIOA_NOB 2 /* PCMCIA with I/O "A", no "B" */ | ||
339 | #define K_PCMCIA_MODE_PCMA_PCMB 4 /* standard PCMCIA "A", standard PCMCIA "B" */ | ||
340 | #define K_PCMCIA_MODE_IDEA_PCMB 5 /* IDE "A", standard PCMCIA "B" */ | ||
341 | #define K_PCMCIA_MODE_PCMA_IDEB 6 /* standard PCMCIA "A", IDE "B" */ | ||
342 | #define K_PCMCIA_MODE_IDEA_IDEB 7 /* IDE "A", IDE "B" */ | ||
343 | #endif | ||
344 | |||
345 | |||
346 | /* | ||
347 | * PCMCIA status register (Table 12-7) | ||
348 | */ | ||
349 | |||
350 | #define M_PCMCIA_STATUS_CD1 _SB_MAKEMASK1(0) | ||
351 | #define M_PCMCIA_STATUS_CD2 _SB_MAKEMASK1(1) | ||
352 | #define M_PCMCIA_STATUS_VS1 _SB_MAKEMASK1(2) | ||
353 | #define M_PCMCIA_STATUS_VS2 _SB_MAKEMASK1(3) | ||
354 | #define M_PCMCIA_STATUS_WP _SB_MAKEMASK1(4) | ||
355 | #define M_PCMCIA_STATUS_RDY _SB_MAKEMASK1(5) | ||
356 | #define M_PCMCIA_STATUS_3VEN _SB_MAKEMASK1(6) | ||
357 | #define M_PCMCIA_STATUS_5VEN _SB_MAKEMASK1(7) | ||
358 | #define M_PCMCIA_STATUS_CDCHG _SB_MAKEMASK1(8) | ||
359 | #define M_PCMCIA_STATUS_WPCHG _SB_MAKEMASK1(9) | ||
360 | #define M_PCMCIA_STATUS_RDYCHG _SB_MAKEMASK1(10) | ||
361 | |||
362 | /* | ||
363 | * GPIO Interrupt Type Register (table 13-3) | ||
364 | */ | ||
365 | |||
366 | #define K_GPIO_INTR_DISABLE 0 | ||
367 | #define K_GPIO_INTR_EDGE 1 | ||
368 | #define K_GPIO_INTR_LEVEL 2 | ||
369 | #define K_GPIO_INTR_SPLIT 3 | ||
370 | |||
371 | #define S_GPIO_INTR_TYPEX(n) (((n)/2)*2) | ||
372 | #define M_GPIO_INTR_TYPEX(n) _SB_MAKEMASK(2, S_GPIO_INTR_TYPEX(n)) | ||
373 | #define V_GPIO_INTR_TYPEX(n, x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPEX(n)) | ||
374 | #define G_GPIO_INTR_TYPEX(n, x) _SB_GETVALUE(x, S_GPIO_INTR_TYPEX(n), M_GPIO_INTR_TYPEX(n)) | ||
375 | |||
376 | #define S_GPIO_INTR_TYPE0 0 | ||
377 | #define M_GPIO_INTR_TYPE0 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE0) | ||
378 | #define V_GPIO_INTR_TYPE0(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE0) | ||
379 | #define G_GPIO_INTR_TYPE0(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE0, M_GPIO_INTR_TYPE0) | ||
380 | |||
381 | #define S_GPIO_INTR_TYPE2 2 | ||
382 | #define M_GPIO_INTR_TYPE2 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE2) | ||
383 | #define V_GPIO_INTR_TYPE2(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE2) | ||
384 | #define G_GPIO_INTR_TYPE2(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE2, M_GPIO_INTR_TYPE2) | ||
385 | |||
386 | #define S_GPIO_INTR_TYPE4 4 | ||
387 | #define M_GPIO_INTR_TYPE4 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE4) | ||
388 | #define V_GPIO_INTR_TYPE4(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE4) | ||
389 | #define G_GPIO_INTR_TYPE4(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE4, M_GPIO_INTR_TYPE4) | ||
390 | |||
391 | #define S_GPIO_INTR_TYPE6 6 | ||
392 | #define M_GPIO_INTR_TYPE6 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE6) | ||
393 | #define V_GPIO_INTR_TYPE6(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE6) | ||
394 | #define G_GPIO_INTR_TYPE6(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE6, M_GPIO_INTR_TYPE6) | ||
395 | |||
396 | #define S_GPIO_INTR_TYPE8 8 | ||
397 | #define M_GPIO_INTR_TYPE8 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE8) | ||
398 | #define V_GPIO_INTR_TYPE8(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE8) | ||
399 | #define G_GPIO_INTR_TYPE8(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE8, M_GPIO_INTR_TYPE8) | ||
400 | |||
401 | #define S_GPIO_INTR_TYPE10 10 | ||
402 | #define M_GPIO_INTR_TYPE10 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE10) | ||
403 | #define V_GPIO_INTR_TYPE10(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE10) | ||
404 | #define G_GPIO_INTR_TYPE10(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE10, M_GPIO_INTR_TYPE10) | ||
405 | |||
406 | #define S_GPIO_INTR_TYPE12 12 | ||
407 | #define M_GPIO_INTR_TYPE12 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE12) | ||
408 | #define V_GPIO_INTR_TYPE12(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE12) | ||
409 | #define G_GPIO_INTR_TYPE12(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE12, M_GPIO_INTR_TYPE12) | ||
410 | |||
411 | #define S_GPIO_INTR_TYPE14 14 | ||
412 | #define M_GPIO_INTR_TYPE14 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE14) | ||
413 | #define V_GPIO_INTR_TYPE14(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE14) | ||
414 | #define G_GPIO_INTR_TYPE14(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE14, M_GPIO_INTR_TYPE14) | ||
415 | |||
416 | #if SIBYTE_HDR_FEATURE_CHIP(1480) | ||
417 | |||
418 | /* | ||
419 | * GPIO Interrupt Additional Type Register | ||
420 | */ | ||
421 | |||
422 | #define K_GPIO_INTR_BOTHEDGE 0 | ||
423 | #define K_GPIO_INTR_RISEEDGE 1 | ||
424 | #define K_GPIO_INTR_UNPRED1 2 | ||
425 | #define K_GPIO_INTR_UNPRED2 3 | ||
426 | |||
427 | #define S_GPIO_INTR_ATYPEX(n) (((n)/2)*2) | ||
428 | #define M_GPIO_INTR_ATYPEX(n) _SB_MAKEMASK(2, S_GPIO_INTR_ATYPEX(n)) | ||
429 | #define V_GPIO_INTR_ATYPEX(n, x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPEX(n)) | ||
430 | #define G_GPIO_INTR_ATYPEX(n, x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPEX(n), M_GPIO_INTR_ATYPEX(n)) | ||
431 | |||
432 | #define S_GPIO_INTR_ATYPE0 0 | ||
433 | #define M_GPIO_INTR_ATYPE0 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE0) | ||
434 | #define V_GPIO_INTR_ATYPE0(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE0) | ||
435 | #define G_GPIO_INTR_ATYPE0(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE0, M_GPIO_INTR_ATYPE0) | ||
436 | |||
437 | #define S_GPIO_INTR_ATYPE2 2 | ||
438 | #define M_GPIO_INTR_ATYPE2 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE2) | ||
439 | #define V_GPIO_INTR_ATYPE2(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE2) | ||
440 | #define G_GPIO_INTR_ATYPE2(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE2, M_GPIO_INTR_ATYPE2) | ||
441 | |||
442 | #define S_GPIO_INTR_ATYPE4 4 | ||
443 | #define M_GPIO_INTR_ATYPE4 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE4) | ||
444 | #define V_GPIO_INTR_ATYPE4(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE4) | ||
445 | #define G_GPIO_INTR_ATYPE4(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE4, M_GPIO_INTR_ATYPE4) | ||
446 | |||
447 | #define S_GPIO_INTR_ATYPE6 6 | ||
448 | #define M_GPIO_INTR_ATYPE6 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE6) | ||
449 | #define V_GPIO_INTR_ATYPE6(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE6) | ||
450 | #define G_GPIO_INTR_ATYPE6(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE6, M_GPIO_INTR_ATYPE6) | ||
451 | |||
452 | #define S_GPIO_INTR_ATYPE8 8 | ||
453 | #define M_GPIO_INTR_ATYPE8 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE8) | ||
454 | #define V_GPIO_INTR_ATYPE8(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE8) | ||
455 | #define G_GPIO_INTR_ATYPE8(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE8, M_GPIO_INTR_ATYPE8) | ||
456 | |||
457 | #define S_GPIO_INTR_ATYPE10 10 | ||
458 | #define M_GPIO_INTR_ATYPE10 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE10) | ||
459 | #define V_GPIO_INTR_ATYPE10(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE10) | ||
460 | #define G_GPIO_INTR_ATYPE10(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE10, M_GPIO_INTR_ATYPE10) | ||
461 | |||
462 | #define S_GPIO_INTR_ATYPE12 12 | ||
463 | #define M_GPIO_INTR_ATYPE12 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE12) | ||
464 | #define V_GPIO_INTR_ATYPE12(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE12) | ||
465 | #define G_GPIO_INTR_ATYPE12(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE12, M_GPIO_INTR_ATYPE12) | ||
466 | |||
467 | #define S_GPIO_INTR_ATYPE14 14 | ||
468 | #define M_GPIO_INTR_ATYPE14 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE14) | ||
469 | #define V_GPIO_INTR_ATYPE14(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE14) | ||
470 | #define G_GPIO_INTR_ATYPE14(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE14, M_GPIO_INTR_ATYPE14) | ||
471 | #endif | ||
472 | |||
473 | |||
474 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_int.h b/include/asm-mips/sibyte/sb1250_int.h deleted file mode 100644 index f2850b4bcfd4..000000000000 --- a/include/asm-mips/sibyte/sb1250_int.h +++ /dev/null | |||
@@ -1,248 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * Interrupt Mapper definitions File: sb1250_int.h | ||
5 | * | ||
6 | * This module contains constants for manipulating the SB1250's | ||
7 | * interrupt mapper and definitions for the interrupt sources. | ||
8 | * | ||
9 | * SB1250 specification level: User's manual 1/02/02 | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000, 2001, 2002, 2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _SB1250_INT_H | ||
34 | #define _SB1250_INT_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | /* ********************************************************************* | ||
39 | * Interrupt Mapper Constants | ||
40 | ********************************************************************* */ | ||
41 | |||
42 | /* | ||
43 | * Interrupt sources (Table 4-8, UM 0.2) | ||
44 | * | ||
45 | * First, the interrupt numbers. | ||
46 | */ | ||
47 | |||
48 | #define K_INT_SOURCES 64 | ||
49 | |||
50 | #define K_INT_WATCHDOG_TIMER_0 0 | ||
51 | #define K_INT_WATCHDOG_TIMER_1 1 | ||
52 | #define K_INT_TIMER_0 2 | ||
53 | #define K_INT_TIMER_1 3 | ||
54 | #define K_INT_TIMER_2 4 | ||
55 | #define K_INT_TIMER_3 5 | ||
56 | #define K_INT_SMB_0 6 | ||
57 | #define K_INT_SMB_1 7 | ||
58 | #define K_INT_UART_0 8 | ||
59 | #define K_INT_UART_1 9 | ||
60 | #define K_INT_SER_0 10 | ||
61 | #define K_INT_SER_1 11 | ||
62 | #define K_INT_PCMCIA 12 | ||
63 | #define K_INT_ADDR_TRAP 13 | ||
64 | #define K_INT_PERF_CNT 14 | ||
65 | #define K_INT_TRACE_FREEZE 15 | ||
66 | #define K_INT_BAD_ECC 16 | ||
67 | #define K_INT_COR_ECC 17 | ||
68 | #define K_INT_IO_BUS 18 | ||
69 | #define K_INT_MAC_0 19 | ||
70 | #define K_INT_MAC_1 20 | ||
71 | #define K_INT_MAC_2 21 | ||
72 | #define K_INT_DM_CH_0 22 | ||
73 | #define K_INT_DM_CH_1 23 | ||
74 | #define K_INT_DM_CH_2 24 | ||
75 | #define K_INT_DM_CH_3 25 | ||
76 | #define K_INT_MBOX_0 26 | ||
77 | #define K_INT_MBOX_1 27 | ||
78 | #define K_INT_MBOX_2 28 | ||
79 | #define K_INT_MBOX_3 29 | ||
80 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
81 | #define K_INT_CYCLE_CP0_INT 30 | ||
82 | #define K_INT_CYCLE_CP1_INT 31 | ||
83 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
84 | #define K_INT_GPIO_0 32 | ||
85 | #define K_INT_GPIO_1 33 | ||
86 | #define K_INT_GPIO_2 34 | ||
87 | #define K_INT_GPIO_3 35 | ||
88 | #define K_INT_GPIO_4 36 | ||
89 | #define K_INT_GPIO_5 37 | ||
90 | #define K_INT_GPIO_6 38 | ||
91 | #define K_INT_GPIO_7 39 | ||
92 | #define K_INT_GPIO_8 40 | ||
93 | #define K_INT_GPIO_9 41 | ||
94 | #define K_INT_GPIO_10 42 | ||
95 | #define K_INT_GPIO_11 43 | ||
96 | #define K_INT_GPIO_12 44 | ||
97 | #define K_INT_GPIO_13 45 | ||
98 | #define K_INT_GPIO_14 46 | ||
99 | #define K_INT_GPIO_15 47 | ||
100 | #define K_INT_LDT_FATAL 48 | ||
101 | #define K_INT_LDT_NONFATAL 49 | ||
102 | #define K_INT_LDT_SMI 50 | ||
103 | #define K_INT_LDT_NMI 51 | ||
104 | #define K_INT_LDT_INIT 52 | ||
105 | #define K_INT_LDT_STARTUP 53 | ||
106 | #define K_INT_LDT_EXT 54 | ||
107 | #define K_INT_PCI_ERROR 55 | ||
108 | #define K_INT_PCI_INTA 56 | ||
109 | #define K_INT_PCI_INTB 57 | ||
110 | #define K_INT_PCI_INTC 58 | ||
111 | #define K_INT_PCI_INTD 59 | ||
112 | #define K_INT_SPARE_2 60 | ||
113 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
114 | #define K_INT_MAC_0_CH1 61 | ||
115 | #define K_INT_MAC_1_CH1 62 | ||
116 | #define K_INT_MAC_2_CH1 63 | ||
117 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
118 | |||
119 | /* | ||
120 | * Mask values for each interrupt | ||
121 | */ | ||
122 | |||
123 | #define M_INT_WATCHDOG_TIMER_0 _SB_MAKEMASK1(K_INT_WATCHDOG_TIMER_0) | ||
124 | #define M_INT_WATCHDOG_TIMER_1 _SB_MAKEMASK1(K_INT_WATCHDOG_TIMER_1) | ||
125 | #define M_INT_TIMER_0 _SB_MAKEMASK1(K_INT_TIMER_0) | ||
126 | #define M_INT_TIMER_1 _SB_MAKEMASK1(K_INT_TIMER_1) | ||
127 | #define M_INT_TIMER_2 _SB_MAKEMASK1(K_INT_TIMER_2) | ||
128 | #define M_INT_TIMER_3 _SB_MAKEMASK1(K_INT_TIMER_3) | ||
129 | #define M_INT_SMB_0 _SB_MAKEMASK1(K_INT_SMB_0) | ||
130 | #define M_INT_SMB_1 _SB_MAKEMASK1(K_INT_SMB_1) | ||
131 | #define M_INT_UART_0 _SB_MAKEMASK1(K_INT_UART_0) | ||
132 | #define M_INT_UART_1 _SB_MAKEMASK1(K_INT_UART_1) | ||
133 | #define M_INT_SER_0 _SB_MAKEMASK1(K_INT_SER_0) | ||
134 | #define M_INT_SER_1 _SB_MAKEMASK1(K_INT_SER_1) | ||
135 | #define M_INT_PCMCIA _SB_MAKEMASK1(K_INT_PCMCIA) | ||
136 | #define M_INT_ADDR_TRAP _SB_MAKEMASK1(K_INT_ADDR_TRAP) | ||
137 | #define M_INT_PERF_CNT _SB_MAKEMASK1(K_INT_PERF_CNT) | ||
138 | #define M_INT_TRACE_FREEZE _SB_MAKEMASK1(K_INT_TRACE_FREEZE) | ||
139 | #define M_INT_BAD_ECC _SB_MAKEMASK1(K_INT_BAD_ECC) | ||
140 | #define M_INT_COR_ECC _SB_MAKEMASK1(K_INT_COR_ECC) | ||
141 | #define M_INT_IO_BUS _SB_MAKEMASK1(K_INT_IO_BUS) | ||
142 | #define M_INT_MAC_0 _SB_MAKEMASK1(K_INT_MAC_0) | ||
143 | #define M_INT_MAC_1 _SB_MAKEMASK1(K_INT_MAC_1) | ||
144 | #define M_INT_MAC_2 _SB_MAKEMASK1(K_INT_MAC_2) | ||
145 | #define M_INT_DM_CH_0 _SB_MAKEMASK1(K_INT_DM_CH_0) | ||
146 | #define M_INT_DM_CH_1 _SB_MAKEMASK1(K_INT_DM_CH_1) | ||
147 | #define M_INT_DM_CH_2 _SB_MAKEMASK1(K_INT_DM_CH_2) | ||
148 | #define M_INT_DM_CH_3 _SB_MAKEMASK1(K_INT_DM_CH_3) | ||
149 | #define M_INT_MBOX_0 _SB_MAKEMASK1(K_INT_MBOX_0) | ||
150 | #define M_INT_MBOX_1 _SB_MAKEMASK1(K_INT_MBOX_1) | ||
151 | #define M_INT_MBOX_2 _SB_MAKEMASK1(K_INT_MBOX_2) | ||
152 | #define M_INT_MBOX_3 _SB_MAKEMASK1(K_INT_MBOX_3) | ||
153 | #define M_INT_MBOX_ALL _SB_MAKEMASK(4, K_INT_MBOX_0) | ||
154 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
155 | #define M_INT_CYCLE_CP0_INT _SB_MAKEMASK1(K_INT_CYCLE_CP0_INT) | ||
156 | #define M_INT_CYCLE_CP1_INT _SB_MAKEMASK1(K_INT_CYCLE_CP1_INT) | ||
157 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
158 | #define M_INT_GPIO_0 _SB_MAKEMASK1(K_INT_GPIO_0) | ||
159 | #define M_INT_GPIO_1 _SB_MAKEMASK1(K_INT_GPIO_1) | ||
160 | #define M_INT_GPIO_2 _SB_MAKEMASK1(K_INT_GPIO_2) | ||
161 | #define M_INT_GPIO_3 _SB_MAKEMASK1(K_INT_GPIO_3) | ||
162 | #define M_INT_GPIO_4 _SB_MAKEMASK1(K_INT_GPIO_4) | ||
163 | #define M_INT_GPIO_5 _SB_MAKEMASK1(K_INT_GPIO_5) | ||
164 | #define M_INT_GPIO_6 _SB_MAKEMASK1(K_INT_GPIO_6) | ||
165 | #define M_INT_GPIO_7 _SB_MAKEMASK1(K_INT_GPIO_7) | ||
166 | #define M_INT_GPIO_8 _SB_MAKEMASK1(K_INT_GPIO_8) | ||
167 | #define M_INT_GPIO_9 _SB_MAKEMASK1(K_INT_GPIO_9) | ||
168 | #define M_INT_GPIO_10 _SB_MAKEMASK1(K_INT_GPIO_10) | ||
169 | #define M_INT_GPIO_11 _SB_MAKEMASK1(K_INT_GPIO_11) | ||
170 | #define M_INT_GPIO_12 _SB_MAKEMASK1(K_INT_GPIO_12) | ||
171 | #define M_INT_GPIO_13 _SB_MAKEMASK1(K_INT_GPIO_13) | ||
172 | #define M_INT_GPIO_14 _SB_MAKEMASK1(K_INT_GPIO_14) | ||
173 | #define M_INT_GPIO_15 _SB_MAKEMASK1(K_INT_GPIO_15) | ||
174 | #define M_INT_LDT_FATAL _SB_MAKEMASK1(K_INT_LDT_FATAL) | ||
175 | #define M_INT_LDT_NONFATAL _SB_MAKEMASK1(K_INT_LDT_NONFATAL) | ||
176 | #define M_INT_LDT_SMI _SB_MAKEMASK1(K_INT_LDT_SMI) | ||
177 | #define M_INT_LDT_NMI _SB_MAKEMASK1(K_INT_LDT_NMI) | ||
178 | #define M_INT_LDT_INIT _SB_MAKEMASK1(K_INT_LDT_INIT) | ||
179 | #define M_INT_LDT_STARTUP _SB_MAKEMASK1(K_INT_LDT_STARTUP) | ||
180 | #define M_INT_LDT_EXT _SB_MAKEMASK1(K_INT_LDT_EXT) | ||
181 | #define M_INT_PCI_ERROR _SB_MAKEMASK1(K_INT_PCI_ERROR) | ||
182 | #define M_INT_PCI_INTA _SB_MAKEMASK1(K_INT_PCI_INTA) | ||
183 | #define M_INT_PCI_INTB _SB_MAKEMASK1(K_INT_PCI_INTB) | ||
184 | #define M_INT_PCI_INTC _SB_MAKEMASK1(K_INT_PCI_INTC) | ||
185 | #define M_INT_PCI_INTD _SB_MAKEMASK1(K_INT_PCI_INTD) | ||
186 | #define M_INT_SPARE_2 _SB_MAKEMASK1(K_INT_SPARE_2) | ||
187 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
188 | #define M_INT_MAC_0_CH1 _SB_MAKEMASK1(K_INT_MAC_0_CH1) | ||
189 | #define M_INT_MAC_1_CH1 _SB_MAKEMASK1(K_INT_MAC_1_CH1) | ||
190 | #define M_INT_MAC_2_CH1 _SB_MAKEMASK1(K_INT_MAC_2_CH1) | ||
191 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
192 | |||
193 | /* | ||
194 | * Interrupt mappings | ||
195 | */ | ||
196 | |||
197 | #define K_INT_MAP_I0 0 /* interrupt pins on processor */ | ||
198 | #define K_INT_MAP_I1 1 | ||
199 | #define K_INT_MAP_I2 2 | ||
200 | #define K_INT_MAP_I3 3 | ||
201 | #define K_INT_MAP_I4 4 | ||
202 | #define K_INT_MAP_I5 5 | ||
203 | #define K_INT_MAP_NMI 6 /* nonmaskable */ | ||
204 | #define K_INT_MAP_DINT 7 /* debug interrupt */ | ||
205 | |||
206 | /* | ||
207 | * LDT Interrupt Set Register (table 4-5) | ||
208 | */ | ||
209 | |||
210 | #define S_INT_LDT_INTMSG 0 | ||
211 | #define M_INT_LDT_INTMSG _SB_MAKEMASK(3, S_INT_LDT_INTMSG) | ||
212 | #define V_INT_LDT_INTMSG(x) _SB_MAKEVALUE(x, S_INT_LDT_INTMSG) | ||
213 | #define G_INT_LDT_INTMSG(x) _SB_GETVALUE(x, S_INT_LDT_INTMSG, M_INT_LDT_INTMSG) | ||
214 | |||
215 | #define K_INT_LDT_INTMSG_FIXED 0 | ||
216 | #define K_INT_LDT_INTMSG_ARBITRATED 1 | ||
217 | #define K_INT_LDT_INTMSG_SMI 2 | ||
218 | #define K_INT_LDT_INTMSG_NMI 3 | ||
219 | #define K_INT_LDT_INTMSG_INIT 4 | ||
220 | #define K_INT_LDT_INTMSG_STARTUP 5 | ||
221 | #define K_INT_LDT_INTMSG_EXTINT 6 | ||
222 | #define K_INT_LDT_INTMSG_RESERVED 7 | ||
223 | |||
224 | #define M_INT_LDT_EDGETRIGGER 0 | ||
225 | #define M_INT_LDT_LEVELTRIGGER _SB_MAKEMASK1(3) | ||
226 | |||
227 | #define M_INT_LDT_PHYSICALDEST 0 | ||
228 | #define M_INT_LDT_LOGICALDEST _SB_MAKEMASK1(4) | ||
229 | |||
230 | #define S_INT_LDT_INTDEST 5 | ||
231 | #define M_INT_LDT_INTDEST _SB_MAKEMASK(10, S_INT_LDT_INTDEST) | ||
232 | #define V_INT_LDT_INTDEST(x) _SB_MAKEVALUE(x, S_INT_LDT_INTDEST) | ||
233 | #define G_INT_LDT_INTDEST(x) _SB_GETVALUE(x, S_INT_LDT_INTDEST, M_INT_LDT_INTDEST) | ||
234 | |||
235 | #define S_INT_LDT_VECTOR 13 | ||
236 | #define M_INT_LDT_VECTOR _SB_MAKEMASK(8, S_INT_LDT_VECTOR) | ||
237 | #define V_INT_LDT_VECTOR(x) _SB_MAKEVALUE(x, S_INT_LDT_VECTOR) | ||
238 | #define G_INT_LDT_VECTOR(x) _SB_GETVALUE(x, S_INT_LDT_VECTOR, M_INT_LDT_VECTOR) | ||
239 | |||
240 | /* | ||
241 | * Vector format (Table 4-6) | ||
242 | */ | ||
243 | |||
244 | #define M_LDTVECT_RAISEINT 0x00 | ||
245 | #define M_LDTVECT_RAISEMBOX 0x40 | ||
246 | |||
247 | |||
248 | #endif /* 1250/112x */ | ||
diff --git a/include/asm-mips/sibyte/sb1250_l2c.h b/include/asm-mips/sibyte/sb1250_l2c.h deleted file mode 100644 index 6554dcf05cfe..000000000000 --- a/include/asm-mips/sibyte/sb1250_l2c.h +++ /dev/null | |||
@@ -1,131 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * L2 Cache constants and macros File: sb1250_l2c.h | ||
5 | * | ||
6 | * This module contains constants useful for manipulating the | ||
7 | * level 2 cache. | ||
8 | * | ||
9 | * SB1250 specification level: User's manual 1/02/02 | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _SB1250_L2C_H | ||
34 | #define _SB1250_L2C_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | /* | ||
39 | * Level 2 Cache Tag register (Table 5-3) | ||
40 | */ | ||
41 | |||
42 | #define S_L2C_TAG_MBZ 0 | ||
43 | #define M_L2C_TAG_MBZ _SB_MAKEMASK(5, S_L2C_TAG_MBZ) | ||
44 | |||
45 | #define S_L2C_TAG_INDEX 5 | ||
46 | #define M_L2C_TAG_INDEX _SB_MAKEMASK(12, S_L2C_TAG_INDEX) | ||
47 | #define V_L2C_TAG_INDEX(x) _SB_MAKEVALUE(x, S_L2C_TAG_INDEX) | ||
48 | #define G_L2C_TAG_INDEX(x) _SB_GETVALUE(x, S_L2C_TAG_INDEX, M_L2C_TAG_INDEX) | ||
49 | |||
50 | #define S_L2C_TAG_TAG 17 | ||
51 | #define M_L2C_TAG_TAG _SB_MAKEMASK(23, S_L2C_TAG_TAG) | ||
52 | #define V_L2C_TAG_TAG(x) _SB_MAKEVALUE(x, S_L2C_TAG_TAG) | ||
53 | #define G_L2C_TAG_TAG(x) _SB_GETVALUE(x, S_L2C_TAG_TAG, M_L2C_TAG_TAG) | ||
54 | |||
55 | #define S_L2C_TAG_ECC 40 | ||
56 | #define M_L2C_TAG_ECC _SB_MAKEMASK(6, S_L2C_TAG_ECC) | ||
57 | #define V_L2C_TAG_ECC(x) _SB_MAKEVALUE(x, S_L2C_TAG_ECC) | ||
58 | #define G_L2C_TAG_ECC(x) _SB_GETVALUE(x, S_L2C_TAG_ECC, M_L2C_TAG_ECC) | ||
59 | |||
60 | #define S_L2C_TAG_WAY 46 | ||
61 | #define M_L2C_TAG_WAY _SB_MAKEMASK(2, S_L2C_TAG_WAY) | ||
62 | #define V_L2C_TAG_WAY(x) _SB_MAKEVALUE(x, S_L2C_TAG_WAY) | ||
63 | #define G_L2C_TAG_WAY(x) _SB_GETVALUE(x, S_L2C_TAG_WAY, M_L2C_TAG_WAY) | ||
64 | |||
65 | #define M_L2C_TAG_DIRTY _SB_MAKEMASK1(48) | ||
66 | #define M_L2C_TAG_VALID _SB_MAKEMASK1(49) | ||
67 | |||
68 | /* | ||
69 | * Format of level 2 cache management address (table 5-2) | ||
70 | */ | ||
71 | |||
72 | #define S_L2C_MGMT_INDEX 5 | ||
73 | #define M_L2C_MGMT_INDEX _SB_MAKEMASK(12, S_L2C_MGMT_INDEX) | ||
74 | #define V_L2C_MGMT_INDEX(x) _SB_MAKEVALUE(x, S_L2C_MGMT_INDEX) | ||
75 | #define G_L2C_MGMT_INDEX(x) _SB_GETVALUE(x, S_L2C_MGMT_INDEX, M_L2C_MGMT_INDEX) | ||
76 | |||
77 | #define S_L2C_MGMT_QUADRANT 15 | ||
78 | #define M_L2C_MGMT_QUADRANT _SB_MAKEMASK(2, S_L2C_MGMT_QUADRANT) | ||
79 | #define V_L2C_MGMT_QUADRANT(x) _SB_MAKEVALUE(x, S_L2C_MGMT_QUADRANT) | ||
80 | #define G_L2C_MGMT_QUADRANT(x) _SB_GETVALUE(x, S_L2C_MGMT_QUADRANT, M_L2C_MGMT_QUADRANT) | ||
81 | |||
82 | #define S_L2C_MGMT_HALF 16 | ||
83 | #define M_L2C_MGMT_HALF _SB_MAKEMASK(1, S_L2C_MGMT_HALF) | ||
84 | |||
85 | #define S_L2C_MGMT_WAY 17 | ||
86 | #define M_L2C_MGMT_WAY _SB_MAKEMASK(2, S_L2C_MGMT_WAY) | ||
87 | #define V_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x, S_L2C_MGMT_WAY) | ||
88 | #define G_L2C_MGMT_WAY(x) _SB_GETVALUE(x, S_L2C_MGMT_WAY, M_L2C_MGMT_WAY) | ||
89 | |||
90 | #define S_L2C_MGMT_ECC_DIAG 21 | ||
91 | #define M_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2, S_L2C_MGMT_ECC_DIAG) | ||
92 | #define V_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x, S_L2C_MGMT_ECC_DIAG) | ||
93 | #define G_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x, S_L2C_MGMT_ECC_DIAG, M_L2C_MGMT_ECC_DIAG) | ||
94 | |||
95 | #define S_L2C_MGMT_TAG 23 | ||
96 | #define M_L2C_MGMT_TAG _SB_MAKEMASK(4, S_L2C_MGMT_TAG) | ||
97 | #define V_L2C_MGMT_TAG(x) _SB_MAKEVALUE(x, S_L2C_MGMT_TAG) | ||
98 | #define G_L2C_MGMT_TAG(x) _SB_GETVALUE(x, S_L2C_MGMT_TAG, M_L2C_MGMT_TAG) | ||
99 | |||
100 | #define M_L2C_MGMT_DIRTY _SB_MAKEMASK1(19) | ||
101 | #define M_L2C_MGMT_VALID _SB_MAKEMASK1(20) | ||
102 | |||
103 | #define A_L2C_MGMT_TAG_BASE 0x00D0000000 | ||
104 | |||
105 | #define L2C_ENTRIES_PER_WAY 4096 | ||
106 | #define L2C_NUM_WAYS 4 | ||
107 | |||
108 | |||
109 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
110 | /* | ||
111 | * L2 Read Misc. register (A_L2_READ_MISC) | ||
112 | */ | ||
113 | #define S_L2C_MISC_NO_WAY 10 | ||
114 | #define M_L2C_MISC_NO_WAY _SB_MAKEMASK(4, S_L2C_MISC_NO_WAY) | ||
115 | #define V_L2C_MISC_NO_WAY(x) _SB_MAKEVALUE(x, S_L2C_MISC_NO_WAY) | ||
116 | #define G_L2C_MISC_NO_WAY(x) _SB_GETVALUE(x, S_L2C_MISC_NO_WAY, M_L2C_MISC_NO_WAY) | ||
117 | |||
118 | #define M_L2C_MISC_ECC_CLEANUP_DIS _SB_MAKEMASK1(9) | ||
119 | #define M_L2C_MISC_MC_PRIO_LOW _SB_MAKEMASK1(8) | ||
120 | #define M_L2C_MISC_SOFT_DISABLE_T _SB_MAKEMASK1(7) | ||
121 | #define M_L2C_MISC_SOFT_DISABLE_B _SB_MAKEMASK1(6) | ||
122 | #define M_L2C_MISC_SOFT_DISABLE_R _SB_MAKEMASK1(5) | ||
123 | #define M_L2C_MISC_SOFT_DISABLE_L _SB_MAKEMASK1(4) | ||
124 | #define M_L2C_MISC_SCACHE_DISABLE_T _SB_MAKEMASK1(3) | ||
125 | #define M_L2C_MISC_SCACHE_DISABLE_B _SB_MAKEMASK1(2) | ||
126 | #define M_L2C_MISC_SCACHE_DISABLE_R _SB_MAKEMASK1(1) | ||
127 | #define M_L2C_MISC_SCACHE_DISABLE_L _SB_MAKEMASK1(0) | ||
128 | #endif /* 1250 PASS3 || 112x PASS1 */ | ||
129 | |||
130 | |||
131 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_ldt.h b/include/asm-mips/sibyte/sb1250_ldt.h deleted file mode 100644 index 081e8b1c4ad0..000000000000 --- a/include/asm-mips/sibyte/sb1250_ldt.h +++ /dev/null | |||
@@ -1,423 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * LDT constants File: sb1250_ldt.h | ||
5 | * | ||
6 | * This module contains constants and macros to describe | ||
7 | * the LDT interface on the SB1250. | ||
8 | * | ||
9 | * SB1250 specification level: User's manual 1/02/02 | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000, 2001, 2002, 2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _SB1250_LDT_H | ||
34 | #define _SB1250_LDT_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | #define K_LDT_VENDOR_SIBYTE 0x166D | ||
39 | #define K_LDT_DEVICE_SB1250 0x0002 | ||
40 | |||
41 | /* | ||
42 | * LDT Interface Type 1 (bridge) configuration header | ||
43 | */ | ||
44 | |||
45 | #define R_LDT_TYPE1_DEVICEID 0x0000 | ||
46 | #define R_LDT_TYPE1_CMDSTATUS 0x0004 | ||
47 | #define R_LDT_TYPE1_CLASSREV 0x0008 | ||
48 | #define R_LDT_TYPE1_DEVHDR 0x000C | ||
49 | #define R_LDT_TYPE1_BAR0 0x0010 /* not used */ | ||
50 | #define R_LDT_TYPE1_BAR1 0x0014 /* not used */ | ||
51 | |||
52 | #define R_LDT_TYPE1_BUSID 0x0018 /* bus ID register */ | ||
53 | #define R_LDT_TYPE1_SECSTATUS 0x001C /* secondary status / I/O base/limit */ | ||
54 | #define R_LDT_TYPE1_MEMLIMIT 0x0020 | ||
55 | #define R_LDT_TYPE1_PREFETCH 0x0024 | ||
56 | #define R_LDT_TYPE1_PREF_BASE 0x0028 | ||
57 | #define R_LDT_TYPE1_PREF_LIMIT 0x002C | ||
58 | #define R_LDT_TYPE1_IOLIMIT 0x0030 | ||
59 | #define R_LDT_TYPE1_CAPPTR 0x0034 | ||
60 | #define R_LDT_TYPE1_ROMADDR 0x0038 | ||
61 | #define R_LDT_TYPE1_BRCTL 0x003C | ||
62 | #define R_LDT_TYPE1_CMD 0x0040 | ||
63 | #define R_LDT_TYPE1_LINKCTRL 0x0044 | ||
64 | #define R_LDT_TYPE1_LINKFREQ 0x0048 | ||
65 | #define R_LDT_TYPE1_RESERVED1 0x004C | ||
66 | #define R_LDT_TYPE1_SRICMD 0x0050 | ||
67 | #define R_LDT_TYPE1_SRITXNUM 0x0054 | ||
68 | #define R_LDT_TYPE1_SRIRXNUM 0x0058 | ||
69 | #define R_LDT_TYPE1_ERRSTATUS 0x0068 | ||
70 | #define R_LDT_TYPE1_SRICTRL 0x006C | ||
71 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
72 | #define R_LDT_TYPE1_ADDSTATUS 0x0070 | ||
73 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
74 | #define R_LDT_TYPE1_TXBUFCNT 0x00C8 | ||
75 | #define R_LDT_TYPE1_EXPCRC 0x00DC | ||
76 | #define R_LDT_TYPE1_RXCRC 0x00F0 | ||
77 | |||
78 | |||
79 | /* | ||
80 | * LDT Device ID register | ||
81 | */ | ||
82 | |||
83 | #define S_LDT_DEVICEID_VENDOR 0 | ||
84 | #define M_LDT_DEVICEID_VENDOR _SB_MAKEMASK_32(16, S_LDT_DEVICEID_VENDOR) | ||
85 | #define V_LDT_DEVICEID_VENDOR(x) _SB_MAKEVALUE_32(x, S_LDT_DEVICEID_VENDOR) | ||
86 | #define G_LDT_DEVICEID_VENDOR(x) _SB_GETVALUE_32(x, S_LDT_DEVICEID_VENDOR, M_LDT_DEVICEID_VENDOR) | ||
87 | |||
88 | #define S_LDT_DEVICEID_DEVICEID 16 | ||
89 | #define M_LDT_DEVICEID_DEVICEID _SB_MAKEMASK_32(16, S_LDT_DEVICEID_DEVICEID) | ||
90 | #define V_LDT_DEVICEID_DEVICEID(x) _SB_MAKEVALUE_32(x, S_LDT_DEVICEID_DEVICEID) | ||
91 | #define G_LDT_DEVICEID_DEVICEID(x) _SB_GETVALUE_32(x, S_LDT_DEVICEID_DEVICEID, M_LDT_DEVICEID_DEVICEID) | ||
92 | |||
93 | |||
94 | /* | ||
95 | * LDT Command Register (Table 8-13) | ||
96 | */ | ||
97 | |||
98 | #define M_LDT_CMD_IOSPACE_EN _SB_MAKEMASK1_32(0) | ||
99 | #define M_LDT_CMD_MEMSPACE_EN _SB_MAKEMASK1_32(1) | ||
100 | #define M_LDT_CMD_MASTER_EN _SB_MAKEMASK1_32(2) | ||
101 | #define M_LDT_CMD_SPECCYC_EN _SB_MAKEMASK1_32(3) | ||
102 | #define M_LDT_CMD_MEMWRINV_EN _SB_MAKEMASK1_32(4) | ||
103 | #define M_LDT_CMD_VGAPALSNP_EN _SB_MAKEMASK1_32(5) | ||
104 | #define M_LDT_CMD_PARERRRESP _SB_MAKEMASK1_32(6) | ||
105 | #define M_LDT_CMD_WAITCYCCTRL _SB_MAKEMASK1_32(7) | ||
106 | #define M_LDT_CMD_SERR_EN _SB_MAKEMASK1_32(8) | ||
107 | #define M_LDT_CMD_FASTB2B_EN _SB_MAKEMASK1_32(9) | ||
108 | |||
109 | /* | ||
110 | * LDT class and revision registers | ||
111 | */ | ||
112 | |||
113 | #define S_LDT_CLASSREV_REV 0 | ||
114 | #define M_LDT_CLASSREV_REV _SB_MAKEMASK_32(8, S_LDT_CLASSREV_REV) | ||
115 | #define V_LDT_CLASSREV_REV(x) _SB_MAKEVALUE_32(x, S_LDT_CLASSREV_REV) | ||
116 | #define G_LDT_CLASSREV_REV(x) _SB_GETVALUE_32(x, S_LDT_CLASSREV_REV, M_LDT_CLASSREV_REV) | ||
117 | |||
118 | #define S_LDT_CLASSREV_CLASS 8 | ||
119 | #define M_LDT_CLASSREV_CLASS _SB_MAKEMASK_32(24, S_LDT_CLASSREV_CLASS) | ||
120 | #define V_LDT_CLASSREV_CLASS(x) _SB_MAKEVALUE_32(x, S_LDT_CLASSREV_CLASS) | ||
121 | #define G_LDT_CLASSREV_CLASS(x) _SB_GETVALUE_32(x, S_LDT_CLASSREV_CLASS, M_LDT_CLASSREV_CLASS) | ||
122 | |||
123 | #define K_LDT_REV 0x01 | ||
124 | #define K_LDT_CLASS 0x060000 | ||
125 | |||
126 | /* | ||
127 | * Device Header (offset 0x0C) | ||
128 | */ | ||
129 | |||
130 | #define S_LDT_DEVHDR_CLINESZ 0 | ||
131 | #define M_LDT_DEVHDR_CLINESZ _SB_MAKEMASK_32(8, S_LDT_DEVHDR_CLINESZ) | ||
132 | #define V_LDT_DEVHDR_CLINESZ(x) _SB_MAKEVALUE_32(x, S_LDT_DEVHDR_CLINESZ) | ||
133 | #define G_LDT_DEVHDR_CLINESZ(x) _SB_GETVALUE_32(x, S_LDT_DEVHDR_CLINESZ, M_LDT_DEVHDR_CLINESZ) | ||
134 | |||
135 | #define S_LDT_DEVHDR_LATTMR 8 | ||
136 | #define M_LDT_DEVHDR_LATTMR _SB_MAKEMASK_32(8, S_LDT_DEVHDR_LATTMR) | ||
137 | #define V_LDT_DEVHDR_LATTMR(x) _SB_MAKEVALUE_32(x, S_LDT_DEVHDR_LATTMR) | ||
138 | #define G_LDT_DEVHDR_LATTMR(x) _SB_GETVALUE_32(x, S_LDT_DEVHDR_LATTMR, M_LDT_DEVHDR_LATTMR) | ||
139 | |||
140 | #define S_LDT_DEVHDR_HDRTYPE 16 | ||
141 | #define M_LDT_DEVHDR_HDRTYPE _SB_MAKEMASK_32(8, S_LDT_DEVHDR_HDRTYPE) | ||
142 | #define V_LDT_DEVHDR_HDRTYPE(x) _SB_MAKEVALUE_32(x, S_LDT_DEVHDR_HDRTYPE) | ||
143 | #define G_LDT_DEVHDR_HDRTYPE(x) _SB_GETVALUE_32(x, S_LDT_DEVHDR_HDRTYPE, M_LDT_DEVHDR_HDRTYPE) | ||
144 | |||
145 | #define K_LDT_DEVHDR_HDRTYPE_TYPE1 1 | ||
146 | |||
147 | #define S_LDT_DEVHDR_BIST 24 | ||
148 | #define M_LDT_DEVHDR_BIST _SB_MAKEMASK_32(8, S_LDT_DEVHDR_BIST) | ||
149 | #define V_LDT_DEVHDR_BIST(x) _SB_MAKEVALUE_32(x, S_LDT_DEVHDR_BIST) | ||
150 | #define G_LDT_DEVHDR_BIST(x) _SB_GETVALUE_32(x, S_LDT_DEVHDR_BIST, M_LDT_DEVHDR_BIST) | ||
151 | |||
152 | |||
153 | |||
154 | /* | ||
155 | * LDT Status Register (Table 8-14). Note that these constants | ||
156 | * assume you've read the command and status register | ||
157 | * together (32-bit read at offset 0x04) | ||
158 | * | ||
159 | * These bits also apply to the secondary status | ||
160 | * register (Table 8-15), offset 0x1C | ||
161 | */ | ||
162 | |||
163 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
164 | #define M_LDT_STATUS_VGAEN _SB_MAKEMASK1_32(3) | ||
165 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
166 | #define M_LDT_STATUS_CAPLIST _SB_MAKEMASK1_32(20) | ||
167 | #define M_LDT_STATUS_66MHZCAP _SB_MAKEMASK1_32(21) | ||
168 | #define M_LDT_STATUS_RESERVED2 _SB_MAKEMASK1_32(22) | ||
169 | #define M_LDT_STATUS_FASTB2BCAP _SB_MAKEMASK1_32(23) | ||
170 | #define M_LDT_STATUS_MSTRDPARERR _SB_MAKEMASK1_32(24) | ||
171 | |||
172 | #define S_LDT_STATUS_DEVSELTIMING 25 | ||
173 | #define M_LDT_STATUS_DEVSELTIMING _SB_MAKEMASK_32(2, S_LDT_STATUS_DEVSELTIMING) | ||
174 | #define V_LDT_STATUS_DEVSELTIMING(x) _SB_MAKEVALUE_32(x, S_LDT_STATUS_DEVSELTIMING) | ||
175 | #define G_LDT_STATUS_DEVSELTIMING(x) _SB_GETVALUE_32(x, S_LDT_STATUS_DEVSELTIMING, M_LDT_STATUS_DEVSELTIMING) | ||
176 | |||
177 | #define M_LDT_STATUS_SIGDTGTABORT _SB_MAKEMASK1_32(27) | ||
178 | #define M_LDT_STATUS_RCVDTGTABORT _SB_MAKEMASK1_32(28) | ||
179 | #define M_LDT_STATUS_RCVDMSTRABORT _SB_MAKEMASK1_32(29) | ||
180 | #define M_LDT_STATUS_SIGDSERR _SB_MAKEMASK1_32(30) | ||
181 | #define M_LDT_STATUS_DETPARERR _SB_MAKEMASK1_32(31) | ||
182 | |||
183 | /* | ||
184 | * Bridge Control Register (Table 8-16). Note that these | ||
185 | * constants assume you've read the register as a 32-bit | ||
186 | * read (offset 0x3C) | ||
187 | */ | ||
188 | |||
189 | #define M_LDT_BRCTL_PARERRRESP_EN _SB_MAKEMASK1_32(16) | ||
190 | #define M_LDT_BRCTL_SERR_EN _SB_MAKEMASK1_32(17) | ||
191 | #define M_LDT_BRCTL_ISA_EN _SB_MAKEMASK1_32(18) | ||
192 | #define M_LDT_BRCTL_VGA_EN _SB_MAKEMASK1_32(19) | ||
193 | #define M_LDT_BRCTL_MSTRABORTMODE _SB_MAKEMASK1_32(21) | ||
194 | #define M_LDT_BRCTL_SECBUSRESET _SB_MAKEMASK1_32(22) | ||
195 | #define M_LDT_BRCTL_FASTB2B_EN _SB_MAKEMASK1_32(23) | ||
196 | #define M_LDT_BRCTL_PRIDISCARD _SB_MAKEMASK1_32(24) | ||
197 | #define M_LDT_BRCTL_SECDISCARD _SB_MAKEMASK1_32(25) | ||
198 | #define M_LDT_BRCTL_DISCARDSTAT _SB_MAKEMASK1_32(26) | ||
199 | #define M_LDT_BRCTL_DISCARDSERR_EN _SB_MAKEMASK1_32(27) | ||
200 | |||
201 | /* | ||
202 | * LDT Command Register (Table 8-17). Note that these constants | ||
203 | * assume you've read the command and status register together | ||
204 | * 32-bit read at offset 0x40 | ||
205 | */ | ||
206 | |||
207 | #define M_LDT_CMD_WARMRESET _SB_MAKEMASK1_32(16) | ||
208 | #define M_LDT_CMD_DOUBLEENDED _SB_MAKEMASK1_32(17) | ||
209 | |||
210 | #define S_LDT_CMD_CAPTYPE 29 | ||
211 | #define M_LDT_CMD_CAPTYPE _SB_MAKEMASK_32(3, S_LDT_CMD_CAPTYPE) | ||
212 | #define V_LDT_CMD_CAPTYPE(x) _SB_MAKEVALUE_32(x, S_LDT_CMD_CAPTYPE) | ||
213 | #define G_LDT_CMD_CAPTYPE(x) _SB_GETVALUE_32(x, S_LDT_CMD_CAPTYPE, M_LDT_CMD_CAPTYPE) | ||
214 | |||
215 | /* | ||
216 | * LDT link control register (Table 8-18), and (Table 8-19) | ||
217 | */ | ||
218 | |||
219 | #define M_LDT_LINKCTRL_CAPSYNCFLOOD_EN _SB_MAKEMASK1_32(1) | ||
220 | #define M_LDT_LINKCTRL_CRCSTARTTEST _SB_MAKEMASK1_32(2) | ||
221 | #define M_LDT_LINKCTRL_CRCFORCEERR _SB_MAKEMASK1_32(3) | ||
222 | #define M_LDT_LINKCTRL_LINKFAIL _SB_MAKEMASK1_32(4) | ||
223 | #define M_LDT_LINKCTRL_INITDONE _SB_MAKEMASK1_32(5) | ||
224 | #define M_LDT_LINKCTRL_EOC _SB_MAKEMASK1_32(6) | ||
225 | #define M_LDT_LINKCTRL_XMITOFF _SB_MAKEMASK1_32(7) | ||
226 | |||
227 | #define S_LDT_LINKCTRL_CRCERR 8 | ||
228 | #define M_LDT_LINKCTRL_CRCERR _SB_MAKEMASK_32(4, S_LDT_LINKCTRL_CRCERR) | ||
229 | #define V_LDT_LINKCTRL_CRCERR(x) _SB_MAKEVALUE_32(x, S_LDT_LINKCTRL_CRCERR) | ||
230 | #define G_LDT_LINKCTRL_CRCERR(x) _SB_GETVALUE_32(x, S_LDT_LINKCTRL_CRCERR, M_LDT_LINKCTRL_CRCERR) | ||
231 | |||
232 | #define S_LDT_LINKCTRL_MAXIN 16 | ||
233 | #define M_LDT_LINKCTRL_MAXIN _SB_MAKEMASK_32(3, S_LDT_LINKCTRL_MAXIN) | ||
234 | #define V_LDT_LINKCTRL_MAXIN(x) _SB_MAKEVALUE_32(x, S_LDT_LINKCTRL_MAXIN) | ||
235 | #define G_LDT_LINKCTRL_MAXIN(x) _SB_GETVALUE_32(x, S_LDT_LINKCTRL_MAXIN, M_LDT_LINKCTRL_MAXIN) | ||
236 | |||
237 | #define M_LDT_LINKCTRL_DWFCLN _SB_MAKEMASK1_32(19) | ||
238 | |||
239 | #define S_LDT_LINKCTRL_MAXOUT 20 | ||
240 | #define M_LDT_LINKCTRL_MAXOUT _SB_MAKEMASK_32(3, S_LDT_LINKCTRL_MAXOUT) | ||
241 | #define V_LDT_LINKCTRL_MAXOUT(x) _SB_MAKEVALUE_32(x, S_LDT_LINKCTRL_MAXOUT) | ||
242 | #define G_LDT_LINKCTRL_MAXOUT(x) _SB_GETVALUE_32(x, S_LDT_LINKCTRL_MAXOUT, M_LDT_LINKCTRL_MAXOUT) | ||
243 | |||
244 | #define M_LDT_LINKCTRL_DWFCOUT _SB_MAKEMASK1_32(23) | ||
245 | |||
246 | #define S_LDT_LINKCTRL_WIDTHIN 24 | ||
247 | #define M_LDT_LINKCTRL_WIDTHIN _SB_MAKEMASK_32(3, S_LDT_LINKCTRL_WIDTHIN) | ||
248 | #define V_LDT_LINKCTRL_WIDTHIN(x) _SB_MAKEVALUE_32(x, S_LDT_LINKCTRL_WIDTHIN) | ||
249 | #define G_LDT_LINKCTRL_WIDTHIN(x) _SB_GETVALUE_32(x, S_LDT_LINKCTRL_WIDTHIN, M_LDT_LINKCTRL_WIDTHIN) | ||
250 | |||
251 | #define M_LDT_LINKCTRL_DWFCLIN_EN _SB_MAKEMASK1_32(27) | ||
252 | |||
253 | #define S_LDT_LINKCTRL_WIDTHOUT 28 | ||
254 | #define M_LDT_LINKCTRL_WIDTHOUT _SB_MAKEMASK_32(3, S_LDT_LINKCTRL_WIDTHOUT) | ||
255 | #define V_LDT_LINKCTRL_WIDTHOUT(x) _SB_MAKEVALUE_32(x, S_LDT_LINKCTRL_WIDTHOUT) | ||
256 | #define G_LDT_LINKCTRL_WIDTHOUT(x) _SB_GETVALUE_32(x, S_LDT_LINKCTRL_WIDTHOUT, M_LDT_LINKCTRL_WIDTHOUT) | ||
257 | |||
258 | #define M_LDT_LINKCTRL_DWFCOUT_EN _SB_MAKEMASK1_32(31) | ||
259 | |||
260 | /* | ||
261 | * LDT Link frequency register (Table 8-20) offset 0x48 | ||
262 | */ | ||
263 | |||
264 | #define S_LDT_LINKFREQ_FREQ 8 | ||
265 | #define M_LDT_LINKFREQ_FREQ _SB_MAKEMASK_32(4, S_LDT_LINKFREQ_FREQ) | ||
266 | #define V_LDT_LINKFREQ_FREQ(x) _SB_MAKEVALUE_32(x, S_LDT_LINKFREQ_FREQ) | ||
267 | #define G_LDT_LINKFREQ_FREQ(x) _SB_GETVALUE_32(x, S_LDT_LINKFREQ_FREQ, M_LDT_LINKFREQ_FREQ) | ||
268 | |||
269 | #define K_LDT_LINKFREQ_200MHZ 0 | ||
270 | #define K_LDT_LINKFREQ_300MHZ 1 | ||
271 | #define K_LDT_LINKFREQ_400MHZ 2 | ||
272 | #define K_LDT_LINKFREQ_500MHZ 3 | ||
273 | #define K_LDT_LINKFREQ_600MHZ 4 | ||
274 | #define K_LDT_LINKFREQ_800MHZ 5 | ||
275 | #define K_LDT_LINKFREQ_1000MHZ 6 | ||
276 | |||
277 | /* | ||
278 | * LDT SRI Command Register (Table 8-21). Note that these constants | ||
279 | * assume you've read the command and status register together | ||
280 | * 32-bit read at offset 0x50 | ||
281 | */ | ||
282 | |||
283 | #define M_LDT_SRICMD_SIPREADY _SB_MAKEMASK1_32(16) | ||
284 | #define M_LDT_SRICMD_SYNCPTRCTL _SB_MAKEMASK1_32(17) | ||
285 | #define M_LDT_SRICMD_REDUCESYNCZERO _SB_MAKEMASK1_32(18) | ||
286 | #if SIBYTE_HDR_FEATURE_UP_TO(1250, PASS1) | ||
287 | #define M_LDT_SRICMD_DISSTARVATIONCNT _SB_MAKEMASK1_32(19) /* PASS1 */ | ||
288 | #endif /* up to 1250 PASS1 */ | ||
289 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
290 | #define M_LDT_SRICMD_DISMULTTXVLD _SB_MAKEMASK1_32(19) | ||
291 | #define M_LDT_SRICMD_EXPENDIAN _SB_MAKEMASK1_32(26) | ||
292 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
293 | |||
294 | |||
295 | #define S_LDT_SRICMD_RXMARGIN 20 | ||
296 | #define M_LDT_SRICMD_RXMARGIN _SB_MAKEMASK_32(5, S_LDT_SRICMD_RXMARGIN) | ||
297 | #define V_LDT_SRICMD_RXMARGIN(x) _SB_MAKEVALUE_32(x, S_LDT_SRICMD_RXMARGIN) | ||
298 | #define G_LDT_SRICMD_RXMARGIN(x) _SB_GETVALUE_32(x, S_LDT_SRICMD_RXMARGIN, M_LDT_SRICMD_RXMARGIN) | ||
299 | |||
300 | #define M_LDT_SRICMD_LDTPLLCOMPAT _SB_MAKEMASK1_32(25) | ||
301 | |||
302 | #define S_LDT_SRICMD_TXINITIALOFFSET 28 | ||
303 | #define M_LDT_SRICMD_TXINITIALOFFSET _SB_MAKEMASK_32(3, S_LDT_SRICMD_TXINITIALOFFSET) | ||
304 | #define V_LDT_SRICMD_TXINITIALOFFSET(x) _SB_MAKEVALUE_32(x, S_LDT_SRICMD_TXINITIALOFFSET) | ||
305 | #define G_LDT_SRICMD_TXINITIALOFFSET(x) _SB_GETVALUE_32(x, S_LDT_SRICMD_TXINITIALOFFSET, M_LDT_SRICMD_TXINITIALOFFSET) | ||
306 | |||
307 | #define M_LDT_SRICMD_LINKFREQDIRECT _SB_MAKEMASK1_32(31) | ||
308 | |||
309 | /* | ||
310 | * LDT Error control and status register (Table 8-22) (Table 8-23) | ||
311 | */ | ||
312 | |||
313 | #define M_LDT_ERRCTL_PROTFATAL_EN _SB_MAKEMASK1_32(0) | ||
314 | #define M_LDT_ERRCTL_PROTNONFATAL_EN _SB_MAKEMASK1_32(1) | ||
315 | #define M_LDT_ERRCTL_PROTSYNCFLOOD_EN _SB_MAKEMASK1_32(2) | ||
316 | #define M_LDT_ERRCTL_OVFFATAL_EN _SB_MAKEMASK1_32(3) | ||
317 | #define M_LDT_ERRCTL_OVFNONFATAL_EN _SB_MAKEMASK1_32(4) | ||
318 | #define M_LDT_ERRCTL_OVFSYNCFLOOD_EN _SB_MAKEMASK1_32(5) | ||
319 | #define M_LDT_ERRCTL_EOCNXAFATAL_EN _SB_MAKEMASK1_32(6) | ||
320 | #define M_LDT_ERRCTL_EOCNXANONFATAL_EN _SB_MAKEMASK1_32(7) | ||
321 | #define M_LDT_ERRCTL_EOCNXASYNCFLOOD_EN _SB_MAKEMASK1_32(8) | ||
322 | #define M_LDT_ERRCTL_CRCFATAL_EN _SB_MAKEMASK1_32(9) | ||
323 | #define M_LDT_ERRCTL_CRCNONFATAL_EN _SB_MAKEMASK1_32(10) | ||
324 | #define M_LDT_ERRCTL_SERRFATAL_EN _SB_MAKEMASK1_32(11) | ||
325 | #define M_LDT_ERRCTL_SRCTAGFATAL_EN _SB_MAKEMASK1_32(12) | ||
326 | #define M_LDT_ERRCTL_SRCTAGNONFATAL_EN _SB_MAKEMASK1_32(13) | ||
327 | #define M_LDT_ERRCTL_SRCTAGSYNCFLOOD_EN _SB_MAKEMASK1_32(14) | ||
328 | #define M_LDT_ERRCTL_MAPNXAFATAL_EN _SB_MAKEMASK1_32(15) | ||
329 | #define M_LDT_ERRCTL_MAPNXANONFATAL_EN _SB_MAKEMASK1_32(16) | ||
330 | #define M_LDT_ERRCTL_MAPNXASYNCFLOOD_EN _SB_MAKEMASK1_32(17) | ||
331 | |||
332 | #define M_LDT_ERRCTL_PROTOERR _SB_MAKEMASK1_32(24) | ||
333 | #define M_LDT_ERRCTL_OVFERR _SB_MAKEMASK1_32(25) | ||
334 | #define M_LDT_ERRCTL_EOCNXAERR _SB_MAKEMASK1_32(26) | ||
335 | #define M_LDT_ERRCTL_SRCTAGERR _SB_MAKEMASK1_32(27) | ||
336 | #define M_LDT_ERRCTL_MAPNXAERR _SB_MAKEMASK1_32(28) | ||
337 | |||
338 | /* | ||
339 | * SRI Control register (Table 8-24, 8-25) Offset 0x6C | ||
340 | */ | ||
341 | |||
342 | #define S_LDT_SRICTRL_NEEDRESP 0 | ||
343 | #define M_LDT_SRICTRL_NEEDRESP _SB_MAKEMASK_32(2, S_LDT_SRICTRL_NEEDRESP) | ||
344 | #define V_LDT_SRICTRL_NEEDRESP(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_NEEDRESP) | ||
345 | #define G_LDT_SRICTRL_NEEDRESP(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_NEEDRESP, M_LDT_SRICTRL_NEEDRESP) | ||
346 | |||
347 | #define S_LDT_SRICTRL_NEEDNPREQ 2 | ||
348 | #define M_LDT_SRICTRL_NEEDNPREQ _SB_MAKEMASK_32(2, S_LDT_SRICTRL_NEEDNPREQ) | ||
349 | #define V_LDT_SRICTRL_NEEDNPREQ(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_NEEDNPREQ) | ||
350 | #define G_LDT_SRICTRL_NEEDNPREQ(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_NEEDNPREQ, M_LDT_SRICTRL_NEEDNPREQ) | ||
351 | |||
352 | #define S_LDT_SRICTRL_NEEDPREQ 4 | ||
353 | #define M_LDT_SRICTRL_NEEDPREQ _SB_MAKEMASK_32(2, S_LDT_SRICTRL_NEEDPREQ) | ||
354 | #define V_LDT_SRICTRL_NEEDPREQ(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_NEEDPREQ) | ||
355 | #define G_LDT_SRICTRL_NEEDPREQ(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_NEEDPREQ, M_LDT_SRICTRL_NEEDPREQ) | ||
356 | |||
357 | #define S_LDT_SRICTRL_WANTRESP 8 | ||
358 | #define M_LDT_SRICTRL_WANTRESP _SB_MAKEMASK_32(2, S_LDT_SRICTRL_WANTRESP) | ||
359 | #define V_LDT_SRICTRL_WANTRESP(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_WANTRESP) | ||
360 | #define G_LDT_SRICTRL_WANTRESP(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_WANTRESP, M_LDT_SRICTRL_WANTRESP) | ||
361 | |||
362 | #define S_LDT_SRICTRL_WANTNPREQ 10 | ||
363 | #define M_LDT_SRICTRL_WANTNPREQ _SB_MAKEMASK_32(2, S_LDT_SRICTRL_WANTNPREQ) | ||
364 | #define V_LDT_SRICTRL_WANTNPREQ(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_WANTNPREQ) | ||
365 | #define G_LDT_SRICTRL_WANTNPREQ(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_WANTNPREQ, M_LDT_SRICTRL_WANTNPREQ) | ||
366 | |||
367 | #define S_LDT_SRICTRL_WANTPREQ 12 | ||
368 | #define M_LDT_SRICTRL_WANTPREQ _SB_MAKEMASK_32(2, S_LDT_SRICTRL_WANTPREQ) | ||
369 | #define V_LDT_SRICTRL_WANTPREQ(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_WANTPREQ) | ||
370 | #define G_LDT_SRICTRL_WANTPREQ(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_WANTPREQ, M_LDT_SRICTRL_WANTPREQ) | ||
371 | |||
372 | #define S_LDT_SRICTRL_BUFRELSPACE 16 | ||
373 | #define M_LDT_SRICTRL_BUFRELSPACE _SB_MAKEMASK_32(4, S_LDT_SRICTRL_BUFRELSPACE) | ||
374 | #define V_LDT_SRICTRL_BUFRELSPACE(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_BUFRELSPACE) | ||
375 | #define G_LDT_SRICTRL_BUFRELSPACE(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_BUFRELSPACE, M_LDT_SRICTRL_BUFRELSPACE) | ||
376 | |||
377 | /* | ||
378 | * LDT SRI Transmit Buffer Count register (Table 8-26) | ||
379 | */ | ||
380 | |||
381 | #define S_LDT_TXBUFCNT_PCMD 0 | ||
382 | #define M_LDT_TXBUFCNT_PCMD _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_PCMD) | ||
383 | #define V_LDT_TXBUFCNT_PCMD(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_PCMD) | ||
384 | #define G_LDT_TXBUFCNT_PCMD(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_PCMD, M_LDT_TXBUFCNT_PCMD) | ||
385 | |||
386 | #define S_LDT_TXBUFCNT_PDATA 4 | ||
387 | #define M_LDT_TXBUFCNT_PDATA _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_PDATA) | ||
388 | #define V_LDT_TXBUFCNT_PDATA(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_PDATA) | ||
389 | #define G_LDT_TXBUFCNT_PDATA(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_PDATA, M_LDT_TXBUFCNT_PDATA) | ||
390 | |||
391 | #define S_LDT_TXBUFCNT_NPCMD 8 | ||
392 | #define M_LDT_TXBUFCNT_NPCMD _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_NPCMD) | ||
393 | #define V_LDT_TXBUFCNT_NPCMD(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_NPCMD) | ||
394 | #define G_LDT_TXBUFCNT_NPCMD(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_NPCMD, M_LDT_TXBUFCNT_NPCMD) | ||
395 | |||
396 | #define S_LDT_TXBUFCNT_NPDATA 12 | ||
397 | #define M_LDT_TXBUFCNT_NPDATA _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_NPDATA) | ||
398 | #define V_LDT_TXBUFCNT_NPDATA(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_NPDATA) | ||
399 | #define G_LDT_TXBUFCNT_NPDATA(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_NPDATA, M_LDT_TXBUFCNT_NPDATA) | ||
400 | |||
401 | #define S_LDT_TXBUFCNT_RCMD 16 | ||
402 | #define M_LDT_TXBUFCNT_RCMD _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_RCMD) | ||
403 | #define V_LDT_TXBUFCNT_RCMD(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_RCMD) | ||
404 | #define G_LDT_TXBUFCNT_RCMD(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_RCMD, M_LDT_TXBUFCNT_RCMD) | ||
405 | |||
406 | #define S_LDT_TXBUFCNT_RDATA 20 | ||
407 | #define M_LDT_TXBUFCNT_RDATA _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_RDATA) | ||
408 | #define V_LDT_TXBUFCNT_RDATA(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_RDATA) | ||
409 | #define G_LDT_TXBUFCNT_RDATA(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_RDATA, M_LDT_TXBUFCNT_RDATA) | ||
410 | |||
411 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
412 | /* | ||
413 | * Additional Status Register | ||
414 | */ | ||
415 | |||
416 | #define S_LDT_ADDSTATUS_TGTDONE 0 | ||
417 | #define M_LDT_ADDSTATUS_TGTDONE _SB_MAKEMASK_32(8, S_LDT_ADDSTATUS_TGTDONE) | ||
418 | #define V_LDT_ADDSTATUS_TGTDONE(x) _SB_MAKEVALUE_32(x, S_LDT_ADDSTATUS_TGTDONE) | ||
419 | #define G_LDT_ADDSTATUS_TGTDONE(x) _SB_GETVALUE_32(x, S_LDT_ADDSTATUS_TGTDONE, M_LDT_ADDSTATUS_TGTDONE) | ||
420 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
421 | |||
422 | #endif | ||
423 | |||
diff --git a/include/asm-mips/sibyte/sb1250_mac.h b/include/asm-mips/sibyte/sb1250_mac.h deleted file mode 100644 index b6faf08ca81d..000000000000 --- a/include/asm-mips/sibyte/sb1250_mac.h +++ /dev/null | |||
@@ -1,656 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * MAC constants and macros File: sb1250_mac.h | ||
5 | * | ||
6 | * This module contains constants and macros for the SB1250's | ||
7 | * ethernet controllers. | ||
8 | * | ||
9 | * SB1250 specification level: User's manual 1/02/02 | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _SB1250_MAC_H | ||
34 | #define _SB1250_MAC_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | /* ********************************************************************* | ||
39 | * Ethernet MAC Registers | ||
40 | ********************************************************************* */ | ||
41 | |||
42 | /* | ||
43 | * MAC Configuration Register (Table 9-13) | ||
44 | * Register: MAC_CFG_0 | ||
45 | * Register: MAC_CFG_1 | ||
46 | * Register: MAC_CFG_2 | ||
47 | */ | ||
48 | |||
49 | |||
50 | #define M_MAC_RESERVED0 _SB_MAKEMASK1(0) | ||
51 | #define M_MAC_TX_HOLD_SOP_EN _SB_MAKEMASK1(1) | ||
52 | #define M_MAC_RETRY_EN _SB_MAKEMASK1(2) | ||
53 | #define M_MAC_RET_DRPREQ_EN _SB_MAKEMASK1(3) | ||
54 | #define M_MAC_RET_UFL_EN _SB_MAKEMASK1(4) | ||
55 | #define M_MAC_BURST_EN _SB_MAKEMASK1(5) | ||
56 | |||
57 | #define S_MAC_TX_PAUSE _SB_MAKE64(6) | ||
58 | #define M_MAC_TX_PAUSE_CNT _SB_MAKEMASK(3, S_MAC_TX_PAUSE) | ||
59 | #define V_MAC_TX_PAUSE_CNT(x) _SB_MAKEVALUE(x, S_MAC_TX_PAUSE) | ||
60 | |||
61 | #define K_MAC_TX_PAUSE_CNT_512 0 | ||
62 | #define K_MAC_TX_PAUSE_CNT_1K 1 | ||
63 | #define K_MAC_TX_PAUSE_CNT_2K 2 | ||
64 | #define K_MAC_TX_PAUSE_CNT_4K 3 | ||
65 | #define K_MAC_TX_PAUSE_CNT_8K 4 | ||
66 | #define K_MAC_TX_PAUSE_CNT_16K 5 | ||
67 | #define K_MAC_TX_PAUSE_CNT_32K 6 | ||
68 | #define K_MAC_TX_PAUSE_CNT_64K 7 | ||
69 | |||
70 | #define V_MAC_TX_PAUSE_CNT_512 V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_512) | ||
71 | #define V_MAC_TX_PAUSE_CNT_1K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_1K) | ||
72 | #define V_MAC_TX_PAUSE_CNT_2K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_2K) | ||
73 | #define V_MAC_TX_PAUSE_CNT_4K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_4K) | ||
74 | #define V_MAC_TX_PAUSE_CNT_8K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_8K) | ||
75 | #define V_MAC_TX_PAUSE_CNT_16K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_16K) | ||
76 | #define V_MAC_TX_PAUSE_CNT_32K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_32K) | ||
77 | #define V_MAC_TX_PAUSE_CNT_64K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_64K) | ||
78 | |||
79 | #define M_MAC_RESERVED1 _SB_MAKEMASK(8, 9) | ||
80 | |||
81 | #define M_MAC_AP_STAT_EN _SB_MAKEMASK1(17) | ||
82 | |||
83 | #if SIBYTE_HDR_FEATURE_CHIP(1480) | ||
84 | #define M_MAC_TIMESTAMP _SB_MAKEMASK1(18) | ||
85 | #endif | ||
86 | #define M_MAC_DRP_ERRPKT_EN _SB_MAKEMASK1(19) | ||
87 | #define M_MAC_DRP_FCSERRPKT_EN _SB_MAKEMASK1(20) | ||
88 | #define M_MAC_DRP_CODEERRPKT_EN _SB_MAKEMASK1(21) | ||
89 | #define M_MAC_DRP_DRBLERRPKT_EN _SB_MAKEMASK1(22) | ||
90 | #define M_MAC_DRP_RNTPKT_EN _SB_MAKEMASK1(23) | ||
91 | #define M_MAC_DRP_OSZPKT_EN _SB_MAKEMASK1(24) | ||
92 | #define M_MAC_DRP_LENERRPKT_EN _SB_MAKEMASK1(25) | ||
93 | |||
94 | #define M_MAC_RESERVED3 _SB_MAKEMASK(6, 26) | ||
95 | |||
96 | #define M_MAC_BYPASS_SEL _SB_MAKEMASK1(32) | ||
97 | #define M_MAC_HDX_EN _SB_MAKEMASK1(33) | ||
98 | |||
99 | #define S_MAC_SPEED_SEL _SB_MAKE64(34) | ||
100 | #define M_MAC_SPEED_SEL _SB_MAKEMASK(2, S_MAC_SPEED_SEL) | ||
101 | #define V_MAC_SPEED_SEL(x) _SB_MAKEVALUE(x, S_MAC_SPEED_SEL) | ||
102 | #define G_MAC_SPEED_SEL(x) _SB_GETVALUE(x, S_MAC_SPEED_SEL, M_MAC_SPEED_SEL) | ||
103 | |||
104 | #define K_MAC_SPEED_SEL_10MBPS 0 | ||
105 | #define K_MAC_SPEED_SEL_100MBPS 1 | ||
106 | #define K_MAC_SPEED_SEL_1000MBPS 2 | ||
107 | #define K_MAC_SPEED_SEL_RESERVED 3 | ||
108 | |||
109 | #define V_MAC_SPEED_SEL_10MBPS V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_10MBPS) | ||
110 | #define V_MAC_SPEED_SEL_100MBPS V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_100MBPS) | ||
111 | #define V_MAC_SPEED_SEL_1000MBPS V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_1000MBPS) | ||
112 | #define V_MAC_SPEED_SEL_RESERVED V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_RESERVED) | ||
113 | |||
114 | #define M_MAC_TX_CLK_EDGE_SEL _SB_MAKEMASK1(36) | ||
115 | #define M_MAC_LOOPBACK_SEL _SB_MAKEMASK1(37) | ||
116 | #define M_MAC_FAST_SYNC _SB_MAKEMASK1(38) | ||
117 | #define M_MAC_SS_EN _SB_MAKEMASK1(39) | ||
118 | |||
119 | #define S_MAC_BYPASS_CFG _SB_MAKE64(40) | ||
120 | #define M_MAC_BYPASS_CFG _SB_MAKEMASK(2, S_MAC_BYPASS_CFG) | ||
121 | #define V_MAC_BYPASS_CFG(x) _SB_MAKEVALUE(x, S_MAC_BYPASS_CFG) | ||
122 | #define G_MAC_BYPASS_CFG(x) _SB_GETVALUE(x, S_MAC_BYPASS_CFG, M_MAC_BYPASS_CFG) | ||
123 | |||
124 | #define K_MAC_BYPASS_GMII 0 | ||
125 | #define K_MAC_BYPASS_ENCODED 1 | ||
126 | #define K_MAC_BYPASS_SOP 2 | ||
127 | #define K_MAC_BYPASS_EOP 3 | ||
128 | |||
129 | #define M_MAC_BYPASS_16 _SB_MAKEMASK1(42) | ||
130 | #define M_MAC_BYPASS_FCS_CHK _SB_MAKEMASK1(43) | ||
131 | |||
132 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
133 | #define M_MAC_RX_CH_SEL_MSB _SB_MAKEMASK1(44) | ||
134 | #endif /* 1250 PASS2 || 112x PASS1 || 1480*/ | ||
135 | |||
136 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
137 | #define M_MAC_SPLIT_CH_SEL _SB_MAKEMASK1(45) | ||
138 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
139 | |||
140 | #define S_MAC_BYPASS_IFG _SB_MAKE64(46) | ||
141 | #define M_MAC_BYPASS_IFG _SB_MAKEMASK(8, S_MAC_BYPASS_IFG) | ||
142 | #define V_MAC_BYPASS_IFG(x) _SB_MAKEVALUE(x, S_MAC_BYPASS_IFG) | ||
143 | #define G_MAC_BYPASS_IFG(x) _SB_GETVALUE(x, S_MAC_BYPASS_IFG, M_MAC_BYPASS_IFG) | ||
144 | |||
145 | #define K_MAC_FC_CMD_DISABLED 0 | ||
146 | #define K_MAC_FC_CMD_ENABLED 1 | ||
147 | #define K_MAC_FC_CMD_ENAB_FALSECARR 2 | ||
148 | |||
149 | #define V_MAC_FC_CMD_DISABLED V_MAC_FC_CMD(K_MAC_FC_CMD_DISABLED) | ||
150 | #define V_MAC_FC_CMD_ENABLED V_MAC_FC_CMD(K_MAC_FC_CMD_ENABLED) | ||
151 | #define V_MAC_FC_CMD_ENAB_FALSECARR V_MAC_FC_CMD(K_MAC_FC_CMD_ENAB_FALSECARR) | ||
152 | |||
153 | #define M_MAC_FC_SEL _SB_MAKEMASK1(54) | ||
154 | |||
155 | #define S_MAC_FC_CMD _SB_MAKE64(55) | ||
156 | #define M_MAC_FC_CMD _SB_MAKEMASK(2, S_MAC_FC_CMD) | ||
157 | #define V_MAC_FC_CMD(x) _SB_MAKEVALUE(x, S_MAC_FC_CMD) | ||
158 | #define G_MAC_FC_CMD(x) _SB_GETVALUE(x, S_MAC_FC_CMD, M_MAC_FC_CMD) | ||
159 | |||
160 | #define S_MAC_RX_CH_SEL _SB_MAKE64(57) | ||
161 | #define M_MAC_RX_CH_SEL _SB_MAKEMASK(7, S_MAC_RX_CH_SEL) | ||
162 | #define V_MAC_RX_CH_SEL(x) _SB_MAKEVALUE(x, S_MAC_RX_CH_SEL) | ||
163 | #define G_MAC_RX_CH_SEL(x) _SB_GETVALUE(x, S_MAC_RX_CH_SEL, M_MAC_RX_CH_SEL) | ||
164 | |||
165 | |||
166 | /* | ||
167 | * MAC Enable Registers | ||
168 | * Register: MAC_ENABLE_0 | ||
169 | * Register: MAC_ENABLE_1 | ||
170 | * Register: MAC_ENABLE_2 | ||
171 | */ | ||
172 | |||
173 | #define M_MAC_RXDMA_EN0 _SB_MAKEMASK1(0) | ||
174 | #define M_MAC_RXDMA_EN1 _SB_MAKEMASK1(1) | ||
175 | #define M_MAC_TXDMA_EN0 _SB_MAKEMASK1(4) | ||
176 | #define M_MAC_TXDMA_EN1 _SB_MAKEMASK1(5) | ||
177 | |||
178 | #define M_MAC_PORT_RESET _SB_MAKEMASK1(8) | ||
179 | |||
180 | #if (SIBYTE_HDR_FEATURE_CHIP(1250) || SIBYTE_HDR_FEATURE_CHIP(112x)) | ||
181 | #define M_MAC_RX_ENABLE _SB_MAKEMASK1(10) | ||
182 | #define M_MAC_TX_ENABLE _SB_MAKEMASK1(11) | ||
183 | #define M_MAC_BYP_RX_ENABLE _SB_MAKEMASK1(12) | ||
184 | #define M_MAC_BYP_TX_ENABLE _SB_MAKEMASK1(13) | ||
185 | #endif | ||
186 | |||
187 | /* | ||
188 | * MAC reset information register (1280/1255) | ||
189 | */ | ||
190 | #if SIBYTE_HDR_FEATURE_CHIP(1480) | ||
191 | #define M_MAC_RX_CH0_PAUSE_ON _SB_MAKEMASK1(8) | ||
192 | #define M_MAC_RX_CH1_PAUSE_ON _SB_MAKEMASK1(16) | ||
193 | #define M_MAC_TX_CH0_PAUSE_ON _SB_MAKEMASK1(24) | ||
194 | #define M_MAC_TX_CH1_PAUSE_ON _SB_MAKEMASK1(32) | ||
195 | #endif | ||
196 | |||
197 | /* | ||
198 | * MAC DMA Control Register | ||
199 | * Register: MAC_TXD_CTL_0 | ||
200 | * Register: MAC_TXD_CTL_1 | ||
201 | * Register: MAC_TXD_CTL_2 | ||
202 | */ | ||
203 | |||
204 | #define S_MAC_TXD_WEIGHT0 _SB_MAKE64(0) | ||
205 | #define M_MAC_TXD_WEIGHT0 _SB_MAKEMASK(4, S_MAC_TXD_WEIGHT0) | ||
206 | #define V_MAC_TXD_WEIGHT0(x) _SB_MAKEVALUE(x, S_MAC_TXD_WEIGHT0) | ||
207 | #define G_MAC_TXD_WEIGHT0(x) _SB_GETVALUE(x, S_MAC_TXD_WEIGHT0, M_MAC_TXD_WEIGHT0) | ||
208 | |||
209 | #define S_MAC_TXD_WEIGHT1 _SB_MAKE64(4) | ||
210 | #define M_MAC_TXD_WEIGHT1 _SB_MAKEMASK(4, S_MAC_TXD_WEIGHT1) | ||
211 | #define V_MAC_TXD_WEIGHT1(x) _SB_MAKEVALUE(x, S_MAC_TXD_WEIGHT1) | ||
212 | #define G_MAC_TXD_WEIGHT1(x) _SB_GETVALUE(x, S_MAC_TXD_WEIGHT1, M_MAC_TXD_WEIGHT1) | ||
213 | |||
214 | /* | ||
215 | * MAC Fifo Threshhold registers (Table 9-14) | ||
216 | * Register: MAC_THRSH_CFG_0 | ||
217 | * Register: MAC_THRSH_CFG_1 | ||
218 | * Register: MAC_THRSH_CFG_2 | ||
219 | */ | ||
220 | |||
221 | #define S_MAC_TX_WR_THRSH _SB_MAKE64(0) | ||
222 | #if SIBYTE_HDR_FEATURE_UP_TO(1250, PASS1) | ||
223 | /* XXX: Can't enable, as it has the same name as a pass2+ define below. */ | ||
224 | /* #define M_MAC_TX_WR_THRSH _SB_MAKEMASK(6, S_MAC_TX_WR_THRSH) */ | ||
225 | #endif /* up to 1250 PASS1 */ | ||
226 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
227 | #define M_MAC_TX_WR_THRSH _SB_MAKEMASK(7, S_MAC_TX_WR_THRSH) | ||
228 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
229 | #define V_MAC_TX_WR_THRSH(x) _SB_MAKEVALUE(x, S_MAC_TX_WR_THRSH) | ||
230 | #define G_MAC_TX_WR_THRSH(x) _SB_GETVALUE(x, S_MAC_TX_WR_THRSH, M_MAC_TX_WR_THRSH) | ||
231 | |||
232 | #define S_MAC_TX_RD_THRSH _SB_MAKE64(8) | ||
233 | #if SIBYTE_HDR_FEATURE_UP_TO(1250, PASS1) | ||
234 | /* XXX: Can't enable, as it has the same name as a pass2+ define below. */ | ||
235 | /* #define M_MAC_TX_RD_THRSH _SB_MAKEMASK(6, S_MAC_TX_RD_THRSH) */ | ||
236 | #endif /* up to 1250 PASS1 */ | ||
237 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
238 | #define M_MAC_TX_RD_THRSH _SB_MAKEMASK(7, S_MAC_TX_RD_THRSH) | ||
239 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
240 | #define V_MAC_TX_RD_THRSH(x) _SB_MAKEVALUE(x, S_MAC_TX_RD_THRSH) | ||
241 | #define G_MAC_TX_RD_THRSH(x) _SB_GETVALUE(x, S_MAC_TX_RD_THRSH, M_MAC_TX_RD_THRSH) | ||
242 | |||
243 | #define S_MAC_TX_RL_THRSH _SB_MAKE64(16) | ||
244 | #define M_MAC_TX_RL_THRSH _SB_MAKEMASK(4, S_MAC_TX_RL_THRSH) | ||
245 | #define V_MAC_TX_RL_THRSH(x) _SB_MAKEVALUE(x, S_MAC_TX_RL_THRSH) | ||
246 | #define G_MAC_TX_RL_THRSH(x) _SB_GETVALUE(x, S_MAC_TX_RL_THRSH, M_MAC_TX_RL_THRSH) | ||
247 | |||
248 | #define S_MAC_RX_PL_THRSH _SB_MAKE64(24) | ||
249 | #define M_MAC_RX_PL_THRSH _SB_MAKEMASK(6, S_MAC_RX_PL_THRSH) | ||
250 | #define V_MAC_RX_PL_THRSH(x) _SB_MAKEVALUE(x, S_MAC_RX_PL_THRSH) | ||
251 | #define G_MAC_RX_PL_THRSH(x) _SB_GETVALUE(x, S_MAC_RX_PL_THRSH, M_MAC_RX_PL_THRSH) | ||
252 | |||
253 | #define S_MAC_RX_RD_THRSH _SB_MAKE64(32) | ||
254 | #define M_MAC_RX_RD_THRSH _SB_MAKEMASK(6, S_MAC_RX_RD_THRSH) | ||
255 | #define V_MAC_RX_RD_THRSH(x) _SB_MAKEVALUE(x, S_MAC_RX_RD_THRSH) | ||
256 | #define G_MAC_RX_RD_THRSH(x) _SB_GETVALUE(x, S_MAC_RX_RD_THRSH, M_MAC_RX_RD_THRSH) | ||
257 | |||
258 | #define S_MAC_RX_RL_THRSH _SB_MAKE64(40) | ||
259 | #define M_MAC_RX_RL_THRSH _SB_MAKEMASK(6, S_MAC_RX_RL_THRSH) | ||
260 | #define V_MAC_RX_RL_THRSH(x) _SB_MAKEVALUE(x, S_MAC_RX_RL_THRSH) | ||
261 | #define G_MAC_RX_RL_THRSH(x) _SB_GETVALUE(x, S_MAC_RX_RL_THRSH, M_MAC_RX_RL_THRSH) | ||
262 | |||
263 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
264 | #define S_MAC_ENC_FC_THRSH _SB_MAKE64(56) | ||
265 | #define M_MAC_ENC_FC_THRSH _SB_MAKEMASK(6, S_MAC_ENC_FC_THRSH) | ||
266 | #define V_MAC_ENC_FC_THRSH(x) _SB_MAKEVALUE(x, S_MAC_ENC_FC_THRSH) | ||
267 | #define G_MAC_ENC_FC_THRSH(x) _SB_GETVALUE(x, S_MAC_ENC_FC_THRSH, M_MAC_ENC_FC_THRSH) | ||
268 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
269 | |||
270 | /* | ||
271 | * MAC Frame Configuration Registers (Table 9-15) | ||
272 | * Register: MAC_FRAME_CFG_0 | ||
273 | * Register: MAC_FRAME_CFG_1 | ||
274 | * Register: MAC_FRAME_CFG_2 | ||
275 | */ | ||
276 | |||
277 | /* XXXCGD: ??? Unused in pass2? */ | ||
278 | #define S_MAC_IFG_RX _SB_MAKE64(0) | ||
279 | #define M_MAC_IFG_RX _SB_MAKEMASK(6, S_MAC_IFG_RX) | ||
280 | #define V_MAC_IFG_RX(x) _SB_MAKEVALUE(x, S_MAC_IFG_RX) | ||
281 | #define G_MAC_IFG_RX(x) _SB_GETVALUE(x, S_MAC_IFG_RX, M_MAC_IFG_RX) | ||
282 | |||
283 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
284 | #define S_MAC_PRE_LEN _SB_MAKE64(0) | ||
285 | #define M_MAC_PRE_LEN _SB_MAKEMASK(6, S_MAC_PRE_LEN) | ||
286 | #define V_MAC_PRE_LEN(x) _SB_MAKEVALUE(x, S_MAC_PRE_LEN) | ||
287 | #define G_MAC_PRE_LEN(x) _SB_GETVALUE(x, S_MAC_PRE_LEN, M_MAC_PRE_LEN) | ||
288 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
289 | |||
290 | #define S_MAC_IFG_TX _SB_MAKE64(6) | ||
291 | #define M_MAC_IFG_TX _SB_MAKEMASK(6, S_MAC_IFG_TX) | ||
292 | #define V_MAC_IFG_TX(x) _SB_MAKEVALUE(x, S_MAC_IFG_TX) | ||
293 | #define G_MAC_IFG_TX(x) _SB_GETVALUE(x, S_MAC_IFG_TX, M_MAC_IFG_TX) | ||
294 | |||
295 | #define S_MAC_IFG_THRSH _SB_MAKE64(12) | ||
296 | #define M_MAC_IFG_THRSH _SB_MAKEMASK(6, S_MAC_IFG_THRSH) | ||
297 | #define V_MAC_IFG_THRSH(x) _SB_MAKEVALUE(x, S_MAC_IFG_THRSH) | ||
298 | #define G_MAC_IFG_THRSH(x) _SB_GETVALUE(x, S_MAC_IFG_THRSH, M_MAC_IFG_THRSH) | ||
299 | |||
300 | #define S_MAC_BACKOFF_SEL _SB_MAKE64(18) | ||
301 | #define M_MAC_BACKOFF_SEL _SB_MAKEMASK(4, S_MAC_BACKOFF_SEL) | ||
302 | #define V_MAC_BACKOFF_SEL(x) _SB_MAKEVALUE(x, S_MAC_BACKOFF_SEL) | ||
303 | #define G_MAC_BACKOFF_SEL(x) _SB_GETVALUE(x, S_MAC_BACKOFF_SEL, M_MAC_BACKOFF_SEL) | ||
304 | |||
305 | #define S_MAC_LFSR_SEED _SB_MAKE64(22) | ||
306 | #define M_MAC_LFSR_SEED _SB_MAKEMASK(8, S_MAC_LFSR_SEED) | ||
307 | #define V_MAC_LFSR_SEED(x) _SB_MAKEVALUE(x, S_MAC_LFSR_SEED) | ||
308 | #define G_MAC_LFSR_SEED(x) _SB_GETVALUE(x, S_MAC_LFSR_SEED, M_MAC_LFSR_SEED) | ||
309 | |||
310 | #define S_MAC_SLOT_SIZE _SB_MAKE64(30) | ||
311 | #define M_MAC_SLOT_SIZE _SB_MAKEMASK(10, S_MAC_SLOT_SIZE) | ||
312 | #define V_MAC_SLOT_SIZE(x) _SB_MAKEVALUE(x, S_MAC_SLOT_SIZE) | ||
313 | #define G_MAC_SLOT_SIZE(x) _SB_GETVALUE(x, S_MAC_SLOT_SIZE, M_MAC_SLOT_SIZE) | ||
314 | |||
315 | #define S_MAC_MIN_FRAMESZ _SB_MAKE64(40) | ||
316 | #define M_MAC_MIN_FRAMESZ _SB_MAKEMASK(8, S_MAC_MIN_FRAMESZ) | ||
317 | #define V_MAC_MIN_FRAMESZ(x) _SB_MAKEVALUE(x, S_MAC_MIN_FRAMESZ) | ||
318 | #define G_MAC_MIN_FRAMESZ(x) _SB_GETVALUE(x, S_MAC_MIN_FRAMESZ, M_MAC_MIN_FRAMESZ) | ||
319 | |||
320 | #define S_MAC_MAX_FRAMESZ _SB_MAKE64(48) | ||
321 | #define M_MAC_MAX_FRAMESZ _SB_MAKEMASK(16, S_MAC_MAX_FRAMESZ) | ||
322 | #define V_MAC_MAX_FRAMESZ(x) _SB_MAKEVALUE(x, S_MAC_MAX_FRAMESZ) | ||
323 | #define G_MAC_MAX_FRAMESZ(x) _SB_GETVALUE(x, S_MAC_MAX_FRAMESZ, M_MAC_MAX_FRAMESZ) | ||
324 | |||
325 | /* | ||
326 | * These constants are used to configure the fields within the Frame | ||
327 | * Configuration Register. | ||
328 | */ | ||
329 | |||
330 | #define K_MAC_IFG_RX_10 _SB_MAKE64(0) /* See table 176, not used */ | ||
331 | #define K_MAC_IFG_RX_100 _SB_MAKE64(0) | ||
332 | #define K_MAC_IFG_RX_1000 _SB_MAKE64(0) | ||
333 | |||
334 | #define K_MAC_IFG_TX_10 _SB_MAKE64(20) | ||
335 | #define K_MAC_IFG_TX_100 _SB_MAKE64(20) | ||
336 | #define K_MAC_IFG_TX_1000 _SB_MAKE64(8) | ||
337 | |||
338 | #define K_MAC_IFG_THRSH_10 _SB_MAKE64(4) | ||
339 | #define K_MAC_IFG_THRSH_100 _SB_MAKE64(4) | ||
340 | #define K_MAC_IFG_THRSH_1000 _SB_MAKE64(0) | ||
341 | |||
342 | #define K_MAC_SLOT_SIZE_10 _SB_MAKE64(0) | ||
343 | #define K_MAC_SLOT_SIZE_100 _SB_MAKE64(0) | ||
344 | #define K_MAC_SLOT_SIZE_1000 _SB_MAKE64(0) | ||
345 | |||
346 | #define V_MAC_IFG_RX_10 V_MAC_IFG_RX(K_MAC_IFG_RX_10) | ||
347 | #define V_MAC_IFG_RX_100 V_MAC_IFG_RX(K_MAC_IFG_RX_100) | ||
348 | #define V_MAC_IFG_RX_1000 V_MAC_IFG_RX(K_MAC_IFG_RX_1000) | ||
349 | |||
350 | #define V_MAC_IFG_TX_10 V_MAC_IFG_TX(K_MAC_IFG_TX_10) | ||
351 | #define V_MAC_IFG_TX_100 V_MAC_IFG_TX(K_MAC_IFG_TX_100) | ||
352 | #define V_MAC_IFG_TX_1000 V_MAC_IFG_TX(K_MAC_IFG_TX_1000) | ||
353 | |||
354 | #define V_MAC_IFG_THRSH_10 V_MAC_IFG_THRSH(K_MAC_IFG_THRSH_10) | ||
355 | #define V_MAC_IFG_THRSH_100 V_MAC_IFG_THRSH(K_MAC_IFG_THRSH_100) | ||
356 | #define V_MAC_IFG_THRSH_1000 V_MAC_IFG_THRSH(K_MAC_IFG_THRSH_1000) | ||
357 | |||
358 | #define V_MAC_SLOT_SIZE_10 V_MAC_SLOT_SIZE(K_MAC_SLOT_SIZE_10) | ||
359 | #define V_MAC_SLOT_SIZE_100 V_MAC_SLOT_SIZE(K_MAC_SLOT_SIZE_100) | ||
360 | #define V_MAC_SLOT_SIZE_1000 V_MAC_SLOT_SIZE(K_MAC_SLOT_SIZE_1000) | ||
361 | |||
362 | #define K_MAC_MIN_FRAMESZ_FIFO _SB_MAKE64(9) | ||
363 | #define K_MAC_MIN_FRAMESZ_DEFAULT _SB_MAKE64(64) | ||
364 | #define K_MAC_MAX_FRAMESZ_DEFAULT _SB_MAKE64(1518) | ||
365 | #define K_MAC_MAX_FRAMESZ_JUMBO _SB_MAKE64(9216) | ||
366 | |||
367 | #define V_MAC_MIN_FRAMESZ_FIFO V_MAC_MIN_FRAMESZ(K_MAC_MIN_FRAMESZ_FIFO) | ||
368 | #define V_MAC_MIN_FRAMESZ_DEFAULT V_MAC_MIN_FRAMESZ(K_MAC_MIN_FRAMESZ_DEFAULT) | ||
369 | #define V_MAC_MAX_FRAMESZ_DEFAULT V_MAC_MAX_FRAMESZ(K_MAC_MAX_FRAMESZ_DEFAULT) | ||
370 | #define V_MAC_MAX_FRAMESZ_JUMBO V_MAC_MAX_FRAMESZ(K_MAC_MAX_FRAMESZ_JUMBO) | ||
371 | |||
372 | /* | ||
373 | * MAC VLAN Tag Registers (Table 9-16) | ||
374 | * Register: MAC_VLANTAG_0 | ||
375 | * Register: MAC_VLANTAG_1 | ||
376 | * Register: MAC_VLANTAG_2 | ||
377 | */ | ||
378 | |||
379 | #define S_MAC_VLAN_TAG _SB_MAKE64(0) | ||
380 | #define M_MAC_VLAN_TAG _SB_MAKEMASK(32, S_MAC_VLAN_TAG) | ||
381 | #define V_MAC_VLAN_TAG(x) _SB_MAKEVALUE(x, S_MAC_VLAN_TAG) | ||
382 | #define G_MAC_VLAN_TAG(x) _SB_GETVALUE(x, S_MAC_VLAN_TAG, M_MAC_VLAN_TAG) | ||
383 | |||
384 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
385 | #define S_MAC_TX_PKT_OFFSET _SB_MAKE64(32) | ||
386 | #define M_MAC_TX_PKT_OFFSET _SB_MAKEMASK(8, S_MAC_TX_PKT_OFFSET) | ||
387 | #define V_MAC_TX_PKT_OFFSET(x) _SB_MAKEVALUE(x, S_MAC_TX_PKT_OFFSET) | ||
388 | #define G_MAC_TX_PKT_OFFSET(x) _SB_GETVALUE(x, S_MAC_TX_PKT_OFFSET, M_MAC_TX_PKT_OFFSET) | ||
389 | |||
390 | #define S_MAC_TX_CRC_OFFSET _SB_MAKE64(40) | ||
391 | #define M_MAC_TX_CRC_OFFSET _SB_MAKEMASK(8, S_MAC_TX_CRC_OFFSET) | ||
392 | #define V_MAC_TX_CRC_OFFSET(x) _SB_MAKEVALUE(x, S_MAC_TX_CRC_OFFSET) | ||
393 | #define G_MAC_TX_CRC_OFFSET(x) _SB_GETVALUE(x, S_MAC_TX_CRC_OFFSET, M_MAC_TX_CRC_OFFSET) | ||
394 | |||
395 | #define M_MAC_CH_BASE_FC_EN _SB_MAKEMASK1(48) | ||
396 | #endif /* 1250 PASS3 || 112x PASS1 */ | ||
397 | |||
398 | /* | ||
399 | * MAC Status Registers (Table 9-17) | ||
400 | * Also used for the MAC Interrupt Mask Register (Table 9-18) | ||
401 | * Register: MAC_STATUS_0 | ||
402 | * Register: MAC_STATUS_1 | ||
403 | * Register: MAC_STATUS_2 | ||
404 | * Register: MAC_INT_MASK_0 | ||
405 | * Register: MAC_INT_MASK_1 | ||
406 | * Register: MAC_INT_MASK_2 | ||
407 | */ | ||
408 | |||
409 | /* | ||
410 | * Use these constants to shift the appropriate channel | ||
411 | * into the CH0 position so the same tests can be used | ||
412 | * on each channel. | ||
413 | */ | ||
414 | |||
415 | #define S_MAC_RX_CH0 _SB_MAKE64(0) | ||
416 | #define S_MAC_RX_CH1 _SB_MAKE64(8) | ||
417 | #define S_MAC_TX_CH0 _SB_MAKE64(16) | ||
418 | #define S_MAC_TX_CH1 _SB_MAKE64(24) | ||
419 | |||
420 | #define S_MAC_TXCHANNELS _SB_MAKE64(16) /* this is 1st TX chan */ | ||
421 | #define S_MAC_CHANWIDTH _SB_MAKE64(8) /* bits between channels */ | ||
422 | |||
423 | /* | ||
424 | * These are the same as RX channel 0. The idea here | ||
425 | * is that you'll use one of the "S_" things above | ||
426 | * and pass just the six bits to a DMA-channel-specific ISR | ||
427 | */ | ||
428 | #define M_MAC_INT_CHANNEL _SB_MAKEMASK(8, 0) | ||
429 | #define M_MAC_INT_EOP_COUNT _SB_MAKEMASK1(0) | ||
430 | #define M_MAC_INT_EOP_TIMER _SB_MAKEMASK1(1) | ||
431 | #define M_MAC_INT_EOP_SEEN _SB_MAKEMASK1(2) | ||
432 | #define M_MAC_INT_HWM _SB_MAKEMASK1(3) | ||
433 | #define M_MAC_INT_LWM _SB_MAKEMASK1(4) | ||
434 | #define M_MAC_INT_DSCR _SB_MAKEMASK1(5) | ||
435 | #define M_MAC_INT_ERR _SB_MAKEMASK1(6) | ||
436 | #define M_MAC_INT_DZERO _SB_MAKEMASK1(7) /* only for TX channels */ | ||
437 | #define M_MAC_INT_DROP _SB_MAKEMASK1(7) /* only for RX channels */ | ||
438 | |||
439 | /* | ||
440 | * In the following definitions we use ch (0/1) and txrx (TX=1, RX=0, see | ||
441 | * also DMA_TX/DMA_RX in sb_regs.h). | ||
442 | */ | ||
443 | #define S_MAC_STATUS_CH_OFFSET(ch, txrx) _SB_MAKE64(((ch) + 2 * (txrx)) * S_MAC_CHANWIDTH) | ||
444 | |||
445 | #define M_MAC_STATUS_CHANNEL(ch, txrx) _SB_MAKEVALUE(_SB_MAKEMASK(8, 0), S_MAC_STATUS_CH_OFFSET(ch, txrx)) | ||
446 | #define M_MAC_STATUS_EOP_COUNT(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_EOP_COUNT, S_MAC_STATUS_CH_OFFSET(ch, txrx)) | ||
447 | #define M_MAC_STATUS_EOP_TIMER(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_EOP_TIMER, S_MAC_STATUS_CH_OFFSET(ch, txrx)) | ||
448 | #define M_MAC_STATUS_EOP_SEEN(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_EOP_SEEN, S_MAC_STATUS_CH_OFFSET(ch, txrx)) | ||
449 | #define M_MAC_STATUS_HWM(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_HWM, S_MAC_STATUS_CH_OFFSET(ch, txrx)) | ||
450 | #define M_MAC_STATUS_LWM(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_LWM, S_MAC_STATUS_CH_OFFSET(ch, txrx)) | ||
451 | #define M_MAC_STATUS_DSCR(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_DSCR, S_MAC_STATUS_CH_OFFSET(ch, txrx)) | ||
452 | #define M_MAC_STATUS_ERR(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_ERR, S_MAC_STATUS_CH_OFFSET(ch, txrx)) | ||
453 | #define M_MAC_STATUS_DZERO(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_DZERO, S_MAC_STATUS_CH_OFFSET(ch, txrx)) | ||
454 | #define M_MAC_STATUS_DROP(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_DROP, S_MAC_STATUS_CH_OFFSET(ch, txrx)) | ||
455 | #define M_MAC_STATUS_OTHER_ERR _SB_MAKEVALUE(_SB_MAKEMASK(7, 0), 40) | ||
456 | |||
457 | |||
458 | #define M_MAC_RX_UNDRFL _SB_MAKEMASK1(40) | ||
459 | #define M_MAC_RX_OVRFL _SB_MAKEMASK1(41) | ||
460 | #define M_MAC_TX_UNDRFL _SB_MAKEMASK1(42) | ||
461 | #define M_MAC_TX_OVRFL _SB_MAKEMASK1(43) | ||
462 | #define M_MAC_LTCOL_ERR _SB_MAKEMASK1(44) | ||
463 | #define M_MAC_EXCOL_ERR _SB_MAKEMASK1(45) | ||
464 | #define M_MAC_CNTR_OVRFL_ERR _SB_MAKEMASK1(46) | ||
465 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
466 | #define M_MAC_SPLIT_EN _SB_MAKEMASK1(47) /* interrupt mask only */ | ||
467 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
468 | |||
469 | #define S_MAC_COUNTER_ADDR _SB_MAKE64(47) | ||
470 | #define M_MAC_COUNTER_ADDR _SB_MAKEMASK(5, S_MAC_COUNTER_ADDR) | ||
471 | #define V_MAC_COUNTER_ADDR(x) _SB_MAKEVALUE(x, S_MAC_COUNTER_ADDR) | ||
472 | #define G_MAC_COUNTER_ADDR(x) _SB_GETVALUE(x, S_MAC_COUNTER_ADDR, M_MAC_COUNTER_ADDR) | ||
473 | |||
474 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
475 | #define M_MAC_TX_PAUSE_ON _SB_MAKEMASK1(52) | ||
476 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
477 | |||
478 | /* | ||
479 | * MAC Fifo Pointer Registers (Table 9-19) [Debug register] | ||
480 | * Register: MAC_FIFO_PTRS_0 | ||
481 | * Register: MAC_FIFO_PTRS_1 | ||
482 | * Register: MAC_FIFO_PTRS_2 | ||
483 | */ | ||
484 | |||
485 | #define S_MAC_TX_WRPTR _SB_MAKE64(0) | ||
486 | #define M_MAC_TX_WRPTR _SB_MAKEMASK(6, S_MAC_TX_WRPTR) | ||
487 | #define V_MAC_TX_WRPTR(x) _SB_MAKEVALUE(x, S_MAC_TX_WRPTR) | ||
488 | #define G_MAC_TX_WRPTR(x) _SB_GETVALUE(x, S_MAC_TX_WRPTR, M_MAC_TX_WRPTR) | ||
489 | |||
490 | #define S_MAC_TX_RDPTR _SB_MAKE64(8) | ||
491 | #define M_MAC_TX_RDPTR _SB_MAKEMASK(6, S_MAC_TX_RDPTR) | ||
492 | #define V_MAC_TX_RDPTR(x) _SB_MAKEVALUE(x, S_MAC_TX_RDPTR) | ||
493 | #define G_MAC_TX_RDPTR(x) _SB_GETVALUE(x, S_MAC_TX_RDPTR, M_MAC_TX_RDPTR) | ||
494 | |||
495 | #define S_MAC_RX_WRPTR _SB_MAKE64(16) | ||
496 | #define M_MAC_RX_WRPTR _SB_MAKEMASK(6, S_MAC_RX_WRPTR) | ||
497 | #define V_MAC_RX_WRPTR(x) _SB_MAKEVALUE(x, S_MAC_RX_WRPTR) | ||
498 | #define G_MAC_RX_WRPTR(x) _SB_GETVALUE(x, S_MAC_RX_WRPTR, M_MAC_TX_WRPTR) | ||
499 | |||
500 | #define S_MAC_RX_RDPTR _SB_MAKE64(24) | ||
501 | #define M_MAC_RX_RDPTR _SB_MAKEMASK(6, S_MAC_RX_RDPTR) | ||
502 | #define V_MAC_RX_RDPTR(x) _SB_MAKEVALUE(x, S_MAC_RX_RDPTR) | ||
503 | #define G_MAC_RX_RDPTR(x) _SB_GETVALUE(x, S_MAC_RX_RDPTR, M_MAC_TX_RDPTR) | ||
504 | |||
505 | /* | ||
506 | * MAC Fifo End Of Packet Count Registers (Table 9-20) [Debug register] | ||
507 | * Register: MAC_EOPCNT_0 | ||
508 | * Register: MAC_EOPCNT_1 | ||
509 | * Register: MAC_EOPCNT_2 | ||
510 | */ | ||
511 | |||
512 | #define S_MAC_TX_EOP_COUNTER _SB_MAKE64(0) | ||
513 | #define M_MAC_TX_EOP_COUNTER _SB_MAKEMASK(6, S_MAC_TX_EOP_COUNTER) | ||
514 | #define V_MAC_TX_EOP_COUNTER(x) _SB_MAKEVALUE(x, S_MAC_TX_EOP_COUNTER) | ||
515 | #define G_MAC_TX_EOP_COUNTER(x) _SB_GETVALUE(x, S_MAC_TX_EOP_COUNTER, M_MAC_TX_EOP_COUNTER) | ||
516 | |||
517 | #define S_MAC_RX_EOP_COUNTER _SB_MAKE64(8) | ||
518 | #define M_MAC_RX_EOP_COUNTER _SB_MAKEMASK(6, S_MAC_RX_EOP_COUNTER) | ||
519 | #define V_MAC_RX_EOP_COUNTER(x) _SB_MAKEVALUE(x, S_MAC_RX_EOP_COUNTER) | ||
520 | #define G_MAC_RX_EOP_COUNTER(x) _SB_GETVALUE(x, S_MAC_RX_EOP_COUNTER, M_MAC_RX_EOP_COUNTER) | ||
521 | |||
522 | /* | ||
523 | * MAC Recieve Address Filter Exact Match Registers (Table 9-21) | ||
524 | * Registers: MAC_ADDR0_0 through MAC_ADDR7_0 | ||
525 | * Registers: MAC_ADDR0_1 through MAC_ADDR7_1 | ||
526 | * Registers: MAC_ADDR0_2 through MAC_ADDR7_2 | ||
527 | */ | ||
528 | |||
529 | /* No bitfields */ | ||
530 | |||
531 | /* | ||
532 | * MAC Receive Address Filter Mask Registers | ||
533 | * Registers: MAC_ADDRMASK0_0 and MAC_ADDRMASK0_1 | ||
534 | * Registers: MAC_ADDRMASK1_0 and MAC_ADDRMASK1_1 | ||
535 | * Registers: MAC_ADDRMASK2_0 and MAC_ADDRMASK2_1 | ||
536 | */ | ||
537 | |||
538 | /* No bitfields */ | ||
539 | |||
540 | /* | ||
541 | * MAC Recieve Address Filter Hash Match Registers (Table 9-22) | ||
542 | * Registers: MAC_HASH0_0 through MAC_HASH7_0 | ||
543 | * Registers: MAC_HASH0_1 through MAC_HASH7_1 | ||
544 | * Registers: MAC_HASH0_2 through MAC_HASH7_2 | ||
545 | */ | ||
546 | |||
547 | /* No bitfields */ | ||
548 | |||
549 | /* | ||
550 | * MAC Transmit Source Address Registers (Table 9-23) | ||
551 | * Register: MAC_ETHERNET_ADDR_0 | ||
552 | * Register: MAC_ETHERNET_ADDR_1 | ||
553 | * Register: MAC_ETHERNET_ADDR_2 | ||
554 | */ | ||
555 | |||
556 | /* No bitfields */ | ||
557 | |||
558 | /* | ||
559 | * MAC Packet Type Configuration Register | ||
560 | * Register: MAC_TYPE_CFG_0 | ||
561 | * Register: MAC_TYPE_CFG_1 | ||
562 | * Register: MAC_TYPE_CFG_2 | ||
563 | */ | ||
564 | |||
565 | #define S_TYPECFG_TYPESIZE _SB_MAKE64(16) | ||
566 | |||
567 | #define S_TYPECFG_TYPE0 _SB_MAKE64(0) | ||
568 | #define M_TYPECFG_TYPE0 _SB_MAKEMASK(16, S_TYPECFG_TYPE0) | ||
569 | #define V_TYPECFG_TYPE0(x) _SB_MAKEVALUE(x, S_TYPECFG_TYPE0) | ||
570 | #define G_TYPECFG_TYPE0(x) _SB_GETVALUE(x, S_TYPECFG_TYPE0, M_TYPECFG_TYPE0) | ||
571 | |||
572 | #define S_TYPECFG_TYPE1 _SB_MAKE64(0) | ||
573 | #define M_TYPECFG_TYPE1 _SB_MAKEMASK(16, S_TYPECFG_TYPE1) | ||
574 | #define V_TYPECFG_TYPE1(x) _SB_MAKEVALUE(x, S_TYPECFG_TYPE1) | ||
575 | #define G_TYPECFG_TYPE1(x) _SB_GETVALUE(x, S_TYPECFG_TYPE1, M_TYPECFG_TYPE1) | ||
576 | |||
577 | #define S_TYPECFG_TYPE2 _SB_MAKE64(0) | ||
578 | #define M_TYPECFG_TYPE2 _SB_MAKEMASK(16, S_TYPECFG_TYPE2) | ||
579 | #define V_TYPECFG_TYPE2(x) _SB_MAKEVALUE(x, S_TYPECFG_TYPE2) | ||
580 | #define G_TYPECFG_TYPE2(x) _SB_GETVALUE(x, S_TYPECFG_TYPE2, M_TYPECFG_TYPE2) | ||
581 | |||
582 | #define S_TYPECFG_TYPE3 _SB_MAKE64(0) | ||
583 | #define M_TYPECFG_TYPE3 _SB_MAKEMASK(16, S_TYPECFG_TYPE3) | ||
584 | #define V_TYPECFG_TYPE3(x) _SB_MAKEVALUE(x, S_TYPECFG_TYPE3) | ||
585 | #define G_TYPECFG_TYPE3(x) _SB_GETVALUE(x, S_TYPECFG_TYPE3, M_TYPECFG_TYPE3) | ||
586 | |||
587 | /* | ||
588 | * MAC Receive Address Filter Control Registers (Table 9-24) | ||
589 | * Register: MAC_ADFILTER_CFG_0 | ||
590 | * Register: MAC_ADFILTER_CFG_1 | ||
591 | * Register: MAC_ADFILTER_CFG_2 | ||
592 | */ | ||
593 | |||
594 | #define M_MAC_ALLPKT_EN _SB_MAKEMASK1(0) | ||
595 | #define M_MAC_UCAST_EN _SB_MAKEMASK1(1) | ||
596 | #define M_MAC_UCAST_INV _SB_MAKEMASK1(2) | ||
597 | #define M_MAC_MCAST_EN _SB_MAKEMASK1(3) | ||
598 | #define M_MAC_MCAST_INV _SB_MAKEMASK1(4) | ||
599 | #define M_MAC_BCAST_EN _SB_MAKEMASK1(5) | ||
600 | #define M_MAC_DIRECT_INV _SB_MAKEMASK1(6) | ||
601 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
602 | #define M_MAC_ALLMCAST_EN _SB_MAKEMASK1(7) | ||
603 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
604 | |||
605 | #define S_MAC_IPHDR_OFFSET _SB_MAKE64(8) | ||
606 | #define M_MAC_IPHDR_OFFSET _SB_MAKEMASK(8, S_MAC_IPHDR_OFFSET) | ||
607 | #define V_MAC_IPHDR_OFFSET(x) _SB_MAKEVALUE(x, S_MAC_IPHDR_OFFSET) | ||
608 | #define G_MAC_IPHDR_OFFSET(x) _SB_GETVALUE(x, S_MAC_IPHDR_OFFSET, M_MAC_IPHDR_OFFSET) | ||
609 | |||
610 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
611 | #define S_MAC_RX_CRC_OFFSET _SB_MAKE64(16) | ||
612 | #define M_MAC_RX_CRC_OFFSET _SB_MAKEMASK(8, S_MAC_RX_CRC_OFFSET) | ||
613 | #define V_MAC_RX_CRC_OFFSET(x) _SB_MAKEVALUE(x, S_MAC_RX_CRC_OFFSET) | ||
614 | #define G_MAC_RX_CRC_OFFSET(x) _SB_GETVALUE(x, S_MAC_RX_CRC_OFFSET, M_MAC_RX_CRC_OFFSET) | ||
615 | |||
616 | #define S_MAC_RX_PKT_OFFSET _SB_MAKE64(24) | ||
617 | #define M_MAC_RX_PKT_OFFSET _SB_MAKEMASK(8, S_MAC_RX_PKT_OFFSET) | ||
618 | #define V_MAC_RX_PKT_OFFSET(x) _SB_MAKEVALUE(x, S_MAC_RX_PKT_OFFSET) | ||
619 | #define G_MAC_RX_PKT_OFFSET(x) _SB_GETVALUE(x, S_MAC_RX_PKT_OFFSET, M_MAC_RX_PKT_OFFSET) | ||
620 | |||
621 | #define M_MAC_FWDPAUSE_EN _SB_MAKEMASK1(32) | ||
622 | #define M_MAC_VLAN_DET_EN _SB_MAKEMASK1(33) | ||
623 | |||
624 | #define S_MAC_RX_CH_MSN_SEL _SB_MAKE64(34) | ||
625 | #define M_MAC_RX_CH_MSN_SEL _SB_MAKEMASK(8, S_MAC_RX_CH_MSN_SEL) | ||
626 | #define V_MAC_RX_CH_MSN_SEL(x) _SB_MAKEVALUE(x, S_MAC_RX_CH_MSN_SEL) | ||
627 | #define G_MAC_RX_CH_MSN_SEL(x) _SB_GETVALUE(x, S_MAC_RX_CH_MSN_SEL, M_MAC_RX_CH_MSN_SEL) | ||
628 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
629 | |||
630 | /* | ||
631 | * MAC Receive Channel Select Registers (Table 9-25) | ||
632 | */ | ||
633 | |||
634 | /* no bitfields */ | ||
635 | |||
636 | /* | ||
637 | * MAC MII Management Interface Registers (Table 9-26) | ||
638 | * Register: MAC_MDIO_0 | ||
639 | * Register: MAC_MDIO_1 | ||
640 | * Register: MAC_MDIO_2 | ||
641 | */ | ||
642 | |||
643 | #define S_MAC_MDC 0 | ||
644 | #define S_MAC_MDIO_DIR 1 | ||
645 | #define S_MAC_MDIO_OUT 2 | ||
646 | #define S_MAC_GENC 3 | ||
647 | #define S_MAC_MDIO_IN 4 | ||
648 | |||
649 | #define M_MAC_MDC _SB_MAKEMASK1(S_MAC_MDC) | ||
650 | #define M_MAC_MDIO_DIR _SB_MAKEMASK1(S_MAC_MDIO_DIR) | ||
651 | #define M_MAC_MDIO_DIR_INPUT _SB_MAKEMASK1(S_MAC_MDIO_DIR) | ||
652 | #define M_MAC_MDIO_OUT _SB_MAKEMASK1(S_MAC_MDIO_OUT) | ||
653 | #define M_MAC_GENC _SB_MAKEMASK1(S_MAC_GENC) | ||
654 | #define M_MAC_MDIO_IN _SB_MAKEMASK1(S_MAC_MDIO_IN) | ||
655 | |||
656 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_mc.h b/include/asm-mips/sibyte/sb1250_mc.h deleted file mode 100644 index 1eb1b5a88736..000000000000 --- a/include/asm-mips/sibyte/sb1250_mc.h +++ /dev/null | |||
@@ -1,550 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * Memory Controller constants File: sb1250_mc.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * programming the memory controller. | ||
8 | * | ||
9 | * SB1250 specification level: User's manual 1/02/02 | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000, 2001, 2002, 2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _SB1250_MC_H | ||
34 | #define _SB1250_MC_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | /* | ||
39 | * Memory Channel Config Register (table 6-14) | ||
40 | */ | ||
41 | |||
42 | #define S_MC_RESERVED0 0 | ||
43 | #define M_MC_RESERVED0 _SB_MAKEMASK(8, S_MC_RESERVED0) | ||
44 | |||
45 | #define S_MC_CHANNEL_SEL 8 | ||
46 | #define M_MC_CHANNEL_SEL _SB_MAKEMASK(8, S_MC_CHANNEL_SEL) | ||
47 | #define V_MC_CHANNEL_SEL(x) _SB_MAKEVALUE(x, S_MC_CHANNEL_SEL) | ||
48 | #define G_MC_CHANNEL_SEL(x) _SB_GETVALUE(x, S_MC_CHANNEL_SEL, M_MC_CHANNEL_SEL) | ||
49 | |||
50 | #define S_MC_BANK0_MAP 16 | ||
51 | #define M_MC_BANK0_MAP _SB_MAKEMASK(4, S_MC_BANK0_MAP) | ||
52 | #define V_MC_BANK0_MAP(x) _SB_MAKEVALUE(x, S_MC_BANK0_MAP) | ||
53 | #define G_MC_BANK0_MAP(x) _SB_GETVALUE(x, S_MC_BANK0_MAP, M_MC_BANK0_MAP) | ||
54 | |||
55 | #define K_MC_BANK0_MAP_DEFAULT 0x00 | ||
56 | #define V_MC_BANK0_MAP_DEFAULT V_MC_BANK0_MAP(K_MC_BANK0_MAP_DEFAULT) | ||
57 | |||
58 | #define S_MC_BANK1_MAP 20 | ||
59 | #define M_MC_BANK1_MAP _SB_MAKEMASK(4, S_MC_BANK1_MAP) | ||
60 | #define V_MC_BANK1_MAP(x) _SB_MAKEVALUE(x, S_MC_BANK1_MAP) | ||
61 | #define G_MC_BANK1_MAP(x) _SB_GETVALUE(x, S_MC_BANK1_MAP, M_MC_BANK1_MAP) | ||
62 | |||
63 | #define K_MC_BANK1_MAP_DEFAULT 0x08 | ||
64 | #define V_MC_BANK1_MAP_DEFAULT V_MC_BANK1_MAP(K_MC_BANK1_MAP_DEFAULT) | ||
65 | |||
66 | #define S_MC_BANK2_MAP 24 | ||
67 | #define M_MC_BANK2_MAP _SB_MAKEMASK(4, S_MC_BANK2_MAP) | ||
68 | #define V_MC_BANK2_MAP(x) _SB_MAKEVALUE(x, S_MC_BANK2_MAP) | ||
69 | #define G_MC_BANK2_MAP(x) _SB_GETVALUE(x, S_MC_BANK2_MAP, M_MC_BANK2_MAP) | ||
70 | |||
71 | #define K_MC_BANK2_MAP_DEFAULT 0x09 | ||
72 | #define V_MC_BANK2_MAP_DEFAULT V_MC_BANK2_MAP(K_MC_BANK2_MAP_DEFAULT) | ||
73 | |||
74 | #define S_MC_BANK3_MAP 28 | ||
75 | #define M_MC_BANK3_MAP _SB_MAKEMASK(4, S_MC_BANK3_MAP) | ||
76 | #define V_MC_BANK3_MAP(x) _SB_MAKEVALUE(x, S_MC_BANK3_MAP) | ||
77 | #define G_MC_BANK3_MAP(x) _SB_GETVALUE(x, S_MC_BANK3_MAP, M_MC_BANK3_MAP) | ||
78 | |||
79 | #define K_MC_BANK3_MAP_DEFAULT 0x0C | ||
80 | #define V_MC_BANK3_MAP_DEFAULT V_MC_BANK3_MAP(K_MC_BANK3_MAP_DEFAULT) | ||
81 | |||
82 | #define M_MC_RESERVED1 _SB_MAKEMASK(8, 32) | ||
83 | |||
84 | #define S_MC_QUEUE_SIZE 40 | ||
85 | #define M_MC_QUEUE_SIZE _SB_MAKEMASK(4, S_MC_QUEUE_SIZE) | ||
86 | #define V_MC_QUEUE_SIZE(x) _SB_MAKEVALUE(x, S_MC_QUEUE_SIZE) | ||
87 | #define G_MC_QUEUE_SIZE(x) _SB_GETVALUE(x, S_MC_QUEUE_SIZE, M_MC_QUEUE_SIZE) | ||
88 | #define V_MC_QUEUE_SIZE_DEFAULT V_MC_QUEUE_SIZE(0x0A) | ||
89 | |||
90 | #define S_MC_AGE_LIMIT 44 | ||
91 | #define M_MC_AGE_LIMIT _SB_MAKEMASK(4, S_MC_AGE_LIMIT) | ||
92 | #define V_MC_AGE_LIMIT(x) _SB_MAKEVALUE(x, S_MC_AGE_LIMIT) | ||
93 | #define G_MC_AGE_LIMIT(x) _SB_GETVALUE(x, S_MC_AGE_LIMIT, M_MC_AGE_LIMIT) | ||
94 | #define V_MC_AGE_LIMIT_DEFAULT V_MC_AGE_LIMIT(8) | ||
95 | |||
96 | #define S_MC_WR_LIMIT 48 | ||
97 | #define M_MC_WR_LIMIT _SB_MAKEMASK(4, S_MC_WR_LIMIT) | ||
98 | #define V_MC_WR_LIMIT(x) _SB_MAKEVALUE(x, S_MC_WR_LIMIT) | ||
99 | #define G_MC_WR_LIMIT(x) _SB_GETVALUE(x, S_MC_WR_LIMIT, M_MC_WR_LIMIT) | ||
100 | #define V_MC_WR_LIMIT_DEFAULT V_MC_WR_LIMIT(5) | ||
101 | |||
102 | #define M_MC_IOB1HIGHPRIORITY _SB_MAKEMASK1(52) | ||
103 | |||
104 | #define M_MC_RESERVED2 _SB_MAKEMASK(3, 53) | ||
105 | |||
106 | #define S_MC_CS_MODE 56 | ||
107 | #define M_MC_CS_MODE _SB_MAKEMASK(4, S_MC_CS_MODE) | ||
108 | #define V_MC_CS_MODE(x) _SB_MAKEVALUE(x, S_MC_CS_MODE) | ||
109 | #define G_MC_CS_MODE(x) _SB_GETVALUE(x, S_MC_CS_MODE, M_MC_CS_MODE) | ||
110 | |||
111 | #define K_MC_CS_MODE_MSB_CS 0 | ||
112 | #define K_MC_CS_MODE_INTLV_CS 15 | ||
113 | #define K_MC_CS_MODE_MIXED_CS_10 12 | ||
114 | #define K_MC_CS_MODE_MIXED_CS_30 6 | ||
115 | #define K_MC_CS_MODE_MIXED_CS_32 3 | ||
116 | |||
117 | #define V_MC_CS_MODE_MSB_CS V_MC_CS_MODE(K_MC_CS_MODE_MSB_CS) | ||
118 | #define V_MC_CS_MODE_INTLV_CS V_MC_CS_MODE(K_MC_CS_MODE_INTLV_CS) | ||
119 | #define V_MC_CS_MODE_MIXED_CS_10 V_MC_CS_MODE(K_MC_CS_MODE_MIXED_CS_10) | ||
120 | #define V_MC_CS_MODE_MIXED_CS_30 V_MC_CS_MODE(K_MC_CS_MODE_MIXED_CS_30) | ||
121 | #define V_MC_CS_MODE_MIXED_CS_32 V_MC_CS_MODE(K_MC_CS_MODE_MIXED_CS_32) | ||
122 | |||
123 | #define M_MC_ECC_DISABLE _SB_MAKEMASK1(60) | ||
124 | #define M_MC_BERR_DISABLE _SB_MAKEMASK1(61) | ||
125 | #define M_MC_FORCE_SEQ _SB_MAKEMASK1(62) | ||
126 | #define M_MC_DEBUG _SB_MAKEMASK1(63) | ||
127 | |||
128 | #define V_MC_CONFIG_DEFAULT V_MC_WR_LIMIT_DEFAULT | V_MC_AGE_LIMIT_DEFAULT | \ | ||
129 | V_MC_BANK0_MAP_DEFAULT | V_MC_BANK1_MAP_DEFAULT | \ | ||
130 | V_MC_BANK2_MAP_DEFAULT | V_MC_BANK3_MAP_DEFAULT | V_MC_CHANNEL_SEL(0) | \ | ||
131 | M_MC_IOB1HIGHPRIORITY | V_MC_QUEUE_SIZE_DEFAULT | ||
132 | |||
133 | |||
134 | /* | ||
135 | * Memory clock config register (Table 6-15) | ||
136 | * | ||
137 | * Note: this field has been updated to be consistent with the errata to 0.2 | ||
138 | */ | ||
139 | |||
140 | #define S_MC_CLK_RATIO 0 | ||
141 | #define M_MC_CLK_RATIO _SB_MAKEMASK(4, S_MC_CLK_RATIO) | ||
142 | #define V_MC_CLK_RATIO(x) _SB_MAKEVALUE(x, S_MC_CLK_RATIO) | ||
143 | #define G_MC_CLK_RATIO(x) _SB_GETVALUE(x, S_MC_CLK_RATIO, M_MC_CLK_RATIO) | ||
144 | |||
145 | #define K_MC_CLK_RATIO_2X 4 | ||
146 | #define K_MC_CLK_RATIO_25X 5 | ||
147 | #define K_MC_CLK_RATIO_3X 6 | ||
148 | #define K_MC_CLK_RATIO_35X 7 | ||
149 | #define K_MC_CLK_RATIO_4X 8 | ||
150 | #define K_MC_CLK_RATIO_45X 9 | ||
151 | |||
152 | #define V_MC_CLK_RATIO_2X V_MC_CLK_RATIO(K_MC_CLK_RATIO_2X) | ||
153 | #define V_MC_CLK_RATIO_25X V_MC_CLK_RATIO(K_MC_CLK_RATIO_25X) | ||
154 | #define V_MC_CLK_RATIO_3X V_MC_CLK_RATIO(K_MC_CLK_RATIO_3X) | ||
155 | #define V_MC_CLK_RATIO_35X V_MC_CLK_RATIO(K_MC_CLK_RATIO_35X) | ||
156 | #define V_MC_CLK_RATIO_4X V_MC_CLK_RATIO(K_MC_CLK_RATIO_4X) | ||
157 | #define V_MC_CLK_RATIO_45X V_MC_CLK_RATIO(K_MC_CLK_RATIO_45X) | ||
158 | #define V_MC_CLK_RATIO_DEFAULT V_MC_CLK_RATIO_25X | ||
159 | |||
160 | #define S_MC_REF_RATE 8 | ||
161 | #define M_MC_REF_RATE _SB_MAKEMASK(8, S_MC_REF_RATE) | ||
162 | #define V_MC_REF_RATE(x) _SB_MAKEVALUE(x, S_MC_REF_RATE) | ||
163 | #define G_MC_REF_RATE(x) _SB_GETVALUE(x, S_MC_REF_RATE, M_MC_REF_RATE) | ||
164 | |||
165 | #define K_MC_REF_RATE_100MHz 0x62 | ||
166 | #define K_MC_REF_RATE_133MHz 0x81 | ||
167 | #define K_MC_REF_RATE_200MHz 0xC4 | ||
168 | |||
169 | #define V_MC_REF_RATE_100MHz V_MC_REF_RATE(K_MC_REF_RATE_100MHz) | ||
170 | #define V_MC_REF_RATE_133MHz V_MC_REF_RATE(K_MC_REF_RATE_133MHz) | ||
171 | #define V_MC_REF_RATE_200MHz V_MC_REF_RATE(K_MC_REF_RATE_200MHz) | ||
172 | #define V_MC_REF_RATE_DEFAULT V_MC_REF_RATE_100MHz | ||
173 | |||
174 | #define S_MC_CLOCK_DRIVE 16 | ||
175 | #define M_MC_CLOCK_DRIVE _SB_MAKEMASK(4, S_MC_CLOCK_DRIVE) | ||
176 | #define V_MC_CLOCK_DRIVE(x) _SB_MAKEVALUE(x, S_MC_CLOCK_DRIVE) | ||
177 | #define G_MC_CLOCK_DRIVE(x) _SB_GETVALUE(x, S_MC_CLOCK_DRIVE, M_MC_CLOCK_DRIVE) | ||
178 | #define V_MC_CLOCK_DRIVE_DEFAULT V_MC_CLOCK_DRIVE(0xF) | ||
179 | |||
180 | #define S_MC_DATA_DRIVE 20 | ||
181 | #define M_MC_DATA_DRIVE _SB_MAKEMASK(4, S_MC_DATA_DRIVE) | ||
182 | #define V_MC_DATA_DRIVE(x) _SB_MAKEVALUE(x, S_MC_DATA_DRIVE) | ||
183 | #define G_MC_DATA_DRIVE(x) _SB_GETVALUE(x, S_MC_DATA_DRIVE, M_MC_DATA_DRIVE) | ||
184 | #define V_MC_DATA_DRIVE_DEFAULT V_MC_DATA_DRIVE(0x0) | ||
185 | |||
186 | #define S_MC_ADDR_DRIVE 24 | ||
187 | #define M_MC_ADDR_DRIVE _SB_MAKEMASK(4, S_MC_ADDR_DRIVE) | ||
188 | #define V_MC_ADDR_DRIVE(x) _SB_MAKEVALUE(x, S_MC_ADDR_DRIVE) | ||
189 | #define G_MC_ADDR_DRIVE(x) _SB_GETVALUE(x, S_MC_ADDR_DRIVE, M_MC_ADDR_DRIVE) | ||
190 | #define V_MC_ADDR_DRIVE_DEFAULT V_MC_ADDR_DRIVE(0x0) | ||
191 | |||
192 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
193 | #define M_MC_REF_DISABLE _SB_MAKEMASK1(30) | ||
194 | #endif /* 1250 PASS3 || 112x PASS1 */ | ||
195 | |||
196 | #define M_MC_DLL_BYPASS _SB_MAKEMASK1(31) | ||
197 | |||
198 | #define S_MC_DQI_SKEW 32 | ||
199 | #define M_MC_DQI_SKEW _SB_MAKEMASK(8, S_MC_DQI_SKEW) | ||
200 | #define V_MC_DQI_SKEW(x) _SB_MAKEVALUE(x, S_MC_DQI_SKEW) | ||
201 | #define G_MC_DQI_SKEW(x) _SB_GETVALUE(x, S_MC_DQI_SKEW, M_MC_DQI_SKEW) | ||
202 | #define V_MC_DQI_SKEW_DEFAULT V_MC_DQI_SKEW(0) | ||
203 | |||
204 | #define S_MC_DQO_SKEW 40 | ||
205 | #define M_MC_DQO_SKEW _SB_MAKEMASK(8, S_MC_DQO_SKEW) | ||
206 | #define V_MC_DQO_SKEW(x) _SB_MAKEVALUE(x, S_MC_DQO_SKEW) | ||
207 | #define G_MC_DQO_SKEW(x) _SB_GETVALUE(x, S_MC_DQO_SKEW, M_MC_DQO_SKEW) | ||
208 | #define V_MC_DQO_SKEW_DEFAULT V_MC_DQO_SKEW(0) | ||
209 | |||
210 | #define S_MC_ADDR_SKEW 48 | ||
211 | #define M_MC_ADDR_SKEW _SB_MAKEMASK(8, S_MC_ADDR_SKEW) | ||
212 | #define V_MC_ADDR_SKEW(x) _SB_MAKEVALUE(x, S_MC_ADDR_SKEW) | ||
213 | #define G_MC_ADDR_SKEW(x) _SB_GETVALUE(x, S_MC_ADDR_SKEW, M_MC_ADDR_SKEW) | ||
214 | #define V_MC_ADDR_SKEW_DEFAULT V_MC_ADDR_SKEW(0x0F) | ||
215 | |||
216 | #define S_MC_DLL_DEFAULT 56 | ||
217 | #define M_MC_DLL_DEFAULT _SB_MAKEMASK(8, S_MC_DLL_DEFAULT) | ||
218 | #define V_MC_DLL_DEFAULT(x) _SB_MAKEVALUE(x, S_MC_DLL_DEFAULT) | ||
219 | #define G_MC_DLL_DEFAULT(x) _SB_GETVALUE(x, S_MC_DLL_DEFAULT, M_MC_DLL_DEFAULT) | ||
220 | #define V_MC_DLL_DEFAULT_DEFAULT V_MC_DLL_DEFAULT(0x10) | ||
221 | |||
222 | #define V_MC_CLKCONFIG_DEFAULT V_MC_DLL_DEFAULT_DEFAULT | \ | ||
223 | V_MC_ADDR_SKEW_DEFAULT | \ | ||
224 | V_MC_DQO_SKEW_DEFAULT | \ | ||
225 | V_MC_DQI_SKEW_DEFAULT | \ | ||
226 | V_MC_ADDR_DRIVE_DEFAULT | \ | ||
227 | V_MC_DATA_DRIVE_DEFAULT | \ | ||
228 | V_MC_CLOCK_DRIVE_DEFAULT | \ | ||
229 | V_MC_REF_RATE_DEFAULT | ||
230 | |||
231 | |||
232 | |||
233 | /* | ||
234 | * DRAM Command Register (Table 6-13) | ||
235 | */ | ||
236 | |||
237 | #define S_MC_COMMAND 0 | ||
238 | #define M_MC_COMMAND _SB_MAKEMASK(4, S_MC_COMMAND) | ||
239 | #define V_MC_COMMAND(x) _SB_MAKEVALUE(x, S_MC_COMMAND) | ||
240 | #define G_MC_COMMAND(x) _SB_GETVALUE(x, S_MC_COMMAND, M_MC_COMMAND) | ||
241 | |||
242 | #define K_MC_COMMAND_EMRS 0 | ||
243 | #define K_MC_COMMAND_MRS 1 | ||
244 | #define K_MC_COMMAND_PRE 2 | ||
245 | #define K_MC_COMMAND_AR 3 | ||
246 | #define K_MC_COMMAND_SETRFSH 4 | ||
247 | #define K_MC_COMMAND_CLRRFSH 5 | ||
248 | #define K_MC_COMMAND_SETPWRDN 6 | ||
249 | #define K_MC_COMMAND_CLRPWRDN 7 | ||
250 | |||
251 | #define V_MC_COMMAND_EMRS V_MC_COMMAND(K_MC_COMMAND_EMRS) | ||
252 | #define V_MC_COMMAND_MRS V_MC_COMMAND(K_MC_COMMAND_MRS) | ||
253 | #define V_MC_COMMAND_PRE V_MC_COMMAND(K_MC_COMMAND_PRE) | ||
254 | #define V_MC_COMMAND_AR V_MC_COMMAND(K_MC_COMMAND_AR) | ||
255 | #define V_MC_COMMAND_SETRFSH V_MC_COMMAND(K_MC_COMMAND_SETRFSH) | ||
256 | #define V_MC_COMMAND_CLRRFSH V_MC_COMMAND(K_MC_COMMAND_CLRRFSH) | ||
257 | #define V_MC_COMMAND_SETPWRDN V_MC_COMMAND(K_MC_COMMAND_SETPWRDN) | ||
258 | #define V_MC_COMMAND_CLRPWRDN V_MC_COMMAND(K_MC_COMMAND_CLRPWRDN) | ||
259 | |||
260 | #define M_MC_CS0 _SB_MAKEMASK1(4) | ||
261 | #define M_MC_CS1 _SB_MAKEMASK1(5) | ||
262 | #define M_MC_CS2 _SB_MAKEMASK1(6) | ||
263 | #define M_MC_CS3 _SB_MAKEMASK1(7) | ||
264 | |||
265 | /* | ||
266 | * DRAM Mode Register (Table 6-14) | ||
267 | */ | ||
268 | |||
269 | #define S_MC_EMODE 0 | ||
270 | #define M_MC_EMODE _SB_MAKEMASK(15, S_MC_EMODE) | ||
271 | #define V_MC_EMODE(x) _SB_MAKEVALUE(x, S_MC_EMODE) | ||
272 | #define G_MC_EMODE(x) _SB_GETVALUE(x, S_MC_EMODE, M_MC_EMODE) | ||
273 | #define V_MC_EMODE_DEFAULT V_MC_EMODE(0) | ||
274 | |||
275 | #define S_MC_MODE 16 | ||
276 | #define M_MC_MODE _SB_MAKEMASK(15, S_MC_MODE) | ||
277 | #define V_MC_MODE(x) _SB_MAKEVALUE(x, S_MC_MODE) | ||
278 | #define G_MC_MODE(x) _SB_GETVALUE(x, S_MC_MODE, M_MC_MODE) | ||
279 | #define V_MC_MODE_DEFAULT V_MC_MODE(0x22) | ||
280 | |||
281 | #define S_MC_DRAM_TYPE 32 | ||
282 | #define M_MC_DRAM_TYPE _SB_MAKEMASK(3, S_MC_DRAM_TYPE) | ||
283 | #define V_MC_DRAM_TYPE(x) _SB_MAKEVALUE(x, S_MC_DRAM_TYPE) | ||
284 | #define G_MC_DRAM_TYPE(x) _SB_GETVALUE(x, S_MC_DRAM_TYPE, M_MC_DRAM_TYPE) | ||
285 | |||
286 | #define K_MC_DRAM_TYPE_JEDEC 0 | ||
287 | #define K_MC_DRAM_TYPE_FCRAM 1 | ||
288 | #define K_MC_DRAM_TYPE_SGRAM 2 | ||
289 | |||
290 | #define V_MC_DRAM_TYPE_JEDEC V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_JEDEC) | ||
291 | #define V_MC_DRAM_TYPE_FCRAM V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_FCRAM) | ||
292 | #define V_MC_DRAM_TYPE_SGRAM V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_SGRAM) | ||
293 | |||
294 | #define M_MC_EXTERNALDECODE _SB_MAKEMASK1(35) | ||
295 | |||
296 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
297 | #define M_MC_PRE_ON_A8 _SB_MAKEMASK1(36) | ||
298 | #define M_MC_RAM_WITH_A13 _SB_MAKEMASK1(37) | ||
299 | #endif /* 1250 PASS3 || 112x PASS1 */ | ||
300 | |||
301 | |||
302 | |||
303 | /* | ||
304 | * SDRAM Timing Register (Table 6-15) | ||
305 | */ | ||
306 | |||
307 | #define M_MC_w2rIDLE_TWOCYCLES _SB_MAKEMASK1(60) | ||
308 | #define M_MC_r2wIDLE_TWOCYCLES _SB_MAKEMASK1(61) | ||
309 | #define M_MC_r2rIDLE_TWOCYCLES _SB_MAKEMASK1(62) | ||
310 | |||
311 | #define S_MC_tFIFO 56 | ||
312 | #define M_MC_tFIFO _SB_MAKEMASK(4, S_MC_tFIFO) | ||
313 | #define V_MC_tFIFO(x) _SB_MAKEVALUE(x, S_MC_tFIFO) | ||
314 | #define G_MC_tFIFO(x) _SB_GETVALUE(x, S_MC_tFIFO, M_MC_tFIFO) | ||
315 | #define K_MC_tFIFO_DEFAULT 1 | ||
316 | #define V_MC_tFIFO_DEFAULT V_MC_tFIFO(K_MC_tFIFO_DEFAULT) | ||
317 | |||
318 | #define S_MC_tRFC 52 | ||
319 | #define M_MC_tRFC _SB_MAKEMASK(4, S_MC_tRFC) | ||
320 | #define V_MC_tRFC(x) _SB_MAKEVALUE(x, S_MC_tRFC) | ||
321 | #define G_MC_tRFC(x) _SB_GETVALUE(x, S_MC_tRFC, M_MC_tRFC) | ||
322 | #define K_MC_tRFC_DEFAULT 12 | ||
323 | #define V_MC_tRFC_DEFAULT V_MC_tRFC(K_MC_tRFC_DEFAULT) | ||
324 | |||
325 | #if SIBYTE_HDR_FEATURE(1250, PASS3) | ||
326 | #define M_MC_tRFC_PLUS16 _SB_MAKEMASK1(51) /* 1250C3 and later. */ | ||
327 | #endif | ||
328 | |||
329 | #define S_MC_tCwCr 40 | ||
330 | #define M_MC_tCwCr _SB_MAKEMASK(4, S_MC_tCwCr) | ||
331 | #define V_MC_tCwCr(x) _SB_MAKEVALUE(x, S_MC_tCwCr) | ||
332 | #define G_MC_tCwCr(x) _SB_GETVALUE(x, S_MC_tCwCr, M_MC_tCwCr) | ||
333 | #define K_MC_tCwCr_DEFAULT 4 | ||
334 | #define V_MC_tCwCr_DEFAULT V_MC_tCwCr(K_MC_tCwCr_DEFAULT) | ||
335 | |||
336 | #define S_MC_tRCr 28 | ||
337 | #define M_MC_tRCr _SB_MAKEMASK(4, S_MC_tRCr) | ||
338 | #define V_MC_tRCr(x) _SB_MAKEVALUE(x, S_MC_tRCr) | ||
339 | #define G_MC_tRCr(x) _SB_GETVALUE(x, S_MC_tRCr, M_MC_tRCr) | ||
340 | #define K_MC_tRCr_DEFAULT 9 | ||
341 | #define V_MC_tRCr_DEFAULT V_MC_tRCr(K_MC_tRCr_DEFAULT) | ||
342 | |||
343 | #define S_MC_tRCw 24 | ||
344 | #define M_MC_tRCw _SB_MAKEMASK(4, S_MC_tRCw) | ||
345 | #define V_MC_tRCw(x) _SB_MAKEVALUE(x, S_MC_tRCw) | ||
346 | #define G_MC_tRCw(x) _SB_GETVALUE(x, S_MC_tRCw, M_MC_tRCw) | ||
347 | #define K_MC_tRCw_DEFAULT 10 | ||
348 | #define V_MC_tRCw_DEFAULT V_MC_tRCw(K_MC_tRCw_DEFAULT) | ||
349 | |||
350 | #define S_MC_tRRD 20 | ||
351 | #define M_MC_tRRD _SB_MAKEMASK(4, S_MC_tRRD) | ||
352 | #define V_MC_tRRD(x) _SB_MAKEVALUE(x, S_MC_tRRD) | ||
353 | #define G_MC_tRRD(x) _SB_GETVALUE(x, S_MC_tRRD, M_MC_tRRD) | ||
354 | #define K_MC_tRRD_DEFAULT 2 | ||
355 | #define V_MC_tRRD_DEFAULT V_MC_tRRD(K_MC_tRRD_DEFAULT) | ||
356 | |||
357 | #define S_MC_tRP 16 | ||
358 | #define M_MC_tRP _SB_MAKEMASK(4, S_MC_tRP) | ||
359 | #define V_MC_tRP(x) _SB_MAKEVALUE(x, S_MC_tRP) | ||
360 | #define G_MC_tRP(x) _SB_GETVALUE(x, S_MC_tRP, M_MC_tRP) | ||
361 | #define K_MC_tRP_DEFAULT 4 | ||
362 | #define V_MC_tRP_DEFAULT V_MC_tRP(K_MC_tRP_DEFAULT) | ||
363 | |||
364 | #define S_MC_tCwD 8 | ||
365 | #define M_MC_tCwD _SB_MAKEMASK(4, S_MC_tCwD) | ||
366 | #define V_MC_tCwD(x) _SB_MAKEVALUE(x, S_MC_tCwD) | ||
367 | #define G_MC_tCwD(x) _SB_GETVALUE(x, S_MC_tCwD, M_MC_tCwD) | ||
368 | #define K_MC_tCwD_DEFAULT 1 | ||
369 | #define V_MC_tCwD_DEFAULT V_MC_tCwD(K_MC_tCwD_DEFAULT) | ||
370 | |||
371 | #define M_tCrDh _SB_MAKEMASK1(7) | ||
372 | #define M_MC_tCrDh M_tCrDh | ||
373 | |||
374 | #define S_MC_tCrD 4 | ||
375 | #define M_MC_tCrD _SB_MAKEMASK(3, S_MC_tCrD) | ||
376 | #define V_MC_tCrD(x) _SB_MAKEVALUE(x, S_MC_tCrD) | ||
377 | #define G_MC_tCrD(x) _SB_GETVALUE(x, S_MC_tCrD, M_MC_tCrD) | ||
378 | #define K_MC_tCrD_DEFAULT 2 | ||
379 | #define V_MC_tCrD_DEFAULT V_MC_tCrD(K_MC_tCrD_DEFAULT) | ||
380 | |||
381 | #define S_MC_tRCD 0 | ||
382 | #define M_MC_tRCD _SB_MAKEMASK(4, S_MC_tRCD) | ||
383 | #define V_MC_tRCD(x) _SB_MAKEVALUE(x, S_MC_tRCD) | ||
384 | #define G_MC_tRCD(x) _SB_GETVALUE(x, S_MC_tRCD, M_MC_tRCD) | ||
385 | #define K_MC_tRCD_DEFAULT 3 | ||
386 | #define V_MC_tRCD_DEFAULT V_MC_tRCD(K_MC_tRCD_DEFAULT) | ||
387 | |||
388 | #define V_MC_TIMING_DEFAULT V_MC_tFIFO(K_MC_tFIFO_DEFAULT) | \ | ||
389 | V_MC_tRFC(K_MC_tRFC_DEFAULT) | \ | ||
390 | V_MC_tCwCr(K_MC_tCwCr_DEFAULT) | \ | ||
391 | V_MC_tRCr(K_MC_tRCr_DEFAULT) | \ | ||
392 | V_MC_tRCw(K_MC_tRCw_DEFAULT) | \ | ||
393 | V_MC_tRRD(K_MC_tRRD_DEFAULT) | \ | ||
394 | V_MC_tRP(K_MC_tRP_DEFAULT) | \ | ||
395 | V_MC_tCwD(K_MC_tCwD_DEFAULT) | \ | ||
396 | V_MC_tCrD(K_MC_tCrD_DEFAULT) | \ | ||
397 | V_MC_tRCD(K_MC_tRCD_DEFAULT) | \ | ||
398 | M_MC_r2rIDLE_TWOCYCLES | ||
399 | |||
400 | /* | ||
401 | * Errata says these are not the default | ||
402 | * M_MC_w2rIDLE_TWOCYCLES | \ | ||
403 | * M_MC_r2wIDLE_TWOCYCLES | \ | ||
404 | */ | ||
405 | |||
406 | |||
407 | /* | ||
408 | * Chip Select Start Address Register (Table 6-17) | ||
409 | */ | ||
410 | |||
411 | #define S_MC_CS0_START 0 | ||
412 | #define M_MC_CS0_START _SB_MAKEMASK(16, S_MC_CS0_START) | ||
413 | #define V_MC_CS0_START(x) _SB_MAKEVALUE(x, S_MC_CS0_START) | ||
414 | #define G_MC_CS0_START(x) _SB_GETVALUE(x, S_MC_CS0_START, M_MC_CS0_START) | ||
415 | |||
416 | #define S_MC_CS1_START 16 | ||
417 | #define M_MC_CS1_START _SB_MAKEMASK(16, S_MC_CS1_START) | ||
418 | #define V_MC_CS1_START(x) _SB_MAKEVALUE(x, S_MC_CS1_START) | ||
419 | #define G_MC_CS1_START(x) _SB_GETVALUE(x, S_MC_CS1_START, M_MC_CS1_START) | ||
420 | |||
421 | #define S_MC_CS2_START 32 | ||
422 | #define M_MC_CS2_START _SB_MAKEMASK(16, S_MC_CS2_START) | ||
423 | #define V_MC_CS2_START(x) _SB_MAKEVALUE(x, S_MC_CS2_START) | ||
424 | #define G_MC_CS2_START(x) _SB_GETVALUE(x, S_MC_CS2_START, M_MC_CS2_START) | ||
425 | |||
426 | #define S_MC_CS3_START 48 | ||
427 | #define M_MC_CS3_START _SB_MAKEMASK(16, S_MC_CS3_START) | ||
428 | #define V_MC_CS3_START(x) _SB_MAKEVALUE(x, S_MC_CS3_START) | ||
429 | #define G_MC_CS3_START(x) _SB_GETVALUE(x, S_MC_CS3_START, M_MC_CS3_START) | ||
430 | |||
431 | /* | ||
432 | * Chip Select End Address Register (Table 6-18) | ||
433 | */ | ||
434 | |||
435 | #define S_MC_CS0_END 0 | ||
436 | #define M_MC_CS0_END _SB_MAKEMASK(16, S_MC_CS0_END) | ||
437 | #define V_MC_CS0_END(x) _SB_MAKEVALUE(x, S_MC_CS0_END) | ||
438 | #define G_MC_CS0_END(x) _SB_GETVALUE(x, S_MC_CS0_END, M_MC_CS0_END) | ||
439 | |||
440 | #define S_MC_CS1_END 16 | ||
441 | #define M_MC_CS1_END _SB_MAKEMASK(16, S_MC_CS1_END) | ||
442 | #define V_MC_CS1_END(x) _SB_MAKEVALUE(x, S_MC_CS1_END) | ||
443 | #define G_MC_CS1_END(x) _SB_GETVALUE(x, S_MC_CS1_END, M_MC_CS1_END) | ||
444 | |||
445 | #define S_MC_CS2_END 32 | ||
446 | #define M_MC_CS2_END _SB_MAKEMASK(16, S_MC_CS2_END) | ||
447 | #define V_MC_CS2_END(x) _SB_MAKEVALUE(x, S_MC_CS2_END) | ||
448 | #define G_MC_CS2_END(x) _SB_GETVALUE(x, S_MC_CS2_END, M_MC_CS2_END) | ||
449 | |||
450 | #define S_MC_CS3_END 48 | ||
451 | #define M_MC_CS3_END _SB_MAKEMASK(16, S_MC_CS3_END) | ||
452 | #define V_MC_CS3_END(x) _SB_MAKEVALUE(x, S_MC_CS3_END) | ||
453 | #define G_MC_CS3_END(x) _SB_GETVALUE(x, S_MC_CS3_END, M_MC_CS3_END) | ||
454 | |||
455 | /* | ||
456 | * Chip Select Interleave Register (Table 6-19) | ||
457 | */ | ||
458 | |||
459 | #define S_MC_INTLV_RESERVED 0 | ||
460 | #define M_MC_INTLV_RESERVED _SB_MAKEMASK(5, S_MC_INTLV_RESERVED) | ||
461 | |||
462 | #define S_MC_INTERLEAVE 7 | ||
463 | #define M_MC_INTERLEAVE _SB_MAKEMASK(18, S_MC_INTERLEAVE) | ||
464 | #define V_MC_INTERLEAVE(x) _SB_MAKEVALUE(x, S_MC_INTERLEAVE) | ||
465 | |||
466 | #define S_MC_INTLV_MBZ 25 | ||
467 | #define M_MC_INTLV_MBZ _SB_MAKEMASK(39, S_MC_INTLV_MBZ) | ||
468 | |||
469 | /* | ||
470 | * Row Address Bits Register (Table 6-20) | ||
471 | */ | ||
472 | |||
473 | #define S_MC_RAS_RESERVED 0 | ||
474 | #define M_MC_RAS_RESERVED _SB_MAKEMASK(5, S_MC_RAS_RESERVED) | ||
475 | |||
476 | #define S_MC_RAS_SELECT 12 | ||
477 | #define M_MC_RAS_SELECT _SB_MAKEMASK(25, S_MC_RAS_SELECT) | ||
478 | #define V_MC_RAS_SELECT(x) _SB_MAKEVALUE(x, S_MC_RAS_SELECT) | ||
479 | |||
480 | #define S_MC_RAS_MBZ 37 | ||
481 | #define M_MC_RAS_MBZ _SB_MAKEMASK(27, S_MC_RAS_MBZ) | ||
482 | |||
483 | |||
484 | /* | ||
485 | * Column Address Bits Register (Table 6-21) | ||
486 | */ | ||
487 | |||
488 | #define S_MC_CAS_RESERVED 0 | ||
489 | #define M_MC_CAS_RESERVED _SB_MAKEMASK(5, S_MC_CAS_RESERVED) | ||
490 | |||
491 | #define S_MC_CAS_SELECT 5 | ||
492 | #define M_MC_CAS_SELECT _SB_MAKEMASK(18, S_MC_CAS_SELECT) | ||
493 | #define V_MC_CAS_SELECT(x) _SB_MAKEVALUE(x, S_MC_CAS_SELECT) | ||
494 | |||
495 | #define S_MC_CAS_MBZ 23 | ||
496 | #define M_MC_CAS_MBZ _SB_MAKEMASK(41, S_MC_CAS_MBZ) | ||
497 | |||
498 | |||
499 | /* | ||
500 | * Bank Address Address Bits Register (Table 6-22) | ||
501 | */ | ||
502 | |||
503 | #define S_MC_BA_RESERVED 0 | ||
504 | #define M_MC_BA_RESERVED _SB_MAKEMASK(5, S_MC_BA_RESERVED) | ||
505 | |||
506 | #define S_MC_BA_SELECT 5 | ||
507 | #define M_MC_BA_SELECT _SB_MAKEMASK(20, S_MC_BA_SELECT) | ||
508 | #define V_MC_BA_SELECT(x) _SB_MAKEVALUE(x, S_MC_BA_SELECT) | ||
509 | |||
510 | #define S_MC_BA_MBZ 25 | ||
511 | #define M_MC_BA_MBZ _SB_MAKEMASK(39, S_MC_BA_MBZ) | ||
512 | |||
513 | /* | ||
514 | * Chip Select Attribute Register (Table 6-23) | ||
515 | */ | ||
516 | |||
517 | #define K_MC_CS_ATTR_CLOSED 0 | ||
518 | #define K_MC_CS_ATTR_CASCHECK 1 | ||
519 | #define K_MC_CS_ATTR_HINT 2 | ||
520 | #define K_MC_CS_ATTR_OPEN 3 | ||
521 | |||
522 | #define S_MC_CS0_PAGE 0 | ||
523 | #define M_MC_CS0_PAGE _SB_MAKEMASK(2, S_MC_CS0_PAGE) | ||
524 | #define V_MC_CS0_PAGE(x) _SB_MAKEVALUE(x, S_MC_CS0_PAGE) | ||
525 | #define G_MC_CS0_PAGE(x) _SB_GETVALUE(x, S_MC_CS0_PAGE, M_MC_CS0_PAGE) | ||
526 | |||
527 | #define S_MC_CS1_PAGE 16 | ||
528 | #define M_MC_CS1_PAGE _SB_MAKEMASK(2, S_MC_CS1_PAGE) | ||
529 | #define V_MC_CS1_PAGE(x) _SB_MAKEVALUE(x, S_MC_CS1_PAGE) | ||
530 | #define G_MC_CS1_PAGE(x) _SB_GETVALUE(x, S_MC_CS1_PAGE, M_MC_CS1_PAGE) | ||
531 | |||
532 | #define S_MC_CS2_PAGE 32 | ||
533 | #define M_MC_CS2_PAGE _SB_MAKEMASK(2, S_MC_CS2_PAGE) | ||
534 | #define V_MC_CS2_PAGE(x) _SB_MAKEVALUE(x, S_MC_CS2_PAGE) | ||
535 | #define G_MC_CS2_PAGE(x) _SB_GETVALUE(x, S_MC_CS2_PAGE, M_MC_CS2_PAGE) | ||
536 | |||
537 | #define S_MC_CS3_PAGE 48 | ||
538 | #define M_MC_CS3_PAGE _SB_MAKEMASK(2, S_MC_CS3_PAGE) | ||
539 | #define V_MC_CS3_PAGE(x) _SB_MAKEVALUE(x, S_MC_CS3_PAGE) | ||
540 | #define G_MC_CS3_PAGE(x) _SB_GETVALUE(x, S_MC_CS3_PAGE, M_MC_CS3_PAGE) | ||
541 | |||
542 | /* | ||
543 | * ECC Test ECC Register (Table 6-25) | ||
544 | */ | ||
545 | |||
546 | #define S_MC_ECC_INVERT 0 | ||
547 | #define M_MC_ECC_INVERT _SB_MAKEMASK(8, S_MC_ECC_INVERT) | ||
548 | |||
549 | |||
550 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_regs.h b/include/asm-mips/sibyte/sb1250_regs.h deleted file mode 100644 index 8f53ec817a5e..000000000000 --- a/include/asm-mips/sibyte/sb1250_regs.h +++ /dev/null | |||
@@ -1,893 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * Register Definitions File: sb1250_regs.h | ||
5 | * | ||
6 | * This module contains the addresses of the on-chip peripherals | ||
7 | * on the SB1250. | ||
8 | * | ||
9 | * SB1250 specification level: 01/02/2002 | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _SB1250_REGS_H | ||
34 | #define _SB1250_REGS_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | |||
39 | /* ********************************************************************* | ||
40 | * Some general notes: | ||
41 | * | ||
42 | * For the most part, when there is more than one peripheral | ||
43 | * of the same type on the SOC, the constants below will be | ||
44 | * offsets from the base of each peripheral. For example, | ||
45 | * the MAC registers are described as offsets from the first | ||
46 | * MAC register, and there will be a MAC_REGISTER() macro | ||
47 | * to calculate the base address of a given MAC. | ||
48 | * | ||
49 | * The information in this file is based on the SB1250 SOC | ||
50 | * manual version 0.2, July 2000. | ||
51 | ********************************************************************* */ | ||
52 | |||
53 | |||
54 | /* ********************************************************************* | ||
55 | * Memory Controller Registers | ||
56 | ********************************************************************* */ | ||
57 | |||
58 | /* | ||
59 | * XXX: can't remove MC base 0 if 112x, since it's used by other macros, | ||
60 | * since there is one reg there (but it could get its addr/offset constant). | ||
61 | */ | ||
62 | |||
63 | #if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ | ||
64 | #define A_MC_BASE_0 0x0010051000 | ||
65 | #define A_MC_BASE_1 0x0010052000 | ||
66 | #define MC_REGISTER_SPACING 0x1000 | ||
67 | |||
68 | #define A_MC_BASE(ctlid) ((ctlid)*MC_REGISTER_SPACING+A_MC_BASE_0) | ||
69 | #define A_MC_REGISTER(ctlid, reg) (A_MC_BASE(ctlid)+(reg)) | ||
70 | |||
71 | #define R_MC_CONFIG 0x0000000100 | ||
72 | #define R_MC_DRAMCMD 0x0000000120 | ||
73 | #define R_MC_DRAMMODE 0x0000000140 | ||
74 | #define R_MC_TIMING1 0x0000000160 | ||
75 | #define R_MC_TIMING2 0x0000000180 | ||
76 | #define R_MC_CS_START 0x00000001A0 | ||
77 | #define R_MC_CS_END 0x00000001C0 | ||
78 | #define R_MC_CS_INTERLEAVE 0x00000001E0 | ||
79 | #define S_MC_CS_STARTEND 16 | ||
80 | |||
81 | #define R_MC_CSX_BASE 0x0000000200 | ||
82 | #define R_MC_CSX_ROW 0x0000000000 /* relative to CSX_BASE, above */ | ||
83 | #define R_MC_CSX_COL 0x0000000020 /* relative to CSX_BASE, above */ | ||
84 | #define R_MC_CSX_BA 0x0000000040 /* relative to CSX_BASE, above */ | ||
85 | #define MC_CSX_SPACING 0x0000000060 /* relative to CSX_BASE, above */ | ||
86 | |||
87 | #define R_MC_CS0_ROW 0x0000000200 | ||
88 | #define R_MC_CS0_COL 0x0000000220 | ||
89 | #define R_MC_CS0_BA 0x0000000240 | ||
90 | #define R_MC_CS1_ROW 0x0000000260 | ||
91 | #define R_MC_CS1_COL 0x0000000280 | ||
92 | #define R_MC_CS1_BA 0x00000002A0 | ||
93 | #define R_MC_CS2_ROW 0x00000002C0 | ||
94 | #define R_MC_CS2_COL 0x00000002E0 | ||
95 | #define R_MC_CS2_BA 0x0000000300 | ||
96 | #define R_MC_CS3_ROW 0x0000000320 | ||
97 | #define R_MC_CS3_COL 0x0000000340 | ||
98 | #define R_MC_CS3_BA 0x0000000360 | ||
99 | #define R_MC_CS_ATTR 0x0000000380 | ||
100 | #define R_MC_TEST_DATA 0x0000000400 | ||
101 | #define R_MC_TEST_ECC 0x0000000420 | ||
102 | #define R_MC_MCLK_CFG 0x0000000500 | ||
103 | |||
104 | #endif /* 1250 & 112x */ | ||
105 | |||
106 | /* ********************************************************************* | ||
107 | * L2 Cache Control Registers | ||
108 | ********************************************************************* */ | ||
109 | |||
110 | #if SIBYTE_HDR_FEATURE_1250_112x /* This L2C only on 1250/112x */ | ||
111 | |||
112 | #define A_L2_READ_TAG 0x0010040018 | ||
113 | #define A_L2_ECC_TAG 0x0010040038 | ||
114 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
115 | #define A_L2_READ_MISC 0x0010040058 | ||
116 | #endif /* 1250 PASS3 || 112x PASS1 */ | ||
117 | #define A_L2_WAY_DISABLE 0x0010041000 | ||
118 | #define A_L2_MAKEDISABLE(x) (A_L2_WAY_DISABLE | (((~(x))&0x0F) << 8)) | ||
119 | #define A_L2_MGMT_TAG_BASE 0x00D0000000 | ||
120 | |||
121 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
122 | #define A_L2_CACHE_DISABLE 0x0010042000 | ||
123 | #define A_L2_MAKECACHEDISABLE(x) (A_L2_CACHE_DISABLE | (((x)&0x0F) << 8)) | ||
124 | #define A_L2_MISC_CONFIG 0x0010043000 | ||
125 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
126 | |||
127 | /* Backward-compatibility definitions. */ | ||
128 | /* XXX: discourage people from using these constants. */ | ||
129 | #define A_L2_READ_ADDRESS A_L2_READ_TAG | ||
130 | #define A_L2_EEC_ADDRESS A_L2_ECC_TAG | ||
131 | |||
132 | #endif | ||
133 | |||
134 | |||
135 | /* ********************************************************************* | ||
136 | * PCI Interface Registers | ||
137 | ********************************************************************* */ | ||
138 | |||
139 | #if SIBYTE_HDR_FEATURE_1250_112x /* This PCI/HT only on 1250/112x */ | ||
140 | #define A_PCI_TYPE00_HEADER 0x00DE000000 | ||
141 | #define A_PCI_TYPE01_HEADER 0x00DE000800 | ||
142 | #endif | ||
143 | |||
144 | |||
145 | /* ********************************************************************* | ||
146 | * Ethernet DMA and MACs | ||
147 | ********************************************************************* */ | ||
148 | |||
149 | #define A_MAC_BASE_0 0x0010064000 | ||
150 | #define A_MAC_BASE_1 0x0010065000 | ||
151 | #if SIBYTE_HDR_FEATURE_CHIP(1250) | ||
152 | #define A_MAC_BASE_2 0x0010066000 | ||
153 | #endif /* 1250 */ | ||
154 | |||
155 | #define MAC_SPACING 0x1000 | ||
156 | #define MAC_DMA_TXRX_SPACING 0x0400 | ||
157 | #define MAC_DMA_CHANNEL_SPACING 0x0100 | ||
158 | #define DMA_RX 0 | ||
159 | #define DMA_TX 1 | ||
160 | #define MAC_NUM_DMACHAN 2 /* channels per direction */ | ||
161 | |||
162 | /* XXX: not correct; depends on SOC type. */ | ||
163 | #define MAC_NUM_PORTS 3 | ||
164 | |||
165 | #define A_MAC_CHANNEL_BASE(macnum) \ | ||
166 | (A_MAC_BASE_0 + \ | ||
167 | MAC_SPACING*(macnum)) | ||
168 | |||
169 | #define A_MAC_REGISTER(macnum,reg) \ | ||
170 | (A_MAC_BASE_0 + \ | ||
171 | MAC_SPACING*(macnum) + (reg)) | ||
172 | |||
173 | |||
174 | #define R_MAC_DMA_CHANNELS 0x800 /* Relative to A_MAC_CHANNEL_BASE */ | ||
175 | |||
176 | #define A_MAC_DMA_CHANNEL_BASE(macnum, txrx, chan) \ | ||
177 | ((A_MAC_CHANNEL_BASE(macnum)) + \ | ||
178 | R_MAC_DMA_CHANNELS + \ | ||
179 | (MAC_DMA_TXRX_SPACING*(txrx)) + \ | ||
180 | (MAC_DMA_CHANNEL_SPACING*(chan))) | ||
181 | |||
182 | #define R_MAC_DMA_CHANNEL_BASE(txrx, chan) \ | ||
183 | (R_MAC_DMA_CHANNELS + \ | ||
184 | (MAC_DMA_TXRX_SPACING*(txrx)) + \ | ||
185 | (MAC_DMA_CHANNEL_SPACING*(chan))) | ||
186 | |||
187 | #define A_MAC_DMA_REGISTER(macnum, txrx, chan, reg) \ | ||
188 | (A_MAC_DMA_CHANNEL_BASE(macnum, txrx, chan) + \ | ||
189 | (reg)) | ||
190 | |||
191 | #define R_MAC_DMA_REGISTER(txrx, chan, reg) \ | ||
192 | (R_MAC_DMA_CHANNEL_BASE(txrx, chan) + \ | ||
193 | (reg)) | ||
194 | |||
195 | /* | ||
196 | * DMA channel registers, relative to A_MAC_DMA_CHANNEL_BASE | ||
197 | */ | ||
198 | |||
199 | #define R_MAC_DMA_CONFIG0 0x00000000 | ||
200 | #define R_MAC_DMA_CONFIG1 0x00000008 | ||
201 | #define R_MAC_DMA_DSCR_BASE 0x00000010 | ||
202 | #define R_MAC_DMA_DSCR_CNT 0x00000018 | ||
203 | #define R_MAC_DMA_CUR_DSCRA 0x00000020 | ||
204 | #define R_MAC_DMA_CUR_DSCRB 0x00000028 | ||
205 | #define R_MAC_DMA_CUR_DSCRADDR 0x00000030 | ||
206 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
207 | #define R_MAC_DMA_OODPKTLOST_RX 0x00000038 /* rx only */ | ||
208 | #endif /* 1250 PASS3 || 112x PASS1 */ | ||
209 | |||
210 | /* | ||
211 | * RMON Counters | ||
212 | */ | ||
213 | |||
214 | #define R_MAC_RMON_TX_BYTES 0x00000000 | ||
215 | #define R_MAC_RMON_COLLISIONS 0x00000008 | ||
216 | #define R_MAC_RMON_LATE_COL 0x00000010 | ||
217 | #define R_MAC_RMON_EX_COL 0x00000018 | ||
218 | #define R_MAC_RMON_FCS_ERROR 0x00000020 | ||
219 | #define R_MAC_RMON_TX_ABORT 0x00000028 | ||
220 | /* Counter #6 (0x30) now reserved */ | ||
221 | #define R_MAC_RMON_TX_BAD 0x00000038 | ||
222 | #define R_MAC_RMON_TX_GOOD 0x00000040 | ||
223 | #define R_MAC_RMON_TX_RUNT 0x00000048 | ||
224 | #define R_MAC_RMON_TX_OVERSIZE 0x00000050 | ||
225 | #define R_MAC_RMON_RX_BYTES 0x00000080 | ||
226 | #define R_MAC_RMON_RX_MCAST 0x00000088 | ||
227 | #define R_MAC_RMON_RX_BCAST 0x00000090 | ||
228 | #define R_MAC_RMON_RX_BAD 0x00000098 | ||
229 | #define R_MAC_RMON_RX_GOOD 0x000000A0 | ||
230 | #define R_MAC_RMON_RX_RUNT 0x000000A8 | ||
231 | #define R_MAC_RMON_RX_OVERSIZE 0x000000B0 | ||
232 | #define R_MAC_RMON_RX_FCS_ERROR 0x000000B8 | ||
233 | #define R_MAC_RMON_RX_LENGTH_ERROR 0x000000C0 | ||
234 | #define R_MAC_RMON_RX_CODE_ERROR 0x000000C8 | ||
235 | #define R_MAC_RMON_RX_ALIGN_ERROR 0x000000D0 | ||
236 | |||
237 | /* Updated to spec 0.2 */ | ||
238 | #define R_MAC_CFG 0x00000100 | ||
239 | #define R_MAC_THRSH_CFG 0x00000108 | ||
240 | #define R_MAC_VLANTAG 0x00000110 | ||
241 | #define R_MAC_FRAMECFG 0x00000118 | ||
242 | #define R_MAC_EOPCNT 0x00000120 | ||
243 | #define R_MAC_FIFO_PTRS 0x00000128 | ||
244 | #define R_MAC_ADFILTER_CFG 0x00000200 | ||
245 | #define R_MAC_ETHERNET_ADDR 0x00000208 | ||
246 | #define R_MAC_PKT_TYPE 0x00000210 | ||
247 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
248 | #define R_MAC_ADMASK0 0x00000218 | ||
249 | #define R_MAC_ADMASK1 0x00000220 | ||
250 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
251 | #define R_MAC_HASH_BASE 0x00000240 | ||
252 | #define R_MAC_ADDR_BASE 0x00000280 | ||
253 | #define R_MAC_CHLO0_BASE 0x00000300 | ||
254 | #define R_MAC_CHUP0_BASE 0x00000320 | ||
255 | #define R_MAC_ENABLE 0x00000400 | ||
256 | #define R_MAC_STATUS 0x00000408 | ||
257 | #define R_MAC_INT_MASK 0x00000410 | ||
258 | #define R_MAC_TXD_CTL 0x00000420 | ||
259 | #define R_MAC_MDIO 0x00000428 | ||
260 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
261 | #define R_MAC_STATUS1 0x00000430 | ||
262 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
263 | #define R_MAC_DEBUG_STATUS 0x00000448 | ||
264 | |||
265 | #define MAC_HASH_COUNT 8 | ||
266 | #define MAC_ADDR_COUNT 8 | ||
267 | #define MAC_CHMAP_COUNT 4 | ||
268 | |||
269 | |||
270 | /* ********************************************************************* | ||
271 | * DUART Registers | ||
272 | ********************************************************************* */ | ||
273 | |||
274 | |||
275 | #if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ | ||
276 | #define R_DUART_NUM_PORTS 2 | ||
277 | |||
278 | #define A_DUART 0x0010060000 | ||
279 | |||
280 | #define DUART_CHANREG_SPACING 0x100 | ||
281 | |||
282 | #define A_DUART_CHANREG(chan, reg) \ | ||
283 | (A_DUART + DUART_CHANREG_SPACING * ((chan) + 1) + (reg)) | ||
284 | #endif /* 1250 & 112x */ | ||
285 | |||
286 | #define R_DUART_MODE_REG_1 0x000 | ||
287 | #define R_DUART_MODE_REG_2 0x010 | ||
288 | #define R_DUART_STATUS 0x020 | ||
289 | #define R_DUART_CLK_SEL 0x030 | ||
290 | #define R_DUART_CMD 0x050 | ||
291 | #define R_DUART_RX_HOLD 0x060 | ||
292 | #define R_DUART_TX_HOLD 0x070 | ||
293 | |||
294 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
295 | #define R_DUART_FULL_CTL 0x040 | ||
296 | #define R_DUART_OPCR_X 0x080 | ||
297 | #define R_DUART_AUXCTL_X 0x090 | ||
298 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
299 | |||
300 | |||
301 | /* | ||
302 | * The IMR and ISR can't be addressed with A_DUART_CHANREG, | ||
303 | * so use these macros instead. | ||
304 | */ | ||
305 | |||
306 | #if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ | ||
307 | #define DUART_IMRISR_SPACING 0x20 | ||
308 | #define DUART_INCHNG_SPACING 0x10 | ||
309 | |||
310 | #define A_DUART_CTRLREG(reg) \ | ||
311 | (A_DUART + DUART_CHANREG_SPACING * 3 + (reg)) | ||
312 | |||
313 | #define R_DUART_IMRREG(chan) \ | ||
314 | (R_DUART_IMR_A + (chan) * DUART_IMRISR_SPACING) | ||
315 | #define R_DUART_ISRREG(chan) \ | ||
316 | (R_DUART_ISR_A + (chan) * DUART_IMRISR_SPACING) | ||
317 | #define R_DUART_INCHREG(chan) \ | ||
318 | (R_DUART_IN_CHNG_A + (chan) * DUART_INCHNG_SPACING) | ||
319 | |||
320 | #define A_DUART_IMRREG(chan) A_DUART_CTRLREG(R_DUART_IMRREG(chan)) | ||
321 | #define A_DUART_ISRREG(chan) A_DUART_CTRLREG(R_DUART_ISRREG(chan)) | ||
322 | #define A_DUART_INCHREG(chan) A_DUART_CTRLREG(R_DUART_INCHREG(chan)) | ||
323 | #endif /* 1250 & 112x */ | ||
324 | |||
325 | #define R_DUART_AUX_CTRL 0x010 | ||
326 | #define R_DUART_ISR_A 0x020 | ||
327 | #define R_DUART_IMR_A 0x030 | ||
328 | #define R_DUART_ISR_B 0x040 | ||
329 | #define R_DUART_IMR_B 0x050 | ||
330 | #define R_DUART_OUT_PORT 0x060 | ||
331 | #define R_DUART_OPCR 0x070 | ||
332 | #define R_DUART_IN_PORT 0x080 | ||
333 | |||
334 | #define R_DUART_SET_OPR 0x0B0 | ||
335 | #define R_DUART_CLEAR_OPR 0x0C0 | ||
336 | #define R_DUART_IN_CHNG_A 0x0D0 | ||
337 | #define R_DUART_IN_CHNG_B 0x0E0 | ||
338 | |||
339 | |||
340 | /* | ||
341 | * These constants are the absolute addresses. | ||
342 | */ | ||
343 | |||
344 | #define A_DUART_MODE_REG_1_A 0x0010060100 | ||
345 | #define A_DUART_MODE_REG_2_A 0x0010060110 | ||
346 | #define A_DUART_STATUS_A 0x0010060120 | ||
347 | #define A_DUART_CLK_SEL_A 0x0010060130 | ||
348 | #define A_DUART_CMD_A 0x0010060150 | ||
349 | #define A_DUART_RX_HOLD_A 0x0010060160 | ||
350 | #define A_DUART_TX_HOLD_A 0x0010060170 | ||
351 | |||
352 | #define A_DUART_MODE_REG_1_B 0x0010060200 | ||
353 | #define A_DUART_MODE_REG_2_B 0x0010060210 | ||
354 | #define A_DUART_STATUS_B 0x0010060220 | ||
355 | #define A_DUART_CLK_SEL_B 0x0010060230 | ||
356 | #define A_DUART_CMD_B 0x0010060250 | ||
357 | #define A_DUART_RX_HOLD_B 0x0010060260 | ||
358 | #define A_DUART_TX_HOLD_B 0x0010060270 | ||
359 | |||
360 | #define A_DUART_INPORT_CHNG 0x0010060300 | ||
361 | #define A_DUART_AUX_CTRL 0x0010060310 | ||
362 | #define A_DUART_ISR_A 0x0010060320 | ||
363 | #define A_DUART_IMR_A 0x0010060330 | ||
364 | #define A_DUART_ISR_B 0x0010060340 | ||
365 | #define A_DUART_IMR_B 0x0010060350 | ||
366 | #define A_DUART_OUT_PORT 0x0010060360 | ||
367 | #define A_DUART_OPCR 0x0010060370 | ||
368 | #define A_DUART_IN_PORT 0x0010060380 | ||
369 | #define A_DUART_ISR 0x0010060390 | ||
370 | #define A_DUART_IMR 0x00100603A0 | ||
371 | #define A_DUART_SET_OPR 0x00100603B0 | ||
372 | #define A_DUART_CLEAR_OPR 0x00100603C0 | ||
373 | #define A_DUART_INPORT_CHNG_A 0x00100603D0 | ||
374 | #define A_DUART_INPORT_CHNG_B 0x00100603E0 | ||
375 | |||
376 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
377 | #define A_DUART_FULL_CTL_A 0x0010060140 | ||
378 | #define A_DUART_FULL_CTL_B 0x0010060240 | ||
379 | |||
380 | #define A_DUART_OPCR_A 0x0010060180 | ||
381 | #define A_DUART_OPCR_B 0x0010060280 | ||
382 | |||
383 | #define A_DUART_INPORT_CHNG_DEBUG 0x00100603F0 | ||
384 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
385 | |||
386 | |||
387 | /* ********************************************************************* | ||
388 | * Synchronous Serial Registers | ||
389 | ********************************************************************* */ | ||
390 | |||
391 | |||
392 | #if SIBYTE_HDR_FEATURE_1250_112x /* sync serial only on 1250/112x */ | ||
393 | |||
394 | #define A_SER_BASE_0 0x0010060400 | ||
395 | #define A_SER_BASE_1 0x0010060800 | ||
396 | #define SER_SPACING 0x400 | ||
397 | |||
398 | #define SER_DMA_TXRX_SPACING 0x80 | ||
399 | |||
400 | #define SER_NUM_PORTS 2 | ||
401 | |||
402 | #define A_SER_CHANNEL_BASE(sernum) \ | ||
403 | (A_SER_BASE_0 + \ | ||
404 | SER_SPACING*(sernum)) | ||
405 | |||
406 | #define A_SER_REGISTER(sernum,reg) \ | ||
407 | (A_SER_BASE_0 + \ | ||
408 | SER_SPACING*(sernum) + (reg)) | ||
409 | |||
410 | |||
411 | #define R_SER_DMA_CHANNELS 0 /* Relative to A_SER_BASE_x */ | ||
412 | |||
413 | #define A_SER_DMA_CHANNEL_BASE(sernum,txrx) \ | ||
414 | ((A_SER_CHANNEL_BASE(sernum)) + \ | ||
415 | R_SER_DMA_CHANNELS + \ | ||
416 | (SER_DMA_TXRX_SPACING*(txrx))) | ||
417 | |||
418 | #define A_SER_DMA_REGISTER(sernum, txrx, reg) \ | ||
419 | (A_SER_DMA_CHANNEL_BASE(sernum, txrx) + \ | ||
420 | (reg)) | ||
421 | |||
422 | |||
423 | /* | ||
424 | * DMA channel registers, relative to A_SER_DMA_CHANNEL_BASE | ||
425 | */ | ||
426 | |||
427 | #define R_SER_DMA_CONFIG0 0x00000000 | ||
428 | #define R_SER_DMA_CONFIG1 0x00000008 | ||
429 | #define R_SER_DMA_DSCR_BASE 0x00000010 | ||
430 | #define R_SER_DMA_DSCR_CNT 0x00000018 | ||
431 | #define R_SER_DMA_CUR_DSCRA 0x00000020 | ||
432 | #define R_SER_DMA_CUR_DSCRB 0x00000028 | ||
433 | #define R_SER_DMA_CUR_DSCRADDR 0x00000030 | ||
434 | |||
435 | #define R_SER_DMA_CONFIG0_RX 0x00000000 | ||
436 | #define R_SER_DMA_CONFIG1_RX 0x00000008 | ||
437 | #define R_SER_DMA_DSCR_BASE_RX 0x00000010 | ||
438 | #define R_SER_DMA_DSCR_COUNT_RX 0x00000018 | ||
439 | #define R_SER_DMA_CUR_DSCR_A_RX 0x00000020 | ||
440 | #define R_SER_DMA_CUR_DSCR_B_RX 0x00000028 | ||
441 | #define R_SER_DMA_CUR_DSCR_ADDR_RX 0x00000030 | ||
442 | |||
443 | #define R_SER_DMA_CONFIG0_TX 0x00000080 | ||
444 | #define R_SER_DMA_CONFIG1_TX 0x00000088 | ||
445 | #define R_SER_DMA_DSCR_BASE_TX 0x00000090 | ||
446 | #define R_SER_DMA_DSCR_COUNT_TX 0x00000098 | ||
447 | #define R_SER_DMA_CUR_DSCR_A_TX 0x000000A0 | ||
448 | #define R_SER_DMA_CUR_DSCR_B_TX 0x000000A8 | ||
449 | #define R_SER_DMA_CUR_DSCR_ADDR_TX 0x000000B0 | ||
450 | |||
451 | #define R_SER_MODE 0x00000100 | ||
452 | #define R_SER_MINFRM_SZ 0x00000108 | ||
453 | #define R_SER_MAXFRM_SZ 0x00000110 | ||
454 | #define R_SER_ADDR 0x00000118 | ||
455 | #define R_SER_USR0_ADDR 0x00000120 | ||
456 | #define R_SER_USR1_ADDR 0x00000128 | ||
457 | #define R_SER_USR2_ADDR 0x00000130 | ||
458 | #define R_SER_USR3_ADDR 0x00000138 | ||
459 | #define R_SER_CMD 0x00000140 | ||
460 | #define R_SER_TX_RD_THRSH 0x00000160 | ||
461 | #define R_SER_TX_WR_THRSH 0x00000168 | ||
462 | #define R_SER_RX_RD_THRSH 0x00000170 | ||
463 | #define R_SER_LINE_MODE 0x00000178 | ||
464 | #define R_SER_DMA_ENABLE 0x00000180 | ||
465 | #define R_SER_INT_MASK 0x00000190 | ||
466 | #define R_SER_STATUS 0x00000188 | ||
467 | #define R_SER_STATUS_DEBUG 0x000001A8 | ||
468 | #define R_SER_RX_TABLE_BASE 0x00000200 | ||
469 | #define SER_RX_TABLE_COUNT 16 | ||
470 | #define R_SER_TX_TABLE_BASE 0x00000300 | ||
471 | #define SER_TX_TABLE_COUNT 16 | ||
472 | |||
473 | /* RMON Counters */ | ||
474 | #define R_SER_RMON_TX_BYTE_LO 0x000001C0 | ||
475 | #define R_SER_RMON_TX_BYTE_HI 0x000001C8 | ||
476 | #define R_SER_RMON_RX_BYTE_LO 0x000001D0 | ||
477 | #define R_SER_RMON_RX_BYTE_HI 0x000001D8 | ||
478 | #define R_SER_RMON_TX_UNDERRUN 0x000001E0 | ||
479 | #define R_SER_RMON_RX_OVERFLOW 0x000001E8 | ||
480 | #define R_SER_RMON_RX_ERRORS 0x000001F0 | ||
481 | #define R_SER_RMON_RX_BADADDR 0x000001F8 | ||
482 | |||
483 | #endif /* 1250/112x */ | ||
484 | |||
485 | /* ********************************************************************* | ||
486 | * Generic Bus Registers | ||
487 | ********************************************************************* */ | ||
488 | |||
489 | #define IO_EXT_CFG_COUNT 8 | ||
490 | |||
491 | #define A_IO_EXT_BASE 0x0010061000 | ||
492 | #define A_IO_EXT_REG(r) (A_IO_EXT_BASE + (r)) | ||
493 | |||
494 | #define A_IO_EXT_CFG_BASE 0x0010061000 | ||
495 | #define A_IO_EXT_MULT_SIZE_BASE 0x0010061100 | ||
496 | #define A_IO_EXT_START_ADDR_BASE 0x0010061200 | ||
497 | #define A_IO_EXT_TIME_CFG0_BASE 0x0010061600 | ||
498 | #define A_IO_EXT_TIME_CFG1_BASE 0x0010061700 | ||
499 | |||
500 | #define IO_EXT_REGISTER_SPACING 8 | ||
501 | #define A_IO_EXT_CS_BASE(cs) (A_IO_EXT_CFG_BASE+IO_EXT_REGISTER_SPACING*(cs)) | ||
502 | #define R_IO_EXT_REG(reg, cs) ((cs)*IO_EXT_REGISTER_SPACING + (reg)) | ||
503 | |||
504 | #define R_IO_EXT_CFG 0x0000 | ||
505 | #define R_IO_EXT_MULT_SIZE 0x0100 | ||
506 | #define R_IO_EXT_START_ADDR 0x0200 | ||
507 | #define R_IO_EXT_TIME_CFG0 0x0600 | ||
508 | #define R_IO_EXT_TIME_CFG1 0x0700 | ||
509 | |||
510 | |||
511 | #define A_IO_INTERRUPT_STATUS 0x0010061A00 | ||
512 | #define A_IO_INTERRUPT_DATA0 0x0010061A10 | ||
513 | #define A_IO_INTERRUPT_DATA1 0x0010061A18 | ||
514 | #define A_IO_INTERRUPT_DATA2 0x0010061A20 | ||
515 | #define A_IO_INTERRUPT_DATA3 0x0010061A28 | ||
516 | #define A_IO_INTERRUPT_ADDR0 0x0010061A30 | ||
517 | #define A_IO_INTERRUPT_ADDR1 0x0010061A40 | ||
518 | #define A_IO_INTERRUPT_PARITY 0x0010061A50 | ||
519 | #define A_IO_PCMCIA_CFG 0x0010061A60 | ||
520 | #define A_IO_PCMCIA_STATUS 0x0010061A70 | ||
521 | #define A_IO_DRIVE_0 0x0010061300 | ||
522 | #define A_IO_DRIVE_1 0x0010061308 | ||
523 | #define A_IO_DRIVE_2 0x0010061310 | ||
524 | #define A_IO_DRIVE_3 0x0010061318 | ||
525 | #define A_IO_DRIVE_BASE A_IO_DRIVE_0 | ||
526 | #define IO_DRIVE_REGISTER_SPACING 8 | ||
527 | #define R_IO_DRIVE(x) ((x)*IO_DRIVE_REGISTER_SPACING) | ||
528 | #define A_IO_DRIVE(x) (A_IO_DRIVE_BASE + R_IO_DRIVE(x)) | ||
529 | |||
530 | #define R_IO_INTERRUPT_STATUS 0x0A00 | ||
531 | #define R_IO_INTERRUPT_DATA0 0x0A10 | ||
532 | #define R_IO_INTERRUPT_DATA1 0x0A18 | ||
533 | #define R_IO_INTERRUPT_DATA2 0x0A20 | ||
534 | #define R_IO_INTERRUPT_DATA3 0x0A28 | ||
535 | #define R_IO_INTERRUPT_ADDR0 0x0A30 | ||
536 | #define R_IO_INTERRUPT_ADDR1 0x0A40 | ||
537 | #define R_IO_INTERRUPT_PARITY 0x0A50 | ||
538 | #define R_IO_PCMCIA_CFG 0x0A60 | ||
539 | #define R_IO_PCMCIA_STATUS 0x0A70 | ||
540 | |||
541 | /* ********************************************************************* | ||
542 | * GPIO Registers | ||
543 | ********************************************************************* */ | ||
544 | |||
545 | #define A_GPIO_CLR_EDGE 0x0010061A80 | ||
546 | #define A_GPIO_INT_TYPE 0x0010061A88 | ||
547 | #define A_GPIO_INPUT_INVERT 0x0010061A90 | ||
548 | #define A_GPIO_GLITCH 0x0010061A98 | ||
549 | #define A_GPIO_READ 0x0010061AA0 | ||
550 | #define A_GPIO_DIRECTION 0x0010061AA8 | ||
551 | #define A_GPIO_PIN_CLR 0x0010061AB0 | ||
552 | #define A_GPIO_PIN_SET 0x0010061AB8 | ||
553 | |||
554 | #define A_GPIO_BASE 0x0010061A80 | ||
555 | |||
556 | #define R_GPIO_CLR_EDGE 0x00 | ||
557 | #define R_GPIO_INT_TYPE 0x08 | ||
558 | #define R_GPIO_INPUT_INVERT 0x10 | ||
559 | #define R_GPIO_GLITCH 0x18 | ||
560 | #define R_GPIO_READ 0x20 | ||
561 | #define R_GPIO_DIRECTION 0x28 | ||
562 | #define R_GPIO_PIN_CLR 0x30 | ||
563 | #define R_GPIO_PIN_SET 0x38 | ||
564 | |||
565 | /* ********************************************************************* | ||
566 | * SMBus Registers | ||
567 | ********************************************************************* */ | ||
568 | |||
569 | #define A_SMB_XTRA_0 0x0010060000 | ||
570 | #define A_SMB_XTRA_1 0x0010060008 | ||
571 | #define A_SMB_FREQ_0 0x0010060010 | ||
572 | #define A_SMB_FREQ_1 0x0010060018 | ||
573 | #define A_SMB_STATUS_0 0x0010060020 | ||
574 | #define A_SMB_STATUS_1 0x0010060028 | ||
575 | #define A_SMB_CMD_0 0x0010060030 | ||
576 | #define A_SMB_CMD_1 0x0010060038 | ||
577 | #define A_SMB_START_0 0x0010060040 | ||
578 | #define A_SMB_START_1 0x0010060048 | ||
579 | #define A_SMB_DATA_0 0x0010060050 | ||
580 | #define A_SMB_DATA_1 0x0010060058 | ||
581 | #define A_SMB_CONTROL_0 0x0010060060 | ||
582 | #define A_SMB_CONTROL_1 0x0010060068 | ||
583 | #define A_SMB_PEC_0 0x0010060070 | ||
584 | #define A_SMB_PEC_1 0x0010060078 | ||
585 | |||
586 | #define A_SMB_0 0x0010060000 | ||
587 | #define A_SMB_1 0x0010060008 | ||
588 | #define SMB_REGISTER_SPACING 0x8 | ||
589 | #define A_SMB_BASE(idx) (A_SMB_0+(idx)*SMB_REGISTER_SPACING) | ||
590 | #define A_SMB_REGISTER(idx, reg) (A_SMB_BASE(idx)+(reg)) | ||
591 | |||
592 | #define R_SMB_XTRA 0x0000000000 | ||
593 | #define R_SMB_FREQ 0x0000000010 | ||
594 | #define R_SMB_STATUS 0x0000000020 | ||
595 | #define R_SMB_CMD 0x0000000030 | ||
596 | #define R_SMB_START 0x0000000040 | ||
597 | #define R_SMB_DATA 0x0000000050 | ||
598 | #define R_SMB_CONTROL 0x0000000060 | ||
599 | #define R_SMB_PEC 0x0000000070 | ||
600 | |||
601 | /* ********************************************************************* | ||
602 | * Timer Registers | ||
603 | ********************************************************************* */ | ||
604 | |||
605 | /* | ||
606 | * Watchdog timers | ||
607 | */ | ||
608 | |||
609 | #define A_SCD_WDOG_0 0x0010020050 | ||
610 | #define A_SCD_WDOG_1 0x0010020150 | ||
611 | #define SCD_WDOG_SPACING 0x100 | ||
612 | #define SCD_NUM_WDOGS 2 | ||
613 | #define A_SCD_WDOG_BASE(w) (A_SCD_WDOG_0+SCD_WDOG_SPACING*(w)) | ||
614 | #define A_SCD_WDOG_REGISTER(w, r) (A_SCD_WDOG_BASE(w) + (r)) | ||
615 | |||
616 | #define R_SCD_WDOG_INIT 0x0000000000 | ||
617 | #define R_SCD_WDOG_CNT 0x0000000008 | ||
618 | #define R_SCD_WDOG_CFG 0x0000000010 | ||
619 | |||
620 | #define A_SCD_WDOG_INIT_0 0x0010020050 | ||
621 | #define A_SCD_WDOG_CNT_0 0x0010020058 | ||
622 | #define A_SCD_WDOG_CFG_0 0x0010020060 | ||
623 | |||
624 | #define A_SCD_WDOG_INIT_1 0x0010020150 | ||
625 | #define A_SCD_WDOG_CNT_1 0x0010020158 | ||
626 | #define A_SCD_WDOG_CFG_1 0x0010020160 | ||
627 | |||
628 | /* | ||
629 | * Generic timers | ||
630 | */ | ||
631 | |||
632 | #define A_SCD_TIMER_0 0x0010020070 | ||
633 | #define A_SCD_TIMER_1 0x0010020078 | ||
634 | #define A_SCD_TIMER_2 0x0010020170 | ||
635 | #define A_SCD_TIMER_3 0x0010020178 | ||
636 | #define SCD_NUM_TIMERS 4 | ||
637 | #define A_SCD_TIMER_BASE(w) (A_SCD_TIMER_0+0x08*((w)&1)+0x100*(((w)&2)>>1)) | ||
638 | #define A_SCD_TIMER_REGISTER(w, r) (A_SCD_TIMER_BASE(w) + (r)) | ||
639 | |||
640 | #define R_SCD_TIMER_INIT 0x0000000000 | ||
641 | #define R_SCD_TIMER_CNT 0x0000000010 | ||
642 | #define R_SCD_TIMER_CFG 0x0000000020 | ||
643 | |||
644 | #define A_SCD_TIMER_INIT_0 0x0010020070 | ||
645 | #define A_SCD_TIMER_CNT_0 0x0010020080 | ||
646 | #define A_SCD_TIMER_CFG_0 0x0010020090 | ||
647 | |||
648 | #define A_SCD_TIMER_INIT_1 0x0010020078 | ||
649 | #define A_SCD_TIMER_CNT_1 0x0010020088 | ||
650 | #define A_SCD_TIMER_CFG_1 0x0010020098 | ||
651 | |||
652 | #define A_SCD_TIMER_INIT_2 0x0010020170 | ||
653 | #define A_SCD_TIMER_CNT_2 0x0010020180 | ||
654 | #define A_SCD_TIMER_CFG_2 0x0010020190 | ||
655 | |||
656 | #define A_SCD_TIMER_INIT_3 0x0010020178 | ||
657 | #define A_SCD_TIMER_CNT_3 0x0010020188 | ||
658 | #define A_SCD_TIMER_CFG_3 0x0010020198 | ||
659 | |||
660 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
661 | #define A_SCD_SCRATCH 0x0010020C10 | ||
662 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
663 | |||
664 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
665 | #define A_SCD_ZBBUS_CYCLE_COUNT 0x0010030000 | ||
666 | #define A_SCD_ZBBUS_CYCLE_CP0 0x0010020C00 | ||
667 | #define A_SCD_ZBBUS_CYCLE_CP1 0x0010020C08 | ||
668 | #endif | ||
669 | |||
670 | /* ********************************************************************* | ||
671 | * System Control Registers | ||
672 | ********************************************************************* */ | ||
673 | |||
674 | #define A_SCD_SYSTEM_REVISION 0x0010020000 | ||
675 | #define A_SCD_SYSTEM_CFG 0x0010020008 | ||
676 | #define A_SCD_SYSTEM_MANUF 0x0010038000 | ||
677 | |||
678 | /* ********************************************************************* | ||
679 | * System Address Trap Registers | ||
680 | ********************************************************************* */ | ||
681 | |||
682 | #define A_ADDR_TRAP_INDEX 0x00100200B0 | ||
683 | #define A_ADDR_TRAP_REG 0x00100200B8 | ||
684 | #define A_ADDR_TRAP_UP_0 0x0010020400 | ||
685 | #define A_ADDR_TRAP_UP_1 0x0010020408 | ||
686 | #define A_ADDR_TRAP_UP_2 0x0010020410 | ||
687 | #define A_ADDR_TRAP_UP_3 0x0010020418 | ||
688 | #define A_ADDR_TRAP_DOWN_0 0x0010020420 | ||
689 | #define A_ADDR_TRAP_DOWN_1 0x0010020428 | ||
690 | #define A_ADDR_TRAP_DOWN_2 0x0010020430 | ||
691 | #define A_ADDR_TRAP_DOWN_3 0x0010020438 | ||
692 | #define A_ADDR_TRAP_CFG_0 0x0010020440 | ||
693 | #define A_ADDR_TRAP_CFG_1 0x0010020448 | ||
694 | #define A_ADDR_TRAP_CFG_2 0x0010020450 | ||
695 | #define A_ADDR_TRAP_CFG_3 0x0010020458 | ||
696 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
697 | #define A_ADDR_TRAP_REG_DEBUG 0x0010020460 | ||
698 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
699 | |||
700 | #define ADDR_TRAP_SPACING 8 | ||
701 | #define NUM_ADDR_TRAP 4 | ||
702 | #define A_ADDR_TRAP_UP(n) (A_ADDR_TRAP_UP_0 + ((n) * ADDR_TRAP_SPACING)) | ||
703 | #define A_ADDR_TRAP_DOWN(n) (A_ADDR_TRAP_DOWN_0 + ((n) * ADDR_TRAP_SPACING)) | ||
704 | #define A_ADDR_TRAP_CFG(n) (A_ADDR_TRAP_CFG_0 + ((n) * ADDR_TRAP_SPACING)) | ||
705 | |||
706 | |||
707 | /* ********************************************************************* | ||
708 | * System Interrupt Mapper Registers | ||
709 | ********************************************************************* */ | ||
710 | |||
711 | #define A_IMR_CPU0_BASE 0x0010020000 | ||
712 | #define A_IMR_CPU1_BASE 0x0010022000 | ||
713 | #define IMR_REGISTER_SPACING 0x2000 | ||
714 | #define IMR_REGISTER_SPACING_SHIFT 13 | ||
715 | |||
716 | #define A_IMR_MAPPER(cpu) (A_IMR_CPU0_BASE+(cpu)*IMR_REGISTER_SPACING) | ||
717 | #define A_IMR_REGISTER(cpu, reg) (A_IMR_MAPPER(cpu)+(reg)) | ||
718 | |||
719 | #define R_IMR_INTERRUPT_DIAG 0x0010 | ||
720 | #define R_IMR_INTERRUPT_LDT 0x0018 | ||
721 | #define R_IMR_INTERRUPT_MASK 0x0028 | ||
722 | #define R_IMR_INTERRUPT_TRACE 0x0038 | ||
723 | #define R_IMR_INTERRUPT_SOURCE_STATUS 0x0040 | ||
724 | #define R_IMR_LDT_INTERRUPT_SET 0x0048 | ||
725 | #define R_IMR_LDT_INTERRUPT 0x0018 | ||
726 | #define R_IMR_LDT_INTERRUPT_CLR 0x0020 | ||
727 | #define R_IMR_MAILBOX_CPU 0x00c0 | ||
728 | #define R_IMR_ALIAS_MAILBOX_CPU 0x1000 | ||
729 | #define R_IMR_MAILBOX_SET_CPU 0x00C8 | ||
730 | #define R_IMR_ALIAS_MAILBOX_SET_CPU 0x1008 | ||
731 | #define R_IMR_MAILBOX_CLR_CPU 0x00D0 | ||
732 | #define R_IMR_INTERRUPT_STATUS_BASE 0x0100 | ||
733 | #define R_IMR_INTERRUPT_STATUS_COUNT 7 | ||
734 | #define R_IMR_INTERRUPT_MAP_BASE 0x0200 | ||
735 | #define R_IMR_INTERRUPT_MAP_COUNT 64 | ||
736 | |||
737 | /* | ||
738 | * these macros work together to build the address of a mailbox | ||
739 | * register, e.g., A_MAILBOX_REGISTER(R_IMR_MAILBOX_SET_CPU,1) | ||
740 | * for mbox_0_set_cpu2 returns 0x00100240C8 | ||
741 | */ | ||
742 | #define A_MAILBOX_REGISTER(reg,cpu) \ | ||
743 | (A_IMR_CPU0_BASE + (cpu * IMR_REGISTER_SPACING) + reg) | ||
744 | |||
745 | /* ********************************************************************* | ||
746 | * System Performance Counter Registers | ||
747 | ********************************************************************* */ | ||
748 | |||
749 | #define A_SCD_PERF_CNT_CFG 0x00100204C0 | ||
750 | #define A_SCD_PERF_CNT_0 0x00100204D0 | ||
751 | #define A_SCD_PERF_CNT_1 0x00100204D8 | ||
752 | #define A_SCD_PERF_CNT_2 0x00100204E0 | ||
753 | #define A_SCD_PERF_CNT_3 0x00100204E8 | ||
754 | |||
755 | #define SCD_NUM_PERF_CNT 4 | ||
756 | #define SCD_PERF_CNT_SPACING 8 | ||
757 | #define A_SCD_PERF_CNT(n) (A_SCD_PERF_CNT_0+(n*SCD_PERF_CNT_SPACING)) | ||
758 | |||
759 | /* ********************************************************************* | ||
760 | * System Bus Watcher Registers | ||
761 | ********************************************************************* */ | ||
762 | |||
763 | #define A_SCD_BUS_ERR_STATUS 0x0010020880 | ||
764 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
765 | #define A_SCD_BUS_ERR_STATUS_DEBUG 0x00100208D0 | ||
766 | #define A_BUS_ERR_STATUS_DEBUG 0x00100208D0 | ||
767 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
768 | #define A_BUS_ERR_DATA_0 0x00100208A0 | ||
769 | #define A_BUS_ERR_DATA_1 0x00100208A8 | ||
770 | #define A_BUS_ERR_DATA_2 0x00100208B0 | ||
771 | #define A_BUS_ERR_DATA_3 0x00100208B8 | ||
772 | #define A_BUS_L2_ERRORS 0x00100208C0 | ||
773 | #define A_BUS_MEM_IO_ERRORS 0x00100208C8 | ||
774 | |||
775 | /* ********************************************************************* | ||
776 | * System Debug Controller Registers | ||
777 | ********************************************************************* */ | ||
778 | |||
779 | #define A_SCD_JTAG_BASE 0x0010000000 | ||
780 | |||
781 | /* ********************************************************************* | ||
782 | * System Trace Buffer Registers | ||
783 | ********************************************************************* */ | ||
784 | |||
785 | #define A_SCD_TRACE_CFG 0x0010020A00 | ||
786 | #define A_SCD_TRACE_READ 0x0010020A08 | ||
787 | #define A_SCD_TRACE_EVENT_0 0x0010020A20 | ||
788 | #define A_SCD_TRACE_EVENT_1 0x0010020A28 | ||
789 | #define A_SCD_TRACE_EVENT_2 0x0010020A30 | ||
790 | #define A_SCD_TRACE_EVENT_3 0x0010020A38 | ||
791 | #define A_SCD_TRACE_SEQUENCE_0 0x0010020A40 | ||
792 | #define A_SCD_TRACE_SEQUENCE_1 0x0010020A48 | ||
793 | #define A_SCD_TRACE_SEQUENCE_2 0x0010020A50 | ||
794 | #define A_SCD_TRACE_SEQUENCE_3 0x0010020A58 | ||
795 | #define A_SCD_TRACE_EVENT_4 0x0010020A60 | ||
796 | #define A_SCD_TRACE_EVENT_5 0x0010020A68 | ||
797 | #define A_SCD_TRACE_EVENT_6 0x0010020A70 | ||
798 | #define A_SCD_TRACE_EVENT_7 0x0010020A78 | ||
799 | #define A_SCD_TRACE_SEQUENCE_4 0x0010020A80 | ||
800 | #define A_SCD_TRACE_SEQUENCE_5 0x0010020A88 | ||
801 | #define A_SCD_TRACE_SEQUENCE_6 0x0010020A90 | ||
802 | #define A_SCD_TRACE_SEQUENCE_7 0x0010020A98 | ||
803 | |||
804 | #define TRACE_REGISTER_SPACING 8 | ||
805 | #define TRACE_NUM_REGISTERS 8 | ||
806 | #define A_SCD_TRACE_EVENT(n) (((n) & 4) ? \ | ||
807 | (A_SCD_TRACE_EVENT_4 + (((n) & 3) * TRACE_REGISTER_SPACING)) : \ | ||
808 | (A_SCD_TRACE_EVENT_0 + ((n) * TRACE_REGISTER_SPACING))) | ||
809 | #define A_SCD_TRACE_SEQUENCE(n) (((n) & 4) ? \ | ||
810 | (A_SCD_TRACE_SEQUENCE_4 + (((n) & 3) * TRACE_REGISTER_SPACING)) : \ | ||
811 | (A_SCD_TRACE_SEQUENCE_0 + ((n) * TRACE_REGISTER_SPACING))) | ||
812 | |||
813 | /* ********************************************************************* | ||
814 | * System Generic DMA Registers | ||
815 | ********************************************************************* */ | ||
816 | |||
817 | #define A_DM_0 0x0010020B00 | ||
818 | #define A_DM_1 0x0010020B20 | ||
819 | #define A_DM_2 0x0010020B40 | ||
820 | #define A_DM_3 0x0010020B60 | ||
821 | #define DM_REGISTER_SPACING 0x20 | ||
822 | #define DM_NUM_CHANNELS 4 | ||
823 | #define A_DM_BASE(idx) (A_DM_0 + ((idx) * DM_REGISTER_SPACING)) | ||
824 | #define A_DM_REGISTER(idx, reg) (A_DM_BASE(idx) + (reg)) | ||
825 | |||
826 | #define R_DM_DSCR_BASE 0x0000000000 | ||
827 | #define R_DM_DSCR_COUNT 0x0000000008 | ||
828 | #define R_DM_CUR_DSCR_ADDR 0x0000000010 | ||
829 | #define R_DM_DSCR_BASE_DEBUG 0x0000000018 | ||
830 | |||
831 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
832 | #define A_DM_PARTIAL_0 0x0010020ba0 | ||
833 | #define A_DM_PARTIAL_1 0x0010020ba8 | ||
834 | #define A_DM_PARTIAL_2 0x0010020bb0 | ||
835 | #define A_DM_PARTIAL_3 0x0010020bb8 | ||
836 | #define DM_PARTIAL_REGISTER_SPACING 0x8 | ||
837 | #define A_DM_PARTIAL(idx) (A_DM_PARTIAL_0 + ((idx) * DM_PARTIAL_REGISTER_SPACING)) | ||
838 | #endif /* 1250 PASS3 || 112x PASS1 */ | ||
839 | |||
840 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
841 | #define A_DM_CRC_0 0x0010020b80 | ||
842 | #define A_DM_CRC_1 0x0010020b90 | ||
843 | #define DM_CRC_REGISTER_SPACING 0x10 | ||
844 | #define DM_CRC_NUM_CHANNELS 2 | ||
845 | #define A_DM_CRC_BASE(idx) (A_DM_CRC_0 + ((idx) * DM_CRC_REGISTER_SPACING)) | ||
846 | #define A_DM_CRC_REGISTER(idx, reg) (A_DM_CRC_BASE(idx) + (reg)) | ||
847 | |||
848 | #define R_CRC_DEF_0 0x00 | ||
849 | #define R_CTCP_DEF_0 0x08 | ||
850 | #endif /* 1250 PASS3 || 112x PASS1 */ | ||
851 | |||
852 | /* ********************************************************************* | ||
853 | * Physical Address Map | ||
854 | ********************************************************************* */ | ||
855 | |||
856 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
857 | #define A_PHYS_MEMORY_0 _SB_MAKE64(0x0000000000) | ||
858 | #define A_PHYS_MEMORY_SIZE _SB_MAKE64((256*1024*1024)) | ||
859 | #define A_PHYS_SYSTEM_CTL _SB_MAKE64(0x0010000000) | ||
860 | #define A_PHYS_IO_SYSTEM _SB_MAKE64(0x0010060000) | ||
861 | #define A_PHYS_GENBUS _SB_MAKE64(0x0010090000) | ||
862 | #define A_PHYS_GENBUS_END _SB_MAKE64(0x0040000000) | ||
863 | #define A_PHYS_LDTPCI_IO_MATCH_BYTES_32 _SB_MAKE64(0x0040000000) | ||
864 | #define A_PHYS_LDTPCI_IO_MATCH_BITS_32 _SB_MAKE64(0x0060000000) | ||
865 | #define A_PHYS_MEMORY_1 _SB_MAKE64(0x0080000000) | ||
866 | #define A_PHYS_MEMORY_2 _SB_MAKE64(0x0090000000) | ||
867 | #define A_PHYS_MEMORY_3 _SB_MAKE64(0x00C0000000) | ||
868 | #define A_PHYS_L2_CACHE_TEST _SB_MAKE64(0x00D0000000) | ||
869 | #define A_PHYS_LDT_SPECIAL_MATCH_BYTES _SB_MAKE64(0x00D8000000) | ||
870 | #define A_PHYS_LDTPCI_IO_MATCH_BYTES _SB_MAKE64(0x00DC000000) | ||
871 | #define A_PHYS_LDTPCI_CFG_MATCH_BYTES _SB_MAKE64(0x00DE000000) | ||
872 | #define A_PHYS_LDT_SPECIAL_MATCH_BITS _SB_MAKE64(0x00F8000000) | ||
873 | #define A_PHYS_LDTPCI_IO_MATCH_BITS _SB_MAKE64(0x00FC000000) | ||
874 | #define A_PHYS_LDTPCI_CFG_MATCH_BITS _SB_MAKE64(0x00FE000000) | ||
875 | #define A_PHYS_MEMORY_EXP _SB_MAKE64(0x0100000000) | ||
876 | #define A_PHYS_MEMORY_EXP_SIZE _SB_MAKE64((508*1024*1024*1024)) | ||
877 | #define A_PHYS_LDT_EXP _SB_MAKE64(0x8000000000) | ||
878 | #define A_PHYS_PCI_FULLACCESS_BYTES _SB_MAKE64(0xF000000000) | ||
879 | #define A_PHYS_PCI_FULLACCESS_BITS _SB_MAKE64(0xF100000000) | ||
880 | #define A_PHYS_RESERVED _SB_MAKE64(0xF200000000) | ||
881 | #define A_PHYS_RESERVED_SPECIAL_LDT _SB_MAKE64(0xFD00000000) | ||
882 | |||
883 | #define A_PHYS_L2CACHE_WAY_SIZE _SB_MAKE64(0x0000020000) | ||
884 | #define PHYS_L2CACHE_NUM_WAYS 4 | ||
885 | #define A_PHYS_L2CACHE_TOTAL_SIZE _SB_MAKE64(0x0000080000) | ||
886 | #define A_PHYS_L2CACHE_WAY0 _SB_MAKE64(0x00D0180000) | ||
887 | #define A_PHYS_L2CACHE_WAY1 _SB_MAKE64(0x00D01A0000) | ||
888 | #define A_PHYS_L2CACHE_WAY2 _SB_MAKE64(0x00D01C0000) | ||
889 | #define A_PHYS_L2CACHE_WAY3 _SB_MAKE64(0x00D01E0000) | ||
890 | #endif | ||
891 | |||
892 | |||
893 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_scd.h b/include/asm-mips/sibyte/sb1250_scd.h deleted file mode 100644 index e49c3e89b5ee..000000000000 --- a/include/asm-mips/sibyte/sb1250_scd.h +++ /dev/null | |||
@@ -1,654 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * SCD Constants and Macros File: sb1250_scd.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * manipulating the System Control and Debug module on the 1250. | ||
8 | * | ||
9 | * SB1250 specification level: User's manual 1/02/02 | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003,2004,2005 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | #ifndef _SB1250_SCD_H | ||
33 | #define _SB1250_SCD_H | ||
34 | |||
35 | #include "sb1250_defs.h" | ||
36 | |||
37 | /* ********************************************************************* | ||
38 | * System control/debug registers | ||
39 | ********************************************************************* */ | ||
40 | |||
41 | /* | ||
42 | * System Revision Register (Table 4-1) | ||
43 | */ | ||
44 | |||
45 | #define M_SYS_RESERVED _SB_MAKEMASK(8, 0) | ||
46 | |||
47 | #define S_SYS_REVISION _SB_MAKE64(8) | ||
48 | #define M_SYS_REVISION _SB_MAKEMASK(8, S_SYS_REVISION) | ||
49 | #define V_SYS_REVISION(x) _SB_MAKEVALUE(x, S_SYS_REVISION) | ||
50 | #define G_SYS_REVISION(x) _SB_GETVALUE(x, S_SYS_REVISION, M_SYS_REVISION) | ||
51 | |||
52 | #define K_SYS_REVISION_BCM1250_PASS1 0x01 | ||
53 | |||
54 | #define K_SYS_REVISION_BCM1250_PASS2 0x03 | ||
55 | #define K_SYS_REVISION_BCM1250_A1 0x03 /* Pass 2.0 WB */ | ||
56 | #define K_SYS_REVISION_BCM1250_A2 0x04 /* Pass 2.0 FC */ | ||
57 | #define K_SYS_REVISION_BCM1250_A3 0x05 /* Pass 2.1 FC */ | ||
58 | #define K_SYS_REVISION_BCM1250_A4 0x06 /* Pass 2.1 WB */ | ||
59 | #define K_SYS_REVISION_BCM1250_A6 0x07 /* OR 0x04 (A2) w/WID != 0 */ | ||
60 | #define K_SYS_REVISION_BCM1250_A8 0x0b /* A8/A10 */ | ||
61 | #define K_SYS_REVISION_BCM1250_A9 0x08 | ||
62 | #define K_SYS_REVISION_BCM1250_A10 K_SYS_REVISION_BCM1250_A8 | ||
63 | |||
64 | #define K_SYS_REVISION_BCM1250_PASS2_2 0x10 | ||
65 | #define K_SYS_REVISION_BCM1250_B0 K_SYS_REVISION_BCM1250_B1 | ||
66 | #define K_SYS_REVISION_BCM1250_B1 0x10 | ||
67 | #define K_SYS_REVISION_BCM1250_B2 0x11 | ||
68 | |||
69 | #define K_SYS_REVISION_BCM1250_C0 0x20 | ||
70 | #define K_SYS_REVISION_BCM1250_C1 0x21 | ||
71 | #define K_SYS_REVISION_BCM1250_C2 0x22 | ||
72 | #define K_SYS_REVISION_BCM1250_C3 0x23 | ||
73 | |||
74 | #if SIBYTE_HDR_FEATURE_CHIP(1250) | ||
75 | /* XXX: discourage people from using these constants. */ | ||
76 | #define K_SYS_REVISION_PASS1 K_SYS_REVISION_BCM1250_PASS1 | ||
77 | #define K_SYS_REVISION_PASS2 K_SYS_REVISION_BCM1250_PASS2 | ||
78 | #define K_SYS_REVISION_PASS2_2 K_SYS_REVISION_BCM1250_PASS2_2 | ||
79 | #define K_SYS_REVISION_PASS3 K_SYS_REVISION_BCM1250_PASS3 | ||
80 | #define K_SYS_REVISION_BCM1250_PASS3 K_SYS_REVISION_BCM1250_C0 | ||
81 | #endif /* 1250 */ | ||
82 | |||
83 | #define K_SYS_REVISION_BCM112x_A1 0x20 | ||
84 | #define K_SYS_REVISION_BCM112x_A2 0x21 | ||
85 | #define K_SYS_REVISION_BCM112x_A3 0x22 | ||
86 | #define K_SYS_REVISION_BCM112x_A4 0x23 | ||
87 | #define K_SYS_REVISION_BCM112x_B0 0x30 | ||
88 | |||
89 | #define K_SYS_REVISION_BCM1480_S0 0x01 | ||
90 | #define K_SYS_REVISION_BCM1480_A1 0x02 | ||
91 | #define K_SYS_REVISION_BCM1480_A2 0x03 | ||
92 | #define K_SYS_REVISION_BCM1480_A3 0x04 | ||
93 | #define K_SYS_REVISION_BCM1480_B0 0x11 | ||
94 | |||
95 | /*Cache size - 23:20 of revision register*/ | ||
96 | #define S_SYS_L2C_SIZE _SB_MAKE64(20) | ||
97 | #define M_SYS_L2C_SIZE _SB_MAKEMASK(4, S_SYS_L2C_SIZE) | ||
98 | #define V_SYS_L2C_SIZE(x) _SB_MAKEVALUE(x, S_SYS_L2C_SIZE) | ||
99 | #define G_SYS_L2C_SIZE(x) _SB_GETVALUE(x, S_SYS_L2C_SIZE, M_SYS_L2C_SIZE) | ||
100 | |||
101 | #define K_SYS_L2C_SIZE_1MB 0 | ||
102 | #define K_SYS_L2C_SIZE_512KB 5 | ||
103 | #define K_SYS_L2C_SIZE_256KB 2 | ||
104 | #define K_SYS_L2C_SIZE_128KB 1 | ||
105 | |||
106 | #define K_SYS_L2C_SIZE_BCM1250 K_SYS_L2C_SIZE_512KB | ||
107 | #define K_SYS_L2C_SIZE_BCM1125 K_SYS_L2C_SIZE_256KB | ||
108 | #define K_SYS_L2C_SIZE_BCM1122 K_SYS_L2C_SIZE_128KB | ||
109 | |||
110 | |||
111 | /* Number of CPU cores, bits 27:24 of revision register*/ | ||
112 | #define S_SYS_NUM_CPUS _SB_MAKE64(24) | ||
113 | #define M_SYS_NUM_CPUS _SB_MAKEMASK(4, S_SYS_NUM_CPUS) | ||
114 | #define V_SYS_NUM_CPUS(x) _SB_MAKEVALUE(x, S_SYS_NUM_CPUS) | ||
115 | #define G_SYS_NUM_CPUS(x) _SB_GETVALUE(x, S_SYS_NUM_CPUS, M_SYS_NUM_CPUS) | ||
116 | |||
117 | |||
118 | /* XXX: discourage people from using these constants. */ | ||
119 | #define S_SYS_PART _SB_MAKE64(16) | ||
120 | #define M_SYS_PART _SB_MAKEMASK(16, S_SYS_PART) | ||
121 | #define V_SYS_PART(x) _SB_MAKEVALUE(x, S_SYS_PART) | ||
122 | #define G_SYS_PART(x) _SB_GETVALUE(x, S_SYS_PART, M_SYS_PART) | ||
123 | |||
124 | /* XXX: discourage people from using these constants. */ | ||
125 | #define K_SYS_PART_SB1250 0x1250 | ||
126 | #define K_SYS_PART_BCM1120 0x1121 | ||
127 | #define K_SYS_PART_BCM1125 0x1123 | ||
128 | #define K_SYS_PART_BCM1125H 0x1124 | ||
129 | #define K_SYS_PART_BCM1122 0x1113 | ||
130 | |||
131 | |||
132 | /* The "peripheral set" (SOC type) is the low 4 bits of the "part" field. */ | ||
133 | #define S_SYS_SOC_TYPE _SB_MAKE64(16) | ||
134 | #define M_SYS_SOC_TYPE _SB_MAKEMASK(4, S_SYS_SOC_TYPE) | ||
135 | #define V_SYS_SOC_TYPE(x) _SB_MAKEVALUE(x, S_SYS_SOC_TYPE) | ||
136 | #define G_SYS_SOC_TYPE(x) _SB_GETVALUE(x, S_SYS_SOC_TYPE, M_SYS_SOC_TYPE) | ||
137 | |||
138 | #define K_SYS_SOC_TYPE_BCM1250 0x0 | ||
139 | #define K_SYS_SOC_TYPE_BCM1120 0x1 | ||
140 | #define K_SYS_SOC_TYPE_BCM1250_ALT 0x2 /* 1250pass2 w/ 1/4 L2. */ | ||
141 | #define K_SYS_SOC_TYPE_BCM1125 0x3 | ||
142 | #define K_SYS_SOC_TYPE_BCM1125H 0x4 | ||
143 | #define K_SYS_SOC_TYPE_BCM1250_ALT2 0x5 /* 1250pass2 w/ 1/2 L2. */ | ||
144 | #define K_SYS_SOC_TYPE_BCM1x80 0x6 | ||
145 | #define K_SYS_SOC_TYPE_BCM1x55 0x7 | ||
146 | |||
147 | /* | ||
148 | * Calculate correct SOC type given a copy of system revision register. | ||
149 | * | ||
150 | * (For the assembler version, sysrev and dest may be the same register. | ||
151 | * Also, it clobbers AT.) | ||
152 | */ | ||
153 | #ifdef __ASSEMBLER__ | ||
154 | #define SYS_SOC_TYPE(dest, sysrev) \ | ||
155 | .set push ; \ | ||
156 | .set reorder ; \ | ||
157 | dsrl dest, sysrev, S_SYS_SOC_TYPE ; \ | ||
158 | andi dest, dest, (M_SYS_SOC_TYPE >> S_SYS_SOC_TYPE); \ | ||
159 | beq dest, K_SYS_SOC_TYPE_BCM1250_ALT, 991f ; \ | ||
160 | beq dest, K_SYS_SOC_TYPE_BCM1250_ALT2, 991f ; \ | ||
161 | b 992f ; \ | ||
162 | 991: li dest, K_SYS_SOC_TYPE_BCM1250 ; \ | ||
163 | 992: \ | ||
164 | .set pop | ||
165 | #else | ||
166 | #define SYS_SOC_TYPE(sysrev) \ | ||
167 | ((G_SYS_SOC_TYPE(sysrev) == K_SYS_SOC_TYPE_BCM1250_ALT \ | ||
168 | || G_SYS_SOC_TYPE(sysrev) == K_SYS_SOC_TYPE_BCM1250_ALT2) \ | ||
169 | ? K_SYS_SOC_TYPE_BCM1250 : G_SYS_SOC_TYPE(sysrev)) | ||
170 | #endif | ||
171 | |||
172 | #define S_SYS_WID _SB_MAKE64(32) | ||
173 | #define M_SYS_WID _SB_MAKEMASK(32, S_SYS_WID) | ||
174 | #define V_SYS_WID(x) _SB_MAKEVALUE(x, S_SYS_WID) | ||
175 | #define G_SYS_WID(x) _SB_GETVALUE(x, S_SYS_WID, M_SYS_WID) | ||
176 | |||
177 | /* | ||
178 | * System Manufacturing Register | ||
179 | * Register: SCD_SYSTEM_MANUF | ||
180 | */ | ||
181 | |||
182 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
183 | /* Wafer ID: bits 31:0 */ | ||
184 | #define S_SYS_WAFERID1_200 _SB_MAKE64(0) | ||
185 | #define M_SYS_WAFERID1_200 _SB_MAKEMASK(32, S_SYS_WAFERID1_200) | ||
186 | #define V_SYS_WAFERID1_200(x) _SB_MAKEVALUE(x, S_SYS_WAFERID1_200) | ||
187 | #define G_SYS_WAFERID1_200(x) _SB_GETVALUE(x, S_SYS_WAFERID1_200, M_SYS_WAFERID1_200) | ||
188 | |||
189 | #define S_SYS_BIN _SB_MAKE64(32) | ||
190 | #define M_SYS_BIN _SB_MAKEMASK(4, S_SYS_BIN) | ||
191 | #define V_SYS_BIN(x) _SB_MAKEVALUE(x, S_SYS_BIN) | ||
192 | #define G_SYS_BIN(x) _SB_GETVALUE(x, S_SYS_BIN, M_SYS_BIN) | ||
193 | |||
194 | /* Wafer ID: bits 39:36 */ | ||
195 | #define S_SYS_WAFERID2_200 _SB_MAKE64(36) | ||
196 | #define M_SYS_WAFERID2_200 _SB_MAKEMASK(4, S_SYS_WAFERID2_200) | ||
197 | #define V_SYS_WAFERID2_200(x) _SB_MAKEVALUE(x, S_SYS_WAFERID2_200) | ||
198 | #define G_SYS_WAFERID2_200(x) _SB_GETVALUE(x, S_SYS_WAFERID2_200, M_SYS_WAFERID2_200) | ||
199 | |||
200 | /* Wafer ID: bits 39:0 */ | ||
201 | #define S_SYS_WAFERID_300 _SB_MAKE64(0) | ||
202 | #define M_SYS_WAFERID_300 _SB_MAKEMASK(40, S_SYS_WAFERID_300) | ||
203 | #define V_SYS_WAFERID_300(x) _SB_MAKEVALUE(x, S_SYS_WAFERID_300) | ||
204 | #define G_SYS_WAFERID_300(x) _SB_GETVALUE(x, S_SYS_WAFERID_300, M_SYS_WAFERID_300) | ||
205 | |||
206 | #define S_SYS_XPOS _SB_MAKE64(40) | ||
207 | #define M_SYS_XPOS _SB_MAKEMASK(6, S_SYS_XPOS) | ||
208 | #define V_SYS_XPOS(x) _SB_MAKEVALUE(x, S_SYS_XPOS) | ||
209 | #define G_SYS_XPOS(x) _SB_GETVALUE(x, S_SYS_XPOS, M_SYS_XPOS) | ||
210 | |||
211 | #define S_SYS_YPOS _SB_MAKE64(46) | ||
212 | #define M_SYS_YPOS _SB_MAKEMASK(6, S_SYS_YPOS) | ||
213 | #define V_SYS_YPOS(x) _SB_MAKEVALUE(x, S_SYS_YPOS) | ||
214 | #define G_SYS_YPOS(x) _SB_GETVALUE(x, S_SYS_YPOS, M_SYS_YPOS) | ||
215 | #endif | ||
216 | |||
217 | |||
218 | /* | ||
219 | * System Config Register (Table 4-2) | ||
220 | * Register: SCD_SYSTEM_CFG | ||
221 | */ | ||
222 | |||
223 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
224 | #define M_SYS_LDT_PLL_BYP _SB_MAKEMASK1(3) | ||
225 | #define M_SYS_PCI_SYNC_TEST_MODE _SB_MAKEMASK1(4) | ||
226 | #define M_SYS_IOB0_DIV _SB_MAKEMASK1(5) | ||
227 | #define M_SYS_IOB1_DIV _SB_MAKEMASK1(6) | ||
228 | |||
229 | #define S_SYS_PLL_DIV _SB_MAKE64(7) | ||
230 | #define M_SYS_PLL_DIV _SB_MAKEMASK(5, S_SYS_PLL_DIV) | ||
231 | #define V_SYS_PLL_DIV(x) _SB_MAKEVALUE(x, S_SYS_PLL_DIV) | ||
232 | #define G_SYS_PLL_DIV(x) _SB_GETVALUE(x, S_SYS_PLL_DIV, M_SYS_PLL_DIV) | ||
233 | |||
234 | #define M_SYS_SER0_ENABLE _SB_MAKEMASK1(12) | ||
235 | #define M_SYS_SER0_RSTB_EN _SB_MAKEMASK1(13) | ||
236 | #define M_SYS_SER1_ENABLE _SB_MAKEMASK1(14) | ||
237 | #define M_SYS_SER1_RSTB_EN _SB_MAKEMASK1(15) | ||
238 | #define M_SYS_PCMCIA_ENABLE _SB_MAKEMASK1(16) | ||
239 | |||
240 | #define S_SYS_BOOT_MODE _SB_MAKE64(17) | ||
241 | #define M_SYS_BOOT_MODE _SB_MAKEMASK(2, S_SYS_BOOT_MODE) | ||
242 | #define V_SYS_BOOT_MODE(x) _SB_MAKEVALUE(x, S_SYS_BOOT_MODE) | ||
243 | #define G_SYS_BOOT_MODE(x) _SB_GETVALUE(x, S_SYS_BOOT_MODE, M_SYS_BOOT_MODE) | ||
244 | #define K_SYS_BOOT_MODE_ROM32 0 | ||
245 | #define K_SYS_BOOT_MODE_ROM8 1 | ||
246 | #define K_SYS_BOOT_MODE_SMBUS_SMALL 2 | ||
247 | #define K_SYS_BOOT_MODE_SMBUS_BIG 3 | ||
248 | |||
249 | #define M_SYS_PCI_HOST _SB_MAKEMASK1(19) | ||
250 | #define M_SYS_PCI_ARBITER _SB_MAKEMASK1(20) | ||
251 | #define M_SYS_SOUTH_ON_LDT _SB_MAKEMASK1(21) | ||
252 | #define M_SYS_BIG_ENDIAN _SB_MAKEMASK1(22) | ||
253 | #define M_SYS_GENCLK_EN _SB_MAKEMASK1(23) | ||
254 | #define M_SYS_LDT_TEST_EN _SB_MAKEMASK1(24) | ||
255 | #define M_SYS_GEN_PARITY_EN _SB_MAKEMASK1(25) | ||
256 | |||
257 | #define S_SYS_CONFIG 26 | ||
258 | #define M_SYS_CONFIG _SB_MAKEMASK(6, S_SYS_CONFIG) | ||
259 | #define V_SYS_CONFIG(x) _SB_MAKEVALUE(x, S_SYS_CONFIG) | ||
260 | #define G_SYS_CONFIG(x) _SB_GETVALUE(x, S_SYS_CONFIG, M_SYS_CONFIG) | ||
261 | |||
262 | /* The following bits are writeable by JTAG only. */ | ||
263 | |||
264 | #define M_SYS_CLKSTOP _SB_MAKEMASK1(32) | ||
265 | #define M_SYS_CLKSTEP _SB_MAKEMASK1(33) | ||
266 | |||
267 | #define S_SYS_CLKCOUNT 34 | ||
268 | #define M_SYS_CLKCOUNT _SB_MAKEMASK(8, S_SYS_CLKCOUNT) | ||
269 | #define V_SYS_CLKCOUNT(x) _SB_MAKEVALUE(x, S_SYS_CLKCOUNT) | ||
270 | #define G_SYS_CLKCOUNT(x) _SB_GETVALUE(x, S_SYS_CLKCOUNT, M_SYS_CLKCOUNT) | ||
271 | |||
272 | #define M_SYS_PLL_BYPASS _SB_MAKEMASK1(42) | ||
273 | |||
274 | #define S_SYS_PLL_IREF 43 | ||
275 | #define M_SYS_PLL_IREF _SB_MAKEMASK(2, S_SYS_PLL_IREF) | ||
276 | |||
277 | #define S_SYS_PLL_VCO 45 | ||
278 | #define M_SYS_PLL_VCO _SB_MAKEMASK(2, S_SYS_PLL_VCO) | ||
279 | |||
280 | #define S_SYS_PLL_VREG 47 | ||
281 | #define M_SYS_PLL_VREG _SB_MAKEMASK(2, S_SYS_PLL_VREG) | ||
282 | |||
283 | #define M_SYS_MEM_RESET _SB_MAKEMASK1(49) | ||
284 | #define M_SYS_L2C_RESET _SB_MAKEMASK1(50) | ||
285 | #define M_SYS_IO_RESET_0 _SB_MAKEMASK1(51) | ||
286 | #define M_SYS_IO_RESET_1 _SB_MAKEMASK1(52) | ||
287 | #define M_SYS_SCD_RESET _SB_MAKEMASK1(53) | ||
288 | |||
289 | /* End of bits writable by JTAG only. */ | ||
290 | |||
291 | #define M_SYS_CPU_RESET_0 _SB_MAKEMASK1(54) | ||
292 | #define M_SYS_CPU_RESET_1 _SB_MAKEMASK1(55) | ||
293 | |||
294 | #define M_SYS_UNICPU0 _SB_MAKEMASK1(56) | ||
295 | #define M_SYS_UNICPU1 _SB_MAKEMASK1(57) | ||
296 | |||
297 | #define M_SYS_SB_SOFTRES _SB_MAKEMASK1(58) | ||
298 | #define M_SYS_EXT_RESET _SB_MAKEMASK1(59) | ||
299 | #define M_SYS_SYSTEM_RESET _SB_MAKEMASK1(60) | ||
300 | |||
301 | #define M_SYS_MISR_MODE _SB_MAKEMASK1(61) | ||
302 | #define M_SYS_MISR_RESET _SB_MAKEMASK1(62) | ||
303 | |||
304 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | ||
305 | #define M_SYS_SW_FLAG _SB_MAKEMASK1(63) | ||
306 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
307 | |||
308 | #endif | ||
309 | |||
310 | |||
311 | /* | ||
312 | * Mailbox Registers (Table 4-3) | ||
313 | * Registers: SCD_MBOX_CPU_x | ||
314 | */ | ||
315 | |||
316 | #define S_MBOX_INT_3 0 | ||
317 | #define M_MBOX_INT_3 _SB_MAKEMASK(16, S_MBOX_INT_3) | ||
318 | #define S_MBOX_INT_2 16 | ||
319 | #define M_MBOX_INT_2 _SB_MAKEMASK(16, S_MBOX_INT_2) | ||
320 | #define S_MBOX_INT_1 32 | ||
321 | #define M_MBOX_INT_1 _SB_MAKEMASK(16, S_MBOX_INT_1) | ||
322 | #define S_MBOX_INT_0 48 | ||
323 | #define M_MBOX_INT_0 _SB_MAKEMASK(16, S_MBOX_INT_0) | ||
324 | |||
325 | /* | ||
326 | * Watchdog Registers (Table 4-8) (Table 4-9) (Table 4-10) | ||
327 | * Registers: SCD_WDOG_INIT_CNT_x | ||
328 | */ | ||
329 | |||
330 | #define V_SCD_WDOG_FREQ 1000000 | ||
331 | |||
332 | #define S_SCD_WDOG_INIT 0 | ||
333 | #define M_SCD_WDOG_INIT _SB_MAKEMASK(23, S_SCD_WDOG_INIT) | ||
334 | |||
335 | #define S_SCD_WDOG_CNT 0 | ||
336 | #define M_SCD_WDOG_CNT _SB_MAKEMASK(23, S_SCD_WDOG_CNT) | ||
337 | |||
338 | #define S_SCD_WDOG_ENABLE 0 | ||
339 | #define M_SCD_WDOG_ENABLE _SB_MAKEMASK1(S_SCD_WDOG_ENABLE) | ||
340 | |||
341 | #define S_SCD_WDOG_RESET_TYPE 2 | ||
342 | #define M_SCD_WDOG_RESET_TYPE _SB_MAKEMASK(3, S_SCD_WDOG_RESET_TYPE) | ||
343 | #define V_SCD_WDOG_RESET_TYPE(x) _SB_MAKEVALUE(x, S_SCD_WDOG_RESET_TYPE) | ||
344 | #define G_SCD_WDOG_RESET_TYPE(x) _SB_GETVALUE(x, S_SCD_WDOG_RESET_TYPE, M_SCD_WDOG_RESET_TYPE) | ||
345 | |||
346 | #define K_SCD_WDOG_RESET_FULL 0 /* actually, (x & 1) == 0 */ | ||
347 | #define K_SCD_WDOG_RESET_SOFT 1 | ||
348 | #define K_SCD_WDOG_RESET_CPU0 3 | ||
349 | #define K_SCD_WDOG_RESET_CPU1 5 | ||
350 | #define K_SCD_WDOG_RESET_BOTH_CPUS 7 | ||
351 | |||
352 | /* This feature is present in 1250 C0 and later, but *not* in 112x A revs. */ | ||
353 | #if SIBYTE_HDR_FEATURE(1250, PASS3) | ||
354 | #define S_SCD_WDOG_HAS_RESET 8 | ||
355 | #define M_SCD_WDOG_HAS_RESET _SB_MAKEMASK1(S_SCD_WDOG_HAS_RESET) | ||
356 | #endif | ||
357 | |||
358 | |||
359 | /* | ||
360 | * Timer Registers (Table 4-11) (Table 4-12) (Table 4-13) | ||
361 | */ | ||
362 | |||
363 | #define V_SCD_TIMER_FREQ 1000000 | ||
364 | |||
365 | #define S_SCD_TIMER_INIT 0 | ||
366 | #define M_SCD_TIMER_INIT _SB_MAKEMASK(23, S_SCD_TIMER_INIT) | ||
367 | #define V_SCD_TIMER_INIT(x) _SB_MAKEVALUE(x, S_SCD_TIMER_INIT) | ||
368 | #define G_SCD_TIMER_INIT(x) _SB_GETVALUE(x, S_SCD_TIMER_INIT, M_SCD_TIMER_INIT) | ||
369 | |||
370 | #define V_SCD_TIMER_WIDTH 23 | ||
371 | #define S_SCD_TIMER_CNT 0 | ||
372 | #define M_SCD_TIMER_CNT _SB_MAKEMASK(V_SCD_TIMER_WIDTH, S_SCD_TIMER_CNT) | ||
373 | #define V_SCD_TIMER_CNT(x) _SB_MAKEVALUE(x, S_SCD_TIMER_CNT) | ||
374 | #define G_SCD_TIMER_CNT(x) _SB_GETVALUE(x, S_SCD_TIMER_CNT, M_SCD_TIMER_CNT) | ||
375 | |||
376 | #define M_SCD_TIMER_ENABLE _SB_MAKEMASK1(0) | ||
377 | #define M_SCD_TIMER_MODE _SB_MAKEMASK1(1) | ||
378 | #define M_SCD_TIMER_MODE_CONTINUOUS M_SCD_TIMER_MODE | ||
379 | |||
380 | /* | ||
381 | * System Performance Counters | ||
382 | */ | ||
383 | |||
384 | #define S_SPC_CFG_SRC0 0 | ||
385 | #define M_SPC_CFG_SRC0 _SB_MAKEMASK(8, S_SPC_CFG_SRC0) | ||
386 | #define V_SPC_CFG_SRC0(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC0) | ||
387 | #define G_SPC_CFG_SRC0(x) _SB_GETVALUE(x, S_SPC_CFG_SRC0, M_SPC_CFG_SRC0) | ||
388 | |||
389 | #define S_SPC_CFG_SRC1 8 | ||
390 | #define M_SPC_CFG_SRC1 _SB_MAKEMASK(8, S_SPC_CFG_SRC1) | ||
391 | #define V_SPC_CFG_SRC1(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC1) | ||
392 | #define G_SPC_CFG_SRC1(x) _SB_GETVALUE(x, S_SPC_CFG_SRC1, M_SPC_CFG_SRC1) | ||
393 | |||
394 | #define S_SPC_CFG_SRC2 16 | ||
395 | #define M_SPC_CFG_SRC2 _SB_MAKEMASK(8, S_SPC_CFG_SRC2) | ||
396 | #define V_SPC_CFG_SRC2(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC2) | ||
397 | #define G_SPC_CFG_SRC2(x) _SB_GETVALUE(x, S_SPC_CFG_SRC2, M_SPC_CFG_SRC2) | ||
398 | |||
399 | #define S_SPC_CFG_SRC3 24 | ||
400 | #define M_SPC_CFG_SRC3 _SB_MAKEMASK(8, S_SPC_CFG_SRC3) | ||
401 | #define V_SPC_CFG_SRC3(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC3) | ||
402 | #define G_SPC_CFG_SRC3(x) _SB_GETVALUE(x, S_SPC_CFG_SRC3, M_SPC_CFG_SRC3) | ||
403 | |||
404 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
405 | #define M_SPC_CFG_CLEAR _SB_MAKEMASK1(32) | ||
406 | #define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33) | ||
407 | #endif | ||
408 | |||
409 | |||
410 | /* | ||
411 | * Bus Watcher | ||
412 | */ | ||
413 | |||
414 | #define S_SCD_BERR_TID 8 | ||
415 | #define M_SCD_BERR_TID _SB_MAKEMASK(10, S_SCD_BERR_TID) | ||
416 | #define V_SCD_BERR_TID(x) _SB_MAKEVALUE(x, S_SCD_BERR_TID) | ||
417 | #define G_SCD_BERR_TID(x) _SB_GETVALUE(x, S_SCD_BERR_TID, M_SCD_BERR_TID) | ||
418 | |||
419 | #define S_SCD_BERR_RID 18 | ||
420 | #define M_SCD_BERR_RID _SB_MAKEMASK(4, S_SCD_BERR_RID) | ||
421 | #define V_SCD_BERR_RID(x) _SB_MAKEVALUE(x, S_SCD_BERR_RID) | ||
422 | #define G_SCD_BERR_RID(x) _SB_GETVALUE(x, S_SCD_BERR_RID, M_SCD_BERR_RID) | ||
423 | |||
424 | #define S_SCD_BERR_DCODE 22 | ||
425 | #define M_SCD_BERR_DCODE _SB_MAKEMASK(3, S_SCD_BERR_DCODE) | ||
426 | #define V_SCD_BERR_DCODE(x) _SB_MAKEVALUE(x, S_SCD_BERR_DCODE) | ||
427 | #define G_SCD_BERR_DCODE(x) _SB_GETVALUE(x, S_SCD_BERR_DCODE, M_SCD_BERR_DCODE) | ||
428 | |||
429 | #define M_SCD_BERR_MULTERRS _SB_MAKEMASK1(30) | ||
430 | |||
431 | |||
432 | #define S_SCD_L2ECC_CORR_D 0 | ||
433 | #define M_SCD_L2ECC_CORR_D _SB_MAKEMASK(8, S_SCD_L2ECC_CORR_D) | ||
434 | #define V_SCD_L2ECC_CORR_D(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_CORR_D) | ||
435 | #define G_SCD_L2ECC_CORR_D(x) _SB_GETVALUE(x, S_SCD_L2ECC_CORR_D, M_SCD_L2ECC_CORR_D) | ||
436 | |||
437 | #define S_SCD_L2ECC_BAD_D 8 | ||
438 | #define M_SCD_L2ECC_BAD_D _SB_MAKEMASK(8, S_SCD_L2ECC_BAD_D) | ||
439 | #define V_SCD_L2ECC_BAD_D(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_BAD_D) | ||
440 | #define G_SCD_L2ECC_BAD_D(x) _SB_GETVALUE(x, S_SCD_L2ECC_BAD_D, M_SCD_L2ECC_BAD_D) | ||
441 | |||
442 | #define S_SCD_L2ECC_CORR_T 16 | ||
443 | #define M_SCD_L2ECC_CORR_T _SB_MAKEMASK(8, S_SCD_L2ECC_CORR_T) | ||
444 | #define V_SCD_L2ECC_CORR_T(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_CORR_T) | ||
445 | #define G_SCD_L2ECC_CORR_T(x) _SB_GETVALUE(x, S_SCD_L2ECC_CORR_T, M_SCD_L2ECC_CORR_T) | ||
446 | |||
447 | #define S_SCD_L2ECC_BAD_T 24 | ||
448 | #define M_SCD_L2ECC_BAD_T _SB_MAKEMASK(8, S_SCD_L2ECC_BAD_T) | ||
449 | #define V_SCD_L2ECC_BAD_T(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_BAD_T) | ||
450 | #define G_SCD_L2ECC_BAD_T(x) _SB_GETVALUE(x, S_SCD_L2ECC_BAD_T, M_SCD_L2ECC_BAD_T) | ||
451 | |||
452 | #define S_SCD_MEM_ECC_CORR 0 | ||
453 | #define M_SCD_MEM_ECC_CORR _SB_MAKEMASK(8, S_SCD_MEM_ECC_CORR) | ||
454 | #define V_SCD_MEM_ECC_CORR(x) _SB_MAKEVALUE(x, S_SCD_MEM_ECC_CORR) | ||
455 | #define G_SCD_MEM_ECC_CORR(x) _SB_GETVALUE(x, S_SCD_MEM_ECC_CORR, M_SCD_MEM_ECC_CORR) | ||
456 | |||
457 | #define S_SCD_MEM_ECC_BAD 8 | ||
458 | #define M_SCD_MEM_ECC_BAD _SB_MAKEMASK(8, S_SCD_MEM_ECC_BAD) | ||
459 | #define V_SCD_MEM_ECC_BAD(x) _SB_MAKEVALUE(x, S_SCD_MEM_ECC_BAD) | ||
460 | #define G_SCD_MEM_ECC_BAD(x) _SB_GETVALUE(x, S_SCD_MEM_ECC_BAD, M_SCD_MEM_ECC_BAD) | ||
461 | |||
462 | #define S_SCD_MEM_BUSERR 16 | ||
463 | #define M_SCD_MEM_BUSERR _SB_MAKEMASK(8, S_SCD_MEM_BUSERR) | ||
464 | #define V_SCD_MEM_BUSERR(x) _SB_MAKEVALUE(x, S_SCD_MEM_BUSERR) | ||
465 | #define G_SCD_MEM_BUSERR(x) _SB_GETVALUE(x, S_SCD_MEM_BUSERR, M_SCD_MEM_BUSERR) | ||
466 | |||
467 | |||
468 | /* | ||
469 | * Address Trap Registers | ||
470 | */ | ||
471 | |||
472 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
473 | #define M_ATRAP_INDEX _SB_MAKEMASK(4, 0) | ||
474 | #define M_ATRAP_ADDRESS _SB_MAKEMASK(40, 0) | ||
475 | |||
476 | #define S_ATRAP_CFG_CNT 0 | ||
477 | #define M_ATRAP_CFG_CNT _SB_MAKEMASK(3, S_ATRAP_CFG_CNT) | ||
478 | #define V_ATRAP_CFG_CNT(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_CNT) | ||
479 | #define G_ATRAP_CFG_CNT(x) _SB_GETVALUE(x, S_ATRAP_CFG_CNT, M_ATRAP_CFG_CNT) | ||
480 | |||
481 | #define M_ATRAP_CFG_WRITE _SB_MAKEMASK1(3) | ||
482 | #define M_ATRAP_CFG_ALL _SB_MAKEMASK1(4) | ||
483 | #define M_ATRAP_CFG_INV _SB_MAKEMASK1(5) | ||
484 | #define M_ATRAP_CFG_USESRC _SB_MAKEMASK1(6) | ||
485 | #define M_ATRAP_CFG_SRCINV _SB_MAKEMASK1(7) | ||
486 | |||
487 | #define S_ATRAP_CFG_AGENTID 8 | ||
488 | #define M_ATRAP_CFG_AGENTID _SB_MAKEMASK(4, S_ATRAP_CFG_AGENTID) | ||
489 | #define V_ATRAP_CFG_AGENTID(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_AGENTID) | ||
490 | #define G_ATRAP_CFG_AGENTID(x) _SB_GETVALUE(x, S_ATRAP_CFG_AGENTID, M_ATRAP_CFG_AGENTID) | ||
491 | |||
492 | #define K_BUS_AGENT_CPU0 0 | ||
493 | #define K_BUS_AGENT_CPU1 1 | ||
494 | #define K_BUS_AGENT_IOB0 2 | ||
495 | #define K_BUS_AGENT_IOB1 3 | ||
496 | #define K_BUS_AGENT_SCD 4 | ||
497 | #define K_BUS_AGENT_L2C 6 | ||
498 | #define K_BUS_AGENT_MC 7 | ||
499 | |||
500 | #define S_ATRAP_CFG_CATTR 12 | ||
501 | #define M_ATRAP_CFG_CATTR _SB_MAKEMASK(3, S_ATRAP_CFG_CATTR) | ||
502 | #define V_ATRAP_CFG_CATTR(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_CATTR) | ||
503 | #define G_ATRAP_CFG_CATTR(x) _SB_GETVALUE(x, S_ATRAP_CFG_CATTR, M_ATRAP_CFG_CATTR) | ||
504 | |||
505 | #define K_ATRAP_CFG_CATTR_IGNORE 0 | ||
506 | #define K_ATRAP_CFG_CATTR_UNC 1 | ||
507 | #define K_ATRAP_CFG_CATTR_CACHEABLE 2 | ||
508 | #define K_ATRAP_CFG_CATTR_NONCOH 3 | ||
509 | #define K_ATRAP_CFG_CATTR_COHERENT 4 | ||
510 | #define K_ATRAP_CFG_CATTR_NOTUNC 5 | ||
511 | #define K_ATRAP_CFG_CATTR_NOTNONCOH 6 | ||
512 | #define K_ATRAP_CFG_CATTR_NOTCOHERENT 7 | ||
513 | |||
514 | #endif /* 1250/112x */ | ||
515 | |||
516 | /* | ||
517 | * Trace Buffer Config register | ||
518 | */ | ||
519 | |||
520 | #define M_SCD_TRACE_CFG_RESET _SB_MAKEMASK1(0) | ||
521 | #define M_SCD_TRACE_CFG_START_READ _SB_MAKEMASK1(1) | ||
522 | #define M_SCD_TRACE_CFG_START _SB_MAKEMASK1(2) | ||
523 | #define M_SCD_TRACE_CFG_STOP _SB_MAKEMASK1(3) | ||
524 | #define M_SCD_TRACE_CFG_FREEZE _SB_MAKEMASK1(4) | ||
525 | #define M_SCD_TRACE_CFG_FREEZE_FULL _SB_MAKEMASK1(5) | ||
526 | #define M_SCD_TRACE_CFG_DEBUG_FULL _SB_MAKEMASK1(6) | ||
527 | #define M_SCD_TRACE_CFG_FULL _SB_MAKEMASK1(7) | ||
528 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
529 | #define M_SCD_TRACE_CFG_FORCECNT _SB_MAKEMASK1(8) | ||
530 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
531 | |||
532 | /* | ||
533 | * This field is the same on the 1250/112x and 1480, just located in | ||
534 | * a slightly different place in the register. | ||
535 | */ | ||
536 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
537 | #define S_SCD_TRACE_CFG_CUR_ADDR 10 | ||
538 | #else | ||
539 | #if SIBYTE_HDR_FEATURE_CHIP(1480) | ||
540 | #define S_SCD_TRACE_CFG_CUR_ADDR 24 | ||
541 | #endif /* 1480 */ | ||
542 | #endif /* 1250/112x */ | ||
543 | |||
544 | #define M_SCD_TRACE_CFG_CUR_ADDR _SB_MAKEMASK(8, S_SCD_TRACE_CFG_CUR_ADDR) | ||
545 | #define V_SCD_TRACE_CFG_CUR_ADDR(x) _SB_MAKEVALUE(x, S_SCD_TRACE_CFG_CUR_ADDR) | ||
546 | #define G_SCD_TRACE_CFG_CUR_ADDR(x) _SB_GETVALUE(x, S_SCD_TRACE_CFG_CUR_ADDR, M_SCD_TRACE_CFG_CUR_ADDR) | ||
547 | |||
548 | /* | ||
549 | * Trace Event registers | ||
550 | */ | ||
551 | |||
552 | #define S_SCD_TREVT_ADDR_MATCH 0 | ||
553 | #define M_SCD_TREVT_ADDR_MATCH _SB_MAKEMASK(4, S_SCD_TREVT_ADDR_MATCH) | ||
554 | #define V_SCD_TREVT_ADDR_MATCH(x) _SB_MAKEVALUE(x, S_SCD_TREVT_ADDR_MATCH) | ||
555 | #define G_SCD_TREVT_ADDR_MATCH(x) _SB_GETVALUE(x, S_SCD_TREVT_ADDR_MATCH, M_SCD_TREVT_ADDR_MATCH) | ||
556 | |||
557 | #define M_SCD_TREVT_REQID_MATCH _SB_MAKEMASK1(4) | ||
558 | #define M_SCD_TREVT_DATAID_MATCH _SB_MAKEMASK1(5) | ||
559 | #define M_SCD_TREVT_RESPID_MATCH _SB_MAKEMASK1(6) | ||
560 | #define M_SCD_TREVT_INTERRUPT _SB_MAKEMASK1(7) | ||
561 | #define M_SCD_TREVT_DEBUG_PIN _SB_MAKEMASK1(9) | ||
562 | #define M_SCD_TREVT_WRITE _SB_MAKEMASK1(10) | ||
563 | #define M_SCD_TREVT_READ _SB_MAKEMASK1(11) | ||
564 | |||
565 | #define S_SCD_TREVT_REQID 12 | ||
566 | #define M_SCD_TREVT_REQID _SB_MAKEMASK(4, S_SCD_TREVT_REQID) | ||
567 | #define V_SCD_TREVT_REQID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_REQID) | ||
568 | #define G_SCD_TREVT_REQID(x) _SB_GETVALUE(x, S_SCD_TREVT_REQID, M_SCD_TREVT_REQID) | ||
569 | |||
570 | #define S_SCD_TREVT_RESPID 16 | ||
571 | #define M_SCD_TREVT_RESPID _SB_MAKEMASK(4, S_SCD_TREVT_RESPID) | ||
572 | #define V_SCD_TREVT_RESPID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_RESPID) | ||
573 | #define G_SCD_TREVT_RESPID(x) _SB_GETVALUE(x, S_SCD_TREVT_RESPID, M_SCD_TREVT_RESPID) | ||
574 | |||
575 | #define S_SCD_TREVT_DATAID 20 | ||
576 | #define M_SCD_TREVT_DATAID _SB_MAKEMASK(4, S_SCD_TREVT_DATAID) | ||
577 | #define V_SCD_TREVT_DATAID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_DATAID) | ||
578 | #define G_SCD_TREVT_DATAID(x) _SB_GETVALUE(x, S_SCD_TREVT_DATAID, M_SCD_TREVT_DATID) | ||
579 | |||
580 | #define S_SCD_TREVT_COUNT 24 | ||
581 | #define M_SCD_TREVT_COUNT _SB_MAKEMASK(8, S_SCD_TREVT_COUNT) | ||
582 | #define V_SCD_TREVT_COUNT(x) _SB_MAKEVALUE(x, S_SCD_TREVT_COUNT) | ||
583 | #define G_SCD_TREVT_COUNT(x) _SB_GETVALUE(x, S_SCD_TREVT_COUNT, M_SCD_TREVT_COUNT) | ||
584 | |||
585 | /* | ||
586 | * Trace Sequence registers | ||
587 | */ | ||
588 | |||
589 | #define S_SCD_TRSEQ_EVENT4 0 | ||
590 | #define M_SCD_TRSEQ_EVENT4 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT4) | ||
591 | #define V_SCD_TRSEQ_EVENT4(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT4) | ||
592 | #define G_SCD_TRSEQ_EVENT4(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT4, M_SCD_TRSEQ_EVENT4) | ||
593 | |||
594 | #define S_SCD_TRSEQ_EVENT3 4 | ||
595 | #define M_SCD_TRSEQ_EVENT3 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT3) | ||
596 | #define V_SCD_TRSEQ_EVENT3(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT3) | ||
597 | #define G_SCD_TRSEQ_EVENT3(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT3, M_SCD_TRSEQ_EVENT3) | ||
598 | |||
599 | #define S_SCD_TRSEQ_EVENT2 8 | ||
600 | #define M_SCD_TRSEQ_EVENT2 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT2) | ||
601 | #define V_SCD_TRSEQ_EVENT2(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT2) | ||
602 | #define G_SCD_TRSEQ_EVENT2(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT2, M_SCD_TRSEQ_EVENT2) | ||
603 | |||
604 | #define S_SCD_TRSEQ_EVENT1 12 | ||
605 | #define M_SCD_TRSEQ_EVENT1 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT1) | ||
606 | #define V_SCD_TRSEQ_EVENT1(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT1) | ||
607 | #define G_SCD_TRSEQ_EVENT1(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT1, M_SCD_TRSEQ_EVENT1) | ||
608 | |||
609 | #define K_SCD_TRSEQ_E0 0 | ||
610 | #define K_SCD_TRSEQ_E1 1 | ||
611 | #define K_SCD_TRSEQ_E2 2 | ||
612 | #define K_SCD_TRSEQ_E3 3 | ||
613 | #define K_SCD_TRSEQ_E0_E1 4 | ||
614 | #define K_SCD_TRSEQ_E1_E2 5 | ||
615 | #define K_SCD_TRSEQ_E2_E3 6 | ||
616 | #define K_SCD_TRSEQ_E0_E1_E2 7 | ||
617 | #define K_SCD_TRSEQ_E0_E1_E2_E3 8 | ||
618 | #define K_SCD_TRSEQ_E0E1 9 | ||
619 | #define K_SCD_TRSEQ_E0E1E2 10 | ||
620 | #define K_SCD_TRSEQ_E0E1E2E3 11 | ||
621 | #define K_SCD_TRSEQ_E0E1_E2 12 | ||
622 | #define K_SCD_TRSEQ_E0E1_E2E3 13 | ||
623 | #define K_SCD_TRSEQ_E0E1_E2_E3 14 | ||
624 | #define K_SCD_TRSEQ_IGNORED 15 | ||
625 | |||
626 | #define K_SCD_TRSEQ_TRIGGER_ALL (V_SCD_TRSEQ_EVENT1(K_SCD_TRSEQ_IGNORED) | \ | ||
627 | V_SCD_TRSEQ_EVENT2(K_SCD_TRSEQ_IGNORED) | \ | ||
628 | V_SCD_TRSEQ_EVENT3(K_SCD_TRSEQ_IGNORED) | \ | ||
629 | V_SCD_TRSEQ_EVENT4(K_SCD_TRSEQ_IGNORED)) | ||
630 | |||
631 | #define S_SCD_TRSEQ_FUNCTION 16 | ||
632 | #define M_SCD_TRSEQ_FUNCTION _SB_MAKEMASK(4, S_SCD_TRSEQ_FUNCTION) | ||
633 | #define V_SCD_TRSEQ_FUNCTION(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_FUNCTION) | ||
634 | #define G_SCD_TRSEQ_FUNCTION(x) _SB_GETVALUE(x, S_SCD_TRSEQ_FUNCTION, M_SCD_TRSEQ_FUNCTION) | ||
635 | |||
636 | #define K_SCD_TRSEQ_FUNC_NOP 0 | ||
637 | #define K_SCD_TRSEQ_FUNC_START 1 | ||
638 | #define K_SCD_TRSEQ_FUNC_STOP 2 | ||
639 | #define K_SCD_TRSEQ_FUNC_FREEZE 3 | ||
640 | |||
641 | #define V_SCD_TRSEQ_FUNC_NOP V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_NOP) | ||
642 | #define V_SCD_TRSEQ_FUNC_START V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_START) | ||
643 | #define V_SCD_TRSEQ_FUNC_STOP V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_STOP) | ||
644 | #define V_SCD_TRSEQ_FUNC_FREEZE V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_FREEZE) | ||
645 | |||
646 | #define M_SCD_TRSEQ_ASAMPLE _SB_MAKEMASK1(18) | ||
647 | #define M_SCD_TRSEQ_DSAMPLE _SB_MAKEMASK1(19) | ||
648 | #define M_SCD_TRSEQ_DEBUGPIN _SB_MAKEMASK1(20) | ||
649 | #define M_SCD_TRSEQ_DEBUGCPU _SB_MAKEMASK1(21) | ||
650 | #define M_SCD_TRSEQ_CLEARUSE _SB_MAKEMASK1(22) | ||
651 | #define M_SCD_TRSEQ_ALLD_A _SB_MAKEMASK1(23) | ||
652 | #define M_SCD_TRSEQ_ALL_A _SB_MAKEMASK1(24) | ||
653 | |||
654 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_smbus.h b/include/asm-mips/sibyte/sb1250_smbus.h deleted file mode 100644 index 04769923cf1e..000000000000 --- a/include/asm-mips/sibyte/sb1250_smbus.h +++ /dev/null | |||
@@ -1,204 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * SMBUS Constants File: sb1250_smbus.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * manipulating the SB1250's SMbus devices. | ||
8 | * | ||
9 | * SB1250 specification level: 10/21/02 | ||
10 | * BCM1280 specification level: 11/24/03 | ||
11 | * | ||
12 | ********************************************************************* | ||
13 | * | ||
14 | * Copyright 2000,2001,2002,2003 | ||
15 | * Broadcom Corporation. All rights reserved. | ||
16 | * | ||
17 | * This program is free software; you can redistribute it and/or | ||
18 | * modify it under the terms of the GNU General Public License as | ||
19 | * published by the Free Software Foundation; either version 2 of | ||
20 | * the License, or (at your option) any later version. | ||
21 | * | ||
22 | * This program is distributed in the hope that it will be useful, | ||
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
25 | * GNU General Public License for more details. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public License | ||
28 | * along with this program; if not, write to the Free Software | ||
29 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
30 | * MA 02111-1307 USA | ||
31 | ********************************************************************* */ | ||
32 | |||
33 | |||
34 | #ifndef _SB1250_SMBUS_H | ||
35 | #define _SB1250_SMBUS_H | ||
36 | |||
37 | #include "sb1250_defs.h" | ||
38 | |||
39 | /* | ||
40 | * SMBus Clock Frequency Register (Table 14-2) | ||
41 | */ | ||
42 | |||
43 | #define S_SMB_FREQ_DIV 0 | ||
44 | #define M_SMB_FREQ_DIV _SB_MAKEMASK(13, S_SMB_FREQ_DIV) | ||
45 | #define V_SMB_FREQ_DIV(x) _SB_MAKEVALUE(x, S_SMB_FREQ_DIV) | ||
46 | |||
47 | #define K_SMB_FREQ_400KHZ 0x1F | ||
48 | #define K_SMB_FREQ_100KHZ 0x7D | ||
49 | #define K_SMB_FREQ_10KHZ 1250 | ||
50 | |||
51 | #define S_SMB_CMD 0 | ||
52 | #define M_SMB_CMD _SB_MAKEMASK(8, S_SMB_CMD) | ||
53 | #define V_SMB_CMD(x) _SB_MAKEVALUE(x, S_SMB_CMD) | ||
54 | |||
55 | /* | ||
56 | * SMBus control register (Table 14-4) | ||
57 | */ | ||
58 | |||
59 | #define M_SMB_ERR_INTR _SB_MAKEMASK1(0) | ||
60 | #define M_SMB_FINISH_INTR _SB_MAKEMASK1(1) | ||
61 | |||
62 | #define S_SMB_DATA_OUT 4 | ||
63 | #define M_SMB_DATA_OUT _SB_MAKEMASK1(S_SMB_DATA_OUT) | ||
64 | #define V_SMB_DATA_OUT(x) _SB_MAKEVALUE(x, S_SMB_DATA_OUT) | ||
65 | |||
66 | #define M_SMB_DATA_DIR _SB_MAKEMASK1(5) | ||
67 | #define M_SMB_DATA_DIR_OUTPUT M_SMB_DATA_DIR | ||
68 | #define M_SMB_CLK_OUT _SB_MAKEMASK1(6) | ||
69 | #define M_SMB_DIRECT_ENABLE _SB_MAKEMASK1(7) | ||
70 | |||
71 | /* | ||
72 | * SMBus status registers (Table 14-5) | ||
73 | */ | ||
74 | |||
75 | #define M_SMB_BUSY _SB_MAKEMASK1(0) | ||
76 | #define M_SMB_ERROR _SB_MAKEMASK1(1) | ||
77 | #define M_SMB_ERROR_TYPE _SB_MAKEMASK1(2) | ||
78 | |||
79 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
80 | #define S_SMB_SCL_IN 5 | ||
81 | #define M_SMB_SCL_IN _SB_MAKEMASK1(S_SMB_SCL_IN) | ||
82 | #define V_SMB_SCL_IN(x) _SB_MAKEVALUE(x, S_SMB_SCL_IN) | ||
83 | #define G_SMB_SCL_IN(x) _SB_GETVALUE(x, S_SMB_SCL_IN, M_SMB_SCL_IN) | ||
84 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
85 | |||
86 | #define S_SMB_REF 6 | ||
87 | #define M_SMB_REF _SB_MAKEMASK1(S_SMB_REF) | ||
88 | #define V_SMB_REF(x) _SB_MAKEVALUE(x, S_SMB_REF) | ||
89 | #define G_SMB_REF(x) _SB_GETVALUE(x, S_SMB_REF, M_SMB_REF) | ||
90 | |||
91 | #define S_SMB_DATA_IN 7 | ||
92 | #define M_SMB_DATA_IN _SB_MAKEMASK1(S_SMB_DATA_IN) | ||
93 | #define V_SMB_DATA_IN(x) _SB_MAKEVALUE(x, S_SMB_DATA_IN) | ||
94 | #define G_SMB_DATA_IN(x) _SB_GETVALUE(x, S_SMB_DATA_IN, M_SMB_DATA_IN) | ||
95 | |||
96 | /* | ||
97 | * SMBus Start/Command registers (Table 14-9) | ||
98 | */ | ||
99 | |||
100 | #define S_SMB_ADDR 0 | ||
101 | #define M_SMB_ADDR _SB_MAKEMASK(7, S_SMB_ADDR) | ||
102 | #define V_SMB_ADDR(x) _SB_MAKEVALUE(x, S_SMB_ADDR) | ||
103 | #define G_SMB_ADDR(x) _SB_GETVALUE(x, S_SMB_ADDR, M_SMB_ADDR) | ||
104 | |||
105 | #define M_SMB_QDATA _SB_MAKEMASK1(7) | ||
106 | |||
107 | #define S_SMB_TT 8 | ||
108 | #define M_SMB_TT _SB_MAKEMASK(3, S_SMB_TT) | ||
109 | #define V_SMB_TT(x) _SB_MAKEVALUE(x, S_SMB_TT) | ||
110 | #define G_SMB_TT(x) _SB_GETVALUE(x, S_SMB_TT, M_SMB_TT) | ||
111 | |||
112 | #define K_SMB_TT_WR1BYTE 0 | ||
113 | #define K_SMB_TT_WR2BYTE 1 | ||
114 | #define K_SMB_TT_WR3BYTE 2 | ||
115 | #define K_SMB_TT_CMD_RD1BYTE 3 | ||
116 | #define K_SMB_TT_CMD_RD2BYTE 4 | ||
117 | #define K_SMB_TT_RD1BYTE 5 | ||
118 | #define K_SMB_TT_QUICKCMD 6 | ||
119 | #define K_SMB_TT_EEPROMREAD 7 | ||
120 | |||
121 | #define V_SMB_TT_WR1BYTE V_SMB_TT(K_SMB_TT_WR1BYTE) | ||
122 | #define V_SMB_TT_WR2BYTE V_SMB_TT(K_SMB_TT_WR2BYTE) | ||
123 | #define V_SMB_TT_WR3BYTE V_SMB_TT(K_SMB_TT_WR3BYTE) | ||
124 | #define V_SMB_TT_CMD_RD1BYTE V_SMB_TT(K_SMB_TT_CMD_RD1BYTE) | ||
125 | #define V_SMB_TT_CMD_RD2BYTE V_SMB_TT(K_SMB_TT_CMD_RD2BYTE) | ||
126 | #define V_SMB_TT_RD1BYTE V_SMB_TT(K_SMB_TT_RD1BYTE) | ||
127 | #define V_SMB_TT_QUICKCMD V_SMB_TT(K_SMB_TT_QUICKCMD) | ||
128 | #define V_SMB_TT_EEPROMREAD V_SMB_TT(K_SMB_TT_EEPROMREAD) | ||
129 | |||
130 | #define M_SMB_PEC _SB_MAKEMASK1(15) | ||
131 | |||
132 | /* | ||
133 | * SMBus Data Register (Table 14-6) and SMBus Extra Register (Table 14-7) | ||
134 | */ | ||
135 | |||
136 | #define S_SMB_LB 0 | ||
137 | #define M_SMB_LB _SB_MAKEMASK(8, S_SMB_LB) | ||
138 | #define V_SMB_LB(x) _SB_MAKEVALUE(x, S_SMB_LB) | ||
139 | |||
140 | #define S_SMB_MB 8 | ||
141 | #define M_SMB_MB _SB_MAKEMASK(8, S_SMB_MB) | ||
142 | #define V_SMB_MB(x) _SB_MAKEVALUE(x, S_SMB_MB) | ||
143 | |||
144 | |||
145 | /* | ||
146 | * SMBus Packet Error Check register (Table 14-8) | ||
147 | */ | ||
148 | |||
149 | #define S_SPEC_PEC 0 | ||
150 | #define M_SPEC_PEC _SB_MAKEMASK(8, S_SPEC_PEC) | ||
151 | #define V_SPEC_MB(x) _SB_MAKEVALUE(x, S_SPEC_PEC) | ||
152 | |||
153 | |||
154 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
155 | |||
156 | #define S_SMB_CMDH 8 | ||
157 | #define M_SMB_CMDH _SB_MAKEMASK(8, S_SMB_CMDH) | ||
158 | #define V_SMB_CMDH(x) _SB_MAKEVALUE(x, S_SMB_CMDH) | ||
159 | |||
160 | #define M_SMB_EXTEND _SB_MAKEMASK1(14) | ||
161 | |||
162 | #define S_SMB_DFMT 8 | ||
163 | #define M_SMB_DFMT _SB_MAKEMASK(3, S_SMB_DFMT) | ||
164 | #define V_SMB_DFMT(x) _SB_MAKEVALUE(x, S_SMB_DFMT) | ||
165 | #define G_SMB_DFMT(x) _SB_GETVALUE(x, S_SMB_DFMT, M_SMB_DFMT) | ||
166 | |||
167 | #define K_SMB_DFMT_1BYTE 0 | ||
168 | #define K_SMB_DFMT_2BYTE 1 | ||
169 | #define K_SMB_DFMT_3BYTE 2 | ||
170 | #define K_SMB_DFMT_4BYTE 3 | ||
171 | #define K_SMB_DFMT_NODATA 4 | ||
172 | #define K_SMB_DFMT_CMD4BYTE 5 | ||
173 | #define K_SMB_DFMT_CMD5BYTE 6 | ||
174 | #define K_SMB_DFMT_RESERVED 7 | ||
175 | |||
176 | #define V_SMB_DFMT_1BYTE V_SMB_DFMT(K_SMB_DFMT_1BYTE) | ||
177 | #define V_SMB_DFMT_2BYTE V_SMB_DFMT(K_SMB_DFMT_2BYTE) | ||
178 | #define V_SMB_DFMT_3BYTE V_SMB_DFMT(K_SMB_DFMT_3BYTE) | ||
179 | #define V_SMB_DFMT_4BYTE V_SMB_DFMT(K_SMB_DFMT_4BYTE) | ||
180 | #define V_SMB_DFMT_NODATA V_SMB_DFMT(K_SMB_DFMT_NODATA) | ||
181 | #define V_SMB_DFMT_CMD4BYTE V_SMB_DFMT(K_SMB_DFMT_CMD4BYTE) | ||
182 | #define V_SMB_DFMT_CMD5BYTE V_SMB_DFMT(K_SMB_DFMT_CMD5BYTE) | ||
183 | #define V_SMB_DFMT_RESERVED V_SMB_DFMT(K_SMB_DFMT_RESERVED) | ||
184 | |||
185 | #define S_SMB_AFMT 11 | ||
186 | #define M_SMB_AFMT _SB_MAKEMASK(2, S_SMB_AFMT) | ||
187 | #define V_SMB_AFMT(x) _SB_MAKEVALUE(x, S_SMB_AFMT) | ||
188 | #define G_SMB_AFMT(x) _SB_GETVALUE(x, S_SMB_AFMT, M_SMB_AFMT) | ||
189 | |||
190 | #define K_SMB_AFMT_NONE 0 | ||
191 | #define K_SMB_AFMT_ADDR 1 | ||
192 | #define K_SMB_AFMT_ADDR_CMD1BYTE 2 | ||
193 | #define K_SMB_AFMT_ADDR_CMD2BYTE 3 | ||
194 | |||
195 | #define V_SMB_AFMT_NONE V_SMB_AFMT(K_SMB_AFMT_NONE) | ||
196 | #define V_SMB_AFMT_ADDR V_SMB_AFMT(K_SMB_AFMT_ADDR) | ||
197 | #define V_SMB_AFMT_ADDR_CMD1BYTE V_SMB_AFMT(K_SMB_AFMT_ADDR_CMD1BYTE) | ||
198 | #define V_SMB_AFMT_ADDR_CMD2BYTE V_SMB_AFMT(K_SMB_AFMT_ADDR_CMD2BYTE) | ||
199 | |||
200 | #define M_SMB_DIR _SB_MAKEMASK1(13) | ||
201 | |||
202 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
203 | |||
204 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_syncser.h b/include/asm-mips/sibyte/sb1250_syncser.h deleted file mode 100644 index d4b8558e0bf1..000000000000 --- a/include/asm-mips/sibyte/sb1250_syncser.h +++ /dev/null | |||
@@ -1,146 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * Synchronous Serial Constants File: sb1250_syncser.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * manipulating the SB1250's Synchronous Serial | ||
8 | * | ||
9 | * SB1250 specification level: User's manual 1/02/02 | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _SB1250_SYNCSER_H | ||
34 | #define _SB1250_SYNCSER_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | /* | ||
39 | * Serial Mode Configuration Register | ||
40 | */ | ||
41 | |||
42 | #define M_SYNCSER_CRC_MODE _SB_MAKEMASK1(0) | ||
43 | #define M_SYNCSER_MSB_FIRST _SB_MAKEMASK1(1) | ||
44 | |||
45 | #define S_SYNCSER_FLAG_NUM 2 | ||
46 | #define M_SYNCSER_FLAG_NUM _SB_MAKEMASK(4, S_SYNCSER_FLAG_NUM) | ||
47 | #define V_SYNCSER_FLAG_NUM _SB_MAKEVALUE(x, S_SYNCSER_FLAG_NUM) | ||
48 | |||
49 | #define M_SYNCSER_FLAG_EN _SB_MAKEMASK1(6) | ||
50 | #define M_SYNCSER_HDLC_EN _SB_MAKEMASK1(7) | ||
51 | #define M_SYNCSER_LOOP_MODE _SB_MAKEMASK1(8) | ||
52 | #define M_SYNCSER_LOOPBACK _SB_MAKEMASK1(9) | ||
53 | |||
54 | /* | ||
55 | * Serial Clock Source and Line Interface Mode Register | ||
56 | */ | ||
57 | |||
58 | #define M_SYNCSER_RXCLK_INV _SB_MAKEMASK1(0) | ||
59 | #define M_SYNCSER_RXCLK_EXT _SB_MAKEMASK1(1) | ||
60 | |||
61 | #define S_SYNCSER_RXSYNC_DLY 2 | ||
62 | #define M_SYNCSER_RXSYNC_DLY _SB_MAKEMASK(2, S_SYNCSER_RXSYNC_DLY) | ||
63 | #define V_SYNCSER_RXSYNC_DLY(x) _SB_MAKEVALUE(x, S_SYNCSER_RXSYNC_DLY) | ||
64 | |||
65 | #define M_SYNCSER_RXSYNC_LOW _SB_MAKEMASK1(4) | ||
66 | #define M_SYNCSER_RXSTRB_LOW _SB_MAKEMASK1(5) | ||
67 | |||
68 | #define M_SYNCSER_RXSYNC_EDGE _SB_MAKEMASK1(6) | ||
69 | #define M_SYNCSER_RXSYNC_INT _SB_MAKEMASK1(7) | ||
70 | |||
71 | #define M_SYNCSER_TXCLK_INV _SB_MAKEMASK1(8) | ||
72 | #define M_SYNCSER_TXCLK_EXT _SB_MAKEMASK1(9) | ||
73 | |||
74 | #define S_SYNCSER_TXSYNC_DLY 10 | ||
75 | #define M_SYNCSER_TXSYNC_DLY _SB_MAKEMASK(2, S_SYNCSER_TXSYNC_DLY) | ||
76 | #define V_SYNCSER_TXSYNC_DLY(x) _SB_MAKEVALUE(x, S_SYNCSER_TXSYNC_DLY) | ||
77 | |||
78 | #define M_SYNCSER_TXSYNC_LOW _SB_MAKEMASK1(12) | ||
79 | #define M_SYNCSER_TXSTRB_LOW _SB_MAKEMASK1(13) | ||
80 | |||
81 | #define M_SYNCSER_TXSYNC_EDGE _SB_MAKEMASK1(14) | ||
82 | #define M_SYNCSER_TXSYNC_INT _SB_MAKEMASK1(15) | ||
83 | |||
84 | /* | ||
85 | * Serial Command Register | ||
86 | */ | ||
87 | |||
88 | #define M_SYNCSER_CMD_RX_EN _SB_MAKEMASK1(0) | ||
89 | #define M_SYNCSER_CMD_TX_EN _SB_MAKEMASK1(1) | ||
90 | #define M_SYNCSER_CMD_RX_RESET _SB_MAKEMASK1(2) | ||
91 | #define M_SYNCSER_CMD_TX_RESET _SB_MAKEMASK1(3) | ||
92 | #define M_SYNCSER_CMD_TX_PAUSE _SB_MAKEMASK1(5) | ||
93 | |||
94 | /* | ||
95 | * Serial DMA Enable Register | ||
96 | */ | ||
97 | |||
98 | #define M_SYNCSER_DMA_RX_EN _SB_MAKEMASK1(0) | ||
99 | #define M_SYNCSER_DMA_TX_EN _SB_MAKEMASK1(4) | ||
100 | |||
101 | /* | ||
102 | * Serial Status Register | ||
103 | */ | ||
104 | |||
105 | #define M_SYNCSER_RX_CRCERR _SB_MAKEMASK1(0) | ||
106 | #define M_SYNCSER_RX_ABORT _SB_MAKEMASK1(1) | ||
107 | #define M_SYNCSER_RX_OCTET _SB_MAKEMASK1(2) | ||
108 | #define M_SYNCSER_RX_LONGFRM _SB_MAKEMASK1(3) | ||
109 | #define M_SYNCSER_RX_SHORTFRM _SB_MAKEMASK1(4) | ||
110 | #define M_SYNCSER_RX_OVERRUN _SB_MAKEMASK1(5) | ||
111 | #define M_SYNCSER_RX_SYNC_ERR _SB_MAKEMASK1(6) | ||
112 | #define M_SYNCSER_TX_CRCERR _SB_MAKEMASK1(8) | ||
113 | #define M_SYNCSER_TX_UNDERRUN _SB_MAKEMASK1(9) | ||
114 | #define M_SYNCSER_TX_SYNC_ERR _SB_MAKEMASK1(10) | ||
115 | #define M_SYNCSER_TX_PAUSE_COMPLETE _SB_MAKEMASK1(11) | ||
116 | #define M_SYNCSER_RX_EOP_COUNT _SB_MAKEMASK1(16) | ||
117 | #define M_SYNCSER_RX_EOP_TIMER _SB_MAKEMASK1(17) | ||
118 | #define M_SYNCSER_RX_EOP_SEEN _SB_MAKEMASK1(18) | ||
119 | #define M_SYNCSER_RX_HWM _SB_MAKEMASK1(19) | ||
120 | #define M_SYNCSER_RX_LWM _SB_MAKEMASK1(20) | ||
121 | #define M_SYNCSER_RX_DSCR _SB_MAKEMASK1(21) | ||
122 | #define M_SYNCSER_RX_DERR _SB_MAKEMASK1(22) | ||
123 | #define M_SYNCSER_TX_EOP_COUNT _SB_MAKEMASK1(24) | ||
124 | #define M_SYNCSER_TX_EOP_TIMER _SB_MAKEMASK1(25) | ||
125 | #define M_SYNCSER_TX_EOP_SEEN _SB_MAKEMASK1(26) | ||
126 | #define M_SYNCSER_TX_HWM _SB_MAKEMASK1(27) | ||
127 | #define M_SYNCSER_TX_LWM _SB_MAKEMASK1(28) | ||
128 | #define M_SYNCSER_TX_DSCR _SB_MAKEMASK1(29) | ||
129 | #define M_SYNCSER_TX_DERR _SB_MAKEMASK1(30) | ||
130 | #define M_SYNCSER_TX_DZERO _SB_MAKEMASK1(31) | ||
131 | |||
132 | /* | ||
133 | * Sequencer Table Entry format | ||
134 | */ | ||
135 | |||
136 | #define M_SYNCSER_SEQ_LAST _SB_MAKEMASK1(0) | ||
137 | #define M_SYNCSER_SEQ_BYTE _SB_MAKEMASK1(1) | ||
138 | |||
139 | #define S_SYNCSER_SEQ_COUNT 2 | ||
140 | #define M_SYNCSER_SEQ_COUNT _SB_MAKEMASK(4, S_SYNCSER_SEQ_COUNT) | ||
141 | #define V_SYNCSER_SEQ_COUNT(x) _SB_MAKEVALUE(x, S_SYNCSER_SEQ_COUNT) | ||
142 | |||
143 | #define M_SYNCSER_SEQ_ENABLE _SB_MAKEMASK1(6) | ||
144 | #define M_SYNCSER_SEQ_STROBE _SB_MAKEMASK1(7) | ||
145 | |||
146 | #endif | ||
diff --git a/include/asm-mips/sibyte/sb1250_uart.h b/include/asm-mips/sibyte/sb1250_uart.h deleted file mode 100644 index d835bf280140..000000000000 --- a/include/asm-mips/sibyte/sb1250_uart.h +++ /dev/null | |||
@@ -1,362 +0,0 @@ | |||
1 | /* ********************************************************************* | ||
2 | * SB1250 Board Support Package | ||
3 | * | ||
4 | * UART Constants File: sb1250_uart.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * manipulating the SB1250's UARTs | ||
8 | * | ||
9 | * SB1250 specification level: User's manual 1/02/02 | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _SB1250_UART_H | ||
34 | #define _SB1250_UART_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | /* ********************************************************************** | ||
39 | * DUART Registers | ||
40 | ********************************************************************** */ | ||
41 | |||
42 | /* | ||
43 | * DUART Mode Register #1 (Table 10-3) | ||
44 | * Register: DUART_MODE_REG_1_A | ||
45 | * Register: DUART_MODE_REG_1_B | ||
46 | */ | ||
47 | |||
48 | #define S_DUART_BITS_PER_CHAR 0 | ||
49 | #define M_DUART_BITS_PER_CHAR _SB_MAKEMASK(2, S_DUART_BITS_PER_CHAR) | ||
50 | #define V_DUART_BITS_PER_CHAR(x) _SB_MAKEVALUE(x, S_DUART_BITS_PER_CHAR) | ||
51 | |||
52 | #define K_DUART_BITS_PER_CHAR_RSV0 0 | ||
53 | #define K_DUART_BITS_PER_CHAR_RSV1 1 | ||
54 | #define K_DUART_BITS_PER_CHAR_7 2 | ||
55 | #define K_DUART_BITS_PER_CHAR_8 3 | ||
56 | |||
57 | #define V_DUART_BITS_PER_CHAR_RSV0 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_RSV0) | ||
58 | #define V_DUART_BITS_PER_CHAR_RSV1 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_RSV1) | ||
59 | #define V_DUART_BITS_PER_CHAR_7 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_7) | ||
60 | #define V_DUART_BITS_PER_CHAR_8 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_8) | ||
61 | |||
62 | |||
63 | #define M_DUART_PARITY_TYPE_EVEN 0x00 | ||
64 | #define M_DUART_PARITY_TYPE_ODD _SB_MAKEMASK1(2) | ||
65 | |||
66 | #define S_DUART_PARITY_MODE 3 | ||
67 | #define M_DUART_PARITY_MODE _SB_MAKEMASK(2, S_DUART_PARITY_MODE) | ||
68 | #define V_DUART_PARITY_MODE(x) _SB_MAKEVALUE(x, S_DUART_PARITY_MODE) | ||
69 | |||
70 | #define K_DUART_PARITY_MODE_ADD 0 | ||
71 | #define K_DUART_PARITY_MODE_ADD_FIXED 1 | ||
72 | #define K_DUART_PARITY_MODE_NONE 2 | ||
73 | |||
74 | #define V_DUART_PARITY_MODE_ADD V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_ADD) | ||
75 | #define V_DUART_PARITY_MODE_ADD_FIXED V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_ADD_FIXED) | ||
76 | #define V_DUART_PARITY_MODE_NONE V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_NONE) | ||
77 | |||
78 | #define M_DUART_TX_IRQ_SEL_TXRDY 0 | ||
79 | #define M_DUART_TX_IRQ_SEL_TXEMPT _SB_MAKEMASK1(5) | ||
80 | |||
81 | #define M_DUART_RX_IRQ_SEL_RXRDY 0 | ||
82 | #define M_DUART_RX_IRQ_SEL_RXFULL _SB_MAKEMASK1(6) | ||
83 | |||
84 | #define M_DUART_RX_RTS_ENA _SB_MAKEMASK1(7) | ||
85 | |||
86 | /* | ||
87 | * DUART Mode Register #2 (Table 10-4) | ||
88 | * Register: DUART_MODE_REG_2_A | ||
89 | * Register: DUART_MODE_REG_2_B | ||
90 | */ | ||
91 | |||
92 | #define M_DUART_MODE_RESERVED1 _SB_MAKEMASK(3, 0) /* ignored */ | ||
93 | |||
94 | #define M_DUART_STOP_BIT_LEN_2 _SB_MAKEMASK1(3) | ||
95 | #define M_DUART_STOP_BIT_LEN_1 0 | ||
96 | |||
97 | #define M_DUART_TX_CTS_ENA _SB_MAKEMASK1(4) | ||
98 | |||
99 | |||
100 | #define M_DUART_MODE_RESERVED2 _SB_MAKEMASK1(5) /* must be zero */ | ||
101 | |||
102 | #define S_DUART_CHAN_MODE 6 | ||
103 | #define M_DUART_CHAN_MODE _SB_MAKEMASK(2, S_DUART_CHAN_MODE) | ||
104 | #define V_DUART_CHAN_MODE(x) _SB_MAKEVALUE(x, S_DUART_CHAN_MODE) | ||
105 | |||
106 | #define K_DUART_CHAN_MODE_NORMAL 0 | ||
107 | #define K_DUART_CHAN_MODE_LCL_LOOP 2 | ||
108 | #define K_DUART_CHAN_MODE_REM_LOOP 3 | ||
109 | |||
110 | #define V_DUART_CHAN_MODE_NORMAL V_DUART_CHAN_MODE(K_DUART_CHAN_MODE_NORMAL) | ||
111 | #define V_DUART_CHAN_MODE_LCL_LOOP V_DUART_CHAN_MODE(K_DUART_CHAN_MODE_LCL_LOOP) | ||
112 | #define V_DUART_CHAN_MODE_REM_LOOP V_DUART_CHAN_MODE(K_DUART_CHAN_MODE_REM_LOOP) | ||
113 | |||
114 | /* | ||
115 | * DUART Command Register (Table 10-5) | ||
116 | * Register: DUART_CMD_A | ||
117 | * Register: DUART_CMD_B | ||
118 | */ | ||
119 | |||
120 | #define M_DUART_RX_EN _SB_MAKEMASK1(0) | ||
121 | #define M_DUART_RX_DIS _SB_MAKEMASK1(1) | ||
122 | #define M_DUART_TX_EN _SB_MAKEMASK1(2) | ||
123 | #define M_DUART_TX_DIS _SB_MAKEMASK1(3) | ||
124 | |||
125 | #define S_DUART_MISC_CMD 4 | ||
126 | #define M_DUART_MISC_CMD _SB_MAKEMASK(3, S_DUART_MISC_CMD) | ||
127 | #define V_DUART_MISC_CMD(x) _SB_MAKEVALUE(x, S_DUART_MISC_CMD) | ||
128 | |||
129 | #define K_DUART_MISC_CMD_NOACTION0 0 | ||
130 | #define K_DUART_MISC_CMD_NOACTION1 1 | ||
131 | #define K_DUART_MISC_CMD_RESET_RX 2 | ||
132 | #define K_DUART_MISC_CMD_RESET_TX 3 | ||
133 | #define K_DUART_MISC_CMD_NOACTION4 4 | ||
134 | #define K_DUART_MISC_CMD_RESET_BREAK_INT 5 | ||
135 | #define K_DUART_MISC_CMD_START_BREAK 6 | ||
136 | #define K_DUART_MISC_CMD_STOP_BREAK 7 | ||
137 | |||
138 | #define V_DUART_MISC_CMD_NOACTION0 V_DUART_MISC_CMD(K_DUART_MISC_CMD_NOACTION0) | ||
139 | #define V_DUART_MISC_CMD_NOACTION1 V_DUART_MISC_CMD(K_DUART_MISC_CMD_NOACTION1) | ||
140 | #define V_DUART_MISC_CMD_RESET_RX V_DUART_MISC_CMD(K_DUART_MISC_CMD_RESET_RX) | ||
141 | #define V_DUART_MISC_CMD_RESET_TX V_DUART_MISC_CMD(K_DUART_MISC_CMD_RESET_TX) | ||
142 | #define V_DUART_MISC_CMD_NOACTION4 V_DUART_MISC_CMD(K_DUART_MISC_CMD_NOACTION4) | ||
143 | #define V_DUART_MISC_CMD_RESET_BREAK_INT V_DUART_MISC_CMD(K_DUART_MISC_CMD_RESET_BREAK_INT) | ||
144 | #define V_DUART_MISC_CMD_START_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_START_BREAK) | ||
145 | #define V_DUART_MISC_CMD_STOP_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_STOP_BREAK) | ||
146 | |||
147 | #define M_DUART_CMD_RESERVED _SB_MAKEMASK1(7) | ||
148 | |||
149 | /* | ||
150 | * DUART Status Register (Table 10-6) | ||
151 | * Register: DUART_STATUS_A | ||
152 | * Register: DUART_STATUS_B | ||
153 | * READ-ONLY | ||
154 | */ | ||
155 | |||
156 | #define M_DUART_RX_RDY _SB_MAKEMASK1(0) | ||
157 | #define M_DUART_RX_FFUL _SB_MAKEMASK1(1) | ||
158 | #define M_DUART_TX_RDY _SB_MAKEMASK1(2) | ||
159 | #define M_DUART_TX_EMT _SB_MAKEMASK1(3) | ||
160 | #define M_DUART_OVRUN_ERR _SB_MAKEMASK1(4) | ||
161 | #define M_DUART_PARITY_ERR _SB_MAKEMASK1(5) | ||
162 | #define M_DUART_FRM_ERR _SB_MAKEMASK1(6) | ||
163 | #define M_DUART_RCVD_BRK _SB_MAKEMASK1(7) | ||
164 | |||
165 | /* | ||
166 | * DUART Baud Rate Register (Table 10-7) | ||
167 | * Register: DUART_CLK_SEL_A | ||
168 | * Register: DUART_CLK_SEL_B | ||
169 | */ | ||
170 | |||
171 | #define M_DUART_CLK_COUNTER _SB_MAKEMASK(12, 0) | ||
172 | #define V_DUART_BAUD_RATE(x) (100000000/((x)*20)-1) | ||
173 | |||
174 | /* | ||
175 | * DUART Data Registers (Table 10-8 and 10-9) | ||
176 | * Register: DUART_RX_HOLD_A | ||
177 | * Register: DUART_RX_HOLD_B | ||
178 | * Register: DUART_TX_HOLD_A | ||
179 | * Register: DUART_TX_HOLD_B | ||
180 | */ | ||
181 | |||
182 | #define M_DUART_RX_DATA _SB_MAKEMASK(8, 0) | ||
183 | #define M_DUART_TX_DATA _SB_MAKEMASK(8, 0) | ||
184 | |||
185 | /* | ||
186 | * DUART Input Port Register (Table 10-10) | ||
187 | * Register: DUART_IN_PORT | ||
188 | */ | ||
189 | |||
190 | #define M_DUART_IN_PIN0_VAL _SB_MAKEMASK1(0) | ||
191 | #define M_DUART_IN_PIN1_VAL _SB_MAKEMASK1(1) | ||
192 | #define M_DUART_IN_PIN2_VAL _SB_MAKEMASK1(2) | ||
193 | #define M_DUART_IN_PIN3_VAL _SB_MAKEMASK1(3) | ||
194 | #define M_DUART_IN_PIN4_VAL _SB_MAKEMASK1(4) | ||
195 | #define M_DUART_IN_PIN5_VAL _SB_MAKEMASK1(5) | ||
196 | #define M_DUART_RIN0_PIN _SB_MAKEMASK1(6) | ||
197 | #define M_DUART_RIN1_PIN _SB_MAKEMASK1(7) | ||
198 | |||
199 | /* | ||
200 | * DUART Input Port Change Status Register (Tables 10-11, 10-12, and 10-13) | ||
201 | * Register: DUART_INPORT_CHNG | ||
202 | */ | ||
203 | |||
204 | #define S_DUART_IN_PIN_VAL 0 | ||
205 | #define M_DUART_IN_PIN_VAL _SB_MAKEMASK(4, S_DUART_IN_PIN_VAL) | ||
206 | |||
207 | #define S_DUART_IN_PIN_CHNG 4 | ||
208 | #define M_DUART_IN_PIN_CHNG _SB_MAKEMASK(4, S_DUART_IN_PIN_CHNG) | ||
209 | |||
210 | |||
211 | /* | ||
212 | * DUART Output port control register (Table 10-14) | ||
213 | * Register: DUART_OPCR | ||
214 | */ | ||
215 | |||
216 | #define M_DUART_OPCR_RESERVED0 _SB_MAKEMASK1(0) /* must be zero */ | ||
217 | #define M_DUART_OPC2_SEL _SB_MAKEMASK1(1) | ||
218 | #define M_DUART_OPCR_RESERVED1 _SB_MAKEMASK1(2) /* must be zero */ | ||
219 | #define M_DUART_OPC3_SEL _SB_MAKEMASK1(3) | ||
220 | #define M_DUART_OPCR_RESERVED2 _SB_MAKEMASK(4, 4) /* must be zero */ | ||
221 | |||
222 | /* | ||
223 | * DUART Aux Control Register (Table 10-15) | ||
224 | * Register: DUART_AUX_CTRL | ||
225 | */ | ||
226 | |||
227 | #define M_DUART_IP0_CHNG_ENA _SB_MAKEMASK1(0) | ||
228 | #define M_DUART_IP1_CHNG_ENA _SB_MAKEMASK1(1) | ||
229 | #define M_DUART_IP2_CHNG_ENA _SB_MAKEMASK1(2) | ||
230 | #define M_DUART_IP3_CHNG_ENA _SB_MAKEMASK1(3) | ||
231 | #define M_DUART_ACR_RESERVED _SB_MAKEMASK(4, 4) | ||
232 | |||
233 | #define M_DUART_CTS_CHNG_ENA _SB_MAKEMASK1(0) | ||
234 | #define M_DUART_CIN_CHNG_ENA _SB_MAKEMASK1(2) | ||
235 | |||
236 | /* | ||
237 | * DUART Interrupt Status Register (Table 10-16) | ||
238 | * Register: DUART_ISR | ||
239 | */ | ||
240 | |||
241 | #define M_DUART_ISR_TX_A _SB_MAKEMASK1(0) | ||
242 | |||
243 | #define S_DUART_ISR_RX_A 1 | ||
244 | #define M_DUART_ISR_RX_A _SB_MAKEMASK1(S_DUART_ISR_RX_A) | ||
245 | #define V_DUART_ISR_RX_A(x) _SB_MAKEVALUE(x, S_DUART_ISR_RX_A) | ||
246 | #define G_DUART_ISR_RX_A(x) _SB_GETVALUE(x, S_DUART_ISR_RX_A, M_DUART_ISR_RX_A) | ||
247 | |||
248 | #define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2) | ||
249 | #define M_DUART_ISR_IN_A _SB_MAKEMASK1(3) | ||
250 | #define M_DUART_ISR_ALL_A _SB_MAKEMASK(4, 0) | ||
251 | |||
252 | #define M_DUART_ISR_TX_B _SB_MAKEMASK1(4) | ||
253 | #define M_DUART_ISR_RX_B _SB_MAKEMASK1(5) | ||
254 | #define M_DUART_ISR_BRK_B _SB_MAKEMASK1(6) | ||
255 | #define M_DUART_ISR_IN_B _SB_MAKEMASK1(7) | ||
256 | #define M_DUART_ISR_ALL_B _SB_MAKEMASK(4, 4) | ||
257 | |||
258 | /* | ||
259 | * DUART Channel A Interrupt Status Register (Table 10-17) | ||
260 | * DUART Channel B Interrupt Status Register (Table 10-18) | ||
261 | * Register: DUART_ISR_A | ||
262 | * Register: DUART_ISR_B | ||
263 | */ | ||
264 | |||
265 | #define M_DUART_ISR_TX _SB_MAKEMASK1(0) | ||
266 | #define M_DUART_ISR_RX _SB_MAKEMASK1(1) | ||
267 | #define M_DUART_ISR_BRK _SB_MAKEMASK1(2) | ||
268 | #define M_DUART_ISR_IN _SB_MAKEMASK1(3) | ||
269 | #define M_DUART_ISR_ALL _SB_MAKEMASK(4, 0) | ||
270 | #define M_DUART_ISR_RESERVED _SB_MAKEMASK(4, 4) | ||
271 | |||
272 | /* | ||
273 | * DUART Interrupt Mask Register (Table 10-19) | ||
274 | * Register: DUART_IMR | ||
275 | */ | ||
276 | |||
277 | #define M_DUART_IMR_TX_A _SB_MAKEMASK1(0) | ||
278 | #define M_DUART_IMR_RX_A _SB_MAKEMASK1(1) | ||
279 | #define M_DUART_IMR_BRK_A _SB_MAKEMASK1(2) | ||
280 | #define M_DUART_IMR_IN_A _SB_MAKEMASK1(3) | ||
281 | #define M_DUART_IMR_ALL_A _SB_MAKEMASK(4, 0) | ||
282 | |||
283 | #define M_DUART_IMR_TX_B _SB_MAKEMASK1(4) | ||
284 | #define M_DUART_IMR_RX_B _SB_MAKEMASK1(5) | ||
285 | #define M_DUART_IMR_BRK_B _SB_MAKEMASK1(6) | ||
286 | #define M_DUART_IMR_IN_B _SB_MAKEMASK1(7) | ||
287 | #define M_DUART_IMR_ALL_B _SB_MAKEMASK(4, 4) | ||
288 | |||
289 | /* | ||
290 | * DUART Channel A Interrupt Mask Register (Table 10-20) | ||
291 | * DUART Channel B Interrupt Mask Register (Table 10-21) | ||
292 | * Register: DUART_IMR_A | ||
293 | * Register: DUART_IMR_B | ||
294 | */ | ||
295 | |||
296 | #define M_DUART_IMR_TX _SB_MAKEMASK1(0) | ||
297 | #define M_DUART_IMR_RX _SB_MAKEMASK1(1) | ||
298 | #define M_DUART_IMR_BRK _SB_MAKEMASK1(2) | ||
299 | #define M_DUART_IMR_IN _SB_MAKEMASK1(3) | ||
300 | #define M_DUART_IMR_ALL _SB_MAKEMASK(4, 0) | ||
301 | #define M_DUART_IMR_RESERVED _SB_MAKEMASK(4, 4) | ||
302 | |||
303 | |||
304 | /* | ||
305 | * DUART Output Port Set Register (Table 10-22) | ||
306 | * Register: DUART_SET_OPR | ||
307 | */ | ||
308 | |||
309 | #define M_DUART_SET_OPR0 _SB_MAKEMASK1(0) | ||
310 | #define M_DUART_SET_OPR1 _SB_MAKEMASK1(1) | ||
311 | #define M_DUART_SET_OPR2 _SB_MAKEMASK1(2) | ||
312 | #define M_DUART_SET_OPR3 _SB_MAKEMASK1(3) | ||
313 | #define M_DUART_OPSR_RESERVED _SB_MAKEMASK(4, 4) | ||
314 | |||
315 | /* | ||
316 | * DUART Output Port Clear Register (Table 10-23) | ||
317 | * Register: DUART_CLEAR_OPR | ||
318 | */ | ||
319 | |||
320 | #define M_DUART_CLR_OPR0 _SB_MAKEMASK1(0) | ||
321 | #define M_DUART_CLR_OPR1 _SB_MAKEMASK1(1) | ||
322 | #define M_DUART_CLR_OPR2 _SB_MAKEMASK1(2) | ||
323 | #define M_DUART_CLR_OPR3 _SB_MAKEMASK1(3) | ||
324 | #define M_DUART_OPCR_RESERVED _SB_MAKEMASK(4, 4) | ||
325 | |||
326 | /* | ||
327 | * DUART Output Port RTS Register (Table 10-24) | ||
328 | * Register: DUART_OUT_PORT | ||
329 | */ | ||
330 | |||
331 | #define M_DUART_OUT_PIN_SET0 _SB_MAKEMASK1(0) | ||
332 | #define M_DUART_OUT_PIN_SET1 _SB_MAKEMASK1(1) | ||
333 | #define M_DUART_OUT_PIN_CLR0 _SB_MAKEMASK1(2) | ||
334 | #define M_DUART_OUT_PIN_CLR1 _SB_MAKEMASK1(3) | ||
335 | #define M_DUART_OPRR_RESERVED _SB_MAKEMASK(4, 4) | ||
336 | |||
337 | #define M_DUART_OUT_PIN_SET(chan) \ | ||
338 | (chan == 0 ? M_DUART_OUT_PIN_SET0 : M_DUART_OUT_PIN_SET1) | ||
339 | #define M_DUART_OUT_PIN_CLR(chan) \ | ||
340 | (chan == 0 ? M_DUART_OUT_PIN_CLR0 : M_DUART_OUT_PIN_CLR1) | ||
341 | |||
342 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
343 | /* | ||
344 | * Full Interrupt Control Register | ||
345 | */ | ||
346 | |||
347 | #define S_DUART_SIG_FULL _SB_MAKE64(0) | ||
348 | #define M_DUART_SIG_FULL _SB_MAKEMASK(4, S_DUART_SIG_FULL) | ||
349 | #define V_DUART_SIG_FULL(x) _SB_MAKEVALUE(x, S_DUART_SIG_FULL) | ||
350 | #define G_DUART_SIG_FULL(x) _SB_GETVALUE(x, S_DUART_SIG_FULL, M_DUART_SIG_FULL) | ||
351 | |||
352 | #define S_DUART_INT_TIME _SB_MAKE64(4) | ||
353 | #define M_DUART_INT_TIME _SB_MAKEMASK(4, S_DUART_INT_TIME) | ||
354 | #define V_DUART_INT_TIME(x) _SB_MAKEVALUE(x, S_DUART_INT_TIME) | ||
355 | #define G_DUART_INT_TIME(x) _SB_GETVALUE(x, S_DUART_INT_TIME, M_DUART_INT_TIME) | ||
356 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
357 | |||
358 | |||
359 | /* ********************************************************************** */ | ||
360 | |||
361 | |||
362 | #endif | ||
diff --git a/include/asm-mips/sibyte/sentosa.h b/include/asm-mips/sibyte/sentosa.h deleted file mode 100644 index 64c47874f32d..000000000000 --- a/include/asm-mips/sibyte/sentosa.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001 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 | #ifndef __ASM_SIBYTE_SENTOSA_H | ||
19 | #define __ASM_SIBYTE_SENTOSA_H | ||
20 | |||
21 | #include <asm/sibyte/sb1250.h> | ||
22 | #include <asm/sibyte/sb1250_int.h> | ||
23 | |||
24 | #ifdef CONFIG_SIBYTE_SENTOSA | ||
25 | #define SIBYTE_BOARD_NAME "BCM91250E (Sentosa)" | ||
26 | #endif | ||
27 | #ifdef CONFIG_SIBYTE_RHONE | ||
28 | #define SIBYTE_BOARD_NAME "BCM91125E (Rhone)" | ||
29 | #endif | ||
30 | |||
31 | /* Generic bus chip selects */ | ||
32 | #ifdef CONFIG_SIBYTE_RHONE | ||
33 | #define LEDS_CS 6 | ||
34 | #define LEDS_PHYS 0x1d0a0000 | ||
35 | #endif | ||
36 | |||
37 | /* GPIOs */ | ||
38 | #define K_GPIO_DBG_LED 0 | ||
39 | |||
40 | #endif /* __ASM_SIBYTE_SENTOSA_H */ | ||
diff --git a/include/asm-mips/sibyte/swarm.h b/include/asm-mips/sibyte/swarm.h deleted file mode 100644 index 114d9d29ca9d..000000000000 --- a/include/asm-mips/sibyte/swarm.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 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 | #ifndef __ASM_SIBYTE_SWARM_H | ||
19 | #define __ASM_SIBYTE_SWARM_H | ||
20 | |||
21 | #include <asm/sibyte/sb1250.h> | ||
22 | #include <asm/sibyte/sb1250_int.h> | ||
23 | |||
24 | #ifdef CONFIG_SIBYTE_SWARM | ||
25 | #define SIBYTE_BOARD_NAME "BCM91250A (SWARM)" | ||
26 | #define SIBYTE_HAVE_PCMCIA 1 | ||
27 | #define SIBYTE_HAVE_IDE 1 | ||
28 | #endif | ||
29 | #ifdef CONFIG_SIBYTE_LITTLESUR | ||
30 | #define SIBYTE_BOARD_NAME "BCM91250C2 (LittleSur)" | ||
31 | #define SIBYTE_HAVE_PCMCIA 0 | ||
32 | #define SIBYTE_HAVE_IDE 1 | ||
33 | #define SIBYTE_DEFAULT_CONSOLE "cfe0" | ||
34 | #endif | ||
35 | #ifdef CONFIG_SIBYTE_CRHONE | ||
36 | #define SIBYTE_BOARD_NAME "BCM91125C (CRhone)" | ||
37 | #define SIBYTE_HAVE_PCMCIA 0 | ||
38 | #define SIBYTE_HAVE_IDE 0 | ||
39 | #endif | ||
40 | #ifdef CONFIG_SIBYTE_CRHINE | ||
41 | #define SIBYTE_BOARD_NAME "BCM91120C (CRhine)" | ||
42 | #define SIBYTE_HAVE_PCMCIA 0 | ||
43 | #define SIBYTE_HAVE_IDE 0 | ||
44 | #endif | ||
45 | |||
46 | /* Generic bus chip selects */ | ||
47 | #define LEDS_CS 3 | ||
48 | #define LEDS_PHYS 0x100a0000 | ||
49 | |||
50 | #ifdef SIBYTE_HAVE_IDE | ||
51 | #define IDE_CS 4 | ||
52 | #define IDE_PHYS 0x100b0000 | ||
53 | #define K_GPIO_GB_IDE 4 | ||
54 | #define K_INT_GB_IDE (K_INT_GPIO_0 + K_GPIO_GB_IDE) | ||
55 | #endif | ||
56 | |||
57 | #ifdef SIBYTE_HAVE_PCMCIA | ||
58 | #define PCMCIA_CS 6 | ||
59 | #define PCMCIA_PHYS 0x11000000 | ||
60 | #define K_GPIO_PC_READY 9 | ||
61 | #define K_INT_PC_READY (K_INT_GPIO_0 + K_GPIO_PC_READY) | ||
62 | #endif | ||
63 | |||
64 | #endif /* __ASM_SIBYTE_SWARM_H */ | ||
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h deleted file mode 100644 index 9ce0607d7a4e..000000000000 --- a/include/asm-mips/sigcontext.h +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 1997, 1999 by Ralf Baechle | ||
7 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_SIGCONTEXT_H | ||
10 | #define _ASM_SIGCONTEXT_H | ||
11 | |||
12 | #include <asm/sgidefs.h> | ||
13 | |||
14 | #if _MIPS_SIM == _MIPS_SIM_ABI32 | ||
15 | |||
16 | /* | ||
17 | * Keep this struct definition in sync with the sigcontext fragment | ||
18 | * in arch/mips/tools/offset.c | ||
19 | */ | ||
20 | struct sigcontext { | ||
21 | unsigned int sc_regmask; /* Unused */ | ||
22 | unsigned int sc_status; /* Unused */ | ||
23 | unsigned long long sc_pc; | ||
24 | unsigned long long sc_regs[32]; | ||
25 | unsigned long long sc_fpregs[32]; | ||
26 | unsigned int sc_acx; /* Was sc_ownedfp */ | ||
27 | unsigned int sc_fpc_csr; | ||
28 | unsigned int sc_fpc_eir; /* Unused */ | ||
29 | unsigned int sc_used_math; | ||
30 | unsigned int sc_dsp; /* dsp status, was sc_ssflags */ | ||
31 | unsigned long long sc_mdhi; | ||
32 | unsigned long long sc_mdlo; | ||
33 | unsigned long sc_hi1; /* Was sc_cause */ | ||
34 | unsigned long sc_lo1; /* Was sc_badvaddr */ | ||
35 | unsigned long sc_hi2; /* Was sc_sigset[4] */ | ||
36 | unsigned long sc_lo2; | ||
37 | unsigned long sc_hi3; | ||
38 | unsigned long sc_lo3; | ||
39 | }; | ||
40 | |||
41 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | ||
42 | |||
43 | #if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 | ||
44 | |||
45 | #include <linux/posix_types.h> | ||
46 | /* | ||
47 | * Keep this struct definition in sync with the sigcontext fragment | ||
48 | * in arch/mips/tools/offset.c | ||
49 | * | ||
50 | * Warning: this structure illdefined with sc_badvaddr being just an unsigned | ||
51 | * int so it was changed to unsigned long in 2.6.0-test1. This may break | ||
52 | * binary compatibility - no prisoners. | ||
53 | * DSP ASE in 2.6.12-rc4. Turn sc_mdhi and sc_mdlo into an array of four | ||
54 | * entries, add sc_dsp and sc_reserved for padding. No prisoners. | ||
55 | */ | ||
56 | struct sigcontext { | ||
57 | __u64 sc_regs[32]; | ||
58 | __u64 sc_fpregs[32]; | ||
59 | __u64 sc_mdhi; | ||
60 | __u64 sc_hi1; | ||
61 | __u64 sc_hi2; | ||
62 | __u64 sc_hi3; | ||
63 | __u64 sc_mdlo; | ||
64 | __u64 sc_lo1; | ||
65 | __u64 sc_lo2; | ||
66 | __u64 sc_lo3; | ||
67 | __u64 sc_pc; | ||
68 | __u32 sc_fpc_csr; | ||
69 | __u32 sc_used_math; | ||
70 | __u32 sc_dsp; | ||
71 | __u32 sc_reserved; | ||
72 | }; | ||
73 | |||
74 | #ifdef __KERNEL__ | ||
75 | |||
76 | struct sigcontext32 { | ||
77 | __u32 sc_regmask; /* Unused */ | ||
78 | __u32 sc_status; /* Unused */ | ||
79 | __u64 sc_pc; | ||
80 | __u64 sc_regs[32]; | ||
81 | __u64 sc_fpregs[32]; | ||
82 | __u32 sc_acx; /* Only MIPS32; was sc_ownedfp */ | ||
83 | __u32 sc_fpc_csr; | ||
84 | __u32 sc_fpc_eir; /* Unused */ | ||
85 | __u32 sc_used_math; | ||
86 | __u32 sc_dsp; /* dsp status, was sc_ssflags */ | ||
87 | __u64 sc_mdhi; | ||
88 | __u64 sc_mdlo; | ||
89 | __u32 sc_hi1; /* Was sc_cause */ | ||
90 | __u32 sc_lo1; /* Was sc_badvaddr */ | ||
91 | __u32 sc_hi2; /* Was sc_sigset[4] */ | ||
92 | __u32 sc_lo2; | ||
93 | __u32 sc_hi3; | ||
94 | __u32 sc_lo3; | ||
95 | }; | ||
96 | #endif /* __KERNEL__ */ | ||
97 | |||
98 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */ | ||
99 | |||
100 | #endif /* _ASM_SIGCONTEXT_H */ | ||
diff --git a/include/asm-mips/siginfo.h b/include/asm-mips/siginfo.h deleted file mode 100644 index 96e28f18dad1..000000000000 --- a/include/asm-mips/siginfo.h +++ /dev/null | |||
@@ -1,130 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle | ||
7 | * Copyright (C) 2000, 2001 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_SIGINFO_H | ||
10 | #define _ASM_SIGINFO_H | ||
11 | |||
12 | |||
13 | #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int)) | ||
14 | #undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */ | ||
15 | |||
16 | #define HAVE_ARCH_SIGINFO_T | ||
17 | |||
18 | /* | ||
19 | * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked | ||
20 | * by design ... | ||
21 | */ | ||
22 | #define HAVE_ARCH_COPY_SIGINFO | ||
23 | struct siginfo; | ||
24 | |||
25 | /* | ||
26 | * Careful to keep union _sifields from shifting ... | ||
27 | */ | ||
28 | #ifdef CONFIG_32BIT | ||
29 | #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) | ||
30 | #endif | ||
31 | #ifdef CONFIG_64BIT | ||
32 | #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) | ||
33 | #endif | ||
34 | |||
35 | #include <asm-generic/siginfo.h> | ||
36 | |||
37 | typedef struct siginfo { | ||
38 | int si_signo; | ||
39 | int si_code; | ||
40 | int si_errno; | ||
41 | int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3]; | ||
42 | |||
43 | union { | ||
44 | int _pad[SI_PAD_SIZE]; | ||
45 | |||
46 | /* kill() */ | ||
47 | struct { | ||
48 | pid_t _pid; /* sender's pid */ | ||
49 | __ARCH_SI_UID_T _uid; /* sender's uid */ | ||
50 | } _kill; | ||
51 | |||
52 | /* POSIX.1b timers */ | ||
53 | struct { | ||
54 | timer_t _tid; /* timer id */ | ||
55 | int _overrun; /* overrun count */ | ||
56 | char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)]; | ||
57 | sigval_t _sigval; /* same as below */ | ||
58 | int _sys_private; /* not to be passed to user */ | ||
59 | } _timer; | ||
60 | |||
61 | /* POSIX.1b signals */ | ||
62 | struct { | ||
63 | pid_t _pid; /* sender's pid */ | ||
64 | __ARCH_SI_UID_T _uid; /* sender's uid */ | ||
65 | sigval_t _sigval; | ||
66 | } _rt; | ||
67 | |||
68 | /* SIGCHLD */ | ||
69 | struct { | ||
70 | pid_t _pid; /* which child */ | ||
71 | __ARCH_SI_UID_T _uid; /* sender's uid */ | ||
72 | int _status; /* exit code */ | ||
73 | clock_t _utime; | ||
74 | clock_t _stime; | ||
75 | } _sigchld; | ||
76 | |||
77 | /* IRIX SIGCHLD */ | ||
78 | struct { | ||
79 | pid_t _pid; /* which child */ | ||
80 | clock_t _utime; | ||
81 | int _status; /* exit code */ | ||
82 | clock_t _stime; | ||
83 | } _irix_sigchld; | ||
84 | |||
85 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
86 | struct { | ||
87 | void __user *_addr; /* faulting insn/memory ref. */ | ||
88 | #ifdef __ARCH_SI_TRAPNO | ||
89 | int _trapno; /* TRAP # which caused the signal */ | ||
90 | #endif | ||
91 | } _sigfault; | ||
92 | |||
93 | /* SIGPOLL, SIGXFSZ (To do ...) */ | ||
94 | struct { | ||
95 | __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
96 | int _fd; | ||
97 | } _sigpoll; | ||
98 | } _sifields; | ||
99 | } siginfo_t; | ||
100 | |||
101 | /* | ||
102 | * si_code values | ||
103 | * Again these have been choosen to be IRIX compatible. | ||
104 | */ | ||
105 | #undef SI_ASYNCIO | ||
106 | #undef SI_TIMER | ||
107 | #undef SI_MESGQ | ||
108 | #define SI_ASYNCIO -2 /* sent by AIO completion */ | ||
109 | #define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */ | ||
110 | #define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */ | ||
111 | |||
112 | #ifdef __KERNEL__ | ||
113 | |||
114 | /* | ||
115 | * Duplicated here because of <asm-generic/siginfo.h> braindamage ... | ||
116 | */ | ||
117 | #include <linux/string.h> | ||
118 | |||
119 | static inline void copy_siginfo(struct siginfo *to, struct siginfo *from) | ||
120 | { | ||
121 | if (from->si_code < 0) | ||
122 | memcpy(to, from, sizeof(*to)); | ||
123 | else | ||
124 | /* _sigchld is currently the largest know union member */ | ||
125 | memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld)); | ||
126 | } | ||
127 | |||
128 | #endif | ||
129 | |||
130 | #endif /* _ASM_SIGINFO_H */ | ||
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h deleted file mode 100644 index bee5153aca48..000000000000 --- a/include/asm-mips/signal.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle | ||
7 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_SIGNAL_H | ||
10 | #define _ASM_SIGNAL_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | #define _NSIG 128 | ||
15 | #define _NSIG_BPW (sizeof(unsigned long) * 8) | ||
16 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) | ||
17 | |||
18 | typedef struct { | ||
19 | unsigned long sig[_NSIG_WORDS]; | ||
20 | } sigset_t; | ||
21 | |||
22 | typedef unsigned long old_sigset_t; /* at least 32 bits */ | ||
23 | |||
24 | #define SIGHUP 1 /* Hangup (POSIX). */ | ||
25 | #define SIGINT 2 /* Interrupt (ANSI). */ | ||
26 | #define SIGQUIT 3 /* Quit (POSIX). */ | ||
27 | #define SIGILL 4 /* Illegal instruction (ANSI). */ | ||
28 | #define SIGTRAP 5 /* Trace trap (POSIX). */ | ||
29 | #define SIGIOT 6 /* IOT trap (4.2 BSD). */ | ||
30 | #define SIGABRT SIGIOT /* Abort (ANSI). */ | ||
31 | #define SIGEMT 7 | ||
32 | #define SIGFPE 8 /* Floating-point exception (ANSI). */ | ||
33 | #define SIGKILL 9 /* Kill, unblockable (POSIX). */ | ||
34 | #define SIGBUS 10 /* BUS error (4.2 BSD). */ | ||
35 | #define SIGSEGV 11 /* Segmentation violation (ANSI). */ | ||
36 | #define SIGSYS 12 | ||
37 | #define SIGPIPE 13 /* Broken pipe (POSIX). */ | ||
38 | #define SIGALRM 14 /* Alarm clock (POSIX). */ | ||
39 | #define SIGTERM 15 /* Termination (ANSI). */ | ||
40 | #define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ | ||
41 | #define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ | ||
42 | #define SIGCHLD 18 /* Child status has changed (POSIX). */ | ||
43 | #define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ | ||
44 | #define SIGPWR 19 /* Power failure restart (System V). */ | ||
45 | #define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */ | ||
46 | #define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */ | ||
47 | #define SIGIO 22 /* I/O now possible (4.2 BSD). */ | ||
48 | #define SIGPOLL SIGIO /* Pollable event occurred (System V). */ | ||
49 | #define SIGSTOP 23 /* Stop, unblockable (POSIX). */ | ||
50 | #define SIGTSTP 24 /* Keyboard stop (POSIX). */ | ||
51 | #define SIGCONT 25 /* Continue (POSIX). */ | ||
52 | #define SIGTTIN 26 /* Background read from tty (POSIX). */ | ||
53 | #define SIGTTOU 27 /* Background write to tty (POSIX). */ | ||
54 | #define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */ | ||
55 | #define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */ | ||
56 | #define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */ | ||
57 | #define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */ | ||
58 | |||
59 | /* These should not be considered constants from userland. */ | ||
60 | #define SIGRTMIN 32 | ||
61 | #define SIGRTMAX _NSIG | ||
62 | |||
63 | /* | ||
64 | * SA_FLAGS values: | ||
65 | * | ||
66 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
67 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
68 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
69 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
70 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
71 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
72 | * | ||
73 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
74 | * Unix names RESETHAND and NODEFER respectively. | ||
75 | */ | ||
76 | #define SA_ONSTACK 0x08000000 | ||
77 | #define SA_RESETHAND 0x80000000 | ||
78 | #define SA_RESTART 0x10000000 | ||
79 | #define SA_SIGINFO 0x00000008 | ||
80 | #define SA_NODEFER 0x40000000 | ||
81 | #define SA_NOCLDWAIT 0x00010000 | ||
82 | #define SA_NOCLDSTOP 0x00000001 | ||
83 | |||
84 | #define SA_NOMASK SA_NODEFER | ||
85 | #define SA_ONESHOT SA_RESETHAND | ||
86 | |||
87 | #define SA_RESTORER 0x04000000 /* Only for o32 */ | ||
88 | |||
89 | /* | ||
90 | * sigaltstack controls | ||
91 | */ | ||
92 | #define SS_ONSTACK 1 | ||
93 | #define SS_DISABLE 2 | ||
94 | |||
95 | #define MINSIGSTKSZ 2048 | ||
96 | #define SIGSTKSZ 8192 | ||
97 | |||
98 | #ifdef __KERNEL__ | ||
99 | |||
100 | #ifdef CONFIG_TRAD_SIGNALS | ||
101 | #define sig_uses_siginfo(ka) ((ka)->sa.sa_flags & SA_SIGINFO) | ||
102 | #else | ||
103 | #define sig_uses_siginfo(ka) (1) | ||
104 | #endif | ||
105 | |||
106 | #endif /* __KERNEL__ */ | ||
107 | |||
108 | #define SIG_BLOCK 1 /* for blocking signals */ | ||
109 | #define SIG_UNBLOCK 2 /* for unblocking signals */ | ||
110 | #define SIG_SETMASK 3 /* for setting the signal mask */ | ||
111 | |||
112 | #include <asm-generic/signal.h> | ||
113 | |||
114 | struct sigaction { | ||
115 | unsigned int sa_flags; | ||
116 | __sighandler_t sa_handler; | ||
117 | sigset_t sa_mask; | ||
118 | }; | ||
119 | |||
120 | struct k_sigaction { | ||
121 | struct sigaction sa; | ||
122 | }; | ||
123 | |||
124 | /* IRIX compatible stack_t */ | ||
125 | typedef struct sigaltstack { | ||
126 | void __user *ss_sp; | ||
127 | size_t ss_size; | ||
128 | int ss_flags; | ||
129 | } stack_t; | ||
130 | |||
131 | #ifdef __KERNEL__ | ||
132 | #include <asm/sigcontext.h> | ||
133 | #include <asm/siginfo.h> | ||
134 | |||
135 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | ||
136 | |||
137 | #endif /* __KERNEL__ */ | ||
138 | |||
139 | #endif /* _ASM_SIGNAL_H */ | ||
diff --git a/include/asm-mips/sim.h b/include/asm-mips/sim.h deleted file mode 100644 index 0cd719fabb51..000000000000 --- a/include/asm-mips/sim.h +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1999, 2000, 2003 Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_SIM_H | ||
10 | #define _ASM_SIM_H | ||
11 | |||
12 | |||
13 | #include <asm/asm-offsets.h> | ||
14 | |||
15 | #define __str2(x) #x | ||
16 | #define __str(x) __str2(x) | ||
17 | |||
18 | #ifdef CONFIG_32BIT | ||
19 | |||
20 | #define save_static_function(symbol) \ | ||
21 | __asm__( \ | ||
22 | ".text\n\t" \ | ||
23 | ".globl\t" #symbol "\n\t" \ | ||
24 | ".align\t2\n\t" \ | ||
25 | ".type\t" #symbol ", @function\n\t" \ | ||
26 | ".ent\t" #symbol ", 0\n" \ | ||
27 | #symbol":\n\t" \ | ||
28 | ".frame\t$29, 0, $31\n\t" \ | ||
29 | "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \ | ||
30 | "sw\t$17,"__str(PT_R17)"($29)\n\t" \ | ||
31 | "sw\t$18,"__str(PT_R18)"($29)\n\t" \ | ||
32 | "sw\t$19,"__str(PT_R19)"($29)\n\t" \ | ||
33 | "sw\t$20,"__str(PT_R20)"($29)\n\t" \ | ||
34 | "sw\t$21,"__str(PT_R21)"($29)\n\t" \ | ||
35 | "sw\t$22,"__str(PT_R22)"($29)\n\t" \ | ||
36 | "sw\t$23,"__str(PT_R23)"($29)\n\t" \ | ||
37 | "sw\t$30,"__str(PT_R30)"($29)\n\t" \ | ||
38 | "j\t_" #symbol "\n\t" \ | ||
39 | ".end\t" #symbol "\n\t" \ | ||
40 | ".size\t" #symbol",. - " #symbol) | ||
41 | |||
42 | #define nabi_no_regargs | ||
43 | |||
44 | #endif /* CONFIG_32BIT */ | ||
45 | |||
46 | #ifdef CONFIG_64BIT | ||
47 | |||
48 | #define save_static_function(symbol) \ | ||
49 | __asm__( \ | ||
50 | ".text\n\t" \ | ||
51 | ".globl\t" #symbol "\n\t" \ | ||
52 | ".align\t2\n\t" \ | ||
53 | ".type\t" #symbol ", @function\n\t" \ | ||
54 | ".ent\t" #symbol ", 0\n" \ | ||
55 | #symbol":\n\t" \ | ||
56 | ".frame\t$29, 0, $31\n\t" \ | ||
57 | "sd\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \ | ||
58 | "sd\t$17,"__str(PT_R17)"($29)\n\t" \ | ||
59 | "sd\t$18,"__str(PT_R18)"($29)\n\t" \ | ||
60 | "sd\t$19,"__str(PT_R19)"($29)\n\t" \ | ||
61 | "sd\t$20,"__str(PT_R20)"($29)\n\t" \ | ||
62 | "sd\t$21,"__str(PT_R21)"($29)\n\t" \ | ||
63 | "sd\t$22,"__str(PT_R22)"($29)\n\t" \ | ||
64 | "sd\t$23,"__str(PT_R23)"($29)\n\t" \ | ||
65 | "sd\t$30,"__str(PT_R30)"($29)\n\t" \ | ||
66 | "j\t_" #symbol "\n\t" \ | ||
67 | ".end\t" #symbol "\n\t" \ | ||
68 | ".size\t" #symbol",. - " #symbol) | ||
69 | |||
70 | #define nabi_no_regargs \ | ||
71 | unsigned long __dummy0, \ | ||
72 | unsigned long __dummy1, \ | ||
73 | unsigned long __dummy2, \ | ||
74 | unsigned long __dummy3, \ | ||
75 | unsigned long __dummy4, \ | ||
76 | unsigned long __dummy5, \ | ||
77 | unsigned long __dummy6, \ | ||
78 | unsigned long __dummy7, | ||
79 | |||
80 | #endif /* CONFIG_64BIT */ | ||
81 | |||
82 | #endif /* _ASM_SIM_H */ | ||
diff --git a/include/asm-mips/smp-ops.h b/include/asm-mips/smp-ops.h deleted file mode 100644 index 43c207e72a63..000000000000 --- a/include/asm-mips/smp-ops.h +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General | ||
3 | * Public License. See the file "COPYING" in the main directory of this | ||
4 | * archive for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com) | ||
7 | * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc. | ||
8 | * Copyright (C) 2000, 2001, 2002 Ralf Baechle | ||
9 | * Copyright (C) 2000, 2001 Broadcom Corporation | ||
10 | */ | ||
11 | #ifndef __ASM_SMP_OPS_H | ||
12 | #define __ASM_SMP_OPS_H | ||
13 | |||
14 | #ifdef CONFIG_SMP | ||
15 | |||
16 | #include <linux/cpumask.h> | ||
17 | |||
18 | struct plat_smp_ops { | ||
19 | void (*send_ipi_single)(int cpu, unsigned int action); | ||
20 | void (*send_ipi_mask)(cpumask_t mask, unsigned int action); | ||
21 | void (*init_secondary)(void); | ||
22 | void (*smp_finish)(void); | ||
23 | void (*cpus_done)(void); | ||
24 | void (*boot_secondary)(int cpu, struct task_struct *idle); | ||
25 | void (*smp_setup)(void); | ||
26 | void (*prepare_cpus)(unsigned int max_cpus); | ||
27 | }; | ||
28 | |||
29 | extern void register_smp_ops(struct plat_smp_ops *ops); | ||
30 | |||
31 | static inline void plat_smp_setup(void) | ||
32 | { | ||
33 | extern struct plat_smp_ops *mp_ops; /* private */ | ||
34 | |||
35 | mp_ops->smp_setup(); | ||
36 | } | ||
37 | |||
38 | #else /* !CONFIG_SMP */ | ||
39 | |||
40 | struct plat_smp_ops; | ||
41 | |||
42 | static inline void plat_smp_setup(void) | ||
43 | { | ||
44 | /* UP, nothing to do ... */ | ||
45 | } | ||
46 | |||
47 | static inline void register_smp_ops(struct plat_smp_ops *ops) | ||
48 | { | ||
49 | } | ||
50 | |||
51 | #endif /* !CONFIG_SMP */ | ||
52 | |||
53 | extern struct plat_smp_ops up_smp_ops; | ||
54 | extern struct plat_smp_ops cmp_smp_ops; | ||
55 | extern struct plat_smp_ops vsmp_smp_ops; | ||
56 | |||
57 | #endif /* __ASM_SMP_OPS_H */ | ||
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h deleted file mode 100644 index 0ff5b523ea77..000000000000 --- a/include/asm-mips/smp.h +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General | ||
3 | * Public License. See the file "COPYING" in the main directory of this | ||
4 | * archive for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com) | ||
7 | * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc. | ||
8 | * Copyright (C) 2000, 2001, 2002 Ralf Baechle | ||
9 | * Copyright (C) 2000, 2001 Broadcom Corporation | ||
10 | */ | ||
11 | #ifndef __ASM_SMP_H | ||
12 | #define __ASM_SMP_H | ||
13 | |||
14 | #include <linux/bitops.h> | ||
15 | #include <linux/linkage.h> | ||
16 | #include <linux/threads.h> | ||
17 | #include <linux/cpumask.h> | ||
18 | |||
19 | #include <asm/atomic.h> | ||
20 | #include <asm/smp-ops.h> | ||
21 | |||
22 | extern int smp_num_siblings; | ||
23 | extern cpumask_t cpu_sibling_map[]; | ||
24 | |||
25 | #define raw_smp_processor_id() (current_thread_info()->cpu) | ||
26 | |||
27 | /* Map from cpu id to sequential logical cpu number. This will only | ||
28 | not be idempotent when cpus failed to come on-line. */ | ||
29 | extern int __cpu_number_map[NR_CPUS]; | ||
30 | #define cpu_number_map(cpu) __cpu_number_map[cpu] | ||
31 | |||
32 | /* The reverse map from sequential logical cpu number to cpu id. */ | ||
33 | extern int __cpu_logical_map[NR_CPUS]; | ||
34 | #define cpu_logical_map(cpu) __cpu_logical_map[cpu] | ||
35 | |||
36 | #define NO_PROC_ID (-1) | ||
37 | |||
38 | #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ | ||
39 | #define SMP_CALL_FUNCTION 0x2 | ||
40 | |||
41 | extern cpumask_t phys_cpu_present_map; | ||
42 | #define cpu_possible_map phys_cpu_present_map | ||
43 | |||
44 | extern void asmlinkage smp_bootstrap(void); | ||
45 | |||
46 | /* | ||
47 | * this function sends a 'reschedule' IPI to another CPU. | ||
48 | * it goes straight through and wastes no time serializing | ||
49 | * anything. Worst case is that we lose a reschedule ... | ||
50 | */ | ||
51 | static inline void smp_send_reschedule(int cpu) | ||
52 | { | ||
53 | extern struct plat_smp_ops *mp_ops; /* private */ | ||
54 | |||
55 | mp_ops->send_ipi_single(cpu, SMP_RESCHEDULE_YOURSELF); | ||
56 | } | ||
57 | |||
58 | extern asmlinkage void smp_call_function_interrupt(void); | ||
59 | |||
60 | extern void arch_send_call_function_single_ipi(int cpu); | ||
61 | extern void arch_send_call_function_ipi(cpumask_t mask); | ||
62 | |||
63 | #endif /* __ASM_SMP_H */ | ||
diff --git a/include/asm-mips/smtc.h b/include/asm-mips/smtc.h deleted file mode 100644 index ea60bf08dcb0..000000000000 --- a/include/asm-mips/smtc.h +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | #ifndef _ASM_SMTC_MT_H | ||
2 | #define _ASM_SMTC_MT_H | ||
3 | |||
4 | /* | ||
5 | * Definitions for SMTC multitasking on MIPS MT cores | ||
6 | */ | ||
7 | |||
8 | #include <asm/mips_mt.h> | ||
9 | #include <asm/smtc_ipi.h> | ||
10 | |||
11 | /* | ||
12 | * System-wide SMTC status information | ||
13 | */ | ||
14 | |||
15 | extern unsigned int smtc_status; | ||
16 | |||
17 | #define SMTC_TLB_SHARED 0x00000001 | ||
18 | #define SMTC_MTC_ACTIVE 0x00000002 | ||
19 | |||
20 | /* | ||
21 | * TLB/ASID Management information | ||
22 | */ | ||
23 | |||
24 | #define MAX_SMTC_TLBS 2 | ||
25 | #define MAX_SMTC_ASIDS 256 | ||
26 | #if NR_CPUS <= 8 | ||
27 | typedef char asiduse; | ||
28 | #else | ||
29 | #if NR_CPUS <= 16 | ||
30 | typedef short asiduse; | ||
31 | #else | ||
32 | typedef long asiduse; | ||
33 | #endif | ||
34 | #endif | ||
35 | |||
36 | extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS]; | ||
37 | |||
38 | struct mm_struct; | ||
39 | struct task_struct; | ||
40 | |||
41 | void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu); | ||
42 | void self_ipi(struct smtc_ipi *); | ||
43 | void smtc_flush_tlb_asid(unsigned long asid); | ||
44 | extern int smtc_build_cpu_map(int startslot); | ||
45 | extern void smtc_prepare_cpus(int cpus); | ||
46 | extern void smtc_smp_finish(void); | ||
47 | extern void smtc_boot_secondary(int cpu, struct task_struct *t); | ||
48 | extern void smtc_cpus_done(void); | ||
49 | |||
50 | |||
51 | /* | ||
52 | * Sharing the TLB between multiple VPEs means that the | ||
53 | * "random" index selection function is not allowed to | ||
54 | * select the current value of the Index register. To | ||
55 | * avoid additional TLB pressure, the Index registers | ||
56 | * are "parked" with an non-Valid value. | ||
57 | */ | ||
58 | |||
59 | #define PARKED_INDEX ((unsigned int)0x80000000) | ||
60 | |||
61 | /* | ||
62 | * Define low-level interrupt mask for IPIs, if necessary. | ||
63 | * By default, use SW interrupt 1, which requires no external | ||
64 | * hardware support, but which works only for single-core | ||
65 | * MIPS MT systems. | ||
66 | */ | ||
67 | #ifndef MIPS_CPU_IPI_IRQ | ||
68 | #define MIPS_CPU_IPI_IRQ 1 | ||
69 | #endif | ||
70 | |||
71 | #endif /* _ASM_SMTC_MT_H */ | ||
diff --git a/include/asm-mips/smtc_ipi.h b/include/asm-mips/smtc_ipi.h deleted file mode 100644 index 8ce517574340..000000000000 --- a/include/asm-mips/smtc_ipi.h +++ /dev/null | |||
@@ -1,128 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions used in MIPS MT SMTC "Interprocessor Interrupt" code. | ||
3 | */ | ||
4 | #ifndef __ASM_SMTC_IPI_H | ||
5 | #define __ASM_SMTC_IPI_H | ||
6 | |||
7 | #include <linux/spinlock.h> | ||
8 | |||
9 | //#define SMTC_IPI_DEBUG | ||
10 | |||
11 | #ifdef SMTC_IPI_DEBUG | ||
12 | #include <asm/mipsregs.h> | ||
13 | #include <asm/mipsmtregs.h> | ||
14 | #endif /* SMTC_IPI_DEBUG */ | ||
15 | |||
16 | /* | ||
17 | * An IPI "message" | ||
18 | */ | ||
19 | |||
20 | struct smtc_ipi { | ||
21 | struct smtc_ipi *flink; | ||
22 | int type; | ||
23 | void *arg; | ||
24 | int dest; | ||
25 | #ifdef SMTC_IPI_DEBUG | ||
26 | int sender; | ||
27 | long stamp; | ||
28 | #endif /* SMTC_IPI_DEBUG */ | ||
29 | }; | ||
30 | |||
31 | /* | ||
32 | * Defined IPI Types | ||
33 | */ | ||
34 | |||
35 | #define LINUX_SMP_IPI 1 | ||
36 | #define SMTC_CLOCK_TICK 2 | ||
37 | #define IRQ_AFFINITY_IPI 3 | ||
38 | |||
39 | /* | ||
40 | * A queue of IPI messages | ||
41 | */ | ||
42 | |||
43 | struct smtc_ipi_q { | ||
44 | struct smtc_ipi *head; | ||
45 | spinlock_t lock; | ||
46 | struct smtc_ipi *tail; | ||
47 | int depth; | ||
48 | }; | ||
49 | |||
50 | static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p) | ||
51 | { | ||
52 | unsigned long flags; | ||
53 | |||
54 | spin_lock_irqsave(&q->lock, flags); | ||
55 | if (q->head == NULL) | ||
56 | q->head = q->tail = p; | ||
57 | else | ||
58 | q->tail->flink = p; | ||
59 | p->flink = NULL; | ||
60 | q->tail = p; | ||
61 | q->depth++; | ||
62 | #ifdef SMTC_IPI_DEBUG | ||
63 | p->sender = read_c0_tcbind(); | ||
64 | p->stamp = read_c0_count(); | ||
65 | #endif /* SMTC_IPI_DEBUG */ | ||
66 | spin_unlock_irqrestore(&q->lock, flags); | ||
67 | } | ||
68 | |||
69 | static inline struct smtc_ipi *__smtc_ipi_dq(struct smtc_ipi_q *q) | ||
70 | { | ||
71 | struct smtc_ipi *p; | ||
72 | |||
73 | if (q->head == NULL) | ||
74 | p = NULL; | ||
75 | else { | ||
76 | p = q->head; | ||
77 | q->head = q->head->flink; | ||
78 | q->depth--; | ||
79 | /* Arguably unnecessary, but leaves queue cleaner */ | ||
80 | if (q->head == NULL) | ||
81 | q->tail = NULL; | ||
82 | } | ||
83 | |||
84 | return p; | ||
85 | } | ||
86 | |||
87 | static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q) | ||
88 | { | ||
89 | unsigned long flags; | ||
90 | struct smtc_ipi *p; | ||
91 | |||
92 | spin_lock_irqsave(&q->lock, flags); | ||
93 | p = __smtc_ipi_dq(q); | ||
94 | spin_unlock_irqrestore(&q->lock, flags); | ||
95 | |||
96 | return p; | ||
97 | } | ||
98 | |||
99 | static inline void smtc_ipi_req(struct smtc_ipi_q *q, struct smtc_ipi *p) | ||
100 | { | ||
101 | unsigned long flags; | ||
102 | |||
103 | spin_lock_irqsave(&q->lock, flags); | ||
104 | if (q->head == NULL) { | ||
105 | q->head = q->tail = p; | ||
106 | p->flink = NULL; | ||
107 | } else { | ||
108 | p->flink = q->head; | ||
109 | q->head = p; | ||
110 | } | ||
111 | q->depth++; | ||
112 | spin_unlock_irqrestore(&q->lock, flags); | ||
113 | } | ||
114 | |||
115 | static inline int smtc_ipi_qdepth(struct smtc_ipi_q *q) | ||
116 | { | ||
117 | unsigned long flags; | ||
118 | int retval; | ||
119 | |||
120 | spin_lock_irqsave(&q->lock, flags); | ||
121 | retval = q->depth; | ||
122 | spin_unlock_irqrestore(&q->lock, flags); | ||
123 | return retval; | ||
124 | } | ||
125 | |||
126 | extern void smtc_send_ipi(int cpu, int type, unsigned int action); | ||
127 | |||
128 | #endif /* __ASM_SMTC_IPI_H */ | ||
diff --git a/include/asm-mips/smtc_proc.h b/include/asm-mips/smtc_proc.h deleted file mode 100644 index 25da651f1f5f..000000000000 --- a/include/asm-mips/smtc_proc.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for SMTC /proc entries | ||
3 | * Copyright(C) 2005 MIPS Technologies Inc. | ||
4 | */ | ||
5 | #ifndef __ASM_SMTC_PROC_H | ||
6 | #define __ASM_SMTC_PROC_H | ||
7 | |||
8 | /* | ||
9 | * per-"CPU" statistics | ||
10 | */ | ||
11 | |||
12 | struct smtc_cpu_proc { | ||
13 | unsigned long timerints; | ||
14 | unsigned long selfipis; | ||
15 | }; | ||
16 | |||
17 | extern struct smtc_cpu_proc smtc_cpu_stats[NR_CPUS]; | ||
18 | |||
19 | /* Count of number of recoveries of "stolen" FPU access rights on 34K */ | ||
20 | |||
21 | extern atomic_t smtc_fpu_recoveries; | ||
22 | |||
23 | #endif /* __ASM_SMTC_PROC_H */ | ||
diff --git a/include/asm-mips/smvp.h b/include/asm-mips/smvp.h deleted file mode 100644 index 0d0e80a39e8a..000000000000 --- a/include/asm-mips/smvp.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | #ifndef _ASM_SMVP_H | ||
2 | #define _ASM_SMVP_H | ||
3 | |||
4 | /* | ||
5 | * Definitions for SMVP multitasking on MIPS MT cores | ||
6 | */ | ||
7 | struct task_struct; | ||
8 | |||
9 | extern void smvp_smp_setup(void); | ||
10 | extern void smvp_smp_finish(void); | ||
11 | extern void smvp_boot_secondary(int cpu, struct task_struct *t); | ||
12 | extern void smvp_init_secondary(void); | ||
13 | extern void smvp_smp_finish(void); | ||
14 | extern void smvp_cpus_done(void); | ||
15 | extern void smvp_prepare_cpus(unsigned int max_cpus); | ||
16 | |||
17 | /* This is platform specific */ | ||
18 | extern void smvp_send_ipi(int cpu, unsigned int action); | ||
19 | #endif /* _ASM_SMVP_H */ | ||
diff --git a/include/asm-mips/sn/addrs.h b/include/asm-mips/sn/addrs.h deleted file mode 100644 index fec9bdd34913..000000000000 --- a/include/asm-mips/sn/addrs.h +++ /dev/null | |||
@@ -1,430 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1992 - 1997, 1999, 2000 Silicon Graphics, Inc. | ||
7 | * Copyright (C) 1999, 2000 by Ralf Baechle | ||
8 | */ | ||
9 | #ifndef _ASM_SN_ADDRS_H | ||
10 | #define _ASM_SN_ADDRS_H | ||
11 | |||
12 | |||
13 | #ifndef __ASSEMBLY__ | ||
14 | #include <linux/types.h> | ||
15 | #endif /* !__ASSEMBLY__ */ | ||
16 | |||
17 | #include <asm/addrspace.h> | ||
18 | #include <asm/sn/kldir.h> | ||
19 | |||
20 | #if defined(CONFIG_SGI_IP27) | ||
21 | #include <asm/sn/sn0/addrs.h> | ||
22 | #elif defined(CONFIG_SGI_IP35) | ||
23 | #include <asm/sn/sn1/addrs.h> | ||
24 | #endif | ||
25 | |||
26 | |||
27 | #ifndef __ASSEMBLY__ | ||
28 | |||
29 | #define PS_UINT_CAST (unsigned long) | ||
30 | #define UINT64_CAST (unsigned long) | ||
31 | |||
32 | #define HUBREG_CAST (volatile hubreg_t *) | ||
33 | |||
34 | #else /* __ASSEMBLY__ */ | ||
35 | |||
36 | #define PS_UINT_CAST | ||
37 | #define UINT64_CAST | ||
38 | #define HUBREG_CAST | ||
39 | |||
40 | #endif /* __ASSEMBLY__ */ | ||
41 | |||
42 | |||
43 | #define NASID_GET_META(_n) ((_n) >> NASID_LOCAL_BITS) | ||
44 | #ifdef CONFIG_SGI_IP27 | ||
45 | #define NASID_GET_LOCAL(_n) ((_n) & 0xf) | ||
46 | #endif | ||
47 | #define NASID_MAKE(_m, _l) (((_m) << NASID_LOCAL_BITS) | (_l)) | ||
48 | |||
49 | #define NODE_ADDRSPACE_MASK (NODE_ADDRSPACE_SIZE - 1) | ||
50 | #define TO_NODE_ADDRSPACE(_pa) (UINT64_CAST (_pa) & NODE_ADDRSPACE_MASK) | ||
51 | |||
52 | #define CHANGE_ADDR_NASID(_pa, _nasid) \ | ||
53 | ((UINT64_CAST(_pa) & ~NASID_MASK) | \ | ||
54 | (UINT64_CAST(_nasid) << NASID_SHFT)) | ||
55 | |||
56 | |||
57 | /* | ||
58 | * The following macros are used to index to the beginning of a specific | ||
59 | * node's address space. | ||
60 | */ | ||
61 | |||
62 | #define NODE_OFFSET(_n) (UINT64_CAST (_n) << NODE_SIZE_BITS) | ||
63 | |||
64 | #define NODE_CAC_BASE(_n) (CAC_BASE + NODE_OFFSET(_n)) | ||
65 | #define NODE_HSPEC_BASE(_n) (HSPEC_BASE + NODE_OFFSET(_n)) | ||
66 | #define NODE_IO_BASE(_n) (IO_BASE + NODE_OFFSET(_n)) | ||
67 | #define NODE_MSPEC_BASE(_n) (MSPEC_BASE + NODE_OFFSET(_n)) | ||
68 | #define NODE_UNCAC_BASE(_n) (UNCAC_BASE + NODE_OFFSET(_n)) | ||
69 | |||
70 | #define TO_NODE(_n, _x) (NODE_OFFSET(_n) | ((_x) )) | ||
71 | #define TO_NODE_CAC(_n, _x) (NODE_CAC_BASE(_n) | ((_x) & TO_PHYS_MASK)) | ||
72 | #define TO_NODE_UNCAC(_n, _x) (NODE_UNCAC_BASE(_n) | ((_x) & TO_PHYS_MASK)) | ||
73 | #define TO_NODE_MSPEC(_n, _x) (NODE_MSPEC_BASE(_n) | ((_x) & TO_PHYS_MASK)) | ||
74 | #define TO_NODE_HSPEC(_n, _x) (NODE_HSPEC_BASE(_n) | ((_x) & TO_PHYS_MASK)) | ||
75 | |||
76 | |||
77 | #define RAW_NODE_SWIN_BASE(nasid, widget) \ | ||
78 | (NODE_IO_BASE(nasid) + (UINT64_CAST(widget) << SWIN_SIZE_BITS)) | ||
79 | |||
80 | #define WIDGETID_GET(addr) ((unsigned char)((addr >> SWIN_SIZE_BITS) & 0xff)) | ||
81 | |||
82 | /* | ||
83 | * The following definitions pertain to the IO special address | ||
84 | * space. They define the location of the big and little windows | ||
85 | * of any given node. | ||
86 | */ | ||
87 | |||
88 | #define SWIN_SIZE_BITS 24 | ||
89 | #define SWIN_SIZE (UINT64_CAST 1 << 24) | ||
90 | #define SWIN_SIZEMASK (SWIN_SIZE - 1) | ||
91 | #define SWIN_WIDGET_MASK 0xF | ||
92 | |||
93 | /* | ||
94 | * Convert smallwindow address to xtalk address. | ||
95 | * | ||
96 | * 'addr' can be physical or virtual address, but will be converted | ||
97 | * to Xtalk address in the range 0 -> SWINZ_SIZEMASK | ||
98 | */ | ||
99 | #define SWIN_WIDGETADDR(addr) ((addr) & SWIN_SIZEMASK) | ||
100 | #define SWIN_WIDGETNUM(addr) (((addr) >> SWIN_SIZE_BITS) & SWIN_WIDGET_MASK) | ||
101 | /* | ||
102 | * Verify if addr belongs to small window address on node with "nasid" | ||
103 | * | ||
104 | * | ||
105 | * NOTE: "addr" is expected to be XKPHYS address, and NOT physical | ||
106 | * address | ||
107 | * | ||
108 | * | ||
109 | */ | ||
110 | #define NODE_SWIN_ADDR(nasid, addr) \ | ||
111 | (((addr) >= NODE_SWIN_BASE(nasid, 0)) && \ | ||
112 | ((addr) < (NODE_SWIN_BASE(nasid, HUB_NUM_WIDGET) + SWIN_SIZE)\ | ||
113 | )) | ||
114 | |||
115 | /* | ||
116 | * The following define the major position-independent aliases used | ||
117 | * in SN. | ||
118 | * UALIAS -- 256MB in size, reads in the UALIAS result in | ||
119 | * uncached references to the memory of the reader's node. | ||
120 | * CPU_UALIAS -- 128kb in size, the bottom part of UALIAS is flipped | ||
121 | * depending on which CPU does the access to provide | ||
122 | * all CPUs with unique uncached memory at low addresses. | ||
123 | * LBOOT -- 256MB in size, reads in the LBOOT area result in | ||
124 | * uncached references to the local hub's boot prom and | ||
125 | * other directory-bus connected devices. | ||
126 | * IALIAS -- 8MB in size, reads in the IALIAS result in uncached | ||
127 | * references to the local hub's registers. | ||
128 | */ | ||
129 | |||
130 | #define UALIAS_BASE HSPEC_BASE | ||
131 | #define UALIAS_SIZE 0x10000000 /* 256 Megabytes */ | ||
132 | #define UALIAS_LIMIT (UALIAS_BASE + UALIAS_SIZE) | ||
133 | |||
134 | /* | ||
135 | * The bottom of ualias space is flipped depending on whether you're | ||
136 | * processor 0 or 1 within a node. | ||
137 | */ | ||
138 | #ifdef CONFIG_SGI_IP27 | ||
139 | #define UALIAS_FLIP_BASE UALIAS_BASE | ||
140 | #define UALIAS_FLIP_SIZE 0x20000 | ||
141 | #define UALIAS_FLIP_BIT 0x10000 | ||
142 | #define UALIAS_FLIP_ADDR(_x) (cputoslice(smp_processor_id()) ? \ | ||
143 | (_x) ^ UALIAS_FLIP_BIT : (_x)) | ||
144 | |||
145 | #define LBOOT_BASE (HSPEC_BASE + 0x10000000) | ||
146 | #define LBOOT_SIZE 0x10000000 | ||
147 | #define LBOOT_LIMIT (LBOOT_BASE + LBOOT_SIZE) | ||
148 | #define LBOOT_STRIDE 0 /* IP27 has only one CPU PROM */ | ||
149 | |||
150 | #endif | ||
151 | |||
152 | #define HUB_REGISTER_WIDGET 1 | ||
153 | #define IALIAS_BASE NODE_SWIN_BASE(0, HUB_REGISTER_WIDGET) | ||
154 | #define IALIAS_SIZE 0x800000 /* 8 Megabytes */ | ||
155 | #define IS_IALIAS(_a) (((_a) >= IALIAS_BASE) && \ | ||
156 | ((_a) < (IALIAS_BASE + IALIAS_SIZE))) | ||
157 | |||
158 | /* | ||
159 | * Macro for referring to Hub's RBOOT space | ||
160 | */ | ||
161 | |||
162 | #ifdef CONFIG_SGI_IP27 | ||
163 | #define RBOOT_SIZE 0x10000000 /* 256 Megabytes */ | ||
164 | #define NODE_RBOOT_BASE(_n) (NODE_HSPEC_BASE(_n) + 0x30000000) | ||
165 | #define NODE_RBOOT_LIMIT(_n) (NODE_RBOOT_BASE(_n) + RBOOT_SIZE) | ||
166 | |||
167 | #endif | ||
168 | |||
169 | /* | ||
170 | * Macros for referring the Hub's back door space | ||
171 | * | ||
172 | * These macros correctly process addresses in any node's space. | ||
173 | * WARNING: They won't work in assembler. | ||
174 | * | ||
175 | * BDDIR_ENTRY_LO returns the address of the low double-word of the dir | ||
176 | * entry corresponding to a physical (Cac or Uncac) address. | ||
177 | * BDDIR_ENTRY_HI returns the address of the high double-word of the entry. | ||
178 | * BDPRT_ENTRY returns the address of the double-word protection entry | ||
179 | * corresponding to the page containing the physical address. | ||
180 | * BDPRT_ENTRY_S Stores the value into the protection entry. | ||
181 | * BDPRT_ENTRY_L Load the value from the protection entry. | ||
182 | * BDECC_ENTRY returns the address of the ECC byte corresponding to a | ||
183 | * double-word at a specified physical address. | ||
184 | * BDECC_ENTRY_H returns the address of the two ECC bytes corresponding to a | ||
185 | * quad-word at a specified physical address. | ||
186 | */ | ||
187 | #define NODE_BDOOR_BASE(_n) (NODE_HSPEC_BASE(_n) + (NODE_ADDRSPACE_SIZE/2)) | ||
188 | |||
189 | #define NODE_BDECC_BASE(_n) (NODE_BDOOR_BASE(_n)) | ||
190 | #define NODE_BDDIR_BASE(_n) (NODE_BDOOR_BASE(_n) + (NODE_ADDRSPACE_SIZE/4)) | ||
191 | #ifdef CONFIG_SGI_IP27 | ||
192 | #define BDDIR_ENTRY_LO(_pa) ((HSPEC_BASE + \ | ||
193 | NODE_ADDRSPACE_SIZE * 3 / 4 + \ | ||
194 | 0x200) | \ | ||
195 | UINT64_CAST(_pa) & NASID_MASK | \ | ||
196 | UINT64_CAST(_pa) >> 2 & BDDIR_UPPER_MASK | \ | ||
197 | UINT64_CAST(_pa) >> 3 & 0x1f << 4) | ||
198 | |||
199 | #define BDDIR_ENTRY_HI(_pa) ((HSPEC_BASE + \ | ||
200 | NODE_ADDRSPACE_SIZE * 3 / 4 + \ | ||
201 | 0x208) | \ | ||
202 | UINT64_CAST(_pa) & NASID_MASK | \ | ||
203 | UINT64_CAST(_pa) >> 2 & BDDIR_UPPER_MASK | \ | ||
204 | UINT64_CAST(_pa) >> 3 & 0x1f << 4) | ||
205 | |||
206 | #define BDPRT_ENTRY(_pa, _rgn) ((HSPEC_BASE + \ | ||
207 | NODE_ADDRSPACE_SIZE * 3 / 4) | \ | ||
208 | UINT64_CAST(_pa) & NASID_MASK | \ | ||
209 | UINT64_CAST(_pa) >> 2 & BDDIR_UPPER_MASK | \ | ||
210 | (_rgn) << 3) | ||
211 | #define BDPRT_ENTRY_ADDR(_pa, _rgn) (BDPRT_ENTRY((_pa), (_rgn))) | ||
212 | #define BDPRT_ENTRY_S(_pa, _rgn, _val) (*(__psunsigned_t *)BDPRT_ENTRY((_pa), (_rgn))=(_val)) | ||
213 | #define BDPRT_ENTRY_L(_pa, _rgn) (*(__psunsigned_t *)BDPRT_ENTRY((_pa), (_rgn))) | ||
214 | |||
215 | #define BDECC_ENTRY(_pa) ((HSPEC_BASE + \ | ||
216 | NODE_ADDRSPACE_SIZE / 2) | \ | ||
217 | UINT64_CAST(_pa) & NASID_MASK | \ | ||
218 | UINT64_CAST(_pa) >> 2 & BDECC_UPPER_MASK | \ | ||
219 | UINT64_CAST(_pa) >> 3 & 3) | ||
220 | |||
221 | /* | ||
222 | * Macro to convert a back door directory or protection address into the | ||
223 | * raw physical address of the associated cache line or protection page. | ||
224 | */ | ||
225 | #define BDADDR_IS_DIR(_ba) ((UINT64_CAST (_ba) & 0x200) != 0) | ||
226 | #define BDADDR_IS_PRT(_ba) ((UINT64_CAST (_ba) & 0x200) == 0) | ||
227 | |||
228 | #define BDDIR_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ | ||
229 | (UINT64_CAST(_ba) & BDDIR_UPPER_MASK)<<2 | \ | ||
230 | (UINT64_CAST(_ba) & 0x1f << 4) << 3) | ||
231 | |||
232 | #define BDPRT_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ | ||
233 | (UINT64_CAST(_ba) & BDDIR_UPPER_MASK)<<2) | ||
234 | |||
235 | #define BDECC_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ | ||
236 | (UINT64_CAST(_ba) & BDECC_UPPER_MASK)<<2 | \ | ||
237 | (UINT64_CAST(_ba) & 3) << 3) | ||
238 | #endif /* CONFIG_SGI_IP27 */ | ||
239 | |||
240 | |||
241 | /* | ||
242 | * The following macros produce the correct base virtual address for | ||
243 | * the hub registers. The LOCAL_HUB_* macros produce the appropriate | ||
244 | * address for the local registers. The REMOTE_HUB_* macro produce | ||
245 | * the address for the specified hub's registers. The intent is | ||
246 | * that the appropriate PI, MD, NI, or II register would be substituted | ||
247 | * for _x. | ||
248 | */ | ||
249 | |||
250 | /* | ||
251 | * WARNING: | ||
252 | * When certain Hub chip workaround are defined, it's not sufficient | ||
253 | * to dereference the *_HUB_ADDR() macros. You should instead use | ||
254 | * HUB_L() and HUB_S() if you must deal with pointers to hub registers. | ||
255 | * Otherwise, the recommended approach is to use *_HUB_L() and *_HUB_S(). | ||
256 | * They're always safe. | ||
257 | */ | ||
258 | #define LOCAL_HUB_ADDR(_x) (HUBREG_CAST (IALIAS_BASE + (_x))) | ||
259 | #define REMOTE_HUB_ADDR(_n, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \ | ||
260 | 0x800000 + (_x))) | ||
261 | #ifdef CONFIG_SGI_IP27 | ||
262 | #define REMOTE_HUB_PI_ADDR(_n, _sn, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \ | ||
263 | 0x800000 + (_x))) | ||
264 | #endif /* CONFIG_SGI_IP27 */ | ||
265 | |||
266 | #ifndef __ASSEMBLY__ | ||
267 | |||
268 | #define HUB_L(_a) *(_a) | ||
269 | #define HUB_S(_a, _d) *(_a) = (_d) | ||
270 | |||
271 | #define LOCAL_HUB_L(_r) HUB_L(LOCAL_HUB_ADDR(_r)) | ||
272 | #define LOCAL_HUB_S(_r, _d) HUB_S(LOCAL_HUB_ADDR(_r), (_d)) | ||
273 | #define REMOTE_HUB_L(_n, _r) HUB_L(REMOTE_HUB_ADDR((_n), (_r))) | ||
274 | #define REMOTE_HUB_S(_n, _r, _d) HUB_S(REMOTE_HUB_ADDR((_n), (_r)), (_d)) | ||
275 | #define REMOTE_HUB_PI_L(_n, _sn, _r) HUB_L(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r))) | ||
276 | #define REMOTE_HUB_PI_S(_n, _sn, _r, _d) HUB_S(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)), (_d)) | ||
277 | |||
278 | #endif /* !__ASSEMBLY__ */ | ||
279 | |||
280 | /* | ||
281 | * The following macros are used to get to a hub/bridge register, given | ||
282 | * the base of the register space. | ||
283 | */ | ||
284 | #define HUB_REG_PTR(_base, _off) \ | ||
285 | (HUBREG_CAST((__psunsigned_t)(_base) + (__psunsigned_t)(_off))) | ||
286 | |||
287 | #define HUB_REG_PTR_L(_base, _off) \ | ||
288 | HUB_L(HUB_REG_PTR((_base), (_off))) | ||
289 | |||
290 | #define HUB_REG_PTR_S(_base, _off, _data) \ | ||
291 | HUB_S(HUB_REG_PTR((_base), (_off)), (_data)) | ||
292 | |||
293 | /* | ||
294 | * Software structure locations -- permanently fixed | ||
295 | * See diagram in kldir.h | ||
296 | */ | ||
297 | |||
298 | #define PHYS_RAMBASE 0x0 | ||
299 | #define K0_RAMBASE PHYS_TO_K0(PHYS_RAMBASE) | ||
300 | |||
301 | #define EX_HANDLER_OFFSET(slice) ((slice) << 16) | ||
302 | #define EX_HANDLER_ADDR(nasid, slice) \ | ||
303 | PHYS_TO_K0(NODE_OFFSET(nasid) | EX_HANDLER_OFFSET(slice)) | ||
304 | #define EX_HANDLER_SIZE 0x0400 | ||
305 | |||
306 | #define EX_FRAME_OFFSET(slice) ((slice) << 16 | 0x400) | ||
307 | #define EX_FRAME_ADDR(nasid, slice) \ | ||
308 | PHYS_TO_K0(NODE_OFFSET(nasid) | EX_FRAME_OFFSET(slice)) | ||
309 | #define EX_FRAME_SIZE 0x0c00 | ||
310 | |||
311 | #define ARCS_SPB_OFFSET 0x1000 | ||
312 | #define ARCS_SPB_ADDR(nasid) \ | ||
313 | PHYS_TO_K0(NODE_OFFSET(nasid) | ARCS_SPB_OFFSET) | ||
314 | #define ARCS_SPB_SIZE 0x0400 | ||
315 | |||
316 | #define KLDIR_OFFSET 0x2000 | ||
317 | #define KLDIR_ADDR(nasid) \ | ||
318 | TO_NODE_UNCAC((nasid), KLDIR_OFFSET) | ||
319 | #define KLDIR_SIZE 0x0400 | ||
320 | |||
321 | |||
322 | /* | ||
323 | * Software structure locations -- indirected through KLDIR | ||
324 | * See diagram in kldir.h | ||
325 | * | ||
326 | * Important: All low memory structures must only be accessed | ||
327 | * uncached, except for the symmon stacks. | ||
328 | */ | ||
329 | |||
330 | #define KLI_LAUNCH 0 /* Dir. entries */ | ||
331 | #define KLI_KLCONFIG 1 | ||
332 | #define KLI_NMI 2 | ||
333 | #define KLI_GDA 3 | ||
334 | #define KLI_FREEMEM 4 | ||
335 | #define KLI_SYMMON_STK 5 | ||
336 | #define KLI_PI_ERROR 6 | ||
337 | #define KLI_KERN_VARS 7 | ||
338 | #define KLI_KERN_XP 8 | ||
339 | #define KLI_KERN_PARTID 9 | ||
340 | |||
341 | #ifndef __ASSEMBLY__ | ||
342 | |||
343 | #define KLD_BASE(nasid) ((kldir_ent_t *) KLDIR_ADDR(nasid)) | ||
344 | #define KLD_LAUNCH(nasid) (KLD_BASE(nasid) + KLI_LAUNCH) | ||
345 | #define KLD_NMI(nasid) (KLD_BASE(nasid) + KLI_NMI) | ||
346 | #define KLD_KLCONFIG(nasid) (KLD_BASE(nasid) + KLI_KLCONFIG) | ||
347 | #define KLD_PI_ERROR(nasid) (KLD_BASE(nasid) + KLI_PI_ERROR) | ||
348 | #define KLD_GDA(nasid) (KLD_BASE(nasid) + KLI_GDA) | ||
349 | #define KLD_SYMMON_STK(nasid) (KLD_BASE(nasid) + KLI_SYMMON_STK) | ||
350 | #define KLD_FREEMEM(nasid) (KLD_BASE(nasid) + KLI_FREEMEM) | ||
351 | #define KLD_KERN_VARS(nasid) (KLD_BASE(nasid) + KLI_KERN_VARS) | ||
352 | #define KLD_KERN_XP(nasid) (KLD_BASE(nasid) + KLI_KERN_XP) | ||
353 | #define KLD_KERN_PARTID(nasid) (KLD_BASE(nasid) + KLI_KERN_PARTID) | ||
354 | |||
355 | #define LAUNCH_OFFSET(nasid, slice) \ | ||
356 | (KLD_LAUNCH(nasid)->offset + \ | ||
357 | KLD_LAUNCH(nasid)->stride * (slice)) | ||
358 | #define LAUNCH_ADDR(nasid, slice) \ | ||
359 | TO_NODE_UNCAC((nasid), LAUNCH_OFFSET(nasid, slice)) | ||
360 | #define LAUNCH_SIZE(nasid) KLD_LAUNCH(nasid)->size | ||
361 | |||
362 | #define NMI_OFFSET(nasid, slice) \ | ||
363 | (KLD_NMI(nasid)->offset + \ | ||
364 | KLD_NMI(nasid)->stride * (slice)) | ||
365 | #define NMI_ADDR(nasid, slice) \ | ||
366 | TO_NODE_UNCAC((nasid), NMI_OFFSET(nasid, slice)) | ||
367 | #define NMI_SIZE(nasid) KLD_NMI(nasid)->size | ||
368 | |||
369 | #define KLCONFIG_OFFSET(nasid) KLD_KLCONFIG(nasid)->offset | ||
370 | #define KLCONFIG_ADDR(nasid) \ | ||
371 | TO_NODE_UNCAC((nasid), KLCONFIG_OFFSET(nasid)) | ||
372 | #define KLCONFIG_SIZE(nasid) KLD_KLCONFIG(nasid)->size | ||
373 | |||
374 | #define GDA_ADDR(nasid) KLD_GDA(nasid)->pointer | ||
375 | #define GDA_SIZE(nasid) KLD_GDA(nasid)->size | ||
376 | |||
377 | #define SYMMON_STK_OFFSET(nasid, slice) \ | ||
378 | (KLD_SYMMON_STK(nasid)->offset + \ | ||
379 | KLD_SYMMON_STK(nasid)->stride * (slice)) | ||
380 | #define SYMMON_STK_STRIDE(nasid) KLD_SYMMON_STK(nasid)->stride | ||
381 | |||
382 | #define SYMMON_STK_ADDR(nasid, slice) \ | ||
383 | TO_NODE_CAC((nasid), SYMMON_STK_OFFSET(nasid, slice)) | ||
384 | |||
385 | #define SYMMON_STK_SIZE(nasid) KLD_SYMMON_STK(nasid)->stride | ||
386 | |||
387 | #define SYMMON_STK_END(nasid) (SYMMON_STK_ADDR(nasid, 0) + KLD_SYMMON_STK(nasid)->size) | ||
388 | |||
389 | /* loading symmon 4k below UNIX. the arcs loader needs the topaddr for a | ||
390 | * relocatable program | ||
391 | */ | ||
392 | #define UNIX_DEBUG_LOADADDR 0x300000 | ||
393 | #define SYMMON_LOADADDR(nasid) \ | ||
394 | TO_NODE(nasid, PHYS_TO_K0(UNIX_DEBUG_LOADADDR - 0x1000)) | ||
395 | |||
396 | #define FREEMEM_OFFSET(nasid) KLD_FREEMEM(nasid)->offset | ||
397 | #define FREEMEM_ADDR(nasid) SYMMON_STK_END(nasid) | ||
398 | /* | ||
399 | * XXX | ||
400 | * Fix this. FREEMEM_ADDR should be aware of if symmon is loaded. | ||
401 | * Also, it should take into account what prom thinks to be a safe | ||
402 | * address | ||
403 | PHYS_TO_K0(NODE_OFFSET(nasid) + FREEMEM_OFFSET(nasid)) | ||
404 | */ | ||
405 | #define FREEMEM_SIZE(nasid) KLD_FREEMEM(nasid)->size | ||
406 | |||
407 | #define PI_ERROR_OFFSET(nasid) KLD_PI_ERROR(nasid)->offset | ||
408 | #define PI_ERROR_ADDR(nasid) \ | ||
409 | TO_NODE_UNCAC((nasid), PI_ERROR_OFFSET(nasid)) | ||
410 | #define PI_ERROR_SIZE(nasid) KLD_PI_ERROR(nasid)->size | ||
411 | |||
412 | #define NODE_OFFSET_TO_K0(_nasid, _off) \ | ||
413 | PHYS_TO_K0((NODE_OFFSET(_nasid) + (_off)) | CAC_BASE) | ||
414 | #define NODE_OFFSET_TO_K1(_nasid, _off) \ | ||
415 | TO_UNCAC((NODE_OFFSET(_nasid) + (_off)) | UNCAC_BASE) | ||
416 | #define K0_TO_NODE_OFFSET(_k0addr) \ | ||
417 | ((__psunsigned_t)(_k0addr) & NODE_ADDRSPACE_MASK) | ||
418 | |||
419 | #define KERN_VARS_ADDR(nasid) KLD_KERN_VARS(nasid)->pointer | ||
420 | #define KERN_VARS_SIZE(nasid) KLD_KERN_VARS(nasid)->size | ||
421 | |||
422 | #define KERN_XP_ADDR(nasid) KLD_KERN_XP(nasid)->pointer | ||
423 | #define KERN_XP_SIZE(nasid) KLD_KERN_XP(nasid)->size | ||
424 | |||
425 | #define GPDA_ADDR(nasid) TO_NODE_CAC(nasid, GPDA_OFFSET) | ||
426 | |||
427 | #endif /* !__ASSEMBLY__ */ | ||
428 | |||
429 | |||
430 | #endif /* _ASM_SN_ADDRS_H */ | ||
diff --git a/include/asm-mips/sn/agent.h b/include/asm-mips/sn/agent.h deleted file mode 100644 index ac4ea85c3a5c..000000000000 --- a/include/asm-mips/sn/agent.h +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * This file has definitions for the hub and snac interfaces. | ||
7 | * | ||
8 | * Copyright (C) 1992 - 1997, 1999, 2000 Silcon Graphics, Inc. | ||
9 | * Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org) | ||
10 | */ | ||
11 | #ifndef _ASM_SGI_SN_AGENT_H | ||
12 | #define _ASM_SGI_SN_AGENT_H | ||
13 | |||
14 | #include <linux/topology.h> | ||
15 | #include <asm/sn/addrs.h> | ||
16 | #include <asm/sn/arch.h> | ||
17 | |||
18 | #if defined(CONFIG_SGI_IP27) | ||
19 | #include <asm/sn/sn0/hub.h> | ||
20 | #elif defined(CONFIG_SGI_IP35) | ||
21 | #include <asm/sn/sn1/hub.h> | ||
22 | #endif /* !CONFIG_SGI_IP27 && !CONFIG_SGI_IP35 */ | ||
23 | |||
24 | /* | ||
25 | * NIC register macros | ||
26 | */ | ||
27 | |||
28 | #if defined(CONFIG_SGI_IP27) | ||
29 | #define HUB_NIC_ADDR(_cpuid) \ | ||
30 | REMOTE_HUB_ADDR(COMPACT_TO_NASID_NODEID(cpu_to_node(_cpuid)), \ | ||
31 | MD_MLAN_CTL) | ||
32 | #endif | ||
33 | |||
34 | #define SET_HUB_NIC(_my_cpuid, _val) \ | ||
35 | (HUB_S(HUB_NIC_ADDR(_my_cpuid), (_val))) | ||
36 | |||
37 | #define SET_MY_HUB_NIC(_v) \ | ||
38 | SET_HUB_NIC(cpuid(), (_v)) | ||
39 | |||
40 | #define GET_HUB_NIC(_my_cpuid) \ | ||
41 | (HUB_L(HUB_NIC_ADDR(_my_cpuid))) | ||
42 | |||
43 | #define GET_MY_HUB_NIC() \ | ||
44 | GET_HUB_NIC(cpuid()) | ||
45 | |||
46 | #endif /* _ASM_SGI_SN_AGENT_H */ | ||
diff --git a/include/asm-mips/sn/arch.h b/include/asm-mips/sn/arch.h deleted file mode 100644 index bd75945e10ff..000000000000 --- a/include/asm-mips/sn/arch.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * SGI specific setup. | ||
7 | * | ||
8 | * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc. | ||
9 | * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) | ||
10 | */ | ||
11 | #ifndef _ASM_SN_ARCH_H | ||
12 | #define _ASM_SN_ARCH_H | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <asm/sn/types.h> | ||
16 | #ifdef CONFIG_SGI_IP27 | ||
17 | #include <asm/sn/sn0/arch.h> | ||
18 | #endif | ||
19 | |||
20 | typedef u64 hubreg_t; | ||
21 | |||
22 | #define cputonasid(cpu) (sn_cpu_info[(cpu)].p_nasid) | ||
23 | #define cputoslice(cpu) (sn_cpu_info[(cpu)].p_slice) | ||
24 | #define makespnum(_nasid, _slice) \ | ||
25 | (((_nasid) << CPUS_PER_NODE_SHFT) | (_slice)) | ||
26 | |||
27 | #define INVALID_NASID (nasid_t)-1 | ||
28 | #define INVALID_CNODEID (cnodeid_t)-1 | ||
29 | #define INVALID_PNODEID (pnodeid_t)-1 | ||
30 | #define INVALID_MODULE (moduleid_t)-1 | ||
31 | #define INVALID_PARTID (partid_t)-1 | ||
32 | |||
33 | extern nasid_t get_nasid(void); | ||
34 | extern cnodeid_t get_cpu_cnode(cpuid_t); | ||
35 | extern int get_cpu_slice(cpuid_t); | ||
36 | |||
37 | /* | ||
38 | * NO ONE should access these arrays directly. The only reason we refer to | ||
39 | * them here is to avoid the procedure call that would be required in the | ||
40 | * macros below. (Really want private data members here :-) | ||
41 | */ | ||
42 | extern cnodeid_t nasid_to_compact_node[MAX_NASIDS]; | ||
43 | extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES]; | ||
44 | |||
45 | /* | ||
46 | * These macros are used by various parts of the kernel to convert | ||
47 | * between the three different kinds of node numbering. At least some | ||
48 | * of them may change to procedure calls in the future, but the macros | ||
49 | * will continue to work. Don't use the arrays above directly. | ||
50 | */ | ||
51 | |||
52 | #define NASID_TO_REGION(nnode) \ | ||
53 | ((nnode) >> \ | ||
54 | (is_fine_dirmode() ? NASID_TO_FINEREG_SHFT : NASID_TO_COARSEREG_SHFT)) | ||
55 | |||
56 | extern cnodeid_t nasid_to_compact_node[MAX_NASIDS]; | ||
57 | extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES]; | ||
58 | extern cnodeid_t cpuid_to_compact_node[MAXCPUS]; | ||
59 | |||
60 | #define NASID_TO_COMPACT_NODEID(nnode) (nasid_to_compact_node[nnode]) | ||
61 | #define COMPACT_TO_NASID_NODEID(cnode) (compact_to_nasid_node[cnode]) | ||
62 | #define CPUID_TO_COMPACT_NODEID(cpu) (cpuid_to_compact_node[(cpu)]) | ||
63 | |||
64 | #endif /* _ASM_SN_ARCH_H */ | ||
diff --git a/include/asm-mips/sn/fru.h b/include/asm-mips/sn/fru.h deleted file mode 100644 index b3e3606723b7..000000000000 --- a/include/asm-mips/sn/fru.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Derived from IRIX <sys/SN/SN0/sn0_fru.h> | ||
7 | * | ||
8 | * Copyright (C) 1992 - 1997, 1999 Silcon Graphics, Inc. | ||
9 | * Copyright (C) 1999, 2006 Ralf Baechle (ralf@linux-mips) | ||
10 | */ | ||
11 | #ifndef __ASM_SN_FRU_H | ||
12 | #define __ASM_SN_FRU_H | ||
13 | |||
14 | #define MAX_DIMMS 8 /* max # of dimm banks */ | ||
15 | #define MAX_PCIDEV 8 /* max # of pci devices on a pci bus */ | ||
16 | |||
17 | typedef unsigned char confidence_t; | ||
18 | |||
19 | typedef struct kf_mem_s { | ||
20 | confidence_t km_confidence; /* confidence level that the memory is bad | ||
21 | * is this necessary ? | ||
22 | */ | ||
23 | confidence_t km_dimm[MAX_DIMMS]; | ||
24 | /* confidence level that dimm[i] is bad | ||
25 | *I think this is the right number | ||
26 | */ | ||
27 | |||
28 | } kf_mem_t; | ||
29 | |||
30 | typedef struct kf_cpu_s { | ||
31 | confidence_t kc_confidence; /* confidence level that cpu is bad */ | ||
32 | confidence_t kc_icache; /* confidence level that instr. cache is bad */ | ||
33 | confidence_t kc_dcache; /* confidence level that data cache is bad */ | ||
34 | confidence_t kc_scache; /* confidence level that sec. cache is bad */ | ||
35 | confidence_t kc_sysbus; /* confidence level that sysad/cmd/state bus is bad */ | ||
36 | } kf_cpu_t; | ||
37 | |||
38 | typedef struct kf_pci_bus_s { | ||
39 | confidence_t kpb_belief; /* confidence level that the pci bus is bad */ | ||
40 | confidence_t kpb_pcidev_belief[MAX_PCIDEV]; | ||
41 | /* confidence level that the pci dev is bad */ | ||
42 | } kf_pci_bus_t; | ||
43 | |||
44 | #endif /* __ASM_SN_FRU_H */ | ||
diff --git a/include/asm-mips/sn/gda.h b/include/asm-mips/sn/gda.h deleted file mode 100644 index 9cb6ff770915..000000000000 --- a/include/asm-mips/sn/gda.h +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Derived from IRIX <sys/SN/gda.h>. | ||
7 | * | ||
8 | * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. | ||
9 | * | ||
10 | * gda.h -- Contains the data structure for the global data area, | ||
11 | * The GDA contains information communicated between the | ||
12 | * PROM, SYMMON, and the kernel. | ||
13 | */ | ||
14 | #ifndef _ASM_SN_GDA_H | ||
15 | #define _ASM_SN_GDA_H | ||
16 | |||
17 | #include <asm/sn/addrs.h> | ||
18 | |||
19 | #define GDA_MAGIC 0x58464552 | ||
20 | |||
21 | /* | ||
22 | * GDA Version History | ||
23 | * | ||
24 | * Version # | Change | ||
25 | * -------------+------------------------------------------------------- | ||
26 | * 1 | Initial SN0 version | ||
27 | * 2 | Prom sets g_partid field to the partition number. 0 IS | ||
28 | * | a valid partition #. | ||
29 | */ | ||
30 | |||
31 | #define GDA_VERSION 2 /* Current GDA version # */ | ||
32 | |||
33 | #define G_MAGICOFF 0 | ||
34 | #define G_VERSIONOFF 4 | ||
35 | #define G_PROMOPOFF 6 | ||
36 | #define G_MASTEROFF 8 | ||
37 | #define G_VDSOFF 12 | ||
38 | #define G_HKDNORMOFF 16 | ||
39 | #define G_HKDUTLBOFF 24 | ||
40 | #define G_HKDXUTLBOFF 32 | ||
41 | #define G_PARTIDOFF 40 | ||
42 | #define G_TABLEOFF 128 | ||
43 | |||
44 | #ifndef __ASSEMBLY__ | ||
45 | |||
46 | typedef struct gda { | ||
47 | u32 g_magic; /* GDA magic number */ | ||
48 | u16 g_version; /* Version of this structure */ | ||
49 | u16 g_masterid; /* The NASID:CPUNUM of the master cpu */ | ||
50 | u32 g_promop; /* Passes requests from the kernel to prom */ | ||
51 | u32 g_vds; /* Store the virtual dipswitches here */ | ||
52 | void **g_hooked_norm;/* ptr to pda loc for norm hndlr */ | ||
53 | void **g_hooked_utlb;/* ptr to pda loc for utlb hndlr */ | ||
54 | void **g_hooked_xtlb;/* ptr to pda loc for xtlb hndlr */ | ||
55 | int g_partid; /* partition id */ | ||
56 | int g_symmax; /* Max symbols in name table. */ | ||
57 | void *g_dbstab; /* Address of idbg symbol table */ | ||
58 | char *g_nametab; /* Address of idbg name table */ | ||
59 | void *g_ktext_repmask; | ||
60 | /* Pointer to a mask of nodes with copies | ||
61 | * of the kernel. */ | ||
62 | char g_padding[56]; /* pad out to 128 bytes */ | ||
63 | nasid_t g_nasidtable[MAX_COMPACT_NODES]; /* NASID of each node, | ||
64 | * indexed by cnodeid. | ||
65 | */ | ||
66 | } gda_t; | ||
67 | |||
68 | #define GDA ((gda_t*) GDA_ADDR(get_nasid())) | ||
69 | |||
70 | #endif /* !__ASSEMBLY__ */ | ||
71 | /* | ||
72 | * Define: PART_GDA_VERSION | ||
73 | * Purpose: Define the minimum version of the GDA required, lower | ||
74 | * revisions assume GDA is NOT set up, and read partition | ||
75 | * information from the board info. | ||
76 | */ | ||
77 | #define PART_GDA_VERSION 2 | ||
78 | |||
79 | /* | ||
80 | * The following requests can be sent to the PROM during startup. | ||
81 | */ | ||
82 | |||
83 | #define PROMOP_MAGIC 0x0ead0000 | ||
84 | #define PROMOP_MAGIC_MASK 0x0fff0000 | ||
85 | |||
86 | #define PROMOP_BIST_SHIFT 11 | ||
87 | #define PROMOP_BIST_MASK (0x3 << 11) | ||
88 | |||
89 | #define PROMOP_REG PI_ERR_STACK_ADDR_A | ||
90 | |||
91 | #define PROMOP_INVALID (PROMOP_MAGIC | 0x00) | ||
92 | #define PROMOP_HALT (PROMOP_MAGIC | 0x10) | ||
93 | #define PROMOP_POWERDOWN (PROMOP_MAGIC | 0x20) | ||
94 | #define PROMOP_RESTART (PROMOP_MAGIC | 0x30) | ||
95 | #define PROMOP_REBOOT (PROMOP_MAGIC | 0x40) | ||
96 | #define PROMOP_IMODE (PROMOP_MAGIC | 0x50) | ||
97 | |||
98 | #define PROMOP_CMD_MASK 0x00f0 | ||
99 | #define PROMOP_OPTIONS_MASK 0xfff0 | ||
100 | |||
101 | #define PROMOP_SKIP_DIAGS 0x0100 /* don't bother running diags */ | ||
102 | #define PROMOP_SKIP_MEMINIT 0x0200 /* don't bother initing memory */ | ||
103 | #define PROMOP_SKIP_DEVINIT 0x0400 /* don't bother initing devices */ | ||
104 | #define PROMOP_BIST1 0x0800 /* keep track of which BIST ran */ | ||
105 | #define PROMOP_BIST2 0x1000 /* keep track of which BIST ran */ | ||
106 | |||
107 | #endif /* _ASM_SN_GDA_H */ | ||
diff --git a/include/asm-mips/sn/hub.h b/include/asm-mips/sn/hub.h deleted file mode 100644 index 1992d9254a08..000000000000 --- a/include/asm-mips/sn/hub.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef __ASM_SN_HUB_H | ||
2 | #define __ASM_SN_HUB_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/cpumask.h> | ||
6 | #include <asm/sn/types.h> | ||
7 | #include <asm/sn/io.h> | ||
8 | #include <asm/sn/klkernvars.h> | ||
9 | #include <asm/xtalk/xtalk.h> | ||
10 | |||
11 | /* ip27-hubio.c */ | ||
12 | extern unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget, | ||
13 | unsigned long xtalk_addr, size_t size); | ||
14 | extern void hub_pio_init(cnodeid_t cnode); | ||
15 | |||
16 | #endif /* __ASM_SN_HUB_H */ | ||
diff --git a/include/asm-mips/sn/intr.h b/include/asm-mips/sn/intr.h deleted file mode 100644 index 6718b644b970..000000000000 --- a/include/asm-mips/sn/intr.h +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1992 - 1997 Silicon Graphics, Inc. | ||
7 | */ | ||
8 | #ifndef __ASM_SN_INTR_H | ||
9 | #define __ASM_SN_INTR_H | ||
10 | |||
11 | /* Number of interrupt levels associated with each interrupt register. */ | ||
12 | #define N_INTPEND_BITS 64 | ||
13 | |||
14 | #define INT_PEND0_BASELVL 0 | ||
15 | #define INT_PEND1_BASELVL 64 | ||
16 | |||
17 | #define N_INTPENDJUNK_BITS 8 | ||
18 | #define INTPENDJUNK_CLRBIT 0x80 | ||
19 | |||
20 | /* | ||
21 | * Macros to manipulate the interrupt register on the calling hub chip. | ||
22 | */ | ||
23 | |||
24 | #define LOCAL_HUB_SEND_INTR(level) \ | ||
25 | LOCAL_HUB_S(PI_INT_PEND_MOD, (0x100 | (level))) | ||
26 | #define REMOTE_HUB_SEND_INTR(hub, level) \ | ||
27 | REMOTE_HUB_S((hub), PI_INT_PEND_MOD, (0x100 | (level))) | ||
28 | |||
29 | /* | ||
30 | * When clearing the interrupt, make sure this clear does make it | ||
31 | * to the hub. Otherwise we could end up losing interrupts. | ||
32 | * We do an uncached load of the int_pend0 register to ensure this. | ||
33 | */ | ||
34 | |||
35 | #define LOCAL_HUB_CLR_INTR(level) \ | ||
36 | do { \ | ||
37 | LOCAL_HUB_S(PI_INT_PEND_MOD, (level)); \ | ||
38 | LOCAL_HUB_L(PI_INT_PEND0); \ | ||
39 | } while (0); | ||
40 | |||
41 | #define REMOTE_HUB_CLR_INTR(hub, level) \ | ||
42 | do { \ | ||
43 | nasid_t __hub = (hub); \ | ||
44 | \ | ||
45 | REMOTE_HUB_S(__hub, PI_INT_PEND_MOD, (level)); \ | ||
46 | REMOTE_HUB_L(__hub, PI_INT_PEND0); \ | ||
47 | } while (0); | ||
48 | |||
49 | /* | ||
50 | * Hard-coded interrupt levels: | ||
51 | */ | ||
52 | |||
53 | /* | ||
54 | * L0 = SW1 | ||
55 | * L1 = SW2 | ||
56 | * L2 = INT_PEND0 | ||
57 | * L3 = INT_PEND1 | ||
58 | * L4 = RTC | ||
59 | * L5 = Profiling Timer | ||
60 | * L6 = Hub Errors | ||
61 | * L7 = Count/Compare (T5 counters) | ||
62 | */ | ||
63 | |||
64 | |||
65 | /* | ||
66 | * INT_PEND0 hard-coded bits. | ||
67 | */ | ||
68 | |||
69 | /* | ||
70 | * INT_PEND0 bits determined by hardware: | ||
71 | */ | ||
72 | #define RESERVED_INTR 0 /* What is this bit? */ | ||
73 | #define GFX_INTR_A 1 | ||
74 | #define GFX_INTR_B 2 | ||
75 | #define PG_MIG_INTR 3 | ||
76 | #define UART_INTR 4 | ||
77 | #define CC_PEND_A 5 | ||
78 | #define CC_PEND_B 6 | ||
79 | |||
80 | /* | ||
81 | * INT_PEND0 used by the kernel for itself ... | ||
82 | */ | ||
83 | #define CPU_RESCHED_A_IRQ 7 | ||
84 | #define CPU_RESCHED_B_IRQ 8 | ||
85 | #define CPU_CALL_A_IRQ 9 | ||
86 | #define CPU_CALL_B_IRQ 10 | ||
87 | #define MSC_MESG_INTR 11 | ||
88 | #define BASE_PCI_IRQ 12 | ||
89 | |||
90 | /* | ||
91 | * INT_PEND0 again, bits determined by hardware / hardcoded: | ||
92 | */ | ||
93 | #define SDISK_INTR 63 /* SABLE name */ | ||
94 | #define IP_PEND0_6_63 63 /* What is this bit? */ | ||
95 | |||
96 | /* | ||
97 | * INT_PEND1 hard-coded bits: | ||
98 | */ | ||
99 | #define NI_BRDCAST_ERR_A 39 | ||
100 | #define NI_BRDCAST_ERR_B 40 | ||
101 | |||
102 | #define LLP_PFAIL_INTR_A 41 /* see ml/SN/SN0/sysctlr.c */ | ||
103 | #define LLP_PFAIL_INTR_B 42 | ||
104 | |||
105 | #define TLB_INTR_A 43 /* used for tlb flush random */ | ||
106 | #define TLB_INTR_B 44 | ||
107 | |||
108 | #define IP27_INTR_0 45 /* Reserved for PROM use */ | ||
109 | #define IP27_INTR_1 46 /* do not use in Kernel */ | ||
110 | #define IP27_INTR_2 47 | ||
111 | #define IP27_INTR_3 48 | ||
112 | #define IP27_INTR_4 49 | ||
113 | #define IP27_INTR_5 50 | ||
114 | #define IP27_INTR_6 51 | ||
115 | #define IP27_INTR_7 52 | ||
116 | |||
117 | #define BRIDGE_ERROR_INTR 53 /* Setup by PROM to catch */ | ||
118 | /* Bridge Errors */ | ||
119 | #define DEBUG_INTR_A 54 | ||
120 | #define DEBUG_INTR_B 55 /* Used by symmon to stop all cpus */ | ||
121 | #define IO_ERROR_INTR 57 /* Setup by PROM */ | ||
122 | #define CLK_ERR_INTR 58 | ||
123 | #define COR_ERR_INTR_A 59 | ||
124 | #define COR_ERR_INTR_B 60 | ||
125 | #define MD_COR_ERR_INTR 61 | ||
126 | #define NI_ERROR_INTR 62 | ||
127 | #define MSC_PANIC_INTR 63 | ||
128 | |||
129 | #endif /* __ASM_SN_INTR_H */ | ||
diff --git a/include/asm-mips/sn/io.h b/include/asm-mips/sn/io.h deleted file mode 100644 index 24c6775fbb0f..000000000000 --- a/include/asm-mips/sn/io.h +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000, 2003 Ralf Baechle | ||
7 | * Copyright (C) 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_SN_IO_H | ||
10 | #define _ASM_SN_IO_H | ||
11 | |||
12 | #if defined(CONFIG_SGI_IP27) | ||
13 | #include <asm/sn/sn0/hubio.h> | ||
14 | #endif | ||
15 | |||
16 | |||
17 | #define IIO_ITTE_BASE 0x400160 /* base of translation table entries */ | ||
18 | #define IIO_ITTE(bigwin) (IIO_ITTE_BASE + 8*(bigwin)) | ||
19 | |||
20 | #define IIO_ITTE_OFFSET_BITS 5 /* size of offset field */ | ||
21 | #define IIO_ITTE_OFFSET_MASK ((1<<IIO_ITTE_OFFSET_BITS)-1) | ||
22 | #define IIO_ITTE_OFFSET_SHIFT 0 | ||
23 | |||
24 | #define IIO_ITTE_WIDGET_BITS 4 /* size of widget field */ | ||
25 | #define IIO_ITTE_WIDGET_MASK ((1<<IIO_ITTE_WIDGET_BITS)-1) | ||
26 | #define IIO_ITTE_WIDGET_SHIFT 8 | ||
27 | |||
28 | #define IIO_ITTE_IOSP 1 /* I/O Space bit */ | ||
29 | #define IIO_ITTE_IOSP_MASK 1 | ||
30 | #define IIO_ITTE_IOSP_SHIFT 12 | ||
31 | #define HUB_PIO_MAP_TO_MEM 0 | ||
32 | #define HUB_PIO_MAP_TO_IO 1 | ||
33 | |||
34 | #define IIO_ITTE_INVALID_WIDGET 3 /* an invalid widget */ | ||
35 | |||
36 | #define IIO_ITTE_PUT(nasid, bigwin, io_or_mem, widget, addr) \ | ||
37 | REMOTE_HUB_S((nasid), IIO_ITTE(bigwin), \ | ||
38 | (((((addr) >> BWIN_SIZE_BITS) & \ | ||
39 | IIO_ITTE_OFFSET_MASK) << IIO_ITTE_OFFSET_SHIFT) | \ | ||
40 | (io_or_mem << IIO_ITTE_IOSP_SHIFT) | \ | ||
41 | (((widget) & IIO_ITTE_WIDGET_MASK) << IIO_ITTE_WIDGET_SHIFT))) | ||
42 | |||
43 | #define IIO_ITTE_DISABLE(nasid, bigwin) \ | ||
44 | IIO_ITTE_PUT((nasid), HUB_PIO_MAP_TO_MEM, \ | ||
45 | (bigwin), IIO_ITTE_INVALID_WIDGET, 0) | ||
46 | |||
47 | #define IIO_ITTE_GET(nasid, bigwin) REMOTE_HUB_ADDR((nasid), IIO_ITTE(bigwin)) | ||
48 | |||
49 | /* | ||
50 | * Macro which takes the widget number, and returns the | ||
51 | * IO PRB address of that widget. | ||
52 | * value _x is expected to be a widget number in the range | ||
53 | * 0, 8 - 0xF | ||
54 | */ | ||
55 | #define IIO_IOPRB(_x) (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \ | ||
56 | (_x) : \ | ||
57 | (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) ) | ||
58 | |||
59 | #endif /* _ASM_SN_IO_H */ | ||
diff --git a/include/asm-mips/sn/ioc3.h b/include/asm-mips/sn/ioc3.h deleted file mode 100644 index 099677774d71..000000000000 --- a/include/asm-mips/sn/ioc3.h +++ /dev/null | |||
@@ -1,663 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999, 2000 Ralf Baechle | ||
3 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
4 | */ | ||
5 | #ifndef _IOC3_H | ||
6 | #define _IOC3_H | ||
7 | |||
8 | #include <linux/types.h> | ||
9 | |||
10 | /* SUPERIO uart register map */ | ||
11 | typedef volatile struct ioc3_uartregs { | ||
12 | union { | ||
13 | volatile u8 rbr; /* read only, DLAB == 0 */ | ||
14 | volatile u8 thr; /* write only, DLAB == 0 */ | ||
15 | volatile u8 dll; /* DLAB == 1 */ | ||
16 | } u1; | ||
17 | union { | ||
18 | volatile u8 ier; /* DLAB == 0 */ | ||
19 | volatile u8 dlm; /* DLAB == 1 */ | ||
20 | } u2; | ||
21 | union { | ||
22 | volatile u8 iir; /* read only */ | ||
23 | volatile u8 fcr; /* write only */ | ||
24 | } u3; | ||
25 | volatile u8 iu_lcr; | ||
26 | volatile u8 iu_mcr; | ||
27 | volatile u8 iu_lsr; | ||
28 | volatile u8 iu_msr; | ||
29 | volatile u8 iu_scr; | ||
30 | } ioc3_uregs_t; | ||
31 | |||
32 | #define iu_rbr u1.rbr | ||
33 | #define iu_thr u1.thr | ||
34 | #define iu_dll u1.dll | ||
35 | #define iu_ier u2.ier | ||
36 | #define iu_dlm u2.dlm | ||
37 | #define iu_iir u3.iir | ||
38 | #define iu_fcr u3.fcr | ||
39 | |||
40 | struct ioc3_sioregs { | ||
41 | volatile u8 fill[0x141]; /* starts at 0x141 */ | ||
42 | |||
43 | volatile u8 uartc; | ||
44 | volatile u8 kbdcg; | ||
45 | |||
46 | volatile u8 fill0[0x150 - 0x142 - 1]; | ||
47 | |||
48 | volatile u8 pp_data; | ||
49 | volatile u8 pp_dsr; | ||
50 | volatile u8 pp_dcr; | ||
51 | |||
52 | volatile u8 fill1[0x158 - 0x152 - 1]; | ||
53 | |||
54 | volatile u8 pp_fifa; | ||
55 | volatile u8 pp_cfgb; | ||
56 | volatile u8 pp_ecr; | ||
57 | |||
58 | volatile u8 fill2[0x168 - 0x15a - 1]; | ||
59 | |||
60 | volatile u8 rtcad; | ||
61 | volatile u8 rtcdat; | ||
62 | |||
63 | volatile u8 fill3[0x170 - 0x169 - 1]; | ||
64 | |||
65 | struct ioc3_uartregs uartb; /* 0x20170 */ | ||
66 | struct ioc3_uartregs uarta; /* 0x20178 */ | ||
67 | }; | ||
68 | |||
69 | /* Register layout of IOC3 in configuration space. */ | ||
70 | struct ioc3 { | ||
71 | volatile u32 pad0[7]; /* 0x00000 */ | ||
72 | volatile u32 sio_ir; /* 0x0001c */ | ||
73 | volatile u32 sio_ies; /* 0x00020 */ | ||
74 | volatile u32 sio_iec; /* 0x00024 */ | ||
75 | volatile u32 sio_cr; /* 0x00028 */ | ||
76 | volatile u32 int_out; /* 0x0002c */ | ||
77 | volatile u32 mcr; /* 0x00030 */ | ||
78 | |||
79 | /* General Purpose I/O registers */ | ||
80 | volatile u32 gpcr_s; /* 0x00034 */ | ||
81 | volatile u32 gpcr_c; /* 0x00038 */ | ||
82 | volatile u32 gpdr; /* 0x0003c */ | ||
83 | volatile u32 gppr_0; /* 0x00040 */ | ||
84 | volatile u32 gppr_1; /* 0x00044 */ | ||
85 | volatile u32 gppr_2; /* 0x00048 */ | ||
86 | volatile u32 gppr_3; /* 0x0004c */ | ||
87 | volatile u32 gppr_4; /* 0x00050 */ | ||
88 | volatile u32 gppr_5; /* 0x00054 */ | ||
89 | volatile u32 gppr_6; /* 0x00058 */ | ||
90 | volatile u32 gppr_7; /* 0x0005c */ | ||
91 | volatile u32 gppr_8; /* 0x00060 */ | ||
92 | volatile u32 gppr_9; /* 0x00064 */ | ||
93 | volatile u32 gppr_10; /* 0x00068 */ | ||
94 | volatile u32 gppr_11; /* 0x0006c */ | ||
95 | volatile u32 gppr_12; /* 0x00070 */ | ||
96 | volatile u32 gppr_13; /* 0x00074 */ | ||
97 | volatile u32 gppr_14; /* 0x00078 */ | ||
98 | volatile u32 gppr_15; /* 0x0007c */ | ||
99 | |||
100 | /* Parallel Port Registers */ | ||
101 | volatile u32 ppbr_h_a; /* 0x00080 */ | ||
102 | volatile u32 ppbr_l_a; /* 0x00084 */ | ||
103 | volatile u32 ppcr_a; /* 0x00088 */ | ||
104 | volatile u32 ppcr; /* 0x0008c */ | ||
105 | volatile u32 ppbr_h_b; /* 0x00090 */ | ||
106 | volatile u32 ppbr_l_b; /* 0x00094 */ | ||
107 | volatile u32 ppcr_b; /* 0x00098 */ | ||
108 | |||
109 | /* Keyboard and Mouse Registers */ | ||
110 | volatile u32 km_csr; /* 0x0009c */ | ||
111 | volatile u32 k_rd; /* 0x000a0 */ | ||
112 | volatile u32 m_rd; /* 0x000a4 */ | ||
113 | volatile u32 k_wd; /* 0x000a8 */ | ||
114 | volatile u32 m_wd; /* 0x000ac */ | ||
115 | |||
116 | /* Serial Port Registers */ | ||
117 | volatile u32 sbbr_h; /* 0x000b0 */ | ||
118 | volatile u32 sbbr_l; /* 0x000b4 */ | ||
119 | volatile u32 sscr_a; /* 0x000b8 */ | ||
120 | volatile u32 stpir_a; /* 0x000bc */ | ||
121 | volatile u32 stcir_a; /* 0x000c0 */ | ||
122 | volatile u32 srpir_a; /* 0x000c4 */ | ||
123 | volatile u32 srcir_a; /* 0x000c8 */ | ||
124 | volatile u32 srtr_a; /* 0x000cc */ | ||
125 | volatile u32 shadow_a; /* 0x000d0 */ | ||
126 | volatile u32 sscr_b; /* 0x000d4 */ | ||
127 | volatile u32 stpir_b; /* 0x000d8 */ | ||
128 | volatile u32 stcir_b; /* 0x000dc */ | ||
129 | volatile u32 srpir_b; /* 0x000e0 */ | ||
130 | volatile u32 srcir_b; /* 0x000e4 */ | ||
131 | volatile u32 srtr_b; /* 0x000e8 */ | ||
132 | volatile u32 shadow_b; /* 0x000ec */ | ||
133 | |||
134 | /* Ethernet Registers */ | ||
135 | volatile u32 emcr; /* 0x000f0 */ | ||
136 | volatile u32 eisr; /* 0x000f4 */ | ||
137 | volatile u32 eier; /* 0x000f8 */ | ||
138 | volatile u32 ercsr; /* 0x000fc */ | ||
139 | volatile u32 erbr_h; /* 0x00100 */ | ||
140 | volatile u32 erbr_l; /* 0x00104 */ | ||
141 | volatile u32 erbar; /* 0x00108 */ | ||
142 | volatile u32 ercir; /* 0x0010c */ | ||
143 | volatile u32 erpir; /* 0x00110 */ | ||
144 | volatile u32 ertr; /* 0x00114 */ | ||
145 | volatile u32 etcsr; /* 0x00118 */ | ||
146 | volatile u32 ersr; /* 0x0011c */ | ||
147 | volatile u32 etcdc; /* 0x00120 */ | ||
148 | volatile u32 ebir; /* 0x00124 */ | ||
149 | volatile u32 etbr_h; /* 0x00128 */ | ||
150 | volatile u32 etbr_l; /* 0x0012c */ | ||
151 | volatile u32 etcir; /* 0x00130 */ | ||
152 | volatile u32 etpir; /* 0x00134 */ | ||
153 | volatile u32 emar_h; /* 0x00138 */ | ||
154 | volatile u32 emar_l; /* 0x0013c */ | ||
155 | volatile u32 ehar_h; /* 0x00140 */ | ||
156 | volatile u32 ehar_l; /* 0x00144 */ | ||
157 | volatile u32 micr; /* 0x00148 */ | ||
158 | volatile u32 midr_r; /* 0x0014c */ | ||
159 | volatile u32 midr_w; /* 0x00150 */ | ||
160 | volatile u32 pad1[(0x20000 - 0x00154) / 4]; | ||
161 | |||
162 | /* SuperIO Registers XXX */ | ||
163 | struct ioc3_sioregs sregs; /* 0x20000 */ | ||
164 | volatile u32 pad2[(0x40000 - 0x20180) / 4]; | ||
165 | |||
166 | /* SSRAM Diagnostic Access */ | ||
167 | volatile u32 ssram[(0x80000 - 0x40000) / 4]; | ||
168 | |||
169 | /* Bytebus device offsets | ||
170 | 0x80000 - Access to the generic devices selected with DEV0 | ||
171 | 0x9FFFF bytebus DEV_SEL_0 | ||
172 | 0xA0000 - Access to the generic devices selected with DEV1 | ||
173 | 0xBFFFF bytebus DEV_SEL_1 | ||
174 | 0xC0000 - Access to the generic devices selected with DEV2 | ||
175 | 0xDFFFF bytebus DEV_SEL_2 | ||
176 | 0xE0000 - Access to the generic devices selected with DEV3 | ||
177 | 0xFFFFF bytebus DEV_SEL_3 */ | ||
178 | }; | ||
179 | |||
180 | /* | ||
181 | * Ethernet RX Buffer | ||
182 | */ | ||
183 | struct ioc3_erxbuf { | ||
184 | u32 w0; /* first word (valid,bcnt,cksum) */ | ||
185 | u32 err; /* second word various errors */ | ||
186 | /* next comes n bytes of padding */ | ||
187 | /* then the received ethernet frame itself */ | ||
188 | }; | ||
189 | |||
190 | #define ERXBUF_IPCKSUM_MASK 0x0000ffff | ||
191 | #define ERXBUF_BYTECNT_MASK 0x07ff0000 | ||
192 | #define ERXBUF_BYTECNT_SHIFT 16 | ||
193 | #define ERXBUF_V 0x80000000 | ||
194 | |||
195 | #define ERXBUF_CRCERR 0x00000001 /* aka RSV15 */ | ||
196 | #define ERXBUF_FRAMERR 0x00000002 /* aka RSV14 */ | ||
197 | #define ERXBUF_CODERR 0x00000004 /* aka RSV13 */ | ||
198 | #define ERXBUF_INVPREAMB 0x00000008 /* aka RSV18 */ | ||
199 | #define ERXBUF_LOLEN 0x00007000 /* aka RSV2_0 */ | ||
200 | #define ERXBUF_HILEN 0x03ff0000 /* aka RSV12_3 */ | ||
201 | #define ERXBUF_MULTICAST 0x04000000 /* aka RSV16 */ | ||
202 | #define ERXBUF_BROADCAST 0x08000000 /* aka RSV17 */ | ||
203 | #define ERXBUF_LONGEVENT 0x10000000 /* aka RSV19 */ | ||
204 | #define ERXBUF_BADPKT 0x20000000 /* aka RSV20 */ | ||
205 | #define ERXBUF_GOODPKT 0x40000000 /* aka RSV21 */ | ||
206 | #define ERXBUF_CARRIER 0x80000000 /* aka RSV22 */ | ||
207 | |||
208 | /* | ||
209 | * Ethernet TX Descriptor | ||
210 | */ | ||
211 | #define ETXD_DATALEN 104 | ||
212 | struct ioc3_etxd { | ||
213 | u32 cmd; /* command field */ | ||
214 | u32 bufcnt; /* buffer counts field */ | ||
215 | u64 p1; /* buffer pointer 1 */ | ||
216 | u64 p2; /* buffer pointer 2 */ | ||
217 | u8 data[ETXD_DATALEN]; /* opt. tx data */ | ||
218 | }; | ||
219 | |||
220 | #define ETXD_BYTECNT_MASK 0x000007ff /* total byte count */ | ||
221 | #define ETXD_INTWHENDONE 0x00001000 /* intr when done */ | ||
222 | #define ETXD_D0V 0x00010000 /* data 0 valid */ | ||
223 | #define ETXD_B1V 0x00020000 /* buf 1 valid */ | ||
224 | #define ETXD_B2V 0x00040000 /* buf 2 valid */ | ||
225 | #define ETXD_DOCHECKSUM 0x00080000 /* insert ip cksum */ | ||
226 | #define ETXD_CHKOFF_MASK 0x07f00000 /* cksum byte offset */ | ||
227 | #define ETXD_CHKOFF_SHIFT 20 | ||
228 | |||
229 | #define ETXD_D0CNT_MASK 0x0000007f | ||
230 | #define ETXD_B1CNT_MASK 0x0007ff00 | ||
231 | #define ETXD_B1CNT_SHIFT 8 | ||
232 | #define ETXD_B2CNT_MASK 0x7ff00000 | ||
233 | #define ETXD_B2CNT_SHIFT 20 | ||
234 | |||
235 | /* | ||
236 | * Bytebus device space | ||
237 | */ | ||
238 | #define IOC3_BYTEBUS_DEV0 0x80000L | ||
239 | #define IOC3_BYTEBUS_DEV1 0xa0000L | ||
240 | #define IOC3_BYTEBUS_DEV2 0xc0000L | ||
241 | #define IOC3_BYTEBUS_DEV3 0xe0000L | ||
242 | |||
243 | /* ------------------------------------------------------------------------- */ | ||
244 | |||
245 | /* Superio Registers (PIO Access) */ | ||
246 | #define IOC3_SIO_BASE 0x20000 | ||
247 | #define IOC3_SIO_UARTC (IOC3_SIO_BASE+0x141) /* UART Config */ | ||
248 | #define IOC3_SIO_KBDCG (IOC3_SIO_BASE+0x142) /* KBD Config */ | ||
249 | #define IOC3_SIO_PP_BASE (IOC3_SIO_BASE+PP_BASE) /* Parallel Port */ | ||
250 | #define IOC3_SIO_RTC_BASE (IOC3_SIO_BASE+0x168) /* Real Time Clock */ | ||
251 | #define IOC3_SIO_UB_BASE (IOC3_SIO_BASE+UARTB_BASE) /* UART B */ | ||
252 | #define IOC3_SIO_UA_BASE (IOC3_SIO_BASE+UARTA_BASE) /* UART A */ | ||
253 | |||
254 | /* SSRAM Diagnostic Access */ | ||
255 | #define IOC3_SSRAM IOC3_RAM_OFF /* base of SSRAM diagnostic access */ | ||
256 | #define IOC3_SSRAM_LEN 0x40000 /* 256kb (address space size, may not be fully populated) */ | ||
257 | #define IOC3_SSRAM_DM 0x0000ffff /* data mask */ | ||
258 | #define IOC3_SSRAM_PM 0x00010000 /* parity mask */ | ||
259 | |||
260 | /* bitmasks for PCI_SCR */ | ||
261 | #define PCI_SCR_PAR_RESP_EN 0x00000040 /* enb PCI parity checking */ | ||
262 | #define PCI_SCR_SERR_EN 0x00000100 /* enable the SERR# driver */ | ||
263 | #define PCI_SCR_DROP_MODE_EN 0x00008000 /* drop pios on parity err */ | ||
264 | #define PCI_SCR_RX_SERR (0x1 << 16) | ||
265 | #define PCI_SCR_DROP_MODE (0x1 << 17) | ||
266 | #define PCI_SCR_SIG_PAR_ERR (0x1 << 24) | ||
267 | #define PCI_SCR_SIG_TAR_ABRT (0x1 << 27) | ||
268 | #define PCI_SCR_RX_TAR_ABRT (0x1 << 28) | ||
269 | #define PCI_SCR_SIG_MST_ABRT (0x1 << 29) | ||
270 | #define PCI_SCR_SIG_SERR (0x1 << 30) | ||
271 | #define PCI_SCR_PAR_ERR (0x1 << 31) | ||
272 | |||
273 | /* bitmasks for IOC3_KM_CSR */ | ||
274 | #define KM_CSR_K_WRT_PEND 0x00000001 /* kbd port xmitting or resetting */ | ||
275 | #define KM_CSR_M_WRT_PEND 0x00000002 /* mouse port xmitting or resetting */ | ||
276 | #define KM_CSR_K_LCB 0x00000004 /* Line Cntrl Bit for last KBD write */ | ||
277 | #define KM_CSR_M_LCB 0x00000008 /* same for mouse */ | ||
278 | #define KM_CSR_K_DATA 0x00000010 /* state of kbd data line */ | ||
279 | #define KM_CSR_K_CLK 0x00000020 /* state of kbd clock line */ | ||
280 | #define KM_CSR_K_PULL_DATA 0x00000040 /* pull kbd data line low */ | ||
281 | #define KM_CSR_K_PULL_CLK 0x00000080 /* pull kbd clock line low */ | ||
282 | #define KM_CSR_M_DATA 0x00000100 /* state of ms data line */ | ||
283 | #define KM_CSR_M_CLK 0x00000200 /* state of ms clock line */ | ||
284 | #define KM_CSR_M_PULL_DATA 0x00000400 /* pull ms data line low */ | ||
285 | #define KM_CSR_M_PULL_CLK 0x00000800 /* pull ms clock line low */ | ||
286 | #define KM_CSR_EMM_MODE 0x00001000 /* emulation mode */ | ||
287 | #define KM_CSR_SIM_MODE 0x00002000 /* clock X8 */ | ||
288 | #define KM_CSR_K_SM_IDLE 0x00004000 /* Keyboard is idle */ | ||
289 | #define KM_CSR_M_SM_IDLE 0x00008000 /* Mouse is idle */ | ||
290 | #define KM_CSR_K_TO 0x00010000 /* Keyboard trying to send/receive */ | ||
291 | #define KM_CSR_M_TO 0x00020000 /* Mouse trying to send/receive */ | ||
292 | #define KM_CSR_K_TO_EN 0x00040000 /* KM_CSR_K_TO + KM_CSR_K_TO_EN = cause | ||
293 | SIO_IR to assert */ | ||
294 | #define KM_CSR_M_TO_EN 0x00080000 /* KM_CSR_M_TO + KM_CSR_M_TO_EN = cause | ||
295 | SIO_IR to assert */ | ||
296 | #define KM_CSR_K_CLAMP_ONE 0x00100000 /* Pull K_CLK low after rec. one char */ | ||
297 | #define KM_CSR_M_CLAMP_ONE 0x00200000 /* Pull M_CLK low after rec. one char */ | ||
298 | #define KM_CSR_K_CLAMP_THREE 0x00400000 /* Pull K_CLK low after rec. three chars */ | ||
299 | #define KM_CSR_M_CLAMP_THREE 0x00800000 /* Pull M_CLK low after rec. three char */ | ||
300 | |||
301 | /* bitmasks for IOC3_K_RD and IOC3_M_RD */ | ||
302 | #define KM_RD_DATA_2 0x000000ff /* 3rd char recvd since last read */ | ||
303 | #define KM_RD_DATA_2_SHIFT 0 | ||
304 | #define KM_RD_DATA_1 0x0000ff00 /* 2nd char recvd since last read */ | ||
305 | #define KM_RD_DATA_1_SHIFT 8 | ||
306 | #define KM_RD_DATA_0 0x00ff0000 /* 1st char recvd since last read */ | ||
307 | #define KM_RD_DATA_0_SHIFT 16 | ||
308 | #define KM_RD_FRAME_ERR_2 0x01000000 /* framing or parity error in byte 2 */ | ||
309 | #define KM_RD_FRAME_ERR_1 0x02000000 /* same for byte 1 */ | ||
310 | #define KM_RD_FRAME_ERR_0 0x04000000 /* same for byte 0 */ | ||
311 | |||
312 | #define KM_RD_KBD_MSE 0x08000000 /* 0 if from kbd, 1 if from mouse */ | ||
313 | #define KM_RD_OFLO 0x10000000 /* 4th char recvd before this read */ | ||
314 | #define KM_RD_VALID_2 0x20000000 /* DATA_2 valid */ | ||
315 | #define KM_RD_VALID_1 0x40000000 /* DATA_1 valid */ | ||
316 | #define KM_RD_VALID_0 0x80000000 /* DATA_0 valid */ | ||
317 | #define KM_RD_VALID_ALL (KM_RD_VALID_0|KM_RD_VALID_1|KM_RD_VALID_2) | ||
318 | |||
319 | /* bitmasks for IOC3_K_WD & IOC3_M_WD */ | ||
320 | #define KM_WD_WRT_DATA 0x000000ff /* write to keyboard/mouse port */ | ||
321 | #define KM_WD_WRT_DATA_SHIFT 0 | ||
322 | |||
323 | /* bitmasks for serial RX status byte */ | ||
324 | #define RXSB_OVERRUN 0x01 /* char(s) lost */ | ||
325 | #define RXSB_PAR_ERR 0x02 /* parity error */ | ||
326 | #define RXSB_FRAME_ERR 0x04 /* framing error */ | ||
327 | #define RXSB_BREAK 0x08 /* break character */ | ||
328 | #define RXSB_CTS 0x10 /* state of CTS */ | ||
329 | #define RXSB_DCD 0x20 /* state of DCD */ | ||
330 | #define RXSB_MODEM_VALID 0x40 /* DCD, CTS and OVERRUN are valid */ | ||
331 | #define RXSB_DATA_VALID 0x80 /* data byte, FRAME_ERR PAR_ERR & BREAK valid */ | ||
332 | |||
333 | /* bitmasks for serial TX control byte */ | ||
334 | #define TXCB_INT_WHEN_DONE 0x20 /* interrupt after this byte is sent */ | ||
335 | #define TXCB_INVALID 0x00 /* byte is invalid */ | ||
336 | #define TXCB_VALID 0x40 /* byte is valid */ | ||
337 | #define TXCB_MCR 0x80 /* data<7:0> to modem control register */ | ||
338 | #define TXCB_DELAY 0xc0 /* delay data<7:0> mSec */ | ||
339 | |||
340 | /* bitmasks for IOC3_SBBR_L */ | ||
341 | #define SBBR_L_SIZE 0x00000001 /* 0 == 1KB rings, 1 == 4KB rings */ | ||
342 | #define SBBR_L_BASE 0xfffff000 /* lower serial ring base addr */ | ||
343 | |||
344 | /* bitmasks for IOC3_SSCR_<A:B> */ | ||
345 | #define SSCR_RX_THRESHOLD 0x000001ff /* hiwater mark */ | ||
346 | #define SSCR_TX_TIMER_BUSY 0x00010000 /* TX timer in progress */ | ||
347 | #define SSCR_HFC_EN 0x00020000 /* hardware flow control enabled */ | ||
348 | #define SSCR_RX_RING_DCD 0x00040000 /* post RX record on delta-DCD */ | ||
349 | #define SSCR_RX_RING_CTS 0x00080000 /* post RX record on delta-CTS */ | ||
350 | #define SSCR_HIGH_SPD 0x00100000 /* 4X speed */ | ||
351 | #define SSCR_DIAG 0x00200000 /* bypass clock divider for sim */ | ||
352 | #define SSCR_RX_DRAIN 0x08000000 /* drain RX buffer to memory */ | ||
353 | #define SSCR_DMA_EN 0x10000000 /* enable ring buffer DMA */ | ||
354 | #define SSCR_DMA_PAUSE 0x20000000 /* pause DMA */ | ||
355 | #define SSCR_PAUSE_STATE 0x40000000 /* sets when PAUSE takes effect */ | ||
356 | #define SSCR_RESET 0x80000000 /* reset DMA channels */ | ||
357 | |||
358 | /* all producer/comsumer pointers are the same bitfield */ | ||
359 | #define PROD_CONS_PTR_4K 0x00000ff8 /* for 4K buffers */ | ||
360 | #define PROD_CONS_PTR_1K 0x000003f8 /* for 1K buffers */ | ||
361 | #define PROD_CONS_PTR_OFF 3 | ||
362 | |||
363 | /* bitmasks for IOC3_SRCIR_<A:B> */ | ||
364 | #define SRCIR_ARM 0x80000000 /* arm RX timer */ | ||
365 | |||
366 | /* bitmasks for IOC3_SRPIR_<A:B> */ | ||
367 | #define SRPIR_BYTE_CNT 0x07000000 /* bytes in packer */ | ||
368 | #define SRPIR_BYTE_CNT_SHIFT 24 | ||
369 | |||
370 | /* bitmasks for IOC3_STCIR_<A:B> */ | ||
371 | #define STCIR_BYTE_CNT 0x0f000000 /* bytes in unpacker */ | ||
372 | #define STCIR_BYTE_CNT_SHIFT 24 | ||
373 | |||
374 | /* bitmasks for IOC3_SHADOW_<A:B> */ | ||
375 | #define SHADOW_DR 0x00000001 /* data ready */ | ||
376 | #define SHADOW_OE 0x00000002 /* overrun error */ | ||
377 | #define SHADOW_PE 0x00000004 /* parity error */ | ||
378 | #define SHADOW_FE 0x00000008 /* framing error */ | ||
379 | #define SHADOW_BI 0x00000010 /* break interrupt */ | ||
380 | #define SHADOW_THRE 0x00000020 /* transmit holding register empty */ | ||
381 | #define SHADOW_TEMT 0x00000040 /* transmit shift register empty */ | ||
382 | #define SHADOW_RFCE 0x00000080 /* char in RX fifo has an error */ | ||
383 | #define SHADOW_DCTS 0x00010000 /* delta clear to send */ | ||
384 | #define SHADOW_DDCD 0x00080000 /* delta data carrier detect */ | ||
385 | #define SHADOW_CTS 0x00100000 /* clear to send */ | ||
386 | #define SHADOW_DCD 0x00800000 /* data carrier detect */ | ||
387 | #define SHADOW_DTR 0x01000000 /* data terminal ready */ | ||
388 | #define SHADOW_RTS 0x02000000 /* request to send */ | ||
389 | #define SHADOW_OUT1 0x04000000 /* 16550 OUT1 bit */ | ||
390 | #define SHADOW_OUT2 0x08000000 /* 16550 OUT2 bit */ | ||
391 | #define SHADOW_LOOP 0x10000000 /* loopback enabled */ | ||
392 | |||
393 | /* bitmasks for IOC3_SRTR_<A:B> */ | ||
394 | #define SRTR_CNT 0x00000fff /* reload value for RX timer */ | ||
395 | #define SRTR_CNT_VAL 0x0fff0000 /* current value of RX timer */ | ||
396 | #define SRTR_CNT_VAL_SHIFT 16 | ||
397 | #define SRTR_HZ 16000 /* SRTR clock frequency */ | ||
398 | |||
399 | /* bitmasks for IOC3_SIO_IR, IOC3_SIO_IEC and IOC3_SIO_IES */ | ||
400 | #define SIO_IR_SA_TX_MT 0x00000001 /* Serial port A TX empty */ | ||
401 | #define SIO_IR_SA_RX_FULL 0x00000002 /* port A RX buf full */ | ||
402 | #define SIO_IR_SA_RX_HIGH 0x00000004 /* port A RX hiwat */ | ||
403 | #define SIO_IR_SA_RX_TIMER 0x00000008 /* port A RX timeout */ | ||
404 | #define SIO_IR_SA_DELTA_DCD 0x00000010 /* port A delta DCD */ | ||
405 | #define SIO_IR_SA_DELTA_CTS 0x00000020 /* port A delta CTS */ | ||
406 | #define SIO_IR_SA_INT 0x00000040 /* port A pass-thru intr */ | ||
407 | #define SIO_IR_SA_TX_EXPLICIT 0x00000080 /* port A explicit TX thru */ | ||
408 | #define SIO_IR_SA_MEMERR 0x00000100 /* port A PCI error */ | ||
409 | #define SIO_IR_SB_TX_MT 0x00000200 /* */ | ||
410 | #define SIO_IR_SB_RX_FULL 0x00000400 /* */ | ||
411 | #define SIO_IR_SB_RX_HIGH 0x00000800 /* */ | ||
412 | #define SIO_IR_SB_RX_TIMER 0x00001000 /* */ | ||
413 | #define SIO_IR_SB_DELTA_DCD 0x00002000 /* */ | ||
414 | #define SIO_IR_SB_DELTA_CTS 0x00004000 /* */ | ||
415 | #define SIO_IR_SB_INT 0x00008000 /* */ | ||
416 | #define SIO_IR_SB_TX_EXPLICIT 0x00010000 /* */ | ||
417 | #define SIO_IR_SB_MEMERR 0x00020000 /* */ | ||
418 | #define SIO_IR_PP_INT 0x00040000 /* P port pass-thru intr */ | ||
419 | #define SIO_IR_PP_INTA 0x00080000 /* PP context A thru */ | ||
420 | #define SIO_IR_PP_INTB 0x00100000 /* PP context B thru */ | ||
421 | #define SIO_IR_PP_MEMERR 0x00200000 /* PP PCI error */ | ||
422 | #define SIO_IR_KBD_INT 0x00400000 /* kbd/mouse intr */ | ||
423 | #define SIO_IR_RT_INT 0x08000000 /* RT output pulse */ | ||
424 | #define SIO_IR_GEN_INT1 0x10000000 /* RT input pulse */ | ||
425 | #define SIO_IR_GEN_INT_SHIFT 28 | ||
426 | |||
427 | /* per device interrupt masks */ | ||
428 | #define SIO_IR_SA (SIO_IR_SA_TX_MT | SIO_IR_SA_RX_FULL | \ | ||
429 | SIO_IR_SA_RX_HIGH | SIO_IR_SA_RX_TIMER | \ | ||
430 | SIO_IR_SA_DELTA_DCD | SIO_IR_SA_DELTA_CTS | \ | ||
431 | SIO_IR_SA_INT | SIO_IR_SA_TX_EXPLICIT | \ | ||
432 | SIO_IR_SA_MEMERR) | ||
433 | #define SIO_IR_SB (SIO_IR_SB_TX_MT | SIO_IR_SB_RX_FULL | \ | ||
434 | SIO_IR_SB_RX_HIGH | SIO_IR_SB_RX_TIMER | \ | ||
435 | SIO_IR_SB_DELTA_DCD | SIO_IR_SB_DELTA_CTS | \ | ||
436 | SIO_IR_SB_INT | SIO_IR_SB_TX_EXPLICIT | \ | ||
437 | SIO_IR_SB_MEMERR) | ||
438 | #define SIO_IR_PP (SIO_IR_PP_INT | SIO_IR_PP_INTA | \ | ||
439 | SIO_IR_PP_INTB | SIO_IR_PP_MEMERR) | ||
440 | #define SIO_IR_RT (SIO_IR_RT_INT | SIO_IR_GEN_INT1) | ||
441 | |||
442 | /* macro to load pending interrupts */ | ||
443 | #define IOC3_PENDING_INTRS(mem) (PCI_INW(&((mem)->sio_ir)) & \ | ||
444 | PCI_INW(&((mem)->sio_ies_ro))) | ||
445 | |||
446 | /* bitmasks for SIO_CR */ | ||
447 | #define SIO_CR_SIO_RESET 0x00000001 /* reset the SIO */ | ||
448 | #define SIO_CR_SER_A_BASE 0x000000fe /* DMA poll addr port A */ | ||
449 | #define SIO_CR_SER_A_BASE_SHIFT 1 | ||
450 | #define SIO_CR_SER_B_BASE 0x00007f00 /* DMA poll addr port B */ | ||
451 | #define SIO_CR_SER_B_BASE_SHIFT 8 | ||
452 | #define SIO_SR_CMD_PULSE 0x00078000 /* byte bus strobe length */ | ||
453 | #define SIO_CR_CMD_PULSE_SHIFT 15 | ||
454 | #define SIO_CR_ARB_DIAG 0x00380000 /* cur !enet PCI requet (ro) */ | ||
455 | #define SIO_CR_ARB_DIAG_TXA 0x00000000 | ||
456 | #define SIO_CR_ARB_DIAG_RXA 0x00080000 | ||
457 | #define SIO_CR_ARB_DIAG_TXB 0x00100000 | ||
458 | #define SIO_CR_ARB_DIAG_RXB 0x00180000 | ||
459 | #define SIO_CR_ARB_DIAG_PP 0x00200000 | ||
460 | #define SIO_CR_ARB_DIAG_IDLE 0x00400000 /* 0 -> active request (ro) */ | ||
461 | |||
462 | /* bitmasks for INT_OUT */ | ||
463 | #define INT_OUT_COUNT 0x0000ffff /* pulse interval timer */ | ||
464 | #define INT_OUT_MODE 0x00070000 /* mode mask */ | ||
465 | #define INT_OUT_MODE_0 0x00000000 /* set output to 0 */ | ||
466 | #define INT_OUT_MODE_1 0x00040000 /* set output to 1 */ | ||
467 | #define INT_OUT_MODE_1PULSE 0x00050000 /* send 1 pulse */ | ||
468 | #define INT_OUT_MODE_PULSES 0x00060000 /* send 1 pulse every interval */ | ||
469 | #define INT_OUT_MODE_SQW 0x00070000 /* toggle output every interval */ | ||
470 | #define INT_OUT_DIAG 0x40000000 /* diag mode */ | ||
471 | #define INT_OUT_INT_OUT 0x80000000 /* current state of INT_OUT */ | ||
472 | |||
473 | /* time constants for INT_OUT */ | ||
474 | #define INT_OUT_NS_PER_TICK (30 * 260) /* 30 ns PCI clock, divisor=260 */ | ||
475 | #define INT_OUT_TICKS_PER_PULSE 3 /* outgoing pulse lasts 3 ticks */ | ||
476 | #define INT_OUT_US_TO_COUNT(x) /* convert uS to a count value */ \ | ||
477 | (((x) * 10 + INT_OUT_NS_PER_TICK / 200) * \ | ||
478 | 100 / INT_OUT_NS_PER_TICK - 1) | ||
479 | #define INT_OUT_COUNT_TO_US(x) /* convert count value to uS */ \ | ||
480 | (((x) + 1) * INT_OUT_NS_PER_TICK / 1000) | ||
481 | #define INT_OUT_MIN_TICKS 3 /* min period is width of pulse in "ticks" */ | ||
482 | #define INT_OUT_MAX_TICKS INT_OUT_COUNT /* largest possible count */ | ||
483 | |||
484 | /* bitmasks for GPCR */ | ||
485 | #define GPCR_DIR 0x000000ff /* tristate pin input or output */ | ||
486 | #define GPCR_DIR_PIN(x) (1<<(x)) /* access one of the DIR bits */ | ||
487 | #define GPCR_EDGE 0x000f0000 /* extint edge or level sensitive */ | ||
488 | #define GPCR_EDGE_PIN(x) (1<<((x)+15)) /* access one of the EDGE bits */ | ||
489 | |||
490 | /* values for GPCR */ | ||
491 | #define GPCR_INT_OUT_EN 0x00100000 /* enable INT_OUT to pin 0 */ | ||
492 | #define GPCR_MLAN_EN 0x00200000 /* enable MCR to pin 8 */ | ||
493 | #define GPCR_DIR_SERA_XCVR 0x00000080 /* Port A Transceiver select enable */ | ||
494 | #define GPCR_DIR_SERB_XCVR 0x00000040 /* Port B Transceiver select enable */ | ||
495 | #define GPCR_DIR_PHY_RST 0x00000020 /* ethernet PHY reset enable */ | ||
496 | |||
497 | /* defs for some of the generic I/O pins */ | ||
498 | #define GPCR_PHY_RESET 0x20 /* pin is output to PHY reset */ | ||
499 | #define GPCR_UARTB_MODESEL 0x40 /* pin is output to port B mode sel */ | ||
500 | #define GPCR_UARTA_MODESEL 0x80 /* pin is output to port A mode sel */ | ||
501 | |||
502 | #define GPPR_PHY_RESET_PIN 5 /* GIO pin controlling phy reset */ | ||
503 | #define GPPR_UARTB_MODESEL_PIN 6 /* GIO pin controlling uart b mode select */ | ||
504 | #define GPPR_UARTA_MODESEL_PIN 7 /* GIO pin controlling uart a mode select */ | ||
505 | |||
506 | #define EMCR_DUPLEX 0x00000001 | ||
507 | #define EMCR_PROMISC 0x00000002 | ||
508 | #define EMCR_PADEN 0x00000004 | ||
509 | #define EMCR_RXOFF_MASK 0x000001f8 | ||
510 | #define EMCR_RXOFF_SHIFT 3 | ||
511 | #define EMCR_RAMPAR 0x00000200 | ||
512 | #define EMCR_BADPAR 0x00000800 | ||
513 | #define EMCR_BUFSIZ 0x00001000 | ||
514 | #define EMCR_TXDMAEN 0x00002000 | ||
515 | #define EMCR_TXEN 0x00004000 | ||
516 | #define EMCR_RXDMAEN 0x00008000 | ||
517 | #define EMCR_RXEN 0x00010000 | ||
518 | #define EMCR_LOOPBACK 0x00020000 | ||
519 | #define EMCR_ARB_DIAG 0x001c0000 | ||
520 | #define EMCR_ARB_DIAG_IDLE 0x00200000 | ||
521 | #define EMCR_RST 0x80000000 | ||
522 | |||
523 | #define EISR_RXTIMERINT 0x00000001 | ||
524 | #define EISR_RXTHRESHINT 0x00000002 | ||
525 | #define EISR_RXOFLO 0x00000004 | ||
526 | #define EISR_RXBUFOFLO 0x00000008 | ||
527 | #define EISR_RXMEMERR 0x00000010 | ||
528 | #define EISR_RXPARERR 0x00000020 | ||
529 | #define EISR_TXEMPTY 0x00010000 | ||
530 | #define EISR_TXRTRY 0x00020000 | ||
531 | #define EISR_TXEXDEF 0x00040000 | ||
532 | #define EISR_TXLCOL 0x00080000 | ||
533 | #define EISR_TXGIANT 0x00100000 | ||
534 | #define EISR_TXBUFUFLO 0x00200000 | ||
535 | #define EISR_TXEXPLICIT 0x00400000 | ||
536 | #define EISR_TXCOLLWRAP 0x00800000 | ||
537 | #define EISR_TXDEFERWRAP 0x01000000 | ||
538 | #define EISR_TXMEMERR 0x02000000 | ||
539 | #define EISR_TXPARERR 0x04000000 | ||
540 | |||
541 | #define ERCSR_THRESH_MASK 0x000001ff /* enet RX threshold */ | ||
542 | #define ERCSR_RX_TMR 0x40000000 /* simulation only */ | ||
543 | #define ERCSR_DIAG_OFLO 0x80000000 /* simulation only */ | ||
544 | |||
545 | #define ERBR_ALIGNMENT 4096 | ||
546 | #define ERBR_L_RXRINGBASE_MASK 0xfffff000 | ||
547 | |||
548 | #define ERBAR_BARRIER_BIT 0x0100 | ||
549 | #define ERBAR_RXBARR_MASK 0xffff0000 | ||
550 | #define ERBAR_RXBARR_SHIFT 16 | ||
551 | |||
552 | #define ERCIR_RXCONSUME_MASK 0x00000fff | ||
553 | |||
554 | #define ERPIR_RXPRODUCE_MASK 0x00000fff | ||
555 | #define ERPIR_ARM 0x80000000 | ||
556 | |||
557 | #define ERTR_CNT_MASK 0x000007ff | ||
558 | |||
559 | #define ETCSR_IPGT_MASK 0x0000007f | ||
560 | #define ETCSR_IPGR1_MASK 0x00007f00 | ||
561 | #define ETCSR_IPGR1_SHIFT 8 | ||
562 | #define ETCSR_IPGR2_MASK 0x007f0000 | ||
563 | #define ETCSR_IPGR2_SHIFT 16 | ||
564 | #define ETCSR_NOTXCLK 0x80000000 | ||
565 | |||
566 | #define ETCDC_COLLCNT_MASK 0x0000ffff | ||
567 | #define ETCDC_DEFERCNT_MASK 0xffff0000 | ||
568 | #define ETCDC_DEFERCNT_SHIFT 16 | ||
569 | |||
570 | #define ETBR_ALIGNMENT (64*1024) | ||
571 | #define ETBR_L_RINGSZ_MASK 0x00000001 | ||
572 | #define ETBR_L_RINGSZ128 0 | ||
573 | #define ETBR_L_RINGSZ512 1 | ||
574 | #define ETBR_L_TXRINGBASE_MASK 0xffffc000 | ||
575 | |||
576 | #define ETCIR_TXCONSUME_MASK 0x0000ffff | ||
577 | #define ETCIR_IDLE 0x80000000 | ||
578 | |||
579 | #define ETPIR_TXPRODUCE_MASK 0x0000ffff | ||
580 | |||
581 | #define EBIR_TXBUFPROD_MASK 0x0000001f | ||
582 | #define EBIR_TXBUFCONS_MASK 0x00001f00 | ||
583 | #define EBIR_TXBUFCONS_SHIFT 8 | ||
584 | #define EBIR_RXBUFPROD_MASK 0x007fc000 | ||
585 | #define EBIR_RXBUFPROD_SHIFT 14 | ||
586 | #define EBIR_RXBUFCONS_MASK 0xff800000 | ||
587 | #define EBIR_RXBUFCONS_SHIFT 23 | ||
588 | |||
589 | #define MICR_REGADDR_MASK 0x0000001f | ||
590 | #define MICR_PHYADDR_MASK 0x000003e0 | ||
591 | #define MICR_PHYADDR_SHIFT 5 | ||
592 | #define MICR_READTRIG 0x00000400 | ||
593 | #define MICR_BUSY 0x00000800 | ||
594 | |||
595 | #define MIDR_DATA_MASK 0x0000ffff | ||
596 | |||
597 | #define ERXBUF_IPCKSUM_MASK 0x0000ffff | ||
598 | #define ERXBUF_BYTECNT_MASK 0x07ff0000 | ||
599 | #define ERXBUF_BYTECNT_SHIFT 16 | ||
600 | #define ERXBUF_V 0x80000000 | ||
601 | |||
602 | #define ERXBUF_CRCERR 0x00000001 /* aka RSV15 */ | ||
603 | #define ERXBUF_FRAMERR 0x00000002 /* aka RSV14 */ | ||
604 | #define ERXBUF_CODERR 0x00000004 /* aka RSV13 */ | ||
605 | #define ERXBUF_INVPREAMB 0x00000008 /* aka RSV18 */ | ||
606 | #define ERXBUF_LOLEN 0x00007000 /* aka RSV2_0 */ | ||
607 | #define ERXBUF_HILEN 0x03ff0000 /* aka RSV12_3 */ | ||
608 | #define ERXBUF_MULTICAST 0x04000000 /* aka RSV16 */ | ||
609 | #define ERXBUF_BROADCAST 0x08000000 /* aka RSV17 */ | ||
610 | #define ERXBUF_LONGEVENT 0x10000000 /* aka RSV19 */ | ||
611 | #define ERXBUF_BADPKT 0x20000000 /* aka RSV20 */ | ||
612 | #define ERXBUF_GOODPKT 0x40000000 /* aka RSV21 */ | ||
613 | #define ERXBUF_CARRIER 0x80000000 /* aka RSV22 */ | ||
614 | |||
615 | #define ETXD_BYTECNT_MASK 0x000007ff /* total byte count */ | ||
616 | #define ETXD_INTWHENDONE 0x00001000 /* intr when done */ | ||
617 | #define ETXD_D0V 0x00010000 /* data 0 valid */ | ||
618 | #define ETXD_B1V 0x00020000 /* buf 1 valid */ | ||
619 | #define ETXD_B2V 0x00040000 /* buf 2 valid */ | ||
620 | #define ETXD_DOCHECKSUM 0x00080000 /* insert ip cksum */ | ||
621 | #define ETXD_CHKOFF_MASK 0x07f00000 /* cksum byte offset */ | ||
622 | #define ETXD_CHKOFF_SHIFT 20 | ||
623 | |||
624 | #define ETXD_D0CNT_MASK 0x0000007f | ||
625 | #define ETXD_B1CNT_MASK 0x0007ff00 | ||
626 | #define ETXD_B1CNT_SHIFT 8 | ||
627 | #define ETXD_B2CNT_MASK 0x7ff00000 | ||
628 | #define ETXD_B2CNT_SHIFT 20 | ||
629 | |||
630 | typedef enum ioc3_subdevs_e { | ||
631 | ioc3_subdev_ether, | ||
632 | ioc3_subdev_generic, | ||
633 | ioc3_subdev_nic, | ||
634 | ioc3_subdev_kbms, | ||
635 | ioc3_subdev_ttya, | ||
636 | ioc3_subdev_ttyb, | ||
637 | ioc3_subdev_ecpp, | ||
638 | ioc3_subdev_rt, | ||
639 | ioc3_nsubdevs | ||
640 | } ioc3_subdev_t; | ||
641 | |||
642 | /* subdevice disable bits, | ||
643 | * from the standard INFO_LBL_SUBDEVS | ||
644 | */ | ||
645 | #define IOC3_SDB_ETHER (1<<ioc3_subdev_ether) | ||
646 | #define IOC3_SDB_GENERIC (1<<ioc3_subdev_generic) | ||
647 | #define IOC3_SDB_NIC (1<<ioc3_subdev_nic) | ||
648 | #define IOC3_SDB_KBMS (1<<ioc3_subdev_kbms) | ||
649 | #define IOC3_SDB_TTYA (1<<ioc3_subdev_ttya) | ||
650 | #define IOC3_SDB_TTYB (1<<ioc3_subdev_ttyb) | ||
651 | #define IOC3_SDB_ECPP (1<<ioc3_subdev_ecpp) | ||
652 | #define IOC3_SDB_RT (1<<ioc3_subdev_rt) | ||
653 | |||
654 | #define IOC3_ALL_SUBDEVS ((1<<ioc3_nsubdevs)-1) | ||
655 | |||
656 | #define IOC3_SDB_SERIAL (IOC3_SDB_TTYA|IOC3_SDB_TTYB) | ||
657 | |||
658 | #define IOC3_STD_SUBDEVS IOC3_ALL_SUBDEVS | ||
659 | |||
660 | #define IOC3_INTA_SUBDEVS IOC3_SDB_ETHER | ||
661 | #define IOC3_INTB_SUBDEVS (IOC3_SDB_GENERIC|IOC3_SDB_KBMS|IOC3_SDB_SERIAL|IOC3_SDB_ECPP|IOC3_SDB_RT) | ||
662 | |||
663 | #endif /* _IOC3_H */ | ||
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h deleted file mode 100644 index 96cfd2ab1bcd..000000000000 --- a/include/asm-mips/sn/klconfig.h +++ /dev/null | |||
@@ -1,898 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Derived from IRIX <sys/SN/klconfig.h>. | ||
7 | * | ||
8 | * Copyright (C) 1992 - 1997, 1999, 2000 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 1999, 2000 by Ralf Baechle | ||
10 | */ | ||
11 | #ifndef _ASM_SN_KLCONFIG_H | ||
12 | #define _ASM_SN_KLCONFIG_H | ||
13 | |||
14 | /* | ||
15 | * The KLCONFIG structures store info about the various BOARDs found | ||
16 | * during Hardware Discovery. In addition, it stores info about the | ||
17 | * components found on the BOARDs. | ||
18 | */ | ||
19 | |||
20 | /* | ||
21 | * WARNING: | ||
22 | * Certain assembly language routines (notably xxxxx.s) in the IP27PROM | ||
23 | * will depend on the format of the data structures in this file. In | ||
24 | * most cases, rearranging the fields can seriously break things. | ||
25 | * Adding fields in the beginning or middle can also break things. | ||
26 | * Add fields if necessary, to the end of a struct in such a way | ||
27 | * that offsets of existing fields do not change. | ||
28 | */ | ||
29 | |||
30 | #include <linux/types.h> | ||
31 | #include <asm/sn/types.h> | ||
32 | |||
33 | #if defined(CONFIG_SGI_IP27) | ||
34 | |||
35 | #include <asm/sn/sn0/addrs.h> | ||
36 | //#include <sys/SN/router.h> | ||
37 | // XXX Stolen from <sys/SN/router.h>: | ||
38 | #define MAX_ROUTER_PORTS (6) /* Max. number of ports on a router */ | ||
39 | #include <asm/sn/fru.h> | ||
40 | //#include <sys/graph.h> | ||
41 | //#include <sys/xtalk/xbow.h> | ||
42 | |||
43 | #elif defined(CONFIG_SGI_IP35) | ||
44 | |||
45 | #include <asm/sn/sn1/addrs.h> | ||
46 | #include <sys/sn/router.h> | ||
47 | #include <sys/graph.h> | ||
48 | #include <asm/xtalk/xbow.h> | ||
49 | |||
50 | #endif /* !CONFIG_SGI_IP27 && !CONFIG_SGI_IP35 */ | ||
51 | |||
52 | #if defined(CONFIG_SGI_IP27) || defined(CONFIG_SGI_IP35) | ||
53 | #include <asm/sn/agent.h> | ||
54 | #include <asm/fw/arc/types.h> | ||
55 | #include <asm/fw/arc/hinv.h> | ||
56 | #if defined(CONFIG_SGI_IP35) | ||
57 | // The hack file has to be before vector and after sn0_fru.... | ||
58 | #include <asm/hack.h> | ||
59 | #include <asm/sn/vector.h> | ||
60 | #include <asm/xtalk/xtalk.h> | ||
61 | #endif /* CONFIG_SGI_IP35 */ | ||
62 | #endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */ | ||
63 | |||
64 | typedef u64 nic_t; | ||
65 | |||
66 | #define KLCFGINFO_MAGIC 0xbeedbabe | ||
67 | |||
68 | typedef s32 klconf_off_t; | ||
69 | |||
70 | /* | ||
71 | * Some IMPORTANT OFFSETS. These are the offsets on all NODES. | ||
72 | */ | ||
73 | #define MAX_MODULE_ID 255 | ||
74 | #define SIZE_PAD 4096 /* 4k padding for structures */ | ||
75 | /* | ||
76 | * 1 NODE brd, 2 Router brd (1 8p, 1 meta), 6 Widgets, | ||
77 | * 2 Midplanes assuming no pci card cages | ||
78 | */ | ||
79 | #define MAX_SLOTS_PER_NODE (1 + 2 + 6 + 2) | ||
80 | |||
81 | /* XXX if each node is guranteed to have some memory */ | ||
82 | |||
83 | #define MAX_PCI_DEVS 8 | ||
84 | |||
85 | /* lboard_t->brd_flags fields */ | ||
86 | /* All bits in this field are currently used. Try the pad fields if | ||
87 | you need more flag bits */ | ||
88 | |||
89 | #define ENABLE_BOARD 0x01 | ||
90 | #define FAILED_BOARD 0x02 | ||
91 | #define DUPLICATE_BOARD 0x04 /* Boards like midplanes/routers which | ||
92 | are discovered twice. Use one of them */ | ||
93 | #define VISITED_BOARD 0x08 /* Used for compact hub numbering. */ | ||
94 | #define LOCAL_MASTER_IO6 0x10 /* master io6 for that node */ | ||
95 | #define GLOBAL_MASTER_IO6 0x20 | ||
96 | #define THIRD_NIC_PRESENT 0x40 /* for future use */ | ||
97 | #define SECOND_NIC_PRESENT 0x80 /* addons like MIO are present */ | ||
98 | |||
99 | /* klinfo->flags fields */ | ||
100 | |||
101 | #define KLINFO_ENABLE 0x01 /* This component is enabled */ | ||
102 | #define KLINFO_FAILED 0x02 /* This component failed */ | ||
103 | #define KLINFO_DEVICE 0x04 /* This component is a device */ | ||
104 | #define KLINFO_VISITED 0x08 /* This component has been visited */ | ||
105 | #define KLINFO_CONTROLLER 0x10 /* This component is a device controller */ | ||
106 | #define KLINFO_INSTALL 0x20 /* Install a driver */ | ||
107 | #define KLINFO_HEADLESS 0x40 /* Headless (or hubless) component */ | ||
108 | #define IS_CONSOLE_IOC3(i) ((((klinfo_t *)i)->flags) & KLINFO_INSTALL) | ||
109 | |||
110 | #define GB2 0x80000000 | ||
111 | |||
112 | #define MAX_RSV_PTRS 32 | ||
113 | |||
114 | /* Structures to manage various data storage areas */ | ||
115 | /* The numbers must be contiguous since the array index i | ||
116 | is used in the code to allocate various areas. | ||
117 | */ | ||
118 | |||
119 | #define BOARD_STRUCT 0 | ||
120 | #define COMPONENT_STRUCT 1 | ||
121 | #define ERRINFO_STRUCT 2 | ||
122 | #define KLMALLOC_TYPE_MAX (ERRINFO_STRUCT + 1) | ||
123 | #define DEVICE_STRUCT 3 | ||
124 | |||
125 | |||
126 | typedef struct console_s { | ||
127 | unsigned long uart_base; | ||
128 | unsigned long config_base; | ||
129 | unsigned long memory_base; | ||
130 | short baud; | ||
131 | short flag; | ||
132 | int type; | ||
133 | nasid_t nasid; | ||
134 | char wid; | ||
135 | char npci; | ||
136 | nic_t baseio_nic; | ||
137 | } console_t; | ||
138 | |||
139 | typedef struct klc_malloc_hdr { | ||
140 | klconf_off_t km_base; | ||
141 | klconf_off_t km_limit; | ||
142 | klconf_off_t km_current; | ||
143 | } klc_malloc_hdr_t; | ||
144 | |||
145 | /* Functions/macros needed to use this structure */ | ||
146 | |||
147 | typedef struct kl_config_hdr { | ||
148 | u64 ch_magic; /* set this to KLCFGINFO_MAGIC */ | ||
149 | u32 ch_version; /* structure version number */ | ||
150 | klconf_off_t ch_malloc_hdr_off; /* offset of ch_malloc_hdr */ | ||
151 | klconf_off_t ch_cons_off; /* offset of ch_cons */ | ||
152 | klconf_off_t ch_board_info; /* the link list of boards */ | ||
153 | console_t ch_cons_info; /* address info of the console */ | ||
154 | klc_malloc_hdr_t ch_malloc_hdr[KLMALLOC_TYPE_MAX]; | ||
155 | confidence_t ch_sw_belief; /* confidence that software is bad*/ | ||
156 | confidence_t ch_sn0net_belief; /* confidence that sn0net is bad */ | ||
157 | } kl_config_hdr_t; | ||
158 | |||
159 | |||
160 | #define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid))) | ||
161 | #define KL_CONFIG_INFO_OFFSET(_nasid) \ | ||
162 | (KL_CONFIG_HDR(_nasid)->ch_board_info) | ||
163 | #define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off) \ | ||
164 | (KL_CONFIG_HDR(_nasid)->ch_board_info = (_off)) | ||
165 | |||
166 | #define KL_CONFIG_INFO(_nasid) \ | ||
167 | (lboard_t *)((KL_CONFIG_HDR(_nasid)->ch_board_info) ? \ | ||
168 | NODE_OFFSET_TO_K1((_nasid), KL_CONFIG_HDR(_nasid)->ch_board_info) : \ | ||
169 | 0) | ||
170 | #define KL_CONFIG_MAGIC(_nasid) (KL_CONFIG_HDR(_nasid)->ch_magic) | ||
171 | |||
172 | #define KL_CONFIG_CHECK_MAGIC(_nasid) \ | ||
173 | (KL_CONFIG_HDR(_nasid)->ch_magic == KLCFGINFO_MAGIC) | ||
174 | |||
175 | #define KL_CONFIG_HDR_INIT_MAGIC(_nasid) \ | ||
176 | (KL_CONFIG_HDR(_nasid)->ch_magic = KLCFGINFO_MAGIC) | ||
177 | |||
178 | /* --- New Macros for the changed kl_config_hdr_t structure --- */ | ||
179 | |||
180 | #define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\ | ||
181 | ((unsigned long)_k + (_k->ch_malloc_hdr_off))) | ||
182 | |||
183 | #define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n)) | ||
184 | |||
185 | #define PTR_CH_CONS_INFO(_k) ((console_t *)\ | ||
186 | ((unsigned long)_k + (_k->ch_cons_off))) | ||
187 | |||
188 | #define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n)) | ||
189 | |||
190 | /* ------------------------------------------------------------- */ | ||
191 | |||
192 | #define KL_CONFIG_INFO_START(_nasid) \ | ||
193 | (klconf_off_t)(KLCONFIG_OFFSET(_nasid) + sizeof(kl_config_hdr_t)) | ||
194 | |||
195 | #define KL_CONFIG_BOARD_NASID(_brd) ((_brd)->brd_nasid) | ||
196 | #define KL_CONFIG_BOARD_SET_NEXT(_brd, _off) ((_brd)->brd_next = (_off)) | ||
197 | |||
198 | #define KL_CONFIG_DUPLICATE_BOARD(_brd) ((_brd)->brd_flags & DUPLICATE_BOARD) | ||
199 | |||
200 | #define XBOW_PORT_TYPE_HUB(_xbowp, _link) \ | ||
201 | ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_HUB) | ||
202 | #define XBOW_PORT_TYPE_IO(_xbowp, _link) \ | ||
203 | ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_IO) | ||
204 | |||
205 | #define XBOW_PORT_IS_ENABLED(_xbowp, _link) \ | ||
206 | ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_ENABLE) | ||
207 | #define XBOW_PORT_NASID(_xbowp, _link) \ | ||
208 | ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_nasid) | ||
209 | |||
210 | #define XBOW_PORT_IO 0x1 | ||
211 | #define XBOW_PORT_HUB 0x2 | ||
212 | #define XBOW_PORT_ENABLE 0x4 | ||
213 | |||
214 | #define SN0_PORT_FENCE_SHFT 0 | ||
215 | #define SN0_PORT_FENCE_MASK (1 << SN0_PORT_FENCE_SHFT) | ||
216 | |||
217 | /* | ||
218 | * The KLCONFIG area is organized as a LINKED LIST of BOARDs. A BOARD | ||
219 | * can be either 'LOCAL' or 'REMOTE'. LOCAL means it is attached to | ||
220 | * the LOCAL/current NODE. REMOTE means it is attached to a different | ||
221 | * node.(TBD - Need a way to treat ROUTER boards.) | ||
222 | * | ||
223 | * There are 2 different structures to represent these boards - | ||
224 | * lboard - Local board, rboard - remote board. These 2 structures | ||
225 | * can be arbitrarily mixed in the LINKED LIST of BOARDs. (Refer | ||
226 | * Figure below). The first byte of the rboard or lboard structure | ||
227 | * is used to find out its type - no unions are used. | ||
228 | * If it is a lboard, then the config info of this board will be found | ||
229 | * on the local node. (LOCAL NODE BASE + offset value gives pointer to | ||
230 | * the structure. | ||
231 | * If it is a rboard, the local structure contains the node number | ||
232 | * and the offset of the beginning of the LINKED LIST on the remote node. | ||
233 | * The details of the hardware on a remote node can be built locally, | ||
234 | * if required, by reading the LINKED LIST on the remote node and | ||
235 | * ignoring all the rboards on that node. | ||
236 | * | ||
237 | * The local node uses the REMOTE NODE NUMBER + OFFSET to point to the | ||
238 | * First board info on the remote node. The remote node list is | ||
239 | * traversed as the local list, using the REMOTE BASE ADDRESS and not | ||
240 | * the local base address and ignoring all rboard values. | ||
241 | * | ||
242 | * | ||
243 | KLCONFIG | ||
244 | |||
245 | +------------+ +------------+ +------------+ +------------+ | ||
246 | | lboard | +-->| lboard | +-->| rboard | +-->| lboard | | ||
247 | +------------+ | +------------+ | +------------+ | +------------+ | ||
248 | | board info | | | board info | | |errinfo,bptr| | | board info | | ||
249 | +------------+ | +------------+ | +------------+ | +------------+ | ||
250 | | offset |--+ | offset |--+ | offset |--+ |offset=NULL | | ||
251 | +------------+ +------------+ +------------+ +------------+ | ||
252 | |||
253 | |||
254 | +------------+ | ||
255 | | board info | | ||
256 | +------------+ +--------------------------------+ | ||
257 | | compt 1 |------>| type, rev, diaginfo, size ... | (CPU) | ||
258 | +------------+ +--------------------------------+ | ||
259 | | compt 2 |--+ | ||
260 | +------------+ | +--------------------------------+ | ||
261 | | ... | +--->| type, rev, diaginfo, size ... | (MEM_BANK) | ||
262 | +------------+ +--------------------------------+ | ||
263 | | errinfo |--+ | ||
264 | +------------+ | +--------------------------------+ | ||
265 | +--->|r/l brd errinfo,compt err flags | | ||
266 | +--------------------------------+ | ||
267 | |||
268 | * | ||
269 | * Each BOARD consists of COMPONENTs and the BOARD structure has | ||
270 | * pointers (offsets) to its COMPONENT structure. | ||
271 | * The COMPONENT structure has version info, size and speed info, revision, | ||
272 | * error info and the NIC info. This structure can accommodate any | ||
273 | * BOARD with arbitrary COMPONENT composition. | ||
274 | * | ||
275 | * The ERRORINFO part of each BOARD has error information | ||
276 | * that describes errors about the BOARD itself. It also has flags to | ||
277 | * indicate the COMPONENT(s) on the board that have errors. The error | ||
278 | * information specific to the COMPONENT is present in the respective | ||
279 | * COMPONENT structure. | ||
280 | * | ||
281 | * The ERRORINFO structure is also treated like a COMPONENT, ie. the | ||
282 | * BOARD has pointers(offset) to the ERRORINFO structure. The rboard | ||
283 | * structure also has a pointer to the ERRORINFO structure. This is | ||
284 | * the place to store ERRORINFO about a REMOTE NODE, if the HUB on | ||
285 | * that NODE is not working or if the REMOTE MEMORY is BAD. In cases where | ||
286 | * only the CPU of the REMOTE NODE is disabled, the ERRORINFO pointer can | ||
287 | * be a NODE NUMBER, REMOTE OFFSET combination, pointing to error info | ||
288 | * which is present on the REMOTE NODE.(TBD) | ||
289 | * REMOTE ERRINFO can be stored on any of the nearest nodes | ||
290 | * or on all the nearest nodes.(TBD) | ||
291 | * Like BOARD structures, REMOTE ERRINFO structures can be built locally | ||
292 | * using the rboard errinfo pointer. | ||
293 | * | ||
294 | * In order to get useful information from this Data organization, a set of | ||
295 | * interface routines are provided (TBD). The important thing to remember while | ||
296 | * manipulating the structures, is that, the NODE number information should | ||
297 | * be used. If the NODE is non-zero (remote) then each offset should | ||
298 | * be added to the REMOTE BASE ADDR else it should be added to the LOCAL BASE ADDR. | ||
299 | * This includes offsets for BOARDS, COMPONENTS and ERRORINFO. | ||
300 | * | ||
301 | * Note that these structures do not provide much info about connectivity. | ||
302 | * That info will be part of HWGRAPH, which is an extension of the cfg_t | ||
303 | * data structure. (ref IP27prom/cfg.h) It has to be extended to include | ||
304 | * the IO part of the Network(TBD). | ||
305 | * | ||
306 | * The data structures below define the above concepts. | ||
307 | */ | ||
308 | |||
309 | /* | ||
310 | * Values for CPU types | ||
311 | */ | ||
312 | #define KL_CPU_R4000 0x1 /* Standard R4000 */ | ||
313 | #define KL_CPU_TFP 0x2 /* TFP processor */ | ||
314 | #define KL_CPU_R10000 0x3 /* R10000 (T5) */ | ||
315 | #define KL_CPU_NONE (-1) /* no cpu present in slot */ | ||
316 | |||
317 | /* | ||
318 | * IP27 BOARD classes | ||
319 | */ | ||
320 | |||
321 | #define KLCLASS_MASK 0xf0 | ||
322 | #define KLCLASS_NONE 0x00 | ||
323 | #define KLCLASS_NODE 0x10 /* CPU, Memory and HUB board */ | ||
324 | #define KLCLASS_CPU KLCLASS_NODE | ||
325 | #define KLCLASS_IO 0x20 /* BaseIO, 4 ch SCSI, ethernet, FDDI | ||
326 | and the non-graphics widget boards */ | ||
327 | #define KLCLASS_ROUTER 0x30 /* Router board */ | ||
328 | #define KLCLASS_MIDPLANE 0x40 /* We need to treat this as a board | ||
329 | so that we can record error info */ | ||
330 | #define KLCLASS_GFX 0x50 /* graphics boards */ | ||
331 | |||
332 | #define KLCLASS_PSEUDO_GFX 0x60 /* HDTV type cards that use a gfx | ||
333 | * hw ifc to xtalk and are not gfx | ||
334 | * class for sw purposes */ | ||
335 | |||
336 | #define KLCLASS_MAX 7 /* Bump this if a new CLASS is added */ | ||
337 | #define KLTYPE_MAX 10 /* Bump this if a new CLASS is added */ | ||
338 | |||
339 | #define KLCLASS_UNKNOWN 0xf0 | ||
340 | |||
341 | #define KLCLASS(_x) ((_x) & KLCLASS_MASK) | ||
342 | |||
343 | /* | ||
344 | * IP27 board types | ||
345 | */ | ||
346 | |||
347 | #define KLTYPE_MASK 0x0f | ||
348 | #define KLTYPE_NONE 0x00 | ||
349 | #define KLTYPE_EMPTY 0x00 | ||
350 | |||
351 | #define KLTYPE_WEIRDCPU (KLCLASS_CPU | 0x0) | ||
352 | #define KLTYPE_IP27 (KLCLASS_CPU | 0x1) /* 2 CPUs(R10K) per board */ | ||
353 | |||
354 | #define KLTYPE_WEIRDIO (KLCLASS_IO | 0x0) | ||
355 | #define KLTYPE_BASEIO (KLCLASS_IO | 0x1) /* IOC3, SuperIO, Bridge, SCSI */ | ||
356 | #define KLTYPE_IO6 KLTYPE_BASEIO /* Additional name */ | ||
357 | #define KLTYPE_4CHSCSI (KLCLASS_IO | 0x2) | ||
358 | #define KLTYPE_MSCSI KLTYPE_4CHSCSI /* Additional name */ | ||
359 | #define KLTYPE_ETHERNET (KLCLASS_IO | 0x3) | ||
360 | #define KLTYPE_MENET KLTYPE_ETHERNET /* Additional name */ | ||
361 | #define KLTYPE_FDDI (KLCLASS_IO | 0x4) | ||
362 | #define KLTYPE_UNUSED (KLCLASS_IO | 0x5) /* XXX UNUSED */ | ||
363 | #define KLTYPE_HAROLD (KLCLASS_IO | 0x6) /* PCI SHOE BOX */ | ||
364 | #define KLTYPE_PCI KLTYPE_HAROLD | ||
365 | #define KLTYPE_VME (KLCLASS_IO | 0x7) /* Any 3rd party VME card */ | ||
366 | #define KLTYPE_MIO (KLCLASS_IO | 0x8) | ||
367 | #define KLTYPE_FC (KLCLASS_IO | 0x9) | ||
368 | #define KLTYPE_LINC (KLCLASS_IO | 0xA) | ||
369 | #define KLTYPE_TPU (KLCLASS_IO | 0xB) /* Tensor Processing Unit */ | ||
370 | #define KLTYPE_GSN_A (KLCLASS_IO | 0xC) /* Main GSN board */ | ||
371 | #define KLTYPE_GSN_B (KLCLASS_IO | 0xD) /* Auxiliary GSN board */ | ||
372 | |||
373 | #define KLTYPE_GFX (KLCLASS_GFX | 0x0) /* unknown graphics type */ | ||
374 | #define KLTYPE_GFX_KONA (KLCLASS_GFX | 0x1) /* KONA graphics on IP27 */ | ||
375 | #define KLTYPE_GFX_MGRA (KLCLASS_GFX | 0x3) /* MGRAS graphics on IP27 */ | ||
376 | |||
377 | #define KLTYPE_WEIRDROUTER (KLCLASS_ROUTER | 0x0) | ||
378 | #define KLTYPE_ROUTER (KLCLASS_ROUTER | 0x1) | ||
379 | #define KLTYPE_ROUTER2 KLTYPE_ROUTER /* Obsolete! */ | ||
380 | #define KLTYPE_NULL_ROUTER (KLCLASS_ROUTER | 0x2) | ||
381 | #define KLTYPE_META_ROUTER (KLCLASS_ROUTER | 0x3) | ||
382 | |||
383 | #define KLTYPE_WEIRDMIDPLANE (KLCLASS_MIDPLANE | 0x0) | ||
384 | #define KLTYPE_MIDPLANE8 (KLCLASS_MIDPLANE | 0x1) /* 8 slot backplane */ | ||
385 | #define KLTYPE_MIDPLANE KLTYPE_MIDPLANE8 | ||
386 | #define KLTYPE_PBRICK_XBOW (KLCLASS_MIDPLANE | 0x2) | ||
387 | |||
388 | #define KLTYPE_IOBRICK (KLCLASS_IOBRICK | 0x0) | ||
389 | #define KLTYPE_IBRICK (KLCLASS_IOBRICK | 0x1) | ||
390 | #define KLTYPE_PBRICK (KLCLASS_IOBRICK | 0x2) | ||
391 | #define KLTYPE_XBRICK (KLCLASS_IOBRICK | 0x3) | ||
392 | |||
393 | #define KLTYPE_PBRICK_BRIDGE KLTYPE_PBRICK | ||
394 | |||
395 | /* The value of type should be more than 8 so that hinv prints | ||
396 | * out the board name from the NIC string. For values less than | ||
397 | * 8 the name of the board needs to be hard coded in a few places. | ||
398 | * When bringup started nic names had not standardized and so we | ||
399 | * had to hard code. (For people interested in history.) | ||
400 | */ | ||
401 | #define KLTYPE_XTHD (KLCLASS_PSEUDO_GFX | 0x9) | ||
402 | |||
403 | #define KLTYPE_UNKNOWN (KLCLASS_UNKNOWN | 0xf) | ||
404 | |||
405 | #define KLTYPE(_x) ((_x) & KLTYPE_MASK) | ||
406 | #define IS_MIO_PRESENT(l) ((l->brd_type == KLTYPE_BASEIO) && \ | ||
407 | (l->brd_flags & SECOND_NIC_PRESENT)) | ||
408 | #define IS_MIO_IOC3(l, n) (IS_MIO_PRESENT(l) && (n > 2)) | ||
409 | |||
410 | /* | ||
411 | * board structures | ||
412 | */ | ||
413 | |||
414 | #define MAX_COMPTS_PER_BRD 24 | ||
415 | |||
416 | #define LOCAL_BOARD 1 | ||
417 | #define REMOTE_BOARD 2 | ||
418 | |||
419 | #define LBOARD_STRUCT_VERSION 2 | ||
420 | |||
421 | typedef struct lboard_s { | ||
422 | klconf_off_t brd_next; /* Next BOARD */ | ||
423 | unsigned char struct_type; /* type of structure, local or remote */ | ||
424 | unsigned char brd_type; /* type+class */ | ||
425 | unsigned char brd_sversion; /* version of this structure */ | ||
426 | unsigned char brd_brevision; /* board revision */ | ||
427 | unsigned char brd_promver; /* board prom version, if any */ | ||
428 | unsigned char brd_flags; /* Enabled, Disabled etc */ | ||
429 | unsigned char brd_slot; /* slot number */ | ||
430 | unsigned short brd_debugsw; /* Debug switches */ | ||
431 | moduleid_t brd_module; /* module to which it belongs */ | ||
432 | partid_t brd_partition; /* Partition number */ | ||
433 | unsigned short brd_diagval; /* diagnostic value */ | ||
434 | unsigned short brd_diagparm; /* diagnostic parameter */ | ||
435 | unsigned char brd_inventory; /* inventory history */ | ||
436 | unsigned char brd_numcompts; /* Number of components */ | ||
437 | nic_t brd_nic; /* Number in CAN */ | ||
438 | nasid_t brd_nasid; /* passed parameter */ | ||
439 | klconf_off_t brd_compts[MAX_COMPTS_PER_BRD]; /* pointers to COMPONENTS */ | ||
440 | klconf_off_t brd_errinfo; /* Board's error information */ | ||
441 | struct lboard_s *brd_parent; /* Logical parent for this brd */ | ||
442 | vertex_hdl_t brd_graph_link; /* vertex hdl to connect extern compts */ | ||
443 | confidence_t brd_confidence; /* confidence that the board is bad */ | ||
444 | nasid_t brd_owner; /* who owns this board */ | ||
445 | unsigned char brd_nic_flags; /* To handle 8 more NICs */ | ||
446 | char brd_name[32]; | ||
447 | } lboard_t; | ||
448 | |||
449 | |||
450 | /* | ||
451 | * Make sure we pass back the calias space address for local boards. | ||
452 | * klconfig board traversal and error structure extraction defines. | ||
453 | */ | ||
454 | |||
455 | #define BOARD_SLOT(_brd) ((_brd)->brd_slot) | ||
456 | |||
457 | #define KLCF_CLASS(_brd) KLCLASS((_brd)->brd_type) | ||
458 | #define KLCF_TYPE(_brd) KLTYPE((_brd)->brd_type) | ||
459 | #define KLCF_REMOTE(_brd) (((_brd)->struct_type & LOCAL_BOARD) ? 0 : 1) | ||
460 | #define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts) | ||
461 | #define KLCF_MODULE_ID(_brd) ((_brd)->brd_module) | ||
462 | |||
463 | #define KLCF_NEXT(_brd) \ | ||
464 | ((_brd)->brd_next ? \ | ||
465 | (lboard_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), (_brd)->brd_next)):\ | ||
466 | NULL) | ||
467 | #define KLCF_COMP(_brd, _ndx) \ | ||
468 | (klinfo_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), \ | ||
469 | (_brd)->brd_compts[(_ndx)])) | ||
470 | |||
471 | #define KLCF_COMP_ERROR(_brd, _comp) \ | ||
472 | (NODE_OFFSET_TO_K1(NASID_GET(_brd), (_comp)->errinfo)) | ||
473 | |||
474 | #define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type) | ||
475 | #define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */ | ||
476 | |||
477 | |||
478 | |||
479 | /* | ||
480 | * Generic info structure. This stores common info about a | ||
481 | * component. | ||
482 | */ | ||
483 | |||
484 | typedef struct klinfo_s { /* Generic info */ | ||
485 | unsigned char struct_type; /* type of this structure */ | ||
486 | unsigned char struct_version; /* version of this structure */ | ||
487 | unsigned char flags; /* Enabled, disabled etc */ | ||
488 | unsigned char revision; /* component revision */ | ||
489 | unsigned short diagval; /* result of diagnostics */ | ||
490 | unsigned short diagparm; /* diagnostic parameter */ | ||
491 | unsigned char inventory; /* previous inventory status */ | ||
492 | nic_t nic; /* MUst be aligned properly */ | ||
493 | unsigned char physid; /* physical id of component */ | ||
494 | unsigned int virtid; /* virtual id as seen by system */ | ||
495 | unsigned char widid; /* Widget id - if applicable */ | ||
496 | nasid_t nasid; /* node number - from parent */ | ||
497 | char pad1; /* pad out structure. */ | ||
498 | char pad2; /* pad out structure. */ | ||
499 | COMPONENT *arcs_compt; /* ptr to the arcs struct for ease*/ | ||
500 | klconf_off_t errinfo; /* component specific errors */ | ||
501 | unsigned short pad3; /* pci fields have moved over to */ | ||
502 | unsigned short pad4; /* klbri_t */ | ||
503 | } klinfo_t ; | ||
504 | |||
505 | #define KLCONFIG_INFO_ENABLED(_i) ((_i)->flags & KLINFO_ENABLE) | ||
506 | /* | ||
507 | * Component structures. | ||
508 | * Following are the currently identified components: | ||
509 | * CPU, HUB, MEM_BANK, | ||
510 | * XBOW(consists of 16 WIDGETs, each of which can be HUB or GRAPHICS or BRIDGE) | ||
511 | * BRIDGE, IOC3, SuperIO, SCSI, FDDI | ||
512 | * ROUTER | ||
513 | * GRAPHICS | ||
514 | */ | ||
515 | #define KLSTRUCT_UNKNOWN 0 | ||
516 | #define KLSTRUCT_CPU 1 | ||
517 | #define KLSTRUCT_HUB 2 | ||
518 | #define KLSTRUCT_MEMBNK 3 | ||
519 | #define KLSTRUCT_XBOW 4 | ||
520 | #define KLSTRUCT_BRI 5 | ||
521 | #define KLSTRUCT_IOC3 6 | ||
522 | #define KLSTRUCT_PCI 7 | ||
523 | #define KLSTRUCT_VME 8 | ||
524 | #define KLSTRUCT_ROU 9 | ||
525 | #define KLSTRUCT_GFX 10 | ||
526 | #define KLSTRUCT_SCSI 11 | ||
527 | #define KLSTRUCT_FDDI 12 | ||
528 | #define KLSTRUCT_MIO 13 | ||
529 | #define KLSTRUCT_DISK 14 | ||
530 | #define KLSTRUCT_TAPE 15 | ||
531 | #define KLSTRUCT_CDROM 16 | ||
532 | #define KLSTRUCT_HUB_UART 17 | ||
533 | #define KLSTRUCT_IOC3ENET 18 | ||
534 | #define KLSTRUCT_IOC3UART 19 | ||
535 | #define KLSTRUCT_UNUSED 20 /* XXX UNUSED */ | ||
536 | #define KLSTRUCT_IOC3PCKM 21 | ||
537 | #define KLSTRUCT_RAD 22 | ||
538 | #define KLSTRUCT_HUB_TTY 23 | ||
539 | #define KLSTRUCT_IOC3_TTY 24 | ||
540 | |||
541 | /* Early Access IO proms are compatible | ||
542 | only with KLSTRUCT values upto 24. */ | ||
543 | |||
544 | #define KLSTRUCT_FIBERCHANNEL 25 | ||
545 | #define KLSTRUCT_MOD_SERIAL_NUM 26 | ||
546 | #define KLSTRUCT_IOC3MS 27 | ||
547 | #define KLSTRUCT_TPU 28 | ||
548 | #define KLSTRUCT_GSN_A 29 | ||
549 | #define KLSTRUCT_GSN_B 30 | ||
550 | #define KLSTRUCT_XTHD 31 | ||
551 | |||
552 | /* | ||
553 | * These are the indices of various components within a lboard structure. | ||
554 | */ | ||
555 | |||
556 | #define IP27_CPU0_INDEX 0 | ||
557 | #define IP27_CPU1_INDEX 1 | ||
558 | #define IP27_HUB_INDEX 2 | ||
559 | #define IP27_MEM_INDEX 3 | ||
560 | |||
561 | #define BASEIO_BRIDGE_INDEX 0 | ||
562 | #define BASEIO_IOC3_INDEX 1 | ||
563 | #define BASEIO_SCSI1_INDEX 2 | ||
564 | #define BASEIO_SCSI2_INDEX 3 | ||
565 | |||
566 | #define MIDPLANE_XBOW_INDEX 0 | ||
567 | #define ROUTER_COMPONENT_INDEX 0 | ||
568 | |||
569 | #define CH4SCSI_BRIDGE_INDEX 0 | ||
570 | |||
571 | /* Info holders for various hardware components */ | ||
572 | |||
573 | typedef u64 *pci_t; | ||
574 | typedef u64 *vmeb_t; | ||
575 | typedef u64 *vmed_t; | ||
576 | typedef u64 *fddi_t; | ||
577 | typedef u64 *scsi_t; | ||
578 | typedef u64 *mio_t; | ||
579 | typedef u64 *graphics_t; | ||
580 | typedef u64 *router_t; | ||
581 | |||
582 | /* | ||
583 | * The port info in ip27_cfg area translates to a lboart_t in the | ||
584 | * KLCONFIG area. But since KLCONFIG does not use pointers, lboart_t | ||
585 | * is stored in terms of a nasid and a offset from start of KLCONFIG | ||
586 | * area on that nasid. | ||
587 | */ | ||
588 | typedef struct klport_s { | ||
589 | nasid_t port_nasid; | ||
590 | unsigned char port_flag; | ||
591 | klconf_off_t port_offset; | ||
592 | } klport_t; | ||
593 | |||
594 | typedef struct klcpu_s { /* CPU */ | ||
595 | klinfo_t cpu_info; | ||
596 | unsigned short cpu_prid; /* Processor PRID value */ | ||
597 | unsigned short cpu_fpirr; /* FPU IRR value */ | ||
598 | unsigned short cpu_speed; /* Speed in MHZ */ | ||
599 | unsigned short cpu_scachesz; /* secondary cache size in MB */ | ||
600 | unsigned short cpu_scachespeed;/* secondary cache speed in MHz */ | ||
601 | } klcpu_t ; | ||
602 | |||
603 | #define CPU_STRUCT_VERSION 2 | ||
604 | |||
605 | typedef struct klhub_s { /* HUB */ | ||
606 | klinfo_t hub_info; | ||
607 | unsigned int hub_flags; /* PCFG_HUB_xxx flags */ | ||
608 | klport_t hub_port; /* hub is connected to this */ | ||
609 | nic_t hub_box_nic; /* nic of containing box */ | ||
610 | klconf_off_t hub_mfg_nic; /* MFG NIC string */ | ||
611 | u64 hub_speed; /* Speed of hub in HZ */ | ||
612 | } klhub_t ; | ||
613 | |||
614 | typedef struct klhub_uart_s { /* HUB */ | ||
615 | klinfo_t hubuart_info; | ||
616 | unsigned int hubuart_flags; /* PCFG_HUB_xxx flags */ | ||
617 | nic_t hubuart_box_nic; /* nic of containing box */ | ||
618 | } klhub_uart_t ; | ||
619 | |||
620 | #define MEMORY_STRUCT_VERSION 2 | ||
621 | |||
622 | typedef struct klmembnk_s { /* MEMORY BANK */ | ||
623 | klinfo_t membnk_info; | ||
624 | short membnk_memsz; /* Total memory in megabytes */ | ||
625 | short membnk_dimm_select; /* bank to physical addr mapping*/ | ||
626 | short membnk_bnksz[MD_MEM_BANKS]; /* Memory bank sizes */ | ||
627 | short membnk_attr; | ||
628 | } klmembnk_t ; | ||
629 | |||
630 | #define KLCONFIG_MEMBNK_SIZE(_info, _bank) \ | ||
631 | ((_info)->membnk_bnksz[(_bank)]) | ||
632 | |||
633 | |||
634 | #define MEMBNK_PREMIUM 1 | ||
635 | #define KLCONFIG_MEMBNK_PREMIUM(_info, _bank) \ | ||
636 | ((_info)->membnk_attr & (MEMBNK_PREMIUM << (_bank))) | ||
637 | |||
638 | #define MAX_SERIAL_NUM_SIZE 10 | ||
639 | |||
640 | typedef struct klmod_serial_num_s { | ||
641 | klinfo_t snum_info; | ||
642 | union { | ||
643 | char snum_str[MAX_SERIAL_NUM_SIZE]; | ||
644 | unsigned long long snum_int; | ||
645 | } snum; | ||
646 | } klmod_serial_num_t; | ||
647 | |||
648 | /* Macros needed to access serial number structure in lboard_t. | ||
649 | Hard coded values are necessary since we cannot treat | ||
650 | serial number struct as a component without losing compatibility | ||
651 | between prom versions. */ | ||
652 | |||
653 | #define GET_SNUM_COMP(_l) ((klmod_serial_num_t *)\ | ||
654 | KLCF_COMP(_l, _l->brd_numcompts)) | ||
655 | |||
656 | #define MAX_XBOW_LINKS 16 | ||
657 | |||
658 | typedef struct klxbow_s { /* XBOW */ | ||
659 | klinfo_t xbow_info ; | ||
660 | klport_t xbow_port_info[MAX_XBOW_LINKS] ; /* Module number */ | ||
661 | int xbow_master_hub_link; | ||
662 | /* type of brd connected+component struct ptr+flags */ | ||
663 | } klxbow_t ; | ||
664 | |||
665 | #define MAX_PCI_SLOTS 8 | ||
666 | |||
667 | typedef struct klpci_device_s { | ||
668 | s32 pci_device_id; /* 32 bits of vendor/device ID. */ | ||
669 | s32 pci_device_pad; /* 32 bits of padding. */ | ||
670 | } klpci_device_t; | ||
671 | |||
672 | #define BRIDGE_STRUCT_VERSION 2 | ||
673 | |||
674 | typedef struct klbri_s { /* BRIDGE */ | ||
675 | klinfo_t bri_info ; | ||
676 | unsigned char bri_eprominfo ; /* IO6prom connected to bridge */ | ||
677 | unsigned char bri_bustype ; /* PCI/VME BUS bridge/GIO */ | ||
678 | pci_t pci_specific ; /* PCI Board config info */ | ||
679 | klpci_device_t bri_devices[MAX_PCI_DEVS] ; /* PCI IDs */ | ||
680 | klconf_off_t bri_mfg_nic ; | ||
681 | } klbri_t ; | ||
682 | |||
683 | #define MAX_IOC3_TTY 2 | ||
684 | |||
685 | typedef struct klioc3_s { /* IOC3 */ | ||
686 | klinfo_t ioc3_info ; | ||
687 | unsigned char ioc3_ssram ; /* Info about ssram */ | ||
688 | unsigned char ioc3_nvram ; /* Info about nvram */ | ||
689 | klinfo_t ioc3_superio ; /* Info about superio */ | ||
690 | klconf_off_t ioc3_tty_off ; | ||
691 | klinfo_t ioc3_enet ; | ||
692 | klconf_off_t ioc3_enet_off ; | ||
693 | klconf_off_t ioc3_kbd_off ; | ||
694 | } klioc3_t ; | ||
695 | |||
696 | #define MAX_VME_SLOTS 8 | ||
697 | |||
698 | typedef struct klvmeb_s { /* VME BRIDGE - PCI CTLR */ | ||
699 | klinfo_t vmeb_info ; | ||
700 | vmeb_t vmeb_specific ; | ||
701 | klconf_off_t vmeb_brdinfo[MAX_VME_SLOTS] ; /* VME Board config info */ | ||
702 | } klvmeb_t ; | ||
703 | |||
704 | typedef struct klvmed_s { /* VME DEVICE - VME BOARD */ | ||
705 | klinfo_t vmed_info ; | ||
706 | vmed_t vmed_specific ; | ||
707 | klconf_off_t vmed_brdinfo[MAX_VME_SLOTS] ; /* VME Board config info */ | ||
708 | } klvmed_t ; | ||
709 | |||
710 | #define ROUTER_VECTOR_VERS 2 | ||
711 | |||
712 | /* XXX - Don't we need the number of ports here?!? */ | ||
713 | typedef struct klrou_s { /* ROUTER */ | ||
714 | klinfo_t rou_info ; | ||
715 | unsigned int rou_flags ; /* PCFG_ROUTER_xxx flags */ | ||
716 | nic_t rou_box_nic ; /* nic of the containing module */ | ||
717 | klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */ | ||
718 | klconf_off_t rou_mfg_nic ; /* MFG NIC string */ | ||
719 | u64 rou_vector; /* vector from master node */ | ||
720 | } klrou_t ; | ||
721 | |||
722 | /* | ||
723 | * Graphics Controller/Device | ||
724 | * | ||
725 | * (IP27/IO6) Prom versions 6.13 (and 6.5.1 kernels) and earlier | ||
726 | * used a couple different structures to store graphics information. | ||
727 | * For compatibility reasons, the newer data structure preserves some | ||
728 | * of the layout so that fields that are used in the old versions remain | ||
729 | * in the same place (with the same info). Determination of what version | ||
730 | * of this structure we have is done by checking the cookie field. | ||
731 | */ | ||
732 | #define KLGFX_COOKIE 0x0c0de000 | ||
733 | |||
734 | typedef struct klgfx_s { /* GRAPHICS Device */ | ||
735 | klinfo_t gfx_info; | ||
736 | klconf_off_t old_gndevs; /* for compatibility with older proms */ | ||
737 | klconf_off_t old_gdoff0; /* for compatibility with older proms */ | ||
738 | unsigned int cookie; /* for compatibility with older proms */ | ||
739 | unsigned int moduleslot; | ||
740 | struct klgfx_s *gfx_next_pipe; | ||
741 | graphics_t gfx_specific; | ||
742 | klconf_off_t pad0; /* for compatibility with older proms */ | ||
743 | klconf_off_t gfx_mfg_nic; | ||
744 | } klgfx_t; | ||
745 | |||
746 | typedef struct klxthd_s { | ||
747 | klinfo_t xthd_info ; | ||
748 | klconf_off_t xthd_mfg_nic ; /* MFG NIC string */ | ||
749 | } klxthd_t ; | ||
750 | |||
751 | typedef struct kltpu_s { /* TPU board */ | ||
752 | klinfo_t tpu_info ; | ||
753 | klconf_off_t tpu_mfg_nic ; /* MFG NIC string */ | ||
754 | } kltpu_t ; | ||
755 | |||
756 | typedef struct klgsn_s { /* GSN board */ | ||
757 | klinfo_t gsn_info ; | ||
758 | klconf_off_t gsn_mfg_nic ; /* MFG NIC string */ | ||
759 | } klgsn_t ; | ||
760 | |||
761 | #define MAX_SCSI_DEVS 16 | ||
762 | |||
763 | /* | ||
764 | * NOTE: THis is the max sized kl* structure and is used in klmalloc.c | ||
765 | * to allocate space of type COMPONENT. Make sure that if the size of | ||
766 | * any other component struct becomes more than this, then redefine | ||
767 | * that as the size to be klmalloced. | ||
768 | */ | ||
769 | |||
770 | typedef struct klscsi_s { /* SCSI Controller */ | ||
771 | klinfo_t scsi_info ; | ||
772 | scsi_t scsi_specific ; | ||
773 | unsigned char scsi_numdevs ; | ||
774 | klconf_off_t scsi_devinfo[MAX_SCSI_DEVS] ; | ||
775 | } klscsi_t ; | ||
776 | |||
777 | typedef struct klscdev_s { /* SCSI device */ | ||
778 | klinfo_t scdev_info ; | ||
779 | struct scsidisk_data *scdev_cfg ; /* driver fills up this */ | ||
780 | } klscdev_t ; | ||
781 | |||
782 | typedef struct klttydev_s { /* TTY device */ | ||
783 | klinfo_t ttydev_info ; | ||
784 | struct terminal_data *ttydev_cfg ; /* driver fills up this */ | ||
785 | } klttydev_t ; | ||
786 | |||
787 | typedef struct klenetdev_s { /* ENET device */ | ||
788 | klinfo_t enetdev_info ; | ||
789 | struct net_data *enetdev_cfg ; /* driver fills up this */ | ||
790 | } klenetdev_t ; | ||
791 | |||
792 | typedef struct klkbddev_s { /* KBD device */ | ||
793 | klinfo_t kbddev_info ; | ||
794 | struct keyboard_data *kbddev_cfg ; /* driver fills up this */ | ||
795 | } klkbddev_t ; | ||
796 | |||
797 | typedef struct klmsdev_s { /* mouse device */ | ||
798 | klinfo_t msdev_info ; | ||
799 | void *msdev_cfg ; | ||
800 | } klmsdev_t ; | ||
801 | |||
802 | #define MAX_FDDI_DEVS 10 /* XXX Is this true */ | ||
803 | |||
804 | typedef struct klfddi_s { /* FDDI */ | ||
805 | klinfo_t fddi_info ; | ||
806 | fddi_t fddi_specific ; | ||
807 | klconf_off_t fddi_devinfo[MAX_FDDI_DEVS] ; | ||
808 | } klfddi_t ; | ||
809 | |||
810 | typedef struct klmio_s { /* MIO */ | ||
811 | klinfo_t mio_info ; | ||
812 | mio_t mio_specific ; | ||
813 | } klmio_t ; | ||
814 | |||
815 | |||
816 | typedef union klcomp_s { | ||
817 | klcpu_t kc_cpu; | ||
818 | klhub_t kc_hub; | ||
819 | klmembnk_t kc_mem; | ||
820 | klxbow_t kc_xbow; | ||
821 | klbri_t kc_bri; | ||
822 | klioc3_t kc_ioc3; | ||
823 | klvmeb_t kc_vmeb; | ||
824 | klvmed_t kc_vmed; | ||
825 | klrou_t kc_rou; | ||
826 | klgfx_t kc_gfx; | ||
827 | klscsi_t kc_scsi; | ||
828 | klscdev_t kc_scsi_dev; | ||
829 | klfddi_t kc_fddi; | ||
830 | klmio_t kc_mio; | ||
831 | klmod_serial_num_t kc_snum ; | ||
832 | } klcomp_t; | ||
833 | |||
834 | typedef union kldev_s { /* for device structure allocation */ | ||
835 | klscdev_t kc_scsi_dev ; | ||
836 | klttydev_t kc_tty_dev ; | ||
837 | klenetdev_t kc_enet_dev ; | ||
838 | klkbddev_t kc_kbd_dev ; | ||
839 | } kldev_t ; | ||
840 | |||
841 | /* Data structure interface routines. TBD */ | ||
842 | |||
843 | /* Include launch info in this file itself? TBD */ | ||
844 | |||
845 | /* | ||
846 | * TBD - Can the ARCS and device driver related info also be included in the | ||
847 | * KLCONFIG area. On the IO4PROM, prom device driver info is part of cfgnode_t | ||
848 | * structure, viz private to the IO4prom. | ||
849 | */ | ||
850 | |||
851 | /* | ||
852 | * TBD - Allocation issues. | ||
853 | * | ||
854 | * Do we need to Mark off sepatate heaps for lboard_t, rboard_t, component, | ||
855 | * errinfo and allocate from them, or have a single heap and allocate all | ||
856 | * structures from it. Debug is easier in the former method since we can | ||
857 | * dump all similar structs in one command, but there will be lots of holes, | ||
858 | * in memory and max limits are needed for number of structures. | ||
859 | * Another way to make it organized, is to have a union of all components | ||
860 | * and allocate a aligned chunk of memory greater than the biggest | ||
861 | * component. | ||
862 | */ | ||
863 | |||
864 | typedef union { | ||
865 | lboard_t *lbinfo ; | ||
866 | } biptr_t ; | ||
867 | |||
868 | |||
869 | #define BRI_PER_XBOW 6 | ||
870 | #define PCI_PER_BRI 8 | ||
871 | #define DEV_PER_PCI 16 | ||
872 | |||
873 | |||
874 | /* Virtual dipswitch values (starting from switch "7"): */ | ||
875 | |||
876 | #define VDS_NOGFX 0x8000 /* Don't enable gfx and autoboot */ | ||
877 | #define VDS_NOMP 0x100 /* Don't start slave processors */ | ||
878 | #define VDS_MANUMODE 0x80 /* Manufacturing mode */ | ||
879 | #define VDS_NOARB 0x40 /* No bootmaster arbitration */ | ||
880 | #define VDS_PODMODE 0x20 /* Go straight to POD mode */ | ||
881 | #define VDS_NO_DIAGS 0x10 /* Don't run any diags after BM arb */ | ||
882 | #define VDS_DEFAULTS 0x08 /* Use default environment values */ | ||
883 | #define VDS_NOMEMCLEAR 0x04 /* Don't run mem cfg code */ | ||
884 | #define VDS_2ND_IO4 0x02 /* Boot from the second IO4 */ | ||
885 | #define VDS_DEBUG_PROM 0x01 /* Print PROM debugging messages */ | ||
886 | |||
887 | /* external declarations of Linux kernel functions. */ | ||
888 | |||
889 | extern lboard_t *find_lboard(lboard_t *start, unsigned char type); | ||
890 | extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type); | ||
891 | extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type); | ||
892 | extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int); | ||
893 | extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class); | ||
894 | |||
895 | |||
896 | extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu); | ||
897 | |||
898 | #endif /* _ASM_SN_KLCONFIG_H */ | ||
diff --git a/include/asm-mips/sn/kldir.h b/include/asm-mips/sn/kldir.h deleted file mode 100644 index 1327e12e9645..000000000000 --- a/include/asm-mips/sn/kldir.h +++ /dev/null | |||
@@ -1,217 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Derived from IRIX <sys/SN/kldir.h>, revision 1.21. | ||
7 | * | ||
8 | * Copyright (C) 1992 - 1997, 1999, 2000 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 1999, 2000 by Ralf Baechle | ||
10 | */ | ||
11 | #ifndef _ASM_SN_KLDIR_H | ||
12 | #define _ASM_SN_KLDIR_H | ||
13 | |||
14 | |||
15 | /* | ||
16 | * The kldir memory area resides at a fixed place in each node's memory and | ||
17 | * provides pointers to most other IP27 memory areas. This allows us to | ||
18 | * resize and/or relocate memory areas at a later time without breaking all | ||
19 | * firmware and kernels that use them. Indices in the array are | ||
20 | * permanently dedicated to areas listed below. Some memory areas (marked | ||
21 | * below) reside at a permanently fixed location, but are included in the | ||
22 | * directory for completeness. | ||
23 | */ | ||
24 | |||
25 | #define KLDIR_MAGIC 0x434d5f53505f5357 | ||
26 | |||
27 | /* | ||
28 | * The upper portion of the memory map applies during boot | ||
29 | * only and is overwritten by IRIX/SYMMON. | ||
30 | * | ||
31 | * MEMORY MAP PER NODE | ||
32 | * | ||
33 | * 0x2000000 (32M) +-----------------------------------------+ | ||
34 | * | IO6 BUFFERS FOR FLASH ENET IOC3 | | ||
35 | * 0x1F80000 (31.5M) +-----------------------------------------+ | ||
36 | * | IO6 TEXT/DATA/BSS/stack | | ||
37 | * 0x1C00000 (30M) +-----------------------------------------+ | ||
38 | * | IO6 PROM DEBUG TEXT/DATA/BSS/stack | | ||
39 | * 0x0800000 (28M) +-----------------------------------------+ | ||
40 | * | IP27 PROM TEXT/DATA/BSS/stack | | ||
41 | * 0x1B00000 (27M) +-----------------------------------------+ | ||
42 | * | IP27 CFG | | ||
43 | * 0x1A00000 (26M) +-----------------------------------------+ | ||
44 | * | Graphics PROM | | ||
45 | * 0x1800000 (24M) +-----------------------------------------+ | ||
46 | * | 3rd Party PROM drivers | | ||
47 | * 0x1600000 (22M) +-----------------------------------------+ | ||
48 | * | | | ||
49 | * | Free | | ||
50 | * | | | ||
51 | * +-----------------------------------------+ | ||
52 | * | UNIX DEBUG Version | | ||
53 | * 0x190000 (2M--) +-----------------------------------------+ | ||
54 | * | SYMMON | | ||
55 | * | (For UNIX Debug only) | | ||
56 | * 0x34000 (208K) +-----------------------------------------+ | ||
57 | * | SYMMON STACK [NUM_CPU_PER_NODE] | | ||
58 | * | (For UNIX Debug only) | | ||
59 | * 0x25000 (148K) +-----------------------------------------+ | ||
60 | * | KLCONFIG - II (temp) | | ||
61 | * | | | ||
62 | * | ---------------------------- | | ||
63 | * | | | ||
64 | * | UNIX NON-DEBUG Version | | ||
65 | * 0x19000 (100K) +-----------------------------------------+ | ||
66 | * | ||
67 | * | ||
68 | * The lower portion of the memory map contains information that is | ||
69 | * permanent and is used by the IP27PROM, IO6PROM and IRIX. | ||
70 | * | ||
71 | * 0x19000 (100K) +-----------------------------------------+ | ||
72 | * | | | ||
73 | * | PI Error Spools (32K) | | ||
74 | * | | | ||
75 | * 0x12000 (72K) +-----------------------------------------+ | ||
76 | * | Unused | | ||
77 | * 0x11c00 (71K) +-----------------------------------------+ | ||
78 | * | CPU 1 NMI Eframe area | | ||
79 | * 0x11a00 (70.5K) +-----------------------------------------+ | ||
80 | * | CPU 0 NMI Eframe area | | ||
81 | * 0x11800 (70K) +-----------------------------------------+ | ||
82 | * | CPU 1 NMI Register save area | | ||
83 | * 0x11600 (69.5K) +-----------------------------------------+ | ||
84 | * | CPU 0 NMI Register save area | | ||
85 | * 0x11400 (69K) +-----------------------------------------+ | ||
86 | * | GDA (1k) | | ||
87 | * 0x11000 (68K) +-----------------------------------------+ | ||
88 | * | Early cache Exception stack | | ||
89 | * | and/or | | ||
90 | * | kernel/io6prom nmi registers | | ||
91 | * 0x10800 (66k) +-----------------------------------------+ | ||
92 | * | cache error eframe | | ||
93 | * 0x10400 (65K) +-----------------------------------------+ | ||
94 | * | Exception Handlers (UALIAS copy) | | ||
95 | * 0x10000 (64K) +-----------------------------------------+ | ||
96 | * | | | ||
97 | * | | | ||
98 | * | KLCONFIG - I (permanent) (48K) | | ||
99 | * | | | ||
100 | * | | | ||
101 | * | | | ||
102 | * 0x4000 (16K) +-----------------------------------------+ | ||
103 | * | NMI Handler (Protected Page) | | ||
104 | * 0x3000 (12K) +-----------------------------------------+ | ||
105 | * | ARCS PVECTORS (master node only) | | ||
106 | * 0x2c00 (11K) +-----------------------------------------+ | ||
107 | * | ARCS TVECTORS (master node only) | | ||
108 | * 0x2800 (10K) +-----------------------------------------+ | ||
109 | * | LAUNCH [NUM_CPU] | | ||
110 | * 0x2400 (9K) +-----------------------------------------+ | ||
111 | * | Low memory directory (KLDIR) | | ||
112 | * 0x2000 (8K) +-----------------------------------------+ | ||
113 | * | ARCS SPB (1K) | | ||
114 | * 0x1000 (4K) +-----------------------------------------+ | ||
115 | * | Early cache Exception stack | | ||
116 | * | and/or | | ||
117 | * | kernel/io6prom nmi registers | | ||
118 | * 0x800 (2k) +-----------------------------------------+ | ||
119 | * | cache error eframe | | ||
120 | * 0x400 (1K) +-----------------------------------------+ | ||
121 | * | Exception Handlers | | ||
122 | * 0x0 (0K) +-----------------------------------------+ | ||
123 | */ | ||
124 | |||
125 | #ifdef __ASSEMBLY__ | ||
126 | #define KLDIR_OFF_MAGIC 0x00 | ||
127 | #define KLDIR_OFF_OFFSET 0x08 | ||
128 | #define KLDIR_OFF_POINTER 0x10 | ||
129 | #define KLDIR_OFF_SIZE 0x18 | ||
130 | #define KLDIR_OFF_COUNT 0x20 | ||
131 | #define KLDIR_OFF_STRIDE 0x28 | ||
132 | #endif /* __ASSEMBLY__ */ | ||
133 | |||
134 | /* | ||
135 | * This is defined here because IP27_SYMMON_STK_SIZE must be at least what | ||
136 | * we define here. Since it's set up in the prom. We can't redefine it later | ||
137 | * and expect more space to be allocated. The way to find out the true size | ||
138 | * of the symmon stacks is to divide SYMMON_STK_SIZE by SYMMON_STK_STRIDE | ||
139 | * for a particular node. | ||
140 | */ | ||
141 | #define SYMMON_STACK_SIZE 0x8000 | ||
142 | |||
143 | #if defined(PROM) | ||
144 | |||
145 | /* | ||
146 | * These defines are prom version dependent. No code other than the IP27 | ||
147 | * prom should attempt to use these values. | ||
148 | */ | ||
149 | #define IP27_LAUNCH_OFFSET 0x2400 | ||
150 | #define IP27_LAUNCH_SIZE 0x400 | ||
151 | #define IP27_LAUNCH_COUNT 2 | ||
152 | #define IP27_LAUNCH_STRIDE 0x200 | ||
153 | |||
154 | #define IP27_KLCONFIG_OFFSET 0x4000 | ||
155 | #define IP27_KLCONFIG_SIZE 0xc000 | ||
156 | #define IP27_KLCONFIG_COUNT 1 | ||
157 | #define IP27_KLCONFIG_STRIDE 0 | ||
158 | |||
159 | #define IP27_NMI_OFFSET 0x3000 | ||
160 | #define IP27_NMI_SIZE 0x40 | ||
161 | #define IP27_NMI_COUNT 2 | ||
162 | #define IP27_NMI_STRIDE 0x40 | ||
163 | |||
164 | #define IP27_PI_ERROR_OFFSET 0x12000 | ||
165 | #define IP27_PI_ERROR_SIZE 0x4000 | ||
166 | #define IP27_PI_ERROR_COUNT 1 | ||
167 | #define IP27_PI_ERROR_STRIDE 0 | ||
168 | |||
169 | #define IP27_SYMMON_STK_OFFSET 0x25000 | ||
170 | #define IP27_SYMMON_STK_SIZE 0xe000 | ||
171 | #define IP27_SYMMON_STK_COUNT 2 | ||
172 | /* IP27_SYMMON_STK_STRIDE must be >= SYMMON_STACK_SIZE */ | ||
173 | #define IP27_SYMMON_STK_STRIDE 0x7000 | ||
174 | |||
175 | #define IP27_FREEMEM_OFFSET 0x19000 | ||
176 | #define IP27_FREEMEM_SIZE -1 | ||
177 | #define IP27_FREEMEM_COUNT 1 | ||
178 | #define IP27_FREEMEM_STRIDE 0 | ||
179 | |||
180 | #endif /* PROM */ | ||
181 | /* | ||
182 | * There will be only one of these in a partition so the IO6 must set it up. | ||
183 | */ | ||
184 | #define IO6_GDA_OFFSET 0x11000 | ||
185 | #define IO6_GDA_SIZE 0x400 | ||
186 | #define IO6_GDA_COUNT 1 | ||
187 | #define IO6_GDA_STRIDE 0 | ||
188 | |||
189 | /* | ||
190 | * save area of kernel nmi regs in the prom format | ||
191 | */ | ||
192 | #define IP27_NMI_KREGS_OFFSET 0x11400 | ||
193 | #define IP27_NMI_KREGS_CPU_SIZE 0x200 | ||
194 | /* | ||
195 | * save area of kernel nmi regs in eframe format | ||
196 | */ | ||
197 | #define IP27_NMI_EFRAME_OFFSET 0x11800 | ||
198 | #define IP27_NMI_EFRAME_SIZE 0x200 | ||
199 | |||
200 | #define KLDIR_ENT_SIZE 0x40 | ||
201 | #define KLDIR_MAX_ENTRIES (0x400 / 0x40) | ||
202 | |||
203 | #ifndef __ASSEMBLY__ | ||
204 | typedef struct kldir_ent_s { | ||
205 | u64 magic; /* Indicates validity of entry */ | ||
206 | off_t offset; /* Offset from start of node space */ | ||
207 | unsigned long pointer; /* Pointer to area in some cases */ | ||
208 | size_t size; /* Size in bytes */ | ||
209 | u64 count; /* Repeat count if array, 1 if not */ | ||
210 | size_t stride; /* Stride if array, 0 if not */ | ||
211 | char rsvd[16]; /* Pad entry to 0x40 bytes */ | ||
212 | /* NOTE: These 16 bytes are used in the Partition KLDIR | ||
213 | entry to store partition info. Refer to klpart.h for this. */ | ||
214 | } kldir_ent_t; | ||
215 | #endif /* !__ASSEMBLY__ */ | ||
216 | |||
217 | #endif /* _ASM_SN_KLDIR_H */ | ||
diff --git a/include/asm-mips/sn/klkernvars.h b/include/asm-mips/sn/klkernvars.h deleted file mode 100644 index 5de4c5e8ab30..000000000000 --- a/include/asm-mips/sn/klkernvars.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * File ported from IRIX to Linux by Kanoj Sarcar, 06/08/00. | ||
3 | * Copyright 2000 Silicon Graphics, Inc. | ||
4 | */ | ||
5 | #ifndef __ASM_SN_KLKERNVARS_H | ||
6 | #define __ASM_SN_KLKERNVARS_H | ||
7 | |||
8 | #define KV_MAGIC_OFFSET 0x0 | ||
9 | #define KV_RO_NASID_OFFSET 0x4 | ||
10 | #define KV_RW_NASID_OFFSET 0x6 | ||
11 | |||
12 | #define KV_MAGIC 0x5f4b565f | ||
13 | |||
14 | #ifndef __ASSEMBLY__ | ||
15 | |||
16 | #include <asm/sn/types.h> | ||
17 | |||
18 | typedef struct kern_vars_s { | ||
19 | int kv_magic; | ||
20 | nasid_t kv_ro_nasid; | ||
21 | nasid_t kv_rw_nasid; | ||
22 | unsigned long kv_ro_baseaddr; | ||
23 | unsigned long kv_rw_baseaddr; | ||
24 | } kern_vars_t; | ||
25 | |||
26 | #endif /* !__ASSEMBLY__ */ | ||
27 | |||
28 | #endif /* __ASM_SN_KLKERNVARS_H */ | ||
29 | |||
diff --git a/include/asm-mips/sn/launch.h b/include/asm-mips/sn/launch.h deleted file mode 100644 index b7c2226312c6..000000000000 --- a/include/asm-mips/sn/launch.h +++ /dev/null | |||
@@ -1,106 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. | ||
7 | * Copyright (C) 2000 by Colin Ngam | ||
8 | */ | ||
9 | #ifndef _ASM_SN_LAUNCH_H | ||
10 | #define _ASM_SN_LAUNCH_H | ||
11 | |||
12 | #include <asm/sn/types.h> | ||
13 | #include <asm/sn/addrs.h> | ||
14 | |||
15 | /* | ||
16 | * The launch data structure resides at a fixed place in each node's memory | ||
17 | * and is used to communicate between the master processor and the slave | ||
18 | * processors. | ||
19 | * | ||
20 | * The master stores launch parameters in the launch structure | ||
21 | * corresponding to a target processor that is in a slave loop, then sends | ||
22 | * an interrupt to the slave processor. The slave calls the desired | ||
23 | * function, then returns to the slave loop. The master may poll or wait | ||
24 | * for the slaves to finish. | ||
25 | * | ||
26 | * There is an array of launch structures, one per CPU on the node. One | ||
27 | * interrupt level is used per local CPU. | ||
28 | */ | ||
29 | |||
30 | #define LAUNCH_MAGIC 0xaddbead2addbead3 | ||
31 | #ifdef CONFIG_SGI_IP27 | ||
32 | #define LAUNCH_SIZEOF 0x100 | ||
33 | #define LAUNCH_PADSZ 0xa0 | ||
34 | #endif | ||
35 | |||
36 | #define LAUNCH_OFF_MAGIC 0x00 /* Struct offsets for assembly */ | ||
37 | #define LAUNCH_OFF_BUSY 0x08 | ||
38 | #define LAUNCH_OFF_CALL 0x10 | ||
39 | #define LAUNCH_OFF_CALLC 0x18 | ||
40 | #define LAUNCH_OFF_CALLPARM 0x20 | ||
41 | #define LAUNCH_OFF_STACK 0x28 | ||
42 | #define LAUNCH_OFF_GP 0x30 | ||
43 | #define LAUNCH_OFF_BEVUTLB 0x38 | ||
44 | #define LAUNCH_OFF_BEVNORMAL 0x40 | ||
45 | #define LAUNCH_OFF_BEVECC 0x48 | ||
46 | |||
47 | #define LAUNCH_STATE_DONE 0 /* Return value of LAUNCH_POLL */ | ||
48 | #define LAUNCH_STATE_SENT 1 | ||
49 | #define LAUNCH_STATE_RECD 2 | ||
50 | |||
51 | /* | ||
52 | * The launch routine is called only if the complement address is correct. | ||
53 | * | ||
54 | * Before control is transferred to a routine, the complement address | ||
55 | * is zeroed (invalidated) to prevent an accidental call from a spurious | ||
56 | * interrupt. | ||
57 | * | ||
58 | * The slave_launch routine turns on the BUSY flag, and the slave loop | ||
59 | * clears the BUSY flag after control is returned to it. | ||
60 | */ | ||
61 | |||
62 | #ifndef __ASSEMBLY__ | ||
63 | |||
64 | typedef int launch_state_t; | ||
65 | typedef void (*launch_proc_t)(u64 call_parm); | ||
66 | |||
67 | typedef struct launch_s { | ||
68 | volatile u64 magic; /* Magic number */ | ||
69 | volatile u64 busy; /* Slave currently active */ | ||
70 | volatile launch_proc_t call_addr; /* Func. for slave to call */ | ||
71 | volatile u64 call_addr_c; /* 1's complement of call_addr*/ | ||
72 | volatile u64 call_parm; /* Single parm passed to call*/ | ||
73 | volatile void *stack_addr; /* Stack pointer for slave function */ | ||
74 | volatile void *gp_addr; /* Global pointer for slave func. */ | ||
75 | volatile char *bevutlb;/* Address of bev utlb ex handler */ | ||
76 | volatile char *bevnormal;/*Address of bev normal ex handler */ | ||
77 | volatile char *bevecc;/* Address of bev cache err handler */ | ||
78 | volatile char pad[160]; /* Pad to LAUNCH_SIZEOF */ | ||
79 | } launch_t; | ||
80 | |||
81 | /* | ||
82 | * PROM entry points for launch routines are determined by IPxxprom/start.s | ||
83 | */ | ||
84 | |||
85 | #define LAUNCH_SLAVE (*(void (*)(int nasid, int cpu, \ | ||
86 | launch_proc_t call_addr, \ | ||
87 | u64 call_parm, \ | ||
88 | void *stack_addr, \ | ||
89 | void *gp_addr)) \ | ||
90 | IP27PROM_LAUNCHSLAVE) | ||
91 | |||
92 | #define LAUNCH_WAIT (*(void (*)(int nasid, int cpu, int timeout_msec)) \ | ||
93 | IP27PROM_WAITSLAVE) | ||
94 | |||
95 | #define LAUNCH_POLL (*(launch_state_t (*)(int nasid, int cpu)) \ | ||
96 | IP27PROM_POLLSLAVE) | ||
97 | |||
98 | #define LAUNCH_LOOP (*(void (*)(void)) \ | ||
99 | IP27PROM_SLAVELOOP) | ||
100 | |||
101 | #define LAUNCH_FLASH (*(void (*)(void)) \ | ||
102 | IP27PROM_FLASHLEDS) | ||
103 | |||
104 | #endif /* !__ASSEMBLY__ */ | ||
105 | |||
106 | #endif /* _ASM_SN_LAUNCH_H */ | ||
diff --git a/include/asm-mips/sn/mapped_kernel.h b/include/asm-mips/sn/mapped_kernel.h deleted file mode 100644 index 721496a0bb92..000000000000 --- a/include/asm-mips/sn/mapped_kernel.h +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * File created by Kanoj Sarcar 06/06/00. | ||
3 | * Copyright 2000 Silicon Graphics, Inc. | ||
4 | */ | ||
5 | #ifndef __ASM_SN_MAPPED_KERNEL_H | ||
6 | #define __ASM_SN_MAPPED_KERNEL_H | ||
7 | |||
8 | #include <linux/mmzone.h> | ||
9 | |||
10 | /* | ||
11 | * Note on how mapped kernels work: the text and data section is | ||
12 | * compiled at cksseg segment (LOADADDR = 0xc001c000), and the | ||
13 | * init/setup/data section gets a 16M virtual address bump in the | ||
14 | * ld.script file (so that tlblo0 and tlblo1 maps the sections). | ||
15 | * The vmlinux.64 section addresses are put in the xkseg range | ||
16 | * using the change-addresses makefile option. Use elfdump -of | ||
17 | * on IRIX to see where the sections go. The Origin loader loads | ||
18 | * the two sections contiguously in physical memory. The loader | ||
19 | * sets the entry point into kernel_entry using a xkphys address, | ||
20 | * but instead of using 0xa800000001160000, it uses the address | ||
21 | * 0xa800000000160000, which is where it physically loaded that | ||
22 | * code. So no jumps can be done before we have switched to using | ||
23 | * cksseg addresses. | ||
24 | */ | ||
25 | #include <asm/addrspace.h> | ||
26 | |||
27 | #define REP_BASE CAC_BASE | ||
28 | |||
29 | #ifdef CONFIG_MAPPED_KERNEL | ||
30 | |||
31 | #define MAPPED_ADDR_RO_TO_PHYS(x) (x - REP_BASE) | ||
32 | #define MAPPED_ADDR_RW_TO_PHYS(x) (x - REP_BASE - 16777216) | ||
33 | |||
34 | #define MAPPED_KERN_RO_PHYSBASE(n) (hub_data(n)->kern_vars.kv_ro_baseaddr) | ||
35 | #define MAPPED_KERN_RW_PHYSBASE(n) (hub_data(n)->kern_vars.kv_rw_baseaddr) | ||
36 | |||
37 | #define MAPPED_KERN_RO_TO_PHYS(x) \ | ||
38 | ((unsigned long)MAPPED_ADDR_RO_TO_PHYS(x) | \ | ||
39 | MAPPED_KERN_RO_PHYSBASE(get_compact_nodeid())) | ||
40 | #define MAPPED_KERN_RW_TO_PHYS(x) \ | ||
41 | ((unsigned long)MAPPED_ADDR_RW_TO_PHYS(x) | \ | ||
42 | MAPPED_KERN_RW_PHYSBASE(get_compact_nodeid())) | ||
43 | |||
44 | #else /* CONFIG_MAPPED_KERNEL */ | ||
45 | |||
46 | #define MAPPED_KERN_RO_TO_PHYS(x) (x - REP_BASE) | ||
47 | #define MAPPED_KERN_RW_TO_PHYS(x) (x - REP_BASE) | ||
48 | |||
49 | #endif /* CONFIG_MAPPED_KERNEL */ | ||
50 | |||
51 | #define MAPPED_KERN_RO_TO_K0(x) PHYS_TO_K0(MAPPED_KERN_RO_TO_PHYS(x)) | ||
52 | #define MAPPED_KERN_RW_TO_K0(x) PHYS_TO_K0(MAPPED_KERN_RW_TO_PHYS(x)) | ||
53 | |||
54 | #endif /* __ASM_SN_MAPPED_KERNEL_H */ | ||
diff --git a/include/asm-mips/sn/nmi.h b/include/asm-mips/sn/nmi.h deleted file mode 100644 index 6b7b0b5f3729..000000000000 --- a/include/asm-mips/sn/nmi.h +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1992 - 1997 Silicon Graphics, Inc. | ||
7 | */ | ||
8 | #ifndef __ASM_SN_NMI_H | ||
9 | #define __ASM_SN_NMI_H | ||
10 | |||
11 | #ident "$Revision: 1.5 $" | ||
12 | |||
13 | #include <asm/sn/addrs.h> | ||
14 | |||
15 | /* | ||
16 | * The launch data structure resides at a fixed place in each node's memory | ||
17 | * and is used to communicate between the master processor and the slave | ||
18 | * processors. | ||
19 | * | ||
20 | * The master stores launch parameters in the launch structure | ||
21 | * corresponding to a target processor that is in a slave loop, then sends | ||
22 | * an interrupt to the slave processor. The slave calls the desired | ||
23 | * function, followed by an optional rendezvous function, then returns to | ||
24 | * the slave loop. The master does not wait for the slaves before | ||
25 | * returning. | ||
26 | * | ||
27 | * There is an array of launch structures, one per CPU on the node. One | ||
28 | * interrupt level is used per CPU. | ||
29 | */ | ||
30 | |||
31 | #define NMI_MAGIC 0x48414d4d455201 | ||
32 | #define NMI_SIZEOF 0x40 | ||
33 | |||
34 | #define NMI_OFF_MAGIC 0x00 /* Struct offsets for assembly */ | ||
35 | #define NMI_OFF_FLAGS 0x08 | ||
36 | #define NMI_OFF_CALL 0x10 | ||
37 | #define NMI_OFF_CALLC 0x18 | ||
38 | #define NMI_OFF_CALLPARM 0x20 | ||
39 | #define NMI_OFF_GMASTER 0x28 | ||
40 | |||
41 | /* | ||
42 | * The NMI routine is called only if the complement address is | ||
43 | * correct. | ||
44 | * | ||
45 | * Before control is transferred to a routine, the complement address | ||
46 | * is zeroed (invalidated) to prevent an accidental call from a spurious | ||
47 | * interrupt. | ||
48 | * | ||
49 | */ | ||
50 | |||
51 | #ifndef __ASSEMBLY__ | ||
52 | |||
53 | typedef struct nmi_s { | ||
54 | volatile unsigned long magic; /* Magic number */ | ||
55 | volatile unsigned long flags; /* Combination of flags above */ | ||
56 | volatile void *call_addr; /* Routine for slave to call */ | ||
57 | volatile void *call_addr_c; /* 1's complement of address */ | ||
58 | volatile void *call_parm; /* Single parm passed to call */ | ||
59 | volatile unsigned long gmaster; /* Flag true only on global master*/ | ||
60 | } nmi_t; | ||
61 | |||
62 | #endif /* !__ASSEMBLY__ */ | ||
63 | |||
64 | /* Following definitions are needed both in the prom & the kernel | ||
65 | * to identify the format of the nmi cpu register save area in the | ||
66 | * low memory on each node. | ||
67 | */ | ||
68 | #ifndef __ASSEMBLY__ | ||
69 | |||
70 | struct reg_struct { | ||
71 | unsigned long gpr[32]; | ||
72 | unsigned long sr; | ||
73 | unsigned long cause; | ||
74 | unsigned long epc; | ||
75 | unsigned long badva; | ||
76 | unsigned long error_epc; | ||
77 | unsigned long cache_err; | ||
78 | unsigned long nmi_sr; | ||
79 | }; | ||
80 | |||
81 | #endif /* !__ASSEMBLY__ */ | ||
82 | |||
83 | /* These are the assembly language offsets into the reg_struct structure */ | ||
84 | |||
85 | #define R0_OFF 0x0 | ||
86 | #define R1_OFF 0x8 | ||
87 | #define R2_OFF 0x10 | ||
88 | #define R3_OFF 0x18 | ||
89 | #define R4_OFF 0x20 | ||
90 | #define R5_OFF 0x28 | ||
91 | #define R6_OFF 0x30 | ||
92 | #define R7_OFF 0x38 | ||
93 | #define R8_OFF 0x40 | ||
94 | #define R9_OFF 0x48 | ||
95 | #define R10_OFF 0x50 | ||
96 | #define R11_OFF 0x58 | ||
97 | #define R12_OFF 0x60 | ||
98 | #define R13_OFF 0x68 | ||
99 | #define R14_OFF 0x70 | ||
100 | #define R15_OFF 0x78 | ||
101 | #define R16_OFF 0x80 | ||
102 | #define R17_OFF 0x88 | ||
103 | #define R18_OFF 0x90 | ||
104 | #define R19_OFF 0x98 | ||
105 | #define R20_OFF 0xa0 | ||
106 | #define R21_OFF 0xa8 | ||
107 | #define R22_OFF 0xb0 | ||
108 | #define R23_OFF 0xb8 | ||
109 | #define R24_OFF 0xc0 | ||
110 | #define R25_OFF 0xc8 | ||
111 | #define R26_OFF 0xd0 | ||
112 | #define R27_OFF 0xd8 | ||
113 | #define R28_OFF 0xe0 | ||
114 | #define R29_OFF 0xe8 | ||
115 | #define R30_OFF 0xf0 | ||
116 | #define R31_OFF 0xf8 | ||
117 | #define SR_OFF 0x100 | ||
118 | #define CAUSE_OFF 0x108 | ||
119 | #define EPC_OFF 0x110 | ||
120 | #define BADVA_OFF 0x118 | ||
121 | #define ERROR_EPC_OFF 0x120 | ||
122 | #define CACHE_ERR_OFF 0x128 | ||
123 | #define NMISR_OFF 0x130 | ||
124 | |||
125 | #endif /* __ASM_SN_NMI_H */ | ||
diff --git a/include/asm-mips/sn/sn0/addrs.h b/include/asm-mips/sn/sn0/addrs.h deleted file mode 100644 index b06190093bbc..000000000000 --- a/include/asm-mips/sn/sn0/addrs.h +++ /dev/null | |||
@@ -1,288 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Derived from IRIX <sys/SN/SN0/addrs.h>, revision 1.126. | ||
7 | * | ||
8 | * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 1999 by Ralf Baechle | ||
10 | */ | ||
11 | #ifndef _ASM_SN_SN0_ADDRS_H | ||
12 | #define _ASM_SN_SN0_ADDRS_H | ||
13 | |||
14 | |||
15 | /* | ||
16 | * SN0 (on a T5) Address map | ||
17 | * | ||
18 | * This file contains a set of definitions and macros which are used | ||
19 | * to reference into the major address spaces (CAC, HSPEC, IO, MSPEC, | ||
20 | * and UNCAC) used by the SN0 architecture. It also contains addresses | ||
21 | * for "major" statically locatable PROM/Kernel data structures, such as | ||
22 | * the partition table, the configuration data structure, etc. | ||
23 | * We make an implicit assumption that the processor using this file | ||
24 | * follows the R10K's provisions for specifying uncached attributes; | ||
25 | * should this change, the base registers may very well become processor- | ||
26 | * dependent. | ||
27 | * | ||
28 | * For more information on the address spaces, see the "Local Resources" | ||
29 | * chapter of the Hub specification. | ||
30 | * | ||
31 | * NOTE: This header file is included both by C and by assembler source | ||
32 | * files. Please bracket any language-dependent definitions | ||
33 | * appropriately. | ||
34 | */ | ||
35 | |||
36 | /* | ||
37 | * Some of the macros here need to be casted to appropriate types when used | ||
38 | * from C. They definitely must not be casted from assembly language so we | ||
39 | * use some new ANSI preprocessor stuff to paste these on where needed. | ||
40 | */ | ||
41 | |||
42 | /* | ||
43 | * The following couple of definitions will eventually need to be variables, | ||
44 | * since the amount of address space assigned to each node depends on | ||
45 | * whether the system is running in N-mode (more nodes with less memory) | ||
46 | * or M-mode (fewer nodes with more memory). We expect that it will | ||
47 | * be a while before we need to make this decision dynamically, though, | ||
48 | * so for now we just use defines bracketed by an ifdef. | ||
49 | */ | ||
50 | |||
51 | #ifdef CONFIG_SGI_SN_N_MODE | ||
52 | |||
53 | #define NODE_SIZE_BITS 31 | ||
54 | #define BWIN_SIZE_BITS 28 | ||
55 | |||
56 | #define NASID_BITS 9 | ||
57 | #define NASID_BITMASK (0x1ffLL) | ||
58 | #define NASID_SHFT 31 | ||
59 | #define NASID_META_BITS 5 | ||
60 | #define NASID_LOCAL_BITS 4 | ||
61 | |||
62 | #define BDDIR_UPPER_MASK (UINT64_CAST 0x7ffff << 10) | ||
63 | #define BDECC_UPPER_MASK (UINT64_CAST 0x3ffffff << 3) | ||
64 | |||
65 | #else /* !defined(CONFIG_SGI_SN_N_MODE), assume that M-mode is desired */ | ||
66 | |||
67 | #define NODE_SIZE_BITS 32 | ||
68 | #define BWIN_SIZE_BITS 29 | ||
69 | |||
70 | #define NASID_BITMASK (0xffLL) | ||
71 | #define NASID_BITS 8 | ||
72 | #define NASID_SHFT 32 | ||
73 | #define NASID_META_BITS 4 | ||
74 | #define NASID_LOCAL_BITS 4 | ||
75 | |||
76 | #define BDDIR_UPPER_MASK (UINT64_CAST 0xfffff << 10) | ||
77 | #define BDECC_UPPER_MASK (UINT64_CAST 0x7ffffff << 3) | ||
78 | |||
79 | #endif /* !defined(CONFIG_SGI_SN_N_MODE) */ | ||
80 | |||
81 | #define NODE_ADDRSPACE_SIZE (UINT64_CAST 1 << NODE_SIZE_BITS) | ||
82 | |||
83 | #define NASID_MASK (UINT64_CAST NASID_BITMASK << NASID_SHFT) | ||
84 | #define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \ | ||
85 | NASID_SHFT) & NASID_BITMASK) | ||
86 | |||
87 | #if !defined(__ASSEMBLY__) | ||
88 | |||
89 | #define NODE_SWIN_BASE(nasid, widget) \ | ||
90 | ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \ | ||
91 | : RAW_NODE_SWIN_BASE(nasid, widget)) | ||
92 | #else /* __ASSEMBLY__ */ | ||
93 | #define NODE_SWIN_BASE(nasid, widget) \ | ||
94 | (NODE_IO_BASE(nasid) + (UINT64_CAST(widget) << SWIN_SIZE_BITS)) | ||
95 | #endif /* __ASSEMBLY__ */ | ||
96 | |||
97 | /* | ||
98 | * The following definitions pertain to the IO special address | ||
99 | * space. They define the location of the big and little windows | ||
100 | * of any given node. | ||
101 | */ | ||
102 | |||
103 | #define BWIN_INDEX_BITS 3 | ||
104 | #define BWIN_SIZE (UINT64_CAST 1 << BWIN_SIZE_BITS) | ||
105 | #define BWIN_SIZEMASK (BWIN_SIZE - 1) | ||
106 | #define BWIN_WIDGET_MASK 0x7 | ||
107 | #define NODE_BWIN_BASE0(nasid) (NODE_IO_BASE(nasid) + BWIN_SIZE) | ||
108 | #define NODE_BWIN_BASE(nasid, bigwin) (NODE_BWIN_BASE0(nasid) + \ | ||
109 | (UINT64_CAST(bigwin) << BWIN_SIZE_BITS)) | ||
110 | |||
111 | #define BWIN_WIDGETADDR(addr) ((addr) & BWIN_SIZEMASK) | ||
112 | #define BWIN_WINDOWNUM(addr) (((addr) >> BWIN_SIZE_BITS) & BWIN_WIDGET_MASK) | ||
113 | /* | ||
114 | * Verify if addr belongs to large window address of node with "nasid" | ||
115 | * | ||
116 | * | ||
117 | * NOTE: "addr" is expected to be XKPHYS address, and NOT physical | ||
118 | * address | ||
119 | * | ||
120 | * | ||
121 | */ | ||
122 | |||
123 | #define NODE_BWIN_ADDR(nasid, addr) \ | ||
124 | (((addr) >= NODE_BWIN_BASE0(nasid)) && \ | ||
125 | ((addr) < (NODE_BWIN_BASE(nasid, HUB_NUM_BIG_WINDOW) + \ | ||
126 | BWIN_SIZE))) | ||
127 | |||
128 | /* | ||
129 | * The following define the major position-independent aliases used | ||
130 | * in SN0. | ||
131 | * CALIAS -- Varies in size, points to the first n bytes of memory | ||
132 | * on the reader's node. | ||
133 | */ | ||
134 | |||
135 | #define CALIAS_BASE CAC_BASE | ||
136 | |||
137 | |||
138 | |||
139 | #define BRIDGE_REG_PTR(_base, _off) ((volatile bridgereg_t *) \ | ||
140 | ((__psunsigned_t)(_base) + (__psunsigned_t)(_off))) | ||
141 | |||
142 | #define SN0_WIDGET_BASE(_nasid, _wid) (NODE_SWIN_BASE((_nasid), (_wid))) | ||
143 | |||
144 | /* Turn on sable logging for the processors whose bits are set. */ | ||
145 | #define SABLE_LOG_TRIGGER(_map) | ||
146 | |||
147 | #ifndef __ASSEMBLY__ | ||
148 | #define KERN_NMI_ADDR(nasid, slice) \ | ||
149 | TO_NODE_UNCAC((nasid), IP27_NMI_KREGS_OFFSET + \ | ||
150 | (IP27_NMI_KREGS_CPU_SIZE * (slice))) | ||
151 | #endif /* !__ASSEMBLY__ */ | ||
152 | |||
153 | #ifdef PROM | ||
154 | |||
155 | #define MISC_PROM_BASE PHYS_TO_K0(0x01300000) | ||
156 | #define MISC_PROM_SIZE 0x200000 | ||
157 | |||
158 | #define DIAG_BASE PHYS_TO_K0(0x01500000) | ||
159 | #define DIAG_SIZE 0x300000 | ||
160 | |||
161 | #define ROUTE_BASE PHYS_TO_K0(0x01800000) | ||
162 | #define ROUTE_SIZE 0x200000 | ||
163 | |||
164 | #define IP27PROM_FLASH_HDR PHYS_TO_K0(0x01300000) | ||
165 | #define IP27PROM_FLASH_DATA PHYS_TO_K0(0x01301000) | ||
166 | #define IP27PROM_CORP_MAX 32 | ||
167 | #define IP27PROM_CORP PHYS_TO_K0(0x01800000) | ||
168 | #define IP27PROM_CORP_SIZE 0x10000 | ||
169 | #define IP27PROM_CORP_STK PHYS_TO_K0(0x01810000) | ||
170 | #define IP27PROM_CORP_STKSIZE 0x2000 | ||
171 | #define IP27PROM_DECOMP_BUF PHYS_TO_K0(0x01900000) | ||
172 | #define IP27PROM_DECOMP_SIZE 0xfff00 | ||
173 | |||
174 | #define IP27PROM_BASE PHYS_TO_K0(0x01a00000) | ||
175 | #define IP27PROM_BASE_MAPPED (UNCAC_BASE | 0x1fc00000) | ||
176 | #define IP27PROM_SIZE_MAX 0x100000 | ||
177 | |||
178 | #define IP27PROM_PCFG PHYS_TO_K0(0x01b00000) | ||
179 | #define IP27PROM_PCFG_SIZE 0xd0000 | ||
180 | #define IP27PROM_ERRDMP PHYS_TO_K1(0x01bd0000) | ||
181 | #define IP27PROM_ERRDMP_SIZE 0xf000 | ||
182 | |||
183 | #define IP27PROM_INIT_START PHYS_TO_K1(0x01bd0000) | ||
184 | #define IP27PROM_CONSOLE PHYS_TO_K1(0x01bdf000) | ||
185 | #define IP27PROM_CONSOLE_SIZE 0x200 | ||
186 | #define IP27PROM_NETUART PHYS_TO_K1(0x01bdf200) | ||
187 | #define IP27PROM_NETUART_SIZE 0x100 | ||
188 | #define IP27PROM_UNUSED1 PHYS_TO_K1(0x01bdf300) | ||
189 | #define IP27PROM_UNUSED1_SIZE 0x500 | ||
190 | #define IP27PROM_ELSC_BASE_A PHYS_TO_K0(0x01bdf800) | ||
191 | #define IP27PROM_ELSC_BASE_B PHYS_TO_K0(0x01bdfc00) | ||
192 | #define IP27PROM_STACK_A PHYS_TO_K0(0x01be0000) | ||
193 | #define IP27PROM_STACK_B PHYS_TO_K0(0x01bf0000) | ||
194 | #define IP27PROM_STACK_SHFT 16 | ||
195 | #define IP27PROM_STACK_SIZE (1 << IP27PROM_STACK_SHFT) | ||
196 | #define IP27PROM_INIT_END PHYS_TO_K0(0x01c00000) | ||
197 | |||
198 | #define SLAVESTACK_BASE PHYS_TO_K0(0x01580000) | ||
199 | #define SLAVESTACK_SIZE 0x40000 | ||
200 | |||
201 | #define ENETBUFS_BASE PHYS_TO_K0(0x01f80000) | ||
202 | #define ENETBUFS_SIZE 0x20000 | ||
203 | |||
204 | #define IO6PROM_BASE PHYS_TO_K0(0x01c00000) | ||
205 | #define IO6PROM_SIZE 0x400000 | ||
206 | #define IO6PROM_BASE_MAPPED (UNCAC_BASE | 0x11c00000) | ||
207 | #define IO6DPROM_BASE PHYS_TO_K0(0x01c00000) | ||
208 | #define IO6DPROM_SIZE 0x200000 | ||
209 | |||
210 | #define NODEBUGUNIX_ADDR PHYS_TO_K0(0x00019000) | ||
211 | #define DEBUGUNIX_ADDR PHYS_TO_K0(0x00100000) | ||
212 | |||
213 | #define IP27PROM_INT_LAUNCH 10 /* and 11 */ | ||
214 | #define IP27PROM_INT_NETUART 12 /* through 17 */ | ||
215 | |||
216 | #endif /* PROM */ | ||
217 | |||
218 | /* | ||
219 | * needed by symmon so it needs to be outside #if PROM | ||
220 | */ | ||
221 | #define IP27PROM_ELSC_SHFT 10 | ||
222 | #define IP27PROM_ELSC_SIZE (1 << IP27PROM_ELSC_SHFT) | ||
223 | |||
224 | /* | ||
225 | * This address is used by IO6PROM to build MemoryDescriptors of | ||
226 | * free memory. This address is important since unix gets loaded | ||
227 | * at this address, and this memory has to be FREE if unix is to | ||
228 | * be loaded. | ||
229 | */ | ||
230 | |||
231 | #define FREEMEM_BASE PHYS_TO_K0(0x2000000) | ||
232 | |||
233 | #define IO6PROM_STACK_SHFT 14 /* stack per cpu */ | ||
234 | #define IO6PROM_STACK_SIZE (1 << IO6PROM_STACK_SHFT) | ||
235 | |||
236 | /* | ||
237 | * IP27 PROM vectors | ||
238 | */ | ||
239 | |||
240 | #define IP27PROM_ENTRY PHYS_TO_COMPATK1(0x1fc00000) | ||
241 | #define IP27PROM_RESTART PHYS_TO_COMPATK1(0x1fc00008) | ||
242 | #define IP27PROM_SLAVELOOP PHYS_TO_COMPATK1(0x1fc00010) | ||
243 | #define IP27PROM_PODMODE PHYS_TO_COMPATK1(0x1fc00018) | ||
244 | #define IP27PROM_IOC3UARTPOD PHYS_TO_COMPATK1(0x1fc00020) | ||
245 | #define IP27PROM_FLASHLEDS PHYS_TO_COMPATK1(0x1fc00028) | ||
246 | #define IP27PROM_REPOD PHYS_TO_COMPATK1(0x1fc00030) | ||
247 | #define IP27PROM_LAUNCHSLAVE PHYS_TO_COMPATK1(0x1fc00038) | ||
248 | #define IP27PROM_WAITSLAVE PHYS_TO_COMPATK1(0x1fc00040) | ||
249 | #define IP27PROM_POLLSLAVE PHYS_TO_COMPATK1(0x1fc00048) | ||
250 | |||
251 | #define KL_UART_BASE LOCAL_HUB_ADDR(MD_UREG0_0) /* base of UART regs */ | ||
252 | #define KL_UART_CMD LOCAL_HUB_ADDR(MD_UREG0_0) /* UART command reg */ | ||
253 | #define KL_UART_DATA LOCAL_HUB_ADDR(MD_UREG0_1) /* UART data reg */ | ||
254 | #define KL_I2C_REG MD_UREG0_0 /* I2C reg */ | ||
255 | |||
256 | #ifndef __ASSEMBLY__ | ||
257 | |||
258 | /* Address 0x400 to 0x1000 ualias points to cache error eframe + misc | ||
259 | * CACHE_ERR_SP_PTR could either contain an address to the stack, or | ||
260 | * the stack could start at CACHE_ERR_SP_PTR | ||
261 | */ | ||
262 | #if defined(HUB_ERR_STS_WAR) | ||
263 | #define CACHE_ERR_EFRAME 0x480 | ||
264 | #else /* HUB_ERR_STS_WAR */ | ||
265 | #define CACHE_ERR_EFRAME 0x400 | ||
266 | #endif /* HUB_ERR_STS_WAR */ | ||
267 | |||
268 | #define CACHE_ERR_ECCFRAME (CACHE_ERR_EFRAME + EF_SIZE) | ||
269 | #define CACHE_ERR_SP_PTR (0x1000 - 32) /* why -32? TBD */ | ||
270 | #define CACHE_ERR_IBASE_PTR (0x1000 - 40) | ||
271 | #define CACHE_ERR_SP (CACHE_ERR_SP_PTR - 16) | ||
272 | #define CACHE_ERR_AREA_SIZE (ARCS_SPB_OFFSET - CACHE_ERR_EFRAME) | ||
273 | |||
274 | #endif /* !__ASSEMBLY__ */ | ||
275 | |||
276 | #define _ARCSPROM | ||
277 | |||
278 | #if defined(HUB_ERR_STS_WAR) | ||
279 | |||
280 | #define ERR_STS_WAR_REGISTER IIO_IIBUSERR | ||
281 | #define ERR_STS_WAR_ADDR LOCAL_HUB_ADDR(IIO_IIBUSERR) | ||
282 | #define ERR_STS_WAR_PHYSADDR TO_PHYS((__psunsigned_t)ERR_STS_WAR_ADDR) | ||
283 | /* Used to match addr in error reg. */ | ||
284 | #define OLD_ERR_STS_WAR_OFFSET ((MD_MEM_BANKS * MD_BANK_SIZE) - 0x100) | ||
285 | |||
286 | #endif /* HUB_ERR_STS_WAR */ | ||
287 | |||
288 | #endif /* _ASM_SN_SN0_ADDRS_H */ | ||
diff --git a/include/asm-mips/sn/sn0/arch.h b/include/asm-mips/sn/sn0/arch.h deleted file mode 100644 index f734f2007f24..000000000000 --- a/include/asm-mips/sn/sn0/arch.h +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * SGI IP27 specific setup. | ||
7 | * | ||
8 | * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc. | ||
9 | * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) | ||
10 | */ | ||
11 | #ifndef _ASM_SN_SN0_ARCH_H | ||
12 | #define _ASM_SN_SN0_ARCH_H | ||
13 | |||
14 | |||
15 | #ifndef SN0XXL /* 128 cpu SMP max */ | ||
16 | /* | ||
17 | * This is the maximum number of nodes that can be part of a kernel. | ||
18 | * Effectively, it's the maximum number of compact node ids (cnodeid_t). | ||
19 | */ | ||
20 | #define MAX_COMPACT_NODES 64 | ||
21 | |||
22 | /* | ||
23 | * MAXCPUS refers to the maximum number of CPUs in a single kernel. | ||
24 | * This is not necessarily the same as MAXNODES * CPUS_PER_NODE | ||
25 | */ | ||
26 | #define MAXCPUS 128 | ||
27 | |||
28 | #else /* SN0XXL system */ | ||
29 | |||
30 | #define MAX_COMPACT_NODES 128 | ||
31 | #define MAXCPUS 256 | ||
32 | |||
33 | #endif /* SN0XXL */ | ||
34 | |||
35 | /* | ||
36 | * This is the maximum number of NASIDS that can be present in a system. | ||
37 | * (Highest NASID plus one.) | ||
38 | */ | ||
39 | #define MAX_NASIDS 256 | ||
40 | |||
41 | /* | ||
42 | * MAX_REGIONS refers to the maximum number of hardware partitioned regions. | ||
43 | */ | ||
44 | #define MAX_REGIONS 64 | ||
45 | #define MAX_NONPREMIUM_REGIONS 16 | ||
46 | #define MAX_PREMIUM_REGIONS MAX_REGIONS | ||
47 | |||
48 | /* | ||
49 | * MAX_PARITIONS refers to the maximum number of logically defined | ||
50 | * partitions the system can support. | ||
51 | */ | ||
52 | #define MAX_PARTITIONS MAX_REGIONS | ||
53 | |||
54 | #define NASID_MASK_BYTES ((MAX_NASIDS + 7) / 8) | ||
55 | |||
56 | /* | ||
57 | * Slot constants for SN0 | ||
58 | */ | ||
59 | #ifdef CONFIG_SGI_SN_N_MODE | ||
60 | #define MAX_MEM_SLOTS 16 /* max slots per node */ | ||
61 | #else /* !CONFIG_SGI_SN_N_MODE, assume CONFIG_SGI_SN_M_MODE */ | ||
62 | #define MAX_MEM_SLOTS 32 /* max slots per node */ | ||
63 | #endif /* CONFIG_SGI_SN_M_MODE */ | ||
64 | |||
65 | #define SLOT_SHIFT (27) | ||
66 | #define SLOT_MIN_MEM_SIZE (32*1024*1024) | ||
67 | |||
68 | #define CPUS_PER_NODE 2 /* CPUs on a single hub */ | ||
69 | #define CPUS_PER_NODE_SHFT 1 /* Bits to shift in the node number */ | ||
70 | #define CPUS_PER_SUBNODE 2 /* CPUs on a single hub PI */ | ||
71 | |||
72 | #endif /* _ASM_SN_SN0_ARCH_H */ | ||
diff --git a/include/asm-mips/sn/sn0/hub.h b/include/asm-mips/sn/sn0/hub.h deleted file mode 100644 index 3e228f8e7969..000000000000 --- a/include/asm-mips/sn/sn0/hub.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. | ||
7 | * Copyright (C) 1999 by Ralf Baechle | ||
8 | */ | ||
9 | #ifndef _ASM_SN_SN0_HUB_H | ||
10 | #define _ASM_SN_SN0_HUB_H | ||
11 | |||
12 | /* The secret password; used to release protection */ | ||
13 | #define HUB_PASSWORD 0x53474972756c6573ull | ||
14 | |||
15 | #define CHIPID_HUB 0 | ||
16 | #define CHIPID_ROUTER 1 | ||
17 | |||
18 | #define HUB_REV_1_0 1 | ||
19 | #define HUB_REV_2_0 2 | ||
20 | #define HUB_REV_2_1 3 | ||
21 | #define HUB_REV_2_2 4 | ||
22 | #define HUB_REV_2_3 5 | ||
23 | #define HUB_REV_2_4 6 | ||
24 | |||
25 | #define MAX_HUB_PATH 80 | ||
26 | |||
27 | #include <asm/sn/sn0/addrs.h> | ||
28 | #include <asm/sn/sn0/hubpi.h> | ||
29 | #include <asm/sn/sn0/hubmd.h> | ||
30 | #include <asm/sn/sn0/hubio.h> | ||
31 | #include <asm/sn/sn0/hubni.h> | ||
32 | //#include <asm/sn/sn0/hubcore.h> | ||
33 | |||
34 | /* Translation of uncached attributes */ | ||
35 | #define UATTR_HSPEC 0 | ||
36 | #define UATTR_IO 1 | ||
37 | #define UATTR_MSPEC 2 | ||
38 | #define UATTR_UNCAC 3 | ||
39 | |||
40 | #endif /* _ASM_SN_SN0_HUB_H */ | ||
diff --git a/include/asm-mips/sn/sn0/hubio.h b/include/asm-mips/sn/sn0/hubio.h deleted file mode 100644 index 0187895e556c..000000000000 --- a/include/asm-mips/sn/sn0/hubio.h +++ /dev/null | |||
@@ -1,972 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Derived from IRIX <sys/SN/SN0/hubio.h>, Revision 1.80. | ||
7 | * | ||
8 | * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 1999 by Ralf Baechle | ||
10 | */ | ||
11 | #ifndef _ASM_SGI_SN_SN0_HUBIO_H | ||
12 | #define _ASM_SGI_SN_SN0_HUBIO_H | ||
13 | |||
14 | /* | ||
15 | * Hub I/O interface registers | ||
16 | * | ||
17 | * All registers in this file are subject to change until Hub chip tapeout. | ||
18 | * In general, the longer software name should be used when available. | ||
19 | */ | ||
20 | |||
21 | /* | ||
22 | * Slightly friendlier names for some common registers. | ||
23 | * The hardware definitions follow. | ||
24 | */ | ||
25 | #define IIO_WIDGET IIO_WID /* Widget identification */ | ||
26 | #define IIO_WIDGET_STAT IIO_WSTAT /* Widget status register */ | ||
27 | #define IIO_WIDGET_CTRL IIO_WCR /* Widget control register */ | ||
28 | #define IIO_WIDGET_TOUT IIO_WRTO /* Widget request timeout */ | ||
29 | #define IIO_WIDGET_FLUSH IIO_WTFR /* Widget target flush */ | ||
30 | #define IIO_PROTECT IIO_ILAPR /* IO interface protection */ | ||
31 | #define IIO_PROTECT_OVRRD IIO_ILAPO /* IO protect override */ | ||
32 | #define IIO_OUTWIDGET_ACCESS IIO_IOWA /* Outbound widget access */ | ||
33 | #define IIO_INWIDGET_ACCESS IIO_IIWA /* Inbound widget access */ | ||
34 | #define IIO_INDEV_ERR_MASK IIO_IIDEM /* Inbound device error mask */ | ||
35 | #define IIO_LLP_CSR IIO_ILCSR /* LLP control and status */ | ||
36 | #define IIO_LLP_LOG IIO_ILLR /* LLP log */ | ||
37 | #define IIO_XTALKCC_TOUT IIO_IXCC /* Xtalk credit count timeout*/ | ||
38 | #define IIO_XTALKTT_TOUT IIO_IXTT /* Xtalk tail timeout */ | ||
39 | #define IIO_IO_ERR_CLR IIO_IECLR /* IO error clear */ | ||
40 | #define IIO_BTE_CRB_CNT IIO_IBCN /* IO BTE CRB count */ | ||
41 | |||
42 | #define IIO_LLP_CSR_IS_UP 0x00002000 | ||
43 | #define IIO_LLP_CSR_LLP_STAT_MASK 0x00003000 | ||
44 | #define IIO_LLP_CSR_LLP_STAT_SHFT 12 | ||
45 | |||
46 | /* key to IIO_PROTECT_OVRRD */ | ||
47 | #define IIO_PROTECT_OVRRD_KEY 0x53474972756c6573ull /* "SGIrules" */ | ||
48 | |||
49 | /* BTE register names */ | ||
50 | #define IIO_BTE_STAT_0 IIO_IBLS_0 /* Also BTE length/status 0 */ | ||
51 | #define IIO_BTE_SRC_0 IIO_IBSA_0 /* Also BTE source address 0 */ | ||
52 | #define IIO_BTE_DEST_0 IIO_IBDA_0 /* Also BTE dest. address 0 */ | ||
53 | #define IIO_BTE_CTRL_0 IIO_IBCT_0 /* Also BTE control/terminate 0 */ | ||
54 | #define IIO_BTE_NOTIFY_0 IIO_IBNA_0 /* Also BTE notification 0 */ | ||
55 | #define IIO_BTE_INT_0 IIO_IBIA_0 /* Also BTE interrupt 0 */ | ||
56 | #define IIO_BTE_OFF_0 0 /* Base offset from BTE 0 regs. */ | ||
57 | #define IIO_BTE_OFF_1 IIO_IBLS_1 - IIO_IBLS_0 /* Offset from base to BTE 1 */ | ||
58 | |||
59 | /* BTE register offsets from base */ | ||
60 | #define BTEOFF_STAT 0 | ||
61 | #define BTEOFF_SRC (IIO_BTE_SRC_0 - IIO_BTE_STAT_0) | ||
62 | #define BTEOFF_DEST (IIO_BTE_DEST_0 - IIO_BTE_STAT_0) | ||
63 | #define BTEOFF_CTRL (IIO_BTE_CTRL_0 - IIO_BTE_STAT_0) | ||
64 | #define BTEOFF_NOTIFY (IIO_BTE_NOTIFY_0 - IIO_BTE_STAT_0) | ||
65 | #define BTEOFF_INT (IIO_BTE_INT_0 - IIO_BTE_STAT_0) | ||
66 | |||
67 | |||
68 | /* | ||
69 | * The following definitions use the names defined in the IO interface | ||
70 | * document for ease of reference. When possible, software should | ||
71 | * generally use the longer but clearer names defined above. | ||
72 | */ | ||
73 | |||
74 | #define IIO_BASE 0x400000 | ||
75 | #define IIO_BASE_BTE0 0x410000 | ||
76 | #define IIO_BASE_BTE1 0x420000 | ||
77 | #define IIO_BASE_PERF 0x430000 | ||
78 | #define IIO_PERF_CNT 0x430008 | ||
79 | |||
80 | #define IO_PERF_SETS 32 | ||
81 | |||
82 | #define IIO_WID 0x400000 /* Widget identification */ | ||
83 | #define IIO_WSTAT 0x400008 /* Widget status */ | ||
84 | #define IIO_WCR 0x400020 /* Widget control */ | ||
85 | |||
86 | #define IIO_WSTAT_ECRAZY (1ULL << 32) /* Hub gone crazy */ | ||
87 | #define IIO_WSTAT_TXRETRY (1ULL << 9) /* Hub Tx Retry timeout */ | ||
88 | #define IIO_WSTAT_TXRETRY_MASK (0x7F) | ||
89 | #define IIO_WSTAT_TXRETRY_SHFT (16) | ||
90 | #define IIO_WSTAT_TXRETRY_CNT(w) (((w) >> IIO_WSTAT_TXRETRY_SHFT) & \ | ||
91 | IIO_WSTAT_TXRETRY_MASK) | ||
92 | |||
93 | #define IIO_ILAPR 0x400100 /* Local Access Protection */ | ||
94 | #define IIO_ILAPO 0x400108 /* Protection override */ | ||
95 | #define IIO_IOWA 0x400110 /* outbound widget access */ | ||
96 | #define IIO_IIWA 0x400118 /* inbound widget access */ | ||
97 | #define IIO_IIDEM 0x400120 /* Inbound Device Error Mask */ | ||
98 | #define IIO_ILCSR 0x400128 /* LLP control and status */ | ||
99 | #define IIO_ILLR 0x400130 /* LLP Log */ | ||
100 | #define IIO_IIDSR 0x400138 /* Interrupt destination */ | ||
101 | |||
102 | #define IIO_IIBUSERR 0x1400208 /* Reads here cause a bus error. */ | ||
103 | |||
104 | /* IO Interrupt Destination Register */ | ||
105 | #define IIO_IIDSR_SENT_SHIFT 28 | ||
106 | #define IIO_IIDSR_SENT_MASK 0x10000000 | ||
107 | #define IIO_IIDSR_ENB_SHIFT 24 | ||
108 | #define IIO_IIDSR_ENB_MASK 0x01000000 | ||
109 | #define IIO_IIDSR_NODE_SHIFT 8 | ||
110 | #define IIO_IIDSR_NODE_MASK 0x0000ff00 | ||
111 | #define IIO_IIDSR_LVL_SHIFT 0 | ||
112 | #define IIO_IIDSR_LVL_MASK 0x0000003f | ||
113 | |||
114 | |||
115 | /* GFX Flow Control Node/Widget Register */ | ||
116 | #define IIO_IGFX_0 0x400140 /* gfx node/widget register 0 */ | ||
117 | #define IIO_IGFX_1 0x400148 /* gfx node/widget register 1 */ | ||
118 | #define IIO_IGFX_W_NUM_BITS 4 /* size of widget num field */ | ||
119 | #define IIO_IGFX_W_NUM_MASK ((1<<IIO_IGFX_W_NUM_BITS)-1) | ||
120 | #define IIO_IGFX_W_NUM_SHIFT 0 | ||
121 | #define IIO_IGFX_N_NUM_BITS 9 /* size of node num field */ | ||
122 | #define IIO_IGFX_N_NUM_MASK ((1<<IIO_IGFX_N_NUM_BITS)-1) | ||
123 | #define IIO_IGFX_N_NUM_SHIFT 4 | ||
124 | #define IIO_IGFX_P_NUM_BITS 1 /* size of processor num field */ | ||
125 | #define IIO_IGFX_P_NUM_MASK ((1<<IIO_IGFX_P_NUM_BITS)-1) | ||
126 | #define IIO_IGFX_P_NUM_SHIFT 16 | ||
127 | #define IIO_IGFX_VLD_BITS 1 /* size of valid field */ | ||
128 | #define IIO_IGFX_VLD_MASK ((1<<IIO_IGFX_VLD_BITS)-1) | ||
129 | #define IIO_IGFX_VLD_SHIFT 20 | ||
130 | #define IIO_IGFX_INIT(widget, node, cpu, valid) (\ | ||
131 | (((widget) & IIO_IGFX_W_NUM_MASK) << IIO_IGFX_W_NUM_SHIFT) | \ | ||
132 | (((node) & IIO_IGFX_N_NUM_MASK) << IIO_IGFX_N_NUM_SHIFT) | \ | ||
133 | (((cpu) & IIO_IGFX_P_NUM_MASK) << IIO_IGFX_P_NUM_SHIFT) | \ | ||
134 | (((valid) & IIO_IGFX_VLD_MASK) << IIO_IGFX_VLD_SHIFT) ) | ||
135 | |||
136 | /* Scratch registers (not all bits available) */ | ||
137 | #define IIO_SCRATCH_REG0 0x400150 | ||
138 | #define IIO_SCRATCH_REG1 0x400158 | ||
139 | #define IIO_SCRATCH_MASK 0x0000000f00f11fff | ||
140 | |||
141 | #define IIO_SCRATCH_BIT0_0 0x0000000800000000 | ||
142 | #define IIO_SCRATCH_BIT0_1 0x0000000400000000 | ||
143 | #define IIO_SCRATCH_BIT0_2 0x0000000200000000 | ||
144 | #define IIO_SCRATCH_BIT0_3 0x0000000100000000 | ||
145 | #define IIO_SCRATCH_BIT0_4 0x0000000000800000 | ||
146 | #define IIO_SCRATCH_BIT0_5 0x0000000000400000 | ||
147 | #define IIO_SCRATCH_BIT0_6 0x0000000000200000 | ||
148 | #define IIO_SCRATCH_BIT0_7 0x0000000000100000 | ||
149 | #define IIO_SCRATCH_BIT0_8 0x0000000000010000 | ||
150 | #define IIO_SCRATCH_BIT0_9 0x0000000000001000 | ||
151 | #define IIO_SCRATCH_BIT0_R 0x0000000000000fff | ||
152 | |||
153 | /* IO Translation Table Entries */ | ||
154 | #define IIO_NUM_ITTES 7 /* ITTEs numbered 0..6 */ | ||
155 | /* Hw manuals number them 1..7! */ | ||
156 | |||
157 | /* | ||
158 | * As a permanent workaround for a bug in the PI side of the hub, we've | ||
159 | * redefined big window 7 as small window 0. | ||
160 | */ | ||
161 | #define HUB_NUM_BIG_WINDOW IIO_NUM_ITTES - 1 | ||
162 | |||
163 | /* | ||
164 | * Use the top big window as a surrogate for the first small window | ||
165 | */ | ||
166 | #define SWIN0_BIGWIN HUB_NUM_BIG_WINDOW | ||
167 | |||
168 | #define ILCSR_WARM_RESET 0x100 | ||
169 | /* | ||
170 | * The IO LLP control status register and widget control register | ||
171 | */ | ||
172 | #ifndef __ASSEMBLY__ | ||
173 | |||
174 | typedef union hubii_wid_u { | ||
175 | u64 wid_reg_value; | ||
176 | struct { | ||
177 | u64 wid_rsvd: 32, /* unused */ | ||
178 | wid_rev_num: 4, /* revision number */ | ||
179 | wid_part_num: 16, /* the widget type: hub=c101 */ | ||
180 | wid_mfg_num: 11, /* Manufacturer id (IBM) */ | ||
181 | wid_rsvd1: 1; /* Reserved */ | ||
182 | } wid_fields_s; | ||
183 | } hubii_wid_t; | ||
184 | |||
185 | |||
186 | typedef union hubii_wcr_u { | ||
187 | u64 wcr_reg_value; | ||
188 | struct { | ||
189 | u64 wcr_rsvd: 41, /* unused */ | ||
190 | wcr_e_thresh: 5, /* elasticity threshold */ | ||
191 | wcr_dir_con: 1, /* widget direct connect */ | ||
192 | wcr_f_bad_pkt: 1, /* Force bad llp pkt enable */ | ||
193 | wcr_xbar_crd: 3, /* LLP crossbar credit */ | ||
194 | wcr_rsvd1: 8, /* Reserved */ | ||
195 | wcr_tag_mode: 1, /* Tag mode */ | ||
196 | wcr_widget_id: 4; /* LLP crossbar credit */ | ||
197 | } wcr_fields_s; | ||
198 | } hubii_wcr_t; | ||
199 | |||
200 | #define iwcr_dir_con wcr_fields_s.wcr_dir_con | ||
201 | |||
202 | typedef union hubii_wstat_u { | ||
203 | u64 reg_value; | ||
204 | struct { | ||
205 | u64 rsvd1: 31, | ||
206 | crazy: 1, /* Crazy bit */ | ||
207 | rsvd2: 8, | ||
208 | llp_tx_cnt: 8, /* LLP Xmit retry counter */ | ||
209 | rsvd3: 6, | ||
210 | tx_max_rtry: 1, /* LLP Retry Timeout Signal */ | ||
211 | rsvd4: 2, | ||
212 | xt_tail_to: 1, /* Xtalk Tail Timeout */ | ||
213 | xt_crd_to: 1, /* Xtalk Credit Timeout */ | ||
214 | pending: 4; /* Pending Requests */ | ||
215 | } wstat_fields_s; | ||
216 | } hubii_wstat_t; | ||
217 | |||
218 | |||
219 | typedef union hubii_ilcsr_u { | ||
220 | u64 icsr_reg_value; | ||
221 | struct { | ||
222 | u64 icsr_rsvd: 22, /* unused */ | ||
223 | icsr_max_burst: 10, /* max burst */ | ||
224 | icsr_rsvd4: 6, /* reserved */ | ||
225 | icsr_max_retry: 10, /* max retry */ | ||
226 | icsr_rsvd3: 2, /* reserved */ | ||
227 | icsr_lnk_stat: 2, /* link status */ | ||
228 | icsr_bm8: 1, /* Bit mode 8 */ | ||
229 | icsr_llp_en: 1, /* LLP enable bit */ | ||
230 | icsr_rsvd2: 1, /* reserver */ | ||
231 | icsr_wrm_reset: 1, /* Warm reset bit */ | ||
232 | icsr_rsvd1: 2, /* Data ready offset */ | ||
233 | icsr_null_to: 6; /* Null timeout */ | ||
234 | |||
235 | } icsr_fields_s; | ||
236 | } hubii_ilcsr_t; | ||
237 | |||
238 | |||
239 | typedef union hubii_iowa_u { | ||
240 | u64 iowa_reg_value; | ||
241 | struct { | ||
242 | u64 iowa_rsvd: 48, /* unused */ | ||
243 | iowa_wxoac: 8, /* xtalk widget access bits */ | ||
244 | iowa_rsvd1: 7, /* xtalk widget access bits */ | ||
245 | iowa_w0oac: 1; /* xtalk widget access bits */ | ||
246 | } iowa_fields_s; | ||
247 | } hubii_iowa_t; | ||
248 | |||
249 | typedef union hubii_iiwa_u { | ||
250 | u64 iiwa_reg_value; | ||
251 | struct { | ||
252 | u64 iiwa_rsvd: 48, /* unused */ | ||
253 | iiwa_wxiac: 8, /* hub wid access bits */ | ||
254 | iiwa_rsvd1: 7, /* reserved */ | ||
255 | iiwa_w0iac: 1; /* hub wid0 access */ | ||
256 | } iiwa_fields_s; | ||
257 | } hubii_iiwa_t; | ||
258 | |||
259 | typedef union hubii_illr_u { | ||
260 | u64 illr_reg_value; | ||
261 | struct { | ||
262 | u64 illr_rsvd: 32, /* unused */ | ||
263 | illr_cb_cnt: 16, /* checkbit error count */ | ||
264 | illr_sn_cnt: 16; /* sequence number count */ | ||
265 | } illr_fields_s; | ||
266 | } hubii_illr_t; | ||
267 | |||
268 | /* The structures below are defined to extract and modify the ii | ||
269 | performance registers */ | ||
270 | |||
271 | /* io_perf_sel allows the caller to specify what tests will be | ||
272 | performed */ | ||
273 | typedef union io_perf_sel { | ||
274 | u64 perf_sel_reg; | ||
275 | struct { | ||
276 | u64 perf_rsvd : 48, | ||
277 | perf_icct : 8, | ||
278 | perf_ippr1 : 4, | ||
279 | perf_ippr0 : 4; | ||
280 | } perf_sel_bits; | ||
281 | } io_perf_sel_t; | ||
282 | |||
283 | /* io_perf_cnt is to extract the count from the hub registers. Due to | ||
284 | hardware problems there is only one counter, not two. */ | ||
285 | |||
286 | typedef union io_perf_cnt { | ||
287 | u64 perf_cnt; | ||
288 | struct { | ||
289 | u64 perf_rsvd1 : 32, | ||
290 | perf_rsvd2 : 12, | ||
291 | perf_cnt : 20; | ||
292 | } perf_cnt_bits; | ||
293 | } io_perf_cnt_t; | ||
294 | |||
295 | #endif /* !__ASSEMBLY__ */ | ||
296 | |||
297 | |||
298 | #define LNK_STAT_WORKING 0x2 | ||
299 | |||
300 | #define IIO_LLP_CB_MAX 0xffff | ||
301 | #define IIO_LLP_SN_MAX 0xffff | ||
302 | |||
303 | /* IO PRB Entries */ | ||
304 | #define IIO_NUM_IPRBS (9) | ||
305 | #define IIO_IOPRB_0 0x400198 /* PRB entry 0 */ | ||
306 | #define IIO_IOPRB_8 0x4001a0 /* PRB entry 8 */ | ||
307 | #define IIO_IOPRB_9 0x4001a8 /* PRB entry 9 */ | ||
308 | #define IIO_IOPRB_A 0x4001b0 /* PRB entry a */ | ||
309 | #define IIO_IOPRB_B 0x4001b8 /* PRB entry b */ | ||
310 | #define IIO_IOPRB_C 0x4001c0 /* PRB entry c */ | ||
311 | #define IIO_IOPRB_D 0x4001c8 /* PRB entry d */ | ||
312 | #define IIO_IOPRB_E 0x4001d0 /* PRB entry e */ | ||
313 | #define IIO_IOPRB_F 0x4001d8 /* PRB entry f */ | ||
314 | |||
315 | |||
316 | #define IIO_IXCC 0x4001e0 /* Crosstalk credit count timeout */ | ||
317 | #define IIO_IXTCC IIO_IXCC | ||
318 | #define IIO_IMEM 0x4001e8 /* Miscellaneous Enable Mask */ | ||
319 | #define IIO_IXTT 0x4001f0 /* Crosstalk tail timeout */ | ||
320 | #define IIO_IECLR 0x4001f8 /* IO error clear */ | ||
321 | #define IIO_IBCN 0x400200 /* IO BTE CRB count */ | ||
322 | |||
323 | /* | ||
324 | * IIO_IMEM Register fields. | ||
325 | */ | ||
326 | #define IIO_IMEM_W0ESD 0x1 /* Widget 0 shut down due to error */ | ||
327 | #define IIO_IMEM_B0ESD (1 << 4) /* BTE 0 shut down due to error */ | ||
328 | #define IIO_IMEM_B1ESD (1 << 8) /* BTE 1 Shut down due to error */ | ||
329 | |||
330 | /* PIO Read address Table Entries */ | ||
331 | #define IIO_IPCA 0x400300 /* PRB Counter adjust */ | ||
332 | #define IIO_NUM_PRTES 8 /* Total number of PRB table entries */ | ||
333 | #define IIO_PRTE_0 0x400308 /* PIO Read address table entry 0 */ | ||
334 | #define IIO_PRTE(_x) (IIO_PRTE_0 + (8 * (_x))) | ||
335 | #define IIO_WIDPRTE(x) IIO_PRTE(((x) - 8)) /* widget ID to its PRTE num */ | ||
336 | #define IIO_IPDR 0x400388 /* PIO table entry deallocation */ | ||
337 | #define IIO_ICDR 0x400390 /* CRB Entry Deallocation */ | ||
338 | #define IIO_IFDR 0x400398 /* IOQ FIFO Depth */ | ||
339 | #define IIO_IIAP 0x4003a0 /* IIQ Arbitration Parameters */ | ||
340 | #define IIO_IMMR IIO_IIAP | ||
341 | #define IIO_ICMR 0x4003a8 /* CRB Management Register */ | ||
342 | #define IIO_ICCR 0x4003b0 /* CRB Control Register */ | ||
343 | #define IIO_ICTO 0x4003b8 /* CRB Time Out Register */ | ||
344 | #define IIO_ICTP 0x4003c0 /* CRB Time Out Prescalar */ | ||
345 | |||
346 | |||
347 | /* | ||
348 | * ICMR register fields | ||
349 | */ | ||
350 | #define IIO_ICMR_PC_VLD_SHFT 36 | ||
351 | #define IIO_ICMR_PC_VLD_MASK (0x7fffUL << IIO_ICMR_PC_VLD_SHFT) | ||
352 | |||
353 | #define IIO_ICMR_CRB_VLD_SHFT 20 | ||
354 | #define IIO_ICMR_CRB_VLD_MASK (0x7fffUL << IIO_ICMR_CRB_VLD_SHFT) | ||
355 | |||
356 | #define IIO_ICMR_FC_CNT_SHFT 16 | ||
357 | #define IIO_ICMR_FC_CNT_MASK (0xf << IIO_ICMR_FC_CNT_SHFT) | ||
358 | |||
359 | #define IIO_ICMR_C_CNT_SHFT 4 | ||
360 | #define IIO_ICMR_C_CNT_MASK (0xf << IIO_ICMR_C_CNT_SHFT) | ||
361 | |||
362 | #define IIO_ICMR_P_CNT_SHFT 0 | ||
363 | #define IIO_ICMR_P_CNT_MASK (0xf << IIO_ICMR_P_CNT_SHFT) | ||
364 | |||
365 | #define IIO_ICMR_PRECISE (1UL << 52) | ||
366 | #define IIO_ICMR_CLR_RPPD (1UL << 13) | ||
367 | #define IIO_ICMR_CLR_RQPD (1UL << 12) | ||
368 | |||
369 | /* | ||
370 | * IIO PIO Deallocation register field masks : (IIO_IPDR) | ||
371 | */ | ||
372 | #define IIO_IPDR_PND (1 << 4) | ||
373 | |||
374 | /* | ||
375 | * IIO CRB deallocation register field masks: (IIO_ICDR) | ||
376 | */ | ||
377 | #define IIO_ICDR_PND (1 << 4) | ||
378 | |||
379 | /* | ||
380 | * IIO CRB control register Fields: IIO_ICCR | ||
381 | */ | ||
382 | #define IIO_ICCR_PENDING (0x10000) | ||
383 | #define IIO_ICCR_CMD_MASK (0xFF) | ||
384 | #define IIO_ICCR_CMD_SHFT (7) | ||
385 | #define IIO_ICCR_CMD_NOP (0x0) /* No Op */ | ||
386 | #define IIO_ICCR_CMD_WAKE (0x100) /* Reactivate CRB entry and process */ | ||
387 | #define IIO_ICCR_CMD_TIMEOUT (0x200) /* Make CRB timeout & mark invalid */ | ||
388 | #define IIO_ICCR_CMD_EJECT (0x400) /* Contents of entry written to memory | ||
389 | * via a WB | ||
390 | */ | ||
391 | #define IIO_ICCR_CMD_FLUSH (0x800) | ||
392 | |||
393 | /* | ||
394 | * CRB manipulation macros | ||
395 | * The CRB macros are slightly complicated, since there are up to | ||
396 | * four registers associated with each CRB entry. | ||
397 | */ | ||
398 | #define IIO_NUM_CRBS 15 /* Number of CRBs */ | ||
399 | #define IIO_NUM_NORMAL_CRBS 12 /* Number of regular CRB entries */ | ||
400 | #define IIO_NUM_PC_CRBS 4 /* Number of partial cache CRBs */ | ||
401 | #define IIO_ICRB_OFFSET 8 | ||
402 | #define IIO_ICRB_0 0x400400 | ||
403 | /* XXX - This is now tuneable: | ||
404 | #define IIO_FIRST_PC_ENTRY 12 | ||
405 | */ | ||
406 | |||
407 | #define IIO_ICRB_A(_x) (IIO_ICRB_0 + (4 * IIO_ICRB_OFFSET * (_x))) | ||
408 | #define IIO_ICRB_B(_x) (IIO_ICRB_A(_x) + 1*IIO_ICRB_OFFSET) | ||
409 | #define IIO_ICRB_C(_x) (IIO_ICRB_A(_x) + 2*IIO_ICRB_OFFSET) | ||
410 | #define IIO_ICRB_D(_x) (IIO_ICRB_A(_x) + 3*IIO_ICRB_OFFSET) | ||
411 | |||
412 | /* XXX - IBUE register coming for Hub 2 */ | ||
413 | |||
414 | /* | ||
415 | * | ||
416 | * CRB Register description. | ||
417 | * | ||
418 | * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING | ||
419 | * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING | ||
420 | * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING | ||
421 | * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING | ||
422 | * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING | ||
423 | * | ||
424 | * Many of the fields in CRB are status bits used by hardware | ||
425 | * for implementation of the protocol. It's very dangerous to | ||
426 | * mess around with the CRB registers. | ||
427 | * | ||
428 | * It's OK to read the CRB registers and try to make sense out of the | ||
429 | * fields in CRB. | ||
430 | * | ||
431 | * Updating CRB requires all activities in Hub IIO to be quiesced. | ||
432 | * otherwise, a write to CRB could corrupt other CRB entries. | ||
433 | * CRBs are here only as a back door peek to hub IIO's status. | ||
434 | * Quiescing implies no dmas no PIOs | ||
435 | * either directly from the cpu or from sn0net. | ||
436 | * this is not something that can be done easily. So, AVOID updating | ||
437 | * CRBs. | ||
438 | */ | ||
439 | |||
440 | /* | ||
441 | * Fields in CRB Register A | ||
442 | */ | ||
443 | #ifndef __ASSEMBLY__ | ||
444 | typedef union icrba_u { | ||
445 | u64 reg_value; | ||
446 | struct { | ||
447 | u64 resvd: 6, | ||
448 | stall_bte0: 1, /* Stall BTE 0 */ | ||
449 | stall_bte1: 1, /* Stall BTE 1 */ | ||
450 | error: 1, /* CRB has an error */ | ||
451 | ecode: 3, /* Error Code */ | ||
452 | lnetuce: 1, /* SN0net Uncorrectable error */ | ||
453 | mark: 1, /* CRB Has been marked */ | ||
454 | xerr: 1, /* Error bit set in xtalk header */ | ||
455 | sidn: 4, /* SIDN field from xtalk */ | ||
456 | tnum: 5, /* TNUM field in xtalk */ | ||
457 | addr: 38, /* Address of request */ | ||
458 | valid: 1, /* Valid status */ | ||
459 | iow: 1; /* IO Write operation */ | ||
460 | } icrba_fields_s; | ||
461 | } icrba_t; | ||
462 | |||
463 | /* This is an alternate typedef for the HUB1 CRB A in order to allow | ||
464 | runtime selection of the format based on the REV_ID field of the | ||
465 | NI_STATUS_REV_ID register. */ | ||
466 | typedef union h1_icrba_u { | ||
467 | u64 reg_value; | ||
468 | |||
469 | struct { | ||
470 | u64 resvd: 6, | ||
471 | unused: 1, /* Unused but RW!! */ | ||
472 | error: 1, /* CRB has an error */ | ||
473 | ecode: 4, /* Error Code */ | ||
474 | lnetuce: 1, /* SN0net Uncorrectable error */ | ||
475 | mark: 1, /* CRB Has been marked */ | ||
476 | xerr: 1, /* Error bit set in xtalk header */ | ||
477 | sidn: 4, /* SIDN field from xtalk */ | ||
478 | tnum: 5, /* TNUM field in xtalk */ | ||
479 | addr: 38, /* Address of request */ | ||
480 | valid: 1, /* Valid status */ | ||
481 | iow: 1; /* IO Write operation */ | ||
482 | } h1_icrba_fields_s; | ||
483 | } h1_icrba_t; | ||
484 | |||
485 | /* XXX - Is this still right? Check the spec. */ | ||
486 | #define ICRBN_A_CERR_SHFT 54 | ||
487 | #define ICRBN_A_ERR_MASK 0x3ff | ||
488 | |||
489 | #endif /* !__ASSEMBLY__ */ | ||
490 | |||
491 | #define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */ | ||
492 | |||
493 | /* | ||
494 | * values for "ecode" field | ||
495 | */ | ||
496 | #define IIO_ICRB_ECODE_DERR 0 /* Directory error due to IIO access */ | ||
497 | #define IIO_ICRB_ECODE_PERR 1 /* Poison error on IO access */ | ||
498 | #define IIO_ICRB_ECODE_WERR 2 /* Write error by IIO access | ||
499 | * e.g. WINV to a Read only line. | ||
500 | */ | ||
501 | #define IIO_ICRB_ECODE_AERR 3 /* Access error caused by IIO access */ | ||
502 | #define IIO_ICRB_ECODE_PWERR 4 /* Error on partial write */ | ||
503 | #define IIO_ICRB_ECODE_PRERR 5 /* Error on partial read */ | ||
504 | #define IIO_ICRB_ECODE_TOUT 6 /* CRB timeout before deallocating */ | ||
505 | #define IIO_ICRB_ECODE_XTERR 7 /* Incoming xtalk pkt had error bit */ | ||
506 | |||
507 | |||
508 | |||
509 | /* | ||
510 | * Fields in CRB Register B | ||
511 | */ | ||
512 | #ifndef __ASSEMBLY__ | ||
513 | typedef union icrbb_u { | ||
514 | u64 reg_value; | ||
515 | struct { | ||
516 | u64 rsvd1: 5, | ||
517 | btenum: 1, /* BTE to which entry belongs to */ | ||
518 | cohtrans: 1, /* Coherent transaction */ | ||
519 | xtsize: 2, /* Xtalk operation size | ||
520 | * 0: Double Word | ||
521 | * 1: 32 Bytes. | ||
522 | * 2: 128 Bytes, | ||
523 | * 3: Reserved. | ||
524 | */ | ||
525 | srcnode: 9, /* Source Node ID */ | ||
526 | srcinit: 2, /* Source Initiator: | ||
527 | * See below for field values. | ||
528 | */ | ||
529 | useold: 1, /* Use OLD command for processing */ | ||
530 | imsgtype: 2, /* Incoming message type | ||
531 | * see below for field values | ||
532 | */ | ||
533 | imsg: 8, /* Incoming message */ | ||
534 | initator: 3, /* Initiator of original request | ||
535 | * See below for field values. | ||
536 | */ | ||
537 | reqtype: 5, /* Identifies type of request | ||
538 | * See below for field values. | ||
539 | */ | ||
540 | rsvd2: 7, | ||
541 | ackcnt: 11, /* Invalidate ack count */ | ||
542 | resp: 1, /* data response given to processor */ | ||
543 | ack: 1, /* indicates data ack received */ | ||
544 | hold: 1, /* entry is gathering inval acks */ | ||
545 | wb_pend:1, /* waiting for writeback to complete */ | ||
546 | intvn: 1, /* Intervention */ | ||
547 | stall_ib: 1, /* Stall Ibuf (from crosstalk) */ | ||
548 | stall_intr: 1; /* Stall internal interrupts */ | ||
549 | } icrbb_field_s; | ||
550 | } icrbb_t; | ||
551 | |||
552 | /* This is an alternate typedef for the HUB1 CRB B in order to allow | ||
553 | runtime selection of the format based on the REV_ID field of the | ||
554 | NI_STATUS_REV_ID register. */ | ||
555 | typedef union h1_icrbb_u { | ||
556 | u64 reg_value; | ||
557 | struct { | ||
558 | u64 rsvd1: 5, | ||
559 | btenum: 1, /* BTE to which entry belongs to */ | ||
560 | cohtrans: 1, /* Coherent transaction */ | ||
561 | xtsize: 2, /* Xtalk operation size | ||
562 | * 0: Double Word | ||
563 | * 1: 32 Bytes. | ||
564 | * 2: 128 Bytes, | ||
565 | * 3: Reserved. | ||
566 | */ | ||
567 | srcnode: 9, /* Source Node ID */ | ||
568 | srcinit: 2, /* Source Initiator: | ||
569 | * See below for field values. | ||
570 | */ | ||
571 | useold: 1, /* Use OLD command for processing */ | ||
572 | imsgtype: 2, /* Incoming message type | ||
573 | * see below for field values | ||
574 | */ | ||
575 | imsg: 8, /* Incoming message */ | ||
576 | initator: 3, /* Initiator of original request | ||
577 | * See below for field values. | ||
578 | */ | ||
579 | rsvd2: 1, | ||
580 | pcache: 1, /* entry belongs to partial cache */ | ||
581 | reqtype: 5, /* Identifies type of request | ||
582 | * See below for field values. | ||
583 | */ | ||
584 | stl_ib: 1, /* stall Ibus coming from xtalk */ | ||
585 | stl_intr: 1, /* Stall internal interrupts */ | ||
586 | stl_bte0: 1, /* Stall BTE 0 */ | ||
587 | stl_bte1: 1, /* Stall BTE 1 */ | ||
588 | intrvn: 1, /* Req was target of intervention */ | ||
589 | ackcnt: 11, /* Invalidate ack count */ | ||
590 | resp: 1, /* data response given to processor */ | ||
591 | ack: 1, /* indicates data ack received */ | ||
592 | hold: 1, /* entry is gathering inval acks */ | ||
593 | wb_pend:1, /* waiting for writeback to complete */ | ||
594 | sleep: 1, /* xtalk req sleeping till IO-sync */ | ||
595 | pnd_reply: 1, /* replies not issed due to IOQ full */ | ||
596 | pnd_req: 1; /* reqs not issued due to IOQ full */ | ||
597 | } h1_icrbb_field_s; | ||
598 | } h1_icrbb_t; | ||
599 | |||
600 | |||
601 | #define b_imsgtype icrbb_field_s.imsgtype | ||
602 | #define b_btenum icrbb_field_s.btenum | ||
603 | #define b_cohtrans icrbb_field_s.cohtrans | ||
604 | #define b_xtsize icrbb_field_s.xtsize | ||
605 | #define b_srcnode icrbb_field_s.srcnode | ||
606 | #define b_srcinit icrbb_field_s.srcinit | ||
607 | #define b_imsgtype icrbb_field_s.imsgtype | ||
608 | #define b_imsg icrbb_field_s.imsg | ||
609 | #define b_initiator icrbb_field_s.initiator | ||
610 | |||
611 | #endif /* !__ASSEMBLY__ */ | ||
612 | |||
613 | /* | ||
614 | * values for field xtsize | ||
615 | */ | ||
616 | #define IIO_ICRB_XTSIZE_DW 0 /* Xtalk operation size is 8 bytes */ | ||
617 | #define IIO_ICRB_XTSIZE_32 1 /* Xtalk operation size is 32 bytes */ | ||
618 | #define IIO_ICRB_XTSIZE_128 2 /* Xtalk operation size is 128 bytes */ | ||
619 | |||
620 | /* | ||
621 | * values for field srcinit | ||
622 | */ | ||
623 | #define IIO_ICRB_PROC0 0 /* Source of request is Proc 0 */ | ||
624 | #define IIO_ICRB_PROC1 1 /* Source of request is Proc 1 */ | ||
625 | #define IIO_ICRB_GB_REQ 2 /* Source is Guranteed BW request */ | ||
626 | #define IIO_ICRB_IO_REQ 3 /* Source is Normal IO request */ | ||
627 | |||
628 | /* | ||
629 | * Values for field imsgtype | ||
630 | */ | ||
631 | #define IIO_ICRB_IMSGT_XTALK 0 /* Incoming Meessage from Xtalk */ | ||
632 | #define IIO_ICRB_IMSGT_BTE 1 /* Incoming message from BTE */ | ||
633 | #define IIO_ICRB_IMSGT_SN0NET 2 /* Incoming message from SN0 net */ | ||
634 | #define IIO_ICRB_IMSGT_CRB 3 /* Incoming message from CRB ??? */ | ||
635 | |||
636 | /* | ||
637 | * values for field initiator. | ||
638 | */ | ||
639 | #define IIO_ICRB_INIT_XTALK 0 /* Message originated in xtalk */ | ||
640 | #define IIO_ICRB_INIT_BTE0 0x1 /* Message originated in BTE 0 */ | ||
641 | #define IIO_ICRB_INIT_SN0NET 0x2 /* Message originated in SN0net */ | ||
642 | #define IIO_ICRB_INIT_CRB 0x3 /* Message originated in CRB ? */ | ||
643 | #define IIO_ICRB_INIT_BTE1 0x5 /* MEssage originated in BTE 1 */ | ||
644 | |||
645 | /* | ||
646 | * Values for field reqtype. | ||
647 | */ | ||
648 | /* XXX - Need to fix this for Hub 2 */ | ||
649 | #define IIO_ICRB_REQ_DWRD 0 /* Request type double word */ | ||
650 | #define IIO_ICRB_REQ_QCLRD 1 /* Request is Qrtr Caceh line Rd */ | ||
651 | #define IIO_ICRB_REQ_BLKRD 2 /* Request is block read */ | ||
652 | #define IIO_ICRB_REQ_RSHU 6 /* Request is BTE block read */ | ||
653 | #define IIO_ICRB_REQ_REXU 7 /* request is BTE Excl Read */ | ||
654 | #define IIO_ICRB_REQ_RDEX 8 /* Request is Read Exclusive */ | ||
655 | #define IIO_ICRB_REQ_WINC 9 /* Request is Write Invalidate */ | ||
656 | #define IIO_ICRB_REQ_BWINV 10 /* Request is BTE Winv */ | ||
657 | #define IIO_ICRB_REQ_PIORD 11 /* Request is PIO read */ | ||
658 | #define IIO_ICRB_REQ_PIOWR 12 /* Request is PIO Write */ | ||
659 | #define IIO_ICRB_REQ_PRDM 13 /* Request is Fetch&Op */ | ||
660 | #define IIO_ICRB_REQ_PWRM 14 /* Request is Store &Op */ | ||
661 | #define IIO_ICRB_REQ_PTPWR 15 /* Request is Peer to peer */ | ||
662 | #define IIO_ICRB_REQ_WB 16 /* Request is Write back */ | ||
663 | #define IIO_ICRB_REQ_DEX 17 /* Retained DEX Cache line */ | ||
664 | |||
665 | /* | ||
666 | * Fields in CRB Register C | ||
667 | */ | ||
668 | |||
669 | #ifndef __ASSEMBLY__ | ||
670 | |||
671 | typedef union icrbc_s { | ||
672 | u64 reg_value; | ||
673 | struct { | ||
674 | u64 rsvd: 6, | ||
675 | sleep: 1, | ||
676 | pricnt: 4, /* Priority count sent with Read req */ | ||
677 | pripsc: 4, /* Priority Pre scalar */ | ||
678 | bteop: 1, /* BTE Operation */ | ||
679 | push_be: 34, /* Push address Byte enable | ||
680 | * Holds push addr, if CRB is for BTE | ||
681 | * If CRB belongs to Partial cache, | ||
682 | * this contains byte enables bits | ||
683 | * ([47:46] = 0) | ||
684 | */ | ||
685 | suppl: 11, /* Supplemental field */ | ||
686 | barrop: 1, /* Barrier Op bit set in xtalk req */ | ||
687 | doresp: 1, /* Xtalk req needs a response */ | ||
688 | gbr: 1; /* GBR bit set in xtalk packet */ | ||
689 | } icrbc_field_s; | ||
690 | } icrbc_t; | ||
691 | |||
692 | #define c_pricnt icrbc_field_s.pricnt | ||
693 | #define c_pripsc icrbc_field_s.pripsc | ||
694 | #define c_bteop icrbc_field_s.bteop | ||
695 | #define c_bteaddr icrbc_field_s.push_be /* push_be field has 2 names */ | ||
696 | #define c_benable icrbc_field_s.push_be /* push_be field has 2 names */ | ||
697 | #define c_suppl icrbc_field_s.suppl | ||
698 | #define c_barrop icrbc_field_s.barrop | ||
699 | #define c_doresp icrbc_field_s.doresp | ||
700 | #define c_gbr icrbc_field_s.gbr | ||
701 | #endif /* !__ASSEMBLY__ */ | ||
702 | |||
703 | /* | ||
704 | * Fields in CRB Register D | ||
705 | */ | ||
706 | |||
707 | #ifndef __ASSEMBLY__ | ||
708 | typedef union icrbd_s { | ||
709 | u64 reg_value; | ||
710 | struct { | ||
711 | u64 rsvd: 38, | ||
712 | toutvld: 1, /* Timeout in progress for this CRB */ | ||
713 | ctxtvld: 1, /* Context field below is valid */ | ||
714 | rsvd2: 1, | ||
715 | context: 15, /* Bit vector: | ||
716 | * Has a bit set for each CRB entry | ||
717 | * which needs to be deallocated | ||
718 | * before this CRB entry is processed. | ||
719 | * Set only for barrier operations. | ||
720 | */ | ||
721 | timeout: 8; /* Timeout Upper 8 bits */ | ||
722 | } icrbd_field_s; | ||
723 | } icrbd_t; | ||
724 | |||
725 | #define icrbd_toutvld icrbd_field_s.toutvld | ||
726 | #define icrbd_ctxtvld icrbd_field_s.ctxtvld | ||
727 | #define icrbd_context icrbd_field_s.context | ||
728 | |||
729 | |||
730 | typedef union hubii_ifdr_u { | ||
731 | u64 hi_ifdr_value; | ||
732 | struct { | ||
733 | u64 ifdr_rsvd: 49, | ||
734 | ifdr_maxrp: 7, | ||
735 | ifdr_rsvd1: 1, | ||
736 | ifdr_maxrq: 7; | ||
737 | } hi_ifdr_fields; | ||
738 | } hubii_ifdr_t; | ||
739 | |||
740 | #endif /* !__ASSEMBLY__ */ | ||
741 | |||
742 | /* | ||
743 | * Hardware designed names for the BTE control registers. | ||
744 | */ | ||
745 | #define IIO_IBLS_0 0x410000 /* BTE length/status 0 */ | ||
746 | #define IIO_IBSA_0 0x410008 /* BTE source address 0 */ | ||
747 | #define IIO_IBDA_0 0x410010 /* BTE destination address 0 */ | ||
748 | #define IIO_IBCT_0 0x410018 /* BTE control/terminate 0 */ | ||
749 | #define IIO_IBNA_0 0x410020 /* BTE notification address 0 */ | ||
750 | #define IIO_IBNR_0 IIO_IBNA_0 | ||
751 | #define IIO_IBIA_0 0x410028 /* BTE interrupt address 0 */ | ||
752 | |||
753 | #define IIO_IBLS_1 0x420000 /* BTE length/status 1 */ | ||
754 | #define IIO_IBSA_1 0x420008 /* BTE source address 1 */ | ||
755 | #define IIO_IBDA_1 0x420010 /* BTE destination address 1 */ | ||
756 | #define IIO_IBCT_1 0x420018 /* BTE control/terminate 1 */ | ||
757 | #define IIO_IBNA_1 0x420020 /* BTE notification address 1 */ | ||
758 | #define IIO_IBNR_1 IIO_IBNA_1 | ||
759 | #define IIO_IBIA_1 0x420028 /* BTE interrupt address 1 */ | ||
760 | |||
761 | /* | ||
762 | * More miscellaneous registers | ||
763 | */ | ||
764 | #define IIO_IPCR 0x430000 /* Performance Control */ | ||
765 | #define IIO_IPPR 0x430008 /* Performance Profiling */ | ||
766 | |||
767 | /* | ||
768 | * IO Error Clear register bit field definitions | ||
769 | */ | ||
770 | #define IECLR_BTE1 (1 << 18) /* clear bte error 1 ??? */ | ||
771 | #define IECLR_BTE0 (1 << 17) /* clear bte error 0 ??? */ | ||
772 | #define IECLR_CRAZY (1 << 16) /* clear crazy bit in wstat reg */ | ||
773 | #define IECLR_PRB_F (1 << 15) /* clear err bit in PRB_F reg */ | ||
774 | #define IECLR_PRB_E (1 << 14) /* clear err bit in PRB_E reg */ | ||
775 | #define IECLR_PRB_D (1 << 13) /* clear err bit in PRB_D reg */ | ||
776 | #define IECLR_PRB_C (1 << 12) /* clear err bit in PRB_C reg */ | ||
777 | #define IECLR_PRB_B (1 << 11) /* clear err bit in PRB_B reg */ | ||
778 | #define IECLR_PRB_A (1 << 10) /* clear err bit in PRB_A reg */ | ||
779 | #define IECLR_PRB_9 (1 << 9) /* clear err bit in PRB_9 reg */ | ||
780 | #define IECLR_PRB_8 (1 << 8) /* clear err bit in PRB_8 reg */ | ||
781 | #define IECLR_PRB_0 (1 << 0) /* clear err bit in PRB_0 reg */ | ||
782 | |||
783 | /* | ||
784 | * IO PIO Read Table Entry format | ||
785 | */ | ||
786 | |||
787 | #ifndef __ASSEMBLY__ | ||
788 | |||
789 | typedef union iprte_a { | ||
790 | u64 entry; | ||
791 | struct { | ||
792 | u64 rsvd1 : 7, /* Reserved field */ | ||
793 | valid : 1, /* Maps to a timeout entry */ | ||
794 | rsvd2 : 1, | ||
795 | srcnode : 9, /* Node which did this PIO */ | ||
796 | initiator : 2, /* If T5A or T5B or IO */ | ||
797 | rsvd3 : 3, | ||
798 | addr : 38, /* Physical address of PIO */ | ||
799 | rsvd4 : 3; | ||
800 | } iprte_fields; | ||
801 | } iprte_a_t; | ||
802 | |||
803 | #define iprte_valid iprte_fields.valid | ||
804 | #define iprte_timeout iprte_fields.timeout | ||
805 | #define iprte_srcnode iprte_fields.srcnode | ||
806 | #define iprte_init iprte_fields.initiator | ||
807 | #define iprte_addr iprte_fields.addr | ||
808 | |||
809 | #endif /* !__ASSEMBLY__ */ | ||
810 | |||
811 | #define IPRTE_ADDRSHFT 3 | ||
812 | |||
813 | /* | ||
814 | * Hub IIO PRB Register format. | ||
815 | */ | ||
816 | |||
817 | #ifndef __ASSEMBLY__ | ||
818 | /* | ||
819 | * Note: Fields bnakctr, anakctr, xtalkctrmode, ovflow fields are | ||
820 | * "Status" fields, and should only be used in case of clean up after errors. | ||
821 | */ | ||
822 | |||
823 | typedef union iprb_u { | ||
824 | u64 reg_value; | ||
825 | struct { | ||
826 | u64 rsvd1: 15, | ||
827 | error: 1, /* Widget rcvd wr resp pkt w/ error */ | ||
828 | ovflow: 5, /* Over flow count. perf measurement */ | ||
829 | fire_and_forget: 1, /* Launch Write without response */ | ||
830 | mode: 2, /* Widget operation Mode */ | ||
831 | rsvd2: 2, | ||
832 | bnakctr: 14, | ||
833 | rsvd3: 2, | ||
834 | anakctr: 14, | ||
835 | xtalkctr: 8; | ||
836 | } iprb_fields_s; | ||
837 | } iprb_t; | ||
838 | |||
839 | #define iprb_regval reg_value | ||
840 | |||
841 | #define iprb_error iprb_fields_s.error | ||
842 | #define iprb_ovflow iprb_fields_s.ovflow | ||
843 | #define iprb_ff iprb_fields_s.fire_and_forget | ||
844 | #define iprb_mode iprb_fields_s.mode | ||
845 | #define iprb_bnakctr iprb_fields_s.bnakctr | ||
846 | #define iprb_anakctr iprb_fields_s.anakctr | ||
847 | #define iprb_xtalkctr iprb_fields_s.xtalkctr | ||
848 | |||
849 | #endif /* !__ASSEMBLY__ */ | ||
850 | |||
851 | /* | ||
852 | * values for mode field in iprb_t. | ||
853 | * For details of the meanings of NAK and Accept, refer the PIO flow | ||
854 | * document | ||
855 | */ | ||
856 | #define IPRB_MODE_NORMAL (0) | ||
857 | #define IPRB_MODE_COLLECT_A (1) /* PRB in collect A mode */ | ||
858 | #define IPRB_MODE_SERVICE_A (2) /* NAK B and Accept A */ | ||
859 | #define IPRB_MODE_SERVICE_B (3) /* NAK A and Accept B */ | ||
860 | |||
861 | /* | ||
862 | * IO CRB entry C_A to E_A : Partial (cache) CRBS | ||
863 | */ | ||
864 | #ifndef __ASSEMBLY__ | ||
865 | typedef union icrbp_a { | ||
866 | u64 ip_reg; /* the entire register value */ | ||
867 | struct { | ||
868 | u64 error: 1, /* 63, error occurred */ | ||
869 | ln_uce: 1, /* 62: uncorrectable memory */ | ||
870 | ln_ae: 1, /* 61: protection violation */ | ||
871 | ln_werr:1, /* 60: write access error */ | ||
872 | ln_aerr:1, /* 59: sn0net: Address error */ | ||
873 | ln_perr:1, /* 58: sn0net: poison error */ | ||
874 | timeout:1, /* 57: CRB timed out */ | ||
875 | l_bdpkt:1, /* 56: truncated pkt on sn0net */ | ||
876 | c_bdpkt:1, /* 55: truncated pkt on xtalk */ | ||
877 | c_err: 1, /* 54: incoming xtalk req, err set*/ | ||
878 | rsvd1: 12, /* 53-42: reserved */ | ||
879 | valid: 1, /* 41: Valid status */ | ||
880 | sidn: 4, /* 40-37: SIDN field of xtalk rqst */ | ||
881 | tnum: 5, /* 36-32: TNUM of xtalk request */ | ||
882 | bo: 1, /* 31: barrier op set in xtalk rqst*/ | ||
883 | resprqd:1, /* 30: xtalk rqst requires response*/ | ||
884 | gbr: 1, /* 29: gbr bit set in xtalk rqst */ | ||
885 | size: 2, /* 28-27: size of xtalk request */ | ||
886 | excl: 4, /* 26-23: exclusive bit(s) */ | ||
887 | stall: 3, /* 22-20: stall (xtalk, bte 0/1) */ | ||
888 | intvn: 1, /* 19: rqst target of intervention*/ | ||
889 | resp: 1, /* 18: Data response given to t5 */ | ||
890 | ack: 1, /* 17: Data ack received. */ | ||
891 | hold: 1, /* 16: crb gathering invalidate acks*/ | ||
892 | wb: 1, /* 15: writeback pending. */ | ||
893 | ack_cnt:11, /* 14-04: counter of invalidate acks*/ | ||
894 | tscaler:4; /* 03-00: Timeout prescaler */ | ||
895 | } ip_fmt; | ||
896 | } icrbp_a_t; | ||
897 | |||
898 | #endif /* !__ASSEMBLY__ */ | ||
899 | |||
900 | /* | ||
901 | * A couple of defines to go with the above structure. | ||
902 | */ | ||
903 | #define ICRBP_A_CERR_SHFT 54 | ||
904 | #define ICRBP_A_ERR_MASK 0x3ff | ||
905 | |||
906 | #ifndef __ASSEMBLY__ | ||
907 | typedef union hubii_idsr { | ||
908 | u64 iin_reg; | ||
909 | struct { | ||
910 | u64 rsvd1 : 35, | ||
911 | isent : 1, | ||
912 | rsvd2 : 3, | ||
913 | ienable: 1, | ||
914 | rsvd : 7, | ||
915 | node : 9, | ||
916 | rsvd4 : 1, | ||
917 | level : 7; | ||
918 | } iin_fmt; | ||
919 | } hubii_idsr_t; | ||
920 | #endif /* !__ASSEMBLY__ */ | ||
921 | |||
922 | /* | ||
923 | * IO BTE Length/Status (IIO_IBLS) register bit field definitions | ||
924 | */ | ||
925 | #define IBLS_BUSY (0x1 << 20) | ||
926 | #define IBLS_ERROR_SHFT 16 | ||
927 | #define IBLS_ERROR (0x1 << IBLS_ERROR_SHFT) | ||
928 | #define IBLS_LENGTH_MASK 0xffff | ||
929 | |||
930 | /* | ||
931 | * IO BTE Control/Terminate register (IBCT) register bit field definitions | ||
932 | */ | ||
933 | #define IBCT_POISON (0x1 << 8) | ||
934 | #define IBCT_NOTIFY (0x1 << 4) | ||
935 | #define IBCT_ZFIL_MODE (0x1 << 0) | ||
936 | |||
937 | /* | ||
938 | * IO BTE Interrupt Address Register (IBIA) register bit field definitions | ||
939 | */ | ||
940 | #define IBIA_LEVEL_SHFT 16 | ||
941 | #define IBIA_LEVEL_MASK (0x7f << IBIA_LEVEL_SHFT) | ||
942 | #define IBIA_NODE_ID_SHFT 0 | ||
943 | #define IBIA_NODE_ID_MASK (0x1ff) | ||
944 | |||
945 | /* | ||
946 | * Miscellaneous hub constants | ||
947 | */ | ||
948 | |||
949 | /* Number of widgets supported by hub */ | ||
950 | #define HUB_NUM_WIDGET 9 | ||
951 | #define HUB_WIDGET_ID_MIN 0x8 | ||
952 | #define HUB_WIDGET_ID_MAX 0xf | ||
953 | |||
954 | #define HUB_WIDGET_PART_NUM 0xc101 | ||
955 | #define MAX_HUBS_PER_XBOW 2 | ||
956 | |||
957 | /* | ||
958 | * Get a hub's widget id from widget control register | ||
959 | */ | ||
960 | #define IIO_WCR_WID_GET(nasid) (REMOTE_HUB_L(nasid, III_WCR) & 0xf) | ||
961 | #define IIO_WST_ERROR_MASK (UINT64_CAST 1 << 32) /* Widget status error */ | ||
962 | |||
963 | /* | ||
964 | * Number of credits Hub widget has while sending req/response to | ||
965 | * xbow. | ||
966 | * Value of 3 is required by Xbow 1.1 | ||
967 | * We may be able to increase this to 4 with Xbow 1.2. | ||
968 | */ | ||
969 | #define HUBII_XBOW_CREDIT 3 | ||
970 | #define HUBII_XBOW_REV2_CREDIT 4 | ||
971 | |||
972 | #endif /* _ASM_SGI_SN_SN0_HUBIO_H */ | ||
diff --git a/include/asm-mips/sn/sn0/hubmd.h b/include/asm-mips/sn/sn0/hubmd.h deleted file mode 100644 index 14c225d80664..000000000000 --- a/include/asm-mips/sn/sn0/hubmd.h +++ /dev/null | |||
@@ -1,789 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Derived from IRIX <sys/SN/SN0/hubmd.h>, revision 1.59. | ||
7 | * | ||
8 | * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 1999 by Ralf Baechle | ||
10 | */ | ||
11 | #ifndef _ASM_SN_SN0_HUBMD_H | ||
12 | #define _ASM_SN_SN0_HUBMD_H | ||
13 | |||
14 | |||
15 | /* | ||
16 | * Hub Memory/Directory interface registers | ||
17 | */ | ||
18 | #define CACHE_SLINE_SIZE 128 /* Secondary cache line size on SN0 */ | ||
19 | |||
20 | #define MAX_REGIONS 64 | ||
21 | |||
22 | /* Hardware page size and shift */ | ||
23 | |||
24 | #define MD_PAGE_SIZE 4096 /* Page size in bytes */ | ||
25 | #define MD_PAGE_NUM_SHFT 12 /* Address to page number shift */ | ||
26 | |||
27 | /* Register offsets from LOCAL_HUB or REMOTE_HUB */ | ||
28 | |||
29 | #define MD_BASE 0x200000 | ||
30 | #define MD_BASE_PERF 0x210000 | ||
31 | #define MD_BASE_JUNK 0x220000 | ||
32 | |||
33 | #define MD_IO_PROTECT 0x200000 /* MD and core register protection */ | ||
34 | #define MD_IO_PROT_OVRRD 0x200008 /* Clear my bit in MD_IO_PROTECT */ | ||
35 | #define MD_HSPEC_PROTECT 0x200010 /* BDDIR, LBOOT, RBOOT protection */ | ||
36 | #define MD_MEMORY_CONFIG 0x200018 /* Memory/Directory DIMM control */ | ||
37 | #define MD_REFRESH_CONTROL 0x200020 /* Memory/Directory refresh ctrl */ | ||
38 | #define MD_FANDOP_CAC_STAT 0x200028 /* Fetch-and-op cache status */ | ||
39 | #define MD_MIG_DIFF_THRESH 0x200030 /* Page migr. count diff thresh. */ | ||
40 | #define MD_MIG_VALUE_THRESH 0x200038 /* Page migr. count abs. thresh. */ | ||
41 | #define MD_MIG_CANDIDATE 0x200040 /* Latest page migration candidate */ | ||
42 | #define MD_MIG_CANDIDATE_CLR 0x200048 /* Clear page migration candidate */ | ||
43 | #define MD_DIR_ERROR 0x200050 /* Directory DIMM error */ | ||
44 | #define MD_DIR_ERROR_CLR 0x200058 /* Directory DIMM error clear */ | ||
45 | #define MD_PROTOCOL_ERROR 0x200060 /* Directory protocol error */ | ||
46 | #define MD_PROTOCOL_ERROR_CLR 0x200068 /* Directory protocol error clear */ | ||
47 | #define MD_MEM_ERROR 0x200070 /* Memory DIMM error */ | ||
48 | #define MD_MEM_ERROR_CLR 0x200078 /* Memory DIMM error clear */ | ||
49 | #define MD_MISC_ERROR 0x200080 /* Miscellaneous MD error */ | ||
50 | #define MD_MISC_ERROR_CLR 0x200088 /* Miscellaneous MD error clear */ | ||
51 | #define MD_MEM_DIMM_INIT 0x200090 /* Memory DIMM mode initization. */ | ||
52 | #define MD_DIR_DIMM_INIT 0x200098 /* Directory DIMM mode init. */ | ||
53 | #define MD_MOQ_SIZE 0x2000a0 /* MD outgoing queue size */ | ||
54 | #define MD_MLAN_CTL 0x2000a8 /* NIC (Microlan) control register */ | ||
55 | |||
56 | #define MD_PERF_SEL 0x210000 /* Select perf monitor events */ | ||
57 | #define MD_PERF_CNT0 0x210010 /* Performance counter 0 */ | ||
58 | #define MD_PERF_CNT1 0x210018 /* Performance counter 1 */ | ||
59 | #define MD_PERF_CNT2 0x210020 /* Performance counter 2 */ | ||
60 | #define MD_PERF_CNT3 0x210028 /* Performance counter 3 */ | ||
61 | #define MD_PERF_CNT4 0x210030 /* Performance counter 4 */ | ||
62 | #define MD_PERF_CNT5 0x210038 /* Performance counter 5 */ | ||
63 | |||
64 | #define MD_UREG0_0 0x220000 /* uController/UART 0 register */ | ||
65 | #define MD_UREG0_1 0x220008 /* uController/UART 0 register */ | ||
66 | #define MD_UREG0_2 0x220010 /* uController/UART 0 register */ | ||
67 | #define MD_UREG0_3 0x220018 /* uController/UART 0 register */ | ||
68 | #define MD_UREG0_4 0x220020 /* uController/UART 0 register */ | ||
69 | #define MD_UREG0_5 0x220028 /* uController/UART 0 register */ | ||
70 | #define MD_UREG0_6 0x220030 /* uController/UART 0 register */ | ||
71 | #define MD_UREG0_7 0x220038 /* uController/UART 0 register */ | ||
72 | |||
73 | #define MD_SLOTID_USTAT 0x220048 /* Hub slot ID & UART/uCtlr status */ | ||
74 | #define MD_LED0 0x220050 /* Eight-bit LED for CPU A */ | ||
75 | #define MD_LED1 0x220058 /* Eight-bit LED for CPU B */ | ||
76 | |||
77 | #define MD_UREG1_0 0x220080 /* uController/UART 1 register */ | ||
78 | #define MD_UREG1_1 0x220088 /* uController/UART 1 register */ | ||
79 | #define MD_UREG1_2 0x220090 /* uController/UART 1 register */ | ||
80 | #define MD_UREG1_3 0x220098 /* uController/UART 1 register */ | ||
81 | #define MD_UREG1_4 0x2200a0 /* uController/UART 1 register */ | ||
82 | #define MD_UREG1_5 0x2200a8 /* uController/UART 1 register */ | ||
83 | #define MD_UREG1_6 0x2200b0 /* uController/UART 1 register */ | ||
84 | #define MD_UREG1_7 0x2200b8 /* uController/UART 1 register */ | ||
85 | #define MD_UREG1_8 0x2200c0 /* uController/UART 1 register */ | ||
86 | #define MD_UREG1_9 0x2200c8 /* uController/UART 1 register */ | ||
87 | #define MD_UREG1_10 0x2200d0 /* uController/UART 1 register */ | ||
88 | #define MD_UREG1_11 0x2200d8 /* uController/UART 1 register */ | ||
89 | #define MD_UREG1_12 0x2200e0 /* uController/UART 1 register */ | ||
90 | #define MD_UREG1_13 0x2200e8 /* uController/UART 1 register */ | ||
91 | #define MD_UREG1_14 0x2200f0 /* uController/UART 1 register */ | ||
92 | #define MD_UREG1_15 0x2200f8 /* uController/UART 1 register */ | ||
93 | |||
94 | #ifdef CONFIG_SGI_SN_N_MODE | ||
95 | #define MD_MEM_BANKS 4 /* 4 banks of memory max in N mode */ | ||
96 | #else | ||
97 | #define MD_MEM_BANKS 8 /* 8 banks of memory max in M mode */ | ||
98 | #endif | ||
99 | |||
100 | /* | ||
101 | * MD_MEMORY_CONFIG fields | ||
102 | * | ||
103 | * MD_SIZE_xxx are useful for representing the size of a SIMM or bank | ||
104 | * (SIMM pair). They correspond to the values needed for the bit | ||
105 | * triplets (MMC_BANK_MASK) in the MD_MEMORY_CONFIG register for bank size. | ||
106 | * Bits not used by the MD are used by software. | ||
107 | */ | ||
108 | |||
109 | #define MD_SIZE_EMPTY 0 /* Valid in MEMORY_CONFIG */ | ||
110 | #define MD_SIZE_8MB 1 | ||
111 | #define MD_SIZE_16MB 2 | ||
112 | #define MD_SIZE_32MB 3 /* Broken in Hub 1 */ | ||
113 | #define MD_SIZE_64MB 4 /* Valid in MEMORY_CONFIG */ | ||
114 | #define MD_SIZE_128MB 5 /* Valid in MEMORY_CONFIG */ | ||
115 | #define MD_SIZE_256MB 6 | ||
116 | #define MD_SIZE_512MB 7 /* Valid in MEMORY_CONFIG */ | ||
117 | #define MD_SIZE_1GB 8 | ||
118 | #define MD_SIZE_2GB 9 | ||
119 | #define MD_SIZE_4GB 10 | ||
120 | |||
121 | #define MD_SIZE_BYTES(size) ((size) == 0 ? 0 : 0x400000L << (size)) | ||
122 | #define MD_SIZE_MBYTES(size) ((size) == 0 ? 0 : 4 << (size)) | ||
123 | |||
124 | #define MMC_FPROM_CYC_SHFT 49 /* Have to use UINT64_CAST, instead */ | ||
125 | #define MMC_FPROM_CYC_MASK (UINT64_CAST 31 << 49) /* of 'L' suffix, */ | ||
126 | #define MMC_FPROM_WR_SHFT 44 /* for assembler */ | ||
127 | #define MMC_FPROM_WR_MASK (UINT64_CAST 31 << 44) | ||
128 | #define MMC_UCTLR_CYC_SHFT 39 | ||
129 | #define MMC_UCTLR_CYC_MASK (UINT64_CAST 31 << 39) | ||
130 | #define MMC_UCTLR_WR_SHFT 34 | ||
131 | #define MMC_UCTLR_WR_MASK (UINT64_CAST 31 << 34) | ||
132 | #define MMC_DIMM0_SEL_SHFT 32 | ||
133 | #define MMC_DIMM0_SEL_MASK (UINT64_CAST 3 << 32) | ||
134 | #define MMC_IO_PROT_EN_SHFT 31 | ||
135 | #define MMC_IO_PROT_EN_MASK (UINT64_CAST 1 << 31) | ||
136 | #define MMC_IO_PROT (UINT64_CAST 1 << 31) | ||
137 | #define MMC_ARB_MLSS_SHFT 30 | ||
138 | #define MMC_ARB_MLSS_MASK (UINT64_CAST 1 << 30) | ||
139 | #define MMC_ARB_MLSS (UINT64_CAST 1 << 30) | ||
140 | #define MMC_IGNORE_ECC_SHFT 29 | ||
141 | #define MMC_IGNORE_ECC_MASK (UINT64_CAST 1 << 29) | ||
142 | #define MMC_IGNORE_ECC (UINT64_CAST 1 << 29) | ||
143 | #define MMC_DIR_PREMIUM_SHFT 28 | ||
144 | #define MMC_DIR_PREMIUM_MASK (UINT64_CAST 1 << 28) | ||
145 | #define MMC_DIR_PREMIUM (UINT64_CAST 1 << 28) | ||
146 | #define MMC_REPLY_GUAR_SHFT 24 | ||
147 | #define MMC_REPLY_GUAR_MASK (UINT64_CAST 15 << 24) | ||
148 | #define MMC_BANK_SHFT(_b) ((_b) * 3) | ||
149 | #define MMC_BANK_MASK(_b) (UINT64_CAST 7 << MMC_BANK_SHFT(_b)) | ||
150 | #define MMC_BANK_ALL_MASK 0xffffff | ||
151 | #define MMC_RESET_DEFAULTS (UINT64_CAST 0x0f << MMC_FPROM_CYC_SHFT | \ | ||
152 | UINT64_CAST 0x07 << MMC_FPROM_WR_SHFT | \ | ||
153 | UINT64_CAST 0x1f << MMC_UCTLR_CYC_SHFT | \ | ||
154 | UINT64_CAST 0x0f << MMC_UCTLR_WR_SHFT | \ | ||
155 | MMC_IGNORE_ECC | MMC_DIR_PREMIUM | \ | ||
156 | UINT64_CAST 0x0f << MMC_REPLY_GUAR_SHFT | \ | ||
157 | MMC_BANK_ALL_MASK) | ||
158 | |||
159 | /* MD_REFRESH_CONTROL fields */ | ||
160 | |||
161 | #define MRC_ENABLE_SHFT 63 | ||
162 | #define MRC_ENABLE_MASK (UINT64_CAST 1 << 63) | ||
163 | #define MRC_ENABLE (UINT64_CAST 1 << 63) | ||
164 | #define MRC_COUNTER_SHFT 12 | ||
165 | #define MRC_COUNTER_MASK (UINT64_CAST 0xfff << 12) | ||
166 | #define MRC_CNT_THRESH_MASK 0xfff | ||
167 | #define MRC_RESET_DEFAULTS (UINT64_CAST 0x400) | ||
168 | |||
169 | /* MD_MEM_DIMM_INIT and MD_DIR_DIMM_INIT fields */ | ||
170 | |||
171 | #define MDI_SELECT_SHFT 32 | ||
172 | #define MDI_SELECT_MASK (UINT64_CAST 0x0f << 32) | ||
173 | #define MDI_DIMM_MODE_MASK (UINT64_CAST 0xfff) | ||
174 | |||
175 | /* MD_MOQ_SIZE fields */ | ||
176 | |||
177 | #define MMS_RP_SIZE_SHFT 8 | ||
178 | #define MMS_RP_SIZE_MASK (UINT64_CAST 0x3f << 8) | ||
179 | #define MMS_RQ_SIZE_SHFT 0 | ||
180 | #define MMS_RQ_SIZE_MASK (UINT64_CAST 0x1f) | ||
181 | #define MMS_RESET_DEFAULTS (0x32 << 8 | 0x12) | ||
182 | |||
183 | /* MD_FANDOP_CAC_STAT fields */ | ||
184 | |||
185 | #define MFC_VALID_SHFT 63 | ||
186 | #define MFC_VALID_MASK (UINT64_CAST 1 << 63) | ||
187 | #define MFC_VALID (UINT64_CAST 1 << 63) | ||
188 | #define MFC_ADDR_SHFT 6 | ||
189 | #define MFC_ADDR_MASK (UINT64_CAST 0x3ffffff) | ||
190 | |||
191 | /* MD_MLAN_CTL fields */ | ||
192 | |||
193 | #define MLAN_PHI1_SHFT 27 | ||
194 | #define MLAN_PHI1_MASK (UINT64_CAST 0x7f << 27) | ||
195 | #define MLAN_PHI0_SHFT 20 | ||
196 | #define MLAN_PHI0_MASK (UINT64_CAST 0x7f << 27) | ||
197 | #define MLAN_PULSE_SHFT 10 | ||
198 | #define MLAN_PULSE_MASK (UINT64_CAST 0x3ff << 10) | ||
199 | #define MLAN_SAMPLE_SHFT 2 | ||
200 | #define MLAN_SAMPLE_MASK (UINT64_CAST 0xff << 2) | ||
201 | #define MLAN_DONE_SHFT 1 | ||
202 | #define MLAN_DONE_MASK 2 | ||
203 | #define MLAN_DONE (UINT64_CAST 0x02) | ||
204 | #define MLAN_RD_DATA (UINT64_CAST 0x01) | ||
205 | #define MLAN_RESET_DEFAULTS (UINT64_CAST 0x31 << MLAN_PHI1_SHFT | \ | ||
206 | UINT64_CAST 0x31 << MLAN_PHI0_SHFT) | ||
207 | |||
208 | /* MD_SLOTID_USTAT bit definitions */ | ||
209 | |||
210 | #define MSU_CORECLK_TST_SHFT 7 /* You don't wanna know */ | ||
211 | #define MSU_CORECLK_TST_MASK (UINT64_CAST 1 << 7) | ||
212 | #define MSU_CORECLK_TST (UINT64_CAST 1 << 7) | ||
213 | #define MSU_CORECLK_SHFT 6 /* You don't wanna know */ | ||
214 | #define MSU_CORECLK_MASK (UINT64_CAST 1 << 6) | ||
215 | #define MSU_CORECLK (UINT64_CAST 1 << 6) | ||
216 | #define MSU_NETSYNC_SHFT 5 /* You don't wanna know */ | ||
217 | #define MSU_NETSYNC_MASK (UINT64_CAST 1 << 5) | ||
218 | #define MSU_NETSYNC (UINT64_CAST 1 << 5) | ||
219 | #define MSU_FPROMRDY_SHFT 4 /* Flash PROM ready bit */ | ||
220 | #define MSU_FPROMRDY_MASK (UINT64_CAST 1 << 4) | ||
221 | #define MSU_FPROMRDY (UINT64_CAST 1 << 4) | ||
222 | #define MSU_I2CINTR_SHFT 3 /* I2C interrupt bit */ | ||
223 | #define MSU_I2CINTR_MASK (UINT64_CAST 1 << 3) | ||
224 | #define MSU_I2CINTR (UINT64_CAST 1 << 3) | ||
225 | #define MSU_SLOTID_MASK 0xff | ||
226 | #define MSU_SN0_SLOTID_SHFT 0 /* Slot ID */ | ||
227 | #define MSU_SN0_SLOTID_MASK (UINT64_CAST 7) | ||
228 | #define MSU_SN00_SLOTID_SHFT 7 | ||
229 | #define MSU_SN00_SLOTID_MASK (UINT64_CAST 0x80) | ||
230 | |||
231 | #define MSU_PIMM_PSC_SHFT 4 | ||
232 | #define MSU_PIMM_PSC_MASK (0xf << MSU_PIMM_PSC_SHFT) | ||
233 | |||
234 | /* MD_MIG_DIFF_THRESH bit definitions */ | ||
235 | |||
236 | #define MD_MIG_DIFF_THRES_VALID_MASK (UINT64_CAST 0x1 << 63) | ||
237 | #define MD_MIG_DIFF_THRES_VALID_SHFT 63 | ||
238 | #define MD_MIG_DIFF_THRES_VALUE_MASK (UINT64_CAST 0xfffff) | ||
239 | |||
240 | /* MD_MIG_VALUE_THRESH bit definitions */ | ||
241 | |||
242 | #define MD_MIG_VALUE_THRES_VALID_MASK (UINT64_CAST 0x1 << 63) | ||
243 | #define MD_MIG_VALUE_THRES_VALID_SHFT 63 | ||
244 | #define MD_MIG_VALUE_THRES_VALUE_MASK (UINT64_CAST 0xfffff) | ||
245 | |||
246 | /* MD_MIG_CANDIDATE bit definitions */ | ||
247 | |||
248 | #define MD_MIG_CANDIDATE_VALID_MASK (UINT64_CAST 0x1 << 63) | ||
249 | #define MD_MIG_CANDIDATE_VALID_SHFT 63 | ||
250 | #define MD_MIG_CANDIDATE_TYPE_MASK (UINT64_CAST 0x1 << 30) | ||
251 | #define MD_MIG_CANDIDATE_TYPE_SHFT 30 | ||
252 | #define MD_MIG_CANDIDATE_OVERRUN_MASK (UINT64_CAST 0x1 << 29) | ||
253 | #define MD_MIG_CANDIDATE_OVERRUN_SHFT 29 | ||
254 | #define MD_MIG_CANDIDATE_INITIATOR_MASK (UINT64_CAST 0x7ff << 18) | ||
255 | #define MD_MIG_CANDIDATE_INITIATOR_SHFT 18 | ||
256 | #define MD_MIG_CANDIDATE_NODEID_MASK (UINT64_CAST 0x1ff << 20) | ||
257 | #define MD_MIG_CANDIDATE_NODEID_SHFT 20 | ||
258 | #define MD_MIG_CANDIDATE_ADDR_MASK (UINT64_CAST 0x3ffff) | ||
259 | #define MD_MIG_CANDIDATE_ADDR_SHFT 14 /* The address starts at bit 14 */ | ||
260 | |||
261 | /* Other MD definitions */ | ||
262 | |||
263 | #define MD_BANK_SHFT 29 /* log2(512 MB) */ | ||
264 | #define MD_BANK_MASK (UINT64_CAST 7 << 29) | ||
265 | #define MD_BANK_SIZE (UINT64_CAST 1 << MD_BANK_SHFT) /* 512 MB */ | ||
266 | #define MD_BANK_OFFSET(_b) (UINT64_CAST (_b) << MD_BANK_SHFT) | ||
267 | |||
268 | /* | ||
269 | * The following definitions cover the bit field definitions for the | ||
270 | * various MD registers. For multi-bit registers, we define both | ||
271 | * a shift amount and a mask value. By convention, if you want to | ||
272 | * isolate a field, you should mask the field and then shift it down, | ||
273 | * since this makes the masks useful without a shift. | ||
274 | */ | ||
275 | |||
276 | /* Directory entry states for both premium and standard SIMMs. */ | ||
277 | |||
278 | #define MD_DIR_SHARED (UINT64_CAST 0x0) /* 000 */ | ||
279 | #define MD_DIR_POISONED (UINT64_CAST 0x1) /* 001 */ | ||
280 | #define MD_DIR_EXCLUSIVE (UINT64_CAST 0x2) /* 010 */ | ||
281 | #define MD_DIR_BUSY_SHARED (UINT64_CAST 0x3) /* 011 */ | ||
282 | #define MD_DIR_BUSY_EXCL (UINT64_CAST 0x4) /* 100 */ | ||
283 | #define MD_DIR_WAIT (UINT64_CAST 0x5) /* 101 */ | ||
284 | #define MD_DIR_UNOWNED (UINT64_CAST 0x7) /* 111 */ | ||
285 | |||
286 | /* | ||
287 | * The MD_DIR_FORCE_ECC bit can be added directory entry write data | ||
288 | * to forcing the ECC to be written as-is instead of recalculated. | ||
289 | */ | ||
290 | |||
291 | #define MD_DIR_FORCE_ECC (UINT64_CAST 1 << 63) | ||
292 | |||
293 | /* | ||
294 | * Premium SIMM directory entry shifts and masks. Each is valid only in the | ||
295 | * context(s) indicated, where A, B, and C indicate the directory entry format | ||
296 | * as shown, and low and/or high indicates which double-word of the entry. | ||
297 | * | ||
298 | * Format A: STATE = shared, FINE = 1 | ||
299 | * Format B: STATE = shared, FINE = 0 | ||
300 | * Format C: STATE != shared (FINE must be 0) | ||
301 | */ | ||
302 | |||
303 | #define MD_PDIR_MASK 0xffffffffffff /* Whole entry */ | ||
304 | #define MD_PDIR_ECC_SHFT 0 /* ABC low or high */ | ||
305 | #define MD_PDIR_ECC_MASK 0x7f | ||
306 | #define MD_PDIR_PRIO_SHFT 8 /* ABC low */ | ||
307 | #define MD_PDIR_PRIO_MASK (0xf << 8) | ||
308 | #define MD_PDIR_AX_SHFT 7 /* ABC low */ | ||
309 | #define MD_PDIR_AX_MASK (1 << 7) | ||
310 | #define MD_PDIR_AX (1 << 7) | ||
311 | #define MD_PDIR_FINE_SHFT 12 /* ABC low */ | ||
312 | #define MD_PDIR_FINE_MASK (1 << 12) | ||
313 | #define MD_PDIR_FINE (1 << 12) | ||
314 | #define MD_PDIR_OCT_SHFT 13 /* A low */ | ||
315 | #define MD_PDIR_OCT_MASK (7 << 13) | ||
316 | #define MD_PDIR_STATE_SHFT 13 /* BC low */ | ||
317 | #define MD_PDIR_STATE_MASK (7 << 13) | ||
318 | #define MD_PDIR_ONECNT_SHFT 16 /* BC low */ | ||
319 | #define MD_PDIR_ONECNT_MASK (0x3f << 16) | ||
320 | #define MD_PDIR_PTR_SHFT 22 /* C low */ | ||
321 | #define MD_PDIR_PTR_MASK (UINT64_CAST 0x7ff << 22) | ||
322 | #define MD_PDIR_VECMSB_SHFT 22 /* AB low */ | ||
323 | #define MD_PDIR_VECMSB_BITMASK 0x3ffffff | ||
324 | #define MD_PDIR_VECMSB_BITSHFT 27 | ||
325 | #define MD_PDIR_VECMSB_MASK (UINT64_CAST MD_PDIR_VECMSB_BITMASK << 22) | ||
326 | #define MD_PDIR_CWOFF_SHFT 7 /* C high */ | ||
327 | #define MD_PDIR_CWOFF_MASK (7 << 7) | ||
328 | #define MD_PDIR_VECLSB_SHFT 10 /* AB high */ | ||
329 | #define MD_PDIR_VECLSB_BITMASK (UINT64_CAST 0x3fffffffff) | ||
330 | #define MD_PDIR_VECLSB_BITSHFT 0 | ||
331 | #define MD_PDIR_VECLSB_MASK (MD_PDIR_VECLSB_BITMASK << 10) | ||
332 | |||
333 | /* | ||
334 | * Directory initialization values | ||
335 | */ | ||
336 | |||
337 | #define MD_PDIR_INIT_LO (MD_DIR_UNOWNED << MD_PDIR_STATE_SHFT | \ | ||
338 | MD_PDIR_AX) | ||
339 | #define MD_PDIR_INIT_HI 0 | ||
340 | #define MD_PDIR_INIT_PROT (MD_PROT_RW << MD_PPROT_IO_SHFT | \ | ||
341 | MD_PROT_RW << MD_PPROT_SHFT) | ||
342 | |||
343 | /* | ||
344 | * Standard SIMM directory entry shifts and masks. Each is valid only in the | ||
345 | * context(s) indicated, where A and C indicate the directory entry format | ||
346 | * as shown, and low and/or high indicates which double-word of the entry. | ||
347 | * | ||
348 | * Format A: STATE == shared | ||
349 | * Format C: STATE != shared | ||
350 | */ | ||
351 | |||
352 | #define MD_SDIR_MASK 0xffff /* Whole entry */ | ||
353 | #define MD_SDIR_ECC_SHFT 0 /* AC low or high */ | ||
354 | #define MD_SDIR_ECC_MASK 0x1f | ||
355 | #define MD_SDIR_PRIO_SHFT 6 /* AC low */ | ||
356 | #define MD_SDIR_PRIO_MASK (1 << 6) | ||
357 | #define MD_SDIR_AX_SHFT 5 /* AC low */ | ||
358 | #define MD_SDIR_AX_MASK (1 << 5) | ||
359 | #define MD_SDIR_AX (1 << 5) | ||
360 | #define MD_SDIR_STATE_SHFT 7 /* AC low */ | ||
361 | #define MD_SDIR_STATE_MASK (7 << 7) | ||
362 | #define MD_SDIR_PTR_SHFT 10 /* C low */ | ||
363 | #define MD_SDIR_PTR_MASK (0x3f << 10) | ||
364 | #define MD_SDIR_CWOFF_SHFT 5 /* C high */ | ||
365 | #define MD_SDIR_CWOFF_MASK (7 << 5) | ||
366 | #define MD_SDIR_VECMSB_SHFT 11 /* A low */ | ||
367 | #define MD_SDIR_VECMSB_BITMASK 0x1f | ||
368 | #define MD_SDIR_VECMSB_BITSHFT 7 | ||
369 | #define MD_SDIR_VECMSB_MASK (MD_SDIR_VECMSB_BITMASK << 11) | ||
370 | #define MD_SDIR_VECLSB_SHFT 5 /* A high */ | ||
371 | #define MD_SDIR_VECLSB_BITMASK 0x7ff | ||
372 | #define MD_SDIR_VECLSB_BITSHFT 0 | ||
373 | #define MD_SDIR_VECLSB_MASK (MD_SDIR_VECLSB_BITMASK << 5) | ||
374 | |||
375 | /* | ||
376 | * Directory initialization values | ||
377 | */ | ||
378 | |||
379 | #define MD_SDIR_INIT_LO (MD_DIR_UNOWNED << MD_SDIR_STATE_SHFT | \ | ||
380 | MD_SDIR_AX) | ||
381 | #define MD_SDIR_INIT_HI 0 | ||
382 | #define MD_SDIR_INIT_PROT (MD_PROT_RW << MD_SPROT_SHFT) | ||
383 | |||
384 | /* Protection and migration field values */ | ||
385 | |||
386 | #define MD_PROT_RW (UINT64_CAST 0x6) | ||
387 | #define MD_PROT_RO (UINT64_CAST 0x3) | ||
388 | #define MD_PROT_NO (UINT64_CAST 0x0) | ||
389 | #define MD_PROT_BAD (UINT64_CAST 0x5) | ||
390 | |||
391 | /* Premium SIMM protection entry shifts and masks. */ | ||
392 | |||
393 | #define MD_PPROT_SHFT 0 /* Prot. field */ | ||
394 | #define MD_PPROT_MASK 7 | ||
395 | #define MD_PPROT_MIGMD_SHFT 3 /* Migration mode */ | ||
396 | #define MD_PPROT_MIGMD_MASK (3 << 3) | ||
397 | #define MD_PPROT_REFCNT_SHFT 5 /* Reference count */ | ||
398 | #define MD_PPROT_REFCNT_WIDTH 0x7ffff | ||
399 | #define MD_PPROT_REFCNT_MASK (MD_PPROT_REFCNT_WIDTH << 5) | ||
400 | |||
401 | #define MD_PPROT_IO_SHFT 45 /* I/O Prot field */ | ||
402 | #define MD_PPROT_IO_MASK (UINT64_CAST 7 << 45) | ||
403 | |||
404 | /* Standard SIMM protection entry shifts and masks. */ | ||
405 | |||
406 | #define MD_SPROT_SHFT 0 /* Prot. field */ | ||
407 | #define MD_SPROT_MASK 7 | ||
408 | #define MD_SPROT_MIGMD_SHFT 3 /* Migration mode */ | ||
409 | #define MD_SPROT_MIGMD_MASK (3 << 3) | ||
410 | #define MD_SPROT_REFCNT_SHFT 5 /* Reference count */ | ||
411 | #define MD_SPROT_REFCNT_WIDTH 0x7ff | ||
412 | #define MD_SPROT_REFCNT_MASK (MD_SPROT_REFCNT_WIDTH << 5) | ||
413 | |||
414 | /* Migration modes used in protection entries */ | ||
415 | |||
416 | #define MD_PROT_MIGMD_IREL (UINT64_CAST 0x3 << 3) | ||
417 | #define MD_PROT_MIGMD_IABS (UINT64_CAST 0x2 << 3) | ||
418 | #define MD_PROT_MIGMD_PREL (UINT64_CAST 0x1 << 3) | ||
419 | #define MD_PROT_MIGMD_OFF (UINT64_CAST 0x0 << 3) | ||
420 | |||
421 | |||
422 | /* | ||
423 | * Operations on page migration threshold register | ||
424 | */ | ||
425 | |||
426 | #ifndef __ASSEMBLY__ | ||
427 | |||
428 | /* | ||
429 | * LED register macros | ||
430 | */ | ||
431 | |||
432 | #define CPU_LED_ADDR(_nasid, _slice) \ | ||
433 | (private.p_sn00 ? \ | ||
434 | REMOTE_HUB_ADDR((_nasid), MD_UREG1_0 + ((_slice) << 5)) : \ | ||
435 | REMOTE_HUB_ADDR((_nasid), MD_LED0 + ((_slice) << 3))) | ||
436 | |||
437 | #define SET_CPU_LEDS(_nasid, _slice, _val) \ | ||
438 | (HUB_S(CPU_LED_ADDR(_nasid, _slice), (_val))) | ||
439 | |||
440 | #define SET_MY_LEDS(_v) \ | ||
441 | SET_CPU_LEDS(get_nasid(), get_slice(), (_v)) | ||
442 | |||
443 | /* | ||
444 | * Operations on Memory/Directory DIMM control register | ||
445 | */ | ||
446 | |||
447 | #define DIRTYPE_PREMIUM 1 | ||
448 | #define DIRTYPE_STANDARD 0 | ||
449 | #define MD_MEMORY_CONFIG_DIR_TYPE_GET(region) (\ | ||
450 | (REMOTE_HUB_L(region, MD_MEMORY_CONFIG) & MMC_DIR_PREMIUM_MASK) >> \ | ||
451 | MMC_DIR_PREMIUM_SHFT) | ||
452 | |||
453 | |||
454 | /* | ||
455 | * Operations on page migration count difference and absolute threshold | ||
456 | * registers | ||
457 | */ | ||
458 | |||
459 | #define MD_MIG_DIFF_THRESH_GET(region) ( \ | ||
460 | REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH) & \ | ||
461 | MD_MIG_DIFF_THRES_VALUE_MASK) | ||
462 | |||
463 | #define MD_MIG_DIFF_THRESH_SET(region, value) ( \ | ||
464 | REMOTE_HUB_S((region), MD_MIG_DIFF_THRESH, \ | ||
465 | MD_MIG_DIFF_THRES_VALID_MASK | (value))) | ||
466 | |||
467 | #define MD_MIG_DIFF_THRESH_DISABLE(region) ( \ | ||
468 | REMOTE_HUB_S((region), MD_MIG_DIFF_THRESH, \ | ||
469 | REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH) \ | ||
470 | & ~MD_MIG_DIFF_THRES_VALID_MASK)) | ||
471 | |||
472 | #define MD_MIG_DIFF_THRESH_ENABLE(region) ( \ | ||
473 | REMOTE_HUB_S((region), MD_MIG_DIFF_THRESH, \ | ||
474 | REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH) \ | ||
475 | | MD_MIG_DIFF_THRES_VALID_MASK)) | ||
476 | |||
477 | #define MD_MIG_DIFF_THRESH_IS_ENABLED(region) ( \ | ||
478 | REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH) & \ | ||
479 | MD_MIG_DIFF_THRES_VALID_MASK) | ||
480 | |||
481 | #define MD_MIG_VALUE_THRESH_GET(region) ( \ | ||
482 | REMOTE_HUB_L((region), MD_MIG_VALUE_THRESH) & \ | ||
483 | MD_MIG_VALUE_THRES_VALUE_MASK) | ||
484 | |||
485 | #define MD_MIG_VALUE_THRESH_SET(region, value) ( \ | ||
486 | REMOTE_HUB_S((region), MD_MIG_VALUE_THRESH, \ | ||
487 | MD_MIG_VALUE_THRES_VALID_MASK | (value))) | ||
488 | |||
489 | #define MD_MIG_VALUE_THRESH_DISABLE(region) ( \ | ||
490 | REMOTE_HUB_S((region), MD_MIG_VALUE_THRESH, \ | ||
491 | REMOTE_HUB_L(region, MD_MIG_VALUE_THRESH) \ | ||
492 | & ~MD_MIG_VALUE_THRES_VALID_MASK)) | ||
493 | |||
494 | #define MD_MIG_VALUE_THRESH_ENABLE(region) ( \ | ||
495 | REMOTE_HUB_S((region), MD_MIG_VALUE_THRESH, \ | ||
496 | REMOTE_HUB_L((region), MD_MIG_VALUE_THRESH) \ | ||
497 | | MD_MIG_VALUE_THRES_VALID_MASK)) | ||
498 | |||
499 | #define MD_MIG_VALUE_THRESH_IS_ENABLED(region) ( \ | ||
500 | REMOTE_HUB_L((region), MD_MIG_VALUE_THRESH) & \ | ||
501 | MD_MIG_VALUE_THRES_VALID_MASK) | ||
502 | |||
503 | /* | ||
504 | * Operations on page migration candidate register | ||
505 | */ | ||
506 | |||
507 | #define MD_MIG_CANDIDATE_GET(my_region_id) ( \ | ||
508 | REMOTE_HUB_L((my_region_id), MD_MIG_CANDIDATE_CLR)) | ||
509 | |||
510 | #define MD_MIG_CANDIDATE_HWPFN(value) ((value) & MD_MIG_CANDIDATE_ADDR_MASK) | ||
511 | |||
512 | #define MD_MIG_CANDIDATE_NODEID(value) ( \ | ||
513 | ((value) & MD_MIG_CANDIDATE_NODEID_MASK) >> MD_MIG_CANDIDATE_NODEID_SHFT) | ||
514 | |||
515 | #define MD_MIG_CANDIDATE_TYPE(value) ( \ | ||
516 | ((value) & MD_MIG_CANDIDATE_TYPE_MASK) >> MD_MIG_CANDIDATE_TYPE_SHFT) | ||
517 | |||
518 | #define MD_MIG_CANDIDATE_VALID(value) ( \ | ||
519 | ((value) & MD_MIG_CANDIDATE_VALID_MASK) >> MD_MIG_CANDIDATE_VALID_SHFT) | ||
520 | |||
521 | /* | ||
522 | * Macros to retrieve fields in the protection entry | ||
523 | */ | ||
524 | |||
525 | /* for Premium SIMM */ | ||
526 | #define MD_PPROT_REFCNT_GET(value) ( \ | ||
527 | ((value) & MD_PPROT_REFCNT_MASK) >> MD_PPROT_REFCNT_SHFT) | ||
528 | |||
529 | #define MD_PPROT_MIGMD_GET(value) ( \ | ||
530 | ((value) & MD_PPROT_MIGMD_MASK) >> MD_PPROT_MIGMD_SHFT) | ||
531 | |||
532 | /* for Standard SIMM */ | ||
533 | #define MD_SPROT_REFCNT_GET(value) ( \ | ||
534 | ((value) & MD_SPROT_REFCNT_MASK) >> MD_SPROT_REFCNT_SHFT) | ||
535 | |||
536 | #define MD_SPROT_MIGMD_GET(value) ( \ | ||
537 | ((value) & MD_SPROT_MIGMD_MASK) >> MD_SPROT_MIGMD_SHFT) | ||
538 | |||
539 | /* | ||
540 | * Format of dir_error, mem_error, protocol_error and misc_error registers | ||
541 | */ | ||
542 | |||
543 | struct dir_error_reg { | ||
544 | u64 uce_vld: 1, /* 63: valid directory uce */ | ||
545 | ae_vld: 1, /* 62: valid dir prot ecc error */ | ||
546 | ce_vld: 1, /* 61: valid correctable ECC err*/ | ||
547 | rsvd1: 19, /* 60-42: reserved */ | ||
548 | bad_prot: 3, /* 41-39: encoding, bad access rights*/ | ||
549 | bad_syn: 7, /* 38-32: bad dir syndrome */ | ||
550 | rsvd2: 2, /* 31-30: reserved */ | ||
551 | hspec_addr:27, /* 29-03: bddir space bad entry */ | ||
552 | uce_ovr: 1, /* 2: multiple dir uce's */ | ||
553 | ae_ovr: 1, /* 1: multiple prot ecc errs*/ | ||
554 | ce_ovr: 1; /* 0: multiple correctable errs */ | ||
555 | }; | ||
556 | |||
557 | typedef union md_dir_error { | ||
558 | u64 derr_reg; /* the entire register */ | ||
559 | struct dir_error_reg derr_fmt; /* the register format */ | ||
560 | } md_dir_error_t; | ||
561 | |||
562 | |||
563 | struct mem_error_reg { | ||
564 | u64 uce_vld: 1, /* 63: valid memory uce */ | ||
565 | ce_vld: 1, /* 62: valid correctable ECC err*/ | ||
566 | rsvd1: 22, /* 61-40: reserved */ | ||
567 | bad_syn: 8, /* 39-32: bad mem ecc syndrome */ | ||
568 | address: 29, /* 31-03: bad entry pointer */ | ||
569 | rsvd2: 1, /* 2: reserved */ | ||
570 | uce_ovr: 1, /* 1: multiple mem uce's */ | ||
571 | ce_ovr: 1; /* 0: multiple correctable errs */ | ||
572 | }; | ||
573 | |||
574 | |||
575 | typedef union md_mem_error { | ||
576 | u64 merr_reg; /* the entire register */ | ||
577 | struct mem_error_reg merr_fmt; /* format of the mem_error reg */ | ||
578 | } md_mem_error_t; | ||
579 | |||
580 | |||
581 | struct proto_error_reg { | ||
582 | u64 valid: 1, /* 63: valid protocol error */ | ||
583 | rsvd1: 2, /* 62-61: reserved */ | ||
584 | initiator:11, /* 60-50: id of request initiator*/ | ||
585 | backoff: 2, /* 49-48: backoff control */ | ||
586 | msg_type: 8, /* 47-40: type of request */ | ||
587 | access: 2, /* 39-38: access rights of initiator*/ | ||
588 | priority: 1, /* 37: priority level of requestor*/ | ||
589 | dir_state: 4, /* 36-33: state of directory */ | ||
590 | pointer_me:1, /* 32: initiator same as dir ptr */ | ||
591 | address: 29, /* 31-03: request address */ | ||
592 | rsvd2: 2, /* 02-01: reserved */ | ||
593 | overrun: 1; /* 0: multiple protocol errs */ | ||
594 | }; | ||
595 | |||
596 | typedef union md_proto_error { | ||
597 | u64 perr_reg; /* the entire register */ | ||
598 | struct proto_error_reg perr_fmt; /* format of the register */ | ||
599 | } md_proto_error_t; | ||
600 | |||
601 | |||
602 | struct md_sdir_high_fmt { | ||
603 | unsigned short sd_hi_bvec : 11, | ||
604 | sd_hi_ecc : 5; | ||
605 | }; | ||
606 | |||
607 | |||
608 | typedef union md_sdir_high { | ||
609 | /* The 16 bits of standard directory, upper word */ | ||
610 | unsigned short sd_hi_val; | ||
611 | struct md_sdir_high_fmt sd_hi_fmt; | ||
612 | }md_sdir_high_t; | ||
613 | |||
614 | |||
615 | struct md_sdir_low_shared_fmt { | ||
616 | /* The meaning of lower directory, shared */ | ||
617 | unsigned short sds_lo_bvec : 5, | ||
618 | sds_lo_unused: 1, | ||
619 | sds_lo_state : 3, | ||
620 | sds_lo_prio : 1, | ||
621 | sds_lo_ax : 1, | ||
622 | sds_lo_ecc : 5; | ||
623 | }; | ||
624 | |||
625 | struct md_sdir_low_exclusive_fmt { | ||
626 | /* The meaning of lower directory, exclusive */ | ||
627 | unsigned short sde_lo_ptr : 6, | ||
628 | sde_lo_state : 3, | ||
629 | sde_lo_prio : 1, | ||
630 | sde_lo_ax : 1, | ||
631 | sde_lo_ecc : 5; | ||
632 | }; | ||
633 | |||
634 | |||
635 | typedef union md_sdir_low { | ||
636 | /* The 16 bits of standard directory, lower word */ | ||
637 | unsigned short sd_lo_val; | ||
638 | struct md_sdir_low_exclusive_fmt sde_lo_fmt; | ||
639 | struct md_sdir_low_shared_fmt sds_lo_fmt; | ||
640 | }md_sdir_low_t; | ||
641 | |||
642 | |||
643 | |||
644 | struct md_pdir_high_fmt { | ||
645 | u64 pd_hi_unused : 16, | ||
646 | pd_hi_bvec : 38, | ||
647 | pd_hi_unused1 : 3, | ||
648 | pd_hi_ecc : 7; | ||
649 | }; | ||
650 | |||
651 | |||
652 | typedef union md_pdir_high { | ||
653 | /* The 48 bits of standard directory, upper word */ | ||
654 | u64 pd_hi_val; | ||
655 | struct md_pdir_high_fmt pd_hi_fmt; | ||
656 | }md_pdir_high_t; | ||
657 | |||
658 | |||
659 | struct md_pdir_low_shared_fmt { | ||
660 | /* The meaning of lower directory, shared */ | ||
661 | u64 pds_lo_unused : 16, | ||
662 | pds_lo_bvec : 26, | ||
663 | pds_lo_cnt : 6, | ||
664 | pds_lo_state : 3, | ||
665 | pds_lo_ste : 1, | ||
666 | pds_lo_prio : 4, | ||
667 | pds_lo_ax : 1, | ||
668 | pds_lo_ecc : 7; | ||
669 | }; | ||
670 | |||
671 | struct md_pdir_low_exclusive_fmt { | ||
672 | /* The meaning of lower directory, exclusive */ | ||
673 | u64 pde_lo_unused : 31, | ||
674 | pde_lo_ptr : 11, | ||
675 | pde_lo_unused1 : 6, | ||
676 | pde_lo_state : 3, | ||
677 | pde_lo_ste : 1, | ||
678 | pde_lo_prio : 4, | ||
679 | pde_lo_ax : 1, | ||
680 | pde_lo_ecc : 7; | ||
681 | }; | ||
682 | |||
683 | |||
684 | typedef union md_pdir_loent { | ||
685 | /* The 48 bits of premium directory, lower word */ | ||
686 | u64 pd_lo_val; | ||
687 | struct md_pdir_low_exclusive_fmt pde_lo_fmt; | ||
688 | struct md_pdir_low_shared_fmt pds_lo_fmt; | ||
689 | }md_pdir_low_t; | ||
690 | |||
691 | |||
692 | /* | ||
693 | * the following two "union" definitions and two | ||
694 | * "struct" definitions are used in vmdump.c to | ||
695 | * represent directory memory information. | ||
696 | */ | ||
697 | |||
698 | typedef union md_dir_high { | ||
699 | md_sdir_high_t md_sdir_high; | ||
700 | md_pdir_high_t md_pdir_high; | ||
701 | } md_dir_high_t; | ||
702 | |||
703 | typedef union md_dir_low { | ||
704 | md_sdir_low_t md_sdir_low; | ||
705 | md_pdir_low_t md_pdir_low; | ||
706 | } md_dir_low_t; | ||
707 | |||
708 | typedef struct bddir_entry { | ||
709 | md_dir_low_t md_dir_low; | ||
710 | md_dir_high_t md_dir_high; | ||
711 | } bddir_entry_t; | ||
712 | |||
713 | typedef struct dir_mem_entry { | ||
714 | u64 prcpf[MAX_REGIONS]; | ||
715 | bddir_entry_t directory_words[MD_PAGE_SIZE/CACHE_SLINE_SIZE]; | ||
716 | } dir_mem_entry_t; | ||
717 | |||
718 | |||
719 | |||
720 | typedef union md_perf_sel { | ||
721 | u64 perf_sel_reg; | ||
722 | struct { | ||
723 | u64 perf_rsvd : 60, | ||
724 | perf_en : 1, | ||
725 | perf_sel : 3; | ||
726 | } perf_sel_bits; | ||
727 | } md_perf_sel_t; | ||
728 | |||
729 | typedef union md_perf_cnt { | ||
730 | u64 perf_cnt; | ||
731 | struct { | ||
732 | u64 perf_rsvd : 44, | ||
733 | perf_cnt : 20; | ||
734 | } perf_cnt_bits; | ||
735 | } md_perf_cnt_t; | ||
736 | |||
737 | |||
738 | #endif /* !__ASSEMBLY__ */ | ||
739 | |||
740 | |||
741 | #define DIR_ERROR_VALID_MASK 0xe000000000000000 | ||
742 | #define DIR_ERROR_VALID_SHFT 61 | ||
743 | #define DIR_ERROR_VALID_UCE 0x8000000000000000 | ||
744 | #define DIR_ERROR_VALID_AE 0x4000000000000000 | ||
745 | #define DIR_ERROR_VALID_CE 0x2000000000000000 | ||
746 | |||
747 | #define MEM_ERROR_VALID_MASK 0xc000000000000000 | ||
748 | #define MEM_ERROR_VALID_SHFT 62 | ||
749 | #define MEM_ERROR_VALID_UCE 0x8000000000000000 | ||
750 | #define MEM_ERROR_VALID_CE 0x4000000000000000 | ||
751 | |||
752 | #define PROTO_ERROR_VALID_MASK 0x8000000000000000 | ||
753 | |||
754 | #define MISC_ERROR_VALID_MASK 0x3ff | ||
755 | |||
756 | /* | ||
757 | * Mask for hspec address that is stored in the dir error register. | ||
758 | * This represents bits 29 through 3. | ||
759 | */ | ||
760 | #define DIR_ERR_HSPEC_MASK 0x3ffffff8 | ||
761 | #define ERROR_HSPEC_MASK 0x3ffffff8 | ||
762 | #define ERROR_HSPEC_SHFT 3 | ||
763 | #define ERROR_ADDR_MASK 0xfffffff8 | ||
764 | #define ERROR_ADDR_SHFT 3 | ||
765 | |||
766 | /* | ||
767 | * MD_MISC_ERROR register defines. | ||
768 | */ | ||
769 | |||
770 | #define MMCE_VALID_MASK 0x3ff | ||
771 | #define MMCE_ILL_MSG_SHFT 8 | ||
772 | #define MMCE_ILL_MSG_MASK (UINT64_CAST 0x03 << MMCE_ILL_MSG_SHFT) | ||
773 | #define MMCE_ILL_REV_SHFT 6 | ||
774 | #define MMCE_ILL_REV_MASK (UINT64_CAST 0x03 << MMCE_ILL_REV_SHFT) | ||
775 | #define MMCE_LONG_PACK_SHFT 4 | ||
776 | #define MMCE_LONG_PACK_MASK (UINT64_CAST 0x03 << MMCE_lONG_PACK_SHFT) | ||
777 | #define MMCE_SHORT_PACK_SHFT 2 | ||
778 | #define MMCE_SHORT_PACK_MASK (UINT64_CAST 0x03 << MMCE_SHORT_PACK_SHFT) | ||
779 | #define MMCE_BAD_DATA_SHFT 0 | ||
780 | #define MMCE_BAD_DATA_MASK (UINT64_CAST 0x03 << MMCE_BAD_DATA_SHFT) | ||
781 | |||
782 | |||
783 | #define MD_PERF_COUNTERS 6 | ||
784 | #define MD_PERF_SETS 6 | ||
785 | |||
786 | #define MEM_DIMM_MASK 0xe0000000 | ||
787 | #define MEM_DIMM_SHFT 29 | ||
788 | |||
789 | #endif /* _ASM_SN_SN0_HUBMD_H */ | ||
diff --git a/include/asm-mips/sn/sn0/hubni.h b/include/asm-mips/sn/sn0/hubni.h deleted file mode 100644 index b40d3ef97a12..000000000000 --- a/include/asm-mips/sn/sn0/hubni.h +++ /dev/null | |||
@@ -1,255 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Derived from IRIX <sys/SN/SN0/hubni.h>, Revision 1.27. | ||
7 | * | ||
8 | * Copyright (C) 1992-1997, 1999 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 1999 by Ralf Baechle | ||
10 | */ | ||
11 | #ifndef _ASM_SGI_SN0_HUBNI_H | ||
12 | #define _ASM_SGI_SN0_HUBNI_H | ||
13 | |||
14 | #ifndef __ASSEMBLY__ | ||
15 | #include <linux/types.h> | ||
16 | #endif | ||
17 | |||
18 | /* | ||
19 | * Hub Network Interface registers | ||
20 | * | ||
21 | * All registers in this file are subject to change until Hub chip tapeout. | ||
22 | */ | ||
23 | |||
24 | #define NI_BASE 0x600000 | ||
25 | #define NI_BASE_TABLES 0x630000 | ||
26 | |||
27 | #define NI_STATUS_REV_ID 0x600000 /* Hub network status, rev, and ID */ | ||
28 | #define NI_PORT_RESET 0x600008 /* Reset the network interface */ | ||
29 | #define NI_PROTECTION 0x600010 /* NI register access permissions */ | ||
30 | #define NI_GLOBAL_PARMS 0x600018 /* LLP parameters */ | ||
31 | #define NI_SCRATCH_REG0 0x600100 /* Scratch register 0 (64 bits) */ | ||
32 | #define NI_SCRATCH_REG1 0x600108 /* Scratch register 1 (64 bits) */ | ||
33 | #define NI_DIAG_PARMS 0x600110 /* Parameters for diags */ | ||
34 | |||
35 | #define NI_VECTOR_PARMS 0x600200 /* Vector PIO routing parameters */ | ||
36 | #define NI_VECTOR 0x600208 /* Vector PIO route */ | ||
37 | #define NI_VECTOR_DATA 0x600210 /* Vector PIO data */ | ||
38 | #define NI_VECTOR_STATUS 0x600300 /* Vector PIO return status */ | ||
39 | #define NI_RETURN_VECTOR 0x600308 /* Vector PIO return vector */ | ||
40 | #define NI_VECTOR_READ_DATA 0x600310 /* Vector PIO read data */ | ||
41 | #define NI_VECTOR_CLEAR 0x600380 /* Vector PIO read & clear status */ | ||
42 | |||
43 | #define NI_IO_PROTECT 0x600400 /* PIO protection bits */ | ||
44 | #define NI_IO_PROT_OVRRD 0x600408 /* PIO protection bit override */ | ||
45 | |||
46 | #define NI_AGE_CPU0_MEMORY 0x600500 /* CPU 0 memory age control */ | ||
47 | #define NI_AGE_CPU0_PIO 0x600508 /* CPU 0 PIO age control */ | ||
48 | #define NI_AGE_CPU1_MEMORY 0x600510 /* CPU 1 memory age control */ | ||
49 | #define NI_AGE_CPU1_PIO 0x600518 /* CPU 1 PIO age control */ | ||
50 | #define NI_AGE_GBR_MEMORY 0x600520 /* GBR memory age control */ | ||
51 | #define NI_AGE_GBR_PIO 0x600528 /* GBR PIO age control */ | ||
52 | #define NI_AGE_IO_MEMORY 0x600530 /* IO memory age control */ | ||
53 | #define NI_AGE_IO_PIO 0x600538 /* IO PIO age control */ | ||
54 | #define NI_AGE_REG_MIN NI_AGE_CPU0_MEMORY | ||
55 | #define NI_AGE_REG_MAX NI_AGE_IO_PIO | ||
56 | |||
57 | #define NI_PORT_PARMS 0x608000 /* LLP Parameters */ | ||
58 | #define NI_PORT_ERROR 0x608008 /* LLP Errors */ | ||
59 | #define NI_PORT_ERROR_CLEAR 0x608088 /* Clear the error bits */ | ||
60 | |||
61 | #define NI_META_TABLE0 0x638000 /* First meta routing table entry */ | ||
62 | #define NI_META_TABLE(_x) (NI_META_TABLE0 + (8 * (_x))) | ||
63 | #define NI_META_ENTRIES 32 | ||
64 | |||
65 | #define NI_LOCAL_TABLE0 0x638100 /* First local routing table entry */ | ||
66 | #define NI_LOCAL_TABLE(_x) (NI_LOCAL_TABLE0 + (8 * (_x))) | ||
67 | #define NI_LOCAL_ENTRIES 16 | ||
68 | |||
69 | /* | ||
70 | * NI_STATUS_REV_ID mask and shift definitions | ||
71 | * Have to use UINT64_CAST instead of 'L' suffix, for assembler. | ||
72 | */ | ||
73 | |||
74 | #define NSRI_8BITMODE_SHFT 30 | ||
75 | #define NSRI_8BITMODE_MASK (UINT64_CAST 0x1 << 30) | ||
76 | #define NSRI_LINKUP_SHFT 29 | ||
77 | #define NSRI_LINKUP_MASK (UINT64_CAST 0x1 << 29) | ||
78 | #define NSRI_DOWNREASON_SHFT 28 /* 0=failed, 1=never came */ | ||
79 | #define NSRI_DOWNREASON_MASK (UINT64_CAST 0x1 << 28) /* out of reset. */ | ||
80 | #define NSRI_MORENODES_SHFT 18 | ||
81 | #define NSRI_MORENODES_MASK (UINT64_CAST 1 << 18) /* Max. # of nodes */ | ||
82 | #define MORE_MEMORY 0 | ||
83 | #define MORE_NODES 1 | ||
84 | #define NSRI_REGIONSIZE_SHFT 17 | ||
85 | #define NSRI_REGIONSIZE_MASK (UINT64_CAST 1 << 17) /* Granularity */ | ||
86 | #define REGIONSIZE_FINE 1 | ||
87 | #define REGIONSIZE_COARSE 0 | ||
88 | #define NSRI_NODEID_SHFT 8 | ||
89 | #define NSRI_NODEID_MASK (UINT64_CAST 0x1ff << 8)/* Node (Hub) ID */ | ||
90 | #define NSRI_REV_SHFT 4 | ||
91 | #define NSRI_REV_MASK (UINT64_CAST 0xf << 4) /* Chip Revision */ | ||
92 | #define NSRI_CHIPID_SHFT 0 | ||
93 | #define NSRI_CHIPID_MASK (UINT64_CAST 0xf) /* Chip type ID */ | ||
94 | |||
95 | /* | ||
96 | * In fine mode, each node is a region. In coarse mode, there are | ||
97 | * eight nodes per region. | ||
98 | */ | ||
99 | #define NASID_TO_FINEREG_SHFT 0 | ||
100 | #define NASID_TO_COARSEREG_SHFT 3 | ||
101 | |||
102 | /* NI_PORT_RESET mask definitions */ | ||
103 | |||
104 | #define NPR_PORTRESET (UINT64_CAST 1 << 7) /* Send warm reset */ | ||
105 | #define NPR_LINKRESET (UINT64_CAST 1 << 1) /* Send link reset */ | ||
106 | #define NPR_LOCALRESET (UINT64_CAST 1) /* Reset entire hub */ | ||
107 | |||
108 | /* NI_PROTECTION mask and shift definitions */ | ||
109 | |||
110 | #define NPROT_RESETOK (UINT64_CAST 1) | ||
111 | |||
112 | /* NI_GLOBAL_PARMS mask and shift definitions */ | ||
113 | |||
114 | #define NGP_MAXRETRY_SHFT 48 /* Maximum retries */ | ||
115 | #define NGP_MAXRETRY_MASK (UINT64_CAST 0x3ff << 48) | ||
116 | #define NGP_TAILTOWRAP_SHFT 32 /* Tail timeout wrap */ | ||
117 | #define NGP_TAILTOWRAP_MASK (UINT64_CAST 0xffff << 32) | ||
118 | |||
119 | #define NGP_CREDITTOVAL_SHFT 16 /* Tail timeout wrap */ | ||
120 | #define NGP_CREDITTOVAL_MASK (UINT64_CAST 0xf << 16) | ||
121 | #define NGP_TAILTOVAL_SHFT 4 /* Tail timeout value */ | ||
122 | #define NGP_TAILTOVAL_MASK (UINT64_CAST 0xf << 4) | ||
123 | |||
124 | /* NI_DIAG_PARMS mask and shift definitions */ | ||
125 | |||
126 | #define NDP_PORTTORESET (UINT64_CAST 1 << 18) /* Port tmout reset */ | ||
127 | #define NDP_LLP8BITMODE (UINT64_CAST 1 << 12) /* LLP 8-bit mode */ | ||
128 | #define NDP_PORTDISABLE (UINT64_CAST 1 << 6) /* Port disable */ | ||
129 | #define NDP_SENDERROR (UINT64_CAST 1) /* Send data error */ | ||
130 | |||
131 | /* | ||
132 | * NI_VECTOR_PARMS mask and shift definitions. | ||
133 | * TYPE may be any of the first four PIOTYPEs defined under NI_VECTOR_STATUS. | ||
134 | */ | ||
135 | |||
136 | #define NVP_PIOID_SHFT 40 | ||
137 | #define NVP_PIOID_MASK (UINT64_CAST 0x3ff << 40) | ||
138 | #define NVP_WRITEID_SHFT 32 | ||
139 | #define NVP_WRITEID_MASK (UINT64_CAST 0xff << 32) | ||
140 | #define NVP_ADDRESS_MASK (UINT64_CAST 0xffff8) /* Bits 19:3 */ | ||
141 | #define NVP_TYPE_SHFT 0 | ||
142 | #define NVP_TYPE_MASK (UINT64_CAST 0x3) | ||
143 | |||
144 | /* NI_VECTOR_STATUS mask and shift definitions */ | ||
145 | |||
146 | #define NVS_VALID (UINT64_CAST 1 << 63) | ||
147 | #define NVS_OVERRUN (UINT64_CAST 1 << 62) | ||
148 | #define NVS_TARGET_SHFT 51 | ||
149 | #define NVS_TARGET_MASK (UINT64_CAST 0x3ff << 51) | ||
150 | #define NVS_PIOID_SHFT 40 | ||
151 | #define NVS_PIOID_MASK (UINT64_CAST 0x3ff << 40) | ||
152 | #define NVS_WRITEID_SHFT 32 | ||
153 | #define NVS_WRITEID_MASK (UINT64_CAST 0xff << 32) | ||
154 | #define NVS_ADDRESS_MASK (UINT64_CAST 0xfffffff8) /* Bits 31:3 */ | ||
155 | #define NVS_TYPE_SHFT 0 | ||
156 | #define NVS_TYPE_MASK (UINT64_CAST 0x7) | ||
157 | #define NVS_ERROR_MASK (UINT64_CAST 0x4) /* bit set means error */ | ||
158 | |||
159 | |||
160 | #define PIOTYPE_READ 0 /* VECTOR_PARMS and VECTOR_STATUS */ | ||
161 | #define PIOTYPE_WRITE 1 /* VECTOR_PARMS and VECTOR_STATUS */ | ||
162 | #define PIOTYPE_UNDEFINED 2 /* VECTOR_PARMS and VECTOR_STATUS */ | ||
163 | #define PIOTYPE_EXCHANGE 3 /* VECTOR_PARMS and VECTOR_STATUS */ | ||
164 | #define PIOTYPE_ADDR_ERR 4 /* VECTOR_STATUS only */ | ||
165 | #define PIOTYPE_CMD_ERR 5 /* VECTOR_STATUS only */ | ||
166 | #define PIOTYPE_PROT_ERR 6 /* VECTOR_STATUS only */ | ||
167 | #define PIOTYPE_UNKNOWN 7 /* VECTOR_STATUS only */ | ||
168 | |||
169 | /* NI_AGE_XXX mask and shift definitions */ | ||
170 | |||
171 | #define NAGE_VCH_SHFT 10 | ||
172 | #define NAGE_VCH_MASK (UINT64_CAST 3 << 10) | ||
173 | #define NAGE_CC_SHFT 8 | ||
174 | #define NAGE_CC_MASK (UINT64_CAST 3 << 8) | ||
175 | #define NAGE_AGE_SHFT 0 | ||
176 | #define NAGE_AGE_MASK (UINT64_CAST 0xff) | ||
177 | #define NAGE_MASK (NAGE_VCH_MASK | NAGE_CC_MASK | NAGE_AGE_MASK) | ||
178 | |||
179 | #define VCHANNEL_A 0 | ||
180 | #define VCHANNEL_B 1 | ||
181 | #define VCHANNEL_ANY 2 | ||
182 | |||
183 | /* NI_PORT_PARMS mask and shift definitions */ | ||
184 | |||
185 | #define NPP_NULLTO_SHFT 10 | ||
186 | #define NPP_NULLTO_MASK (UINT64_CAST 0x3f << 16) | ||
187 | #define NPP_MAXBURST_SHFT 0 | ||
188 | #define NPP_MAXBURST_MASK (UINT64_CAST 0x3ff) | ||
189 | #define NPP_RESET_DFLT_HUB20 ((UINT64_CAST 1 << NPP_NULLTO_SHFT) | \ | ||
190 | (UINT64_CAST 0x3f0 << NPP_MAXBURST_SHFT)) | ||
191 | #define NPP_RESET_DEFAULTS ((UINT64_CAST 6 << NPP_NULLTO_SHFT) | \ | ||
192 | (UINT64_CAST 0x3f0 << NPP_MAXBURST_SHFT)) | ||
193 | |||
194 | |||
195 | /* NI_PORT_ERROR mask and shift definitions */ | ||
196 | |||
197 | #define NPE_LINKRESET (UINT64_CAST 1 << 37) | ||
198 | #define NPE_INTERNALERROR (UINT64_CAST 1 << 36) | ||
199 | #define NPE_BADMESSAGE (UINT64_CAST 1 << 35) | ||
200 | #define NPE_BADDEST (UINT64_CAST 1 << 34) | ||
201 | #define NPE_FIFOOVERFLOW (UINT64_CAST 1 << 33) | ||
202 | #define NPE_CREDITTO_SHFT 28 | ||
203 | #define NPE_CREDITTO_MASK (UINT64_CAST 0xf << 28) | ||
204 | #define NPE_TAILTO_SHFT 24 | ||
205 | #define NPE_TAILTO_MASK (UINT64_CAST 0xf << 24) | ||
206 | #define NPE_RETRYCOUNT_SHFT 16 | ||
207 | #define NPE_RETRYCOUNT_MASK (UINT64_CAST 0xff << 16) | ||
208 | #define NPE_CBERRCOUNT_SHFT 8 | ||
209 | #define NPE_CBERRCOUNT_MASK (UINT64_CAST 0xff << 8) | ||
210 | #define NPE_SNERRCOUNT_SHFT 0 | ||
211 | #define NPE_SNERRCOUNT_MASK (UINT64_CAST 0xff << 0) | ||
212 | #define NPE_MASK 0x3effffffff | ||
213 | |||
214 | #define NPE_COUNT_MAX 0xff | ||
215 | |||
216 | #define NPE_FATAL_ERRORS (NPE_LINKRESET | NPE_INTERNALERROR | \ | ||
217 | NPE_BADMESSAGE | NPE_BADDEST | \ | ||
218 | NPE_FIFOOVERFLOW | NPE_CREDITTO_MASK | \ | ||
219 | NPE_TAILTO_MASK) | ||
220 | |||
221 | /* NI_META_TABLE mask and shift definitions */ | ||
222 | |||
223 | #define NMT_EXIT_PORT_MASK (UINT64_CAST 0xf) | ||
224 | |||
225 | /* NI_LOCAL_TABLE mask and shift definitions */ | ||
226 | |||
227 | #define NLT_EXIT_PORT_MASK (UINT64_CAST 0xf) | ||
228 | |||
229 | #ifndef __ASSEMBLY__ | ||
230 | |||
231 | typedef union hubni_port_error_u { | ||
232 | u64 nipe_reg_value; | ||
233 | struct { | ||
234 | u64 nipe_rsvd: 26, /* unused */ | ||
235 | nipe_lnk_reset: 1, /* link reset */ | ||
236 | nipe_intl_err: 1, /* internal error */ | ||
237 | nipe_bad_msg: 1, /* bad message */ | ||
238 | nipe_bad_dest: 1, /* bad dest */ | ||
239 | nipe_fifo_ovfl: 1, /* fifo overflow */ | ||
240 | nipe_rsvd1: 1, /* unused */ | ||
241 | nipe_credit_to: 4, /* credit timeout */ | ||
242 | nipe_tail_to: 4, /* tail timeout */ | ||
243 | nipe_retry_cnt: 8, /* retry error count */ | ||
244 | nipe_cb_cnt: 8, /* checkbit error count */ | ||
245 | nipe_sn_cnt: 8; /* sequence number count */ | ||
246 | } nipe_fields_s; | ||
247 | } hubni_port_error_t; | ||
248 | |||
249 | #define NI_LLP_RETRY_MAX 0xff | ||
250 | #define NI_LLP_CB_MAX 0xff | ||
251 | #define NI_LLP_SN_MAX 0xff | ||
252 | |||
253 | #endif /* !__ASSEMBLY__ */ | ||
254 | |||
255 | #endif /* _ASM_SGI_SN0_HUBNI_H */ | ||
diff --git a/include/asm-mips/sn/sn0/hubpi.h b/include/asm-mips/sn/sn0/hubpi.h deleted file mode 100644 index e39f5f9da040..000000000000 --- a/include/asm-mips/sn/sn0/hubpi.h +++ /dev/null | |||
@@ -1,409 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Derived from IRIX <sys/SN/SN0/hubpi.h>, revision 1.28. | ||
7 | * | ||
8 | * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 1999 by Ralf Baechle | ||
10 | */ | ||
11 | #ifndef _ASM_SN_SN0_HUBPI_H | ||
12 | #define _ASM_SN_SN0_HUBPI_H | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | |||
16 | /* | ||
17 | * Hub I/O interface registers | ||
18 | * | ||
19 | * All registers in this file are subject to change until Hub chip tapeout. | ||
20 | * All register "addresses" are actually offsets. Use the LOCAL_HUB | ||
21 | * or REMOTE_HUB macros to synthesize an actual address | ||
22 | */ | ||
23 | |||
24 | #define PI_BASE 0x000000 | ||
25 | |||
26 | /* General protection and control registers */ | ||
27 | |||
28 | #define PI_CPU_PROTECT 0x000000 /* CPU Protection */ | ||
29 | #define PI_PROT_OVERRD 0x000008 /* Clear CPU Protection bit */ | ||
30 | #define PI_IO_PROTECT 0x000010 /* Interrupt Pending Protection */ | ||
31 | #define PI_REGION_PRESENT 0x000018 /* Indicates whether region exists */ | ||
32 | #define PI_CPU_NUM 0x000020 /* CPU Number ID */ | ||
33 | #define PI_CALIAS_SIZE 0x000028 /* Cached Alias Size */ | ||
34 | #define PI_MAX_CRB_TIMEOUT 0x000030 /* Maximum Timeout for CRB */ | ||
35 | #define PI_CRB_SFACTOR 0x000038 /* Scale factor for CRB timeout */ | ||
36 | |||
37 | /* CALIAS values */ | ||
38 | #define PI_CALIAS_SIZE_0 0 | ||
39 | #define PI_CALIAS_SIZE_4K 1 | ||
40 | #define PI_CALIAS_SIZE_8K 2 | ||
41 | #define PI_CALIAS_SIZE_16K 3 | ||
42 | #define PI_CALIAS_SIZE_32K 4 | ||
43 | #define PI_CALIAS_SIZE_64K 5 | ||
44 | #define PI_CALIAS_SIZE_128K 6 | ||
45 | #define PI_CALIAS_SIZE_256K 7 | ||
46 | #define PI_CALIAS_SIZE_512K 8 | ||
47 | #define PI_CALIAS_SIZE_1M 9 | ||
48 | #define PI_CALIAS_SIZE_2M 10 | ||
49 | #define PI_CALIAS_SIZE_4M 11 | ||
50 | #define PI_CALIAS_SIZE_8M 12 | ||
51 | #define PI_CALIAS_SIZE_16M 13 | ||
52 | #define PI_CALIAS_SIZE_32M 14 | ||
53 | #define PI_CALIAS_SIZE_64M 15 | ||
54 | |||
55 | /* Processor control and status checking */ | ||
56 | |||
57 | #define PI_CPU_PRESENT_A 0x000040 /* CPU Present A */ | ||
58 | #define PI_CPU_PRESENT_B 0x000048 /* CPU Present B */ | ||
59 | #define PI_CPU_ENABLE_A 0x000050 /* CPU Enable A */ | ||
60 | #define PI_CPU_ENABLE_B 0x000058 /* CPU Enable B */ | ||
61 | #define PI_REPLY_LEVEL 0x000060 /* Reply Level */ | ||
62 | #define PI_HARDRESET_BIT 0x020068 /* Bit cleared by s/w on SR */ | ||
63 | #define PI_NMI_A 0x000070 /* NMI to CPU A */ | ||
64 | #define PI_NMI_B 0x000078 /* NMI to CPU B */ | ||
65 | #define PI_NMI_OFFSET (PI_NMI_B - PI_NMI_A) | ||
66 | #define PI_SOFTRESET 0x000080 /* Softreset (to both CPUs) */ | ||
67 | |||
68 | /* Regular Interrupt register checking. */ | ||
69 | |||
70 | #define PI_INT_PEND_MOD 0x000090 /* Write to set pending ints */ | ||
71 | #define PI_INT_PEND0 0x000098 /* Read to get pending ints */ | ||
72 | #define PI_INT_PEND1 0x0000a0 /* Read to get pending ints */ | ||
73 | #define PI_INT_MASK0_A 0x0000a8 /* Interrupt Mask 0 for CPU A */ | ||
74 | #define PI_INT_MASK1_A 0x0000b0 /* Interrupt Mask 1 for CPU A */ | ||
75 | #define PI_INT_MASK0_B 0x0000b8 /* Interrupt Mask 0 for CPU B */ | ||
76 | #define PI_INT_MASK1_B 0x0000c0 /* Interrupt Mask 1 for CPU B */ | ||
77 | |||
78 | #define PI_INT_MASK_OFFSET 0x10 /* Offset from A to B */ | ||
79 | |||
80 | /* Crosscall interrupts */ | ||
81 | |||
82 | #define PI_CC_PEND_SET_A 0x0000c8 /* CC Interrupt Pending Set, CPU A */ | ||
83 | #define PI_CC_PEND_SET_B 0x0000d0 /* CC Interrupt Pending Set, CPU B */ | ||
84 | #define PI_CC_PEND_CLR_A 0x0000d8 /* CC Interrupt Pending Clr, CPU A */ | ||
85 | #define PI_CC_PEND_CLR_B 0x0000e0 /* CC Interrupt Pending Clr, CPU B */ | ||
86 | #define PI_CC_MASK 0x0000e8 /* CC Interrupt mask */ | ||
87 | |||
88 | #define PI_INT_SET_OFFSET 0x08 /* Offset from A to B */ | ||
89 | |||
90 | /* Realtime Counter and Profiler control registers */ | ||
91 | |||
92 | #define PI_RT_COUNT 0x030100 /* Real Time Counter */ | ||
93 | #define PI_RT_COMPARE_A 0x000108 /* Real Time Compare A */ | ||
94 | #define PI_RT_COMPARE_B 0x000110 /* Real Time Compare B */ | ||
95 | #define PI_PROFILE_COMPARE 0x000118 /* L5 int to both cpus when == RTC */ | ||
96 | #define PI_RT_PEND_A 0x000120 /* Set if RT int for A pending */ | ||
97 | #define PI_RT_PEND_B 0x000128 /* Set if RT int for B pending */ | ||
98 | #define PI_PROF_PEND_A 0x000130 /* Set if Prof int for A pending */ | ||
99 | #define PI_PROF_PEND_B 0x000138 /* Set if Prof int for B pending */ | ||
100 | #define PI_RT_EN_A 0x000140 /* RT int for CPU A enable */ | ||
101 | #define PI_RT_EN_B 0x000148 /* RT int for CPU B enable */ | ||
102 | #define PI_PROF_EN_A 0x000150 /* PROF int for CPU A enable */ | ||
103 | #define PI_PROF_EN_B 0x000158 /* PROF int for CPU B enable */ | ||
104 | #define PI_RT_LOCAL_CTRL 0x000160 /* RT control register */ | ||
105 | #define PI_RT_FILTER_CTRL 0x000168 /* GCLK Filter control register */ | ||
106 | |||
107 | #define PI_COUNT_OFFSET 0x08 /* A to B offset for all counts */ | ||
108 | |||
109 | /* Built-In Self Test support */ | ||
110 | |||
111 | #define PI_BIST_WRITE_DATA 0x000200 /* BIST write data */ | ||
112 | #define PI_BIST_READ_DATA 0x000208 /* BIST read data */ | ||
113 | #define PI_BIST_COUNT_TARG 0x000210 /* BIST Count and Target */ | ||
114 | #define PI_BIST_READY 0x000218 /* BIST Ready indicator */ | ||
115 | #define PI_BIST_SHIFT_LOAD 0x000220 /* BIST control */ | ||
116 | #define PI_BIST_SHIFT_UNLOAD 0x000228 /* BIST control */ | ||
117 | #define PI_BIST_ENTER_RUN 0x000230 /* BIST control */ | ||
118 | |||
119 | /* Graphics control registers */ | ||
120 | |||
121 | #define PI_GFX_PAGE_A 0x000300 /* Graphics page A */ | ||
122 | #define PI_GFX_CREDIT_CNTR_A 0x000308 /* Graphics credit counter A */ | ||
123 | #define PI_GFX_BIAS_A 0x000310 /* Graphics bias A */ | ||
124 | #define PI_GFX_INT_CNTR_A 0x000318 /* Graphics interrupt counter A */ | ||
125 | #define PI_GFX_INT_CMP_A 0x000320 /* Graphics interrupt comparator A */ | ||
126 | #define PI_GFX_PAGE_B 0x000328 /* Graphics page B */ | ||
127 | #define PI_GFX_CREDIT_CNTR_B 0x000330 /* Graphics credit counter B */ | ||
128 | #define PI_GFX_BIAS_B 0x000338 /* Graphics bias B */ | ||
129 | #define PI_GFX_INT_CNTR_B 0x000340 /* Graphics interrupt counter B */ | ||
130 | #define PI_GFX_INT_CMP_B 0x000348 /* Graphics interrupt comparator B */ | ||
131 | |||
132 | #define PI_GFX_OFFSET (PI_GFX_PAGE_B - PI_GFX_PAGE_A) | ||
133 | #define PI_GFX_PAGE_ENABLE 0x0000010000000000LL | ||
134 | |||
135 | /* Error and timeout registers */ | ||
136 | #define PI_ERR_INT_PEND 0x000400 /* Error Interrupt Pending */ | ||
137 | #define PI_ERR_INT_MASK_A 0x000408 /* Error Interrupt mask for CPU A */ | ||
138 | #define PI_ERR_INT_MASK_B 0x000410 /* Error Interrupt mask for CPU B */ | ||
139 | #define PI_ERR_STACK_ADDR_A 0x000418 /* Error stack address for CPU A */ | ||
140 | #define PI_ERR_STACK_ADDR_B 0x000420 /* Error stack address for CPU B */ | ||
141 | #define PI_ERR_STACK_SIZE 0x000428 /* Error Stack Size */ | ||
142 | #define PI_ERR_STATUS0_A 0x000430 /* Error Status 0A */ | ||
143 | #define PI_ERR_STATUS0_A_RCLR 0x000438 /* Error Status 0A clear on read */ | ||
144 | #define PI_ERR_STATUS1_A 0x000440 /* Error Status 1A */ | ||
145 | #define PI_ERR_STATUS1_A_RCLR 0x000448 /* Error Status 1A clear on read */ | ||
146 | #define PI_ERR_STATUS0_B 0x000450 /* Error Status 0B */ | ||
147 | #define PI_ERR_STATUS0_B_RCLR 0x000458 /* Error Status 0B clear on read */ | ||
148 | #define PI_ERR_STATUS1_B 0x000460 /* Error Status 1B */ | ||
149 | #define PI_ERR_STATUS1_B_RCLR 0x000468 /* Error Status 1B clear on read */ | ||
150 | #define PI_SPOOL_CMP_A 0x000470 /* Spool compare for CPU A */ | ||
151 | #define PI_SPOOL_CMP_B 0x000478 /* Spool compare for CPU B */ | ||
152 | #define PI_CRB_TIMEOUT_A 0x000480 /* Timed out CRB entries for A */ | ||
153 | #define PI_CRB_TIMEOUT_B 0x000488 /* Timed out CRB entries for B */ | ||
154 | #define PI_SYSAD_ERRCHK_EN 0x000490 /* Enables SYSAD error checking */ | ||
155 | #define PI_BAD_CHECK_BIT_A 0x000498 /* Force SYSAD check bit error */ | ||
156 | #define PI_BAD_CHECK_BIT_B 0x0004a0 /* Force SYSAD check bit error */ | ||
157 | #define PI_NACK_CNT_A 0x0004a8 /* Consecutive NACK counter */ | ||
158 | #define PI_NACK_CNT_B 0x0004b0 /* " " for CPU B */ | ||
159 | #define PI_NACK_CMP 0x0004b8 /* NACK count compare */ | ||
160 | #define PI_STACKADDR_OFFSET (PI_ERR_STACK_ADDR_B - PI_ERR_STACK_ADDR_A) | ||
161 | #define PI_ERRSTAT_OFFSET (PI_ERR_STATUS0_B - PI_ERR_STATUS0_A) | ||
162 | #define PI_RDCLR_OFFSET (PI_ERR_STATUS0_A_RCLR - PI_ERR_STATUS0_A) | ||
163 | |||
164 | /* Bits in PI_ERR_INT_PEND */ | ||
165 | #define PI_ERR_SPOOL_CMP_B 0x00000001 /* Spool end hit high water */ | ||
166 | #define PI_ERR_SPOOL_CMP_A 0x00000002 | ||
167 | #define PI_ERR_SPUR_MSG_B 0x00000004 /* Spurious message intr. */ | ||
168 | #define PI_ERR_SPUR_MSG_A 0x00000008 | ||
169 | #define PI_ERR_WRB_TERR_B 0x00000010 /* WRB TERR */ | ||
170 | #define PI_ERR_WRB_TERR_A 0x00000020 | ||
171 | #define PI_ERR_WRB_WERR_B 0x00000040 /* WRB WERR */ | ||
172 | #define PI_ERR_WRB_WERR_A 0x00000080 | ||
173 | #define PI_ERR_SYSSTATE_B 0x00000100 /* SysState parity error */ | ||
174 | #define PI_ERR_SYSSTATE_A 0x00000200 | ||
175 | #define PI_ERR_SYSAD_DATA_B 0x00000400 /* SysAD data parity error */ | ||
176 | #define PI_ERR_SYSAD_DATA_A 0x00000800 | ||
177 | #define PI_ERR_SYSAD_ADDR_B 0x00001000 /* SysAD addr parity error */ | ||
178 | #define PI_ERR_SYSAD_ADDR_A 0x00002000 | ||
179 | #define PI_ERR_SYSCMD_DATA_B 0x00004000 /* SysCmd data parity error */ | ||
180 | #define PI_ERR_SYSCMD_DATA_A 0x00008000 | ||
181 | #define PI_ERR_SYSCMD_ADDR_B 0x00010000 /* SysCmd addr parity error */ | ||
182 | #define PI_ERR_SYSCMD_ADDR_A 0x00020000 | ||
183 | #define PI_ERR_BAD_SPOOL_B 0x00040000 /* Error spooling to memory */ | ||
184 | #define PI_ERR_BAD_SPOOL_A 0x00080000 | ||
185 | #define PI_ERR_UNCAC_UNCORR_B 0x00100000 /* Uncached uncorrectable */ | ||
186 | #define PI_ERR_UNCAC_UNCORR_A 0x00200000 | ||
187 | #define PI_ERR_SYSSTATE_TAG_B 0x00400000 /* SysState tag parity error */ | ||
188 | #define PI_ERR_SYSSTATE_TAG_A 0x00800000 | ||
189 | #define PI_ERR_MD_UNCORR 0x01000000 /* Must be cleared in MD */ | ||
190 | |||
191 | #define PI_ERR_CLEAR_ALL_A 0x00aaaaaa | ||
192 | #define PI_ERR_CLEAR_ALL_B 0x00555555 | ||
193 | |||
194 | |||
195 | /* | ||
196 | * The following three macros define all possible error int pends. | ||
197 | */ | ||
198 | |||
199 | #define PI_FATAL_ERR_CPU_A (PI_ERR_SYSSTATE_TAG_A | \ | ||
200 | PI_ERR_BAD_SPOOL_A | \ | ||
201 | PI_ERR_SYSCMD_ADDR_A | \ | ||
202 | PI_ERR_SYSCMD_DATA_A | \ | ||
203 | PI_ERR_SYSAD_ADDR_A | \ | ||
204 | PI_ERR_SYSAD_DATA_A | \ | ||
205 | PI_ERR_SYSSTATE_A) | ||
206 | |||
207 | #define PI_MISC_ERR_CPU_A (PI_ERR_UNCAC_UNCORR_A | \ | ||
208 | PI_ERR_WRB_WERR_A | \ | ||
209 | PI_ERR_WRB_TERR_A | \ | ||
210 | PI_ERR_SPUR_MSG_A | \ | ||
211 | PI_ERR_SPOOL_CMP_A) | ||
212 | |||
213 | #define PI_FATAL_ERR_CPU_B (PI_ERR_SYSSTATE_TAG_B | \ | ||
214 | PI_ERR_BAD_SPOOL_B | \ | ||
215 | PI_ERR_SYSCMD_ADDR_B | \ | ||
216 | PI_ERR_SYSCMD_DATA_B | \ | ||
217 | PI_ERR_SYSAD_ADDR_B | \ | ||
218 | PI_ERR_SYSAD_DATA_B | \ | ||
219 | PI_ERR_SYSSTATE_B) | ||
220 | |||
221 | #define PI_MISC_ERR_CPU_B (PI_ERR_UNCAC_UNCORR_B | \ | ||
222 | PI_ERR_WRB_WERR_B | \ | ||
223 | PI_ERR_WRB_TERR_B | \ | ||
224 | PI_ERR_SPUR_MSG_B | \ | ||
225 | PI_ERR_SPOOL_CMP_B) | ||
226 | |||
227 | #define PI_ERR_GENERIC (PI_ERR_MD_UNCORR) | ||
228 | |||
229 | /* | ||
230 | * Error types for PI_ERR_STATUS0_[AB] and error stack: | ||
231 | * Use the write types if WRBRRB is 1 else use the read types | ||
232 | */ | ||
233 | |||
234 | /* Fields in PI_ERR_STATUS0_[AB] */ | ||
235 | #define PI_ERR_ST0_TYPE_MASK 0x0000000000000007 | ||
236 | #define PI_ERR_ST0_TYPE_SHFT 0 | ||
237 | #define PI_ERR_ST0_REQNUM_MASK 0x0000000000000038 | ||
238 | #define PI_ERR_ST0_REQNUM_SHFT 3 | ||
239 | #define PI_ERR_ST0_SUPPL_MASK 0x000000000001ffc0 | ||
240 | #define PI_ERR_ST0_SUPPL_SHFT 6 | ||
241 | #define PI_ERR_ST0_CMD_MASK 0x0000000001fe0000 | ||
242 | #define PI_ERR_ST0_CMD_SHFT 17 | ||
243 | #define PI_ERR_ST0_ADDR_MASK 0x3ffffffffe000000 | ||
244 | #define PI_ERR_ST0_ADDR_SHFT 25 | ||
245 | #define PI_ERR_ST0_OVERRUN_MASK 0x4000000000000000 | ||
246 | #define PI_ERR_ST0_OVERRUN_SHFT 62 | ||
247 | #define PI_ERR_ST0_VALID_MASK 0x8000000000000000 | ||
248 | #define PI_ERR_ST0_VALID_SHFT 63 | ||
249 | |||
250 | /* Fields in PI_ERR_STATUS1_[AB] */ | ||
251 | #define PI_ERR_ST1_SPOOL_MASK 0x00000000001fffff | ||
252 | #define PI_ERR_ST1_SPOOL_SHFT 0 | ||
253 | #define PI_ERR_ST1_TOUTCNT_MASK 0x000000001fe00000 | ||
254 | #define PI_ERR_ST1_TOUTCNT_SHFT 21 | ||
255 | #define PI_ERR_ST1_INVCNT_MASK 0x0000007fe0000000 | ||
256 | #define PI_ERR_ST1_INVCNT_SHFT 29 | ||
257 | #define PI_ERR_ST1_CRBNUM_MASK 0x0000038000000000 | ||
258 | #define PI_ERR_ST1_CRBNUM_SHFT 39 | ||
259 | #define PI_ERR_ST1_WRBRRB_MASK 0x0000040000000000 | ||
260 | #define PI_ERR_ST1_WRBRRB_SHFT 42 | ||
261 | #define PI_ERR_ST1_CRBSTAT_MASK 0x001ff80000000000 | ||
262 | #define PI_ERR_ST1_CRBSTAT_SHFT 43 | ||
263 | #define PI_ERR_ST1_MSGSRC_MASK 0xffe0000000000000 | ||
264 | #define PI_ERR_ST1_MSGSRC_SHFT 53 | ||
265 | |||
266 | /* Fields in the error stack */ | ||
267 | #define PI_ERR_STK_TYPE_MASK 0x0000000000000003 | ||
268 | #define PI_ERR_STK_TYPE_SHFT 0 | ||
269 | #define PI_ERR_STK_SUPPL_MASK 0x0000000000000038 | ||
270 | #define PI_ERR_STK_SUPPL_SHFT 3 | ||
271 | #define PI_ERR_STK_REQNUM_MASK 0x00000000000001c0 | ||
272 | #define PI_ERR_STK_REQNUM_SHFT 6 | ||
273 | #define PI_ERR_STK_CRBNUM_MASK 0x0000000000000e00 | ||
274 | #define PI_ERR_STK_CRBNUM_SHFT 9 | ||
275 | #define PI_ERR_STK_WRBRRB_MASK 0x0000000000001000 | ||
276 | #define PI_ERR_STK_WRBRRB_SHFT 12 | ||
277 | #define PI_ERR_STK_CRBSTAT_MASK 0x00000000007fe000 | ||
278 | #define PI_ERR_STK_CRBSTAT_SHFT 13 | ||
279 | #define PI_ERR_STK_CMD_MASK 0x000000007f800000 | ||
280 | #define PI_ERR_STK_CMD_SHFT 23 | ||
281 | #define PI_ERR_STK_ADDR_MASK 0xffffffff80000000 | ||
282 | #define PI_ERR_STK_ADDR_SHFT 31 | ||
283 | |||
284 | /* Error type in the error status or stack on Read CRBs */ | ||
285 | #define PI_ERR_RD_PRERR 1 | ||
286 | #define PI_ERR_RD_DERR 2 | ||
287 | #define PI_ERR_RD_TERR 3 | ||
288 | |||
289 | /* Error type in the error status or stack on Write CRBs */ | ||
290 | #define PI_ERR_WR_WERR 0 | ||
291 | #define PI_ERR_WR_PWERR 1 | ||
292 | #define PI_ERR_WR_TERR 3 | ||
293 | |||
294 | /* Read or Write CRB in error status or stack */ | ||
295 | #define PI_ERR_RRB 0 | ||
296 | #define PI_ERR_WRB 1 | ||
297 | #define PI_ERR_ANY_CRB 2 | ||
298 | |||
299 | /* Address masks in the error status and error stack are not the same */ | ||
300 | #define ERR_STK_ADDR_SHFT 7 | ||
301 | #define ERR_STAT0_ADDR_SHFT 3 | ||
302 | |||
303 | #define PI_MIN_STACK_SIZE 4096 /* For figuring out the size to set */ | ||
304 | #define PI_STACK_SIZE_SHFT 12 /* 4k */ | ||
305 | |||
306 | #define ERR_STACK_SIZE_BYTES(_sz) \ | ||
307 | ((_sz) ? (PI_MIN_STACK_SIZE << ((_sz) - 1)) : 0) | ||
308 | |||
309 | #ifndef __ASSEMBLY__ | ||
310 | /* | ||
311 | * format of error stack and error status registers. | ||
312 | */ | ||
313 | |||
314 | struct err_stack_format { | ||
315 | u64 sk_addr : 33, /* address */ | ||
316 | sk_cmd : 8, /* message command */ | ||
317 | sk_crb_sts : 10, /* status from RRB or WRB */ | ||
318 | sk_rw_rb : 1, /* RRB == 0, WRB == 1 */ | ||
319 | sk_crb_num : 3, /* WRB (0 to 7) or RRB (0 to 4) */ | ||
320 | sk_t5_req : 3, /* RRB T5 request number */ | ||
321 | sk_suppl : 3, /* lowest 3 bit of supplemental */ | ||
322 | sk_err_type: 3; /* error type */ | ||
323 | }; | ||
324 | |||
325 | typedef union pi_err_stack { | ||
326 | u64 pi_stk_word; | ||
327 | struct err_stack_format pi_stk_fmt; | ||
328 | } pi_err_stack_t; | ||
329 | |||
330 | struct err_status0_format { | ||
331 | u64 s0_valid : 1, /* Valid */ | ||
332 | s0_ovr_run : 1, /* Overrun, spooled to memory */ | ||
333 | s0_addr : 37, /* address */ | ||
334 | s0_cmd : 8, /* message command */ | ||
335 | s0_supl : 11, /* message supplemental field */ | ||
336 | s0_t5_req : 3, /* RRB T5 request number */ | ||
337 | s0_err_type: 3; /* error type */ | ||
338 | }; | ||
339 | |||
340 | typedef union pi_err_stat0 { | ||
341 | u64 pi_stat0_word; | ||
342 | struct err_status0_format pi_stat0_fmt; | ||
343 | } pi_err_stat0_t; | ||
344 | |||
345 | struct err_status1_format { | ||
346 | u64 s1_src : 11, /* message source */ | ||
347 | s1_crb_sts : 10, /* status from RRB or WRB */ | ||
348 | s1_rw_rb : 1, /* RRB == 0, WRB == 1 */ | ||
349 | s1_crb_num : 3, /* WRB (0 to 7) or RRB (0 to 4) */ | ||
350 | s1_inval_cnt:10, /* signed invalidate counter RRB */ | ||
351 | s1_to_cnt : 8, /* crb timeout counter */ | ||
352 | s1_spl_cnt : 21; /* number spooled to memory */ | ||
353 | }; | ||
354 | |||
355 | typedef union pi_err_stat1 { | ||
356 | u64 pi_stat1_word; | ||
357 | struct err_status1_format pi_stat1_fmt; | ||
358 | } pi_err_stat1_t; | ||
359 | |||
360 | typedef u64 rtc_time_t; | ||
361 | |||
362 | #endif /* !__ASSEMBLY__ */ | ||
363 | |||
364 | |||
365 | /* Bits in PI_SYSAD_ERRCHK_EN */ | ||
366 | #define PI_SYSAD_ERRCHK_ECCGEN 0x01 /* Enable ECC generation */ | ||
367 | #define PI_SYSAD_ERRCHK_QUALGEN 0x02 /* Enable data quality signal gen. */ | ||
368 | #define PI_SYSAD_ERRCHK_SADP 0x04 /* Enable SysAD parity checking */ | ||
369 | #define PI_SYSAD_ERRCHK_CMDP 0x08 /* Enable SysCmd parity checking */ | ||
370 | #define PI_SYSAD_ERRCHK_STATE 0x10 /* Enable SysState parity checking */ | ||
371 | #define PI_SYSAD_ERRCHK_QUAL 0x20 /* Enable data quality checking */ | ||
372 | #define PI_SYSAD_CHECK_ALL 0x3f /* Generate and check all signals. */ | ||
373 | |||
374 | /* Interrupt pending bits on R10000 */ | ||
375 | |||
376 | #define HUB_IP_PEND0 0x0400 | ||
377 | #define HUB_IP_PEND1_CC 0x0800 | ||
378 | #define HUB_IP_RT 0x1000 | ||
379 | #define HUB_IP_PROF 0x2000 | ||
380 | #define HUB_IP_ERROR 0x4000 | ||
381 | #define HUB_IP_MASK 0x7c00 | ||
382 | |||
383 | /* PI_RT_LOCAL_CTRL mask and shift definitions */ | ||
384 | |||
385 | #define PRLC_USE_INT_SHFT 16 | ||
386 | #define PRLC_USE_INT_MASK (UINT64_CAST 1 << 16) | ||
387 | #define PRLC_USE_INT (UINT64_CAST 1 << 16) | ||
388 | #define PRLC_GCLK_SHFT 15 | ||
389 | #define PRLC_GCLK_MASK (UINT64_CAST 1 << 15) | ||
390 | #define PRLC_GCLK (UINT64_CAST 1 << 15) | ||
391 | #define PRLC_GCLK_COUNT_SHFT 8 | ||
392 | #define PRLC_GCLK_COUNT_MASK (UINT64_CAST 0x7f << 8) | ||
393 | #define PRLC_MAX_COUNT_SHFT 1 | ||
394 | #define PRLC_MAX_COUNT_MASK (UINT64_CAST 0x7f << 1) | ||
395 | #define PRLC_GCLK_EN_SHFT 0 | ||
396 | #define PRLC_GCLK_EN_MASK (UINT64_CAST 1) | ||
397 | #define PRLC_GCLK_EN (UINT64_CAST 1) | ||
398 | |||
399 | /* PI_RT_FILTER_CTRL mask and shift definitions */ | ||
400 | |||
401 | /* | ||
402 | * Bits for NACK_CNT_A/B and NACK_CMP | ||
403 | */ | ||
404 | #define PI_NACK_CNT_EN_SHFT 20 | ||
405 | #define PI_NACK_CNT_EN_MASK 0x100000 | ||
406 | #define PI_NACK_CNT_MASK 0x0fffff | ||
407 | #define PI_NACK_CNT_MAX 0x0fffff | ||
408 | |||
409 | #endif /* _ASM_SN_SN0_HUBPI_H */ | ||
diff --git a/include/asm-mips/sn/sn0/ip27.h b/include/asm-mips/sn/sn0/ip27.h deleted file mode 100644 index 3c97e0855c8d..000000000000 --- a/include/asm-mips/sn/sn0/ip27.h +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Derived from IRIX <sys/SN/SN0/IP27.h>. | ||
7 | * | ||
8 | * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 1999, 2006 by Ralf Baechle | ||
10 | */ | ||
11 | #ifndef _ASM_SN_SN0_IP27_H | ||
12 | #define _ASM_SN_SN0_IP27_H | ||
13 | |||
14 | #include <asm/mipsregs.h> | ||
15 | |||
16 | /* | ||
17 | * Simple definitions for the masks which remove SW bits from pte. | ||
18 | */ | ||
19 | |||
20 | #define TLBLO_HWBITSHIFT 0 /* Shift value, for masking */ | ||
21 | |||
22 | #ifndef __ASSEMBLY__ | ||
23 | |||
24 | #define CAUSE_BERRINTR IE_IRQ5 | ||
25 | |||
26 | #define ECCF_CACHE_ERR 0 | ||
27 | #define ECCF_TAGLO 1 | ||
28 | #define ECCF_ECC 2 | ||
29 | #define ECCF_ERROREPC 3 | ||
30 | #define ECCF_PADDR 4 | ||
31 | #define ECCF_SIZE (5 * sizeof(long)) | ||
32 | |||
33 | #endif /* !__ASSEMBLY__ */ | ||
34 | |||
35 | #ifdef __ASSEMBLY__ | ||
36 | |||
37 | /* | ||
38 | * KL_GET_CPUNUM (similar to EV_GET_SPNUM for EVEREST platform) reads | ||
39 | * the processor number of the calling processor. The proc parameters | ||
40 | * must be a register. | ||
41 | */ | ||
42 | #define KL_GET_CPUNUM(proc) \ | ||
43 | dli proc, LOCAL_HUB(0); \ | ||
44 | ld proc, PI_CPU_NUM(proc) | ||
45 | |||
46 | #endif /* __ASSEMBLY__ */ | ||
47 | |||
48 | /* | ||
49 | * R10000 status register interrupt bit mask usage for IP27. | ||
50 | */ | ||
51 | #define SRB_SWTIMO IE_SW0 /* 0x0100 */ | ||
52 | #define SRB_NET IE_SW1 /* 0x0200 */ | ||
53 | #define SRB_DEV0 IE_IRQ0 /* 0x0400 */ | ||
54 | #define SRB_DEV1 IE_IRQ1 /* 0x0800 */ | ||
55 | #define SRB_TIMOCLK IE_IRQ2 /* 0x1000 */ | ||
56 | #define SRB_PROFCLK IE_IRQ3 /* 0x2000 */ | ||
57 | #define SRB_ERR IE_IRQ4 /* 0x4000 */ | ||
58 | #define SRB_SCHEDCLK IE_IRQ5 /* 0x8000 */ | ||
59 | |||
60 | #define SR_IBIT_HI SRB_DEV0 | ||
61 | #define SR_IBIT_PROF SRB_PROFCLK | ||
62 | |||
63 | #define SRB_SWTIMO_IDX 0 | ||
64 | #define SRB_NET_IDX 1 | ||
65 | #define SRB_DEV0_IDX 2 | ||
66 | #define SRB_DEV1_IDX 3 | ||
67 | #define SRB_TIMOCLK_IDX 4 | ||
68 | #define SRB_PROFCLK_IDX 5 | ||
69 | #define SRB_ERR_IDX 6 | ||
70 | #define SRB_SCHEDCLK_IDX 7 | ||
71 | |||
72 | #define NUM_CAUSE_INTRS 8 | ||
73 | |||
74 | #define SCACHE_LINESIZE 128 | ||
75 | #define SCACHE_LINEMASK (SCACHE_LINESIZE - 1) | ||
76 | |||
77 | #include <asm/sn/addrs.h> | ||
78 | |||
79 | #define LED_CYCLE_MASK 0x0f | ||
80 | #define LED_CYCLE_SHFT 4 | ||
81 | |||
82 | #define SEND_NMI(_nasid, _slice) \ | ||
83 | REMOTE_HUB_S((_nasid), (PI_NMI_A + ((_slice) * PI_NMI_OFFSET)), 1) | ||
84 | |||
85 | #endif /* _ASM_SN_SN0_IP27_H */ | ||
diff --git a/include/asm-mips/sn/sn_private.h b/include/asm-mips/sn/sn_private.h deleted file mode 100644 index 1a2c3025bf28..000000000000 --- a/include/asm-mips/sn/sn_private.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | #ifndef __ASM_SN_SN_PRIVATE_H | ||
2 | #define __ASM_SN_SN_PRIVATE_H | ||
3 | |||
4 | #include <asm/sn/types.h> | ||
5 | |||
6 | extern nasid_t master_nasid; | ||
7 | |||
8 | extern void cpu_node_probe(void); | ||
9 | extern cnodeid_t get_compact_nodeid(void); | ||
10 | extern void hub_rtc_init(cnodeid_t); | ||
11 | extern void cpu_time_init(void); | ||
12 | extern void per_cpu_init(void); | ||
13 | extern void install_cpu_nmi_handler(int slice); | ||
14 | extern void install_ipi(void); | ||
15 | extern void setup_replication_mask(void); | ||
16 | extern void replicate_kernel_text(void); | ||
17 | extern pfn_t node_getfirstfree(cnodeid_t); | ||
18 | |||
19 | #endif /* __ASM_SN_SN_PRIVATE_H */ | ||
diff --git a/include/asm-mips/sn/types.h b/include/asm-mips/sn/types.h deleted file mode 100644 index 74d0bb260b86..000000000000 --- a/include/asm-mips/sn/types.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
7 | * Copyright (C) 1999 by Ralf Baechle | ||
8 | */ | ||
9 | #ifndef _ASM_SN_TYPES_H | ||
10 | #define _ASM_SN_TYPES_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | typedef unsigned long cpuid_t; | ||
15 | typedef unsigned long cnodemask_t; | ||
16 | typedef signed short nasid_t; /* node id in numa-as-id space */ | ||
17 | typedef signed short cnodeid_t; /* node id in compact-id space */ | ||
18 | typedef signed char partid_t; /* partition ID type */ | ||
19 | typedef signed short moduleid_t; /* user-visible module number type */ | ||
20 | typedef signed short cmoduleid_t; /* kernel compact module id type */ | ||
21 | typedef unsigned char clusterid_t; /* Clusterid of the cell */ | ||
22 | typedef unsigned long pfn_t; | ||
23 | |||
24 | typedef dev_t vertex_hdl_t; /* hardware graph vertex handle */ | ||
25 | |||
26 | #endif /* _ASM_SN_TYPES_H */ | ||
diff --git a/include/asm-mips/sni.h b/include/asm-mips/sni.h deleted file mode 100644 index 8c1eb02c6d16..000000000000 --- a/include/asm-mips/sni.h +++ /dev/null | |||
@@ -1,244 +0,0 @@ | |||
1 | /* | ||
2 | * SNI specific definitions | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1997, 1998 by Ralf Baechle | ||
9 | * Copyright (C) 2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de) | ||
10 | */ | ||
11 | #ifndef __ASM_SNI_H | ||
12 | #define __ASM_SNI_H | ||
13 | |||
14 | extern unsigned int sni_brd_type; | ||
15 | |||
16 | #define SNI_BRD_10 2 | ||
17 | #define SNI_BRD_10NEW 3 | ||
18 | #define SNI_BRD_TOWER_OASIC 4 | ||
19 | #define SNI_BRD_MINITOWER 5 | ||
20 | #define SNI_BRD_PCI_TOWER 6 | ||
21 | #define SNI_BRD_RM200 7 | ||
22 | #define SNI_BRD_PCI_MTOWER 8 | ||
23 | #define SNI_BRD_PCI_DESKTOP 9 | ||
24 | #define SNI_BRD_PCI_TOWER_CPLUS 10 | ||
25 | #define SNI_BRD_PCI_MTOWER_CPLUS 11 | ||
26 | |||
27 | /* RM400 cpu types */ | ||
28 | #define SNI_CPU_M8021 0x01 | ||
29 | #define SNI_CPU_M8030 0x04 | ||
30 | #define SNI_CPU_M8031 0x06 | ||
31 | #define SNI_CPU_M8034 0x0f | ||
32 | #define SNI_CPU_M8037 0x07 | ||
33 | #define SNI_CPU_M8040 0x05 | ||
34 | #define SNI_CPU_M8043 0x09 | ||
35 | #define SNI_CPU_M8050 0x0b | ||
36 | #define SNI_CPU_M8053 0x0d | ||
37 | |||
38 | #define SNI_PORT_BASE CKSEG1ADDR(0xb4000000) | ||
39 | |||
40 | #ifndef __MIPSEL__ | ||
41 | /* | ||
42 | * ASIC PCI registers for big endian configuration. | ||
43 | */ | ||
44 | #define PCIMT_UCONF CKSEG1ADDR(0xbfff0004) | ||
45 | #define PCIMT_IOADTIMEOUT2 CKSEG1ADDR(0xbfff000c) | ||
46 | #define PCIMT_IOMEMCONF CKSEG1ADDR(0xbfff0014) | ||
47 | #define PCIMT_IOMMU CKSEG1ADDR(0xbfff001c) | ||
48 | #define PCIMT_IOADTIMEOUT1 CKSEG1ADDR(0xbfff0024) | ||
49 | #define PCIMT_DMAACCESS CKSEG1ADDR(0xbfff002c) | ||
50 | #define PCIMT_DMAHIT CKSEG1ADDR(0xbfff0034) | ||
51 | #define PCIMT_ERRSTATUS CKSEG1ADDR(0xbfff003c) | ||
52 | #define PCIMT_ERRADDR CKSEG1ADDR(0xbfff0044) | ||
53 | #define PCIMT_SYNDROME CKSEG1ADDR(0xbfff004c) | ||
54 | #define PCIMT_ITPEND CKSEG1ADDR(0xbfff0054) | ||
55 | #define IT_INT2 0x01 | ||
56 | #define IT_INTD 0x02 | ||
57 | #define IT_INTC 0x04 | ||
58 | #define IT_INTB 0x08 | ||
59 | #define IT_INTA 0x10 | ||
60 | #define IT_EISA 0x20 | ||
61 | #define IT_SCSI 0x40 | ||
62 | #define IT_ETH 0x80 | ||
63 | #define PCIMT_IRQSEL CKSEG1ADDR(0xbfff005c) | ||
64 | #define PCIMT_TESTMEM CKSEG1ADDR(0xbfff0064) | ||
65 | #define PCIMT_ECCREG CKSEG1ADDR(0xbfff006c) | ||
66 | #define PCIMT_CONFIG_ADDRESS CKSEG1ADDR(0xbfff0074) | ||
67 | #define PCIMT_ASIC_ID CKSEG1ADDR(0xbfff007c) /* read */ | ||
68 | #define PCIMT_SOFT_RESET CKSEG1ADDR(0xbfff007c) /* write */ | ||
69 | #define PCIMT_PIA_OE CKSEG1ADDR(0xbfff0084) | ||
70 | #define PCIMT_PIA_DATAOUT CKSEG1ADDR(0xbfff008c) | ||
71 | #define PCIMT_PIA_DATAIN CKSEG1ADDR(0xbfff0094) | ||
72 | #define PCIMT_CACHECONF CKSEG1ADDR(0xbfff009c) | ||
73 | #define PCIMT_INVSPACE CKSEG1ADDR(0xbfff00a4) | ||
74 | #else | ||
75 | /* | ||
76 | * ASIC PCI registers for little endian configuration. | ||
77 | */ | ||
78 | #define PCIMT_UCONF CKSEG1ADDR(0xbfff0000) | ||
79 | #define PCIMT_IOADTIMEOUT2 CKSEG1ADDR(0xbfff0008) | ||
80 | #define PCIMT_IOMEMCONF CKSEG1ADDR(0xbfff0010) | ||
81 | #define PCIMT_IOMMU CKSEG1ADDR(0xbfff0018) | ||
82 | #define PCIMT_IOADTIMEOUT1 CKSEG1ADDR(0xbfff0020) | ||
83 | #define PCIMT_DMAACCESS CKSEG1ADDR(0xbfff0028) | ||
84 | #define PCIMT_DMAHIT CKSEG1ADDR(0xbfff0030) | ||
85 | #define PCIMT_ERRSTATUS CKSEG1ADDR(0xbfff0038) | ||
86 | #define PCIMT_ERRADDR CKSEG1ADDR(0xbfff0040) | ||
87 | #define PCIMT_SYNDROME CKSEG1ADDR(0xbfff0048) | ||
88 | #define PCIMT_ITPEND CKSEG1ADDR(0xbfff0050) | ||
89 | #define IT_INT2 0x01 | ||
90 | #define IT_INTD 0x02 | ||
91 | #define IT_INTC 0x04 | ||
92 | #define IT_INTB 0x08 | ||
93 | #define IT_INTA 0x10 | ||
94 | #define IT_EISA 0x20 | ||
95 | #define IT_SCSI 0x40 | ||
96 | #define IT_ETH 0x80 | ||
97 | #define PCIMT_IRQSEL CKSEG1ADDR(0xbfff0058) | ||
98 | #define PCIMT_TESTMEM CKSEG1ADDR(0xbfff0060) | ||
99 | #define PCIMT_ECCREG CKSEG1ADDR(0xbfff0068) | ||
100 | #define PCIMT_CONFIG_ADDRESS CKSEG1ADDR(0xbfff0070) | ||
101 | #define PCIMT_ASIC_ID CKSEG1ADDR(0xbfff0078) /* read */ | ||
102 | #define PCIMT_SOFT_RESET CKSEG1ADDR(0xbfff0078) /* write */ | ||
103 | #define PCIMT_PIA_OE CKSEG1ADDR(0xbfff0080) | ||
104 | #define PCIMT_PIA_DATAOUT CKSEG1ADDR(0xbfff0088) | ||
105 | #define PCIMT_PIA_DATAIN CKSEG1ADDR(0xbfff0090) | ||
106 | #define PCIMT_CACHECONF CKSEG1ADDR(0xbfff0098) | ||
107 | #define PCIMT_INVSPACE CKSEG1ADDR(0xbfff00a0) | ||
108 | #endif | ||
109 | |||
110 | #define PCIMT_PCI_CONF CKSEG1ADDR(0xbfff0100) | ||
111 | |||
112 | /* | ||
113 | * Data port for the PCI bus in IO space | ||
114 | */ | ||
115 | #define PCIMT_CONFIG_DATA 0x0cfc | ||
116 | |||
117 | /* | ||
118 | * Board specific registers | ||
119 | */ | ||
120 | #define PCIMT_CSMSR CKSEG1ADDR(0xbfd00000) | ||
121 | #define PCIMT_CSSWITCH CKSEG1ADDR(0xbfd10000) | ||
122 | #define PCIMT_CSITPEND CKSEG1ADDR(0xbfd20000) | ||
123 | #define PCIMT_AUTO_PO_EN CKSEG1ADDR(0xbfd30000) | ||
124 | #define PCIMT_CLR_TEMP CKSEG1ADDR(0xbfd40000) | ||
125 | #define PCIMT_AUTO_PO_DIS CKSEG1ADDR(0xbfd50000) | ||
126 | #define PCIMT_EXMSR CKSEG1ADDR(0xbfd60000) | ||
127 | #define PCIMT_UNUSED1 CKSEG1ADDR(0xbfd70000) | ||
128 | #define PCIMT_CSWCSM CKSEG1ADDR(0xbfd80000) | ||
129 | #define PCIMT_UNUSED2 CKSEG1ADDR(0xbfd90000) | ||
130 | #define PCIMT_CSLED CKSEG1ADDR(0xbfda0000) | ||
131 | #define PCIMT_CSMAPISA CKSEG1ADDR(0xbfdb0000) | ||
132 | #define PCIMT_CSRSTBP CKSEG1ADDR(0xbfdc0000) | ||
133 | #define PCIMT_CLRPOFF CKSEG1ADDR(0xbfdd0000) | ||
134 | #define PCIMT_CSTIMER CKSEG1ADDR(0xbfde0000) | ||
135 | #define PCIMT_PWDN CKSEG1ADDR(0xbfdf0000) | ||
136 | |||
137 | /* | ||
138 | * A20R based boards | ||
139 | */ | ||
140 | #define A20R_PT_CLOCK_BASE CKSEG1ADDR(0xbc040000) | ||
141 | #define A20R_PT_TIM0_ACK CKSEG1ADDR(0xbc050000) | ||
142 | #define A20R_PT_TIM1_ACK CKSEG1ADDR(0xbc060000) | ||
143 | |||
144 | #define SNI_A20R_IRQ_BASE MIPS_CPU_IRQ_BASE | ||
145 | #define SNI_A20R_IRQ_TIMER (SNI_A20R_IRQ_BASE+5) | ||
146 | |||
147 | #define SNI_PCIT_INT_REG CKSEG1ADDR(0xbfff000c) | ||
148 | |||
149 | #define SNI_PCIT_INT_START 24 | ||
150 | #define SNI_PCIT_INT_END 30 | ||
151 | |||
152 | #define PCIT_IRQ_ETHERNET (MIPS_CPU_IRQ_BASE + 5) | ||
153 | #define PCIT_IRQ_INTA (SNI_PCIT_INT_START + 0) | ||
154 | #define PCIT_IRQ_INTB (SNI_PCIT_INT_START + 1) | ||
155 | #define PCIT_IRQ_INTC (SNI_PCIT_INT_START + 2) | ||
156 | #define PCIT_IRQ_INTD (SNI_PCIT_INT_START + 3) | ||
157 | #define PCIT_IRQ_SCSI0 (SNI_PCIT_INT_START + 4) | ||
158 | #define PCIT_IRQ_SCSI1 (SNI_PCIT_INT_START + 5) | ||
159 | |||
160 | |||
161 | /* | ||
162 | * Interrupt 0-16 are EISA interrupts. Interrupts from 16 on are assigned | ||
163 | * to the other interrupts generated by ASIC PCI. | ||
164 | * | ||
165 | * INT2 is a wired-or of the push button interrupt, high temperature interrupt | ||
166 | * ASIC PCI interrupt. | ||
167 | */ | ||
168 | #define PCIMT_KEYBOARD_IRQ 1 | ||
169 | #define PCIMT_IRQ_INT2 24 | ||
170 | #define PCIMT_IRQ_INTD 25 | ||
171 | #define PCIMT_IRQ_INTC 26 | ||
172 | #define PCIMT_IRQ_INTB 27 | ||
173 | #define PCIMT_IRQ_INTA 28 | ||
174 | #define PCIMT_IRQ_EISA 29 | ||
175 | #define PCIMT_IRQ_SCSI 30 | ||
176 | |||
177 | #define PCIMT_IRQ_ETHERNET (MIPS_CPU_IRQ_BASE+6) | ||
178 | |||
179 | #if 0 | ||
180 | #define PCIMT_IRQ_TEMPERATURE 24 | ||
181 | #define PCIMT_IRQ_EISA_NMI 25 | ||
182 | #define PCIMT_IRQ_POWER_OFF 26 | ||
183 | #define PCIMT_IRQ_BUTTON 27 | ||
184 | #endif | ||
185 | |||
186 | /* | ||
187 | * Base address for the mapped 16mb EISA bus segment. | ||
188 | */ | ||
189 | #define PCIMT_EISA_BASE CKSEG1ADDR(0xb0000000) | ||
190 | |||
191 | /* PCI EISA Interrupt acknowledge */ | ||
192 | #define PCIMT_INT_ACKNOWLEDGE CKSEG1ADDR(0xba000000) | ||
193 | |||
194 | /* | ||
195 | * SNI ID PROM | ||
196 | * | ||
197 | * SNI_IDPROM_MEMSIZE Memsize in 16MB quantities | ||
198 | * SNI_IDPROM_BRDTYPE Board Type | ||
199 | * SNI_IDPROM_CPUTYPE CPU Type on RM400 | ||
200 | */ | ||
201 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
202 | #define __SNI_END 0 | ||
203 | #endif | ||
204 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
205 | #define __SNI_END 3 | ||
206 | #endif | ||
207 | #define SNI_IDPROM_BASE CKSEG1ADDR(0x1ff00000) | ||
208 | #define SNI_IDPROM_MEMSIZE (SNI_IDPROM_BASE + (0x28 ^ __SNI_END)) | ||
209 | #define SNI_IDPROM_BRDTYPE (SNI_IDPROM_BASE + (0x29 ^ __SNI_END)) | ||
210 | #define SNI_IDPROM_CPUTYPE (SNI_IDPROM_BASE + (0x30 ^ __SNI_END)) | ||
211 | |||
212 | #define SNI_IDPROM_SIZE 0x1000 | ||
213 | |||
214 | /* board specific init functions */ | ||
215 | extern void sni_a20r_init(void); | ||
216 | extern void sni_pcit_init(void); | ||
217 | extern void sni_rm200_init(void); | ||
218 | extern void sni_pcimt_init(void); | ||
219 | |||
220 | /* board specific irq init functions */ | ||
221 | extern void sni_a20r_irq_init(void); | ||
222 | extern void sni_pcit_irq_init(void); | ||
223 | extern void sni_pcit_cplus_irq_init(void); | ||
224 | extern void sni_rm200_irq_init(void); | ||
225 | extern void sni_pcimt_irq_init(void); | ||
226 | |||
227 | /* timer inits */ | ||
228 | extern void sni_cpu_time_init(void); | ||
229 | |||
230 | /* eisa init for RM200/400 */ | ||
231 | #ifdef CONFIG_EISA | ||
232 | extern int sni_eisa_root_init(void); | ||
233 | #else | ||
234 | static inline int sni_eisa_root_init(void) | ||
235 | { | ||
236 | return 0; | ||
237 | } | ||
238 | #endif | ||
239 | |||
240 | /* common irq stuff */ | ||
241 | extern void (*sni_hwint)(void); | ||
242 | extern struct irqaction sni_isa_irq; | ||
243 | |||
244 | #endif /* __ASM_SNI_H */ | ||
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h deleted file mode 100644 index facc2d7a87ca..000000000000 --- a/include/asm-mips/socket.h +++ /dev/null | |||
@@ -1,117 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle | ||
7 | * Copyright (C) 2000, 2001 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_SOCKET_H | ||
10 | #define _ASM_SOCKET_H | ||
11 | |||
12 | #include <asm/sockios.h> | ||
13 | |||
14 | /* | ||
15 | * For setsockopt(2) | ||
16 | * | ||
17 | * This defines are ABI conformant as far as Linux supports these ... | ||
18 | */ | ||
19 | #define SOL_SOCKET 0xffff | ||
20 | |||
21 | #define SO_DEBUG 0x0001 /* Record debugging information. */ | ||
22 | #define SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */ | ||
23 | #define SO_KEEPALIVE 0x0008 /* Keep connections alive and send | ||
24 | SIGPIPE when they die. */ | ||
25 | #define SO_DONTROUTE 0x0010 /* Don't do local routing. */ | ||
26 | #define SO_BROADCAST 0x0020 /* Allow transmission of | ||
27 | broadcast messages. */ | ||
28 | #define SO_LINGER 0x0080 /* Block on close of a reliable | ||
29 | socket to transmit pending data. */ | ||
30 | #define SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */ | ||
31 | #if 0 | ||
32 | To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ | ||
33 | #endif | ||
34 | |||
35 | #define SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */ | ||
36 | #define SO_STYLE SO_TYPE /* Synonym */ | ||
37 | #define SO_ERROR 0x1007 /* get error status and clear */ | ||
38 | #define SO_SNDBUF 0x1001 /* Send buffer size. */ | ||
39 | #define SO_RCVBUF 0x1002 /* Receive buffer. */ | ||
40 | #define SO_SNDLOWAT 0x1003 /* send low-water mark */ | ||
41 | #define SO_RCVLOWAT 0x1004 /* receive low-water mark */ | ||
42 | #define SO_SNDTIMEO 0x1005 /* send timeout */ | ||
43 | #define SO_RCVTIMEO 0x1006 /* receive timeout */ | ||
44 | #define SO_ACCEPTCONN 0x1009 | ||
45 | |||
46 | /* linux-specific, might as well be the same as on i386 */ | ||
47 | #define SO_NO_CHECK 11 | ||
48 | #define SO_PRIORITY 12 | ||
49 | #define SO_BSDCOMPAT 14 | ||
50 | |||
51 | #define SO_PASSCRED 17 | ||
52 | #define SO_PEERCRED 18 | ||
53 | |||
54 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | ||
55 | #define SO_SECURITY_AUTHENTICATION 22 | ||
56 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 | ||
57 | #define SO_SECURITY_ENCRYPTION_NETWORK 24 | ||
58 | |||
59 | #define SO_BINDTODEVICE 25 | ||
60 | |||
61 | /* Socket filtering */ | ||
62 | #define SO_ATTACH_FILTER 26 | ||
63 | #define SO_DETACH_FILTER 27 | ||
64 | |||
65 | #define SO_PEERNAME 28 | ||
66 | #define SO_TIMESTAMP 29 | ||
67 | #define SCM_TIMESTAMP SO_TIMESTAMP | ||
68 | |||
69 | #define SO_PEERSEC 30 | ||
70 | #define SO_SNDBUFFORCE 31 | ||
71 | #define SO_RCVBUFFORCE 33 | ||
72 | #define SO_PASSSEC 34 | ||
73 | #define SO_TIMESTAMPNS 35 | ||
74 | #define SCM_TIMESTAMPNS SO_TIMESTAMPNS | ||
75 | |||
76 | #define SO_MARK 36 | ||
77 | |||
78 | #ifdef __KERNEL__ | ||
79 | |||
80 | /** sock_type - Socket types | ||
81 | * | ||
82 | * Please notice that for binary compat reasons MIPS has to | ||
83 | * override the enum sock_type in include/linux/net.h, so | ||
84 | * we define ARCH_HAS_SOCKET_TYPES here. | ||
85 | * | ||
86 | * @SOCK_DGRAM - datagram (conn.less) socket | ||
87 | * @SOCK_STREAM - stream (connection) socket | ||
88 | * @SOCK_RAW - raw socket | ||
89 | * @SOCK_RDM - reliably-delivered message | ||
90 | * @SOCK_SEQPACKET - sequential packet socket | ||
91 | * @SOCK_PACKET - linux specific way of getting packets at the dev level. | ||
92 | * For writing rarp and other similar things on the user level. | ||
93 | */ | ||
94 | enum sock_type { | ||
95 | SOCK_DGRAM = 1, | ||
96 | SOCK_STREAM = 2, | ||
97 | SOCK_RAW = 3, | ||
98 | SOCK_RDM = 4, | ||
99 | SOCK_SEQPACKET = 5, | ||
100 | SOCK_DCCP = 6, | ||
101 | SOCK_PACKET = 10, | ||
102 | }; | ||
103 | |||
104 | #define SOCK_MAX (SOCK_PACKET + 1) | ||
105 | /* Mask which covers at least up to SOCK_MASK-1. The | ||
106 | * * remaining bits are used as flags. */ | ||
107 | #define SOCK_TYPE_MASK 0xf | ||
108 | |||
109 | /* Flags for socket, socketpair, paccept */ | ||
110 | #define SOCK_CLOEXEC O_CLOEXEC | ||
111 | #define SOCK_NONBLOCK O_NONBLOCK | ||
112 | |||
113 | #define ARCH_HAS_SOCKET_TYPES 1 | ||
114 | |||
115 | #endif /* __KERNEL__ */ | ||
116 | |||
117 | #endif /* _ASM_SOCKET_H */ | ||
diff --git a/include/asm-mips/sockios.h b/include/asm-mips/sockios.h deleted file mode 100644 index ed1a5f78d22f..000000000000 --- a/include/asm-mips/sockios.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * Socket-level I/O control calls. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1995 by Ralf Baechle | ||
9 | */ | ||
10 | #ifndef _ASM_SOCKIOS_H | ||
11 | #define _ASM_SOCKIOS_H | ||
12 | |||
13 | #include <asm/ioctl.h> | ||
14 | |||
15 | /* Socket-level I/O control calls. */ | ||
16 | #define FIOGETOWN _IOR('f', 123, int) | ||
17 | #define FIOSETOWN _IOW('f', 124, int) | ||
18 | |||
19 | #define SIOCATMARK _IOR('s', 7, int) | ||
20 | #define SIOCSPGRP _IOW('s', 8, pid_t) | ||
21 | #define SIOCGPGRP _IOR('s', 9, pid_t) | ||
22 | |||
23 | #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ | ||
24 | #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ | ||
25 | |||
26 | #endif /* _ASM_SOCKIOS_H */ | ||
diff --git a/include/asm-mips/sparsemem.h b/include/asm-mips/sparsemem.h deleted file mode 100644 index 795ac6c23203..000000000000 --- a/include/asm-mips/sparsemem.h +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #ifndef _MIPS_SPARSEMEM_H | ||
2 | #define _MIPS_SPARSEMEM_H | ||
3 | #ifdef CONFIG_SPARSEMEM | ||
4 | |||
5 | /* | ||
6 | * SECTION_SIZE_BITS 2^N: how big each section will be | ||
7 | * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space | ||
8 | */ | ||
9 | #define SECTION_SIZE_BITS 28 | ||
10 | #define MAX_PHYSMEM_BITS 35 | ||
11 | |||
12 | #endif /* CONFIG_SPARSEMEM */ | ||
13 | #endif /* _MIPS_SPARSEMEM_H */ | ||
14 | |||
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h deleted file mode 100644 index bb897016c491..000000000000 --- a/include/asm-mips/spinlock.h +++ /dev/null | |||
@@ -1,376 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1999, 2000, 06 Ralf Baechle (ralf@linux-mips.org) | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_SPINLOCK_H | ||
10 | #define _ASM_SPINLOCK_H | ||
11 | |||
12 | #include <asm/barrier.h> | ||
13 | #include <asm/war.h> | ||
14 | |||
15 | /* | ||
16 | * Your basic SMP spinlocks, allowing only a single CPU anywhere | ||
17 | */ | ||
18 | |||
19 | #define __raw_spin_is_locked(x) ((x)->lock != 0) | ||
20 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | ||
21 | #define __raw_spin_unlock_wait(x) \ | ||
22 | do { cpu_relax(); } while ((x)->lock) | ||
23 | |||
24 | /* | ||
25 | * Simple spin lock operations. There are two variants, one clears IRQ's | ||
26 | * on the local processor, one does not. | ||
27 | * | ||
28 | * We make no fairness assumptions. They have a cost. | ||
29 | */ | ||
30 | |||
31 | static inline void __raw_spin_lock(raw_spinlock_t *lock) | ||
32 | { | ||
33 | unsigned int tmp; | ||
34 | |||
35 | if (R10000_LLSC_WAR) { | ||
36 | __asm__ __volatile__( | ||
37 | " .set noreorder # __raw_spin_lock \n" | ||
38 | "1: ll %1, %2 \n" | ||
39 | " bnez %1, 1b \n" | ||
40 | " li %1, 1 \n" | ||
41 | " sc %1, %0 \n" | ||
42 | " beqzl %1, 1b \n" | ||
43 | " nop \n" | ||
44 | " .set reorder \n" | ||
45 | : "=m" (lock->lock), "=&r" (tmp) | ||
46 | : "m" (lock->lock) | ||
47 | : "memory"); | ||
48 | } else { | ||
49 | __asm__ __volatile__( | ||
50 | " .set noreorder # __raw_spin_lock \n" | ||
51 | "1: ll %1, %2 \n" | ||
52 | " bnez %1, 2f \n" | ||
53 | " li %1, 1 \n" | ||
54 | " sc %1, %0 \n" | ||
55 | " beqz %1, 2f \n" | ||
56 | " nop \n" | ||
57 | " .subsection 2 \n" | ||
58 | "2: ll %1, %2 \n" | ||
59 | " bnez %1, 2b \n" | ||
60 | " li %1, 1 \n" | ||
61 | " b 1b \n" | ||
62 | " nop \n" | ||
63 | " .previous \n" | ||
64 | " .set reorder \n" | ||
65 | : "=m" (lock->lock), "=&r" (tmp) | ||
66 | : "m" (lock->lock) | ||
67 | : "memory"); | ||
68 | } | ||
69 | |||
70 | smp_llsc_mb(); | ||
71 | } | ||
72 | |||
73 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) | ||
74 | { | ||
75 | smp_mb(); | ||
76 | |||
77 | __asm__ __volatile__( | ||
78 | " .set noreorder # __raw_spin_unlock \n" | ||
79 | " sw $0, %0 \n" | ||
80 | " .set\treorder \n" | ||
81 | : "=m" (lock->lock) | ||
82 | : "m" (lock->lock) | ||
83 | : "memory"); | ||
84 | } | ||
85 | |||
86 | static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock) | ||
87 | { | ||
88 | unsigned int temp, res; | ||
89 | |||
90 | if (R10000_LLSC_WAR) { | ||
91 | __asm__ __volatile__( | ||
92 | " .set noreorder # __raw_spin_trylock \n" | ||
93 | "1: ll %0, %3 \n" | ||
94 | " ori %2, %0, 1 \n" | ||
95 | " sc %2, %1 \n" | ||
96 | " beqzl %2, 1b \n" | ||
97 | " nop \n" | ||
98 | " andi %2, %0, 1 \n" | ||
99 | " .set reorder" | ||
100 | : "=&r" (temp), "=m" (lock->lock), "=&r" (res) | ||
101 | : "m" (lock->lock) | ||
102 | : "memory"); | ||
103 | } else { | ||
104 | __asm__ __volatile__( | ||
105 | " .set noreorder # __raw_spin_trylock \n" | ||
106 | "1: ll %0, %3 \n" | ||
107 | " ori %2, %0, 1 \n" | ||
108 | " sc %2, %1 \n" | ||
109 | " beqz %2, 2f \n" | ||
110 | " andi %2, %0, 1 \n" | ||
111 | " .subsection 2 \n" | ||
112 | "2: b 1b \n" | ||
113 | " nop \n" | ||
114 | " .previous \n" | ||
115 | " .set reorder" | ||
116 | : "=&r" (temp), "=m" (lock->lock), "=&r" (res) | ||
117 | : "m" (lock->lock) | ||
118 | : "memory"); | ||
119 | } | ||
120 | |||
121 | smp_llsc_mb(); | ||
122 | |||
123 | return res == 0; | ||
124 | } | ||
125 | |||
126 | /* | ||
127 | * Read-write spinlocks, allowing multiple readers but only one writer. | ||
128 | * | ||
129 | * NOTE! it is quite common to have readers in interrupts but no interrupt | ||
130 | * writers. For those circumstances we can "mix" irq-safe locks - any writer | ||
131 | * needs to get a irq-safe write-lock, but readers can get non-irqsafe | ||
132 | * read-locks. | ||
133 | */ | ||
134 | |||
135 | /* | ||
136 | * read_can_lock - would read_trylock() succeed? | ||
137 | * @lock: the rwlock in question. | ||
138 | */ | ||
139 | #define __raw_read_can_lock(rw) ((rw)->lock >= 0) | ||
140 | |||
141 | /* | ||
142 | * write_can_lock - would write_trylock() succeed? | ||
143 | * @lock: the rwlock in question. | ||
144 | */ | ||
145 | #define __raw_write_can_lock(rw) (!(rw)->lock) | ||
146 | |||
147 | static inline void __raw_read_lock(raw_rwlock_t *rw) | ||
148 | { | ||
149 | unsigned int tmp; | ||
150 | |||
151 | if (R10000_LLSC_WAR) { | ||
152 | __asm__ __volatile__( | ||
153 | " .set noreorder # __raw_read_lock \n" | ||
154 | "1: ll %1, %2 \n" | ||
155 | " bltz %1, 1b \n" | ||
156 | " addu %1, 1 \n" | ||
157 | " sc %1, %0 \n" | ||
158 | " beqzl %1, 1b \n" | ||
159 | " nop \n" | ||
160 | " .set reorder \n" | ||
161 | : "=m" (rw->lock), "=&r" (tmp) | ||
162 | : "m" (rw->lock) | ||
163 | : "memory"); | ||
164 | } else { | ||
165 | __asm__ __volatile__( | ||
166 | " .set noreorder # __raw_read_lock \n" | ||
167 | "1: ll %1, %2 \n" | ||
168 | " bltz %1, 2f \n" | ||
169 | " addu %1, 1 \n" | ||
170 | " sc %1, %0 \n" | ||
171 | " beqz %1, 1b \n" | ||
172 | " nop \n" | ||
173 | " .subsection 2 \n" | ||
174 | "2: ll %1, %2 \n" | ||
175 | " bltz %1, 2b \n" | ||
176 | " addu %1, 1 \n" | ||
177 | " b 1b \n" | ||
178 | " nop \n" | ||
179 | " .previous \n" | ||
180 | " .set reorder \n" | ||
181 | : "=m" (rw->lock), "=&r" (tmp) | ||
182 | : "m" (rw->lock) | ||
183 | : "memory"); | ||
184 | } | ||
185 | |||
186 | smp_llsc_mb(); | ||
187 | } | ||
188 | |||
189 | /* Note the use of sub, not subu which will make the kernel die with an | ||
190 | overflow exception if we ever try to unlock an rwlock that is already | ||
191 | unlocked or is being held by a writer. */ | ||
192 | static inline void __raw_read_unlock(raw_rwlock_t *rw) | ||
193 | { | ||
194 | unsigned int tmp; | ||
195 | |||
196 | smp_llsc_mb(); | ||
197 | |||
198 | if (R10000_LLSC_WAR) { | ||
199 | __asm__ __volatile__( | ||
200 | "1: ll %1, %2 # __raw_read_unlock \n" | ||
201 | " sub %1, 1 \n" | ||
202 | " sc %1, %0 \n" | ||
203 | " beqzl %1, 1b \n" | ||
204 | : "=m" (rw->lock), "=&r" (tmp) | ||
205 | : "m" (rw->lock) | ||
206 | : "memory"); | ||
207 | } else { | ||
208 | __asm__ __volatile__( | ||
209 | " .set noreorder # __raw_read_unlock \n" | ||
210 | "1: ll %1, %2 \n" | ||
211 | " sub %1, 1 \n" | ||
212 | " sc %1, %0 \n" | ||
213 | " beqz %1, 2f \n" | ||
214 | " nop \n" | ||
215 | " .subsection 2 \n" | ||
216 | "2: b 1b \n" | ||
217 | " nop \n" | ||
218 | " .previous \n" | ||
219 | " .set reorder \n" | ||
220 | : "=m" (rw->lock), "=&r" (tmp) | ||
221 | : "m" (rw->lock) | ||
222 | : "memory"); | ||
223 | } | ||
224 | } | ||
225 | |||
226 | static inline void __raw_write_lock(raw_rwlock_t *rw) | ||
227 | { | ||
228 | unsigned int tmp; | ||
229 | |||
230 | if (R10000_LLSC_WAR) { | ||
231 | __asm__ __volatile__( | ||
232 | " .set noreorder # __raw_write_lock \n" | ||
233 | "1: ll %1, %2 \n" | ||
234 | " bnez %1, 1b \n" | ||
235 | " lui %1, 0x8000 \n" | ||
236 | " sc %1, %0 \n" | ||
237 | " beqzl %1, 1b \n" | ||
238 | " nop \n" | ||
239 | " .set reorder \n" | ||
240 | : "=m" (rw->lock), "=&r" (tmp) | ||
241 | : "m" (rw->lock) | ||
242 | : "memory"); | ||
243 | } else { | ||
244 | __asm__ __volatile__( | ||
245 | " .set noreorder # __raw_write_lock \n" | ||
246 | "1: ll %1, %2 \n" | ||
247 | " bnez %1, 2f \n" | ||
248 | " lui %1, 0x8000 \n" | ||
249 | " sc %1, %0 \n" | ||
250 | " beqz %1, 2f \n" | ||
251 | " nop \n" | ||
252 | " .subsection 2 \n" | ||
253 | "2: ll %1, %2 \n" | ||
254 | " bnez %1, 2b \n" | ||
255 | " lui %1, 0x8000 \n" | ||
256 | " b 1b \n" | ||
257 | " nop \n" | ||
258 | " .previous \n" | ||
259 | " .set reorder \n" | ||
260 | : "=m" (rw->lock), "=&r" (tmp) | ||
261 | : "m" (rw->lock) | ||
262 | : "memory"); | ||
263 | } | ||
264 | |||
265 | smp_llsc_mb(); | ||
266 | } | ||
267 | |||
268 | static inline void __raw_write_unlock(raw_rwlock_t *rw) | ||
269 | { | ||
270 | smp_mb(); | ||
271 | |||
272 | __asm__ __volatile__( | ||
273 | " # __raw_write_unlock \n" | ||
274 | " sw $0, %0 \n" | ||
275 | : "=m" (rw->lock) | ||
276 | : "m" (rw->lock) | ||
277 | : "memory"); | ||
278 | } | ||
279 | |||
280 | static inline int __raw_read_trylock(raw_rwlock_t *rw) | ||
281 | { | ||
282 | unsigned int tmp; | ||
283 | int ret; | ||
284 | |||
285 | if (R10000_LLSC_WAR) { | ||
286 | __asm__ __volatile__( | ||
287 | " .set noreorder # __raw_read_trylock \n" | ||
288 | " li %2, 0 \n" | ||
289 | "1: ll %1, %3 \n" | ||
290 | " bltz %1, 2f \n" | ||
291 | " addu %1, 1 \n" | ||
292 | " sc %1, %0 \n" | ||
293 | " .set reorder \n" | ||
294 | " beqzl %1, 1b \n" | ||
295 | " nop \n" | ||
296 | __WEAK_LLSC_MB | ||
297 | " li %2, 1 \n" | ||
298 | "2: \n" | ||
299 | : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret) | ||
300 | : "m" (rw->lock) | ||
301 | : "memory"); | ||
302 | } else { | ||
303 | __asm__ __volatile__( | ||
304 | " .set noreorder # __raw_read_trylock \n" | ||
305 | " li %2, 0 \n" | ||
306 | "1: ll %1, %3 \n" | ||
307 | " bltz %1, 2f \n" | ||
308 | " addu %1, 1 \n" | ||
309 | " sc %1, %0 \n" | ||
310 | " beqz %1, 1b \n" | ||
311 | " nop \n" | ||
312 | " .set reorder \n" | ||
313 | __WEAK_LLSC_MB | ||
314 | " li %2, 1 \n" | ||
315 | "2: \n" | ||
316 | : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret) | ||
317 | : "m" (rw->lock) | ||
318 | : "memory"); | ||
319 | } | ||
320 | |||
321 | return ret; | ||
322 | } | ||
323 | |||
324 | static inline int __raw_write_trylock(raw_rwlock_t *rw) | ||
325 | { | ||
326 | unsigned int tmp; | ||
327 | int ret; | ||
328 | |||
329 | if (R10000_LLSC_WAR) { | ||
330 | __asm__ __volatile__( | ||
331 | " .set noreorder # __raw_write_trylock \n" | ||
332 | " li %2, 0 \n" | ||
333 | "1: ll %1, %3 \n" | ||
334 | " bnez %1, 2f \n" | ||
335 | " lui %1, 0x8000 \n" | ||
336 | " sc %1, %0 \n" | ||
337 | " beqzl %1, 1b \n" | ||
338 | " nop \n" | ||
339 | __WEAK_LLSC_MB | ||
340 | " li %2, 1 \n" | ||
341 | " .set reorder \n" | ||
342 | "2: \n" | ||
343 | : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret) | ||
344 | : "m" (rw->lock) | ||
345 | : "memory"); | ||
346 | } else { | ||
347 | __asm__ __volatile__( | ||
348 | " .set noreorder # __raw_write_trylock \n" | ||
349 | " li %2, 0 \n" | ||
350 | "1: ll %1, %3 \n" | ||
351 | " bnez %1, 2f \n" | ||
352 | " lui %1, 0x8000 \n" | ||
353 | " sc %1, %0 \n" | ||
354 | " beqz %1, 3f \n" | ||
355 | " li %2, 1 \n" | ||
356 | "2: \n" | ||
357 | __WEAK_LLSC_MB | ||
358 | " .subsection 2 \n" | ||
359 | "3: b 1b \n" | ||
360 | " li %2, 0 \n" | ||
361 | " .previous \n" | ||
362 | " .set reorder \n" | ||
363 | : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret) | ||
364 | : "m" (rw->lock) | ||
365 | : "memory"); | ||
366 | } | ||
367 | |||
368 | return ret; | ||
369 | } | ||
370 | |||
371 | |||
372 | #define _raw_spin_relax(lock) cpu_relax() | ||
373 | #define _raw_read_relax(lock) cpu_relax() | ||
374 | #define _raw_write_relax(lock) cpu_relax() | ||
375 | |||
376 | #endif /* _ASM_SPINLOCK_H */ | ||
diff --git a/include/asm-mips/spinlock_types.h b/include/asm-mips/spinlock_types.h deleted file mode 100644 index ce26c5048b15..000000000000 --- a/include/asm-mips/spinlock_types.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef _ASM_SPINLOCK_TYPES_H | ||
2 | #define _ASM_SPINLOCK_TYPES_H | ||
3 | |||
4 | #ifndef __LINUX_SPINLOCK_TYPES_H | ||
5 | # error "please don't include this file directly" | ||
6 | #endif | ||
7 | |||
8 | typedef struct { | ||
9 | volatile unsigned int lock; | ||
10 | } raw_spinlock_t; | ||
11 | |||
12 | #define __RAW_SPIN_LOCK_UNLOCKED { 0 } | ||
13 | |||
14 | typedef struct { | ||
15 | volatile unsigned int lock; | ||
16 | } raw_rwlock_t; | ||
17 | |||
18 | #define __RAW_RW_LOCK_UNLOCKED { 0 } | ||
19 | |||
20 | #endif | ||
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h deleted file mode 100644 index 4c37c4e5f72e..000000000000 --- a/include/asm-mips/stackframe.h +++ /dev/null | |||
@@ -1,574 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 95, 96, 99, 2001 Ralf Baechle | ||
7 | * Copyright (C) 1994, 1995, 1996 Paul M. Antoine. | ||
8 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
9 | * Copyright (C) 2007 Maciej W. Rozycki | ||
10 | */ | ||
11 | #ifndef _ASM_STACKFRAME_H | ||
12 | #define _ASM_STACKFRAME_H | ||
13 | |||
14 | #include <linux/threads.h> | ||
15 | |||
16 | #include <asm/asm.h> | ||
17 | #include <asm/asmmacro.h> | ||
18 | #include <asm/mipsregs.h> | ||
19 | #include <asm/asm-offsets.h> | ||
20 | |||
21 | /* | ||
22 | * For SMTC kernel, global IE should be left set, and interrupts | ||
23 | * controlled exclusively via IXMT. | ||
24 | */ | ||
25 | #ifdef CONFIG_MIPS_MT_SMTC | ||
26 | #define STATMASK 0x1e | ||
27 | #elif defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
28 | #define STATMASK 0x3f | ||
29 | #else | ||
30 | #define STATMASK 0x1f | ||
31 | #endif | ||
32 | |||
33 | #ifdef CONFIG_MIPS_MT_SMTC | ||
34 | #include <asm/mipsmtregs.h> | ||
35 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
36 | |||
37 | .macro SAVE_AT | ||
38 | .set push | ||
39 | .set noat | ||
40 | LONG_S $1, PT_R1(sp) | ||
41 | .set pop | ||
42 | .endm | ||
43 | |||
44 | .macro SAVE_TEMP | ||
45 | #ifdef CONFIG_CPU_HAS_SMARTMIPS | ||
46 | mflhxu v1 | ||
47 | LONG_S v1, PT_LO(sp) | ||
48 | mflhxu v1 | ||
49 | LONG_S v1, PT_HI(sp) | ||
50 | mflhxu v1 | ||
51 | LONG_S v1, PT_ACX(sp) | ||
52 | #else | ||
53 | mfhi v1 | ||
54 | LONG_S v1, PT_HI(sp) | ||
55 | mflo v1 | ||
56 | LONG_S v1, PT_LO(sp) | ||
57 | #endif | ||
58 | #ifdef CONFIG_32BIT | ||
59 | LONG_S $8, PT_R8(sp) | ||
60 | LONG_S $9, PT_R9(sp) | ||
61 | #endif | ||
62 | LONG_S $10, PT_R10(sp) | ||
63 | LONG_S $11, PT_R11(sp) | ||
64 | LONG_S $12, PT_R12(sp) | ||
65 | LONG_S $13, PT_R13(sp) | ||
66 | LONG_S $14, PT_R14(sp) | ||
67 | LONG_S $15, PT_R15(sp) | ||
68 | LONG_S $24, PT_R24(sp) | ||
69 | .endm | ||
70 | |||
71 | .macro SAVE_STATIC | ||
72 | LONG_S $16, PT_R16(sp) | ||
73 | LONG_S $17, PT_R17(sp) | ||
74 | LONG_S $18, PT_R18(sp) | ||
75 | LONG_S $19, PT_R19(sp) | ||
76 | LONG_S $20, PT_R20(sp) | ||
77 | LONG_S $21, PT_R21(sp) | ||
78 | LONG_S $22, PT_R22(sp) | ||
79 | LONG_S $23, PT_R23(sp) | ||
80 | LONG_S $30, PT_R30(sp) | ||
81 | .endm | ||
82 | |||
83 | #ifdef CONFIG_SMP | ||
84 | #ifdef CONFIG_MIPS_MT_SMTC | ||
85 | #define PTEBASE_SHIFT 19 /* TCBIND */ | ||
86 | #else | ||
87 | #define PTEBASE_SHIFT 23 /* CONTEXT */ | ||
88 | #endif | ||
89 | .macro get_saved_sp /* SMP variation */ | ||
90 | #ifdef CONFIG_MIPS_MT_SMTC | ||
91 | mfc0 k0, CP0_TCBIND | ||
92 | #else | ||
93 | MFC0 k0, CP0_CONTEXT | ||
94 | #endif | ||
95 | #if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) | ||
96 | lui k1, %hi(kernelsp) | ||
97 | #else | ||
98 | lui k1, %highest(kernelsp) | ||
99 | daddiu k1, %higher(kernelsp) | ||
100 | dsll k1, 16 | ||
101 | daddiu k1, %hi(kernelsp) | ||
102 | dsll k1, 16 | ||
103 | #endif | ||
104 | LONG_SRL k0, PTEBASE_SHIFT | ||
105 | LONG_ADDU k1, k0 | ||
106 | LONG_L k1, %lo(kernelsp)(k1) | ||
107 | .endm | ||
108 | |||
109 | .macro set_saved_sp stackp temp temp2 | ||
110 | #ifdef CONFIG_MIPS_MT_SMTC | ||
111 | mfc0 \temp, CP0_TCBIND | ||
112 | #else | ||
113 | MFC0 \temp, CP0_CONTEXT | ||
114 | #endif | ||
115 | LONG_SRL \temp, PTEBASE_SHIFT | ||
116 | LONG_S \stackp, kernelsp(\temp) | ||
117 | .endm | ||
118 | #else | ||
119 | .macro get_saved_sp /* Uniprocessor variation */ | ||
120 | #if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) | ||
121 | lui k1, %hi(kernelsp) | ||
122 | #else | ||
123 | lui k1, %highest(kernelsp) | ||
124 | daddiu k1, %higher(kernelsp) | ||
125 | dsll k1, k1, 16 | ||
126 | daddiu k1, %hi(kernelsp) | ||
127 | dsll k1, k1, 16 | ||
128 | #endif | ||
129 | LONG_L k1, %lo(kernelsp)(k1) | ||
130 | .endm | ||
131 | |||
132 | .macro set_saved_sp stackp temp temp2 | ||
133 | LONG_S \stackp, kernelsp | ||
134 | .endm | ||
135 | #endif | ||
136 | |||
137 | .macro SAVE_SOME | ||
138 | .set push | ||
139 | .set noat | ||
140 | .set reorder | ||
141 | mfc0 k0, CP0_STATUS | ||
142 | sll k0, 3 /* extract cu0 bit */ | ||
143 | .set noreorder | ||
144 | bltz k0, 8f | ||
145 | move k1, sp | ||
146 | .set reorder | ||
147 | /* Called from user mode, new stack. */ | ||
148 | get_saved_sp | ||
149 | #ifndef CONFIG_CPU_DADDI_WORKAROUNDS | ||
150 | 8: move k0, sp | ||
151 | PTR_SUBU sp, k1, PT_SIZE | ||
152 | #else | ||
153 | .set at=k0 | ||
154 | 8: PTR_SUBU k1, PT_SIZE | ||
155 | .set noat | ||
156 | move k0, sp | ||
157 | move sp, k1 | ||
158 | #endif | ||
159 | LONG_S k0, PT_R29(sp) | ||
160 | LONG_S $3, PT_R3(sp) | ||
161 | /* | ||
162 | * You might think that you don't need to save $0, | ||
163 | * but the FPU emulator and gdb remote debug stub | ||
164 | * need it to operate correctly | ||
165 | */ | ||
166 | LONG_S $0, PT_R0(sp) | ||
167 | mfc0 v1, CP0_STATUS | ||
168 | LONG_S $2, PT_R2(sp) | ||
169 | LONG_S v1, PT_STATUS(sp) | ||
170 | #ifdef CONFIG_MIPS_MT_SMTC | ||
171 | /* | ||
172 | * Ideally, these instructions would be shuffled in | ||
173 | * to cover the pipeline delay. | ||
174 | */ | ||
175 | .set mips32 | ||
176 | mfc0 v1, CP0_TCSTATUS | ||
177 | .set mips0 | ||
178 | LONG_S v1, PT_TCSTATUS(sp) | ||
179 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
180 | LONG_S $4, PT_R4(sp) | ||
181 | mfc0 v1, CP0_CAUSE | ||
182 | LONG_S $5, PT_R5(sp) | ||
183 | LONG_S v1, PT_CAUSE(sp) | ||
184 | LONG_S $6, PT_R6(sp) | ||
185 | MFC0 v1, CP0_EPC | ||
186 | LONG_S $7, PT_R7(sp) | ||
187 | #ifdef CONFIG_64BIT | ||
188 | LONG_S $8, PT_R8(sp) | ||
189 | LONG_S $9, PT_R9(sp) | ||
190 | #endif | ||
191 | LONG_S v1, PT_EPC(sp) | ||
192 | LONG_S $25, PT_R25(sp) | ||
193 | LONG_S $28, PT_R28(sp) | ||
194 | LONG_S $31, PT_R31(sp) | ||
195 | ori $28, sp, _THREAD_MASK | ||
196 | xori $28, _THREAD_MASK | ||
197 | .set pop | ||
198 | .endm | ||
199 | |||
200 | .macro SAVE_ALL | ||
201 | SAVE_SOME | ||
202 | SAVE_AT | ||
203 | SAVE_TEMP | ||
204 | SAVE_STATIC | ||
205 | .endm | ||
206 | |||
207 | .macro RESTORE_AT | ||
208 | .set push | ||
209 | .set noat | ||
210 | LONG_L $1, PT_R1(sp) | ||
211 | .set pop | ||
212 | .endm | ||
213 | |||
214 | .macro RESTORE_TEMP | ||
215 | #ifdef CONFIG_CPU_HAS_SMARTMIPS | ||
216 | LONG_L $24, PT_ACX(sp) | ||
217 | mtlhx $24 | ||
218 | LONG_L $24, PT_HI(sp) | ||
219 | mtlhx $24 | ||
220 | LONG_L $24, PT_LO(sp) | ||
221 | mtlhx $24 | ||
222 | #else | ||
223 | LONG_L $24, PT_LO(sp) | ||
224 | mtlo $24 | ||
225 | LONG_L $24, PT_HI(sp) | ||
226 | mthi $24 | ||
227 | #endif | ||
228 | #ifdef CONFIG_32BIT | ||
229 | LONG_L $8, PT_R8(sp) | ||
230 | LONG_L $9, PT_R9(sp) | ||
231 | #endif | ||
232 | LONG_L $10, PT_R10(sp) | ||
233 | LONG_L $11, PT_R11(sp) | ||
234 | LONG_L $12, PT_R12(sp) | ||
235 | LONG_L $13, PT_R13(sp) | ||
236 | LONG_L $14, PT_R14(sp) | ||
237 | LONG_L $15, PT_R15(sp) | ||
238 | LONG_L $24, PT_R24(sp) | ||
239 | .endm | ||
240 | |||
241 | .macro RESTORE_STATIC | ||
242 | LONG_L $16, PT_R16(sp) | ||
243 | LONG_L $17, PT_R17(sp) | ||
244 | LONG_L $18, PT_R18(sp) | ||
245 | LONG_L $19, PT_R19(sp) | ||
246 | LONG_L $20, PT_R20(sp) | ||
247 | LONG_L $21, PT_R21(sp) | ||
248 | LONG_L $22, PT_R22(sp) | ||
249 | LONG_L $23, PT_R23(sp) | ||
250 | LONG_L $30, PT_R30(sp) | ||
251 | .endm | ||
252 | |||
253 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
254 | |||
255 | .macro RESTORE_SOME | ||
256 | .set push | ||
257 | .set reorder | ||
258 | .set noat | ||
259 | mfc0 a0, CP0_STATUS | ||
260 | li v1, 0xff00 | ||
261 | ori a0, STATMASK | ||
262 | xori a0, STATMASK | ||
263 | mtc0 a0, CP0_STATUS | ||
264 | and a0, v1 | ||
265 | LONG_L v0, PT_STATUS(sp) | ||
266 | nor v1, $0, v1 | ||
267 | and v0, v1 | ||
268 | or v0, a0 | ||
269 | mtc0 v0, CP0_STATUS | ||
270 | LONG_L $31, PT_R31(sp) | ||
271 | LONG_L $28, PT_R28(sp) | ||
272 | LONG_L $25, PT_R25(sp) | ||
273 | LONG_L $7, PT_R7(sp) | ||
274 | LONG_L $6, PT_R6(sp) | ||
275 | LONG_L $5, PT_R5(sp) | ||
276 | LONG_L $4, PT_R4(sp) | ||
277 | LONG_L $3, PT_R3(sp) | ||
278 | LONG_L $2, PT_R2(sp) | ||
279 | .set pop | ||
280 | .endm | ||
281 | |||
282 | .macro RESTORE_SP_AND_RET | ||
283 | .set push | ||
284 | .set noreorder | ||
285 | LONG_L k0, PT_EPC(sp) | ||
286 | LONG_L sp, PT_R29(sp) | ||
287 | jr k0 | ||
288 | rfe | ||
289 | .set pop | ||
290 | .endm | ||
291 | |||
292 | #else | ||
293 | .macro RESTORE_SOME | ||
294 | .set push | ||
295 | .set reorder | ||
296 | .set noat | ||
297 | #ifdef CONFIG_MIPS_MT_SMTC | ||
298 | .set mips32r2 | ||
299 | /* | ||
300 | * We need to make sure the read-modify-write | ||
301 | * of Status below isn't perturbed by an interrupt | ||
302 | * or cross-TC access, so we need to do at least a DMT, | ||
303 | * protected by an interrupt-inhibit. But setting IXMT | ||
304 | * also creates a few-cycle window where an IPI could | ||
305 | * be queued and not be detected before potentially | ||
306 | * returning to a WAIT or user-mode loop. It must be | ||
307 | * replayed. | ||
308 | * | ||
309 | * We're in the middle of a context switch, and | ||
310 | * we can't dispatch it directly without trashing | ||
311 | * some registers, so we'll try to detect this unlikely | ||
312 | * case and program a software interrupt in the VPE, | ||
313 | * as would be done for a cross-VPE IPI. To accomodate | ||
314 | * the handling of that case, we're doing a DVPE instead | ||
315 | * of just a DMT here to protect against other threads. | ||
316 | * This is a lot of cruft to cover a tiny window. | ||
317 | * If you can find a better design, implement it! | ||
318 | * | ||
319 | */ | ||
320 | mfc0 v0, CP0_TCSTATUS | ||
321 | ori v0, TCSTATUS_IXMT | ||
322 | mtc0 v0, CP0_TCSTATUS | ||
323 | _ehb | ||
324 | DVPE 5 # dvpe a1 | ||
325 | jal mips_ihb | ||
326 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
327 | mfc0 a0, CP0_STATUS | ||
328 | ori a0, STATMASK | ||
329 | xori a0, STATMASK | ||
330 | mtc0 a0, CP0_STATUS | ||
331 | li v1, 0xff00 | ||
332 | and a0, v1 | ||
333 | LONG_L v0, PT_STATUS(sp) | ||
334 | nor v1, $0, v1 | ||
335 | and v0, v1 | ||
336 | or v0, a0 | ||
337 | mtc0 v0, CP0_STATUS | ||
338 | #ifdef CONFIG_MIPS_MT_SMTC | ||
339 | /* | ||
340 | * Only after EXL/ERL have been restored to status can we | ||
341 | * restore TCStatus.IXMT. | ||
342 | */ | ||
343 | LONG_L v1, PT_TCSTATUS(sp) | ||
344 | _ehb | ||
345 | mfc0 a0, CP0_TCSTATUS | ||
346 | andi v1, TCSTATUS_IXMT | ||
347 | bnez v1, 0f | ||
348 | |||
349 | /* | ||
350 | * We'd like to detect any IPIs queued in the tiny window | ||
351 | * above and request an software interrupt to service them | ||
352 | * when we ERET. | ||
353 | * | ||
354 | * Computing the offset into the IPIQ array of the executing | ||
355 | * TC's IPI queue in-line would be tedious. We use part of | ||
356 | * the TCContext register to hold 16 bits of offset that we | ||
357 | * can add in-line to find the queue head. | ||
358 | */ | ||
359 | mfc0 v0, CP0_TCCONTEXT | ||
360 | la a2, IPIQ | ||
361 | srl v0, v0, 16 | ||
362 | addu a2, a2, v0 | ||
363 | LONG_L v0, 0(a2) | ||
364 | beqz v0, 0f | ||
365 | /* | ||
366 | * If we have a queue, provoke dispatch within the VPE by setting C_SW1 | ||
367 | */ | ||
368 | mfc0 v0, CP0_CAUSE | ||
369 | ori v0, v0, C_SW1 | ||
370 | mtc0 v0, CP0_CAUSE | ||
371 | 0: | ||
372 | /* | ||
373 | * This test should really never branch but | ||
374 | * let's be prudent here. Having atomized | ||
375 | * the shared register modifications, we can | ||
376 | * now EVPE, and must do so before interrupts | ||
377 | * are potentially re-enabled. | ||
378 | */ | ||
379 | andi a1, a1, MVPCONTROL_EVP | ||
380 | beqz a1, 1f | ||
381 | evpe | ||
382 | 1: | ||
383 | /* We know that TCStatua.IXMT should be set from above */ | ||
384 | xori a0, a0, TCSTATUS_IXMT | ||
385 | or a0, a0, v1 | ||
386 | mtc0 a0, CP0_TCSTATUS | ||
387 | _ehb | ||
388 | |||
389 | .set mips0 | ||
390 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
391 | LONG_L v1, PT_EPC(sp) | ||
392 | MTC0 v1, CP0_EPC | ||
393 | LONG_L $31, PT_R31(sp) | ||
394 | LONG_L $28, PT_R28(sp) | ||
395 | LONG_L $25, PT_R25(sp) | ||
396 | #ifdef CONFIG_64BIT | ||
397 | LONG_L $8, PT_R8(sp) | ||
398 | LONG_L $9, PT_R9(sp) | ||
399 | #endif | ||
400 | LONG_L $7, PT_R7(sp) | ||
401 | LONG_L $6, PT_R6(sp) | ||
402 | LONG_L $5, PT_R5(sp) | ||
403 | LONG_L $4, PT_R4(sp) | ||
404 | LONG_L $3, PT_R3(sp) | ||
405 | LONG_L $2, PT_R2(sp) | ||
406 | .set pop | ||
407 | .endm | ||
408 | |||
409 | .macro RESTORE_SP_AND_RET | ||
410 | LONG_L sp, PT_R29(sp) | ||
411 | .set mips3 | ||
412 | eret | ||
413 | .set mips0 | ||
414 | .endm | ||
415 | |||
416 | #endif | ||
417 | |||
418 | .macro RESTORE_SP | ||
419 | LONG_L sp, PT_R29(sp) | ||
420 | .endm | ||
421 | |||
422 | .macro RESTORE_ALL | ||
423 | RESTORE_TEMP | ||
424 | RESTORE_STATIC | ||
425 | RESTORE_AT | ||
426 | RESTORE_SOME | ||
427 | RESTORE_SP | ||
428 | .endm | ||
429 | |||
430 | .macro RESTORE_ALL_AND_RET | ||
431 | RESTORE_TEMP | ||
432 | RESTORE_STATIC | ||
433 | RESTORE_AT | ||
434 | RESTORE_SOME | ||
435 | RESTORE_SP_AND_RET | ||
436 | .endm | ||
437 | |||
438 | /* | ||
439 | * Move to kernel mode and disable interrupts. | ||
440 | * Set cp0 enable bit as sign that we're running on the kernel stack | ||
441 | */ | ||
442 | .macro CLI | ||
443 | #if !defined(CONFIG_MIPS_MT_SMTC) | ||
444 | mfc0 t0, CP0_STATUS | ||
445 | li t1, ST0_CU0 | STATMASK | ||
446 | or t0, t1 | ||
447 | xori t0, STATMASK | ||
448 | mtc0 t0, CP0_STATUS | ||
449 | #else /* CONFIG_MIPS_MT_SMTC */ | ||
450 | /* | ||
451 | * For SMTC, we need to set privilege | ||
452 | * and disable interrupts only for the | ||
453 | * current TC, using the TCStatus register. | ||
454 | */ | ||
455 | mfc0 t0, CP0_TCSTATUS | ||
456 | /* Fortunately CU 0 is in the same place in both registers */ | ||
457 | /* Set TCU0, TMX, TKSU (for later inversion) and IXMT */ | ||
458 | li t1, ST0_CU0 | 0x08001c00 | ||
459 | or t0, t1 | ||
460 | /* Clear TKSU, leave IXMT */ | ||
461 | xori t0, 0x00001800 | ||
462 | mtc0 t0, CP0_TCSTATUS | ||
463 | _ehb | ||
464 | /* We need to leave the global IE bit set, but clear EXL...*/ | ||
465 | mfc0 t0, CP0_STATUS | ||
466 | ori t0, ST0_EXL | ST0_ERL | ||
467 | xori t0, ST0_EXL | ST0_ERL | ||
468 | mtc0 t0, CP0_STATUS | ||
469 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
470 | irq_disable_hazard | ||
471 | .endm | ||
472 | |||
473 | /* | ||
474 | * Move to kernel mode and enable interrupts. | ||
475 | * Set cp0 enable bit as sign that we're running on the kernel stack | ||
476 | */ | ||
477 | .macro STI | ||
478 | #if !defined(CONFIG_MIPS_MT_SMTC) | ||
479 | mfc0 t0, CP0_STATUS | ||
480 | li t1, ST0_CU0 | STATMASK | ||
481 | or t0, t1 | ||
482 | xori t0, STATMASK & ~1 | ||
483 | mtc0 t0, CP0_STATUS | ||
484 | #else /* CONFIG_MIPS_MT_SMTC */ | ||
485 | /* | ||
486 | * For SMTC, we need to set privilege | ||
487 | * and enable interrupts only for the | ||
488 | * current TC, using the TCStatus register. | ||
489 | */ | ||
490 | _ehb | ||
491 | mfc0 t0, CP0_TCSTATUS | ||
492 | /* Fortunately CU 0 is in the same place in both registers */ | ||
493 | /* Set TCU0, TKSU (for later inversion) and IXMT */ | ||
494 | li t1, ST0_CU0 | 0x08001c00 | ||
495 | or t0, t1 | ||
496 | /* Clear TKSU *and* IXMT */ | ||
497 | xori t0, 0x00001c00 | ||
498 | mtc0 t0, CP0_TCSTATUS | ||
499 | _ehb | ||
500 | /* We need to leave the global IE bit set, but clear EXL...*/ | ||
501 | mfc0 t0, CP0_STATUS | ||
502 | ori t0, ST0_EXL | ||
503 | xori t0, ST0_EXL | ||
504 | mtc0 t0, CP0_STATUS | ||
505 | /* irq_enable_hazard below should expand to EHB for 24K/34K cpus */ | ||
506 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
507 | irq_enable_hazard | ||
508 | .endm | ||
509 | |||
510 | /* | ||
511 | * Just move to kernel mode and leave interrupts as they are. Note | ||
512 | * for the R3000 this means copying the previous enable from IEp. | ||
513 | * Set cp0 enable bit as sign that we're running on the kernel stack | ||
514 | */ | ||
515 | .macro KMODE | ||
516 | #ifdef CONFIG_MIPS_MT_SMTC | ||
517 | /* | ||
518 | * This gets baroque in SMTC. We want to | ||
519 | * protect the non-atomic clearing of EXL | ||
520 | * with DMT/EMT, but we don't want to take | ||
521 | * an interrupt while DMT is still in effect. | ||
522 | */ | ||
523 | |||
524 | /* KMODE gets invoked from both reorder and noreorder code */ | ||
525 | .set push | ||
526 | .set mips32r2 | ||
527 | .set noreorder | ||
528 | mfc0 v0, CP0_TCSTATUS | ||
529 | andi v1, v0, TCSTATUS_IXMT | ||
530 | ori v0, TCSTATUS_IXMT | ||
531 | mtc0 v0, CP0_TCSTATUS | ||
532 | _ehb | ||
533 | DMT 2 # dmt v0 | ||
534 | /* | ||
535 | * We don't know a priori if ra is "live" | ||
536 | */ | ||
537 | move t0, ra | ||
538 | jal mips_ihb | ||
539 | nop /* delay slot */ | ||
540 | move ra, t0 | ||
541 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
542 | mfc0 t0, CP0_STATUS | ||
543 | li t1, ST0_CU0 | (STATMASK & ~1) | ||
544 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
545 | andi t2, t0, ST0_IEP | ||
546 | srl t2, 2 | ||
547 | or t0, t2 | ||
548 | #endif | ||
549 | or t0, t1 | ||
550 | xori t0, STATMASK & ~1 | ||
551 | mtc0 t0, CP0_STATUS | ||
552 | #ifdef CONFIG_MIPS_MT_SMTC | ||
553 | _ehb | ||
554 | andi v0, v0, VPECONTROL_TE | ||
555 | beqz v0, 2f | ||
556 | nop /* delay slot */ | ||
557 | emt | ||
558 | 2: | ||
559 | mfc0 v0, CP0_TCSTATUS | ||
560 | /* Clear IXMT, then OR in previous value */ | ||
561 | ori v0, TCSTATUS_IXMT | ||
562 | xori v0, TCSTATUS_IXMT | ||
563 | or v0, v1, v0 | ||
564 | mtc0 v0, CP0_TCSTATUS | ||
565 | /* | ||
566 | * irq_disable_hazard below should expand to EHB | ||
567 | * on 24K/34K CPUS | ||
568 | */ | ||
569 | .set pop | ||
570 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
571 | irq_disable_hazard | ||
572 | .endm | ||
573 | |||
574 | #endif /* _ASM_STACKFRAME_H */ | ||
diff --git a/include/asm-mips/stacktrace.h b/include/asm-mips/stacktrace.h deleted file mode 100644 index 0bf82818aa53..000000000000 --- a/include/asm-mips/stacktrace.h +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | #ifndef _ASM_STACKTRACE_H | ||
2 | #define _ASM_STACKTRACE_H | ||
3 | |||
4 | #include <asm/ptrace.h> | ||
5 | |||
6 | #ifdef CONFIG_KALLSYMS | ||
7 | extern int raw_show_trace; | ||
8 | extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, | ||
9 | unsigned long pc, unsigned long *ra); | ||
10 | #else | ||
11 | #define raw_show_trace 1 | ||
12 | static inline unsigned long unwind_stack(struct task_struct *task, | ||
13 | unsigned long *sp, unsigned long pc, unsigned long *ra) | ||
14 | { | ||
15 | return 0; | ||
16 | } | ||
17 | #endif | ||
18 | |||
19 | static __always_inline void prepare_frametrace(struct pt_regs *regs) | ||
20 | { | ||
21 | #ifndef CONFIG_KALLSYMS | ||
22 | /* | ||
23 | * Remove any garbage that may be in regs (specially func | ||
24 | * addresses) to avoid show_raw_backtrace() to report them | ||
25 | */ | ||
26 | memset(regs, 0, sizeof(*regs)); | ||
27 | #endif | ||
28 | __asm__ __volatile__( | ||
29 | ".set push\n\t" | ||
30 | ".set noat\n\t" | ||
31 | #ifdef CONFIG_64BIT | ||
32 | "1: dla $1, 1b\n\t" | ||
33 | "sd $1, %0\n\t" | ||
34 | "sd $29, %1\n\t" | ||
35 | "sd $31, %2\n\t" | ||
36 | #else | ||
37 | "1: la $1, 1b\n\t" | ||
38 | "sw $1, %0\n\t" | ||
39 | "sw $29, %1\n\t" | ||
40 | "sw $31, %2\n\t" | ||
41 | #endif | ||
42 | ".set pop\n\t" | ||
43 | : "=m" (regs->cp0_epc), | ||
44 | "=m" (regs->regs[29]), "=m" (regs->regs[31]) | ||
45 | : : "memory"); | ||
46 | } | ||
47 | |||
48 | #endif /* _ASM_STACKTRACE_H */ | ||
diff --git a/include/asm-mips/stat.h b/include/asm-mips/stat.h deleted file mode 100644 index 6e00f751ab6d..000000000000 --- a/include/asm-mips/stat.h +++ /dev/null | |||
@@ -1,132 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 1999, 2000 Ralf Baechle | ||
7 | * Copyright (C) 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_STAT_H | ||
10 | #define _ASM_STAT_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | #include <asm/sgidefs.h> | ||
15 | |||
16 | #if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32) | ||
17 | |||
18 | struct stat { | ||
19 | unsigned st_dev; | ||
20 | long st_pad1[3]; /* Reserved for network id */ | ||
21 | ino_t st_ino; | ||
22 | mode_t st_mode; | ||
23 | nlink_t st_nlink; | ||
24 | uid_t st_uid; | ||
25 | gid_t st_gid; | ||
26 | unsigned st_rdev; | ||
27 | long st_pad2[2]; | ||
28 | off_t st_size; | ||
29 | long st_pad3; | ||
30 | /* | ||
31 | * Actually this should be timestruc_t st_atime, st_mtime and st_ctime | ||
32 | * but we don't have it under Linux. | ||
33 | */ | ||
34 | time_t st_atime; | ||
35 | long st_atime_nsec; | ||
36 | time_t st_mtime; | ||
37 | long st_mtime_nsec; | ||
38 | time_t st_ctime; | ||
39 | long st_ctime_nsec; | ||
40 | long st_blksize; | ||
41 | long st_blocks; | ||
42 | long st_pad4[14]; | ||
43 | }; | ||
44 | |||
45 | /* | ||
46 | * This matches struct stat64 in glibc2.1, hence the absolutely insane | ||
47 | * amounts of padding around dev_t's. The memory layout is the same as of | ||
48 | * struct stat of the 64-bit kernel. | ||
49 | */ | ||
50 | |||
51 | struct stat64 { | ||
52 | unsigned long st_dev; | ||
53 | unsigned long st_pad0[3]; /* Reserved for st_dev expansion */ | ||
54 | |||
55 | unsigned long long st_ino; | ||
56 | |||
57 | mode_t st_mode; | ||
58 | nlink_t st_nlink; | ||
59 | |||
60 | uid_t st_uid; | ||
61 | gid_t st_gid; | ||
62 | |||
63 | unsigned long st_rdev; | ||
64 | unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */ | ||
65 | |||
66 | long long st_size; | ||
67 | |||
68 | /* | ||
69 | * Actually this should be timestruc_t st_atime, st_mtime and st_ctime | ||
70 | * but we don't have it under Linux. | ||
71 | */ | ||
72 | time_t st_atime; | ||
73 | unsigned long st_atime_nsec; /* Reserved for st_atime expansion */ | ||
74 | |||
75 | time_t st_mtime; | ||
76 | unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */ | ||
77 | |||
78 | time_t st_ctime; | ||
79 | unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */ | ||
80 | |||
81 | unsigned long st_blksize; | ||
82 | unsigned long st_pad2; | ||
83 | |||
84 | long long st_blocks; | ||
85 | }; | ||
86 | |||
87 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | ||
88 | |||
89 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | ||
90 | |||
91 | /* The memory layout is the same as of struct stat64 of the 32-bit kernel. */ | ||
92 | struct stat { | ||
93 | unsigned int st_dev; | ||
94 | unsigned int st_pad0[3]; /* Reserved for st_dev expansion */ | ||
95 | |||
96 | unsigned long st_ino; | ||
97 | |||
98 | mode_t st_mode; | ||
99 | nlink_t st_nlink; | ||
100 | |||
101 | uid_t st_uid; | ||
102 | gid_t st_gid; | ||
103 | |||
104 | unsigned int st_rdev; | ||
105 | unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */ | ||
106 | |||
107 | off_t st_size; | ||
108 | |||
109 | /* | ||
110 | * Actually this should be timestruc_t st_atime, st_mtime and st_ctime | ||
111 | * but we don't have it under Linux. | ||
112 | */ | ||
113 | unsigned int st_atime; | ||
114 | unsigned int st_atime_nsec; | ||
115 | |||
116 | unsigned int st_mtime; | ||
117 | unsigned int st_mtime_nsec; | ||
118 | |||
119 | unsigned int st_ctime; | ||
120 | unsigned int st_ctime_nsec; | ||
121 | |||
122 | unsigned int st_blksize; | ||
123 | unsigned int st_pad2; | ||
124 | |||
125 | unsigned long st_blocks; | ||
126 | }; | ||
127 | |||
128 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | ||
129 | |||
130 | #define STAT_HAVE_NSEC 1 | ||
131 | |||
132 | #endif /* _ASM_STAT_H */ | ||
diff --git a/include/asm-mips/statfs.h b/include/asm-mips/statfs.h deleted file mode 100644 index c3ddf973c1c0..000000000000 --- a/include/asm-mips/statfs.h +++ /dev/null | |||
@@ -1,96 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 1999 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_STATFS_H | ||
9 | #define _ASM_STATFS_H | ||
10 | |||
11 | #include <linux/posix_types.h> | ||
12 | #include <asm/sgidefs.h> | ||
13 | |||
14 | #ifndef __KERNEL_STRICT_NAMES | ||
15 | |||
16 | #include <linux/types.h> | ||
17 | |||
18 | typedef __kernel_fsid_t fsid_t; | ||
19 | |||
20 | #endif | ||
21 | |||
22 | struct statfs { | ||
23 | long f_type; | ||
24 | #define f_fstyp f_type | ||
25 | long f_bsize; | ||
26 | long f_frsize; /* Fragment size - unsupported */ | ||
27 | long f_blocks; | ||
28 | long f_bfree; | ||
29 | long f_files; | ||
30 | long f_ffree; | ||
31 | long f_bavail; | ||
32 | |||
33 | /* Linux specials */ | ||
34 | __kernel_fsid_t f_fsid; | ||
35 | long f_namelen; | ||
36 | long f_spare[6]; | ||
37 | }; | ||
38 | |||
39 | #if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32) | ||
40 | |||
41 | /* | ||
42 | * Unlike the traditional version the LFAPI version has none of the ABI junk | ||
43 | */ | ||
44 | struct statfs64 { | ||
45 | __u32 f_type; | ||
46 | __u32 f_bsize; | ||
47 | __u32 f_frsize; /* Fragment size - unsupported */ | ||
48 | __u32 __pad; | ||
49 | __u64 f_blocks; | ||
50 | __u64 f_bfree; | ||
51 | __u64 f_files; | ||
52 | __u64 f_ffree; | ||
53 | __u64 f_bavail; | ||
54 | __kernel_fsid_t f_fsid; | ||
55 | __u32 f_namelen; | ||
56 | __u32 f_spare[6]; | ||
57 | }; | ||
58 | |||
59 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | ||
60 | |||
61 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | ||
62 | |||
63 | struct statfs64 { /* Same as struct statfs */ | ||
64 | long f_type; | ||
65 | long f_bsize; | ||
66 | long f_frsize; /* Fragment size - unsupported */ | ||
67 | long f_blocks; | ||
68 | long f_bfree; | ||
69 | long f_files; | ||
70 | long f_ffree; | ||
71 | long f_bavail; | ||
72 | |||
73 | /* Linux specials */ | ||
74 | __kernel_fsid_t f_fsid; | ||
75 | long f_namelen; | ||
76 | long f_spare[6]; | ||
77 | }; | ||
78 | |||
79 | struct compat_statfs64 { | ||
80 | __u32 f_type; | ||
81 | __u32 f_bsize; | ||
82 | __u32 f_frsize; /* Fragment size - unsupported */ | ||
83 | __u32 __pad; | ||
84 | __u64 f_blocks; | ||
85 | __u64 f_bfree; | ||
86 | __u64 f_files; | ||
87 | __u64 f_ffree; | ||
88 | __u64 f_bavail; | ||
89 | __kernel_fsid_t f_fsid; | ||
90 | __u32 f_namelen; | ||
91 | __u32 f_spare[6]; | ||
92 | }; | ||
93 | |||
94 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | ||
95 | |||
96 | #endif /* _ASM_STATFS_H */ | ||
diff --git a/include/asm-mips/string.h b/include/asm-mips/string.h deleted file mode 100644 index 436e3ad352d9..000000000000 --- a/include/asm-mips/string.h +++ /dev/null | |||
@@ -1,143 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 1994, 95, 96, 97, 98, 2000, 01 Ralf Baechle | ||
7 | * Copyright (c) 2000 by Silicon Graphics, Inc. | ||
8 | * Copyright (c) 2001 MIPS Technologies, Inc. | ||
9 | */ | ||
10 | #ifndef _ASM_STRING_H | ||
11 | #define _ASM_STRING_H | ||
12 | |||
13 | |||
14 | /* | ||
15 | * Most of the inline functions are rather naive implementations so I just | ||
16 | * didn't bother updating them for 64-bit ... | ||
17 | */ | ||
18 | #ifdef CONFIG_32BIT | ||
19 | |||
20 | #ifndef IN_STRING_C | ||
21 | |||
22 | #define __HAVE_ARCH_STRCPY | ||
23 | static __inline__ char *strcpy(char *__dest, __const__ char *__src) | ||
24 | { | ||
25 | char *__xdest = __dest; | ||
26 | |||
27 | __asm__ __volatile__( | ||
28 | ".set\tnoreorder\n\t" | ||
29 | ".set\tnoat\n" | ||
30 | "1:\tlbu\t$1,(%1)\n\t" | ||
31 | "addiu\t%1,1\n\t" | ||
32 | "sb\t$1,(%0)\n\t" | ||
33 | "bnez\t$1,1b\n\t" | ||
34 | "addiu\t%0,1\n\t" | ||
35 | ".set\tat\n\t" | ||
36 | ".set\treorder" | ||
37 | : "=r" (__dest), "=r" (__src) | ||
38 | : "0" (__dest), "1" (__src) | ||
39 | : "memory"); | ||
40 | |||
41 | return __xdest; | ||
42 | } | ||
43 | |||
44 | #define __HAVE_ARCH_STRNCPY | ||
45 | static __inline__ char *strncpy(char *__dest, __const__ char *__src, size_t __n) | ||
46 | { | ||
47 | char *__xdest = __dest; | ||
48 | |||
49 | if (__n == 0) | ||
50 | return __xdest; | ||
51 | |||
52 | __asm__ __volatile__( | ||
53 | ".set\tnoreorder\n\t" | ||
54 | ".set\tnoat\n" | ||
55 | "1:\tlbu\t$1,(%1)\n\t" | ||
56 | "subu\t%2,1\n\t" | ||
57 | "sb\t$1,(%0)\n\t" | ||
58 | "beqz\t$1,2f\n\t" | ||
59 | "addiu\t%0,1\n\t" | ||
60 | "bnez\t%2,1b\n\t" | ||
61 | "addiu\t%1,1\n" | ||
62 | "2:\n\t" | ||
63 | ".set\tat\n\t" | ||
64 | ".set\treorder" | ||
65 | : "=r" (__dest), "=r" (__src), "=r" (__n) | ||
66 | : "0" (__dest), "1" (__src), "2" (__n) | ||
67 | : "memory"); | ||
68 | |||
69 | return __xdest; | ||
70 | } | ||
71 | |||
72 | #define __HAVE_ARCH_STRCMP | ||
73 | static __inline__ int strcmp(__const__ char *__cs, __const__ char *__ct) | ||
74 | { | ||
75 | int __res; | ||
76 | |||
77 | __asm__ __volatile__( | ||
78 | ".set\tnoreorder\n\t" | ||
79 | ".set\tnoat\n\t" | ||
80 | "lbu\t%2,(%0)\n" | ||
81 | "1:\tlbu\t$1,(%1)\n\t" | ||
82 | "addiu\t%0,1\n\t" | ||
83 | "bne\t$1,%2,2f\n\t" | ||
84 | "addiu\t%1,1\n\t" | ||
85 | "bnez\t%2,1b\n\t" | ||
86 | "lbu\t%2,(%0)\n\t" | ||
87 | #if defined(CONFIG_CPU_R3000) | ||
88 | "nop\n\t" | ||
89 | #endif | ||
90 | "move\t%2,$1\n" | ||
91 | "2:\tsubu\t%2,$1\n" | ||
92 | "3:\t.set\tat\n\t" | ||
93 | ".set\treorder" | ||
94 | : "=r" (__cs), "=r" (__ct), "=r" (__res) | ||
95 | : "0" (__cs), "1" (__ct)); | ||
96 | |||
97 | return __res; | ||
98 | } | ||
99 | |||
100 | #endif /* !defined(IN_STRING_C) */ | ||
101 | |||
102 | #define __HAVE_ARCH_STRNCMP | ||
103 | static __inline__ int | ||
104 | strncmp(__const__ char *__cs, __const__ char *__ct, size_t __count) | ||
105 | { | ||
106 | int __res; | ||
107 | |||
108 | __asm__ __volatile__( | ||
109 | ".set\tnoreorder\n\t" | ||
110 | ".set\tnoat\n" | ||
111 | "1:\tlbu\t%3,(%0)\n\t" | ||
112 | "beqz\t%2,2f\n\t" | ||
113 | "lbu\t$1,(%1)\n\t" | ||
114 | "subu\t%2,1\n\t" | ||
115 | "bne\t$1,%3,3f\n\t" | ||
116 | "addiu\t%0,1\n\t" | ||
117 | "bnez\t%3,1b\n\t" | ||
118 | "addiu\t%1,1\n" | ||
119 | "2:\n\t" | ||
120 | #if defined(CONFIG_CPU_R3000) | ||
121 | "nop\n\t" | ||
122 | #endif | ||
123 | "move\t%3,$1\n" | ||
124 | "3:\tsubu\t%3,$1\n\t" | ||
125 | ".set\tat\n\t" | ||
126 | ".set\treorder" | ||
127 | : "=r" (__cs), "=r" (__ct), "=r" (__count), "=r" (__res) | ||
128 | : "0" (__cs), "1" (__ct), "2" (__count)); | ||
129 | |||
130 | return __res; | ||
131 | } | ||
132 | #endif /* CONFIG_32BIT */ | ||
133 | |||
134 | #define __HAVE_ARCH_MEMSET | ||
135 | extern void *memset(void *__s, int __c, size_t __count); | ||
136 | |||
137 | #define __HAVE_ARCH_MEMCPY | ||
138 | extern void *memcpy(void *__to, __const__ void *__from, size_t __n); | ||
139 | |||
140 | #define __HAVE_ARCH_MEMMOVE | ||
141 | extern void *memmove(void *__dest, __const__ void *__src, size_t __n); | ||
142 | |||
143 | #endif /* _ASM_STRING_H */ | ||
diff --git a/include/asm-mips/suspend.h b/include/asm-mips/suspend.h deleted file mode 100644 index 2562f8f9be0e..000000000000 --- a/include/asm-mips/suspend.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SUSPEND_H | ||
2 | #define __ASM_SUSPEND_H | ||
3 | |||
4 | /* Somewhen... Maybe :-) */ | ||
5 | |||
6 | #endif /* __ASM_SUSPEND_H */ | ||
diff --git a/include/asm-mips/sysmips.h b/include/asm-mips/sysmips.h deleted file mode 100644 index 4f47b7d6a5f7..000000000000 --- a/include/asm-mips/sysmips.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for the MIPS sysmips(2) call | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1995 by Ralf Baechle | ||
9 | */ | ||
10 | #ifndef _ASM_SYSMIPS_H | ||
11 | #define _ASM_SYSMIPS_H | ||
12 | |||
13 | /* | ||
14 | * Commands for the sysmips(2) call | ||
15 | * | ||
16 | * sysmips(2) is deprecated - though some existing software uses it. | ||
17 | * We only support the following commands. | ||
18 | */ | ||
19 | #define SETNAME 1 /* set hostname */ | ||
20 | #define FLUSH_CACHE 3 /* writeback and invalidate caches */ | ||
21 | #define MIPS_FIXADE 7 /* control address error fixing */ | ||
22 | #define MIPS_RDNVRAM 10 /* read NVRAM */ | ||
23 | #define MIPS_ATOMIC_SET 2001 /* atomically set variable */ | ||
24 | |||
25 | #endif /* _ASM_SYSMIPS_H */ | ||
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h deleted file mode 100644 index a944eda4faf5..000000000000 --- a/include/asm-mips/system.h +++ /dev/null | |||
@@ -1,220 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003, 06 by Ralf Baechle | ||
7 | * Copyright (C) 1996 by Paul M. Antoine | ||
8 | * Copyright (C) 1999 Silicon Graphics | ||
9 | * Kevin D. Kissell, kevink@mips.org and Carsten Langgaard, carstenl@mips.com | ||
10 | * Copyright (C) 2000 MIPS Technologies, Inc. | ||
11 | */ | ||
12 | #ifndef _ASM_SYSTEM_H | ||
13 | #define _ASM_SYSTEM_H | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | #include <linux/irqflags.h> | ||
17 | |||
18 | #include <asm/addrspace.h> | ||
19 | #include <asm/barrier.h> | ||
20 | #include <asm/cmpxchg.h> | ||
21 | #include <asm/cpu-features.h> | ||
22 | #include <asm/dsp.h> | ||
23 | #include <asm/war.h> | ||
24 | |||
25 | |||
26 | /* | ||
27 | * switch_to(n) should switch tasks to task nr n, first | ||
28 | * checking that n isn't the current task, in which case it does nothing. | ||
29 | */ | ||
30 | extern asmlinkage void *resume(void *last, void *next, void *next_ti); | ||
31 | |||
32 | struct task_struct; | ||
33 | |||
34 | #ifdef CONFIG_MIPS_MT_FPAFF | ||
35 | |||
36 | /* | ||
37 | * Handle the scheduler resume end of FPU affinity management. We do this | ||
38 | * inline to try to keep the overhead down. If we have been forced to run on | ||
39 | * a "CPU" with an FPU because of a previous high level of FP computation, | ||
40 | * but did not actually use the FPU during the most recent time-slice (CU1 | ||
41 | * isn't set), we undo the restriction on cpus_allowed. | ||
42 | * | ||
43 | * We're not calling set_cpus_allowed() here, because we have no need to | ||
44 | * force prompt migration - we're already switching the current CPU to a | ||
45 | * different thread. | ||
46 | */ | ||
47 | |||
48 | #define __mips_mt_fpaff_switch_to(prev) \ | ||
49 | do { \ | ||
50 | struct thread_info *__prev_ti = task_thread_info(prev); \ | ||
51 | \ | ||
52 | if (cpu_has_fpu && \ | ||
53 | test_ti_thread_flag(__prev_ti, TIF_FPUBOUND) && \ | ||
54 | (!(KSTK_STATUS(prev) & ST0_CU1))) { \ | ||
55 | clear_ti_thread_flag(__prev_ti, TIF_FPUBOUND); \ | ||
56 | prev->cpus_allowed = prev->thread.user_cpus_allowed; \ | ||
57 | } \ | ||
58 | next->thread.emulated_fp = 0; \ | ||
59 | } while(0) | ||
60 | |||
61 | #else | ||
62 | #define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0) | ||
63 | #endif | ||
64 | |||
65 | #define switch_to(prev, next, last) \ | ||
66 | do { \ | ||
67 | __mips_mt_fpaff_switch_to(prev); \ | ||
68 | if (cpu_has_dsp) \ | ||
69 | __save_dsp(prev); \ | ||
70 | (last) = resume(prev, next, task_thread_info(next)); \ | ||
71 | } while (0) | ||
72 | |||
73 | #define finish_arch_switch(prev) \ | ||
74 | do { \ | ||
75 | if (cpu_has_dsp) \ | ||
76 | __restore_dsp(current); \ | ||
77 | if (cpu_has_userlocal) \ | ||
78 | write_c0_userlocal(current_thread_info()->tp_value); \ | ||
79 | } while (0) | ||
80 | |||
81 | static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) | ||
82 | { | ||
83 | __u32 retval; | ||
84 | |||
85 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
86 | unsigned long dummy; | ||
87 | |||
88 | __asm__ __volatile__( | ||
89 | " .set mips3 \n" | ||
90 | "1: ll %0, %3 # xchg_u32 \n" | ||
91 | " .set mips0 \n" | ||
92 | " move %2, %z4 \n" | ||
93 | " .set mips3 \n" | ||
94 | " sc %2, %1 \n" | ||
95 | " beqzl %2, 1b \n" | ||
96 | " .set mips0 \n" | ||
97 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) | ||
98 | : "R" (*m), "Jr" (val) | ||
99 | : "memory"); | ||
100 | } else if (cpu_has_llsc) { | ||
101 | unsigned long dummy; | ||
102 | |||
103 | __asm__ __volatile__( | ||
104 | " .set mips3 \n" | ||
105 | "1: ll %0, %3 # xchg_u32 \n" | ||
106 | " .set mips0 \n" | ||
107 | " move %2, %z4 \n" | ||
108 | " .set mips3 \n" | ||
109 | " sc %2, %1 \n" | ||
110 | " beqz %2, 2f \n" | ||
111 | " .subsection 2 \n" | ||
112 | "2: b 1b \n" | ||
113 | " .previous \n" | ||
114 | " .set mips0 \n" | ||
115 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) | ||
116 | : "R" (*m), "Jr" (val) | ||
117 | : "memory"); | ||
118 | } else { | ||
119 | unsigned long flags; | ||
120 | |||
121 | raw_local_irq_save(flags); | ||
122 | retval = *m; | ||
123 | *m = val; | ||
124 | raw_local_irq_restore(flags); /* implies memory barrier */ | ||
125 | } | ||
126 | |||
127 | smp_llsc_mb(); | ||
128 | |||
129 | return retval; | ||
130 | } | ||
131 | |||
132 | #ifdef CONFIG_64BIT | ||
133 | static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val) | ||
134 | { | ||
135 | __u64 retval; | ||
136 | |||
137 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
138 | unsigned long dummy; | ||
139 | |||
140 | __asm__ __volatile__( | ||
141 | " .set mips3 \n" | ||
142 | "1: lld %0, %3 # xchg_u64 \n" | ||
143 | " move %2, %z4 \n" | ||
144 | " scd %2, %1 \n" | ||
145 | " beqzl %2, 1b \n" | ||
146 | " .set mips0 \n" | ||
147 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) | ||
148 | : "R" (*m), "Jr" (val) | ||
149 | : "memory"); | ||
150 | } else if (cpu_has_llsc) { | ||
151 | unsigned long dummy; | ||
152 | |||
153 | __asm__ __volatile__( | ||
154 | " .set mips3 \n" | ||
155 | "1: lld %0, %3 # xchg_u64 \n" | ||
156 | " move %2, %z4 \n" | ||
157 | " scd %2, %1 \n" | ||
158 | " beqz %2, 2f \n" | ||
159 | " .subsection 2 \n" | ||
160 | "2: b 1b \n" | ||
161 | " .previous \n" | ||
162 | " .set mips0 \n" | ||
163 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) | ||
164 | : "R" (*m), "Jr" (val) | ||
165 | : "memory"); | ||
166 | } else { | ||
167 | unsigned long flags; | ||
168 | |||
169 | raw_local_irq_save(flags); | ||
170 | retval = *m; | ||
171 | *m = val; | ||
172 | raw_local_irq_restore(flags); /* implies memory barrier */ | ||
173 | } | ||
174 | |||
175 | smp_llsc_mb(); | ||
176 | |||
177 | return retval; | ||
178 | } | ||
179 | #else | ||
180 | extern __u64 __xchg_u64_unsupported_on_32bit_kernels(volatile __u64 * m, __u64 val); | ||
181 | #define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels | ||
182 | #endif | ||
183 | |||
184 | /* This function doesn't exist, so you'll get a linker error | ||
185 | if something tries to do an invalid xchg(). */ | ||
186 | extern void __xchg_called_with_bad_pointer(void); | ||
187 | |||
188 | static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) | ||
189 | { | ||
190 | switch (size) { | ||
191 | case 4: | ||
192 | return __xchg_u32(ptr, x); | ||
193 | case 8: | ||
194 | return __xchg_u64(ptr, x); | ||
195 | } | ||
196 | __xchg_called_with_bad_pointer(); | ||
197 | return x; | ||
198 | } | ||
199 | |||
200 | #define xchg(ptr, x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) | ||
201 | |||
202 | extern void set_handler(unsigned long offset, void *addr, unsigned long len); | ||
203 | extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len); | ||
204 | |||
205 | typedef void (*vi_handler_t)(void); | ||
206 | extern void *set_vi_handler(int n, vi_handler_t addr); | ||
207 | |||
208 | extern void *set_except_vector(int n, void *addr); | ||
209 | extern unsigned long ebase; | ||
210 | extern void per_cpu_trap_init(void); | ||
211 | |||
212 | /* | ||
213 | * See include/asm-ia64/system.h; prevents deadlock on SMP | ||
214 | * systems. | ||
215 | */ | ||
216 | #define __ARCH_WANT_UNLOCKED_CTXSW | ||
217 | |||
218 | extern unsigned long arch_align_stack(unsigned long sp); | ||
219 | |||
220 | #endif /* _ASM_SYSTEM_H */ | ||
diff --git a/include/asm-mips/termbits.h b/include/asm-mips/termbits.h deleted file mode 100644 index c83c68444e86..000000000000 --- a/include/asm-mips/termbits.h +++ /dev/null | |||
@@ -1,226 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 96, 99, 2001, 06 Ralf Baechle | ||
7 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
8 | * Copyright (C) 2001 MIPS Technologies, Inc. | ||
9 | */ | ||
10 | #ifndef _ASM_TERMBITS_H | ||
11 | #define _ASM_TERMBITS_H | ||
12 | |||
13 | #include <linux/posix_types.h> | ||
14 | |||
15 | typedef unsigned char cc_t; | ||
16 | typedef unsigned int speed_t; | ||
17 | typedef unsigned int tcflag_t; | ||
18 | |||
19 | /* | ||
20 | * The ABI says nothing about NCC but seems to use NCCS as | ||
21 | * replacement for it in struct termio | ||
22 | */ | ||
23 | #define NCCS 23 | ||
24 | struct termios { | ||
25 | tcflag_t c_iflag; /* input mode flags */ | ||
26 | tcflag_t c_oflag; /* output mode flags */ | ||
27 | tcflag_t c_cflag; /* control mode flags */ | ||
28 | tcflag_t c_lflag; /* local mode flags */ | ||
29 | cc_t c_line; /* line discipline */ | ||
30 | cc_t c_cc[NCCS]; /* control characters */ | ||
31 | }; | ||
32 | |||
33 | struct termios2 { | ||
34 | tcflag_t c_iflag; /* input mode flags */ | ||
35 | tcflag_t c_oflag; /* output mode flags */ | ||
36 | tcflag_t c_cflag; /* control mode flags */ | ||
37 | tcflag_t c_lflag; /* local mode flags */ | ||
38 | cc_t c_line; /* line discipline */ | ||
39 | cc_t c_cc[NCCS]; /* control characters */ | ||
40 | speed_t c_ispeed; /* input speed */ | ||
41 | speed_t c_ospeed; /* output speed */ | ||
42 | }; | ||
43 | |||
44 | struct ktermios { | ||
45 | tcflag_t c_iflag; /* input mode flags */ | ||
46 | tcflag_t c_oflag; /* output mode flags */ | ||
47 | tcflag_t c_cflag; /* control mode flags */ | ||
48 | tcflag_t c_lflag; /* local mode flags */ | ||
49 | cc_t c_line; /* line discipline */ | ||
50 | cc_t c_cc[NCCS]; /* control characters */ | ||
51 | speed_t c_ispeed; /* input speed */ | ||
52 | speed_t c_ospeed; /* output speed */ | ||
53 | }; | ||
54 | |||
55 | /* c_cc characters */ | ||
56 | #define VINTR 0 /* Interrupt character [ISIG]. */ | ||
57 | #define VQUIT 1 /* Quit character [ISIG]. */ | ||
58 | #define VERASE 2 /* Erase character [ICANON]. */ | ||
59 | #define VKILL 3 /* Kill-line character [ICANON]. */ | ||
60 | #define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */ | ||
61 | #define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */ | ||
62 | #define VEOL2 6 /* Second EOL character [ICANON]. */ | ||
63 | #define VSWTC 7 /* ??? */ | ||
64 | #define VSWTCH VSWTC | ||
65 | #define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ | ||
66 | #define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ | ||
67 | #define VSUSP 10 /* Suspend character [ISIG]. */ | ||
68 | #if 0 | ||
69 | /* | ||
70 | * VDSUSP is not supported | ||
71 | */ | ||
72 | #define VDSUSP 11 /* Delayed suspend character [ISIG]. */ | ||
73 | #endif | ||
74 | #define VREPRINT 12 /* Reprint-line character [ICANON]. */ | ||
75 | #define VDISCARD 13 /* Discard character [IEXTEN]. */ | ||
76 | #define VWERASE 14 /* Word-erase character [ICANON]. */ | ||
77 | #define VLNEXT 15 /* Literal-next character [IEXTEN]. */ | ||
78 | #define VEOF 16 /* End-of-file character [ICANON]. */ | ||
79 | #define VEOL 17 /* End-of-line character [ICANON]. */ | ||
80 | |||
81 | /* c_iflag bits */ | ||
82 | #define IGNBRK 0000001 /* Ignore break condition. */ | ||
83 | #define BRKINT 0000002 /* Signal interrupt on break. */ | ||
84 | #define IGNPAR 0000004 /* Ignore characters with parity errors. */ | ||
85 | #define PARMRK 0000010 /* Mark parity and framing errors. */ | ||
86 | #define INPCK 0000020 /* Enable input parity check. */ | ||
87 | #define ISTRIP 0000040 /* Strip 8th bit off characters. */ | ||
88 | #define INLCR 0000100 /* Map NL to CR on input. */ | ||
89 | #define IGNCR 0000200 /* Ignore CR. */ | ||
90 | #define ICRNL 0000400 /* Map CR to NL on input. */ | ||
91 | #define IUCLC 0001000 /* Map upper case to lower case on input. */ | ||
92 | #define IXON 0002000 /* Enable start/stop output control. */ | ||
93 | #define IXANY 0004000 /* Any character will restart after stop. */ | ||
94 | #define IXOFF 0010000 /* Enable start/stop input control. */ | ||
95 | #define IMAXBEL 0020000 /* Ring bell when input queue is full. */ | ||
96 | #define IUTF8 0040000 /* Input is UTF-8 */ | ||
97 | |||
98 | /* c_oflag bits */ | ||
99 | #define OPOST 0000001 /* Perform output processing. */ | ||
100 | #define OLCUC 0000002 /* Map lower case to upper case on output. */ | ||
101 | #define ONLCR 0000004 /* Map NL to CR-NL on output. */ | ||
102 | #define OCRNL 0000010 | ||
103 | #define ONOCR 0000020 | ||
104 | #define ONLRET 0000040 | ||
105 | #define OFILL 0000100 | ||
106 | #define OFDEL 0000200 | ||
107 | #define NLDLY 0000400 | ||
108 | #define NL0 0000000 | ||
109 | #define NL1 0000400 | ||
110 | #define CRDLY 0003000 | ||
111 | #define CR0 0000000 | ||
112 | #define CR1 0001000 | ||
113 | #define CR2 0002000 | ||
114 | #define CR3 0003000 | ||
115 | #define TABDLY 0014000 | ||
116 | #define TAB0 0000000 | ||
117 | #define TAB1 0004000 | ||
118 | #define TAB2 0010000 | ||
119 | #define TAB3 0014000 | ||
120 | #define XTABS 0014000 | ||
121 | #define BSDLY 0020000 | ||
122 | #define BS0 0000000 | ||
123 | #define BS1 0020000 | ||
124 | #define VTDLY 0040000 | ||
125 | #define VT0 0000000 | ||
126 | #define VT1 0040000 | ||
127 | #define FFDLY 0100000 | ||
128 | #define FF0 0000000 | ||
129 | #define FF1 0100000 | ||
130 | /* | ||
131 | #define PAGEOUT ??? | ||
132 | #define WRAP ??? | ||
133 | */ | ||
134 | |||
135 | /* c_cflag bit meaning */ | ||
136 | #define CBAUD 0010017 | ||
137 | #define B0 0000000 /* hang up */ | ||
138 | #define B50 0000001 | ||
139 | #define B75 0000002 | ||
140 | #define B110 0000003 | ||
141 | #define B134 0000004 | ||
142 | #define B150 0000005 | ||
143 | #define B200 0000006 | ||
144 | #define B300 0000007 | ||
145 | #define B600 0000010 | ||
146 | #define B1200 0000011 | ||
147 | #define B1800 0000012 | ||
148 | #define B2400 0000013 | ||
149 | #define B4800 0000014 | ||
150 | #define B9600 0000015 | ||
151 | #define B19200 0000016 | ||
152 | #define B38400 0000017 | ||
153 | #define EXTA B19200 | ||
154 | #define EXTB B38400 | ||
155 | #define CSIZE 0000060 /* Number of bits per byte (mask). */ | ||
156 | #define CS5 0000000 /* 5 bits per byte. */ | ||
157 | #define CS6 0000020 /* 6 bits per byte. */ | ||
158 | #define CS7 0000040 /* 7 bits per byte. */ | ||
159 | #define CS8 0000060 /* 8 bits per byte. */ | ||
160 | #define CSTOPB 0000100 /* Two stop bits instead of one. */ | ||
161 | #define CREAD 0000200 /* Enable receiver. */ | ||
162 | #define PARENB 0000400 /* Parity enable. */ | ||
163 | #define PARODD 0001000 /* Odd parity instead of even. */ | ||
164 | #define HUPCL 0002000 /* Hang up on last close. */ | ||
165 | #define CLOCAL 0004000 /* Ignore modem status lines. */ | ||
166 | #define CBAUDEX 0010000 | ||
167 | #define BOTHER 0010000 | ||
168 | #define B57600 0010001 | ||
169 | #define B115200 0010002 | ||
170 | #define B230400 0010003 | ||
171 | #define B460800 0010004 | ||
172 | #define B500000 0010005 | ||
173 | #define B576000 0010006 | ||
174 | #define B921600 0010007 | ||
175 | #define B1000000 0010010 | ||
176 | #define B1152000 0010011 | ||
177 | #define B1500000 0010012 | ||
178 | #define B2000000 0010013 | ||
179 | #define B2500000 0010014 | ||
180 | #define B3000000 0010015 | ||
181 | #define B3500000 0010016 | ||
182 | #define B4000000 0010017 | ||
183 | #define CIBAUD 002003600000 /* input baud rate */ | ||
184 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | ||
185 | #define CRTSCTS 020000000000 /* flow control */ | ||
186 | |||
187 | #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ | ||
188 | |||
189 | /* c_lflag bits */ | ||
190 | #define ISIG 0000001 /* Enable signals. */ | ||
191 | #define ICANON 0000002 /* Do erase and kill processing. */ | ||
192 | #define XCASE 0000004 | ||
193 | #define ECHO 0000010 /* Enable echo. */ | ||
194 | #define ECHOE 0000020 /* Visual erase for ERASE. */ | ||
195 | #define ECHOK 0000040 /* Echo NL after KILL. */ | ||
196 | #define ECHONL 0000100 /* Echo NL even if ECHO is off. */ | ||
197 | #define NOFLSH 0000200 /* Disable flush after interrupt. */ | ||
198 | #define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */ | ||
199 | #define ECHOCTL 0001000 /* Echo control characters as ^X. */ | ||
200 | #define ECHOPRT 0002000 /* Hardcopy visual erase. */ | ||
201 | #define ECHOKE 0004000 /* Visual erase for KILL. */ | ||
202 | #define FLUSHO 0020000 | ||
203 | #define PENDIN 0040000 /* Retype pending input (state). */ | ||
204 | #define TOSTOP 0100000 /* Send SIGTTOU for background output. */ | ||
205 | #define ITOSTOP TOSTOP | ||
206 | |||
207 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
208 | #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ | ||
209 | |||
210 | /* tcflow() and TCXONC use these */ | ||
211 | #define TCOOFF 0 /* Suspend output. */ | ||
212 | #define TCOON 1 /* Restart suspended output. */ | ||
213 | #define TCIOFF 2 /* Send a STOP character. */ | ||
214 | #define TCION 3 /* Send a START character. */ | ||
215 | |||
216 | /* tcflush() and TCFLSH use these */ | ||
217 | #define TCIFLUSH 0 /* Discard data received but not yet read. */ | ||
218 | #define TCOFLUSH 1 /* Discard data written but not yet sent. */ | ||
219 | #define TCIOFLUSH 2 /* Discard all pending data. */ | ||
220 | |||
221 | /* tcsetattr uses these */ | ||
222 | #define TCSANOW TCSETS /* Change immediately. */ | ||
223 | #define TCSADRAIN TCSETSW /* Change when pending output is written. */ | ||
224 | #define TCSAFLUSH TCSETSF /* Flush pending input before changing. */ | ||
225 | |||
226 | #endif /* _ASM_TERMBITS_H */ | ||
diff --git a/include/asm-mips/termios.h b/include/asm-mips/termios.h deleted file mode 100644 index a275661fa7e1..000000000000 --- a/include/asm-mips/termios.h +++ /dev/null | |||
@@ -1,132 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 1996, 2000, 2001 by Ralf Baechle | ||
7 | * Copyright (C) 2000, 2001 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_TERMIOS_H | ||
10 | #define _ASM_TERMIOS_H | ||
11 | |||
12 | #include <asm/termbits.h> | ||
13 | #include <asm/ioctls.h> | ||
14 | |||
15 | struct sgttyb { | ||
16 | char sg_ispeed; | ||
17 | char sg_ospeed; | ||
18 | char sg_erase; | ||
19 | char sg_kill; | ||
20 | int sg_flags; /* SGI special - int, not short */ | ||
21 | }; | ||
22 | |||
23 | struct tchars { | ||
24 | char t_intrc; | ||
25 | char t_quitc; | ||
26 | char t_startc; | ||
27 | char t_stopc; | ||
28 | char t_eofc; | ||
29 | char t_brkc; | ||
30 | }; | ||
31 | |||
32 | struct ltchars { | ||
33 | char t_suspc; /* stop process signal */ | ||
34 | char t_dsuspc; /* delayed stop process signal */ | ||
35 | char t_rprntc; /* reprint line */ | ||
36 | char t_flushc; /* flush output (toggles) */ | ||
37 | char t_werasc; /* word erase */ | ||
38 | char t_lnextc; /* literal next character */ | ||
39 | }; | ||
40 | |||
41 | /* TIOCGSIZE, TIOCSSIZE not defined yet. Only needed for SunOS source | ||
42 | compatibility anyway ... */ | ||
43 | |||
44 | struct winsize { | ||
45 | unsigned short ws_row; | ||
46 | unsigned short ws_col; | ||
47 | unsigned short ws_xpixel; | ||
48 | unsigned short ws_ypixel; | ||
49 | }; | ||
50 | |||
51 | #define NCC 8 | ||
52 | struct termio { | ||
53 | unsigned short c_iflag; /* input mode flags */ | ||
54 | unsigned short c_oflag; /* output mode flags */ | ||
55 | unsigned short c_cflag; /* control mode flags */ | ||
56 | unsigned short c_lflag; /* local mode flags */ | ||
57 | char c_line; /* line discipline */ | ||
58 | unsigned char c_cc[NCCS]; /* control characters */ | ||
59 | }; | ||
60 | |||
61 | #ifdef __KERNEL__ | ||
62 | #include <linux/module.h> | ||
63 | |||
64 | /* | ||
65 | * intr=^C quit=^\ erase=del kill=^U | ||
66 | * vmin=\1 vtime=\0 eol2=\0 swtc=\0 | ||
67 | * start=^Q stop=^S susp=^Z vdsusp= | ||
68 | * reprint=^R discard=^U werase=^W lnext=^V | ||
69 | * eof=^D eol=\0 | ||
70 | */ | ||
71 | #define INIT_C_CC "\003\034\177\025\1\0\0\0\021\023\032\0\022\017\027\026\004\0" | ||
72 | #endif | ||
73 | |||
74 | /* modem lines */ | ||
75 | #define TIOCM_LE 0x001 /* line enable */ | ||
76 | #define TIOCM_DTR 0x002 /* data terminal ready */ | ||
77 | #define TIOCM_RTS 0x004 /* request to send */ | ||
78 | #define TIOCM_ST 0x010 /* secondary transmit */ | ||
79 | #define TIOCM_SR 0x020 /* secondary receive */ | ||
80 | #define TIOCM_CTS 0x040 /* clear to send */ | ||
81 | #define TIOCM_CAR 0x100 /* carrier detect */ | ||
82 | #define TIOCM_CD TIOCM_CAR | ||
83 | #define TIOCM_RNG 0x200 /* ring */ | ||
84 | #define TIOCM_RI TIOCM_RNG | ||
85 | #define TIOCM_DSR 0x400 /* data set ready */ | ||
86 | #define TIOCM_OUT1 0x2000 | ||
87 | #define TIOCM_OUT2 0x4000 | ||
88 | #define TIOCM_LOOP 0x8000 | ||
89 | |||
90 | #ifdef __KERNEL__ | ||
91 | |||
92 | #include <linux/string.h> | ||
93 | |||
94 | /* | ||
95 | * Translate a "termio" structure into a "termios". Ugh. | ||
96 | */ | ||
97 | #define user_termio_to_kernel_termios(termios, termio) \ | ||
98 | ({ \ | ||
99 | unsigned short tmp; \ | ||
100 | get_user(tmp, &(termio)->c_iflag); \ | ||
101 | (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ | ||
102 | get_user(tmp, &(termio)->c_oflag); \ | ||
103 | (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ | ||
104 | get_user(tmp, &(termio)->c_cflag); \ | ||
105 | (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ | ||
106 | get_user(tmp, &(termio)->c_lflag); \ | ||
107 | (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ | ||
108 | get_user((termios)->c_line, &(termio)->c_line); \ | ||
109 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | ||
110 | }) | ||
111 | |||
112 | /* | ||
113 | * Translate a "termios" structure into a "termio". Ugh. | ||
114 | */ | ||
115 | #define kernel_termios_to_user_termio(termio, termios) \ | ||
116 | ({ \ | ||
117 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ | ||
118 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ | ||
119 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ | ||
120 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ | ||
121 | put_user((termios)->c_line, &(termio)->c_line); \ | ||
122 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | ||
123 | }) | ||
124 | |||
125 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) | ||
126 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) | ||
127 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
128 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
129 | |||
130 | #endif /* defined(__KERNEL__) */ | ||
131 | |||
132 | #endif /* _ASM_TERMIOS_H */ | ||
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h deleted file mode 100644 index bb3060699df2..000000000000 --- a/include/asm-mips/thread_info.h +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
1 | /* thread_info.h: MIPS low-level thread information | ||
2 | * | ||
3 | * Copyright (C) 2002 David Howells (dhowells@redhat.com) | ||
4 | * - Incorporating suggestions made by Linus Torvalds and Dave Miller | ||
5 | */ | ||
6 | |||
7 | #ifndef _ASM_THREAD_INFO_H | ||
8 | #define _ASM_THREAD_INFO_H | ||
9 | |||
10 | #ifdef __KERNEL__ | ||
11 | |||
12 | |||
13 | #ifndef __ASSEMBLY__ | ||
14 | |||
15 | #include <asm/processor.h> | ||
16 | |||
17 | /* | ||
18 | * low level task data that entry.S needs immediate access to | ||
19 | * - this struct should fit entirely inside of one cache line | ||
20 | * - this struct shares the supervisor stack pages | ||
21 | * - if the contents of this structure are changed, the assembly constants | ||
22 | * must also be changed | ||
23 | */ | ||
24 | struct thread_info { | ||
25 | struct task_struct *task; /* main task structure */ | ||
26 | struct exec_domain *exec_domain; /* execution domain */ | ||
27 | unsigned long flags; /* low level flags */ | ||
28 | unsigned long tp_value; /* thread pointer */ | ||
29 | __u32 cpu; /* current CPU */ | ||
30 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | ||
31 | |||
32 | mm_segment_t addr_limit; /* thread address space: | ||
33 | 0-0xBFFFFFFF for user-thead | ||
34 | 0-0xFFFFFFFF for kernel-thread | ||
35 | */ | ||
36 | struct restart_block restart_block; | ||
37 | struct pt_regs *regs; | ||
38 | }; | ||
39 | |||
40 | /* | ||
41 | * macros/functions for gaining access to the thread information structure | ||
42 | * | ||
43 | * preempt_count needs to be 1 initially, until the scheduler is functional. | ||
44 | */ | ||
45 | #define INIT_THREAD_INFO(tsk) \ | ||
46 | { \ | ||
47 | .task = &tsk, \ | ||
48 | .exec_domain = &default_exec_domain, \ | ||
49 | .flags = _TIF_FIXADE, \ | ||
50 | .cpu = 0, \ | ||
51 | .preempt_count = 1, \ | ||
52 | .addr_limit = KERNEL_DS, \ | ||
53 | .restart_block = { \ | ||
54 | .fn = do_no_restart_syscall, \ | ||
55 | }, \ | ||
56 | } | ||
57 | |||
58 | #define init_thread_info (init_thread_union.thread_info) | ||
59 | #define init_stack (init_thread_union.stack) | ||
60 | |||
61 | /* How to get the thread information struct from C. */ | ||
62 | register struct thread_info *__current_thread_info __asm__("$28"); | ||
63 | #define current_thread_info() __current_thread_info | ||
64 | |||
65 | /* thread information allocation */ | ||
66 | #if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_32BIT) | ||
67 | #define THREAD_SIZE_ORDER (1) | ||
68 | #endif | ||
69 | #if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_64BIT) | ||
70 | #define THREAD_SIZE_ORDER (2) | ||
71 | #endif | ||
72 | #ifdef CONFIG_PAGE_SIZE_8KB | ||
73 | #define THREAD_SIZE_ORDER (1) | ||
74 | #endif | ||
75 | #ifdef CONFIG_PAGE_SIZE_16KB | ||
76 | #define THREAD_SIZE_ORDER (0) | ||
77 | #endif | ||
78 | #ifdef CONFIG_PAGE_SIZE_64KB | ||
79 | #define THREAD_SIZE_ORDER (0) | ||
80 | #endif | ||
81 | |||
82 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) | ||
83 | #define THREAD_MASK (THREAD_SIZE - 1UL) | ||
84 | |||
85 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
86 | |||
87 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
88 | #define alloc_thread_info(tsk) \ | ||
89 | ({ \ | ||
90 | struct thread_info *ret; \ | ||
91 | \ | ||
92 | ret = kzalloc(THREAD_SIZE, GFP_KERNEL); \ | ||
93 | \ | ||
94 | ret; \ | ||
95 | }) | ||
96 | #else | ||
97 | #define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL) | ||
98 | #endif | ||
99 | |||
100 | #define free_thread_info(info) kfree(info) | ||
101 | |||
102 | #endif /* !__ASSEMBLY__ */ | ||
103 | |||
104 | #define PREEMPT_ACTIVE 0x10000000 | ||
105 | |||
106 | /* | ||
107 | * thread information flags | ||
108 | * - these are process state flags that various assembly files may need to | ||
109 | * access | ||
110 | * - pending work-to-be-done flags are in LSW | ||
111 | * - other flags in MSW | ||
112 | */ | ||
113 | #define TIF_SIGPENDING 1 /* signal pending */ | ||
114 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ | ||
115 | #define TIF_SYSCALL_AUDIT 3 /* syscall auditing active */ | ||
116 | #define TIF_SECCOMP 4 /* secure computing */ | ||
117 | #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ | ||
118 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ | ||
119 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | ||
120 | #define TIF_MEMDIE 18 | ||
121 | #define TIF_FREEZE 19 | ||
122 | #define TIF_FIXADE 20 /* Fix address errors in software */ | ||
123 | #define TIF_LOGADE 21 /* Log address errors to syslog */ | ||
124 | #define TIF_32BIT_REGS 22 /* also implies 16/32 fprs */ | ||
125 | #define TIF_32BIT_ADDR 23 /* 32-bit address space (o32/n32) */ | ||
126 | #define TIF_FPUBOUND 24 /* thread bound to FPU-full CPU set */ | ||
127 | #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ | ||
128 | |||
129 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | ||
130 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | ||
131 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | ||
132 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | ||
133 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | ||
134 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | ||
135 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) | ||
136 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | ||
137 | #define _TIF_FREEZE (1<<TIF_FREEZE) | ||
138 | #define _TIF_FIXADE (1<<TIF_FIXADE) | ||
139 | #define _TIF_LOGADE (1<<TIF_LOGADE) | ||
140 | #define _TIF_32BIT_REGS (1<<TIF_32BIT_REGS) | ||
141 | #define _TIF_32BIT_ADDR (1<<TIF_32BIT_ADDR) | ||
142 | #define _TIF_FPUBOUND (1<<TIF_FPUBOUND) | ||
143 | |||
144 | /* work to do on interrupt/exception return */ | ||
145 | #define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP) | ||
146 | /* work to do on any return to u-space */ | ||
147 | #define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP) | ||
148 | |||
149 | #endif /* __KERNEL__ */ | ||
150 | |||
151 | #endif /* _ASM_THREAD_INFO_H */ | ||
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h deleted file mode 100644 index d3bd5c5aa2ec..000000000000 --- a/include/asm-mips/time.h +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001, 2002, MontaVista Software Inc. | ||
3 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net | ||
4 | * Copyright (c) 2003 Maciej W. Rozycki | ||
5 | * | ||
6 | * include/asm-mips/time.h | ||
7 | * header file for the new style time.c file and time services. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | */ | ||
14 | #ifndef _ASM_TIME_H | ||
15 | #define _ASM_TIME_H | ||
16 | |||
17 | #include <linux/rtc.h> | ||
18 | #include <linux/spinlock.h> | ||
19 | #include <linux/clockchips.h> | ||
20 | #include <linux/clocksource.h> | ||
21 | |||
22 | extern spinlock_t rtc_lock; | ||
23 | |||
24 | /* | ||
25 | * RTC ops. By default, they point to weak no-op RTC functions. | ||
26 | * rtc_mips_set_time - reverse the above translation and set time to RTC. | ||
27 | * rtc_mips_set_mmss - similar to rtc_set_time, but only min and sec need | ||
28 | * to be set. Used by RTC sync-up. | ||
29 | */ | ||
30 | extern int rtc_mips_set_time(unsigned long); | ||
31 | extern int rtc_mips_set_mmss(unsigned long); | ||
32 | |||
33 | /* | ||
34 | * board specific routines required by time_init(). | ||
35 | */ | ||
36 | extern void plat_time_init(void); | ||
37 | |||
38 | /* | ||
39 | * mips_hpt_frequency - must be set if you intend to use an R4k-compatible | ||
40 | * counter as a timer interrupt source. | ||
41 | */ | ||
42 | extern unsigned int mips_hpt_frequency; | ||
43 | |||
44 | /* | ||
45 | * The performance counter IRQ on MIPS is a close relative to the timer IRQ | ||
46 | * so it lives here. | ||
47 | */ | ||
48 | extern int (*perf_irq)(void); | ||
49 | |||
50 | /* | ||
51 | * Initialize the calling CPU's compare interrupt as clockevent device | ||
52 | */ | ||
53 | #ifdef CONFIG_CEVT_R4K | ||
54 | extern int mips_clockevent_init(void); | ||
55 | extern unsigned int __weak get_c0_compare_int(void); | ||
56 | #else | ||
57 | static inline int mips_clockevent_init(void) | ||
58 | { | ||
59 | return -ENXIO; | ||
60 | } | ||
61 | #endif | ||
62 | |||
63 | /* | ||
64 | * Initialize the count register as a clocksource | ||
65 | */ | ||
66 | #ifdef CONFIG_CEVT_R4K | ||
67 | extern int init_mips_clocksource(void); | ||
68 | #else | ||
69 | static inline int init_mips_clocksource(void) | ||
70 | { | ||
71 | return 0; | ||
72 | } | ||
73 | #endif | ||
74 | |||
75 | extern void clocksource_set_clock(struct clocksource *cs, unsigned int clock); | ||
76 | extern void clockevent_set_clock(struct clock_event_device *cd, | ||
77 | unsigned int clock); | ||
78 | |||
79 | #endif /* _ASM_TIME_H */ | ||
diff --git a/include/asm-mips/timex.h b/include/asm-mips/timex.h deleted file mode 100644 index 6529704aa73a..000000000000 --- a/include/asm-mips/timex.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 1999, 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_TIMEX_H | ||
9 | #define _ASM_TIMEX_H | ||
10 | |||
11 | #ifdef __KERNEL__ | ||
12 | |||
13 | #include <asm/mipsregs.h> | ||
14 | |||
15 | /* | ||
16 | * This is the clock rate of the i8253 PIT. A MIPS system may not have | ||
17 | * a PIT by the symbol is used all over the kernel including some APIs. | ||
18 | * So keeping it defined to the number for the PIT is the only sane thing | ||
19 | * for now. | ||
20 | */ | ||
21 | #define CLOCK_TICK_RATE 1193182 | ||
22 | |||
23 | /* | ||
24 | * Standard way to access the cycle counter. | ||
25 | * Currently only used on SMP for scheduling. | ||
26 | * | ||
27 | * Only the low 32 bits are available as a continuously counting entity. | ||
28 | * But this only means we'll force a reschedule every 8 seconds or so, | ||
29 | * which isn't an evil thing. | ||
30 | * | ||
31 | * We know that all SMP capable CPUs have cycle counters. | ||
32 | */ | ||
33 | |||
34 | typedef unsigned int cycles_t; | ||
35 | |||
36 | static inline cycles_t get_cycles(void) | ||
37 | { | ||
38 | return 0; | ||
39 | } | ||
40 | |||
41 | #endif /* __KERNEL__ */ | ||
42 | |||
43 | #endif /* _ASM_TIMEX_H */ | ||
diff --git a/include/asm-mips/titan_dep.h b/include/asm-mips/titan_dep.h deleted file mode 100644 index fee1908c65d2..000000000000 --- a/include/asm-mips/titan_dep.h +++ /dev/null | |||
@@ -1,231 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2003 PMC-Sierra | ||
3 | * Author: Manish Lachwani (lachwani@pmc-sierra.com) | ||
4 | * | ||
5 | * Board specific definititions for the PMC-Sierra Yosemite | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __TITAN_DEP_H__ | ||
14 | #define __TITAN_DEP_H__ | ||
15 | |||
16 | #include <asm/addrspace.h> /* for KSEG1ADDR() */ | ||
17 | #include <asm/byteorder.h> /* for cpu_to_le32() */ | ||
18 | |||
19 | #define TITAN_READ(ofs) \ | ||
20 | (*(volatile u32 *)(ocd_base+(ofs))) | ||
21 | #define TITAN_READ_16(ofs) \ | ||
22 | (*(volatile u16 *)(ocd_base+(ofs))) | ||
23 | #define TITAN_READ_8(ofs) \ | ||
24 | (*(volatile u8 *)(ocd_base+(ofs))) | ||
25 | |||
26 | #define TITAN_WRITE(ofs, data) \ | ||
27 | do { *(volatile u32 *)(ocd_base+(ofs)) = (data); } while (0) | ||
28 | #define TITAN_WRITE_16(ofs, data) \ | ||
29 | do { *(volatile u16 *)(ocd_base+(ofs)) = (data); } while (0) | ||
30 | #define TITAN_WRITE_8(ofs, data) \ | ||
31 | do { *(volatile u8 *)(ocd_base+(ofs)) = (data); } while (0) | ||
32 | |||
33 | /* | ||
34 | * PCI specific defines | ||
35 | */ | ||
36 | #define TITAN_PCI_0_CONFIG_ADDRESS 0x780 | ||
37 | #define TITAN_PCI_0_CONFIG_DATA 0x784 | ||
38 | |||
39 | /* | ||
40 | * HT specific defines | ||
41 | */ | ||
42 | #define RM9000x2_HTLINK_REG 0xbb000644 | ||
43 | #define RM9000x2_BASE_ADDR 0xbb000000 | ||
44 | |||
45 | #define OCD_BASE 0xfb000000UL | ||
46 | #define OCD_SIZE 0x3000UL | ||
47 | |||
48 | extern unsigned long ocd_base; | ||
49 | |||
50 | /* | ||
51 | * OCD Registers | ||
52 | */ | ||
53 | #define RM9000x2_OCD_LKB5 0x0128 /* Ethernet */ | ||
54 | #define RM9000x2_OCD_LKM5 0x012c | ||
55 | |||
56 | #define RM9000x2_OCD_LKB7 0x0138 /* HT Region 0 */ | ||
57 | #define RM9000x2_OCD_LKM7 0x013c | ||
58 | #define RM9000x2_OCD_LKB8 0x0140 /* HT Region 1 */ | ||
59 | #define RM9000x2_OCD_LKM8 0x0144 | ||
60 | |||
61 | #define RM9000x2_OCD_LKB9 0x0148 /* Local Bus */ | ||
62 | #define RM9000x2_OCD_LKM9 0x014c | ||
63 | #define RM9000x2_OCD_LKB10 0x0150 | ||
64 | #define RM9000x2_OCD_LKM10 0x0154 | ||
65 | #define RM9000x2_OCD_LKB11 0x0158 | ||
66 | #define RM9000x2_OCD_LKM11 0x015c | ||
67 | #define RM9000x2_OCD_LKB12 0x0160 | ||
68 | #define RM9000x2_OCD_LKM12 0x0164 | ||
69 | |||
70 | #define RM9000x2_OCD_LKB13 0x0168 /* Scratch RAM */ | ||
71 | #define RM9000x2_OCD_LKM13 0x016c | ||
72 | |||
73 | #define RM9000x2_OCD_LPD0 0x0200 /* Local Bus */ | ||
74 | #define RM9000x2_OCD_LPD1 0x0210 | ||
75 | #define RM9000x2_OCD_LPD2 0x0220 | ||
76 | #define RM9000x2_OCD_LPD3 0x0230 | ||
77 | |||
78 | #define RM9000x2_OCD_HTDVID 0x0600 /* HT Device Header */ | ||
79 | #define RM9000x2_OCD_HTSC 0x0604 | ||
80 | #define RM9000x2_OCD_HTCCR 0x0608 | ||
81 | #define RM9000x2_OCD_HTBHL 0x060c | ||
82 | #define RM9000x2_OCD_HTBAR0 0x0610 | ||
83 | #define RM9000x2_OCD_HTBAR1 0x0614 | ||
84 | #define RM9000x2_OCD_HTBAR2 0x0618 | ||
85 | #define RM9000x2_OCD_HTBAR3 0x061c | ||
86 | #define RM9000x2_OCD_HTBAR4 0x0620 | ||
87 | #define RM9000x2_OCD_HTBAR5 0x0624 | ||
88 | #define RM9000x2_OCD_HTCBCPT 0x0628 | ||
89 | #define RM9000x2_OCD_HTSDVID 0x062c | ||
90 | #define RM9000x2_OCD_HTXRA 0x0630 | ||
91 | #define RM9000x2_OCD_HTCAP1 0x0634 | ||
92 | #define RM9000x2_OCD_HTIL 0x063c | ||
93 | |||
94 | #define RM9000x2_OCD_HTLCC 0x0640 /* HT Capability Block */ | ||
95 | #define RM9000x2_OCD_HTLINK 0x0644 | ||
96 | #define RM9000x2_OCD_HTFQREV 0x0648 | ||
97 | |||
98 | #define RM9000x2_OCD_HTERCTL 0x0668 /* HT Controller */ | ||
99 | #define RM9000x2_OCD_HTRXDB 0x066c | ||
100 | #define RM9000x2_OCD_HTIMPED 0x0670 | ||
101 | #define RM9000x2_OCD_HTSWIMP 0x0674 | ||
102 | #define RM9000x2_OCD_HTCAL 0x0678 | ||
103 | |||
104 | #define RM9000x2_OCD_HTBAA30 0x0680 | ||
105 | #define RM9000x2_OCD_HTBAA54 0x0684 | ||
106 | #define RM9000x2_OCD_HTMASK0 0x0688 | ||
107 | #define RM9000x2_OCD_HTMASK1 0x068c | ||
108 | #define RM9000x2_OCD_HTMASK2 0x0690 | ||
109 | #define RM9000x2_OCD_HTMASK3 0x0694 | ||
110 | #define RM9000x2_OCD_HTMASK4 0x0698 | ||
111 | #define RM9000x2_OCD_HTMASK5 0x069c | ||
112 | |||
113 | #define RM9000x2_OCD_HTIFCTL 0x06a0 | ||
114 | #define RM9000x2_OCD_HTPLL 0x06a4 | ||
115 | |||
116 | #define RM9000x2_OCD_HTSRI 0x06b0 | ||
117 | #define RM9000x2_OCD_HTRXNUM 0x06b4 | ||
118 | #define RM9000x2_OCD_HTTXNUM 0x06b8 | ||
119 | |||
120 | #define RM9000x2_OCD_HTTXCNT 0x06c8 | ||
121 | |||
122 | #define RM9000x2_OCD_HTERROR 0x06d8 | ||
123 | #define RM9000x2_OCD_HTRCRCE 0x06dc | ||
124 | #define RM9000x2_OCD_HTEOI 0x06e0 | ||
125 | |||
126 | #define RM9000x2_OCD_CRCR 0x06f0 | ||
127 | |||
128 | #define RM9000x2_OCD_HTCFGA 0x06f8 | ||
129 | #define RM9000x2_OCD_HTCFGD 0x06fc | ||
130 | |||
131 | #define RM9000x2_OCD_INTMSG 0x0a00 | ||
132 | |||
133 | #define RM9000x2_OCD_INTPIN0 0x0a40 | ||
134 | #define RM9000x2_OCD_INTPIN1 0x0a44 | ||
135 | #define RM9000x2_OCD_INTPIN2 0x0a48 | ||
136 | #define RM9000x2_OCD_INTPIN3 0x0a4c | ||
137 | #define RM9000x2_OCD_INTPIN4 0x0a50 | ||
138 | #define RM9000x2_OCD_INTPIN5 0x0a54 | ||
139 | #define RM9000x2_OCD_INTPIN6 0x0a58 | ||
140 | #define RM9000x2_OCD_INTPIN7 0x0a5c | ||
141 | #define RM9000x2_OCD_SEM 0x0a60 | ||
142 | #define RM9000x2_OCD_SEMSET 0x0a64 | ||
143 | #define RM9000x2_OCD_SEMCLR 0x0a68 | ||
144 | |||
145 | #define RM9000x2_OCD_TKT 0x0a70 | ||
146 | #define RM9000x2_OCD_TKTINC 0x0a74 | ||
147 | |||
148 | #define RM9000x2_OCD_NMICONFIG 0x0ac0 /* Interrupts */ | ||
149 | #define RM9000x2_OCD_INTP0PRI 0x1a80 | ||
150 | #define RM9000x2_OCD_INTP1PRI 0x1a80 | ||
151 | #define RM9000x2_OCD_INTP0STATUS0 0x1b00 | ||
152 | #define RM9000x2_OCD_INTP0MASK0 0x1b04 | ||
153 | #define RM9000x2_OCD_INTP0SET0 0x1b08 | ||
154 | #define RM9000x2_OCD_INTP0CLEAR0 0x1b0c | ||
155 | #define RM9000x2_OCD_INTP0STATUS1 0x1b10 | ||
156 | #define RM9000x2_OCD_INTP0MASK1 0x1b14 | ||
157 | #define RM9000x2_OCD_INTP0SET1 0x1b18 | ||
158 | #define RM9000x2_OCD_INTP0CLEAR1 0x1b1c | ||
159 | #define RM9000x2_OCD_INTP0STATUS2 0x1b20 | ||
160 | #define RM9000x2_OCD_INTP0MASK2 0x1b24 | ||
161 | #define RM9000x2_OCD_INTP0SET2 0x1b28 | ||
162 | #define RM9000x2_OCD_INTP0CLEAR2 0x1b2c | ||
163 | #define RM9000x2_OCD_INTP0STATUS3 0x1b30 | ||
164 | #define RM9000x2_OCD_INTP0MASK3 0x1b34 | ||
165 | #define RM9000x2_OCD_INTP0SET3 0x1b38 | ||
166 | #define RM9000x2_OCD_INTP0CLEAR3 0x1b3c | ||
167 | #define RM9000x2_OCD_INTP0STATUS4 0x1b40 | ||
168 | #define RM9000x2_OCD_INTP0MASK4 0x1b44 | ||
169 | #define RM9000x2_OCD_INTP0SET4 0x1b48 | ||
170 | #define RM9000x2_OCD_INTP0CLEAR4 0x1b4c | ||
171 | #define RM9000x2_OCD_INTP0STATUS5 0x1b50 | ||
172 | #define RM9000x2_OCD_INTP0MASK5 0x1b54 | ||
173 | #define RM9000x2_OCD_INTP0SET5 0x1b58 | ||
174 | #define RM9000x2_OCD_INTP0CLEAR5 0x1b5c | ||
175 | #define RM9000x2_OCD_INTP0STATUS6 0x1b60 | ||
176 | #define RM9000x2_OCD_INTP0MASK6 0x1b64 | ||
177 | #define RM9000x2_OCD_INTP0SET6 0x1b68 | ||
178 | #define RM9000x2_OCD_INTP0CLEAR6 0x1b6c | ||
179 | #define RM9000x2_OCD_INTP0STATUS7 0x1b70 | ||
180 | #define RM9000x2_OCD_INTP0MASK7 0x1b74 | ||
181 | #define RM9000x2_OCD_INTP0SET7 0x1b78 | ||
182 | #define RM9000x2_OCD_INTP0CLEAR7 0x1b7c | ||
183 | #define RM9000x2_OCD_INTP1STATUS0 0x2b00 | ||
184 | #define RM9000x2_OCD_INTP1MASK0 0x2b04 | ||
185 | #define RM9000x2_OCD_INTP1SET0 0x2b08 | ||
186 | #define RM9000x2_OCD_INTP1CLEAR0 0x2b0c | ||
187 | #define RM9000x2_OCD_INTP1STATUS1 0x2b10 | ||
188 | #define RM9000x2_OCD_INTP1MASK1 0x2b14 | ||
189 | #define RM9000x2_OCD_INTP1SET1 0x2b18 | ||
190 | #define RM9000x2_OCD_INTP1CLEAR1 0x2b1c | ||
191 | #define RM9000x2_OCD_INTP1STATUS2 0x2b20 | ||
192 | #define RM9000x2_OCD_INTP1MASK2 0x2b24 | ||
193 | #define RM9000x2_OCD_INTP1SET2 0x2b28 | ||
194 | #define RM9000x2_OCD_INTP1CLEAR2 0x2b2c | ||
195 | #define RM9000x2_OCD_INTP1STATUS3 0x2b30 | ||
196 | #define RM9000x2_OCD_INTP1MASK3 0x2b34 | ||
197 | #define RM9000x2_OCD_INTP1SET3 0x2b38 | ||
198 | #define RM9000x2_OCD_INTP1CLEAR3 0x2b3c | ||
199 | #define RM9000x2_OCD_INTP1STATUS4 0x2b40 | ||
200 | #define RM9000x2_OCD_INTP1MASK4 0x2b44 | ||
201 | #define RM9000x2_OCD_INTP1SET4 0x2b48 | ||
202 | #define RM9000x2_OCD_INTP1CLEAR4 0x2b4c | ||
203 | #define RM9000x2_OCD_INTP1STATUS5 0x2b50 | ||
204 | #define RM9000x2_OCD_INTP1MASK5 0x2b54 | ||
205 | #define RM9000x2_OCD_INTP1SET5 0x2b58 | ||
206 | #define RM9000x2_OCD_INTP1CLEAR5 0x2b5c | ||
207 | #define RM9000x2_OCD_INTP1STATUS6 0x2b60 | ||
208 | #define RM9000x2_OCD_INTP1MASK6 0x2b64 | ||
209 | #define RM9000x2_OCD_INTP1SET6 0x2b68 | ||
210 | #define RM9000x2_OCD_INTP1CLEAR6 0x2b6c | ||
211 | #define RM9000x2_OCD_INTP1STATUS7 0x2b70 | ||
212 | #define RM9000x2_OCD_INTP1MASK7 0x2b74 | ||
213 | #define RM9000x2_OCD_INTP1SET7 0x2b78 | ||
214 | #define RM9000x2_OCD_INTP1CLEAR7 0x2b7c | ||
215 | |||
216 | #define OCD_READ(reg) (*(volatile unsigned int *)(ocd_base + (reg))) | ||
217 | #define OCD_WRITE(reg, val) \ | ||
218 | do { *(volatile unsigned int *)(ocd_base + (reg)) = (val); } while (0) | ||
219 | |||
220 | /* | ||
221 | * Hypertransport specific macros | ||
222 | */ | ||
223 | #define RM9K_WRITE(ofs, data) *(volatile u_int32_t *)(RM9000x2_BASE_ADDR+ofs) = data | ||
224 | #define RM9K_WRITE_8(ofs, data) *(volatile u8 *)(RM9000x2_BASE_ADDR+ofs) = data | ||
225 | #define RM9K_WRITE_16(ofs, data) *(volatile u16 *)(RM9000x2_BASE_ADDR+ofs) = data | ||
226 | |||
227 | #define RM9K_READ(ofs, val) *(val) = *(volatile u_int32_t *)(RM9000x2_BASE_ADDR+ofs) | ||
228 | #define RM9K_READ_8(ofs, val) *(val) = *(volatile u8 *)(RM9000x2_BASE_ADDR+ofs) | ||
229 | #define RM9K_READ_16(ofs, val) *(val) = *(volatile u16 *)(RM9000x2_BASE_ADDR+ofs) | ||
230 | |||
231 | #endif | ||
diff --git a/include/asm-mips/tlb.h b/include/asm-mips/tlb.h deleted file mode 100644 index 80d9dfcf1e88..000000000000 --- a/include/asm-mips/tlb.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #ifndef __ASM_TLB_H | ||
2 | #define __ASM_TLB_H | ||
3 | |||
4 | /* | ||
5 | * MIPS doesn't need any special per-pte or per-vma handling, except | ||
6 | * we need to flush cache for area to be unmapped. | ||
7 | */ | ||
8 | #define tlb_start_vma(tlb, vma) \ | ||
9 | do { \ | ||
10 | if (!tlb->fullmm) \ | ||
11 | flush_cache_range(vma, vma->vm_start, vma->vm_end); \ | ||
12 | } while (0) | ||
13 | #define tlb_end_vma(tlb, vma) do { } while (0) | ||
14 | #define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0) | ||
15 | |||
16 | /* | ||
17 | * .. because we flush the whole mm when it fills up. | ||
18 | */ | ||
19 | #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) | ||
20 | |||
21 | #include <asm-generic/tlb.h> | ||
22 | |||
23 | #endif /* __ASM_TLB_H */ | ||
diff --git a/include/asm-mips/tlbdebug.h b/include/asm-mips/tlbdebug.h deleted file mode 100644 index bb8f5c29c3d9..000000000000 --- a/include/asm-mips/tlbdebug.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_TLBDEBUG_H | ||
9 | #define __ASM_TLBDEBUG_H | ||
10 | |||
11 | /* | ||
12 | * TLB debugging functions: | ||
13 | */ | ||
14 | extern void dump_tlb_all(void); | ||
15 | |||
16 | #endif /* __ASM_TLBDEBUG_H */ | ||
diff --git a/include/asm-mips/tlbflush.h b/include/asm-mips/tlbflush.h deleted file mode 100644 index 86b21de12e91..000000000000 --- a/include/asm-mips/tlbflush.h +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | #ifndef __ASM_TLBFLUSH_H | ||
2 | #define __ASM_TLBFLUSH_H | ||
3 | |||
4 | #include <linux/mm.h> | ||
5 | |||
6 | /* | ||
7 | * TLB flushing: | ||
8 | * | ||
9 | * - flush_tlb_all() flushes all processes TLB entries | ||
10 | * - flush_tlb_mm(mm) flushes the specified mm context TLB entries | ||
11 | * - flush_tlb_page(vma, vmaddr) flushes one page | ||
12 | * - flush_tlb_range(vma, start, end) flushes a range of pages | ||
13 | * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages | ||
14 | */ | ||
15 | extern void local_flush_tlb_all(void); | ||
16 | extern void local_flush_tlb_mm(struct mm_struct *mm); | ||
17 | extern void local_flush_tlb_range(struct vm_area_struct *vma, | ||
18 | unsigned long start, unsigned long end); | ||
19 | extern void local_flush_tlb_kernel_range(unsigned long start, | ||
20 | unsigned long end); | ||
21 | extern void local_flush_tlb_page(struct vm_area_struct *vma, | ||
22 | unsigned long page); | ||
23 | extern void local_flush_tlb_one(unsigned long vaddr); | ||
24 | |||
25 | #ifdef CONFIG_SMP | ||
26 | |||
27 | extern void flush_tlb_all(void); | ||
28 | extern void flush_tlb_mm(struct mm_struct *); | ||
29 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long, | ||
30 | unsigned long); | ||
31 | extern void flush_tlb_kernel_range(unsigned long, unsigned long); | ||
32 | extern void flush_tlb_page(struct vm_area_struct *, unsigned long); | ||
33 | extern void flush_tlb_one(unsigned long vaddr); | ||
34 | |||
35 | #else /* CONFIG_SMP */ | ||
36 | |||
37 | #define flush_tlb_all() local_flush_tlb_all() | ||
38 | #define flush_tlb_mm(mm) local_flush_tlb_mm(mm) | ||
39 | #define flush_tlb_range(vma, vmaddr, end) local_flush_tlb_range(vma, vmaddr, end) | ||
40 | #define flush_tlb_kernel_range(vmaddr,end) \ | ||
41 | local_flush_tlb_kernel_range(vmaddr, end) | ||
42 | #define flush_tlb_page(vma, page) local_flush_tlb_page(vma, page) | ||
43 | #define flush_tlb_one(vaddr) local_flush_tlb_one(vaddr) | ||
44 | |||
45 | #endif /* CONFIG_SMP */ | ||
46 | |||
47 | #endif /* __ASM_TLBFLUSH_H */ | ||
diff --git a/include/asm-mips/topology.h b/include/asm-mips/topology.h deleted file mode 100644 index 259145e07e97..000000000000 --- a/include/asm-mips/topology.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2007 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_TOPOLOGY_H | ||
9 | #define __ASM_TOPOLOGY_H | ||
10 | |||
11 | #include <topology.h> | ||
12 | |||
13 | #ifdef CONFIG_SMP | ||
14 | #define smt_capable() (smp_num_siblings > 1) | ||
15 | #endif | ||
16 | |||
17 | #endif /* __ASM_TOPOLOGY_H */ | ||
diff --git a/include/asm-mips/traps.h b/include/asm-mips/traps.h deleted file mode 100644 index 90ff2f497c50..000000000000 --- a/include/asm-mips/traps.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | /* | ||
2 | * Trap handling definitions. | ||
3 | * | ||
4 | * Copyright (C) 2002, 2003 Maciej W. Rozycki | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | #ifndef _ASM_TRAPS_H | ||
12 | #define _ASM_TRAPS_H | ||
13 | |||
14 | /* | ||
15 | * Possible status responses for a board_be_handler backend. | ||
16 | */ | ||
17 | #define MIPS_BE_DISCARD 0 /* return with no action */ | ||
18 | #define MIPS_BE_FIXUP 1 /* return to the fixup code */ | ||
19 | #define MIPS_BE_FATAL 2 /* treat as an unrecoverable error */ | ||
20 | |||
21 | extern void (*board_be_init)(void); | ||
22 | extern int (*board_be_handler)(struct pt_regs *regs, int is_fixup); | ||
23 | |||
24 | extern void (*board_nmi_handler_setup)(void); | ||
25 | extern void (*board_ejtag_handler_setup)(void); | ||
26 | extern void (*board_bind_eic_interrupt)(int irq, int regset); | ||
27 | |||
28 | #endif /* _ASM_TRAPS_H */ | ||
diff --git a/include/asm-mips/txx9/boards.h b/include/asm-mips/txx9/boards.h deleted file mode 100644 index cbe9476d963e..000000000000 --- a/include/asm-mips/txx9/boards.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #ifdef CONFIG_TOSHIBA_JMR3927 | ||
2 | BOARD_VEC(jmr3927_vec) | ||
3 | #endif | ||
4 | #ifdef CONFIG_TOSHIBA_RBTX4927 | ||
5 | BOARD_VEC(rbtx4927_vec) | ||
6 | BOARD_VEC(rbtx4937_vec) | ||
7 | #endif | ||
8 | #ifdef CONFIG_TOSHIBA_RBTX4938 | ||
9 | BOARD_VEC(rbtx4938_vec) | ||
10 | #endif | ||
11 | #ifdef CONFIG_TOSHIBA_RBTX4939 | ||
12 | BOARD_VEC(rbtx4939_vec) | ||
13 | #endif | ||
diff --git a/include/asm-mips/txx9/generic.h b/include/asm-mips/txx9/generic.h deleted file mode 100644 index 4316a3e57678..000000000000 --- a/include/asm-mips/txx9/generic.h +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-mips/txx9/generic.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | */ | ||
8 | #ifndef __ASM_TXX9_GENERIC_H | ||
9 | #define __ASM_TXX9_GENERIC_H | ||
10 | |||
11 | #include <linux/init.h> | ||
12 | #include <linux/ioport.h> /* for struct resource */ | ||
13 | |||
14 | extern struct resource txx9_ce_res[]; | ||
15 | #define TXX9_CE(n) (unsigned long)(txx9_ce_res[(n)].start) | ||
16 | extern unsigned int txx9_pcode; | ||
17 | extern char txx9_pcode_str[8]; | ||
18 | void txx9_reg_res_init(unsigned int pcode, unsigned long base, | ||
19 | unsigned long size); | ||
20 | |||
21 | extern unsigned int txx9_master_clock; | ||
22 | extern unsigned int txx9_cpu_clock; | ||
23 | extern unsigned int txx9_gbus_clock; | ||
24 | #define TXX9_IMCLK (txx9_gbus_clock / 2) | ||
25 | |||
26 | extern int txx9_ccfg_toeon; | ||
27 | struct uart_port; | ||
28 | int early_serial_txx9_setup(struct uart_port *port); | ||
29 | |||
30 | struct pci_dev; | ||
31 | struct txx9_board_vec { | ||
32 | const char *system; | ||
33 | void (*prom_init)(void); | ||
34 | void (*mem_setup)(void); | ||
35 | void (*irq_setup)(void); | ||
36 | void (*time_init)(void); | ||
37 | void (*arch_init)(void); | ||
38 | void (*device_init)(void); | ||
39 | #ifdef CONFIG_PCI | ||
40 | int (*pci_map_irq)(const struct pci_dev *dev, u8 slot, u8 pin); | ||
41 | #endif | ||
42 | }; | ||
43 | extern struct txx9_board_vec *txx9_board_vec; | ||
44 | extern int (*txx9_irq_dispatch)(int pending); | ||
45 | char *prom_getcmdline(void); | ||
46 | const char *prom_getenv(const char *name); | ||
47 | void txx9_wdt_init(unsigned long base); | ||
48 | void txx9_wdt_now(unsigned long base); | ||
49 | void txx9_spi_init(int busid, unsigned long base, int irq); | ||
50 | void txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr); | ||
51 | void txx9_sio_init(unsigned long baseaddr, int irq, | ||
52 | unsigned int line, unsigned int sclk, int nocts); | ||
53 | void prom_putchar(char c); | ||
54 | #ifdef CONFIG_EARLY_PRINTK | ||
55 | extern void (*txx9_prom_putchar)(char c); | ||
56 | void txx9_sio_putchar_init(unsigned long baseaddr); | ||
57 | #else | ||
58 | static inline void txx9_sio_putchar_init(unsigned long baseaddr) | ||
59 | { | ||
60 | } | ||
61 | #endif | ||
62 | |||
63 | struct physmap_flash_data; | ||
64 | void txx9_physmap_flash_init(int no, unsigned long addr, unsigned long size, | ||
65 | const struct physmap_flash_data *pdata); | ||
66 | |||
67 | /* 8 bit version of __fls(): find first bit set (returns 0..7) */ | ||
68 | static inline unsigned int __fls8(unsigned char x) | ||
69 | { | ||
70 | int r = 7; | ||
71 | |||
72 | if (!(x & 0xf0)) { | ||
73 | r -= 4; | ||
74 | x <<= 4; | ||
75 | } | ||
76 | if (!(x & 0xc0)) { | ||
77 | r -= 2; | ||
78 | x <<= 2; | ||
79 | } | ||
80 | if (!(x & 0x80)) | ||
81 | r -= 1; | ||
82 | return r; | ||
83 | } | ||
84 | |||
85 | void txx9_iocled_init(unsigned long baseaddr, | ||
86 | int basenum, unsigned int num, int lowactive, | ||
87 | const char *color, char **deftriggers); | ||
88 | |||
89 | #endif /* __ASM_TXX9_GENERIC_H */ | ||
diff --git a/include/asm-mips/txx9/jmr3927.h b/include/asm-mips/txx9/jmr3927.h deleted file mode 100644 index a409c446bf18..000000000000 --- a/include/asm-mips/txx9/jmr3927.h +++ /dev/null | |||
@@ -1,180 +0,0 @@ | |||
1 | /* | ||
2 | * Defines for the TJSYS JMR-TX3927 | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2000-2001 Toshiba Corporation | ||
9 | */ | ||
10 | #ifndef __ASM_TXX9_JMR3927_H | ||
11 | #define __ASM_TXX9_JMR3927_H | ||
12 | |||
13 | #include <asm/txx9/tx3927.h> | ||
14 | #include <asm/addrspace.h> | ||
15 | #include <asm/system.h> | ||
16 | #include <asm/txx9irq.h> | ||
17 | |||
18 | /* CS */ | ||
19 | #define JMR3927_ROMCE0 0x1fc00000 /* 4M */ | ||
20 | #define JMR3927_ROMCE1 0x1e000000 /* 4M */ | ||
21 | #define JMR3927_ROMCE2 0x14000000 /* 16M */ | ||
22 | #define JMR3927_ROMCE3 0x10000000 /* 64M */ | ||
23 | #define JMR3927_ROMCE5 0x1d000000 /* 4M */ | ||
24 | #define JMR3927_SDCS0 0x00000000 /* 32M */ | ||
25 | #define JMR3927_SDCS1 0x02000000 /* 32M */ | ||
26 | /* PCI Direct Mappings */ | ||
27 | |||
28 | #define JMR3927_PCIMEM 0x08000000 | ||
29 | #define JMR3927_PCIMEM_SIZE 0x08000000 /* 128M */ | ||
30 | #define JMR3927_PCIIO 0x15000000 | ||
31 | #define JMR3927_PCIIO_SIZE 0x01000000 /* 16M */ | ||
32 | |||
33 | #define JMR3927_SDRAM_SIZE 0x02000000 /* 32M */ | ||
34 | #define JMR3927_PORT_BASE KSEG1 | ||
35 | |||
36 | /* Address map (virtual address) */ | ||
37 | #define JMR3927_ROM0_BASE (KSEG1 + JMR3927_ROMCE0) | ||
38 | #define JMR3927_ROM1_BASE (KSEG1 + JMR3927_ROMCE1) | ||
39 | #define JMR3927_IOC_BASE (KSEG1 + JMR3927_ROMCE2) | ||
40 | #define JMR3927_PCIMEM_BASE (KSEG1 + JMR3927_PCIMEM) | ||
41 | #define JMR3927_PCIIO_BASE (KSEG1 + JMR3927_PCIIO) | ||
42 | |||
43 | #define JMR3927_IOC_REV_ADDR (JMR3927_IOC_BASE + 0x00000000) | ||
44 | #define JMR3927_IOC_NVRAMB_ADDR (JMR3927_IOC_BASE + 0x00010000) | ||
45 | #define JMR3927_IOC_LED_ADDR (JMR3927_IOC_BASE + 0x00020000) | ||
46 | #define JMR3927_IOC_DIPSW_ADDR (JMR3927_IOC_BASE + 0x00030000) | ||
47 | #define JMR3927_IOC_BREV_ADDR (JMR3927_IOC_BASE + 0x00040000) | ||
48 | #define JMR3927_IOC_DTR_ADDR (JMR3927_IOC_BASE + 0x00050000) | ||
49 | #define JMR3927_IOC_INTS1_ADDR (JMR3927_IOC_BASE + 0x00080000) | ||
50 | #define JMR3927_IOC_INTS2_ADDR (JMR3927_IOC_BASE + 0x00090000) | ||
51 | #define JMR3927_IOC_INTM_ADDR (JMR3927_IOC_BASE + 0x000a0000) | ||
52 | #define JMR3927_IOC_INTP_ADDR (JMR3927_IOC_BASE + 0x000b0000) | ||
53 | #define JMR3927_IOC_RESET_ADDR (JMR3927_IOC_BASE + 0x000f0000) | ||
54 | |||
55 | /* Flash ROM */ | ||
56 | #define JMR3927_FLASH_BASE (JMR3927_ROM0_BASE) | ||
57 | #define JMR3927_FLASH_SIZE 0x00400000 | ||
58 | |||
59 | /* bits for IOC_REV/IOC_BREV (high byte) */ | ||
60 | #define JMR3927_IDT_MASK 0xfc | ||
61 | #define JMR3927_REV_MASK 0x03 | ||
62 | #define JMR3927_IOC_IDT 0xe0 | ||
63 | |||
64 | /* bits for IOC_INTS1/IOC_INTS2/IOC_INTM/IOC_INTP (high byte) */ | ||
65 | #define JMR3927_IOC_INTB_PCIA 0 | ||
66 | #define JMR3927_IOC_INTB_PCIB 1 | ||
67 | #define JMR3927_IOC_INTB_PCIC 2 | ||
68 | #define JMR3927_IOC_INTB_PCID 3 | ||
69 | #define JMR3927_IOC_INTB_MODEM 4 | ||
70 | #define JMR3927_IOC_INTB_INT6 5 | ||
71 | #define JMR3927_IOC_INTB_INT7 6 | ||
72 | #define JMR3927_IOC_INTB_SOFT 7 | ||
73 | #define JMR3927_IOC_INTF_PCIA (1 << JMR3927_IOC_INTF_PCIA) | ||
74 | #define JMR3927_IOC_INTF_PCIB (1 << JMR3927_IOC_INTB_PCIB) | ||
75 | #define JMR3927_IOC_INTF_PCIC (1 << JMR3927_IOC_INTB_PCIC) | ||
76 | #define JMR3927_IOC_INTF_PCID (1 << JMR3927_IOC_INTB_PCID) | ||
77 | #define JMR3927_IOC_INTF_MODEM (1 << JMR3927_IOC_INTB_MODEM) | ||
78 | #define JMR3927_IOC_INTF_INT6 (1 << JMR3927_IOC_INTB_INT6) | ||
79 | #define JMR3927_IOC_INTF_INT7 (1 << JMR3927_IOC_INTB_INT7) | ||
80 | #define JMR3927_IOC_INTF_SOFT (1 << JMR3927_IOC_INTB_SOFT) | ||
81 | |||
82 | /* bits for IOC_RESET (high byte) */ | ||
83 | #define JMR3927_IOC_RESET_CPU 1 | ||
84 | #define JMR3927_IOC_RESET_PCI 2 | ||
85 | |||
86 | #if defined(__BIG_ENDIAN) | ||
87 | #define jmr3927_ioc_reg_out(d, a) ((*(volatile unsigned char *)(a)) = (d)) | ||
88 | #define jmr3927_ioc_reg_in(a) (*(volatile unsigned char *)(a)) | ||
89 | #elif defined(__LITTLE_ENDIAN) | ||
90 | #define jmr3927_ioc_reg_out(d, a) ((*(volatile unsigned char *)((a)^1)) = (d)) | ||
91 | #define jmr3927_ioc_reg_in(a) (*(volatile unsigned char *)((a)^1)) | ||
92 | #else | ||
93 | #error "No Endian" | ||
94 | #endif | ||
95 | |||
96 | /* LED macro */ | ||
97 | #define jmr3927_led_set(n/*0-16*/) jmr3927_ioc_reg_out(~(n), JMR3927_IOC_LED_ADDR) | ||
98 | |||
99 | #define jmr3927_led_and_set(n/*0-16*/) jmr3927_ioc_reg_out((~(n)) & jmr3927_ioc_reg_in(JMR3927_IOC_LED_ADDR), JMR3927_IOC_LED_ADDR) | ||
100 | |||
101 | /* DIPSW4 macro */ | ||
102 | #define jmr3927_dipsw1() (gpio_get_value(11) == 0) | ||
103 | #define jmr3927_dipsw2() (gpio_get_value(10) == 0) | ||
104 | #define jmr3927_dipsw3() ((jmr3927_ioc_reg_in(JMR3927_IOC_DIPSW_ADDR) & 2) == 0) | ||
105 | #define jmr3927_dipsw4() ((jmr3927_ioc_reg_in(JMR3927_IOC_DIPSW_ADDR) & 1) == 0) | ||
106 | |||
107 | /* | ||
108 | * IRQ mappings | ||
109 | */ | ||
110 | |||
111 | /* These are the virtual IRQ numbers, we divide all IRQ's into | ||
112 | * 'spaces', the 'space' determines where and how to enable/disable | ||
113 | * that particular IRQ on an JMR machine. Add new 'spaces' as new | ||
114 | * IRQ hardware is supported. | ||
115 | */ | ||
116 | #define JMR3927_NR_IRQ_IRC 16 /* On-Chip IRC */ | ||
117 | #define JMR3927_NR_IRQ_IOC 8 /* PCI/MODEM/INT[6:7] */ | ||
118 | |||
119 | #define JMR3927_IRQ_IRC TXX9_IRQ_BASE | ||
120 | #define JMR3927_IRQ_IOC (JMR3927_IRQ_IRC + JMR3927_NR_IRQ_IRC) | ||
121 | #define JMR3927_IRQ_END (JMR3927_IRQ_IOC + JMR3927_NR_IRQ_IOC) | ||
122 | |||
123 | #define JMR3927_IRQ_IRC_INT0 (JMR3927_IRQ_IRC + TX3927_IR_INT0) | ||
124 | #define JMR3927_IRQ_IRC_INT1 (JMR3927_IRQ_IRC + TX3927_IR_INT1) | ||
125 | #define JMR3927_IRQ_IRC_INT2 (JMR3927_IRQ_IRC + TX3927_IR_INT2) | ||
126 | #define JMR3927_IRQ_IRC_INT3 (JMR3927_IRQ_IRC + TX3927_IR_INT3) | ||
127 | #define JMR3927_IRQ_IRC_INT4 (JMR3927_IRQ_IRC + TX3927_IR_INT4) | ||
128 | #define JMR3927_IRQ_IRC_INT5 (JMR3927_IRQ_IRC + TX3927_IR_INT5) | ||
129 | #define JMR3927_IRQ_IRC_SIO0 (JMR3927_IRQ_IRC + TX3927_IR_SIO0) | ||
130 | #define JMR3927_IRQ_IRC_SIO1 (JMR3927_IRQ_IRC + TX3927_IR_SIO1) | ||
131 | #define JMR3927_IRQ_IRC_SIO(ch) (JMR3927_IRQ_IRC + TX3927_IR_SIO(ch)) | ||
132 | #define JMR3927_IRQ_IRC_DMA (JMR3927_IRQ_IRC + TX3927_IR_DMA) | ||
133 | #define JMR3927_IRQ_IRC_PIO (JMR3927_IRQ_IRC + TX3927_IR_PIO) | ||
134 | #define JMR3927_IRQ_IRC_PCI (JMR3927_IRQ_IRC + TX3927_IR_PCI) | ||
135 | #define JMR3927_IRQ_IRC_TMR(ch) (JMR3927_IRQ_IRC + TX3927_IR_TMR(ch)) | ||
136 | #define JMR3927_IRQ_IOC_PCIA (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIA) | ||
137 | #define JMR3927_IRQ_IOC_PCIB (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIB) | ||
138 | #define JMR3927_IRQ_IOC_PCIC (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIC) | ||
139 | #define JMR3927_IRQ_IOC_PCID (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCID) | ||
140 | #define JMR3927_IRQ_IOC_MODEM (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_MODEM) | ||
141 | #define JMR3927_IRQ_IOC_INT6 (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_INT6) | ||
142 | #define JMR3927_IRQ_IOC_INT7 (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_INT7) | ||
143 | #define JMR3927_IRQ_IOC_SOFT (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_SOFT) | ||
144 | |||
145 | /* IOC (PCI, MODEM) */ | ||
146 | #define JMR3927_IRQ_IOCINT JMR3927_IRQ_IRC_INT1 | ||
147 | /* TC35815 100M Ether (JMR-TX3912:JPW4:2-3 Short) */ | ||
148 | #define JMR3927_IRQ_ETHER0 JMR3927_IRQ_IRC_INT3 | ||
149 | |||
150 | /* Clocks */ | ||
151 | #define JMR3927_CORECLK 132710400 /* 132.7MHz */ | ||
152 | |||
153 | /* | ||
154 | * TX3927 Pin Configuration: | ||
155 | * | ||
156 | * PCFG bits Avail Dead | ||
157 | * SELSIO[1:0]:11 RXD[1:0], TXD[1:0] PIO[6:3] | ||
158 | * SELSIOC[0]:1 CTS[0], RTS[0] INT[5:4] | ||
159 | * SELSIOC[1]:0,SELDSF:0, GSDAO[0],GPCST[3] CTS[1], RTS[1],DSF, | ||
160 | * GDBGE* PIO[2:1] | ||
161 | * SELDMA[2]:1 DMAREQ[2],DMAACK[2] PIO[13:12] | ||
162 | * SELTMR[2:0]:000 TIMER[1:0] | ||
163 | * SELCS:0,SELDMA[1]:0 PIO[11;10] SDCS_CE[7:6], | ||
164 | * DMAREQ[1],DMAACK[1] | ||
165 | * SELDMA[0]:1 DMAREQ[0],DMAACK[0] PIO[9:8] | ||
166 | * SELDMA[3]:1 DMAREQ[3],DMAACK[3] PIO[15:14] | ||
167 | * SELDONE:1 DMADONE PIO[7] | ||
168 | * | ||
169 | * Usable pins are: | ||
170 | * RXD[1;0],TXD[1:0],CTS[0],RTS[0], | ||
171 | * DMAREQ[0,2,3],DMAACK[0,2,3],DMADONE,PIO[0,10,11] | ||
172 | * INT[3:0] | ||
173 | */ | ||
174 | |||
175 | void jmr3927_prom_init(void); | ||
176 | void jmr3927_irq_setup(void); | ||
177 | struct pci_dev; | ||
178 | int jmr3927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); | ||
179 | |||
180 | #endif /* __ASM_TXX9_JMR3927_H */ | ||
diff --git a/include/asm-mips/txx9/pci.h b/include/asm-mips/txx9/pci.h deleted file mode 100644 index 3d32529060aa..000000000000 --- a/include/asm-mips/txx9/pci.h +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | */ | ||
6 | #ifndef __ASM_TXX9_PCI_H | ||
7 | #define __ASM_TXX9_PCI_H | ||
8 | |||
9 | #include <linux/pci.h> | ||
10 | |||
11 | extern struct pci_controller txx9_primary_pcic; | ||
12 | struct pci_controller * | ||
13 | txx9_alloc_pci_controller(struct pci_controller *pcic, | ||
14 | unsigned long mem_base, unsigned long mem_size, | ||
15 | unsigned long io_base, unsigned long io_size); | ||
16 | |||
17 | int txx9_pci66_check(struct pci_controller *hose, int top_bus, | ||
18 | int current_bus); | ||
19 | extern int txx9_pci_mem_high __initdata; | ||
20 | |||
21 | extern int txx9_pci_option; | ||
22 | #define TXX9_PCI_OPT_PICMG 0x0002 | ||
23 | #define TXX9_PCI_OPT_CLK_33 0x0008 | ||
24 | #define TXX9_PCI_OPT_CLK_66 0x0010 | ||
25 | #define TXX9_PCI_OPT_CLK_MASK \ | ||
26 | (TXX9_PCI_OPT_CLK_33 | TXX9_PCI_OPT_CLK_66) | ||
27 | #define TXX9_PCI_OPT_CLK_AUTO TXX9_PCI_OPT_CLK_MASK | ||
28 | |||
29 | enum txx9_pci_err_action { | ||
30 | TXX9_PCI_ERR_REPORT, | ||
31 | TXX9_PCI_ERR_IGNORE, | ||
32 | TXX9_PCI_ERR_PANIC, | ||
33 | }; | ||
34 | extern enum txx9_pci_err_action txx9_pci_err_action; | ||
35 | |||
36 | extern char * (*txx9_board_pcibios_setup)(char *str); | ||
37 | char *txx9_pcibios_setup(char *str); | ||
38 | |||
39 | #endif /* __ASM_TXX9_PCI_H */ | ||
diff --git a/include/asm-mips/txx9/rbtx4927.h b/include/asm-mips/txx9/rbtx4927.h deleted file mode 100644 index b2adab3d1acc..000000000000 --- a/include/asm-mips/txx9/rbtx4927.h +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | /* | ||
2 | * Author: MontaVista Software, Inc. | ||
3 | * source@mvista.com | ||
4 | * | ||
5 | * Copyright 2001-2002 MontaVista Software Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
13 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
14 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
15 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | ||
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | ||
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | ||
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License along | ||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | */ | ||
27 | #ifndef __ASM_TXX9_RBTX4927_H | ||
28 | #define __ASM_TXX9_RBTX4927_H | ||
29 | |||
30 | #include <asm/txx9/tx4927.h> | ||
31 | |||
32 | #define RBTX4927_PCIMEM 0x08000000 | ||
33 | #define RBTX4927_PCIMEM_SIZE 0x08000000 | ||
34 | #define RBTX4927_PCIIO 0x16000000 | ||
35 | #define RBTX4927_PCIIO_SIZE 0x01000000 | ||
36 | |||
37 | #define RBTX4927_LED_ADDR (IO_BASE + TXX9_CE(2) + 0x00001000) | ||
38 | #define RBTX4927_IMASK_ADDR (IO_BASE + TXX9_CE(2) + 0x00002000) | ||
39 | #define RBTX4927_IMSTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x00002006) | ||
40 | #define RBTX4927_SOFTINT_ADDR (IO_BASE + TXX9_CE(2) + 0x00003000) | ||
41 | #define RBTX4927_SOFTRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x0000f000) | ||
42 | #define RBTX4927_SOFTRESETLOCK_ADDR (IO_BASE + TXX9_CE(2) + 0x0000f002) | ||
43 | #define RBTX4927_PCIRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x0000f006) | ||
44 | #define RBTX4927_BRAMRTC_BASE (IO_BASE + TXX9_CE(2) + 0x00010000) | ||
45 | #define RBTX4927_ETHER_BASE (IO_BASE + TXX9_CE(2) + 0x00020000) | ||
46 | |||
47 | /* Ethernet port address */ | ||
48 | #define RBTX4927_ETHER_ADDR (RBTX4927_ETHER_BASE + 0x280) | ||
49 | |||
50 | #define rbtx4927_imask_addr ((__u8 __iomem *)RBTX4927_IMASK_ADDR) | ||
51 | #define rbtx4927_imstat_addr ((__u8 __iomem *)RBTX4927_IMSTAT_ADDR) | ||
52 | #define rbtx4927_softint_addr ((__u8 __iomem *)RBTX4927_SOFTINT_ADDR) | ||
53 | #define rbtx4927_softreset_addr ((__u8 __iomem *)RBTX4927_SOFTRESET_ADDR) | ||
54 | #define rbtx4927_softresetlock_addr \ | ||
55 | ((__u8 __iomem *)RBTX4927_SOFTRESETLOCK_ADDR) | ||
56 | #define rbtx4927_pcireset_addr ((__u8 __iomem *)RBTX4927_PCIRESET_ADDR) | ||
57 | |||
58 | /* bits for ISTAT/IMASK/IMSTAT */ | ||
59 | #define RBTX4927_INTB_PCID 0 | ||
60 | #define RBTX4927_INTB_PCIC 1 | ||
61 | #define RBTX4927_INTB_PCIB 2 | ||
62 | #define RBTX4927_INTB_PCIA 3 | ||
63 | #define RBTX4927_INTF_PCID (1 << RBTX4927_INTB_PCID) | ||
64 | #define RBTX4927_INTF_PCIC (1 << RBTX4927_INTB_PCIC) | ||
65 | #define RBTX4927_INTF_PCIB (1 << RBTX4927_INTB_PCIB) | ||
66 | #define RBTX4927_INTF_PCIA (1 << RBTX4927_INTB_PCIA) | ||
67 | |||
68 | #define RBTX4927_NR_IRQ_IOC 8 /* IOC */ | ||
69 | |||
70 | #define RBTX4927_IRQ_IOC (TXX9_IRQ_BASE + TX4927_NUM_IR) | ||
71 | #define RBTX4927_IRQ_IOC_PCID (RBTX4927_IRQ_IOC + RBTX4927_INTB_PCID) | ||
72 | #define RBTX4927_IRQ_IOC_PCIC (RBTX4927_IRQ_IOC + RBTX4927_INTB_PCIC) | ||
73 | #define RBTX4927_IRQ_IOC_PCIB (RBTX4927_IRQ_IOC + RBTX4927_INTB_PCIB) | ||
74 | #define RBTX4927_IRQ_IOC_PCIA (RBTX4927_IRQ_IOC + RBTX4927_INTB_PCIA) | ||
75 | |||
76 | #define RBTX4927_IRQ_IOCINT (TXX9_IRQ_BASE + TX4927_IR_INT(1)) | ||
77 | |||
78 | #ifdef CONFIG_PCI | ||
79 | #define RBTX4927_ISA_IO_OFFSET RBTX4927_PCIIO | ||
80 | #else | ||
81 | #define RBTX4927_ISA_IO_OFFSET 0 | ||
82 | #endif | ||
83 | |||
84 | #define RBTX4927_RTL_8019_BASE (RBTX4927_ETHER_ADDR - mips_io_port_base) | ||
85 | #define RBTX4927_RTL_8019_IRQ (TXX9_IRQ_BASE + TX4927_IR_INT(3)) | ||
86 | |||
87 | void rbtx4927_prom_init(void); | ||
88 | void rbtx4927_irq_setup(void); | ||
89 | struct pci_dev; | ||
90 | int rbtx4927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); | ||
91 | |||
92 | #endif /* __ASM_TXX9_RBTX4927_H */ | ||
diff --git a/include/asm-mips/txx9/rbtx4938.h b/include/asm-mips/txx9/rbtx4938.h deleted file mode 100644 index 9f0441a28126..000000000000 --- a/include/asm-mips/txx9/rbtx4938.h +++ /dev/null | |||
@@ -1,145 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for TX4937/TX4938 | ||
3 | * | ||
4 | * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the | ||
5 | * terms of the GNU General Public License version 2. This program is | ||
6 | * licensed "as is" without any warranty of any kind, whether express | ||
7 | * or implied. | ||
8 | * | ||
9 | * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) | ||
10 | */ | ||
11 | #ifndef __ASM_TXX9_RBTX4938_H | ||
12 | #define __ASM_TXX9_RBTX4938_H | ||
13 | |||
14 | #include <asm/addrspace.h> | ||
15 | #include <asm/txx9irq.h> | ||
16 | #include <asm/txx9/tx4938.h> | ||
17 | |||
18 | /* Address map */ | ||
19 | #define RBTX4938_FPGA_REG_ADDR (IO_BASE + TXX9_CE(2) + 0x00000000) | ||
20 | #define RBTX4938_FPGA_REV_ADDR (IO_BASE + TXX9_CE(2) + 0x00000002) | ||
21 | #define RBTX4938_CONFIG1_ADDR (IO_BASE + TXX9_CE(2) + 0x00000004) | ||
22 | #define RBTX4938_CONFIG2_ADDR (IO_BASE + TXX9_CE(2) + 0x00000006) | ||
23 | #define RBTX4938_CONFIG3_ADDR (IO_BASE + TXX9_CE(2) + 0x00000008) | ||
24 | #define RBTX4938_LED_ADDR (IO_BASE + TXX9_CE(2) + 0x00001000) | ||
25 | #define RBTX4938_DIPSW_ADDR (IO_BASE + TXX9_CE(2) + 0x00001002) | ||
26 | #define RBTX4938_BDIPSW_ADDR (IO_BASE + TXX9_CE(2) + 0x00001004) | ||
27 | #define RBTX4938_IMASK_ADDR (IO_BASE + TXX9_CE(2) + 0x00002000) | ||
28 | #define RBTX4938_IMASK2_ADDR (IO_BASE + TXX9_CE(2) + 0x00002002) | ||
29 | #define RBTX4938_INTPOL_ADDR (IO_BASE + TXX9_CE(2) + 0x00002004) | ||
30 | #define RBTX4938_ISTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x00002006) | ||
31 | #define RBTX4938_ISTAT2_ADDR (IO_BASE + TXX9_CE(2) + 0x00002008) | ||
32 | #define RBTX4938_IMSTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x0000200a) | ||
33 | #define RBTX4938_IMSTAT2_ADDR (IO_BASE + TXX9_CE(2) + 0x0000200c) | ||
34 | #define RBTX4938_SOFTINT_ADDR (IO_BASE + TXX9_CE(2) + 0x00003000) | ||
35 | #define RBTX4938_PIOSEL_ADDR (IO_BASE + TXX9_CE(2) + 0x00005000) | ||
36 | #define RBTX4938_SPICS_ADDR (IO_BASE + TXX9_CE(2) + 0x00005002) | ||
37 | #define RBTX4938_SFPWR_ADDR (IO_BASE + TXX9_CE(2) + 0x00005008) | ||
38 | #define RBTX4938_SFVOL_ADDR (IO_BASE + TXX9_CE(2) + 0x0000500a) | ||
39 | #define RBTX4938_SOFTRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x00007000) | ||
40 | #define RBTX4938_SOFTRESETLOCK_ADDR (IO_BASE + TXX9_CE(2) + 0x00007002) | ||
41 | #define RBTX4938_PCIRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x00007004) | ||
42 | #define RBTX4938_ETHER_BASE (IO_BASE + TXX9_CE(2) + 0x00020000) | ||
43 | |||
44 | /* Ethernet port address (Jumperless Mode (W12:Open)) */ | ||
45 | #define RBTX4938_ETHER_ADDR (RBTX4938_ETHER_BASE + 0x280) | ||
46 | |||
47 | /* bits for ISTAT/IMASK/IMSTAT */ | ||
48 | #define RBTX4938_INTB_PCID 0 | ||
49 | #define RBTX4938_INTB_PCIC 1 | ||
50 | #define RBTX4938_INTB_PCIB 2 | ||
51 | #define RBTX4938_INTB_PCIA 3 | ||
52 | #define RBTX4938_INTB_RTC 4 | ||
53 | #define RBTX4938_INTB_ATA 5 | ||
54 | #define RBTX4938_INTB_MODEM 6 | ||
55 | #define RBTX4938_INTB_SWINT 7 | ||
56 | #define RBTX4938_INTF_PCID (1 << RBTX4938_INTB_PCID) | ||
57 | #define RBTX4938_INTF_PCIC (1 << RBTX4938_INTB_PCIC) | ||
58 | #define RBTX4938_INTF_PCIB (1 << RBTX4938_INTB_PCIB) | ||
59 | #define RBTX4938_INTF_PCIA (1 << RBTX4938_INTB_PCIA) | ||
60 | #define RBTX4938_INTF_RTC (1 << RBTX4938_INTB_RTC) | ||
61 | #define RBTX4938_INTF_ATA (1 << RBTX4938_INTB_ATA) | ||
62 | #define RBTX4938_INTF_MODEM (1 << RBTX4938_INTB_MODEM) | ||
63 | #define RBTX4938_INTF_SWINT (1 << RBTX4938_INTB_SWINT) | ||
64 | |||
65 | #define rbtx4938_fpga_rev_addr ((__u8 __iomem *)RBTX4938_FPGA_REV_ADDR) | ||
66 | #define rbtx4938_led_addr ((__u8 __iomem *)RBTX4938_LED_ADDR) | ||
67 | #define rbtx4938_dipsw_addr ((__u8 __iomem *)RBTX4938_DIPSW_ADDR) | ||
68 | #define rbtx4938_bdipsw_addr ((__u8 __iomem *)RBTX4938_BDIPSW_ADDR) | ||
69 | #define rbtx4938_imask_addr ((__u8 __iomem *)RBTX4938_IMASK_ADDR) | ||
70 | #define rbtx4938_imask2_addr ((__u8 __iomem *)RBTX4938_IMASK2_ADDR) | ||
71 | #define rbtx4938_intpol_addr ((__u8 __iomem *)RBTX4938_INTPOL_ADDR) | ||
72 | #define rbtx4938_istat_addr ((__u8 __iomem *)RBTX4938_ISTAT_ADDR) | ||
73 | #define rbtx4938_istat2_addr ((__u8 __iomem *)RBTX4938_ISTAT2_ADDR) | ||
74 | #define rbtx4938_imstat_addr ((__u8 __iomem *)RBTX4938_IMSTAT_ADDR) | ||
75 | #define rbtx4938_imstat2_addr ((__u8 __iomem *)RBTX4938_IMSTAT2_ADDR) | ||
76 | #define rbtx4938_softint_addr ((__u8 __iomem *)RBTX4938_SOFTINT_ADDR) | ||
77 | #define rbtx4938_piosel_addr ((__u8 __iomem *)RBTX4938_PIOSEL_ADDR) | ||
78 | #define rbtx4938_spics_addr ((__u8 __iomem *)RBTX4938_SPICS_ADDR) | ||
79 | #define rbtx4938_sfpwr_addr ((__u8 __iomem *)RBTX4938_SFPWR_ADDR) | ||
80 | #define rbtx4938_sfvol_addr ((__u8 __iomem *)RBTX4938_SFVOL_ADDR) | ||
81 | #define rbtx4938_softreset_addr ((__u8 __iomem *)RBTX4938_SOFTRESET_ADDR) | ||
82 | #define rbtx4938_softresetlock_addr \ | ||
83 | ((__u8 __iomem *)RBTX4938_SOFTRESETLOCK_ADDR) | ||
84 | #define rbtx4938_pcireset_addr ((__u8 __iomem *)RBTX4938_PCIRESET_ADDR) | ||
85 | |||
86 | /* | ||
87 | * IRQ mappings | ||
88 | */ | ||
89 | |||
90 | #define RBTX4938_SOFT_INT0 0 /* not used */ | ||
91 | #define RBTX4938_SOFT_INT1 1 /* not used */ | ||
92 | #define RBTX4938_IRC_INT 2 | ||
93 | #define RBTX4938_TIMER_INT 7 | ||
94 | |||
95 | /* These are the virtual IRQ numbers, we divide all IRQ's into | ||
96 | * 'spaces', the 'space' determines where and how to enable/disable | ||
97 | * that particular IRQ on an RBTX4938 machine. Add new 'spaces' as new | ||
98 | * IRQ hardware is supported. | ||
99 | */ | ||
100 | #define RBTX4938_NR_IRQ_IOC 8 | ||
101 | |||
102 | #define RBTX4938_IRQ_IRC TXX9_IRQ_BASE | ||
103 | #define RBTX4938_IRQ_IOC (TXX9_IRQ_BASE + TX4938_NUM_IR) | ||
104 | #define RBTX4938_IRQ_END (RBTX4938_IRQ_IOC + RBTX4938_NR_IRQ_IOC) | ||
105 | |||
106 | #define RBTX4938_IRQ_IRC_ECCERR (RBTX4938_IRQ_IRC + TX4938_IR_ECCERR) | ||
107 | #define RBTX4938_IRQ_IRC_WTOERR (RBTX4938_IRQ_IRC + TX4938_IR_WTOERR) | ||
108 | #define RBTX4938_IRQ_IRC_INT(n) (RBTX4938_IRQ_IRC + TX4938_IR_INT(n)) | ||
109 | #define RBTX4938_IRQ_IRC_SIO(n) (RBTX4938_IRQ_IRC + TX4938_IR_SIO(n)) | ||
110 | #define RBTX4938_IRQ_IRC_DMA(ch, n) (RBTX4938_IRQ_IRC + TX4938_IR_DMA(ch, n)) | ||
111 | #define RBTX4938_IRQ_IRC_PIO (RBTX4938_IRQ_IRC + TX4938_IR_PIO) | ||
112 | #define RBTX4938_IRQ_IRC_PDMAC (RBTX4938_IRQ_IRC + TX4938_IR_PDMAC) | ||
113 | #define RBTX4938_IRQ_IRC_PCIC (RBTX4938_IRQ_IRC + TX4938_IR_PCIC) | ||
114 | #define RBTX4938_IRQ_IRC_TMR(n) (RBTX4938_IRQ_IRC + TX4938_IR_TMR(n)) | ||
115 | #define RBTX4938_IRQ_IRC_NDFMC (RBTX4938_IRQ_IRC + TX4938_IR_NDFMC) | ||
116 | #define RBTX4938_IRQ_IRC_PCIERR (RBTX4938_IRQ_IRC + TX4938_IR_PCIERR) | ||
117 | #define RBTX4938_IRQ_IRC_PCIPME (RBTX4938_IRQ_IRC + TX4938_IR_PCIPME) | ||
118 | #define RBTX4938_IRQ_IRC_ACLC (RBTX4938_IRQ_IRC + TX4938_IR_ACLC) | ||
119 | #define RBTX4938_IRQ_IRC_ACLCPME (RBTX4938_IRQ_IRC + TX4938_IR_ACLCPME) | ||
120 | #define RBTX4938_IRQ_IRC_PCIC1 (RBTX4938_IRQ_IRC + TX4938_IR_PCIC1) | ||
121 | #define RBTX4938_IRQ_IRC_SPI (RBTX4938_IRQ_IRC + TX4938_IR_SPI) | ||
122 | #define RBTX4938_IRQ_IOC_PCID (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCID) | ||
123 | #define RBTX4938_IRQ_IOC_PCIC (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIC) | ||
124 | #define RBTX4938_IRQ_IOC_PCIB (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIB) | ||
125 | #define RBTX4938_IRQ_IOC_PCIA (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIA) | ||
126 | #define RBTX4938_IRQ_IOC_RTC (RBTX4938_IRQ_IOC + RBTX4938_INTB_RTC) | ||
127 | #define RBTX4938_IRQ_IOC_ATA (RBTX4938_IRQ_IOC + RBTX4938_INTB_ATA) | ||
128 | #define RBTX4938_IRQ_IOC_MODEM (RBTX4938_IRQ_IOC + RBTX4938_INTB_MODEM) | ||
129 | #define RBTX4938_IRQ_IOC_SWINT (RBTX4938_IRQ_IOC + RBTX4938_INTB_SWINT) | ||
130 | |||
131 | |||
132 | /* IOC (PCI, etc) */ | ||
133 | #define RBTX4938_IRQ_IOCINT (TXX9_IRQ_BASE + TX4938_IR_INT(0)) | ||
134 | /* Onboard 10M Ether */ | ||
135 | #define RBTX4938_IRQ_ETHER (TXX9_IRQ_BASE + TX4938_IR_INT(1)) | ||
136 | |||
137 | #define RBTX4938_RTL_8019_BASE (RBTX4938_ETHER_ADDR - mips_io_port_base) | ||
138 | #define RBTX4938_RTL_8019_IRQ (RBTX4938_IRQ_ETHER) | ||
139 | |||
140 | void rbtx4938_prom_init(void); | ||
141 | void rbtx4938_irq_setup(void); | ||
142 | struct pci_dev; | ||
143 | int rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); | ||
144 | |||
145 | #endif /* __ASM_TXX9_RBTX4938_H */ | ||
diff --git a/include/asm-mips/txx9/rbtx4939.h b/include/asm-mips/txx9/rbtx4939.h deleted file mode 100644 index 1acf428c0b4f..000000000000 --- a/include/asm-mips/txx9/rbtx4939.h +++ /dev/null | |||
@@ -1,133 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for RBTX4939 | ||
3 | * | ||
4 | * (C) Copyright TOSHIBA CORPORATION 2005-2006 | ||
5 | * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the | ||
6 | * terms of the GNU General Public License version 2. This program is | ||
7 | * licensed "as is" without any warranty of any kind, whether express | ||
8 | * or implied. | ||
9 | */ | ||
10 | #ifndef __ASM_TXX9_RBTX4939_H | ||
11 | #define __ASM_TXX9_RBTX4939_H | ||
12 | |||
13 | #include <asm/addrspace.h> | ||
14 | #include <asm/txx9irq.h> | ||
15 | #include <asm/txx9/generic.h> | ||
16 | #include <asm/txx9/tx4939.h> | ||
17 | |||
18 | /* Address map */ | ||
19 | #define RBTX4939_IOC_REG_ADDR (IO_BASE + TXX9_CE(1) + 0x00000000) | ||
20 | #define RBTX4939_BOARD_REV_ADDR (IO_BASE + TXX9_CE(1) + 0x00000000) | ||
21 | #define RBTX4939_IOC_REV_ADDR (IO_BASE + TXX9_CE(1) + 0x00000002) | ||
22 | #define RBTX4939_CONFIG1_ADDR (IO_BASE + TXX9_CE(1) + 0x00000004) | ||
23 | #define RBTX4939_CONFIG2_ADDR (IO_BASE + TXX9_CE(1) + 0x00000006) | ||
24 | #define RBTX4939_CONFIG3_ADDR (IO_BASE + TXX9_CE(1) + 0x00000008) | ||
25 | #define RBTX4939_CONFIG4_ADDR (IO_BASE + TXX9_CE(1) + 0x0000000a) | ||
26 | #define RBTX4939_USTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00001000) | ||
27 | #define RBTX4939_UDIPSW_ADDR (IO_BASE + TXX9_CE(1) + 0x00001002) | ||
28 | #define RBTX4939_BDIPSW_ADDR (IO_BASE + TXX9_CE(1) + 0x00001004) | ||
29 | #define RBTX4939_IEN_ADDR (IO_BASE + TXX9_CE(1) + 0x00002000) | ||
30 | #define RBTX4939_IPOL_ADDR (IO_BASE + TXX9_CE(1) + 0x00002002) | ||
31 | #define RBTX4939_IFAC1_ADDR (IO_BASE + TXX9_CE(1) + 0x00002004) | ||
32 | #define RBTX4939_IFAC2_ADDR (IO_BASE + TXX9_CE(1) + 0x00002006) | ||
33 | #define RBTX4939_SOFTINT_ADDR (IO_BASE + TXX9_CE(1) + 0x00003000) | ||
34 | #define RBTX4939_ISASTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00004000) | ||
35 | #define RBTX4939_PCISTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00004002) | ||
36 | #define RBTX4939_ROME_ADDR (IO_BASE + TXX9_CE(1) + 0x00004004) | ||
37 | #define RBTX4939_SPICS_ADDR (IO_BASE + TXX9_CE(1) + 0x00004006) | ||
38 | #define RBTX4939_AUDI_ADDR (IO_BASE + TXX9_CE(1) + 0x00004008) | ||
39 | #define RBTX4939_ISAGPIO_ADDR (IO_BASE + TXX9_CE(1) + 0x0000400a) | ||
40 | #define RBTX4939_PE1_ADDR (IO_BASE + TXX9_CE(1) + 0x00005000) | ||
41 | #define RBTX4939_PE2_ADDR (IO_BASE + TXX9_CE(1) + 0x00005002) | ||
42 | #define RBTX4939_PE3_ADDR (IO_BASE + TXX9_CE(1) + 0x00005004) | ||
43 | #define RBTX4939_VP_ADDR (IO_BASE + TXX9_CE(1) + 0x00005006) | ||
44 | #define RBTX4939_VPRESET_ADDR (IO_BASE + TXX9_CE(1) + 0x00005008) | ||
45 | #define RBTX4939_VPSOUT_ADDR (IO_BASE + TXX9_CE(1) + 0x0000500a) | ||
46 | #define RBTX4939_VPSIN_ADDR (IO_BASE + TXX9_CE(1) + 0x0000500c) | ||
47 | #define RBTX4939_7SEG_ADDR(s, ch) \ | ||
48 | (IO_BASE + TXX9_CE(1) + 0x00006000 + (s) * 16 + ((ch) & 3) * 2) | ||
49 | #define RBTX4939_SOFTRESET_ADDR (IO_BASE + TXX9_CE(1) + 0x00007000) | ||
50 | #define RBTX4939_RESETEN_ADDR (IO_BASE + TXX9_CE(1) + 0x00007002) | ||
51 | #define RBTX4939_RESETSTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00007004) | ||
52 | #define RBTX4939_ETHER_BASE (IO_BASE + TXX9_CE(1) + 0x00020000) | ||
53 | |||
54 | /* Ethernet port address */ | ||
55 | #define RBTX4939_ETHER_ADDR (RBTX4939_ETHER_BASE + 0x300) | ||
56 | |||
57 | /* bits for IEN/IPOL/IFAC */ | ||
58 | #define RBTX4938_INTB_ISA0 0 | ||
59 | #define RBTX4938_INTB_ISA11 1 | ||
60 | #define RBTX4938_INTB_ISA12 2 | ||
61 | #define RBTX4938_INTB_ISA15 3 | ||
62 | #define RBTX4938_INTB_I2S 4 | ||
63 | #define RBTX4938_INTB_SW 5 | ||
64 | #define RBTX4938_INTF_ISA0 (1 << RBTX4938_INTB_ISA0) | ||
65 | #define RBTX4938_INTF_ISA11 (1 << RBTX4938_INTB_ISA11) | ||
66 | #define RBTX4938_INTF_ISA12 (1 << RBTX4938_INTB_ISA12) | ||
67 | #define RBTX4938_INTF_ISA15 (1 << RBTX4938_INTB_ISA15) | ||
68 | #define RBTX4938_INTF_I2S (1 << RBTX4938_INTB_I2S) | ||
69 | #define RBTX4938_INTF_SW (1 << RBTX4938_INTB_SW) | ||
70 | |||
71 | /* bits for PE1,PE2,PE3 */ | ||
72 | #define RBTX4939_PE1_ATA(ch) (0x01 << (ch)) | ||
73 | #define RBTX4939_PE1_RMII(ch) (0x04 << (ch)) | ||
74 | #define RBTX4939_PE2_SIO0 0x01 | ||
75 | #define RBTX4939_PE2_SIO2 0x02 | ||
76 | #define RBTX4939_PE2_SIO3 0x04 | ||
77 | #define RBTX4939_PE2_CIR 0x08 | ||
78 | #define RBTX4939_PE2_SPI 0x10 | ||
79 | #define RBTX4939_PE2_GPIO 0x20 | ||
80 | #define RBTX4939_PE3_VP 0x01 | ||
81 | #define RBTX4939_PE3_VP_P 0x02 | ||
82 | #define RBTX4939_PE3_VP_S 0x04 | ||
83 | |||
84 | #define rbtx4939_board_rev_addr ((u8 __iomem *)RBTX4939_BOARD_REV_ADDR) | ||
85 | #define rbtx4939_ioc_rev_addr ((u8 __iomem *)RBTX4939_IOC_REV_ADDR) | ||
86 | #define rbtx4939_config1_addr ((u8 __iomem *)RBTX4939_CONFIG1_ADDR) | ||
87 | #define rbtx4939_config2_addr ((u8 __iomem *)RBTX4939_CONFIG2_ADDR) | ||
88 | #define rbtx4939_config3_addr ((u8 __iomem *)RBTX4939_CONFIG3_ADDR) | ||
89 | #define rbtx4939_config4_addr ((u8 __iomem *)RBTX4939_CONFIG4_ADDR) | ||
90 | #define rbtx4939_ustat_addr ((u8 __iomem *)RBTX4939_USTAT_ADDR) | ||
91 | #define rbtx4939_udipsw_addr ((u8 __iomem *)RBTX4939_UDIPSW_ADDR) | ||
92 | #define rbtx4939_bdipsw_addr ((u8 __iomem *)RBTX4939_BDIPSW_ADDR) | ||
93 | #define rbtx4939_ien_addr ((u8 __iomem *)RBTX4939_IEN_ADDR) | ||
94 | #define rbtx4939_ipol_addr ((u8 __iomem *)RBTX4939_IPOL_ADDR) | ||
95 | #define rbtx4939_ifac1_addr ((u8 __iomem *)RBTX4939_IFAC1_ADDR) | ||
96 | #define rbtx4939_ifac2_addr ((u8 __iomem *)RBTX4939_IFAC2_ADDR) | ||
97 | #define rbtx4939_softint_addr ((u8 __iomem *)RBTX4939_SOFTINT_ADDR) | ||
98 | #define rbtx4939_isastat_addr ((u8 __iomem *)RBTX4939_ISASTAT_ADDR) | ||
99 | #define rbtx4939_pcistat_addr ((u8 __iomem *)RBTX4939_PCISTAT_ADDR) | ||
100 | #define rbtx4939_rome_addr ((u8 __iomem *)RBTX4939_ROME_ADDR) | ||
101 | #define rbtx4939_spics_addr ((u8 __iomem *)RBTX4939_SPICS_ADDR) | ||
102 | #define rbtx4939_audi_addr ((u8 __iomem *)RBTX4939_AUDI_ADDR) | ||
103 | #define rbtx4939_isagpio_addr ((u8 __iomem *)RBTX4939_ISAGPIO_ADDR) | ||
104 | #define rbtx4939_pe1_addr ((u8 __iomem *)RBTX4939_PE1_ADDR) | ||
105 | #define rbtx4939_pe2_addr ((u8 __iomem *)RBTX4939_PE2_ADDR) | ||
106 | #define rbtx4939_pe3_addr ((u8 __iomem *)RBTX4939_PE3_ADDR) | ||
107 | #define rbtx4939_vp_addr ((u8 __iomem *)RBTX4939_VP_ADDR) | ||
108 | #define rbtx4939_vpreset_addr ((u8 __iomem *)RBTX4939_VPRESET_ADDR) | ||
109 | #define rbtx4939_vpsout_addr ((u8 __iomem *)RBTX4939_VPSOUT_ADDR) | ||
110 | #define rbtx4939_vpsin_addr ((u8 __iomem *)RBTX4939_VPSIN_ADDR) | ||
111 | #define rbtx4939_7seg_addr(s, ch) \ | ||
112 | ((u8 __iomem *)RBTX4939_7SEG_ADDR(s, ch)) | ||
113 | #define rbtx4939_softreset_addr ((u8 __iomem *)RBTX4939_SOFTRESET_ADDR) | ||
114 | #define rbtx4939_reseten_addr ((u8 __iomem *)RBTX4939_RESETEN_ADDR) | ||
115 | #define rbtx4939_resetstat_addr ((u8 __iomem *)RBTX4939_RESETSTAT_ADDR) | ||
116 | |||
117 | /* | ||
118 | * IRQ mappings | ||
119 | */ | ||
120 | #define RBTX4939_NR_IRQ_IOC 8 | ||
121 | |||
122 | #define RBTX4939_IRQ_IOC (TXX9_IRQ_BASE + TX4939_NUM_IR) | ||
123 | #define RBTX4939_IRQ_END (RBTX4939_IRQ_IOC + RBTX4939_NR_IRQ_IOC) | ||
124 | |||
125 | /* IOC (ISA, etc) */ | ||
126 | #define RBTX4939_IRQ_IOCINT (TXX9_IRQ_BASE + TX4939_IR_INT(0)) | ||
127 | /* Onboard 10M Ether */ | ||
128 | #define RBTX4939_IRQ_ETHER (TXX9_IRQ_BASE + TX4939_IR_INT(1)) | ||
129 | |||
130 | void rbtx4939_prom_init(void); | ||
131 | void rbtx4939_irq_setup(void); | ||
132 | |||
133 | #endif /* __ASM_TXX9_RBTX4939_H */ | ||
diff --git a/include/asm-mips/txx9/smsc_fdc37m81x.h b/include/asm-mips/txx9/smsc_fdc37m81x.h deleted file mode 100644 index d1d6332b4ca6..000000000000 --- a/include/asm-mips/txx9/smsc_fdc37m81x.h +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | /* | ||
2 | * Interface for smsc fdc48m81x Super IO chip | ||
3 | * | ||
4 | * Author: MontaVista Software, Inc. source@mvista.com | ||
5 | * | ||
6 | * 2001-2003 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | * | ||
11 | * Copyright (C) 2004 MontaVista Software Inc. | ||
12 | * Manish Lachwani, mlachwani@mvista.com | ||
13 | */ | ||
14 | |||
15 | #ifndef _SMSC_FDC37M81X_H_ | ||
16 | #define _SMSC_FDC37M81X_H_ | ||
17 | |||
18 | /* Common Registers */ | ||
19 | #define SMSC_FDC37M81X_CONFIG_INDEX 0x00 | ||
20 | #define SMSC_FDC37M81X_CONFIG_DATA 0x01 | ||
21 | #define SMSC_FDC37M81X_CONF 0x02 | ||
22 | #define SMSC_FDC37M81X_INDEX 0x03 | ||
23 | #define SMSC_FDC37M81X_DNUM 0x07 | ||
24 | #define SMSC_FDC37M81X_DID 0x20 | ||
25 | #define SMSC_FDC37M81X_DREV 0x21 | ||
26 | #define SMSC_FDC37M81X_PCNT 0x22 | ||
27 | #define SMSC_FDC37M81X_PMGT 0x23 | ||
28 | #define SMSC_FDC37M81X_OSC 0x24 | ||
29 | #define SMSC_FDC37M81X_CONFPA0 0x26 | ||
30 | #define SMSC_FDC37M81X_CONFPA1 0x27 | ||
31 | #define SMSC_FDC37M81X_TEST4 0x2B | ||
32 | #define SMSC_FDC37M81X_TEST5 0x2C | ||
33 | #define SMSC_FDC37M81X_TEST1 0x2D | ||
34 | #define SMSC_FDC37M81X_TEST2 0x2E | ||
35 | #define SMSC_FDC37M81X_TEST3 0x2F | ||
36 | |||
37 | /* Logical device numbers */ | ||
38 | #define SMSC_FDC37M81X_FDD 0x00 | ||
39 | #define SMSC_FDC37M81X_PARALLEL 0x03 | ||
40 | #define SMSC_FDC37M81X_SERIAL1 0x04 | ||
41 | #define SMSC_FDC37M81X_SERIAL2 0x05 | ||
42 | #define SMSC_FDC37M81X_KBD 0x07 | ||
43 | #define SMSC_FDC37M81X_AUXIO 0x08 | ||
44 | #define SMSC_FDC37M81X_NONE 0xff | ||
45 | |||
46 | /* Logical device Config Registers */ | ||
47 | #define SMSC_FDC37M81X_ACTIVE 0x30 | ||
48 | #define SMSC_FDC37M81X_BASEADDR0 0x60 | ||
49 | #define SMSC_FDC37M81X_BASEADDR1 0x61 | ||
50 | #define SMSC_FDC37M81X_INT 0x70 | ||
51 | #define SMSC_FDC37M81X_INT2 0x72 | ||
52 | #define SMSC_FDC37M81X_LDCR_F0 0xF0 | ||
53 | |||
54 | /* Chip Config Values */ | ||
55 | #define SMSC_FDC37M81X_CONFIG_ENTER 0x55 | ||
56 | #define SMSC_FDC37M81X_CONFIG_EXIT 0xaa | ||
57 | #define SMSC_FDC37M81X_CHIP_ID 0x4d | ||
58 | |||
59 | unsigned long smsc_fdc37m81x_init(unsigned long port); | ||
60 | |||
61 | void smsc_fdc37m81x_config_beg(void); | ||
62 | |||
63 | void smsc_fdc37m81x_config_end(void); | ||
64 | |||
65 | u8 smsc_fdc37m81x_config_get(u8 reg); | ||
66 | void smsc_fdc37m81x_config_set(u8 reg, u8 val); | ||
67 | |||
68 | #endif | ||
diff --git a/include/asm-mips/txx9/spi.h b/include/asm-mips/txx9/spi.h deleted file mode 100644 index 0d727f354557..000000000000 --- a/include/asm-mips/txx9/spi.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for TX4937/TX4938 SPI | ||
3 | * | ||
4 | * Copyright (C) 2000-2001 Toshiba Corporation | ||
5 | * | ||
6 | * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the | ||
7 | * terms of the GNU General Public License version 2. This program is | ||
8 | * licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | * | ||
11 | * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) | ||
12 | */ | ||
13 | #ifndef __ASM_TXX9_SPI_H | ||
14 | #define __ASM_TXX9_SPI_H | ||
15 | |||
16 | #include <linux/errno.h> | ||
17 | |||
18 | #ifdef CONFIG_SPI | ||
19 | int spi_eeprom_register(int busid, int chipid, int size); | ||
20 | int spi_eeprom_read(int busid, int chipid, | ||
21 | int address, unsigned char *buf, int len); | ||
22 | #else | ||
23 | static inline int spi_eeprom_register(int busid, int chipid, int size) | ||
24 | { | ||
25 | return -ENODEV; | ||
26 | } | ||
27 | static inline int spi_eeprom_read(int busid, int chipid, | ||
28 | int address, unsigned char *buf, int len) | ||
29 | { | ||
30 | return -ENODEV; | ||
31 | } | ||
32 | #endif | ||
33 | |||
34 | #endif /* __ASM_TXX9_SPI_H */ | ||
diff --git a/include/asm-mips/txx9/tx3927.h b/include/asm-mips/txx9/tx3927.h deleted file mode 100644 index dc30c8d42061..000000000000 --- a/include/asm-mips/txx9/tx3927.h +++ /dev/null | |||
@@ -1,341 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000 Toshiba Corporation | ||
7 | */ | ||
8 | #ifndef __ASM_TXX9_TX3927_H | ||
9 | #define __ASM_TXX9_TX3927_H | ||
10 | |||
11 | #define TX3927_REG_BASE 0xfffe0000UL | ||
12 | #define TX3927_REG_SIZE 0x00010000 | ||
13 | #define TX3927_SDRAMC_REG (TX3927_REG_BASE + 0x8000) | ||
14 | #define TX3927_ROMC_REG (TX3927_REG_BASE + 0x9000) | ||
15 | #define TX3927_DMA_REG (TX3927_REG_BASE + 0xb000) | ||
16 | #define TX3927_IRC_REG (TX3927_REG_BASE + 0xc000) | ||
17 | #define TX3927_PCIC_REG (TX3927_REG_BASE + 0xd000) | ||
18 | #define TX3927_CCFG_REG (TX3927_REG_BASE + 0xe000) | ||
19 | #define TX3927_NR_TMR 3 | ||
20 | #define TX3927_TMR_REG(ch) (TX3927_REG_BASE + 0xf000 + (ch) * 0x100) | ||
21 | #define TX3927_NR_SIO 2 | ||
22 | #define TX3927_SIO_REG(ch) (TX3927_REG_BASE + 0xf300 + (ch) * 0x100) | ||
23 | #define TX3927_PIO_REG (TX3927_REG_BASE + 0xf500) | ||
24 | |||
25 | struct tx3927_sdramc_reg { | ||
26 | volatile unsigned long cr[8]; | ||
27 | volatile unsigned long tr[3]; | ||
28 | volatile unsigned long cmd; | ||
29 | volatile unsigned long smrs[2]; | ||
30 | }; | ||
31 | |||
32 | struct tx3927_romc_reg { | ||
33 | volatile unsigned long cr[8]; | ||
34 | }; | ||
35 | |||
36 | struct tx3927_dma_reg { | ||
37 | struct tx3927_dma_ch_reg { | ||
38 | volatile unsigned long cha; | ||
39 | volatile unsigned long sar; | ||
40 | volatile unsigned long dar; | ||
41 | volatile unsigned long cntr; | ||
42 | volatile unsigned long sair; | ||
43 | volatile unsigned long dair; | ||
44 | volatile unsigned long ccr; | ||
45 | volatile unsigned long csr; | ||
46 | } ch[4]; | ||
47 | volatile unsigned long dbr[8]; | ||
48 | volatile unsigned long tdhr; | ||
49 | volatile unsigned long mcr; | ||
50 | volatile unsigned long unused0; | ||
51 | }; | ||
52 | |||
53 | #include <asm/byteorder.h> | ||
54 | |||
55 | #ifdef __BIG_ENDIAN | ||
56 | #define endian_def_s2(e1, e2) \ | ||
57 | volatile unsigned short e1, e2 | ||
58 | #define endian_def_sb2(e1, e2, e3) \ | ||
59 | volatile unsigned short e1;volatile unsigned char e2, e3 | ||
60 | #define endian_def_b2s(e1, e2, e3) \ | ||
61 | volatile unsigned char e1, e2;volatile unsigned short e3 | ||
62 | #define endian_def_b4(e1, e2, e3, e4) \ | ||
63 | volatile unsigned char e1, e2, e3, e4 | ||
64 | #else | ||
65 | #define endian_def_s2(e1, e2) \ | ||
66 | volatile unsigned short e2, e1 | ||
67 | #define endian_def_sb2(e1, e2, e3) \ | ||
68 | volatile unsigned char e3, e2;volatile unsigned short e1 | ||
69 | #define endian_def_b2s(e1, e2, e3) \ | ||
70 | volatile unsigned short e3;volatile unsigned char e2, e1 | ||
71 | #define endian_def_b4(e1, e2, e3, e4) \ | ||
72 | volatile unsigned char e4, e3, e2, e1 | ||
73 | #endif | ||
74 | |||
75 | struct tx3927_pcic_reg { | ||
76 | endian_def_s2(did, vid); | ||
77 | endian_def_s2(pcistat, pcicmd); | ||
78 | endian_def_b4(cc, scc, rpli, rid); | ||
79 | endian_def_b4(unused0, ht, mlt, cls); | ||
80 | volatile unsigned long ioba; /* +10 */ | ||
81 | volatile unsigned long mba; | ||
82 | volatile unsigned long unused1[5]; | ||
83 | endian_def_s2(svid, ssvid); | ||
84 | volatile unsigned long unused2; /* +30 */ | ||
85 | endian_def_sb2(unused3, unused4, capptr); | ||
86 | volatile unsigned long unused5; | ||
87 | endian_def_b4(ml, mg, ip, il); | ||
88 | volatile unsigned long unused6; /* +40 */ | ||
89 | volatile unsigned long istat; | ||
90 | volatile unsigned long iim; | ||
91 | volatile unsigned long rrt; | ||
92 | volatile unsigned long unused7[3]; /* +50 */ | ||
93 | volatile unsigned long ipbmma; | ||
94 | volatile unsigned long ipbioma; /* +60 */ | ||
95 | volatile unsigned long ilbmma; | ||
96 | volatile unsigned long ilbioma; | ||
97 | volatile unsigned long unused8[9]; | ||
98 | volatile unsigned long tc; /* +90 */ | ||
99 | volatile unsigned long tstat; | ||
100 | volatile unsigned long tim; | ||
101 | volatile unsigned long tccmd; | ||
102 | volatile unsigned long pcirrt; /* +a0 */ | ||
103 | volatile unsigned long pcirrt_cmd; | ||
104 | volatile unsigned long pcirrdt; | ||
105 | volatile unsigned long unused9[3]; | ||
106 | volatile unsigned long tlboap; | ||
107 | volatile unsigned long tlbiap; | ||
108 | volatile unsigned long tlbmma; /* +c0 */ | ||
109 | volatile unsigned long tlbioma; | ||
110 | volatile unsigned long sc_msg; | ||
111 | volatile unsigned long sc_be; | ||
112 | volatile unsigned long tbl; /* +d0 */ | ||
113 | volatile unsigned long unused10[3]; | ||
114 | volatile unsigned long pwmng; /* +e0 */ | ||
115 | volatile unsigned long pwmngs; | ||
116 | volatile unsigned long unused11[6]; | ||
117 | volatile unsigned long req_trace; /* +100 */ | ||
118 | volatile unsigned long pbapmc; | ||
119 | volatile unsigned long pbapms; | ||
120 | volatile unsigned long pbapmim; | ||
121 | volatile unsigned long bm; /* +110 */ | ||
122 | volatile unsigned long cpcibrs; | ||
123 | volatile unsigned long cpcibgs; | ||
124 | volatile unsigned long pbacs; | ||
125 | volatile unsigned long iobas; /* +120 */ | ||
126 | volatile unsigned long mbas; | ||
127 | volatile unsigned long lbc; | ||
128 | volatile unsigned long lbstat; | ||
129 | volatile unsigned long lbim; /* +130 */ | ||
130 | volatile unsigned long pcistatim; | ||
131 | volatile unsigned long ica; | ||
132 | volatile unsigned long icd; | ||
133 | volatile unsigned long iiadp; /* +140 */ | ||
134 | volatile unsigned long iscdp; | ||
135 | volatile unsigned long mmas; | ||
136 | volatile unsigned long iomas; | ||
137 | volatile unsigned long ipciaddr; /* +150 */ | ||
138 | volatile unsigned long ipcidata; | ||
139 | volatile unsigned long ipcibe; | ||
140 | }; | ||
141 | |||
142 | struct tx3927_ccfg_reg { | ||
143 | volatile unsigned long ccfg; | ||
144 | volatile unsigned long crir; | ||
145 | volatile unsigned long pcfg; | ||
146 | volatile unsigned long tear; | ||
147 | volatile unsigned long pdcr; | ||
148 | }; | ||
149 | |||
150 | /* | ||
151 | * SDRAMC | ||
152 | */ | ||
153 | |||
154 | /* | ||
155 | * ROMC | ||
156 | */ | ||
157 | |||
158 | /* | ||
159 | * DMA | ||
160 | */ | ||
161 | /* bits for MCR */ | ||
162 | #define TX3927_DMA_MCR_EIS(ch) (0x10000000<<(ch)) | ||
163 | #define TX3927_DMA_MCR_DIS(ch) (0x01000000<<(ch)) | ||
164 | #define TX3927_DMA_MCR_RSFIF 0x00000080 | ||
165 | #define TX3927_DMA_MCR_FIFUM(ch) (0x00000008<<(ch)) | ||
166 | #define TX3927_DMA_MCR_LE 0x00000004 | ||
167 | #define TX3927_DMA_MCR_RPRT 0x00000002 | ||
168 | #define TX3927_DMA_MCR_MSTEN 0x00000001 | ||
169 | |||
170 | /* bits for CCRn */ | ||
171 | #define TX3927_DMA_CCR_DBINH 0x04000000 | ||
172 | #define TX3927_DMA_CCR_SBINH 0x02000000 | ||
173 | #define TX3927_DMA_CCR_CHRST 0x01000000 | ||
174 | #define TX3927_DMA_CCR_RVBYTE 0x00800000 | ||
175 | #define TX3927_DMA_CCR_ACKPOL 0x00400000 | ||
176 | #define TX3927_DMA_CCR_REQPL 0x00200000 | ||
177 | #define TX3927_DMA_CCR_EGREQ 0x00100000 | ||
178 | #define TX3927_DMA_CCR_CHDN 0x00080000 | ||
179 | #define TX3927_DMA_CCR_DNCTL 0x00060000 | ||
180 | #define TX3927_DMA_CCR_EXTRQ 0x00010000 | ||
181 | #define TX3927_DMA_CCR_INTRQD 0x0000e000 | ||
182 | #define TX3927_DMA_CCR_INTENE 0x00001000 | ||
183 | #define TX3927_DMA_CCR_INTENC 0x00000800 | ||
184 | #define TX3927_DMA_CCR_INTENT 0x00000400 | ||
185 | #define TX3927_DMA_CCR_CHNEN 0x00000200 | ||
186 | #define TX3927_DMA_CCR_XFACT 0x00000100 | ||
187 | #define TX3927_DMA_CCR_SNOP 0x00000080 | ||
188 | #define TX3927_DMA_CCR_DSTINC 0x00000040 | ||
189 | #define TX3927_DMA_CCR_SRCINC 0x00000020 | ||
190 | #define TX3927_DMA_CCR_XFSZ(order) (((order) << 2) & 0x0000001c) | ||
191 | #define TX3927_DMA_CCR_XFSZ_1W TX3927_DMA_CCR_XFSZ(2) | ||
192 | #define TX3927_DMA_CCR_XFSZ_4W TX3927_DMA_CCR_XFSZ(4) | ||
193 | #define TX3927_DMA_CCR_XFSZ_8W TX3927_DMA_CCR_XFSZ(5) | ||
194 | #define TX3927_DMA_CCR_XFSZ_16W TX3927_DMA_CCR_XFSZ(6) | ||
195 | #define TX3927_DMA_CCR_XFSZ_32W TX3927_DMA_CCR_XFSZ(7) | ||
196 | #define TX3927_DMA_CCR_MEMIO 0x00000002 | ||
197 | #define TX3927_DMA_CCR_ONEAD 0x00000001 | ||
198 | |||
199 | /* bits for CSRn */ | ||
200 | #define TX3927_DMA_CSR_CHNACT 0x00000100 | ||
201 | #define TX3927_DMA_CSR_ABCHC 0x00000080 | ||
202 | #define TX3927_DMA_CSR_NCHNC 0x00000040 | ||
203 | #define TX3927_DMA_CSR_NTRNFC 0x00000020 | ||
204 | #define TX3927_DMA_CSR_EXTDN 0x00000010 | ||
205 | #define TX3927_DMA_CSR_CFERR 0x00000008 | ||
206 | #define TX3927_DMA_CSR_CHERR 0x00000004 | ||
207 | #define TX3927_DMA_CSR_DESERR 0x00000002 | ||
208 | #define TX3927_DMA_CSR_SORERR 0x00000001 | ||
209 | |||
210 | /* | ||
211 | * IRC | ||
212 | */ | ||
213 | #define TX3927_IR_INT0 0 | ||
214 | #define TX3927_IR_INT1 1 | ||
215 | #define TX3927_IR_INT2 2 | ||
216 | #define TX3927_IR_INT3 3 | ||
217 | #define TX3927_IR_INT4 4 | ||
218 | #define TX3927_IR_INT5 5 | ||
219 | #define TX3927_IR_SIO0 6 | ||
220 | #define TX3927_IR_SIO1 7 | ||
221 | #define TX3927_IR_SIO(ch) (6 + (ch)) | ||
222 | #define TX3927_IR_DMA 8 | ||
223 | #define TX3927_IR_PIO 9 | ||
224 | #define TX3927_IR_PCI 10 | ||
225 | #define TX3927_IR_TMR(ch) (13 + (ch)) | ||
226 | #define TX3927_NUM_IR 16 | ||
227 | |||
228 | /* | ||
229 | * PCIC | ||
230 | */ | ||
231 | /* bits for PCICMD */ | ||
232 | /* see PCI_COMMAND_XXX in linux/pci.h */ | ||
233 | |||
234 | /* bits for PCISTAT */ | ||
235 | /* see PCI_STATUS_XXX in linux/pci.h */ | ||
236 | #define PCI_STATUS_NEW_CAP 0x0010 | ||
237 | |||
238 | /* bits for ISTAT/IIM */ | ||
239 | #define TX3927_PCIC_IIM_ALL 0x00001600 | ||
240 | |||
241 | /* bits for TC */ | ||
242 | #define TX3927_PCIC_TC_OF16E 0x00000020 | ||
243 | #define TX3927_PCIC_TC_IF8E 0x00000010 | ||
244 | #define TX3927_PCIC_TC_OF8E 0x00000008 | ||
245 | |||
246 | /* bits for TSTAT/TIM */ | ||
247 | #define TX3927_PCIC_TIM_ALL 0x0003ffff | ||
248 | |||
249 | /* bits for IOBA/MBA */ | ||
250 | /* see PCI_BASE_ADDRESS_XXX in linux/pci.h */ | ||
251 | |||
252 | /* bits for PBAPMC */ | ||
253 | #define TX3927_PCIC_PBAPMC_RPBA 0x00000004 | ||
254 | #define TX3927_PCIC_PBAPMC_PBAEN 0x00000002 | ||
255 | #define TX3927_PCIC_PBAPMC_BMCEN 0x00000001 | ||
256 | |||
257 | /* bits for LBSTAT/LBIM */ | ||
258 | #define TX3927_PCIC_LBIM_ALL 0x0000003e | ||
259 | |||
260 | /* bits for PCISTATIM (see also PCI_STATUS_XXX in linux/pci.h */ | ||
261 | #define TX3927_PCIC_PCISTATIM_ALL 0x0000f900 | ||
262 | |||
263 | /* bits for LBC */ | ||
264 | #define TX3927_PCIC_LBC_IBSE 0x00004000 | ||
265 | #define TX3927_PCIC_LBC_TIBSE 0x00002000 | ||
266 | #define TX3927_PCIC_LBC_TMFBSE 0x00001000 | ||
267 | #define TX3927_PCIC_LBC_HRST 0x00000800 | ||
268 | #define TX3927_PCIC_LBC_SRST 0x00000400 | ||
269 | #define TX3927_PCIC_LBC_EPCAD 0x00000200 | ||
270 | #define TX3927_PCIC_LBC_MSDSE 0x00000100 | ||
271 | #define TX3927_PCIC_LBC_CRR 0x00000080 | ||
272 | #define TX3927_PCIC_LBC_ILMDE 0x00000040 | ||
273 | #define TX3927_PCIC_LBC_ILIDE 0x00000020 | ||
274 | |||
275 | #define TX3927_PCIC_IDSEL_AD_TO_SLOT(ad) ((ad) - 11) | ||
276 | #define TX3927_PCIC_MAX_DEVNU TX3927_PCIC_IDSEL_AD_TO_SLOT(32) | ||
277 | |||
278 | /* | ||
279 | * CCFG | ||
280 | */ | ||
281 | /* CCFG : Chip Configuration */ | ||
282 | #define TX3927_CCFG_TLBOFF 0x00020000 | ||
283 | #define TX3927_CCFG_BEOW 0x00010000 | ||
284 | #define TX3927_CCFG_WR 0x00008000 | ||
285 | #define TX3927_CCFG_TOE 0x00004000 | ||
286 | #define TX3927_CCFG_PCIXARB 0x00002000 | ||
287 | #define TX3927_CCFG_PCI3 0x00001000 | ||
288 | #define TX3927_CCFG_PSNP 0x00000800 | ||
289 | #define TX3927_CCFG_PPRI 0x00000400 | ||
290 | #define TX3927_CCFG_PLLM 0x00000030 | ||
291 | #define TX3927_CCFG_ENDIAN 0x00000004 | ||
292 | #define TX3927_CCFG_HALT 0x00000002 | ||
293 | #define TX3927_CCFG_ACEHOLD 0x00000001 | ||
294 | |||
295 | /* PCFG : Pin Configuration */ | ||
296 | #define TX3927_PCFG_SYSCLKEN 0x08000000 | ||
297 | #define TX3927_PCFG_SDRCLKEN_ALL 0x07c00000 | ||
298 | #define TX3927_PCFG_SDRCLKEN(ch) (0x00400000<<(ch)) | ||
299 | #define TX3927_PCFG_PCICLKEN_ALL 0x003c0000 | ||
300 | #define TX3927_PCFG_PCICLKEN(ch) (0x00040000<<(ch)) | ||
301 | #define TX3927_PCFG_SELALL 0x0003ffff | ||
302 | #define TX3927_PCFG_SELCS 0x00020000 | ||
303 | #define TX3927_PCFG_SELDSF 0x00010000 | ||
304 | #define TX3927_PCFG_SELSIOC_ALL 0x0000c000 | ||
305 | #define TX3927_PCFG_SELSIOC(ch) (0x00004000<<(ch)) | ||
306 | #define TX3927_PCFG_SELSIO_ALL 0x00003000 | ||
307 | #define TX3927_PCFG_SELSIO(ch) (0x00001000<<(ch)) | ||
308 | #define TX3927_PCFG_SELTMR_ALL 0x00000e00 | ||
309 | #define TX3927_PCFG_SELTMR(ch) (0x00000200<<(ch)) | ||
310 | #define TX3927_PCFG_SELDONE 0x00000100 | ||
311 | #define TX3927_PCFG_INTDMA_ALL 0x000000f0 | ||
312 | #define TX3927_PCFG_INTDMA(ch) (0x00000010<<(ch)) | ||
313 | #define TX3927_PCFG_SELDMA_ALL 0x0000000f | ||
314 | #define TX3927_PCFG_SELDMA(ch) (0x00000001<<(ch)) | ||
315 | |||
316 | #define tx3927_sdramcptr ((struct tx3927_sdramc_reg *)TX3927_SDRAMC_REG) | ||
317 | #define tx3927_romcptr ((struct tx3927_romc_reg *)TX3927_ROMC_REG) | ||
318 | #define tx3927_dmaptr ((struct tx3927_dma_reg *)TX3927_DMA_REG) | ||
319 | #define tx3927_pcicptr ((struct tx3927_pcic_reg *)TX3927_PCIC_REG) | ||
320 | #define tx3927_ccfgptr ((struct tx3927_ccfg_reg *)TX3927_CCFG_REG) | ||
321 | #define tx3927_sioptr(ch) ((struct txx927_sio_reg *)TX3927_SIO_REG(ch)) | ||
322 | #define tx3927_pioptr ((struct txx9_pio_reg __iomem *)TX3927_PIO_REG) | ||
323 | |||
324 | #define TX3927_REV_PCODE() (tx3927_ccfgptr->crir >> 16) | ||
325 | #define TX3927_ROMC_BA(ch) (tx3927_romcptr->cr[(ch)] & 0xfff00000) | ||
326 | #define TX3927_ROMC_SIZE(ch) \ | ||
327 | (0x00100000 << ((tx3927_romcptr->cr[(ch)] >> 8) & 0xf)) | ||
328 | #define TX3927_ROMC_WIDTH(ch) (32 >> ((tx3927_romcptr->cr[(ch)] >> 7) & 0x1)) | ||
329 | |||
330 | void tx3927_wdt_init(void); | ||
331 | void tx3927_setup(void); | ||
332 | void tx3927_time_init(unsigned int evt_tmrnr, unsigned int src_tmrnr); | ||
333 | void tx3927_sio_init(unsigned int sclk, unsigned int cts_mask); | ||
334 | struct pci_controller; | ||
335 | void tx3927_pcic_setup(struct pci_controller *channel, | ||
336 | unsigned long sdram_size, int extarb); | ||
337 | void tx3927_setup_pcierr_irq(void); | ||
338 | void tx3927_irq_init(void); | ||
339 | void tx3927_mtd_init(int ch); | ||
340 | |||
341 | #endif /* __ASM_TXX9_TX3927_H */ | ||
diff --git a/include/asm-mips/txx9/tx4927.h b/include/asm-mips/txx9/tx4927.h deleted file mode 100644 index 7d813f1cb98d..000000000000 --- a/include/asm-mips/txx9/tx4927.h +++ /dev/null | |||
@@ -1,269 +0,0 @@ | |||
1 | /* | ||
2 | * Author: MontaVista Software, Inc. | ||
3 | * source@mvista.com | ||
4 | * | ||
5 | * Copyright 2001-2006 MontaVista Software Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
13 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
14 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
15 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | ||
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | ||
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | ||
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License along | ||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | */ | ||
27 | #ifndef __ASM_TXX9_TX4927_H | ||
28 | #define __ASM_TXX9_TX4927_H | ||
29 | |||
30 | #include <linux/types.h> | ||
31 | #include <linux/io.h> | ||
32 | #include <asm/txx9irq.h> | ||
33 | #include <asm/txx9/tx4927pcic.h> | ||
34 | |||
35 | #ifdef CONFIG_64BIT | ||
36 | #define TX4927_REG_BASE 0xffffffffff1f0000UL | ||
37 | #else | ||
38 | #define TX4927_REG_BASE 0xff1f0000UL | ||
39 | #endif | ||
40 | #define TX4927_REG_SIZE 0x00010000 | ||
41 | |||
42 | #define TX4927_SDRAMC_REG (TX4927_REG_BASE + 0x8000) | ||
43 | #define TX4927_EBUSC_REG (TX4927_REG_BASE + 0x9000) | ||
44 | #define TX4927_PCIC_REG (TX4927_REG_BASE + 0xd000) | ||
45 | #define TX4927_CCFG_REG (TX4927_REG_BASE + 0xe000) | ||
46 | #define TX4927_IRC_REG (TX4927_REG_BASE + 0xf600) | ||
47 | #define TX4927_NR_TMR 3 | ||
48 | #define TX4927_TMR_REG(ch) (TX4927_REG_BASE + 0xf000 + (ch) * 0x100) | ||
49 | #define TX4927_NR_SIO 2 | ||
50 | #define TX4927_SIO_REG(ch) (TX4927_REG_BASE + 0xf300 + (ch) * 0x100) | ||
51 | #define TX4927_PIO_REG (TX4927_REG_BASE + 0xf500) | ||
52 | |||
53 | #define TX4927_IR_ECCERR 0 | ||
54 | #define TX4927_IR_WTOERR 1 | ||
55 | #define TX4927_NUM_IR_INT 6 | ||
56 | #define TX4927_IR_INT(n) (2 + (n)) | ||
57 | #define TX4927_NUM_IR_SIO 2 | ||
58 | #define TX4927_IR_SIO(n) (8 + (n)) | ||
59 | #define TX4927_NUM_IR_DMA 4 | ||
60 | #define TX4927_IR_DMA(n) (10 + (n)) | ||
61 | #define TX4927_IR_PIO 14 | ||
62 | #define TX4927_IR_PDMAC 15 | ||
63 | #define TX4927_IR_PCIC 16 | ||
64 | #define TX4927_NUM_IR_TMR 3 | ||
65 | #define TX4927_IR_TMR(n) (17 + (n)) | ||
66 | #define TX4927_IR_PCIERR 22 | ||
67 | #define TX4927_IR_PCIPME 23 | ||
68 | #define TX4927_IR_ACLC 24 | ||
69 | #define TX4927_IR_ACLCPME 25 | ||
70 | #define TX4927_NUM_IR 32 | ||
71 | |||
72 | #define TX4927_IRC_INT 2 /* IP[2] in Status register */ | ||
73 | |||
74 | #define TX4927_NUM_PIO 16 | ||
75 | |||
76 | struct tx4927_sdramc_reg { | ||
77 | u64 cr[4]; | ||
78 | u64 unused0[4]; | ||
79 | u64 tr; | ||
80 | u64 unused1[2]; | ||
81 | u64 cmd; | ||
82 | }; | ||
83 | |||
84 | struct tx4927_ebusc_reg { | ||
85 | u64 cr[8]; | ||
86 | }; | ||
87 | |||
88 | struct tx4927_ccfg_reg { | ||
89 | u64 ccfg; | ||
90 | u64 crir; | ||
91 | u64 pcfg; | ||
92 | u64 toea; | ||
93 | u64 clkctr; | ||
94 | u64 unused0; | ||
95 | u64 garbc; | ||
96 | u64 unused1; | ||
97 | u64 unused2; | ||
98 | u64 ramp; | ||
99 | }; | ||
100 | |||
101 | /* | ||
102 | * CCFG | ||
103 | */ | ||
104 | /* CCFG : Chip Configuration */ | ||
105 | #define TX4927_CCFG_WDRST 0x0000020000000000ULL | ||
106 | #define TX4927_CCFG_WDREXEN 0x0000010000000000ULL | ||
107 | #define TX4927_CCFG_BCFG_MASK 0x000000ff00000000ULL | ||
108 | #define TX4927_CCFG_TINTDIS 0x01000000 | ||
109 | #define TX4927_CCFG_PCI66 0x00800000 | ||
110 | #define TX4927_CCFG_PCIMODE 0x00400000 | ||
111 | #define TX4927_CCFG_DIVMODE_MASK 0x000e0000 | ||
112 | #define TX4927_CCFG_DIVMODE_8 (0x0 << 17) | ||
113 | #define TX4927_CCFG_DIVMODE_12 (0x1 << 17) | ||
114 | #define TX4927_CCFG_DIVMODE_16 (0x2 << 17) | ||
115 | #define TX4927_CCFG_DIVMODE_10 (0x3 << 17) | ||
116 | #define TX4927_CCFG_DIVMODE_2 (0x4 << 17) | ||
117 | #define TX4927_CCFG_DIVMODE_3 (0x5 << 17) | ||
118 | #define TX4927_CCFG_DIVMODE_4 (0x6 << 17) | ||
119 | #define TX4927_CCFG_DIVMODE_2_5 (0x7 << 17) | ||
120 | #define TX4927_CCFG_BEOW 0x00010000 | ||
121 | #define TX4927_CCFG_WR 0x00008000 | ||
122 | #define TX4927_CCFG_TOE 0x00004000 | ||
123 | #define TX4927_CCFG_PCIARB 0x00002000 | ||
124 | #define TX4927_CCFG_PCIDIVMODE_MASK 0x00001800 | ||
125 | #define TX4927_CCFG_PCIDIVMODE_2_5 0x00000000 | ||
126 | #define TX4927_CCFG_PCIDIVMODE_3 0x00000800 | ||
127 | #define TX4927_CCFG_PCIDIVMODE_5 0x00001000 | ||
128 | #define TX4927_CCFG_PCIDIVMODE_6 0x00001800 | ||
129 | #define TX4927_CCFG_SYSSP_MASK 0x000000c0 | ||
130 | #define TX4927_CCFG_ENDIAN 0x00000004 | ||
131 | #define TX4927_CCFG_HALT 0x00000002 | ||
132 | #define TX4927_CCFG_ACEHOLD 0x00000001 | ||
133 | #define TX4927_CCFG_W1CBITS (TX4927_CCFG_WDRST | TX4927_CCFG_BEOW) | ||
134 | |||
135 | /* PCFG : Pin Configuration */ | ||
136 | #define TX4927_PCFG_SDCLKDLY_MASK 0x30000000 | ||
137 | #define TX4927_PCFG_SDCLKDLY(d) ((d)<<28) | ||
138 | #define TX4927_PCFG_SYSCLKEN 0x08000000 | ||
139 | #define TX4927_PCFG_SDCLKEN_ALL 0x07800000 | ||
140 | #define TX4927_PCFG_SDCLKEN(ch) (0x00800000<<(ch)) | ||
141 | #define TX4927_PCFG_PCICLKEN_ALL 0x003f0000 | ||
142 | #define TX4927_PCFG_PCICLKEN(ch) (0x00010000<<(ch)) | ||
143 | #define TX4927_PCFG_SEL2 0x00000200 | ||
144 | #define TX4927_PCFG_SEL1 0x00000100 | ||
145 | #define TX4927_PCFG_DMASEL_ALL 0x000000ff | ||
146 | #define TX4927_PCFG_DMASEL0_MASK 0x00000003 | ||
147 | #define TX4927_PCFG_DMASEL1_MASK 0x0000000c | ||
148 | #define TX4927_PCFG_DMASEL2_MASK 0x00000030 | ||
149 | #define TX4927_PCFG_DMASEL3_MASK 0x000000c0 | ||
150 | #define TX4927_PCFG_DMASEL0_DRQ0 0x00000000 | ||
151 | #define TX4927_PCFG_DMASEL0_SIO1 0x00000001 | ||
152 | #define TX4927_PCFG_DMASEL0_ACL0 0x00000002 | ||
153 | #define TX4927_PCFG_DMASEL0_ACL2 0x00000003 | ||
154 | #define TX4927_PCFG_DMASEL1_DRQ1 0x00000000 | ||
155 | #define TX4927_PCFG_DMASEL1_SIO1 0x00000004 | ||
156 | #define TX4927_PCFG_DMASEL1_ACL1 0x00000008 | ||
157 | #define TX4927_PCFG_DMASEL1_ACL3 0x0000000c | ||
158 | #define TX4927_PCFG_DMASEL2_DRQ2 0x00000000 /* SEL2=0 */ | ||
159 | #define TX4927_PCFG_DMASEL2_SIO0 0x00000010 /* SEL2=0 */ | ||
160 | #define TX4927_PCFG_DMASEL2_ACL1 0x00000000 /* SEL2=1 */ | ||
161 | #define TX4927_PCFG_DMASEL2_ACL2 0x00000020 /* SEL2=1 */ | ||
162 | #define TX4927_PCFG_DMASEL2_ACL0 0x00000030 /* SEL2=1 */ | ||
163 | #define TX4927_PCFG_DMASEL3_DRQ3 0x00000000 | ||
164 | #define TX4927_PCFG_DMASEL3_SIO0 0x00000040 | ||
165 | #define TX4927_PCFG_DMASEL3_ACL3 0x00000080 | ||
166 | #define TX4927_PCFG_DMASEL3_ACL1 0x000000c0 | ||
167 | |||
168 | /* CLKCTR : Clock Control */ | ||
169 | #define TX4927_CLKCTR_ACLCKD 0x02000000 | ||
170 | #define TX4927_CLKCTR_PIOCKD 0x01000000 | ||
171 | #define TX4927_CLKCTR_DMACKD 0x00800000 | ||
172 | #define TX4927_CLKCTR_PCICKD 0x00400000 | ||
173 | #define TX4927_CLKCTR_TM0CKD 0x00100000 | ||
174 | #define TX4927_CLKCTR_TM1CKD 0x00080000 | ||
175 | #define TX4927_CLKCTR_TM2CKD 0x00040000 | ||
176 | #define TX4927_CLKCTR_SIO0CKD 0x00020000 | ||
177 | #define TX4927_CLKCTR_SIO1CKD 0x00010000 | ||
178 | #define TX4927_CLKCTR_ACLRST 0x00000200 | ||
179 | #define TX4927_CLKCTR_PIORST 0x00000100 | ||
180 | #define TX4927_CLKCTR_DMARST 0x00000080 | ||
181 | #define TX4927_CLKCTR_PCIRST 0x00000040 | ||
182 | #define TX4927_CLKCTR_TM0RST 0x00000010 | ||
183 | #define TX4927_CLKCTR_TM1RST 0x00000008 | ||
184 | #define TX4927_CLKCTR_TM2RST 0x00000004 | ||
185 | #define TX4927_CLKCTR_SIO0RST 0x00000002 | ||
186 | #define TX4927_CLKCTR_SIO1RST 0x00000001 | ||
187 | |||
188 | #define tx4927_sdramcptr \ | ||
189 | ((struct tx4927_sdramc_reg __iomem *)TX4927_SDRAMC_REG) | ||
190 | #define tx4927_pcicptr \ | ||
191 | ((struct tx4927_pcic_reg __iomem *)TX4927_PCIC_REG) | ||
192 | #define tx4927_ccfgptr \ | ||
193 | ((struct tx4927_ccfg_reg __iomem *)TX4927_CCFG_REG) | ||
194 | #define tx4927_ebuscptr \ | ||
195 | ((struct tx4927_ebusc_reg __iomem *)TX4927_EBUSC_REG) | ||
196 | #define tx4927_pioptr ((struct txx9_pio_reg __iomem *)TX4927_PIO_REG) | ||
197 | |||
198 | #define TX4927_REV_PCODE() \ | ||
199 | ((__u32)__raw_readq(&tx4927_ccfgptr->crir) >> 16) | ||
200 | |||
201 | #define TX4927_SDRAMC_CR(ch) __raw_readq(&tx4927_sdramcptr->cr[(ch)]) | ||
202 | #define TX4927_SDRAMC_BA(ch) ((TX4927_SDRAMC_CR(ch) >> 49) << 21) | ||
203 | #define TX4927_SDRAMC_SIZE(ch) \ | ||
204 | ((((TX4927_SDRAMC_CR(ch) >> 33) & 0x7fff) + 1) << 21) | ||
205 | |||
206 | #define TX4927_EBUSC_CR(ch) __raw_readq(&tx4927_ebuscptr->cr[(ch)]) | ||
207 | #define TX4927_EBUSC_BA(ch) ((TX4927_EBUSC_CR(ch) >> 48) << 20) | ||
208 | #define TX4927_EBUSC_SIZE(ch) \ | ||
209 | (0x00100000 << ((unsigned long)(TX4927_EBUSC_CR(ch) >> 8) & 0xf)) | ||
210 | #define TX4927_EBUSC_WIDTH(ch) \ | ||
211 | (64 >> ((__u32)(TX4927_EBUSC_CR(ch) >> 20) & 0x3)) | ||
212 | |||
213 | /* utilities */ | ||
214 | static inline void txx9_clear64(__u64 __iomem *adr, __u64 bits) | ||
215 | { | ||
216 | #ifdef CONFIG_32BIT | ||
217 | unsigned long flags; | ||
218 | local_irq_save(flags); | ||
219 | #endif | ||
220 | ____raw_writeq(____raw_readq(adr) & ~bits, adr); | ||
221 | #ifdef CONFIG_32BIT | ||
222 | local_irq_restore(flags); | ||
223 | #endif | ||
224 | } | ||
225 | static inline void txx9_set64(__u64 __iomem *adr, __u64 bits) | ||
226 | { | ||
227 | #ifdef CONFIG_32BIT | ||
228 | unsigned long flags; | ||
229 | local_irq_save(flags); | ||
230 | #endif | ||
231 | ____raw_writeq(____raw_readq(adr) | bits, adr); | ||
232 | #ifdef CONFIG_32BIT | ||
233 | local_irq_restore(flags); | ||
234 | #endif | ||
235 | } | ||
236 | |||
237 | /* These functions are not interrupt safe. */ | ||
238 | static inline void tx4927_ccfg_clear(__u64 bits) | ||
239 | { | ||
240 | ____raw_writeq(____raw_readq(&tx4927_ccfgptr->ccfg) | ||
241 | & ~(TX4927_CCFG_W1CBITS | bits), | ||
242 | &tx4927_ccfgptr->ccfg); | ||
243 | } | ||
244 | static inline void tx4927_ccfg_set(__u64 bits) | ||
245 | { | ||
246 | ____raw_writeq((____raw_readq(&tx4927_ccfgptr->ccfg) | ||
247 | & ~TX4927_CCFG_W1CBITS) | bits, | ||
248 | &tx4927_ccfgptr->ccfg); | ||
249 | } | ||
250 | static inline void tx4927_ccfg_change(__u64 change, __u64 new) | ||
251 | { | ||
252 | ____raw_writeq((____raw_readq(&tx4927_ccfgptr->ccfg) | ||
253 | & ~(TX4927_CCFG_W1CBITS | change)) | | ||
254 | new, | ||
255 | &tx4927_ccfgptr->ccfg); | ||
256 | } | ||
257 | |||
258 | unsigned int tx4927_get_mem_size(void); | ||
259 | void tx4927_wdt_init(void); | ||
260 | void tx4927_setup(void); | ||
261 | void tx4927_time_init(unsigned int tmrnr); | ||
262 | void tx4927_sio_init(unsigned int sclk, unsigned int cts_mask); | ||
263 | int tx4927_report_pciclk(void); | ||
264 | int tx4927_pciclk66_setup(void); | ||
265 | void tx4927_setup_pcierr_irq(void); | ||
266 | void tx4927_irq_init(void); | ||
267 | void tx4927_mtd_init(int ch); | ||
268 | |||
269 | #endif /* __ASM_TXX9_TX4927_H */ | ||
diff --git a/include/asm-mips/txx9/tx4927pcic.h b/include/asm-mips/txx9/tx4927pcic.h deleted file mode 100644 index c470b8a5fe57..000000000000 --- a/include/asm-mips/txx9/tx4927pcic.h +++ /dev/null | |||
@@ -1,203 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/txx9/tx4927pcic.h | ||
3 | * TX4927 PCI controller definitions. | ||
4 | * | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | */ | ||
9 | #ifndef __ASM_TXX9_TX4927PCIC_H | ||
10 | #define __ASM_TXX9_TX4927PCIC_H | ||
11 | |||
12 | #include <linux/pci.h> | ||
13 | #include <linux/irqreturn.h> | ||
14 | |||
15 | struct tx4927_pcic_reg { | ||
16 | u32 pciid; | ||
17 | u32 pcistatus; | ||
18 | u32 pciccrev; | ||
19 | u32 pcicfg1; | ||
20 | u32 p2gm0plbase; /* +10 */ | ||
21 | u32 p2gm0pubase; | ||
22 | u32 p2gm1plbase; | ||
23 | u32 p2gm1pubase; | ||
24 | u32 p2gm2pbase; /* +20 */ | ||
25 | u32 p2giopbase; | ||
26 | u32 unused0; | ||
27 | u32 pcisid; | ||
28 | u32 unused1; /* +30 */ | ||
29 | u32 pcicapptr; | ||
30 | u32 unused2; | ||
31 | u32 pcicfg2; | ||
32 | u32 g2ptocnt; /* +40 */ | ||
33 | u32 unused3[15]; | ||
34 | u32 g2pstatus; /* +80 */ | ||
35 | u32 g2pmask; | ||
36 | u32 pcisstatus; | ||
37 | u32 pcimask; | ||
38 | u32 p2gcfg; /* +90 */ | ||
39 | u32 p2gstatus; | ||
40 | u32 p2gmask; | ||
41 | u32 p2gccmd; | ||
42 | u32 unused4[24]; /* +a0 */ | ||
43 | u32 pbareqport; /* +100 */ | ||
44 | u32 pbacfg; | ||
45 | u32 pbastatus; | ||
46 | u32 pbamask; | ||
47 | u32 pbabm; /* +110 */ | ||
48 | u32 pbacreq; | ||
49 | u32 pbacgnt; | ||
50 | u32 pbacstate; | ||
51 | u64 g2pmgbase[3]; /* +120 */ | ||
52 | u64 g2piogbase; | ||
53 | u32 g2pmmask[3]; /* +140 */ | ||
54 | u32 g2piomask; | ||
55 | u64 g2pmpbase[3]; /* +150 */ | ||
56 | u64 g2piopbase; | ||
57 | u32 pciccfg; /* +170 */ | ||
58 | u32 pcicstatus; | ||
59 | u32 pcicmask; | ||
60 | u32 unused5; | ||
61 | u64 p2gmgbase[3]; /* +180 */ | ||
62 | u64 p2giogbase; | ||
63 | u32 g2pcfgadrs; /* +1a0 */ | ||
64 | u32 g2pcfgdata; | ||
65 | u32 unused6[8]; | ||
66 | u32 g2pintack; | ||
67 | u32 g2pspc; | ||
68 | u32 unused7[12]; /* +1d0 */ | ||
69 | u64 pdmca; /* +200 */ | ||
70 | u64 pdmga; | ||
71 | u64 pdmpa; | ||
72 | u64 pdmctr; | ||
73 | u64 pdmcfg; /* +220 */ | ||
74 | u64 pdmsts; | ||
75 | }; | ||
76 | |||
77 | /* bits for PCICMD */ | ||
78 | /* see PCI_COMMAND_XXX in linux/pci_regs.h */ | ||
79 | |||
80 | /* bits for PCISTAT */ | ||
81 | /* see PCI_STATUS_XXX in linux/pci_regs.h */ | ||
82 | |||
83 | /* bits for IOBA/MBA */ | ||
84 | /* see PCI_BASE_ADDRESS_XXX in linux/pci_regs.h */ | ||
85 | |||
86 | /* bits for G2PSTATUS/G2PMASK */ | ||
87 | #define TX4927_PCIC_G2PSTATUS_ALL 0x00000003 | ||
88 | #define TX4927_PCIC_G2PSTATUS_TTOE 0x00000002 | ||
89 | #define TX4927_PCIC_G2PSTATUS_RTOE 0x00000001 | ||
90 | |||
91 | /* bits for PCIMASK (see also PCI_STATUS_XXX in linux/pci_regs.h */ | ||
92 | #define TX4927_PCIC_PCISTATUS_ALL 0x0000f900 | ||
93 | |||
94 | /* bits for PBACFG */ | ||
95 | #define TX4927_PCIC_PBACFG_FIXPA 0x00000008 | ||
96 | #define TX4927_PCIC_PBACFG_RPBA 0x00000004 | ||
97 | #define TX4927_PCIC_PBACFG_PBAEN 0x00000002 | ||
98 | #define TX4927_PCIC_PBACFG_BMCEN 0x00000001 | ||
99 | |||
100 | /* bits for PBASTATUS/PBAMASK */ | ||
101 | #define TX4927_PCIC_PBASTATUS_ALL 0x00000001 | ||
102 | #define TX4927_PCIC_PBASTATUS_BM 0x00000001 | ||
103 | |||
104 | /* bits for G2PMnGBASE */ | ||
105 | #define TX4927_PCIC_G2PMnGBASE_BSDIS 0x0000002000000000ULL | ||
106 | #define TX4927_PCIC_G2PMnGBASE_ECHG 0x0000001000000000ULL | ||
107 | |||
108 | /* bits for G2PIOGBASE */ | ||
109 | #define TX4927_PCIC_G2PIOGBASE_BSDIS 0x0000002000000000ULL | ||
110 | #define TX4927_PCIC_G2PIOGBASE_ECHG 0x0000001000000000ULL | ||
111 | |||
112 | /* bits for PCICSTATUS/PCICMASK */ | ||
113 | #define TX4927_PCIC_PCICSTATUS_ALL 0x000007b8 | ||
114 | #define TX4927_PCIC_PCICSTATUS_PME 0x00000400 | ||
115 | #define TX4927_PCIC_PCICSTATUS_TLB 0x00000200 | ||
116 | #define TX4927_PCIC_PCICSTATUS_NIB 0x00000100 | ||
117 | #define TX4927_PCIC_PCICSTATUS_ZIB 0x00000080 | ||
118 | #define TX4927_PCIC_PCICSTATUS_PERR 0x00000020 | ||
119 | #define TX4927_PCIC_PCICSTATUS_SERR 0x00000010 | ||
120 | #define TX4927_PCIC_PCICSTATUS_GBE 0x00000008 | ||
121 | #define TX4927_PCIC_PCICSTATUS_IWB 0x00000002 | ||
122 | #define TX4927_PCIC_PCICSTATUS_E2PDONE 0x00000001 | ||
123 | |||
124 | /* bits for PCICCFG */ | ||
125 | #define TX4927_PCIC_PCICCFG_GBWC_MASK 0x0fff0000 | ||
126 | #define TX4927_PCIC_PCICCFG_HRST 0x00000800 | ||
127 | #define TX4927_PCIC_PCICCFG_SRST 0x00000400 | ||
128 | #define TX4927_PCIC_PCICCFG_IRBER 0x00000200 | ||
129 | #define TX4927_PCIC_PCICCFG_G2PMEN(ch) (0x00000100>>(ch)) | ||
130 | #define TX4927_PCIC_PCICCFG_G2PM0EN 0x00000100 | ||
131 | #define TX4927_PCIC_PCICCFG_G2PM1EN 0x00000080 | ||
132 | #define TX4927_PCIC_PCICCFG_G2PM2EN 0x00000040 | ||
133 | #define TX4927_PCIC_PCICCFG_G2PIOEN 0x00000020 | ||
134 | #define TX4927_PCIC_PCICCFG_TCAR 0x00000010 | ||
135 | #define TX4927_PCIC_PCICCFG_ICAEN 0x00000008 | ||
136 | |||
137 | /* bits for P2GMnGBASE */ | ||
138 | #define TX4927_PCIC_P2GMnGBASE_TMEMEN 0x0000004000000000ULL | ||
139 | #define TX4927_PCIC_P2GMnGBASE_TBSDIS 0x0000002000000000ULL | ||
140 | #define TX4927_PCIC_P2GMnGBASE_TECHG 0x0000001000000000ULL | ||
141 | |||
142 | /* bits for P2GIOGBASE */ | ||
143 | #define TX4927_PCIC_P2GIOGBASE_TIOEN 0x0000004000000000ULL | ||
144 | #define TX4927_PCIC_P2GIOGBASE_TBSDIS 0x0000002000000000ULL | ||
145 | #define TX4927_PCIC_P2GIOGBASE_TECHG 0x0000001000000000ULL | ||
146 | |||
147 | #define TX4927_PCIC_IDSEL_AD_TO_SLOT(ad) ((ad) - 11) | ||
148 | #define TX4927_PCIC_MAX_DEVNU TX4927_PCIC_IDSEL_AD_TO_SLOT(32) | ||
149 | |||
150 | /* bits for PDMCFG */ | ||
151 | #define TX4927_PCIC_PDMCFG_RSTFIFO 0x00200000 | ||
152 | #define TX4927_PCIC_PDMCFG_EXFER 0x00100000 | ||
153 | #define TX4927_PCIC_PDMCFG_REQDLY_MASK 0x00003800 | ||
154 | #define TX4927_PCIC_PDMCFG_REQDLY_NONE (0 << 11) | ||
155 | #define TX4927_PCIC_PDMCFG_REQDLY_16 (1 << 11) | ||
156 | #define TX4927_PCIC_PDMCFG_REQDLY_32 (2 << 11) | ||
157 | #define TX4927_PCIC_PDMCFG_REQDLY_64 (3 << 11) | ||
158 | #define TX4927_PCIC_PDMCFG_REQDLY_128 (4 << 11) | ||
159 | #define TX4927_PCIC_PDMCFG_REQDLY_256 (5 << 11) | ||
160 | #define TX4927_PCIC_PDMCFG_REQDLY_512 (6 << 11) | ||
161 | #define TX4927_PCIC_PDMCFG_REQDLY_1024 (7 << 11) | ||
162 | #define TX4927_PCIC_PDMCFG_ERRIE 0x00000400 | ||
163 | #define TX4927_PCIC_PDMCFG_NCCMPIE 0x00000200 | ||
164 | #define TX4927_PCIC_PDMCFG_NTCMPIE 0x00000100 | ||
165 | #define TX4927_PCIC_PDMCFG_CHNEN 0x00000080 | ||
166 | #define TX4927_PCIC_PDMCFG_XFRACT 0x00000040 | ||
167 | #define TX4927_PCIC_PDMCFG_BSWAP 0x00000020 | ||
168 | #define TX4927_PCIC_PDMCFG_XFRSIZE_MASK 0x0000000c | ||
169 | #define TX4927_PCIC_PDMCFG_XFRSIZE_1DW 0x00000000 | ||
170 | #define TX4927_PCIC_PDMCFG_XFRSIZE_1QW 0x00000004 | ||
171 | #define TX4927_PCIC_PDMCFG_XFRSIZE_4QW 0x00000008 | ||
172 | #define TX4927_PCIC_PDMCFG_XFRDIRC 0x00000002 | ||
173 | #define TX4927_PCIC_PDMCFG_CHRST 0x00000001 | ||
174 | |||
175 | /* bits for PDMSTS */ | ||
176 | #define TX4927_PCIC_PDMSTS_REQCNT_MASK 0x3f000000 | ||
177 | #define TX4927_PCIC_PDMSTS_FIFOCNT_MASK 0x00f00000 | ||
178 | #define TX4927_PCIC_PDMSTS_FIFOWP_MASK 0x000c0000 | ||
179 | #define TX4927_PCIC_PDMSTS_FIFORP_MASK 0x00030000 | ||
180 | #define TX4927_PCIC_PDMSTS_ERRINT 0x00000800 | ||
181 | #define TX4927_PCIC_PDMSTS_DONEINT 0x00000400 | ||
182 | #define TX4927_PCIC_PDMSTS_CHNEN 0x00000200 | ||
183 | #define TX4927_PCIC_PDMSTS_XFRACT 0x00000100 | ||
184 | #define TX4927_PCIC_PDMSTS_ACCMP 0x00000080 | ||
185 | #define TX4927_PCIC_PDMSTS_NCCMP 0x00000040 | ||
186 | #define TX4927_PCIC_PDMSTS_NTCMP 0x00000020 | ||
187 | #define TX4927_PCIC_PDMSTS_CFGERR 0x00000008 | ||
188 | #define TX4927_PCIC_PDMSTS_PCIERR 0x00000004 | ||
189 | #define TX4927_PCIC_PDMSTS_CHNERR 0x00000002 | ||
190 | #define TX4927_PCIC_PDMSTS_DATAERR 0x00000001 | ||
191 | #define TX4927_PCIC_PDMSTS_ALL_CMP 0x000000e0 | ||
192 | #define TX4927_PCIC_PDMSTS_ALL_ERR 0x0000000f | ||
193 | |||
194 | struct tx4927_pcic_reg __iomem *get_tx4927_pcicptr( | ||
195 | struct pci_controller *channel); | ||
196 | void tx4927_pcic_setup(struct tx4927_pcic_reg __iomem *pcicptr, | ||
197 | struct pci_controller *channel, int extarb); | ||
198 | void tx4927_report_pcic_status(void); | ||
199 | char *tx4927_pcibios_setup(char *str); | ||
200 | void tx4927_dump_pcic_settings(void); | ||
201 | irqreturn_t tx4927_pcierr_interrupt(int irq, void *dev_id); | ||
202 | |||
203 | #endif /* __ASM_TXX9_TX4927PCIC_H */ | ||
diff --git a/include/asm-mips/txx9/tx4938.h b/include/asm-mips/txx9/tx4938.h deleted file mode 100644 index 989e7751135a..000000000000 --- a/include/asm-mips/txx9/tx4938.h +++ /dev/null | |||
@@ -1,295 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for TX4937/TX4938 | ||
3 | * Copyright (C) 2000-2001 Toshiba Corporation | ||
4 | * | ||
5 | * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the | ||
6 | * terms of the GNU General Public License version 2. This program is | ||
7 | * licensed "as is" without any warranty of any kind, whether express | ||
8 | * or implied. | ||
9 | * | ||
10 | * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) | ||
11 | */ | ||
12 | #ifndef __ASM_TXX9_TX4938_H | ||
13 | #define __ASM_TXX9_TX4938_H | ||
14 | |||
15 | /* some controllers are compatible with 4927 */ | ||
16 | #include <asm/txx9/tx4927.h> | ||
17 | |||
18 | #ifdef CONFIG_64BIT | ||
19 | #define TX4938_REG_BASE 0xffffffffff1f0000UL /* == TX4937_REG_BASE */ | ||
20 | #else | ||
21 | #define TX4938_REG_BASE 0xff1f0000UL /* == TX4937_REG_BASE */ | ||
22 | #endif | ||
23 | #define TX4938_REG_SIZE 0x00010000 /* == TX4937_REG_SIZE */ | ||
24 | |||
25 | /* NDFMC, SRAMC, PCIC1, SPIC: TX4938 only */ | ||
26 | #define TX4938_NDFMC_REG (TX4938_REG_BASE + 0x5000) | ||
27 | #define TX4938_SRAMC_REG (TX4938_REG_BASE + 0x6000) | ||
28 | #define TX4938_PCIC1_REG (TX4938_REG_BASE + 0x7000) | ||
29 | #define TX4938_SDRAMC_REG (TX4938_REG_BASE + 0x8000) | ||
30 | #define TX4938_EBUSC_REG (TX4938_REG_BASE + 0x9000) | ||
31 | #define TX4938_DMA_REG(ch) (TX4938_REG_BASE + 0xb000 + (ch) * 0x800) | ||
32 | #define TX4938_PCIC_REG (TX4938_REG_BASE + 0xd000) | ||
33 | #define TX4938_CCFG_REG (TX4938_REG_BASE + 0xe000) | ||
34 | #define TX4938_NR_TMR 3 | ||
35 | #define TX4938_TMR_REG(ch) ((TX4938_REG_BASE + 0xf000) + (ch) * 0x100) | ||
36 | #define TX4938_NR_SIO 2 | ||
37 | #define TX4938_SIO_REG(ch) ((TX4938_REG_BASE + 0xf300) + (ch) * 0x100) | ||
38 | #define TX4938_PIO_REG (TX4938_REG_BASE + 0xf500) | ||
39 | #define TX4938_IRC_REG (TX4938_REG_BASE + 0xf600) | ||
40 | #define TX4938_ACLC_REG (TX4938_REG_BASE + 0xf700) | ||
41 | #define TX4938_SPI_REG (TX4938_REG_BASE + 0xf800) | ||
42 | |||
43 | struct tx4938_sramc_reg { | ||
44 | u64 cr; | ||
45 | }; | ||
46 | |||
47 | struct tx4938_ccfg_reg { | ||
48 | u64 ccfg; | ||
49 | u64 crir; | ||
50 | u64 pcfg; | ||
51 | u64 toea; | ||
52 | u64 clkctr; | ||
53 | u64 unused0; | ||
54 | u64 garbc; | ||
55 | u64 unused1; | ||
56 | u64 unused2; | ||
57 | u64 ramp; | ||
58 | u64 unused3; | ||
59 | u64 jmpadr; | ||
60 | }; | ||
61 | |||
62 | /* | ||
63 | * IRC | ||
64 | */ | ||
65 | |||
66 | #define TX4938_IR_ECCERR 0 | ||
67 | #define TX4938_IR_WTOERR 1 | ||
68 | #define TX4938_NUM_IR_INT 6 | ||
69 | #define TX4938_IR_INT(n) (2 + (n)) | ||
70 | #define TX4938_NUM_IR_SIO 2 | ||
71 | #define TX4938_IR_SIO(n) (8 + (n)) | ||
72 | #define TX4938_NUM_IR_DMA 4 | ||
73 | #define TX4938_IR_DMA(ch, n) ((ch ? 27 : 10) + (n)) /* 10-13, 27-30 */ | ||
74 | #define TX4938_IR_PIO 14 | ||
75 | #define TX4938_IR_PDMAC 15 | ||
76 | #define TX4938_IR_PCIC 16 | ||
77 | #define TX4938_NUM_IR_TMR 3 | ||
78 | #define TX4938_IR_TMR(n) (17 + (n)) | ||
79 | #define TX4938_IR_NDFMC 21 | ||
80 | #define TX4938_IR_PCIERR 22 | ||
81 | #define TX4938_IR_PCIPME 23 | ||
82 | #define TX4938_IR_ACLC 24 | ||
83 | #define TX4938_IR_ACLCPME 25 | ||
84 | #define TX4938_IR_PCIC1 26 | ||
85 | #define TX4938_IR_SPI 31 | ||
86 | #define TX4938_NUM_IR 32 | ||
87 | /* multiplex */ | ||
88 | #define TX4938_IR_ETH0 TX4938_IR_INT(4) | ||
89 | #define TX4938_IR_ETH1 TX4938_IR_INT(3) | ||
90 | |||
91 | #define TX4938_IRC_INT 2 /* IP[2] in Status register */ | ||
92 | |||
93 | #define TX4938_NUM_PIO 16 | ||
94 | |||
95 | /* | ||
96 | * CCFG | ||
97 | */ | ||
98 | /* CCFG : Chip Configuration */ | ||
99 | #define TX4938_CCFG_WDRST 0x0000020000000000ULL | ||
100 | #define TX4938_CCFG_WDREXEN 0x0000010000000000ULL | ||
101 | #define TX4938_CCFG_BCFG_MASK 0x000000ff00000000ULL | ||
102 | #define TX4938_CCFG_TINTDIS 0x01000000 | ||
103 | #define TX4938_CCFG_PCI66 0x00800000 | ||
104 | #define TX4938_CCFG_PCIMODE 0x00400000 | ||
105 | #define TX4938_CCFG_PCI1_66 0x00200000 | ||
106 | #define TX4938_CCFG_DIVMODE_MASK 0x001e0000 | ||
107 | #define TX4938_CCFG_DIVMODE_2 (0x4 << 17) | ||
108 | #define TX4938_CCFG_DIVMODE_2_5 (0xf << 17) | ||
109 | #define TX4938_CCFG_DIVMODE_3 (0x5 << 17) | ||
110 | #define TX4938_CCFG_DIVMODE_4 (0x6 << 17) | ||
111 | #define TX4938_CCFG_DIVMODE_4_5 (0xd << 17) | ||
112 | #define TX4938_CCFG_DIVMODE_8 (0x0 << 17) | ||
113 | #define TX4938_CCFG_DIVMODE_10 (0xb << 17) | ||
114 | #define TX4938_CCFG_DIVMODE_12 (0x1 << 17) | ||
115 | #define TX4938_CCFG_DIVMODE_16 (0x2 << 17) | ||
116 | #define TX4938_CCFG_DIVMODE_18 (0x9 << 17) | ||
117 | #define TX4938_CCFG_BEOW 0x00010000 | ||
118 | #define TX4938_CCFG_WR 0x00008000 | ||
119 | #define TX4938_CCFG_TOE 0x00004000 | ||
120 | #define TX4938_CCFG_PCIARB 0x00002000 | ||
121 | #define TX4938_CCFG_PCIDIVMODE_MASK 0x00001c00 | ||
122 | #define TX4938_CCFG_PCIDIVMODE_4 (0x1 << 10) | ||
123 | #define TX4938_CCFG_PCIDIVMODE_4_5 (0x3 << 10) | ||
124 | #define TX4938_CCFG_PCIDIVMODE_5 (0x5 << 10) | ||
125 | #define TX4938_CCFG_PCIDIVMODE_5_5 (0x7 << 10) | ||
126 | #define TX4938_CCFG_PCIDIVMODE_8 (0x0 << 10) | ||
127 | #define TX4938_CCFG_PCIDIVMODE_9 (0x2 << 10) | ||
128 | #define TX4938_CCFG_PCIDIVMODE_10 (0x4 << 10) | ||
129 | #define TX4938_CCFG_PCIDIVMODE_11 (0x6 << 10) | ||
130 | #define TX4938_CCFG_PCI1DMD 0x00000100 | ||
131 | #define TX4938_CCFG_SYSSP_MASK 0x000000c0 | ||
132 | #define TX4938_CCFG_ENDIAN 0x00000004 | ||
133 | #define TX4938_CCFG_HALT 0x00000002 | ||
134 | #define TX4938_CCFG_ACEHOLD 0x00000001 | ||
135 | |||
136 | /* PCFG : Pin Configuration */ | ||
137 | #define TX4938_PCFG_ETH0_SEL 0x8000000000000000ULL | ||
138 | #define TX4938_PCFG_ETH1_SEL 0x4000000000000000ULL | ||
139 | #define TX4938_PCFG_ATA_SEL 0x2000000000000000ULL | ||
140 | #define TX4938_PCFG_ISA_SEL 0x1000000000000000ULL | ||
141 | #define TX4938_PCFG_SPI_SEL 0x0800000000000000ULL | ||
142 | #define TX4938_PCFG_NDF_SEL 0x0400000000000000ULL | ||
143 | #define TX4938_PCFG_SDCLKDLY_MASK 0x30000000 | ||
144 | #define TX4938_PCFG_SDCLKDLY(d) ((d)<<28) | ||
145 | #define TX4938_PCFG_SYSCLKEN 0x08000000 | ||
146 | #define TX4938_PCFG_SDCLKEN_ALL 0x07800000 | ||
147 | #define TX4938_PCFG_SDCLKEN(ch) (0x00800000<<(ch)) | ||
148 | #define TX4938_PCFG_PCICLKEN_ALL 0x003f0000 | ||
149 | #define TX4938_PCFG_PCICLKEN(ch) (0x00010000<<(ch)) | ||
150 | #define TX4938_PCFG_SEL2 0x00000200 | ||
151 | #define TX4938_PCFG_SEL1 0x00000100 | ||
152 | #define TX4938_PCFG_DMASEL_ALL 0x0000000f | ||
153 | #define TX4938_PCFG_DMASEL0_DRQ0 0x00000000 | ||
154 | #define TX4938_PCFG_DMASEL0_SIO1 0x00000001 | ||
155 | #define TX4938_PCFG_DMASEL1_DRQ1 0x00000000 | ||
156 | #define TX4938_PCFG_DMASEL1_SIO1 0x00000002 | ||
157 | #define TX4938_PCFG_DMASEL2_DRQ2 0x00000000 | ||
158 | #define TX4938_PCFG_DMASEL2_SIO0 0x00000004 | ||
159 | #define TX4938_PCFG_DMASEL3_DRQ3 0x00000000 | ||
160 | #define TX4938_PCFG_DMASEL3_SIO0 0x00000008 | ||
161 | |||
162 | /* CLKCTR : Clock Control */ | ||
163 | #define TX4938_CLKCTR_NDFCKD 0x0001000000000000ULL | ||
164 | #define TX4938_CLKCTR_NDFRST 0x0000000100000000ULL | ||
165 | #define TX4938_CLKCTR_ETH1CKD 0x80000000 | ||
166 | #define TX4938_CLKCTR_ETH0CKD 0x40000000 | ||
167 | #define TX4938_CLKCTR_SPICKD 0x20000000 | ||
168 | #define TX4938_CLKCTR_SRAMCKD 0x10000000 | ||
169 | #define TX4938_CLKCTR_PCIC1CKD 0x08000000 | ||
170 | #define TX4938_CLKCTR_DMA1CKD 0x04000000 | ||
171 | #define TX4938_CLKCTR_ACLCKD 0x02000000 | ||
172 | #define TX4938_CLKCTR_PIOCKD 0x01000000 | ||
173 | #define TX4938_CLKCTR_DMACKD 0x00800000 | ||
174 | #define TX4938_CLKCTR_PCICKD 0x00400000 | ||
175 | #define TX4938_CLKCTR_TM0CKD 0x00100000 | ||
176 | #define TX4938_CLKCTR_TM1CKD 0x00080000 | ||
177 | #define TX4938_CLKCTR_TM2CKD 0x00040000 | ||
178 | #define TX4938_CLKCTR_SIO0CKD 0x00020000 | ||
179 | #define TX4938_CLKCTR_SIO1CKD 0x00010000 | ||
180 | #define TX4938_CLKCTR_ETH1RST 0x00008000 | ||
181 | #define TX4938_CLKCTR_ETH0RST 0x00004000 | ||
182 | #define TX4938_CLKCTR_SPIRST 0x00002000 | ||
183 | #define TX4938_CLKCTR_SRAMRST 0x00001000 | ||
184 | #define TX4938_CLKCTR_PCIC1RST 0x00000800 | ||
185 | #define TX4938_CLKCTR_DMA1RST 0x00000400 | ||
186 | #define TX4938_CLKCTR_ACLRST 0x00000200 | ||
187 | #define TX4938_CLKCTR_PIORST 0x00000100 | ||
188 | #define TX4938_CLKCTR_DMARST 0x00000080 | ||
189 | #define TX4938_CLKCTR_PCIRST 0x00000040 | ||
190 | #define TX4938_CLKCTR_TM0RST 0x00000010 | ||
191 | #define TX4938_CLKCTR_TM1RST 0x00000008 | ||
192 | #define TX4938_CLKCTR_TM2RST 0x00000004 | ||
193 | #define TX4938_CLKCTR_SIO0RST 0x00000002 | ||
194 | #define TX4938_CLKCTR_SIO1RST 0x00000001 | ||
195 | |||
196 | /* | ||
197 | * DMA | ||
198 | */ | ||
199 | /* bits for MCR */ | ||
200 | #define TX4938_DMA_MCR_EIS(ch) (0x10000000<<(ch)) | ||
201 | #define TX4938_DMA_MCR_DIS(ch) (0x01000000<<(ch)) | ||
202 | #define TX4938_DMA_MCR_RSFIF 0x00000080 | ||
203 | #define TX4938_DMA_MCR_FIFUM(ch) (0x00000008<<(ch)) | ||
204 | #define TX4938_DMA_MCR_RPRT 0x00000002 | ||
205 | #define TX4938_DMA_MCR_MSTEN 0x00000001 | ||
206 | |||
207 | /* bits for CCRn */ | ||
208 | #define TX4938_DMA_CCR_IMMCHN 0x20000000 | ||
209 | #define TX4938_DMA_CCR_USEXFSZ 0x10000000 | ||
210 | #define TX4938_DMA_CCR_LE 0x08000000 | ||
211 | #define TX4938_DMA_CCR_DBINH 0x04000000 | ||
212 | #define TX4938_DMA_CCR_SBINH 0x02000000 | ||
213 | #define TX4938_DMA_CCR_CHRST 0x01000000 | ||
214 | #define TX4938_DMA_CCR_RVBYTE 0x00800000 | ||
215 | #define TX4938_DMA_CCR_ACKPOL 0x00400000 | ||
216 | #define TX4938_DMA_CCR_REQPL 0x00200000 | ||
217 | #define TX4938_DMA_CCR_EGREQ 0x00100000 | ||
218 | #define TX4938_DMA_CCR_CHDN 0x00080000 | ||
219 | #define TX4938_DMA_CCR_DNCTL 0x00060000 | ||
220 | #define TX4938_DMA_CCR_EXTRQ 0x00010000 | ||
221 | #define TX4938_DMA_CCR_INTRQD 0x0000e000 | ||
222 | #define TX4938_DMA_CCR_INTENE 0x00001000 | ||
223 | #define TX4938_DMA_CCR_INTENC 0x00000800 | ||
224 | #define TX4938_DMA_CCR_INTENT 0x00000400 | ||
225 | #define TX4938_DMA_CCR_CHNEN 0x00000200 | ||
226 | #define TX4938_DMA_CCR_XFACT 0x00000100 | ||
227 | #define TX4938_DMA_CCR_SMPCHN 0x00000020 | ||
228 | #define TX4938_DMA_CCR_XFSZ(order) (((order) << 2) & 0x0000001c) | ||
229 | #define TX4938_DMA_CCR_XFSZ_1W TX4938_DMA_CCR_XFSZ(2) | ||
230 | #define TX4938_DMA_CCR_XFSZ_2W TX4938_DMA_CCR_XFSZ(3) | ||
231 | #define TX4938_DMA_CCR_XFSZ_4W TX4938_DMA_CCR_XFSZ(4) | ||
232 | #define TX4938_DMA_CCR_XFSZ_8W TX4938_DMA_CCR_XFSZ(5) | ||
233 | #define TX4938_DMA_CCR_XFSZ_16W TX4938_DMA_CCR_XFSZ(6) | ||
234 | #define TX4938_DMA_CCR_XFSZ_32W TX4938_DMA_CCR_XFSZ(7) | ||
235 | #define TX4938_DMA_CCR_MEMIO 0x00000002 | ||
236 | #define TX4938_DMA_CCR_SNGAD 0x00000001 | ||
237 | |||
238 | /* bits for CSRn */ | ||
239 | #define TX4938_DMA_CSR_CHNEN 0x00000400 | ||
240 | #define TX4938_DMA_CSR_STLXFER 0x00000200 | ||
241 | #define TX4938_DMA_CSR_CHNACT 0x00000100 | ||
242 | #define TX4938_DMA_CSR_ABCHC 0x00000080 | ||
243 | #define TX4938_DMA_CSR_NCHNC 0x00000040 | ||
244 | #define TX4938_DMA_CSR_NTRNFC 0x00000020 | ||
245 | #define TX4938_DMA_CSR_EXTDN 0x00000010 | ||
246 | #define TX4938_DMA_CSR_CFERR 0x00000008 | ||
247 | #define TX4938_DMA_CSR_CHERR 0x00000004 | ||
248 | #define TX4938_DMA_CSR_DESERR 0x00000002 | ||
249 | #define TX4938_DMA_CSR_SORERR 0x00000001 | ||
250 | |||
251 | #define tx4938_sdramcptr tx4927_sdramcptr | ||
252 | #define tx4938_ebuscptr tx4927_ebuscptr | ||
253 | #define tx4938_pcicptr tx4927_pcicptr | ||
254 | #define tx4938_pcic1ptr \ | ||
255 | ((struct tx4927_pcic_reg __iomem *)TX4938_PCIC1_REG) | ||
256 | #define tx4938_ccfgptr \ | ||
257 | ((struct tx4938_ccfg_reg __iomem *)TX4938_CCFG_REG) | ||
258 | #define tx4938_pioptr ((struct txx9_pio_reg __iomem *)TX4938_PIO_REG) | ||
259 | #define tx4938_sramcptr \ | ||
260 | ((struct tx4938_sramc_reg __iomem *)TX4938_SRAMC_REG) | ||
261 | |||
262 | |||
263 | #define TX4938_REV_PCODE() \ | ||
264 | ((__u32)__raw_readq(&tx4938_ccfgptr->crir) >> 16) | ||
265 | |||
266 | #define tx4938_ccfg_clear(bits) tx4927_ccfg_clear(bits) | ||
267 | #define tx4938_ccfg_set(bits) tx4927_ccfg_set(bits) | ||
268 | #define tx4938_ccfg_change(change, new) tx4927_ccfg_change(change, new) | ||
269 | |||
270 | #define TX4938_SDRAMC_CR(ch) TX4927_SDRAMC_CR(ch) | ||
271 | #define TX4938_SDRAMC_BA(ch) TX4927_SDRAMC_BA(ch) | ||
272 | #define TX4938_SDRAMC_SIZE(ch) TX4927_SDRAMC_SIZE(ch) | ||
273 | |||
274 | #define TX4938_EBUSC_CR(ch) TX4927_EBUSC_CR(ch) | ||
275 | #define TX4938_EBUSC_BA(ch) TX4927_EBUSC_BA(ch) | ||
276 | #define TX4938_EBUSC_SIZE(ch) TX4927_EBUSC_SIZE(ch) | ||
277 | #define TX4938_EBUSC_WIDTH(ch) TX4927_EBUSC_WIDTH(ch) | ||
278 | |||
279 | #define tx4938_get_mem_size() tx4927_get_mem_size() | ||
280 | void tx4938_wdt_init(void); | ||
281 | void tx4938_setup(void); | ||
282 | void tx4938_time_init(unsigned int tmrnr); | ||
283 | void tx4938_sio_init(unsigned int sclk, unsigned int cts_mask); | ||
284 | void tx4938_spi_init(int busid); | ||
285 | void tx4938_ethaddr_init(unsigned char *addr0, unsigned char *addr1); | ||
286 | int tx4938_report_pciclk(void); | ||
287 | void tx4938_report_pci1clk(void); | ||
288 | int tx4938_pciclk66_setup(void); | ||
289 | struct pci_dev; | ||
290 | int tx4938_pcic1_map_irq(const struct pci_dev *dev, u8 slot); | ||
291 | void tx4938_setup_pcierr_irq(void); | ||
292 | void tx4938_irq_init(void); | ||
293 | void tx4938_mtd_init(int ch); | ||
294 | |||
295 | #endif | ||
diff --git a/include/asm-mips/txx9/tx4939.h b/include/asm-mips/txx9/tx4939.h deleted file mode 100644 index 7ce2dff3b7cc..000000000000 --- a/include/asm-mips/txx9/tx4939.h +++ /dev/null | |||
@@ -1,544 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for TX4939 | ||
3 | * | ||
4 | * Copyright (C) 2000-2001,2005-2006 Toshiba Corporation | ||
5 | * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the | ||
6 | * terms of the GNU General Public License version 2. This program is | ||
7 | * licensed "as is" without any warranty of any kind, whether express | ||
8 | * or implied. | ||
9 | */ | ||
10 | #ifndef __ASM_TXX9_TX4939_H | ||
11 | #define __ASM_TXX9_TX4939_H | ||
12 | |||
13 | /* some controllers are compatible with 4927/4938 */ | ||
14 | #include <asm/txx9/tx4938.h> | ||
15 | |||
16 | #ifdef CONFIG_64BIT | ||
17 | #define TX4939_REG_BASE 0xffffffffff1f0000UL /* == TX4938_REG_BASE */ | ||
18 | #else | ||
19 | #define TX4939_REG_BASE 0xff1f0000UL /* == TX4938_REG_BASE */ | ||
20 | #endif | ||
21 | #define TX4939_REG_SIZE 0x00010000 /* == TX4938_REG_SIZE */ | ||
22 | |||
23 | #define TX4939_ATA_REG(ch) (TX4939_REG_BASE + 0x3000 + (ch) * 0x1000) | ||
24 | #define TX4939_NDFMC_REG (TX4939_REG_BASE + 0x5000) | ||
25 | #define TX4939_SRAMC_REG (TX4939_REG_BASE + 0x6000) | ||
26 | #define TX4939_CRYPTO_REG (TX4939_REG_BASE + 0x6800) | ||
27 | #define TX4939_PCIC1_REG (TX4939_REG_BASE + 0x7000) | ||
28 | #define TX4939_DDRC_REG (TX4939_REG_BASE + 0x8000) | ||
29 | #define TX4939_EBUSC_REG (TX4939_REG_BASE + 0x9000) | ||
30 | #define TX4939_VPC_REG (TX4939_REG_BASE + 0xa000) | ||
31 | #define TX4939_DMA_REG(ch) (TX4939_REG_BASE + 0xb000 + (ch) * 0x800) | ||
32 | #define TX4939_PCIC_REG (TX4939_REG_BASE + 0xd000) | ||
33 | #define TX4939_CCFG_REG (TX4939_REG_BASE + 0xe000) | ||
34 | #define TX4939_IRC_REG (TX4939_REG_BASE + 0xe800) | ||
35 | #define TX4939_NR_TMR 6 /* 0xf000,0xf100,0xf200,0xfd00,0xfe00,0xff00 */ | ||
36 | #define TX4939_TMR_REG(ch) \ | ||
37 | (TX4939_REG_BASE + 0xf000 + ((ch) + ((ch) >= 3) * 10) * 0x100) | ||
38 | #define TX4939_NR_SIO 4 /* 0xf300, 0xf400, 0xf380, 0xf480 */ | ||
39 | #define TX4939_SIO_REG(ch) \ | ||
40 | (TX4939_REG_BASE + 0xf300 + (((ch) & 1) << 8) + (((ch) & 2) << 6)) | ||
41 | #define TX4939_ACLC_REG (TX4939_REG_BASE + 0xf700) | ||
42 | #define TX4939_SPI_REG (TX4939_REG_BASE + 0xf800) | ||
43 | #define TX4939_I2C_REG (TX4939_REG_BASE + 0xf900) | ||
44 | #define TX4939_I2S_REG (TX4939_REG_BASE + 0xfa00) | ||
45 | #define TX4939_RTC_REG (TX4939_REG_BASE + 0xfb00) | ||
46 | #define TX4939_CIR_REG (TX4939_REG_BASE + 0xfc00) | ||
47 | |||
48 | struct tx4939_le_reg { | ||
49 | __u32 r; | ||
50 | __u32 unused; | ||
51 | }; | ||
52 | |||
53 | struct tx4939_ddrc_reg { | ||
54 | struct tx4939_le_reg ctl[47]; | ||
55 | __u64 unused0[17]; | ||
56 | __u64 winen; | ||
57 | __u64 win[4]; | ||
58 | }; | ||
59 | |||
60 | struct tx4939_ccfg_reg { | ||
61 | __u64 ccfg; | ||
62 | __u64 crir; | ||
63 | __u64 pcfg; | ||
64 | __u64 toea; | ||
65 | __u64 clkctr; | ||
66 | __u64 unused0; | ||
67 | __u64 garbc; | ||
68 | __u64 unused1[2]; | ||
69 | __u64 ramp; | ||
70 | __u64 unused2[2]; | ||
71 | __u64 dskwctrl; | ||
72 | __u64 mclkosc; | ||
73 | __u64 mclkctl; | ||
74 | __u64 unused3[17]; | ||
75 | struct { | ||
76 | __u64 mr; | ||
77 | __u64 dr; | ||
78 | } gpio[2]; | ||
79 | }; | ||
80 | |||
81 | struct tx4939_irc_reg { | ||
82 | struct tx4939_le_reg den; | ||
83 | struct tx4939_le_reg scipb; | ||
84 | struct tx4939_le_reg dm[2]; | ||
85 | struct tx4939_le_reg lvl[16]; | ||
86 | struct tx4939_le_reg msk; | ||
87 | struct tx4939_le_reg edc; | ||
88 | struct tx4939_le_reg pnd0; | ||
89 | struct tx4939_le_reg cs; | ||
90 | struct tx4939_le_reg pnd1; | ||
91 | struct tx4939_le_reg dm2[2]; | ||
92 | struct tx4939_le_reg dbr[2]; | ||
93 | struct tx4939_le_reg dben; | ||
94 | struct tx4939_le_reg unused0[2]; | ||
95 | struct tx4939_le_reg flag[2]; | ||
96 | struct tx4939_le_reg pol; | ||
97 | struct tx4939_le_reg cnt; | ||
98 | struct tx4939_le_reg maskint; | ||
99 | struct tx4939_le_reg maskext; | ||
100 | }; | ||
101 | |||
102 | struct tx4939_rtc_reg { | ||
103 | __u32 ctl; | ||
104 | __u32 adr; | ||
105 | __u32 dat; | ||
106 | __u32 tbc; | ||
107 | }; | ||
108 | |||
109 | struct tx4939_crypto_reg { | ||
110 | struct tx4939_le_reg csr; | ||
111 | struct tx4939_le_reg idesptr; | ||
112 | struct tx4939_le_reg cdesptr; | ||
113 | struct tx4939_le_reg buserr; | ||
114 | struct tx4939_le_reg cip_tout; | ||
115 | struct tx4939_le_reg cir; | ||
116 | union { | ||
117 | struct { | ||
118 | struct tx4939_le_reg data[8]; | ||
119 | struct tx4939_le_reg ctrl; | ||
120 | } gen; | ||
121 | struct { | ||
122 | struct { | ||
123 | struct tx4939_le_reg l; | ||
124 | struct tx4939_le_reg u; | ||
125 | } key[3], ini; | ||
126 | struct tx4939_le_reg ctrl; | ||
127 | } des; | ||
128 | struct { | ||
129 | struct tx4939_le_reg key[4]; | ||
130 | struct tx4939_le_reg ini[4]; | ||
131 | struct tx4939_le_reg ctrl; | ||
132 | } aes; | ||
133 | struct { | ||
134 | struct { | ||
135 | struct tx4939_le_reg l; | ||
136 | struct tx4939_le_reg u; | ||
137 | } cnt; | ||
138 | struct tx4939_le_reg ini[5]; | ||
139 | struct tx4939_le_reg unused; | ||
140 | struct tx4939_le_reg ctrl; | ||
141 | } hash; | ||
142 | } cdr; | ||
143 | struct tx4939_le_reg unused0[7]; | ||
144 | struct tx4939_le_reg rcsr; | ||
145 | struct tx4939_le_reg rpr; | ||
146 | __u64 rdr; | ||
147 | __u64 ror[3]; | ||
148 | struct tx4939_le_reg unused1[2]; | ||
149 | struct tx4939_le_reg xorslr; | ||
150 | struct tx4939_le_reg xorsur; | ||
151 | }; | ||
152 | |||
153 | struct tx4939_crypto_desc { | ||
154 | __u32 src; | ||
155 | __u32 dst; | ||
156 | __u32 next; | ||
157 | __u32 ctrl; | ||
158 | __u32 index; | ||
159 | __u32 xor; | ||
160 | }; | ||
161 | |||
162 | struct tx4939_vpc_reg { | ||
163 | struct tx4939_le_reg csr; | ||
164 | struct { | ||
165 | struct tx4939_le_reg ctrlA; | ||
166 | struct tx4939_le_reg ctrlB; | ||
167 | struct tx4939_le_reg idesptr; | ||
168 | struct tx4939_le_reg cdesptr; | ||
169 | } port[3]; | ||
170 | struct tx4939_le_reg buserr; | ||
171 | }; | ||
172 | |||
173 | struct tx4939_vpc_desc { | ||
174 | __u32 src; | ||
175 | __u32 next; | ||
176 | __u32 ctrl1; | ||
177 | __u32 ctrl2; | ||
178 | }; | ||
179 | |||
180 | /* | ||
181 | * IRC | ||
182 | */ | ||
183 | #define TX4939_IR_NONE 0 | ||
184 | #define TX4939_IR_DDR 1 | ||
185 | #define TX4939_IR_WTOERR 2 | ||
186 | #define TX4939_NUM_IR_INT 3 | ||
187 | #define TX4939_IR_INT(n) (3 + (n)) | ||
188 | #define TX4939_NUM_IR_ETH 2 | ||
189 | #define TX4939_IR_ETH(n) ((n) ? 43 : 6) | ||
190 | #define TX4939_IR_VIDEO 7 | ||
191 | #define TX4939_IR_CIR 8 | ||
192 | #define TX4939_NUM_IR_SIO 4 | ||
193 | #define TX4939_IR_SIO(n) ((n) ? 43 + (n) : 9) /* 9,44-46 */ | ||
194 | #define TX4939_NUM_IR_DMA 4 | ||
195 | #define TX4939_IR_DMA(ch, n) (((ch) ? 22 : 10) + (n)) /* 10-13,22-25 */ | ||
196 | #define TX4939_IR_IRC 14 | ||
197 | #define TX4939_IR_PDMAC 15 | ||
198 | #define TX4939_NUM_IR_TMR 6 | ||
199 | #define TX4939_IR_TMR(n) (((n) >= 3 ? 45 : 16) + (n)) /* 16-18,48-50 */ | ||
200 | #define TX4939_NUM_IR_ATA 2 | ||
201 | #define TX4939_IR_ATA(n) (19 + (n)) | ||
202 | #define TX4939_IR_ACLC 21 | ||
203 | #define TX4939_IR_CIPHER 26 | ||
204 | #define TX4939_IR_INTA 27 | ||
205 | #define TX4939_IR_INTB 28 | ||
206 | #define TX4939_IR_INTC 29 | ||
207 | #define TX4939_IR_INTD 30 | ||
208 | #define TX4939_IR_I2C 33 | ||
209 | #define TX4939_IR_SPI 34 | ||
210 | #define TX4939_IR_PCIC 35 | ||
211 | #define TX4939_IR_PCIC1 36 | ||
212 | #define TX4939_IR_PCIERR 37 | ||
213 | #define TX4939_IR_PCIPME 38 | ||
214 | #define TX4939_IR_NDFMC 39 | ||
215 | #define TX4939_IR_ACLCPME 40 | ||
216 | #define TX4939_IR_RTC 41 | ||
217 | #define TX4939_IR_RND 42 | ||
218 | #define TX4939_IR_I2S 47 | ||
219 | #define TX4939_NUM_IR 64 | ||
220 | |||
221 | #define TX4939_IRC_INT 2 /* IP[2] in Status register */ | ||
222 | |||
223 | /* | ||
224 | * CCFG | ||
225 | */ | ||
226 | /* CCFG : Chip Configuration */ | ||
227 | #define TX4939_CCFG_PCIBOOT 0x0000040000000000ULL | ||
228 | #define TX4939_CCFG_WDRST 0x0000020000000000ULL | ||
229 | #define TX4939_CCFG_WDREXEN 0x0000010000000000ULL | ||
230 | #define TX4939_CCFG_BCFG_MASK 0x000000ff00000000ULL | ||
231 | #define TX4939_CCFG_GTOT_MASK 0x06000000 | ||
232 | #define TX4939_CCFG_GTOT_4096 0x06000000 | ||
233 | #define TX4939_CCFG_GTOT_2048 0x04000000 | ||
234 | #define TX4939_CCFG_GTOT_1024 0x02000000 | ||
235 | #define TX4939_CCFG_GTOT_512 0x00000000 | ||
236 | #define TX4939_CCFG_TINTDIS 0x01000000 | ||
237 | #define TX4939_CCFG_PCI66 0x00800000 | ||
238 | #define TX4939_CCFG_PCIMODE 0x00400000 | ||
239 | #define TX4939_CCFG_SSCG 0x00100000 | ||
240 | #define TX4939_CCFG_MULCLK_MASK 0x000e0000 | ||
241 | #define TX4939_CCFG_MULCLK_8 (0x7 << 17) | ||
242 | #define TX4939_CCFG_MULCLK_9 (0x0 << 17) | ||
243 | #define TX4939_CCFG_MULCLK_10 (0x1 << 17) | ||
244 | #define TX4939_CCFG_MULCLK_11 (0x2 << 17) | ||
245 | #define TX4939_CCFG_MULCLK_12 (0x3 << 17) | ||
246 | #define TX4939_CCFG_MULCLK_13 (0x4 << 17) | ||
247 | #define TX4939_CCFG_MULCLK_14 (0x5 << 17) | ||
248 | #define TX4939_CCFG_MULCLK_15 (0x6 << 17) | ||
249 | #define TX4939_CCFG_BEOW 0x00010000 | ||
250 | #define TX4939_CCFG_WR 0x00008000 | ||
251 | #define TX4939_CCFG_TOE 0x00004000 | ||
252 | #define TX4939_CCFG_PCIARB 0x00002000 | ||
253 | #define TX4939_CCFG_YDIVMODE_MASK 0x00001c00 | ||
254 | #define TX4939_CCFG_YDIVMODE_2 (0x0 << 10) | ||
255 | #define TX4939_CCFG_YDIVMODE_3 (0x1 << 10) | ||
256 | #define TX4939_CCFG_YDIVMODE_5 (0x6 << 10) | ||
257 | #define TX4939_CCFG_YDIVMODE_6 (0x7 << 10) | ||
258 | #define TX4939_CCFG_PTSEL 0x00000200 | ||
259 | #define TX4939_CCFG_BESEL 0x00000100 | ||
260 | #define TX4939_CCFG_SYSSP_MASK 0x000000c0 | ||
261 | #define TX4939_CCFG_ACKSEL 0x00000020 | ||
262 | #define TX4939_CCFG_ROMW 0x00000010 | ||
263 | #define TX4939_CCFG_ENDIAN 0x00000004 | ||
264 | #define TX4939_CCFG_ARMODE 0x00000002 | ||
265 | #define TX4939_CCFG_ACEHOLD 0x00000001 | ||
266 | |||
267 | /* PCFG : Pin Configuration */ | ||
268 | #define TX4939_PCFG_SIO2MODE_MASK 0xc000000000000000ULL | ||
269 | #define TX4939_PCFG_SIO2MODE_GPIO 0x8000000000000000ULL | ||
270 | #define TX4939_PCFG_SIO2MODE_SIO2 0x4000000000000000ULL | ||
271 | #define TX4939_PCFG_SIO2MODE_SIO0 0x0000000000000000ULL | ||
272 | #define TX4939_PCFG_SPIMODE 0x2000000000000000ULL | ||
273 | #define TX4939_PCFG_I2CMODE 0x1000000000000000ULL | ||
274 | #define TX4939_PCFG_I2SMODE_MASK 0x0c00000000000000ULL | ||
275 | #define TX4939_PCFG_I2SMODE_GPIO 0x0c00000000000000ULL | ||
276 | #define TX4939_PCFG_I2SMODE_I2S 0x0800000000000000ULL | ||
277 | #define TX4939_PCFG_I2SMODE_I2S_ALT 0x0400000000000000ULL | ||
278 | #define TX4939_PCFG_I2SMODE_ACLC 0x0000000000000000ULL | ||
279 | #define TX4939_PCFG_SIO3MODE 0x0200000000000000ULL | ||
280 | #define TX4939_PCFG_DMASEL3 0x0004000000000000ULL | ||
281 | #define TX4939_PCFG_DMASEL3_SIO0 0x0004000000000000ULL | ||
282 | #define TX4939_PCFG_DMASEL3_NDFC 0x0000000000000000ULL | ||
283 | #define TX4939_PCFG_VSSMODE 0x0000200000000000ULL | ||
284 | #define TX4939_PCFG_VPSMODE 0x0000100000000000ULL | ||
285 | #define TX4939_PCFG_ET1MODE 0x0000080000000000ULL | ||
286 | #define TX4939_PCFG_ET0MODE 0x0000040000000000ULL | ||
287 | #define TX4939_PCFG_ATA1MODE 0x0000020000000000ULL | ||
288 | #define TX4939_PCFG_ATA0MODE 0x0000010000000000ULL | ||
289 | #define TX4939_PCFG_BP_PLL 0x0000000100000000ULL | ||
290 | |||
291 | #define TX4939_PCFG_SYSCLKEN 0x08000000 | ||
292 | #define TX4939_PCFG_PCICLKEN_ALL 0x000f0000 | ||
293 | #define TX4939_PCFG_PCICLKEN(ch) (0x00010000<<(ch)) | ||
294 | #define TX4939_PCFG_SPEED1 0x00002000 | ||
295 | #define TX4939_PCFG_SPEED0 0x00001000 | ||
296 | #define TX4939_PCFG_ITMODE 0x00000300 | ||
297 | #define TX4939_PCFG_DMASEL_ALL (0x00000007 | TX4939_PCFG_DMASEL3) | ||
298 | #define TX4939_PCFG_DMASEL2 0x00000004 | ||
299 | #define TX4939_PCFG_DMASEL2_DRQ2 0x00000000 | ||
300 | #define TX4939_PCFG_DMASEL2_SIO0 0x00000004 | ||
301 | #define TX4939_PCFG_DMASEL1 0x00000002 | ||
302 | #define TX4939_PCFG_DMASEL1_DRQ1 0x00000000 | ||
303 | #define TX4939_PCFG_DMASEL0 0x00000001 | ||
304 | #define TX4939_PCFG_DMASEL0_DRQ0 0x00000000 | ||
305 | |||
306 | /* CLKCTR : Clock Control */ | ||
307 | #define TX4939_CLKCTR_IOSCKD 0x8000000000000000ULL | ||
308 | #define TX4939_CLKCTR_SYSCKD 0x4000000000000000ULL | ||
309 | #define TX4939_CLKCTR_TM5CKD 0x2000000000000000ULL | ||
310 | #define TX4939_CLKCTR_TM4CKD 0x1000000000000000ULL | ||
311 | #define TX4939_CLKCTR_TM3CKD 0x0800000000000000ULL | ||
312 | #define TX4939_CLKCTR_CIRCKD 0x0400000000000000ULL | ||
313 | #define TX4939_CLKCTR_SIO3CKD 0x0200000000000000ULL | ||
314 | #define TX4939_CLKCTR_SIO2CKD 0x0100000000000000ULL | ||
315 | #define TX4939_CLKCTR_SIO1CKD 0x0080000000000000ULL | ||
316 | #define TX4939_CLKCTR_VPCCKD 0x0040000000000000ULL | ||
317 | #define TX4939_CLKCTR_EPCICKD 0x0020000000000000ULL | ||
318 | #define TX4939_CLKCTR_ETH1CKD 0x0008000000000000ULL | ||
319 | #define TX4939_CLKCTR_ATA1CKD 0x0004000000000000ULL | ||
320 | #define TX4939_CLKCTR_BROMCKD 0x0002000000000000ULL | ||
321 | #define TX4939_CLKCTR_NDCCKD 0x0001000000000000ULL | ||
322 | #define TX4939_CLKCTR_I2CCKD 0x0000800000000000ULL | ||
323 | #define TX4939_CLKCTR_ETH0CKD 0x0000400000000000ULL | ||
324 | #define TX4939_CLKCTR_SPICKD 0x0000200000000000ULL | ||
325 | #define TX4939_CLKCTR_SRAMCKD 0x0000100000000000ULL | ||
326 | #define TX4939_CLKCTR_PCI1CKD 0x0000080000000000ULL | ||
327 | #define TX4939_CLKCTR_DMA1CKD 0x0000040000000000ULL | ||
328 | #define TX4939_CLKCTR_ACLCKD 0x0000020000000000ULL | ||
329 | #define TX4939_CLKCTR_ATA0CKD 0x0000010000000000ULL | ||
330 | #define TX4939_CLKCTR_DMA0CKD 0x0000008000000000ULL | ||
331 | #define TX4939_CLKCTR_PCICCKD 0x0000004000000000ULL | ||
332 | #define TX4939_CLKCTR_I2SCKD 0x0000002000000000ULL | ||
333 | #define TX4939_CLKCTR_TM0CKD 0x0000001000000000ULL | ||
334 | #define TX4939_CLKCTR_TM1CKD 0x0000000800000000ULL | ||
335 | #define TX4939_CLKCTR_TM2CKD 0x0000000400000000ULL | ||
336 | #define TX4939_CLKCTR_SIO0CKD 0x0000000200000000ULL | ||
337 | #define TX4939_CLKCTR_CYPCKD 0x0000000100000000ULL | ||
338 | #define TX4939_CLKCTR_IOSRST 0x80000000 | ||
339 | #define TX4939_CLKCTR_SYSRST 0x40000000 | ||
340 | #define TX4939_CLKCTR_TM5RST 0x20000000 | ||
341 | #define TX4939_CLKCTR_TM4RST 0x10000000 | ||
342 | #define TX4939_CLKCTR_TM3RST 0x08000000 | ||
343 | #define TX4939_CLKCTR_CIRRST 0x04000000 | ||
344 | #define TX4939_CLKCTR_SIO3RST 0x02000000 | ||
345 | #define TX4939_CLKCTR_SIO2RST 0x01000000 | ||
346 | #define TX4939_CLKCTR_SIO1RST 0x00800000 | ||
347 | #define TX4939_CLKCTR_VPCRST 0x00400000 | ||
348 | #define TX4939_CLKCTR_EPCIRST 0x00200000 | ||
349 | #define TX4939_CLKCTR_ETH1RST 0x00080000 | ||
350 | #define TX4939_CLKCTR_ATA1RST 0x00040000 | ||
351 | #define TX4939_CLKCTR_BROMRST 0x00020000 | ||
352 | #define TX4939_CLKCTR_NDCRST 0x00010000 | ||
353 | #define TX4939_CLKCTR_I2CRST 0x00008000 | ||
354 | #define TX4939_CLKCTR_ETH0RST 0x00004000 | ||
355 | #define TX4939_CLKCTR_SPIRST 0x00002000 | ||
356 | #define TX4939_CLKCTR_SRAMRST 0x00001000 | ||
357 | #define TX4939_CLKCTR_PCI1RST 0x00000800 | ||
358 | #define TX4939_CLKCTR_DMA1RST 0x00000400 | ||
359 | #define TX4939_CLKCTR_ACLRST 0x00000200 | ||
360 | #define TX4939_CLKCTR_ATA0RST 0x00000100 | ||
361 | #define TX4939_CLKCTR_DMA0RST 0x00000080 | ||
362 | #define TX4939_CLKCTR_PCICRST 0x00000040 | ||
363 | #define TX4939_CLKCTR_I2SRST 0x00000020 | ||
364 | #define TX4939_CLKCTR_TM0RST 0x00000010 | ||
365 | #define TX4939_CLKCTR_TM1RST 0x00000008 | ||
366 | #define TX4939_CLKCTR_TM2RST 0x00000004 | ||
367 | #define TX4939_CLKCTR_SIO0RST 0x00000002 | ||
368 | #define TX4939_CLKCTR_CYPRST 0x00000001 | ||
369 | |||
370 | /* | ||
371 | * RTC | ||
372 | */ | ||
373 | #define TX4939_RTCCTL_ALME 0x00000080 | ||
374 | #define TX4939_RTCCTL_ALMD 0x00000040 | ||
375 | #define TX4939_RTCCTL_BUSY 0x00000020 | ||
376 | |||
377 | #define TX4939_RTCCTL_COMMAND 0x00000007 | ||
378 | #define TX4939_RTCCTL_COMMAND_NOP 0x00000000 | ||
379 | #define TX4939_RTCCTL_COMMAND_GETTIME 0x00000001 | ||
380 | #define TX4939_RTCCTL_COMMAND_SETTIME 0x00000002 | ||
381 | #define TX4939_RTCCTL_COMMAND_GETALARM 0x00000003 | ||
382 | #define TX4939_RTCCTL_COMMAND_SETALARM 0x00000004 | ||
383 | |||
384 | #define TX4939_RTCTBC_PM 0x00000080 | ||
385 | #define TX4939_RTCTBC_COMP 0x0000007f | ||
386 | |||
387 | #define TX4939_RTC_REG_RAMSIZE 0x00000100 | ||
388 | #define TX4939_RTC_REG_RWBSIZE 0x00000006 | ||
389 | |||
390 | /* | ||
391 | * CRYPTO | ||
392 | */ | ||
393 | #define TX4939_CRYPTO_CSR_SAESO 0x08000000 | ||
394 | #define TX4939_CRYPTO_CSR_SAESI 0x04000000 | ||
395 | #define TX4939_CRYPTO_CSR_SDESO 0x02000000 | ||
396 | #define TX4939_CRYPTO_CSR_SDESI 0x01000000 | ||
397 | #define TX4939_CRYPTO_CSR_INDXBST_MASK 0x00700000 | ||
398 | #define TX4939_CRYPTO_CSR_INDXBST(n) ((n) << 20) | ||
399 | #define TX4939_CRYPTO_CSR_TOINT 0x00080000 | ||
400 | #define TX4939_CRYPTO_CSR_DCINT 0x00040000 | ||
401 | #define TX4939_CRYPTO_CSR_GBINT 0x00010000 | ||
402 | #define TX4939_CRYPTO_CSR_INDXAST_MASK 0x0000e000 | ||
403 | #define TX4939_CRYPTO_CSR_INDXAST(n) ((n) << 13) | ||
404 | #define TX4939_CRYPTO_CSR_CSWAP_MASK 0x00001800 | ||
405 | #define TX4939_CRYPTO_CSR_CSWAP_NONE 0x00000000 | ||
406 | #define TX4939_CRYPTO_CSR_CSWAP_IN 0x00000800 | ||
407 | #define TX4939_CRYPTO_CSR_CSWAP_OUT 0x00001000 | ||
408 | #define TX4939_CRYPTO_CSR_CSWAP_BOTH 0x00001800 | ||
409 | #define TX4939_CRYPTO_CSR_CDIV_MASK 0x00000600 | ||
410 | #define TX4939_CRYPTO_CSR_CDIV_DIV2 0x00000000 | ||
411 | #define TX4939_CRYPTO_CSR_CDIV_DIV1 0x00000200 | ||
412 | #define TX4939_CRYPTO_CSR_CDIV_DIV2ALT 0x00000400 | ||
413 | #define TX4939_CRYPTO_CSR_CDIV_DIV1ALT 0x00000600 | ||
414 | #define TX4939_CRYPTO_CSR_PDINT_MASK 0x000000c0 | ||
415 | #define TX4939_CRYPTO_CSR_PDINT_ALL 0x00000000 | ||
416 | #define TX4939_CRYPTO_CSR_PDINT_END 0x00000040 | ||
417 | #define TX4939_CRYPTO_CSR_PDINT_NEXT 0x00000080 | ||
418 | #define TX4939_CRYPTO_CSR_PDINT_NONE 0x000000c0 | ||
419 | #define TX4939_CRYPTO_CSR_GINTE 0x00000008 | ||
420 | #define TX4939_CRYPTO_CSR_RSTD 0x00000004 | ||
421 | #define TX4939_CRYPTO_CSR_RSTC 0x00000002 | ||
422 | #define TX4939_CRYPTO_CSR_ENCR 0x00000001 | ||
423 | |||
424 | /* bits for tx4939_crypto_reg.cdr.gen.ctrl */ | ||
425 | #define TX4939_CRYPTO_CTX_ENGINE_MASK 0x00000003 | ||
426 | #define TX4939_CRYPTO_CTX_ENGINE_DES 0x00000000 | ||
427 | #define TX4939_CRYPTO_CTX_ENGINE_AES 0x00000001 | ||
428 | #define TX4939_CRYPTO_CTX_ENGINE_MD5 0x00000002 | ||
429 | #define TX4939_CRYPTO_CTX_ENGINE_SHA1 0x00000003 | ||
430 | #define TX4939_CRYPTO_CTX_TDMS 0x00000010 | ||
431 | #define TX4939_CRYPTO_CTX_CMS 0x00000020 | ||
432 | #define TX4939_CRYPTO_CTX_DMS 0x00000040 | ||
433 | #define TX4939_CRYPTO_CTX_UPDATE 0x00000080 | ||
434 | |||
435 | /* bits for tx4939_crypto_desc.ctrl */ | ||
436 | #define TX4939_CRYPTO_DESC_OB_CNT_MASK 0xffe00000 | ||
437 | #define TX4939_CRYPTO_DESC_OB_CNT(cnt) ((cnt) << 21) | ||
438 | #define TX4939_CRYPTO_DESC_IB_CNT_MASK 0x001ffc00 | ||
439 | #define TX4939_CRYPTO_DESC_IB_CNT(cnt) ((cnt) << 10) | ||
440 | #define TX4939_CRYPTO_DESC_START 0x00000200 | ||
441 | #define TX4939_CRYPTO_DESC_END 0x00000100 | ||
442 | #define TX4939_CRYPTO_DESC_XOR 0x00000010 | ||
443 | #define TX4939_CRYPTO_DESC_LAST 0x00000008 | ||
444 | #define TX4939_CRYPTO_DESC_ERR_MASK 0x00000006 | ||
445 | #define TX4939_CRYPTO_DESC_ERR_NONE 0x00000000 | ||
446 | #define TX4939_CRYPTO_DESC_ERR_TOUT 0x00000002 | ||
447 | #define TX4939_CRYPTO_DESC_ERR_DIGEST 0x00000004 | ||
448 | #define TX4939_CRYPTO_DESC_OWN 0x00000001 | ||
449 | |||
450 | /* bits for tx4939_crypto_desc.index */ | ||
451 | #define TX4939_CRYPTO_DESC_HASH_IDX_MASK 0x00000070 | ||
452 | #define TX4939_CRYPTO_DESC_HASH_IDX(idx) ((idx) << 4) | ||
453 | #define TX4939_CRYPTO_DESC_ENCRYPT_IDX_MASK 0x00000007 | ||
454 | #define TX4939_CRYPTO_DESC_ENCRYPT_IDX(idx) ((idx) << 0) | ||
455 | |||
456 | #define TX4939_CRYPTO_NR_SET 6 | ||
457 | |||
458 | #define TX4939_CRYPTO_RCSR_INTE 0x00000008 | ||
459 | #define TX4939_CRYPTO_RCSR_RST 0x00000004 | ||
460 | #define TX4939_CRYPTO_RCSR_FIN 0x00000002 | ||
461 | #define TX4939_CRYPTO_RCSR_ST 0x00000001 | ||
462 | |||
463 | /* | ||
464 | * VPC | ||
465 | */ | ||
466 | #define TX4939_VPC_CSR_GBINT 0x00010000 | ||
467 | #define TX4939_VPC_CSR_SWAPO 0x00000020 | ||
468 | #define TX4939_VPC_CSR_SWAPI 0x00000010 | ||
469 | #define TX4939_VPC_CSR_GINTE 0x00000008 | ||
470 | #define TX4939_VPC_CSR_RSTD 0x00000004 | ||
471 | #define TX4939_VPC_CSR_RSTVPC 0x00000002 | ||
472 | |||
473 | #define TX4939_VPC_CTRLA_VDPSN 0x00000200 | ||
474 | #define TX4939_VPC_CTRLA_PBUSY 0x00000100 | ||
475 | #define TX4939_VPC_CTRLA_DCINT 0x00000080 | ||
476 | #define TX4939_VPC_CTRLA_UOINT 0x00000040 | ||
477 | #define TX4939_VPC_CTRLA_PDINT_MASK 0x00000030 | ||
478 | #define TX4939_VPC_CTRLA_PDINT_ALL 0x00000000 | ||
479 | #define TX4939_VPC_CTRLA_PDINT_NEXT 0x00000010 | ||
480 | #define TX4939_VPC_CTRLA_PDINT_NONE 0x00000030 | ||
481 | #define TX4939_VPC_CTRLA_VDVLDP 0x00000008 | ||
482 | #define TX4939_VPC_CTRLA_VDMODE 0x00000004 | ||
483 | #define TX4939_VPC_CTRLA_VDFOR 0x00000002 | ||
484 | #define TX4939_VPC_CTRLA_ENVPC 0x00000001 | ||
485 | |||
486 | /* bits for tx4939_vpc_desc.ctrl1 */ | ||
487 | #define TX4939_VPC_DESC_CTRL1_ERR_MASK 0x00000006 | ||
488 | #define TX4939_VPC_DESC_CTRL1_OWN 0x00000001 | ||
489 | |||
490 | #define tx4939_ddrcptr ((struct tx4939_ddrc_reg __iomem *)TX4939_DDRC_REG) | ||
491 | #define tx4939_ebuscptr tx4938_ebuscptr | ||
492 | #define tx4939_ircptr \ | ||
493 | ((struct tx4939_irc_reg __iomem *)TX4939_IRC_REG) | ||
494 | #define tx4939_pcicptr tx4938_pcicptr | ||
495 | #define tx4939_pcic1ptr tx4938_pcic1ptr | ||
496 | #define tx4939_ccfgptr \ | ||
497 | ((struct tx4939_ccfg_reg __iomem *)TX4939_CCFG_REG) | ||
498 | #define tx4939_sramcptr tx4938_sramcptr | ||
499 | #define tx4939_rtcptr \ | ||
500 | ((struct tx4939_rtc_reg __iomem *)TX4939_RTC_REG) | ||
501 | #define tx4939_cryptoptr \ | ||
502 | ((struct tx4939_crypto_reg __iomem *)TX4939_CRYPTO_REG) | ||
503 | #define tx4939_vpcptr ((struct tx4939_vpc_reg __iomem *)TX4939_VPC_REG) | ||
504 | |||
505 | #define TX4939_REV_MAJ_MIN() \ | ||
506 | ((__u32)__raw_readq(&tx4939_ccfgptr->crir) & 0x00ff) | ||
507 | #define TX4939_REV_PCODE() \ | ||
508 | ((__u32)__raw_readq(&tx4939_ccfgptr->crir) >> 16) | ||
509 | #define TX4939_CCFG_BCFG() \ | ||
510 | ((__u32)((__raw_readq(&tx4939_ccfgptr->ccfg) & TX4939_CCFG_BCFG_MASK) \ | ||
511 | >> 32)) | ||
512 | |||
513 | #define tx4939_ccfg_clear(bits) tx4938_ccfg_clear(bits) | ||
514 | #define tx4939_ccfg_set(bits) tx4938_ccfg_set(bits) | ||
515 | #define tx4939_ccfg_change(change, new) tx4938_ccfg_change(change, new) | ||
516 | |||
517 | #define TX4939_EBUSC_CR(ch) TX4927_EBUSC_CR(ch) | ||
518 | #define TX4939_EBUSC_BA(ch) TX4927_EBUSC_BA(ch) | ||
519 | #define TX4939_EBUSC_SIZE(ch) TX4927_EBUSC_SIZE(ch) | ||
520 | #define TX4939_EBUSC_WIDTH(ch) \ | ||
521 | (16 >> ((__u32)(TX4939_EBUSC_CR(ch) >> 20) & 0x1)) | ||
522 | |||
523 | /* SCLK0 = MSTCLK * 429/19 * 16/245 / 2 (14.745MHz for MST 20MHz) */ | ||
524 | #define TX4939_SCLK0(mst) \ | ||
525 | ((((mst) + 245/2) / 245UL * 429 * 16 + 19) / 19 / 2) | ||
526 | |||
527 | void tx4939_wdt_init(void); | ||
528 | void tx4939_add_memory_regions(void); | ||
529 | void tx4939_setup(void); | ||
530 | void tx4939_time_init(unsigned int tmrnr); | ||
531 | void tx4939_sio_init(unsigned int sclk, unsigned int cts_mask); | ||
532 | void tx4939_spi_init(int busid); | ||
533 | void tx4939_ethaddr_init(unsigned char *addr0, unsigned char *addr1); | ||
534 | int tx4939_report_pciclk(void); | ||
535 | void tx4939_report_pci1clk(void); | ||
536 | struct pci_dev; | ||
537 | int tx4939_pcic1_map_irq(const struct pci_dev *dev, u8 slot); | ||
538 | int tx4939_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); | ||
539 | void tx4939_setup_pcierr_irq(void); | ||
540 | void tx4939_irq_init(void); | ||
541 | int tx4939_irq(void); | ||
542 | void tx4939_mtd_init(int ch); | ||
543 | |||
544 | #endif /* __ASM_TXX9_TX4939_H */ | ||
diff --git a/include/asm-mips/txx9irq.h b/include/asm-mips/txx9irq.h deleted file mode 100644 index 5620879be37f..000000000000 --- a/include/asm-mips/txx9irq.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/txx9irq.h | ||
3 | * TX39/TX49 interrupt controller definitions. | ||
4 | * | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | */ | ||
9 | #ifndef __ASM_TXX9IRQ_H | ||
10 | #define __ASM_TXX9IRQ_H | ||
11 | |||
12 | #include <irq.h> | ||
13 | |||
14 | #ifdef CONFIG_IRQ_CPU | ||
15 | #define TXX9_IRQ_BASE (MIPS_CPU_IRQ_BASE + 8) | ||
16 | #else | ||
17 | #ifdef CONFIG_I8259 | ||
18 | #define TXX9_IRQ_BASE (I8259A_IRQ_BASE + 16) | ||
19 | #else | ||
20 | #define TXX9_IRQ_BASE 0 | ||
21 | #endif | ||
22 | #endif | ||
23 | |||
24 | #ifdef CONFIG_CPU_TX39XX | ||
25 | #define TXx9_MAX_IR 16 | ||
26 | #else | ||
27 | #define TXx9_MAX_IR 32 | ||
28 | #endif | ||
29 | |||
30 | void txx9_irq_init(unsigned long baseaddr); | ||
31 | int txx9_irq(void); | ||
32 | int txx9_irq_set_pri(int irc_irq, int new_pri); | ||
33 | |||
34 | #endif /* __ASM_TXX9IRQ_H */ | ||
diff --git a/include/asm-mips/txx9pio.h b/include/asm-mips/txx9pio.h deleted file mode 100644 index 3d6fa9f8d513..000000000000 --- a/include/asm-mips/txx9pio.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/txx9pio.h | ||
3 | * TX39/TX49 PIO controller definitions. | ||
4 | * | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | */ | ||
9 | #ifndef __ASM_TXX9PIO_H | ||
10 | #define __ASM_TXX9PIO_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | struct txx9_pio_reg { | ||
15 | __u32 dout; | ||
16 | __u32 din; | ||
17 | __u32 dir; | ||
18 | __u32 od; | ||
19 | __u32 flag[2]; | ||
20 | __u32 pol; | ||
21 | __u32 intc; | ||
22 | __u32 maskcpu; | ||
23 | __u32 maskext; | ||
24 | }; | ||
25 | |||
26 | int txx9_gpio_init(unsigned long baseaddr, | ||
27 | unsigned int base, unsigned int num); | ||
28 | |||
29 | #endif /* __ASM_TXX9PIO_H */ | ||
diff --git a/include/asm-mips/txx9tmr.h b/include/asm-mips/txx9tmr.h deleted file mode 100644 index 67f70a8f09bd..000000000000 --- a/include/asm-mips/txx9tmr.h +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/txx9tmr.h | ||
3 | * TX39/TX49 timer controller definitions. | ||
4 | * | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | */ | ||
9 | #ifndef __ASM_TXX9TMR_H | ||
10 | #define __ASM_TXX9TMR_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | struct txx9_tmr_reg { | ||
15 | u32 tcr; | ||
16 | u32 tisr; | ||
17 | u32 cpra; | ||
18 | u32 cprb; | ||
19 | u32 itmr; | ||
20 | u32 unused0[3]; | ||
21 | u32 ccdr; | ||
22 | u32 unused1[3]; | ||
23 | u32 pgmr; | ||
24 | u32 unused2[3]; | ||
25 | u32 wtmr; | ||
26 | u32 unused3[43]; | ||
27 | u32 trr; | ||
28 | }; | ||
29 | |||
30 | /* TMTCR : Timer Control */ | ||
31 | #define TXx9_TMTCR_TCE 0x00000080 | ||
32 | #define TXx9_TMTCR_CCDE 0x00000040 | ||
33 | #define TXx9_TMTCR_CRE 0x00000020 | ||
34 | #define TXx9_TMTCR_ECES 0x00000008 | ||
35 | #define TXx9_TMTCR_CCS 0x00000004 | ||
36 | #define TXx9_TMTCR_TMODE_MASK 0x00000003 | ||
37 | #define TXx9_TMTCR_TMODE_ITVL 0x00000000 | ||
38 | #define TXx9_TMTCR_TMODE_PGEN 0x00000001 | ||
39 | #define TXx9_TMTCR_TMODE_WDOG 0x00000002 | ||
40 | |||
41 | /* TMTISR : Timer Int. Status */ | ||
42 | #define TXx9_TMTISR_TPIBS 0x00000004 | ||
43 | #define TXx9_TMTISR_TPIAS 0x00000002 | ||
44 | #define TXx9_TMTISR_TIIS 0x00000001 | ||
45 | |||
46 | /* TMITMR : Interval Timer Mode */ | ||
47 | #define TXx9_TMITMR_TIIE 0x00008000 | ||
48 | #define TXx9_TMITMR_TZCE 0x00000001 | ||
49 | |||
50 | /* TMWTMR : Watchdog Timer Mode */ | ||
51 | #define TXx9_TMWTMR_TWIE 0x00008000 | ||
52 | #define TXx9_TMWTMR_WDIS 0x00000080 | ||
53 | #define TXx9_TMWTMR_TWC 0x00000001 | ||
54 | |||
55 | void txx9_clocksource_init(unsigned long baseaddr, | ||
56 | unsigned int imbusclk); | ||
57 | void txx9_clockevent_init(unsigned long baseaddr, int irq, | ||
58 | unsigned int imbusclk); | ||
59 | void txx9_tmr_init(unsigned long baseaddr); | ||
60 | |||
61 | #ifdef CONFIG_CPU_TX39XX | ||
62 | #define TXX9_TIMER_BITS 24 | ||
63 | #else | ||
64 | #define TXX9_TIMER_BITS 32 | ||
65 | #endif | ||
66 | |||
67 | #endif /* __ASM_TXX9TMR_H */ | ||
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h deleted file mode 100644 index bcbb8d675af5..000000000000 --- a/include/asm-mips/types.h +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle | ||
7 | * Copyright (C) 1999 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_TYPES_H | ||
10 | #define _ASM_TYPES_H | ||
11 | |||
12 | #if _MIPS_SZLONG == 64 | ||
13 | # include <asm-generic/int-l64.h> | ||
14 | #else | ||
15 | # include <asm-generic/int-ll64.h> | ||
16 | #endif | ||
17 | |||
18 | #ifndef __ASSEMBLY__ | ||
19 | |||
20 | typedef unsigned short umode_t; | ||
21 | |||
22 | #endif /* __ASSEMBLY__ */ | ||
23 | |||
24 | /* | ||
25 | * These aren't exported outside the kernel to avoid name space clashes | ||
26 | */ | ||
27 | #ifdef __KERNEL__ | ||
28 | |||
29 | #define BITS_PER_LONG _MIPS_SZLONG | ||
30 | |||
31 | #ifndef __ASSEMBLY__ | ||
32 | |||
33 | #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \ | ||
34 | || defined(CONFIG_64BIT) | ||
35 | typedef u64 dma_addr_t; | ||
36 | #else | ||
37 | typedef u32 dma_addr_t; | ||
38 | #endif | ||
39 | typedef u64 dma64_addr_t; | ||
40 | |||
41 | /* | ||
42 | * Don't use phys_t. You've been warned. | ||
43 | */ | ||
44 | #ifdef CONFIG_64BIT_PHYS_ADDR | ||
45 | typedef unsigned long long phys_t; | ||
46 | #else | ||
47 | typedef unsigned long phys_t; | ||
48 | #endif | ||
49 | |||
50 | #endif /* __ASSEMBLY__ */ | ||
51 | |||
52 | #endif /* __KERNEL__ */ | ||
53 | |||
54 | #endif /* _ASM_TYPES_H */ | ||
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h deleted file mode 100644 index b895144d577a..000000000000 --- a/include/asm-mips/uaccess.h +++ /dev/null | |||
@@ -1,852 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 1997, 1998, 1999, 2000, 03, 04 by Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | * Copyright (C) 2007 Maciej W. Rozycki | ||
9 | */ | ||
10 | #ifndef _ASM_UACCESS_H | ||
11 | #define _ASM_UACCESS_H | ||
12 | |||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/errno.h> | ||
15 | #include <linux/thread_info.h> | ||
16 | #include <asm-generic/uaccess.h> | ||
17 | |||
18 | /* | ||
19 | * The fs value determines whether argument validity checking should be | ||
20 | * performed or not. If get_fs() == USER_DS, checking is performed, with | ||
21 | * get_fs() == KERNEL_DS, checking is bypassed. | ||
22 | * | ||
23 | * For historical reasons, these macros are grossly misnamed. | ||
24 | */ | ||
25 | #ifdef CONFIG_32BIT | ||
26 | |||
27 | #define __UA_LIMIT 0x80000000UL | ||
28 | |||
29 | #define __UA_ADDR ".word" | ||
30 | #define __UA_LA "la" | ||
31 | #define __UA_ADDU "addu" | ||
32 | #define __UA_t0 "$8" | ||
33 | #define __UA_t1 "$9" | ||
34 | |||
35 | #endif /* CONFIG_32BIT */ | ||
36 | |||
37 | #ifdef CONFIG_64BIT | ||
38 | |||
39 | #define __UA_LIMIT (- TASK_SIZE) | ||
40 | |||
41 | #define __UA_ADDR ".dword" | ||
42 | #define __UA_LA "dla" | ||
43 | #define __UA_ADDU "daddu" | ||
44 | #define __UA_t0 "$12" | ||
45 | #define __UA_t1 "$13" | ||
46 | |||
47 | #endif /* CONFIG_64BIT */ | ||
48 | |||
49 | /* | ||
50 | * USER_DS is a bitmask that has the bits set that may not be set in a valid | ||
51 | * userspace address. Note that we limit 32-bit userspace to 0x7fff8000 but | ||
52 | * the arithmetic we're doing only works if the limit is a power of two, so | ||
53 | * we use 0x80000000 here on 32-bit kernels. If a process passes an invalid | ||
54 | * address in this range it's the process's problem, not ours :-) | ||
55 | */ | ||
56 | |||
57 | #define KERNEL_DS ((mm_segment_t) { 0UL }) | ||
58 | #define USER_DS ((mm_segment_t) { __UA_LIMIT }) | ||
59 | |||
60 | #define VERIFY_READ 0 | ||
61 | #define VERIFY_WRITE 1 | ||
62 | |||
63 | #define get_ds() (KERNEL_DS) | ||
64 | #define get_fs() (current_thread_info()->addr_limit) | ||
65 | #define set_fs(x) (current_thread_info()->addr_limit = (x)) | ||
66 | |||
67 | #define segment_eq(a, b) ((a).seg == (b).seg) | ||
68 | |||
69 | |||
70 | /* | ||
71 | * Is a address valid? This does a straighforward calculation rather | ||
72 | * than tests. | ||
73 | * | ||
74 | * Address valid if: | ||
75 | * - "addr" doesn't have any high-bits set | ||
76 | * - AND "size" doesn't have any high-bits set | ||
77 | * - AND "addr+size" doesn't have any high-bits set | ||
78 | * - OR we are in kernel mode. | ||
79 | * | ||
80 | * __ua_size() is a trick to avoid runtime checking of positive constant | ||
81 | * sizes; for those we already know at compile time that the size is ok. | ||
82 | */ | ||
83 | #define __ua_size(size) \ | ||
84 | ((__builtin_constant_p(size) && (signed long) (size) > 0) ? 0 : (size)) | ||
85 | |||
86 | /* | ||
87 | * access_ok: - Checks if a user space pointer is valid | ||
88 | * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE. Note that | ||
89 | * %VERIFY_WRITE is a superset of %VERIFY_READ - if it is safe | ||
90 | * to write to a block, it is always safe to read from it. | ||
91 | * @addr: User space pointer to start of block to check | ||
92 | * @size: Size of block to check | ||
93 | * | ||
94 | * Context: User context only. This function may sleep. | ||
95 | * | ||
96 | * Checks if a pointer to a block of memory in user space is valid. | ||
97 | * | ||
98 | * Returns true (nonzero) if the memory block may be valid, false (zero) | ||
99 | * if it is definitely invalid. | ||
100 | * | ||
101 | * Note that, depending on architecture, this function probably just | ||
102 | * checks that the pointer is in the user space range - after calling | ||
103 | * this function, memory access functions may still return -EFAULT. | ||
104 | */ | ||
105 | |||
106 | #define __access_mask get_fs().seg | ||
107 | |||
108 | #define __access_ok(addr, size, mask) \ | ||
109 | (((signed long)((mask) & ((addr) | ((addr) + (size)) | __ua_size(size)))) == 0) | ||
110 | |||
111 | #define access_ok(type, addr, size) \ | ||
112 | likely(__access_ok((unsigned long)(addr), (size), __access_mask)) | ||
113 | |||
114 | /* | ||
115 | * put_user: - Write a simple value into user space. | ||
116 | * @x: Value to copy to user space. | ||
117 | * @ptr: Destination address, in user space. | ||
118 | * | ||
119 | * Context: User context only. This function may sleep. | ||
120 | * | ||
121 | * This macro copies a single simple value from kernel space to user | ||
122 | * space. It supports simple types like char and int, but not larger | ||
123 | * data types like structures or arrays. | ||
124 | * | ||
125 | * @ptr must have pointer-to-simple-variable type, and @x must be assignable | ||
126 | * to the result of dereferencing @ptr. | ||
127 | * | ||
128 | * Returns zero on success, or -EFAULT on error. | ||
129 | */ | ||
130 | #define put_user(x,ptr) \ | ||
131 | __put_user_check((x), (ptr), sizeof(*(ptr))) | ||
132 | |||
133 | /* | ||
134 | * get_user: - Get a simple variable from user space. | ||
135 | * @x: Variable to store result. | ||
136 | * @ptr: Source address, in user space. | ||
137 | * | ||
138 | * Context: User context only. This function may sleep. | ||
139 | * | ||
140 | * This macro copies a single simple variable from user space to kernel | ||
141 | * space. It supports simple types like char and int, but not larger | ||
142 | * data types like structures or arrays. | ||
143 | * | ||
144 | * @ptr must have pointer-to-simple-variable type, and the result of | ||
145 | * dereferencing @ptr must be assignable to @x without a cast. | ||
146 | * | ||
147 | * Returns zero on success, or -EFAULT on error. | ||
148 | * On error, the variable @x is set to zero. | ||
149 | */ | ||
150 | #define get_user(x,ptr) \ | ||
151 | __get_user_check((x), (ptr), sizeof(*(ptr))) | ||
152 | |||
153 | /* | ||
154 | * __put_user: - Write a simple value into user space, with less checking. | ||
155 | * @x: Value to copy to user space. | ||
156 | * @ptr: Destination address, in user space. | ||
157 | * | ||
158 | * Context: User context only. This function may sleep. | ||
159 | * | ||
160 | * This macro copies a single simple value from kernel space to user | ||
161 | * space. It supports simple types like char and int, but not larger | ||
162 | * data types like structures or arrays. | ||
163 | * | ||
164 | * @ptr must have pointer-to-simple-variable type, and @x must be assignable | ||
165 | * to the result of dereferencing @ptr. | ||
166 | * | ||
167 | * Caller must check the pointer with access_ok() before calling this | ||
168 | * function. | ||
169 | * | ||
170 | * Returns zero on success, or -EFAULT on error. | ||
171 | */ | ||
172 | #define __put_user(x,ptr) \ | ||
173 | __put_user_nocheck((x), (ptr), sizeof(*(ptr))) | ||
174 | |||
175 | /* | ||
176 | * __get_user: - Get a simple variable from user space, with less checking. | ||
177 | * @x: Variable to store result. | ||
178 | * @ptr: Source address, in user space. | ||
179 | * | ||
180 | * Context: User context only. This function may sleep. | ||
181 | * | ||
182 | * This macro copies a single simple variable from user space to kernel | ||
183 | * space. It supports simple types like char and int, but not larger | ||
184 | * data types like structures or arrays. | ||
185 | * | ||
186 | * @ptr must have pointer-to-simple-variable type, and the result of | ||
187 | * dereferencing @ptr must be assignable to @x without a cast. | ||
188 | * | ||
189 | * Caller must check the pointer with access_ok() before calling this | ||
190 | * function. | ||
191 | * | ||
192 | * Returns zero on success, or -EFAULT on error. | ||
193 | * On error, the variable @x is set to zero. | ||
194 | */ | ||
195 | #define __get_user(x,ptr) \ | ||
196 | __get_user_nocheck((x), (ptr), sizeof(*(ptr))) | ||
197 | |||
198 | struct __large_struct { unsigned long buf[100]; }; | ||
199 | #define __m(x) (*(struct __large_struct __user *)(x)) | ||
200 | |||
201 | /* | ||
202 | * Yuck. We need two variants, one for 64bit operation and one | ||
203 | * for 32 bit mode and old iron. | ||
204 | */ | ||
205 | #ifdef CONFIG_32BIT | ||
206 | #define __GET_USER_DW(val, ptr) __get_user_asm_ll32(val, ptr) | ||
207 | #endif | ||
208 | #ifdef CONFIG_64BIT | ||
209 | #define __GET_USER_DW(val, ptr) __get_user_asm(val, "ld", ptr) | ||
210 | #endif | ||
211 | |||
212 | extern void __get_user_unknown(void); | ||
213 | |||
214 | #define __get_user_common(val, size, ptr) \ | ||
215 | do { \ | ||
216 | switch (size) { \ | ||
217 | case 1: __get_user_asm(val, "lb", ptr); break; \ | ||
218 | case 2: __get_user_asm(val, "lh", ptr); break; \ | ||
219 | case 4: __get_user_asm(val, "lw", ptr); break; \ | ||
220 | case 8: __GET_USER_DW(val, ptr); break; \ | ||
221 | default: __get_user_unknown(); break; \ | ||
222 | } \ | ||
223 | } while (0) | ||
224 | |||
225 | #define __get_user_nocheck(x, ptr, size) \ | ||
226 | ({ \ | ||
227 | int __gu_err; \ | ||
228 | \ | ||
229 | __get_user_common((x), size, ptr); \ | ||
230 | __gu_err; \ | ||
231 | }) | ||
232 | |||
233 | #define __get_user_check(x, ptr, size) \ | ||
234 | ({ \ | ||
235 | int __gu_err = -EFAULT; \ | ||
236 | const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \ | ||
237 | \ | ||
238 | if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \ | ||
239 | __get_user_common((x), size, __gu_ptr); \ | ||
240 | \ | ||
241 | __gu_err; \ | ||
242 | }) | ||
243 | |||
244 | #define __get_user_asm(val, insn, addr) \ | ||
245 | { \ | ||
246 | long __gu_tmp; \ | ||
247 | \ | ||
248 | __asm__ __volatile__( \ | ||
249 | "1: " insn " %1, %3 \n" \ | ||
250 | "2: \n" \ | ||
251 | " .section .fixup,\"ax\" \n" \ | ||
252 | "3: li %0, %4 \n" \ | ||
253 | " j 2b \n" \ | ||
254 | " .previous \n" \ | ||
255 | " .section __ex_table,\"a\" \n" \ | ||
256 | " "__UA_ADDR "\t1b, 3b \n" \ | ||
257 | " .previous \n" \ | ||
258 | : "=r" (__gu_err), "=r" (__gu_tmp) \ | ||
259 | : "0" (0), "o" (__m(addr)), "i" (-EFAULT)); \ | ||
260 | \ | ||
261 | (val) = (__typeof__(*(addr))) __gu_tmp; \ | ||
262 | } | ||
263 | |||
264 | /* | ||
265 | * Get a long long 64 using 32 bit registers. | ||
266 | */ | ||
267 | #define __get_user_asm_ll32(val, addr) \ | ||
268 | { \ | ||
269 | union { \ | ||
270 | unsigned long long l; \ | ||
271 | __typeof__(*(addr)) t; \ | ||
272 | } __gu_tmp; \ | ||
273 | \ | ||
274 | __asm__ __volatile__( \ | ||
275 | "1: lw %1, (%3) \n" \ | ||
276 | "2: lw %D1, 4(%3) \n" \ | ||
277 | "3: .section .fixup,\"ax\" \n" \ | ||
278 | "4: li %0, %4 \n" \ | ||
279 | " move %1, $0 \n" \ | ||
280 | " move %D1, $0 \n" \ | ||
281 | " j 3b \n" \ | ||
282 | " .previous \n" \ | ||
283 | " .section __ex_table,\"a\" \n" \ | ||
284 | " " __UA_ADDR " 1b, 4b \n" \ | ||
285 | " " __UA_ADDR " 2b, 4b \n" \ | ||
286 | " .previous \n" \ | ||
287 | : "=r" (__gu_err), "=&r" (__gu_tmp.l) \ | ||
288 | : "0" (0), "r" (addr), "i" (-EFAULT)); \ | ||
289 | \ | ||
290 | (val) = __gu_tmp.t; \ | ||
291 | } | ||
292 | |||
293 | /* | ||
294 | * Yuck. We need two variants, one for 64bit operation and one | ||
295 | * for 32 bit mode and old iron. | ||
296 | */ | ||
297 | #ifdef CONFIG_32BIT | ||
298 | #define __PUT_USER_DW(ptr) __put_user_asm_ll32(ptr) | ||
299 | #endif | ||
300 | #ifdef CONFIG_64BIT | ||
301 | #define __PUT_USER_DW(ptr) __put_user_asm("sd", ptr) | ||
302 | #endif | ||
303 | |||
304 | #define __put_user_nocheck(x, ptr, size) \ | ||
305 | ({ \ | ||
306 | __typeof__(*(ptr)) __pu_val; \ | ||
307 | int __pu_err = 0; \ | ||
308 | \ | ||
309 | __pu_val = (x); \ | ||
310 | switch (size) { \ | ||
311 | case 1: __put_user_asm("sb", ptr); break; \ | ||
312 | case 2: __put_user_asm("sh", ptr); break; \ | ||
313 | case 4: __put_user_asm("sw", ptr); break; \ | ||
314 | case 8: __PUT_USER_DW(ptr); break; \ | ||
315 | default: __put_user_unknown(); break; \ | ||
316 | } \ | ||
317 | __pu_err; \ | ||
318 | }) | ||
319 | |||
320 | #define __put_user_check(x, ptr, size) \ | ||
321 | ({ \ | ||
322 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ | ||
323 | __typeof__(*(ptr)) __pu_val = (x); \ | ||
324 | int __pu_err = -EFAULT; \ | ||
325 | \ | ||
326 | if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \ | ||
327 | switch (size) { \ | ||
328 | case 1: __put_user_asm("sb", __pu_addr); break; \ | ||
329 | case 2: __put_user_asm("sh", __pu_addr); break; \ | ||
330 | case 4: __put_user_asm("sw", __pu_addr); break; \ | ||
331 | case 8: __PUT_USER_DW(__pu_addr); break; \ | ||
332 | default: __put_user_unknown(); break; \ | ||
333 | } \ | ||
334 | } \ | ||
335 | __pu_err; \ | ||
336 | }) | ||
337 | |||
338 | #define __put_user_asm(insn, ptr) \ | ||
339 | { \ | ||
340 | __asm__ __volatile__( \ | ||
341 | "1: " insn " %z2, %3 # __put_user_asm\n" \ | ||
342 | "2: \n" \ | ||
343 | " .section .fixup,\"ax\" \n" \ | ||
344 | "3: li %0, %4 \n" \ | ||
345 | " j 2b \n" \ | ||
346 | " .previous \n" \ | ||
347 | " .section __ex_table,\"a\" \n" \ | ||
348 | " " __UA_ADDR " 1b, 3b \n" \ | ||
349 | " .previous \n" \ | ||
350 | : "=r" (__pu_err) \ | ||
351 | : "0" (0), "Jr" (__pu_val), "o" (__m(ptr)), \ | ||
352 | "i" (-EFAULT)); \ | ||
353 | } | ||
354 | |||
355 | #define __put_user_asm_ll32(ptr) \ | ||
356 | { \ | ||
357 | __asm__ __volatile__( \ | ||
358 | "1: sw %2, (%3) # __put_user_asm_ll32 \n" \ | ||
359 | "2: sw %D2, 4(%3) \n" \ | ||
360 | "3: \n" \ | ||
361 | " .section .fixup,\"ax\" \n" \ | ||
362 | "4: li %0, %4 \n" \ | ||
363 | " j 3b \n" \ | ||
364 | " .previous \n" \ | ||
365 | " .section __ex_table,\"a\" \n" \ | ||
366 | " " __UA_ADDR " 1b, 4b \n" \ | ||
367 | " " __UA_ADDR " 2b, 4b \n" \ | ||
368 | " .previous" \ | ||
369 | : "=r" (__pu_err) \ | ||
370 | : "0" (0), "r" (__pu_val), "r" (ptr), \ | ||
371 | "i" (-EFAULT)); \ | ||
372 | } | ||
373 | |||
374 | extern void __put_user_unknown(void); | ||
375 | |||
376 | /* | ||
377 | * We're generating jump to subroutines which will be outside the range of | ||
378 | * jump instructions | ||
379 | */ | ||
380 | #ifdef MODULE | ||
381 | #define __MODULE_JAL(destination) \ | ||
382 | ".set\tnoat\n\t" \ | ||
383 | __UA_LA "\t$1, " #destination "\n\t" \ | ||
384 | "jalr\t$1\n\t" \ | ||
385 | ".set\tat\n\t" | ||
386 | #else | ||
387 | #define __MODULE_JAL(destination) \ | ||
388 | "jal\t" #destination "\n\t" | ||
389 | #endif | ||
390 | |||
391 | #ifndef CONFIG_CPU_DADDI_WORKAROUNDS | ||
392 | #define DADDI_SCRATCH "$0" | ||
393 | #else | ||
394 | #define DADDI_SCRATCH "$3" | ||
395 | #endif | ||
396 | |||
397 | extern size_t __copy_user(void *__to, const void *__from, size_t __n); | ||
398 | |||
399 | #define __invoke_copy_to_user(to, from, n) \ | ||
400 | ({ \ | ||
401 | register void __user *__cu_to_r __asm__("$4"); \ | ||
402 | register const void *__cu_from_r __asm__("$5"); \ | ||
403 | register long __cu_len_r __asm__("$6"); \ | ||
404 | \ | ||
405 | __cu_to_r = (to); \ | ||
406 | __cu_from_r = (from); \ | ||
407 | __cu_len_r = (n); \ | ||
408 | __asm__ __volatile__( \ | ||
409 | __MODULE_JAL(__copy_user) \ | ||
410 | : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r) \ | ||
411 | : \ | ||
412 | : "$8", "$9", "$10", "$11", "$12", "$15", "$24", "$31", \ | ||
413 | DADDI_SCRATCH, "memory"); \ | ||
414 | __cu_len_r; \ | ||
415 | }) | ||
416 | |||
417 | /* | ||
418 | * __copy_to_user: - Copy a block of data into user space, with less checking. | ||
419 | * @to: Destination address, in user space. | ||
420 | * @from: Source address, in kernel space. | ||
421 | * @n: Number of bytes to copy. | ||
422 | * | ||
423 | * Context: User context only. This function may sleep. | ||
424 | * | ||
425 | * Copy data from kernel space to user space. Caller must check | ||
426 | * the specified block with access_ok() before calling this function. | ||
427 | * | ||
428 | * Returns number of bytes that could not be copied. | ||
429 | * On success, this will be zero. | ||
430 | */ | ||
431 | #define __copy_to_user(to, from, n) \ | ||
432 | ({ \ | ||
433 | void __user *__cu_to; \ | ||
434 | const void *__cu_from; \ | ||
435 | long __cu_len; \ | ||
436 | \ | ||
437 | might_sleep(); \ | ||
438 | __cu_to = (to); \ | ||
439 | __cu_from = (from); \ | ||
440 | __cu_len = (n); \ | ||
441 | __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, __cu_len); \ | ||
442 | __cu_len; \ | ||
443 | }) | ||
444 | |||
445 | extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); | ||
446 | |||
447 | #define __copy_to_user_inatomic(to, from, n) \ | ||
448 | ({ \ | ||
449 | void __user *__cu_to; \ | ||
450 | const void *__cu_from; \ | ||
451 | long __cu_len; \ | ||
452 | \ | ||
453 | __cu_to = (to); \ | ||
454 | __cu_from = (from); \ | ||
455 | __cu_len = (n); \ | ||
456 | __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, __cu_len); \ | ||
457 | __cu_len; \ | ||
458 | }) | ||
459 | |||
460 | #define __copy_from_user_inatomic(to, from, n) \ | ||
461 | ({ \ | ||
462 | void *__cu_to; \ | ||
463 | const void __user *__cu_from; \ | ||
464 | long __cu_len; \ | ||
465 | \ | ||
466 | __cu_to = (to); \ | ||
467 | __cu_from = (from); \ | ||
468 | __cu_len = (n); \ | ||
469 | __cu_len = __invoke_copy_from_user_inatomic(__cu_to, __cu_from, \ | ||
470 | __cu_len); \ | ||
471 | __cu_len; \ | ||
472 | }) | ||
473 | |||
474 | /* | ||
475 | * copy_to_user: - Copy a block of data into user space. | ||
476 | * @to: Destination address, in user space. | ||
477 | * @from: Source address, in kernel space. | ||
478 | * @n: Number of bytes to copy. | ||
479 | * | ||
480 | * Context: User context only. This function may sleep. | ||
481 | * | ||
482 | * Copy data from kernel space to user space. | ||
483 | * | ||
484 | * Returns number of bytes that could not be copied. | ||
485 | * On success, this will be zero. | ||
486 | */ | ||
487 | #define copy_to_user(to, from, n) \ | ||
488 | ({ \ | ||
489 | void __user *__cu_to; \ | ||
490 | const void *__cu_from; \ | ||
491 | long __cu_len; \ | ||
492 | \ | ||
493 | might_sleep(); \ | ||
494 | __cu_to = (to); \ | ||
495 | __cu_from = (from); \ | ||
496 | __cu_len = (n); \ | ||
497 | if (access_ok(VERIFY_WRITE, __cu_to, __cu_len)) \ | ||
498 | __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, \ | ||
499 | __cu_len); \ | ||
500 | __cu_len; \ | ||
501 | }) | ||
502 | |||
503 | #define __invoke_copy_from_user(to, from, n) \ | ||
504 | ({ \ | ||
505 | register void *__cu_to_r __asm__("$4"); \ | ||
506 | register const void __user *__cu_from_r __asm__("$5"); \ | ||
507 | register long __cu_len_r __asm__("$6"); \ | ||
508 | \ | ||
509 | __cu_to_r = (to); \ | ||
510 | __cu_from_r = (from); \ | ||
511 | __cu_len_r = (n); \ | ||
512 | __asm__ __volatile__( \ | ||
513 | ".set\tnoreorder\n\t" \ | ||
514 | __MODULE_JAL(__copy_user) \ | ||
515 | ".set\tnoat\n\t" \ | ||
516 | __UA_ADDU "\t$1, %1, %2\n\t" \ | ||
517 | ".set\tat\n\t" \ | ||
518 | ".set\treorder" \ | ||
519 | : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r) \ | ||
520 | : \ | ||
521 | : "$8", "$9", "$10", "$11", "$12", "$15", "$24", "$31", \ | ||
522 | DADDI_SCRATCH, "memory"); \ | ||
523 | __cu_len_r; \ | ||
524 | }) | ||
525 | |||
526 | #define __invoke_copy_from_user_inatomic(to, from, n) \ | ||
527 | ({ \ | ||
528 | register void *__cu_to_r __asm__("$4"); \ | ||
529 | register const void __user *__cu_from_r __asm__("$5"); \ | ||
530 | register long __cu_len_r __asm__("$6"); \ | ||
531 | \ | ||
532 | __cu_to_r = (to); \ | ||
533 | __cu_from_r = (from); \ | ||
534 | __cu_len_r = (n); \ | ||
535 | __asm__ __volatile__( \ | ||
536 | ".set\tnoreorder\n\t" \ | ||
537 | __MODULE_JAL(__copy_user_inatomic) \ | ||
538 | ".set\tnoat\n\t" \ | ||
539 | __UA_ADDU "\t$1, %1, %2\n\t" \ | ||
540 | ".set\tat\n\t" \ | ||
541 | ".set\treorder" \ | ||
542 | : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r) \ | ||
543 | : \ | ||
544 | : "$8", "$9", "$10", "$11", "$12", "$15", "$24", "$31", \ | ||
545 | DADDI_SCRATCH, "memory"); \ | ||
546 | __cu_len_r; \ | ||
547 | }) | ||
548 | |||
549 | /* | ||
550 | * __copy_from_user: - Copy a block of data from user space, with less checking. | ||
551 | * @to: Destination address, in kernel space. | ||
552 | * @from: Source address, in user space. | ||
553 | * @n: Number of bytes to copy. | ||
554 | * | ||
555 | * Context: User context only. This function may sleep. | ||
556 | * | ||
557 | * Copy data from user space to kernel space. Caller must check | ||
558 | * the specified block with access_ok() before calling this function. | ||
559 | * | ||
560 | * Returns number of bytes that could not be copied. | ||
561 | * On success, this will be zero. | ||
562 | * | ||
563 | * If some data could not be copied, this function will pad the copied | ||
564 | * data to the requested size using zero bytes. | ||
565 | */ | ||
566 | #define __copy_from_user(to, from, n) \ | ||
567 | ({ \ | ||
568 | void *__cu_to; \ | ||
569 | const void __user *__cu_from; \ | ||
570 | long __cu_len; \ | ||
571 | \ | ||
572 | might_sleep(); \ | ||
573 | __cu_to = (to); \ | ||
574 | __cu_from = (from); \ | ||
575 | __cu_len = (n); \ | ||
576 | __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \ | ||
577 | __cu_len); \ | ||
578 | __cu_len; \ | ||
579 | }) | ||
580 | |||
581 | /* | ||
582 | * copy_from_user: - Copy a block of data from user space. | ||
583 | * @to: Destination address, in kernel space. | ||
584 | * @from: Source address, in user space. | ||
585 | * @n: Number of bytes to copy. | ||
586 | * | ||
587 | * Context: User context only. This function may sleep. | ||
588 | * | ||
589 | * Copy data from user space to kernel space. | ||
590 | * | ||
591 | * Returns number of bytes that could not be copied. | ||
592 | * On success, this will be zero. | ||
593 | * | ||
594 | * If some data could not be copied, this function will pad the copied | ||
595 | * data to the requested size using zero bytes. | ||
596 | */ | ||
597 | #define copy_from_user(to, from, n) \ | ||
598 | ({ \ | ||
599 | void *__cu_to; \ | ||
600 | const void __user *__cu_from; \ | ||
601 | long __cu_len; \ | ||
602 | \ | ||
603 | might_sleep(); \ | ||
604 | __cu_to = (to); \ | ||
605 | __cu_from = (from); \ | ||
606 | __cu_len = (n); \ | ||
607 | if (access_ok(VERIFY_READ, __cu_from, __cu_len)) \ | ||
608 | __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \ | ||
609 | __cu_len); \ | ||
610 | __cu_len; \ | ||
611 | }) | ||
612 | |||
613 | #define __copy_in_user(to, from, n) __copy_from_user(to, from, n) | ||
614 | |||
615 | #define copy_in_user(to, from, n) \ | ||
616 | ({ \ | ||
617 | void __user *__cu_to; \ | ||
618 | const void __user *__cu_from; \ | ||
619 | long __cu_len; \ | ||
620 | \ | ||
621 | might_sleep(); \ | ||
622 | __cu_to = (to); \ | ||
623 | __cu_from = (from); \ | ||
624 | __cu_len = (n); \ | ||
625 | if (likely(access_ok(VERIFY_READ, __cu_from, __cu_len) && \ | ||
626 | access_ok(VERIFY_WRITE, __cu_to, __cu_len))) \ | ||
627 | __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \ | ||
628 | __cu_len); \ | ||
629 | __cu_len; \ | ||
630 | }) | ||
631 | |||
632 | /* | ||
633 | * __clear_user: - Zero a block of memory in user space, with less checking. | ||
634 | * @to: Destination address, in user space. | ||
635 | * @n: Number of bytes to zero. | ||
636 | * | ||
637 | * Zero a block of memory in user space. Caller must check | ||
638 | * the specified block with access_ok() before calling this function. | ||
639 | * | ||
640 | * Returns number of bytes that could not be cleared. | ||
641 | * On success, this will be zero. | ||
642 | */ | ||
643 | static inline __kernel_size_t | ||
644 | __clear_user(void __user *addr, __kernel_size_t size) | ||
645 | { | ||
646 | __kernel_size_t res; | ||
647 | |||
648 | might_sleep(); | ||
649 | __asm__ __volatile__( | ||
650 | "move\t$4, %1\n\t" | ||
651 | "move\t$5, $0\n\t" | ||
652 | "move\t$6, %2\n\t" | ||
653 | __MODULE_JAL(__bzero) | ||
654 | "move\t%0, $6" | ||
655 | : "=r" (res) | ||
656 | : "r" (addr), "r" (size) | ||
657 | : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"); | ||
658 | |||
659 | return res; | ||
660 | } | ||
661 | |||
662 | #define clear_user(addr,n) \ | ||
663 | ({ \ | ||
664 | void __user * __cl_addr = (addr); \ | ||
665 | unsigned long __cl_size = (n); \ | ||
666 | if (__cl_size && access_ok(VERIFY_WRITE, \ | ||
667 | ((unsigned long)(__cl_addr)), __cl_size)) \ | ||
668 | __cl_size = __clear_user(__cl_addr, __cl_size); \ | ||
669 | __cl_size; \ | ||
670 | }) | ||
671 | |||
672 | /* | ||
673 | * __strncpy_from_user: - Copy a NUL terminated string from userspace, with less checking. | ||
674 | * @dst: Destination address, in kernel space. This buffer must be at | ||
675 | * least @count bytes long. | ||
676 | * @src: Source address, in user space. | ||
677 | * @count: Maximum number of bytes to copy, including the trailing NUL. | ||
678 | * | ||
679 | * Copies a NUL-terminated string from userspace to kernel space. | ||
680 | * Caller must check the specified block with access_ok() before calling | ||
681 | * this function. | ||
682 | * | ||
683 | * On success, returns the length of the string (not including the trailing | ||
684 | * NUL). | ||
685 | * | ||
686 | * If access to userspace fails, returns -EFAULT (some data may have been | ||
687 | * copied). | ||
688 | * | ||
689 | * If @count is smaller than the length of the string, copies @count bytes | ||
690 | * and returns @count. | ||
691 | */ | ||
692 | static inline long | ||
693 | __strncpy_from_user(char *__to, const char __user *__from, long __len) | ||
694 | { | ||
695 | long res; | ||
696 | |||
697 | might_sleep(); | ||
698 | __asm__ __volatile__( | ||
699 | "move\t$4, %1\n\t" | ||
700 | "move\t$5, %2\n\t" | ||
701 | "move\t$6, %3\n\t" | ||
702 | __MODULE_JAL(__strncpy_from_user_nocheck_asm) | ||
703 | "move\t%0, $2" | ||
704 | : "=r" (res) | ||
705 | : "r" (__to), "r" (__from), "r" (__len) | ||
706 | : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory"); | ||
707 | |||
708 | return res; | ||
709 | } | ||
710 | |||
711 | /* | ||
712 | * strncpy_from_user: - Copy a NUL terminated string from userspace. | ||
713 | * @dst: Destination address, in kernel space. This buffer must be at | ||
714 | * least @count bytes long. | ||
715 | * @src: Source address, in user space. | ||
716 | * @count: Maximum number of bytes to copy, including the trailing NUL. | ||
717 | * | ||
718 | * Copies a NUL-terminated string from userspace to kernel space. | ||
719 | * | ||
720 | * On success, returns the length of the string (not including the trailing | ||
721 | * NUL). | ||
722 | * | ||
723 | * If access to userspace fails, returns -EFAULT (some data may have been | ||
724 | * copied). | ||
725 | * | ||
726 | * If @count is smaller than the length of the string, copies @count bytes | ||
727 | * and returns @count. | ||
728 | */ | ||
729 | static inline long | ||
730 | strncpy_from_user(char *__to, const char __user *__from, long __len) | ||
731 | { | ||
732 | long res; | ||
733 | |||
734 | might_sleep(); | ||
735 | __asm__ __volatile__( | ||
736 | "move\t$4, %1\n\t" | ||
737 | "move\t$5, %2\n\t" | ||
738 | "move\t$6, %3\n\t" | ||
739 | __MODULE_JAL(__strncpy_from_user_asm) | ||
740 | "move\t%0, $2" | ||
741 | : "=r" (res) | ||
742 | : "r" (__to), "r" (__from), "r" (__len) | ||
743 | : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory"); | ||
744 | |||
745 | return res; | ||
746 | } | ||
747 | |||
748 | /* Returns: 0 if bad, string length+1 (memory size) of string if ok */ | ||
749 | static inline long __strlen_user(const char __user *s) | ||
750 | { | ||
751 | long res; | ||
752 | |||
753 | might_sleep(); | ||
754 | __asm__ __volatile__( | ||
755 | "move\t$4, %1\n\t" | ||
756 | __MODULE_JAL(__strlen_user_nocheck_asm) | ||
757 | "move\t%0, $2" | ||
758 | : "=r" (res) | ||
759 | : "r" (s) | ||
760 | : "$2", "$4", __UA_t0, "$31"); | ||
761 | |||
762 | return res; | ||
763 | } | ||
764 | |||
765 | /* | ||
766 | * strlen_user: - Get the size of a string in user space. | ||
767 | * @str: The string to measure. | ||
768 | * | ||
769 | * Context: User context only. This function may sleep. | ||
770 | * | ||
771 | * Get the size of a NUL-terminated string in user space. | ||
772 | * | ||
773 | * Returns the size of the string INCLUDING the terminating NUL. | ||
774 | * On exception, returns 0. | ||
775 | * | ||
776 | * If there is a limit on the length of a valid string, you may wish to | ||
777 | * consider using strnlen_user() instead. | ||
778 | */ | ||
779 | static inline long strlen_user(const char __user *s) | ||
780 | { | ||
781 | long res; | ||
782 | |||
783 | might_sleep(); | ||
784 | __asm__ __volatile__( | ||
785 | "move\t$4, %1\n\t" | ||
786 | __MODULE_JAL(__strlen_user_asm) | ||
787 | "move\t%0, $2" | ||
788 | : "=r" (res) | ||
789 | : "r" (s) | ||
790 | : "$2", "$4", __UA_t0, "$31"); | ||
791 | |||
792 | return res; | ||
793 | } | ||
794 | |||
795 | /* Returns: 0 if bad, string length+1 (memory size) of string if ok */ | ||
796 | static inline long __strnlen_user(const char __user *s, long n) | ||
797 | { | ||
798 | long res; | ||
799 | |||
800 | might_sleep(); | ||
801 | __asm__ __volatile__( | ||
802 | "move\t$4, %1\n\t" | ||
803 | "move\t$5, %2\n\t" | ||
804 | __MODULE_JAL(__strnlen_user_nocheck_asm) | ||
805 | "move\t%0, $2" | ||
806 | : "=r" (res) | ||
807 | : "r" (s), "r" (n) | ||
808 | : "$2", "$4", "$5", __UA_t0, "$31"); | ||
809 | |||
810 | return res; | ||
811 | } | ||
812 | |||
813 | /* | ||
814 | * strlen_user: - Get the size of a string in user space. | ||
815 | * @str: The string to measure. | ||
816 | * | ||
817 | * Context: User context only. This function may sleep. | ||
818 | * | ||
819 | * Get the size of a NUL-terminated string in user space. | ||
820 | * | ||
821 | * Returns the size of the string INCLUDING the terminating NUL. | ||
822 | * On exception, returns 0. | ||
823 | * | ||
824 | * If there is a limit on the length of a valid string, you may wish to | ||
825 | * consider using strnlen_user() instead. | ||
826 | */ | ||
827 | static inline long strnlen_user(const char __user *s, long n) | ||
828 | { | ||
829 | long res; | ||
830 | |||
831 | might_sleep(); | ||
832 | __asm__ __volatile__( | ||
833 | "move\t$4, %1\n\t" | ||
834 | "move\t$5, %2\n\t" | ||
835 | __MODULE_JAL(__strnlen_user_asm) | ||
836 | "move\t%0, $2" | ||
837 | : "=r" (res) | ||
838 | : "r" (s), "r" (n) | ||
839 | : "$2", "$4", "$5", __UA_t0, "$31"); | ||
840 | |||
841 | return res; | ||
842 | } | ||
843 | |||
844 | struct exception_table_entry | ||
845 | { | ||
846 | unsigned long insn; | ||
847 | unsigned long nextinsn; | ||
848 | }; | ||
849 | |||
850 | extern int fixup_exception(struct pt_regs *regs); | ||
851 | |||
852 | #endif /* _ASM_UACCESS_H */ | ||
diff --git a/include/asm-mips/ucontext.h b/include/asm-mips/ucontext.h deleted file mode 100644 index 8a4b20e88b81..000000000000 --- a/include/asm-mips/ucontext.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Low level exception handling | ||
7 | * | ||
8 | * Copyright (C) 1998, 1999 by Ralf Baechle | ||
9 | */ | ||
10 | #ifndef _ASM_UCONTEXT_H | ||
11 | #define _ASM_UCONTEXT_H | ||
12 | |||
13 | struct ucontext { | ||
14 | unsigned long uc_flags; | ||
15 | struct ucontext *uc_link; | ||
16 | stack_t uc_stack; | ||
17 | struct sigcontext uc_mcontext; | ||
18 | sigset_t uc_sigmask; /* mask last for extensibility */ | ||
19 | }; | ||
20 | |||
21 | #endif /* _ASM_UCONTEXT_H */ | ||
diff --git a/include/asm-mips/unaligned.h b/include/asm-mips/unaligned.h deleted file mode 100644 index 792404948571..000000000000 --- a/include/asm-mips/unaligned.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #ifndef _ASM_MIPS_UNALIGNED_H | ||
9 | #define _ASM_MIPS_UNALIGNED_H | ||
10 | |||
11 | #include <linux/compiler.h> | ||
12 | #if defined(__MIPSEB__) | ||
13 | # include <linux/unaligned/be_struct.h> | ||
14 | # include <linux/unaligned/le_byteshift.h> | ||
15 | # include <linux/unaligned/generic.h> | ||
16 | # define get_unaligned __get_unaligned_be | ||
17 | # define put_unaligned __put_unaligned_be | ||
18 | #elif defined(__MIPSEL__) | ||
19 | # include <linux/unaligned/le_struct.h> | ||
20 | # include <linux/unaligned/be_byteshift.h> | ||
21 | # include <linux/unaligned/generic.h> | ||
22 | # define get_unaligned __get_unaligned_le | ||
23 | # define put_unaligned __put_unaligned_le | ||
24 | #else | ||
25 | # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" | ||
26 | #endif | ||
27 | |||
28 | #endif /* _ASM_MIPS_UNALIGNED_H */ | ||
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h deleted file mode 100644 index a73e1531e151..000000000000 --- a/include/asm-mips/unistd.h +++ /dev/null | |||
@@ -1,1037 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle | ||
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
8 | * | ||
9 | * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto | ||
10 | * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A | ||
11 | */ | ||
12 | #ifndef _ASM_UNISTD_H | ||
13 | #define _ASM_UNISTD_H | ||
14 | |||
15 | #include <asm/sgidefs.h> | ||
16 | |||
17 | #if _MIPS_SIM == _MIPS_SIM_ABI32 | ||
18 | |||
19 | /* | ||
20 | * Linux o32 style syscalls are in the range from 4000 to 4999. | ||
21 | */ | ||
22 | #define __NR_Linux 4000 | ||
23 | #define __NR_syscall (__NR_Linux + 0) | ||
24 | #define __NR_exit (__NR_Linux + 1) | ||
25 | #define __NR_fork (__NR_Linux + 2) | ||
26 | #define __NR_read (__NR_Linux + 3) | ||
27 | #define __NR_write (__NR_Linux + 4) | ||
28 | #define __NR_open (__NR_Linux + 5) | ||
29 | #define __NR_close (__NR_Linux + 6) | ||
30 | #define __NR_waitpid (__NR_Linux + 7) | ||
31 | #define __NR_creat (__NR_Linux + 8) | ||
32 | #define __NR_link (__NR_Linux + 9) | ||
33 | #define __NR_unlink (__NR_Linux + 10) | ||
34 | #define __NR_execve (__NR_Linux + 11) | ||
35 | #define __NR_chdir (__NR_Linux + 12) | ||
36 | #define __NR_time (__NR_Linux + 13) | ||
37 | #define __NR_mknod (__NR_Linux + 14) | ||
38 | #define __NR_chmod (__NR_Linux + 15) | ||
39 | #define __NR_lchown (__NR_Linux + 16) | ||
40 | #define __NR_break (__NR_Linux + 17) | ||
41 | #define __NR_unused18 (__NR_Linux + 18) | ||
42 | #define __NR_lseek (__NR_Linux + 19) | ||
43 | #define __NR_getpid (__NR_Linux + 20) | ||
44 | #define __NR_mount (__NR_Linux + 21) | ||
45 | #define __NR_umount (__NR_Linux + 22) | ||
46 | #define __NR_setuid (__NR_Linux + 23) | ||
47 | #define __NR_getuid (__NR_Linux + 24) | ||
48 | #define __NR_stime (__NR_Linux + 25) | ||
49 | #define __NR_ptrace (__NR_Linux + 26) | ||
50 | #define __NR_alarm (__NR_Linux + 27) | ||
51 | #define __NR_unused28 (__NR_Linux + 28) | ||
52 | #define __NR_pause (__NR_Linux + 29) | ||
53 | #define __NR_utime (__NR_Linux + 30) | ||
54 | #define __NR_stty (__NR_Linux + 31) | ||
55 | #define __NR_gtty (__NR_Linux + 32) | ||
56 | #define __NR_access (__NR_Linux + 33) | ||
57 | #define __NR_nice (__NR_Linux + 34) | ||
58 | #define __NR_ftime (__NR_Linux + 35) | ||
59 | #define __NR_sync (__NR_Linux + 36) | ||
60 | #define __NR_kill (__NR_Linux + 37) | ||
61 | #define __NR_rename (__NR_Linux + 38) | ||
62 | #define __NR_mkdir (__NR_Linux + 39) | ||
63 | #define __NR_rmdir (__NR_Linux + 40) | ||
64 | #define __NR_dup (__NR_Linux + 41) | ||
65 | #define __NR_pipe (__NR_Linux + 42) | ||
66 | #define __NR_times (__NR_Linux + 43) | ||
67 | #define __NR_prof (__NR_Linux + 44) | ||
68 | #define __NR_brk (__NR_Linux + 45) | ||
69 | #define __NR_setgid (__NR_Linux + 46) | ||
70 | #define __NR_getgid (__NR_Linux + 47) | ||
71 | #define __NR_signal (__NR_Linux + 48) | ||
72 | #define __NR_geteuid (__NR_Linux + 49) | ||
73 | #define __NR_getegid (__NR_Linux + 50) | ||
74 | #define __NR_acct (__NR_Linux + 51) | ||
75 | #define __NR_umount2 (__NR_Linux + 52) | ||
76 | #define __NR_lock (__NR_Linux + 53) | ||
77 | #define __NR_ioctl (__NR_Linux + 54) | ||
78 | #define __NR_fcntl (__NR_Linux + 55) | ||
79 | #define __NR_mpx (__NR_Linux + 56) | ||
80 | #define __NR_setpgid (__NR_Linux + 57) | ||
81 | #define __NR_ulimit (__NR_Linux + 58) | ||
82 | #define __NR_unused59 (__NR_Linux + 59) | ||
83 | #define __NR_umask (__NR_Linux + 60) | ||
84 | #define __NR_chroot (__NR_Linux + 61) | ||
85 | #define __NR_ustat (__NR_Linux + 62) | ||
86 | #define __NR_dup2 (__NR_Linux + 63) | ||
87 | #define __NR_getppid (__NR_Linux + 64) | ||
88 | #define __NR_getpgrp (__NR_Linux + 65) | ||
89 | #define __NR_setsid (__NR_Linux + 66) | ||
90 | #define __NR_sigaction (__NR_Linux + 67) | ||
91 | #define __NR_sgetmask (__NR_Linux + 68) | ||
92 | #define __NR_ssetmask (__NR_Linux + 69) | ||
93 | #define __NR_setreuid (__NR_Linux + 70) | ||
94 | #define __NR_setregid (__NR_Linux + 71) | ||
95 | #define __NR_sigsuspend (__NR_Linux + 72) | ||
96 | #define __NR_sigpending (__NR_Linux + 73) | ||
97 | #define __NR_sethostname (__NR_Linux + 74) | ||
98 | #define __NR_setrlimit (__NR_Linux + 75) | ||
99 | #define __NR_getrlimit (__NR_Linux + 76) | ||
100 | #define __NR_getrusage (__NR_Linux + 77) | ||
101 | #define __NR_gettimeofday (__NR_Linux + 78) | ||
102 | #define __NR_settimeofday (__NR_Linux + 79) | ||
103 | #define __NR_getgroups (__NR_Linux + 80) | ||
104 | #define __NR_setgroups (__NR_Linux + 81) | ||
105 | #define __NR_reserved82 (__NR_Linux + 82) | ||
106 | #define __NR_symlink (__NR_Linux + 83) | ||
107 | #define __NR_unused84 (__NR_Linux + 84) | ||
108 | #define __NR_readlink (__NR_Linux + 85) | ||
109 | #define __NR_uselib (__NR_Linux + 86) | ||
110 | #define __NR_swapon (__NR_Linux + 87) | ||
111 | #define __NR_reboot (__NR_Linux + 88) | ||
112 | #define __NR_readdir (__NR_Linux + 89) | ||
113 | #define __NR_mmap (__NR_Linux + 90) | ||
114 | #define __NR_munmap (__NR_Linux + 91) | ||
115 | #define __NR_truncate (__NR_Linux + 92) | ||
116 | #define __NR_ftruncate (__NR_Linux + 93) | ||
117 | #define __NR_fchmod (__NR_Linux + 94) | ||
118 | #define __NR_fchown (__NR_Linux + 95) | ||
119 | #define __NR_getpriority (__NR_Linux + 96) | ||
120 | #define __NR_setpriority (__NR_Linux + 97) | ||
121 | #define __NR_profil (__NR_Linux + 98) | ||
122 | #define __NR_statfs (__NR_Linux + 99) | ||
123 | #define __NR_fstatfs (__NR_Linux + 100) | ||
124 | #define __NR_ioperm (__NR_Linux + 101) | ||
125 | #define __NR_socketcall (__NR_Linux + 102) | ||
126 | #define __NR_syslog (__NR_Linux + 103) | ||
127 | #define __NR_setitimer (__NR_Linux + 104) | ||
128 | #define __NR_getitimer (__NR_Linux + 105) | ||
129 | #define __NR_stat (__NR_Linux + 106) | ||
130 | #define __NR_lstat (__NR_Linux + 107) | ||
131 | #define __NR_fstat (__NR_Linux + 108) | ||
132 | #define __NR_unused109 (__NR_Linux + 109) | ||
133 | #define __NR_iopl (__NR_Linux + 110) | ||
134 | #define __NR_vhangup (__NR_Linux + 111) | ||
135 | #define __NR_idle (__NR_Linux + 112) | ||
136 | #define __NR_vm86 (__NR_Linux + 113) | ||
137 | #define __NR_wait4 (__NR_Linux + 114) | ||
138 | #define __NR_swapoff (__NR_Linux + 115) | ||
139 | #define __NR_sysinfo (__NR_Linux + 116) | ||
140 | #define __NR_ipc (__NR_Linux + 117) | ||
141 | #define __NR_fsync (__NR_Linux + 118) | ||
142 | #define __NR_sigreturn (__NR_Linux + 119) | ||
143 | #define __NR_clone (__NR_Linux + 120) | ||
144 | #define __NR_setdomainname (__NR_Linux + 121) | ||
145 | #define __NR_uname (__NR_Linux + 122) | ||
146 | #define __NR_modify_ldt (__NR_Linux + 123) | ||
147 | #define __NR_adjtimex (__NR_Linux + 124) | ||
148 | #define __NR_mprotect (__NR_Linux + 125) | ||
149 | #define __NR_sigprocmask (__NR_Linux + 126) | ||
150 | #define __NR_create_module (__NR_Linux + 127) | ||
151 | #define __NR_init_module (__NR_Linux + 128) | ||
152 | #define __NR_delete_module (__NR_Linux + 129) | ||
153 | #define __NR_get_kernel_syms (__NR_Linux + 130) | ||
154 | #define __NR_quotactl (__NR_Linux + 131) | ||
155 | #define __NR_getpgid (__NR_Linux + 132) | ||
156 | #define __NR_fchdir (__NR_Linux + 133) | ||
157 | #define __NR_bdflush (__NR_Linux + 134) | ||
158 | #define __NR_sysfs (__NR_Linux + 135) | ||
159 | #define __NR_personality (__NR_Linux + 136) | ||
160 | #define __NR_afs_syscall (__NR_Linux + 137) /* Syscall for Andrew File System */ | ||
161 | #define __NR_setfsuid (__NR_Linux + 138) | ||
162 | #define __NR_setfsgid (__NR_Linux + 139) | ||
163 | #define __NR__llseek (__NR_Linux + 140) | ||
164 | #define __NR_getdents (__NR_Linux + 141) | ||
165 | #define __NR__newselect (__NR_Linux + 142) | ||
166 | #define __NR_flock (__NR_Linux + 143) | ||
167 | #define __NR_msync (__NR_Linux + 144) | ||
168 | #define __NR_readv (__NR_Linux + 145) | ||
169 | #define __NR_writev (__NR_Linux + 146) | ||
170 | #define __NR_cacheflush (__NR_Linux + 147) | ||
171 | #define __NR_cachectl (__NR_Linux + 148) | ||
172 | #define __NR_sysmips (__NR_Linux + 149) | ||
173 | #define __NR_unused150 (__NR_Linux + 150) | ||
174 | #define __NR_getsid (__NR_Linux + 151) | ||
175 | #define __NR_fdatasync (__NR_Linux + 152) | ||
176 | #define __NR__sysctl (__NR_Linux + 153) | ||
177 | #define __NR_mlock (__NR_Linux + 154) | ||
178 | #define __NR_munlock (__NR_Linux + 155) | ||
179 | #define __NR_mlockall (__NR_Linux + 156) | ||
180 | #define __NR_munlockall (__NR_Linux + 157) | ||
181 | #define __NR_sched_setparam (__NR_Linux + 158) | ||
182 | #define __NR_sched_getparam (__NR_Linux + 159) | ||
183 | #define __NR_sched_setscheduler (__NR_Linux + 160) | ||
184 | #define __NR_sched_getscheduler (__NR_Linux + 161) | ||
185 | #define __NR_sched_yield (__NR_Linux + 162) | ||
186 | #define __NR_sched_get_priority_max (__NR_Linux + 163) | ||
187 | #define __NR_sched_get_priority_min (__NR_Linux + 164) | ||
188 | #define __NR_sched_rr_get_interval (__NR_Linux + 165) | ||
189 | #define __NR_nanosleep (__NR_Linux + 166) | ||
190 | #define __NR_mremap (__NR_Linux + 167) | ||
191 | #define __NR_accept (__NR_Linux + 168) | ||
192 | #define __NR_bind (__NR_Linux + 169) | ||
193 | #define __NR_connect (__NR_Linux + 170) | ||
194 | #define __NR_getpeername (__NR_Linux + 171) | ||
195 | #define __NR_getsockname (__NR_Linux + 172) | ||
196 | #define __NR_getsockopt (__NR_Linux + 173) | ||
197 | #define __NR_listen (__NR_Linux + 174) | ||
198 | #define __NR_recv (__NR_Linux + 175) | ||
199 | #define __NR_recvfrom (__NR_Linux + 176) | ||
200 | #define __NR_recvmsg (__NR_Linux + 177) | ||
201 | #define __NR_send (__NR_Linux + 178) | ||
202 | #define __NR_sendmsg (__NR_Linux + 179) | ||
203 | #define __NR_sendto (__NR_Linux + 180) | ||
204 | #define __NR_setsockopt (__NR_Linux + 181) | ||
205 | #define __NR_shutdown (__NR_Linux + 182) | ||
206 | #define __NR_socket (__NR_Linux + 183) | ||
207 | #define __NR_socketpair (__NR_Linux + 184) | ||
208 | #define __NR_setresuid (__NR_Linux + 185) | ||
209 | #define __NR_getresuid (__NR_Linux + 186) | ||
210 | #define __NR_query_module (__NR_Linux + 187) | ||
211 | #define __NR_poll (__NR_Linux + 188) | ||
212 | #define __NR_nfsservctl (__NR_Linux + 189) | ||
213 | #define __NR_setresgid (__NR_Linux + 190) | ||
214 | #define __NR_getresgid (__NR_Linux + 191) | ||
215 | #define __NR_prctl (__NR_Linux + 192) | ||
216 | #define __NR_rt_sigreturn (__NR_Linux + 193) | ||
217 | #define __NR_rt_sigaction (__NR_Linux + 194) | ||
218 | #define __NR_rt_sigprocmask (__NR_Linux + 195) | ||
219 | #define __NR_rt_sigpending (__NR_Linux + 196) | ||
220 | #define __NR_rt_sigtimedwait (__NR_Linux + 197) | ||
221 | #define __NR_rt_sigqueueinfo (__NR_Linux + 198) | ||
222 | #define __NR_rt_sigsuspend (__NR_Linux + 199) | ||
223 | #define __NR_pread64 (__NR_Linux + 200) | ||
224 | #define __NR_pwrite64 (__NR_Linux + 201) | ||
225 | #define __NR_chown (__NR_Linux + 202) | ||
226 | #define __NR_getcwd (__NR_Linux + 203) | ||
227 | #define __NR_capget (__NR_Linux + 204) | ||
228 | #define __NR_capset (__NR_Linux + 205) | ||
229 | #define __NR_sigaltstack (__NR_Linux + 206) | ||
230 | #define __NR_sendfile (__NR_Linux + 207) | ||
231 | #define __NR_getpmsg (__NR_Linux + 208) | ||
232 | #define __NR_putpmsg (__NR_Linux + 209) | ||
233 | #define __NR_mmap2 (__NR_Linux + 210) | ||
234 | #define __NR_truncate64 (__NR_Linux + 211) | ||
235 | #define __NR_ftruncate64 (__NR_Linux + 212) | ||
236 | #define __NR_stat64 (__NR_Linux + 213) | ||
237 | #define __NR_lstat64 (__NR_Linux + 214) | ||
238 | #define __NR_fstat64 (__NR_Linux + 215) | ||
239 | #define __NR_pivot_root (__NR_Linux + 216) | ||
240 | #define __NR_mincore (__NR_Linux + 217) | ||
241 | #define __NR_madvise (__NR_Linux + 218) | ||
242 | #define __NR_getdents64 (__NR_Linux + 219) | ||
243 | #define __NR_fcntl64 (__NR_Linux + 220) | ||
244 | #define __NR_reserved221 (__NR_Linux + 221) | ||
245 | #define __NR_gettid (__NR_Linux + 222) | ||
246 | #define __NR_readahead (__NR_Linux + 223) | ||
247 | #define __NR_setxattr (__NR_Linux + 224) | ||
248 | #define __NR_lsetxattr (__NR_Linux + 225) | ||
249 | #define __NR_fsetxattr (__NR_Linux + 226) | ||
250 | #define __NR_getxattr (__NR_Linux + 227) | ||
251 | #define __NR_lgetxattr (__NR_Linux + 228) | ||
252 | #define __NR_fgetxattr (__NR_Linux + 229) | ||
253 | #define __NR_listxattr (__NR_Linux + 230) | ||
254 | #define __NR_llistxattr (__NR_Linux + 231) | ||
255 | #define __NR_flistxattr (__NR_Linux + 232) | ||
256 | #define __NR_removexattr (__NR_Linux + 233) | ||
257 | #define __NR_lremovexattr (__NR_Linux + 234) | ||
258 | #define __NR_fremovexattr (__NR_Linux + 235) | ||
259 | #define __NR_tkill (__NR_Linux + 236) | ||
260 | #define __NR_sendfile64 (__NR_Linux + 237) | ||
261 | #define __NR_futex (__NR_Linux + 238) | ||
262 | #define __NR_sched_setaffinity (__NR_Linux + 239) | ||
263 | #define __NR_sched_getaffinity (__NR_Linux + 240) | ||
264 | #define __NR_io_setup (__NR_Linux + 241) | ||
265 | #define __NR_io_destroy (__NR_Linux + 242) | ||
266 | #define __NR_io_getevents (__NR_Linux + 243) | ||
267 | #define __NR_io_submit (__NR_Linux + 244) | ||
268 | #define __NR_io_cancel (__NR_Linux + 245) | ||
269 | #define __NR_exit_group (__NR_Linux + 246) | ||
270 | #define __NR_lookup_dcookie (__NR_Linux + 247) | ||
271 | #define __NR_epoll_create (__NR_Linux + 248) | ||
272 | #define __NR_epoll_ctl (__NR_Linux + 249) | ||
273 | #define __NR_epoll_wait (__NR_Linux + 250) | ||
274 | #define __NR_remap_file_pages (__NR_Linux + 251) | ||
275 | #define __NR_set_tid_address (__NR_Linux + 252) | ||
276 | #define __NR_restart_syscall (__NR_Linux + 253) | ||
277 | #define __NR_fadvise64 (__NR_Linux + 254) | ||
278 | #define __NR_statfs64 (__NR_Linux + 255) | ||
279 | #define __NR_fstatfs64 (__NR_Linux + 256) | ||
280 | #define __NR_timer_create (__NR_Linux + 257) | ||
281 | #define __NR_timer_settime (__NR_Linux + 258) | ||
282 | #define __NR_timer_gettime (__NR_Linux + 259) | ||
283 | #define __NR_timer_getoverrun (__NR_Linux + 260) | ||
284 | #define __NR_timer_delete (__NR_Linux + 261) | ||
285 | #define __NR_clock_settime (__NR_Linux + 262) | ||
286 | #define __NR_clock_gettime (__NR_Linux + 263) | ||
287 | #define __NR_clock_getres (__NR_Linux + 264) | ||
288 | #define __NR_clock_nanosleep (__NR_Linux + 265) | ||
289 | #define __NR_tgkill (__NR_Linux + 266) | ||
290 | #define __NR_utimes (__NR_Linux + 267) | ||
291 | #define __NR_mbind (__NR_Linux + 268) | ||
292 | #define __NR_get_mempolicy (__NR_Linux + 269) | ||
293 | #define __NR_set_mempolicy (__NR_Linux + 270) | ||
294 | #define __NR_mq_open (__NR_Linux + 271) | ||
295 | #define __NR_mq_unlink (__NR_Linux + 272) | ||
296 | #define __NR_mq_timedsend (__NR_Linux + 273) | ||
297 | #define __NR_mq_timedreceive (__NR_Linux + 274) | ||
298 | #define __NR_mq_notify (__NR_Linux + 275) | ||
299 | #define __NR_mq_getsetattr (__NR_Linux + 276) | ||
300 | #define __NR_vserver (__NR_Linux + 277) | ||
301 | #define __NR_waitid (__NR_Linux + 278) | ||
302 | /* #define __NR_sys_setaltroot (__NR_Linux + 279) */ | ||
303 | #define __NR_add_key (__NR_Linux + 280) | ||
304 | #define __NR_request_key (__NR_Linux + 281) | ||
305 | #define __NR_keyctl (__NR_Linux + 282) | ||
306 | #define __NR_set_thread_area (__NR_Linux + 283) | ||
307 | #define __NR_inotify_init (__NR_Linux + 284) | ||
308 | #define __NR_inotify_add_watch (__NR_Linux + 285) | ||
309 | #define __NR_inotify_rm_watch (__NR_Linux + 286) | ||
310 | #define __NR_migrate_pages (__NR_Linux + 287) | ||
311 | #define __NR_openat (__NR_Linux + 288) | ||
312 | #define __NR_mkdirat (__NR_Linux + 289) | ||
313 | #define __NR_mknodat (__NR_Linux + 290) | ||
314 | #define __NR_fchownat (__NR_Linux + 291) | ||
315 | #define __NR_futimesat (__NR_Linux + 292) | ||
316 | #define __NR_fstatat64 (__NR_Linux + 293) | ||
317 | #define __NR_unlinkat (__NR_Linux + 294) | ||
318 | #define __NR_renameat (__NR_Linux + 295) | ||
319 | #define __NR_linkat (__NR_Linux + 296) | ||
320 | #define __NR_symlinkat (__NR_Linux + 297) | ||
321 | #define __NR_readlinkat (__NR_Linux + 298) | ||
322 | #define __NR_fchmodat (__NR_Linux + 299) | ||
323 | #define __NR_faccessat (__NR_Linux + 300) | ||
324 | #define __NR_pselect6 (__NR_Linux + 301) | ||
325 | #define __NR_ppoll (__NR_Linux + 302) | ||
326 | #define __NR_unshare (__NR_Linux + 303) | ||
327 | #define __NR_splice (__NR_Linux + 304) | ||
328 | #define __NR_sync_file_range (__NR_Linux + 305) | ||
329 | #define __NR_tee (__NR_Linux + 306) | ||
330 | #define __NR_vmsplice (__NR_Linux + 307) | ||
331 | #define __NR_move_pages (__NR_Linux + 308) | ||
332 | #define __NR_set_robust_list (__NR_Linux + 309) | ||
333 | #define __NR_get_robust_list (__NR_Linux + 310) | ||
334 | #define __NR_kexec_load (__NR_Linux + 311) | ||
335 | #define __NR_getcpu (__NR_Linux + 312) | ||
336 | #define __NR_epoll_pwait (__NR_Linux + 313) | ||
337 | #define __NR_ioprio_set (__NR_Linux + 314) | ||
338 | #define __NR_ioprio_get (__NR_Linux + 315) | ||
339 | #define __NR_utimensat (__NR_Linux + 316) | ||
340 | #define __NR_signalfd (__NR_Linux + 317) | ||
341 | #define __NR_timerfd (__NR_Linux + 318) | ||
342 | #define __NR_eventfd (__NR_Linux + 319) | ||
343 | #define __NR_fallocate (__NR_Linux + 320) | ||
344 | #define __NR_timerfd_create (__NR_Linux + 321) | ||
345 | #define __NR_timerfd_gettime (__NR_Linux + 322) | ||
346 | #define __NR_timerfd_settime (__NR_Linux + 323) | ||
347 | #define __NR_signalfd4 (__NR_Linux + 324) | ||
348 | #define __NR_eventfd2 (__NR_Linux + 325) | ||
349 | #define __NR_epoll_create1 (__NR_Linux + 326) | ||
350 | #define __NR_dup3 (__NR_Linux + 327) | ||
351 | #define __NR_pipe2 (__NR_Linux + 328) | ||
352 | #define __NR_inotify_init1 (__NR_Linux + 329) | ||
353 | |||
354 | /* | ||
355 | * Offset of the last Linux o32 flavoured syscall | ||
356 | */ | ||
357 | #define __NR_Linux_syscalls 329 | ||
358 | |||
359 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | ||
360 | |||
361 | #define __NR_O32_Linux 4000 | ||
362 | #define __NR_O32_Linux_syscalls 329 | ||
363 | |||
364 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | ||
365 | |||
366 | /* | ||
367 | * Linux 64-bit syscalls are in the range from 5000 to 5999. | ||
368 | */ | ||
369 | #define __NR_Linux 5000 | ||
370 | #define __NR_read (__NR_Linux + 0) | ||
371 | #define __NR_write (__NR_Linux + 1) | ||
372 | #define __NR_open (__NR_Linux + 2) | ||
373 | #define __NR_close (__NR_Linux + 3) | ||
374 | #define __NR_stat (__NR_Linux + 4) | ||
375 | #define __NR_fstat (__NR_Linux + 5) | ||
376 | #define __NR_lstat (__NR_Linux + 6) | ||
377 | #define __NR_poll (__NR_Linux + 7) | ||
378 | #define __NR_lseek (__NR_Linux + 8) | ||
379 | #define __NR_mmap (__NR_Linux + 9) | ||
380 | #define __NR_mprotect (__NR_Linux + 10) | ||
381 | #define __NR_munmap (__NR_Linux + 11) | ||
382 | #define __NR_brk (__NR_Linux + 12) | ||
383 | #define __NR_rt_sigaction (__NR_Linux + 13) | ||
384 | #define __NR_rt_sigprocmask (__NR_Linux + 14) | ||
385 | #define __NR_ioctl (__NR_Linux + 15) | ||
386 | #define __NR_pread64 (__NR_Linux + 16) | ||
387 | #define __NR_pwrite64 (__NR_Linux + 17) | ||
388 | #define __NR_readv (__NR_Linux + 18) | ||
389 | #define __NR_writev (__NR_Linux + 19) | ||
390 | #define __NR_access (__NR_Linux + 20) | ||
391 | #define __NR_pipe (__NR_Linux + 21) | ||
392 | #define __NR__newselect (__NR_Linux + 22) | ||
393 | #define __NR_sched_yield (__NR_Linux + 23) | ||
394 | #define __NR_mremap (__NR_Linux + 24) | ||
395 | #define __NR_msync (__NR_Linux + 25) | ||
396 | #define __NR_mincore (__NR_Linux + 26) | ||
397 | #define __NR_madvise (__NR_Linux + 27) | ||
398 | #define __NR_shmget (__NR_Linux + 28) | ||
399 | #define __NR_shmat (__NR_Linux + 29) | ||
400 | #define __NR_shmctl (__NR_Linux + 30) | ||
401 | #define __NR_dup (__NR_Linux + 31) | ||
402 | #define __NR_dup2 (__NR_Linux + 32) | ||
403 | #define __NR_pause (__NR_Linux + 33) | ||
404 | #define __NR_nanosleep (__NR_Linux + 34) | ||
405 | #define __NR_getitimer (__NR_Linux + 35) | ||
406 | #define __NR_setitimer (__NR_Linux + 36) | ||
407 | #define __NR_alarm (__NR_Linux + 37) | ||
408 | #define __NR_getpid (__NR_Linux + 38) | ||
409 | #define __NR_sendfile (__NR_Linux + 39) | ||
410 | #define __NR_socket (__NR_Linux + 40) | ||
411 | #define __NR_connect (__NR_Linux + 41) | ||
412 | #define __NR_accept (__NR_Linux + 42) | ||
413 | #define __NR_sendto (__NR_Linux + 43) | ||
414 | #define __NR_recvfrom (__NR_Linux + 44) | ||
415 | #define __NR_sendmsg (__NR_Linux + 45) | ||
416 | #define __NR_recvmsg (__NR_Linux + 46) | ||
417 | #define __NR_shutdown (__NR_Linux + 47) | ||
418 | #define __NR_bind (__NR_Linux + 48) | ||
419 | #define __NR_listen (__NR_Linux + 49) | ||
420 | #define __NR_getsockname (__NR_Linux + 50) | ||
421 | #define __NR_getpeername (__NR_Linux + 51) | ||
422 | #define __NR_socketpair (__NR_Linux + 52) | ||
423 | #define __NR_setsockopt (__NR_Linux + 53) | ||
424 | #define __NR_getsockopt (__NR_Linux + 54) | ||
425 | #define __NR_clone (__NR_Linux + 55) | ||
426 | #define __NR_fork (__NR_Linux + 56) | ||
427 | #define __NR_execve (__NR_Linux + 57) | ||
428 | #define __NR_exit (__NR_Linux + 58) | ||
429 | #define __NR_wait4 (__NR_Linux + 59) | ||
430 | #define __NR_kill (__NR_Linux + 60) | ||
431 | #define __NR_uname (__NR_Linux + 61) | ||
432 | #define __NR_semget (__NR_Linux + 62) | ||
433 | #define __NR_semop (__NR_Linux + 63) | ||
434 | #define __NR_semctl (__NR_Linux + 64) | ||
435 | #define __NR_shmdt (__NR_Linux + 65) | ||
436 | #define __NR_msgget (__NR_Linux + 66) | ||
437 | #define __NR_msgsnd (__NR_Linux + 67) | ||
438 | #define __NR_msgrcv (__NR_Linux + 68) | ||
439 | #define __NR_msgctl (__NR_Linux + 69) | ||
440 | #define __NR_fcntl (__NR_Linux + 70) | ||
441 | #define __NR_flock (__NR_Linux + 71) | ||
442 | #define __NR_fsync (__NR_Linux + 72) | ||
443 | #define __NR_fdatasync (__NR_Linux + 73) | ||
444 | #define __NR_truncate (__NR_Linux + 74) | ||
445 | #define __NR_ftruncate (__NR_Linux + 75) | ||
446 | #define __NR_getdents (__NR_Linux + 76) | ||
447 | #define __NR_getcwd (__NR_Linux + 77) | ||
448 | #define __NR_chdir (__NR_Linux + 78) | ||
449 | #define __NR_fchdir (__NR_Linux + 79) | ||
450 | #define __NR_rename (__NR_Linux + 80) | ||
451 | #define __NR_mkdir (__NR_Linux + 81) | ||
452 | #define __NR_rmdir (__NR_Linux + 82) | ||
453 | #define __NR_creat (__NR_Linux + 83) | ||
454 | #define __NR_link (__NR_Linux + 84) | ||
455 | #define __NR_unlink (__NR_Linux + 85) | ||
456 | #define __NR_symlink (__NR_Linux + 86) | ||
457 | #define __NR_readlink (__NR_Linux + 87) | ||
458 | #define __NR_chmod (__NR_Linux + 88) | ||
459 | #define __NR_fchmod (__NR_Linux + 89) | ||
460 | #define __NR_chown (__NR_Linux + 90) | ||
461 | #define __NR_fchown (__NR_Linux + 91) | ||
462 | #define __NR_lchown (__NR_Linux + 92) | ||
463 | #define __NR_umask (__NR_Linux + 93) | ||
464 | #define __NR_gettimeofday (__NR_Linux + 94) | ||
465 | #define __NR_getrlimit (__NR_Linux + 95) | ||
466 | #define __NR_getrusage (__NR_Linux + 96) | ||
467 | #define __NR_sysinfo (__NR_Linux + 97) | ||
468 | #define __NR_times (__NR_Linux + 98) | ||
469 | #define __NR_ptrace (__NR_Linux + 99) | ||
470 | #define __NR_getuid (__NR_Linux + 100) | ||
471 | #define __NR_syslog (__NR_Linux + 101) | ||
472 | #define __NR_getgid (__NR_Linux + 102) | ||
473 | #define __NR_setuid (__NR_Linux + 103) | ||
474 | #define __NR_setgid (__NR_Linux + 104) | ||
475 | #define __NR_geteuid (__NR_Linux + 105) | ||
476 | #define __NR_getegid (__NR_Linux + 106) | ||
477 | #define __NR_setpgid (__NR_Linux + 107) | ||
478 | #define __NR_getppid (__NR_Linux + 108) | ||
479 | #define __NR_getpgrp (__NR_Linux + 109) | ||
480 | #define __NR_setsid (__NR_Linux + 110) | ||
481 | #define __NR_setreuid (__NR_Linux + 111) | ||
482 | #define __NR_setregid (__NR_Linux + 112) | ||
483 | #define __NR_getgroups (__NR_Linux + 113) | ||
484 | #define __NR_setgroups (__NR_Linux + 114) | ||
485 | #define __NR_setresuid (__NR_Linux + 115) | ||
486 | #define __NR_getresuid (__NR_Linux + 116) | ||
487 | #define __NR_setresgid (__NR_Linux + 117) | ||
488 | #define __NR_getresgid (__NR_Linux + 118) | ||
489 | #define __NR_getpgid (__NR_Linux + 119) | ||
490 | #define __NR_setfsuid (__NR_Linux + 120) | ||
491 | #define __NR_setfsgid (__NR_Linux + 121) | ||
492 | #define __NR_getsid (__NR_Linux + 122) | ||
493 | #define __NR_capget (__NR_Linux + 123) | ||
494 | #define __NR_capset (__NR_Linux + 124) | ||
495 | #define __NR_rt_sigpending (__NR_Linux + 125) | ||
496 | #define __NR_rt_sigtimedwait (__NR_Linux + 126) | ||
497 | #define __NR_rt_sigqueueinfo (__NR_Linux + 127) | ||
498 | #define __NR_rt_sigsuspend (__NR_Linux + 128) | ||
499 | #define __NR_sigaltstack (__NR_Linux + 129) | ||
500 | #define __NR_utime (__NR_Linux + 130) | ||
501 | #define __NR_mknod (__NR_Linux + 131) | ||
502 | #define __NR_personality (__NR_Linux + 132) | ||
503 | #define __NR_ustat (__NR_Linux + 133) | ||
504 | #define __NR_statfs (__NR_Linux + 134) | ||
505 | #define __NR_fstatfs (__NR_Linux + 135) | ||
506 | #define __NR_sysfs (__NR_Linux + 136) | ||
507 | #define __NR_getpriority (__NR_Linux + 137) | ||
508 | #define __NR_setpriority (__NR_Linux + 138) | ||
509 | #define __NR_sched_setparam (__NR_Linux + 139) | ||
510 | #define __NR_sched_getparam (__NR_Linux + 140) | ||
511 | #define __NR_sched_setscheduler (__NR_Linux + 141) | ||
512 | #define __NR_sched_getscheduler (__NR_Linux + 142) | ||
513 | #define __NR_sched_get_priority_max (__NR_Linux + 143) | ||
514 | #define __NR_sched_get_priority_min (__NR_Linux + 144) | ||
515 | #define __NR_sched_rr_get_interval (__NR_Linux + 145) | ||
516 | #define __NR_mlock (__NR_Linux + 146) | ||
517 | #define __NR_munlock (__NR_Linux + 147) | ||
518 | #define __NR_mlockall (__NR_Linux + 148) | ||
519 | #define __NR_munlockall (__NR_Linux + 149) | ||
520 | #define __NR_vhangup (__NR_Linux + 150) | ||
521 | #define __NR_pivot_root (__NR_Linux + 151) | ||
522 | #define __NR__sysctl (__NR_Linux + 152) | ||
523 | #define __NR_prctl (__NR_Linux + 153) | ||
524 | #define __NR_adjtimex (__NR_Linux + 154) | ||
525 | #define __NR_setrlimit (__NR_Linux + 155) | ||
526 | #define __NR_chroot (__NR_Linux + 156) | ||
527 | #define __NR_sync (__NR_Linux + 157) | ||
528 | #define __NR_acct (__NR_Linux + 158) | ||
529 | #define __NR_settimeofday (__NR_Linux + 159) | ||
530 | #define __NR_mount (__NR_Linux + 160) | ||
531 | #define __NR_umount2 (__NR_Linux + 161) | ||
532 | #define __NR_swapon (__NR_Linux + 162) | ||
533 | #define __NR_swapoff (__NR_Linux + 163) | ||
534 | #define __NR_reboot (__NR_Linux + 164) | ||
535 | #define __NR_sethostname (__NR_Linux + 165) | ||
536 | #define __NR_setdomainname (__NR_Linux + 166) | ||
537 | #define __NR_create_module (__NR_Linux + 167) | ||
538 | #define __NR_init_module (__NR_Linux + 168) | ||
539 | #define __NR_delete_module (__NR_Linux + 169) | ||
540 | #define __NR_get_kernel_syms (__NR_Linux + 170) | ||
541 | #define __NR_query_module (__NR_Linux + 171) | ||
542 | #define __NR_quotactl (__NR_Linux + 172) | ||
543 | #define __NR_nfsservctl (__NR_Linux + 173) | ||
544 | #define __NR_getpmsg (__NR_Linux + 174) | ||
545 | #define __NR_putpmsg (__NR_Linux + 175) | ||
546 | #define __NR_afs_syscall (__NR_Linux + 176) | ||
547 | #define __NR_reserved177 (__NR_Linux + 177) | ||
548 | #define __NR_gettid (__NR_Linux + 178) | ||
549 | #define __NR_readahead (__NR_Linux + 179) | ||
550 | #define __NR_setxattr (__NR_Linux + 180) | ||
551 | #define __NR_lsetxattr (__NR_Linux + 181) | ||
552 | #define __NR_fsetxattr (__NR_Linux + 182) | ||
553 | #define __NR_getxattr (__NR_Linux + 183) | ||
554 | #define __NR_lgetxattr (__NR_Linux + 184) | ||
555 | #define __NR_fgetxattr (__NR_Linux + 185) | ||
556 | #define __NR_listxattr (__NR_Linux + 186) | ||
557 | #define __NR_llistxattr (__NR_Linux + 187) | ||
558 | #define __NR_flistxattr (__NR_Linux + 188) | ||
559 | #define __NR_removexattr (__NR_Linux + 189) | ||
560 | #define __NR_lremovexattr (__NR_Linux + 190) | ||
561 | #define __NR_fremovexattr (__NR_Linux + 191) | ||
562 | #define __NR_tkill (__NR_Linux + 192) | ||
563 | #define __NR_reserved193 (__NR_Linux + 193) | ||
564 | #define __NR_futex (__NR_Linux + 194) | ||
565 | #define __NR_sched_setaffinity (__NR_Linux + 195) | ||
566 | #define __NR_sched_getaffinity (__NR_Linux + 196) | ||
567 | #define __NR_cacheflush (__NR_Linux + 197) | ||
568 | #define __NR_cachectl (__NR_Linux + 198) | ||
569 | #define __NR_sysmips (__NR_Linux + 199) | ||
570 | #define __NR_io_setup (__NR_Linux + 200) | ||
571 | #define __NR_io_destroy (__NR_Linux + 201) | ||
572 | #define __NR_io_getevents (__NR_Linux + 202) | ||
573 | #define __NR_io_submit (__NR_Linux + 203) | ||
574 | #define __NR_io_cancel (__NR_Linux + 204) | ||
575 | #define __NR_exit_group (__NR_Linux + 205) | ||
576 | #define __NR_lookup_dcookie (__NR_Linux + 206) | ||
577 | #define __NR_epoll_create (__NR_Linux + 207) | ||
578 | #define __NR_epoll_ctl (__NR_Linux + 208) | ||
579 | #define __NR_epoll_wait (__NR_Linux + 209) | ||
580 | #define __NR_remap_file_pages (__NR_Linux + 210) | ||
581 | #define __NR_rt_sigreturn (__NR_Linux + 211) | ||
582 | #define __NR_set_tid_address (__NR_Linux + 212) | ||
583 | #define __NR_restart_syscall (__NR_Linux + 213) | ||
584 | #define __NR_semtimedop (__NR_Linux + 214) | ||
585 | #define __NR_fadvise64 (__NR_Linux + 215) | ||
586 | #define __NR_timer_create (__NR_Linux + 216) | ||
587 | #define __NR_timer_settime (__NR_Linux + 217) | ||
588 | #define __NR_timer_gettime (__NR_Linux + 218) | ||
589 | #define __NR_timer_getoverrun (__NR_Linux + 219) | ||
590 | #define __NR_timer_delete (__NR_Linux + 220) | ||
591 | #define __NR_clock_settime (__NR_Linux + 221) | ||
592 | #define __NR_clock_gettime (__NR_Linux + 222) | ||
593 | #define __NR_clock_getres (__NR_Linux + 223) | ||
594 | #define __NR_clock_nanosleep (__NR_Linux + 224) | ||
595 | #define __NR_tgkill (__NR_Linux + 225) | ||
596 | #define __NR_utimes (__NR_Linux + 226) | ||
597 | #define __NR_mbind (__NR_Linux + 227) | ||
598 | #define __NR_get_mempolicy (__NR_Linux + 228) | ||
599 | #define __NR_set_mempolicy (__NR_Linux + 229) | ||
600 | #define __NR_mq_open (__NR_Linux + 230) | ||
601 | #define __NR_mq_unlink (__NR_Linux + 231) | ||
602 | #define __NR_mq_timedsend (__NR_Linux + 232) | ||
603 | #define __NR_mq_timedreceive (__NR_Linux + 233) | ||
604 | #define __NR_mq_notify (__NR_Linux + 234) | ||
605 | #define __NR_mq_getsetattr (__NR_Linux + 235) | ||
606 | #define __NR_vserver (__NR_Linux + 236) | ||
607 | #define __NR_waitid (__NR_Linux + 237) | ||
608 | /* #define __NR_sys_setaltroot (__NR_Linux + 238) */ | ||
609 | #define __NR_add_key (__NR_Linux + 239) | ||
610 | #define __NR_request_key (__NR_Linux + 240) | ||
611 | #define __NR_keyctl (__NR_Linux + 241) | ||
612 | #define __NR_set_thread_area (__NR_Linux + 242) | ||
613 | #define __NR_inotify_init (__NR_Linux + 243) | ||
614 | #define __NR_inotify_add_watch (__NR_Linux + 244) | ||
615 | #define __NR_inotify_rm_watch (__NR_Linux + 245) | ||
616 | #define __NR_migrate_pages (__NR_Linux + 246) | ||
617 | #define __NR_openat (__NR_Linux + 247) | ||
618 | #define __NR_mkdirat (__NR_Linux + 248) | ||
619 | #define __NR_mknodat (__NR_Linux + 249) | ||
620 | #define __NR_fchownat (__NR_Linux + 250) | ||
621 | #define __NR_futimesat (__NR_Linux + 251) | ||
622 | #define __NR_newfstatat (__NR_Linux + 252) | ||
623 | #define __NR_unlinkat (__NR_Linux + 253) | ||
624 | #define __NR_renameat (__NR_Linux + 254) | ||
625 | #define __NR_linkat (__NR_Linux + 255) | ||
626 | #define __NR_symlinkat (__NR_Linux + 256) | ||
627 | #define __NR_readlinkat (__NR_Linux + 257) | ||
628 | #define __NR_fchmodat (__NR_Linux + 258) | ||
629 | #define __NR_faccessat (__NR_Linux + 259) | ||
630 | #define __NR_pselect6 (__NR_Linux + 260) | ||
631 | #define __NR_ppoll (__NR_Linux + 261) | ||
632 | #define __NR_unshare (__NR_Linux + 262) | ||
633 | #define __NR_splice (__NR_Linux + 263) | ||
634 | #define __NR_sync_file_range (__NR_Linux + 264) | ||
635 | #define __NR_tee (__NR_Linux + 265) | ||
636 | #define __NR_vmsplice (__NR_Linux + 266) | ||
637 | #define __NR_move_pages (__NR_Linux + 267) | ||
638 | #define __NR_set_robust_list (__NR_Linux + 268) | ||
639 | #define __NR_get_robust_list (__NR_Linux + 269) | ||
640 | #define __NR_kexec_load (__NR_Linux + 270) | ||
641 | #define __NR_getcpu (__NR_Linux + 271) | ||
642 | #define __NR_epoll_pwait (__NR_Linux + 272) | ||
643 | #define __NR_ioprio_set (__NR_Linux + 273) | ||
644 | #define __NR_ioprio_get (__NR_Linux + 274) | ||
645 | #define __NR_utimensat (__NR_Linux + 275) | ||
646 | #define __NR_signalfd (__NR_Linux + 276) | ||
647 | #define __NR_timerfd (__NR_Linux + 277) | ||
648 | #define __NR_eventfd (__NR_Linux + 278) | ||
649 | #define __NR_fallocate (__NR_Linux + 279) | ||
650 | #define __NR_timerfd_create (__NR_Linux + 280) | ||
651 | #define __NR_timerfd_gettime (__NR_Linux + 281) | ||
652 | #define __NR_timerfd_settime (__NR_Linux + 282) | ||
653 | #define __NR_signalfd4 (__NR_Linux + 283) | ||
654 | #define __NR_eventfd2 (__NR_Linux + 284) | ||
655 | #define __NR_epoll_create1 (__NR_Linux + 285) | ||
656 | #define __NR_dup3 (__NR_Linux + 286) | ||
657 | #define __NR_pipe2 (__NR_Linux + 287) | ||
658 | #define __NR_inotify_init1 (__NR_Linux + 288) | ||
659 | |||
660 | /* | ||
661 | * Offset of the last Linux 64-bit flavoured syscall | ||
662 | */ | ||
663 | #define __NR_Linux_syscalls 288 | ||
664 | |||
665 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | ||
666 | |||
667 | #define __NR_64_Linux 5000 | ||
668 | #define __NR_64_Linux_syscalls 288 | ||
669 | |||
670 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | ||
671 | |||
672 | /* | ||
673 | * Linux N32 syscalls are in the range from 6000 to 6999. | ||
674 | */ | ||
675 | #define __NR_Linux 6000 | ||
676 | #define __NR_read (__NR_Linux + 0) | ||
677 | #define __NR_write (__NR_Linux + 1) | ||
678 | #define __NR_open (__NR_Linux + 2) | ||
679 | #define __NR_close (__NR_Linux + 3) | ||
680 | #define __NR_stat (__NR_Linux + 4) | ||
681 | #define __NR_fstat (__NR_Linux + 5) | ||
682 | #define __NR_lstat (__NR_Linux + 6) | ||
683 | #define __NR_poll (__NR_Linux + 7) | ||
684 | #define __NR_lseek (__NR_Linux + 8) | ||
685 | #define __NR_mmap (__NR_Linux + 9) | ||
686 | #define __NR_mprotect (__NR_Linux + 10) | ||
687 | #define __NR_munmap (__NR_Linux + 11) | ||
688 | #define __NR_brk (__NR_Linux + 12) | ||
689 | #define __NR_rt_sigaction (__NR_Linux + 13) | ||
690 | #define __NR_rt_sigprocmask (__NR_Linux + 14) | ||
691 | #define __NR_ioctl (__NR_Linux + 15) | ||
692 | #define __NR_pread64 (__NR_Linux + 16) | ||
693 | #define __NR_pwrite64 (__NR_Linux + 17) | ||
694 | #define __NR_readv (__NR_Linux + 18) | ||
695 | #define __NR_writev (__NR_Linux + 19) | ||
696 | #define __NR_access (__NR_Linux + 20) | ||
697 | #define __NR_pipe (__NR_Linux + 21) | ||
698 | #define __NR__newselect (__NR_Linux + 22) | ||
699 | #define __NR_sched_yield (__NR_Linux + 23) | ||
700 | #define __NR_mremap (__NR_Linux + 24) | ||
701 | #define __NR_msync (__NR_Linux + 25) | ||
702 | #define __NR_mincore (__NR_Linux + 26) | ||
703 | #define __NR_madvise (__NR_Linux + 27) | ||
704 | #define __NR_shmget (__NR_Linux + 28) | ||
705 | #define __NR_shmat (__NR_Linux + 29) | ||
706 | #define __NR_shmctl (__NR_Linux + 30) | ||
707 | #define __NR_dup (__NR_Linux + 31) | ||
708 | #define __NR_dup2 (__NR_Linux + 32) | ||
709 | #define __NR_pause (__NR_Linux + 33) | ||
710 | #define __NR_nanosleep (__NR_Linux + 34) | ||
711 | #define __NR_getitimer (__NR_Linux + 35) | ||
712 | #define __NR_setitimer (__NR_Linux + 36) | ||
713 | #define __NR_alarm (__NR_Linux + 37) | ||
714 | #define __NR_getpid (__NR_Linux + 38) | ||
715 | #define __NR_sendfile (__NR_Linux + 39) | ||
716 | #define __NR_socket (__NR_Linux + 40) | ||
717 | #define __NR_connect (__NR_Linux + 41) | ||
718 | #define __NR_accept (__NR_Linux + 42) | ||
719 | #define __NR_sendto (__NR_Linux + 43) | ||
720 | #define __NR_recvfrom (__NR_Linux + 44) | ||
721 | #define __NR_sendmsg (__NR_Linux + 45) | ||
722 | #define __NR_recvmsg (__NR_Linux + 46) | ||
723 | #define __NR_shutdown (__NR_Linux + 47) | ||
724 | #define __NR_bind (__NR_Linux + 48) | ||
725 | #define __NR_listen (__NR_Linux + 49) | ||
726 | #define __NR_getsockname (__NR_Linux + 50) | ||
727 | #define __NR_getpeername (__NR_Linux + 51) | ||
728 | #define __NR_socketpair (__NR_Linux + 52) | ||
729 | #define __NR_setsockopt (__NR_Linux + 53) | ||
730 | #define __NR_getsockopt (__NR_Linux + 54) | ||
731 | #define __NR_clone (__NR_Linux + 55) | ||
732 | #define __NR_fork (__NR_Linux + 56) | ||
733 | #define __NR_execve (__NR_Linux + 57) | ||
734 | #define __NR_exit (__NR_Linux + 58) | ||
735 | #define __NR_wait4 (__NR_Linux + 59) | ||
736 | #define __NR_kill (__NR_Linux + 60) | ||
737 | #define __NR_uname (__NR_Linux + 61) | ||
738 | #define __NR_semget (__NR_Linux + 62) | ||
739 | #define __NR_semop (__NR_Linux + 63) | ||
740 | #define __NR_semctl (__NR_Linux + 64) | ||
741 | #define __NR_shmdt (__NR_Linux + 65) | ||
742 | #define __NR_msgget (__NR_Linux + 66) | ||
743 | #define __NR_msgsnd (__NR_Linux + 67) | ||
744 | #define __NR_msgrcv (__NR_Linux + 68) | ||
745 | #define __NR_msgctl (__NR_Linux + 69) | ||
746 | #define __NR_fcntl (__NR_Linux + 70) | ||
747 | #define __NR_flock (__NR_Linux + 71) | ||
748 | #define __NR_fsync (__NR_Linux + 72) | ||
749 | #define __NR_fdatasync (__NR_Linux + 73) | ||
750 | #define __NR_truncate (__NR_Linux + 74) | ||
751 | #define __NR_ftruncate (__NR_Linux + 75) | ||
752 | #define __NR_getdents (__NR_Linux + 76) | ||
753 | #define __NR_getcwd (__NR_Linux + 77) | ||
754 | #define __NR_chdir (__NR_Linux + 78) | ||
755 | #define __NR_fchdir (__NR_Linux + 79) | ||
756 | #define __NR_rename (__NR_Linux + 80) | ||
757 | #define __NR_mkdir (__NR_Linux + 81) | ||
758 | #define __NR_rmdir (__NR_Linux + 82) | ||
759 | #define __NR_creat (__NR_Linux + 83) | ||
760 | #define __NR_link (__NR_Linux + 84) | ||
761 | #define __NR_unlink (__NR_Linux + 85) | ||
762 | #define __NR_symlink (__NR_Linux + 86) | ||
763 | #define __NR_readlink (__NR_Linux + 87) | ||
764 | #define __NR_chmod (__NR_Linux + 88) | ||
765 | #define __NR_fchmod (__NR_Linux + 89) | ||
766 | #define __NR_chown (__NR_Linux + 90) | ||
767 | #define __NR_fchown (__NR_Linux + 91) | ||
768 | #define __NR_lchown (__NR_Linux + 92) | ||
769 | #define __NR_umask (__NR_Linux + 93) | ||
770 | #define __NR_gettimeofday (__NR_Linux + 94) | ||
771 | #define __NR_getrlimit (__NR_Linux + 95) | ||
772 | #define __NR_getrusage (__NR_Linux + 96) | ||
773 | #define __NR_sysinfo (__NR_Linux + 97) | ||
774 | #define __NR_times (__NR_Linux + 98) | ||
775 | #define __NR_ptrace (__NR_Linux + 99) | ||
776 | #define __NR_getuid (__NR_Linux + 100) | ||
777 | #define __NR_syslog (__NR_Linux + 101) | ||
778 | #define __NR_getgid (__NR_Linux + 102) | ||
779 | #define __NR_setuid (__NR_Linux + 103) | ||
780 | #define __NR_setgid (__NR_Linux + 104) | ||
781 | #define __NR_geteuid (__NR_Linux + 105) | ||
782 | #define __NR_getegid (__NR_Linux + 106) | ||
783 | #define __NR_setpgid (__NR_Linux + 107) | ||
784 | #define __NR_getppid (__NR_Linux + 108) | ||
785 | #define __NR_getpgrp (__NR_Linux + 109) | ||
786 | #define __NR_setsid (__NR_Linux + 110) | ||
787 | #define __NR_setreuid (__NR_Linux + 111) | ||
788 | #define __NR_setregid (__NR_Linux + 112) | ||
789 | #define __NR_getgroups (__NR_Linux + 113) | ||
790 | #define __NR_setgroups (__NR_Linux + 114) | ||
791 | #define __NR_setresuid (__NR_Linux + 115) | ||
792 | #define __NR_getresuid (__NR_Linux + 116) | ||
793 | #define __NR_setresgid (__NR_Linux + 117) | ||
794 | #define __NR_getresgid (__NR_Linux + 118) | ||
795 | #define __NR_getpgid (__NR_Linux + 119) | ||
796 | #define __NR_setfsuid (__NR_Linux + 120) | ||
797 | #define __NR_setfsgid (__NR_Linux + 121) | ||
798 | #define __NR_getsid (__NR_Linux + 122) | ||
799 | #define __NR_capget (__NR_Linux + 123) | ||
800 | #define __NR_capset (__NR_Linux + 124) | ||
801 | #define __NR_rt_sigpending (__NR_Linux + 125) | ||
802 | #define __NR_rt_sigtimedwait (__NR_Linux + 126) | ||
803 | #define __NR_rt_sigqueueinfo (__NR_Linux + 127) | ||
804 | #define __NR_rt_sigsuspend (__NR_Linux + 128) | ||
805 | #define __NR_sigaltstack (__NR_Linux + 129) | ||
806 | #define __NR_utime (__NR_Linux + 130) | ||
807 | #define __NR_mknod (__NR_Linux + 131) | ||
808 | #define __NR_personality (__NR_Linux + 132) | ||
809 | #define __NR_ustat (__NR_Linux + 133) | ||
810 | #define __NR_statfs (__NR_Linux + 134) | ||
811 | #define __NR_fstatfs (__NR_Linux + 135) | ||
812 | #define __NR_sysfs (__NR_Linux + 136) | ||
813 | #define __NR_getpriority (__NR_Linux + 137) | ||
814 | #define __NR_setpriority (__NR_Linux + 138) | ||
815 | #define __NR_sched_setparam (__NR_Linux + 139) | ||
816 | #define __NR_sched_getparam (__NR_Linux + 140) | ||
817 | #define __NR_sched_setscheduler (__NR_Linux + 141) | ||
818 | #define __NR_sched_getscheduler (__NR_Linux + 142) | ||
819 | #define __NR_sched_get_priority_max (__NR_Linux + 143) | ||
820 | #define __NR_sched_get_priority_min (__NR_Linux + 144) | ||
821 | #define __NR_sched_rr_get_interval (__NR_Linux + 145) | ||
822 | #define __NR_mlock (__NR_Linux + 146) | ||
823 | #define __NR_munlock (__NR_Linux + 147) | ||
824 | #define __NR_mlockall (__NR_Linux + 148) | ||
825 | #define __NR_munlockall (__NR_Linux + 149) | ||
826 | #define __NR_vhangup (__NR_Linux + 150) | ||
827 | #define __NR_pivot_root (__NR_Linux + 151) | ||
828 | #define __NR__sysctl (__NR_Linux + 152) | ||
829 | #define __NR_prctl (__NR_Linux + 153) | ||
830 | #define __NR_adjtimex (__NR_Linux + 154) | ||
831 | #define __NR_setrlimit (__NR_Linux + 155) | ||
832 | #define __NR_chroot (__NR_Linux + 156) | ||
833 | #define __NR_sync (__NR_Linux + 157) | ||
834 | #define __NR_acct (__NR_Linux + 158) | ||
835 | #define __NR_settimeofday (__NR_Linux + 159) | ||
836 | #define __NR_mount (__NR_Linux + 160) | ||
837 | #define __NR_umount2 (__NR_Linux + 161) | ||
838 | #define __NR_swapon (__NR_Linux + 162) | ||
839 | #define __NR_swapoff (__NR_Linux + 163) | ||
840 | #define __NR_reboot (__NR_Linux + 164) | ||
841 | #define __NR_sethostname (__NR_Linux + 165) | ||
842 | #define __NR_setdomainname (__NR_Linux + 166) | ||
843 | #define __NR_create_module (__NR_Linux + 167) | ||
844 | #define __NR_init_module (__NR_Linux + 168) | ||
845 | #define __NR_delete_module (__NR_Linux + 169) | ||
846 | #define __NR_get_kernel_syms (__NR_Linux + 170) | ||
847 | #define __NR_query_module (__NR_Linux + 171) | ||
848 | #define __NR_quotactl (__NR_Linux + 172) | ||
849 | #define __NR_nfsservctl (__NR_Linux + 173) | ||
850 | #define __NR_getpmsg (__NR_Linux + 174) | ||
851 | #define __NR_putpmsg (__NR_Linux + 175) | ||
852 | #define __NR_afs_syscall (__NR_Linux + 176) | ||
853 | #define __NR_reserved177 (__NR_Linux + 177) | ||
854 | #define __NR_gettid (__NR_Linux + 178) | ||
855 | #define __NR_readahead (__NR_Linux + 179) | ||
856 | #define __NR_setxattr (__NR_Linux + 180) | ||
857 | #define __NR_lsetxattr (__NR_Linux + 181) | ||
858 | #define __NR_fsetxattr (__NR_Linux + 182) | ||
859 | #define __NR_getxattr (__NR_Linux + 183) | ||
860 | #define __NR_lgetxattr (__NR_Linux + 184) | ||
861 | #define __NR_fgetxattr (__NR_Linux + 185) | ||
862 | #define __NR_listxattr (__NR_Linux + 186) | ||
863 | #define __NR_llistxattr (__NR_Linux + 187) | ||
864 | #define __NR_flistxattr (__NR_Linux + 188) | ||
865 | #define __NR_removexattr (__NR_Linux + 189) | ||
866 | #define __NR_lremovexattr (__NR_Linux + 190) | ||
867 | #define __NR_fremovexattr (__NR_Linux + 191) | ||
868 | #define __NR_tkill (__NR_Linux + 192) | ||
869 | #define __NR_reserved193 (__NR_Linux + 193) | ||
870 | #define __NR_futex (__NR_Linux + 194) | ||
871 | #define __NR_sched_setaffinity (__NR_Linux + 195) | ||
872 | #define __NR_sched_getaffinity (__NR_Linux + 196) | ||
873 | #define __NR_cacheflush (__NR_Linux + 197) | ||
874 | #define __NR_cachectl (__NR_Linux + 198) | ||
875 | #define __NR_sysmips (__NR_Linux + 199) | ||
876 | #define __NR_io_setup (__NR_Linux + 200) | ||
877 | #define __NR_io_destroy (__NR_Linux + 201) | ||
878 | #define __NR_io_getevents (__NR_Linux + 202) | ||
879 | #define __NR_io_submit (__NR_Linux + 203) | ||
880 | #define __NR_io_cancel (__NR_Linux + 204) | ||
881 | #define __NR_exit_group (__NR_Linux + 205) | ||
882 | #define __NR_lookup_dcookie (__NR_Linux + 206) | ||
883 | #define __NR_epoll_create (__NR_Linux + 207) | ||
884 | #define __NR_epoll_ctl (__NR_Linux + 208) | ||
885 | #define __NR_epoll_wait (__NR_Linux + 209) | ||
886 | #define __NR_remap_file_pages (__NR_Linux + 210) | ||
887 | #define __NR_rt_sigreturn (__NR_Linux + 211) | ||
888 | #define __NR_fcntl64 (__NR_Linux + 212) | ||
889 | #define __NR_set_tid_address (__NR_Linux + 213) | ||
890 | #define __NR_restart_syscall (__NR_Linux + 214) | ||
891 | #define __NR_semtimedop (__NR_Linux + 215) | ||
892 | #define __NR_fadvise64 (__NR_Linux + 216) | ||
893 | #define __NR_statfs64 (__NR_Linux + 217) | ||
894 | #define __NR_fstatfs64 (__NR_Linux + 218) | ||
895 | #define __NR_sendfile64 (__NR_Linux + 219) | ||
896 | #define __NR_timer_create (__NR_Linux + 220) | ||
897 | #define __NR_timer_settime (__NR_Linux + 221) | ||
898 | #define __NR_timer_gettime (__NR_Linux + 222) | ||
899 | #define __NR_timer_getoverrun (__NR_Linux + 223) | ||
900 | #define __NR_timer_delete (__NR_Linux + 224) | ||
901 | #define __NR_clock_settime (__NR_Linux + 225) | ||
902 | #define __NR_clock_gettime (__NR_Linux + 226) | ||
903 | #define __NR_clock_getres (__NR_Linux + 227) | ||
904 | #define __NR_clock_nanosleep (__NR_Linux + 228) | ||
905 | #define __NR_tgkill (__NR_Linux + 229) | ||
906 | #define __NR_utimes (__NR_Linux + 230) | ||
907 | #define __NR_mbind (__NR_Linux + 231) | ||
908 | #define __NR_get_mempolicy (__NR_Linux + 232) | ||
909 | #define __NR_set_mempolicy (__NR_Linux + 233) | ||
910 | #define __NR_mq_open (__NR_Linux + 234) | ||
911 | #define __NR_mq_unlink (__NR_Linux + 235) | ||
912 | #define __NR_mq_timedsend (__NR_Linux + 236) | ||
913 | #define __NR_mq_timedreceive (__NR_Linux + 237) | ||
914 | #define __NR_mq_notify (__NR_Linux + 238) | ||
915 | #define __NR_mq_getsetattr (__NR_Linux + 239) | ||
916 | #define __NR_vserver (__NR_Linux + 240) | ||
917 | #define __NR_waitid (__NR_Linux + 241) | ||
918 | /* #define __NR_sys_setaltroot (__NR_Linux + 242) */ | ||
919 | #define __NR_add_key (__NR_Linux + 243) | ||
920 | #define __NR_request_key (__NR_Linux + 244) | ||
921 | #define __NR_keyctl (__NR_Linux + 245) | ||
922 | #define __NR_set_thread_area (__NR_Linux + 246) | ||
923 | #define __NR_inotify_init (__NR_Linux + 247) | ||
924 | #define __NR_inotify_add_watch (__NR_Linux + 248) | ||
925 | #define __NR_inotify_rm_watch (__NR_Linux + 249) | ||
926 | #define __NR_migrate_pages (__NR_Linux + 250) | ||
927 | #define __NR_openat (__NR_Linux + 251) | ||
928 | #define __NR_mkdirat (__NR_Linux + 252) | ||
929 | #define __NR_mknodat (__NR_Linux + 253) | ||
930 | #define __NR_fchownat (__NR_Linux + 254) | ||
931 | #define __NR_futimesat (__NR_Linux + 255) | ||
932 | #define __NR_newfstatat (__NR_Linux + 256) | ||
933 | #define __NR_unlinkat (__NR_Linux + 257) | ||
934 | #define __NR_renameat (__NR_Linux + 258) | ||
935 | #define __NR_linkat (__NR_Linux + 259) | ||
936 | #define __NR_symlinkat (__NR_Linux + 260) | ||
937 | #define __NR_readlinkat (__NR_Linux + 261) | ||
938 | #define __NR_fchmodat (__NR_Linux + 262) | ||
939 | #define __NR_faccessat (__NR_Linux + 263) | ||
940 | #define __NR_pselect6 (__NR_Linux + 264) | ||
941 | #define __NR_ppoll (__NR_Linux + 265) | ||
942 | #define __NR_unshare (__NR_Linux + 266) | ||
943 | #define __NR_splice (__NR_Linux + 267) | ||
944 | #define __NR_sync_file_range (__NR_Linux + 268) | ||
945 | #define __NR_tee (__NR_Linux + 269) | ||
946 | #define __NR_vmsplice (__NR_Linux + 270) | ||
947 | #define __NR_move_pages (__NR_Linux + 271) | ||
948 | #define __NR_set_robust_list (__NR_Linux + 272) | ||
949 | #define __NR_get_robust_list (__NR_Linux + 273) | ||
950 | #define __NR_kexec_load (__NR_Linux + 274) | ||
951 | #define __NR_getcpu (__NR_Linux + 275) | ||
952 | #define __NR_epoll_pwait (__NR_Linux + 276) | ||
953 | #define __NR_ioprio_set (__NR_Linux + 277) | ||
954 | #define __NR_ioprio_get (__NR_Linux + 278) | ||
955 | #define __NR_utimensat (__NR_Linux + 279) | ||
956 | #define __NR_signalfd (__NR_Linux + 280) | ||
957 | #define __NR_timerfd (__NR_Linux + 281) | ||
958 | #define __NR_eventfd (__NR_Linux + 282) | ||
959 | #define __NR_fallocate (__NR_Linux + 283) | ||
960 | #define __NR_timerfd_create (__NR_Linux + 284) | ||
961 | #define __NR_timerfd_gettime (__NR_Linux + 285) | ||
962 | #define __NR_timerfd_settime (__NR_Linux + 286) | ||
963 | #define __NR_signalfd4 (__NR_Linux + 287) | ||
964 | #define __NR_eventfd2 (__NR_Linux + 288) | ||
965 | #define __NR_epoll_create1 (__NR_Linux + 289) | ||
966 | #define __NR_dup3 (__NR_Linux + 290) | ||
967 | #define __NR_pipe2 (__NR_Linux + 291) | ||
968 | #define __NR_inotify_init1 (__NR_Linux + 292) | ||
969 | |||
970 | /* | ||
971 | * Offset of the last N32 flavoured syscall | ||
972 | */ | ||
973 | #define __NR_Linux_syscalls 292 | ||
974 | |||
975 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | ||
976 | |||
977 | #define __NR_N32_Linux 6000 | ||
978 | #define __NR_N32_Linux_syscalls 292 | ||
979 | |||
980 | #ifdef __KERNEL__ | ||
981 | |||
982 | #ifndef __ASSEMBLY__ | ||
983 | |||
984 | #define __ARCH_OMIT_COMPAT_SYS_GETDENTS64 | ||
985 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
986 | #define __ARCH_WANT_OLD_READDIR | ||
987 | #define __ARCH_WANT_SYS_ALARM | ||
988 | #define __ARCH_WANT_SYS_GETHOSTNAME | ||
989 | #define __ARCH_WANT_SYS_PAUSE | ||
990 | #define __ARCH_WANT_SYS_SGETMASK | ||
991 | #define __ARCH_WANT_SYS_UTIME | ||
992 | #define __ARCH_WANT_SYS_WAITPID | ||
993 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
994 | #define __ARCH_WANT_SYS_GETPGRP | ||
995 | #define __ARCH_WANT_SYS_LLSEEK | ||
996 | #define __ARCH_WANT_SYS_NICE | ||
997 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
998 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
999 | #define __ARCH_WANT_SYS_SIGPENDING | ||
1000 | #define __ARCH_WANT_SYS_SIGPROCMASK | ||
1001 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
1002 | # ifdef CONFIG_32BIT | ||
1003 | # define __ARCH_WANT_STAT64 | ||
1004 | # define __ARCH_WANT_SYS_TIME | ||
1005 | # endif | ||
1006 | # ifdef CONFIG_MIPS32_O32 | ||
1007 | # define __ARCH_WANT_COMPAT_SYS_TIME | ||
1008 | # endif | ||
1009 | |||
1010 | /* whitelists for checksyscalls */ | ||
1011 | #define __IGNORE_select | ||
1012 | #define __IGNORE_vfork | ||
1013 | #define __IGNORE_time | ||
1014 | #define __IGNORE_uselib | ||
1015 | #define __IGNORE_fadvise64_64 | ||
1016 | #define __IGNORE_getdents64 | ||
1017 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | ||
1018 | #define __IGNORE_truncate64 | ||
1019 | #define __IGNORE_ftruncate64 | ||
1020 | #define __IGNORE_stat64 | ||
1021 | #define __IGNORE_lstat64 | ||
1022 | #define __IGNORE_fstat64 | ||
1023 | #define __IGNORE_fstatat64 | ||
1024 | #endif | ||
1025 | |||
1026 | #endif /* !__ASSEMBLY__ */ | ||
1027 | |||
1028 | /* | ||
1029 | * "Conditional" syscalls | ||
1030 | * | ||
1031 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
1032 | * but it doesn't work on all toolchains, so we just do it by hand | ||
1033 | */ | ||
1034 | #define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall") | ||
1035 | |||
1036 | #endif /* __KERNEL__ */ | ||
1037 | #endif /* _ASM_UNISTD_H */ | ||
diff --git a/include/asm-mips/user.h b/include/asm-mips/user.h deleted file mode 100644 index afa83a4c1888..000000000000 --- a/include/asm-mips/user.h +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_USER_H | ||
9 | #define _ASM_USER_H | ||
10 | |||
11 | #include <asm/page.h> | ||
12 | #include <asm/reg.h> | ||
13 | |||
14 | /* | ||
15 | * Core file format: The core file is written in such a way that gdb | ||
16 | * can understand it and provide useful information to the user (under | ||
17 | * linux we use the `trad-core' bfd, NOT the irix-core). The file | ||
18 | * contents are as follows: | ||
19 | * | ||
20 | * upage: 1 page consisting of a user struct that tells gdb | ||
21 | * what is present in the file. Directly after this is a | ||
22 | * copy of the task_struct, which is currently not used by gdb, | ||
23 | * but it may come in handy at some point. All of the registers | ||
24 | * are stored as part of the upage. The upage should always be | ||
25 | * only one page long. | ||
26 | * data: The data segment follows next. We use current->end_text to | ||
27 | * current->brk to pick up all of the user variables, plus any memory | ||
28 | * that may have been sbrk'ed. No attempt is made to determine if a | ||
29 | * page is demand-zero or if a page is totally unused, we just cover | ||
30 | * the entire range. All of the addresses are rounded in such a way | ||
31 | * that an integral number of pages is written. | ||
32 | * stack: We need the stack information in order to get a meaningful | ||
33 | * backtrace. We need to write the data from usp to | ||
34 | * current->start_stack, so we round each of these in order to be able | ||
35 | * to write an integer number of pages. | ||
36 | */ | ||
37 | struct user { | ||
38 | unsigned long regs[EF_SIZE / /* integer and fp regs */ | ||
39 | sizeof(unsigned long) + 64]; | ||
40 | size_t u_tsize; /* text size (pages) */ | ||
41 | size_t u_dsize; /* data size (pages) */ | ||
42 | size_t u_ssize; /* stack size (pages) */ | ||
43 | unsigned long start_code; /* text starting address */ | ||
44 | unsigned long start_data; /* data starting address */ | ||
45 | unsigned long start_stack; /* stack starting address */ | ||
46 | long int signal; /* signal causing core dump */ | ||
47 | unsigned long u_ar0; /* help gdb find registers */ | ||
48 | unsigned long magic; /* identifies a core file */ | ||
49 | char u_comm[32]; /* user command name */ | ||
50 | }; | ||
51 | |||
52 | #define NBPG PAGE_SIZE | ||
53 | #define UPAGES 1 | ||
54 | #define HOST_TEXT_START_ADDR (u.start_code) | ||
55 | #define HOST_DATA_START_ADDR (u.start_data) | ||
56 | #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) | ||
57 | |||
58 | #endif /* _ASM_USER_H */ | ||
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h deleted file mode 100644 index f4cff7e4fa8a..000000000000 --- a/include/asm-mips/vga.h +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* | ||
2 | * Access to VGA videoram | ||
3 | * | ||
4 | * (c) 1998 Martin Mares <mj@ucw.cz> | ||
5 | */ | ||
6 | #ifndef _ASM_VGA_H | ||
7 | #define _ASM_VGA_H | ||
8 | |||
9 | #include <asm/byteorder.h> | ||
10 | |||
11 | /* | ||
12 | * On the PC, we can just recalculate addresses and then | ||
13 | * access the videoram directly without any black magic. | ||
14 | */ | ||
15 | |||
16 | #define VGA_MAP_MEM(x, s) (0xb0000000L + (unsigned long)(x)) | ||
17 | |||
18 | #define vga_readb(x) (*(x)) | ||
19 | #define vga_writeb(x, y) (*(y) = (x)) | ||
20 | |||
21 | #define VT_BUF_HAVE_RW | ||
22 | /* | ||
23 | * These are only needed for supporting VGA or MDA text mode, which use little | ||
24 | * endian byte ordering. | ||
25 | * In other cases, we can optimize by using native byte ordering and | ||
26 | * <linux/vt_buffer.h> has already done the right job for us. | ||
27 | */ | ||
28 | |||
29 | #undef scr_writew | ||
30 | #undef scr_readw | ||
31 | |||
32 | static inline void scr_writew(u16 val, volatile u16 *addr) | ||
33 | { | ||
34 | *addr = cpu_to_le16(val); | ||
35 | } | ||
36 | |||
37 | static inline u16 scr_readw(volatile const u16 *addr) | ||
38 | { | ||
39 | return le16_to_cpu(*addr); | ||
40 | } | ||
41 | |||
42 | #define scr_memcpyw(d, s, c) memcpy(d, s, c) | ||
43 | #define scr_memmovew(d, s, c) memmove(d, s, c) | ||
44 | #define VT_BUF_HAVE_MEMCPYW | ||
45 | #define VT_BUF_HAVE_MEMMOVEW | ||
46 | |||
47 | #endif /* _ASM_VGA_H */ | ||
diff --git a/include/asm-mips/vpe.h b/include/asm-mips/vpe.h deleted file mode 100644 index c6e1b961537d..000000000000 --- a/include/asm-mips/vpe.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can distribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License (Version 2) as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
11 | * for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef _ASM_VPE_H | ||
20 | #define _ASM_VPE_H | ||
21 | |||
22 | struct vpe_notifications { | ||
23 | void (*start)(int vpe); | ||
24 | void (*stop)(int vpe); | ||
25 | |||
26 | struct list_head list; | ||
27 | }; | ||
28 | |||
29 | |||
30 | extern int vpe_notify(int index, struct vpe_notifications *notify); | ||
31 | |||
32 | extern void *vpe_get_shared(int index); | ||
33 | extern int vpe_getuid(int index); | ||
34 | extern int vpe_getgid(int index); | ||
35 | extern char *vpe_getcwd(int index); | ||
36 | |||
37 | #endif /* _ASM_VPE_H */ | ||
diff --git a/include/asm-mips/vr41xx/capcella.h b/include/asm-mips/vr41xx/capcella.h deleted file mode 100644 index e0ee05a3dfcc..000000000000 --- a/include/asm-mips/vr41xx/capcella.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * capcella.h, Include file for ZAO Networks Capcella. | ||
3 | * | ||
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __ZAO_CAPCELLA_H | ||
21 | #define __ZAO_CAPCELLA_H | ||
22 | |||
23 | #include <asm/vr41xx/irq.h> | ||
24 | |||
25 | /* | ||
26 | * General-Purpose I/O Pin Number | ||
27 | */ | ||
28 | #define PC104PLUS_INTA_PIN 2 | ||
29 | #define PC104PLUS_INTB_PIN 3 | ||
30 | #define PC104PLUS_INTC_PIN 4 | ||
31 | #define PC104PLUS_INTD_PIN 5 | ||
32 | |||
33 | /* | ||
34 | * Interrupt Number | ||
35 | */ | ||
36 | #define RTL8139_1_IRQ GIU_IRQ(PC104PLUS_INTC_PIN) | ||
37 | #define RTL8139_2_IRQ GIU_IRQ(PC104PLUS_INTD_PIN) | ||
38 | #define PC104PLUS_INTA_IRQ GIU_IRQ(PC104PLUS_INTA_PIN) | ||
39 | #define PC104PLUS_INTB_IRQ GIU_IRQ(PC104PLUS_INTB_PIN) | ||
40 | #define PC104PLUS_INTC_IRQ GIU_IRQ(PC104PLUS_INTC_PIN) | ||
41 | #define PC104PLUS_INTD_IRQ GIU_IRQ(PC104PLUS_INTD_PIN) | ||
42 | |||
43 | #endif /* __ZAO_CAPCELLA_H */ | ||
diff --git a/include/asm-mips/vr41xx/giu.h b/include/asm-mips/vr41xx/giu.h deleted file mode 100644 index 0bcdd3a5c256..000000000000 --- a/include/asm-mips/vr41xx/giu.h +++ /dev/null | |||
@@ -1,78 +0,0 @@ | |||
1 | /* | ||
2 | * Include file for NEC VR4100 series General-purpose I/O Unit. | ||
3 | * | ||
4 | * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __NEC_VR41XX_GIU_H | ||
21 | #define __NEC_VR41XX_GIU_H | ||
22 | |||
23 | /* | ||
24 | * NEC VR4100 series GIU platform device IDs. | ||
25 | */ | ||
26 | enum { | ||
27 | GPIO_50PINS_PULLUPDOWN, | ||
28 | GPIO_36PINS, | ||
29 | GPIO_48PINS_EDGE_SELECT, | ||
30 | }; | ||
31 | |||
32 | typedef enum { | ||
33 | IRQ_TRIGGER_LEVEL, | ||
34 | IRQ_TRIGGER_EDGE, | ||
35 | IRQ_TRIGGER_EDGE_FALLING, | ||
36 | IRQ_TRIGGER_EDGE_RISING, | ||
37 | } irq_trigger_t; | ||
38 | |||
39 | typedef enum { | ||
40 | IRQ_SIGNAL_THROUGH, | ||
41 | IRQ_SIGNAL_HOLD, | ||
42 | } irq_signal_t; | ||
43 | |||
44 | extern void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_t signal); | ||
45 | |||
46 | typedef enum { | ||
47 | IRQ_LEVEL_LOW, | ||
48 | IRQ_LEVEL_HIGH, | ||
49 | } irq_level_t; | ||
50 | |||
51 | extern void vr41xx_set_irq_level(unsigned int pin, irq_level_t level); | ||
52 | |||
53 | typedef enum { | ||
54 | GPIO_DATA_LOW, | ||
55 | GPIO_DATA_HIGH, | ||
56 | GPIO_DATA_INVAL, | ||
57 | } gpio_data_t; | ||
58 | |||
59 | extern gpio_data_t vr41xx_gpio_get_pin(unsigned int pin); | ||
60 | extern int vr41xx_gpio_set_pin(unsigned int pin, gpio_data_t data); | ||
61 | |||
62 | typedef enum { | ||
63 | GPIO_INPUT, | ||
64 | GPIO_OUTPUT, | ||
65 | GPIO_OUTPUT_DISABLE, | ||
66 | } gpio_direction_t; | ||
67 | |||
68 | extern int vr41xx_gpio_set_direction(unsigned int pin, gpio_direction_t dir); | ||
69 | |||
70 | typedef enum { | ||
71 | GPIO_PULL_DOWN, | ||
72 | GPIO_PULL_UP, | ||
73 | GPIO_PULL_DISABLE, | ||
74 | } gpio_pull_t; | ||
75 | |||
76 | extern int vr41xx_gpio_pullupdown(unsigned int pin, gpio_pull_t pull); | ||
77 | |||
78 | #endif /* __NEC_VR41XX_GIU_H */ | ||
diff --git a/include/asm-mips/vr41xx/irq.h b/include/asm-mips/vr41xx/irq.h deleted file mode 100644 index d315dfbc08f2..000000000000 --- a/include/asm-mips/vr41xx/irq.h +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/vr41xx/irq.h | ||
3 | * | ||
4 | * Interrupt numbers for NEC VR4100 series. | ||
5 | * | ||
6 | * Copyright (C) 1999 Michael Klar | ||
7 | * Copyright (C) 2001, 2002 Paul Mundt | ||
8 | * Copyright (C) 2002 MontaVista Software, Inc. | ||
9 | * Copyright (C) 2002 TimeSys Corp. | ||
10 | * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify it | ||
13 | * under the terms of the GNU General Public License as published by the | ||
14 | * Free Software Foundation; either version 2 of the License, or (at your | ||
15 | * option) any later version. | ||
16 | */ | ||
17 | #ifndef __NEC_VR41XX_IRQ_H | ||
18 | #define __NEC_VR41XX_IRQ_H | ||
19 | |||
20 | /* | ||
21 | * CPU core Interrupt Numbers | ||
22 | */ | ||
23 | #define MIPS_CPU_IRQ_BASE 0 | ||
24 | #define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x)) | ||
25 | #define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0) | ||
26 | #define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1) | ||
27 | #define INT0_IRQ MIPS_CPU_IRQ(2) | ||
28 | #define INT1_IRQ MIPS_CPU_IRQ(3) | ||
29 | #define INT2_IRQ MIPS_CPU_IRQ(4) | ||
30 | #define INT3_IRQ MIPS_CPU_IRQ(5) | ||
31 | #define INT4_IRQ MIPS_CPU_IRQ(6) | ||
32 | #define TIMER_IRQ MIPS_CPU_IRQ(7) | ||
33 | |||
34 | /* | ||
35 | * SYINT1 Interrupt Numbers | ||
36 | */ | ||
37 | #define SYSINT1_IRQ_BASE 8 | ||
38 | #define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x)) | ||
39 | #define BATTRY_IRQ SYSINT1_IRQ(0) | ||
40 | #define POWER_IRQ SYSINT1_IRQ(1) | ||
41 | #define RTCLONG1_IRQ SYSINT1_IRQ(2) | ||
42 | #define ELAPSEDTIME_IRQ SYSINT1_IRQ(3) | ||
43 | /* RFU */ | ||
44 | #define PIU_IRQ SYSINT1_IRQ(5) | ||
45 | #define AIU_IRQ SYSINT1_IRQ(6) | ||
46 | #define KIU_IRQ SYSINT1_IRQ(7) | ||
47 | #define GIUINT_IRQ SYSINT1_IRQ(8) | ||
48 | #define SIU_IRQ SYSINT1_IRQ(9) | ||
49 | #define BUSERR_IRQ SYSINT1_IRQ(10) | ||
50 | #define SOFTINT_IRQ SYSINT1_IRQ(11) | ||
51 | #define CLKRUN_IRQ SYSINT1_IRQ(12) | ||
52 | #define DOZEPIU_IRQ SYSINT1_IRQ(13) | ||
53 | #define SYSINT1_IRQ_LAST DOZEPIU_IRQ | ||
54 | |||
55 | /* | ||
56 | * SYSINT2 Interrupt Numbers | ||
57 | */ | ||
58 | #define SYSINT2_IRQ_BASE 24 | ||
59 | #define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x)) | ||
60 | #define RTCLONG2_IRQ SYSINT2_IRQ(0) | ||
61 | #define LED_IRQ SYSINT2_IRQ(1) | ||
62 | #define HSP_IRQ SYSINT2_IRQ(2) | ||
63 | #define TCLOCK_IRQ SYSINT2_IRQ(3) | ||
64 | #define FIR_IRQ SYSINT2_IRQ(4) | ||
65 | #define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */ | ||
66 | #define DSIU_IRQ SYSINT2_IRQ(5) | ||
67 | #define PCI_IRQ SYSINT2_IRQ(6) | ||
68 | #define SCU_IRQ SYSINT2_IRQ(7) | ||
69 | #define CSI_IRQ SYSINT2_IRQ(8) | ||
70 | #define BCU_IRQ SYSINT2_IRQ(9) | ||
71 | #define ETHERNET_IRQ SYSINT2_IRQ(10) | ||
72 | #define SYSINT2_IRQ_LAST ETHERNET_IRQ | ||
73 | |||
74 | /* | ||
75 | * GIU Interrupt Numbers | ||
76 | */ | ||
77 | #define GIU_IRQ_BASE 40 | ||
78 | #define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */ | ||
79 | #define GIU_IRQ_LAST GIU_IRQ(31) | ||
80 | |||
81 | /* | ||
82 | * VRC4173 Interrupt Numbers | ||
83 | */ | ||
84 | #define VRC4173_IRQ_BASE 72 | ||
85 | #define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x)) | ||
86 | #define VRC4173_USB_IRQ VRC4173_IRQ(0) | ||
87 | #define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1) | ||
88 | #define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2) | ||
89 | #define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3) | ||
90 | #define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4) | ||
91 | #define VRC4173_PIU_IRQ VRC4173_IRQ(5) | ||
92 | #define VRC4173_AIU_IRQ VRC4173_IRQ(6) | ||
93 | #define VRC4173_KIU_IRQ VRC4173_IRQ(7) | ||
94 | #define VRC4173_GIU_IRQ VRC4173_IRQ(8) | ||
95 | #define VRC4173_AC97_IRQ VRC4173_IRQ(9) | ||
96 | #define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10) | ||
97 | /* RFU */ | ||
98 | #define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13) | ||
99 | #define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ | ||
100 | |||
101 | #endif /* __NEC_VR41XX_IRQ_H */ | ||
diff --git a/include/asm-mips/vr41xx/mpc30x.h b/include/asm-mips/vr41xx/mpc30x.h deleted file mode 100644 index 1d67df843dc3..000000000000 --- a/include/asm-mips/vr41xx/mpc30x.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * mpc30x.h, Include file for Victor MP-C303/304. | ||
3 | * | ||
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __VICTOR_MPC30X_H | ||
21 | #define __VICTOR_MPC30X_H | ||
22 | |||
23 | #include <asm/vr41xx/irq.h> | ||
24 | |||
25 | /* | ||
26 | * General-Purpose I/O Pin Number | ||
27 | */ | ||
28 | #define VRC4173_PIN 1 | ||
29 | #define MQ200_PIN 4 | ||
30 | |||
31 | /* | ||
32 | * Interrupt Number | ||
33 | */ | ||
34 | #define VRC4173_CASCADE_IRQ GIU_IRQ(VRC4173_PIN) | ||
35 | #define MQ200_IRQ GIU_IRQ(MQ200_PIN) | ||
36 | |||
37 | #endif /* __VICTOR_MPC30X_H */ | ||
diff --git a/include/asm-mips/vr41xx/pci.h b/include/asm-mips/vr41xx/pci.h deleted file mode 100644 index 6fc01ce19777..000000000000 --- a/include/asm-mips/vr41xx/pci.h +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* | ||
2 | * Include file for NEC VR4100 series PCI Control Unit. | ||
3 | * | ||
4 | * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __NEC_VR41XX_PCI_H | ||
21 | #define __NEC_VR41XX_PCI_H | ||
22 | |||
23 | #define PCI_MASTER_ADDRESS_MASK 0x7fffffffU | ||
24 | |||
25 | struct pci_master_address_conversion { | ||
26 | uint32_t bus_base_address; | ||
27 | uint32_t address_mask; | ||
28 | uint32_t pci_base_address; | ||
29 | }; | ||
30 | |||
31 | struct pci_target_address_conversion { | ||
32 | uint32_t address_mask; | ||
33 | uint32_t bus_base_address; | ||
34 | }; | ||
35 | |||
36 | typedef enum { | ||
37 | CANNOT_LOCK_FROM_DEVICE, | ||
38 | CAN_LOCK_FROM_DEVICE, | ||
39 | } pci_exclusive_access_t; | ||
40 | |||
41 | struct pci_mailbox_address { | ||
42 | uint32_t base_address; | ||
43 | }; | ||
44 | |||
45 | struct pci_target_address_window { | ||
46 | uint32_t base_address; | ||
47 | }; | ||
48 | |||
49 | typedef enum { | ||
50 | PCI_ARBITRATION_MODE_FAIR, | ||
51 | PCI_ARBITRATION_MODE_ALTERNATE_0, | ||
52 | PCI_ARBITRATION_MODE_ALTERNATE_B, | ||
53 | } pci_arbiter_priority_control_t; | ||
54 | |||
55 | typedef enum { | ||
56 | PCI_TAKE_AWAY_GNT_DISABLE, | ||
57 | PCI_TAKE_AWAY_GNT_ENABLE, | ||
58 | } pci_take_away_gnt_mode_t; | ||
59 | |||
60 | struct pci_controller_unit_setup { | ||
61 | struct pci_master_address_conversion *master_memory1; | ||
62 | struct pci_master_address_conversion *master_memory2; | ||
63 | |||
64 | struct pci_target_address_conversion *target_memory1; | ||
65 | struct pci_target_address_conversion *target_memory2; | ||
66 | |||
67 | struct pci_master_address_conversion *master_io; | ||
68 | |||
69 | pci_exclusive_access_t exclusive_access; | ||
70 | |||
71 | uint32_t pci_clock_max; | ||
72 | uint8_t wait_time_limit_from_irdy_to_trdy; /* Only VR4122 is supported */ | ||
73 | |||
74 | struct pci_mailbox_address *mailbox; | ||
75 | struct pci_target_address_window *target_window1; | ||
76 | struct pci_target_address_window *target_window2; | ||
77 | |||
78 | uint8_t master_latency_timer; | ||
79 | uint8_t retry_limit; | ||
80 | |||
81 | pci_arbiter_priority_control_t arbiter_priority_control; | ||
82 | pci_take_away_gnt_mode_t take_away_gnt_mode; | ||
83 | |||
84 | struct resource *mem_resource; | ||
85 | struct resource *io_resource; | ||
86 | }; | ||
87 | |||
88 | extern void vr41xx_pciu_setup(struct pci_controller_unit_setup *setup); | ||
89 | |||
90 | #endif /* __NEC_VR41XX_PCI_H */ | ||
diff --git a/include/asm-mips/vr41xx/siu.h b/include/asm-mips/vr41xx/siu.h deleted file mode 100644 index da9f6e373409..000000000000 --- a/include/asm-mips/vr41xx/siu.h +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* | ||
2 | * Include file for NEC VR4100 series Serial Interface Unit. | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __NEC_VR41XX_SIU_H | ||
21 | #define __NEC_VR41XX_SIU_H | ||
22 | |||
23 | #define SIU_PORTS_MAX 2 | ||
24 | |||
25 | typedef enum { | ||
26 | SIU_INTERFACE_RS232C, | ||
27 | SIU_INTERFACE_IRDA, | ||
28 | } siu_interface_t; | ||
29 | |||
30 | extern void vr41xx_select_siu_interface(siu_interface_t interface); | ||
31 | |||
32 | typedef enum { | ||
33 | SIU_USE_IRDA, | ||
34 | FIR_USE_IRDA, | ||
35 | } irda_use_t; | ||
36 | |||
37 | extern void vr41xx_use_irda(irda_use_t use); | ||
38 | |||
39 | typedef enum { | ||
40 | SHARP_IRDA, | ||
41 | TEMIC_IRDA, | ||
42 | HP_IRDA, | ||
43 | } irda_module_t; | ||
44 | |||
45 | typedef enum { | ||
46 | IRDA_TX_1_5MBPS, | ||
47 | IRDA_TX_4MBPS, | ||
48 | } irda_speed_t; | ||
49 | |||
50 | extern void vr41xx_select_irda_module(irda_module_t module, irda_speed_t speed); | ||
51 | |||
52 | #ifdef CONFIG_SERIAL_VR41XX_CONSOLE | ||
53 | extern void vr41xx_siu_early_setup(struct uart_port *port); | ||
54 | #else | ||
55 | static inline void vr41xx_siu_early_setup(struct uart_port *port) {} | ||
56 | #endif | ||
57 | |||
58 | #endif /* __NEC_VR41XX_SIU_H */ | ||
diff --git a/include/asm-mips/vr41xx/tb0219.h b/include/asm-mips/vr41xx/tb0219.h deleted file mode 100644 index dc981b4be0a4..000000000000 --- a/include/asm-mips/vr41xx/tb0219.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | * tb0219.h, Include file for TANBAC TB0219. | ||
3 | * | ||
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * Modified for TANBAC TB0219: | ||
7 | * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | */ | ||
23 | #ifndef __TANBAC_TB0219_H | ||
24 | #define __TANBAC_TB0219_H | ||
25 | |||
26 | #include <asm/vr41xx/irq.h> | ||
27 | |||
28 | /* | ||
29 | * General-Purpose I/O Pin Number | ||
30 | */ | ||
31 | #define TB0219_PCI_SLOT1_PIN 2 | ||
32 | #define TB0219_PCI_SLOT2_PIN 3 | ||
33 | #define TB0219_PCI_SLOT3_PIN 4 | ||
34 | |||
35 | /* | ||
36 | * Interrupt Number | ||
37 | */ | ||
38 | #define TB0219_PCI_SLOT1_IRQ GIU_IRQ(TB0219_PCI_SLOT1_PIN) | ||
39 | #define TB0219_PCI_SLOT2_IRQ GIU_IRQ(TB0219_PCI_SLOT2_PIN) | ||
40 | #define TB0219_PCI_SLOT3_IRQ GIU_IRQ(TB0219_PCI_SLOT3_PIN) | ||
41 | |||
42 | #endif /* __TANBAC_TB0219_H */ | ||
diff --git a/include/asm-mips/vr41xx/tb0226.h b/include/asm-mips/vr41xx/tb0226.h deleted file mode 100644 index de527dcfa5f3..000000000000 --- a/include/asm-mips/vr41xx/tb0226.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * tb0226.h, Include file for TANBAC TB0226. | ||
3 | * | ||
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __TANBAC_TB0226_H | ||
21 | #define __TANBAC_TB0226_H | ||
22 | |||
23 | #include <asm/vr41xx/irq.h> | ||
24 | |||
25 | /* | ||
26 | * General-Purpose I/O Pin Number | ||
27 | */ | ||
28 | #define GD82559_1_PIN 2 | ||
29 | #define GD82559_2_PIN 3 | ||
30 | #define UPD720100_INTA_PIN 4 | ||
31 | #define UPD720100_INTB_PIN 8 | ||
32 | #define UPD720100_INTC_PIN 13 | ||
33 | |||
34 | /* | ||
35 | * Interrupt Number | ||
36 | */ | ||
37 | #define GD82559_1_IRQ GIU_IRQ(GD82559_1_PIN) | ||
38 | #define GD82559_2_IRQ GIU_IRQ(GD82559_2_PIN) | ||
39 | #define UPD720100_INTA_IRQ GIU_IRQ(UPD720100_INTA_PIN) | ||
40 | #define UPD720100_INTB_IRQ GIU_IRQ(UPD720100_INTB_PIN) | ||
41 | #define UPD720100_INTC_IRQ GIU_IRQ(UPD720100_INTC_PIN) | ||
42 | |||
43 | #endif /* __TANBAC_TB0226_H */ | ||
diff --git a/include/asm-mips/vr41xx/tb0287.h b/include/asm-mips/vr41xx/tb0287.h deleted file mode 100644 index 61bead68abf0..000000000000 --- a/include/asm-mips/vr41xx/tb0287.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * tb0287.h, Include file for TANBAC TB0287 mini-ITX board. | ||
3 | * | ||
4 | * Copyright (C) 2005 Media Lab Inc. <ito@mlb.co.jp> | ||
5 | * | ||
6 | * This code is largely based on tb0219.h. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | #ifndef __TANBAC_TB0287_H | ||
23 | #define __TANBAC_TB0287_H | ||
24 | |||
25 | #include <asm/vr41xx/irq.h> | ||
26 | |||
27 | /* | ||
28 | * General-Purpose I/O Pin Number | ||
29 | */ | ||
30 | #define TB0287_PCI_SLOT_PIN 2 | ||
31 | #define TB0287_SM501_PIN 3 | ||
32 | #define TB0287_SIL680A_PIN 8 | ||
33 | #define TB0287_RTL8110_PIN 13 | ||
34 | |||
35 | /* | ||
36 | * Interrupt Number | ||
37 | */ | ||
38 | #define TB0287_PCI_SLOT_IRQ GIU_IRQ(TB0287_PCI_SLOT_PIN) | ||
39 | #define TB0287_SM501_IRQ GIU_IRQ(TB0287_SM501_PIN) | ||
40 | #define TB0287_SIL680A_IRQ GIU_IRQ(TB0287_SIL680A_PIN) | ||
41 | #define TB0287_RTL8110_IRQ GIU_IRQ(TB0287_RTL8110_PIN) | ||
42 | |||
43 | #endif /* __TANBAC_TB0287_H */ | ||
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h deleted file mode 100644 index 22be64971cc6..000000000000 --- a/include/asm-mips/vr41xx/vr41xx.h +++ /dev/null | |||
@@ -1,152 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-mips/vr41xx/vr41xx.h | ||
3 | * | ||
4 | * Include file for NEC VR4100 series. | ||
5 | * | ||
6 | * Copyright (C) 1999 Michael Klar | ||
7 | * Copyright (C) 2001, 2002 Paul Mundt | ||
8 | * Copyright (C) 2002 MontaVista Software, Inc. | ||
9 | * Copyright (C) 2002 TimeSys Corp. | ||
10 | * Copyright (C) 2003-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify it | ||
13 | * under the terms of the GNU General Public License as published by the | ||
14 | * Free Software Foundation; either version 2 of the License, or (at your | ||
15 | * option) any later version. | ||
16 | */ | ||
17 | #ifndef __NEC_VR41XX_H | ||
18 | #define __NEC_VR41XX_H | ||
19 | |||
20 | #include <linux/interrupt.h> | ||
21 | |||
22 | /* | ||
23 | * CPU Revision | ||
24 | */ | ||
25 | /* VR4122 0x00000c70-0x00000c72 */ | ||
26 | #define PRID_VR4122_REV1_0 0x00000c70 | ||
27 | #define PRID_VR4122_REV2_0 0x00000c70 | ||
28 | #define PRID_VR4122_REV2_1 0x00000c70 | ||
29 | #define PRID_VR4122_REV3_0 0x00000c71 | ||
30 | #define PRID_VR4122_REV3_1 0x00000c72 | ||
31 | |||
32 | /* VR4181A 0x00000c73-0x00000c7f */ | ||
33 | #define PRID_VR4181A_REV1_0 0x00000c73 | ||
34 | #define PRID_VR4181A_REV1_1 0x00000c74 | ||
35 | |||
36 | /* VR4131 0x00000c80-0x00000c83 */ | ||
37 | #define PRID_VR4131_REV1_2 0x00000c80 | ||
38 | #define PRID_VR4131_REV2_0 0x00000c81 | ||
39 | #define PRID_VR4131_REV2_1 0x00000c82 | ||
40 | #define PRID_VR4131_REV2_2 0x00000c83 | ||
41 | |||
42 | /* VR4133 0x00000c84- */ | ||
43 | #define PRID_VR4133 0x00000c84 | ||
44 | |||
45 | /* | ||
46 | * Bus Control Uint | ||
47 | */ | ||
48 | extern unsigned long vr41xx_calculate_clock_frequency(void); | ||
49 | extern unsigned long vr41xx_get_vtclock_frequency(void); | ||
50 | extern unsigned long vr41xx_get_tclock_frequency(void); | ||
51 | |||
52 | /* | ||
53 | * Clock Mask Unit | ||
54 | */ | ||
55 | typedef enum { | ||
56 | PIU_CLOCK, | ||
57 | SIU_CLOCK, | ||
58 | AIU_CLOCK, | ||
59 | KIU_CLOCK, | ||
60 | FIR_CLOCK, | ||
61 | DSIU_CLOCK, | ||
62 | CSI_CLOCK, | ||
63 | PCIU_CLOCK, | ||
64 | HSP_CLOCK, | ||
65 | PCI_CLOCK, | ||
66 | CEU_CLOCK, | ||
67 | ETHER0_CLOCK, | ||
68 | ETHER1_CLOCK | ||
69 | } vr41xx_clock_t; | ||
70 | |||
71 | extern void vr41xx_supply_clock(vr41xx_clock_t clock); | ||
72 | extern void vr41xx_mask_clock(vr41xx_clock_t clock); | ||
73 | |||
74 | /* | ||
75 | * Interrupt Control Unit | ||
76 | */ | ||
77 | extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); | ||
78 | extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int)); | ||
79 | |||
80 | #define PIUINT_COMMAND 0x0040 | ||
81 | #define PIUINT_DATA 0x0020 | ||
82 | #define PIUINT_PAGE1 0x0010 | ||
83 | #define PIUINT_PAGE0 0x0008 | ||
84 | #define PIUINT_DATALOST 0x0004 | ||
85 | #define PIUINT_STATUSCHANGE 0x0001 | ||
86 | |||
87 | extern void vr41xx_enable_piuint(uint16_t mask); | ||
88 | extern void vr41xx_disable_piuint(uint16_t mask); | ||
89 | |||
90 | #define AIUINT_INPUT_DMAEND 0x0800 | ||
91 | #define AIUINT_INPUT_DMAHALT 0x0400 | ||
92 | #define AIUINT_INPUT_DATALOST 0x0200 | ||
93 | #define AIUINT_INPUT_DATA 0x0100 | ||
94 | #define AIUINT_OUTPUT_DMAEND 0x0008 | ||
95 | #define AIUINT_OUTPUT_DMAHALT 0x0004 | ||
96 | #define AIUINT_OUTPUT_NODATA 0x0002 | ||
97 | |||
98 | extern void vr41xx_enable_aiuint(uint16_t mask); | ||
99 | extern void vr41xx_disable_aiuint(uint16_t mask); | ||
100 | |||
101 | #define KIUINT_DATALOST 0x0004 | ||
102 | #define KIUINT_DATAREADY 0x0002 | ||
103 | #define KIUINT_SCAN 0x0001 | ||
104 | |||
105 | extern void vr41xx_enable_kiuint(uint16_t mask); | ||
106 | extern void vr41xx_disable_kiuint(uint16_t mask); | ||
107 | |||
108 | #define DSIUINT_CTS 0x0800 | ||
109 | #define DSIUINT_RXERR 0x0400 | ||
110 | #define DSIUINT_RX 0x0200 | ||
111 | #define DSIUINT_TX 0x0100 | ||
112 | #define DSIUINT_ALL 0x0f00 | ||
113 | |||
114 | extern void vr41xx_enable_dsiuint(uint16_t mask); | ||
115 | extern void vr41xx_disable_dsiuint(uint16_t mask); | ||
116 | |||
117 | #define FIRINT_UNIT 0x0010 | ||
118 | #define FIRINT_RX_DMAEND 0x0008 | ||
119 | #define FIRINT_RX_DMAHALT 0x0004 | ||
120 | #define FIRINT_TX_DMAEND 0x0002 | ||
121 | #define FIRINT_TX_DMAHALT 0x0001 | ||
122 | |||
123 | extern void vr41xx_enable_firint(uint16_t mask); | ||
124 | extern void vr41xx_disable_firint(uint16_t mask); | ||
125 | |||
126 | extern void vr41xx_enable_pciint(void); | ||
127 | extern void vr41xx_disable_pciint(void); | ||
128 | |||
129 | extern void vr41xx_enable_scuint(void); | ||
130 | extern void vr41xx_disable_scuint(void); | ||
131 | |||
132 | #define CSIINT_TX_DMAEND 0x0040 | ||
133 | #define CSIINT_TX_DMAHALT 0x0020 | ||
134 | #define CSIINT_TX_DATA 0x0010 | ||
135 | #define CSIINT_TX_FIFOEMPTY 0x0008 | ||
136 | #define CSIINT_RX_DMAEND 0x0004 | ||
137 | #define CSIINT_RX_DMAHALT 0x0002 | ||
138 | #define CSIINT_RX_FIFOEMPTY 0x0001 | ||
139 | |||
140 | extern void vr41xx_enable_csiint(uint16_t mask); | ||
141 | extern void vr41xx_disable_csiint(uint16_t mask); | ||
142 | |||
143 | extern void vr41xx_enable_bcuint(void); | ||
144 | extern void vr41xx_disable_bcuint(void); | ||
145 | |||
146 | #ifdef CONFIG_SERIAL_VR41XX_CONSOLE | ||
147 | extern void vr41xx_siu_setup(void); | ||
148 | #else | ||
149 | static inline void vr41xx_siu_setup(void) {} | ||
150 | #endif | ||
151 | |||
152 | #endif /* __NEC_VR41XX_H */ | ||
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h deleted file mode 100644 index 22361d5e3bf0..000000000000 --- a/include/asm-mips/war.h +++ /dev/null | |||
@@ -1,244 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2004, 2007 by Ralf Baechle | ||
7 | * Copyright (C) 2007 Maciej W. Rozycki | ||
8 | */ | ||
9 | #ifndef _ASM_WAR_H | ||
10 | #define _ASM_WAR_H | ||
11 | |||
12 | #include <war.h> | ||
13 | |||
14 | /* | ||
15 | * Work around certain R4000 CPU errata (as implemented by GCC): | ||
16 | * | ||
17 | * - A double-word or a variable shift may give an incorrect result | ||
18 | * if executed immediately after starting an integer division: | ||
19 | * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", | ||
20 | * erratum #28 | ||
21 | * "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum | ||
22 | * #19 | ||
23 | * | ||
24 | * - A double-word or a variable shift may give an incorrect result | ||
25 | * if executed while an integer multiplication is in progress: | ||
26 | * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", | ||
27 | * errata #16 & #28 | ||
28 | * | ||
29 | * - An integer division may give an incorrect result if started in | ||
30 | * a delay slot of a taken branch or a jump: | ||
31 | * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", | ||
32 | * erratum #52 | ||
33 | */ | ||
34 | #ifdef CONFIG_CPU_R4000_WORKAROUNDS | ||
35 | #define R4000_WAR 1 | ||
36 | #else | ||
37 | #define R4000_WAR 0 | ||
38 | #endif | ||
39 | |||
40 | /* | ||
41 | * Work around certain R4400 CPU errata (as implemented by GCC): | ||
42 | * | ||
43 | * - A double-word or a variable shift may give an incorrect result | ||
44 | * if executed immediately after starting an integer division: | ||
45 | * "MIPS R4400MC Errata, Processor Revision 1.0", erratum #10 | ||
46 | * "MIPS R4400MC Errata, Processor Revision 2.0 & 3.0", erratum #4 | ||
47 | */ | ||
48 | #ifdef CONFIG_CPU_R4400_WORKAROUNDS | ||
49 | #define R4400_WAR 1 | ||
50 | #else | ||
51 | #define R4400_WAR 0 | ||
52 | #endif | ||
53 | |||
54 | /* | ||
55 | * Work around the "daddi" and "daddiu" CPU errata: | ||
56 | * | ||
57 | * - The `daddi' instruction fails to trap on overflow. | ||
58 | * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", | ||
59 | * erratum #23 | ||
60 | * | ||
61 | * - The `daddiu' instruction can produce an incorrect result. | ||
62 | * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", | ||
63 | * erratum #41 | ||
64 | * "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum | ||
65 | * #15 | ||
66 | * "MIPS R4400PC/SC Errata, Processor Revision 1.0", erratum #7 | ||
67 | * "MIPS R4400MC Errata, Processor Revision 1.0", erratum #5 | ||
68 | */ | ||
69 | #ifdef CONFIG_CPU_DADDI_WORKAROUNDS | ||
70 | #define DADDI_WAR 1 | ||
71 | #else | ||
72 | #define DADDI_WAR 0 | ||
73 | #endif | ||
74 | |||
75 | /* | ||
76 | * Another R4600 erratum. Due to the lack of errata information the exact | ||
77 | * technical details aren't known. I've experimentally found that disabling | ||
78 | * interrupts during indexed I-cache flushes seems to be sufficient to deal | ||
79 | * with the issue. | ||
80 | */ | ||
81 | #ifndef R4600_V1_INDEX_ICACHEOP_WAR | ||
82 | #error Check setting of R4600_V1_INDEX_ICACHEOP_WAR for your platform | ||
83 | #endif | ||
84 | |||
85 | /* | ||
86 | * Pleasures of the R4600 V1.x. Cite from the IDT R4600 V1.7 errata: | ||
87 | * | ||
88 | * 18. The CACHE instructions Hit_Writeback_Invalidate_D, Hit_Writeback_D, | ||
89 | * Hit_Invalidate_D and Create_Dirty_Excl_D should only be | ||
90 | * executed if there is no other dcache activity. If the dcache is | ||
91 | * accessed for another instruction immeidately preceding when these | ||
92 | * cache instructions are executing, it is possible that the dcache | ||
93 | * tag match outputs used by these cache instructions will be | ||
94 | * incorrect. These cache instructions should be preceded by at least | ||
95 | * four instructions that are not any kind of load or store | ||
96 | * instruction. | ||
97 | * | ||
98 | * This is not allowed: lw | ||
99 | * nop | ||
100 | * nop | ||
101 | * nop | ||
102 | * cache Hit_Writeback_Invalidate_D | ||
103 | * | ||
104 | * This is allowed: lw | ||
105 | * nop | ||
106 | * nop | ||
107 | * nop | ||
108 | * nop | ||
109 | * cache Hit_Writeback_Invalidate_D | ||
110 | */ | ||
111 | #ifndef R4600_V1_HIT_CACHEOP_WAR | ||
112 | #error Check setting of R4600_V1_HIT_CACHEOP_WAR for your platform | ||
113 | #endif | ||
114 | |||
115 | |||
116 | /* | ||
117 | * Writeback and invalidate the primary cache dcache before DMA. | ||
118 | * | ||
119 | * R4600 v2.0 bug: "The CACHE instructions Hit_Writeback_Inv_D, | ||
120 | * Hit_Writeback_D, Hit_Invalidate_D and Create_Dirty_Exclusive_D will only | ||
121 | * operate correctly if the internal data cache refill buffer is empty. These | ||
122 | * CACHE instructions should be separated from any potential data cache miss | ||
123 | * by a load instruction to an uncached address to empty the response buffer." | ||
124 | * (Revision 2.0 device errata from IDT available on http://www.idt.com/ | ||
125 | * in .pdf format.) | ||
126 | */ | ||
127 | #ifndef R4600_V2_HIT_CACHEOP_WAR | ||
128 | #error Check setting of R4600_V2_HIT_CACHEOP_WAR for your platform | ||
129 | #endif | ||
130 | |||
131 | /* | ||
132 | * When an interrupt happens on a CP0 register read instruction, CPU may | ||
133 | * lock up or read corrupted values of CP0 registers after it enters | ||
134 | * the exception handler. | ||
135 | * | ||
136 | * This workaround makes sure that we read a "safe" CP0 register as the | ||
137 | * first thing in the exception handler, which breaks one of the | ||
138 | * pre-conditions for this problem. | ||
139 | */ | ||
140 | #ifndef R5432_CP0_INTERRUPT_WAR | ||
141 | #error Check setting of R5432_CP0_INTERRUPT_WAR for your platform | ||
142 | #endif | ||
143 | |||
144 | /* | ||
145 | * Workaround for the Sibyte M3 errata the text of which can be found at | ||
146 | * | ||
147 | * http://sibyte.broadcom.com/hw/bcm1250/docs/pass2errata.txt | ||
148 | * | ||
149 | * This will enable the use of a special TLB refill handler which does a | ||
150 | * consistency check on the information in c0_badvaddr and c0_entryhi and | ||
151 | * will just return and take the exception again if the information was | ||
152 | * found to be inconsistent. | ||
153 | */ | ||
154 | #ifndef BCM1250_M3_WAR | ||
155 | #error Check setting of BCM1250_M3_WAR for your platform | ||
156 | #endif | ||
157 | |||
158 | /* | ||
159 | * This is a DUART workaround related to glitches around register accesses | ||
160 | */ | ||
161 | #ifndef SIBYTE_1956_WAR | ||
162 | #error Check setting of SIBYTE_1956_WAR for your platform | ||
163 | #endif | ||
164 | |||
165 | /* | ||
166 | * Fill buffers not flushed on CACHE instructions | ||
167 | * | ||
168 | * Hit_Invalidate_I cacheops invalidate an icache line but the refill | ||
169 | * for that line can get stale data from the fill buffer instead of | ||
170 | * accessing memory if the previous icache miss was also to that line. | ||
171 | * | ||
172 | * Workaround: generate an icache refill from a different line | ||
173 | * | ||
174 | * Affects: | ||
175 | * MIPS 4K RTL revision <3.0, PRID revision <4 | ||
176 | */ | ||
177 | #ifndef MIPS4K_ICACHE_REFILL_WAR | ||
178 | #error Check setting of MIPS4K_ICACHE_REFILL_WAR for your platform | ||
179 | #endif | ||
180 | |||
181 | /* | ||
182 | * Missing implicit forced flush of evictions caused by CACHE | ||
183 | * instruction | ||
184 | * | ||
185 | * Evictions caused by a CACHE instructions are not forced on to the | ||
186 | * bus. The BIU gives higher priority to fetches than to the data from | ||
187 | * the eviction buffer and no collision detection is performed between | ||
188 | * fetches and pending data from the eviction buffer. | ||
189 | * | ||
190 | * Workaround: Execute a SYNC instruction after the cache instruction | ||
191 | * | ||
192 | * Affects: | ||
193 | * MIPS 5Kc,5Kf RTL revision <2.3, PRID revision <8 | ||
194 | * MIPS 20Kc RTL revision <4.0, PRID revision <? | ||
195 | */ | ||
196 | #ifndef MIPS_CACHE_SYNC_WAR | ||
197 | #error Check setting of MIPS_CACHE_SYNC_WAR for your platform | ||
198 | #endif | ||
199 | |||
200 | /* | ||
201 | * From TX49/H2 manual: "If the instruction (i.e. CACHE) is issued for | ||
202 | * the line which this instruction itself exists, the following | ||
203 | * operation is not guaranteed." | ||
204 | * | ||
205 | * Workaround: do two phase flushing for Index_Invalidate_I | ||
206 | */ | ||
207 | #ifndef TX49XX_ICACHE_INDEX_INV_WAR | ||
208 | #error Check setting of TX49XX_ICACHE_INDEX_INV_WAR for your platform | ||
209 | #endif | ||
210 | |||
211 | /* | ||
212 | * On the RM9000 there is a problem which makes the CreateDirtyExclusive | ||
213 | * eache operation unusable on SMP systems. | ||
214 | */ | ||
215 | #ifndef RM9000_CDEX_SMP_WAR | ||
216 | #error Check setting of RM9000_CDEX_SMP_WAR for your platform | ||
217 | #endif | ||
218 | |||
219 | /* | ||
220 | * The RM7000 processors and the E9000 cores have a bug (though PMC-Sierra | ||
221 | * opposes it being called that) where invalid instructions in the same | ||
222 | * I-cache line worth of instructions being fetched may case spurious | ||
223 | * exceptions. | ||
224 | */ | ||
225 | #ifndef ICACHE_REFILLS_WORKAROUND_WAR | ||
226 | #error Check setting of ICACHE_REFILLS_WORKAROUND_WAR for your platform | ||
227 | #endif | ||
228 | |||
229 | /* | ||
230 | * On the R10000 upto version 2.6 (not sure about 2.7) there is a bug that | ||
231 | * may cause ll / sc and lld / scd sequences to execute non-atomically. | ||
232 | */ | ||
233 | #ifndef R10000_LLSC_WAR | ||
234 | #error Check setting of R10000_LLSC_WAR for your platform | ||
235 | #endif | ||
236 | |||
237 | /* | ||
238 | * 34K core erratum: "Problems Executing the TLBR Instruction" | ||
239 | */ | ||
240 | #ifndef MIPS34K_MISSED_ITLB_WAR | ||
241 | #error Check setting of MIPS34K_MISSED_ITLB_WAR for your platform | ||
242 | #endif | ||
243 | |||
244 | #endif /* _ASM_WAR_H */ | ||
diff --git a/include/asm-mips/wbflush.h b/include/asm-mips/wbflush.h deleted file mode 100644 index eadc0ac47e24..000000000000 --- a/include/asm-mips/wbflush.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * Header file for using the wbflush routine | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (c) 1998 Harald Koerfgen | ||
9 | * Copyright (C) 2002 Maciej W. Rozycki | ||
10 | */ | ||
11 | #ifndef _ASM_WBFLUSH_H | ||
12 | #define _ASM_WBFLUSH_H | ||
13 | |||
14 | |||
15 | #ifdef CONFIG_CPU_HAS_WB | ||
16 | |||
17 | extern void (*__wbflush)(void); | ||
18 | extern void wbflush_setup(void); | ||
19 | |||
20 | #define wbflush() \ | ||
21 | do { \ | ||
22 | __sync(); \ | ||
23 | __wbflush(); \ | ||
24 | } while (0) | ||
25 | |||
26 | #else /* !CONFIG_CPU_HAS_WB */ | ||
27 | |||
28 | #define wbflush_setup() do { } while (0) | ||
29 | |||
30 | #define wbflush() fast_iob() | ||
31 | |||
32 | #endif /* !CONFIG_CPU_HAS_WB */ | ||
33 | |||
34 | #endif /* _ASM_WBFLUSH_H */ | ||
diff --git a/include/asm-mips/xor.h b/include/asm-mips/xor.h deleted file mode 100644 index c82eb12a5b18..000000000000 --- a/include/asm-mips/xor.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/xor.h> | ||
diff --git a/include/asm-mips/xtalk/xtalk.h b/include/asm-mips/xtalk/xtalk.h deleted file mode 100644 index 79bac882a739..000000000000 --- a/include/asm-mips/xtalk/xtalk.h +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * xtalk.h -- platform-independent crosstalk interface, derived from | ||
7 | * IRIX <sys/PCI/bridge.h>, revision 1.38. | ||
8 | * | ||
9 | * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc. | ||
10 | * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) | ||
11 | */ | ||
12 | #ifndef _ASM_XTALK_XTALK_H | ||
13 | #define _ASM_XTALK_XTALK_H | ||
14 | |||
15 | #ifndef __ASSEMBLY__ | ||
16 | /* | ||
17 | * User-level device driver visible types | ||
18 | */ | ||
19 | typedef char xwidgetnum_t; /* xtalk widget number (0..15) */ | ||
20 | |||
21 | #define XWIDGET_NONE -1 | ||
22 | |||
23 | typedef int xwidget_part_num_t; /* xtalk widget part number */ | ||
24 | |||
25 | #define XWIDGET_PART_NUM_NONE -1 | ||
26 | |||
27 | typedef int xwidget_rev_num_t; /* xtalk widget revision number */ | ||
28 | |||
29 | #define XWIDGET_REV_NUM_NONE -1 | ||
30 | |||
31 | typedef int xwidget_mfg_num_t; /* xtalk widget manufacturing ID */ | ||
32 | |||
33 | #define XWIDGET_MFG_NUM_NONE -1 | ||
34 | |||
35 | typedef struct xtalk_piomap_s *xtalk_piomap_t; | ||
36 | |||
37 | /* It is often convenient to fold the XIO target port | ||
38 | * number into the XIO address. | ||
39 | */ | ||
40 | #define XIO_NOWHERE (0xFFFFFFFFFFFFFFFFull) | ||
41 | #define XIO_ADDR_BITS (0x0000FFFFFFFFFFFFull) | ||
42 | #define XIO_PORT_BITS (0xF000000000000000ull) | ||
43 | #define XIO_PORT_SHIFT (60) | ||
44 | |||
45 | #define XIO_PACKED(x) (((x)&XIO_PORT_BITS) != 0) | ||
46 | #define XIO_ADDR(x) ((x)&XIO_ADDR_BITS) | ||
47 | #define XIO_PORT(x) ((xwidgetnum_t)(((x)&XIO_PORT_BITS) >> XIO_PORT_SHIFT)) | ||
48 | #define XIO_PACK(p, o) ((((uint64_t)(p))<<XIO_PORT_SHIFT) | ((o)&XIO_ADDR_BITS)) | ||
49 | |||
50 | #endif /* !__ASSEMBLY__ */ | ||
51 | |||
52 | #endif /* _ASM_XTALK_XTALK_H */ | ||
diff --git a/include/asm-mips/xtalk/xwidget.h b/include/asm-mips/xtalk/xwidget.h deleted file mode 100644 index b4a13d7405ee..000000000000 --- a/include/asm-mips/xtalk/xwidget.h +++ /dev/null | |||
@@ -1,167 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * xwidget.h - generic crosstalk widget header file, derived from IRIX | ||
7 | * <sys/xtalk/xtalkwidget.h>, revision 1.32. | ||
8 | * | ||
9 | * Copyright (C) 1996, 1999 Silcon Graphics, Inc. | ||
10 | * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) | ||
11 | */ | ||
12 | #ifndef _ASM_XTALK_XWIDGET_H | ||
13 | #define _ASM_XTALK_XWIDGET_H | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | #include <asm/xtalk/xtalk.h> | ||
17 | |||
18 | #define WIDGET_ID 0x04 | ||
19 | #define WIDGET_STATUS 0x0c | ||
20 | #define WIDGET_ERR_UPPER_ADDR 0x14 | ||
21 | #define WIDGET_ERR_LOWER_ADDR 0x1c | ||
22 | #define WIDGET_CONTROL 0x24 | ||
23 | #define WIDGET_REQ_TIMEOUT 0x2c | ||
24 | #define WIDGET_INTDEST_UPPER_ADDR 0x34 | ||
25 | #define WIDGET_INTDEST_LOWER_ADDR 0x3c | ||
26 | #define WIDGET_ERR_CMD_WORD 0x44 | ||
27 | #define WIDGET_LLP_CFG 0x4c | ||
28 | #define WIDGET_TFLUSH 0x54 | ||
29 | |||
30 | /* WIDGET_ID */ | ||
31 | #define WIDGET_REV_NUM 0xf0000000 | ||
32 | #define WIDGET_PART_NUM 0x0ffff000 | ||
33 | #define WIDGET_MFG_NUM 0x00000ffe | ||
34 | #define WIDGET_REV_NUM_SHFT 28 | ||
35 | #define WIDGET_PART_NUM_SHFT 12 | ||
36 | #define WIDGET_MFG_NUM_SHFT 1 | ||
37 | |||
38 | #define XWIDGET_PART_NUM(widgetid) (((widgetid) & WIDGET_PART_NUM) >> WIDGET_PART_NUM_SHFT) | ||
39 | #define XWIDGET_REV_NUM(widgetid) (((widgetid) & WIDGET_REV_NUM) >> WIDGET_REV_NUM_SHFT) | ||
40 | #define XWIDGET_MFG_NUM(widgetid) (((widgetid) & WIDGET_MFG_NUM) >> WIDGET_MFG_NUM_SHFT) | ||
41 | |||
42 | /* WIDGET_STATUS */ | ||
43 | #define WIDGET_LLP_REC_CNT 0xff000000 | ||
44 | #define WIDGET_LLP_TX_CNT 0x00ff0000 | ||
45 | #define WIDGET_PENDING 0x0000001f | ||
46 | |||
47 | /* WIDGET_ERR_UPPER_ADDR */ | ||
48 | #define WIDGET_ERR_UPPER_ADDR_ONLY 0x0000ffff | ||
49 | |||
50 | /* WIDGET_CONTROL */ | ||
51 | #define WIDGET_F_BAD_PKT 0x00010000 | ||
52 | #define WIDGET_LLP_XBAR_CRD 0x0000f000 | ||
53 | #define WIDGET_LLP_XBAR_CRD_SHFT 12 | ||
54 | #define WIDGET_CLR_RLLP_CNT 0x00000800 | ||
55 | #define WIDGET_CLR_TLLP_CNT 0x00000400 | ||
56 | #define WIDGET_SYS_END 0x00000200 | ||
57 | #define WIDGET_MAX_TRANS 0x000001f0 | ||
58 | #define WIDGET_WIDGET_ID 0x0000000f | ||
59 | |||
60 | /* WIDGET_INTDEST_UPPER_ADDR */ | ||
61 | #define WIDGET_INT_VECTOR 0xff000000 | ||
62 | #define WIDGET_INT_VECTOR_SHFT 24 | ||
63 | #define WIDGET_TARGET_ID 0x000f0000 | ||
64 | #define WIDGET_TARGET_ID_SHFT 16 | ||
65 | #define WIDGET_UPP_ADDR 0x0000ffff | ||
66 | |||
67 | /* WIDGET_ERR_CMD_WORD */ | ||
68 | #define WIDGET_DIDN 0xf0000000 | ||
69 | #define WIDGET_SIDN 0x0f000000 | ||
70 | #define WIDGET_PACTYP 0x00f00000 | ||
71 | #define WIDGET_TNUM 0x000f8000 | ||
72 | #define WIDGET_COHERENT 0x00004000 | ||
73 | #define WIDGET_DS 0x00003000 | ||
74 | #define WIDGET_GBR 0x00000800 | ||
75 | #define WIDGET_VBPM 0x00000400 | ||
76 | #define WIDGET_ERROR 0x00000200 | ||
77 | #define WIDGET_BARRIER 0x00000100 | ||
78 | |||
79 | /* WIDGET_LLP_CFG */ | ||
80 | #define WIDGET_LLP_MAXRETRY 0x03ff0000 | ||
81 | #define WIDGET_LLP_MAXRETRY_SHFT 16 | ||
82 | #define WIDGET_LLP_NULLTIMEOUT 0x0000fc00 | ||
83 | #define WIDGET_LLP_NULLTIMEOUT_SHFT 10 | ||
84 | #define WIDGET_LLP_MAXBURST 0x000003ff | ||
85 | #define WIDGET_LLP_MAXBURST_SHFT 0 | ||
86 | |||
87 | /* | ||
88 | * according to the crosstalk spec, only 32-bits access to the widget | ||
89 | * configuration registers is allowed. some widgets may allow 64-bits | ||
90 | * access but software should not depend on it. registers beyond the | ||
91 | * widget target flush register are widget dependent thus will not be | ||
92 | * defined here | ||
93 | */ | ||
94 | #ifndef __ASSEMBLY__ | ||
95 | typedef u32 widgetreg_t; | ||
96 | |||
97 | /* widget configuration registers */ | ||
98 | typedef volatile struct widget_cfg { | ||
99 | widgetreg_t w_pad_0; /* 0x00 */ | ||
100 | widgetreg_t w_id; /* 0x04 */ | ||
101 | widgetreg_t w_pad_1; /* 0x08 */ | ||
102 | widgetreg_t w_status; /* 0x0c */ | ||
103 | widgetreg_t w_pad_2; /* 0x10 */ | ||
104 | widgetreg_t w_err_upper_addr; /* 0x14 */ | ||
105 | widgetreg_t w_pad_3; /* 0x18 */ | ||
106 | widgetreg_t w_err_lower_addr; /* 0x1c */ | ||
107 | widgetreg_t w_pad_4; /* 0x20 */ | ||
108 | widgetreg_t w_control; /* 0x24 */ | ||
109 | widgetreg_t w_pad_5; /* 0x28 */ | ||
110 | widgetreg_t w_req_timeout; /* 0x2c */ | ||
111 | widgetreg_t w_pad_6; /* 0x30 */ | ||
112 | widgetreg_t w_intdest_upper_addr; /* 0x34 */ | ||
113 | widgetreg_t w_pad_7; /* 0x38 */ | ||
114 | widgetreg_t w_intdest_lower_addr; /* 0x3c */ | ||
115 | widgetreg_t w_pad_8; /* 0x40 */ | ||
116 | widgetreg_t w_err_cmd_word; /* 0x44 */ | ||
117 | widgetreg_t w_pad_9; /* 0x48 */ | ||
118 | widgetreg_t w_llp_cfg; /* 0x4c */ | ||
119 | widgetreg_t w_pad_10; /* 0x50 */ | ||
120 | widgetreg_t w_tflush; /* 0x54 */ | ||
121 | } widget_cfg_t; | ||
122 | |||
123 | typedef struct { | ||
124 | unsigned didn:4; | ||
125 | unsigned sidn:4; | ||
126 | unsigned pactyp:4; | ||
127 | unsigned tnum:5; | ||
128 | unsigned ct:1; | ||
129 | unsigned ds:2; | ||
130 | unsigned gbr:1; | ||
131 | unsigned vbpm:1; | ||
132 | unsigned error:1; | ||
133 | unsigned bo:1; | ||
134 | unsigned other:8; | ||
135 | } w_err_cmd_word_f; | ||
136 | |||
137 | typedef union { | ||
138 | widgetreg_t r; | ||
139 | w_err_cmd_word_f f; | ||
140 | } w_err_cmd_word_u; | ||
141 | |||
142 | typedef struct xwidget_info_s *xwidget_info_t; | ||
143 | |||
144 | /* | ||
145 | * Crosstalk Widget Hardware Identification, as defined in the Crosstalk spec. | ||
146 | */ | ||
147 | typedef struct xwidget_hwid_s { | ||
148 | xwidget_part_num_t part_num; | ||
149 | xwidget_rev_num_t rev_num; | ||
150 | xwidget_mfg_num_t mfg_num; | ||
151 | } *xwidget_hwid_t; | ||
152 | |||
153 | |||
154 | /* | ||
155 | * Returns 1 if a driver that handles devices described by hwid1 is able | ||
156 | * to manage a device with hardwareid hwid2. NOTE: We don't check rev | ||
157 | * numbers at all. | ||
158 | */ | ||
159 | #define XWIDGET_HARDWARE_ID_MATCH(hwid1, hwid2) \ | ||
160 | (((hwid1)->part_num == (hwid2)->part_num) && \ | ||
161 | (((hwid1)->mfg_num == XWIDGET_MFG_NUM_NONE) || \ | ||
162 | ((hwid2)->mfg_num == XWIDGET_MFG_NUM_NONE) || \ | ||
163 | ((hwid1)->mfg_num == (hwid2)->mfg_num))) | ||
164 | |||
165 | #endif /* !__ASSEMBLY__ */ | ||
166 | |||
167 | #endif /* _ASM_XTALK_XWIDGET_H */ | ||