Take the uboot corresponding to Hi3519av100 as an example, and want to test the memory under uboot
You can use the "mtest" command
Compile uboot, add mtest macro to configuration
make ARCH=arm k5_hi3519av100_defconfig
make ARCH=arm menuconfig
找到
CONFIG_CMD_MEMTEST
将其变为 CONFIG_CMD_MEMTEST=y
Then find the configuration file in the corresponding "include/configs/" directory
Here is "k5_hi3519av100", modify the following content:
#define CONFIG_SYS_MEMTEST_START (CONFIG_SYS_SDRAM_BASE + 0x3000000)
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x80000000 - 1)
注:
MEMTEST_START是从内存DDR的起始地址开始,但为了避开uboot的那段地址,因此+0x3000000;
同时DDR的size为2G,因此结束地址为DDR_START+DDR_SIZE
Then compile, generate uboot, check "mtest" under uboot:
hisilicon # mtest help
mtest - simple RAM read/write test
Usage:
mtest [start [end [pattern [iterations]]]]
hisilicon #
Simply do a test to test the memory between 0x30000000~0x35000000
dcache on
hisilicon # mtest 0x30000000 0x35000000 0x0 1
Testing 30000000 ... 35000000:
Pattern 00000000 Writing... Reading...Tested 1 iteration(s) with 0 errors.
hisilicon #
End!