hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/arch/arm/kernel/devtree.c
....@@ -1,18 +1,14 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/kernel/devtree.c
34 *
45 * 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.
96 */
107
118 #include <linux/init.h>
129 #include <linux/export.h>
1310 #include <linux/errno.h>
1411 #include <linux/types.h>
15
-#include <linux/bootmem.h>
1612 #include <linux/memblock.h>
1713 #include <linux/of.h>
1814 #include <linux/of_fdt.h>
....@@ -33,7 +29,7 @@
3329 extern struct of_cpu_method __cpu_method_of_table[];
3430
3531 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");
3733
3834
3935 static int __init set_smp_ops_by_method(struct device_node *node)
....@@ -87,13 +83,10 @@
8783 if (!cpus)
8884 return;
8985
90
- for_each_child_of_node(cpus, cpu) {
86
+ for_each_of_cpu_node(cpu) {
9187 const __be32 *cell;
9288 int prop_bytes;
9389 u32 hwid;
94
-
95
- if (of_node_cmp(cpu->type, "cpu"))
96
- continue;
9790
9891 pr_debug(" * %pOF...\n", cpu);
9992 /*
....@@ -210,12 +203,12 @@
210203
211204 /**
212205 * 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
214207 *
215208 * If a dtb was passed to the kernel in r2, then use it to choose the
216209 * correct machine_desc and to setup the system.
217210 */
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)
219212 {
220213 const struct machine_desc *mdesc, *mdesc_best = NULL;
221214
....@@ -228,7 +221,7 @@
228221 mdesc_best = &__mach_desc_GENERIC_DT;
229222 #endif
230223
231
- if (!dt_phys || !early_init_dt_verify(phys_to_virt(dt_phys)))
224
+ if (!dt_virt || !early_init_dt_verify(dt_virt))
232225 return NULL;
233226
234227 mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach);