Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-boot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- aarch64_qemu_boot
- bpi_r3_sd_boot
- bpi_r3_emmc_boot
- bpi_r64_sd_boot
- bpi_r64_emmc_boot
- cn9130_crb_boot
- fireant_boot
- nanopi_r2s_boot
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- raspberrypi-rpi2
- raspberrypi-rpi64
- bananapi-bpi-r3
- bananapi-bpi-r64
- friendlyarm-nanopi-r2s
- microchip-sama7g54-ek
default: 'raspberrypi-rpi64'
Expand Down Expand Up @@ -67,6 +68,12 @@ jobs:
echo "ARCH=aarch64" >> $GITHUB_ENV
echo "BUILD_EMMC=true" >> $GITHUB_ENV
;;
bananapi-bpi-r64)
echo "BOOTLOADER_SD=bpi-r64-sd-boot" >> $GITHUB_ENV
echo "BOOTLOADER_EMMC=bpi-r64-emmc-boot" >> $GITHUB_ENV
echo "ARCH=aarch64" >> $GITHUB_ENV
echo "BUILD_EMMC=true" >> $GITHUB_ENV
;;
friendlyarm-nanopi-r2s)
echo "BOOTLOADER=nanopi-r2s-boot" >> $GITHUB_ENV
echo "ARCH=aarch64" >> $GITHUB_ENV
Expand Down
1 change: 1 addition & 0 deletions board/aarch64/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ if BR2_aarch64

source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/alder-alder/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/bananapi-bpi-r3/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/bananapi-bpi-r64/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/freescale-imx8mp-evk/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/friendlyarm-nanopi-r2s/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/marvell-cn9130-crb/Config.in"
Expand Down
3 changes: 2 additions & 1 deletion board/aarch64/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ aarch64
Board Specific Documentation
----------------------------

- [Banana Pi R3](banana-pi-r3/)
- [Banana Pi BPi-R3](banana-pi-r3/)
- [Banana Pi BPi-R64](banana-pi-r64/)
- [Marvell CN9130-CRB](cn9130-crb/)
- [Microchip SparX-5i PCB135 (eMMC)](sparx5-pcb135/)
- [NanoPi R2S](r2s/)
Expand Down
7 changes: 7 additions & 0 deletions board/aarch64/bananapi-bpi-r64/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config BR2_PACKAGE_BANANAPI_BPI_R64
bool "Banana Pi R64"
depends on BR2_aarch64
select BR2_PACKAGE_FEATURE_WIFI
select SDCARD_AUX
help
Build Banana PI R64 support
13 changes: 13 additions & 0 deletions board/aarch64/bananapi-bpi-r64/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2026 The KernelKit Authors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
143 changes: 143 additions & 0 deletions board/aarch64/bananapi-bpi-r64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Banana Pi BPI-R64

## Overview

<img align="right" src="banana_pi_bpi-r64_interface.jpg" alt="Board Overview" width=400 padding=10>

The Banana Pi BPI-R64 is a networking board based on the MediaTek MT7622
(dual Cortex-A53, AArch64) SoC.

### Hardware Features

- MediaTek MT7622 ARM Cortex-A53 dual-core processor @ 1.35 GHz
- 1 GB DDR3L RAM
- 8 GB eMMC storage
- microSD card slot
- MT7531 Gigabit Ethernet switch (4x LAN + 1x WAN)
- MT7603E built-in 2.4 GHz WiFi
- USB 3.0 port
- 2x Mini PCIe slots

### Default Network Configuration

Infix comes preconfigured with:

- **LAN ports** (lan0-lan3): Bridged for internal networking
- **WAN port**: DHCP client enabled for internet connectivity
- **WiFi** (wifi0-ap): Bridged to LAN (MT7615 PCIe card if fitted, otherwise MT7603E)

## Boot Switch Reference

<img align="right" src="bpi-r64-sw1.png" alt="SW1 Boot Switch" width=90 padding=10>

The BPI-R64 uses a 2-position DIP switch (SW1) to select the boot device
order. The MT7622 Boot ROM tries devices in the order listed and falls
back to the next if no valid BL2 is found at the expected location.

| SW1 | Boot device | Use case |
|-----|-------------|----------------------------|
| OFF | eMMC | Production eMMC boot |
| ON | SD card | SD card boot / development |

> [!NOTE]
> SinoVoip has exposed only one bit of the MT7622's two-bit `BOOT_SEL[1:0]`
> strapping field via SW1, with `BOOT_SEL[1]` hardwired high. This limits the
> board to eMMC (`10b`) and SD (`11b`) boot; the SPI-NOR and SPI-NAND modes
> available on the MT7622 reference board (`00b`, `01b`) are not selectable.

