aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/lenovo/t400/romstage.c
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2017-01-02 16:16:45 +0100
committerAlexander Couzens <lynxis@fe80.eu>2017-02-19 19:15:40 +0100
commitf9d5308690e96002dbeab77b78e499dcd2d3a42f (patch)
treedeab6f631bc590927ca65fbb9a13f9f3da3f1bf7 /src/mainboard/lenovo/t400/romstage.c
parent3fee215a3e0ee121f5764a4e9fe194b249e42009 (diff)
mb/lenovo/t400: Implement hybrid graphic in romstage
The hybrid driver select by DRIVERS_LENOVO_HYBRID_GRAPHICS doesn't work for t400/t500. Replace it with a custom romstage implementation. Tested on Lenovo T500 with dual graphics: * Intel Native GFX init * AMD VBios * GNU Linux 4.8.13 * SeaBios as payload * Discrete is working (44 W) * Integrated is working (24 W) * Switchable is working (34 W) ** Both GPUs are enabled, with Intel being connected to the panel ** DRI_PRIME allows to use AMD GPU ** ACPI doesn't seem to work (no vgaswitcheroo) Depends on Change-Id: I4dc00005270240c048272b2e4f52ae46ba1c9422 Depends on Change-Id: If389016f3bb0c4c2fd0b826914997a87a9137201 Change-Id: I7496876e9b434d4a2388e1ede27ac604670339b7 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/18010 Tested-by: build bot (Jenkins) Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Diffstat (limited to 'src/mainboard/lenovo/t400/romstage.c')
-rw-r--r--src/mainboard/lenovo/t400/romstage.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mainboard/lenovo/t400/romstage.c b/src/mainboard/lenovo/t400/romstage.c
index d110d4fc44..2a3a770bee 100644
--- a/src/mainboard/lenovo/t400/romstage.c
+++ b/src/mainboard/lenovo/t400/romstage.c
@@ -36,6 +36,8 @@
#define LPC_DEV PCI_DEV(0, 0x1f, 0)
#define MCH_DEV PCI_DEV(0, 0, 0)
+void hybrid_graphics_init(sysinfo_t *sysinfo);
+
static void early_lpc_setup(void)
{
/* Set up SuperIO LPC forwards */
@@ -101,9 +103,13 @@ void mainboard_romstage_entry(unsigned long bist)
memset(&sysinfo, 0, sizeof(sysinfo));
sysinfo.spd_map[0] = 0x50;
sysinfo.spd_map[2] = 0x51;
- sysinfo.enable_igd = 1;
- sysinfo.enable_peg = 0;
get_gmch_info(&sysinfo);
+
+ /* Configure graphic GPIOs.
+ * Make sure there's a little delay between
+ * setup_pch_gpios() and this call ! */
+ hybrid_graphics_init(&sysinfo);
+
raminit(&sysinfo, s3resume);
const u32 deven = pci_read_config32(MCH_DEV, D0F0_DEVEN);