fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / m68k / kernel / setup.c
index 2ede412..9af3ee0 100644 (file)
@@ -8,7 +8,6 @@
  * This file handles the architecture-dependent parts of system setup
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 
 unsigned long m68k_machtype;
 unsigned long m68k_cputype;
+EXPORT_SYMBOL(m68k_machtype);
+EXPORT_SYMBOL(m68k_cputype);
 unsigned long m68k_fputype;
 unsigned long m68k_mmutype;
 #ifdef CONFIG_VME
 unsigned long vme_brdtype;
+EXPORT_SYMBOL(vme_brdtype);
 #endif
 
 int m68k_is040or060;
+EXPORT_SYMBOL(m68k_is040or060);
 
 extern int end;
 extern unsigned long availmem;
 
 int 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;
 
 static char m68k_command_line[CL_SIZE];
-char saved_command_line[CL_SIZE];
 
 char m68k_debug_device[6] = "";
+EXPORT_SYMBOL(m68k_debug_device);
 
-void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *)) __initdata = NULL;
+void (*mach_sched_init) (irq_handler_t handler) __initdata = NULL;
 /* machine dependent irq functions */
 void (*mach_init_IRQ) (void) __initdata = NULL;
-irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
 void (*mach_get_model) (char *model);
 int (*mach_get_hardware_list) (char *buffer);
-int (*mach_get_irq_list) (struct seq_file *, void *);
-irqreturn_t (*mach_process_int) (int, struct pt_regs *);
 /* machine dependent timer functions */
 unsigned long (*mach_gettimeoffset) (void);
 int (*mach_hwclk) (int, struct rtc_time*);
+EXPORT_SYMBOL(mach_hwclk);
 int (*mach_set_clock_mmss) (unsigned long);
 unsigned int (*mach_get_ss)(void);
 int (*mach_get_rtc_pll)(struct rtc_pll_info *);
 int (*mach_set_rtc_pll)(struct rtc_pll_info *);
+EXPORT_SYMBOL(mach_get_ss);
+EXPORT_SYMBOL(mach_get_rtc_pll);
+EXPORT_SYMBOL(mach_set_rtc_pll);
 void (*mach_reset)( void );
 void (*mach_halt)( void );
 void (*mach_power_off)( void );
 long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
-#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY)
-void (*mach_floppy_setup) (char *, int *) __initdata = NULL;
-#endif
 #ifdef CONFIG_HEARTBEAT
 void (*mach_heartbeat) (int);
 EXPORT_SYMBOL(mach_heartbeat);
@@ -97,10 +103,13 @@ void (*mach_l2_flush) (int);
 #endif
 #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
 void (*mach_beep)(unsigned int, unsigned int);
+EXPORT_SYMBOL(mach_beep);
 #endif
 #if defined(CONFIG_ISA) && defined(MULTI_ISA)
 int isa_type;
 int isa_sex;
+EXPORT_SYMBOL(isa_type);
+EXPORT_SYMBOL(isa_sex);
 #endif
 
 extern int amiga_parse_bootinfo(const struct bi_record *);
@@ -110,6 +119,7 @@ extern int q40_parse_bootinfo(const struct bi_record *);
 extern int bvme6000_parse_bootinfo(const struct bi_record *);
 extern int mvme16x_parse_bootinfo(const struct bi_record *);
 extern int mvme147_parse_bootinfo(const struct bi_record *);
+extern int hp300_parse_bootinfo(const struct bi_record *);
 
 extern void config_amiga(void);
 extern void config_atari(void);
@@ -176,6 +186,8 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
                    unknown = mvme16x_parse_bootinfo(record);
                else if (MACH_IS_MVME147)
                    unknown = mvme147_parse_bootinfo(record);
+               else if (MACH_IS_HP300)
+                   unknown = hp300_parse_bootinfo(record);
                else
                    unknown = 1;
        }
@@ -205,20 +217,8 @@ void __init setup_arch(char **cmdline_p)
        int i;
        char *p, *q;
 
-       if (!MACH_IS_HP300) {
-               /* The bootinfo is located right after the kernel bss */
-               m68k_parse_bootinfo((const struct bi_record *)&_end);
-       } else {
-               /* FIXME HP300 doesn't use bootinfo yet */
-               extern unsigned long hp300_phys_ram_base;
-               unsigned long hp300_mem_size = 0xffffffff-hp300_phys_ram_base;
-               m68k_cputype = CPU_68030;
-               m68k_fputype = FPU_68882;
-               m68k_memory[0].addr = hp300_phys_ram_base;
-               /* 0.5M fudge factor */
-               m68k_memory[0].size = hp300_mem_size-512*1024;
-               m68k_num_memory++;
-       }
+       /* The bootinfo is located right after the kernel bss */
+       m68k_parse_bootinfo((const struct bi_record *)&_end);
 
        if (CPU_IS_040)
                m68k_is040or060 = 4;
@@ -238,6 +238,18 @@ void __init setup_arch(char **cmdline_p)
        }
 #endif
 
+       if (CPU_IS_060) {
+               u32 pcr;
+
+               asm (".chip 68060; movec %%pcr,%0; .chip 68k"
+                    : "=d" (pcr));
+               if (((pcr >> 8) & 0xff) <= 5) {
+                       printk("Enabling workaround for errata I14\n");
+                       asm (".chip 68060; movec %0,%%pcr; .chip 68k"
+                            : : "d" (pcr | 0x20));
+               }
+       }
+
        init_mm.start_code = PAGE_OFFSET;
        init_mm.end_code = (unsigned long) &_etext;
        init_mm.end_data = (unsigned long) &_edata;
@@ -278,6 +290,10 @@ void __init setup_arch(char **cmdline_p)
            }
        }
 
+#ifdef CONFIG_DUMMY_CONSOLE
+       conswitchp = &dummy_con;
+#endif
+
        switch (m68k_machtype) {
 #ifdef CONFIG_AMIGA
            case MACH_AMIGA:
@@ -341,7 +357,7 @@ void __init setup_arch(char **cmdline_p)
 #ifndef CONFIG_SUN3
        startmem= m68k_memory[0].addr;
        endmem = startmem + m68k_memory[0].size;
-       high_memory = PAGE_OFFSET;
+       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)
@@ -519,16 +535,6 @@ int get_hardware_list(char *buffer)
     return(len);
 }
 
-
-#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY)
-void __init floppy_setup(char *str, int *ints)
-{
-       if (mach_floppy_setup)
-               mach_floppy_setup (str, ints);
-}
-
-#endif
-
 void check_bugs(void)
 {
 #ifndef CONFIG_M68KFPU_EMU
@@ -539,7 +545,5 @@ void check_bugs(void)
                                "emulation project\n" );
                panic( "no FPU" );
        }
-
-#endif /* CONFIG_SUN3 */
-
+#endif /* !CONFIG_M68KFPU_EMU */
 }