Skip to content

Add support for Banana Pi BPi-R64#1430

Open
troglobit wants to merge 8 commits intomainfrom
bpi-r64
Open

Add support for Banana Pi BPi-R64#1430
troglobit wants to merge 8 commits intomainfrom
bpi-r64

Conversation

@troglobit
Copy link
Contributor

Description

  • Speed up boot time a bit (from initviz branch)
  • Add support for Banana Pi BPi-R64
  • Add support for Mediatek MT7615 firmware

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@troglobit troglobit marked this pull request as ready for review March 8, 2026 19:25
@troglobit troglobit requested a review from mattiaswal March 8, 2026 19:25
Calling tune2fs for ext4 partitions at boot costs more than one second
boot time on 32-bit Arm systems, with very little gain.  Dropping this
restores the default periodic fsck *and* saves boot time.

Instead of calling sgdisk four times, call it only when resizing and
instead use sysfs to find named paritions.  Saves seconds on boards
with weaker CPU and slow media.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Replace the costly read-only filter loop (awk+tr per line) with a
stderr redirect, use /sys/class/net/ instead of ip+jq, and batch
all sysctl writes into a single call.

Reduces boot time by ~4s on 32-bit Arm systems.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
In a hybrid MBR the conventional layout (used by gdisk and others) is:

  MBR[0] = 0xEE  (GPT protective, covers whole disk)
  MBR[1..3] = user-selected GPT partitions with legacy type codes

genimage currently appends the 0xEE entry after the data partitions,
producing the opposite order.  This is fine for most platforms, but
breaks firmware that detects GPT by inspecting only MBR entry 0: seeing
a non-0xEE type there it falls into pure-MBR mode and cannot look up
GPT partitions by name.

The TF-A partition driver (drivers/partition/partition.c) exhibits
exactly this behaviour: load_mbr_header() copies entry[0] and checks
type == 0xEE to select between MBR and GPT mode.  The MediaTek MT7622
platform (BananaPi BPI-R64) is a concrete example where this matters.

On the other hand, Raspberry Pi firmware scans all MBR slots for a
bootable FAT32 partition.  If slot 0 holds a 0xEE protective entry the
firmware switches to GPT detection, looks for an EFI System Partition
UUID, and reports "no bootable partitions" when none is found.

Add an opt-in hdimage option `gpt-protective-first = true` that places
the 0xEE entry at slot 0 and shifts data partitions to slots 1..3.
The default (false) preserves the existing genimage behaviour so that
platforms like Raspberry Pi continue to work without any changes.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add board support for the BananaPi BPi-R64 router board, based on the
MediaTek MT7622 SoC and MT7531 Gigabit Ethernet switch.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Used in BPI-MT7615 802.11ac PCIe WiFi card for the BPi-R64 router board.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The RPi 400 has is the exact same hardware as the RPi 4B, so it needs
the same interface quirks, and we can also give it the same factory
config settings.

Also, minor cleanup of genimage.cfg; primarty and secondary do not need
the bootable flag.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@@ -0,0 +1,12 @@
# Rename MT7531 DSA switch ports by DT node path.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overload the devicetree instead (in board/aarch64/bananapi-bpi-r64/dts/mediatek/mt7622-bananapi-bpi-r64.dtsi), as done for other boards. This seems fragile.

Copy link
Contributor Author

@troglobit troglobit Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it's not fragile anymore, now since we've split the probe and udev. Iirc this is what @wkz recommended earlier on to use instead of naming port interfaces in the DTS.

Also, this is pretty consistent with how we do it for other boards, e.g., NanoPi R2S, BPi-R3 Mini ...

# CONFIG_MMC_PCI is not set
CONFIG_ENV_IS_NOWHERE=y
# CONFIG_ENV_IS_IN_MMC is not set

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does ramload work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, not yet.

## Platform Notes

### BL2 Offset and GPT Requirement (sector 1024)

Copy link
Contributor

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

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants