Pull percpu-dtc into release branch
[pandora-kernel.git] / arch / powerpc / boot / of.c
index 3a71845..d16ee3e 100644 (file)
@@ -173,7 +173,7 @@ static void *claim(unsigned long virt, unsigned long size, unsigned long align)
        return (void *) virt;
 }
 
-static void *of_try_claim(u32 size)
+static void *of_try_claim(unsigned long size)
 {
        unsigned long addr = 0;
 
@@ -208,6 +208,16 @@ static void of_image_hdr(const void *hdr)
        }
 }
 
+static void *of_vmlinux_alloc(unsigned long size)
+{
+       void *p = malloc(size);
+
+       if (!p)
+               fatal("Can't allocate memory for kernel image!\n\r");
+
+       return p;
+}
+
 static void of_exit(void)
 {
        call_prom("exit", 0, 0);
@@ -256,25 +266,24 @@ static void of_console_write(char *buf, int len)
        call_prom("write", 3, 1, of_stdout_handle, buf, len);
 }
 
-int platform_init(void *promptr)
+void platform_init(unsigned long a1, unsigned long a2, void *promptr)
 {
-       platform_ops.fixups = NULL;
        platform_ops.image_hdr = of_image_hdr;
        platform_ops.malloc = of_try_claim;
-       platform_ops.free = NULL;
        platform_ops.exit = of_exit;
+       platform_ops.vmlinux_alloc = of_vmlinux_alloc;
 
        dt_ops.finddevice = of_finddevice;
        dt_ops.getprop = of_getprop;
        dt_ops.setprop = of_setprop;
-       dt_ops.translate_addr = NULL;
 
        console_ops.open = of_console_open;
        console_ops.write = of_console_write;
-       console_ops.edit_cmdline = NULL;
-       console_ops.close = NULL;
-       console_ops.data = NULL;
 
        prom = (int (*)(void *))promptr;
-       return 0;
+       loader_info.promptr = promptr;
+       if (a1 && a2 && a2 != 0xdeadbeef) {
+               loader_info.initrd_addr = a1;
+               loader_info.initrd_size = a2;
+       }
 }