gma config: Make Config.CPU and Config.CPU_Var variable

Introduce CONFIG_GFX_GMA_DYN_CPU that, if set to `y`, makes `Config.CPU`
and `Config.CPU_Var` variables. All other config values derived from
these are turned into expression functions.

Change-Id: If409b5afbd975f3a42e28ff191a092f89ece5ae2
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/27068
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index 87126d5..044036e 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -59,16 +59,22 @@
    type Variable_Config is record
       Valid_Port     : Valid_Port_Array;
       Raw_Clock      : Frequency_Type;
+      Dyn_CPU        : Gen_CPU_Type;
+      Dyn_CPU_Var    : Gen_CPU_Variant;
    end record;
 
    Initial_Settings : constant Variable_Config :=
      (Valid_Port     => (others => False),
-      Raw_Clock      => Frequency_Type'First);
+      Raw_Clock      => Frequency_Type'First,
+      Dyn_CPU        => Gen_CPU_Type'First,
+      Dyn_CPU_Var    => Gen_CPU_Variant'First);
 
    Variable : Variable_Config with Part_Of => GMA.Config_State;
 
    Valid_Port  : Valid_Port_Array renames Variable.Valid_Port;
    Raw_Clock   : Frequency_Type renames Variable.Raw_Clock;
+   CPU         : Gen_CPU_Type renames Variable.Dyn_CPU;
+   CPU_Var     : Gen_CPU_Variant renames Variable.Dyn_CPU_Var;
 
    ----------------------------------------------------------------------------
 
@@ -303,12 +309,12 @@
 
    ----------------------------------------------------------------------------
 
-   GTT_PTE_Size : <hswvar> := (if Has_64bit_GTT then 8 else 4);
+   GTT_PTE_Size : <hswvar> Natural := (if Has_64bit_GTT then 8 else 4);
 
-   Fence_Base : <ilkvar> :=
+   Fence_Base : <ilkvar> Natural :=
      (if not Sandybridge_On then 16#0000_3000# else 16#0010_0000#);
 
-   Fence_Count : <ilkvar> :=
+   Fence_Count : <ilkvar> Natural :=
      (if not Ivybridge_On then 16 else 32);
 
    ----------------------------------------------------------------------------