cmd: mem: Remove CONFIG_SYS_MEMTEST_SCRATCH mapping
authorMichal Simek <michal.simek@xilinx.com>
Mon, 4 May 2020 11:54:40 +0000 (13:54 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 8 May 2020 13:16:26 +0000 (09:16 -0400)
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>
32 files changed:
README
cmd/mem.c
include/configs/MigoR.h
include/configs/advantech_dms-ba16.h
include/configs/apalis_imx6.h
include/configs/aristainetos2.h
include/configs/armadillo-800eva.h
include/configs/blanche.h
include/configs/cgtqmx6eval.h
include/configs/colibri_imx6.h
include/configs/dh_imx6.h
include/configs/el6x_common.h
include/configs/embestmx6boards.h
include/configs/ge_bx50v3.h
include/configs/gw_ventana.h
include/configs/imx6_logic.h
include/configs/kzm9g.h
include/configs/mx6sabre_common.h
include/configs/nitrogen6x.h
include/configs/presidio_asic.h
include/configs/sh7752evb.h
include/configs/sh7753evb.h
include/configs/sh7757lcr.h
include/configs/stm32mp1.h
include/configs/tao3530.h
include/configs/tricorder.h
include/configs/xilinx_versal.h
include/configs/xilinx_versal_mini.h
include/configs/xilinx_zynqmp.h
include/configs/xilinx_zynqmp_mini.h
include/configs/xilinx_zynqmp_r5.h
scripts/config_whitelist.txt

diff --git a/README b/README
index 2e8ad3bc0cb1f18a983da5eb0d525a66bb26d0e2..eb7892d4c15d61a3273c7e7836d26329764499e8 100644 (file)
--- a/README
+++ b/README
@@ -2477,10 +2477,6 @@ Configuration Settings:
                Begin and End addresses of the area used by the
                simple memory test.
 
-- CONFIG_SYS_MEMTEST_SCRATCH:
-               Scratch address used by the alternate memory test
-               You only need to set this if address zero isn't writeable
-
 - CONFIG_SYS_MEM_RESERVE_SECURE
                Only implemented for ARMv8 for now.
                If defined, the size of CONFIG_SYS_MEM_RESERVE_SECURE memory
index 009b7b58f32887dea97c78fbecb6f239289cc0d4..18f0510098be60355b4252815fd3401a87a2cb3c 100644 (file)
--- a/cmd/mem.c
+++ b/cmd/mem.c
 
 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 */
index c58b7814ba942aee1054a48d9b8f2a3925442aaa..2421300e1e13ac63c82f9395c2baaf0e5cc9820b 100644 (file)
@@ -32,7 +32,6 @@
 
 /* Enable alternate, more extensive, memory test */
 /* Scratch address used by the alternate memory test */
-#undef  CONFIG_SYS_MEMTEST_SCRATCH
 
 /* Enable temporary baudrate change while serial download */
 #undef  CONFIG_SYS_LOADS_BAUD_CHANGE
index deb4374d1c4a939651f2ac7e54ad25e54c21302b..b7b1ac2f89b7a5fcbda7e8ef0ea87d9d68ed20a2 100644 (file)
 
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
index fb0037444f4b3cff9fecfb2ce4360331dd0c3a43..49a28f5a3f5e5b9d491f831b29d721555181b3dc 100644 (file)
 
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
index 5f4a4f854f9c740f5b8566f29d67a4eaea688bb6..336cf1746ab01abfdf19301cbbb569f110099e10 100644 (file)
 
 #define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM
 #define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x100000)
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index e56929628bc78c3cfa4714a8d31637ccd6460b3b..c089b9c27c649346df73440ef9dc401ee9617210 100644 (file)
@@ -43,7 +43,6 @@
 #define CONFIG_SYS_MEMTEST_START       (ARMADILLO_800EVA_SDRAM_BASE)
 #define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
                                         504 * 1024 * 1024)
-#undef CONFIG_SYS_MEMTEST_SCRATCH
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE
 
 #define CONFIG_SYS_SDRAM_BASE          (ARMADILLO_800EVA_SDRAM_BASE)
index 7ee38a7ef9bc787016ad6a6203aae8f9c0b8d460..fd29c5d0f1ed9792e085a2fbc7e51dc74a06f9e2 100644 (file)
@@ -22,7 +22,6 @@
 #define RCAR_GEN2_SDRAM_SIZE           (1024u * 1024 * 1024)
 #define RCAR_GEN2_UBOOT_SDRAM_SIZE     (512 * 1024 * 1024)
 
-#undef CONFIG_SYS_MEMTEST_SCRATCH
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE
 
 /* FLASH */
