]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/setup-common.c
[PATCH] powerpc: Merge signal.h
[karo-tx-linux.git] / arch / powerpc / kernel / setup-common.c
index d43fa8c0e5ac0861058b8800dafffb7fc63a8a5a..26bb1fe6384b4fd988c9a5476c446a7e9dcbcecb 100644 (file)
@@ -51,6 +51,7 @@
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/lmb.h>
+#include <asm/xmon.h>
 
 #undef DEBUG
 
@@ -405,6 +406,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
 
 /**
@@ -519,3 +560,23 @@ void __init smp_setup_cpu_maps(void)
 #endif /* CONFIG_PPC64 */
 }
 #endif /* CONFIG_SMP */
+
+#ifdef CONFIG_XMON
+static int __init early_xmon(char *p)
+{
+       /* ensure xmon is enabled */
+       if (p) {
+               if (strncmp(p, "on", 2) == 0)
+                       xmon_init(1);
+               if (strncmp(p, "off", 3) == 0)
+                       xmon_init(0);
+               if (strncmp(p, "early", 5) != 0)
+                       return 0;
+       }
+       xmon_init(1);
+       debugger(NULL);
+
+       return 0;
+}
+early_param("xmon", early_xmon);
+#endif