-
Notifications
You must be signed in to change notification settings - Fork 16
Add support for Banana Pi BPi-R64 #1430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
troglobit
wants to merge
8
commits into
main
Choose a base branch
from
bpi-r64
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d402405
board/common: mnt: drop tune2fs and speed up mounting
troglobit 42ced9c
board/common: optimize sysctl-sync-ip-conf, drop filtering loop
troglobit 5796d57
patches/genimage: add gpt-protective-first option for hybrid MBR
troglobit 5c48311
board: add support for Banana Pi BPI-R64
troglobit 960e8c6
wifi: add Mediatek MT7615 firmware
troglobit 34dbcfa
.github: add bpi-r64 to image builder
troglobit 9332fd6
doc: update changelog with BPi-R64 support
troglobit 1005c08
board/aarch64: add eth0 quirk for Raspberry Pi 400
troglobit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,188 @@ | ||
| # 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 | ||
|
|
||
| ### eMMC Boot ROM Behaviour | ||
|
|
||
| > [!IMPORTANT] | ||
| > The MT7622 Boot ROM reads BL2 from two possible locations depending on the | ||
| > eMMC configuration: | ||
| > | ||
| > - **eMMC BOOT0 hardware partition enabled** (factory default on most chips): | ||
| > Boot ROM reads BL2 from offset 0 of the BOOT0 partition. Our disk image | ||
| > (which puts BL2 in the User Data Area at sector 1024 / offset 0x80000) will | ||
| > **not** be found here — you must either write BL2 to BOOT0 separately or | ||
| > disable BOOT0. | ||
| > | ||
| > - **eMMC BOOT0 disabled:** Boot ROM falls through to the User Data Area (UDA) | ||
| > and reads BL2 from sector 1024 (offset 0x80000). The eMMC BL2 is built | ||
| > for BOOT0 (`hdroffset=0x0`) and will **not** match this location — BOOT0 | ||
| > must be enabled for eMMC boot to work. | ||
| > | ||
| > The recommended installation procedure below writes BL2 to BOOT0 and enables | ||
| > BOOT0 as the boot source. | ||
|
|
||
| ### Procedure | ||
|
|
||
| The easiest path is to boot from SD first and then write the eMMC image from | ||
| U-Boot. | ||
|
|
||
| #### 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 | ||
|
|
||
| This handles the BOOT0 case and ensures the Boot ROM can find BL2 regardless | ||
| of the chip's default BOOT0 state: | ||
|
|
||
| ``` | ||
| 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 | ||
| ``` | ||
|
|
||
| The `mmc partconf 0 1 1 1` command enables BOOT0 and routes boot reads there; | ||
| `mmc partconf 0 1 1 0` switches back to UDA access so U-Boot sees the full | ||
| partition table normally. | ||
|
|
||
| #### Step 4: Boot from eMMC | ||
|
|
||
| 1. Power off the board | ||
| 2. Set SW1 to OFF (eMMC boot) | ||
| 3. Remove SD card | ||
| 4. Remove USB drive | ||
| 5. Power on | ||
|
|
||
| ## Platform Notes | ||
|
|
||
| ### BL2 Offset and GPT Requirement (sector 1024) | ||
|
|
||
| The MT7622 Boot ROM locates BL2 via the **GPT partition table**: it reads the | ||
| GPT, finds the partition named `bl2`, and loads from its start sector. The | ||
| `bl2` partition must start at **sector 1024 = offset 0x80000** (same as the | ||
| MT7986/BPI-R3). | ||
|
|
||
| > [!IMPORTANT] | ||
| > The MT7622 Boot ROM reads the **legacy MBR partition table** to locate BL2, | ||
| > not the GPT. The disk image must use a **hybrid MBR/GPT** layout so that the | ||
| > `bl2` partition is visible in both tables. A pure GPT image causes `F5: 4801 | ||
| > 0000` → `F5: 480A 0031` → halt. `genimage` is configured with | ||
| > `partition-table-type = "hybrid"` to produce the required layout. | ||
|
|
||
| The ATF SD build uses `DEVICE_HEADER_OFFSET=0x80000` so that `mkimage` encodes | ||
| the correct media position (sector 1024 of UDA) in the BRLYT `gfh_offset` | ||
| field. The eMMC build uses `DEVICE_HEADER_OFFSET=0x0` because BL2 lives at | ||
| offset 0 of the BOOT0 partition. Getting this wrong causes a `F5: 4801 0000` | ||
| failure (found but rejected) rather than `F5: 480A 0031` (not found). | ||
|
|
||
| ### FIP Location | ||
|
|
||
| BL2 locates the FIP (containing BL31 + U-Boot) by name via the GPT partition | ||
| table — it looks for a partition labelled `fip`. No hardcoded FIP offset is | ||
| used, so FIP can be placed freely after BL2 in the partition table. | ||
|
|
||
| ### mmc0 = eMMC, mmc1 = SD | ||
|
|
||
| On MT7622, MSDC0 (mmc0 in U-Boot and Linux) is the 8-bit eMMC controller and | ||
| MSDC1 (mmc1) is the 4-bit SD card controller. This is the reverse of many | ||
| other platforms. The SD U-Boot environment therefore sets `boot_targets = | ||
| "mmc1"` while the eMMC environment uses the default `mmc0`. | ||
|
|
||
| ## 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ðsys. | ||
| # 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)) |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| dtb-y += mediatek/mt7622-bananapi-bpi-r64.dtb |
3 changes: 3 additions & 0 deletions
3
board/aarch64/bananapi-bpi-r64/dts/mediatek/mt7622-bananapi-bpi-r64.dts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
10 changes: 10 additions & 0 deletions
10
board/aarch64/bananapi-bpi-r64/dts/mediatek/mt7622-bananapi-bpi-r64.dtsi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"; | ||
| }; | ||
| }; | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isnt this section just a wall of text what does it give to a infiux user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll clean it up.