gma config: Introduce per CPU booleans
The per CPU booleans are additionally guarded by the respective
generation so that the compiler may decide purely on the generation.
Also use the new booleans to get rid of all direct references to
`Config.CPU` and `Config.CPU_Var`.
Change-Id: I307d1dd56f480fdb4fbc6e2e25fc5f413c4158f8
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/27060
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/haswell/hw-gfx-gma-connectors-ddi-buffers.adb b/common/haswell/hw-gfx-gma-connectors-ddi-buffers.adb
index baceb10..df5c55b 100644
--- a/common/haswell/hw-gfx-gma-connectors-ddi-buffers.adb
+++ b/common/haswell/hw-gfx-gma-connectors-ddi-buffers.adb
@@ -125,27 +125,25 @@
else Config.Default_DDI_HDMI_Buffer_Translation);
begin
Trans :=
- (case Config.CPU is
- when Broadwell =>
- (case Port is
- when DIGI_A =>
- (if Config.EDP_Low_Voltage_Swing
- then Broadwell_Trans_EDP
- else Broadwell_Trans_DP),
- when DIGI_B .. DIGI_D => Broadwell_Trans_DP,
- when DIGI_E => Broadwell_Trans_FDI),
- when others =>
- (case Port is
- when DIGI_A .. DIGI_D => Haswell_Trans_DP,
- when DIGI_E => Haswell_Trans_FDI));
- case Config.CPU is
- when Broadwell =>
- Trans (18) := Broadwell_Trans_HDMI (HDMI_Trans).Trans1;
- Trans (19) := Broadwell_Trans_HDMI (HDMI_Trans).Trans2;
- when others =>
- Trans (18) := Haswell_Trans_HDMI (HDMI_Trans).Trans1;
- Trans (19) := Haswell_Trans_HDMI (HDMI_Trans).Trans2;
- end case;
+ (if Config.CPU_Haswell then
+ (case Port is
+ when DIGI_A .. DIGI_D => Haswell_Trans_DP,
+ when DIGI_E => Haswell_Trans_FDI)
+ else
+ (case Port is
+ when DIGI_A =>
+ (if Config.EDP_Low_Voltage_Swing
+ then Broadwell_Trans_EDP
+ else Broadwell_Trans_DP),
+ when DIGI_B .. DIGI_D => Broadwell_Trans_DP,
+ when DIGI_E => Broadwell_Trans_FDI));
+ if Config.CPU_Haswell then
+ Trans (18) := Haswell_Trans_HDMI (HDMI_Trans).Trans1;
+ Trans (19) := Haswell_Trans_HDMI (HDMI_Trans).Trans2;
+ else
+ Trans (18) := Broadwell_Trans_HDMI (HDMI_Trans).Trans1;
+ Trans (19) := Broadwell_Trans_HDMI (HDMI_Trans).Trans2;
+ end if;
end Translations;
end HW.GFX.GMA.Connectors.DDI.Buffers;