Introduce flags for reserve_bootmem()
[safe/jmp/linux-2.6] / arch / m68k / kernel / setup.c
index 852cefe..9a06c48 100644 (file)
@@ -58,22 +58,17 @@ extern int end;
 extern unsigned long availmem;
 
 int m68k_num_memory;
+EXPORT_SYMBOL(m68k_num_memory);
 int m68k_realnum_memory;
 EXPORT_SYMBOL(m68k_realnum_memory);
-#ifdef CONFIG_SINGLE_MEMORY_CHUNK
 unsigned long m68k_memoffset;
-EXPORT_SYMBOL(m68k_memoffset);
-#endif
 struct mem_info m68k_memory[NUM_MEMINFO];
 EXPORT_SYMBOL(m68k_memory);
 
-static struct mem_info m68k_ramdisk;
+struct mem_info m68k_ramdisk;
 
 static char m68k_command_line[CL_SIZE];
 
-char m68k_debug_device[6] = "";
-EXPORT_SYMBOL(m68k_debug_device);
-
 void (*mach_sched_init) (irq_handler_t handler) __initdata = NULL;
 /* machine dependent irq functions */
 void (*mach_init_IRQ) (void) __initdata = NULL;
@@ -204,18 +199,13 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
                       (m68k_num_memory - 1));
                m68k_num_memory = 1;
        }
-       m68k_memoffset = m68k_memory[0].addr-PAGE_OFFSET;
 #endif
 }
 
 void __init setup_arch(char **cmdline_p)
 {
        extern int _etext, _edata, _end;
-#ifndef CONFIG_SUN3
-       unsigned long endmem, startmem;
-#endif
        int i;
-       char *p, *q;
 
        /* The bootinfo is located right after the kernel bss */
        m68k_parse_bootinfo((const struct bi_record *)&_end);
@@ -258,40 +248,7 @@ void __init setup_arch(char **cmdline_p)
        *cmdline_p = m68k_command_line;
        memcpy(boot_command_line, *cmdline_p, CL_SIZE);
 
-       /* Parse the command line for arch-specific options.
-        * For the m68k, this is currently only "debug=xxx" to enable printing
-        * certain kernel messages to some machine-specific device.
-        */
-       for (p = *cmdline_p; p && *p;) {
-               i = 0;
-               if (!strncmp(p, "debug=", 6)) {
-                       strlcpy(m68k_debug_device, p+6, sizeof(m68k_debug_device));
-                       q = strchr(m68k_debug_device, ' ');
-                       if (q)
-                               *q = 0;
-                       i = 1;
-               }
-#ifdef CONFIG_ATARI
-               /* This option must be parsed very early */
-               if (!strncmp(p, "switches=", 9)) {
-                       extern void atari_switches_setup(const char *, int);
-                       q = strchr(p + 9, ' ');
-                       atari_switches_setup(p + 9, q ? (q - (p + 9)) : strlen(p + 9));
-                       i = 1;
-               }
-#endif
-
-               if (i) {
-                       /* option processed, delete it */
-                       if ((q = strchr(p, ' ')))
-                               strcpy(p, q + 1);
-                       else
-                               *p = 0;
-               } else {
-                       if ((p = strchr(p, ' ')))
-                               ++p;
-               }
-       }
+       parse_early_param();
 
 #ifdef CONFIG_DUMMY_CONSOLE
        conswitchp = &dummy_con;
@@ -357,30 +314,17 @@ void __init setup_arch(char **cmdline_p)
                panic("No configuration setup");
        }
 
-#ifndef CONFIG_SUN3
-       startmem= m68k_memory[0].addr;
-       endmem = startmem + m68k_memory[0].size;
-       high_memory = (void *)PAGE_OFFSET;
-       for (i = 0; i < m68k_num_memory; i++) {
-               m68k_memory[i].size &= MASK_256K;
-               if (m68k_memory[i].addr < startmem)
-                       startmem = m68k_memory[i].addr;
-               if (m68k_memory[i].addr+m68k_memory[i].size > endmem)
-                       endmem = m68k_memory[i].addr+m68k_memory[i].size;
-               high_memory += m68k_memory[i].size;
-       }
-
-       availmem += init_bootmem_node(NODE_DATA(0), availmem >> PAGE_SHIFT,
-                                     startmem >> PAGE_SHIFT, endmem >> PAGE_SHIFT);
-
-       for (i = 0; i < m68k_num_memory; i++)
-               free_bootmem(m68k_memory[i].addr, m68k_memory[i].size);
-
-       reserve_bootmem(m68k_memory[0].addr, availmem - m68k_memory[0].addr);
+       paging_init();
 
+#ifndef CONFIG_SUN3
+       for (i = 1; i < m68k_num_memory; i++)
+               free_bootmem_node(NODE_DATA(i), m68k_memory[i].addr,
+                                 m68k_memory[i].size);
 #ifdef CONFIG_BLK_DEV_INITRD
        if (m68k_ramdisk.size) {
-               reserve_bootmem(m68k_ramdisk.addr, m68k_ramdisk.size);
+               reserve_bootmem_node(__virt_to_node(phys_to_virt(m68k_ramdisk.addr)),
+                                    m68k_ramdisk.addr, m68k_ramdisk.size,
+                                    BOOTMEM_DEFAULT);
                initrd_start = (unsigned long)phys_to_virt(m68k_ramdisk.addr);
                initrd_end = initrd_start + m68k_ramdisk.size;
                printk("initrd: %08lx - %08lx\n", initrd_start, initrd_end);
@@ -399,8 +343,6 @@ void __init setup_arch(char **cmdline_p)
 
 #endif /* !CONFIG_SUN3 */
 
-       paging_init();
-
 /* set ISA defs early as possible */
 #if defined(CONFIG_ISA) && defined(MULTI_ISA)
 #if defined(CONFIG_Q40)
@@ -550,3 +492,13 @@ void check_bugs(void)
        }
 #endif /* !CONFIG_M68KFPU_EMU */
 }
+
+#ifdef CONFIG_ADB
+static int __init adb_probe_sync_enable (char *str) {
+       extern int __adb_probe_sync;
+       __adb_probe_sync = 1;
+       return 1;
+}
+
+__setup("adb_sync", adb_probe_sync_enable);
+#endif /* CONFIG_ADB */