.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/arch/arm/kernel/devtree.c |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2009 Canonical Ltd. <jeremy.kerr@canonical.com> |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License version 2 as |
---|
8 | | - * published by the Free Software Foundation. |
---|
9 | 6 | */ |
---|
10 | 7 | |
---|
11 | 8 | #include <linux/init.h> |
---|
12 | 9 | #include <linux/export.h> |
---|
13 | 10 | #include <linux/errno.h> |
---|
14 | 11 | #include <linux/types.h> |
---|
15 | | -#include <linux/bootmem.h> |
---|
16 | 12 | #include <linux/memblock.h> |
---|
17 | 13 | #include <linux/of.h> |
---|
18 | 14 | #include <linux/of_fdt.h> |
---|
.. | .. |
---|
33 | 29 | extern struct of_cpu_method __cpu_method_of_table[]; |
---|
34 | 30 | |
---|
35 | 31 | static const struct of_cpu_method __cpu_method_of_table_sentinel |
---|
36 | | - __used __section(__cpu_method_of_table_end); |
---|
| 32 | + __used __section("__cpu_method_of_table_end"); |
---|
37 | 33 | |
---|
38 | 34 | |
---|
39 | 35 | static int __init set_smp_ops_by_method(struct device_node *node) |
---|
.. | .. |
---|
87 | 83 | if (!cpus) |
---|
88 | 84 | return; |
---|
89 | 85 | |
---|
90 | | - for_each_child_of_node(cpus, cpu) { |
---|
| 86 | + for_each_of_cpu_node(cpu) { |
---|
91 | 87 | const __be32 *cell; |
---|
92 | 88 | int prop_bytes; |
---|
93 | 89 | u32 hwid; |
---|
94 | | - |
---|
95 | | - if (of_node_cmp(cpu->type, "cpu")) |
---|
96 | | - continue; |
---|
97 | 90 | |
---|
98 | 91 | pr_debug(" * %pOF...\n", cpu); |
---|
99 | 92 | /* |
---|
.. | .. |
---|
210 | 203 | |
---|
211 | 204 | /** |
---|
212 | 205 | * setup_machine_fdt - Machine setup when an dtb was passed to the kernel |
---|
213 | | - * @dt_phys: physical address of dt blob |
---|
| 206 | + * @dt_virt: virtual address of dt blob |
---|
214 | 207 | * |
---|
215 | 208 | * If a dtb was passed to the kernel in r2, then use it to choose the |
---|
216 | 209 | * correct machine_desc and to setup the system. |
---|
217 | 210 | */ |
---|
218 | | -const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) |
---|
| 211 | +const struct machine_desc * __init setup_machine_fdt(void *dt_virt) |
---|
219 | 212 | { |
---|
220 | 213 | const struct machine_desc *mdesc, *mdesc_best = NULL; |
---|
221 | 214 | |
---|
.. | .. |
---|
228 | 221 | mdesc_best = &__mach_desc_GENERIC_DT; |
---|
229 | 222 | #endif |
---|
230 | 223 | |
---|
231 | | - if (!dt_phys || !early_init_dt_verify(phys_to_virt(dt_phys))) |
---|
| 224 | + if (!dt_virt || !early_init_dt_verify(dt_virt)) |
---|
232 | 225 | return NULL; |
---|
233 | 226 | |
---|
234 | 227 | mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach); |
---|