hw-gfx-gma-i2c: Reduce EDID I2C timeout

The GMBUS statemachine on Intel C200 chipset is broken and never sets
the HW_RDY, TIMEOUT nor the NAK bit. Due to this silicon bug it runs
into the software timeout when no external display is connected.

Reduce the software timeout from 500msec to 50msec, the same limit that
is being used in the Linux kernel.

Reduces boot time on Lenovo X220 by 450msec when no external HDMI is
connected on the displayport connector.

TEST=Displayport monitor still works.
TEST=HDMI monitor using passive Displayport adapter cable still works.
TEST=LVDS is still working.

Change-Id: Ic8a357fdf345f32fd377b6d83efaa2550f607cac
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/89635
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Naresh <naresh.solanki.2011@gmail.com>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
diff --git a/common/hw-gfx-gma-i2c.adb b/common/hw-gfx-gma-i2c.adb
index 29ce9c1..2e0dde0 100644
--- a/common/hw-gfx-gma-i2c.adb
+++ b/common/hw-gfx-gma-i2c.adb
@@ -256,10 +256,15 @@
                         GMBUS1_DIRECTION_READ);
 
          while Success and then Transfered < Length loop
+	    -- Some GMBUS state machines never set HW_RDY nor NAK.
+	    --
+	    -- Keep delay at a minimum, but big enough that
+	    -- regular EDID transfers can be finished within
+	    -- the timeout.
             Registers.Wait_Set_Mask
               (Register => GMBUS_Regs (2),
                Mask     => GMBUS2_HARDWARE_READY,
-               TOut_MS  => 500);
+               TOut_MS  => 50);
 
             Registers.Read (GMBUS_Regs (2), GMBUS2);
             Success :=  (GMBUS2 and GMBUS2_HARDWARE_READY) /= 0 and