]> rtime.felk.cvut.cz Git - mcf548x/linux.git/commitdiff
setup
authorMartin <meloumar@cmp.felk.cvut.cz>
Sun, 1 May 2011 13:19:01 +0000 (15:19 +0200)
committerMartin <meloumar@cmp.felk.cvut.cz>
Sun, 1 May 2011 13:19:01 +0000 (15:19 +0200)
arch/m68k/coldfire/config.c
arch/m68k/include/asm/setup.h
arch/m68k/kernel/setup.c

index ef2c4000d21e16c17860161b0ea144d05ee2db53..aac09391a04ca1bae09e4b2ca5be46bdde912c05 100644 (file)
@@ -458,3 +458,11 @@ void __init config_coldfire(void)
 #endif
 
 }
+
+//no special boot record
+int coldfire_parse_bootinfo(const struct bi_record *)
+{
+       return 1;
+}
+
+
index 4dfb3952b3753e02b8d0ec2b179ab3bb408ca437..bed5b186ac6a3b510b3954a00087ac356fdd900b 100644 (file)
@@ -189,6 +189,14 @@ extern unsigned long m68k_machtype;
 #  define MACH_TYPE (MACH_SUN3X)
 #endif
 
+#if !defined(CONFIG_COLDFIRE)
+#  define MACH_IS_COLDFIRE (0)
+#else
+#  define CONFIG_COLDFIRE_ONLY
+#  define MACH_IS_COLDFIRE (1)
+#  define MACH_TYPE (MACH_CFMMU)
+#endif
+
 #ifndef MACH_TYPE
 #  define MACH_TYPE (m68k_machtype)
 #endif
@@ -211,23 +219,31 @@ extern unsigned long m68k_machtype;
 #define CPUB_68030     1
 #define CPUB_68040     2
 #define CPUB_68060     3
+#define CPUB_CFV4E     4
 
 #define CPU_68020      (1<<CPUB_68020)
 #define CPU_68030      (1<<CPUB_68030)
 #define CPU_68040      (1<<CPUB_68040)
 #define CPU_68060      (1<<CPUB_68060)
+#define CPU_CFV4E      (1<<CPUB_CFV4E)
 
 #define FPUB_68881     0
 #define FPUB_68882     1
 #define FPUB_68040     2                       /* Internal FPU */
 #define FPUB_68060     3                       /* Internal FPU */
 #define FPUB_SUNFPA    4                       /* Sun-3 FPA */
+#define FPUB_CFV4E     5
 
 #define FPU_68881      (1<<FPUB_68881)
 #define FPU_68882      (1<<FPUB_68882)
 #define FPU_68040      (1<<FPUB_68040)
 #define FPU_68060      (1<<FPUB_68060)
 #define FPU_SUNFPA     (1<<FPUB_SUNFPA)
+#ifndef CONFIG_M5445X
+#define FPU_CFV4E      (1<<FPUB_CFV4E)                         /* No FPU on M5445X */
+#else
+#define FPU_CFV4E      0
+#endif
 
 #define MMUB_68851     0
 #define MMUB_68030     1                       /* Internal MMU */
@@ -235,6 +251,7 @@ extern unsigned long m68k_machtype;
 #define MMUB_68060     3                       /* Internal MMU */
 #define MMUB_APOLLO    4                       /* Custom Apollo */
 #define MMUB_SUN3      5                       /* Custom Sun-3 */
+#define MMUB_CFV4E     6
 
 #define MMU_68851      (1<<MMUB_68851)
 #define MMU_68030      (1<<MMUB_68030)
@@ -242,6 +259,7 @@ extern unsigned long m68k_machtype;
 #define MMU_68060      (1<<MMUB_68060)
 #define MMU_SUN3       (1<<MMUB_SUN3)
 #define MMU_APOLLO     (1<<MMUB_APOLLO)
+#define MMU_CFV4E      (1<<MMUB_CFV4E)
 
 #ifdef __KERNEL__
 
@@ -341,6 +359,14 @@ extern int m68k_is040or060;
 #  endif
 #endif
 
+#if !defined(CONFIG_CFV4E)
+#  define CPU_IS_COLDFIRE (0)
+#else
+#  define CPU_IS_COLDFIRE (1)
+#  define CPU_IS_CFV4E    (1)
+#  define MMU_IS_CFV4E    (1)
+#endif
+
 #define CPU_TYPE (m68k_cputype)
 
 #ifdef CONFIG_M68KFPU_EMU
index b3963ab3d1493fb7a443e2834744f1b9281ac37e..1e29fac369407cd0e4f07e28ba114a8ce62a6678 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:
@@ -170,8 +178,11 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
                        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 +204,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 +216,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 +337,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 +376,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 +418,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 +439,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 +457,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";