aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-11-10 15:27:49 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-11-13 10:40:42 -0500
commit1a4b0fc503ff4149f5915be4aeb179b9453cf485 (patch)
tree0f8ccd1b383f486a71b3f5526eb10d245bd9425c
parentd67afe5ed00070de0965bfc98de5f6ed3a80a73e (diff)
[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>
-rw-r--r--arch/ia64/Kconfig9
-rw-r--r--drivers/char/Kconfig8
-rw-r--r--drivers/char/mspec.c8
-rw-r--r--include/asm-ia64/sn/addrs.h6
4 files changed, 21 insertions, 10 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 14682396f7f7..683b12c6f76c 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -484,6 +484,15 @@ source "net/Kconfig"
484 484
485source "drivers/Kconfig" 485source "drivers/Kconfig"
486 486
487config 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
487source "fs/Kconfig" 496source "fs/Kconfig"
488 497
489source "lib/Kconfig" 498source "lib/Kconfig"
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 39a9f8cc6412..2af12fc45115 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -409,14 +409,6 @@ config SGI_MBCS
409 If you have an SGI Altix with an attached SABrick 409 If you have an SGI Altix with an attached SABrick
410 say Y or M here, otherwise say N. 410 say Y or M here, otherwise say N.
411 411
412config 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
420source "drivers/serial/Kconfig" 412source "drivers/serial/Kconfig"
421 413
422config UNIX98_PTYS 414config UNIX98_PTYS
diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c
index 5c0dec39cf6c..235e89226112 100644
--- a/drivers/char/mspec.c
+++ b/drivers/char/mspec.c
@@ -72,7 +72,11 @@ enum {
72 MSPEC_UNCACHED 72 MSPEC_UNCACHED
73}; 73};
74 74
75#ifdef CONFIG_SGI_SN
75static int is_sn2; 76static int is_sn2;
77#else
78#define is_sn2 0
79#endif
76 80
77/* 81/*
78 * One of these structures is allocated when an mspec region is mmaped. The 82 * One of these structures is allocated when an mspec region is mmaped. The
@@ -211,7 +215,7 @@ mspec_nopfn(struct vm_area_struct *vma, unsigned long address)
211 if (vdata->type == MSPEC_FETCHOP) 215 if (vdata->type == MSPEC_FETCHOP)
212 paddr = TO_AMO(maddr); 216 paddr = TO_AMO(maddr);
213 else 217 else
214 paddr = __pa(TO_CAC(maddr)); 218 paddr = maddr & ~__IA64_UNCACHED_OFFSET;
215 219
216 pfn = paddr >> PAGE_SHIFT; 220 pfn = paddr >> PAGE_SHIFT;
217 221
@@ -335,6 +339,7 @@ mspec_init(void)
335 * The fetchop device only works on SN2 hardware, uncached and cached 339 * The fetchop device only works on SN2 hardware, uncached and cached
336 * memory drivers should both be valid on all ia64 hardware 340 * memory drivers should both be valid on all ia64 hardware
337 */ 341 */
342#ifdef CONFIG_SGI_SN
338 if (ia64_platform_is("sn2")) { 343 if (ia64_platform_is("sn2")) {
339 is_sn2 = 1; 344 is_sn2 = 1;
340 if (is_shub2()) { 345 if (is_shub2()) {
@@ -363,6 +368,7 @@ mspec_init(void)
363 goto free_scratch_pages; 368 goto free_scratch_pages;
364 } 369 }
365 } 370 }
371#endif
366 ret = misc_register(&cached_miscdev); 372 ret = misc_register(&cached_miscdev);
367 if (ret) { 373 if (ret) {
368 printk(KERN_ERR "%s: failed to register device %i\n", 374 printk(KERN_ERR "%s: failed to register device %i\n",
diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h
index 1d9efe541662..e715c794b186 100644
--- a/include/asm-ia64/sn/addrs.h
+++ b/include/asm-ia64/sn/addrs.h
@@ -136,9 +136,13 @@
136 */ 136 */
137#define TO_PHYS(x) (TO_PHYS_MASK & (x)) 137#define TO_PHYS(x) (TO_PHYS_MASK & (x))
138#define TO_CAC(x) (CAC_BASE | TO_PHYS(x)) 138#define TO_CAC(x) (CAC_BASE | TO_PHYS(x))
139#ifdef CONFIG_SGI_SN
139#define TO_AMO(x) (AMO_BASE | TO_PHYS(x)) 140#define TO_AMO(x) (AMO_BASE | TO_PHYS(x))
140#define TO_GET(x) (GET_BASE | TO_PHYS(x)) 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 * Covert from processor physical address to II/TIO physical address: 148 * Covert from processor physical address to II/TIO physical address: