f59ef5d3714d5003d50c98a6c11388266b5aed62
[coreboot.git] / src / cpu / intel / model_f3x / model_f3x_init.c
1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/device.h>
4 #include <device/pci.h>
5 #include <string.h>
6 #include <cpu/cpu.h>
7 #include <cpu/x86/mtrr.h>
8 #include <cpu/x86/msr.h>
9 #include <cpu/x86/lapic.h>
10 #include <cpu/intel/microcode.h>
11 #include <cpu/intel/hyperthreading.h>
12 #include <cpu/x86/cache.h>
13 #include <cpu/x86/mtrr.h>
14
15 static uint32_t microcode_updates[] = {
16         /* WARNING - Intel has a new data structure that has variable length
17          * microcode update lengths.  They are encoded in int 8 and 9.  A
18          * dummy header of nulls must terminate the list.
19          */
20
21 #include "microcode-1290-m0df320a.h"
22 #include "microcode-1467-m0df330c.h"
23 #include "microcode-1468-m1df3417.h"
24
25         /*  Dummy terminator  */
26         0x0, 0x0, 0x0, 0x0,
27         0x0, 0x0, 0x0, 0x0,
28         0x0, 0x0, 0x0, 0x0,
29         0x0, 0x0, 0x0, 0x0,
30 };
31
32
33 static void model_f3x_init(device_t cpu)
34 {
35         /* Turn on caching if we haven't already */
36         x86_enable_cache();
37         x86_setup_mtrrs(36);
38         x86_mtrr_check();
39
40         /* Update the microcode */
41         intel_update_microcode(microcode_updates);
42
43         /* Enable the local cpu apics */
44         setup_lapic();
45
46         /* Start up my cpu siblings */
47         intel_sibling_init(cpu);
48 };
49
50 static struct device_operations cpu_dev_ops = {
51         .init = model_f3x_init,
52 };
53 static struct cpu_device_id cpu_table[] = {
54         { X86_VENDOR_INTEL, 0x0f34 }, /* Xeon */
55         { 0, 0 },
56 };
57
58 static const struct cpu_driver model_f3x __cpu_driver = {
59         .ops      = &cpu_dev_ops,
60         .id_table = cpu_table,
61 };