From 428130e83955795592563393edd360fa0b17199a Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 19 May 2015 09:45:22 +0200 Subject: nehalem 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: Ic157a6a580d7a5048ac28155e0d6b3433bbd1f2c Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/10239 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/northbridge/intel/nehalem/gma.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/northbridge') diff --git a/src/northbridge/intel/nehalem/gma.c b/src/northbridge/intel/nehalem/gma.c index 9fc4bd45ba..7d24bd5565 100644 --- a/src/northbridge/intel/nehalem/gma.c +++ b/src/northbridge/intel/nehalem/gma.c @@ -700,6 +700,7 @@ static void intel_gma_init(const struct northbridge_intel_nehalem_config *info, power_port(mmio); intel_gmbus_read_edid(mmio + PCH_GMBUS0, 3, 0x50, edid_data, 128); + intel_gmbus_stop(mmio + PCH_GMBUS0); decode_edid(edid_data, sizeof(edid_data), &edid); @@ -721,9 +722,8 @@ static void intel_gma_init(const struct northbridge_intel_nehalem_config *info, target_frequency = info->gfx.lvds_dual_channel ? edid.pixel_clock : (2 * edid.pixel_clock); -#if !IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE) vga_textmode_init(); -#else +#if IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE) vga_sr_write(1, 1); vga_sr_write(0x2, 0xf); vga_sr_write(0x3, 0x0); @@ -982,6 +982,11 @@ static void intel_gma_init(const struct northbridge_intel_nehalem_config *info, write32(mmio + DEIIR, 0xffffffff); write32(mmio + SDEIIR, 0xffffffff); + /* Doesn't change any hw behaviour but vga oprom expects it there. */ + write32(mmio + 0x0004f040, 0x01000008); + write32(mmio + 0x0004f04c, 0x7f7f0000); + write32(mmio + 0x0004f054, 0x0000020d); + #if IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE) memset ((void *) lfb, 0, edid.x_resolution * edid.y_resolution * 4); set_vbe_mode_info_valid(&edid, lfb); -- cgit v1.2.3