💾 Archived View for lofi.haiku-os.org › docs › develop › kernel › arch › arm › allwinner_a10.gmi captured on 2024-08-25 at 00:19:39. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-09-28)
-=-=-=-=-=-=-
The A10 is a system-on chip. There are many devices based on it, for example the CubieBoard and the Rikomagic mk802 (versions I and II).
Not so fun layout here. The A10 boot ROM reads raw blocks from the SD card (MBR style), so the bootloader can’t just be dropped in a FAT32 partition.
Note this layout can be a bit different depending on the u-boot version used, some versions will store the environment in uEnv.txt in the FAT32 partition instead. Since everything is loaded from the SD Card, we are free to customize the u-boot or even remove it and get haiku_loader booting directly.
1. SOC load SPL
2. SPL loads u-boot
3. u-boot loads and run the kernel
SPL is a small binary (24K) loaded from a fixed location on the SD card. It does minimal hardware initializations, then loads u-boot, also from the SD card. From there on things go as usual.
In the long term, we can make haiku_loader be an SPL executable on this platform, if it fits the 24K size limit, or have a custom stage1 that loads it. For now, u-boot can be an useful debugging tool.
In order to work on different devices (RAM timings, PIO configs, …), the Linux kernels for Allwinner chips use a “script.bin” file. This is loaded to RAM at a fixed address by u-boot, then the Kernel parses it and uses it to configure the hardware (similar to FDT).
We should probably NOT use this, and convert the script.bin file to an FDT instead. The format is known and there are tools to convert the binary file to an editable text version and back (bin2fex and fex2bin).
This FEX stuff isn’t merged in mainline Linux, and lives on as Allwinner patches. The mainline Linux kernel has some A10 support, rewritten to use FDT. We may use the FDT files from there for the most common boards.
qemu 1.0 has a Cubieoard target which emulates this chip.
Arch Linux instructions on creating a bootable SD card (partition layout, etc)
http://archlinuxarm.org/platforms/armv7/allwinner/cubieboard#qt-platform_tabs-ui-tabs2
Linux SunXi: mainline Linux support for the Allwinner chips. Lots of docs on the hardware.