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
1 change: 1 addition & 0 deletions board/aarch64/bananapi-bpi-r3/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config BR2_PACKAGE_BANANAPI_BPI_R3
select BR2_PACKAGE_LINUX_FIRMWARE
select BR2_PACKAGE_LINUX_FIRMWARE_MEDIATEK
select BR2_PACKAGE_LINUX_FIRMWARE_MEDIATEK_MT7986
select BR2_PACKAGE_LINUX_FIRMWARE_AIROHA_EN8811H
select SDCARD_AUX
help
Build Banana PI R3 support
122 changes: 78 additions & 44 deletions board/aarch64/bananapi-bpi-r3/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
# Banana Pi BPI-R3
# Banana Pi BPI-R3 / BPI-R3 Mini

<img src="bananapi-bpi-r3.webp" alt="The board" width=800 padding=10>

## Overview

The Banana Pi R3 is a high-performance networking board with full Infix
support for all enabled features including switched Ethernet ports, WiFi,
and SFP interfaces.
The Banana Pi BPI-R3 and BPI-R3 Mini are high-performance networking
boards with full Infix support for all enabled features including
Ethernet, WiFi, and SFP interfaces.

Both boards share the same SoC and most peripherals. The key
differences are:

| Feature | BPI-R3 | BPI-R3 Mini |
|-----------------|--------------------|-------------------------|
| Ethernet switch | Yes (4x LAN + WAN) | No (WAN/LAN ports only) |
| SD card slot | Yes | No |

### Hardware Features

- MediaTek MT7986 ARM Cortex-A53 quad-core processor @ 2.0 GHz
- 2 GB DDR4 RAM
- 8 GB eMMC storage + microSD card slot
- 5x Gigabit Ethernet ports (4x LAN, 1x WAN)
- 2x SFP cages for fiber connectivity (1G/2.5G)
- 8 GB eMMC storage
- microSD card slot (BPI-R3 only)
- 5x Gigabit Ethernet ports with switch core (BPI-R3 only)
- 2x SFP cages for fiber connectivity (1G/2.5G) (BPI-R3 only)
- Dual-band WiFi (2.4 GHz + 5 GHz)
- USB 3.0 port
- Mini PCIe slot
Expand All @@ -23,16 +32,16 @@ and SFP interfaces.

Infix comes preconfigured with:

- **LAN ports** (lan1-lan4): Bridged for internal networking
- **LAN ports** (lan1-lan4): Bridged for internal networking (BPI-R3 only)
- **WAN port**: DHCP client enabled for internet connectivity
- **SFP ports** (sfp1, sfp2): Available for configuration
- **SFP ports** (sfp1, sfp2): Available for configuration (BPI-R3 only)
- **WiFi interfaces** (wifi0, wifi1): Available for configuration

## Getting Started

### Quick Start with SD Card
### BPI-R3: Quick Start with SD Card

The easiest way to get started is using an SD card:
The easiest way to get started with the BPI-R3 is using an SD card:

> [!NOTE]
> SD card boot works but we have observed stability issues. For production
Expand All @@ -49,6 +58,12 @@ The easiest way to get started is using an SD card:
- Connect to LAN port or console (115200 8N1)
- Default login: `admin` / `admin`

### BPI-R3 Mini: Getting Started

