Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[safe/jmp/linux-2.6] / arch / mips / kernel / setup.c
index d2e01e7..f8a535a 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/highmem.h>
 #include <linux/console.h>
 #include <linux/pfn.h>
+#include <linux/debugfs.h>
 
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
@@ -50,10 +51,8 @@ EXPORT_SYMBOL(PCI_DMA_BUS_IS_PHYS);
  * These are initialized so they are in the .data section
  */
 unsigned long mips_machtype __read_mostly = MACH_UNKNOWN;
-unsigned long mips_machgroup __read_mostly = MACH_GROUP_UNKNOWN;
 
 EXPORT_SYMBOL(mips_machtype);
-EXPORT_SYMBOL(mips_machgroup);
 
 struct boot_mem_map boot_mem_map;
 
@@ -343,6 +342,34 @@ static void __init bootmem_init(void)
         */
        bootmap_size = init_bootmem_node(NODE_DATA(0), mapstart,
                                         min_low_pfn, max_low_pfn);
+
+
+       for (i = 0; i < boot_mem_map.nr_map; i++) {
+               unsigned long start, end;
+
+               start = PFN_UP(boot_mem_map.map[i].addr);
+               end = PFN_DOWN(boot_mem_map.map[i].addr
+                               + boot_mem_map.map[i].size);
+
+               if (start <= min_low_pfn)
+                       start = min_low_pfn;
+               if (start >= end)
+                       continue;
+
+#ifndef CONFIG_HIGHMEM
+               if (end > max_low_pfn)
+                       end = max_low_pfn;
+
+               /*
+                * ... finally, is the area going away?
+                */
+               if (end <= start)
+                       continue;
+#endif
+
+               add_active_range(0, start, end);
+       }
+
        /*
         * Register fully available low RAM pages with the bootmem allocator.
         */
@@ -452,7 +479,7 @@ static void __init arch_mem_init(char **cmdline_p)
        print_memory_map();
 
        strlcpy(command_line, arcs_cmdline, sizeof(command_line));
-       strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
+       strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
 
        *cmdline_p = command_line;
 
@@ -525,6 +552,14 @@ void __init setup_arch(char **cmdline_p)
 {
        cpu_probe();
        prom_init();
+
+#ifdef CONFIG_EARLY_PRINTK
+       {
+               extern void setup_early_printk(void);
+
+               setup_early_printk();
+       }
+#endif
        cpu_report();
 
 #if defined(CONFIG_VT)
@@ -543,7 +578,7 @@ void __init setup_arch(char **cmdline_p)
 #endif
 }
 
-int __init fpu_disable(char *s)
+static int __init fpu_disable(char *s)
 {
        int i;
 
@@ -555,7 +590,7 @@ int __init fpu_disable(char *s)
 
 __setup("nofpu", fpu_disable);
 
-int __init dsp_disable(char *s)
+static int __init dsp_disable(char *s)
 {
        cpu_data[0].ases &= ~MIPS_ASE_DSP;
 
@@ -566,3 +601,18 @@ __setup("nodsp", dsp_disable);
 
 unsigned long kernelsp[NR_CPUS];
 unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
+
+#ifdef CONFIG_DEBUG_FS
+struct dentry *mips_debugfs_dir;
+static int __init debugfs_mips(void)
+{
+       struct dentry *d;
+
+       d = debugfs_create_dir("mips", NULL);
+       if (IS_ERR(d))
+               return PTR_ERR(d);
+       mips_debugfs_dir = d;
+       return 0;
+}
+arch_initcall(debugfs_mips);
+#endif