gma: Introduce `PCH_Type`
We got this far without it but now there is a PCH (Cannon Point)
that is not fully compatible to its predecessors but works with
the same CPUs. First, introduce the type and make use of it in a
few cases. In a follow-up, we'll add the new PCH.
Change-Id: I9d4965f110da3613749023143cf75123e63ae76e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/48762
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/common/Makefile.inc b/common/Makefile.inc
index f2a2fbb..b1ed074 100644
--- a/common/Makefile.inc
+++ b/common/Makefile.inc
@@ -47,11 +47,13 @@
gfxinit-y += hw-gfx-framebuffer_filler.adb
gfxinit-y += hw-gfx-framebuffer_filler.ads
+CONFIG_GFX_GMA_PCH ?= No_PCH
CONFIG_GFX_GMA_PANEL_2_PORT ?= Disabled
CONFIG_GFX_GMA_GENERATION := $(call strip_quotes,$(CONFIG_GFX_GMA_GENERATION))
CONFIG_GFX_GMA_CPU := $(call strip_quotes,$(CONFIG_GFX_GMA_CPU))
CONFIG_GFX_GMA_CPU_VARIANT := $(call strip_quotes,$(CONFIG_GFX_GMA_CPU_VARIANT))
+CONFIG_GFX_GMA_PCH := $(call strip_quotes,$(CONFIG_GFX_GMA_PCH))
CONFIG_GFX_GMA_PANEL_1_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_PANEL_1_PORT))
CONFIG_GFX_GMA_PANEL_2_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_PANEL_2_PORT))
CONFIG_GFX_GMA_ANALOG_I2C_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_ANALOG_I2C_PORT))
@@ -76,6 +78,7 @@
GFX_GMA_COMMON_SUBSTITUTIONS := \
-e's/<<GEN>>/$(CONFIG_GFX_GMA_GENERATION)/' \
+ -e's/<<PCH>>/$(CONFIG_GFX_GMA_PCH)/' \
-e's/<<PANEL_1_PORT>>/$(CONFIG_GFX_GMA_PANEL_1_PORT)/' \
-e's/<<PANEL_2_PORT>>/$(CONFIG_GFX_GMA_PANEL_2_PORT)/' \
-e's/<<ANALOG_I2C_PORT>>/$(CONFIG_GFX_GMA_ANALOG_I2C_PORT)/' \
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index 241fe8e..820bf0e 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -43,6 +43,24 @@
CPU_Var : constant Gen_CPU_Variant := <<CPU_VARIANT>>;
+ PCH_First : constant PCH_Type :=
+ (case Gen is
+ when G45 => No_PCH,
+ when Ironlake => Ibex_Peak,
+ when Haswell => Lynx_Point,
+ when Broxton => No_PCH,
+ when Skylake => Sunrise_Point);
+ PCH_Last : constant PCH_Type :=
+ (case Gen is
+ when G45 => No_PCH,
+ when Ironlake => Cougar_Point,
+ when Haswell => Lynx_Point,
+ when Broxton => No_PCH,
+ when Skylake => Sunrise_Point);
+ subtype Gen_PCH_Type is PCH_Type range PCH_First .. PCH_Last;
+
+ PCH : constant Gen_PCH_Type := <<PCH>>;
+
Panel_Ports : constant array (Valid_Panels) of Port_Type :=
(Panel_1 => <<PANEL_1_PORT>>,
Panel_2 => <<PANEL_2_PORT>>);
@@ -145,6 +163,11 @@
Broadwell_On : <hswbool> :=
((Gen_Haswell and then CPU >= Broadwell) or Broxton_On);
+ PCH_Cougar_Point : <genbool> := Gen_Ironlake and then PCH = Cougar_Point;
+
+ Cougar_Point_On : <genbool> :=
+ ((Gen_Ironlake and then PCH >= Cougar_Point) or Haswell_On);
+
----------------------------------------------------------------------------
Have_HDMI_Buf_Override : constant Boolean := DDI_HDMI_Buffer_Translation >= 0;
@@ -188,7 +211,7 @@
Has_New_Backlight_Control : <genbool> := Gen_Broxton;
----------- PCH/FDI: ---------
- Has_PCH : <genbool> := not Gen_Broxton and not Gen_G45;
+ Has_PCH : <genbool> := PCH /= No_PCH;
Has_PCH_DAC : <hswbool> :=
(Gen_Ironlake or (Gen_Haswell and then not Is_LP));
@@ -201,9 +224,9 @@
Has_DPLL_SEL : <genbool> := Gen_Ironlake;
Has_FDI_BPC : <genbool> := Gen_Ironlake;
Has_FDI_Composite_Sel : <ilkbool> := CPU_Ivybridge;
- Has_New_FDI_Sink : <ilkbool> := Sandybridge_On;
+ Has_New_FDI_Sink : <genbool> := Cougar_Point_On;
Has_New_FDI_Source : <ilkbool> := Ivybridge_On;
- Has_Trans_DP_Ctl : <ilkbool> := CPU_Sandybridge or CPU_Ivybridge;
+ Has_Trans_DP_Ctl : <genbool> := PCH_Cougar_Point;
Has_FDI_C : <ilkbool> := CPU_Ivybridge;
Has_FDI_RX_Power_Down : <genbool> := Gen_Haswell;
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index 1215fc5..b6c491f 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -49,6 +49,13 @@
type CPU_Variant is (Normal, ULT, ULX);
+ type PCH_Type is
+ (No_PCH,
+ Ibex_Peak,
+ Cougar_Point, -- Panther Point compatible
+ Lynx_Point, -- Wildcat Point compatible
+ Sunrise_Point); -- Union Point compatible
+
type Port_Type is
(Disabled,
LVDS,