prom.c (7246f60068840847bdcf595be5f0b5ca632736e0) prom.c (5a61ef74f269f2573f48fa53607a8911216c3326)
1/*
2 * Procedures for creating, accessing and interpreting the device tree.
3 *
4 * Paul Mackerras August 1996.
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 *
7 * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
8 * {engebret|bergner}@us.ibm.com

--- 43 unchanged lines hidden (view full) ---

52#include <asm/sections.h>
53#include <asm/machdep.h>
54#include <asm/pci-bridge.h>
55#include <asm/kexec.h>
56#include <asm/opal.h>
57#include <asm/fadump.h>
58#include <asm/epapr_hcalls.h>
59#include <asm/firmware.h>
1/*
2 * Procedures for creating, accessing and interpreting the device tree.
3 *
4 * Paul Mackerras August 1996.
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 *
7 * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
8 * {engebret|bergner}@us.ibm.com

--- 43 unchanged lines hidden (view full) ---

52#include <asm/sections.h>
53#include <asm/machdep.h>
54#include <asm/pci-bridge.h>
55#include <asm/kexec.h>
56#include <asm/opal.h>
57#include <asm/fadump.h>
58#include <asm/epapr_hcalls.h>
59#include <asm/firmware.h>
60#include <asm/dt_cpu_ftrs.h>
60
61#include <mm/mmu_decl.h>
62
63#ifdef DEBUG
64#define DBG(fmt...) printk(KERN_ERR fmt)
65#else
66#define DBG(fmt...)
67#endif

--- 302 unchanged lines hidden (view full) ---

370 * If the cpu-version property in the cpu node contains
371 * such a value, we call identify_cpu again with the
372 * logical PVR value in order to use the cpu feature
373 * bits appropriate for the architecture level.
374 *
375 * A POWER6 partition in "POWER6 architected" mode
376 * uses the 0x0f000002 PVR value; in POWER5+ mode
377 * it uses 0x0f000001.
61
62#include <mm/mmu_decl.h>
63
64#ifdef DEBUG
65#define DBG(fmt...) printk(KERN_ERR fmt)
66#else
67#define DBG(fmt...)
68#endif

--- 302 unchanged lines hidden (view full) ---

371 * If the cpu-version property in the cpu node contains
372 * such a value, we call identify_cpu again with the
373 * logical PVR value in order to use the cpu feature
374 * bits appropriate for the architecture level.
375 *
376 * A POWER6 partition in "POWER6 architected" mode
377 * uses the 0x0f000002 PVR value; in POWER5+ mode
378 * it uses 0x0f000001.
379 *
380 * If we're using device tree CPU feature discovery then we don't
381 * support the cpu-version property, and it's the responsibility of the
382 * firmware/hypervisor to provide the correct feature set for the
383 * architecture level via the ibm,powerpc-cpu-features binding.
378 */
384 */
379 prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
380 if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000)
381 identify_cpu(0, be32_to_cpup(prop));
385 if (!dt_cpu_ftrs_in_use()) {
386 prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
387 if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000)
388 identify_cpu(0, be32_to_cpup(prop));
382
389
383 identical_pvr_fixup(node);
390 check_cpu_feature_properties(node);
391 check_cpu_pa_features(node);
392 }
384
393
385 check_cpu_feature_properties(node);
386 check_cpu_pa_features(node);
394 identical_pvr_fixup(node);
387 init_mmu_slb_size(node);
388
389#ifdef CONFIG_PPC64
395 init_mmu_slb_size(node);
396
397#ifdef CONFIG_PPC64
390 if (nthreads > 1)
391 cur_cpu_spec->cpu_features |= CPU_FTR_SMT;
392 else
398 if (nthreads == 1)
393 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT;
399 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT;
400 else if (!dt_cpu_ftrs_in_use())
401 cur_cpu_spec->cpu_features |= CPU_FTR_SMT;
394#endif
402#endif
403
395 return 0;
396}
397
398static int __init early_init_dt_scan_chosen_ppc(unsigned long node,
399 const char *uname,
400 int depth, void *data)
401{
402 const unsigned long *lprop; /* All these set by kernel, so no need to convert endian */

--- 313 unchanged lines hidden (view full) ---

716 /* We may need to relocate the flat tree, do it now.
717 * FIXME .. and the initrd too? */
718 move_device_tree();
719
720 allocate_pacas();
721
722 DBG("Scanning CPUs ...\n");
723
404 return 0;
405}
406
407static int __init early_init_dt_scan_chosen_ppc(unsigned long node,
408 const char *uname,
409 int depth, void *data)
410{
411 const unsigned long *lprop; /* All these set by kernel, so no need to convert endian */

--- 313 unchanged lines hidden (view full) ---

725 /* We may need to relocate the flat tree, do it now.
726 * FIXME .. and the initrd too? */
727 move_device_tree();
728
729 allocate_pacas();
730
731 DBG("Scanning CPUs ...\n");
732
733 dt_cpu_ftrs_scan();
734
724 /* Retrieve CPU related informations from the flat tree
725 * (altivec support, boot CPU ID, ...)
726 */
727 of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
728 if (boot_cpuid < 0) {
729 printk("Failed to identify boot CPU !\n");
730 BUG();
731 }

--- 116 unchanged lines hidden ---
735 /* Retrieve CPU related informations from the flat tree
736 * (altivec support, boot CPU ID, ...)
737 */
738 of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
739 if (boot_cpuid < 0) {
740 printk("Failed to identify boot CPU !\n");
741 BUG();
742 }

--- 116 unchanged lines hidden ---