Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +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 | * |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 4 | * Copyright (C) 2007-2009 coresystems GmbH |
| 5 | * Copyright (C) 2010 Joseph Smith <joe@settoplinux.org> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License as |
| 9 | * published by the Free Software Foundation; version 2 of |
| 10 | * the License. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 16 | */ |
| 17 | |
| 18 | #include <console/console.h> |
| 19 | #include <device/device.h> |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 20 | #include <string.h> |
| 21 | #include <cpu/cpu.h> |
| 22 | #include <cpu/x86/mtrr.h> |
| 23 | #include <cpu/x86/msr.h> |
| 24 | #include <cpu/x86/lapic.h> |
| 25 | #include <cpu/intel/microcode.h> |
| 26 | #include <cpu/x86/cache.h> |
Uwe Hermann | aac8f66 | 2010-09-29 09:54:16 +0000 | [diff] [blame] | 27 | #include <cpu/x86/name.h> |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 28 | |
Edward O'Callaghan | 2c9d2cf | 2014-10-27 23:29:29 +1100 | [diff] [blame] | 29 | static void model_6bx_init(struct device *cpu) |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 30 | { |
| 31 | char processor_name[49]; |
| 32 | |
| 33 | /* Turn on caching if we haven't already */ |
| 34 | x86_enable_cache(); |
| 35 | |
| 36 | /* Update the microcode */ |
Alexandru Gagniuc | 2c38f50 | 2013-12-06 23:14:54 -0600 | [diff] [blame] | 37 | intel_update_microcode_from_cbfs(); |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 38 | |
| 39 | /* Print processor name */ |
| 40 | fill_processor_name(processor_name); |
| 41 | printk(BIOS_INFO, "CPU: %s.\n", processor_name); |
| 42 | |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 43 | /* Setup MTRRs */ |
Sven Schnelle | adfbcb79 | 2012-01-10 12:01:43 +0100 | [diff] [blame] | 44 | x86_setup_mtrrs(); |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 45 | x86_mtrr_check(); |
| 46 | |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 47 | /* Enable the local cpu apics */ |
| 48 | setup_lapic(); |
| 49 | } |
| 50 | |
| 51 | static struct device_operations cpu_dev_ops = { |
| 52 | .init = model_6bx_init, |
| 53 | }; |
| 54 | |
Uwe Hermann | cc0dc7f | 2010-10-04 20:43:55 +0000 | [diff] [blame] | 55 | /* |
| 56 | * Pentium III Processor Identification and Package Information. |
| 57 | * http://www.intel.com/design/pentiumiii/qit/update.pdf |
| 58 | * |
| 59 | * Intel Pentium III Processor Specification Update |
| 60 | * http://download.intel.com/design/intarch/specupdt/24445358.pdf |
| 61 | */ |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 62 | static struct cpu_device_id cpu_table[] = { |
Uwe Hermann | cc0dc7f | 2010-10-04 20:43:55 +0000 | [diff] [blame] | 63 | { X86_VENDOR_INTEL, 0x06b1 }, /* Pentium III/Celeron, tA1/A1/FPA1 */ |
| 64 | { X86_VENDOR_INTEL, 0x06b4 }, /* Pentium III, tB1/FPB1 */ |
Joseph Smith | 7488e04 | 2010-04-09 11:10:25 +0000 | [diff] [blame] | 65 | { 0, 0 }, |
| 66 | }; |
| 67 | |
| 68 | static const struct cpu_driver driver __cpu_driver = { |
| 69 | .ops = &cpu_dev_ops, |
| 70 | .id_table = cpu_table, |
| 71 | }; |