Ed Swierk | 1996313 | 2008-08-25 14:41:11 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2008 Arastra, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Ed Swierk | 1996313 | 2008-08-25 14:41:11 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <console/console.h> |
| 17 | #include <device/device.h> |
Ed Swierk | 1996313 | 2008-08-25 14:41:11 +0000 | [diff] [blame] | 18 | #include <string.h> |
| 19 | #include <cpu/cpu.h> |
| 20 | #include <cpu/x86/mtrr.h> |
| 21 | #include <cpu/x86/msr.h> |
| 22 | #include <cpu/x86/lapic.h> |
| 23 | #include <cpu/intel/microcode.h> |
| 24 | #include <cpu/x86/cache.h> |
| 25 | #include <cpu/x86/mtrr.h> |
| 26 | |
Edward O'Callaghan | 2c9d2cf | 2014-10-27 23:29:29 +1100 | [diff] [blame] | 27 | static void ep80579_init(struct device *dev) |
Ed Swierk | 1996313 | 2008-08-25 14:41:11 +0000 | [diff] [blame] | 28 | { |
| 29 | /* Turn on caching if we haven't already */ |
| 30 | x86_enable_cache(); |
Sven Schnelle | adfbcb79 | 2012-01-10 12:01:43 +0100 | [diff] [blame] | 31 | x86_setup_mtrrs(); |
Ed Swierk | 1996313 | 2008-08-25 14:41:11 +0000 | [diff] [blame] | 32 | x86_mtrr_check(); |
| 33 | |
| 34 | /* Update the microcode */ |
Alexandru Gagniuc | 2c38f50 | 2013-12-06 23:14:54 -0600 | [diff] [blame] | 35 | intel_update_microcode_from_cbfs(); |
Ed Swierk | 1996313 | 2008-08-25 14:41:11 +0000 | [diff] [blame] | 36 | |
| 37 | /* Enable the local cpu apics */ |
| 38 | setup_lapic(); |
| 39 | }; |
| 40 | |
| 41 | static struct device_operations cpu_dev_ops = { |
| 42 | .init = ep80579_init, |
| 43 | }; |
| 44 | |
| 45 | static struct cpu_device_id cpu_table[] = { |
| 46 | { X86_VENDOR_INTEL, 0x10650 }, /* EP80579 */ |
| 47 | { 0, 0 }, |
| 48 | }; |
| 49 | |
Stefan Reinauer | 8013d5a | 2010-03-29 19:04:13 +0000 | [diff] [blame] | 50 | static const struct cpu_driver driver __cpu_driver = { |
Ed Swierk | 1996313 | 2008-08-25 14:41:11 +0000 | [diff] [blame] | 51 | .ops = &cpu_dev_ops, |
| 52 | .id_table = cpu_table, |
| 53 | }; |