Skip to content

Commit 5b7b0bc

Browse files
authored
Merge pull request kernelkit#1430 from kernelkit/bpi-r64
Add support for Banana Pi BPi-R64 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2 parents d04f493 + 4deaee0 commit 5b7b0bc

50 files changed

Lines changed: 2244 additions & 147 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-boot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
- aarch64_qemu_boot
2020
- bpi_r3_sd_boot
2121
- bpi_r3_emmc_boot
22+
- bpi_r64_sd_boot
23+
- bpi_r64_emmc_boot
2224
- cn9130_crb_boot
2325
- fireant_boot
2426
- nanopi_r2s_boot

.github/workflows/build-image.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- raspberrypi-rpi2
1212
- raspberrypi-rpi64
1313
- bananapi-bpi-r3
14+
- bananapi-bpi-r64
1415
- friendlyarm-nanopi-r2s
1516
- microchip-sama7g54-ek
1617
default: 'raspberrypi-rpi64'
@@ -67,6 +68,12 @@ jobs:
6768
echo "ARCH=aarch64" >> $GITHUB_ENV
6869
echo "BUILD_EMMC=true" >> $GITHUB_ENV
6970
;;
71+
bananapi-bpi-r64)
72+
echo "BOOTLOADER_SD=bpi-r64-sd-boot" >> $GITHUB_ENV
73+
echo "BOOTLOADER_EMMC=bpi-r64-emmc-boot" >> $GITHUB_ENV
74+
echo "ARCH=aarch64" >> $GITHUB_ENV
75+
echo "BUILD_EMMC=true" >> $GITHUB_ENV
76+
;;
7077
friendlyarm-nanopi-r2s)
7178
echo "BOOTLOADER=nanopi-r2s-boot" >> $GITHUB_ENV
7279
echo "ARCH=aarch64" >> $GITHUB_ENV

board/aarch64/Config.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ if BR2_aarch64
22

33
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/alder-alder/Config.in"
44
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/bananapi-bpi-r3/Config.in"
5+
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/bananapi-bpi-r64/Config.in"
56
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/freescale-imx8mp-evk/Config.in"
67
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/friendlyarm-nanopi-r2s/Config.in"
78
source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/marvell-cn9130-crb/Config.in"

board/aarch64/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ aarch64
44
Board Specific Documentation
55
----------------------------
66