index 797fcb14590a9e406db3dba02f8bca8d14459bd6..b6dfcdd08b95a79eda6d6c4394167f6355247aa8 100644 (file)
 
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END        0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                    MMDC0_ARB_BASE_ADDR
index 4cdd3c53afbb2d7b57890684dd8887f87472ed50..706665e37fc58e8abb88ab8816a9e944a8183604 100644 (file)
 
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
index 087d020cdd378fba032612b0ad02faadd4c85e5a..e16c9ee01d94cc00d39fc93065e1064a56293f46 100644 (file)
 
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END         0x20000000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Environment */
 
index 95c04c3797060814b23ae3c03522fd131b1d860c..bd42ad259d9344aea74e01bc0225ace34e96456b 100644 (file)
@@ -76,7 +76,6 @@
 
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END         0x10800000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index 62561116bbe320990e53450a0dd5b02c638bd715..bf51afbd9cdfbb8a5bd030fdc42156d688ab5738 100644 (file)
@@ -51,7 +51,6 @@
 
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index 3bf0cd518c1a23c04c6cc207d9e3a0a2e1afd4b6..2b55f51b8ba06a403ce8476d18b742fa6cccbec3 100644 (file)
 
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
index d169aa19de49974125f1012ea576fc141f038e3b..193c88e3da0ae25adb04524e3c9f299c6e591671 100644 (file)
 /* Memory configuration */
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END        0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index 2274db0e2295380d0b87b6fb40042074c851a50c..e77fb4a1b5e42f8d74ee44adbd830a0c9f8ddf16 100644 (file)
 
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index cceabdf66363f3dc3bb1427e7985be2468f85466..9ceb12f7e0068f5d3c4a20f7031c3ae9171bdeb4 100644 (file)
@@ -38,7 +38,6 @@
 #define CONFIG_SYS_MEMTEST_START       (KZM_SDRAM_BASE)
 #define CONFIG_SYS_MEMTEST_END \
        (CONFIG_SYS_MEMTEST_START + (60 * 1024 * 1024))
-#undef  CONFIG_SYS_MEMTEST_SCRATCH
 #undef  CONFIG_SYS_LOADS_BAUD_CHANGE
 
 #define CONFIG_SYS_INIT_RAM_ADDR       (0xE5600000) /* on MERAM */
index ee3b754910cc3e9545852c8a244a6fe180826968..b46367c83145179d9a9f550ab51f8558651cdd44 100644 (file)
 
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index 9ef6ea90a3f64f30f1ea6f3f9df115140bec7b17..5e09a783df2e0085c3236cc1d67e27fc983f7891 100644 (file)
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END        0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                    MMDC0_ARB_BASE_ADDR
index 023092e486da6fe78a4012e20ee6ba20b0f57aa5..56f009ad4e34222f43441b049f5043ece1adc1c1 100644 (file)
@@ -27,7 +27,6 @@
 #define GICD_BASE                      0xf7011000
 #define GICC_BASE                      0xf7012000
 
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x00100000
 #define CONFIG_SYS_MEMTEST_START       0x05000000
 #define CONFIG_SYS_MEMTEST_END         0x0D000000
 
index c45b33a91a97e4b212d3fa21d7c72ae9485c031d..ff49b9c2171bf16ecf73953e3fc2c6083215440a 100644 (file)
@@ -25,7 +25,6 @@
 #define CONFIG_SYS_MEMTEST_START       (SH7752EVB_SDRAM_BASE)
 #define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
                                         480 * 1024 * 1024)
-#undef CONFIG_SYS_MEMTEST_SCRATCH
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE
 
 #define CONFIG_SYS_SDRAM_BASE          (SH7752EVB_SDRAM_BASE)
index 70e7fb932484aa81ebbe596b1e80717a6134b5e9..74fb528d2e9771f141db93bcdbc8615db8d42210 100644 (file)
@@ -25,7 +25,6 @@
 #define CONFIG_SYS_MEMTEST_START       (SH7753EVB_SDRAM_BASE)
 #define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
                                         480 * 1024 * 1024)
-#undef CONFIG_SYS_MEMTEST_SCRATCH
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE
 
 #define CONFIG_SYS_SDRAM_BASE          (SH7753EVB_SDRAM_BASE)
index 6a34dc7954b65b5652fba3dec07d41e78b8e02a3..8f5c84207fe8792c662068307124c75cf84e79dd 100644 (file)
@@ -28,7 +28,6 @@
 #define CONFIG_SYS_MEMTEST_START       (SH7757LCR_SDRAM_BASE)
 #define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
                                         224 * 1024 * 1024)
-#undef CONFIG_SYS_MEMTEST_SCRATCH
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE
 
 #define CONFIG_SYS_SDRAM_BASE          (SH7757LCR_SDRAM_BASE)
