diff options
author | Arnd Bergmann <arnd@arndb.de> | 2006-11-27 13:18:57 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 04:41:16 -0500 |
commit | e22ba7e38144c1cccac5024cfd6ec88bb64d3e1f (patch) | |
tree | 869b43ec4fcc66b0ff6bb6eb7f735b1846859b8c /arch | |
parent | eb30c72026500f9efa9bb23ab2393d6a9e36c5e1 (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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/Kconfig | 26 | ||||
-rw-r--r-- | arch/powerpc/mm/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/oprofile/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/oprofile/common.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/mm.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/setup.c | 2 |
6 files changed, 29 insertions, 9 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 | ||
395 | config PPC_ISERIES | 396 | config 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 | ||
411 | config PPC_EFIKA | 413 | config 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 | ||
419 | config PPC_PMAC | 422 | config 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 | ||
427 | config PPC_PMAC64 | 431 | config 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 | ||
446 | config PPC_MAPLE | 451 | config 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 | ||
493 | config UDBG_RTAS_CONSOLE | ||
494 | bool "RTAS based debug console" | ||
495 | depends on PPC_RTAS | ||
496 | default n | ||
497 | |||
498 | config PPC_PS3 | 501 | config 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 | ||
509 | config 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 | |||
517 | config UDBG_RTAS_CONSOLE | ||
518 | bool "RTAS based debug console" | ||
519 | depends on PPC_RTAS | ||
520 | default n | ||
521 | |||
506 | config XICS | 522 | config 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 | ||
9 | obj-y := fault.o mem.o lmb.o | 9 | obj-y := fault.o mem.o lmb.o |
10 | obj-$(CONFIG_PPC32) += init_32.o pgtable_32.o mmu_context_32.o | 10 | obj-$(CONFIG_PPC32) += init_32.o pgtable_32.o mmu_context_32.o |
11 | hash-$(CONFIG_PPC_MULTIPLATFORM) := hash_native_64.o | 11 | hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o |
12 | obj-$(CONFIG_PPC64) += init_64.o pgtable_64.o mmu_context_64.o \ | 12 | obj-$(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 | ||
13 | oprofile-y := $(DRIVER_OBJS) common.o backtrace.o | 13 | oprofile-y := $(DRIVER_OBJS) common.o backtrace.o |
14 | oprofile-$(CONFIG_PPC_CELL) += op_model_cell.o | 14 | oprofile-$(CONFIG_PPC_CELL_NATIVE) += op_model_cell.o |
15 | oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o | 15 | oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o |
16 | oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o | 16 | oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o |
17 | oprofile-$(CONFIG_6xx) += op_model_7450.o | 17 | oprofile-$(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(); |