]> rtime.felk.cvut.cz Git - mcf548x/linux.git/blobdiff - arch/m68k/coldfire/config.c
Fixes (asm, entry, irq, linker, defconfig)
[mcf548x/linux.git] / arch / m68k / coldfire / config.c
index a3fcb59b7dc0366af19dd632f2d74b2dcf9f9f6b..8ddd42eadef2126f76f6ac29e7f6c5a45ef2e851 100644 (file)
 #include <asm/bootinfo.h>
 #include <asm/machdep.h>
 #include <asm/coldfire.h>
-//#include <asm/cfcache.h>
+#include <asm/mcfcache.h>
 #include <asm/cacheflush.h>
 #include <asm/io.h>
-//#include <asm/cfmmu.h>
+#include <asm/mcfmmu.h>
 #include <asm/setup.h>
 #include <asm/irq.h>
 #include <asm/traps.h>
 
 #include <asm/mcfsim.h>
 
-#ifdef CONFIG_UBOOT
-
-#if defined(CONFIG_M5445X)
-#define UBOOT_EXTRA_CLOCKS
-#elif defined(CONFIG_M547X_8X)
-#define UBOOT_PCI
-#endif
-
-#endif
-
 #include <asm/bootinfo.h>
 
 #ifdef CONFIG_M5445X
 #endif
 
 #ifdef CONFIG_M547X_8X
-#include <asm/m5485gpt.h>
+#include <asm/m548xgpt.h>
 #endif
 
 extern int get_irq_list(struct seq_file *p, void *v);
 extern char _text, _end;
 extern char _etext, _edata, __init_begin, __init_end;
 extern struct console mcfrs_console;
-extern char m68k_command_line[CL_SIZE];
 extern unsigned long availmem;
 
-static int irq_enable[NR_IRQS];
-unsigned long num_pages;
-
-/* ethernet mac addresses from uboot */
 #ifdef CONFIG_UBOOT
-unsigned char uboot_enet0[6];
-unsigned char uboot_enet1[6];
+extern char m68k_command_line[CL_SIZE];
+struct mem_info m68k_ramdisk;
 #endif
 
+static int irq_enable[NR_IRQS];
+unsigned long num_pages;
+
 void coldfire_sort_memrec(void)
 {
        int i, j;
@@ -105,38 +93,36 @@ void coldfire_sort_memrec(void)
 }
 
 /*
- * UBoot Handler
+ * Use uboot commandline if told to
  */
  #ifdef CONFIG_UBOOT
 int __init uboot_commandline(char *bootargs)
 {
+       extern unsigned long uboot_init_sp;
+       
        int len = 0, cmd_line_len;
-       static struct uboot_record uboot_info;
+       unsigned long cmd_line_stop, cmd_line_start;
+       unsigned long initrd_start, initrd_stop;
        u32 offset = PAGE_OFFSET_RAW - PHYS_OFFSET;
 
-       extern unsigned long uboot_info_stk;
+       //uboot_init_sp parameters - must add offset to them !!
+       cmd_line_start = uboot_init_sp + 16 + offset;
+       cmd_line_stop = uboot_init_sp + 20 + offset;
 
-       /* validate address */
-       if ((uboot_info_stk < PAGE_OFFSET_RAW) ||
-           (uboot_info_stk >= (PAGE_OFFSET_RAW + CONFIG_SDRAM_SIZE)))
-               return 0;
+       initrd_start = uboot_init_sp + 8 + offset;
+       
+       if ( *((unsigned long*)initrd_start) != 0)
+       {
+               initrd_stop = uboot_init_sp + 12 + offset;
 
-       /* Add offset to get post-remapped kernel memory location */
-       uboot_info.bdi = (struct bd_info *)((*(u32 *)(uboot_info_stk)) + offset);
-       uboot_info.initrd_start = (*(u32 *)(uboot_info_stk+4)) + offset;
-       uboot_info.initrd_end = (*(u32 *)(uboot_info_stk+8)) + offset;
-       uboot_info.cmd_line_start = (*(u32 *)(uboot_info_stk+12)) + offset;
-       uboot_info.cmd_line_stop = (*(u32 *)(uboot_info_stk+16)) + offset;
-
-       /* copy over mac addresses */
-       memcpy(uboot_enet0, uboot_info.bdi->bi_enet0addr, 6);
-       memcpy(uboot_enet1, uboot_info.bdi->bi_enet1addr, 6);
+               m68k_ramdisk.addr = initrd_start;
+               m68k_ramdisk.size = *((unsigned long*)initrd_stop) - *((unsigned long*)initrd_start);
+       }
 
        /* copy command line */
-       cmd_line_len = uboot_info.cmd_line_stop - uboot_info.cmd_line_start;
+       cmd_line_len = cmd_line_stop - cmd_line_start;
        if ((cmd_line_len > 0) && (cmd_line_len < CL_SIZE-1))
-               len = (int)strncpy(bootargs, (char *)uboot_info.cmd_line_start,\
-                                  cmd_line_len);
+               len = (int)strncpy(bootargs, (char *)cmd_line_start,cmd_line_len);
 
        return len;
 }
@@ -204,13 +190,9 @@ asmlinkage void __init cf_early_init(void)
        m68k_memory[m68k_num_memory].addr = CONFIG_SDRAM_BASE;
        m68k_memory[m68k_num_memory++].size = CONFIG_SDRAM_SIZE;
 
-
 #ifdef CONFIG_UBOOT
        if (!uboot_commandline(m68k_command_line))      
                strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE-1);
-#else
-       //FIXME: some better way here
-       strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE-1);
 #endif
 
 #if defined(CONFIG_BLK_DEV_INITRD)
@@ -262,7 +244,7 @@ void settimericr(unsigned int timer, unsigned int level)
 asmlinkage void buserr(void);
 asmlinkage void trap(void);
 asmlinkage void system_call(void);
-asmlinkage void inthandler(void);
+asmlinkage void auto_inthandler(void);
 
 void __init coldfire_trap_init(void)
 {
@@ -285,9 +267,9 @@ void __init coldfire_trap_init(void)
        for (i = 33; (i <= 63); i++)
                vectors[i] = trap;
        for (i = 24; (i <= 31); i++)
-               vectors[i] = inthandler;
+               vectors[i] = auto_inthandler;
        for (i = 64; (i < 255); i++)
-               vectors[i] = inthandler;
+               vectors[i] = auto_inthandler;
 
        vectors[255] = 0;
        vectors[2] = buserr;
@@ -398,7 +380,7 @@ void coldfire_reboot(void)
 
 static void coldfire_get_model(char *model)
 {
-       sprintf(model, "Version 4 ColdFire");
+       sprintf(model, "Version 4e ColdFire");
 }
 
 static void __init
@@ -478,3 +460,11 @@ void __init config_coldfire(void)
 #endif
 
 }
+
+//no special boot record
+int coldfire_parse_bootinfo(const struct bi_record * record)
+{
+       return 1;
+}
+
+