index ae9631ebccdea6c54a782ab2fdaf68c096d5e6c4..cf04662328fbc0f11d99c2296e413d98343d8891 100644 (file)
@@ -68,7 +68,6 @@
 
 #define CONFIG_SYS_MEMTEST_START       STM32_DDR_BASE
 #define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + SZ_64M)
-#define CONFIG_SYS_MEMTEST_SCRATCH     (CONFIG_SYS_MEMTEST_END + 4)
 
 /*MMC SD*/
 #define CONFIG_SYS_MMC_MAX_DEVICE      3
index e95cd0087d3f49ca6f65bc315f57f75a08babeee..c80776b4da0e78a83ac8f83fb70fce16c38f8864 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       (0x82000000)            /* memtest */
                                                                /* defaults */
 #define CONFIG_SYS_MEMTEST_END         (0x83FFFFFF)            /* 64MB */
-#define CONFIG_SYS_MEMTEST_SCRATCH     (0x81000000)    /* dummy address */
 
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0)     /* default */
                                                        /* load address */
index 1e4459747d5414a7ca7e4a385816c09f6530930e..de6abb58377d1368ff6bd7090915b597ff297c6c 100644 (file)
 #define CONFIG_SYS_SPL_MALLOC_START    0x80208000
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000        /* 1 MB */
 
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x81000000
 #endif /* __CONFIG_H */
index 0c259a181f1080eb084642684b7539e74ebfc076..480afd993bcc543b89c7b5435d5b4997b799afd1 100644 (file)
@@ -18,7 +18,6 @@
 #define GICD_BASE      0xF9000000
 #define GICR_BASE      0xF9080000
 
-#define CONFIG_SYS_MEMTEST_SCRATCH     0xfffc0000
 
 #define CONFIG_SYS_MEMTEST_START       0
 #define CONFIG_SYS_MEMTEST_END         1000
index ee305e0226b3e664e2a28db816aa4643af670cbd..ae7eca11553f6958446e2b2a553e7eba53181877 100644 (file)
@@ -10,7 +10,6 @@
 #ifndef __CONFIG_VERSAL_MINI_H
 #define __CONFIG_VERSAL_MINI_H
 
-#define CONFIG_SYS_MEMTEST_SCRATCH     0xfffc0000
 
 #define CONFIG_EXTRA_ENV_SETTINGS
 
index eddc2b4020068f0d9e1553b0d9962cfa2e6a8fbe..01e05200dfe0889a43252bca7abad2935ee6184a 100644 (file)
 #define GICD_BASE      0xF9010000
 #define GICC_BASE      0xF9020000
 
-#ifndef CONFIG_SYS_MEMTEST_SCRATCH
-# define CONFIG_SYS_MEMTEST_SCRATCH    0x10800000
-#endif
-
 #define CONFIG_SYS_MEMTEST_START       0
 #define CONFIG_SYS_MEMTEST_END         1000
 
index a6922896e0e12cb85d17e1ebdf5e9ed06c359411..3078b9c55b529507bd9a1b4e0264285aaa57e531 100644 (file)
@@ -10,7 +10,6 @@
 #ifndef __CONFIG_ZYNQMP_MINI_H
 #define __CONFIG_ZYNQMP_MINI_H
 
-#define CONFIG_SYS_MEMTEST_SCRATCH     0xfffc0000
 
 #define CONFIG_EXTRA_ENV_SETTINGS
 
index 155d7fe883f059bec431e4534400b7db63fbf97c..327f0af3145c5c930bedd9429a53ce970e2442eb 100644 (file)
@@ -40,6 +40,5 @@
 /* 0x0 - 0x40 is used for placing exception vectors */
 #define CONFIG_SYS_MEMTEST_START       0x40
 #define CONFIG_SYS_MEMTEST_END         0x100
-#define CONFIG_SYS_MEMTEST_SCRATCH     0
 
 #endif /* __CONFIG_ZYNQ_ZYNQMP_R5_H */
index 2678626b59d474ad0c6438633d3e7ed9b9117634..cb401d3bec140967a695ce26dc8c4c618f270c52 100644 (file)
@@ -3076,7 +3076,6 @@ CONFIG_SYS_MEMAC_LITTLE_ENDIAN
 CONFIG_SYS_MEMORY_BASE
 CONFIG_SYS_MEMORY_SIZE
 CONFIG_SYS_MEMTEST_END
-CONFIG_SYS_MEMTEST_SCRATCH
 CONFIG_SYS_MEMTEST_START
 CONFIG_SYS_MEM_MAP
 CONFIG_SYS_MEM_RESERVE_SECURE