Skip to content

xm530: bring up the AltoBeam ATBM6032 USB WiFi chip - #2316

Merged
openipc-ai merged 2 commits into
OpenIPC:masterfrom
yatotoshka:xiongmai-atbm60xx-wifi
Nov 14, 2026
Merged

openipc-ai merged 2 commits into
OpenIPC:masterfrom
yatotoshka:xiongmai-atbm60xx-wifi

Conversation

@yatotoshka

@yatotoshka yatotoshka commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Some XM530 boards (e.g. IPC-RB-BLK530AI-0235P-AB0 V1.03) carry an AltoBeam
ATBM6032 USB WiFi (007a:8888) with a power-down gpio. The stock xm530 image has
neither the driver nor a /etc/wireless/usb case for it, so WiFi is not usable
on these boards.

What this change does

  • Adds the atbm603x-xm530 case to general/overlay/etc/wireless/usb (the
    same table and shape as the existing atbm603x-t31-zte-k540 case):
    modprobe dwc_otg, then modprobe wifi_pdn value="$pdn" where the PDN
    gpio is read from the per-board wifipdn env (set e.g. by a builder
    profile's customizer), then modprobe atbm603x_wifi_usb; S40network
    then applies the MAC and runs ifup wlan0 exactly as for every other
    wlandev.
  • Moves the vendor cfg80211 backport out of /lib/modules, to
    /usr/lib/xiongmai/cfg80211.ko (as mmz.ko already is), and the
    wifi xm711 helper insmods it from there. It is still module
    cfg80211; installed over (or beside) the in-tree cfg80211
    (CONFIG_CFG80211=m), depmod split the shared symbols between the two
    and the kernel's mac80211 failed with Unknown symbol. atbm60xx and
    mac80211 now resolve to the in-tree module only.
  • The profile fails when wifipdn is unset, a modprobe fails, or wlan0
    does not appear within 10 s, so S40network falls back to the wired port
    instead of ifup-ing a missing wlan0.
  • Does not touch xm530_lite_defconfig: enabling atbm60xx is the
    device profile's business (companion profile in
    OpenIPC/builder#130,
    xm530_lite_anbiux-a8b-3mp), so stock xm530 images are unchanged.

Status (2026-11-14)

Hardware tested on

XM530AI (marking 30WX1), board IPC-RB-BLK530AI-0235P-AB0 V1.03, SmartSens
SC3335, AltoBeam ATBM6032 USB WiFi (007a:8888), PDN on gpio 96

Evidence

The chip, the PDN gpio and the exact load order used by the new case
(dwc_otg → wifi_pdn → atbm603x) are proven on this hardware — the camera is
currently associated:

Before (stock image, no driver for the chip at all):

# dmesg — no atbm driver registered, wlan0 never appears
ls /sys/class/net/
eth0  lo

After (radio driven, wlan0 up):

wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether f4:b1:9c:a8:ca:20 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.243/24 brd 192.168.1.255 scope global wlan0
[atbm_log]:wlan0: authenticated
[atbm_log]:wlan0: associated
default via 192.168.1.1 dev wlan0

The Web UI is reachable both over the wlan0 address (192.168.1.243) and the
Ethernet address (192.168.1.242).

Honest status: the running camera currently loads the driver from a prebuilt
blob (built from the same atbm_60xx revision this PR pins) plus a local init
script, not from the clean-build path of this patch (compiled atbm60xx +
wlandev + S40network + the wireless/usb case). That path is still
unverified on-device; CI confirms atbm60xx compiles against the xm530 kernel,
and the size report says whether the 5M rootfs still fits (the image now also
carries the #2315 SD module). To close the gap: build an image from this branch
— possible today via builder#130's build-one with firmware_repo pointed at
this fork and firmware_ref=xiongmai-atbm60xx-wifi, or right after this PR is
merged — flash it and verify.

Notes: the case in /etc/wireless/usb only runs when wlandev is set to
atbm603x-xm530. Every xm530 image now carries the vendor cfg80211 at
/usr/lib/xiongmai/cfg80211.ko instead of over the in-tree module, with
wifi xm711 loading it by path, so xm711 boards keep their stack and
mac80211-based drivers (MT7601U on stock xm530_lite) can load again.

Scope

  • No kernel patches under general/package/all-patches/linux/ (those go to OpenIPC/linux)
  • No files specific to a single retail camera model (those go to OpenIPC/builder)
  • No probing or bring-up tooling (that goes to OpenIPC/ipctool)
  • Nothing under general/overlay/ or in a shared load_<vendor> script hardcodes a value specific to my board
  • Package sources come from an OpenIPC repository, and any version bump keeps at least the specificity of the pin it replaces (a new package should pin a full 40-character SHA)
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source
  • The driver itself is selected by device profiles (builder#130) and by t31_ultimate, so CI compiles atbm60xx; the xm530-kernel compile + 5M rootfs size are covered by the builder device build

Note on the overlay checkbox: the new wireless/usb case is purely additive
and matches the file's established per-board pattern (driver, SoC, board
bring-up — like the ~40 existing cases); it changes no existing board's
behaviour and only runs when wlandev is set to atbm603x-xm530. The PDN
gpio is read from the per-board wifipdn env at run time — set by the builder
profile's customizer or the user, not hardcoded in the shared script.

@yatotoshka
yatotoshka force-pushed the xiongmai-atbm60xx-wifi branch 2 times, most recently from 2048269 to e0af350 Compare August 26, 2026 13:50
@yatotoshka
yatotoshka marked this pull request as ready for review August 26, 2026 14:03
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Bring up ATBM6032 USB WiFi on XM530 boards

✨ Enhancement 🐞 Bug fix 🕐 20-40 Minutes

Grey Divider

AI Description

• Add XM530 USB WiFi bring-up using a per-board power-down GPIO.
• Rebuild module dependencies so the new driver stack is discoverable by modprobe.
• Preserve both WiFi stacks by separating vendor cfg80211 and pinning the ATBM driver revision.
Diagram

graph TD
  ENV["Board environment"] --> NET["S40network"] --> USB["USB dispatch"] --> RADIO["USB and PDN"] --> ATBM["ATBM driver"] --> CFG["In-tree cfg80211"]
  FINAL["XM530 finalize"] --> INDEX["Module index"] --> RADIO
  INDEX --> VENDOR["XM711 vendor cfg"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Package vendor cfg80211 only in XM711-specific images
  • ➕ Avoids carrying the additional vendor module in ATBM-only images.
  • ➖ Requires profile-specific packaging and prevents one image from supporting both WiFi stacks.

Recommendation: Keep the shared, separately named vendor module for now: it preserves the canonical cfg80211 path needed by ATBM without changing XM711's intended loading path. Profile-specific packaging is worth considering only if rootfs size becomes a constraint. Clean-build and XM711 regression testing remain important before merge.

Files changed (4) +28 / -4

Enhancement (1) +10 / -0
usbAdd the XM530 ATBM6032 USB bring-up case +10/-0

Add the XM530 ATBM6032 USB bring-up case

• Adds an opt-in wlandev case that loads DWC OTG, applies the PDN GPIO from the per-board wifipdn environment value when present, and loads the ATBM603x USB driver.

general/overlay/etc/wireless/usb

Bug fix (2) +17 / -3
wifiLoad the separately named XM711 cfg80211 module +1/-1

Load the separately named XM711 cfg80211 module

• Changes the XM711 helper to modprobe cfg80211_xm711 rather than loading the vendor rewrite from the canonical cfg80211 path.

general/package/xiongmai-osdrv-xm530/files/script/wifi

xiongmai-osdrv-xm530.mkSeparate vendor cfg80211 and refresh module dependencies +16/-2

Separate vendor cfg80211 and refresh module dependencies

• Installs the XM711 vendor rewrite as cfg80211_xm711.ko without replacing the in-tree module. Adds a target-finalize depmod pass so modprobe can discover the installed XM530 and ATBM modules.

general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk

Other (1) +1 / -1
atbm60xx.mkPin the ATBM driver source revision +1/-1

Pin the ATBM driver source revision

• Replaces the moving HEAD version with a full commit SHA for reproducible driver builds.

general/package/atbm60xx/atbm60xx.mk

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. The board profile cannot start WiFi 🐞 Bug ≡ Correctness
Description
/etc/wireless/usb matches atbm603x-xm530, but the PR says the companion profile sets
wlandev=atbm603x-xm530-usb. With that documented value, S40network finds no matching wireless
case and never runs ifup wlan0.
Code

general/overlay/etc/wireless/usb[329]

+if [ "$1" = "atbm603x-xm530" ]; then
Evidence
The new case accepts only atbm603x-xm530, while the PR description specifies atbm603x-xm530-usb
for both the companion profile and manual setup. S40network passes wlandev to this script and
calls ifup wlan0 only when a wireless script succeeds.

general/overlay/etc/wireless/usb[329-335]
general/overlay/etc/init.d/S40network[2-11]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new case does not match the `wlandev` value documented for the companion board profile, so boot does not bring up WiFi.
## Fix Focus Areas
- general/overlay/etc/wireless/usb[327-335]
- general/overlay/etc/init.d/S40network[2-11]
## Recommended Fix
Use `atbm603x-xm530-usb` as the case selector, matching the documented profile and manual setup instructions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. A hook comment merely narrates code ⊘ Outdated
Description
post-build-hook.sh labels the duplicate guard with `Idempotent: skip if the case is already
present, merely paraphrasing the immediately following grep` command. The nearby board-scope and
placement comments already preserve the non-obvious rationale, so this label adds no maintenance
context and can become stale if the guard changes.

3. Other cameras ship unusable WiFi logic ✓ Resolved
Description
general/overlay/etc/wireless/usb installs the new atbm603x-xm530-usb branch unconditionally
instead of keying it to BR2_PACKAGE_ATBM60XX through a late overlay or hook. On an image where
that optional package is disabled, selecting this shipped branch still reaches the dwc_otg,
wifi_pdn, and atbm603x_wifi_usb loads even though the driver is not part of that build.

View action required (7)
4. Camera WiFi can miss dependencies ✓ Resolved
Description
The modified wifi helper invokes insmod for cfg80211_xm711.ko instead of the tree's
dependency-aware modprobe convention. When the xm711 branch runs, dependencies are not resolved
from the regenerated module metadata, so an unmet prerequisite prevents that WiFi stack from
loading.

5. atbm60xx path remains untested ⊘ Outdated
Description
The PR enables the clean-built atbm60xx path globally, but the description explicitly says the
demonstrated camera used a prebuilt blob and local init script and that an image built from this
patch has not yet been flashed. The supplied before/after output therefore does not verify the
behavior-changing path introduced here, contrary to the hardware-evidence requirement.

6. PDN module is missing 🐞 Bug ≡ Correctness
Description
The new ATBM6032 path runs modprobe wifi_pdn when wifipdn is configured, but the XM530 package
installs no wifi_pdn.ko, so the required PDN GPIO is never asserted and the USB radio may not
enumerate. The script ignores the failed modprobe and continues, leaving boot to report success from
this case even though wlan0 cannot appear on the tested hardware path.
Code

general/overlay/etc/wireless/usb[332]

+	[ -n "$pdn" ] && modprobe wifi_pdn value="$pdn"
Evidence
The changed case conditionally requires wifi_pdn before loading ATBM. The XM530 installation
commands only copy module globs from files/kmod, files/kmod/usb, and files/kmod/xm711, while
the repository's USB module directory contains only dwc_common_port_lib.ko and dwc_otg.ko; the
existing XM711 loader also references the same absent target path, corroborating that the package
does not currently supply this module.

general/overlay/etc/wireless/usb[329-334]
general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[19-22]
general/package/xiongmai-osdrv-xm530/files/script/wifi[7-12]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new ATBM6032 USB initialization invokes `wifi_pdn`, but no `wifi_pdn.ko` is installed into the XM530 image. Supply the required driver from rebuildable source and make initialization fail when the mandatory PDN setup fails.
## Issue Context
The XM530 package currently installs top-level, `usb`, and `xm711` module globs. The `usb` directory contains only `dwc_common_port_lib.ko` and `dwc_otg.ko`; do not solve this by importing an unrebuildable factory binary.
## Fix Focus Areas
- general/overlay/etc/wireless/usb[331-333]
- general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[19-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. GPIO 96 enters shared overlay ✓ Resolved
Description
The new shared /etc/wireless/usb case hardcodes board-specific PDN GPIO 96. Because
general/overlay/ ships broadly, this board value violates the overlay blast-radius rules and
should be supplied through board-specific configuration instead.

8. USB stack uses insmod ✓ Resolved
Description
The new shipped script loads dwc_common_port_lib, dwc_otg, and wifi_pdn with direct-path
insmod calls even though repository policy requires dependency-aware modprobe. This bypasses the
standardized module-loading convention for on-device scripts.

9. XM711 WiFi path breaks ✓ Resolved
Description
Because xm530_lite now enables ATBM60XX globally, this condition stops replacing the in-tree
cfg80211.ko even though the same image still installs the xm711 driver and a helper that loads
that exact path as xm711's required vendor cfg80211. Any xm711-equipped XM530 using the shared lite
image will therefore load the incompatible in-tree module and lose WiFi after upgrade.

10. Driver source tracks HEAD ✓ Resolved
Description
The new BR2_PACKAGE_ATBM60XX=y selection makes every xm530_lite build fetch openipc/atbm_60xx at
the package's moving HEAD revision. Identical firmware commits can therefore compile different,
unreviewed kernel-driver sources or stop building when that branch changes, so this addition is not
reproducible.


Remediation recommended

11. Switching radios prevents XM711 WiFi ✓ Resolved
Description
The install rule renames the vendor cfg80211.ko file without changing its embedded module
identity, and wifi xm711 tries to load it as a second cfg80211 module. If the in-tree cfg80211
module was loaded for another radio first, the vendor module cannot load while it remains active, so
the subsequent XM711 load cannot work.

Grey Divider

Tip of the day
💡 Did you know, you can ask Qodo to dismiss a finding you disagree with, with your reason on record

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread general/overlay/etc/wireless/usb Resolved
Comment thread general/overlay/etc/wireless/usb Resolved
@yatotoshka
yatotoshka force-pushed the xiongmai-atbm60xx-wifi branch from e0af350 to e46f92f Compare August 26, 2026 14:43
yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Aug 26, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite. The customizer sets wlandev to the atbm603x-xm530-usb
case in firmware's /etc/wireless/usb (dwc + wifi_pdn value=96 +
modprobe, after which S40network applies the MAC and runs ifup) and
points the upgrade url at this device's builder release.

Depends on OpenIPC/firmware#2316: xiongmai-osdrv-xm530 must not
install the vendor cfg80211 rewrite when atbm60xx is enabled, as the
atbm driver is built against the in-tree cfg80211.
yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Aug 26, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530-usb case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio (after which
S40network applies the MAC and runs ifup), and points the upgrade url
at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm60xx uses the in-tree module).

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
@yatotoshka
yatotoshka marked this pull request as draft August 26, 2026 17:39
@yatotoshka
yatotoshka marked this pull request as ready for review August 26, 2026 17:39
Comment thread general/overlay/etc/wireless/usb Resolved
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit e46f92f

@flyrouter

Copy link
Copy Markdown
Member

Good afternoon
Thank you for your interest in our project and the PR you sent.
Unfortunately, we won't be able to accept it because we have a separate repository for board customisation - Builder. Please take a look at it and create your model profile there, that would be the right approach.
Thanks.

@flyrouter

Copy link
Copy Markdown
Member

By the way, I found a few patches in Builder that I haven't sent yet, and I'll try to upload them tomorrow or at the latest in the next few days. And maybe this will help us create a stable solution together. Thanks.

@yatotoshka
yatotoshka marked this pull request as draft August 27, 2026 22:55
widgetii pushed a commit that referenced this pull request Aug 29, 2026
MT7601U_OPENIPC_VERSION was HEAD, so the same tree produced different artifacts
over time and the package could break with no change in this repo. Pin it to an
immutable ref instead.

0ac46553f3190d788b01c15cbeaa14f2951c55a3 is the current tip of openipc/mt7601u
and has been since 2023-08-11, so this is behaviourally a no-op today and purely
protective against future drift. It is also the lineage runtime-verified on a
Hi3518EV200: WPA2 join, RTSP streaming, 15-17 Mbps TX.

The package is enabled in four defconfigs, so this is a live path rather than a
dead one.

Rescoped after review: the original PR also enabled BR2_PACKAGE_MT7601U_OPENIPC
in hi3518ev200_ultimate_defconfig. Per review, firmware images ship WiFi
utilities and not drivers, and per-device selection belongs in Builder, so that
part was dropped on 2026-08-12 and only the pin remains. The changes-requested
predated that rescope and was dismissed as stale, not overridden.

Second instance of an unpinned package found this month; #2316
carries the same fix for atbm60xx. Worth a sweep for other VERSION = HEAD.
@yatotoshka
yatotoshka force-pushed the xiongmai-atbm60xx-wifi branch from e46f92f to d8ca418 Compare September 6, 2026 20:35
@yatotoshka
yatotoshka marked this pull request as ready for review September 6, 2026 20:57
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit d8ca418

@yatotoshka
yatotoshka force-pushed the xiongmai-atbm60xx-wifi branch from d8ca418 to 406f923 Compare September 7, 2026 18:14
@yatotoshka
yatotoshka marked this pull request as draft September 7, 2026 18:33
@yatotoshka
yatotoshka marked this pull request as ready for review September 7, 2026 18:33
yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Sep 30, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530 case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio the case
reads at run time (after which S40network applies the MAC and runs
ifup), and points the upgrade url at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm603x uses the in-tree module).

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
@yatotoshka
yatotoshka marked this pull request as draft September 30, 2026 20:55
@yatotoshka
yatotoshka marked this pull request as ready for review September 30, 2026 20:56
Comment thread general/overlay/etc/wireless/usb Resolved
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 683a548

yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Sep 30, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530 case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio the case
reads at run time (after which S40network applies the MAC and runs
ifup), and points the upgrade url at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm60xx uses the in-tree module). Until that PR
merges, master.yml builds this target against the branch carrying it
(OPENIPC_FW_REPO/REV, matrix-conditional, empty for every other
target) so the published archive is functional; remove the pin once
firmware#2316 lands.

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
@yatotoshka
yatotoshka marked this pull request as draft September 30, 2026 21:03
@yatotoshka
yatotoshka marked this pull request as ready for review September 30, 2026 21:03
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 683a548

yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Sep 30, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530 case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio the case
reads at run time (after which S40network applies the MAC and runs
ifup), and points the upgrade url at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm60xx uses the in-tree module). This profile
stays a draft until firmware#2316 merges; once it lands, the regular
CI builds a functional image for this device from upstream firmware.

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
@yatotoshka
yatotoshka marked this pull request as draft September 30, 2026 22:20
@yatotoshka
yatotoshka marked this pull request as ready for review September 30, 2026 22:20
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 683a548

@flyrouter

Copy link
Copy Markdown
Member

Good afternoon
This PR is frozen until it merges with another branch, which will first be merged into Builder, explored, and only then global joint changes may be possible.
Thank you

@openipc-ai openipc-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for this. #2853 is a second board with the same chip and the same PDN pin (Misecu XM-63-AI-50W: XM550, ATBM6032i 007a:8888, GPIO 96), so this bring-up matters beyond the anbiux. I ran it on the qemu-bench XM550 machine with the atbm-wifi dongle model (OpenIPC/qemu-bench#301 adds the USB host there). I rebased it by hand onto current master and built xm530_lite + atbm60xx from a clean output directory. Three things need changing before it can land.

