All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH wireless-next v2 00/12] wifi: cw1200: add XRadio XR819 support
@ 2026-12-01  8:39 Arthur Heymans
  2026-12-01  8:39 ` [PATCH wireless-next v2 01/12] wifi: cw1200: avoid removing the debugfs directory twice Arthur Heymans
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: Arthur Heymans @ 2026-12-01  8:39 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree,
	Ulf Hansson, linux-mmc, Solomon Peachy, linux-kernel,
	Arthur Heymans

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-11 add the
XR819: a first-stage loader written to SRAM before the usual firmware
download, two preparatory SDIO probe cleanups (per-device platform data
storage and checking sdio_enable_func()/IRQ subscribe errors), and the
XR819 SDIO support (ID 0020:2281 and card reset on probe so that the
device can be bound again after an unbind). Patch 12 takes over the
orphaned driver as Odd Fixes, as I presume someone needs to do it?

Changes since v1:
- Remove "Prepared with ..." lines from individual commit messages
  (keep AI tool disclosure here in the cover letter).
- dt-bindings: vendor-prefixes: use "Guangzhou Xradio Technology Co.,
  Ltd." (Conor Dooley).
- dt-bindings: xradio,xr819: reference wireless-controller.yaml# with
  unevaluatedProperties: false, and note in the description that power
  supplies, active-low reset, and any optional host-provided 32.768 kHz
  clock are described on the parent MMC controller via vmmc-supply /
  vqmmc-supply and mmc-pwrseq-simple.
- Split per-device platform data storage and sdio_enable_func() / IRQ
  subscription error checks out of the XR819 SDIO patch into two
  preceding patches (Ulf Hansson).

v1: https://lore.kernel.org/r/20261119175002.458988-1-arthur@aheymans.xyz

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 and 9-10 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-11, Anthropic Claude for patches 5
and 12, and Gemini for the v2 split and binding adjustments. The
assistants also ran the board tests above on my hardware. I have
reviewed every patch and take responsibility for them.

Arthur Heymans (12):
  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: copy platform data into per-device storage
  wifi: cw1200: check sdio_enable_func() and IRQ subscribe errors
  wifi: cw1200: add XR819 SDIO support
  MAINTAINERS: add myself for the cw1200 driver

 .../bindings/net/wireless/xradio,xr819.yaml   |  55 +++++
 .../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, 367 insertions(+), 79 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/xradio,xr819.yaml


base-commit: e1dd8486807c1acf9551250b7f81e116a21e6ad6
-- 
2.56.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-12-01 16:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01  8:39 [PATCH wireless-next v2 00/12] wifi: cw1200: add XRadio XR819 support Arthur Heymans
2026-12-01  8:39 ` [PATCH wireless-next v2 01/12] wifi: cw1200: avoid removing the debugfs directory twice Arthur Heymans
2026-12-01  8:39 ` [PATCH wireless-next v2 02/12] wifi: cw1200: check SDD element lengths before reading them Arthur Heymans
2026-12-01  8:39 ` [PATCH wireless-next v2 03/12] wifi: cw1200: bounce SDIO transfers that use stack buffers Arthur Heymans
2026-12-01  8:39 ` [PATCH wireless-next v2 04/12] wifi: cw1200: unwind GPIO interrupt setup on error Arthur Heymans
2026-12-01  8:39 ` [PATCH wireless-next v2 05/12] wifi: cw1200: unregister from mac80211 before freeing the interrupt Arthur Heymans
2026-12-01  8:39 ` [PATCH wireless-next v2 06/12] dt-bindings: vendor-prefixes: add XRadio Arthur Heymans
2026-12-01  8:39 ` [PATCH wireless-next v2 07/12] dt-bindings: net: wireless: add XRadio XR819 Arthur Heymans
2026-12-01  8:39 ` [PATCH wireless-next v2 08/12] wifi: cw1200: load the XR819 bootloader into SRAM Arthur Heymans
2026-12-01  8:39 ` [PATCH wireless-next v2 09/12] wifi: cw1200: copy platform data into per-device storage Arthur Heymans
2026-12-01  8:47   ` Ulf Hansson
2026-12-01  8:39 ` [PATCH wireless-next v2 10/12] wifi: cw1200: check sdio_enable_func() and IRQ subscribe errors Arthur Heymans
2026-12-01  8:47   ` Ulf Hansson
2026-12-01  8:39 ` [PATCH wireless-next v2 11/12] wifi: cw1200: add XR819 SDIO support Arthur Heymans
2026-12-01  8:48   ` Ulf Hansson
2026-12-01  8:39 ` [PATCH wireless-next v2 12/12] MAINTAINERS: add myself for the cw1200 driver Arthur Heymans
2026-12-01 16:07 ` [PATCH wireless-next v2 00/12] wifi: cw1200: add XRadio XR819 support Pablo Mazzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.