gma: Implement automatic CPU detection

In dynamic CPU configurations, Config.Detect_CPU() sets the CPU
variables according to the given PCI device id. In static confi-
gurations it does nothing.

We update the default configs to make use of this feature where
applicable. This should still give us full build-test coverage
while cutting the amount of tests in half.

Change-Id: I8ce31c867f97c8d6ef99ca096cb45f7719e78a19
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/27138
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/configs/broadwell b/configs/broadwell
deleted file mode 100644
index 06a6c2a..0000000
--- a/configs/broadwell
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_GFX_GMA_GENERATION	= Haswell
-CONFIG_GFX_GMA_CPU		= Broadwell
-CONFIG_GFX_GMA_CPU_VARIANT	= Normal
-CONFIG_GFX_GMA_INTERNAL_PORT	= DP
-CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
-CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#
diff --git a/configs/broadwell_ult b/configs/broadwell_ult
deleted file mode 100644
index 105992a..0000000
--- a/configs/broadwell_ult
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_GFX_GMA_GENERATION	= Haswell
-CONFIG_GFX_GMA_CPU		= Broadwell
-CONFIG_GFX_GMA_CPU_VARIANT	= ULT
-CONFIG_GFX_GMA_INTERNAL_PORT	= DP
-CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
-CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#
diff --git a/configs/broxton b/configs/broxton
index 35db833..5006125 100644
--- a/configs/broxton
+++ b/configs/broxton
@@ -1,3 +1,4 @@
+CONFIG_GFX_GMA_DYN_CPU		=
 CONFIG_GFX_GMA_GENERATION	= Broxton
 CONFIG_GFX_GMA_CPU		= Broxton
 CONFIG_GFX_GMA_CPU_VARIANT	= Normal	# N/A
diff --git a/configs/g45 b/configs/g45
index ef97850..9d2da64 100644
--- a/configs/g45
+++ b/configs/g45
@@ -1,6 +1,7 @@
+CONFIG_GFX_GMA_DYN_CPU		=
 CONFIG_GFX_GMA_GENERATION	= G45
 CONFIG_GFX_GMA_CPU		= G45
-CONFIG_GFX_GMA_CPU_VARIANT	= Normal
+CONFIG_GFX_GMA_CPU_VARIANT	= Normal	# N/A
 CONFIG_GFX_GMA_INTERNAL_PORT	= LVDS
 CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
 CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#
diff --git a/configs/haswell b/configs/haswell
index 8c025da..8adaafc 100644
--- a/configs/haswell
+++ b/configs/haswell
@@ -1,6 +1,5 @@
+CONFIG_GFX_GMA_DYN_CPU		= y
 CONFIG_GFX_GMA_GENERATION	= Haswell
-CONFIG_GFX_GMA_CPU		= Haswell
-CONFIG_GFX_GMA_CPU_VARIANT	= Normal
 CONFIG_GFX_GMA_INTERNAL_PORT	= DP
 CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
 CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#
diff --git a/configs/haswell_ult b/configs/haswell_ult
deleted file mode 100644
index 9559042..0000000
--- a/configs/haswell_ult
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_GFX_GMA_GENERATION	= Haswell
-CONFIG_GFX_GMA_CPU		= Haswell
-CONFIG_GFX_GMA_CPU_VARIANT	= ULT
-CONFIG_GFX_GMA_INTERNAL_PORT	= DP
-CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
-CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#
diff --git a/configs/ironlake b/configs/ironlake
index 2c26a79..20b33a7 100644
--- a/configs/ironlake
+++ b/configs/ironlake
@@ -1,6 +1,5 @@
+CONFIG_GFX_GMA_DYN_CPU		= y
 CONFIG_GFX_GMA_GENERATION	= Ironlake
-CONFIG_GFX_GMA_CPU		= Ironlake
-CONFIG_GFX_GMA_CPU_VARIANT	= Normal
 CONFIG_GFX_GMA_INTERNAL_PORT	= LVDS
 CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
 CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#
diff --git a/configs/ivybridge_edp b/configs/ironlake_edp
similarity index 69%
rename from configs/ivybridge_edp
rename to configs/ironlake_edp
index 6ce8543..9bc56c3 100644
--- a/configs/ivybridge_edp
+++ b/configs/ironlake_edp
@@ -1,6 +1,5 @@
+CONFIG_GFX_GMA_DYN_CPU		= y
 CONFIG_GFX_GMA_GENERATION	= Ironlake
-CONFIG_GFX_GMA_CPU		= Ivybridge
-CONFIG_GFX_GMA_CPU_VARIANT	= Normal
 CONFIG_GFX_GMA_INTERNAL_PORT	= DP
 CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
 CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#
diff --git a/configs/ivybridge_lvds b/configs/ivybridge_lvds
deleted file mode 100644
index 31813f9..0000000
--- a/configs/ivybridge_lvds
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_GFX_GMA_GENERATION	= Ironlake
-CONFIG_GFX_GMA_CPU		= Ivybridge
-CONFIG_GFX_GMA_CPU_VARIANT	= Normal
-CONFIG_GFX_GMA_INTERNAL_PORT	= LVDS
-CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
-CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#
diff --git a/configs/sandybridge b/configs/sandybridge
deleted file mode 100644
index 5cc15cd..0000000
--- a/configs/sandybridge
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_GFX_GMA_GENERATION	= Ironlake
-CONFIG_GFX_GMA_CPU		= Sandybridge
-CONFIG_GFX_GMA_CPU_VARIANT	= Normal
-CONFIG_GFX_GMA_INTERNAL_PORT	= LVDS
-CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
-CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#
diff --git a/configs/skylake b/configs/skylake
index 26c9896..7ae760a 100644
--- a/configs/skylake
+++ b/configs/skylake
@@ -1,6 +1,5 @@
+CONFIG_GFX_GMA_DYN_CPU		= y
 CONFIG_GFX_GMA_GENERATION	= Skylake
-CONFIG_GFX_GMA_CPU		= Skylake
-CONFIG_GFX_GMA_CPU_VARIANT	= Normal
 CONFIG_GFX_GMA_INTERNAL_PORT	= DP
 CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
 CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#
diff --git a/configs/skylake_ult b/configs/skylake_ult
deleted file mode 100644
index c683251..0000000
--- a/configs/skylake_ult
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_GFX_GMA_GENERATION	= Skylake
-CONFIG_GFX_GMA_CPU		= Skylake
-CONFIG_GFX_GMA_CPU_VARIANT	= ULT
-CONFIG_GFX_GMA_INTERNAL_PORT	= DP
-CONFIG_GFX_GMA_ANALOG_I2C_PORT	= PCH_DAC
-CONFIG_GFX_GMA_DEFAULT_MMIO	= 16\#e000_0000\#