summaryrefslogtreecommitdiff
path: root/src/lib/cbmem.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2013-06-23 17:01:29 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2013-09-11 07:20:25 +0200
commitd50cdf108f9d4b598aa8f6c3205d9a93c3e67131 (patch)
treef8a1ba756eafaa855b69c9e1ad4e043886b80d68 /src/lib/cbmem.c
parent95c39c28a3d4beb10143ad9c749241fcbdbfb2dc (diff)
CBMEM: Drop parameter from cbmem_reinit()
Function is always called with get_top_of_ram() - HIGH_MEMORY_SIZE which equals cbmem_base, thus no need to pass it as a parameter. Change-Id: If026cb567ff534716cd9200cdffa08b21ac0c162 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3564 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src/lib/cbmem.c')
-rw-r--r--src/lib/cbmem.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c
index 2307054421..d7f866bec8 100644
--- a/src/lib/cbmem.c
+++ b/src/lib/cbmem.c
@@ -47,7 +47,6 @@ uint64_t high_tables_base = 0;
uint64_t high_tables_size = 0;
#endif
-#if !defined(__PRE_RAM__)
static void cbmem_trace_location(uint64_t base, uint64_t size, const char *s)
{
if (base && size && s) {
@@ -55,7 +54,6 @@ static void cbmem_trace_location(uint64_t base, uint64_t size, const char *s)
base, base + size - 1, s);
}
}
-#endif
static void cbmem_locate_table(uint64_t *base, uint64_t *size)
{
@@ -120,13 +118,15 @@ void cbmem_init(u64 baseaddr, u64 size)
};
}
-int cbmem_reinit(u64 baseaddr)
+int cbmem_reinit(void)
{
+ uint64_t baseaddr, size;
struct cbmem_entry *cbmem_toc;
- cbmem_toc = (struct cbmem_entry *)(unsigned long)baseaddr;
- printk(BIOS_DEBUG, "Re-Initializing CBMEM area to 0x%lx\n",
- (unsigned long)baseaddr);
+ cbmem_locate_table(&baseaddr, &size);
+ cbmem_trace_location(baseaddr, size, __FUNCTION__);
+
+ cbmem_toc = (struct cbmem_entry *)(unsigned long)baseaddr;
return (cbmem_toc[0].magic == CBMEM_MAGIC);
}
@@ -226,7 +226,7 @@ int cbmem_initialize(void)
cbmem_locate_table(&base, &size);
/* We expect the romstage to always initialize it. */
- if (!cbmem_reinit(base)) {
+ if (!cbmem_reinit()) {
#if CONFIG_HAVE_ACPI_RESUME && !defined(__PRE_RAM__)
/* Something went wrong, our high memory area got wiped */
if (acpi_slp_type == 3 || acpi_slp_type == 2)