diff mbox

[U-Boot,4/6] x86: tsc: Update comments and expand definitions in freq_desc_tables[]

Message ID 1501038725-20850-4-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit c6367748483049236d3ebdc389161f1ba472f266
Delegated to: Bin Meng
Headers show

Commit Message

Bin Meng July 26, 2017, 3:12 a.m. UTC
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>
---

 drivers/timer/tsc_timer.c | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

Comments

Simon Glass Aug. 1, 2017, 9:11 a.m. UTC | #1
On 25 July 2017 at 21:12, Bin Meng <bmeng.cn@gmail.com> wrote:
> 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>
> ---
>
>  drivers/timer/tsc_timer.c | 24 +++++++++---------------
>  1 file changed, 9 insertions(+), 15 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng Aug. 1, 2017, 12:21 p.m. UTC | #2
On Tue, Aug 1, 2017 at 5:11 PM, Simon Glass <sjg@chromium.org> wrote:
> On 25 July 2017 at 21:12, Bin Meng <bmeng.cn@gmail.com> wrote:
>> 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>
>> ---
>>
>>  drivers/timer/tsc_timer.c | 24 +++++++++---------------
>>  1 file changed, 9 insertions(+), 15 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86, thanks!
diff mbox

Patch

diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index bdbecac..3c1b745 100644
--- a/drivers/timer/tsc_timer.c
+++ b/drivers/timer/tsc_timer.c
@@ -18,12 +18,6 @@ 
 #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 */