Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 1 | #include <console/console.h> |
| 2 | #include <device/device.h> |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 3 | #include <string.h> |
| 4 | #include <cpu/cpu.h> |
| 5 | #include <cpu/x86/mtrr.h> |
| 6 | #include <cpu/x86/msr.h> |
| 7 | #include <cpu/x86/lapic.h> |
| 8 | #include <cpu/intel/microcode.h> |
| 9 | #include <cpu/intel/hyperthreading.h> |
| 10 | #include <cpu/x86/cache.h> |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 11 | |
Edward O'Callaghan | 2c9d2cf | 2014-10-27 23:29:29 +1100 | [diff] [blame] | 12 | static void model_f3x_init(struct device *cpu) |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 13 | { |
| 14 | /* Turn on caching if we haven't already */ |
| 15 | x86_enable_cache(); |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 16 | |
Kyösti Mälkki | 9ed1456 | 2012-06-27 16:14:49 +0300 | [diff] [blame] | 17 | if (!intel_ht_sibling()) { |
| 18 | /* MTRRs are shared between threads */ |
| 19 | x86_setup_mtrrs(); |
| 20 | x86_mtrr_check(); |
| 21 | |
| 22 | /* Update the microcode */ |
Alexandru Gagniuc | 2c38f50 | 2013-12-06 23:14:54 -0600 | [diff] [blame] | 23 | intel_update_microcode_from_cbfs(); |
Kyösti Mälkki | 9ed1456 | 2012-06-27 16:14:49 +0300 | [diff] [blame] | 24 | } |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 25 | |
| 26 | /* Enable the local cpu apics */ |
| 27 | setup_lapic(); |
Sven Schnelle | 51676b1 | 2012-07-29 19:18:03 +0200 | [diff] [blame] | 28 | |
| 29 | /* Start up my cpu siblings */ |
| 30 | intel_sibling_init(cpu); |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | static struct device_operations cpu_dev_ops = { |
| 34 | .init = model_f3x_init, |
| 35 | }; |
Uwe Hermann | 554c052 | 2010-10-07 23:42:17 +0000 | [diff] [blame] | 36 | |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 37 | static struct cpu_device_id cpu_table[] = { |
| 38 | { X86_VENDOR_INTEL, 0x0f34 }, /* Xeon */ |
| 39 | { 0, 0 }, |
| 40 | }; |
| 41 | |
Stefan Reinauer | 124e4a4 | 2007-10-24 11:10:21 +0000 | [diff] [blame] | 42 | static const struct cpu_driver model_f3x __cpu_driver = { |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 43 | .ops = &cpu_dev_ops, |
| 44 | .id_table = cpu_table, |
| 45 | }; |