|
@@ -33,6 +33,7 @@
|
|
#include <linux/memblock.h>
|
|
#include <linux/memblock.h>
|
|
#include <linux/of.h>
|
|
#include <linux/of.h>
|
|
#include <linux/of_fdt.h>
|
|
#include <linux/of_fdt.h>
|
|
|
|
+#include <linux/libfdt.h>
|
|
|
|
|
|
#include <asm/prom.h>
|
|
#include <asm/prom.h>
|
|
#include <asm/rtas.h>
|
|
#include <asm/rtas.h>
|
|
@@ -117,14 +118,14 @@ static void __init move_device_tree(void)
|
|
DBG("-> move_device_tree\n");
|
|
DBG("-> move_device_tree\n");
|
|
|
|
|
|
start = __pa(initial_boot_params);
|
|
start = __pa(initial_boot_params);
|
|
- size = be32_to_cpu(initial_boot_params->totalsize);
|
|
|
|
|
|
+ size = fdt_totalsize(initial_boot_params);
|
|
|
|
|
|
if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
|
|
if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
|
|
overlaps_crashkernel(start, size) ||
|
|
overlaps_crashkernel(start, size) ||
|
|
overlaps_initrd(start, size)) {
|
|
overlaps_initrd(start, size)) {
|
|
p = __va(memblock_alloc(size, PAGE_SIZE));
|
|
p = __va(memblock_alloc(size, PAGE_SIZE));
|
|
memcpy(p, initial_boot_params, size);
|
|
memcpy(p, initial_boot_params, size);
|
|
- initial_boot_params = (struct boot_param_header *)p;
|
|
|
|
|
|
+ initial_boot_params = p;
|
|
DBG("Moved device tree to 0x%p\n", p);
|
|
DBG("Moved device tree to 0x%p\n", p);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -324,9 +325,9 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
|
|
* version 2 of the kexec param format adds the phys cpuid of
|
|
* version 2 of the kexec param format adds the phys cpuid of
|
|
* booted proc.
|
|
* booted proc.
|
|
*/
|
|
*/
|
|
- if (be32_to_cpu(initial_boot_params->version) >= 2) {
|
|
|
|
|
|
+ if (fdt_version(initial_boot_params) >= 2) {
|
|
if (be32_to_cpu(intserv[i]) ==
|
|
if (be32_to_cpu(intserv[i]) ==
|
|
- be32_to_cpu(initial_boot_params->boot_cpuid_phys)) {
|
|
|
|
|
|
+ fdt_boot_cpuid_phys(initial_boot_params)) {
|
|
found = boot_cpu_count;
|
|
found = boot_cpu_count;
|
|
found_thread = i;
|
|
found_thread = i;
|
|
}
|
|
}
|
|
@@ -599,7 +600,7 @@ static void __init early_reserve_mem(void)
|
|
__be64 *reserve_map;
|
|
__be64 *reserve_map;
|
|
|
|
|
|
reserve_map = (__be64 *)(((unsigned long)initial_boot_params) +
|
|
reserve_map = (__be64 *)(((unsigned long)initial_boot_params) +
|
|
- be32_to_cpu(initial_boot_params->off_mem_rsvmap));
|
|
|
|
|
|
+ fdt_off_mem_rsvmap(initial_boot_params));
|
|
|
|
|
|
/* Look for the new "reserved-regions" property in the DT */
|
|
/* Look for the new "reserved-regions" property in the DT */
|
|
early_reserve_mem_dt();
|
|
early_reserve_mem_dt();
|