Dear Armbian community, I'd like to share my experience with the latest Armbian Trixie running on Cubietruck with a full desktop environment. It wasn't a flawless experience this morning tbh. I was expecting a perfectly working image just like on a cubieboard2. Instead, whenever SDDM was to appear, the screen went blank. kmscube showed nothing and dmesg was full of lima ... gpmmu page fault at 0x... of type read, gp task error...
The same software works on a cubieboard2 (A20, 1 GiB), and the same cubietruck hardware runs the Mali just fine with the legacy 3.4 kernel (Armbian 559 if I remember correctly) and the Mali blob (glmark2_es2 is alive and rocking the GPU).
I don't know if it's a known bug and a patch lives elsewhere, I couldn't find anything but rumors, that HDMI out is not working on cubietrucks. Well, it is working now and since I've successfully tamed cubietruck to start it's Mali, I'd like to share my findings with the community.
I've tracked it down to the following culprit, hopefully my understanding of the principles is right, please feel free to correct me if I'm wrong. On A10/A20 the Mali-400 is an MBUS master (like the display engine, CSI and video engine). It sees DRAM at bus address 0x00000000, not at the CPU physical address 0x40000000. Mainline handles this for the other MBUS masters in drivers/soc/sunxi/sunxi_mbus.c (a DMA offset of PHYS_OFFSET is attached to the listed devices), but the Mali compatibles are missing from that list, so lima gives the GPU CPU physical addresses. That means:
- 1 GB boards: the DRAM controller decodes 30 address bits. 0x4xxxxxxx wraps around to the right place, so everything works by accident.
- 2 GB boards (Cubietruck): 31 bits are decoded. Every GPU access lands "just" 1 GiB away ๐ from the intended data. Page tables looked fine in memory, yet the GPU MMU faults. Command streams looked fine, yet the GPU reported invalid commands.
I've attached the fix which is currently running on my cubietruck. Two lines in drivers/soc/sunxi/sunxi_mbus.c: add "allwinner,sun4i-a10-mali" and "allwinner,sun7i-a20-mali" to sunxi_mbus_devices[], so the Mali gets the same MBUS DMA offset as the display engine, CSI and video engine. No lima, Mesa or device-tree change is needed.
The patched kernel has only been tested on my cubietruck so far (because my cubie2 runs on a stock Armbian just fine - the reason is obvious from the explanation above).
Disclaimer: my bug hunt and fix have been greatly supported by LLM tools (AI assistant Claude), no cubietrucks have been harmed during the sessions.
armbian-userpatch-0005-soc-sunxi-mbus-add-the-A10-A20-Mali-GPU.patch