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