The PXAMCI is known to be crappy. Though fixing this bug with the PXAMCI was simple. The problem was the mmc init command had to be called twice (or multiple times as some people reported) before the card was detected. It was just that the card was not fast enough to respond to commands so increasing the delays in the initialization routine fixed the problem.
Next was the scripting. I fixed a small conditional statement into the u-boot bootcmd variable which tries starting the MMC card and in case the card is there, starts a script called uboot.script from it. If the card is not present, it tries to start kernel from 0x60000.
The script for u-boot has to be compiled in a little special way. For that, there's a utility called mkimage. This utility takes input files, adds CRC and various other goodies and spits out an image that u-boot can use. To compile uboot.script, run the command like this (this is a one-liner):
mkimage -A arm -O u-boot -T script -C none -a 0 -e 0 -n uboot.script -d SOURCEFILE uboot.script
where SOURCEFILE is the file with the script and uboot.script is the result that goes onto the memory card. For example, my script that only boots the kernel looks like this:
if fatload mmc 0 0xa0000000 uImage ; then
bootm 0xa0000000 ;
fi
As for the updated u-boot, the patches and a binary are available here:
- 0001 MMC card detection fix
- 0002 do_div optimized for ARM (GCC BUG workaround)
- 0003 ZipitZ2 support
- New u-boot binary for Zipit Z2
- Apply all three patches in correct order (use git am)
- make CROSS_COMPILE=arm-crosscc- clean mrproper
- make CROSS_COMPILE=arm-crosscc- zipitz2_config
- make CROSS_COMPILE=arm-crosscc- -j9
- Flash u-boot.bin to 0x00 and erase 0x40000 (for environment) in your flash. In old u-boot, run:
- loady 0xa0000000 (here send the u-boot.bin over Ymodem)
- protect off all
- erase 0x00 +0x20000
- erase 0x40000 +0x20000
- cp.b 0xa0000000 0x0 0x1ea88
- reset
No comments:
Post a Comment