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/x86/cache.h> |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 10 | |
Edward O'Callaghan | 2c9d2cf | 2014-10-27 23:29:29 +1100 | [diff] [blame] | 11 | static void model_f1x_init(struct device *dev) |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 12 | { |
| 13 | /* Turn on caching if we haven't already */ |
| 14 | x86_enable_cache(); |
Sven Schnelle | adfbcb79 | 2012-01-10 12:01:43 +0100 | [diff] [blame] | 15 | x86_setup_mtrrs(); |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 16 | x86_mtrr_check(); |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 17 | |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 18 | /* Update the microcode */ |
Alexandru Gagniuc | 2c38f50 | 2013-12-06 23:14:54 -0600 | [diff] [blame] | 19 | intel_update_microcode_from_cbfs(); |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 20 | |
| 21 | /* Enable the local cpu apics */ |
| 22 | setup_lapic(); |
| 23 | }; |
| 24 | |
| 25 | static struct device_operations cpu_dev_ops = { |
| 26 | .init = model_f1x_init, |
| 27 | }; |
Uwe Hermann | 554c052 | 2010-10-07 23:42:17 +0000 | [diff] [blame] | 28 | |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 29 | static struct cpu_device_id cpu_table[] = { |
| 30 | { X86_VENDOR_INTEL, 0x0f12 }, |
Stefan Reinauer | c104cb0 | 2010-10-18 00:21:39 +0000 | [diff] [blame] | 31 | { X86_VENDOR_INTEL, 0x0f13 }, |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 32 | { 0, 0 }, |
| 33 | }; |
| 34 | |
Stefan Reinauer | 124e4a4 | 2007-10-24 11:10:21 +0000 | [diff] [blame] | 35 | static const struct cpu_driver driver __cpu_driver = { |
Eric Biederman | fcd5ace | 2004-10-14 19:29:29 +0000 | [diff] [blame] | 36 | .ops = &cpu_dev_ops, |
| 37 | .id_table = cpu_table, |
| 38 | }; |