测试发现a33核心板有时无法正常启动,通过串口信息显示判断是uboot 对mmc初始化有时会出现问题:
[ 0.770][mmc]: ************Try MMC card 2************
[ 0.796][mmc]: mmc 2 2xmode config clk
[ 0.806][mmc]: mmc 2 data timeout 80
[ 0.810][mmc]: smc 2 err, cmd 8, DCE
[ 0.814][mmc]: Read remain data
[ 0.819][mmc]: mmc 2 mmc cmd 8 err 0x00000080
[ 0.823][mmc]: mmc send ext csd failed
[ 0.827][mmc]: send ext csd faild
[ 0.830][mmc]: Change speed mode failed
[ 0.834][mmc]: ************SD/MMC 2 init error!!!************
[ 0.840][mmc]: MMC: block number 0x1 exceeds max(0x0)
原因不明。
临时解决方案:当uboot检测到emmc初始化失败时reset cpu。
1. 修改驱动
具体需要修改lichee/brandy/uboot-2011-09/driver/mmc/mmc.c
在检测到mmc_startup失败后,调用reset_cpu(0)来重启cpu。
2. 编译打包
cd lichee/brandy/uboot-2011-09/
make distclean
make sun8iw5p1
make -j