U-Boot-Bootloader for BananaPI-R2/R64/R2Pro/R3/R4/R4Pro/R4Lite
Find a file
2025-12-27 10:51:01 +01:00
.github ci: fix pipeline for r4pro 2025-12-18 17:15:48 +01:00
api API: system info adds FLASH and clk fetches 2025-02-04 11:57:36 -06:00
arch arm: dts: get nvme working for r4pro 2025-12-27 10:51:01 +01:00
board add tlv_eeprom for bpi-r4 2025-10-06 21:24:51 +02:00
boot Revert "fdt: Make sure there is no stale initrd left" 2025-10-03 07:45:20 -06:00
cmd cmd: add pstore check 2025-10-06 21:21:45 +02:00
common spl: spi: fix falcon mode for spi boot 2025-09-12 08:24:21 -06:00
configs add dedicated devicetree for bpi-r4 2025-12-18 16:38:15 +01:00
disk disk/part_dos.c: Make use of LBAF for printing lbaint_t 2025-07-10 08:41:14 -06:00
doc Prepare v2025.10 2025-10-06 13:13:09 -06:00
drivers net: phy: Add the Airoha EN8811H PHY driver 2025-10-06 21:24:51 +02:00
dts doc: Update mentions of README.fdt-control 2025-09-27 09:20:22 +02:00
env env: fix typo in multiple Kconfig descriptions 2025-10-04 12:15:57 -06:00
examples examples: fix building on arm32 2025-02-04 11:57:36 -06:00
files add script for generating header from airoha firmware files 2025-10-06 21:22:48 +02:00
fs fs: exfat: Remove unused label code 2025-07-24 13:30:20 -06:00
include misc: fs_loader: Add request_firmware_into_buf_via_env API for environment-based firmware loading 2025-10-06 21:24:51 +02:00
lib net: lwip: enable debug traces for SNTP when CONFIG_LWIP_DEBUG is set 2025-09-30 12:01:36 +02:00
Licenses Licenses: Clarify exceptions for standalone apps 2022-10-26 15:21:11 -04:00
net net: lwip: ensure alignment of packet buffers 2025-09-30 13:08:38 +02:00
post post: Remove duplicate newlines 2024-07-15 12:12:18 -06:00
scripts pylibfdt: setup.py: Drop license_files 2025-08-07 11:16:12 -06:00
test test: cmd: Add simple test for i3c 2025-08-06 08:41:52 +02:00
tools binman: add a new entry type to support .bin file generation for the i.MX95 platform 2025-09-17 08:16:04 -03:00
.azure-pipelines.yml Docker, CI: Update to latest Ubuntu and Dockerfile 2025-07-25 13:03:01 -06:00
.b4-config b4-config: Improve b4 config for correct operation 2025-10-02 11:30:15 -06:00
.checkpatch.conf global: Move remaining CONFIG_SYS_* to CFG_SYS_* 2022-12-05 16:06:08 -05:00
.get_maintainer.conf get_maintainer.pl: Add --git to look up CCed in git history 2023-12-19 08:03:14 -05:00
.get_maintainer.ignore get_maintainer.pl: Add an ignore list for git history 2023-08-07 13:41:38 -04:00
.gitattributes gitattributes: define bin,img,elf as binary to not change line endings 2025-10-06 21:22:46 +02:00
.gitignore .gitignore: don't ignore .gitattributes files 2025-07-28 13:04:42 -06:00
.gitlab-ci.yml Docker, CI: Update to latest Ubuntu and Dockerfile 2025-07-25 13:03:01 -06:00
.mailmap MAINTAINERS: update email address of Heiko Schocher 2025-08-08 08:33:59 -06:00
.readthedocs.yml CI, docs: Install test/py/requirements.txt as well 2025-05-18 08:51:36 +02:00
build.conf add r4pro as extra board 2025-12-18 16:38:15 +01:00
build.sh add dedicated devicetree for bpi-r4 2025-12-18 16:38:15 +01:00
config.mk examples: eliminate CONFIG_STANDALONE_LOAD_ADDR 2025-02-04 11:57:36 -06:00
COPYING Add symlink from gpl-2.0.txt to a COPYING file 2025-09-29 11:56:16 -06:00
Kbuild build: support building with Link Time Optimizations 2021-05-24 14:21:30 -04:00
Kconfig Kconfig: typo restict 2025-08-04 18:23:16 -06:00
MAINTAINERS MAINTAINERS: Update MMC/POWER/FREESCALE QORIQ 2025-09-25 18:53:28 -06:00
Makefile Prepare v2025.10 2025-10-06 13:13:09 -06:00
README README: remove obsolete note 2025-07-14 12:44:04 -06:00
README.md readme: add README.md with emmc info 2025-10-06 21:22:49 +02:00
uEnv_r2.txt uEnv: all: drop numbers from menu entries 2025-10-10 22:13:07 +02:00
uEnv_r2pro.txt uEnv: all: drop numbers from menu entries 2025-10-10 22:13:07 +02:00
uEnv_r3.txt uEnv: all: drop numbers from menu entries 2025-10-10 22:13:07 +02:00
uEnv_r4.txt uenv: r4: use own sd/emmc overlays for r4pro 2025-10-27 11:26:13 +01:00
uEnv_r64.txt uEnv: all: drop numbers from menu entries 2025-10-10 22:13:07 +02:00

