-
Notifications
You must be signed in to change notification settings - Fork 3
Home
u-boot for Allwinner A10 & A13
sunxi Default branch. Most up to date and supports both A10 and A13.
sun4i Old A10 branch. No longer maintained.
sun5i Old A13 branch. No longer maintained.
lichee/ Unmodified mirrors of original Allwinner sources
wip/ Work in progress temporary feature branches.
v2011.09-sun4i
You need a suitable gcc ARM Linux GNUEABI toolchain installed and added to your PATH.
Then compile u-boot for A10 by running
make 'boardtype' CROSS_COMPILE=arm-none-linux-gnueabi-
or alternatively depending on how your toolchain is configured
make 'boardtype' CROSS_COMPILE=arm-linux-gnueabi-
Available board types are:
sun4i Generic A10
sun5i Generic A13
a13_olinuxino Olimex A13-OLinuXino (SPL)
cubieboard Cubieboard (SPL)
mele_a1000 Mele A1000 (SPL)
Boards with (SPL) include SPL loader to boot directly from SD-card.
A10 & A13 boots the SPL loader from block 8. This then loads actual u-boot from block 32 onwards, counted in 1KB blocks.
dd if=spl/sunxi-spl.bin of=/dev/sdc bs=1024 seek=8
dd if=u-boot.bin of=/dev/sdc bs=1024 seek=32
You also need to partition the card to store system.bin, uImage, boot.scr (optional) and rootfs partition there. First partition should start at sector 2048 to leave sufficient space for uboot & environment.
This version of u-boot support uEnv.txt, and will look for it in the first partition FAT /uEnv.txt or extX /uEnv.txt or extX /boot/uEnv.txt. uEnv.txt contains variables on the form variable=value, one per line. If the variable uenvcmd is set then u-boot will run the commands listed in this variable.
This version of u-boot supports boot.scr, and will look for it in the first partition FAT /boot.scr or extX /boot.scr or extX /boot/boot.scr. boot.scr contains your needed uboot commands for loading script.bin, kernel. initrd (optional), setting kernel parameters and booting.
To create boot.scr first make a u-boot script boot.cmd with the u-boot commands you need for booting your system. An example follows:
setenv bootargs console=ttyS0 root=/dev/mmcblk0p1 rootwait panic=10 ${extra}
ext2load mmc 0 0x43000000 boot/script.bin
ext2load mmc 0 0x48000000 boot/uImage
bootm 0x48000000
Then translate this to a boot.scr by using the mkimage command
mkimage -C none -A arm -T script -d boot.cmd boot.scr
If no boot.scr is found then it will fall back to load script.bin & kernel uImage from the first partition in FAT format
fatload mmc 0 0x43000000 script.bin && fatload mmc 0 0x48000000 ${kernel} && watchdog 0 && bootm 0x48000000
The watchdog command can be used to set a watchdog timeout. A timeout of 0 disables the watchdog. The watchdog have an upper limit of approximately 20 seconds.
You can enable automatic watchdog support by building with CONFIG_WATCHDOG enabled. This makes the watchdog armed by default. Be warned that If the kernel is not up and running and poking the watchdog within the watchdog timeout (approximately 20 seconds) then the watchdog will automatically reboot the system.
baudrate=115200
scriptaddr=0x44000000
bootscr=boot.scr
bootenv=uEnv.txt
loadbootscr=fatload mmc 0 ${scriptaddr} ${bootscr} || ext2load mmc 0 ${scriptaddr} ${bootscr} || ext2load mmc 0 ${scriptaddr} boot/${bootscr}
loadbootscr=fatload mmc 0 ${scriptaddr} ${bootenv} || ext2load mmc 0 ${scriptaddr} ${bootenv} || ext2load mmc 0 ${scriptaddr} boot/${bootenv}
boot_mmc=fatload mmc 0 0x43000000 script.bin && fatload mmc 0 0x48000000 ${kernel} && watchdog 0 && bootm 0x48000000
bootcmd=if run loadbootenv; then \
echo Loaded environment from ${bootenv}; \
env import -t ${scriptaddr} ${filesize}; \
fi; \
if test -n ${uenvcmd}; then \
echo Running uenvcmd ...; \
run uenvcmd; \
fi; \
if run loadbootscr; then \
echo Jumping to ${bootscr}; \
source ${scriptaddr}; \
fi; \
run setargs boot_mmc;"
bootdelay=3
console=ttyS0,115200
kernel=uImage
loglevel=8
panicarg=panic=10
root=/dev/mmcblk0p2
setargs=setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs}
stderr=serial
stdin=serial
stdout=serial
How the SD-Card is used by u-boot-mmc, counted in 1KB blocks:
start size
0 8KB Unused, available for partition table etc.
8 24KB Initial SPL loader
32 512KB u-boot
544 128KB environment
672 352KB reserved
1024 - Free for partitions