Skip to content

Add Banana Pi BPI-M1 support and LED locate RPC - #1686

Merged
troglobit merged 10 commits into
mainfrom
bpi-m1
Oct 8, 2026
Merged

troglobit merged 10 commits into
mainfrom
bpi-m1

Conversation

@troglobit

@troglobit troglobit commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds support for the Banana Pi BPI-M1 (Allwinner A20) to the 32-bit Arm build, with its own bpi_m1_boot_defconfig. Bringing it up showed a number of 32-bit Arm problems, which are fixed here.

Board:

  • BSP with kernel fixups, a GPT layout that keeps clear of the SPL at 8 KiB, a factory-config with DHCPv4 and DHCPv6 on eth0, temperature sensors, HDMI, the power button and the usr LED
  • MMC_SDHCI dropped from the common U-Boot fragment, since every board with an SDHCI controller already sets it
  • GPIOLIB added to the arm kernel config; without it, GPIO LEDs were missing on all 32-bit boards

32-bit Arm fixes:

  • FRR mgmtd crash on unaligned messages (patch)
  • mdns-alias never published, because libuev forces 64-bit time_t and the rest of the system was 32-bit. All 32-bit Arm builds now use 64-bit time_t
  • iitod crashed and never blinked (iito patches)
  • statd dropped all hardware status when a sensor label contained a space
  • The 32-bit Arm builds no longer include FRR, same as the minimal builds

Locate:

  • New infix-hardware:locate RPC that blinks the board's locate LEDs to identify the chassis, by default for 60 s
  • Available as locate / no locate in the CLI and as a button on the Hardware page in the web interface
  • Fails with a clear error on systems where iitod is disabled
  • Depends on iitod: 32-bit fixes, control socket and iitoctl iito#4, included here as patches until iito has a release

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

mgmtd hands its message handlers pointers into the receive stream, where
messages are packed back to back, so some start unaligned.  On 32-bit
Arm GCC uses VFP stores for their 64-bit members, which the kernel
cannot fix up, and mgmtd dies with SIGBUS as soon as a notification
is sent.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Every board with an SDHCI controller already enables MMC_SDHCI in its
own U-Boot defconfig, so the common fragment only forced the driver on
boards with other MMC controllers.  On sunxi this breaks the SPL build,
which has no DM_MMC and cannot compile sdhci.c.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The first Banana Pi, an Allwinner A20 board.  Mainline U-Boot builds the
SPL and U-Boot together from its Bananapi defconfig, and the A20 boot ROM
loads them from 8 KiB into the SD card, so the GPT partition entries are
moved to 1 MiB.

The sunxi board code resets fdtfile after the environment is imported,
dropping the vendor directory on 32-bit Arm, so ixvariant sets it again
at preboot.  POWER_SUPPLY is enabled explicitly, the sun4i USB PHY
depends on it and the shared kernel config does not set it.

GPIOLIB is added to the shared arm kernel config.  Without it LEDS_GPIO
and LEDS_TRIGGER_GPIO are dropped before any board fixup has selected a
GPIO driver, so GPIO LEDs were missing on all 32-bit Arm boards.

The board is enabled in the arm defconfigs like the other 32-bit boards,
disable BR2_PACKAGE_BANANAPI_BPI_M1 to leave it out of a build.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
hwmon labels are free text, but normalize_sensor_name() only rewrote
underscores, so a label like "SoC temperature" from the Allwinner A20
SoC sensor ended up in the name.  The space breaks the pattern for
sensor names, statd fails to parse the yanger data, and no hardware
status is shown at all.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
libuev exports -D_TIME_BITS=64 to its users, its ABI has time_t in it,
so mdns-alias and finit were built with a 64-bit time_t while everything
else on 32-bit Arm used 32 bits.  mdns-alias passes a struct timeval
between libuev and Avahi, read the wrong size, and turned D-Bus timeouts
into garbage.  Avahi then reported every connection attempt as "Memory
exhausted" and mdns-alias never got to publish anything.

One time ABI for the whole system also makes 32-bit Arm Y2038 ready.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The 32-bit Arm boards are small, and FRR with bash is a big part of the
image.  Static routing covers what they are used for.  As with the
minimal builds, BUSYBOX_SHOW_OTHERS is set explicitly, since it was
selected only through bash.  neofetch goes too, it selects bash.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
iitod unpacked a boolean into a bool where jansson writes an int,
corrupting the stack on 32-bit Arm as soon as an LED was set on or off,
and printed 64-bit integers with %d, so blink rates came out wrong.

The update also brings a control socket, root:wheel so admin users need
no sudo, and the iitoctl tool, showing which rule drives each LED and
why.  Its locate method sets the config's locate input, optionally for
a number of seconds, which is what a locate RPC needs.

The git tree has no configure script, so the package is autoreconfigured.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
RPCs that act on the device should log who asked for them, but the
helper that finds the requesting user was private to support.c.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Blinks the board's locate LEDs, by default for 60 seconds, so the unit
can be found, e.g., in a rack.  Available over NETCONF/RESTCONF, as the
CLI command locate, and from the Hardware page in the web interface.
The default NACM rules deny guests, all other users may call it.

confd forwards the request to iitod, which sets the locate input of its
config and keeps the timer.  Which LEDs blink, and how, is up to each
board's iitod.json, the BPi-M1 blinks its only LED at 10 Hz to tell it
apart from loading.  Systems where iitod is disabled, because of
unreliable kernel LED support, have no control socket and the RPC fails
with an error saying so.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The workflows run 'make foo_defconfig apply-mirror' with -j5, so make
started both goals at once and apply-mirror found no .config yet.  All
bootloader builds failed this way, and the two goals also raced on the
git index.lock.  Buildroot's own Makefile is .NOTPARALLEL for the same
reason, -j still applies within each goal.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit
troglobit merged commit b9e53a9 into main Oct 8, 2026
28 checks passed
@troglobit
troglobit deleted the bpi-m1 branch October 8, 2026 18: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