Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | /* |
| 4 | * This file is created based on Intel Alder Lake Platform Stepping and IDs |
| 5 | * Document number: 619362, 619501 |
| 6 | * Chapter number: 2, 14 |
| 7 | */ |
| 8 | |
Subrata Banik | 55f5410 | 2021-07-23 21:04:41 +0530 | [diff] [blame] | 9 | #include <commonlib/helpers.h> |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 10 | #include <console/console.h> |
Elyes Haouas | def74aa | 2022-10-31 13:44:40 +0100 | [diff] [blame] | 11 | #include <cpu/cpu.h> |
Subrata Banik | 87685c5 | 2021-07-15 16:31:30 +0530 | [diff] [blame] | 12 | #include <cpu/intel/cpu_ids.h> |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 13 | #include <cpu/intel/microcode.h> |
| 14 | #include <cpu/x86/msr.h> |
| 15 | #include <cpu/x86/name.h> |
| 16 | #include <device/pci.h> |
| 17 | #include <device/pci_ids.h> |
Elyes Haouas | def74aa | 2022-10-31 13:44:40 +0100 | [diff] [blame] | 18 | #include <device/pci_ops.h> |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 19 | #include <soc/bootblock.h> |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 20 | #include <soc/pci_devs.h> |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 21 | |
| 22 | static struct { |
| 23 | u32 cpuid; |
| 24 | const char *name; |
| 25 | } cpu_table[] = { |
Lean Sheng Tan | 9e78dd1 | 2022-04-01 12:03:51 +0200 | [diff] [blame] | 26 | { CPUID_ALDERLAKE_J0, "Alderlake J0 Platform" }, |
| 27 | { CPUID_ALDERLAKE_K0, "Alderlake K0 Platform" }, |
Lean Sheng Tan | 311ddf3 | 2022-04-01 18:36:11 +0200 | [diff] [blame] | 28 | { CPUID_ALDERLAKE_L0, "Alderlake L0 Platform" }, |
Lean Sheng Tan | 9e78dd1 | 2022-04-01 12:03:51 +0200 | [diff] [blame] | 29 | { CPUID_ALDERLAKE_Q0, "Alderlake Q0 Platform" }, |
| 30 | { CPUID_ALDERLAKE_R0, "Alderlake R0 Platform" }, |
Usha P | 5b94cd9 | 2021-11-15 18:40:00 +0530 | [diff] [blame] | 31 | { CPUID_ALDERLAKE_N_A0, "Alderlake-N Platform" }, |
Michał Żygowski | c8c75fa | 2022-04-25 14:59:17 +0200 | [diff] [blame] | 32 | { CPUID_ALDERLAKE_S_A0, "Alderlake-S A0 Platform" }, |
| 33 | { CPUID_ALDERLAKE_S_B0, "Alderlake-S B0 Platform" }, |
| 34 | { CPUID_ALDERLAKE_S_C0, "Alderlake-S C0 Platform" }, |
| 35 | { CPUID_ALDERLAKE_S_G0, "Alderlake-S G0 Platform" }, |
| 36 | { CPUID_ALDERLAKE_S_H0, "Alderlake-S H0 Platform" }, |
Bora Guvendik | a15b25f | 2022-02-28 14:43:49 -0800 | [diff] [blame] | 37 | { CPUID_RAPTORLAKE_P_J0, "Raptorlake-P J0 Platform" }, |
zhixingma | 529a64b | 2022-06-13 15:06:27 -0700 | [diff] [blame] | 38 | { CPUID_RAPTORLAKE_P_Q0, "Raptorlake-P Q0 Platform" }, |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | static struct { |
| 42 | u16 mchid; |
| 43 | const char *name; |
| 44 | } mch_table[] = { |
Felix Singer | 43b7f41 | 2022-03-07 04:34:52 +0100 | [diff] [blame] | 45 | { PCI_DID_INTEL_ADL_P_ID_1, "Alderlake-P" }, |
| 46 | { PCI_DID_INTEL_ADL_P_ID_3, "Alderlake-P" }, |
| 47 | { PCI_DID_INTEL_ADL_P_ID_4, "Alderlake-P" }, |
| 48 | { PCI_DID_INTEL_ADL_P_ID_5, "Alderlake-P" }, |
| 49 | { PCI_DID_INTEL_ADL_P_ID_6, "Alderlake-P" }, |
| 50 | { PCI_DID_INTEL_ADL_P_ID_7, "Alderlake-P" }, |
| 51 | { PCI_DID_INTEL_ADL_P_ID_8, "Alderlake-P" }, |
| 52 | { PCI_DID_INTEL_ADL_P_ID_9, "Alderlake-P" }, |
| 53 | { PCI_DID_INTEL_ADL_P_ID_10, "Alderlake-P" }, |
| 54 | { PCI_DID_INTEL_ADL_M_ID_1, "Alderlake-M" }, |
| 55 | { PCI_DID_INTEL_ADL_M_ID_2, "Alderlake-M" }, |
| 56 | { PCI_DID_INTEL_ADL_N_ID_1, "Alderlake-N" }, |
| 57 | { PCI_DID_INTEL_ADL_N_ID_2, "Alderlake-N" }, |
| 58 | { PCI_DID_INTEL_ADL_N_ID_3, "Alderlake-N" }, |
| 59 | { PCI_DID_INTEL_ADL_N_ID_4, "Alderlake-N" }, |
Michał Żygowski | c8c75fa | 2022-04-25 14:59:17 +0200 | [diff] [blame] | 60 | { PCI_DID_INTEL_ADL_S_ID_1, "Alderlake-S (8+8)" }, |
| 61 | { PCI_DID_INTEL_ADL_S_ID_2, "Alderlake-S" }, |
| 62 | { PCI_DID_INTEL_ADL_S_ID_3, "Alderlake-S (8+4)" }, |
| 63 | { PCI_DID_INTEL_ADL_S_ID_4, "Alderlake-S" }, |
| 64 | { PCI_DID_INTEL_ADL_S_ID_5, "Alderlake-S (8+0)" }, |
| 65 | { PCI_DID_INTEL_ADL_S_ID_6, "Alderlake-S" }, |
| 66 | { PCI_DID_INTEL_ADL_S_ID_7, "Alderlake-S" }, |
| 67 | { PCI_DID_INTEL_ADL_S_ID_8, "Alderlake-S (6+4)" }, |
| 68 | { PCI_DID_INTEL_ADL_S_ID_9, "Alderlake-S" }, |
| 69 | { PCI_DID_INTEL_ADL_S_ID_10, "Alderlake-S (6+0)" }, |
| 70 | { PCI_DID_INTEL_ADL_S_ID_11, "Alderlake-S (4+0)" }, |
| 71 | { PCI_DID_INTEL_ADL_S_ID_12, "Alderlake-S (2+0)" }, |
| 72 | { PCI_DID_INTEL_ADL_S_ID_13, "Alderlake-S" }, |
| 73 | { PCI_DID_INTEL_ADL_S_ID_14, "Alderlake-S" }, |
Bora Guvendik | a15b25f | 2022-02-28 14:43:49 -0800 | [diff] [blame] | 74 | { PCI_DID_INTEL_RPL_P_ID_1, "Raptorlake-P" }, |
| 75 | { PCI_DID_INTEL_RPL_P_ID_2, "Raptorlake-P" }, |
zhixingma | 529a64b | 2022-06-13 15:06:27 -0700 | [diff] [blame] | 76 | { PCI_DID_INTEL_RPL_P_ID_3, "Raptorlake-P" }, |
Lawrence Chang | 0a5da51 | 2022-10-19 14:38:41 +0800 | [diff] [blame] | 77 | { PCI_DID_INTEL_RPL_P_ID_4, "Raptorlake-P" }, |
Marx Wang | 39ede0a | 2022-12-20 10:48:33 +0800 | [diff] [blame^] | 78 | { PCI_DID_INTEL_RPL_P_ID_5, "Raptorlake-P" }, |
zhixingma | 529a64b | 2022-06-13 15:06:27 -0700 | [diff] [blame] | 79 | |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | static struct { |
| 83 | u16 espiid; |
| 84 | const char *name; |
| 85 | } pch_table[] = { |
Felix Singer | 43b7f41 | 2022-03-07 04:34:52 +0100 | [diff] [blame] | 86 | { PCI_DID_INTEL_ADP_M_N_ESPI_1, "Alderlake-N SKU" }, |
| 87 | { PCI_DID_INTEL_ADP_M_N_ESPI_2, "Alderlake-N SKU" }, |
Maximilian Brune | a0bc90e | 2022-08-08 12:30:47 +0200 | [diff] [blame] | 88 | { PCI_DID_INTEL_ADP_S_ESPI_H610E, "AlderLake-S H610E" }, |
| 89 | { PCI_DID_INTEL_ADP_S_ESPI_Q670E, "AlderLake-S Q670E" }, |
| 90 | { PCI_DID_INTEL_ADP_S_ESPI_R680E, "AlderLake-S R680E" }, |
Maximilian Brune | 667d0f8 | 2022-08-11 12:58:06 +0200 | [diff] [blame] | 91 | { PCI_DID_INTEL_ADP_S_ESPI_H610, "AlderLake-S H610" }, |
| 92 | { PCI_DID_INTEL_ADP_S_ESPI_B660, "AlderLake-S B660" }, |
| 93 | { PCI_DID_INTEL_ADP_S_ESPI_H670, "AlderLake-S H670" }, |
| 94 | { PCI_DID_INTEL_ADP_S_ESPI_Q670, "AlderLake-S Q670" }, |
| 95 | { PCI_DID_INTEL_ADP_S_ESPI_Z690, "AlderLake-S Z690" }, |
| 96 | { PCI_DID_INTEL_ADP_S_ESPI_W680, "AlderLake-S W680" }, |
| 97 | { PCI_DID_INTEL_ADP_S_ESPI_W685, "AlderLake-S W685" }, |
| 98 | { PCI_DID_INTEL_ADP_S_ESPI_WM690, "AlderLake-S WM690" }, |
| 99 | { PCI_DID_INTEL_ADP_S_ESPI_HM670, "AlderLake-S HM670" }, |
| 100 | { PCI_DID_INTEL_RPP_S_ESPI_0, "Raptorlake-S SKU" }, |
| 101 | { PCI_DID_INTEL_RPP_S_ESPI_1, "Raptorlake-S SKU" }, |
| 102 | { PCI_DID_INTEL_RPP_S_ESPI_2, "Raptorlake-S SKU" }, |
| 103 | { PCI_DID_INTEL_RPP_S_ESPI_3, "Raptorlake-S SKU" }, |
| 104 | { PCI_DID_INTEL_RPP_S_ESPI_4, "Raptorlake-S SKU" }, |
| 105 | { PCI_DID_INTEL_RPP_S_ESPI_5, "Raptorlake-S SKU" }, |
| 106 | { PCI_DID_INTEL_RPP_S_ESPI_6, "Raptorlake-S SKU" }, |
| 107 | { PCI_DID_INTEL_RPP_S_ESPI_7, "Raptorlake-S SKU" }, |
| 108 | { PCI_DID_INTEL_RPP_S_ESPI_8, "Raptorlake-S SKU" }, |
| 109 | { PCI_DID_INTEL_RPP_S_ESPI_9, "Raptorlake-S SKU" }, |
| 110 | { PCI_DID_INTEL_RPP_S_ESPI_10, "Raptorlake-S SKU" }, |
| 111 | { PCI_DID_INTEL_RPP_S_ESPI_11, "Raptorlake-S SKU" }, |
| 112 | { PCI_DID_INTEL_RPP_S_ESPI_HM770, "Raptorlake-S HM770" }, |
| 113 | { PCI_DID_INTEL_RPP_S_ESPI_WM790, "Raptorlake-S WM790" }, |
| 114 | { PCI_DID_INTEL_RPP_S_ESPI_14, "Raptorlake-S SKU" }, |
| 115 | { PCI_DID_INTEL_RPP_S_ESPI_15, "Raptorlake-S SKU" }, |
| 116 | { PCI_DID_INTEL_RPP_S_ESPI_16, "Raptorlake-S SKU" }, |
| 117 | { PCI_DID_INTEL_RPP_S_ESPI_17, "Raptorlake-S SKU" }, |
| 118 | { PCI_DID_INTEL_RPP_S_ESPI_18, "Raptorlake-S SKU" }, |
| 119 | { PCI_DID_INTEL_RPP_S_ESPI_19, "Raptorlake-S SKU" }, |
| 120 | { PCI_DID_INTEL_RPP_S_ESPI_20, "Raptorlake-S SKU" }, |
| 121 | { PCI_DID_INTEL_RPP_S_ESPI_21, "Raptorlake-S SKU" }, |
| 122 | { PCI_DID_INTEL_RPP_S_ESPI_22, "Raptorlake-S SKU" }, |
| 123 | { PCI_DID_INTEL_RPP_S_ESPI_23, "Raptorlake-S SKU" }, |
| 124 | { PCI_DID_INTEL_RPP_S_ESPI_24, "Raptorlake-S SKU" }, |
| 125 | { PCI_DID_INTEL_RPP_S_ESPI_25, "Raptorlake-S SKU" }, |
| 126 | { PCI_DID_INTEL_RPP_S_ESPI_26, "Raptorlake-S SKU" }, |
| 127 | { PCI_DID_INTEL_RPP_S_ESPI_27, "Raptorlake-S SKU" }, |
| 128 | { PCI_DID_INTEL_RPP_S_ESPI_28, "Raptorlake-S SKU" }, |
| 129 | { PCI_DID_INTEL_RPP_S_ESPI_29, "Raptorlake-S SKU" }, |
| 130 | { PCI_DID_INTEL_RPP_S_ESPI_30, "Raptorlake-S SKU" }, |
| 131 | { PCI_DID_INTEL_RPP_S_ESPI_31, "Raptorlake-S SKU" }, |
Bora Guvendik | a15b25f | 2022-02-28 14:43:49 -0800 | [diff] [blame] | 132 | { PCI_DID_INTEL_RPP_P_ESPI_0, "Raptorlake-P SKU" }, |
| 133 | { PCI_DID_INTEL_RPP_P_ADP_P_ESPI_1, "Raptorlake-P SKU" }, |
| 134 | { PCI_DID_INTEL_RPP_P_ADP_P_ESPI_2, "Raptorlake-P SKU" }, |
| 135 | { PCI_DID_INTEL_RPP_P_ESPI_3, "Raptorlake-P SKU" }, |
| 136 | { PCI_DID_INTEL_RPP_P_ESPI_4, "Raptorlake-P SKU" }, |
| 137 | { PCI_DID_INTEL_RPP_P_ESPI_5, "Raptorlake-P SKU" }, |
| 138 | { PCI_DID_INTEL_RPP_P_ADP_M_ESPI_6, "Raptorlake-P SKU" }, |
| 139 | { PCI_DID_INTEL_RPP_P_ESPI_7, "Raptorlake-P SKU" }, |
| 140 | { PCI_DID_INTEL_RPP_P_ESPI_8, "Raptorlake-P SKU" }, |
| 141 | { PCI_DID_INTEL_RPP_P_ESPI_9, "Raptorlake-P SKU" }, |
| 142 | { PCI_DID_INTEL_RPP_P_ESPI_10, "Raptorlake-P SKU" }, |
| 143 | { PCI_DID_INTEL_RPP_P_ESPI_11, "Raptorlake-P SKU" }, |
| 144 | { PCI_DID_INTEL_RPP_P_ESPI_12, "Raptorlake-P SKU" }, |
| 145 | { PCI_DID_INTEL_RPP_P_ESPI_13, "Raptorlake-P SKU" }, |
| 146 | { PCI_DID_INTEL_RPP_P_ESPI_14, "Raptorlake-P SKU" }, |
| 147 | { PCI_DID_INTEL_RPP_P_ESPI_15, "Raptorlake-P SKU" }, |
| 148 | { PCI_DID_INTEL_RPP_P_ESPI_16, "Raptorlake-P SKU" }, |
| 149 | { PCI_DID_INTEL_RPP_P_ESPI_17, "Raptorlake-P SKU" }, |
| 150 | { PCI_DID_INTEL_RPP_P_ESPI_18, "Raptorlake-P SKU" }, |
| 151 | { PCI_DID_INTEL_RPP_P_ESPI_19, "Raptorlake-P SKU" }, |
| 152 | { PCI_DID_INTEL_RPP_P_ESPI_20, "Raptorlake-P SKU" }, |
| 153 | { PCI_DID_INTEL_RPP_P_ESPI_21, "Raptorlake-P SKU" }, |
| 154 | { PCI_DID_INTEL_RPP_P_ESPI_22, "Raptorlake-P SKU" }, |
| 155 | { PCI_DID_INTEL_RPP_P_ESPI_23, "Raptorlake-P SKU" }, |
| 156 | { PCI_DID_INTEL_RPP_P_ESPI_24, "Raptorlake-P SKU" }, |
| 157 | { PCI_DID_INTEL_RPP_P_ESPI_25, "Raptorlake-P SKU" }, |
| 158 | { PCI_DID_INTEL_RPP_P_ESPI_26, "Raptorlake-P SKU" }, |
| 159 | { PCI_DID_INTEL_RPP_P_ESPI_27, "Raptorlake-P SKU" }, |
| 160 | { PCI_DID_INTEL_RPP_P_ESPI_28, "Raptorlake-P SKU" }, |
| 161 | { PCI_DID_INTEL_RPP_P_ESPI_29, "Raptorlake-P SKU" }, |
| 162 | { PCI_DID_INTEL_RPP_P_ESPI_30, "Raptorlake-P SKU" }, |
| 163 | { PCI_DID_INTEL_RPP_P_ESPI_31, "Raptorlake-P SKU" }, |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 164 | }; |
| 165 | |
| 166 | static struct { |
| 167 | u16 igdid; |
| 168 | const char *name; |
| 169 | } igd_table[] = { |
Felix Singer | 43b7f41 | 2022-03-07 04:34:52 +0100 | [diff] [blame] | 170 | { PCI_DID_INTEL_ADL_GT0, "Alderlake GT0" }, |
| 171 | { PCI_DID_INTEL_ADL_GT1, "Alderlake GT1" }, |
| 172 | { PCI_DID_INTEL_ADL_GT1_1, "Alderlake GT1" }, |
| 173 | { PCI_DID_INTEL_ADL_GT1_2, "Alderlake GT1" }, |
| 174 | { PCI_DID_INTEL_ADL_GT1_3, "Alderlake GT1" }, |
| 175 | { PCI_DID_INTEL_ADL_GT1_4, "Alderlake GT1" }, |
| 176 | { PCI_DID_INTEL_ADL_GT1_5, "Alderlake GT1" }, |
| 177 | { PCI_DID_INTEL_ADL_GT1_6, "Alderlake GT1" }, |
| 178 | { PCI_DID_INTEL_ADL_GT1_7, "Alderlake GT1" }, |
| 179 | { PCI_DID_INTEL_ADL_GT1_8, "Alderlake GT1" }, |
| 180 | { PCI_DID_INTEL_ADL_GT1_9, "Alderlake GT1" }, |
| 181 | { PCI_DID_INTEL_ADL_P_GT2, "Alderlake P GT2" }, |
| 182 | { PCI_DID_INTEL_ADL_P_GT2_1, "Alderlake P GT2" }, |
| 183 | { PCI_DID_INTEL_ADL_P_GT2_2, "Alderlake P GT2" }, |
| 184 | { PCI_DID_INTEL_ADL_P_GT2_3, "Alderlake P GT2" }, |
| 185 | { PCI_DID_INTEL_ADL_P_GT2_4, "Alderlake P GT2" }, |
| 186 | { PCI_DID_INTEL_ADL_P_GT2_5, "Alderlake P GT2" }, |
| 187 | { PCI_DID_INTEL_ADL_P_GT2_6, "Alderlake P GT2" }, |
| 188 | { PCI_DID_INTEL_ADL_P_GT2_7, "Alderlake P GT2" }, |
| 189 | { PCI_DID_INTEL_ADL_P_GT2_8, "Alderlake P GT2" }, |
| 190 | { PCI_DID_INTEL_ADL_P_GT2_9, "Alderlake P GT2" }, |
| 191 | { PCI_DID_INTEL_ADL_M_GT1, "Alderlake M GT1" }, |
| 192 | { PCI_DID_INTEL_ADL_M_GT2, "Alderlake M GT2" }, |
| 193 | { PCI_DID_INTEL_ADL_M_GT3, "Alderlake M GT3" }, |
| 194 | { PCI_DID_INTEL_ADL_N_GT1, "Alderlake N GT1" }, |
| 195 | { PCI_DID_INTEL_ADL_N_GT2, "Alderlake N GT2" }, |
| 196 | { PCI_DID_INTEL_ADL_N_GT3, "Alderlake N GT3" }, |
Michał Żygowski | c8c75fa | 2022-04-25 14:59:17 +0200 | [diff] [blame] | 197 | { PCI_DID_INTEL_ADL_S_GT1, "Alderlake S GT1" }, |
| 198 | { PCI_DID_INTEL_ADL_S_GT1_1, "Alderlake S GT1" }, |
| 199 | { PCI_DID_INTEL_ADL_S_GT2, "Alderlake S GT2" }, |
| 200 | { PCI_DID_INTEL_ADL_S_GT2_1, "Alderlake S GT2" }, |
| 201 | { PCI_DID_INTEL_ADL_S_GT2_2, "Alderlake S GT2" }, |
Bora Guvendik | a15b25f | 2022-02-28 14:43:49 -0800 | [diff] [blame] | 202 | { PCI_DID_INTEL_RPL_P_GT1, "Raptorlake P GT1" }, |
| 203 | { PCI_DID_INTEL_RPL_P_GT2, "Raptorlake P GT2" }, |
| 204 | { PCI_DID_INTEL_RPL_P_GT3, "Raptorlake P GT3" }, |
zhixingma | 529a64b | 2022-06-13 15:06:27 -0700 | [diff] [blame] | 205 | { PCI_DID_INTEL_RPL_P_GT4, "Raptorlake P GT4" }, |
| 206 | { PCI_DID_INTEL_RPL_P_GT5, "Raptorlake P GT5" }, |
| 207 | { PCI_DID_INTEL_RPL_P_GT6, "Raptorlake P GT6" }, |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 208 | }; |
| 209 | |
| 210 | static inline uint8_t get_dev_revision(pci_devfn_t dev) |
| 211 | { |
| 212 | return pci_read_config8(dev, PCI_REVISION_ID); |
| 213 | } |
| 214 | |
| 215 | static inline uint16_t get_dev_id(pci_devfn_t dev) |
| 216 | { |
| 217 | return pci_read_config16(dev, PCI_DEVICE_ID); |
| 218 | } |
| 219 | |
Subrata Banik | 55f5410 | 2021-07-23 21:04:41 +0530 | [diff] [blame] | 220 | static void report_cache_info(void) |
| 221 | { |
| 222 | int cache_level = CACHE_L3; |
| 223 | struct cpu_cache_info info; |
| 224 | |
| 225 | if (!fill_cpu_cache_info(cache_level, &info)) |
| 226 | return; |
| 227 | |
| 228 | printk(BIOS_INFO, "Cache: Level %d: ", cache_level); |
| 229 | printk(BIOS_INFO, "Associativity = %zd Partitions = %zd Line Size = %zd Sets = %zd\n", |
| 230 | info.num_ways, info.physical_partitions, info.line_size, info.num_sets); |
| 231 | |
Arthur Heymans | 138db06 | 2022-02-18 13:06:59 +0100 | [diff] [blame] | 232 | printk(BIOS_INFO, "Cache size = %zu MiB\n", get_cache_size(&info)/MiB); |
Subrata Banik | 55f5410 | 2021-07-23 21:04:41 +0530 | [diff] [blame] | 233 | } |
| 234 | |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 235 | static void report_cpu_info(void) |
| 236 | { |
| 237 | u32 i, cpu_id, cpu_feature_flag; |
| 238 | char cpu_name[49]; |
| 239 | int vt, txt, aes; |
| 240 | static const char *const mode[] = {"NOT ", ""}; |
| 241 | const char *cpu_type = "Unknown"; |
| 242 | |
| 243 | fill_processor_name(cpu_name); |
| 244 | cpu_id = cpu_get_cpuid(); |
| 245 | |
| 246 | /* Look for string to match the name */ |
| 247 | for (i = 0; i < ARRAY_SIZE(cpu_table); i++) { |
| 248 | if (cpu_table[i].cpuid == cpu_id) { |
| 249 | cpu_type = cpu_table[i].name; |
| 250 | break; |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | printk(BIOS_DEBUG, "CPU: %s\n", cpu_name); |
| 255 | printk(BIOS_DEBUG, "CPU: ID %x, %s, ucode: %08x\n", |
| 256 | cpu_id, cpu_type, get_current_microcode_rev()); |
| 257 | |
| 258 | cpu_feature_flag = cpu_get_feature_flags_ecx(); |
| 259 | aes = !!(cpu_feature_flag & CPUID_AES); |
| 260 | txt = !!(cpu_feature_flag & CPUID_SMX); |
| 261 | vt = !!(cpu_feature_flag & CPUID_VMX); |
| 262 | printk(BIOS_DEBUG, |
| 263 | "CPU: AES %ssupported, TXT %ssupported, VT %ssupported\n", |
| 264 | mode[aes], mode[txt], mode[vt]); |
Subrata Banik | 55f5410 | 2021-07-23 21:04:41 +0530 | [diff] [blame] | 265 | |
| 266 | report_cache_info(); |
Subrata Banik | b3ced6a | 2020-08-04 13:34:03 +0530 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | static void report_mch_info(void) |
| 270 | { |
| 271 | int i; |
| 272 | uint16_t mchid = get_dev_id(SA_DEV_ROOT); |
| 273 | const char *mch_type = "Unknown"; |
| 274 | |
| 275 | for (i = 0; i < ARRAY_SIZE(mch_table); i++) { |
| 276 | if (mch_table[i].mchid == mchid) { |
| 277 | mch_type = mch_table[i].name; |
| 278 | break; |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | printk(BIOS_DEBUG, "MCH: device id %04x (rev %02x) is %s\n", |
| 283 | mchid, get_dev_revision(SA_DEV_ROOT), mch_type); |
| 284 | } |
| 285 | |
| 286 | static void report_pch_info(void) |
| 287 | { |
| 288 | int i; |
| 289 | pci_devfn_t dev = PCH_DEV_ESPI; |
| 290 | uint16_t espiid = get_dev_id(dev); |
| 291 | const char *pch_type = "Unknown"; |
| 292 | |
| 293 | for (i = 0; i < ARRAY_SIZE(pch_table); i++) { |
| 294 | if (pch_table[i].espiid == espiid) { |
| 295 | pch_type = pch_table[i].name; |
| 296 | break; |
| 297 | } |
| 298 | } |
| 299 | printk(BIOS_DEBUG, "PCH: device id %04x (rev %02x) is %s\n", |
| 300 | espiid, get_dev_revision(dev), pch_type); |
| 301 | } |
| 302 | |
| 303 | static void report_igd_info(void) |
| 304 | { |
| 305 | int i; |
| 306 | pci_devfn_t dev = SA_DEV_IGD; |
| 307 | uint16_t igdid = get_dev_id(dev); |
| 308 | const char *igd_type = "Unknown"; |
| 309 | |
| 310 | for (i = 0; i < ARRAY_SIZE(igd_table); i++) { |
| 311 | if (igd_table[i].igdid == igdid) { |
| 312 | igd_type = igd_table[i].name; |
| 313 | break; |
| 314 | } |
| 315 | } |
| 316 | printk(BIOS_DEBUG, "IGD: device id %04x (rev %02x) is %s\n", |
| 317 | igdid, get_dev_revision(dev), igd_type); |
| 318 | } |
| 319 | |
| 320 | void report_platform_info(void) |
| 321 | { |
| 322 | report_cpu_info(); |
| 323 | report_mch_info(); |
| 324 | report_pch_info(); |
| 325 | report_igd_info(); |
| 326 | } |