[PATCH] powerpc: Fix ppc32 initrd
authorDavid Woodhouse <dwmw2@infradead.org>
Wed, 2 Nov 2005 22:34:20 +0000 (22:34 +0000)
committerPaul Mackerras <paulus@samba.org>
Tue, 8 Nov 2005 00:16:41 +0000 (11:16 +1100)
OK, the Fedora ppc32 and ppc64 kernels should both be arch/powerpc by
tomorrow. They're booting on G5, POWER5, and my powerbook. I'll test
pmac SMP and Pegasos later -- but pmac smp is known broken in arch/ppc
anyway, and I'll live with a potential Pegasos regression for now; it
wasn't supported officially in FC4 either.

I needed to fix ppc32 initrd -- we were never setting initrd_start.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/setup-common.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/setup_64.c

index d43fa8c0e5ac0861058b8800dafffb7fc63a8a5a..e22856ecb5a0396f1000cae57289a24107a168dd 100644 (file)
@@ -405,6 +405,46 @@ static int __init set_preferred_console(void)
 console_initcall(set_preferred_console);
 #endif /* CONFIG_PPC_MULTIPLATFORM */
 
+void __init check_for_initrd(void)
+{
+#ifdef CONFIG_BLK_DEV_INITRD
+       unsigned long *prop;
+
+       DBG(" -> check_for_initrd()\n");
+
+       if (of_chosen) {
+               prop = (unsigned long *)get_property(of_chosen,
+                               "linux,initrd-start", NULL);
+               if (prop != NULL) {
+                       initrd_start = (unsigned long)__va(*prop);
+                       prop = (unsigned long *)get_property(of_chosen,
+                                       "linux,initrd-end", NULL);
+                       if (prop != NULL) {
+                               initrd_end = (unsigned long)__va(*prop);
+                               initrd_below_start_ok = 1;
+                       } else
+                               initrd_start = 0;
+               }
+       }
+
+       /* If we were passed an initrd, set the ROOT_DEV properly if the values
+        * look sensible. If not, clear initrd reference.
+        */
+       if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE &&
+           initrd_end > initrd_start)
+               ROOT_DEV = Root_RAM0;
+       else {
+               printk("Bogus initrd %08lx %08lx\n", initrd_start, initrd_end);
+               initrd_start = initrd_end = 0;
+       }
+
+       if (initrd_start)
+               printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
+
+       DBG(" <- check_for_initrd()\n");
+#endif /* CONFIG_BLK_DEV_INITRD */
+}
+
 #ifdef CONFIG_SMP
 
 /**
index b45eedbb4b3a53ec439698ca3f7b115ad2ae87be..3af2631e3fab07f0ce0a4406bd897319a783d6a5 100644 (file)
@@ -286,6 +286,7 @@ void __init setup_arch(char **cmdline_p)
        loops_per_jiffy = 500000000 / HZ;
 
        unflatten_device_tree();
+       check_for_initrd();
        finish_device_tree();
 
        smp_setup_cpu_maps();
index 785fd9d7b3861bb89863a0f247bd256cb6664413..0471e843b6c53961f515a6e46a8e594cbc26a946 100644 (file)
@@ -395,43 +395,6 @@ static void __init initialize_cache_info(void)
        DBG(" <- initialize_cache_info()\n");
 }
 
-static void __init check_for_initrd(void)
-{
-#ifdef CONFIG_BLK_DEV_INITRD
-       u64 *prop;
-
-       DBG(" -> check_for_initrd()\n");
-
-       if (of_chosen) {
-               prop = (u64 *)get_property(of_chosen,
-                               "linux,initrd-start", NULL);
-               if (prop != NULL) {
-                       initrd_start = (unsigned long)__va(*prop);
-                       prop = (u64 *)get_property(of_chosen,
-                                       "linux,initrd-end", NULL);
-                       if (prop != NULL) {
-                               initrd_end = (unsigned long)__va(*prop);
-                               initrd_below_start_ok = 1;
-                       } else
-                               initrd_start = 0;
-               }
-       }
-
-       /* If we were passed an initrd, set the ROOT_DEV properly if the values
-        * look sensible. If not, clear initrd reference.
-        */
-       if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE &&
-           initrd_end > initrd_start)
-               ROOT_DEV = Root_RAM0;
-       else
-               initrd_start = initrd_end = 0;
-
-       if (initrd_start)
-               printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
-
-       DBG(" <- check_for_initrd()\n");
-#endif /* CONFIG_BLK_DEV_INITRD */
-}
 
 /*
  * Do some initial setup of the system.  The parameters are those which