7-
- [Banana Pi R3](banana-pi-r3/)
7+
- [Banana Pi BPi-R3](banana-pi-r3/)
8+
- [Banana Pi BPi-R64](banana-pi-r64/)
89
- [Marvell CN9130-CRB](cn9130-crb/)
910
- [Microchip SparX-5i PCB135 (eMMC)](sparx5-pcb135/)
1011
- [NanoPi R2S](r2s/)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
config BR2_PACKAGE_BANANAPI_BPI_R64
2+
bool "Banana Pi R64"
3+
depends on BR2_aarch64
4+
select BR2_PACKAGE_FEATURE_WIFI
5+
select SDCARD_AUX
6+
help
7+
Build Banana PI R64 support
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2026 The KernelKit Authors
2+
3+
Permission to use, copy, modify, and/or distribute this software for any
4+
purpose with or without fee is hereby granted, provided that the above
5+
copyright notice and this permission notice appear in all copies.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Banana Pi BPI-R64
2+
3+
## Overview
4+
5+
<img align="right" src="banana_pi_bpi-r64_interface.jpg" alt="Board Overview" width=400 padding=10>
6+
7+
The Banana Pi BPI-R64 is a networking board based on the MediaTek MT7622
8+
(dual Cortex-A53, AArch64) SoC.
9+
10+
### Hardware Features
11+
12+
- MediaTek MT7622 ARM Cortex-A53 dual-core processor @ 1.35 GHz
13+
- 1 GB DDR3L RAM
14+
- 8 GB eMMC storage
15+
- microSD card slot
16+
- MT7531 Gigabit Ethernet switch (4x LAN + 1x WAN)
17+
- MT7603E built-in 2.4 GHz WiFi
18+
- USB 3.0 port
19+
- 2x Mini PCIe slots
20+
21+
### Default Network Configuration
22+
23+
Infix comes preconfigured with:
24+
25+
- **LAN ports** (lan0-lan3): Bridged for internal networking
26+
- **WAN port**: DHCP client enabled for internet connectivity
27+
- **WiFi** (wifi0-ap): Bridged to LAN (MT7615 PCIe card if fitted, otherwise MT7603E)
28+
29+
## Boot Switch Reference
30+
31+
<img align="right" src="bpi-r64-sw1.png" alt="SW1 Boot Switch" width=90 padding=10>
32+
33+
The BPI-R64 uses a 2-position DIP switch (SW1) to select the boot device
34+
order. The MT7622 Boot ROM tries devices in the order listed and falls
35+
back to the next if no valid BL2 is found at the expected location.
36+
37+
| SW1 | Boot device | Use case |
38+
|-----|-------------|----------------------------|
39+
| OFF | eMMC | Production eMMC boot |
40+
| ON | SD card | SD card boot / development |
41+
42+
> [!NOTE]
43+
> SinoVoip has exposed only one bit of the MT7622's two-bit `BOOT_SEL[1:0]`
44+
> strapping field via SW1, with `BOOT_SEL[1]` hardwired high. This limits the
45+
> board to eMMC (`10b`) and SD (`11b`) boot; the SPI-NOR and SPI-NAND modes
46+
> available on the MT7622 reference board (`00b`, `01b`) are not selectable.
47+
48+
## Getting Started
49+
50+
### Quick Start with SD Card
51+
52+
1. **Flash the image to an SD card** (the filename includes the version, e.g.
53+
`infix-25.01-bpi-r64-sdcard.img`):
54+
55+
<img align="right" src="debug-uart.png" alt="Debug UART" width=100 padding=10>
56+
57+
```sh
58+
dd if=infix-*-bpi-r64-sdcard.img of=/dev/sdX bs=4M status=progress
59+
```
60+
61+
2. **Set boot switch:** SW1 ON (SD card boot)
62+
3. **Insert SD card and power on**
63+
4. **Connect console:** 115200 8N1 — use the dedicated Debug UART header
64+
just below the 40-pin GPIO header; pins are labeled GND, RX, TX on the board
65+
5. **Default login:** `admin` / `admin`
66+
67+
## Installing to eMMC
68+
69+
Unlike the BPI-R3 (where SD and eMMC share a bus, requiring a NAND intermediate
70+
step), the BPI-R64 has separate controllers for SD (mmc1/MSDC1) and eMMC
71+
(mmc0/MSDC0). You can write directly to eMMC while booted from SD.
72+
73+
### eMMC Boot ROM Behaviour
74+
75+
> [!IMPORTANT]
76+
> The MT7622 Boot ROM reads BL2 from the eMMC BOOT0 hardware partition (offset
77+
> 0), not from the User Data Area where the main disk image lives. The
78+
> installation procedure below writes BL2 to BOOT0 separately to handle this.
79+
80+
### Procedure
81+
82+
Boot from SD and write the eMMC image from U-Boot using a FAT32-formatted USB
83+
drive.
84+
85+
#### Step 1: Boot from SD card
86+
87+
1. Set SW1 to ON (SD boot)
88+
2. Insert SD card with Infix
89+
3. Power on and break into U-Boot (press Ctrl-C during boot)
90+
91+
#### Step 2: Write the eMMC image from U-Boot
92+
93+
Place `infix-bpi-r64-emmc.img` and `bl2.img` on a FAT32-formatted USB drive,
94+
then from the U-Boot prompt:
95+
96+
```
97+
usb start
98+
fatload usb 0:1 0x44000000 infix-bpi-r64-emmc.img
99+
setexpr blocks ${filesize} / 0x200
100+
mmc dev 0
101+
mmc write 0x44000000 0x0 ${blocks}
102+
```
103+
104+
#### Step 3: Write BL2 to eMMC BOOT0
105+
106+
```
107+
fatload usb 0:1 0x44000000 bl2.img
108+
mmc partconf 0 1 1 1
109+
setexpr blkcnt ${filesize} + 0x1ff
110+
setexpr blkcnt ${blkcnt} / 0x200
111+
mmc write 0x44000000 0x0 ${blkcnt}
112+
mmc partconf 0 1 1 0
113+
```
114+
115+
#### Step 4: Boot from eMMC
116+
117+
1. Power off the board
118+
2. Set SW1 to OFF (eMMC boot)
119+
3. Remove SD card and USB drive
120+
4. Power on
121+
122+
## Platform Notes
123+
124+
### mmc0 = eMMC, mmc1 = SD
125+
126+
On MT7622, MSDC0 (mmc0) is the 8-bit eMMC controller and MSDC1 (mmc1) is the
127+
4-bit SD card controller — the reverse of many other platforms.
128+
129+
## Building
130+
131+
```sh
132+
# Bootloader only (SD)
133+
make O=x-boot-bpir64-sd bpi_r64_sd_boot_defconfig && make O=x-boot-bpir64-sd
134+
135+
# Bootloader only (eMMC)
136+
make O=x-boot-bpir64-emmc bpi_r64_emmc_boot_defconfig && make O=x-boot-bpir64-emmc
137+
138+
# Compose SD image (pass the Infix rootfs output directory)
139+
utils/mkimage.sh -b x-boot-bpir64-sd -r x-aarch64/images bananapi-bpi-r64
140+
141+
# Compose eMMC image
142+
utils/mkimage.sh -b x-boot-bpir64-emmc -r x-aarch64/images -t emmc bananapi-bpi-r64
143+
```
228 KB
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
define BANANAPI_BPI_R64_LINUX_CONFIG_FIXUPS
2+
$(call KCONFIG_ENABLE_OPT,CONFIG_ARCH_MEDIATEK)
3+
$(call KCONFIG_ENABLE_OPT,CONFIG_MACH_MT7622)
4+
$(call KCONFIG_ENABLE_OPT,CONFIG_PINCTRL_MT7622)
5+
$(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_8250_MT6577)
6+
$(call KCONFIG_ENABLE_OPT,CONFIG_MTK_UART)
7+
$(call KCONFIG_ENABLE_OPT,CONFIG_MEDIATEK_WATCHDOG)
8+
# Ethernet subsystem clock controller — required for the eth MAC,
9+
# MT7531 DSA switch, and HSDMA to get their clocks from &ethsys.
10+
# Without this, eth probe fails and the switch is never detected.
11+
$(call KCONFIG_ENABLE_OPT,CONFIG_COMMON_CLK_MT7622_ETHSYS)
12+
# HIF subsystem clock controller — required for PCIe and USB.
13+
$(call KCONFIG_ENABLE_OPT,CONFIG_COMMON_CLK_MT7622_HIFSYS)
14+
$(call KCONFIG_ENABLE_OPT,CONFIG_MEDIATEK_GE_PHY)
15+
$(call KCONFIG_ENABLE_OPT,CONFIG_REALTEK_PHY)
16+
$(call KCONFIG_ENABLE_OPT,CONFIG_NET_VENDOR_MEDIATEK)
17+
$(call KCONFIG_ENABLE_OPT,CONFIG_NET_MEDIATEK_SOC)
18+
$(call KCONFIG_SET_OPT,CONFIG_NET_DSA_MT7530,m)
19+
$(call KCONFIG_SET_OPT,CONFIG_MT7603E,m)
20+
$(call KCONFIG_SET_OPT,CONFIG_PCIE_MEDIATEK,m)
21+
$(call KCONFIG_ENABLE_OPT,CONFIG_MMC_MTK)
22+
$(call KCONFIG_SET_OPT,CONFIG_USB_XHCI_MTK,m)
23+
$(call KCONFIG_SET_OPT,CONFIG_PHY_MTK_TPHY,m)
24+
$(call KCONFIG_SET_OPT,CONFIG_MTK_THERMAL,m)
25+
$(call KCONFIG_SET_OPT,CONFIG_MTK_SOC_THERMAL,m)
26+
$(call KCONFIG_SET_OPT,CONFIG_I2C_MT65XX,m)
27+
$(call KCONFIG_SET_OPT,CONFIG_PWM_MEDIATEK,m)
28+
$(call KCONFIG_SET_OPT,CONFIG_REGULATOR_MT6380,m)
29+
$(call KCONFIG_SET_OPT,CONFIG_NVMEM_MTK_EFUSE,m)
30+
$(call KCONFIG_SET_OPT,CONFIG_CRYPTO_DEV_SAFEXCEL,m)
31+
$(call KCONFIG_ENABLE_OPT,CONFIG_RTC_DRV_MT7622)
32+
endef
33+
34+
$(eval $(ix-board))
35+
$(eval $(generic-package))
120 KB
Loading

0 commit comments

Comments
 (0)