U-boot for BPI-R2/R64/R2Pro/R3/R4

CI

Requirements

On x86/x64-host you need cross compile tools for the armhf architecture:

sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu libc6-armhf-cross u-boot-tools make gcc swig python-dev python3-pyelftools

Issues

R2:

  • loadenv fails because of resized environment (4096 => 8188)
    • backup your saved environment before update uboot or change back CONFIG_ENV_SIZE to SZ_4K (./build.sh soc)
    • erase your saved environment
env erase
  • no emmc-command (not needed "emmc pconf 0x48" = "mmc partconf 0 1 1 0")

Usage

  #edit build.conf to select bpi-r64/bpi-r2pro/bpi-r3 if needed
  ./build.sh importconfig
  ./build.sh config #optional (menuconfig)
  ./build.sh
  ./build.sh install #write to sd-card
  ./build.sh umount #umount automatic mounted partitions

flash precompiled binaries

e.g. for change my image (not tested for openwrt) to 8G-variant

sudo dd if=bpi-r4_sdmmc_8GB_bl2.img of=/dev/sdX1 conv=notrunc,fsync

building and flash image

for all boards there are basic sdcard image templates created containing the full bootchain till uboot.

  • bpi-r2.img.gz
  • bpi-r2pro.img.gz
  • bpi-r3_sdmmc.img.gz
  • bpi-r4_sdmmc.img.gz
  • bpi-r64_sdmmc.img.gz

These do not contain linux kernel or rootfs but you can flash them as base to sdcard.

gunzip -c bpi-r3_sdmmc.img.gz | sudo dd bs=1M status=progress conv=notrunc,fsync of=/dev/sdX

#writing R3 emmc (booting from spi-nand/nor and load kernel with initrd)
gunzip -c /mnt/bpi-r3_emmc.img.gz | dd bs=1M status=progress conv=notrunc,fsync of=/dev/mmcblk0

After this you can extract the rootfs and kernel to the card.

refresh partitiontable and mounting

sudo partprobe /dev/sdX
udisksctl mount -b /dev/disk/by-label/BPI-BOOT
udisksctl mount -b /dev/disk/by-label/BPI-ROOT

debian bullseye rootfs (created by buildchroot.sh in same folder): https://drive.google.com/drive/folders/1mEcz1NLX8kv_AOKCPGGBcebRtLVNrQqF?usp=share_link

kernel: https://github.com/frank-w/BPI-Router-Linux/releases/

# unpack debian rootfs
sudo tar -xzf bullseye_arm64.tar.gz -C /media/$USER/BPI-ROOT
# unpack kernel binary files
sudo tar -xzf bpi-r3_6.1.0-main.tar.gz --strip-components=1 -C /media/$USER/BPI-BOOT BPI-BOOT
# for r3 move kernel binary to root of boot-partition and rename it
mv /media/$USER/BPI-BOOT/bananapi/bpi-r3/linux/bpi-r3.itb /media/$USER/BPI-BOOT/bpi-r3-6.1.0.itb
echo "fit=bpi-r3-6.1.0.itb" >> /media/$USER/BPI-BOOT/uEnv.txt
# unpack kernel modules to rootfs
# debian uses /lib as symlink to usr/lib, extracting the dir from tar overwrites symlink with directory
# which contains then only the kernel-modules, but not other libs so extract the subfolder to /lib
sudo tar -xzf bpi-r3_6.1.0-main.tar.gz --strip-components=2 -C /media/$USER/BPI-ROOT/lib/ BPI-ROOT/lib/

R2 uses uImage and kernel=xxx in uEnv.txt (in folder bananapi/bpi-r2/linux) R64, R3, R4 uses fit in in root dir of BPI-BOOT partition (fit=bpi-rX.itb) R2Pro uses now fit and uEnv.txt too (Image.gz+dtb in extlinux folder as fallback).

set root-password and maybe make additional changes:

sudo chroot /media/$USER/BPI-ROOT
passwd
echo "bpi-r3" > /etc/hostname

/etc/fstab

# <file system>	<dir>	<type>	<options>		<dump>	<pass>
/dev/mmcblk0p5	/boot	vfat    errors=remount-ro	0	1
/dev/mmcblk0p6	/	ext4	defaults		0	0

maybe add network-config (systemd) and systemd services i uploaded here: https://drive.google.com/drive/folders/1kST9ZOv8xQWFfo9GUNIIpKjD8QuYMj8i?usp=share_link

i have created an script which creates full sdcard-Images including rootfs and kernel (except BPI-R4):

https://github.com/frank-w/BPI-Router-Images