gma: Get rid of Get_Pipe_Hint()

Now that we call it `Pipe_Index` passing that around makes more sense.

Change-Id: I59460274860dc5d135662aa978acc1603b510eb6
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17932
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
diff --git a/common/ironlake/hw-gfx-gma-connectors-edp.adb b/common/ironlake/hw-gfx-gma-connectors-edp.adb
index b6443fe..49c4039 100644
--- a/common/ironlake/hw-gfx-gma-connectors-edp.adb
+++ b/common/ironlake/hw-gfx-gma-connectors-edp.adb
@@ -25,8 +25,6 @@
 is
 
    DP_CTL_DISPLAYPORT_ENABLE        : constant :=  1 * 2 ** 31;
-   DP_CTL_PIPE_SELECT_MASK          : constant :=  3 * 2 ** 29;
-   DP_CTL_PIPE_SELECT_SHIFT         : constant :=           29;
    DP_CTL_VSWING_EMPH_SET_MASK      : constant := 63 * 2 ** 22;
    DP_CTL_PORT_WIDTH_MASK           : constant :=  7 * 2 ** 19;
    DP_CTL_PORT_WIDTH_1_LANE         : constant :=  0 * 2 ** 19;
@@ -48,6 +46,12 @@
    DP_CTL_HSYNC_ACTIVE_HIGH         : constant :=  1 * 2 **  3;
    DP_CTL_PORT_DETECT               : constant :=  1 * 2 **  2;
 
+   type Pipe_Value_Array is array (Pipe_Index) of Word32;
+   DP_CTL_PIPE_SELECT : constant Pipe_Value_Array :=
+     (Primary     => 0 * 2 ** 29,
+      Secondary   => 1 * 2 ** 29,
+      Tertiary    => 2 * 2 ** 29);
+
    -- TODO? Values are for Ivy Bridge only
    DP_CTL_VSWING_0_EMPH_0 : constant := 1 * 2 ** 27 + 1 * 2 ** 24 + 0 * 2 ** 22;
    DP_CTL_VSWING_0_EMPH_1 : constant := 1 * 2 ** 27 + 2 * 2 ** 24 + 2 * 2 ** 22;
@@ -176,16 +180,14 @@
 
    ----------------------------------------------------------------------------
 
-   procedure Pre_On
-     (Port_Cfg    : Port_Config;
-      Pipe_Hint   : Word32)
+   procedure Pre_On (Pipe : Pipe_Index; Port_Cfg : Port_Config)
    is
       DP_CTL_Set : Word32;
    begin
       pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
 
       DP_CTL_Set :=
-         Shift_Left (Pipe_Hint, DP_CTL_PIPE_SELECT_SHIFT) or
+         DP_CTL_PIPE_SELECT (Pipe) or
          DP_CTL_PORT_WIDTH (Port_Cfg.DP.Lane_Count);
 
       if Port_Cfg.DP.Enhanced_Framing then
diff --git a/common/ironlake/hw-gfx-gma-connectors-edp.ads b/common/ironlake/hw-gfx-gma-connectors-edp.ads
index c74a9cc..c43d586 100644
--- a/common/ironlake/hw-gfx-gma-connectors-edp.ads
+++ b/common/ironlake/hw-gfx-gma-connectors-edp.ads
@@ -15,9 +15,7 @@
 private package HW.GFX.GMA.Connectors.EDP
 is
 
-   procedure Pre_On
-     (Port_Cfg    : Port_Config;
-      Pipe_Hint   : Word32);
+   procedure Pre_On (Pipe : Pipe_Index; Port_Cfg : Port_Config);
 
    procedure Post_On
      (Link     : in     DP_Link;
diff --git a/common/ironlake/hw-gfx-gma-connectors.adb b/common/ironlake/hw-gfx-gma-connectors.adb
index e94ae2e..7d00fa6 100644
--- a/common/ironlake/hw-gfx-gma-connectors.adb
+++ b/common/ironlake/hw-gfx-gma-connectors.adb
@@ -40,16 +40,16 @@
    ----------------------------------------------------------------------------
 
    procedure Pre_On
-     (Port_Cfg    : in     Port_Config;
+     (Pipe        : in     Pipe_Index;
+      Port_Cfg    : in     Port_Config;
       PLL_Hint    : in     Word32;
-      Pipe_Hint   : in     Word32;
       Success     :    out Boolean)
    is
    begin
       pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
 
       if Port_Cfg.Port = DIGI_A then
-         EDP.Pre_On (Port_Cfg, Pipe_Hint);
+         EDP.Pre_On (Pipe, Port_Cfg);
       elsif Port_Cfg.Port in FDI.GPU_FDI_Port then
          FDI.Pre_On (Port_Cfg);
       end if;