## Getting Started

### Quick Start with SD Card

1. **Flash the image to an SD card** (the filename includes the version, e.g.
`infix-25.01-bpi-r64-sdcard.img`):

<img align="right" src="debug-uart.png" alt="Debug UART" width=100 padding=10>

```sh
dd if=infix-*-bpi-r64-sdcard.img of=/dev/sdX bs=4M status=progress
```

2. **Set boot switch:** SW1 ON (SD card boot)
3. **Insert SD card and power on**
4. **Connect console:** 115200 8N1 — use the dedicated Debug UART header
just below the 40-pin GPIO header; pins are labeled GND, RX, TX on the board
5. **Default login:** `admin` / `admin`

## Installing to eMMC

Unlike the BPI-R3 (where SD and eMMC share a bus, requiring a NAND intermediate
step), the BPI-R64 has separate controllers for SD (mmc1/MSDC1) and eMMC
(mmc0/MSDC0). You can write directly to eMMC while booted from SD.

### eMMC Boot ROM Behaviour

> [!IMPORTANT]
> The MT7622 Boot ROM reads BL2 from the eMMC BOOT0 hardware partition (offset
> 0), not from the User Data Area where the main disk image lives. The
> installation procedure below writes BL2 to BOOT0 separately to handle this.

### Procedure

Boot from SD and write the eMMC image from U-Boot using a FAT32-formatted USB
drive.

#### Step 1: Boot from SD card

1. Set SW1 to ON (SD boot)
2. Insert SD card with Infix
3. Power on and break into U-Boot (press Ctrl-C during boot)

#### Step 2: Write the eMMC image from U-Boot

Place `infix-bpi-r64-emmc.img` and `bl2.img` on a FAT32-formatted USB drive,
then from the U-Boot prompt:

```
usb start
fatload usb 0:1 0x44000000 infix-bpi-r64-emmc.img
setexpr blocks ${filesize} / 0x200
mmc dev 0
mmc write 0x44000000 0x0 ${blocks}
```

#### Step 3: Write BL2 to eMMC BOOT0

```
fatload usb 0:1 0x44000000 bl2.img
mmc partconf 0 1 1 1
setexpr blkcnt ${filesize} + 0x1ff
setexpr blkcnt ${blkcnt} / 0x200
mmc write 0x44000000 0x0 ${blkcnt}
mmc partconf 0 1 1 0
```

#### Step 4: Boot from eMMC

1. Power off the board
2. Set SW1 to OFF (eMMC boot)
3. Remove SD card and USB drive
4. Power on

## Platform Notes

### mmc0 = eMMC, mmc1 = SD

On MT7622, MSDC0 (mmc0) is the 8-bit eMMC controller and MSDC1 (mmc1) is the
4-bit SD card controller — the reverse of many other platforms.

## Building