1. The depmod hook is a no-op, so the driver still is not found. After a clean build, the S40network path with wlandev=atbm603x-xm530 wifipdn=96 gives:

$ lsmod
wifi_pdn                 660  0
dwc_otg               167828  0
dwc_common_port_lib    21364  1 dwc_otg
$ ls /sys/class/net
eth0  lo
modprobe: module atbm603x_wifi_usb not found in modules.dep

The cause is not the vendor modules.dep. Buildroot's LINUX_RUN_DEPMOD runs only if lib/modules/$(LINUX_VERSION_PROBED) exists, and on these XM 3.10.103 kernels the probe reads 3.10.103++ inside a git checkout (CI's or yours), so it is skipped at finalize. A package-level $(LINUX_RUN_DEPMOD) expands to the same test -d and is skipped too. #2854 fixes the probe for every board (it also restores Wi-Fi on the V200 family, broken the same way in the nightly). Please drop the hook from this PR and rely on #2854. With #2854 plus the rest of this PR, the same twin run gives wlan0, wpa_state=COMPLETED, a DHCP lease and 3/3 pings.

2. cfg80211_xm711.ko is still module cfg80211. Renaming the file does not rename the module, and both copies export the same symbols, so depmod resolves some of them to each:

kernel/net/mac80211/mac80211.ko: kernel/net/wireless/cfg80211_xm711.ko xiongmai/compat.ko kernel/net/wireless/cfg80211.ko
extra/hal_apollo/atbm603x_wifi_usb.ko: kernel/net/wireless/cfg80211_xm711.ko xiongmai/compat.ko kernel/net/wireless/cfg80211.ko

