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