]> rtime.felk.cvut.cz Git - mcf548x/linux.git/blobdiff - arch/m68k/kernel/setup.c
Current (FEC from 2.6.31 port, no CAN, no I2C, no PCI)
[mcf548x/linux.git] / arch / m68k / kernel / setup.c
index b3963ab3d1493fb7a443e2834744f1b9281ac37e..9e1b0e92dcce45a02169202941d600288bcac939 100644 (file)
@@ -75,7 +75,12 @@ EXPORT_SYMBOL(m68k_memory);
 
 struct mem_info m68k_ramdisk;
 
+//if there is uboot support, do it uboot way 
+#ifdef CONFIG_UBOOT
+char m68k_command_line[CL_SIZE];
+#else
 static char m68k_command_line[CL_SIZE];
+#endif
 
 void (*mach_sched_init) (irq_handler_t handler) __initdata = NULL;
 /* machine dependent irq functions */
@@ -124,6 +129,7 @@ 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 int apollo_parse_bootinfo(const struct bi_record *);
+extern int coldfire_parse_bootinfo(const struct bi_record *);
 
 extern void config_amiga(void);
 extern void config_atari(void);
@@ -136,6 +142,7 @@ extern void config_bvme6000(void);
 extern void config_hp300(void);
 extern void config_q40(void);
 extern void config_sun3x(void);
+extern void config_coldfire(void);
 
 #define MASK_256K 0xfffc0000
 
@@ -153,6 +160,7 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
                case BI_FPUTYPE:
                case BI_MMUTYPE:
                        /* Already set up by head.S */
+                       /* In case of Coldfire it's set up in config.c*/
                        break;
 
                case BI_MEMCHUNK:
@@ -165,13 +173,19 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
                        break;
 
                case BI_RAMDISK:
+//if U-boot then ignore
+#ifndef CONFIG_UBOOT
                        m68k_ramdisk.addr = data[0];
                        m68k_ramdisk.size = data[1];
+#endif
                        break;
 
                case BI_COMMAND_LINE:
+//if U-boot then ignore
+#ifndef CONFIG_UBOOT
                        strlcpy(m68k_command_line, (const char *)data,
                                sizeof(m68k_command_line));
+#endif
                        break;
 
                default:
@@ -193,7 +207,9 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
                                unknown = hp300_parse_bootinfo(record);
                        else if (MACH_IS_APOLLO)
                                unknown = apollo_parse_bootinfo(record);
-                       else
+                       else if (MACH_IS_COLDFIRE)
+                               unknown = coldfire_parse_bootinfo(record);
+                       else if
                                unknown = 1;
                }
                if (unknown)
@@ -203,6 +219,11 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
                                              record->size);
        }
 
+#ifdef CONFIG_COLDFIRE
+       if (MACH_IS_COLDFIRE)
+    coldfire_sort_memrec();
+#endif
+
        m68k_realnum_memory = m68k_num_memory;
 #ifdef CONFIG_SINGLE_MEMORY_CHUNK
        if (m68k_num_memory > 1) {
@@ -319,6 +340,11 @@ void __init setup_arch(char **cmdline_p)
        case MACH_SUN3X:
                config_sun3x();
                break;
+#endif
+#ifdef CONFIG_COLDFIRE
+       case MACH_COLDFIRE:
+               config_coldfire();
+               break;
 #endif
        default:
                panic("No configuration setup");
@@ -353,6 +379,11 @@ void __init setup_arch(char **cmdline_p)
 
 #endif /* !CONFIG_SUN3 */
 
+#ifdef CONFIG_COLDFIRE
+       if (MACH_IS_COLDFIRE)
+               mmu_context_init();
+#endif
+
 /* set ISA defs early as possible */
 #if defined(CONFIG_ISA) && defined(MULTI_ISA)
        if (MACH_IS_Q40) {
@@ -390,6 +421,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        } else if (CPU_IS_060) {
                cpu = "68060";
                clockfactor = LOOP_CYCLES_68060;
+       } else if (CPU_IS_CFV4E) {
+               cpu = "ColdFire V4e";
+               clockfactor = LOOP_CYCLES_COLDFIRE;
        } else {
                cpu = "680x0";
                clockfactor = 0;
@@ -408,6 +442,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                fpu = "68060";
        else if (m68k_fputype & FPU_SUNFPA)
                fpu = "Sun FPA";
+       else if (m68k_fputype & FPU_CFV4E)
+               fpu = "ColdFire V4e";
        else
                fpu = "none";
 #endif
@@ -424,6 +460,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                mmu = "Sun-3";
        else if (m68k_mmutype & MMU_APOLLO)
                mmu = "Apollo";
+       else if (m68k_mmutype & MMU_CFV4E)
+               mmu = "ColdFire";
        else
                mmu = "unknown";