MTRR: get physical address size from CPUID
[coreboot.git] / src / cpu / intel / model_f4x / model_f4x_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 static uint32_t microcode_updates[] = {
14         /* WARNING - Intel has a new data structure that has variable length
15          * microcode update lengths.  They are encoded in int 8 and 9.  A
16          * dummy header of nulls must terminate the list.
17          */
18
19         #include "microcode-1735-m01f480c.h"
20         #include "microcode-1460-m9df4305.h"
21         #include "microcode-2492-m02f480e.h"
22         #include "microcode-1470-m9df4703.h"
23         #include "microcode-1521-m5ff4807.h"
24         #include "microcode-1466-m02f4116.h"
25         #include "microcode-1469-m9df4406.h"
26         #include "microcode-1471-mbdf4117.h"
27         #include "microcode-1637-m5cf4a04.h"
28         #include "microcode-1462-mbdf4903.h"
29         #include "microcode-1498-m5df4a02.h"
30
31         /*  Dummy terminator  */
32         0x0, 0x0, 0x0, 0x0,
33         0x0, 0x0, 0x0, 0x0,
34         0x0, 0x0, 0x0, 0x0,
35         0x0, 0x0, 0x0, 0x0,
36 };
37
38 static void model_f4x_init(device_t cpu)
39 {
40         /* Turn on caching if we haven't already */
41         x86_enable_cache();
42         x86_setup_mtrrs();
43         x86_mtrr_check();
44
45         /* Update the microcode */
46         intel_update_microcode(microcode_updates);
47
48         /* Enable the local cpu apics */
49         setup_lapic();
50
51         /* Start up my cpu siblings */
52         intel_sibling_init(cpu);
53 };
54
55 static struct device_operations cpu_dev_ops = {
56         .init = model_f4x_init,
57 };
58
59 static struct cpu_device_id cpu_table[] = {
60         { X86_VENDOR_INTEL, 0x0f41 }, /* Xeon */
61         { 0, 0 },
62 };
63
64 static const struct cpu_driver model_f4x __cpu_driver = {
65         .ops      = &cpu_dev_ops,
66         .id_table = cpu_table,
67 };