gma: Add GPU_Port types that are convenient for GMCH to use

Change-Id: I9120d084637d36a7e2276fcf3f630b3f7ed32509
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/25407
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads b/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
index ec1fce2..d43db97 100644
--- a/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
+++ b/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
@@ -22,9 +22,14 @@
    procedure Pre_On
      (Port_Cfg : in     Port_Config;
       PLL_Hint : in     Word32;
-      Success  :    out Boolean);
+      Success  :    out Boolean)
+   with
+     Pre => Port_Cfg.Port in Digital_Port;
 
-   procedure Post_On (Port_Cfg : Port_Config);
+   procedure Post_On (Port_Cfg : Port_Config)
+   with
+     Pre => Port_Cfg.Port in Digital_Port;
+
 
    procedure Off (Port : Digital_Port);
 
diff --git a/common/haswell_shared/hw-gfx-gma-connectors.adb b/common/haswell_shared/hw-gfx-gma-connectors.adb
index 0d0ed71..2b29f99 100644
--- a/common/haswell_shared/hw-gfx-gma-connectors.adb
+++ b/common/haswell_shared/hw-gfx-gma-connectors.adb
@@ -41,8 +41,11 @@
    is
    begin
       pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
-
-      DDI.Pre_On (Port_Cfg, PLL_Hint, Success);
+      if Port_Cfg.Port in Digital_Port then
+         DDI.Pre_On (Port_Cfg, PLL_Hint, Success);
+      else
+         Success := False; -- Should not happen
+      end if;
    end Pre_On;
 
    procedure Post_On
@@ -53,13 +56,16 @@
    begin
       pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
 
-      DDI.Post_On (Port_Cfg);
+      if Port_Cfg.Port in Digital_Port then
+         DDI.Post_On (Port_Cfg);
 
-      if Port_Cfg.Port = DIGI_A then
-         Panel.Backlight_On;
+         if Port_Cfg.Port = DIGI_A then
+            Panel.Backlight_On;
+         end if;
+         Success := True;
+      else
+         Success := False; -- Should not happen
       end if;
-
-      Success := True;
    end Post_On;
 
    ----------------------------------------------------------------------------
@@ -79,8 +85,9 @@
    is
    begin
       pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
-
-      DDI.Off (Port_Cfg.Port);
+      if Port_Cfg.Port in Digital_Port then
+         DDI.Off (Port_Cfg.Port);
+      end if;
    end Post_Off;
 
    ----------------------------------------------------------------------------