MTRR: get physical address size from CPUID
[coreboot.git] / src / cpu / intel / model_f0x / model_f0x_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/x86/cache.h>
11
12 /* 256KB cache */
13 static uint32_t microcode_updates[] = {
14         #include "microcode-678-2f0708.h"
15         #include "microcode-965-m01f0a13.h"
16         #include "microcode-983-m02f0a15.h"
17         #include "microcode-964-m01f0712.h"
18         #include "microcode-966-m04f0a14.h"
19
20         /*  Dummy terminator  */
21         0x0, 0x0, 0x0, 0x0,
22         0x0, 0x0, 0x0, 0x0,
23         0x0, 0x0, 0x0, 0x0,
24         0x0, 0x0, 0x0, 0x0,
25 };
26
27 static void model_f0x_init(device_t dev)
28 {
29         /* Turn on caching if we haven't already */
30         x86_enable_cache();
31         x86_setup_mtrrs();
32         x86_mtrr_check();
33
34         /* Update the microcode */
35         intel_update_microcode(microcode_updates);
36
37         /* Enable the local cpu apics */
38         setup_lapic();
39 };
40
41 static struct device_operations cpu_dev_ops = {
42         .init     = model_f0x_init,
43 };
44
45 static struct cpu_device_id cpu_table[] = {
46         { X86_VENDOR_INTEL, 0x0f07 },
47         { X86_VENDOR_INTEL, 0x0f0A },
48         { 0, 0 },
49 };
50
51 static const struct cpu_driver driver __cpu_driver = {
52         .ops      = &cpu_dev_ops,
53         .id_table = cpu_table,
54 };