hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/arch/mips/ralink/of.c
....@@ -1,7 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
2
- * This program is free software; you can redistribute it and/or modify it
3
- * under the terms of the GNU General Public License version 2 as published
4
- * by the Free Software Foundation.
53 *
64 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
75 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
....@@ -15,7 +13,7 @@
1513 #include <linux/sizes.h>
1614 #include <linux/of_fdt.h>
1715 #include <linux/kernel.h>
18
-#include <linux/bootmem.h>
16
+#include <linux/memblock.h>
1917 #include <linux/of_platform.h>
2018 #include <linux/of_address.h>
2119
....@@ -47,7 +45,7 @@
4745 res.name))
4846 panic("Failed to request resources for %s", node);
4947
50
- return ioremap_nocache(res.start, resource_size(&res));
48
+ return ioremap(res.start, resource_size(&res));
5149 }
5250
5351 void __init device_tree_init(void)
....@@ -79,7 +77,7 @@
7977 */
8078 if (fw_passed_dtb)
8179 dtb = (void *)fw_passed_dtb;
82
- else if (__dtb_start != __dtb_end)
80
+ else if (&__dtb_start != &__dtb_end)
8381 dtb = (void *)__dtb_start;
8482
8583 __dt_setup_arch(dtb);
....@@ -88,8 +86,7 @@
8886 if (memory_dtb)
8987 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
9088 else if (soc_info.mem_size)
91
- add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M,
92
- BOOT_MEM_RAM);
89
+ memblock_add(soc_info.mem_base, soc_info.mem_size * SZ_1M);
9390 else
9491 detect_memory_region(soc_info.mem_base,
9592 soc_info.mem_size_min * SZ_1M,