xm530: bring up the AltoBeam ATBM6032 USB WiFi chip - #2316
Conversation
2048269 to
e0af350
Compare
PR Summary by QodoEnable AltoBeam ATBM6032 USB WiFi on XM530
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1. Other cameras ship unusable WiFi logic
|
e0af350 to
e46f92f
Compare
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.
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.
| BR2_PACKAGE_ATBM60XX=y | ||
| BR2_PACKAGE_ATBM60XX_MODEL_603X=y | ||
| BR2_PACKAGE_ATBM60XX_INTERFACE_USB=y |
There was a problem hiding this comment.
1. atbm60xx path remains untested 📘 Rule violation ☼ Reliability
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.
Agent Prompt
## Issue description
The newly enabled `atbm60xx` clean-build and startup path lacks hardware verification from an image produced by this PR.
## Issue Context
The existing evidence comes from a prebuilt driver blob and local init script, while Compliance ID 1 requires board output proving the behavior-changing implementation under review.
## Fix Focus Areas
- br-ext-chip-xiongmai/configs/xm530_lite_defconfig[70-72]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if [ "$1" = "atbm603x-xm530-usb" ]; then | ||
| modprobe dwc_otg | ||
| pdn=$(fw_printenv -n wifipdn) | ||
| [ -n "$pdn" ] && modprobe wifi_pdn value="$pdn" |
There was a problem hiding this comment.
2. Pdn module is missing 🐞 Bug ≡ Correctness
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.
Agent Prompt
## 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
|
Code review by qodo was updated up to the latest commit e46f92f |
|
Good afternoon |
|
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. |
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.
e46f92f to
d8ca418
Compare
| insmod /lib/modules/3.10.103+/xiongmai/wifi_pdn.ko value=96 | ||
| insmod /lib/modules/3.10.103+/xiongmai/compat.ko | ||
| insmod /lib/modules/3.10.103+/kernel/net/wireless/cfg80211.ko # grab from original firmware | ||
| insmod /lib/modules/3.10.103+/kernel/net/wireless/cfg80211_xm711.ko # vendor rewrite, kept off the in-tree cfg80211 path |
There was a problem hiding this comment.
1. Camera wifi can miss dependencies 📘 Rule violation ☼ Reliability
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.
Agent Prompt
## Issue description
The modified shipped WiFi helper loads `cfg80211_xm711.ko` directly with `insmod`, bypassing dependency-aware module loading.
## Issue Context
The package now regenerates module dependency metadata, so the renamed module should be loaded by module name through `modprobe`.
## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530/files/script/wifi[10-10]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit d8ca418 |
Some XM530 boards (e.g. IPC-RB-BLK530AI-0235P-AB0) carry an AltoBeam ATBM6032 on USB (007a:8888) with a power-down gpio. Enable the existing atbm60xx package (603x, USB) in the xm530 defconfig and add the /etc/wireless/usb case for it: load the dwc OTG stack, toggle the PDN regulator (the gpio comes from the wifipdn env, set per board, e.g. by a builder profile customizer), then modprobe the driver; S40network applies the MAC and runs ifup as for every other wlandev. 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. A companion per-device profile in OpenIPC/builder (xm530_lite_anbiux-a8b-3mp) sets wlandev, wifipdn and the upgrade url automatically on first boot.
d8ca418 to
406f923
Compare
| if [ "$1" = "atbm603x-xm530-usb" ]; then | ||
| modprobe dwc_otg | ||
| pdn=$(fw_printenv -n wifipdn) | ||
| [ -n "$pdn" ] && modprobe wifi_pdn value="$pdn" |
There was a problem hiding this comment.
1. Other cameras ship unusable wifi logic 📘 Rule violation ⚙ Maintainability
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.
Agent Prompt
## Issue description
The ATBM6032-specific branch is shipped through the unconditional shared overlay, including in images that do not enable the ATBM60XX package.
## Issue Context
Relocate or generate this branch through a configuration-keyed late overlay or post-build hook so it is present only in applicable XM530 builds with ATBM60XX enabled.
## Fix Focus Areas
- general/overlay/etc/wireless/usb[327-335]
- general/scripts/late-post-build-hooks.list[1-4]
- general/package/atbm60xx/atbm60xx.mk[10-13]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit 406f923 |
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/usbcase for it, so WiFi is not usableon these boards.
What this change does
atbm60xxpackage inxm530_lite_defconfig(603x model,USB interface) — the same three-line pattern as
t31_ultimate_defconfig— andpins
ATBM60XX_VERSIONto a full 40-character SHA instead of movingHEAD.atbm603x-xm530-usbcase to/etc/wireless/usb:modprobe dwc_otg,then
modprobe wifi_pdn value="$pdn"where the PDN gpio is read from theper-board
wifipdnenv (set e.g. by a builder profile's customizer), thenmodprobe atbm603x_wifi_usb.S40networkthen applies the MAC and runsifup wlan0exactly as for every otherwlandev. The case is purelyadditive and follows the file's established per-board pattern.
depmodinxiongmai-osdrv-xm530's target-finalize: the vendorkernel ships a
modules.depthat lists only its own modules, leavingdwc_otg,wifi_pdnand the atbm module invisible tomodprobe(samepattern as hisilicon-opensdk).
cfg80211rewrite ascfg80211_xm711.koinstead of overthe in-tree
cfg80211(CONFIG_CFG80211=m) at the canonical module path, andloads it from there in the
wifi xm711helper. atbm60xx — and thekernel-built mac80211 — build against the in-tree module, so both WiFi stacks
stay usable in one image.
Companion profile in OpenIPC/builder#130
(
xm530_lite_anbiux-a8b-3mp): on first boot setswlandev=atbm603x-xm530-usb,wifipdnto the board's PDN gpio and the upgrade url to this device's builderrelease, so the camera works and keeps updating out of the box. This PR is the
fallback: with it merged, any xm530 with the chip works via
fw_setenv wlandev=atbm603x-xm530-usb wifipdn=<gpio> wlanssid=... wlanpass=... wlanmac=...even without the builder profile.Status (2026-09-06)
317b443d); the branch now sits ontop of the merged SD-card autoload fix (xm530: autoload the SD card driver at boot #2315), so an image built from it also
carries the
sdio0_sdautoload.latest nightly (
master+4c34a66): the radio associates and takes a DHCPlease — see Evidence.
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):
After (radio driven, wlan0 up):
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+ thewireless/usbcase). That path is stillunverified 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-onewithfirmware_repopointed atthis fork and
firmware_ref=xiongmai-atbm60xx-wifi, or right after this PR ismerged — flash it and verify.
Known trade-off: enabling atbm60xx in the shared defconfig grows every xm530
image by the driver module. The cfg80211 rename leaves stock images carrying
the vendor rewrite as
cfg80211_xm711.koalongside the in-treecfg80211(previously it overwrote it), with the
wifi xm711helper loading the renamedcopy, so xm711/lynx boards keep working at the cost of one extra module file.
The only xm530 profile proposed in OpenIPC/builder today ([builder#130]) is
this ATBM board; no xm711-equipped xm530 is registered or known to be
deployed. Both hunks stand alone and can be dropped or split if reviewers
disagree.
Scope
general/package/all-patches/linux/(those go to OpenIPC/linux)general/overlay/or in a sharedload_<vendor>script hardcodes a value specific to my boardLD_PRELOAD, and no binaries that cannot be rebuilt from sourceNote on the overlay checkbox: the new
wireless/usbcase is purely additiveand 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
wlandevis set toatbm603x-xm530-usb. The PDNgpio is read from the per-board
wifipdnenv at run time — set by the builderprofile's customizer or the user, not hardcoded in the shared script.