| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 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. |
|---|
| 5 | 3 | * |
|---|
| 6 | 4 | * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> |
|---|
| 7 | 5 | * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org> |
|---|
| .. | .. |
|---|
| 15 | 13 | #include <linux/sizes.h> |
|---|
| 16 | 14 | #include <linux/of_fdt.h> |
|---|
| 17 | 15 | #include <linux/kernel.h> |
|---|
| 18 | | -#include <linux/bootmem.h> |
|---|
| 16 | +#include <linux/memblock.h> |
|---|
| 19 | 17 | #include <linux/of_platform.h> |
|---|
| 20 | 18 | #include <linux/of_address.h> |
|---|
| 21 | 19 | |
|---|
| .. | .. |
|---|
| 47 | 45 | res.name)) |
|---|
| 48 | 46 | panic("Failed to request resources for %s", node); |
|---|
| 49 | 47 | |
|---|
| 50 | | - return ioremap_nocache(res.start, resource_size(&res)); |
|---|
| 48 | + return ioremap(res.start, resource_size(&res)); |
|---|
| 51 | 49 | } |
|---|
| 52 | 50 | |
|---|
| 53 | 51 | void __init device_tree_init(void) |
|---|
| .. | .. |
|---|
| 79 | 77 | */ |
|---|
| 80 | 78 | if (fw_passed_dtb) |
|---|
| 81 | 79 | dtb = (void *)fw_passed_dtb; |
|---|
| 82 | | - else if (__dtb_start != __dtb_end) |
|---|
| 80 | + else if (&__dtb_start != &__dtb_end) |
|---|
| 83 | 81 | dtb = (void *)__dtb_start; |
|---|
| 84 | 82 | |
|---|
| 85 | 83 | __dt_setup_arch(dtb); |
|---|
| .. | .. |
|---|
| 88 | 86 | if (memory_dtb) |
|---|
| 89 | 87 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); |
|---|
| 90 | 88 | 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); |
|---|
| 93 | 90 | else |
|---|
| 94 | 91 | detect_memory_region(soc_info.mem_base, |
|---|
| 95 | 92 | soc_info.mem_size_min * SZ_1M, |
|---|