x86: tsc: Update comments and expand definitions in freq_desc_tables[]
authorBin Meng <bmeng.cn@gmail.com>
Wed, 26 Jul 2017 03:12:03 +0000 (20:12 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 1 Aug 2017 12:17:02 +0000 (20:17 +0800)
Some processor abbreviations in the comments of freq_desc_tables[]
are obscure. This updates part of these to mention processors
that are known to us. Also expand frequency definitions.

This keeps in sync with Linux kernel commit:
  9e0cae9: x86/tsc_msr: Update comments, expand definitions

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/timer/tsc_timer.c

index bdbecac..3c1b745 100644 (file)
 #include <asm/msr.h>
 #include <asm/u-boot-x86.h>
 
-/* CPU reference clock frequency: in KHz */
-#define FREQ_83                83200
-#define FREQ_100       99840
-#define FREQ_133       133200
-#define FREQ_166       166400
-
 #define MAX_NUM_FREQS  8
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -46,17 +40,17 @@ struct freq_desc {
 
 static struct freq_desc freq_desc_tables[] = {
        /* PNW */
-       { 6, 0x27, 0, { 0, 0, 0, 0, 0, FREQ_100, 0, FREQ_83 } },
+       { 6, 0x27, 0, { 0, 0, 0, 0, 0, 99840, 0, 83200 } },
        /* CLV+ */
-       { 6, 0x35, 0, { 0, FREQ_133, 0, 0, 0, FREQ_100, 0, FREQ_83 } },
-       /* TNG */
-       { 6, 0x4a, 1, { 0, FREQ_100, FREQ_133, 0, 0, 0, 0, 0 } },
-       /* VLV2 */
-       { 6, 0x37, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_166, 0, 0, 0, 0 } },
+       { 6, 0x35, 0, { 0, 133200, 0, 0, 0, 99840, 0, 83200 } },
+       /* TNG - Intel Atom processor Z3400 series */
+       { 6, 0x4a, 1, { 0, 99840, 133200, 0, 0, 0, 0, 0 } },
+       /* VLV2 - Intel Atom processor E3000, Z3600, Z3700 series */
+       { 6, 0x37, 1, { 83200, 99840, 133200, 166400, 0, 0, 0, 0 } },
+       /* ANN - Intel Atom processor Z3500 series */
+       { 6, 0x5a, 1, { 83200, 99840, 133200, 99840, 0, 0, 0, 0 } },
        /* Ivybridge */
        { 6, 0x3a, 2, { 0, 0, 0, 0, 0, 0, 0, 0 } },
-       /* ANN */
-       { 6, 0x5a, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_100, 0, 0, 0, 0 } },
 };
 
 static int match_cpu(u8 family, u8 model)
@@ -105,7 +99,7 @@ static unsigned long __maybe_unused try_msr_calibrate_tsc(void)
 
        if (freq_desc_tables[cpu_index].msr_plat == 2) {
                /* TODO: Figure out how best to deal with this */
-               freq = FREQ_100;
+               freq = 99840;
                debug("Using frequency: %u KHz\n", freq);
        } else {
                /* Get FSB FREQ ID */