Mainline U-Boot with Arch Linux PKGBUILD

I have been tweaking my Arch Linux setup since I described how to dirty hack Arch over Ayufans images in this forum a while back (

There is already a thread on compiling U-Boot for the RockPro64 in this forum by @TaborFife, but he did not create a PKGBUILD for easy reproduction and updates under Arch Linux. His build is rather described to be built from any host, but I think if anyone wants to install Arch Linux on their RockPro64, it is likely they also have an Arch Linux x86 machine running somewhere Big Grin

So, now I have created a PKGBUILD for building U-Boot for the RockPro64 from upstream U-Boot with ARM Trusted Firmware also built from source. The PKGBUILD and install files are based on the uboot PKGBUILD for the Rock64 which is already in the ArchLinuxARM repos.

According to the Rockchip wiki, this equals to Boot Flow 2 with the small exception that ATF is also compiled from source.

The PKGBUILD can be both cross compiled from an Arch Linux x86 machine (works out of the box) or directly on your RockPro64.

What is the advantage of doing everything from source: First for the fun of learning, and second, I can do the build without the Rockchiptools. I just find things more beautiful if you do not need special vendor tools for anything.

So, here is the HowTo (to do an initial build to bootstrap your SD card from your Arch Linux x86 PC):

1) Check out the PKGBUILD from my GitHub:

2) Make the package - for bootstrapping the SD card, you will need to go into the directory where the package sources have been build my makepkg

3) Partition your SD card as described by @TaborFife in his thread in Section 2, steps 0 to 4

4) From the directory where u-boot has been build (makepkg builds packages in the 'BUILDDIR' directory, described in /etc/makepkg.conf) burn the bootloader with dd to the SD card:
dd if=/usr/share/uboot/idbloader.img of=/dev/mmcblk0 seek=64 conv=notrunc
dd if=/usr/share/uboot/u-boot.itb of=/dev/mmcblk0 seek=16384 conv=notrunc

5) When you are done, check out the thread of @TaborFife again and continue with Step 5 from Section 2 until the end to bootstrap Arch Linux ARM on your SD card.

What to do if you already have Arch Linux installed on your RockPro64:

1) Either on your Arch Linux x86 machine or directly on the RockPro64, check out my GitHub repo

2) Make the package (When building on your RockPro64, please refrain from compiling on the SD card. That is terribly slow and cards are not really made to endure such write loads). If you cross compile from your x86, copy the resulting package to your RockPro64

3) Install the built package with pacman. You can choose if you want to directly burn it to your SD card or do it later manually. If you do it manually, the needed files are copied to the directory /usr/share/uboot

Closing remarks:

As of the writing of this post, my RockPro64 runs on the newest U-Boot release 2020.01

Configure the boot:
The package employs the file /boot/boot.scr, generated from /boot/boot.txt for boot configuration. If you want to use extlinux config file for booting, simply delete /boot/boot.scr and create a file /boot/extlinux/extlinux.conf with an extlinux.conf (you can create your own, copy one from Ayufan's images, whatever you like). Mainline U-Boot understands both files, seems to prefer /boot/extlinux/extlinux.conf if both are present.

I have not tried to burn U-Boot to the SPI flash, it would be nice if someone who tries this could post their results.

If you want just U-Boot for whatever distro, just head over to @TaborFife 's Thread for the general description of compiling U-Boot (Described in his Section 1)

Possibly Related Threads…
Thread Author Replies Views Last Post
  Booting Linux/Debian from the eMMC linuxha 4 410 03-02-2021, 07:01 PM
Last Post: linuxha
Question Mainline Debian Buster on RockPro64 ? chrestomanci 36 12,068 02-14-2021, 02:37 PM
Last Post: foresto
Thumbs Up First Manjaro Mainline build! Luke 10 5,635 10-20-2020, 04:29 AM
Last Post: vfr400racer
  Xen EFI with Alpine Linux dom0 sir.lami 0 793 08-26-2020, 12:25 PM
Last Post: sir.lami
  Linux Host - QEMU Android Guest? rik-shaw 0 688 07-09-2020, 08:02 PM
Last Post: rik-shaw
  Official Debian release won't boot!?! Faradn 4 2,104 07-06-2020, 09:29 AM
Last Post: Bullet64
  RETRO GAMING BATOCERA LINUX + ROSHAMBO CASE - Tutoriel Fr TheMiniCakeTV 0 1,499 07-02-2020, 12:45 PM
Last Post: TheMiniCakeTV
  Arch Linux on RockPro64 mmatyas 30 21,736 05-30-2020, 12:08 PM
Last Post: mmatyas
  RockPro64 Linux Manjaro HDMI 4K mkne 12 4,255 05-03-2020, 07:23 AM
Last Post: PakoSt
  Slow/dead ethernet on (non-Ayufan) Linux Mainline (fixed) mmatyas 1 1,109 04-17-2020, 02:53 AM
Last Post: Thra11

Forum Jump:

Users browsing this thread: 1 Guest(s)