summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdfam10
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2013-09-03 05:25:57 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2013-09-11 07:09:21 +0200
commit2b790f651230589fd66e8121745986b8a939b13b (patch)
treecb6ccb48c41e5560506aa565103fbe564bfdad37 /src/northbridge/amd/amdfam10
parente7e847cd5c60d51bf5a50663a191b4e622c5c234 (diff)
downloadcoreboot-2b790f651230589fd66e8121745986b8a939b13b.tar.xz
CBMEM AMD: Fix calls to set_top_of_ram_once()
We can postpone the call to set_top_of_ram_once() outside the loops and make just one call instead. As set_top_of_ram() is now only called once, it is no longer necessary to check if high_tables_base was already set. Change-Id: I302d9af52ac40c7fa8c7c7e65f82e00b031cd397 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3895 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/northbridge/amd/amdfam10')
-rw-r--r--src/northbridge/amd/amdfam10/northbridge.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c
index 8dbb480e50..6bcab411b1 100644
--- a/src/northbridge/amd/amdfam10/northbridge.c
+++ b/src/northbridge/amd/amdfam10/northbridge.c
@@ -877,6 +877,7 @@ static void amdfam10_domain_set_resources(device_t dev)
#endif
unsigned long mmio_basek;
u32 pci_tolm;
+ u64 ramtop = 0;
int i, idx;
struct bus *link;
#if CONFIG_HW_MEM_HOLE_SIZEK != 0
@@ -1037,12 +1038,8 @@ static void amdfam10_domain_set_resources(device_t dev)
ram_resource(dev, (idx | i), basek, pre_sizek);
idx += 0x10;
sizek -= pre_sizek;
-
-#if CONFIG_GFXUMA
- set_top_of_ram_once(uma_memory_base);
-#else
- set_top_of_ram_once(mmio_basek * 1024);
-#endif
+ if (!ramtop)
+ ramtop = mmio_basek * 1024;
}
#if !CONFIG_AMDMCT
#if CONFIG_HW_MEM_HOLE_SIZEK != 0
@@ -1070,15 +1067,15 @@ static void amdfam10_domain_set_resources(device_t dev)
idx += 0x10;
printk(BIOS_DEBUG, "%d: mmio_basek=%08lx, basek=%08llx, limitk=%08llx\n",
i, mmio_basek, basek, limitk);
-#if CONFIG_GFXUMA
- set_top_of_ram_once(uma_memory_base);
-#else
- set_top_of_ram_once(limitk * 1024);
-#endif
+ if (!ramtop)
+ ramtop = limitk * 1024;
}
#if CONFIG_GFXUMA
+ set_top_of_ram(uma_memory_base);
uma_resource(dev, 7, uma_memory_base >> 10, uma_memory_size >> 10);
+#else
+ set_top_of_ram(ramtop);
#endif
for(link = dev->link_list; link; link = link->next) {