The BPI-R3 Mini does not have an SD card slot, so you must install
directly to eMMC. See [Installing to eMMC — BPI-R3
Mini](#bpi-r3-mini) below.

### Boot Switch Reference

The BPI-R3 has a 4-position DIP switch that controls boot media:
Expand All @@ -62,60 +77,44 @@ The BPI-R3 has a 4-position DIP switch that controls boot media:
| 1010 | SPI NAND | Boot from SPI NAND (advanced users) |

> [!NOTE]
> Switch position is read from left to right: "0" = OFF, "1" = ON.
> Switch position is read from left to right: "0" = OFF, "1" = ON.
> When the DIP switch is in the "UP" position it is OFF(0).

## Advanced: Installing to eMMC
## Installing to eMMC

For production deployments or better performance, you can install Infix
to the internal eMMC storage. This is more complex but provides faster
boot times and eliminates the external SD card.
to the internal eMMC storage.

> [!IMPORTANT]
> While Infix boots on both SD card and eMMC, we have observed stability
> issues with SD cards on this platform. **eMMC is recommended** for
> reliable operation.

### Why Use eMMC?

**Advantages:**

- More reliable than SD card (stability issues observed with SD cards)
- Faster boot and better performance
- No external SD card to manage
- More robust for industrial/embedded deployments

**Disadvantages:**

- More complex installation process
- Requires intermediate NAND boot step
- Harder to recover from errors
> While Infix boots on both SD card and eMMC on the BPI-R3, we have
> observed stability issues with SD cards on this platform. **eMMC is
> recommended** for reliable operation.

### Prerequisites

- FTDI USB-to-serial cable (3.3V) for console access
- microSD card with Infix (for initial boot)
- USB flash drive (FAT32 formatted)
- microSD card with Infix, for initial boot (BPI-R3 only)
- Downloaded files (see below)

### Required Files

Download and place these files on a FAT32-formatted USB drive:

1. **Intermediate NAND bootloader** (from Frank-W's U-Boot):
- [bpi-r3_spim-nand_bl2.img][5] (BL2 loader)
- [bpi-r3_spim-nand_fip.bin][6] (FIP image)
2. **Infix eMMC image:**
1. **Infix eMMC image:**
- [infix-bpi-r3-emmc.img][3] (Complete system image)
3. **eMMC bootloader** (extracted from):
2. **eMMC bootloader** (extracted from):
- [bpi-r3-emmc-boot-2025.01-latest.tar.gz][4]
- Extract `bl2.img` from the tarball to your USB drive
3. **Intermediate NAND bootloader** (BPI-R3 only, from Frank-W's U-Boot):
- [bpi-r3_spim-nand_bl2.img][5] (BL2 loader)
- [bpi-r3_spim-nand_fip.bin][6] (FIP image)

> [!WARNING]
> The following process involves multiple boot mode changes. Take your
> time verify each step carefully.
> time and verify each step carefully.

### Installation Steps
### BPI-R3

#### Step 1: Boot from SD card

Expand Down Expand Up @@ -177,13 +176,48 @@ mmc partconf 0 1 1 0

Your BPI-R3 should now boot Infix from internal eMMC storage!

### BPI-R3 Mini

The BPI-R3 Mini does not have an SD card slot, so you have to go
through the factory-installed Linux (OpenWRT) to flash the Infix
bootloader and OS to eMMC.

#### Step 1: Boot from NAND (factory default)

<img src="r3mini_nandboot2.png" alt="BPI-R3 Mini NAND boot switch position" width=400>

1. Ensure boot switches are set to NAND mode (factory default)
2. Place `infix-bpi-r3-emmc.img` and `bl2.img` on a USB drive
3. Power on and boot into Linux
4. Mount the USB drive to `/mnt`

#### Step 2: Flash Infix to eMMC

From the Linux shell:

```
echo 0 > /proc/sys/kernel/printk
dd if=/mnt/infix-bpi-r3-emmc.img of=/dev/mmcblk0
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/mnt/bl2.img of=/dev/mmcblk0boot0
sync
```

#### Step 3: Boot from eMMC

<img src="r3mini_emmcboot.png" alt="BPI-R3 Mini eMMC boot switch position" width=400>

1. Power off the board
2. Set boot switches to eMMC mode (see image above)
3. Power on

## Troubleshooting

### Board won't boot

- Verify boot switch positions (check twice!)
- Ensure power supply provides adequate current (12V/2A recommended)
- Try booting from SD card with switches at **0000**
- Try booting from SD card with switches at **0000** (BPI-R3 only)

### Can't break into U-Boot

Expand All @@ -195,9 +229,9 @@ Your BPI-R3 should now boot Infix from internal eMMC storage!

- Boot from NAND (**1010**) and verify eMMC image was written
- Check USB drive contents - ensure all files are present
- Re-run Step 5 (eMMC boot configuration)
- Re-run the eMMC boot configuration step

### Reverting to SD card
### Reverting to SD card (BPI-R3 only)

Simply set boot switches back to **0000** and boot from SD card. The
eMMC installation does not affect SD card functionality.
Expand Down
1 change: 1 addition & 0 deletions board/aarch64/bananapi-bpi-r3/bananapi-bpi-r3.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ define BANANAPI_BPI_R3_LINUX_CONFIG_FIXUPS
$(call KCONFIG_ENABLE_OPT,CONFIG_MEDIATEK_WATCHDOG)
$(call KCONFIG_ENABLE_OPT,CONFIG_MEDIATEK_GE_PHY)
$(call KCONFIG_ENABLE_OPT,CONFIG_REALTEK_PHY)
$(call KCONFIG_SET_OPT,CONFIG_AIR_EN8811H_PHY,m)
$(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)
Expand Down
2 changes: 1 addition & 1 deletion board/aarch64/bananapi-bpi-r3/dts/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dtb-y += mediatek/mt7986a-bananapi-bpi-r3-sd.dtb mediatek/mt7986a-bananapi-bpi-r3-emmc.dtb
dtb-y += mediatek/mt7986a-bananapi-bpi-r3-sd.dtb mediatek/mt7986a-bananapi-bpi-r3-emmc.dtb mediatek/mt7986a-bananapi-bpi-r3-mini.dtb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#include <arm64/mediatek/mt7986a-bananapi-bpi-r3.dts>

#include "mt7986a-bananapi-bpi-r3.dtsi"
#include "mt7986a-bananapi-bpi-r3-emmc.dtsi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <arm64/mediatek/mt7986a-bananapi-bpi-r3-mini.dts>

#include "mt7986a-bananapi-bpi-r3.dtsi"
#include "mt7986a-bananapi-bpi-r3-emmc.dtsi"

&phy0 {
compatible = "ethernet-phy-id03a2.a411";
};
&phy1 {
compatible = "ethernet-phy-id03a2.a411";
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "mt7986a-bananapi-bpi-r3.dtsi"
#include "mt7986a-bananapi-bpi-r3-emmc.dtsi"
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#include <arm64/mediatek/mt7986a-bananapi-bpi-r3.dts>

#include "mt7986a-bananapi-bpi-r3.dtsi"
#include "mt7986a-bananapi-bpi-r3-sd.dtsi"
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <arm64/mediatek/mt7986a-bananapi-bpi-r3.dts>

/ {
chosen {
infix {
Expand Down
5 changes: 5 additions & 0 deletions board/aarch64/bananapi-bpi-r3/genimage.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ image #INFIX_ID##VERSION#-bpi-r3-#TARGET#.img {
size = 4096s
}

partition en8811h_fw {
size = 10M
image = "en8811h-fw.bin"
}

partition aux {
partition-uuid = D4EF35A0-0652-45A1-B3DE-D63339C82035
image = "aux.ext4"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading