summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2016-06-17 23:31:42 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2016-11-08 19:16:41 +0100
commit19652e6f408851826386d52458ae21e617af8276 (patch)
tree4663636160df523a79f217079ff061308bc936dc /src/lib
parent2bad1e7f491ea9347899498d7d8dde4e1dd9b6d4 (diff)
quick_ram_check: Remove reference to RAMBASE
Change-Id: Ieb8f11690fb0e9b287d866be56010bb9adefd21d Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/15239 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ramtest.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/lib/ramtest.c b/src/lib/ramtest.c
index a29fa25ece..6d12060bfc 100644
--- a/src/lib/ramtest.c
+++ b/src/lib/ramtest.c
@@ -181,32 +181,37 @@ int ram_check_noprint_nodie(unsigned long start, unsigned long stop)
return failures;
}
-void quick_ram_check(void)
+static void __quick_ram_check(uintptr_t dst)
{
int fail = 0;
u32 backup;
- backup = read_phys(CONFIG_RAMBASE);
- write_phys(CONFIG_RAMBASE, 0x55555555);
+ backup = read_phys(dst);
+ write_phys(dst, 0x55555555);
phys_memory_barrier();
- if (read_phys(CONFIG_RAMBASE) != 0x55555555)
+ if (read_phys(dst) != 0x55555555)
fail=1;
- write_phys(CONFIG_RAMBASE, 0xaaaaaaaa);
+ write_phys(dst, 0xaaaaaaaa);
phys_memory_barrier();
- if (read_phys(CONFIG_RAMBASE) != 0xaaaaaaaa)
+ if (read_phys(dst) != 0xaaaaaaaa)
fail=1;
- write_phys(CONFIG_RAMBASE, 0x00000000);
+ write_phys(dst, 0x00000000);
phys_memory_barrier();
- if (read_phys(CONFIG_RAMBASE) != 0x00000000)
+ if (read_phys(dst) != 0x00000000)
fail=1;
- write_phys(CONFIG_RAMBASE, 0xffffffff);
+ write_phys(dst, 0xffffffff);
phys_memory_barrier();
- if (read_phys(CONFIG_RAMBASE) != 0xffffffff)
+ if (read_phys(dst) != 0xffffffff)
fail=1;
- write_phys(CONFIG_RAMBASE, backup);
+ write_phys(dst, backup);
if (fail) {
post_code(0xea);
die("RAM INIT FAILURE!\n");
}
phys_memory_barrier();
}
+
+void quick_ram_check(void)
+{
+ __quick_ram_check(0x100000);
+}