Initial Ramdisk

To use an initial ramdisk (initramfs/initrd) on sunxi, for example if you have modular sata support and your root filesystm on sata, you need to use mkimage to convert your regular initial ramdisk to U-boot's format and adjust your U-boot configuration.

To convert an initial ramdisk to U-Boot's format: mkimage -A arm -T ramdisk -C none -n uInitrd -d /path/to/initrd.img /path/to/uInitrd

In the U-Boot configuration you will want to load the uInitrd file to 0x43100000, for example after the similar command to load the kernel: fatload mmc 0 0x43100000 /path/to/uInitrd

If you are doing this to use a rootfs on sata, then you will need to ensure the initial ramdisk loads the sata module. On Debian using initramfs-tools you would do this simply by adding sw_ahci_platform to /etc/initramfs-tools/modules on a line on it's own.

After any edits to /etc/initramfs-tools/modules you will need to update any initial ramdisk's you want to use it with a command such as: update-initramfs -u -k all

It would also be a good idea to have the initial ramdisk load the display modules early so you can see the output, and interact with the shell, in case of any issues. You can add the following modules to /etc/initramfs-tools/modules in this order to do this (and again update the initial ramdisk): lcd hdmi ump disp mali mali_drm

In the unusual circumstances where you need the initial ramdisk to access files from a fat partition then you would also want to add the nls_ascii and nls_cp437 to the list of modules loaded early in the initial ramdisk.