gma: Allow private sub-packages to access PCI config

Only export Read16() for now, which we need in a follow-up.

Change-Id: I2ca17cab0566d50000369263ab56e122ac6cbb8b
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/35712
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index 269feec..8352e1c 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -38,7 +38,8 @@
 package body HW.GFX.GMA
    with Refined_State =>
      (State =>
-        (Dev.Address_State,
+        (PCI_Usable,
+         Dev.Address_State,
          Registers.Address_State,
          PCode.Mailbox_Ready,
          PLLs.State, Panel.Panel_State,
@@ -384,7 +385,8 @@
         (Input => (Time.State),
          In_Out => (Dev.PCI_State, Registers.Register_State, Port_IO.State),
          Output =>
-           (Config.Variable,
+           (PCI_Usable,
+            Config.Variable,
             Dev.Address_State,
             Registers.Address_State,
             PCode.Mailbox_Ready,
@@ -446,6 +448,7 @@
 
       pragma Debug (Debug.Set_Register_Write_Delay (Write_Delay));
 
+      PCI_Usable := False;
       Linear_FB_Base := 0;
       PCode.Mailbox_Ready := False;
       Wait_For_HPD := HPD_Type'(others => False);
@@ -470,6 +473,7 @@
             Dev.Map (PCI_GTT_Base, PCI.Res0, Offset => MMIO_GTT_Offset);
             if PCI_MMIO_Base /= 0 and PCI_GTT_Base /= 0 then
                Registers.Set_Register_Base (PCI_MMIO_Base, PCI_GTT_Base);
+               PCI_Usable := True;
             else
                pragma Debug (Debug.Put_Line
                  ("ERROR: Couldn't map resoure0."));
@@ -934,4 +938,11 @@
       end loop;
    end Dump_Configs;
 
+   ----------------------------------------------------------------------------
+
+   procedure PCI_Read16 (Value : out Word16; Offset : HW.PCI.Index) is
+   begin
+      Dev.Read16 (Value, Offset);
+   end PCI_Read16;
+
 end HW.GFX.GMA;