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.ads b/common/hw-gfx-gma.ads
index 353ec4b..3a4580e 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -15,6 +15,7 @@
with HW.Config;
with HW.Time;
+with HW.PCI;
with HW.Port_IO;
with HW.GFX.Framebuffer_Filler;
@@ -230,6 +231,14 @@
private
+ PCI_Usable : Boolean with Part_Of => State;
+ use type HW.PCI.Index;
+ procedure PCI_Read16 (Value : out Word16; Offset : HW.PCI.Index)
+ with
+ Pre => PCI_Usable and Offset mod 2 = 0;
+
+ ----------------------------------------------------------------------------
+
-- For the default framebuffer setup (see below) with 90 degree rotations,
-- we expect the offset which is used for the final scanout to be above
-- `GTT_Rotation_Offset`. So we can use `Offset - GTT_Rotation_Offset` for