Install ArchLinux on MangoPi MQ Quad

Posted on | Updated on | 2 minutes
Table of contents

Mostly a memo rather than a tutorial. Not finished due to upstream kernel lack support for H616. I actually got ArchLinux rootfs work, but my motivation gone because no video output.

Steps overviewπŸ”—

An outline, remember me what to write.

  • Build U-Boot
    • Patch to add AXP313A driver
    • Add devicetree(U-Boot version)
    • Compile
  • Build Linux
    • Add devicetree(Linux version)
    • Configure Linux
    • Compile
  • Prepare SD card
    • Create partition table
    • Create/deploy rootfs
    • Write bootloader

Hardware introπŸ”—

MQ-Quad features a quad-core A53 CPU coded H616.

Build U-BootπŸ”—

Upstream u-boot miss necessary driver and devicetree. I implemented my own version, referring hardware developer's code. Later I found someone had released a related patch.

Then a corresponding devicetree is required. It don't have to be complete. Containing necessary nodes/devices for boot is good enough.

So long as u-boot can boot to its console, it's ok to continue.

To test u-boot, use either fel or sdcard to boot. Console is at uart0.

  • fel: sunxi-fel uboot u-boot-sunxi-with-spl.bin
  • sdcard: dd if=u-boot-sunxi-with-spl.bin bs=8K seek=1 of=/dev/target_block_device

Build LinuxπŸ”—

Upstream Linux(6.5 by the writing) miss necessary devicetree. I referred some code on GitHub, and the schematics.

Next "challenge" is to find a bootable configuration. Since I don't have a "bootable" SD card,

Prepare SD cardπŸ”—

Actually this should split into other sections so it can be a complete linear process.

Create a new MBR/GPT partition table with fdisk/gdisk. Note that if you plan to use GPT, you need to limit its size(<=56 entries, <8KB). This can be done with gdisk(expert mode).

Write the u-boot binary to 8KB