相关代码路径:
cmd/mem.c
配置:
make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- menuconfig
CC cmd/mem.o
cmd/mem.c: In function 'do_mem_mtest':
cmd/mem.c:883:10: error: 'CONFIG_SYS_MEMTEST_START' undeclared (first use in this function); did you mean 'CONFIG_SYS_MEMTEST_SCRATCH'?
start = CONFIG_SYS_MEMTEST_START;
^~~~~~~~~~~~~~~~~~~~~~~~
CONFIG_SYS_MEMTEST_SCRATCH
cmd/mem.c:883:10: note: each undeclared identifier is reported only once for each function it appears in
cmd/mem.c:884:8: error: 'CONFIG_SYS_MEMTEST_END' undeclared (first use in this function); did you mean 'CONFIG_SYS_MEMTEST_START'?
end = CONFIG_SYS_MEMTEST_END;
^~~~~~~~~~~~~~~~~~~~~~
CONFIG_SYS_MEMTEST_START
scripts/Makefile.build:278: recipe for target 'cmd/mem.o' failed
make[1]: *** [cmd/mem.o] Error 1
Makefile:1738: recipe for target 'cmd' failed
make: *** [cmd] Error 2
mem.c增加:
#define CONFIG_SYS_MEMTEST_START (CONFIG_SYS_SDRAM_BASE ) //
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 1024*1024*512) // 512M
测试使用
# mtest help
mtest - simple RAM read/write test
Usage:
mtest [start [end [pattern [iterations]]]]
通过查看bdinfo ddr地址
# mtest 0x0000000040000100 0x0000000050000000 0x01
Testing 40000100 ... 50000000: