summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2016-09-06 23:53:32 +0200
committerMartin Roth <martinroth@google.com>2016-10-12 22:57:05 +0200
commit62f4dad88db2640d829c41e787c1c94fd40469ff (patch)
tree4d410a3bae1a848ce359b3d1a5594df953d4e965
parent4aa295ca2812e0d53006628fe29b877c46cfdcc0 (diff)
downloadcoreboot-62f4dad88db2640d829c41e787c1c94fd40469ff.tar.xz
i945/gma.c: Only init LVDS if it is detected
Some devices have no LVDS output but if no VGA is connected or no EDID can be found, it will try to init LVDS. This patch detects the presence of an LVDS panel and makes sure that LVDS is not initialized when it is absent. Change-Id: Ie15631514535bab6c881c1f52e9edbfb8aaa5db7 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/16513 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com>
-rw-r--r--src/northbridge/intel/i945/gma.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c
index eeb377aaa8..7fcd67020c 100644
--- a/src/northbridge/intel/i945/gma.c
+++ b/src/northbridge/intel/i945/gma.c
@@ -557,18 +557,20 @@ static int intel_gma_init_vga(struct northbridge_intel_i945_config *conf,
/* compare the header of the vga edid header */
/* if vga is not connected it should have a correct header */
-static int vga_connected(u8 *pmmio) {
+static int probe_edid(u8 *pmmio, u8 slave)
+{
u8 vga_edid[128];
u8 header[8] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
- intel_gmbus_read_edid(pmmio + GMBUS0, 2, 0x50, vga_edid, 128);
+ intel_gmbus_read_edid(pmmio + GMBUS0, slave, 0x50, vga_edid, 128);
intel_gmbus_stop(pmmio + GMBUS0);
for (int i = 0; i < 8; i++) {
if (vga_edid[i] != header[i]) {
- printk(BIOS_DEBUG, "VGA not connected. Using LVDS display\n");
+ printk(BIOS_DEBUG, "No display connected on slave %d\n",
+ slave);
return 0;
}
}
- printk(BIOS_SPEW, "VGA display connected\n");
+ printk(BIOS_SPEW, "Found a display on slave %d\n", slave);
return 1;
}
@@ -613,7 +615,9 @@ static void gma_func0_init(struct device *dev)
);
int err;
- if (vga_connected(mmiobase))
+ /* probe if VGA is connected and alway run */
+ /* VGA init if no LVDS is connected */
+ if (!probe_edid(mmiobase, 3) || probe_edid(mmiobase, 2))
err = intel_gma_init_vga(conf, pci_read_config32(dev, 0x5c) & ~0xf,
iobase, mmiobase, graphics_base);
else