Imported Upstream version 1.30
[platform/upstream/x86info.git] / AMD / bugs.c
1 /*
2  *  (C) 2002 Dave Jones.
3  *
4  *  Licensed under the terms of the GNU GPL License version 2.
5  *
6  *  AMD-specific errata information
7  */
8
9 #include <stdio.h>
10 #include <unistd.h>
11 #include <sys/types.h>
12 #include "../x86info.h"
13 #include "AMD.h"
14
15 static void show_k7_bugs(struct cpudata *cpu)
16 {
17         unsigned long long val;
18
19         /* As per 27212 0.2 - Some newer athlons are more robust with
20            CLK_CTL reprogrammed to 0x20000000 instead of 0x60000000 */
21         if (tuple(cpu) > 0x681) {
22                 if (read_msr (cpu->number, MSR_CLKCTL, &val) == 1) {
23                         if ((val & 0xfff00000) != 0x20000000) {
24                                 printf("CLK_CTL is programmed to %08llx, instead of %08llx\n",
25                                                 val, ((val&~0xfff00000)|0x20000000));
26                         }
27                 }
28         }
29 }
30
31 void show_amd_bugs(struct cpudata *cpu)
32 {
33         switch (cpu->family) {
34         /* Athlons. */
35         case 6:
36                 show_k7_bugs(cpu);
37                 break;
38
39         default:
40                 break;
41         }
42 }
43