[PATCH] mspec driver build fix

Fix MSPEC driver to build for non SN2 enabled configs as the driver should
work in cached and uncached modes (no fetchop) on these systems. In
addition make MSPEC select IA64_UNCACHED_ALLOCATOR, which is required for
it and move it to arch/ia64/Kconfig to avoid warnings on non ia64
architectures running allmodconfig. Once the Kconfig code is fixed, we can
move it back.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Cc: Fernando Luis Vzquez Cao <fernando@oss.ntt.co.jp>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Jes Sorensen and committed by Linus Torvalds 1a4b0fc5 d67afe5e

+21 -10
+9
arch/ia64/Kconfig
··· 484 484 485 485 source "drivers/Kconfig" 486 486 487 + config MSPEC 488 + tristate "Memory special operations driver" 489 + depends on IA64 490 + select IA64_UNCACHED_ALLOCATOR 491 + help 492 + If you have an ia64 and you want to enable memory special 493 + operations support (formerly known as fetchop), say Y here, 494 + otherwise say N. 495 + 487 496 source "fs/Kconfig" 488 497 489 498 source "lib/Kconfig"
-8
drivers/char/Kconfig
··· 409 409 If you have an SGI Altix with an attached SABrick 410 410 say Y or M here, otherwise say N. 411 411 412 - config MSPEC 413 - tristate "Memory special operations driver" 414 - depends on IA64 415 - help 416 - If you have an ia64 and you want to enable memory special 417 - operations support (formerly known as fetchop), say Y here, 418 - otherwise say N. 419 - 420 412 source "drivers/serial/Kconfig" 421 413 422 414 config UNIX98_PTYS
+7 -1
drivers/char/mspec.c
··· 72 72 MSPEC_UNCACHED 73 73 }; 74 74 75 + #ifdef CONFIG_SGI_SN 75 76 static int is_sn2; 77 + #else 78 + #define is_sn2 0 79 + #endif 76 80 77 81 /* 78 82 * One of these structures is allocated when an mspec region is mmaped. The ··· 215 211 if (vdata->type == MSPEC_FETCHOP) 216 212 paddr = TO_AMO(maddr); 217 213 else 218 - paddr = __pa(TO_CAC(maddr)); 214 + paddr = maddr & ~__IA64_UNCACHED_OFFSET; 219 215 220 216 pfn = paddr >> PAGE_SHIFT; 221 217 ··· 339 335 * The fetchop device only works on SN2 hardware, uncached and cached 340 336 * memory drivers should both be valid on all ia64 hardware 341 337 */ 338 + #ifdef CONFIG_SGI_SN 342 339 if (ia64_platform_is("sn2")) { 343 340 is_sn2 = 1; 344 341 if (is_shub2()) { ··· 368 363 goto free_scratch_pages; 369 364 } 370 365 } 366 + #endif 371 367 ret = misc_register(&cached_miscdev); 372 368 if (ret) { 373 369 printk(KERN_ERR "%s: failed to register device %i\n",
+5 -1
include/asm-ia64/sn/addrs.h
··· 136 136 */ 137 137 #define TO_PHYS(x) (TO_PHYS_MASK & (x)) 138 138 #define TO_CAC(x) (CAC_BASE | TO_PHYS(x)) 139 + #ifdef CONFIG_SGI_SN 139 140 #define TO_AMO(x) (AMO_BASE | TO_PHYS(x)) 140 141 #define TO_GET(x) (GET_BASE | TO_PHYS(x)) 141 - 142 + #else 143 + #define TO_AMO(x) ({ BUG(); x; }) 144 + #define TO_GET(x) ({ BUG(); x; }) 145 + #endif 142 146 143 147 /* 144 148 * Covert from processor physical address to II/TIO physical address: