analog changes for the cpu_driver structures...
[coreboot.git] / src / cpu / amd / model_fxx / model_fxx_init.c
1 /* Needed so the AMD K8 runs correctly.  */
2 /* this should be done by Eric
3  * 2004.11 yhlu add d0 e0 support
4  * 2004.12 yhlu add dual core support
5  * 2005.02 yhlu add e0 memory hole support
6
7  * Copyright 2005 AMD
8  * 2005.08 yhlu add microcode support 
9 */
10 #include <console/console.h>
11 #include <cpu/x86/msr.h>
12 #include <cpu/amd/mtrr.h>
13 #include <device/device.h>
14 #include <device/pci.h>
15 #include <string.h>
16 #include <cpu/x86/msr.h>
17 #include <cpu/x86/pae.h>
18 #include <pc80/mc146818rtc.h>
19 #include <cpu/x86/lapic.h>
20
21 #include "../../../northbridge/amd/amdk8/amdk8.h"
22
23 #include <cpu/amd/model_fxx_rev.h>
24 #include <cpu/cpu.h>
25 #include <cpu/x86/cache.h>
26 #include <cpu/x86/mtrr.h>
27 #include <cpu/x86/mem.h>
28
29 #include <cpu/amd/dualcore.h>
30
31 #include <cpu/amd/model_fxx_msr.h>
32
33 void cpus_ready_for_init(void)
34 {
35 #if MEM_TRAIN_SEQ == 1
36         struct sys_info *sysinfox = (struct sys_info *)((CONFIG_LB_MEM_TOPK<<10) - DCACHE_RAM_GLOBAL_VAR_SIZE);
37         // wait for ap memory to trained
38         wait_all_core0_mem_trained(sysinfox);
39 #endif
40 }
41
42
43 #if K8_REV_F_SUPPORT == 0
44 int is_e0_later_in_bsp(int nodeid)
45 {
46         uint32_t val;
47         uint32_t val_old;
48         int e0_later;
49         if(nodeid==0) { // we don't need to do that for node 0 in core0/node0
50                 return !is_cpu_pre_e0();
51         }
52         // d0 will be treated as e0 with this methods, but the d0 nb_cfg_54 always 0
53         device_t dev;
54         dev = dev_find_slot(0, PCI_DEVFN(0x18+nodeid,2));
55         if(!dev) return 0;
56         val_old = pci_read_config32(dev, 0x80);
57         val = val_old;
58         val |= (1<<3);
59         pci_write_config32(dev, 0x80, val);
60         val = pci_read_config32(dev, 0x80);
61         e0_later = !!(val & (1<<3));
62         if(e0_later) { // pre_e0 bit 3 always be 0 and can not be changed
63                 pci_write_config32(dev, 0x80, val_old); // restore it
64         }
65
66         return e0_later;
67 }
68 #endif
69
70 #if K8_REV_F_SUPPORT == 1
71 int is_cpu_f0_in_bsp(int nodeid)
72 {
73         uint32_t dword;
74         device_t dev;
75         dev = dev_find_slot(0, PCI_DEVFN(0x18+nodeid, 3));
76         dword = pci_read_config32(dev, 0xfc);
77         return (dword & 0xfff00) == 0x40f00;
78 }
79 #endif
80
81 #define MCI_STATUS 0x401
82
83 static inline msr_t rdmsr_amd(unsigned index)
84 {
85         msr_t result;
86         __asm__ __volatile__ (
87                 "rdmsr"
88                 : "=a" (result.lo), "=d" (result.hi)
89                 : "c" (index), "D" (0x9c5a203a)
90                 );
91         return result;
92 }
93
94 static inline void wrmsr_amd(unsigned index, msr_t msr)
95 {
96         __asm__ __volatile__ (
97                 "wrmsr"
98                 : /* No outputs */
99                 : "c" (index), "a" (msr.lo), "d" (msr.hi), "D" (0x9c5a203a)
100                 );
101 }
102
103
104 #define MTRR_COUNT 8
105 #define ZERO_CHUNK_KB 0x800UL /* 2M */
106 #define TOLM_KB 0x400000UL
107
108 struct mtrr {
109         msr_t base;
110         msr_t mask;
111 };
112 struct mtrr_state {
113         struct mtrr mtrrs[MTRR_COUNT];
114         msr_t top_mem, top_mem2;
115         msr_t def_type;
116 };
117
118 static void save_mtrr_state(struct mtrr_state *state)
119 {
120         int i;
121         for(i = 0; i < MTRR_COUNT; i++) {
122                 state->mtrrs[i].base = rdmsr(MTRRphysBase_MSR(i));
123                 state->mtrrs[i].mask = rdmsr(MTRRphysMask_MSR(i));
124         }
125         state->top_mem  = rdmsr(TOP_MEM);
126         state->top_mem2 = rdmsr(TOP_MEM2);
127         state->def_type = rdmsr(MTRRdefType_MSR);
128 }
129
130 static void restore_mtrr_state(struct mtrr_state *state)
131 {
132         int i;
133         disable_cache();
134
135         for(i = 0; i < MTRR_COUNT; i++) {
136                 wrmsr(MTRRphysBase_MSR(i), state->mtrrs[i].base);
137                 wrmsr(MTRRphysMask_MSR(i), state->mtrrs[i].mask);
138         }
139         wrmsr(TOP_MEM,         state->top_mem);
140         wrmsr(TOP_MEM2,        state->top_mem2);
141         wrmsr(MTRRdefType_MSR, state->def_type);
142
143         enable_cache();
144 }
145
146
147 #if 0
148 static void print_mtrr_state(struct mtrr_state *state)
149 {
150         int i;
151         for(i = 0; i < MTRR_COUNT; i++) {
152                 printk_debug("var mtrr %d: %08x%08x mask: %08x%08x\n",
153                         i,
154                         state->mtrrs[i].base.hi, state->mtrrs[i].base.lo,
155                         state->mtrrs[i].mask.hi, state->mtrrs[i].mask.lo);
156         }
157         printk_debug("top_mem:  %08x%08x\n",
158                 state->top_mem.hi, state->top_mem.lo);
159         printk_debug("top_mem2: %08x%08x\n",
160                 state->top_mem2.hi, state->top_mem2.lo);
161         printk_debug("def_type: %08x%08x\n",
162                 state->def_type.hi, state->def_type.lo);
163 }
164 #endif
165
166 static void set_init_ecc_mtrrs(void)
167 {
168         msr_t msr;
169         int i;
170         disable_cache();
171
172         /* First clear all of the msrs to be safe */
173         for(i = 0; i < MTRR_COUNT; i++) {
174                 msr_t zero;
175                 zero.lo = zero.hi = 0;
176                 wrmsr(MTRRphysBase_MSR(i), zero);
177                 wrmsr(MTRRphysMask_MSR(i), zero);
178         }
179
180         /* Write back cache the first 1MB */
181         msr.hi = 0x00000000;
182         msr.lo = 0x00000000 | MTRR_TYPE_WRBACK;
183         wrmsr(MTRRphysBase_MSR(0), msr);
184         msr.hi = 0x000000ff;
185         msr.lo = ~((CONFIG_LB_MEM_TOPK << 10) - 1) | 0x800;
186         wrmsr(MTRRphysMask_MSR(0), msr);
187
188         /* Set the default type to write combining */
189         msr.hi = 0x00000000;
190         msr.lo = 0xc00 | MTRR_TYPE_WRCOMB;
191         wrmsr(MTRRdefType_MSR, msr);
192
193         /* Set TOP_MEM to 4G */
194         msr.hi = 0x00000001;
195         msr.lo = 0x00000000;
196         wrmsr(TOP_MEM, msr);
197
198         enable_cache();
199 }
200
201 static inline void clear_2M_ram(unsigned long basek, struct mtrr_state *mtrr_state) 
202 {
203                 unsigned long limitk;
204                 unsigned long size;
205                 void *addr;
206
207                 /* Report every 64M */
208                 if ((basek % (64*1024)) == 0) {
209
210                         /* Restore the normal state */
211                         map_2M_page(0);
212                         restore_mtrr_state(mtrr_state);
213                         enable_lapic();
214
215                         /* Print a status message */
216                         printk_debug("%c", (basek >= TOLM_KB)?'+':'-');
217
218                         /* Return to the initialization state */
219                         set_init_ecc_mtrrs();
220                         disable_lapic();
221
222                 }
223
224                 limitk = (basek + ZERO_CHUNK_KB) & ~(ZERO_CHUNK_KB - 1);
225 #if 0
226                 /* couldn't happen, memory must on 2M boundary */
227                 if(limitk>endk) {
228                         limitk = enk; 
229                 }
230 #endif
231                 size = (limitk - basek) << 10;
232                 addr = map_2M_page(basek >> 11);
233                 if (addr == MAPPING_ERROR) {
234                         printk_err("Cannot map page: %x\n", basek >> 11);
235                         return;
236                 }
237
238                 /* clear memory 2M (limitk - basek) */
239                 addr = (void *)(((uint32_t)addr) | ((basek & 0x7ff) << 10));
240                 clear_memory(addr, size);
241 }
242
243 static void init_ecc_memory(unsigned node_id)
244 {
245         unsigned long startk, begink, endk;
246         unsigned long hole_startk = 0;
247         unsigned long basek;
248         struct mtrr_state mtrr_state;
249
250         device_t f1_dev, f2_dev, f3_dev;
251         int enable_scrubbing;
252         uint32_t dcl;
253
254         f1_dev = dev_find_slot(0, PCI_DEVFN(0x18 + node_id, 1));
255         if (!f1_dev) {
256                 die("Cannot find cpu function 1\n");
257         }
258         f2_dev = dev_find_slot(0, PCI_DEVFN(0x18 + node_id, 2));
259         if (!f2_dev) {
260                 die("Cannot find cpu function 2\n");
261         }
262         f3_dev = dev_find_slot(0, PCI_DEVFN(0x18 + node_id, 3));
263         if (!f3_dev) {
264                 die("Cannot find cpu function 3\n");
265         }
266
267         /* See if we scrubbing should be enabled */
268         enable_scrubbing = 1;
269         get_option(&enable_scrubbing, "hw_scrubber");
270
271         /* Enable cache scrubbing at the lowest possible rate */
272         if (enable_scrubbing) {
273                 pci_write_config32(f3_dev, SCRUB_CONTROL,
274                         (SCRUB_84ms << 16) | (SCRUB_84ms << 8) | (SCRUB_NONE << 0));
275         } else {
276                 pci_write_config32(f3_dev, SCRUB_CONTROL,
277                         (SCRUB_NONE << 16) | (SCRUB_NONE << 8) | (SCRUB_NONE << 0));
278                 printk_debug("Scrubbing Disabled\n");
279         }
280         
281
282         /* If ecc support is not enabled don't touch memory */
283         dcl = pci_read_config32(f2_dev, DRAM_CONFIG_LOW);
284         if (!(dcl & DCL_DimmEccEn)) {
285                 printk_debug("ECC Disabled\n");
286                 return;
287         }
288
289         startk = (pci_read_config32(f1_dev, 0x40 + (node_id*8)) & 0xffff0000) >> 2;
290         endk   = ((pci_read_config32(f1_dev, 0x44 + (node_id*8)) & 0xffff0000) >> 2) + 0x4000;
291
292 #if HW_MEM_HOLE_SIZEK != 0
293         #if K8_REV_F_SUPPORT == 0
294         if (!is_cpu_pre_e0()) 
295         {
296         #endif
297
298                 uint32_t val;
299                 val = pci_read_config32(f1_dev, 0xf0);
300                 if(val & 1) {
301                         hole_startk = ((val & (0xff<<24)) >> 10);
302                 }
303         #if K8_REV_F_SUPPORT == 0
304         }
305         #endif
306 #endif
307         
308
309         /* Don't start too early */
310         begink = startk;
311         if (begink < CONFIG_LB_MEM_TOPK) { 
312                 begink = CONFIG_LB_MEM_TOPK;
313         }
314
315         printk_debug("Clearing memory %uK - %uK: ", begink, endk);
316
317         /* Save the normal state */
318         save_mtrr_state(&mtrr_state);
319
320         /* Switch to the init ecc state */
321         set_init_ecc_mtrrs();
322         disable_lapic();
323
324         /* Walk through 2M chunks and zero them */
325 #if HW_MEM_HOLE_SIZEK != 0
326         /* here hole_startk can not be equal to begink, never. Also hole_startk is in 2M boundary, 64M? */
327         if ( (hole_startk != 0) && ((begink < hole_startk) && (endk>(4*1024*1024)))) {
328                         for(basek = begink; basek < hole_startk;
329                                 basek = ((basek + ZERO_CHUNK_KB) & ~(ZERO_CHUNK_KB - 1)))
330                         {
331                                 clear_2M_ram(basek, &mtrr_state);
332                         }
333                         for(basek = 4*1024*1024; basek < endk;
334                                 basek = ((basek + ZERO_CHUNK_KB) & ~(ZERO_CHUNK_KB - 1)))
335                         {
336                                 clear_2M_ram(basek, &mtrr_state);
337                         }
338         }
339         else 
340 #endif
341         for(basek = begink; basek < endk;
342                 basek = ((basek + ZERO_CHUNK_KB) & ~(ZERO_CHUNK_KB - 1))) 
343         {
344                 clear_2M_ram(basek, &mtrr_state);
345         }
346
347
348         /* Restore the normal state */
349         map_2M_page(0);
350         restore_mtrr_state(&mtrr_state);
351         enable_lapic();
352
353         /* Set the scrub base address registers */
354         pci_write_config32(f3_dev, SCRUB_ADDR_LOW,  startk << 10);
355         pci_write_config32(f3_dev, SCRUB_ADDR_HIGH, startk >> 22);
356
357         /* Enable the scrubber? */
358         if (enable_scrubbing) {
359                 /* Enable scrubbing at the lowest possible rate */
360                 pci_write_config32(f3_dev, SCRUB_CONTROL,
361                         (SCRUB_84ms << 16) | (SCRUB_84ms << 8) | (SCRUB_84ms << 0));
362         }
363
364         printk_debug(" done\n");
365 }
366
367
368 static inline void k8_errata(void)
369 {
370         msr_t msr;
371 #if K8_REV_F_SUPPORT == 0
372         if (is_cpu_pre_c0()) {
373                 /* Erratum 63... */
374                 msr = rdmsr(HWCR_MSR);
375                 msr.lo |= (1 << 6);
376                 wrmsr(HWCR_MSR, msr);
377
378                 /* Erratum 69... */
379                 msr = rdmsr_amd(BU_CFG_MSR);
380                 msr.hi |= (1 << (45 - 32));
381                 wrmsr_amd(BU_CFG_MSR, msr);
382
383                 /* Erratum 81... */
384                 msr = rdmsr_amd(DC_CFG_MSR);
385                 msr.lo |=  (1 << 10);
386                 wrmsr_amd(DC_CFG_MSR, msr);
387                         
388         }
389         /* I can't touch this msr on early buggy cpus */
390         if (!is_cpu_pre_b3()) {
391
392                 /* Erratum 89 ... */
393                 msr = rdmsr(NB_CFG_MSR);
394                 msr.lo |= 1 << 3;
395                 
396                 if (!is_cpu_pre_c0() && is_cpu_pre_d0()) {
397                         /* D0 later don't need it */
398                         /* Erratum 86 Disable data masking on C0 and 
399                          * later processor revs.
400                          * FIXME this is only needed if ECC is enabled.
401                          */
402                         msr.hi |= 1 << (36 - 32);
403                 }
404                 wrmsr(NB_CFG_MSR, msr);
405         }
406         
407         /* Erratum 97 ... */
408         if (!is_cpu_pre_c0() && is_cpu_pre_d0()) {
409                 msr = rdmsr_amd(DC_CFG_MSR);
410                 msr.lo |= 1 << 3;
411                 wrmsr_amd(DC_CFG_MSR, msr);
412         }       
413         
414         /* Erratum 94 ... */
415         if (is_cpu_pre_d0()) {
416                 msr = rdmsr_amd(IC_CFG_MSR);
417                 msr.lo |= 1 << 11;
418                 wrmsr_amd(IC_CFG_MSR, msr);
419         }
420
421         /* Erratum 91 prefetch miss is handled in the kernel */
422
423         /* Erratum 106 ... */
424         msr = rdmsr_amd(LS_CFG_MSR);
425         msr.lo |= 1 << 25;
426         wrmsr_amd(LS_CFG_MSR, msr);
427
428         /* Erratum 107 ... */
429         msr = rdmsr_amd(BU_CFG_MSR);
430         msr.hi |= 1 << (43 - 32);
431         wrmsr_amd(BU_CFG_MSR, msr);
432
433         if(is_cpu_d0()) {
434                 /* Erratum 110 ...*/
435                 msr = rdmsr_amd(CPU_ID_HYPER_EXT_FEATURES);
436                 msr.hi |=1;
437                 wrmsr_amd(CPU_ID_HYPER_EXT_FEATURES, msr);
438         }
439 #endif
440
441 #if K8_REV_F_SUPPORT == 0
442         if (!is_cpu_pre_e0()) 
443 #endif
444         {
445                 /* Erratum 110 ... */
446                 msr = rdmsr_amd(CPU_ID_EXT_FEATURES_MSR);
447                 msr.hi |=1;
448                 wrmsr_amd(CPU_ID_EXT_FEATURES_MSR, msr);
449         }
450
451         /* Erratum 122 */
452         msr = rdmsr(HWCR_MSR);
453         msr.lo |= 1 << 6;
454         wrmsr(HWCR_MSR, msr);
455
456 #if K8_REV_F_SUPPORT == 1
457         /* Erratum 131... */
458         msr = rdmsr(NB_CFG_MSR);
459         msr.lo |= 1 << 20;
460         wrmsr(NB_CFG_MSR, msr);
461 #endif
462
463 }
464
465 extern void model_fxx_update_microcode(unsigned cpu_deviceid);
466 int init_processor_name(void);
467
468 static unsigned ehci_debug_addr;
469
470 void model_fxx_init(device_t dev)
471 {
472         unsigned long i;
473         msr_t msr;
474         struct node_core_id id;
475 #if CONFIG_LOGICAL_CPUS == 1
476         unsigned siblings;
477 #endif
478
479 #if K8_REV_F_SUPPORT == 1
480         struct cpuinfo_x86 c;
481         
482         get_fms(&c, dev->device);
483 #endif
484
485 #if CONFIG_USBDEBUG_DIRECT
486         if(!ehci_debug_addr) 
487                 ehci_debug_addr = get_ehci_debug();
488         set_ehci_debug(0);
489 #endif
490
491         /* Turn on caching if we haven't already */
492         x86_enable_cache();
493         amd_setup_mtrrs();
494         x86_mtrr_check();
495
496 #if CONFIG_USBDEBUG_DIRECT
497         set_ehci_debug(ehci_debug_addr);
498 #endif
499
500         /* Update the microcode */
501         model_fxx_update_microcode(dev->device);
502
503         disable_cache();
504         
505         /* zero the machine check error status registers */
506         msr.lo = 0;
507         msr.hi = 0;
508         for(i=0; i<5; i++) {
509                 wrmsr(MCI_STATUS + (i*4),msr);
510         }
511
512         k8_errata();
513         
514         /* Set SMMLOCK to avoid exploits messing with SMM */
515         msr = rdmsr(HWCR_MSR);
516         msr.lo |= (1 << 0);
517         wrmsr(HWCR_MSR, msr);
518         
519         /* Set the processor name string */
520         init_processor_name();
521         
522         enable_cache();
523
524         /* Enable the local cpu apics */
525         setup_lapic();
526
527 #if CONFIG_LOGICAL_CPUS == 1
528         siblings = cpuid_ecx(0x80000008) & 0xff;
529
530         if(siblings>0) {
531                 msr = rdmsr_amd(CPU_ID_FEATURES_MSR);
532                 msr.lo |= 1 << 28; 
533                 wrmsr_amd(CPU_ID_FEATURES_MSR, msr);
534
535                 msr = rdmsr_amd(LOGICAL_CPUS_NUM_MSR);
536                 msr.lo = (siblings+1)<<16; 
537                 wrmsr_amd(LOGICAL_CPUS_NUM_MSR, msr);
538
539                 msr = rdmsr_amd(CPU_ID_EXT_FEATURES_MSR);
540                 msr.hi |= 1<<(33-32); 
541                 wrmsr_amd(CPU_ID_EXT_FEATURES_MSR, msr);
542         } 
543
544 #endif
545
546         id = get_node_core_id(read_nb_cfg_54()); // pre e0 nb_cfg_54 can not be set
547
548         /* Is this a bad location?  In particular can another node prefecth
549          * data from this node before we have initialized it?
550          */
551         if (id.coreid == 0) init_ecc_memory(id.nodeid); // only do it for core 0
552
553 #if CONFIG_LOGICAL_CPUS==1
554         /* Start up my cpu siblings */
555 //      if(id.coreid==0)  amd_sibling_init(dev); // Don't need core1 is already be put in the CPU BUS in bus_cpu_scan
556 #endif
557
558 }
559
560 static struct device_operations cpu_dev_ops = {
561         .init = model_fxx_init,
562 };
563 static struct cpu_device_id cpu_table[] = {
564 #if K8_REV_F_SUPPORT == 0
565         { X86_VENDOR_AMD, 0xf50 }, /* B3 */
566         { X86_VENDOR_AMD, 0xf51 }, /* SH7-B3 */
567         { X86_VENDOR_AMD, 0xf58 }, /* SH7-C0 */
568         { X86_VENDOR_AMD, 0xf48 },
569
570         { X86_VENDOR_AMD, 0xf5A }, /* SH7-CG */
571         { X86_VENDOR_AMD, 0xf4A },
572         { X86_VENDOR_AMD, 0xf7A },
573         { X86_VENDOR_AMD, 0xfc0 }, /* DH7-CG */
574         { X86_VENDOR_AMD, 0xfe0 },
575         { X86_VENDOR_AMD, 0xff0 },
576         { X86_VENDOR_AMD, 0xf82 }, /* CH7-CG */
577         { X86_VENDOR_AMD, 0xfb2 },
578 //AMD_D0_SUPPORT
579         { X86_VENDOR_AMD, 0x10f50 }, /* SH7-D0 */
580         { X86_VENDOR_AMD, 0x10f40 },
581         { X86_VENDOR_AMD, 0x10f70 },
582         { X86_VENDOR_AMD, 0x10fc0 }, /* DH7-D0 */
583         { X86_VENDOR_AMD, 0x10ff0 },
584         { X86_VENDOR_AMD, 0x10f80 }, /* CH7-D0 */
585         { X86_VENDOR_AMD, 0x10fb0 },
586 //AMD_E0_SUPPORT
587         { X86_VENDOR_AMD, 0x20f50 }, /* SH8-E0*/
588         { X86_VENDOR_AMD, 0x20f40 },
589         { X86_VENDOR_AMD, 0x20f70 },
590         { X86_VENDOR_AMD, 0x20fc0 }, /* DH8-E0 */ /* DH-E3 */
591         { X86_VENDOR_AMD, 0x20ff0 },
592         { X86_VENDOR_AMD, 0x20f10 }, /* JH8-E1 */
593         { X86_VENDOR_AMD, 0x20f30 },
594         { X86_VENDOR_AMD, 0x20f51 }, /* SH-E4 */
595         { X86_VENDOR_AMD, 0x20f71 },
596         { X86_VENDOR_AMD, 0x20f42 }, /* SH-E5 */
597         { X86_VENDOR_AMD, 0x20ff2 }, /* DH-E6 */
598         { X86_VENDOR_AMD, 0x20fc2 },
599         { X86_VENDOR_AMD, 0x20f12 }, /* JH-E6 */
600         { X86_VENDOR_AMD, 0x20f32 },
601         { X86_VENDOR_AMD, 0x30ff2 }, /* E4 ? */
602 #endif
603
604 #if K8_REV_F_SUPPORT == 1
605 //AMD_F0_SUPPORT
606         { X86_VENDOR_AMD, 0x40f50 }, /* SH-F0      Socket F (1207): Opteron */ 
607         { X86_VENDOR_AMD, 0x40f70 },            /*        AM2: Athlon64/Athlon64 FX  */
608         { X86_VENDOR_AMD, 0x40f40 },            /*        S1g1: Mobile Athlon64 */
609         { X86_VENDOR_AMD, 0x40f11 }, /* JH-F1      Socket F (1207): Opteron Dual Core */
610         { X86_VENDOR_AMD, 0x40f31 },            /*        AM2: Athlon64 x2/Athlon64 FX Dual Core */ 
611         { X86_VENDOR_AMD, 0x40f01 },            /*        S1g1: Mobile Athlon64 */
612         { X86_VENDOR_AMD, 0x40f12 }, /* JH-F2      Socket F (1207): Opteron Dual Core */
613         { X86_VENDOR_AMD, 0x40f32 },            /*        AM2 : Opteron Dual Core/Athlon64 x2/ Athlon64 FX Dual Core */
614         { X86_VENDOR_AMD, 0x40fb2 }, /* BH-F2      Socket AM2:Athlon64 x2/ Mobile Athlon64 x2 */
615         { X86_VENDOR_AMD, 0x40f82 },            /*        S1g1:Turion64 x2 */
616         { X86_VENDOR_AMD, 0x40ff2 }, /* DH-F2      Socket AM2: Athlon64 */
617         { X86_VENDOR_AMD, 0x50ff2 }, /* DH-F2      Socket AM2: Athlon64 */
618         { X86_VENDOR_AMD, 0x40fc2 },            /*        S1g1:Turion64 */
619         { X86_VENDOR_AMD, 0x40f13 }, /* JH-F3      Socket F (1207): Opteron Dual Core */
620         { X86_VENDOR_AMD, 0x40f33 },            /*        AM2 : Opteron Dual Core/Athlon64 x2/ Athlon64 FX Dual Core */
621         { X86_VENDOR_AMD, 0xc0f13 },            /*        AM2 : Athlon64 FX*/
622         { X86_VENDOR_AMD, 0x50ff3 }, /* DH-F3      Socket AM2: Athlon64 */
623         { X86_VENDOR_AMD, 0x60fb1 }, /*       Socket AM2: Athlon64 x2 5000+*/
624 #endif
625
626         { 0, 0 },
627 };
628 static const struct cpu_driver model_fxx __cpu_driver = {
629         .ops      = &cpu_dev_ops,
630         .id_table = cpu_table,
631 };