From 4cdb2b9b75fe2cf722b0409652a0d660b58fecfd Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 28 Nov 2018 16:57:15 +0100 Subject: mb/intel/x200: Add data.vbt There are 2 vendor BIOS's for the Lenovo X200 with the difference being the settings in the VBT blob to accommodate different backlight frequencies. Linux however sticks with the setting set by the firmware. Tested on Lenovo X200 with CCFL backlight. Change-Id: I4c4a7011ce03cdd511fa2e2160c2f006ba2707ba Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/29904 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- src/mainboard/lenovo/x200/Makefile.inc | 9 +++++++++ src/mainboard/lenovo/x200/blc.c | 21 +++++++++++++++++++++ src/mainboard/lenovo/x200/data_ccfl.vbt | Bin 0 -> 3854 bytes src/mainboard/lenovo/x200/data_led.vbt | Bin 0 -> 3863 bytes 4 files changed, 30 insertions(+) create mode 100644 src/mainboard/lenovo/x200/data_ccfl.vbt create mode 100644 src/mainboard/lenovo/x200/data_led.vbt (limited to 'src/mainboard') diff --git a/src/mainboard/lenovo/x200/Makefile.inc b/src/mainboard/lenovo/x200/Makefile.inc index c10bc70e67..5e9832dcce 100644 --- a/src/mainboard/lenovo/x200/Makefile.inc +++ b/src/mainboard/lenovo/x200/Makefile.inc @@ -19,3 +19,12 @@ ramstage-y += blc.c romstage-y += gpio.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads + +add_vbt_to_cbfs= \ + $(eval cbfs-files-y += $1) \ + $(eval $1-file := $2) \ + $(eval $1-type := raw) \ + $(eval $1-compression := lzma) + +$(call add_vbt_to_cbfs, data_ccfl.vbt, data_ccfl.vbt) +$(call add_vbt_to_cbfs, data_led.vbt, data_led.vbt) diff --git a/src/mainboard/lenovo/x200/blc.c b/src/mainboard/lenovo/x200/blc.c index 3f8aadb637..6c5779a0b2 100644 --- a/src/mainboard/lenovo/x200/blc.c +++ b/src/mainboard/lenovo/x200/blc.c @@ -15,7 +15,9 @@ #include #include +#include #include +#include static const struct blc_pwm_t blc_entries[] = { /* corrected to 320MHz CDClk, vendor set 753; works fine at both: */ @@ -43,3 +45,22 @@ int get_blc_values(const struct blc_pwm_t **entries) *entries = blc_entries; return ARRAY_SIZE(blc_entries); } + +const char *mainboard_vbt_filename(void) +{ + u16 pwm_freq; + + pwm_freq = get_blc_pwm_freq_value(NULL); + + if (pwm_freq == 0) { + printk(BIOS_DEBUG, + "GMA: Display backlight type not found, assuming LED\n"); + return "data_led.vbt"; + } else if (pwm_freq > 200) { + printk(BIOS_DEBUG, "GMA: Using LED backlight VBT\n"); + return "data_led.vbt"; + } else { + printk(BIOS_DEBUG, "GMA: Using CCFL backlight VBT\n"); + return "data_ccfl.vbt"; + } +} diff --git a/src/mainboard/lenovo/x200/data_ccfl.vbt b/src/mainboard/lenovo/x200/data_ccfl.vbt new file mode 100644 index 0000000000..dc044c90e3 Binary files /dev/null and b/src/mainboard/lenovo/x200/data_ccfl.vbt differ diff --git a/src/mainboard/lenovo/x200/data_led.vbt b/src/mainboard/lenovo/x200/data_led.vbt new file mode 100644 index 0000000000..bcd6c300c1 Binary files /dev/null and b/src/mainboard/lenovo/x200/data_led.vbt differ -- cgit v1.2.3