hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/arch/mips/sibyte/common/cfe.c
....@@ -1,19 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * 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.
174 */
185
196 #include <linux/init.h>
....@@ -21,7 +8,7 @@
218 #include <linux/linkage.h>
229 #include <linux/mm.h>
2310 #include <linux/blkdev.h>
24
-#include <linux/bootmem.h>
11
+#include <linux/memblock.h>
2512 #include <linux/pm.h>
2613 #include <linux/smp.h>
2714
....@@ -127,16 +114,14 @@
127114 if (initrd_start) {
128115 if ((initrd_pstart > addr) &&
129116 (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);
133119 rd_flag = 1;
134120 }
135121 if ((initrd_pend > addr) &&
136122 (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);
140125 rd_flag = 1;
141126 }
142127 }
....@@ -155,7 +140,7 @@
155140 */
156141 if (size > 512)
157142 size -= 512;
158
- add_memory_region(addr, size, BOOT_MEM_RAM);
143
+ memblock_add(addr, size);
159144 }
160145 board_mem_region_addrs[board_mem_region_count] = addr;
161146 board_mem_region_sizes[board_mem_region_count] = size;
....@@ -171,8 +156,8 @@
171156 }
172157 #ifdef CONFIG_BLK_DEV_INITRD
173158 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);
176161 }
177162 #endif
178163 }