Felix Singer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36315 )
Change subject: inteltool: Add method 'print_system_information' ......................................................................
inteltool: Add method 'print_system_information'
To get a better idea what this code does, this patch adds a new method called 'print_system_info'.
Change-Id: I16f1c9cdc402b1a816fac65d1490432e39c07baf Signed-off-by: Felix Singer felix.singer@9elements.com --- M util/inteltool/inteltool.c 1 file changed, 44 insertions(+), 38 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/36315/1
diff --git a/util/inteltool/inteltool.c b/util/inteltool/inteltool.c index db80bd2..830cdcd 100644 --- a/util/inteltool/inteltool.c +++ b/util/inteltool/inteltool.c @@ -502,15 +502,55 @@ exit(1); }
+static void print_system_info(struct pci_dev *nb, struct pci_dev *sb, struct pci_dev *gfx) +{ + unsigned int id, i; + char *sbname = "unknown", *nbname = "unknown", *gfxname = "unknown"; + + id = cpuid(1); + + /* Determine names */ + for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) { + if (nb->device_id == supported_chips_list[i].device_id) + nbname = supported_chips_list[i].name; + } + for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) { + if (sb->device_id == supported_chips_list[i].device_id) + sbname = supported_chips_list[i].name; + } + if (gfx) { + for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) + if (gfx->device_id == supported_chips_list[i].device_id) + gfxname = supported_chips_list[i].name; + } + + /* Intel has suggested applications to display the family of a CPU as + * the sum of the "Family" and the "Extended Family" fields shown + * above, and the model as the sum of the "Model" and the 4-bit + * left-shifted "Extended Model" fields. + * http://download.intel.com/design/processor/applnots/24161832.pdf + */ + printf("CPU: ID 0x%x, Processor Type 0x%x, Family 0x%x, Model 0x%x, Stepping 0x%x\n", + id, (id >> 12) & 0x3, ((id >> 8) & 0xf) + ((id >> 20) & 0xff), + ((id >> 12) & 0xf0) + ((id >> 4) & 0xf), (id & 0xf)); + + printf("Northbridge: %04x:%04x (%s)\n", + nb->vendor_id, nb->device_id, nbname); + + printf("Southbridge: %04x:%04x (%s)\n", + sb->vendor_id, sb->device_id, sbname); + + if (gfx) + printf("IGD: %04x:%04x (%s)\n", + gfx->vendor_id, gfx->device_id, gfxname); +} + int main(int argc, char *argv[]) { struct pci_access *pacc; struct pci_dev *sb = NULL, *nb, *gfx = NULL, *ahci = NULL, *dev; const char *dump_spd_file = NULL; int opt, option_index = 0; - unsigned int id, i; - - char *sbname = "unknown", *nbname = "unknown", *gfxname = "unknown";
int dump_gpios = 0, dump_mchbar = 0, dump_rcba = 0; int dump_pmbase = 0, dump_epbar = 0, dump_dmibar = 0; @@ -737,43 +777,9 @@ ahci = NULL; }
- id = cpuid(1); - - /* Intel has suggested applications to display the family of a CPU as - * the sum of the "Family" and the "Extended Family" fields shown - * above, and the model as the sum of the "Model" and the 4-bit - * left-shifted "Extended Model" fields. - * http://download.intel.com/design/processor/applnots/24161832.pdf - */ - printf("CPU: ID 0x%x, Processor Type 0x%x, Family 0x%x, Model 0x%x, Stepping 0x%x\n", - id, (id >> 12) & 0x3, ((id >> 8) & 0xf) + ((id >> 20) & 0xff), - ((id >> 12) & 0xf0) + ((id >> 4) & 0xf), (id & 0xf)); - - /* Determine names */ - for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) - if (nb->device_id == supported_chips_list[i].device_id) - nbname = supported_chips_list[i].name; - for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) - if (sb->device_id == supported_chips_list[i].device_id) - sbname = supported_chips_list[i].name; - if (gfx) { - for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) - if (gfx->device_id == supported_chips_list[i].device_id) - gfxname = supported_chips_list[i].name; - } - - printf("Northbridge: %04x:%04x (%s)\n", - nb->vendor_id, nb->device_id, nbname); - - printf("Southbridge: %04x:%04x (%s)\n", - sb->vendor_id, sb->device_id, sbname); - - if (gfx) - printf("IGD: %04x:%04x (%s)\n", - gfx->vendor_id, gfx->device_id, gfxname); + print_system_info(nb, sb, gfx);
/* Now do the deed */ - if (dump_gpios) { print_gpios(sb, 1, show_gpio_diffs); printf("\n\n");
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36315 )
Change subject: inteltool: Add method 'print_system_information' ......................................................................
Patch Set 1: Code-Review+1
Hello Angel Pons, Michael Niewöhner, Stefan Reinauer, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36315
to look at the new patch set (#2).
Change subject: inteltool: Add method 'print_system_info' ......................................................................
inteltool: Add method 'print_system_info'
To get a better idea what this code does, this patch adds a new method called 'print_system_info'.
Change-Id: I16f1c9cdc402b1a816fac65d1490432e39c07baf Signed-off-by: Felix Singer felix.singer@9elements.com --- M util/inteltool/inteltool.c 1 file changed, 44 insertions(+), 38 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/36315/2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36315 )
Change subject: inteltool: Add method 'print_system_info' ......................................................................
Patch Set 2: Code-Review+1
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36315 )
Change subject: inteltool: Add method 'print_system_info' ......................................................................
Patch Set 2: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/36315/2/util/inteltool/inteltool.c File util/inteltool/inteltool.c:
https://review.coreboot.org/c/coreboot/+/36315/2/util/inteltool/inteltool.c@... PS2, Line 538: nb->vendor_id, nb->device_id, nbname); Nit, no line break needed.
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/36315 )
Change subject: inteltool: Add method 'print_system_info' ......................................................................
inteltool: Add method 'print_system_info'
To get a better idea what this code does, this patch adds a new method called 'print_system_info'.
Change-Id: I16f1c9cdc402b1a816fac65d1490432e39c07baf Signed-off-by: Felix Singer felix.singer@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/36315 Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Michael Niewöhner Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M util/inteltool/inteltool.c 1 file changed, 44 insertions(+), 38 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Angel Pons: Looks good to me, but someone else must approve Michael Niewöhner: Looks good to me, but someone else must approve
diff --git a/util/inteltool/inteltool.c b/util/inteltool/inteltool.c index db80bd2..830cdcd 100644 --- a/util/inteltool/inteltool.c +++ b/util/inteltool/inteltool.c @@ -502,15 +502,55 @@ exit(1); }
+static void print_system_info(struct pci_dev *nb, struct pci_dev *sb, struct pci_dev *gfx) +{ + unsigned int id, i; + char *sbname = "unknown", *nbname = "unknown", *gfxname = "unknown"; + + id = cpuid(1); + + /* Determine names */ + for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) { + if (nb->device_id == supported_chips_list[i].device_id) + nbname = supported_chips_list[i].name; + } + for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) { + if (sb->device_id == supported_chips_list[i].device_id) + sbname = supported_chips_list[i].name; + } + if (gfx) { + for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) + if (gfx->device_id == supported_chips_list[i].device_id) + gfxname = supported_chips_list[i].name; + } + + /* Intel has suggested applications to display the family of a CPU as + * the sum of the "Family" and the "Extended Family" fields shown + * above, and the model as the sum of the "Model" and the 4-bit + * left-shifted "Extended Model" fields. + * http://download.intel.com/design/processor/applnots/24161832.pdf + */ + printf("CPU: ID 0x%x, Processor Type 0x%x, Family 0x%x, Model 0x%x, Stepping 0x%x\n", + id, (id >> 12) & 0x3, ((id >> 8) & 0xf) + ((id >> 20) & 0xff), + ((id >> 12) & 0xf0) + ((id >> 4) & 0xf), (id & 0xf)); + + printf("Northbridge: %04x:%04x (%s)\n", + nb->vendor_id, nb->device_id, nbname); + + printf("Southbridge: %04x:%04x (%s)\n", + sb->vendor_id, sb->device_id, sbname); + + if (gfx) + printf("IGD: %04x:%04x (%s)\n", + gfx->vendor_id, gfx->device_id, gfxname); +} + int main(int argc, char *argv[]) { struct pci_access *pacc; struct pci_dev *sb = NULL, *nb, *gfx = NULL, *ahci = NULL, *dev; const char *dump_spd_file = NULL; int opt, option_index = 0; - unsigned int id, i; - - char *sbname = "unknown", *nbname = "unknown", *gfxname = "unknown";
int dump_gpios = 0, dump_mchbar = 0, dump_rcba = 0; int dump_pmbase = 0, dump_epbar = 0, dump_dmibar = 0; @@ -737,43 +777,9 @@ ahci = NULL; }
- id = cpuid(1); - - /* Intel has suggested applications to display the family of a CPU as - * the sum of the "Family" and the "Extended Family" fields shown - * above, and the model as the sum of the "Model" and the 4-bit - * left-shifted "Extended Model" fields. - * http://download.intel.com/design/processor/applnots/24161832.pdf - */ - printf("CPU: ID 0x%x, Processor Type 0x%x, Family 0x%x, Model 0x%x, Stepping 0x%x\n", - id, (id >> 12) & 0x3, ((id >> 8) & 0xf) + ((id >> 20) & 0xff), - ((id >> 12) & 0xf0) + ((id >> 4) & 0xf), (id & 0xf)); - - /* Determine names */ - for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) - if (nb->device_id == supported_chips_list[i].device_id) - nbname = supported_chips_list[i].name; - for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) - if (sb->device_id == supported_chips_list[i].device_id) - sbname = supported_chips_list[i].name; - if (gfx) { - for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) - if (gfx->device_id == supported_chips_list[i].device_id) - gfxname = supported_chips_list[i].name; - } - - printf("Northbridge: %04x:%04x (%s)\n", - nb->vendor_id, nb->device_id, nbname); - - printf("Southbridge: %04x:%04x (%s)\n", - sb->vendor_id, sb->device_id, sbname); - - if (gfx) - printf("IGD: %04x:%04x (%s)\n", - gfx->vendor_id, gfx->device_id, gfxname); + print_system_info(nb, sb, gfx);
/* Now do the deed */ - if (dump_gpios) { print_gpios(sb, 1, show_gpio_diffs); printf("\n\n");