Repository navigation
xiongmai: the Wi-Fi driver for each V200-series board - #2712
Conversation
The Wi-Fi on Xiongmai XM533 boards (X3-WQ-B, "SSV6158M") is an iComm SSV6020B/C on SDIO, 5653:2060. Neither ssv615x-openipc (SSV6006, 3030:3030) nor ssv635x-openipc (SSV6030, 5356:6030) binds it. The source is the ssv6020/ directory of OpenIPC/ssv6x5x (OpenIPC/ssv6x5x#2): iComm's L.SMAC trunk r170 with the SSV6020 HAL, as Allwinner's BSP ships it for the SSV6158, made to build as an external module on 3.10. The package installs the module, its ssv6x5x-sw.bin firmware in /lib/firmware (it calls request_firmware without a firmware_path) and a default /etc/ssv6x5x-wifi.cfg. xm533_lite selects it. On the xm533 image in qemu-bench, `modprobe ssv6x5x stacfgpath=/etc/ssv6x5x-wifi.cfg` loads cfg80211, mac80211 and the driver, which reads the cfg and registers its SDIO driver with no unknown symbol. qemu-bench has no SSV6020, so the card itself needs a camera.
…BM6132CU The Wi-Fi on Xiongmai XM535D2 boards (X9-WE2Q) is an AltoBeam ATBM6132CU, USB 007a:6052/6055/6162. Neither atbm-wifi nor atbm60xx carries AltoBeam's Wi-Fi 6 parts or their firmware. The source is the atbm606x/ directory of OpenIPC/atbm_60xx (OpenIPC/atbm_60xx#5): AltoBeam's 606x driver as Ingenic's SDK ships it (DRIVER_VER 4327). It covers the ATBM6062, 6062-C, 6162 and 6132-C, with the Cronus, Oceanus and Cronus Lite firmware built in and chosen at run time. Its USB table matches the vendor 6132cu.ko's exactly. It needs no changes, only settings: those are passed as make variables, as for atbm60xx, since the tree has no .config. It brings its own cfg80211 (a backport) and mac80211, as the vendor firmware does, so the xm535d2 kernel config turns the kernel's CFG80211 and MAC80211 off. Otherwise two cfg80211.ko would ship and depmod could bind the driver to the wrong one. xm535d2_lite selects the package. On a clean xm535d2 build in qemu-bench: - modules.dep binds atbm606x_wifi_usb.ko to the bundled cfg80211.ko; - modprobe loads both and the driver registers atbm_wlan (SVN_VER=4327), with no unknown symbol or Oops. The rootfs is 2.66 MB of 5 MB. qemu-bench's ATBM model is Ares-B only, so the dongle itself needs a camera.
…D1 and XM535W1 Each V200-series board now selects the Wi-Fi driver for the chip its camera ships with: | Board | Wi-Fi | Package | |---|---|---| | xm530v200_lite | ATBM6012B-X (X6C-WEQ, 007a:888b); XM713G (X2-WQ2, 007a:8888, AsmLite firmware) | atbm603x-comb-openipc | | xm533_lite | iComm SSV6020 | ssv6020-openipc | | xm535d1_lite | ATBM6012B-X | atbm603x-comb-openipc | | xm535d2_lite | ATBM6132CU | atbm606x-openipc | | xm535w1_lite | ATBM6012B-X | atbm603x-comb-openipc | The source is the atbm603x_comb/ directory of OpenIPC/atbm_60xx (OpenIPC/atbm_60xx#6): AltoBeam's apollo driver (DRIVER_VER 2874), as Khadas ships it, with the AsmLite and Ares-B firmware built in. The chip type is picked at run time. It binds 007a:888b and 007a:8888, and uses the kernel's cfg80211. The directory's own .config is used, through ATBM_BUILD_IN_KERNEL=n and WIFI_PROJ_DIR. In qemu-bench, with its emulated AltoBeam dongle: - xm530v200 (PID 8888, chip 0x49) and xm535d1 (PID 888b, chip 0x4a): modprobe identifies the chip and brings up wlan0; - wpa_supplicant associates with the model's open AP; - udhcpc gets a lease over Wi-Fi (192.168.50.15); - no Oops. rootfs: xm530v200 2.54 MB, xm535d1/w1 2.52 MB, of 5 MB.
PR Summary by QodoAdd board-specific Wi-Fi drivers for Xiongmai V200 cameras
AI Description
Diagram
High-Level Assessment
Files changed (13)
|
Code Review by Qodo
1. Affected cameras have untested Wi-Fi
|
…safety fixes Both source PRs gained a commit from review: OpenIPC/ssv6x5x#2 bounds its debug interfaces' input and fixes a module-load crash on a missing stacfgpath (1d5db46); OpenIPC/atbm_60xx#5 bounds its USB endpoint and RX header reads and the private ioctls' input (5379d2a). Both rebuilt images load the drivers in qemu-bench without an Oops.
From review on #2712: the drivers were in the images, but no wlandev profile loaded them. S40network runs the profile named by wlandev. USB (/etc/wireless/usb): - atbm603x-xm530v200-x6c-weq (pad 87) - atbm603x-xm530v200-x2-wq2 (pad 82) - atbm603x-xm535d1-x6e-weq (pad 11) - atbm603x-xm535w1-x2w-wng (pad 163) - atbm606x-xm535d2-x9-we2q (no pad; its vendor loadpublic passes 255) Each loads the USB host, which load_xiongmai would only load after S40network: the vendor's dwc2 and xm_usb0. It then cycles the dongle's power pad as the vendor wifi_pdn.ko does (output high, 2 s, low, 2 s; the pads are its loadpublic's), loads the driver and waits for wlan0. load_xiongmai now modprobes dwc2 and xm_usb0, so a host the profile loaded is not loaded twice. atbm603x-generic-usb also takes atbm603x-comb-openipc's module when atbm-wifi's is not there, and atbm606x-generic-usb loads atbm606x's. SDIO (/etc/wireless/sdio): ssv6020-xm533-x3-wq-b loads xm_v200_sdio_wifi (OpenIPC/linux#156), which registers the XM533's SDIO0 Wi-Fi slot with power pad 166 and clock phase 0x170, then ssv6x5x with its cfg. The xm533 kernel config builds xm_v200_sdio_wifi. In qemu-bench: - xm530v200, wlandev=atbm603x-xm530v200-x6c-weq and wlanssid=OpenIPC, with its emulated AltoBeam dongle: at boot wlan0 joins, gets 192.168.50.15 by DHCP and takes the default route. - xm533, wlandev=ssv6020-xm533-x3-wq-b: the slot comes up as mmc0 (25 MHz from the 1.2 GHz PLL) and ssv6x5x binds it, beside the card slot's mmc1, which mounts its card. qemu-bench has no SSV6020, so there is no wlan0 there.
Problem
Each V200-series board from #2709 now selects the Wi-Fi driver for the one chip its camera ships with. These boards come from one manufacturer, and each chip variant has one Wi-Fi part:
xm530v200_lite007a:888b/007a:8888atbm603x-comb-openipcxm533_lite5653:2060ssv6020-openipcxm535d1_lite007a:888batbm603x-comb-openipcxm535d2_lite007a:6052/6055/6162atbm606x-openipcxm535w1_lite007a:888batbm603x-comb-openipcNone of the existing packages covers these chips:
ssv615x/ssv635xare SSV6006/SSV6030.atbm60xxpredates AsmLite and has only Ares-B firmware.atbm-wifiandatbm60xxhave no Wi-Fi 6 parts.What the three packages do:
atbm603x-comb-openipc: AltoBeam's apollo driver (DRIVER_VER 2874, as Khadas ships it), with the AsmLite and Ares-B firmware built in. It uses the kernel's cfg80211, and the directory's own.config.ssv6020-openipc: iComm's L.SMAC trunk r170 with the SSV6020 HAL, as Allwinner's BSP ships it, made to build as an external module on 3.10. It installsssv6x5x.ko,ssv6x5x-sw.binin/lib/firmware, and/etc/ssv6x5x-wifi.cfg.atbm606x-openipc: AltoBeam's Wi-Fi 6 driver as Ingenic's SDK ships it (DRIVER_VER 4327). It brings its own cfg80211, as the vendor firmware does, so thexm535d2kernel config turns the kernel'sCFG80211andMAC80211off.All three pin full commit SHAs from the source PRs above. Those SHAs already download from the
openipc/archive URLs; if the source PRs are squash-merged, the pins should move to the merged commits.Hardware tested on
Not run on a camera; qemu-bench only. qemu-bench emulates the AltoBeam Ares-B/AresLite dongle at the WSM protocol level, so
atbm603x-comb-openipcgoes as far as a DHCP lease over Wi-Fi there. It has no model of the SSV6020 or the Cronus chips, so those two only load. No radio has been tested.Evidence
QEMU, xm530v200 (PID 8888) and xm535d1 (PID 888b), with qemu-bench's
atbm-wifidongle:QEMU, xm533 (OpenIPC U-Boot, kernel and rootfs):
QEMU, xm535d2 (a clean build):
Image sizes:
ci-matrix.py --self-test: ok (112 boards, 161 packages).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 source