blob: 3678bfe9e88e6b1edabfca549c0bbed41f0e4357 [file] [log] [blame]
Eric Biedermanfcd5ace2004-10-14 19:29:29 +00001#include <console/console.h>
2#include <device/device.h>
Eric Biedermanfcd5ace2004-10-14 19:29:29 +00003#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 Biedermanfcd5ace2004-10-14 19:29:29 +000010
Edward O'Callaghan2c9d2cf2014-10-27 23:29:29 +110011static void model_f1x_init(struct device *dev)
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000012{
13 /* Turn on caching if we haven't already */
14 x86_enable_cache();
Sven Schnelleadfbcb792012-01-10 12:01:43 +010015 x86_setup_mtrrs();
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000016 x86_mtrr_check();
Stefan Reinauer14e22772010-04-27 06:56:47 +000017
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000018 /* Update the microcode */
Alexandru Gagniuc2c38f502013-12-06 23:14:54 -060019 intel_update_microcode_from_cbfs();
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000020
21 /* Enable the local cpu apics */
22 setup_lapic();
23};
24
25static struct device_operations cpu_dev_ops = {
26 .init = model_f1x_init,
27};
Uwe Hermann554c0522010-10-07 23:42:17 +000028
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000029static struct cpu_device_id cpu_table[] = {
30 { X86_VENDOR_INTEL, 0x0f12 },
Stefan Reinauerc104cb02010-10-18 00:21:39 +000031 { X86_VENDOR_INTEL, 0x0f13 },
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000032 { 0, 0 },
33};
34
Stefan Reinauer124e4a42007-10-24 11:10:21 +000035static const struct cpu_driver driver __cpu_driver = {
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000036 .ops = &cpu_dev_ops,
37 .id_table = cpu_table,
38};