4.5. Broadcom BCM283x¶
4.5.1. Raspberry Pi¶
barebox has support for BCM283x-based Raspberry Pi single board computers. Support is most extensive for BCM283. For the newer BCM2711 used in the Raspberry Pi 4, only basic support is currently available (Serial Port, Pinctrl/GPIO, SD-Card).
Prepare an SD or microSD card with a FAT filesystem of at least 30 MB in size.
Download the Raspberry Pi firmware (195 MB), unzip it, and copy the contents of the
boot/folder to your card.
make rpi_defconfig; maketo build barebox. This will create the following images:
images/barebox-raspberry-pi-1.imgfor the BCM2835/ARM1176JZF-S (Raspberry Pi 1, Raspberry Pi Zero)
images/barebox-raspberry-pi-2.imgfor the BCM2836/CORTEX-A7 (Raspberry Pi 2)
images/barebox-raspberry-pi-3.imgfor the BCM2837/CORTEX-A53 (Raspberry Pi 3)
images/barebox-raspberry-pi-cm3.imgfor the BCM2837/CORTEX-A53 (Raspberry Pi CM3)
images/barebox-raspberry-pi.img, which is a super set of all the other images
Copy the respective image for your model to your SD card and name it
images/barebox-raspberry-pi.imgis expected to replace the other images in the future. It contains the device trees of all supported (and enabled) variants and determines at runtime what board it runs on and does the right thing.
Create a text file
config.txton the SD card with the following content:kernel=barebox.img enable_uart=1
If you want to use the mini-uart instead of the PL011, you may need to additionally set:uart_2ndstage=1
This is required on boards, like the Raspberry Pi Zero W, that use the mini-uart as the primary UART. It is needed on boards like the CM3 as well if the mini-uart is to be used.
(For more information, refer to the documentation for config.txt.)
Connect to board’s UART (115200 8N1); Use PIN6 (GND), PIN8 (UART_TX), PIN10 (UART_RX) pins.
Turn board’s power on.
VideoCore firmware creates a device tree based on the entries in
config.txt. This file is available to the Barebox environment in the file
/vc.dtb. For example, to boot a kernel shipped with Raspbian:
bootm -o /vc.dtb /boot/kernel7.img
VideoCore device tree also contains the kernel command-line that is constructed from
cmdline.txt and other parameters internally determined by the VideoCore firmware. Normally in Barebox this command-line gets overwritten on boot by the Linux bootargs (see Booting Linux).
The original command-line from VideoCore device tree is available to the Barebox environment in the
vc.bootargs global variable. For example, to append it to the Linux bootargs: