MCPcopy Create free account
hub / github.com/coreboot/coreboot / print_system_info

Function print_system_info

util/amdtool/amdtool.c:140–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static void print_system_info(struct pci_dev *nb, struct pci_dev *sb,
141 struct pci_dev *smb, struct pci_dev *gfx)
142{
143 unsigned int id, i;
144 char *sbname = "unknown", *nbname = "unknown", *gfxname = "unknown", *smbname = "unknown";
145
146 id = cpuid(1);
147
148 /* Determine names */
149 for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) {
150 if (nb->device_id == supported_chips_list[i].device_id)
151 nbname = supported_chips_list[i].name;
152 if (sb->device_id == supported_chips_list[i].device_id)
153 sbname = supported_chips_list[i].name;
154 if (smb->device_id == supported_chips_list[i].device_id)
155 smbname = supported_chips_list[i].name;
156 }
157 if (gfx) {
158 for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++)
159 if (gfx->device_id == supported_chips_list[i].device_id)
160 gfxname = supported_chips_list[i].name;
161 }
162 printf("CPU: ID 0x%x, Processor Type 0x%x, Family 0x%x, Model 0x%x, Stepping 0x%x\n",
163 id, (id >> 12) & 0x3, ((id >> 8) & 0xf) + ((id >> 20) & 0xff),
164 ((id >> 12) & 0xf0) + ((id >> 4) & 0xf), (id & 0xf));
165
166 printf("Northbridge: %04x:%04x (%s)\n",
167 nb->vendor_id, nb->device_id, nbname);
168
169 printf("Southbridge SMBus: %04x:%04x rev %02x (%s)\n",
170 smb->vendor_id, smb->device_id, pci_read_byte(smb, PCI_REVISION_ID), smbname);
171
172 printf("Southbridge LPC: %04x:%04x rev %02x (%s)\n",
173 sb->vendor_id, sb->device_id, pci_read_byte(sb, PCI_REVISION_ID), sbname);
174
175 if (gfx)
176 printf("Integrated Graphics: %04x:%04x (%s)\n",
177 gfx->vendor_id, gfx->device_id, gfxname);
178}
179
180int main(int argc, char *argv[])
181{

Callers 1

amdtool.cFile · 0.70

Calls 3

printfFunction · 0.85
pci_read_byteFunction · 0.85
cpuidFunction · 0.70

Tested by

no test coverage detected