Stefan Reinauer | cfcc9ca | 2008-03-18 23:10:24 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 3 | * |
Stefan Reinauer | cfcc9ca | 2008-03-18 23:10:24 +0000 | [diff] [blame] | 4 | * (C) 2007-2008 coresystems GmbH |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; either version 2 of |
| 9 | * the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Stefan Reinauer | cfcc9ca | 2008-03-18 23:10:24 +0000 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #include <device/device.h> |
| 18 | #include <cpu/cpu.h> |
| 19 | #include <cpu/x86/mtrr.h> |
| 20 | #include <cpu/x86/msr.h> |
| 21 | #include <cpu/x86/lapic.h> |
| 22 | #include <cpu/x86/cache.h> |
Stefan Reinauer | cfcc9ca | 2008-03-18 23:10:24 +0000 | [diff] [blame] | 23 | |
Edward O'Callaghan | 2c9d2cf | 2014-10-27 23:29:29 +1100 | [diff] [blame] | 24 | static void c3_init(struct device *dev) |
Stefan Reinauer | cfcc9ca | 2008-03-18 23:10:24 +0000 | [diff] [blame] | 25 | { |
| 26 | x86_enable_cache(); |
Sven Schnelle | adfbcb79 | 2012-01-10 12:01:43 +0100 | [diff] [blame] | 27 | x86_setup_mtrrs(); |
Stefan Reinauer | cfcc9ca | 2008-03-18 23:10:24 +0000 | [diff] [blame] | 28 | x86_mtrr_check(); |
| 29 | |
| 30 | /* Enable the local cpu apics */ |
| 31 | setup_lapic(); |
| 32 | }; |
| 33 | |
| 34 | static struct device_operations cpu_dev_ops = { |
Kyösti Mälkki | 12b7262 | 2012-02-09 16:51:38 +0200 | [diff] [blame] | 35 | .init = c3_init, |
Stefan Reinauer | cfcc9ca | 2008-03-18 23:10:24 +0000 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | static struct cpu_device_id cpu_table[] = { |
| 39 | { X86_VENDOR_CENTAUR, 0x0670 }, // VIA C3 Samual 2 + Ezra |
| 40 | { X86_VENDOR_CENTAUR, 0x0680 }, // VIA C3 Ezra-T |
| 41 | { X86_VENDOR_CENTAUR, 0x0690 }, // VIA C3 Nehemiah |
| 42 | { 0, 0 }, |
| 43 | }; |
| 44 | |
| 45 | static const struct cpu_driver driver __cpu_driver = { |
| 46 | .ops = &cpu_dev_ops, |
| 47 | .id_table = cpu_table, |
| 48 | }; |