aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/amd/agesa/family14/northbridge.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2013-06-27 08:20:09 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2013-09-11 07:06:15 +0200
commite7e847cd5c60d51bf5a50663a191b4e622c5c234 (patch)
tree9428184b19d697da741c9f87280df227c7f3c872 /src/northbridge/amd/agesa/family14/northbridge.c
parent9c7d73ca3f5b2985cb0f498038a746bcc0f2cac7 (diff)
CBMEM AMD: Remove references to global high_tables_base
Prepare for removal of globals high_tables_base and _size by replacing the references with a helper function. Added set_top_of_ram_once() may be called several times, but only the first call (with non-zero argument) takes effect. Change-Id: I5b5f71630f03b6a01e9c8ff96cb78e9da03e5cc3 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3894 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src/northbridge/amd/agesa/family14/northbridge.c')
-rw-r--r--src/northbridge/amd/agesa/family14/northbridge.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c
index e7de273a9d..fbf8e44064 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -716,19 +716,12 @@ static void domain_set_resources(device_t dev)
pre_sizek);
idx += 0x10;
sizek -= pre_sizek;
- if (high_tables_base == 0) {
- /* Leave some space for ACPI, PIRQ and MP tables */
#if CONFIG_GFXUMA
- high_tables_base = uma_memory_base - HIGH_MEMORY_SIZE;
+ set_top_of_ram_once(uma_memory_base);
#else
- high_tables_base = (mmio_basek * 1024) - HIGH_MEMORY_SIZE;
+ set_top_of_ram_once(mmio_basek * 1024);
#endif
- high_tables_size = HIGH_MEMORY_SIZE;
- printk(BIOS_DEBUG, " split: %dK table at =%08llx\n",
- (u32)(high_tables_size / 1024), high_tables_base);
- }
}
-
basek = mmio_basek;
}
if ((basek + sizek) <= 4 * 1024 * 1024) {
@@ -744,20 +737,13 @@ static void domain_set_resources(device_t dev)
printk(BIOS_DEBUG,
"%d: mmio_basek=%08lx, basek=%08llx, limitk=%08llx\n", 0,
mmio_basek, basek, limitk);
- if (high_tables_base == 0) {
- /* Leave some space for ACPI, PIRQ and MP tables */
#if CONFIG_GFXUMA
- high_tables_base = uma_memory_base - HIGH_MEMORY_SIZE;
- printk(BIOS_DEBUG, " adsr - uma_memory_base = %llx.\n", uma_memory_base);
+ set_top_of_ram_once(uma_memory_base);
#else
- high_tables_base = (limitk * 1024) - HIGH_MEMORY_SIZE;
+ set_top_of_ram_once(limitk * 1024);
#endif
- high_tables_size = HIGH_MEMORY_SIZE;
- }
}
printk(BIOS_DEBUG, " adsr - mmio_basek = %lx.\n", mmio_basek);
- printk(BIOS_DEBUG, " adsr - high_tables_size = %llx.\n",
- high_tables_size);
#if CONFIG_GFXUMA
uma_resource(dev, 7, uma_memory_base >> 10, uma_memory_size >> 10);