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