diff options
-rw-r--r-- | arch/ia64/Kconfig | 9 | ||||
-rw-r--r-- | drivers/char/Kconfig | 8 | ||||
-rw-r--r-- | drivers/char/mspec.c | 8 | ||||
-rw-r--r-- | include/asm-ia64/sn/addrs.h | 6 |
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 | ||
485 | source "drivers/Kconfig" | 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 | source "fs/Kconfig" | 496 | source "fs/Kconfig" |
488 | 497 | ||
489 | source "lib/Kconfig" | 498 | source "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 | ||
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" | 412 | source "drivers/serial/Kconfig" |
421 | 413 | ||
422 | config UNIX98_PTYS | 414 | config 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 | ||
75 | static int is_sn2; | 76 | static 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: |