[PATCH 02/11] m68k: allow CPU name to be modified at runtime

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Modify the setup code so that the CPU name is not just a hard define.
Some supported ColdFire CPUs have run-time detectable variants that
mean it is possible to display the real actual sub-variant instead of a
generic name.

While we are adding this support also support a run time detectable
CPU revision. Where we can find that display it as well.

Signed-off-by: Greg Ungerer <gerg@xxxxxxxxxxxxxx>
---
 arch/m68k/include/asm/setup.h |  2 ++
 arch/m68k/kernel/setup_mm.c   |  4 +++-
 arch/m68k/kernel/setup_no.c   | 21 +++++++++++++++++----
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/arch/m68k/include/asm/setup.h b/arch/m68k/include/asm/setup.h
index 2c99477aaf89..8fdbc0b00bae 100644
--- a/arch/m68k/include/asm/setup.h
+++ b/arch/m68k/include/asm/setup.h
@@ -206,6 +206,8 @@ extern unsigned long m68k_mmutype;
 #ifdef CONFIG_VME
 extern unsigned long vme_brdtype;
 #endif
+extern char *m68k_cpuname;
+extern unsigned long m68k_cpurevision;
 
     /*
      *  m68k_is040or060 is != 0 for a '040 or higher;
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index 10310b04f77d..1c228c3d5640 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -66,6 +66,8 @@ EXPORT_SYMBOL(m68k_mmutype);
 unsigned long vme_brdtype;
 EXPORT_SYMBOL(vme_brdtype);
 #endif
+char *m68k_cpuname;
+unsigned long m68k_cpurevision;
 
 int m68k_is040or060;
 EXPORT_SYMBOL(m68k_is040or060);
@@ -395,7 +397,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 		cpu = "68060";
 		clockfactor = LOOP_CYCLES_68060;
 	} else if (CPU_IS_COLDFIRE) {
-		cpu = "ColdFire";
+		cpu = (m68k_cpuname) ? m68k_cpuname : "coldfire";
 		clockfactor = LOOP_CYCLES_COLDFIRE;
 	} else {
 		cpu = "680x0";
diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c
index 3e8ef6eb894c..552e85a2370c 100644
--- a/arch/m68k/kernel/setup_no.c
+++ b/arch/m68k/kernel/setup_no.c
@@ -66,10 +66,18 @@ void (*mach_halt)(void);
 #define CPU_NAME	"68000"
 #endif
 #endif /* CONFIG_M68000 */
+#ifdef CONFIG_COLDFIRE
+#define CPU_FAMILY	"coldfire"
+#else
+#define CPU_FAMILY	"classic"
+#endif
 #ifndef CPU_NAME
 #define CPU_NAME	"unknown"
 #endif
 
+char *m68k_cpuname = CPU_NAME;
+unsigned long m68k_cpurevision;
+
 /*
  * Different cores have different instruction execution timings.
  * The old/traditional 68000 cores are basically all the same, at 16.
@@ -82,6 +90,8 @@ void (*mach_halt)(void);
 
 void __init setup_arch(char **cmdline_p)
 {
+	char revstr[32];
+
 	memory_start = PAGE_ALIGN(_ramstart);
 	memory_end = _ramend;
 
@@ -95,7 +105,9 @@ void __init setup_arch(char **cmdline_p)
 
 	process_uboot_commandline(&command_line[0], sizeof(command_line));
 
-	pr_info("uClinux with CPU " CPU_NAME "\n");
+	if (m68k_cpurevision)
+		sprintf(revstr, "revision=%ld", m68k_cpurevision);
+	pr_info("CPU: %s (%s,noMMU) %s\n", m68k_cpuname, CPU_FAMILY, revstr);
 
 #ifdef CONFIG_UCDIMM
 	pr_info("uCdimm by Lineo, Inc. <www.lineo.com>\n");
@@ -173,21 +185,22 @@ void __init setup_arch(char **cmdline_p)
  */
 static int show_cpuinfo(struct seq_file *m, void *v)
 {
-	char *cpu, *mmu, *fpu;
+	char *mmu, *fpu;
 	u_long clockfreq;
 
-	cpu = CPU_NAME;
 	mmu = "none";
 	fpu = "none";
 	clockfreq = (loops_per_jiffy * HZ) * CPU_INSTR_PER_JIFFY;
 
 	seq_printf(m, "CPU:\t\t%s\n"
+		      "Type:\t\t%s\n"
 		      "MMU:\t\t%s\n"
 		      "FPU:\t\t%s\n"
+		      "Revision:\t%ld\n"
 		      "Clocking:\t%lu.%1luMHz\n"
 		      "BogoMips:\t%lu.%02lu\n"
 		      "Calibration:\t%lu loops\n",
-		      cpu, mmu, fpu,
+		      m68k_cpuname, CPU_FAMILY, mmu, fpu, m68k_cpurevision,
 		      clockfreq / 1000000,
 		      (clockfreq / 100000) % 10,
 		      (loops_per_jiffy * HZ) / 500000,
-- 
2.25.1




[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux