Nico Huber has uploaded this change for review.

View Change

gma hsw+: Don't use DDI E if DDI A uses all lanes

DDI E shares its two lanes with DDI A. If DDI A is configured to use
all four lanes, DDI E is disabled. As DDI E is the only DDI that can
be configured in FDI mode to feed the PCH DAC, treat `Analog` as in-
valid in this configuration.

Change-Id: I94e9537c9f30d0cbf757b816f38d44e1b43805b3
Signed-off-by: Nico Huber <nico.h@gmx.de>
---
M common/haswell_shared/hw-gfx-gma-port_detect.adb
M common/hw-gfx-gma-config.ads.template
2 files changed, 11 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/21/20821/1
diff --git a/common/haswell_shared/hw-gfx-gma-port_detect.adb b/common/haswell_shared/hw-gfx-gma-port_detect.adb
index d8a1d07..1302cf0 100644
--- a/common/haswell_shared/hw-gfx-gma-port_detect.adb
+++ b/common/haswell_shared/hw-gfx-gma-port_detect.adb
@@ -19,6 +19,8 @@
package body HW.GFX.GMA.Port_Detect
is

+ DDI_BUF_CTL_A_LANE_CAPABILITY_X4 : constant := 1 * 2 ** 4;
+
SFUSE_STRAP_CRT_DAC_CAP_DISABLE : constant := 1 * 2 ** 6;

HOTPLUG_CTL_DDI_A_HPD_INPUT_ENABLE : constant := 1 * 2 ** 4;
@@ -55,6 +57,7 @@

procedure Initialize
is
+ DDI_A_X4,
DAC_Disabled,
Internal_Detected,
DDI_Detected : Boolean;
@@ -71,13 +74,17 @@
DIGI_C => DP2,
DIGI_D => DP3);
begin
- if Config.Has_PCH_DAC then
+ if Config.Has_DDI_E and Config.Has_PCH_DAC then
-- PCH_DAC (_A)
+ Registers.Is_Set_Mask
+ (Register => Registers.DDI_BUF_CTL_A,
+ Mask => DDI_BUF_CTL_A_LANE_CAPABILITY_X4,
+ Result => DDI_A_X4);
Registers.Is_Set_Mask
(Register => Registers.SFUSE_STRAP,
Mask => SFUSE_STRAP_CRT_DAC_CAP_DISABLE,
Result => DAC_Disabled);
- Config.Valid_Port (Analog) := not DAC_Disabled;
+ Config.Valid_Port (Analog) := not (DDI_A_X4 or DAC_Disabled);
end if;

if Config.Internal_Is_EDP then
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index aba00bb..55696c7 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -91,6 +91,8 @@
Has_DDI_D : constant Boolean := CPU >= Haswell and
CPU_Var = Normal and
not Has_DDI_PHYs;
+ Has_DDI_E : constant Boolean := -- might be disabled by x4 eDP
+ Has_DDI_D;

Has_Low_Voltage_Swing : constant Boolean := CPU >= Broxton;

To view, visit change 20821. To unsubscribe, visit settings.

Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I94e9537c9f30d0cbf757b816f38d44e1b43805b3
Gerrit-Change-Number: 20821
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h@gmx.de>