MTRR: get physical address size from CPUID
[coreboot.git] / src / cpu / intel / model_f2x / model_f2x_init.c
1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <string.h>
5 #include <cpu/cpu.h>
6 #include <cpu/x86/mtrr.h>
7 #include <cpu/x86/msr.h>
8 #include <cpu/x86/lapic.h>
9 #include <cpu/intel/microcode.h>
10 #include <cpu/intel/hyperthreading.h>
11 #include <cpu/x86/cache.h>
12
13 /* 512KB cache */
14 static uint32_t microcode_updates[] = {
15         /* WARNING - Intel has a new data structure that has variable length
16          * microcode update lengths.  They are encoded in int 8 and 9.  A
17          * dummy header of nulls must terminate the list.
18          */
19
20         /* Old microcode file not present in Intel's microcode.dat. */
21 #include "microcode_m02f2203.h"
22
23         /* files from Intel's microcode.dat */
24 #include "microcode-1343-m04f252b.h"
25 #include "microcode-1346-m10f252c.h"
26 #include "microcode-1338-m02f292d.h"
27 #include "microcode-1340-m08f292f.h"
28 #include "microcode-1107-m10f2421.h"
29 #include "microcode-1339-m04f292e.h"
30 #include "microcode-1105-m08f2420.h"
31 #include "microcode-1336-m02f2610.h"
32 #include "microcode-1101-m02f2738.h"
33 #include "microcode-1100-m04f2737.h"
34 #include "microcode-1341-m01f2529.h"
35 #include "microcode-1102-m08f2739.h"
36 #include "microcode-1104-m04f241e.h"
37 #include "microcode-1342-m02f252a.h"
38 #include "microcode-1106-m02f241f.h"
39
40         /*  Dummy terminator  */
41         0x0, 0x0, 0x0, 0x0,
42         0x0, 0x0, 0x0, 0x0,
43         0x0, 0x0, 0x0, 0x0,
44         0x0, 0x0, 0x0, 0x0,
45 };
46
47 static void model_f2x_init(device_t cpu)
48 {
49         /* Turn on caching if we haven't already */
50         x86_enable_cache();
51         x86_setup_mtrrs();
52         x86_mtrr_check();
53
54         /* Update the microcode */
55         intel_update_microcode(microcode_updates);
56
57         /* Enable the local cpu apics */
58         setup_lapic();
59
60         /* Start up my cpu siblings */
61         intel_sibling_init(cpu);
62 };
63
64 static struct device_operations cpu_dev_ops = {
65         .init     = model_f2x_init,
66 };
67
68 static struct cpu_device_id cpu_table[] = {
69         { X86_VENDOR_INTEL, 0x0f22 },
70         { X86_VENDOR_INTEL, 0x0f24 },
71         { X86_VENDOR_INTEL, 0x0f25 },
72         { X86_VENDOR_INTEL, 0x0f26 },
73         { X86_VENDOR_INTEL, 0x0f27 },
74         { X86_VENDOR_INTEL, 0x0f29 },
75         { 0, 0 },
76 };
77
78 static const struct cpu_driver driver __cpu_driver = {
79         .ops      = &cpu_dev_ops,
80         .id_table = cpu_table,
81 };