From e5ac16445f70486713b6533c2071c80eb66cc174 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 12 Mar 2008 11:54:51 +0000 Subject: Add --list-supported option which lists the supported ROM chips, chipsets, and mainboards Corresponding to flashrom svn r199 and coreboot v2 svn r3133. Signed-off-by: Uwe Hermann Acked-by: Ward Vandewege --- chipset_enable.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'chipset_enable.c') diff --git a/chipset_enable.c b/chipset_enable.c index 84cb191c..872f2549 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -561,6 +561,17 @@ static const FLASH_ENABLE enables[] = { {0x1166, 0x0205, "Broadcom HT-1000", enable_flash_ht1000}, }; +void print_supported_chipsets(void) +{ + int i; + + printf("\nSupported chipsets:\n\n"); + + for (i = 0; i < ARRAY_SIZE(enables); i++) + printf("%s (%04x:%04x)\n", enables[i].name, + enables[i].vendor, enables[i].device); +} + int chipset_flash_enable(void) { struct pci_dev *dev = 0; @@ -568,8 +579,7 @@ int chipset_flash_enable(void) int i; /* Now let's try to find the chipset we have... */ - /* TODO: Use ARRAY_SIZE. */ - for (i = 0; i < sizeof(enables) / sizeof(enables[0]); i++) { + for (i = 0; i < ARRAY_SIZE(enables); i++) { dev = pci_dev_find(enables[i].vendor, enables[i].device); if (dev) break; -- cgit v1.2.3