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