kernel/rv1106: M5 AIC8800 wifi/BT port — build-verified, capture recipe

Driver built into self-built 6.18 (=y): zImage 12.7MB + rv1106-warden.dtb
build clean; System.map confirms aicbsp_sdio_driver, aicwf_sdio_driver,
rwnx_cfg80211_ops linked with correct bsp->fdrv->btlpm initcall order (host
nm/System.map — cross-nm/ar mis-list these, verify with System.map).

Recipe captured (driver .c is vendor GPL source in the SDK, not duplicated):
- kbuild/ — from-scratch in-tree Kconfig + Makefiles (bsp->fdrv->btlpm link
  order; tristate->default y; AIC_FW_PATH as a real Kconfig string symbol).
- wifi-dt-block.dtsi — sdio_pwrseq (mmc-pwrseq-simple, reset gpio1 PA2) +
  &sdmmc (mmc@ffaa0000, supports-sdio, cap-sdio-irq, non-removable).
- PORT-PROGRESS.md — full file->change log: ~30 timer/netdev renames, 7
  cfg80211_ops signature deltas, link_id args, wakeup_source API rewrite,
  49 bsp/fdrv symbol collisions renamed aicbsp_priv_*, rwnx_mesh restore.

Firmware present on both oem_a+oem_b (/oem/usr/ko/aic8800dc_fw); on-hardware
wlan0 verify next.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
This commit is contained in:
BFE Engineering
2026-08-24 23:34:39 -06:00
co-authored by Claude Opus 4.8
parent f7f9648f2a
commit 6897c9f93e
11 changed files with 1136 additions and 0 deletions
@@ -0,0 +1,29 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# AICSemi AIC8800DC SDIO WiFi+BT driver (WardenOS M5 port).
#
# Ported from the vendor 5.10.160 out-of-tree source
# (flare-edge/sdk/sysdrv/drv_ko/wifi/aic8800dc/) — see
# warden-sdk/kernel/rv1106-enablement/wifi/PORT-PLAN.md and PORT-PROGRESS.md.
# Built-in only (=y): the 6.18 rootfs has no working module-loading pipeline
# yet, so these default to y rather than the vendor's default-n/tristate.
config AIC_WLAN_SUPPORT
bool "AIC wireless Support"
default y
help
This is support for the AIC wireless chip (AIC8800DC SDIO combo
wifi+BT on the WardenOS 86-Panel).
config AIC_FW_PATH
depends on AIC_WLAN_SUPPORT
string "Firmware & config file path"
default "/oem/usr/ko/aic8800dc_fw"
help
Path to the firmware & config files. The driver reads these
directly (not via request_firmware()) — see PORT-PLAN.md §3.8.
if AIC_WLAN_SUPPORT
source "drivers/net/wireless/aic8800/aic8800_fdrv/Kconfig"
source "drivers/net/wireless/aic8800/aic8800_btlpm/Kconfig"
endif
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# Link order matters: bsp before fdrv before btlpm, mirroring the working
# insmod order (insmod_wifi.sh) now that these are built-in (=y) instead of
# modules — see PORT-PLAN.md §4.5.
obj-$(CONFIG_AIC_WLAN_SUPPORT) += aic8800_bsp/
obj-$(CONFIG_AIC8800_WLAN_SUPPORT) += aic8800_fdrv/
obj-$(CONFIG_AIC8800_BTLPM_SUPPORT) += aic8800_btlpm/
@@ -0,0 +1,33 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# aic8800_bsp — SDIO bus glue + firmware bootstrap, ported in-tree from the
# vendor out-of-tree Makefile (flare-edge/sdk/sysdrv/drv_ko/wifi/aic8800dc/
# aic8800_bsp/Makefile). CONFIG_AIC_FW_PATH is now a real Kconfig string
# symbol (see ../Kconfig) so it needs no -D here — the driver picks it up
# from include/generated/autoconf.h directly (aicsdio.c, aic_bsp_driver.h).
#
# Vendor CONFIG_* build-time knobs below are preserved as fixed -D flags
# (not full Kconfig symbols) since this port only needs the one build
# configuration this board actually uses (SDIO, Rockchip, no USB/PCI/mesh).
ccflags-y += -DAICWF_SDIO_SUPPORT
ccflags-y += -DCONFIG_SDIO_PWRCTRL
ccflags-y += -DCONFIG_PLATFORM_ROCKCHIP
ccflags-y += -DCONFIG_LINK_DET_5G
ccflags-y += -DCONFIG_VRF_DCDC_MODE
ccflags-y += -DCONFIG_PREALLOC_TXQ
ccflags-y += -DCONFIG_DPD -DCONFIG_FORCE_DPD_CALIB
ccflags-y += -DCONFIG_RESV_MEM_SUPPORT
ccflags-y += -DCONFIG_AMSDU_RX
ccflags-y += -Wno-unused-function
obj-$(CONFIG_AIC_WLAN_SUPPORT) += aic8800_bsp.o
aic8800_bsp-y := \
aic8800dc_compat.o \
aic8800d80_compat.o \
aic_bsp_main.o \
aic_bsp_driver.o \
aicsdio.o \
aicsdio_txrxif.o \
md5.o \
aicwf_txq_prealloc.o
@@ -0,0 +1,7 @@
config AIC8800_BTLPM_SUPPORT
tristate "AIC8800 bluetooth Support"
default y
help
This is support for the aic8800 bluetooth low-power-mode / HCI
wake companion module (aic8800_btlpm). Built-in (y) by default —
see the aic8800 port notes in warden-sdk/kernel/rv1106-enablement/wifi/.
@@ -0,0 +1,16 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# aic8800_btlpm — Bluetooth low-power-mode / HCI wake companion module,
# ported in-tree from the vendor out-of-tree Makefile
# (flare-edge/sdk/sysdrv/drv_ko/wifi/aic8800dc/aic8800_btlpm/Makefile).
# lpm.c stays out of the build (CONFIG_SUPPORT_LPM was already off in the
# vendor default; aic8800_btlpm.c's own has_lpm_enabled/lpm_fops logic is
# self-contained and does not call into lpm.c).
ccflags-y += -DCONFIG_PLATFORM_ROCKCHIP
ccflags-y += -I$(srctree)/$(src)/../aic8800_bsp
obj-$(CONFIG_AIC8800_BTLPM_SUPPORT) += aic8800_btlpm.o
aic8800_btlpm-y := \
aic_bluetooth_main.o \
rfkill.o
@@ -0,0 +1,7 @@
config AIC8800_WLAN_SUPPORT
tristate "AIC8800 wlan Support"
default y
help
This is support for the aic8800 cfg80211 full-MAC wifi driver
(aic8800_fdrv). Built-in (y) by default — see the aic8800 port
notes in warden-sdk/kernel/rv1106-enablement/wifi/.
@@ -0,0 +1,92 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# aic8800_fdrv — the cfg80211 full-MAC driver ("fdrv"), ported in-tree from
# the vendor out-of-tree Makefile (flare-edge/sdk/sysdrv/drv_ko/wifi/
# aic8800dc/aic8800_fdrv/Makefile). SDIO-only build (this board has no
# USB/PCI variant) — usb_host.c and rwnx_pci.c are dropped from the tree
# entirely (PORT-PLAN.md §4.1 flagged both as candidates to drop "unless a
# build error proves them referenced elsewhere" — that held for these two).
# rwnx_mesh.c was ALSO dropped initially on the same theory but had to be
# restored: rwnx_tx.c's NL80211_IFTYPE_MESH_POINT switch-case is not
# preprocessor-gated, so rwnx_mesh.h's types/prototypes are needed to
# compile even though this board never creates a mesh-type interface.
# md5.o is dropped from THIS module's object list only: it is byte-identical
# to aic8800_bsp's
# md5.c (same non-static MD5Init/MD5Update/... symbols) and, unlike the
# old separate .ko world, both drivers now link into one vmlinux — keeping
# both objects would be a multiple-definition link error. aic8800_bsp
# links first (../Makefile) so fdrv's calls resolve against its md5.o.
ccflags-y += -DCONFIG_RWNX_FULLMAC
ccflags-y += -DAICWF_SDIO_SUPPORT
ccflags-y += -DCONFIG_SDIO_PWRCTRL
ccflags-y += -DCONFIG_PLATFORM_ROCKCHIP
ccflags-y += -DCONFIG_START_FROM_BOOTROM
ccflags-y += -DCONFIG_PMIC_SETTING
ccflags-y += -DCONFIG_VRF_DCDC_MODE
ccflags-y += -DCONFIG_ROM_PATCH_EN
ccflags-y += -DCONFIG_RWNX_RADAR
ccflags-y += -DCONFIG_RWNX_BCMC
ccflags-y += -DNX_TXQ_CNT=5
ccflags-y += -DCONFIG_USER_MAX=1
ccflags-y += -DCONFIG_RWNX_DBG
ccflags-y += -DUSE_5G
ccflags-y += -DCONFIG_TXRX_THREAD_PRIO
ccflags-y += -DCONFIG_SUPPORT_REALTIME_CHANGE_MAC
ccflags-y += -DCONFIG_PREALLOC_TXQ
ccflags-y += -DCONFIG_DPD -DCONFIG_FORCE_DPD_CALIB
ccflags-y += -DCONFIG_FILTER_TCP_ACK
ccflags-y += -DCONFIG_RESV_MEM_SUPPORT
ccflags-y += -DCONFIG_SHUTDOWN_CALLBACK
ccflags-y += -DCONFIG_MCC
ccflags-y += -DCONFIG_RFTEST
ccflags-y += -DCONFIG_RX_NETIF_RECV_SKB
ccflags-y += -DAICWF_RX_REORDER
ccflags-y += -DAICWF_ARP_OFFLOAD
# FW/IPC sizing (vendor 8800DCDW u02 variant)
ccflags-y += -DNX_VIRT_DEV_MAX=4
ccflags-y += -DNX_REMOTE_STA_MAX_FOR_OLD_IC=10
ccflags-y += -DNX_REMOTE_STA_MAX=32
ccflags-y += -DNX_MU_GROUP_MAX=62
ccflags-y += -DNX_TXDESC_CNT=64
ccflags-y += -DNX_TX_MAX_RATES=4
ccflags-y += -DNX_CHAN_CTXT_CNT=3
ccflags-y += -DDEFAULT_COUNTRY_CODE=\"00\"
ccflags-y += -DAIC_TRACE_INCLUDE_PATH=$(src)
ccflags-y += -I$(srctree)/$(src)/../aic8800_bsp
ccflags-y += -Wno-implicit-fallthrough -Wno-unused-function -Wno-unused-variable
obj-$(CONFIG_AIC8800_WLAN_SUPPORT) += aic8800_fdrv.o
aic8800_fdrv-y := \
rwnx_msg_tx.o \
rwnx_msg_rx.o \
rwnx_utils.o \
rwnx_cmds.o \
rwnx_irqs.o \
rwnx_cfgfile.o \
rwnx_strs.o \
rwnx_rx.o \
rwnx_tx.o \
rwnx_txq.o \
rwnx_main.o \
rwnx_mod_params.o \
rwnx_mesh.o \
rwnx_platform.o \
rwnx_dini.o \
rwnx_v7.o \
ipc_host.o \
rwnx_tdls.o \
aic_vendor.o \
aicwf_compat_8800dc.o \
aicwf_compat_8800d80.o \
rwnx_wakelock.o \
regdb.o \
aic_priv_cmd.o \
aicwf_rx_prealloc.o \
rwnx_radar.o \
sdio_host.o \
aicwf_txrxif.o \
aicwf_sdio.o \
aicwf_tcp_ack.o