This is a demo of a universal SD card image, which should be bootable on almost any Allwinner A10/A10s/A20 device. With an installer of u-boot v2015.07 as the initial simple payload. By using a HDMI monitor for output and a USB keyboard or FEL button for input, it offers a menu based user interface. Which allows to select and install a suitable board-specific u-boot build.
The installer uses a minimal soc-independent placeholder bootloader to boot, plus some supplementary files in the '/boot/setup' directory on the first ext2 partition. As soon as the real full-fledged u-boot v2015.07 bootloader takes over, it expects to find the '/boot/boot.scr' file and a linux kernel in the '/boot' directory. After that, the '/boot/setup' directory becomes unnecessary.
This demo SD card image only takes care of the bootloader. The kernel and rootfs are not provided here and need to be additionally included to get a usable linux system. The providers of SD card images with Linux distributions for Allwinner boards may potentially try to use this SD card image as a starting point. Now it is a full-fledged Debian Linux installer. The installation of it requires a working Internet connection.
- If you have a Banana Pro board, then stop here and don't use this SD card image on it! There is a risk of damaging hardware on this particular board because of the way how USB OTG ID pin is routed in Banana Pro.
- Just write the SD card image to some SD card ("xzcat 20141215-sunxi-bootsetup-prototype-v6.img.xz > /dev/sdX" and then "sync").
- Insert the SD card in your Allwinner device.
- Connect a monitor or TV via a HDMI cable or alternatively get access to the UART serial console.
- Power on the device.
- Follow the instructions on screen.
v2: Updated the SD card image to address a simple typo in /boot/setup/boot-a10s.cmd and make it really bootable on A10s.
v3: Updated the SD card image to reduce the failsafe DRAM clock frequency from 360MHz to 312MHz for a safety headroom even on boards with poor DRAM reliability.
v4: The failsafe DRAM clock frequency is back to 360MHz because Cubietruck board can't handle low clock frequencies. But the 'emr1 = 4' change is kept. Also added the Debian installer as another payload to make this demo a little bit more useful.
v5: The Debian installer now runs on the UART serial console instead of HDMI (which is a more reasonable choice, because the current version of Debian can't support HDMI anyway and is only suitable for headless servers). The version of u-boot is upgraded from v2015.01-rc3 to v2015.01 release.
v6: A newer snapshot of the Debian installer (07 Sep 2015), which now has simplefb support and works fine with HDMI monitors. The version of u-boot is also upgraded to v2015.07. Note: this particular snapshot of Debian bundles the kernel, which may fail to reboot after the end of installation: http://lists.infradead.org/pipermail/linux-arm-kernel/2015-August/365911.html (so you will have to reset the board if it gets stuck).
Reconstructing this SD card image by building all of its parts from sources (this is optional)
Use buildroot from https://github.com/ssvb/buildroot/commits/20141215-sunxi-bootsetup-prototype to build the initramfs file "/boot/setup/rootfs.cpio.uboot":
git clone -b 20141215-sunxi-bootsetup-prototype https://github.com/ssvb/buildroot.git cd buildroot make sunxi_bootsetup_defconfig make
Use https://github.com/ssvb/linux-sunxi/commits/20141215-sunxi-bootsetup-prototype to build the linux kernel ("/boot/setup/uImage-3.18-bootsetup") and dtb files ("/boot/setup/sun4i-a10-bootsetup.dtb", "/boot/setup/sun5i-a10s-bootsetup.dtb", "/boot/setup/sun7i-a20-bootsetup.dtb"):
git clone -b 20141215-sunxi-bootsetup-prototype https://github.com/ssvb/linux-sunxi.git cd linux-sunxi make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_bootsetup_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x40008000 -j2 uImage dtbs
Use upstream u-boot v2015.07 sources to build the u-boot binaries for all the supported Allwinner boards and populate the "/boot/setup/u-boot-binaries" directory.
Use https://github.com/ssvb/u-boot-sunxi/commits/20141215-sunxi-bootsetup-prototype to build the bootloader for the SD card:
git clone -b 20141215-sunxi-bootsetup-prototype https://github.com/ssvb/u-boot-sunxi.git cd u-boot-sunxi make CROSS_COMPILE=arm-linux-gnueabihf- sunxi-generic-a10-a13-a20_defconfig make CROSS_COMPILE=arm-linux-gnueabihf- -j2 sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8 sync
For the details about hooking the standard Debian installer and keeping it up to date, see http://linux-sunxi.org/Mainline_Debian_HowTo#Using_a_ready-made_installation_SD_card_image_instead_of_bootstrapping