From 38cf94b25098e4aee1f4ea16df2110140eca8222 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 13 May 2015 09:30:09 +0200 Subject: ivybridge native gfx init: Adjust state to be compatible with OPROM. My main payload is GRUB and I load SeaBIOS as secondary payload when for some reason I want to boot windows. In this scenario SeaBIOS runs VGA oprom (SeaVGABIOS is not good enough with intel gfx). VGA oprom expects either completely uninited gfx or some special state in gmbus and software scratch registers. Provide this state. The only alternative without this patch for such usecase is to use oprom and I'd like to avoid doing so when going my main boot path to GNU/Linux. Change-Id: I38e78fb845e43b81df084cd4d65f4618bfb2506d Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/10205 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/drivers/intel/gma/edid.c | 24 ++++++++++++++++++++++++ src/drivers/intel/gma/edid.h | 1 + 2 files changed, 25 insertions(+) (limited to 'src/drivers') diff --git a/src/drivers/intel/gma/edid.c b/src/drivers/intel/gma/edid.c index e70156eb28..052f099177 100644 --- a/src/drivers/intel/gma/edid.c +++ b/src/drivers/intel/gma/edid.c @@ -37,6 +37,30 @@ static void wait_rdy(u8 *mmio) } } +static void intel_gmbus_stop_bus(u8 * mmio, u8 bus) +{ + wait_rdy(mmio); + write32(mmio + 4 * 0, bus); + wait_rdy(mmio); + write32(mmio + 4 * 8, 0); + write32(mmio + 4 * 1, 0x4e0400a1); + wait_rdy(mmio); + write32(mmio + 4 * 8, 0); + write32(mmio + 4 * 1, 0x80000000); + write32(mmio + 4 * 1, 0x00000000); + wait_rdy(mmio); + write32(mmio + 4 * 1, 0x480000a0); + wait_rdy(mmio); + write32(mmio + 4 * 0, 0x48000000); + write32(mmio + 4 * 2, 0x00008000); +} + +void intel_gmbus_stop(u8 *mmio) +{ + intel_gmbus_stop_bus(mmio, 6); + intel_gmbus_stop_bus(mmio, 2); +} + void intel_gmbus_read_edid(u8 *mmio, u8 bus, u8 slave, u8 *edid, u32 edid_size) { int i; diff --git a/src/drivers/intel/gma/edid.h b/src/drivers/intel/gma/edid.h index c4763919bd..d8214cf329 100644 --- a/src/drivers/intel/gma/edid.h +++ b/src/drivers/intel/gma/edid.h @@ -1 +1,2 @@ void intel_gmbus_read_edid(u8 *gmbus_mmio, u8 bus, u8 slave, u8 *edid, u32 edid_size); +void intel_gmbus_stop(u8 *gmbus_mmio); -- cgit v1.2.3