It works now only because busybox modprobe happens to load the in-tree cfg80211.ko first; the second cfg80211 then fails as a duplicate, and compat is loaded for nothing. The tree already handles this case for mmz.ko (XIONGMAI_OSDRV_XM530_DROP_REPLACED): keep the vendor rewrite out of /lib/modules (e.g. /usr/lib/xiongmai/cfg80211.ko) and insmod it by path in wifi xm711. depmod then never sees it, and the in-tree module is the only cfg80211 modprobe knows.

3. Rebase, and make the profile report failure. It conflicts with master in general/overlay/etc/wireless/usb (the V200 profiles from #2712 now sit at the end) and in atbm60xx.mk. Master already pins 70d6dec035e6cbe701ec552b0e17d36b0d879c69, so that hunk can go. The profile ends in exit 0 whatever modprobe did, so S40network goes on to ifup a wlan0 that does not exist. The V200 profiles' xm_v200_wifi waits for wlan0 and returns whether it appeared. Doing the same here (and modprobe dwc_otg / wifi_pdn failing loudly) gives the WebUI something true to show.

The wifi_pdn value=96 / dwc_otg / atbm603x_wifi_usb order and the wifipdn env are right: the twin enumerates 007a:8888 with exactly that sequence.

valov-daniil and others added 2 commits November 14, 2026 15:53
Some XM530 boards (e.g. IPC-RB-BLK530AI-0235P-AB0) carry an AltoBeam
ATBM6032 on USB (007a:8888) with a power-down gpio. Add the
atbm603x-xm530 case to /etc/wireless/usb: load the DWC OTG controller,
power the radio through the PDN gpio read from the per-board wifipdn
env (set e.g. by a builder profile customizer), then modprobe the
driver; S40network applies the MAC and runs ifup as for every other
wlandev. Selecting the atbm60xx driver stays the device profile's
business in OpenIPC/builder; the shared xm530_lite_defconfig is not
touched.

Supporting changes:
- re-run depmod in xiongmai-osdrv-xm530's target-finalize: the vendor
  kernel ships a modules.dep that only lists its own modules, leaving
  dwc_otg, wifi_pdn and atbm603x invisible to modprobe (same pattern as
  hisilicon-opensdk);
- install the vendor cfg80211 rewrite as cfg80211_xm711.ko instead of
  over the in-tree cfg80211, and load it from there in the 'wifi xm711'
  helper: atbm60xx (and the kernel-built mac80211) need the in-tree
  module at the canonical path, so both WiFi stacks stay usable in one
  image;
- pin atbm60xx to a fixed revision instead of moving HEAD.
…led ATBM6032 bring-up

Review of OpenIPC#2316: the depmod hook is gone, as OpenIPC#2854 restored depmod on the
XM 3.10.103 kernels for every board. Renaming the vendor backport to
cfg80211_xm711.ko left it module "cfg80211", so depmod split the shared
symbols between the two copies; it now sits in /usr/lib/xiongmai like mmz.ko
and `wifi xm711` loads it by path. The atbm603x-xm530 profile now fails when
wifipdn is unset, a modprobe fails, or wlan0 never appears, so S40network
falls back to the wired port.
@openipc-ai
openipc-ai force-pushed the xiongmai-atbm60xx-wifi branch from 683a548 to 4ff1c40 Compare November 14, 2026 16:00
@openipc-ai

Copy link
Copy Markdown
Collaborator

I've rebased this onto master and pushed the changes from my review as a second commit. @yatotoshka, your commit is unchanged apart from the conflict resolution.

  • Rebase: the profile now comes after the V200 profiles in /etc/wireless/usb. The atbm60xx.mk hunk is dropped because master already pins 70d6dec.
  • depmod hook removed: build: run the final depmod on kernels that see this checkout's git #2854 (merged, in the current nightly) makes depmod run on these kernels again for every board.
  • The vendor cfg80211.ko is moved out of /lib/modules. It now installs to /usr/lib/xiongmai/cfg80211.ko, the same treatment mmz.ko gets, and wifi xm711 loads it from there by path. The in-tree cfg80211 is then the only one depmod knows. This also stops mac80211 failing with Unknown symbol on every xm530 image, which affected MT7601U on stock xm530_lite.
  • atbm603x-xm530 now reports failure. It fails if wifipdn is unset, if any modprobe fails, or if wlan0 does not appear within 10 s. S40network then falls back to the wired port instead of running ifup on a missing wlan0.

Digital twin: qemu-bench -M xm550 with the atbm-wifi dongle. The image is xm530_lite with ATBM60XX + MODEL_603X + INTERFACE_USB enabled, as builder#130 sets them, without MT7601U. Squashfs is 4296/5120 KB.

modules.dep:

kernel/net/mac80211/mac80211.ko: kernel/net/wireless/cfg80211.ko
extra/hal_apollo/atbm603x_wifi_usb.ko: kernel/net/wireless/cfg80211.ko
xiongmai/dwc_otg.ko: xiongmai/dwc_common_port_lib.ko

wlandev=atbm603x-xm530 wifipdn=96, WPA2 network, booted through S40network:

lsmod atbm603x_wifi_usb     624260  0
lsmod cfg80211              122200  1 atbm603x_wifi_usb
lsmod wifi_pdn                 660  0
lsmod dwc_otg               167828  0
addr     inet 10.0.2.15/24 brd 10.0.2.255 scope global wlan0
ping 3 packets transmitted, 3 packets received, 0% packet loss
modprobe mac80211 ok

wlandev set, wifipdn unset: the profile prints atbm603x-xm530: wifipdn is not set, loads nothing, and boot continues.

wifi xm711 still loads its stack, now with the vendor copy from /usr/lib/xiongmai:

xm711                 353628  0
cfg80211              160040  1 xm711
compat                  1188  2 xm711,cfg80211

None of this has run on a real camera; all of it was tested on the twin only.

openipc-ai pushed a commit to yatotoshka/builder that referenced this pull request Nov 14, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530 case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio the case
reads at run time (after which S40network applies the MAC and runs
ifup), and points the upgrade url at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm60xx uses the in-tree module). This profile
stays a draft until firmware#2316 merges; once it lands, the regular
CI builds a functional image for this device from upstream firmware.

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
openipc-ai added a commit to OpenIPC/builder that referenced this pull request Nov 14, 2026
* xm530: add anbiux A8B-3MP (IPC-RB-BLK530AI, ATBM6032 USB WiFi)

