以Hi3519av100对应的uboot为例,想要uboot下进行内存测试
可以使用 “mtest” 命令
编译uboot,配置增加mtest宏
make ARCH=arm k5_hi3519av100_defconfig
make ARCH=arm menuconfig
找到
CONFIG_CMD_MEMTEST
将其变为 CONFIG_CMD_MEMTEST=y
然后找到对应的 “include/configs/”目录下的配置文件
这边是“k5_hi3519av100”,修改如下内容:
#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
然后编译,生成uboot,在uboot下查看“mtest”:
hisilicon # mtest help
mtest - simple RAM read/write test
Usage:
mtest [start [end [pattern [iterations]]]]
hisilicon #
简单做一个测试,测试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 #
结束!