gma config: Introduce Has_New_FDI_(Sink|Source)
Change-Id: Ib9a5951abf62ed01583ad028bc944c0135744457
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/27051
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index 398b340..c6af93a 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -87,6 +87,8 @@
Has_DPLL_SEL : constant Boolean := CPU in Ironlake .. Ivybridge;
Has_FDI_BPC : constant Boolean := CPU in Ironlake .. Ivybridge;
Has_FDI_Composite_Sel : constant Boolean := CPU = Ivybridge;
+ Has_New_FDI_Sink : constant Boolean := CPU >= Sandybridge;
+ Has_New_FDI_Source : constant Boolean := CPU >= Ivybridge;
Has_Trans_DP_Ctl : constant Boolean := CPU in
Sandybridge .. Ivybridge;
Has_FDI_C : constant Boolean := CPU = Ivybridge;
diff --git a/common/hw-gfx-gma-pch-fdi.adb b/common/hw-gfx-gma-pch-fdi.adb
index 95bc19f..53756e2 100644
--- a/common/hw-gfx-gma-pch-fdi.adb
+++ b/common/hw-gfx-gma-pch-fdi.adb
@@ -30,7 +30,7 @@
FDI_RX_CTL_RAWCLK_TO_PCDCLK_SEL_RAWCLK : constant := 0 * 2 ** 4;
FDI_RX_CTL_RAWCLK_TO_PCDCLK_SEL_PCDCLK : constant := 1 * 2 ** 4;
- TP_SHIFT : constant := (if Config.CPU = Ironlake then 28 else 8);
+ TP_SHIFT : constant := (if Config.Has_New_FDI_Sink then 8 else 28);
FDI_RX_CTL_TRAINING_PATTERN_MASK : constant := 3 * 2 ** TP_SHIFT;
type TP_Array is array (Training_Pattern) of Word32;
diff --git a/common/hw-gfx-gma-pch.ads b/common/hw-gfx-gma-pch.ads
index 106d2e8..0acc852 100644
--- a/common/hw-gfx-gma-pch.ads
+++ b/common/hw-gfx-gma-pch.ads
@@ -23,16 +23,10 @@
-- common to all PCH outputs
PCH_TRANSCODER_SELECT_SHIFT : constant :=
- (case Config.CPU is
- when Ironlake => 30,
- when Sandybridge | Ivybridge => 29,
- when others => 0);
+ (if Config.Has_New_FDI_Sink then 29 else 30);
PCH_TRANSCODER_SELECT_MASK : constant :=
- (case Config.CPU is
- when Ironlake => 1 * 2 ** 30,
- when Sandybridge | Ivybridge => 3 * 2 ** 29,
- when others => 0);
+ (if Config.Has_New_FDI_Sink then 3 * 2 ** 29 else 1 * 2 ** 30);
type PCH_TRANSCODER_SELECT_Array is array (FDI_Port_Type) of Word32;
PCH_TRANSCODER_SELECT : constant PCH_TRANSCODER_SELECT_Array :=
diff --git a/common/ironlake/hw-gfx-gma-connectors-fdi.adb b/common/ironlake/hw-gfx-gma-connectors-fdi.adb
index f38c135..4eec9c9 100644
--- a/common/ironlake/hw-gfx-gma-connectors-fdi.adb
+++ b/common/ironlake/hw-gfx-gma-connectors-fdi.adb
@@ -40,7 +40,7 @@
FDI_TX_CTL_AUTO_TRAIN_ENABLE : constant := 1 * 2 ** 10;
FDI_TX_CTL_AUTO_TRAIN_DONE : constant := 1 * 2 ** 1;
- TP_SHIFT : constant := (if Config.CPU <= Sandybridge then 28 else 8);
+ TP_SHIFT : constant := (if Config.Has_New_FDI_Source then 8 else 28);
FDI_TX_CTL_TRAINING_PATTERN_MASK : constant := 3 * 2 ** TP_SHIFT;
FDI_TX_CTL_TRAINING_PATTERN_1 : constant := 0 * 2 ** TP_SHIFT;
FDI_TX_CTL_TRAINING_PATTERN_2 : constant := 1 * 2 ** TP_SHIFT;