summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2020-05-04 13:54:40 +0200
committerTom Rini <trini@konsulko.com>2020-05-08 09:16:26 -0400
commite519f03a18464c1fe249bd7fcf7829fad31abc9a (patch)
treee5ebcba888c223e6a147a7a555b4ae2ef755fd83 /cmd
parentc39e19a9b07807936b8df5925757e0a512effb92 (diff)
cmd: mem: Remove CONFIG_SYS_MEMTEST_SCRATCH mapping
There is no real need to exactly define space for saving patterns for alternate memory test. It is much easier to allocate space on the stack and use it instead of trying to find out space where pattern should be saved. For example if you want to test the whole DDR memory you can't save patter to DDR and you need to find it out. On Xilinx devices DDR or OCM addresses were chosen but that means that OCM needs to be mapped and U-Boot has access permission there. It is easier to remove this limitation and simply save it on stack because it is very clear that memory test can't rewrite U-Boot and U-Boot has also full access to memory where runs from. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mem.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/cmd/mem.c b/cmd/mem.c
index 009b7b58f3..18f0510098 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -25,10 +25,6 @@
DECLARE_GLOBAL_DATA_PTR;
-#ifndef CONFIG_SYS_MEMTEST_SCRATCH
-#define CONFIG_SYS_MEMTEST_SCRATCH 0
-#endif
-
static int mod_mem(cmd_tbl_t *, int, int, int, char * const []);
/* Display values from last command.
@@ -922,7 +918,8 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
ulong start, end;
- vu_long *buf, *dummy;
+ vu_long scratch_space;
+ vu_long *buf, *dummy = &scratch_space;
ulong iteration_limit = 0;
ulong count = 0;
ulong errs = 0; /* number of errors, or -1 if interrupted */
@@ -958,7 +955,6 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
start, end);
buf = map_sysmem(start, end - start);
- dummy = map_sysmem(CONFIG_SYS_MEMTEST_SCRATCH, sizeof(vu_long));
for (iteration = 0;
!iteration_limit || iteration < iteration_limit;
iteration++) {
@@ -988,7 +984,6 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
}
unmap_sysmem((void *)buf);
- unmap_sysmem((void *)dummy);
if (errs == -1UL) {
/* Memory test was aborted - write a newline to finish off */