[PATCH wireless-next 00/10] wifi: cw1200: add XRadio XR819 support
From: Arthur Heymans
Date: Thu Nov 19 2026 - 12:50:22 EST
The XRadio XR819 is a 2.4 GHz 802.11b/g/n SDIO chip found on Allwinner
boards such as the Orange Pi Zero. XRadio likely bought the IP from
ST-Ericsson: the XR819's host interface is based on the WSM interface
of the CW1x60, and it reports the CW1x60 hardware revision. This series
therefore adds it to cw1200 rather than adding a new driver.
Patches 1-5 fix existing cw1200 bugs. They do not depend on the XR819
changes and carry Fixes: tags:
1 a double debugfs removal on unbind
2 SDD elements read without length checks or unaligned access
3 SDIO transfers from stack buffers
4 GPIO interrupt setup not unwound on error
5 mac80211 unregistered after the interrupt is freed, so every
unbind of an associated device ends with "stuck in firmware,
killing BH"
Patches 6-7 add the vendor prefix and a binding for the SDIO function,
with an optional GPIO interrupt and MAC address. Patches 8-9 add the
XR819: a first-stage loader written to SRAM before the usual firmware
download, the SDIO ID 0020:2281, and a card reset on probe so that the
device can be bound again after an unbind. Patch 10 takes over the
orphaned driver as Odd Fixes, as I presume someone needs to do it?
Firmware
--------
The vendor firmware is not redistributable, and it speaks a dialect of
WSM that cw1200 does not: it reads bits 6-7 of the message ID as an
interface number where cw1200 puts a link ID, and its TX confirmations
carry per-rate retry counts in place of the media and queue delays.
The firmware these patches are tested with therefore comes from a
reverse-engineering project and speaks the WSM that cw1200 expects.
The firmware is written in rust and runs on a ARM966E-S core. It
is licensed MIT OR Apache-2.0 and builds the three files the driver
requests, xr819/boot_xr819.bin, xr819/fw_xr819.bin and
xr819/sdd_xr819.bin (this one is pure calibration data).
Code repo:
https://github.com/ArthurHeymans/xradio-open-firmware
Documentation on the hardware obtained through reverse engineering and
black box testing.
https://arthurheymans.github.io/xradio-open-firmware/
I plan to submit them to linux-firmware once the driver side is
settled.
Testing
-------
Tested on an Orange Pi Zero against an Intel peer with WPA2: station,
access point, a 10-minute traffic soak, and repeated unbind and bind
with both the SDIO and a GPIO interrupt. SPI is build-tested only, and
without CW1200 hardware, patches 1-5 are tested on the XR819 only.
Details:
https://arthurheymans.github.io/xradio-open-firmware/orange-pi-zero-smoke.html
Tools
-----
The patches were written with AI coding assistants from my instructions:
OpenAI Codex for patches 1-4 and 6-9, Anthropic Claude for patches 5
and 10. The assistants also ran the board tests above on my hardware.
I have reviewed every patch and take responsibility for them.
Arthur Heymans (10):
wifi: cw1200: avoid removing the debugfs directory twice
wifi: cw1200: check SDD element lengths before reading them
wifi: cw1200: bounce SDIO transfers that use stack buffers
wifi: cw1200: unwind GPIO interrupt setup on error
wifi: cw1200: unregister from mac80211 before freeing the interrupt
dt-bindings: vendor-prefixes: add XRadio
dt-bindings: net: wireless: add XRadio XR819
wifi: cw1200: load the XR819 bootloader into SRAM
wifi: cw1200: add XR819 SDIO support
MAINTAINERS: add myself for the cw1200 driver
.../bindings/net/wireless/xradio,xr819.yaml | 49 +++++
.../devicetree/bindings/vendor-prefixes.yaml | 2 +
MAINTAINERS | 4 +-
drivers/net/wireless/st/cw1200/Kconfig | 6 +-
drivers/net/wireless/st/cw1200/cw1200.h | 9 +
drivers/net/wireless/st/cw1200/cw1200_sdio.c | 200 ++++++++++++++----
drivers/net/wireless/st/cw1200/cw1200_spi.c | 2 +
drivers/net/wireless/st/cw1200/debug.c | 19 +-
drivers/net/wireless/st/cw1200/debug.h | 1 -
drivers/net/wireless/st/cw1200/fwio.c | 67 +++++-
drivers/net/wireless/st/cw1200/fwio.h | 3 +
drivers/net/wireless/st/cw1200/hwio.h | 1 +
drivers/net/wireless/st/cw1200/main.c | 50 ++++-
drivers/net/wireless/st/cw1200/sta.c | 26 ++-
include/linux/mmc/sdio_ids.h | 1 +
15 files changed, 361 insertions(+), 79 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/wireless/xradio,xr819.yaml
base-commit: e1dd8486807c1acf9551250b7f81e116a21e6ad6
--
2.56.0