The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530 case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio the case
reads at run time (after which S40network applies the MAC and runs
ifup), and points the upgrade url at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm60xx uses the in-tree module). This profile
stays a draft until firmware#2316 merges; once it lands, the regular
CI builds a functional image for this device from upstream firmware.

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.

* xm530_lite_anbiux-a8b-3mp: select xiongmai-opensdk, as firmware's xm530_lite does

Firmware #2576 moved the sensor and ISP libraries into the source-built
xiongmai-opensdk package; without it the image has no libsns_*/libispapp
and majestic gets no video.

---------

Co-authored-by: valov <valov.daniil@yandex.ru>
Co-authored-by: AI Dev <ai@openipc.org>

@openipc-ai openipc-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving at 4ff1c40. All three points from my review are addressed: the depmod hook is gone (#2854 covers it), the vendor cfg80211 is out of /lib/modules, and the profile now reports failure. 157 checks pass and no review threads are open.

@flyrouter, the order you asked for on 1 Oct holds: OpenIPC/builder#130 merged first (44ae64c). It builds against upstream firmware, and until this lands its camera comes up on the wired port. This PR then supplies the atbm603x-xm530 profile that device's wlandev names. #2853 is a second board with the same chip and the same PDN pin (XM550, ATBM6032i, GPIO 96), so the profile is shared rather than one-device.

Qodo's open finding asks for an atbm603x-xm530-usb selector, but the description never used that name. It and builder#130 both use atbm603x-xm530, which is what the case matches. The description is now updated to what the PR actually does.

Evidence is from the qemu-bench twin; none of it comes from a camera.

@openipc-ai
openipc-ai enabled auto-merge (squash) November 14, 2026 20:23
@openipc-ai
openipc-ai merged commit 2916ffe into OpenIPC:master Nov 14, 2026
163 of 164 checks passed
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.

4 participants