Skip to content

Bpi r3 nvmem mac - #1702

Merged
troglobit merged 9 commits into
mainfrom
bpi-r3-nvmem-mac
Oct 13, 2026
Merged

troglobit merged 9 commits into
mainfrom
bpi-r3-nvmem-mac

Conversation

@mattiaswal

@mattiaswal mattiaswal commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Add proper VPD for devices without I2C eeprom, BPI-r3, tactical, other (seems rather common)

A file for this is kept in /mnt/aux/vpd.bin which is supposed to be read by the bootloader.

Description

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):

The ports in the bridge had an ipv6 container but the bridge, which
carries the LAN address, had none, so the router had no link-local
address on the LAN side.  Add it on every static factory config with
a LAN bridge.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
A bound nvmem layout has added all the cells it will ever have, so a
missing one is -ENOENT, not -EPROBE_DEFER.  Lets a board with an empty
VPD come up with random port addresses instead of no Ethernet at all.
Copy /vpd.bin to vpd_addr_r on boards that define it, where the kernel
picks it up as nvmem.  The region is zeroed first so a removed file does
not survive a warm reboot.
Describe the VPD U-Boot loads into RAM as an nvmem-rmem node with an ONIE
layout and let each port reference its base MAC offset from it.  The
kernel then sets a permanent address, so confd can restore it when a
custom MAC is removed, which the userspace macaddr script never allowed.
The BPI-R3 VPD now reaches the system through the device tree like any
other, so revert 9d67172 and document the aux file instead.
Same scheme as the BPI-R3 it derives from: the VPD U-Boot loads from
the aux partition is an nvmem-rmem node, and each port takes its base
MAC offset from it.
@mattiaswal
mattiaswal requested a review from troglobit October 13, 2026 12:06
Keep the hardware offload path off until it is offered as an opt-in
feature. Seen some stability issues with it, but most likely it works
in some use cases.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
@mattiaswal
mattiaswal marked this pull request as ready for review October 13, 2026 12:19
Unlocked page selects from the regmap-irq thread interleave with the
driver's locked register sequences and clobber SYS_INT_EN, after which
no PHY link change on an MT7531 is ever reported again.  Seen on the
BPI-R3 rig as ports stuck at no-link after a bounce.

@troglobit troglobit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very cool, love the AFK discussion today that led up to this!

@troglobit
troglobit merged commit 4d7e2b1 into main Oct 13, 2026
8 checks passed
@troglobit
troglobit deleted the bpi-r3-nvmem-mac branch October 13, 2026 15:37
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