Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m68knommu: fix clock rate value reported for ColdFire 54xx parts

The instruction timings of the ColdFire 54xx family parts are
different to other version 4 parts (or version 2 or 3 parts for
that matter too).

Move the instruction timing setting into the ColdFire part
specific headers, and set the 54xx value appropriately.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>

+34 -21
+2 -1
arch/m68k/include/asm/m5206sim.h
··· 12 12 #define m5206sim_h 13 13 /****************************************************************************/ 14 14 15 - #define CPU_NAME "COLDFIRE(m5206)" 15 + #define CPU_NAME "COLDFIRE(m5206)" 16 + #define CPU_INSTR_PER_JIFFY 3 16 17 17 18 /* 18 19 * Define the 5206 SIM register set addresses.
+2 -1
arch/m68k/include/asm/m520xsim.h
··· 11 11 #define m520xsim_h 12 12 /****************************************************************************/ 13 13 14 - #define CPU_NAME "COLDFIRE(m520x)" 14 + #define CPU_NAME "COLDFIRE(m520x)" 15 + #define CPU_INSTR_PER_JIFFY 3 15 16 16 17 /* 17 18 * Define the 520x SIM register set addresses.
+2 -1
arch/m68k/include/asm/m523xsim.h
··· 11 11 #define m523xsim_h 12 12 /****************************************************************************/ 13 13 14 - #define CPU_NAME "COLDFIRE(m523x)" 14 + #define CPU_NAME "COLDFIRE(m523x)" 15 + #define CPU_INSTR_PER_JIFFY 3 15 16 16 17 /* 17 18 * Define the 523x SIM register set addresses.
+2 -1
arch/m68k/include/asm/m5249sim.h
··· 11 11 #define m5249sim_h 12 12 /****************************************************************************/ 13 13 14 - #define CPU_NAME "COLDFIRE(m5249)" 14 + #define CPU_NAME "COLDFIRE(m5249)" 15 + #define CPU_INSTR_PER_JIFFY 3 15 16 16 17 /* 17 18 * Define the 5249 SIM register set addresses.
+2 -1
arch/m68k/include/asm/m5272sim.h
··· 12 12 #define m5272sim_h 13 13 /****************************************************************************/ 14 14 15 - #define CPU_NAME "COLDFIRE(m5272)" 15 + #define CPU_NAME "COLDFIRE(m5272)" 16 + #define CPU_INSTR_PER_JIFFY 3 16 17 17 18 /* 18 19 * Define the 5272 SIM register set addresses.
+2 -1
arch/m68k/include/asm/m527xsim.h
··· 11 11 #define m527xsim_h 12 12 /****************************************************************************/ 13 13 14 - #define CPU_NAME "COLDFIRE(m527x)" 14 + #define CPU_NAME "COLDFIRE(m527x)" 15 + #define CPU_INSTR_PER_JIFFY 3 15 16 16 17 17 18 /*
+2 -1
arch/m68k/include/asm/m528xsim.h
··· 11 11 #define m528xsim_h 12 12 /****************************************************************************/ 13 13 14 - #define CPU_NAME "COLDFIRE(m528x)" 14 + #define CPU_NAME "COLDFIRE(m528x)" 15 + #define CPU_INSTR_PER_JIFFY 3 15 16 16 17 /* 17 18 * Define the 5280/5282 SIM register set addresses.
+2 -1
arch/m68k/include/asm/m5307sim.h
··· 14 14 #define m5307sim_h 15 15 /****************************************************************************/ 16 16 17 - #define CPU_NAME "COLDFIRE(m5307)" 17 + #define CPU_NAME "COLDFIRE(m5307)" 18 + #define CPU_INSTR_PER_JIFFY 3 18 19 19 20 /* 20 21 * Define the 5307 SIM register set addresses.
+2 -1
arch/m68k/include/asm/m532xsim.h
··· 9 9 #define m532xsim_h 10 10 /****************************************************************************/ 11 11 12 - #define CPU_NAME "COLDFIRE(m532x)" 12 + #define CPU_NAME "COLDFIRE(m532x)" 13 + #define CPU_INSTR_PER_JIFFY 3 13 14 14 15 #define MCF_REG32(x) (*(volatile unsigned long *)(x)) 15 16 #define MCF_REG16(x) (*(volatile unsigned short *)(x))
+2 -1
arch/m68k/include/asm/m5407sim.h
··· 14 14 #define m5407sim_h 15 15 /****************************************************************************/ 16 16 17 - #define CPU_NAME "COLDFIRE(m5407)" 17 + #define CPU_NAME "COLDFIRE(m5407)" 18 + #define CPU_INSTR_PER_JIFFY 3 18 19 19 20 /* 20 21 * Define the 5407 SIM register set addresses.
+3 -2
arch/m68k/include/asm/m54xxsim.h
··· 5 5 #ifndef m54xxsim_h 6 6 #define m54xxsim_h 7 7 8 - #define CPU_NAME "COLDFIRE(m54xx)" 8 + #define CPU_NAME "COLDFIRE(m54xx)" 9 + #define CPU_INSTR_PER_JIFFY 2 9 10 10 - #define MCFINT_VECBASE 64 11 + #define MCFINT_VECBASE 64 11 12 12 13 /* 13 14 * Interrupt Controller Registers
+11 -9
arch/m68knommu/kernel/setup.c
··· 66 66 #ifdef CONFIG_M68360 67 67 #define CPU_NAME "MC68360" 68 68 #endif 69 - /* 70 - * The ColdFire CPU names are defined in their headers. 71 - */ 72 69 #ifndef CPU_NAME 73 70 #define CPU_NAME "UNKNOWN" 71 + #endif 72 + 73 + /* 74 + * Different cores have different instruction execution timings. 75 + * The old/traditional 68000 cores are basically all the same, at 16. 76 + * The ColdFire cores vary a little, their values are defined in their 77 + * headers. We default to the standard 68000 value here. 78 + */ 79 + #ifndef CPU_INSTR_PER_JIFFY 80 + #define CPU_INSTR_PER_JIFFY 16 74 81 #endif 75 82 76 83 extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end; ··· 280 273 cpu = CPU_NAME; 281 274 mmu = "none"; 282 275 fpu = "none"; 283 - 284 - #ifdef CONFIG_COLDFIRE 285 - clockfreq = (loops_per_jiffy * HZ) * 3; 286 - #else 287 - clockfreq = (loops_per_jiffy * HZ) * 16; 288 - #endif 276 + clockfreq = (loops_per_jiffy * HZ) * CPU_INSTR_PER_JIFFY; 289 277 290 278 seq_printf(m, "CPU:\t\t%s\n" 291 279 "MMU:\t\t%s\n"