haswell: Make VGA on FDI work

Attempting to light up a 1920x1080 monitor through VGA with libgfxinit
on Haswell would either hang the system or show garbage on the monitor.
This was due to two different problems around FDI initialization code.

The system would only hang if libgfxinit was the first program to light
up a monitor on VGA. This is because no one had performed the required
FDI mPHY initialization that is described on the Haswell graphics PRMs.
Add it to libgfxinit alongside some code to disable bending CLKOUT_DP.

Even with the FDI mPHY initialization in place, the garbage would still
be present on the VGA monitor. Digital interfaces were not affected.
By carefully dumping and comparing the display registers of a good and
a bad case, it was determinted that the fault was due to a mismatched
link width for FDI. The FDI link between the iGPU and the Lynxpoint PCH
can operate in either x1 or x2 width, depending on the bandwidth needs
of the monitor on the PCH's VGA port. To drive a 1920x1080 VGA monitor,
it is necessary to use both FDI lanes. Moreover, both ends of the link
need to be configured to use the same link width. However, the wrong
link width was assumed when configuring the display pipe, because
`DP.Lane_Count` was used unconditionally instead of `FDI.Lane_Count`.

After fixing both issues, gfx_test is able to light up a 1920x1080 VGA
monitor on the Asrock B85M Pro4 successfully, even after a S3 resume.

Change-Id: Ieabe3b7f947be2ef488ddb57bfeae85fa055d360
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/41343
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/common/haswell/hw-gfx-gma-pch-lynxpoint.ads b/common/haswell/hw-gfx-gma-pch-lynxpoint.ads
new file mode 100644
index 0000000..5782683
--- /dev/null
+++ b/common/haswell/hw-gfx-gma-pch-lynxpoint.ads
@@ -0,0 +1,21 @@
+--
+-- Copyright (C) 2020 Angel Pons <th3fanbus@gmail.com>
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License for more details.
+--
+
+package HW.GFX.GMA.PCH.Lynxpoint is
+
+   procedure Enable_Clkout_DP_And_FDI_mPHY;
+   procedure Disable_Clkout_DP;
+   procedure Unbend_Clkout_DP;
+
+end HW.GFX.GMA.PCH.Lynxpoint;