inteltool: Only use real graphics devices

Right now IGD is hard coded to 0:2.0 and if that
device is there, it is blindly used, even if it is
not a graphics device. Look at the PCI class to make
sure we're not using the wrong device.

Change-Id: Ia7f52071bd202e2960faba0f46e4fa5e14ad65f8
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46673
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/util/inteltool/inteltool.c b/util/inteltool/inteltool.c
index aadd0fb..3fb7707 100644
--- a/util/inteltool/inteltool.c
+++ b/util/inteltool/inteltool.c
@@ -773,13 +773,13 @@
 	}
 
 	gfx = pci_get_dev(pacc, 0, 0, 0x02, 0);
-
 	if (gfx) {
 		pci_fill_info(gfx, PCI_FILL_IDENT | PCI_FILL_BASES |
 				   PCI_FILL_CLASS);
-
-		if (gfx->vendor_id != PCI_VENDOR_ID_INTEL)
-			gfx = 0;
+		if ((gfx->device_class & 0xff00) != 0x0300)
+			gfx = NULL;
+		else if (gfx->vendor_id != PCI_VENDOR_ID_INTEL)
+			gfx = NULL;
 	}
 
 	if (sb->device_id == PCI_DEVICE_ID_INTEL_BAYTRAIL_LPC) {