.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or |
---|
5 | | - * modify it under the terms of the GNU General Public License |
---|
6 | | - * as published by the Free Software Foundation; either version 2 |
---|
7 | | - * of the License, or (at your option) any later version. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that it will be useful, |
---|
10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | | - * GNU General Public License for more details. |
---|
13 | | - * |
---|
14 | | - * You should have received a copy of the GNU General Public License |
---|
15 | | - * along with this program; if not, write to the Free Software |
---|
16 | | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
17 | 4 | */ |
---|
18 | 5 | |
---|
19 | 6 | #include <linux/init.h> |
---|
.. | .. |
---|
21 | 8 | #include <linux/linkage.h> |
---|
22 | 9 | #include <linux/mm.h> |
---|
23 | 10 | #include <linux/blkdev.h> |
---|
24 | | -#include <linux/bootmem.h> |
---|
| 11 | +#include <linux/memblock.h> |
---|
25 | 12 | #include <linux/pm.h> |
---|
26 | 13 | #include <linux/smp.h> |
---|
27 | 14 | |
---|
.. | .. |
---|
127 | 114 | if (initrd_start) { |
---|
128 | 115 | if ((initrd_pstart > addr) && |
---|
129 | 116 | (initrd_pstart < (addr + size))) { |
---|
130 | | - add_memory_region(addr, |
---|
131 | | - initrd_pstart - addr, |
---|
132 | | - BOOT_MEM_RAM); |
---|
| 117 | + memblock_add(addr, |
---|
| 118 | + initrd_pstart - addr); |
---|
133 | 119 | rd_flag = 1; |
---|
134 | 120 | } |
---|
135 | 121 | if ((initrd_pend > addr) && |
---|
136 | 122 | (initrd_pend < (addr + size))) { |
---|
137 | | - add_memory_region(initrd_pend, |
---|
138 | | - (addr + size) - initrd_pend, |
---|
139 | | - BOOT_MEM_RAM); |
---|
| 123 | + memblock_add(initrd_pend, |
---|
| 124 | + (addr + size) - initrd_pend); |
---|
140 | 125 | rd_flag = 1; |
---|
141 | 126 | } |
---|
142 | 127 | } |
---|
.. | .. |
---|
155 | 140 | */ |
---|
156 | 141 | if (size > 512) |
---|
157 | 142 | size -= 512; |
---|
158 | | - add_memory_region(addr, size, BOOT_MEM_RAM); |
---|
| 143 | + memblock_add(addr, size); |
---|
159 | 144 | } |
---|
160 | 145 | board_mem_region_addrs[board_mem_region_count] = addr; |
---|
161 | 146 | board_mem_region_sizes[board_mem_region_count] = size; |
---|
.. | .. |
---|
171 | 156 | } |
---|
172 | 157 | #ifdef CONFIG_BLK_DEV_INITRD |
---|
173 | 158 | if (initrd_start) { |
---|
174 | | - add_memory_region(initrd_pstart, initrd_pend - initrd_pstart, |
---|
175 | | - BOOT_MEM_RESERVED); |
---|
| 159 | + memblock_add(initrd_pstart, initrd_pend - initrd_pstart); |
---|
| 160 | + memblock_reserve(initrd_pstart, initrd_pend - initrd_pstart); |
---|
176 | 161 | } |
---|
177 | 162 | #endif |
---|
178 | 163 | } |
---|