summaryrefslogtreecommitdiff
path: root/src/northbridge
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2015-05-19 09:45:22 +0200
committerVladimir Serbinenko <phcoder@gmail.com>2015-05-19 16:24:40 +0200
commit428130e83955795592563393edd360fa0b17199a (patch)
tree02a10ba99d4acb1ef2641d2a0a390327225b877a /src/northbridge
parent38cf94b25098e4aee1f4ea16df2110140eca8222 (diff)
downloadcoreboot-428130e83955795592563393edd360fa0b17199a.tar.xz
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 <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/10239 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/northbridge')
-rw-r--r--src/northbridge/intel/nehalem/gma.c9
1 files changed, 7 insertions, 2 deletions
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);