forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/arch/powerpc/platforms/ps3/setup.c
....@@ -1,21 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * PS3 platform setup routines.
34 *
45 * Copyright (C) 2006 Sony Computer Entertainment Inc.
56 * Copyright 2006 Sony Corp.
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; version 2 of the License.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
197 */
208
219 #include <linux/kernel.h>
....@@ -24,7 +12,7 @@
2412 #include <linux/root_dev.h>
2513 #include <linux/console.h>
2614 #include <linux/export.h>
27
-#include <linux/bootmem.h>
15
+#include <linux/memblock.h>
2816
2917 #include <asm/machdep.h>
3018 #include <asm/firmware.h>
....@@ -126,7 +114,10 @@
126114 if (!p->size)
127115 return;
128116
129
- p->address = memblock_virt_alloc(p->size, p->align);
117
+ p->address = memblock_alloc(p->size, p->align);
118
+ if (!p->address)
119
+ panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
120
+ __func__, p->size, p->align);
130121
131122 printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size,
132123 p->address);
....@@ -147,7 +138,7 @@
147138 if (!p)
148139 return 1;
149140
150
- ps3fb_videomemory.size = _ALIGN_UP(memparse(p, &p),
141
+ ps3fb_videomemory.size = ALIGN(memparse(p, &p),
151142 ps3fb_videomemory.align);
152143 return 0;
153144 }
....@@ -207,10 +198,6 @@
207198
208199 #ifdef CONFIG_SMP
209200 smp_init_ps3();
210
-#endif
211
-
212
-#ifdef CONFIG_DUMMY_CONSOLE
213
- conswitchp = &dummy_con;
214201 #endif
215202
216203 prealloc_ps3fb_videomemory();