gma: Turn constants depending on Config.CPU* into functions

To reduce elaboration time dependencies, turn constants at package
level into functions. This will allow us to use the same code for
configurations with constant and non-constant `GMA.Config.CPU*`.

Change-Id: I0522f5c63c63080bf9633f3d1b6019f35e52d226
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/27062
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/hw-gfx-gma-pch-fdi.adb b/common/hw-gfx-gma-pch-fdi.adb
index 53756e2..c8b1ec6 100644
--- a/common/hw-gfx-gma-pch-fdi.adb
+++ b/common/hw-gfx-gma-pch-fdi.adb
@@ -30,15 +30,18 @@
    FDI_RX_CTL_RAWCLK_TO_PCDCLK_SEL_RAWCLK : constant := 0 * 2 **  4;
    FDI_RX_CTL_RAWCLK_TO_PCDCLK_SEL_PCDCLK : constant := 1 * 2 **  4;
 
-   TP_SHIFT : constant := (if Config.Has_New_FDI_Sink then 8 else 28);
-   FDI_RX_CTL_TRAINING_PATTERN_MASK       : constant := 3 * 2 ** TP_SHIFT;
+   function TP_SHIFT return Natural is
+     (if Config.Has_New_FDI_Sink then 8 else 28);
 
-   type TP_Array is array (Training_Pattern) of Word32;
-   FDI_RX_CTL_TRAINING_PATTERN : constant TP_Array :=
-     (TP_1     => 0 * 2 ** TP_SHIFT,
-      TP_2     => 1 * 2 ** TP_SHIFT,
-      TP_Idle  => 2 * 2 ** TP_SHIFT,
-      TP_None  => 3 * 2 ** TP_SHIFT);
+   function FDI_RX_CTL_TRAINING_PATTERN_MASK
+      return Word32 is (Shift_Left (3, TP_SHIFT));
+
+   function FDI_RX_CTL_TRAINING_PATTERN (TP : Training_Pattern) return Word32 is
+     (case TP is
+         when TP_1     => Shift_Left (0, TP_SHIFT),
+         when TP_2     => Shift_Left (1, TP_SHIFT),
+         when TP_Idle  => Shift_Left (2, TP_SHIFT),
+         when TP_None  => Shift_Left (3, TP_SHIFT));
 
    function FDI_RX_CTL_PORT_WIDTH_SEL (Lane_Count : DP_Lane_Count) return Word32
    is