diff options
Diffstat (limited to 'arch/mips/include/asm/sn/addrs.h')
-rw-r--r-- | arch/mips/include/asm/sn/addrs.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/arch/mips/include/asm/sn/addrs.h b/arch/mips/include/asm/sn/addrs.h index 2367b56dcdef..66814f8ba8e8 100644 --- a/arch/mips/include/asm/sn/addrs.h +++ b/arch/mips/include/asm/sn/addrs.h | |||
@@ -88,8 +88,8 @@ | |||
88 | 88 | ||
89 | #define SWIN_SIZE_BITS 24 | 89 | #define SWIN_SIZE_BITS 24 |
90 | #define SWIN_SIZE (UINT64_CAST 1 << 24) | 90 | #define SWIN_SIZE (UINT64_CAST 1 << 24) |
91 | #define SWIN_SIZEMASK (SWIN_SIZE - 1) | 91 | #define SWIN_SIZEMASK (SWIN_SIZE - 1) |
92 | #define SWIN_WIDGET_MASK 0xF | 92 | #define SWIN_WIDGET_MASK 0xF |
93 | 93 | ||
94 | /* | 94 | /* |
95 | * Convert smallwindow address to xtalk address. | 95 | * Convert smallwindow address to xtalk address. |
@@ -97,8 +97,8 @@ | |||
97 | * 'addr' can be physical or virtual address, but will be converted | 97 | * 'addr' can be physical or virtual address, but will be converted |
98 | * to Xtalk address in the range 0 -> SWINZ_SIZEMASK | 98 | * to Xtalk address in the range 0 -> SWINZ_SIZEMASK |
99 | */ | 99 | */ |
100 | #define SWIN_WIDGETADDR(addr) ((addr) & SWIN_SIZEMASK) | 100 | #define SWIN_WIDGETADDR(addr) ((addr) & SWIN_SIZEMASK) |
101 | #define SWIN_WIDGETNUM(addr) (((addr) >> SWIN_SIZE_BITS) & SWIN_WIDGET_MASK) | 101 | #define SWIN_WIDGETNUM(addr) (((addr) >> SWIN_SIZE_BITS) & SWIN_WIDGET_MASK) |
102 | /* | 102 | /* |
103 | * Verify if addr belongs to small window address on node with "nasid" | 103 | * Verify if addr belongs to small window address on node with "nasid" |
104 | * | 104 | * |
@@ -108,7 +108,7 @@ | |||
108 | * | 108 | * |
109 | * | 109 | * |
110 | */ | 110 | */ |
111 | #define NODE_SWIN_ADDR(nasid, addr) \ | 111 | #define NODE_SWIN_ADDR(nasid, addr) \ |
112 | (((addr) >= NODE_SWIN_BASE(nasid, 0)) && \ | 112 | (((addr) >= NODE_SWIN_BASE(nasid, 0)) && \ |
113 | ((addr) < (NODE_SWIN_BASE(nasid, HUB_NUM_WIDGET) + SWIN_SIZE)\ | 113 | ((addr) < (NODE_SWIN_BASE(nasid, HUB_NUM_WIDGET) + SWIN_SIZE)\ |
114 | )) | 114 | )) |
@@ -150,7 +150,7 @@ | |||
150 | 150 | ||
151 | #endif | 151 | #endif |
152 | 152 | ||
153 | #define HUB_REGISTER_WIDGET 1 | 153 | #define HUB_REGISTER_WIDGET 1 |
154 | #define IALIAS_BASE NODE_SWIN_BASE(0, HUB_REGISTER_WIDGET) | 154 | #define IALIAS_BASE NODE_SWIN_BASE(0, HUB_REGISTER_WIDGET) |
155 | #define IALIAS_SIZE 0x800000 /* 8 Megabytes */ | 155 | #define IALIAS_SIZE 0x800000 /* 8 Megabytes */ |
156 | #define IS_IALIAS(_a) (((_a) >= IALIAS_BASE) && \ | 156 | #define IS_IALIAS(_a) (((_a) >= IALIAS_BASE) && \ |
@@ -174,16 +174,16 @@ | |||
174 | * WARNING: They won't work in assembler. | 174 | * WARNING: They won't work in assembler. |
175 | * | 175 | * |
176 | * BDDIR_ENTRY_LO returns the address of the low double-word of the dir | 176 | * BDDIR_ENTRY_LO returns the address of the low double-word of the dir |
177 | * entry corresponding to a physical (Cac or Uncac) address. | 177 | * entry corresponding to a physical (Cac or Uncac) address. |
178 | * BDDIR_ENTRY_HI returns the address of the high double-word of the entry. | 178 | * BDDIR_ENTRY_HI returns the address of the high double-word of the entry. |
179 | * BDPRT_ENTRY returns the address of the double-word protection entry | 179 | * BDPRT_ENTRY returns the address of the double-word protection entry |
180 | * corresponding to the page containing the physical address. | 180 | * corresponding to the page containing the physical address. |
181 | * BDPRT_ENTRY_S Stores the value into the protection entry. | 181 | * BDPRT_ENTRY_S Stores the value into the protection entry. |
182 | * BDPRT_ENTRY_L Load the value from the protection entry. | 182 | * BDPRT_ENTRY_L Load the value from the protection entry. |
183 | * BDECC_ENTRY returns the address of the ECC byte corresponding to a | 183 | * BDECC_ENTRY returns the address of the ECC byte corresponding to a |
184 | * double-word at a specified physical address. | 184 | * double-word at a specified physical address. |
185 | * BDECC_ENTRY_H returns the address of the two ECC bytes corresponding to a | 185 | * BDECC_ENTRY_H returns the address of the two ECC bytes corresponding to a |
186 | * quad-word at a specified physical address. | 186 | * quad-word at a specified physical address. |
187 | */ | 187 | */ |
188 | #define NODE_BDOOR_BASE(_n) (NODE_HSPEC_BASE(_n) + (NODE_ADDRSPACE_SIZE/2)) | 188 | #define NODE_BDOOR_BASE(_n) (NODE_HSPEC_BASE(_n) + (NODE_ADDRSPACE_SIZE/2)) |
189 | 189 | ||
@@ -226,11 +226,11 @@ | |||
226 | #define BDADDR_IS_DIR(_ba) ((UINT64_CAST (_ba) & 0x200) != 0) | 226 | #define BDADDR_IS_DIR(_ba) ((UINT64_CAST (_ba) & 0x200) != 0) |
227 | #define BDADDR_IS_PRT(_ba) ((UINT64_CAST (_ba) & 0x200) == 0) | 227 | #define BDADDR_IS_PRT(_ba) ((UINT64_CAST (_ba) & 0x200) == 0) |
228 | 228 | ||
229 | #define BDDIR_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ | 229 | #define BDDIR_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ |
230 | (UINT64_CAST(_ba) & BDDIR_UPPER_MASK)<<2 | \ | 230 | (UINT64_CAST(_ba) & BDDIR_UPPER_MASK)<<2 | \ |
231 | (UINT64_CAST(_ba) & 0x1f << 4) << 3) | 231 | (UINT64_CAST(_ba) & 0x1f << 4) << 3) |
232 | 232 | ||
233 | #define BDPRT_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ | 233 | #define BDPRT_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ |
234 | (UINT64_CAST(_ba) & BDDIR_UPPER_MASK)<<2) | 234 | (UINT64_CAST(_ba) & BDDIR_UPPER_MASK)<<2) |
235 | 235 | ||
236 | #define BDECC_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ | 236 | #define BDECC_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ |
@@ -251,23 +251,23 @@ | |||
251 | /* | 251 | /* |
252 | * WARNING: | 252 | * WARNING: |
253 | * When certain Hub chip workaround are defined, it's not sufficient | 253 | * When certain Hub chip workaround are defined, it's not sufficient |
254 | * to dereference the *_HUB_ADDR() macros. You should instead use | 254 | * to dereference the *_HUB_ADDR() macros. You should instead use |
255 | * HUB_L() and HUB_S() if you must deal with pointers to hub registers. | 255 | * HUB_L() and HUB_S() if you must deal with pointers to hub registers. |
256 | * Otherwise, the recommended approach is to use *_HUB_L() and *_HUB_S(). | 256 | * Otherwise, the recommended approach is to use *_HUB_L() and *_HUB_S(). |
257 | * They're always safe. | 257 | * They're always safe. |
258 | */ | 258 | */ |
259 | #define LOCAL_HUB_ADDR(_x) (HUBREG_CAST (IALIAS_BASE + (_x))) | 259 | #define LOCAL_HUB_ADDR(_x) (HUBREG_CAST (IALIAS_BASE + (_x))) |
260 | #define REMOTE_HUB_ADDR(_n, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \ | 260 | #define REMOTE_HUB_ADDR(_n, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \ |
261 | 0x800000 + (_x))) | 261 | 0x800000 + (_x))) |
262 | #ifdef CONFIG_SGI_IP27 | 262 | #ifdef CONFIG_SGI_IP27 |
263 | #define REMOTE_HUB_PI_ADDR(_n, _sn, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \ | 263 | #define REMOTE_HUB_PI_ADDR(_n, _sn, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \ |
264 | 0x800000 + (_x))) | 264 | 0x800000 + (_x))) |
265 | #endif /* CONFIG_SGI_IP27 */ | 265 | #endif /* CONFIG_SGI_IP27 */ |
266 | 266 | ||
267 | #ifndef __ASSEMBLY__ | 267 | #ifndef __ASSEMBLY__ |
268 | 268 | ||
269 | #define HUB_L(_a) *(_a) | 269 | #define HUB_L(_a) *(_a) |
270 | #define HUB_S(_a, _d) *(_a) = (_d) | 270 | #define HUB_S(_a, _d) *(_a) = (_d) |
271 | 271 | ||
272 | #define LOCAL_HUB_L(_r) HUB_L(LOCAL_HUB_ADDR(_r)) | 272 | #define LOCAL_HUB_L(_r) HUB_L(LOCAL_HUB_ADDR(_r)) |
273 | #define LOCAL_HUB_S(_r, _d) HUB_S(LOCAL_HUB_ADDR(_r), (_d)) | 273 | #define LOCAL_HUB_S(_r, _d) HUB_S(LOCAL_HUB_ADDR(_r), (_d)) |
@@ -330,14 +330,14 @@ | |||
330 | 330 | ||
331 | #define KLI_LAUNCH 0 /* Dir. entries */ | 331 | #define KLI_LAUNCH 0 /* Dir. entries */ |
332 | #define KLI_KLCONFIG 1 | 332 | #define KLI_KLCONFIG 1 |
333 | #define KLI_NMI 2 | 333 | #define KLI_NMI 2 |
334 | #define KLI_GDA 3 | 334 | #define KLI_GDA 3 |
335 | #define KLI_FREEMEM 4 | 335 | #define KLI_FREEMEM 4 |
336 | #define KLI_SYMMON_STK 5 | 336 | #define KLI_SYMMON_STK 5 |
337 | #define KLI_PI_ERROR 6 | 337 | #define KLI_PI_ERROR 6 |
338 | #define KLI_KERN_VARS 7 | 338 | #define KLI_KERN_VARS 7 |
339 | #define KLI_KERN_XP 8 | 339 | #define KLI_KERN_XP 8 |
340 | #define KLI_KERN_PARTID 9 | 340 | #define KLI_KERN_PARTID 9 |
341 | 341 | ||
342 | #ifndef __ASSEMBLY__ | 342 | #ifndef __ASSEMBLY__ |
343 | 343 | ||
@@ -350,8 +350,8 @@ | |||
350 | #define KLD_SYMMON_STK(nasid) (KLD_BASE(nasid) + KLI_SYMMON_STK) | 350 | #define KLD_SYMMON_STK(nasid) (KLD_BASE(nasid) + KLI_SYMMON_STK) |
351 | #define KLD_FREEMEM(nasid) (KLD_BASE(nasid) + KLI_FREEMEM) | 351 | #define KLD_FREEMEM(nasid) (KLD_BASE(nasid) + KLI_FREEMEM) |
352 | #define KLD_KERN_VARS(nasid) (KLD_BASE(nasid) + KLI_KERN_VARS) | 352 | #define KLD_KERN_VARS(nasid) (KLD_BASE(nasid) + KLI_KERN_VARS) |
353 | #define KLD_KERN_XP(nasid) (KLD_BASE(nasid) + KLI_KERN_XP) | 353 | #define KLD_KERN_XP(nasid) (KLD_BASE(nasid) + KLI_KERN_XP) |
354 | #define KLD_KERN_PARTID(nasid) (KLD_BASE(nasid) + KLI_KERN_PARTID) | 354 | #define KLD_KERN_PARTID(nasid) (KLD_BASE(nasid) + KLI_KERN_PARTID) |
355 | 355 | ||
356 | #define LAUNCH_OFFSET(nasid, slice) \ | 356 | #define LAUNCH_OFFSET(nasid, slice) \ |
357 | (KLD_LAUNCH(nasid)->offset + \ | 357 | (KLD_LAUNCH(nasid)->offset + \ |
@@ -365,7 +365,7 @@ | |||
365 | KLD_NMI(nasid)->stride * (slice)) | 365 | KLD_NMI(nasid)->stride * (slice)) |
366 | #define NMI_ADDR(nasid, slice) \ | 366 | #define NMI_ADDR(nasid, slice) \ |
367 | TO_NODE_UNCAC((nasid), SN_NMI_OFFSET(nasid, slice)) | 367 | TO_NODE_UNCAC((nasid), SN_NMI_OFFSET(nasid, slice)) |
368 | #define NMI_SIZE(nasid) KLD_NMI(nasid)->size | 368 | #define NMI_SIZE(nasid) KLD_NMI(nasid)->size |
369 | 369 | ||
370 | #define KLCONFIG_OFFSET(nasid) KLD_KLCONFIG(nasid)->offset | 370 | #define KLCONFIG_OFFSET(nasid) KLD_KLCONFIG(nasid)->offset |
371 | #define KLCONFIG_ADDR(nasid) \ | 371 | #define KLCONFIG_ADDR(nasid) \ |
@@ -390,8 +390,8 @@ | |||
390 | /* loading symmon 4k below UNIX. the arcs loader needs the topaddr for a | 390 | /* loading symmon 4k below UNIX. the arcs loader needs the topaddr for a |
391 | * relocatable program | 391 | * relocatable program |
392 | */ | 392 | */ |
393 | #define UNIX_DEBUG_LOADADDR 0x300000 | 393 | #define UNIX_DEBUG_LOADADDR 0x300000 |
394 | #define SYMMON_LOADADDR(nasid) \ | 394 | #define SYMMON_LOADADDR(nasid) \ |
395 | TO_NODE(nasid, PHYS_TO_K0(UNIX_DEBUG_LOADADDR - 0x1000)) | 395 | TO_NODE(nasid, PHYS_TO_K0(UNIX_DEBUG_LOADADDR - 0x1000)) |
396 | 396 | ||
397 | #define FREEMEM_OFFSET(nasid) KLD_FREEMEM(nasid)->offset | 397 | #define FREEMEM_OFFSET(nasid) KLD_FREEMEM(nasid)->offset |
@@ -420,8 +420,8 @@ | |||
420 | #define KERN_VARS_ADDR(nasid) KLD_KERN_VARS(nasid)->pointer | 420 | #define KERN_VARS_ADDR(nasid) KLD_KERN_VARS(nasid)->pointer |
421 | #define KERN_VARS_SIZE(nasid) KLD_KERN_VARS(nasid)->size | 421 | #define KERN_VARS_SIZE(nasid) KLD_KERN_VARS(nasid)->size |
422 | 422 | ||
423 | #define KERN_XP_ADDR(nasid) KLD_KERN_XP(nasid)->pointer | 423 | #define KERN_XP_ADDR(nasid) KLD_KERN_XP(nasid)->pointer |
424 | #define KERN_XP_SIZE(nasid) KLD_KERN_XP(nasid)->size | 424 | #define KERN_XP_SIZE(nasid) KLD_KERN_XP(nasid)->size |
425 | 425 | ||
426 | #define GPDA_ADDR(nasid) TO_NODE_CAC(nasid, GPDA_OFFSET) | 426 | #define GPDA_ADDR(nasid) TO_NODE_CAC(nasid, GPDA_OFFSET) |
427 | 427 | ||