[BPI-R3] Imagebuilder R3 Archlinux, kernel v6.3

Updated my installscript so it can build an image for BPI-R3 too. :slight_smile:

Here I start a topic for R3 related issues with the script.

Edit:

It is nearly finished, almost all things work now with many new extra’s.

What works so far:

  • Boot from ATF version 2.8, directly in to linux kernel. Although it is also possible to change the linux image path to u-boot image path and boot into u-boot this way.

  • ATF can load from fat32 boot partition, tool includes option to change from fip <-> boot partition.

  • Use overlays from source (.dts located on /boot/, applied into .dtb in fip/boot partition).

  • Added working LAN (non sfp ports)

  • Added wlan0 and wlan1 setup.

  • Added correct setup of initrd, keep ‘x’ pressed to run busybox ash.

  • Possibility to flash emmc, when booting up from SD card. No NAND/NOR needed.

  • Possibility to use U-Boot.

  • Kernel version is following linux rolling stable and is now at 6.3.3. Within 24 hours of new version on git, it should be ready for update through normal package update. No need to build kernel yourself, but it is possible if you want with a very simple command, just like any archlinux (AUR) package.

Issues:

  • Only real issue so far is EMMC not running at HS400, but on HS200. See separate topic for more info what’s going wrong…

Some technical details:

  • BL31 image is loaded together with the BL2 image. It does not need to be on the fip/boot partition (but if it is it will be used from fip/boot).

  • FIP partition does not need to be at specific sectors. ATF just uses the partition label, same as the ATF of the R64.

ATF:

Prebuild atf images in the bpir-atf-git-xxxx-.pkg.gz ftp://ftp.woudstra.mywire.org/repo/aarch64

Script that builds images here: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=bpir64-atf-git

Script that installs images here: https://aur.archlinux.org/cgit/aur.git/tree/bpir-writefip?h=bpir64-atf-git

1 Like

Two new options, tested on R3 (R64 not yet tested, but should work):

  1. The latest atf can boot from boot partition instead of fip partition, see [BPI-R3] & {BPI-R64] ATF with FAT32 load capabilities

Make some backups of important stuff, then update the `bpir64-atf-git’ with

pacman -Sy bpir64-atf-git

Then change your setup with:

bpir-writefip --fip2boot

Your fip partition has now transformed to a boot partition. Files from /boot/ are moved in to it. You can revert with:

bpir-writefip --boot2fip
  1. I have now added a U-Boot package, called bpir-uboot-git. You can consider it as an example package how to setup U-Boot, if you need it. With my fork of ATF you do not need it, but you now can if you want. Edit the package as you like and easily build U-Boot any way you customize it. For R3 it is based on sd card for now

It uses distro-boot to keep the package simple, using a flexible startup environment.

Anyway, it is fully functional and is also pre-build, uses the latest ATF. install it with:

pacman -Sy bpir64-atf-git bpir-uboot-git

When booting from boot partition, you are now already set.

When still booting with fip partition, Change the contents of /boot/bootcfg/linux to read /boot/u-boot.bin, then run bpir-writefip

The uboot package can be viewed here:

https://aur.archlinux.org/cgit/aur.git/tree/?h=bpir-uboot-git

Remove u-boot and change back to atf -> kernel boot:

pacman -R bpir-uboot-git

The script now is much more fool proof. Continuing after download hickups.

Major settings are now chosen with an interactive menu. Some advanced tweaks can be done by changing definitions at top of script.