gma: Update BDSM register offset for TGL onwards
BDSM moved and is also 64 bits on TGL. If the register indicates that
BSDM is 64-bits, then right now libgfxinit will error out.
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Change-Id: I0a3e7a92dcb08ea33e08c9f2c5135d4269c9e0b9
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/65178
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index 44aaa96..e759a0c 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -397,6 +397,11 @@
----------------------------------------------------------------------------
+ GMA_Phys_Base_Index : constant PCI.Index :=
+ (if Config.Tigerlake_On then 16#c0# else 16#5c#);
+
+ GMA_Base_Is_64bit : constant Boolean := Config.Tigerlake_On;
+
GTT_PTE_Size : <hswvar> Natural := (if Has_64bit_GTT then 8 else 4);
Fence_Base : <ilkvar> Natural :=
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index c66fa5d..83ded92 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -866,7 +866,6 @@
Clear : in Boolean := True;
Success : out Boolean)
is
- GMA_Phys_Base : constant PCI.Index := 16#5c#;
GMA_Phys_Base_Mask : constant := 16#fff0_0000#;
Phys_Base : Word32;
@@ -874,7 +873,16 @@
Validate_FB (FB, Success);
if Success then
- Dev.Read32 (Phys_Base, GMA_Phys_Base);
+ if Config.GMA_Base_Is_64bit then
+ Dev.Read32 (Phys_Base, Config.GMA_Phys_Base_Index + 4);
+ if Phys_Base /= 0 then
+ pragma Debug (Debug.Put_Line ("Cannot handle 64-bit DSM yet."));
+ Success := False;
+ return;
+ end if;
+ end if;
+
+ Dev.Read32 (Phys_Base, Config.GMA_Phys_Base_Index);
Phys_Base := Phys_Base and GMA_Phys_Base_Mask;
Success := Phys_Base /= GMA_Phys_Base_Mask and Phys_Base /= 0;
pragma Debug (not Success, Debug.Put_Line