drivers/intel/gma: Include mainboard data.vbt

This adds a INTEL_GMA_VBT_HAVE_DATA_FILE Kconfig option for the path
to point to the mainboard dir and to select
INTEL_GMA_ADD_VBT_DATA_FILE by default.

Change-Id: I730cb0737945631e2d5379a9e26b8c039ec6dc49
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/26653
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/src/device/Kconfig b/src/device/Kconfig
index 3d1d3fe..1ed9b1b 100644
--- a/src/device/Kconfig
+++ b/src/device/Kconfig
@@ -598,9 +598,16 @@
 
 	  Under GNU/Linux you can run `lspci -nn` to list the IDs of your PCI devices.
 
+config INTEL_GMA_VBT_HAVE_DATA_FILE
+	bool
+	help
+	  Select this in the mainboard Kconfig to indicate the board has
+	  a data.vbt file.
+
 config INTEL_GMA_ADD_VBT_DATA_FILE
 	depends on SOC_INTEL_COMMON || CPU_INTEL_COMMON
 	bool "Add a Video Bios Table (VBT) binary to CBFS"
+	default y if INTEL_GMA_VBT_HAVE_DATA_FILE
 	help
 	  Add a VBT data file to CBFS. The VBT describes the integrated
 	  GPU and connections, and is needed by the GOP driver integrated into
@@ -609,6 +616,9 @@
 config INTEL_GMA_VBT_FILE
 	string "VBT binary path and filename"
 	depends on INTEL_GMA_ADD_VBT_DATA_FILE
+	default "src/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/data.vbt" \
+		if INTEL_GMA_VBT_HAVE_DATA_FILE && VARIANT_DIR != ""
+	default "src/mainboard/$(MAINBOARDDIR)/data.vbt" if INTEL_GMA_VBT_HAVE_DATA_FILE
 	default "3rdparty/blobs/mainboard/$(MAINBOARDDIR)/vbt.bin"
 	help
 	  The path and filename of the VBT binary.
diff --git a/src/mainboard/lenovo/t420/Kconfig b/src/mainboard/lenovo/t420/Kconfig
index 1ee0b97..1c20245 100644
--- a/src/mainboard/lenovo/t420/Kconfig
+++ b/src/mainboard/lenovo/t420/Kconfig
@@ -24,6 +24,7 @@
 	select MAINBOARD_HAS_LIBGFXINIT
 	select GFX_GMA_INTERNAL_IS_LVDS
 	select DRIVERS_LENOVO_HYBRID_GRAPHICS
+	select INTEL_GMA_VBT_HAVE_DATA_FILE
 
 	# Workaround for EC/KBC IRQ1.
 	select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/lenovo/t420s/Kconfig b/src/mainboard/lenovo/t420s/Kconfig
index 8b6c0fe..d17b9a9 100644
--- a/src/mainboard/lenovo/t420s/Kconfig
+++ b/src/mainboard/lenovo/t420s/Kconfig
@@ -20,6 +20,7 @@
 	select MAINBOARD_HAS_LPC_TPM
 	select MAINBOARD_HAS_TPM1
 	select DRIVERS_LENOVO_HYBRID_GRAPHICS
+	select INTEL_GMA_VBT_HAVE_DATA_FILE
 
 	# Workaround for EC/KBC IRQ1.
 	select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/lenovo/t430/Kconfig b/src/mainboard/lenovo/t430/Kconfig
index 0d7d966..4843b75 100644
--- a/src/mainboard/lenovo/t430/Kconfig
+++ b/src/mainboard/lenovo/t430/Kconfig
@@ -25,6 +25,7 @@
 	select DRIVERS_LENOVO_HYBRID_GRAPHICS
 	select MAINBOARD_HAS_LIBGFXINIT
 	select GFX_GMA_INTERNAL_IS_LVDS
+	select INTEL_GMA_VBT_HAVE_DATA_FILE
 
 config HAVE_IFD_BIN
 	bool
diff --git a/src/mainboard/lenovo/t430s/Kconfig b/src/mainboard/lenovo/t430s/Kconfig
index 2f0c976..82c05e7 100644
--- a/src/mainboard/lenovo/t430s/Kconfig
+++ b/src/mainboard/lenovo/t430s/Kconfig
@@ -22,6 +22,7 @@
 	select MAINBOARD_HAS_TPM1
 	select MAINBOARD_HAS_LIBGFXINIT
 	select GFX_GMA_INTERNAL_IS_LVDS
+	select INTEL_GMA_VBT_HAVE_DATA_FILE
 
 	# Workaround for EC/KBC IRQ1.
 	select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/lenovo/t520/Kconfig b/src/mainboard/lenovo/t520/Kconfig
index afc174c..16e2a34 100644
--- a/src/mainboard/lenovo/t520/Kconfig
+++ b/src/mainboard/lenovo/t520/Kconfig
@@ -18,6 +18,7 @@
 	select MAINBOARD_HAS_LPC_TPM
 	select MAINBOARD_HAS_TPM1
 	select DRIVERS_LENOVO_HYBRID_GRAPHICS
+	select INTEL_GMA_VBT_HAVE_DATA_FILE if BOARD_LENOVO_T520
 
 	# Workaround for EC/KBC IRQ1.
 	select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/lenovo/t530/Kconfig b/src/mainboard/lenovo/t530/Kconfig
index 93ec83b..53953cd 100644
--- a/src/mainboard/lenovo/t530/Kconfig
+++ b/src/mainboard/lenovo/t530/Kconfig
@@ -21,6 +21,7 @@
 	select DRIVERS_LENOVO_HYBRID_GRAPHICS
 	select MAINBOARD_HAS_LIBGFXINIT
 	select GFX_GMA_INTERNAL_IS_LVDS
+	select INTEL_GMA_VBT_HAVE_DATA_FILE
 
 	# Workaround for EC/KBC IRQ1.
 	select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/lenovo/x220/Kconfig b/src/mainboard/lenovo/x220/Kconfig
index 93c6733..fa14fde 100644
--- a/src/mainboard/lenovo/x220/Kconfig
+++ b/src/mainboard/lenovo/x220/Kconfig
@@ -21,6 +21,7 @@
 	select MAINBOARD_HAS_TPM1
 	select MAINBOARD_HAS_LIBGFXINIT
 	select GFX_GMA_INTERNAL_IS_LVDS
+	select INTEL_GMA_VBT_HAVE_DATA_FILE
 
 	# Workaround for EC/KBC IRQ1.
 	select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/lenovo/x230/Kconfig b/src/mainboard/lenovo/x230/Kconfig
index f0856d2..8995daf 100644
--- a/src/mainboard/lenovo/x230/Kconfig
+++ b/src/mainboard/lenovo/x230/Kconfig
@@ -22,6 +22,7 @@
 	select MAINBOARD_HAS_TPM1
 	select MAINBOARD_HAS_LIBGFXINIT
 	select GFX_GMA_INTERNAL_IS_LVDS
+	select INTEL_GMA_VBT_HAVE_DATA_FILE
 
 	# Workaround for EC/KBC IRQ1.
 	select SERIRQ_CONTINUOUS_MODE