aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/intel/gma/edid.c
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2015-05-13 09:30:09 +0200
committerVladimir Serbinenko <phcoder@gmail.com>2015-05-19 16:24:05 +0200
commit38cf94b25098e4aee1f4ea16df2110140eca8222 (patch)
tree5baa7b7fcf6180d4875f1d54b6ffb88a57879f5a /src/drivers/intel/gma/edid.c
parent3387e4e770a37bc09289ffa59fa3c781d8970126 (diff)
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 <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/10205 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/drivers/intel/gma/edid.c')
-rw-r--r--src/drivers/intel/gma/edid.c24
1 files changed, 24 insertions, 0 deletions
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;