|
33 | 33 | #include <linux/memblock.h>
|
34 | 34 | #include <linux/of.h>
|
35 | 35 | #include <linux/of_fdt.h>
|
| 36 | +#include <linux/libfdt.h> |
36 | 37 |
|
37 | 38 | #include <asm/prom.h>
|
38 | 39 | #include <asm/rtas.h>
|
@@ -117,14 +118,14 @@ static void __init move_device_tree(void)
|
117 | 118 | DBG("-> move_device_tree\n");
|
118 | 119 |
|
119 | 120 | start = __pa(initial_boot_params);
|
120 |
| - size = be32_to_cpu(initial_boot_params->totalsize); |
| 121 | + size = fdt_totalsize(initial_boot_params); |
121 | 122 |
|
122 | 123 | if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
|
123 | 124 | overlaps_crashkernel(start, size) ||
|
124 | 125 | overlaps_initrd(start, size)) {
|
125 | 126 | p = __va(memblock_alloc(size, PAGE_SIZE));
|
126 | 127 | memcpy(p, initial_boot_params, size);
|
127 |
| - initial_boot_params = (struct boot_param_header *)p; |
| 128 | + initial_boot_params = p; |
128 | 129 | DBG("Moved device tree to 0x%p\n", p);
|
129 | 130 | }
|
130 | 131 |
|
@@ -324,9 +325,9 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
|
324 | 325 | * version 2 of the kexec param format adds the phys cpuid of
|
325 | 326 | * booted proc.
|
326 | 327 | */
|
327 |
| - if (be32_to_cpu(initial_boot_params->version) >= 2) { |
| 328 | + if (fdt_version(initial_boot_params) >= 2) { |
328 | 329 | if (be32_to_cpu(intserv[i]) ==
|
329 |
| - be32_to_cpu(initial_boot_params->boot_cpuid_phys)) { |
| 330 | + fdt_boot_cpuid_phys(initial_boot_params)) { |
330 | 331 | found = boot_cpu_count;
|
331 | 332 | found_thread = i;
|
332 | 333 | }
|
@@ -599,7 +600,7 @@ static void __init early_reserve_mem(void)
|
599 | 600 | __be64 *reserve_map;
|
600 | 601 |
|
601 | 602 | reserve_map = (__be64 *)(((unsigned long)initial_boot_params) +
|
602 |
| - be32_to_cpu(initial_boot_params->off_mem_rsvmap)); |
| 603 | + fdt_off_mem_rsvmap(initial_boot_params)); |
603 | 604 |
|
604 | 605 | /* Look for the new "reserved-regions" property in the DT */
|
605 | 606 | early_reserve_mem_dt();
|
|
0 commit comments