gma config: Introduce Has_Tertiary_Pipe
And use it instead of `Supported_Pipe`.
Change-Id: Id3c4bdaf0d6b6c6126692b00cbabaf7d3f85b4bf
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/27048
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 90500ab..968ccc7 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -43,6 +43,7 @@
Has_Presence_Straps : constant Boolean := CPU /= Broxton;
----- CPU pipe: --------
+ Has_Tertiary_Pipe : constant Boolean := CPU >= Ivybridge;
Disable_Trickle_Feed : constant Boolean := not
(CPU in Haswell .. Broadwell);
Pipe_Enabled_Workaround : constant Boolean := CPU = Broadwell;
@@ -133,15 +134,7 @@
----------------------------------------------------------------------------
Max_Pipe : constant Pipe_Index :=
- (if CPU <= Sandybridge
- then Secondary
- else Tertiary);
-
- type Supported_Pipe_Array is array (Pipe_Index) of Boolean;
- Supported_Pipe : constant Supported_Pipe_Array :=
- (Primary => Primary <= Max_Pipe,
- Secondary => Secondary <= Max_Pipe,
- Tertiary => Tertiary <= Max_Pipe);
+ (if Has_Tertiary_Pipe then Tertiary else Secondary);
type Valid_Per_Port is array (Port_Type) of Boolean;
type Valid_Per_GPU is array (CPU_Type) of Valid_Per_Port;
diff --git a/common/hw-gfx-gma-config_helpers.adb b/common/hw-gfx-gma-config_helpers.adb
index b7f4833..57163a6 100644
--- a/common/hw-gfx-gma-config_helpers.adb
+++ b/common/hw-gfx-gma-config_helpers.adb
@@ -131,7 +131,7 @@
is
begin
Success :=
- Config.Supported_Pipe (Pipe) and then
+ (Config.Has_Tertiary_Pipe or Pipe <= Secondary) and then
Config.Valid_Port (Port) and then
Port /= Disabled; -- Valid_Port should already cover this, but the
-- array is writeable, so it's hard to prove this.