aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2006-11-27 13:18:57 -0500
committerPaul Mackerras <paulus@samba.org>2006-12-04 04:41:16 -0500
commite22ba7e38144c1cccac5024cfd6ec88bb64d3e1f (patch)
tree869b43ec4fcc66b0ff6bb6eb7f735b1846859b8c
parenteb30c72026500f9efa9bb23ab2393d6a9e36c5e1 (diff)
[POWERPC] ps3: multiplatform build fixes
A few code paths need to check whether or not they are running on the PS3's LV1 hypervisor before making hcalls. This introduces a new firmware feature bit for this, FW_FEATURE_PS3_LV1. Now when both PS3 and IBM_CELL_BLADE are enabled, but not PSERIES, FW_FEATURE_PS3_LV1 and FW_FEATURE_LPAR get enabled at compile time, which is a bug. The same problem can also happen for (PPC_ISERIES && !PPC_PSERIES && PPC_SOMETHING_ELSE). In order to solve this, I introduce a new CONFIG_PPC_NATIVE option that is set when at least one platform is selected that can run without a hypervisor and then turns the firmware feature check into a run-time option. The new cell oprofile support that was recently merged does not work on hypervisor based platforms like the PS3, therefore make it depend on PPC_CELL_NATIVE instead of PPC_CELL. This may change if we get oprofile support for PS3. Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
-rw-r--r--arch/powerpc/Kconfig26
-rw-r--r--arch/powerpc/mm/Makefile2
-rw-r--r--arch/powerpc/oprofile/Makefile2
-rw-r--r--arch/powerpc/oprofile/common.c2
-rw-r--r--arch/powerpc/platforms/ps3/mm.c4
-rw-r--r--arch/powerpc/platforms/ps3/setup.c2
-rw-r--r--drivers/ps3/system-bus.c4
-rw-r--r--include/asm-powerpc/firmware.h13
8 files changed, 44 insertions, 11 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index c0146a40c6f3..c04b7138e1a6 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -390,6 +390,7 @@ config PPC_PSERIES
390 select PPC_RTAS 390 select PPC_RTAS
391 select RTAS_ERROR_LOGGING 391 select RTAS_ERROR_LOGGING
392 select PPC_UDBG_16550 392 select PPC_UDBG_16550
393 select PPC_NATIVE
393 default y 394 default y
394 395
395config PPC_ISERIES 396config PPC_ISERIES
@@ -406,6 +407,7 @@ config PPC_CHRP
406 select PPC_RTAS 407 select PPC_RTAS
407 select PPC_MPC106 408 select PPC_MPC106
408 select PPC_UDBG_16550 409 select PPC_UDBG_16550
410 select PPC_NATIVE
409 default y 411 default y
410 412
411config PPC_EFIKA 413config PPC_EFIKA
@@ -414,6 +416,7 @@ config PPC_EFIKA
414 select PPC_RTAS 416 select PPC_RTAS
415 select RTAS_PROC 417 select RTAS_PROC
416 select PPC_MPC52xx 418 select PPC_MPC52xx
419 select PPC_NATIVE
417 default y 420 default y
418 421
419config PPC_PMAC 422config PPC_PMAC
@@ -422,6 +425,7 @@ config PPC_PMAC
422 select MPIC 425 select MPIC
423 select PPC_INDIRECT_PCI if PPC32 426 select PPC_INDIRECT_PCI if PPC32
424 select PPC_MPC106 if PPC32 427 select PPC_MPC106 if PPC32
428 select PPC_NATIVE
425 default y 429 default y
426 430
427config PPC_PMAC64 431config PPC_PMAC64
@@ -441,6 +445,7 @@ config PPC_PREP
441 select PPC_I8259 445 select PPC_I8259
442 select PPC_INDIRECT_PCI 446 select PPC_INDIRECT_PCI
443 select PPC_UDBG_16550 447 select PPC_UDBG_16550
448 select PPC_NATIVE
444 default y 449 default y
445 450
446config PPC_MAPLE 451config PPC_MAPLE
@@ -452,6 +457,7 @@ config PPC_MAPLE
452 select GENERIC_TBSYNC 457 select GENERIC_TBSYNC
453 select PPC_UDBG_16550 458 select PPC_UDBG_16550
454 select PPC_970_NAP 459 select PPC_970_NAP
460 select PPC_NATIVE
455 default n 461 default n
456 help 462 help
457 This option enables support for the Maple 970FX Evaluation Board. 463 This option enables support for the Maple 970FX Evaluation Board.
@@ -464,6 +470,7 @@ config PPC_PASEMI
464 select MPIC 470 select MPIC
465 select PPC_UDBG_16550 471 select PPC_UDBG_16550
466 select GENERIC_TBSYNC 472 select GENERIC_TBSYNC
473 select PPC_NATIVE
467 help 474 help
468 This option enables support for PA Semi's PWRficient line 475 This option enables support for PA Semi's PWRficient line
469 of SoC processors, including PA6T-1682M 476 of SoC processors, including PA6T-1682M
@@ -478,6 +485,7 @@ config PPC_CELL_NATIVE
478 select PPC_DCR_MMIO 485 select PPC_DCR_MMIO
479 select PPC_OF_PLATFORM_PCI 486 select PPC_OF_PLATFORM_PCI
480 select PPC_INDIRECT_IO 487 select PPC_INDIRECT_IO
488 select PPC_NATIVE
481 select MPIC 489 select MPIC
482 default n 490 default n
483 491
@@ -490,11 +498,6 @@ config PPC_IBM_CELL_BLADE
490 select PPC_UDBG_16550 498 select PPC_UDBG_16550
491 select UDBG_RTAS_CONSOLE 499 select UDBG_RTAS_CONSOLE
492 500
493config UDBG_RTAS_CONSOLE
494 bool "RTAS based debug console"
495 depends on PPC_RTAS
496 default n
497
498config PPC_PS3 501config PPC_PS3
499 bool "Sony PS3" 502 bool "Sony PS3"
500 depends on PPC_MULTIPLATFORM && PPC64 503 depends on PPC_MULTIPLATFORM && PPC64
@@ -503,6 +506,19 @@ config PPC_PS3
503 This option enables support for the Sony PS3 game console 506 This option enables support for the Sony PS3 game console
504 and other platforms using the PS3 hypervisor. 507 and other platforms using the PS3 hypervisor.
505 508
509config PPC_NATIVE
510 bool
511 depends on PPC_MULTIPLATFORM
512 help
513 Support for running natively on the hardware, i.e. without
514 a hypervisor. This option is not user-selectable but should
515 be selected by all platforms that need it.
516
517config UDBG_RTAS_CONSOLE
518 bool "RTAS based debug console"
519 depends on PPC_RTAS
520 default n
521
506config XICS 522config XICS
507 depends on PPC_PSERIES 523 depends on PPC_PSERIES
508 bool 524 bool
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 93441e7a2921..38a81967ca07 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -8,7 +8,7 @@ endif
8 8
9obj-y := fault.o mem.o lmb.o 9obj-y := fault.o mem.o lmb.o
10obj-$(CONFIG_PPC32) += init_32.o pgtable_32.o mmu_context_32.o 10obj-$(CONFIG_PPC32) += init_32.o pgtable_32.o mmu_context_32.o
11hash-$(CONFIG_PPC_MULTIPLATFORM) := hash_native_64.o 11hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o
12obj-$(CONFIG_PPC64) += init_64.o pgtable_64.o mmu_context_64.o \ 12obj-$(CONFIG_PPC64) += init_64.o pgtable_64.o mmu_context_64.o \
13 hash_utils_64.o hash_low_64.o tlb_64.o \ 13 hash_utils_64.o hash_low_64.o tlb_64.o \
14 slb_low.o slb.o stab.o mmap.o imalloc.o \ 14 slb_low.o slb.o stab.o mmap.o imalloc.o \
diff --git a/arch/powerpc/oprofile/Makefile b/arch/powerpc/oprofile/Makefile
index 51c510fed7f7..4ccef2d5530c 100644
--- a/arch/powerpc/oprofile/Makefile
+++ b/arch/powerpc/oprofile/Makefile
@@ -11,7 +11,7 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
11 timer_int.o ) 11 timer_int.o )
12 12
13oprofile-y := $(DRIVER_OBJS) common.o backtrace.o 13oprofile-y := $(DRIVER_OBJS) common.o backtrace.o
14oprofile-$(CONFIG_PPC_CELL) += op_model_cell.o 14oprofile-$(CONFIG_PPC_CELL_NATIVE) += op_model_cell.o
15oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o 15oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o
16oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o 16oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o
17oprofile-$(CONFIG_6xx) += op_model_7450.o 17oprofile-$(CONFIG_6xx) += op_model_7450.o
diff --git a/arch/powerpc/oprofile/common.c b/arch/powerpc/oprofile/common.c
index 7a423437977c..b6d82390b6a6 100644
--- a/arch/powerpc/oprofile/common.c
+++ b/arch/powerpc/oprofile/common.c
@@ -147,7 +147,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
147 147
148 switch (cur_cpu_spec->oprofile_type) { 148 switch (cur_cpu_spec->oprofile_type) {
149#ifdef CONFIG_PPC64 149#ifdef CONFIG_PPC64
150#ifdef CONFIG_PPC_CELL 150#ifdef CONFIG_PPC_CELL_NATIVE
151 case PPC_OPROFILE_CELL: 151 case PPC_OPROFILE_CELL:
152 model = &op_model_cell; 152 model = &op_model_cell;
153 break; 153 break;
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index a57f7036dd1f..49c0d010d491 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/memory_hotplug.h> 23#include <linux/memory_hotplug.h>
24 24
25#include <asm/firmware.h>
25#include <asm/lmb.h> 26#include <asm/lmb.h>
26#include <asm/udbg.h> 27#include <asm/udbg.h>
27#include <asm/ps3.h> 28#include <asm/ps3.h>
@@ -293,6 +294,9 @@ static int __init ps3_mm_add_memory(void)
293 unsigned long start_pfn; 294 unsigned long start_pfn;
294 unsigned long nr_pages; 295 unsigned long nr_pages;
295 296
297 if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
298 return 0;
299
296 BUG_ON(!mem_init_done); 300 BUG_ON(!mem_init_done);
297 301
298 start_addr = USE_LPAR_ADDR ? map.r1.base : map.rm.size; 302 start_addr = USE_LPAR_ADDR ? map.r1.base : map.rm.size;
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index c1f6de50654d..d8b5cadbe80e 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -108,7 +108,7 @@ static int __init ps3_probe(void)
108 if (!of_flat_dt_is_compatible(dt_root, "PS3")) 108 if (!of_flat_dt_is_compatible(dt_root, "PS3"))
109 return 0; 109 return 0;
110 110
111 powerpc_firmware_features |= FW_FEATURE_LPAR; 111 powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE;
112 112
113 ps3_os_area_init(); 113 ps3_os_area_init();
114 ps3_mm_init(); 114 ps3_mm_init();
diff --git a/drivers/ps3/system-bus.c b/drivers/ps3/system-bus.c
index e19992c4db41..d79f949bcb2a 100644
--- a/drivers/ps3/system-bus.c
+++ b/drivers/ps3/system-bus.c
@@ -27,6 +27,7 @@
27#include <asm/udbg.h> 27#include <asm/udbg.h>
28#include <asm/ps3.h> 28#include <asm/ps3.h>
29#include <asm/lv1call.h> 29#include <asm/lv1call.h>
30#include <asm/firmware.h>
30 31
31#define dump_mmio_region(_a) _dump_mmio_region(_a, __func__, __LINE__) 32#define dump_mmio_region(_a) _dump_mmio_region(_a, __func__, __LINE__)
32static void _dump_mmio_region(const struct ps3_mmio_region* r, 33static void _dump_mmio_region(const struct ps3_mmio_region* r,
@@ -167,6 +168,9 @@ int __init ps3_system_bus_init(void)
167{ 168{
168 int result; 169 int result;
169 170
171 if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
172 return 0;
173
170 result = bus_register(&ps3_system_bus_type); 174 result = bus_register(&ps3_system_bus_type);
171 BUG_ON(result); 175 BUG_ON(result);
172 return result; 176 return result;
diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h
index 84d43d6e13ec..98f7b62422c9 100644
--- a/include/asm-powerpc/firmware.h
+++ b/include/asm-powerpc/firmware.h
@@ -42,6 +42,7 @@
42#define FW_FEATURE_SPLPAR ASM_CONST(0x0000000000100000) 42#define FW_FEATURE_SPLPAR ASM_CONST(0x0000000000100000)
43#define FW_FEATURE_ISERIES ASM_CONST(0x0000000000200000) 43#define FW_FEATURE_ISERIES ASM_CONST(0x0000000000200000)
44#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000) 44#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000)
45#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000)
45 46
46#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
47 48
@@ -58,8 +59,10 @@ enum {
58 FW_FEATURE_PSERIES_ALWAYS = 0, 59 FW_FEATURE_PSERIES_ALWAYS = 0,
59 FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, 60 FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
60 FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, 61 FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
61 FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR, 62 FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
62 FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR, 63 FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
64 FW_FEATURE_NATIVE_POSSIBLE = 0,
65 FW_FEATURE_NATIVE_ALWAYS = 0,
63 FW_FEATURE_POSSIBLE = 66 FW_FEATURE_POSSIBLE =
64#ifdef CONFIG_PPC_PSERIES 67#ifdef CONFIG_PPC_PSERIES
65 FW_FEATURE_PSERIES_POSSIBLE | 68 FW_FEATURE_PSERIES_POSSIBLE |
@@ -70,6 +73,9 @@ enum {
70#ifdef CONFIG_PPC_PS3 73#ifdef CONFIG_PPC_PS3
71 FW_FEATURE_PS3_POSSIBLE | 74 FW_FEATURE_PS3_POSSIBLE |
72#endif 75#endif
76#ifdef CONFIG_PPC_NATIVE
77 FW_FEATURE_NATIVE_ALWAYS |
78#endif
73 0, 79 0,
74 FW_FEATURE_ALWAYS = 80 FW_FEATURE_ALWAYS =
75#ifdef CONFIG_PPC_PSERIES 81#ifdef CONFIG_PPC_PSERIES
@@ -81,6 +87,9 @@ enum {
81#ifdef CONFIG_PPC_PS3 87#ifdef CONFIG_PPC_PS3
82 FW_FEATURE_PS3_ALWAYS & 88 FW_FEATURE_PS3_ALWAYS &
83#endif 89#endif
90#ifdef CONFIG_PPC_NATIVE
91 FW_FEATURE_NATIVE_ALWAYS &
92#endif
84 FW_FEATURE_POSSIBLE, 93 FW_FEATURE_POSSIBLE,
85 94
86#else /* CONFIG_PPC64 */ 95#else /* CONFIG_PPC64 */