gma: Split `Internal` port type into `eDP` & `LVDS`

We used to have a single type `Internal`, in the GMA interface, to
represent the port for any internal panel. This seemed suitable as
all mainboard targets used the additional panel logic (power se-
quencing, backlight) only with either one of the eDP and LVDS ports.

However, the hardware allows to combine the panel logic also with
other ports. And some of the regular DP ports are even mentioned as
alternatives to the dedicated eDP port.

As a first step towards supporting such less common combinations,
we get rid of the single `Internal` type. All the panel logic still
assumes that either the dedicated eDP or the LVDS port is used for
an internal display. We introduce `Internal_Port_Type` to represent
eDP and LVDS, for this. But it should vanish, once the panel logic
is adapted.

Change-Id: Iadf3c11bd35d085cf47a961e800b0d96b79f62f5
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/38239
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: Nico Huber <nico.h@gmx.de>
diff --git a/common/haswell_shared/hw-gfx-gma-port_detect.adb b/common/haswell_shared/hw-gfx-gma-port_detect.adb
index 50c14cd..09136ff 100644
--- a/common/haswell_shared/hw-gfx-gma-port_detect.adb
+++ b/common/haswell_shared/hw-gfx-gma-port_detect.adb
@@ -87,41 +87,37 @@
          Config.Valid_Port (Analog) := not (DDI_A_X4 or DAC_Disabled);
       end if;
 
-      if Config.Internal_Is_EDP then
-         -- DDI_A
-         if Config.Has_Presence_Straps then
-            Registers.Is_Set_Mask
-              (Register => Registers.DDI_BUF_CTL_A,
-               Mask     => DDI_PORT_DETECTED (DIGI_A),
-               Result   => Internal_Detected);
-         else
-            Internal_Detected := True; -- XXX: Linux' i915 contains a fixme.
-         end if;
-         if Internal_Detected then
-            if Config.Has_HOTPLUG_CTL then
-               Registers.Set_Mask
-                 (Register => Registers.HOTPLUG_CTL,
-                  Mask     => HOTPLUG_CTL_DDI_A_HPD_INPUT_ENABLE or
-                              HOTPLUG_CTL_DDI_A_HPD_STATUS);   -- clear status
-               if Config.Has_SHOTPLUG_CTL_A then
-                  -- Have to enable south hotplug too on SoCs.
-                  Registers.Unset_And_Set_Mask
-                    (Register    => Registers.SHOTPLUG_CTL,
-                     Mask_Unset  => SHOTPLUG_CTL_DETECT_MASK,
-                     Mask_Set    => SHOTPLUG_CTL_HPD_INPUT_ENABLE (DIGI_A));
-               end if;
-            else
+      -- DDI_A
+      if Config.Has_Presence_Straps then
+         Registers.Is_Set_Mask
+           (Register => Registers.DDI_BUF_CTL_A,
+            Mask     => DDI_PORT_DETECTED (DIGI_A),
+            Result   => Internal_Detected);
+      else
+         Internal_Detected := True; -- XXX: Linux' i915 contains a fixme.
+      end if;
+      if Internal_Detected then
+         if Config.Has_HOTPLUG_CTL then
+            Registers.Set_Mask
+              (Register => Registers.HOTPLUG_CTL,
+               Mask     => HOTPLUG_CTL_DDI_A_HPD_INPUT_ENABLE or
+                           HOTPLUG_CTL_DDI_A_HPD_STATUS);   -- clear status
+            if Config.Has_SHOTPLUG_CTL_A then
+               -- Have to enable south hotplug too on SoCs.
                Registers.Unset_And_Set_Mask
                  (Register    => Registers.SHOTPLUG_CTL,
                   Mask_Unset  => SHOTPLUG_CTL_DETECT_MASK,
-                  Mask_Set    => SHOTPLUG_CTL_HPD_INPUT_ENABLE (DIGI_A) or
-                                 SHOTPLUG_CTL_HPD_STATUS (DIGI_A));  -- clear
+                  Mask_Set    => SHOTPLUG_CTL_HPD_INPUT_ENABLE (DIGI_A));
             end if;
+         else
+            Registers.Unset_And_Set_Mask
+              (Register    => Registers.SHOTPLUG_CTL,
+               Mask_Unset  => SHOTPLUG_CTL_DETECT_MASK,
+               Mask_Set    => SHOTPLUG_CTL_HPD_INPUT_ENABLE (DIGI_A) or
+                              SHOTPLUG_CTL_HPD_STATUS (DIGI_A));  -- clear
          end if;
-      else
-         Internal_Detected := False;
       end if;
-      Config.Valid_Port (Internal) := Internal_Detected;
+      Config.Valid_Port (eDP) := Internal_Detected;
 
       -- DDI_[BCD]
       for Port in Ext_Digital_Port range