Configuring Barebox bootloader for Raspberry Pi CM4

566 views Asked by At

Advice on working with barebox bootloader on Raspberry Pi Cmpute Module 4 will be helpful.

I recently got my hands on a RPi CM4 Lite and now I want to build Yocto image with barebox as bootloader. I have few doubts before I get started.

  1. How should I do the Barebox configuration? For example, for raspberrypi3 we can have machine config in conf/local.conf as:
BAREBOX_CONFIG_raspberrypi3 = "rpi_defconfig"
BAREBOX_IMAGE_SRC_raspberrypi3 = "images/barebox-raspberry-pi-3.img"
COMPATIBLE_MACHINE_pn-barebox_raspberrypi3 = "raspberrypi3"
  1. For RPi CM4, I am using MACHINE="raspberrypi4-64". How should this be used for barebox config?

  2. In order to boot from uSD (for CM4 Lite) how should I copy the bootloader files? Will there be any difference between BCM283x RPi like RPi2/3 and BCM2711 based RPi CM4 Lite? In the Barebox manual steps are given for BCM283x machines.

I am trying to understand how boot process happens for RPi CM4 with barebox bootloader and yocto. My goal is to build an update with RAUC and Barebox.

Has anyone tried to configure barebox for RPi CM4?

Your help will be much appreciated.

Thanks in advance.

1

There are 1 answers

1
a3f On
  1. rpi_defconfig is the 32-bit config. You need to use rpi_v8_defconfig for 64-bit ARMv8-A.

  2. If your MACHINE is capable of booting Linux directly via config.txt, it should be able to boot barebox first

  3. You'll have to provide the barebox device tree to the barebox binary. Otherwise, the VideoCore behaves strangely. See this commit for details.

Starting with barebox v2022.08.0, there's now first upstream barebox support for the Raspberry Pi 4. There's still stuff missing, e.g. Ethernet for network boot, but Linux can be booted from SD. If you are willing to help with getting it to run on the CM4, you can mention that on the mailing list: https://lists.infradead.org/mailman/listinfo/barebox