diff options
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index f58c0d3aaeb4..668aa4791fd7 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/irq.h> | 33 | #include <linux/irq.h> |
34 | #include <linux/memblock.h> | 34 | #include <linux/memblock.h> |
35 | #include <linux/of.h> | 35 | #include <linux/of.h> |
36 | #include <linux/of_fdt.h> | ||
36 | 37 | ||
37 | #include <asm/prom.h> | 38 | #include <asm/prom.h> |
38 | #include <asm/rtas.h> | 39 | #include <asm/rtas.h> |
@@ -346,45 +347,45 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
346 | #endif | 347 | #endif |
347 | } | 348 | } |
348 | 349 | ||
349 | if (found >= 0) { | 350 | /* Not the boot CPU */ |
350 | DBG("boot cpu: logical %d physical %d\n", found, | 351 | if (found < 0) |
351 | be32_to_cpu(intserv[found_thread])); | 352 | return 0; |
352 | boot_cpuid = found; | ||
353 | set_hard_smp_processor_id(found, | ||
354 | be32_to_cpu(intserv[found_thread])); | ||
355 | 353 | ||
356 | /* | 354 | DBG("boot cpu: logical %d physical %d\n", found, |
357 | * PAPR defines "logical" PVR values for cpus that | 355 | be32_to_cpu(intserv[found_thread])); |
358 | * meet various levels of the architecture: | 356 | boot_cpuid = found; |
359 | * 0x0f000001 Architecture version 2.04 | 357 | set_hard_smp_processor_id(found, be32_to_cpu(intserv[found_thread])); |
360 | * 0x0f000002 Architecture version 2.05 | ||
361 | * If the cpu-version property in the cpu node contains | ||
362 | * such a value, we call identify_cpu again with the | ||
363 | * logical PVR value in order to use the cpu feature | ||
364 | * bits appropriate for the architecture level. | ||
365 | * | ||
366 | * A POWER6 partition in "POWER6 architected" mode | ||
367 | * uses the 0x0f000002 PVR value; in POWER5+ mode | ||
368 | * it uses 0x0f000001. | ||
369 | */ | ||
370 | prop = of_get_flat_dt_prop(node, "cpu-version", NULL); | ||
371 | if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000) | ||
372 | identify_cpu(0, be32_to_cpup(prop)); | ||
373 | 358 | ||
374 | identical_pvr_fixup(node); | 359 | /* |
375 | } | 360 | * PAPR defines "logical" PVR values for cpus that |
361 | * meet various levels of the architecture: | ||
362 | * 0x0f000001 Architecture version 2.04 | ||
363 | * 0x0f000002 Architecture version 2.05 | ||
364 | * If the cpu-version property in the cpu node contains | ||
365 | * such a value, we call identify_cpu again with the | ||
366 | * logical PVR value in order to use the cpu feature | ||
367 | * bits appropriate for the architecture level. | ||
368 | * | ||
369 | * A POWER6 partition in "POWER6 architected" mode | ||
370 | * uses the 0x0f000002 PVR value; in POWER5+ mode | ||
371 | * it uses 0x0f000001. | ||
372 | */ | ||
373 | prop = of_get_flat_dt_prop(node, "cpu-version", NULL); | ||
374 | if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000) | ||
375 | identify_cpu(0, be32_to_cpup(prop)); | ||
376 | |||
377 | identical_pvr_fixup(node); | ||
376 | 378 | ||
377 | check_cpu_feature_properties(node); | 379 | check_cpu_feature_properties(node); |
378 | check_cpu_pa_features(node); | 380 | check_cpu_pa_features(node); |
379 | check_cpu_slb_size(node); | 381 | check_cpu_slb_size(node); |
380 | 382 | ||
381 | #ifdef CONFIG_PPC_PSERIES | 383 | #ifdef CONFIG_PPC64 |
382 | if (nthreads > 1) | 384 | if (nthreads > 1) |
383 | cur_cpu_spec->cpu_features |= CPU_FTR_SMT; | 385 | cur_cpu_spec->cpu_features |= CPU_FTR_SMT; |
384 | else | 386 | else |
385 | cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT; | 387 | cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT; |
386 | #endif | 388 | #endif |
387 | |||
388 | return 0; | 389 | return 0; |
389 | } | 390 | } |
390 | 391 | ||
@@ -588,6 +589,8 @@ static void __init early_reserve_mem_dt(void) | |||
588 | memblock_reserve(base, size); | 589 | memblock_reserve(base, size); |
589 | } | 590 | } |
590 | } | 591 | } |
592 | |||
593 | early_init_fdt_scan_reserved_mem(); | ||
591 | } | 594 | } |
592 | 595 | ||
593 | static void __init early_reserve_mem(void) | 596 | static void __init early_reserve_mem(void) |
@@ -744,6 +747,10 @@ void __init early_init_devtree(void *params) | |||
744 | * (altivec support, boot CPU ID, ...) | 747 | * (altivec support, boot CPU ID, ...) |
745 | */ | 748 | */ |
746 | of_scan_flat_dt(early_init_dt_scan_cpus, NULL); | 749 | of_scan_flat_dt(early_init_dt_scan_cpus, NULL); |
750 | if (boot_cpuid < 0) { | ||
751 | printk("Failed to indentify boot CPU !\n"); | ||
752 | BUG(); | ||
753 | } | ||
747 | 754 | ||
748 | #if defined(CONFIG_SMP) && defined(CONFIG_PPC64) | 755 | #if defined(CONFIG_SMP) && defined(CONFIG_PPC64) |
749 | /* We'll later wait for secondaries to check in; there are | 756 | /* We'll later wait for secondaries to check in; there are |
@@ -752,6 +759,11 @@ void __init early_init_devtree(void *params) | |||
752 | spinning_secondaries = boot_cpu_count - 1; | 759 | spinning_secondaries = boot_cpu_count - 1; |
753 | #endif | 760 | #endif |
754 | 761 | ||
762 | #ifdef CONFIG_PPC_POWERNV | ||
763 | /* Scan and build the list of machine check recoverable ranges */ | ||
764 | of_scan_flat_dt(early_init_dt_scan_recoverable_ranges, NULL); | ||
765 | #endif | ||
766 | |||
755 | DBG(" <- early_init_devtree()\n"); | 767 | DBG(" <- early_init_devtree()\n"); |
756 | } | 768 | } |
757 | 769 | ||