diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-08-27 21:17:32 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-08-27 21:17:32 -0400 |
commit | 10420921675582903ab256dc3094206ac0280f68 (patch) | |
tree | b774e849efa85255b2fbc0a24698c75196038e96 /arch | |
parent | 13906db670a128864714c30c244b866dce119494 (diff) | |
parent | d220980b701d838560a70de691b53be007e99e78 (diff) |
Merge branch 'merge' into next
Merge recent fixes to lparcfg so subsequent patches can move
the whole file to arch/powerpc/platforms/pseries
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/Kconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/page.h | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/lparcfg.c | 22 |
3 files changed, 20 insertions, 13 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 174c6a12269a..04f1e94c3437 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -999,6 +999,7 @@ config RELOCATABLE | |||
999 | must live at a different physical address than the primary | 999 | must live at a different physical address than the primary |
1000 | kernel. | 1000 | kernel. |
1001 | 1001 | ||
1002 | # This value must have zeroes in the bottom 60 bits otherwise lots will break | ||
1002 | config PAGE_OFFSET | 1003 | config PAGE_OFFSET |
1003 | hex | 1004 | hex |
1004 | default "0xc000000000000000" | 1005 | default "0xc000000000000000" |
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index 988c812aab5b..b9f426212d3a 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h | |||
@@ -211,9 +211,19 @@ extern long long virt_phys_offset; | |||
211 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET)) | 211 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET)) |
212 | #define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET) | 212 | #define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET) |
213 | #else | 213 | #else |
214 | #ifdef CONFIG_PPC64 | ||
215 | /* | ||
216 | * gcc miscompiles (unsigned long)(&static_var) - PAGE_OFFSET | ||
217 | * with -mcmodel=medium, so we use & and | instead of - and + on 64-bit. | ||
218 | */ | ||
219 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) | PAGE_OFFSET)) | ||
220 | #define __pa(x) ((unsigned long)(x) & 0x0fffffffffffffffUL) | ||
221 | |||
222 | #else /* 32-bit, non book E */ | ||
214 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START)) | 223 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START)) |
215 | #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START) | 224 | #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START) |
216 | #endif | 225 | #endif |
226 | #endif | ||
217 | 227 | ||
218 | /* | 228 | /* |
219 | * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI, | 229 | * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI, |
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 0204089ebdd4..e738007eae64 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -35,7 +35,13 @@ | |||
35 | #include <asm/vdso_datapage.h> | 35 | #include <asm/vdso_datapage.h> |
36 | #include <asm/vio.h> | 36 | #include <asm/vio.h> |
37 | #include <asm/mmu.h> | 37 | #include <asm/mmu.h> |
38 | #include <asm/machdep.h> | ||
38 | 39 | ||
40 | |||
41 | /* | ||
42 | * This isn't a module but we expose that to userspace | ||
43 | * via /proc so leave the definitions here | ||
44 | */ | ||
39 | #define MODULE_VERS "1.9" | 45 | #define MODULE_VERS "1.9" |
40 | #define MODULE_NAME "lparcfg" | 46 | #define MODULE_NAME "lparcfg" |
41 | 47 | ||
@@ -419,7 +425,8 @@ static void parse_em_data(struct seq_file *m) | |||
419 | { | 425 | { |
420 | unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; | 426 | unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; |
421 | 427 | ||
422 | if (plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS) | 428 | if (firmware_has_feature(FW_FEATURE_LPAR) && |
429 | plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS) | ||
423 | seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]); | 430 | seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]); |
424 | } | 431 | } |
425 | 432 | ||
@@ -679,7 +686,6 @@ static int lparcfg_open(struct inode *inode, struct file *file) | |||
679 | } | 686 | } |
680 | 687 | ||
681 | static const struct file_operations lparcfg_fops = { | 688 | static const struct file_operations lparcfg_fops = { |
682 | .owner = THIS_MODULE, | ||
683 | .read = seq_read, | 689 | .read = seq_read, |
684 | .write = lparcfg_write, | 690 | .write = lparcfg_write, |
685 | .open = lparcfg_open, | 691 | .open = lparcfg_open, |
@@ -701,14 +707,4 @@ static int __init lparcfg_init(void) | |||
701 | } | 707 | } |
702 | return 0; | 708 | return 0; |
703 | } | 709 | } |
704 | 710 | machine_device_initcall(pseries, lparcfg_init); | |
705 | static void __exit lparcfg_cleanup(void) | ||
706 | { | ||
707 | remove_proc_subtree("powerpc/lparcfg", NULL); | ||
708 | } | ||
709 | |||
710 | module_init(lparcfg_init); | ||
711 | module_exit(lparcfg_cleanup); | ||
712 | MODULE_DESCRIPTION("Interface for LPAR configuration data"); | ||
713 | MODULE_AUTHOR("Dave Engebretsen"); | ||
714 | MODULE_LICENSE("GPL"); | ||