291e4afef9fd8eced2c0aa3f5fcec083c8359f13
[coreboot.git] / src / cpu / via / model_c3 / model_c3_init.c
1 /*
2  * This file is part of the coreboot project.
3  *
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.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19  * MA 02110-1301 USA
20  */
21
22 #include <device/device.h>
23 #include <cpu/cpu.h>
24 #include <cpu/x86/mtrr.h>
25 #include <cpu/x86/msr.h>
26 #include <cpu/x86/lapic.h>
27 #include <cpu/x86/cache.h>
28 #include <cpu/x86/mtrr.h>
29
30 static void model_c3_init(device_t dev)
31 {
32         x86_enable_cache();
33         x86_setup_mtrrs(36);
34         x86_mtrr_check();
35
36         /* Enable the local cpu apics */
37         setup_lapic();
38 };
39
40 static struct device_operations cpu_dev_ops = {
41         .init     = model_c3_init,
42 };
43
44 static struct cpu_device_id cpu_table[] = {
45         { X86_VENDOR_CENTAUR, 0x0670 },         // VIA C3 Samual 2 + Ezra
46         { X86_VENDOR_CENTAUR, 0x0680 },         // VIA C3 Ezra-T
47         { X86_VENDOR_CENTAUR, 0x0690 },         // VIA C3 Nehemiah
48         { 0, 0 },
49 };
50
51 static const struct cpu_driver driver __cpu_driver = {
52         .ops      = &cpu_dev_ops,
53         .id_table = cpu_table,
54 };