diff options
Diffstat (limited to 'arch/powerpc/boot/of.c')
-rw-r--r-- | arch/powerpc/boot/of.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/arch/powerpc/boot/of.c b/arch/powerpc/boot/of.c index 0182f384f3e6..d16ee3e3f868 100644 --- a/arch/powerpc/boot/of.c +++ b/arch/powerpc/boot/of.c | |||
@@ -173,7 +173,7 @@ static void *claim(unsigned long virt, unsigned long size, unsigned long align) | |||
173 | return (void *) virt; | 173 | return (void *) virt; |
174 | } | 174 | } |
175 | 175 | ||
176 | static void *of_try_claim(u32 size) | 176 | static void *of_try_claim(unsigned long size) |
177 | { | 177 | { |
178 | unsigned long addr = 0; | 178 | unsigned long addr = 0; |
179 | 179 | ||
@@ -208,6 +208,16 @@ static void of_image_hdr(const void *hdr) | |||
208 | } | 208 | } |
209 | } | 209 | } |
210 | 210 | ||
211 | static void *of_vmlinux_alloc(unsigned long size) | ||
212 | { | ||
213 | void *p = malloc(size); | ||
214 | |||
215 | if (!p) | ||
216 | fatal("Can't allocate memory for kernel image!\n\r"); | ||
217 | |||
218 | return p; | ||
219 | } | ||
220 | |||
211 | static void of_exit(void) | 221 | static void of_exit(void) |
212 | { | 222 | { |
213 | call_prom("exit", 0, 0); | 223 | call_prom("exit", 0, 0); |
@@ -256,11 +266,12 @@ static void of_console_write(char *buf, int len) | |||
256 | call_prom("write", 3, 1, of_stdout_handle, buf, len); | 266 | call_prom("write", 3, 1, of_stdout_handle, buf, len); |
257 | } | 267 | } |
258 | 268 | ||
259 | int platform_init(void *promptr, char *dt_blob_start, char *dt_blob_end) | 269 | void platform_init(unsigned long a1, unsigned long a2, void *promptr) |
260 | { | 270 | { |
261 | platform_ops.image_hdr = of_image_hdr; | 271 | platform_ops.image_hdr = of_image_hdr; |
262 | platform_ops.malloc = of_try_claim; | 272 | platform_ops.malloc = of_try_claim; |
263 | platform_ops.exit = of_exit; | 273 | platform_ops.exit = of_exit; |
274 | platform_ops.vmlinux_alloc = of_vmlinux_alloc; | ||
264 | 275 | ||
265 | dt_ops.finddevice = of_finddevice; | 276 | dt_ops.finddevice = of_finddevice; |
266 | dt_ops.getprop = of_getprop; | 277 | dt_ops.getprop = of_getprop; |
@@ -270,5 +281,9 @@ int platform_init(void *promptr, char *dt_blob_start, char *dt_blob_end) | |||
270 | console_ops.write = of_console_write; | 281 | console_ops.write = of_console_write; |
271 | 282 | ||
272 | prom = (int (*)(void *))promptr; | 283 | prom = (int (*)(void *))promptr; |
273 | return 0; | 284 | loader_info.promptr = promptr; |
285 | if (a1 && a2 && a2 != 0xdeadbeef) { | ||
286 | loader_info.initrd_addr = a1; | ||
287 | loader_info.initrd_size = a2; | ||
288 | } | ||
274 | } | 289 | } |