From 6ff1d36a4762365cdbc109d0c07778bfdd56dbaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 27 Jul 2012 08:42:20 +0300 Subject: Intel and GFXUMA: fix MTRR and use uma_resource() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 2d42b340034ff005693482ef9ca34ce3e0f08371 changed the variable MTRR setup and removed compensation of uma_memory_size in the cacheable memory resources. Since the cacheable region size was no longer divisible by a large power of 2, like 256 MB, this caused excessive use of MTRRs. As first symptoms, slow boot with grub and poor user response. As a solution, register the actual top of low ram with ram_resource(), and do not subtract the UMA/TSEG regions from it. TSEG may require further work as the original did not appear exactly right to begin with. To have UMA as un-cacheable, use uma_resource(). Change-Id: I4ca99b5c2ca4e474296590b3d0c6ef5d09550d80 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/1239 Reviewed-by: Anton Kochkov Tested-by: build bot (Jenkins) --- src/northbridge/intel/i82830/northbridge.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/northbridge/intel/i82830/northbridge.c') diff --git a/src/northbridge/intel/i82830/northbridge.c b/src/northbridge/intel/i82830/northbridge.c index 4ada4d7c6a..649a203aca 100644 --- a/src/northbridge/intel/i82830/northbridge.c +++ b/src/northbridge/intel/i82830/northbridge.c @@ -73,7 +73,7 @@ static void pci_domain_set_resources(device_t dev) if (!mc_dev) return; - unsigned long tomk; + unsigned long tomk, tomk_stolen; int idx; if (CONFIG_VIDEO_MB == 512) { @@ -89,24 +89,24 @@ static void pci_domain_set_resources(device_t dev) * i.e. 1 means 32MB. */ tomk = ((unsigned long)pci_read_config8(mc_dev, DRB + 3)) << 15; - tomk -= igd_memory; + tomk_stolen = tomk - igd_memory; /* For reserving UMA memory in the memory map */ - uma_memory_base = tomk * 1024ULL; + uma_memory_base = tomk_stolen * 1024ULL; uma_memory_size = igd_memory * 1024ULL; - printk(BIOS_DEBUG, "Available memory: %ldKB\n", tomk); + printk(BIOS_DEBUG, "Available memory: %ldKB\n", tomk_stolen); /* Report the memory regions. */ idx = 10; ram_resource(dev, idx++, 0, 640); - ram_resource(dev, idx++, 768, 256); - ram_resource(dev, idx++, 1024, tomk - 1024); + ram_resource(dev, idx++, 768, tomk - 768); + uma_resource(dev, idx++, uma_memory_base >> 10, uma_memory_size >> 10); assign_resources(dev->link_list); #if CONFIG_WRITE_HIGH_TABLES /* Leave some space for ACPI, PIRQ and MP tables */ - high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE; + high_tables_base = (tomk_stolen * 1024) - HIGH_MEMORY_SIZE; high_tables_size = HIGH_MEMORY_SIZE; #endif } -- cgit v1.2.3