```sh
# Bootloader only (SD)
make O=x-boot-bpir64-sd bpi_r64_sd_boot_defconfig && make O=x-boot-bpir64-sd

# Bootloader only (eMMC)
make O=x-boot-bpir64-emmc bpi_r64_emmc_boot_defconfig && make O=x-boot-bpir64-emmc

# Compose SD image (pass the Infix rootfs output directory)
utils/mkimage.sh -b x-boot-bpir64-sd -r x-aarch64/images bananapi-bpi-r64

# Compose eMMC image
utils/mkimage.sh -b x-boot-bpir64-emmc -r x-aarch64/images -t emmc bananapi-bpi-r64
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions board/aarch64/bananapi-bpi-r64/bananapi-bpi-r64.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
define BANANAPI_BPI_R64_LINUX_CONFIG_FIXUPS
$(call KCONFIG_ENABLE_OPT,CONFIG_ARCH_MEDIATEK)
$(call KCONFIG_ENABLE_OPT,CONFIG_MACH_MT7622)
$(call KCONFIG_ENABLE_OPT,CONFIG_PINCTRL_MT7622)
$(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_8250_MT6577)
$(call KCONFIG_ENABLE_OPT,CONFIG_MTK_UART)
$(call KCONFIG_ENABLE_OPT,CONFIG_MEDIATEK_WATCHDOG)
# Ethernet subsystem clock controller — required for the eth MAC,
# MT7531 DSA switch, and HSDMA to get their clocks from &ethsys.
# Without this, eth probe fails and the switch is never detected.
$(call KCONFIG_ENABLE_OPT,CONFIG_COMMON_CLK_MT7622_ETHSYS)
# HIF subsystem clock controller — required for PCIe and USB.
$(call KCONFIG_ENABLE_OPT,CONFIG_COMMON_CLK_MT7622_HIFSYS)
$(call KCONFIG_ENABLE_OPT,CONFIG_MEDIATEK_GE_PHY)
$(call KCONFIG_ENABLE_OPT,CONFIG_REALTEK_PHY)
$(call KCONFIG_ENABLE_OPT,CONFIG_NET_VENDOR_MEDIATEK)
$(call KCONFIG_ENABLE_OPT,CONFIG_NET_MEDIATEK_SOC)
$(call KCONFIG_SET_OPT,CONFIG_NET_DSA_MT7530,m)
$(call KCONFIG_SET_OPT,CONFIG_MT7603E,m)
$(call KCONFIG_SET_OPT,CONFIG_PCIE_MEDIATEK,m)
$(call KCONFIG_ENABLE_OPT,CONFIG_MMC_MTK)
$(call KCONFIG_SET_OPT,CONFIG_USB_XHCI_MTK,m)
$(call KCONFIG_SET_OPT,CONFIG_PHY_MTK_TPHY,m)
$(call KCONFIG_SET_OPT,CONFIG_MTK_THERMAL,m)
$(call KCONFIG_SET_OPT,CONFIG_MTK_SOC_THERMAL,m)
$(call KCONFIG_SET_OPT,CONFIG_I2C_MT65XX,m)
$(call KCONFIG_SET_OPT,CONFIG_PWM_MEDIATEK,m)
$(call KCONFIG_SET_OPT,CONFIG_REGULATOR_MT6380,m)
$(call KCONFIG_SET_OPT,CONFIG_NVMEM_MTK_EFUSE,m)
$(call KCONFIG_SET_OPT,CONFIG_CRYPTO_DEV_SAFEXCEL,m)
$(call KCONFIG_ENABLE_OPT,CONFIG_RTC_DRV_MT7622)
endef

$(eval $(ix-board))
$(eval $(generic-package))
Binary file added board/aarch64/bananapi-bpi-r64/bpi-r64-sw1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added board/aarch64/bananapi-bpi-r64/debug-uart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions board/aarch64/bananapi-bpi-r64/dts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dtb-y += mediatek/mt7622-bananapi-bpi-r64.dtb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <arm64/mediatek/mt7622-bananapi-bpi-r64.dts>

#include "mt7622-bananapi-bpi-r64.dtsi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/ {
chosen {
infix {
/* Default admin user password: 'admin' */
factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A";
usb-ports = <&ssusb>;
usb-port-names = "USB";
};
};
};
89 changes: 89 additions & 0 deletions board/aarch64/bananapi-bpi-r64/genimage.cfg.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
image cfg.ext4 {
empty = true
temporary = true
size = 128M
ext4 {
label = "cfg"
use-mke2fs = true
features = "uninit_bg"
extraargs = "-m 0 -i 4096"
}
}

# The /var partition will be expanded automatically at first boot
# to use the full size of the SD-card or eMMC media.
image var.ext4 {
empty = true
temporary = true
size = 128M
ext4 {
label = "var"
use-mke2fs = true
features = "uninit_bg"
extraargs = "-m 0 -i 4096"
}
}

image #INFIX_ID##VERSION#-bpi-r64-#TARGET#.img {
hdimage {
partition-table-type = "hybrid"
# MT7622 TF-A partition driver detects GPT by checking MBR[0]
# for the 0xEE protective entry. Place it first so that BL2
# (with partition-type = 0x83) lands at MBR slot 1.
gpt-protective-first = true
}

# BL2 bootloader at sector 1024 (0x80000). The MT7622 Boot ROM scans
# the hybrid MBR for a bootable entry and loads BL2 from its offset.
# partition-type makes it visible in the MBR at slot 1 (slot 0 holds
# the 0xEE protective entry required by the TF-A partition driver).
partition bl2 {
partition-type = 0x83
image = "bl2.img"
offset = 1024s
size = 1024s
bootable = true
}

# Factory/calibration data at fixed offset
partition factory {
offset = 4608K
size = 2M
}

# FIP partition - BL31 + U-Boot
partition fip {
image = "fip.bin"
offset = 13312s
size = 4096s
}

partition aux {
partition-uuid = D4EF35A0-0652-45A1-B3DE-D63339C82035
image = "aux.ext4"
}

partition primary {
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
bootable = true
size = 250M
image = "rootfs.squashfs"
}

partition secondary {
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
bootable = true
size = 250M
image = "rootfs.squashfs"
}

partition cfg {
partition-uuid = 7aa497f0-73b5-47e5-b2ab-8752d8a48105
image = "cfg.ext4"
}

partition var {
partition-uuid = 8046A06A-E45A-4A14-A6AD-6684704A393F
image = "var.ext4"
}
}
Loading