Martin Roth | bf6b83a | 2015-10-11 10:37:02 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 Google Inc. |
| 5 | * Copyright (C) 2013 Sage Electronic Engineering, LLC. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 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. |
Martin Roth | bf6b83a | 2015-10-11 10:37:02 +0200 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #include <console/console.h> |
| 18 | #include <arch/cpu.h> |
| 19 | #include <string.h> |
| 20 | |
Marc Jones | 31f4d00 | 2015-09-24 21:45:13 -0600 | [diff] [blame] | 21 | #if IS_ENABLED(CONFIG_SOUTHBRIDGE_INTEL_FSP_BD82X6X) |
Martin Roth | bf6b83a | 2015-10-11 10:37:02 +0200 | [diff] [blame] | 22 | #include <southbridge/intel/fsp_bd82x6x/pch.h> |
Marc Jones | 31f4d00 | 2015-09-24 21:45:13 -0600 | [diff] [blame] | 23 | #elif IS_ENABLED(CONFIG_SOUTHBRIDGE_INTEL_FSP_I89XX) |
| 24 | #include <southbridge/intel/fsp_i89xx/pch.h> |
Martin Roth | bf6b83a | 2015-10-11 10:37:02 +0200 | [diff] [blame] | 25 | #endif |
| 26 | |
| 27 | #include <arch/io.h> |
| 28 | #include "northbridge.h" |
| 29 | |
| 30 | static void report_cpu_info(void) |
| 31 | { |
| 32 | struct cpuid_result cpuidr; |
| 33 | u32 i, index; |
| 34 | char cpu_string[50], *cpu_name = cpu_string; /* 48 bytes are reported */ |
| 35 | int vt, txt, aes; |
| 36 | const char *mode[] = {"NOT ", ""}; |
| 37 | |
| 38 | index = 0x80000000; |
| 39 | cpuidr = cpuid(index); |
| 40 | if (cpuidr.eax < 0x80000004) { |
| 41 | strcpy(cpu_string, "Platform info not available"); |
| 42 | } else { |
| 43 | u32 *p = (u32*) cpu_string; |
| 44 | for (i = 2; i <= 4 ; i++) { |
| 45 | cpuidr = cpuid(index + i); |
| 46 | *p++ = cpuidr.eax; |
| 47 | *p++ = cpuidr.ebx; |
| 48 | *p++ = cpuidr.ecx; |
| 49 | *p++ = cpuidr.edx; |
| 50 | } |
| 51 | } |
| 52 | /* Skip leading spaces in CPU name string */ |
| 53 | while (cpu_name[0] == ' ') |
| 54 | cpu_name++; |
| 55 | |
| 56 | cpuidr = cpuid(1); |
| 57 | printk(BIOS_DEBUG, "CPU id(%x): %s\n", cpuidr.eax, cpu_name); |
| 58 | aes = (cpuidr.ecx & (1 << 25)) ? 1 : 0; |
| 59 | txt = (cpuidr.ecx & (1 << 6)) ? 1 : 0; |
| 60 | vt = (cpuidr.ecx & (1 << 5)) ? 1 : 0; |
| 61 | printk(BIOS_DEBUG, "AES %ssupported, TXT %ssupported, VT %ssupported\n", |
| 62 | mode[aes], mode[txt], mode[vt]); |
| 63 | } |
| 64 | |
| 65 | /* The PCI id name match comes from Intel document 472178 */ |
| 66 | static struct { |
| 67 | u16 dev_id; |
| 68 | const char *dev_name; |
| 69 | } pch_table [] = { |
| 70 | {0x1E41, "Desktop Sample"}, |
| 71 | {0x1E42, "Mobile Sample"}, |
| 72 | {0x1E43, "SFF Sample"}, |
| 73 | {0x1E44, "Z77"}, |
| 74 | {0x1E45, "H71"}, |
| 75 | {0x1E46, "Z75"}, |
| 76 | {0x1E47, "Q77"}, |
| 77 | {0x1E48, "Q75"}, |
| 78 | {0x1E49, "B75"}, |
| 79 | {0x1E4A, "H77"}, |
| 80 | {0x1E53, "C216"}, |
| 81 | {0x1E55, "QM77"}, |
| 82 | {0x1E56, "QS77"}, |
| 83 | {0x1E58, "UM77"}, |
| 84 | {0x1E57, "HM77"}, |
| 85 | {0x1E59, "HM76"}, |
| 86 | {0x1E5D, "HM75"}, |
| 87 | {0x1E5E, "HM70"}, |
| 88 | {0x1E5F, "NM70"}, |
| 89 | }; |
| 90 | |
| 91 | static void report_pch_info(void) |
| 92 | { |
| 93 | int i; |
| 94 | u16 dev_id = pci_read_config16(PCH_LPC_DEV, 2); |
| 95 | |
| 96 | |
| 97 | const char *pch_type = "Unknown"; |
| 98 | for (i = 0; i < ARRAY_SIZE(pch_table); i++) { |
| 99 | if (pch_table[i].dev_id == dev_id) { |
| 100 | pch_type = pch_table[i].dev_name; |
| 101 | break; |
| 102 | } |
| 103 | } |
| 104 | printk (BIOS_DEBUG, "PCH type: %s, device id: %x, rev id %x\n", |
| 105 | pch_type, dev_id, pci_read_config8(PCH_LPC_DEV, 8)); |
| 106 | } |
| 107 | |
| 108 | void report_platform_info(void) |
| 109 | { |
| 110 | report_cpu_info(); |
| 111 | report_pch_info(); |
| 112 | } |