From 5cac25e6b2331a559394a3e3f636c4a6a80c58ac Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 14 Aug 2015 16:31:14 -0500 Subject: northbridge/amd/amdfam10: Redirect legacy VGA memory access to MMIO Commit 27baa32 (cpu/amd/model_10xxx: Do not initialize SMM memory if SMM is disabled) deactivated TSeg SMRAM, which had the side effect of routing legacy VGA memory access to DRAM. Restore the correct MMIO mapping via the MMIO configuration registers. TEST: Booted KGPE-D16 with nVidia 7300LE card and verified proper VGA functionality. Change-Id: Ie4b7c0b2d6f9a02af9a022565fe514119513190a Signed-off-by: Timothy Pearson Reviewed-on: http://review.coreboot.org/11240 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/northbridge/amd/amdfam10/northbridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/northbridge/amd') diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c index f6f2641135..6d91cbd00d 100644 --- a/src/northbridge/amd/amdfam10/northbridge.c +++ b/src/northbridge/amd/amdfam10/northbridge.c @@ -492,6 +492,7 @@ static void amdfam10_set_resource(device_t dev, struct resource *resource, static void amdfam10_create_vga_resource(device_t dev, unsigned nodeid) { struct bus *link; + struct resource *res; /* find out which link the VGA card is connected, * we only deal with the 'first' vga card */ @@ -516,6 +517,18 @@ static void amdfam10_create_vga_resource(device_t dev, unsigned nodeid) printk(BIOS_DEBUG, "VGA: %s (aka node %d) link %d has VGA device\n", dev_path(dev), nodeid, link->link_num); set_vga_enable_reg(nodeid, link->link_num); + + /* Redirect VGA memory access to MMIO + * This signals the Family 10h resource parser + * to add a new MMIO mapping to the Range 11 + * MMIO control registers (starting at F1x1B8), + * and also reserves the resource in the E820 map. + */ + res = new_resource(dev, IOINDEX(0x1000 + 0x1b8, link->link_num)); + res->base = 0xa0000; + res->size = 0x20000; + res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED; + amdfam10_set_resource(dev, res, nodeid); } static void amdfam10_set_resources(device_t dev) -- cgit v1.2.3