Skip to content

Commit d8ca418

Browse files
committed
xm530: bring up the AltoBeam ATBM6032 USB WiFi chip
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.
1 parent 317b443 commit d8ca418

5 files changed

Lines changed: 33 additions & 4 deletions

File tree

br-ext-chip-xiongmai/configs/xm530_lite_defconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,8 @@ BR2_PACKAGE_OPUS_OPENIPC=y
6565
BR2_PACKAGE_VTUND_OPENIPC=y
6666
BR2_PACKAGE_XIONGMAI_OSDRV_XM530=y
6767
BR2_PACKAGE_YAML_CLI=y
68+
69+
# ATBM60XX WiFi: AltoBeam ATBM6032 USB chip (007a:8888) found on some XM530 boards
70+
BR2_PACKAGE_ATBM60XX=y
71+
BR2_PACKAGE_ATBM60XX_MODEL_603X=y
72+
BR2_PACKAGE_ATBM60XX_INTERFACE_USB=y

general/overlay/etc/wireless/usb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,14 @@ if [ "$1" = "rtl8188fu-t31-aoni-e97vj62" ]; then
324324
exit 0
325325
fi
326326

327+
# XM530 AltoBeam ATBM6032 (USB 007a:8888); PDN gpio from the wifipdn env
328+
# (set per board, e.g. by the builder profile's customizer)
329+
if [ "$1" = "atbm603x-xm530-usb" ]; then
330+
modprobe dwc_otg
331+
pdn=$(fw_printenv -n wifipdn)
332+
[ -n "$pdn" ] && modprobe wifi_pdn value="$pdn"
333+
modprobe atbm603x_wifi_usb
334+
exit 0
335+
fi
336+
327337
exit 1

general/package/atbm60xx/atbm60xx.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
################################################################################
66

77
ATBM60XX_SITE = $(call github,openipc,atbm_60xx,$(ATBM60XX_VERSION))
8-
ATBM60XX_VERSION = HEAD
8+
ATBM60XX_VERSION = 5243746967626551d29dd17ebdc7c1e4659bfb17
99

1010
define ATBM60XX_INSTALL_TARGET_CMDS
1111
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/share/atbm60xx_conf

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if [ "$WIFI" = "xm711" ]; then
77
insmod /lib/modules/3.10.103+/xiongmai/dwc_otg.ko
88
insmod /lib/modules/3.10.103+/xiongmai/wifi_pdn.ko value=96
99
insmod /lib/modules/3.10.103+/xiongmai/compat.ko
10-
insmod /lib/modules/3.10.103+/kernel/net/wireless/cfg80211.ko # grab from original firmware
10+
insmod /lib/modules/3.10.103+/kernel/net/wireless/cfg80211_xm711.ko # vendor rewrite, kept off the in-tree cfg80211 path
1111
# insmod /lib/modules/3.10.103+/kernel/net/mac80211/mac80211.ko # not used with grabbed cfg80211
1212
insmod /lib/modules/3.10.103+/xiongmai/xm711.ko
1313
fi

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ define XIONGMAI_OSDRV_XM530_INSTALL_TARGET_CMDS
2121
$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/3.10.103+/xiongmai $(XIONGMAI_OSDRV_XM530_PKGDIR)/files/kmod/usb/*.ko
2222
$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/3.10.103+/xiongmai $(XIONGMAI_OSDRV_XM530_PKGDIR)/files/kmod/xm711/*.ko
2323

24-
# Dirty hack
24+
# The backported cfg80211 is only needed by the xm711/lynx driver. Install
25+
# it under its own name instead of over the in-tree cfg80211 at the
26+
# canonical module path: atbm60xx builds against the in-tree module, and so
27+
# does the kernel-built mac80211. `wifi xm711` loads the renamed copy.
2528
$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/3.10.103+/kernel/net/wireless
26-
$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/3.10.103+/kernel/net/wireless $(XIONGMAI_OSDRV_XM530_PKGDIR)/files/kmod/rewrite/cfg80211.ko
29+
$(INSTALL) -m 644 $(XIONGMAI_OSDRV_XM530_PKGDIR)/files/kmod/rewrite/cfg80211.ko $(TARGET_DIR)/lib/modules/3.10.103+/kernel/net/wireless/cfg80211_xm711.ko
2730

2831
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
2932
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(XIONGMAI_OSDRV_XM530_PKGDIR)/files/script/load*
@@ -36,4 +39,15 @@ define XIONGMAI_OSDRV_XM530_INSTALL_TARGET_CMDS
3639
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib/ $(XIONGMAI_OSDRV_XM530_PKGDIR)/files/lib/*.so
3740
endef
3841

42+
# The vendor kernel ships a modules.dep that only lists its own modules, so
43+
# the xiongmai/ modules installed above (dwc_otg, wifi_pdn) and the atbm60xx
44+
# module are invisible to modprobe. LINUX_RUN_DEPMOD is already registered in
45+
# TARGET_FINALIZE_HOOKS (the linux package is processed before this one) and
46+
# has run by the time we get here; a second pass over the merged target makes
47+
# modprobe resolve the driver stack the wireless/usb cases rely on.
48+
define XIONGMAI_OSDRV_XM530_FINALIZE_MODULES
49+
$(LINUX_RUN_DEPMOD)
50+
endef
51+
XIONGMAI_OSDRV_XM530_TARGET_FINALIZE_HOOKS += XIONGMAI_OSDRV_XM530_FINALIZE_MODULES
52+
3953
$(eval $(generic-package))

0 commit comments

Comments
 (0)