From 92905bf4d4f2a319f5fe3006292f929fa8990e7b Mon Sep 17 00:00:00 2001 From: BFE Engineering Date: Tue, 25 Aug 2026 00:34:25 -0600 Subject: [PATCH] =?UTF-8?q?kernel/rv1106:=20M5=20wifi=20VERIFIED=20on=20c8?= =?UTF-8?q?a3=20=E2=80=94=20wlan0=20scan=20works=20(module=20build)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On-hardware proof (self-built 6.18.46, _b slot): aic8800 modules load, download firmware, wlan0 up ([device-mac]), iw scan finds real APs incl. SSID BlueFlare @ -43dBm. RF path fully functional. See wifi/VERIFIED-on-c8a3.md. Two changes from the initial built-in attempt: - Built-in =y DEADLOCKS: aicbsp_init's eager SDIO bring-up (device_initcall, sequential) blocks the dw_mmc controller probe that would enumerate the card it waits for (aicsdio.c:597 2s down_timeout -> unregister). Converted to modules (=m): AIC_WLAN_SUPPORT bool->tristate; loaded late, after the mmc-pwrseq enumerates the card — the vendor-proven flow. - Restored fdrv's own md5.o (each .ko needs its own MD5; bsp doesn't export it). Refreshed kbuild snapshot accordingly. Kernel-size fix (CONFIG_KERNEL_GZIP -> XZ): the wifi kernel's 12.12MB gzip zImage overran U-Boot's DTB-at-0xc00000 load boundary (Sysmem Error, FLARE-AB fell back to _a). XZ -> 8.15MB, ~4MB headroom; also correct for a firmware kernel. Uncompressed Image ~30MB but the ARM decompressor relocates the FDT at runtime, so only the U-Boot load-time overlap mattered. DRIVER-PARITY: wifi ✅ M5; BT 🔨 (module built, HCI not yet exercised). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf --- kernel/rv1106-enablement/DRIVER-PARITY.md | 4 +- .../wifi/VERIFIED-on-c8a3.md | 44 +++++++++++++++++++ .../wifi/kbuild/aic8800/Kconfig | 17 ++++--- .../wifi/kbuild/aic8800/aic8800_fdrv/Makefile | 14 +++--- 4 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 kernel/rv1106-enablement/wifi/VERIFIED-on-c8a3.md diff --git a/kernel/rv1106-enablement/DRIVER-PARITY.md b/kernel/rv1106-enablement/DRIVER-PARITY.md index 605d3ba..d56294d 100644 --- a/kernel/rv1106-enablement/DRIVER-PARITY.md +++ b/kernel/rv1106-enablement/DRIVER-PARITY.md @@ -33,8 +33,8 @@ c8a3, not just compiled. | RGB666 720×720 panel | — | panel-dpi | 🔨 probes; bus_format + connector WIP | | GT911 touch (goodix) | goodix, gt911 | mainline | ⬜ M4 (needs GPIO_SYSFS ✅ + node) | | GPIO_SYSFS / crypto / CFG80211 | — | mainline (config) | ✅ =y (batch2) | -| AIC8800 wifi (bsp/fdrv) | aic8800_* | **out-of-tree** | ⬜ M5 | -| AIC8800 BT (btlpm) | aic8800_btlpm | **out-of-tree** | ⬜ M5 | +| AIC8800 wifi (bsp/fdrv) | aic8800_* | **out-of-tree** | ✅ M5 — wlan0 up, scanned the site AP at −43dBm (modules, `wifi/VERIFIED-on-c8a3.md`) | +| AIC8800 BT (btlpm) | aic8800_btlpm | **out-of-tree** | 🔨 module built (6.18 vermagic); HCI bring-up not yet exercised | | NPU (rknpu, ff660000) | rknpu, ff660000.npu | **out-of-tree** | ⬜ M6 — plan: `npu/PORT-PLAN.md` | | RGA 2D (rga2) | rga2 | ported (vendor char-dev) | ✅ /dev/rga, hw 3.3.87975 | | I2S audio (i2s-tdm) | i2s | rv1126 fallback | 🔨 DAI built; needs acodec+card | diff --git a/kernel/rv1106-enablement/wifi/VERIFIED-on-c8a3.md b/kernel/rv1106-enablement/wifi/VERIFIED-on-c8a3.md new file mode 100644 index 0000000..dc16636 --- /dev/null +++ b/kernel/rv1106-enablement/wifi/VERIFIED-on-c8a3.md @@ -0,0 +1,44 @@ +# AIC8800 wifi — VERIFIED on warden-c8a3 (self-built 6.18.46), 2026-08-25 + +**Result: wifi works end-to-end on our self-built Linux 6.18.46.** Modules built +from the ported source (vermagic `6.18.46 SMP mod_unload ARMv7 p2v8`), loaded on +the panel, downloaded firmware to the AIC8800DC, created `wlan0`, and completed a +live RF scan. + +## Evidence (serial console, _b slot = our 6.18 kernel) +- `insmod aic8800_bsp.ko` → firmware download OK: `aicwf_patch_config_8800dc done`, + `Start app: 00120000`, BSP_RC=0. +- `insmod aic8800_fdrv.ko` → `ieee80211 phy0: HT supp 1, VHT supp 1, HE supp 1`, + FDRV_RC=0. +- `wlan0: ... link/ether [device-mac]` +- `iw dev wlan0 scan` found real APs: + - **the site AP [bssid] 2412 MHz −43 dBm** + - a neighboring guest AP [bssid] 2412 MHz −73 dBm + - +several more, correct signal strengths → RF path fully functional. + +## Why MODULES, not built-in (=y) +Built-in device_initcalls run BEFORE the dw_mmc/SDIO controller probes. Initcalls +are sequential: `aicbsp_init` blocked 3.3–7.5 s doing the eager chip bring-up, and +the mmc controller only probed at 7.9 s (SDIO card at 8.2 s) — AFTER aicbsp had +already given up (`aicsdio.c:597` 2 s `down_timeout` → `sdio_unregister_driver`). +Extending the timeout can't help (aicbsp blocks the very mmc probe that would +enumerate the card — a deadlock). Loaded as modules AFTER boot (mmc up, card at +4 s), `insmod aic8800_bsp` registers the SDIO driver against an already-present +card → probe fires immediately → firmware download → fdrv → wlan0. This is the +vendor-proven flow. + +## Kernel-size fix (needed to boot the wifi kernel at all) +The wifi kernel grew the gzip zImage to 12.12 MB; rockchip U-Boot loads the kernel +blob at 0x8000 and relocates the DTB to 0xc00000 (12 MB), so a >~11.95 MB zImage +overruns the FDT at U-Boot load time (`Sysmem Error: KERNEL overlap with FDT`) and +FLARE-AB falls back to _a. Switched `CONFIG_KERNEL_GZIP` → `CONFIG_KERNEL_XZ`: +zImage 12.12 MB → 8.15 MB (module build), ~4 MB headroom under the FDT. Also the +right call for a firmware kernel. (Uncompressed Image is ~30 MB; the ARM +decompressor relocates the FDT at runtime, so only the U-Boot LOAD-time overlap +mattered — proven by the kernel booting once the zImage fit.) + +## Boot-time auto-load (follow-up, deployment layer — not the kernel port) +Modules were insmod'd manually for this verify. Production auto-load needs a +loader that inserts `aic8800_bsp.ko` → `aic8800_fdrv.ko` (→ `aic8800_btlpm.ko`) in +order from wherever they're staged; the vendor `insmod_wifi.sh` references a +different variant (`aic_load_fw.ko`/`bcmdhd.ko`, absent here). Track in the rootfs. diff --git a/kernel/rv1106-enablement/wifi/kbuild/aic8800/Kconfig b/kernel/rv1106-enablement/wifi/kbuild/aic8800/Kconfig index 9e37be9..f6bef83 100644 --- a/kernel/rv1106-enablement/wifi/kbuild/aic8800/Kconfig +++ b/kernel/rv1106-enablement/wifi/kbuild/aic8800/Kconfig @@ -5,15 +5,22 @@ # 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. +# Modules (=m), loaded late by /oem/usr/ko/insmod_wifi.sh: the AIC8800 SDIO +# bring-up is two-stage (bsp downloads firmware, chip re-enumerates, fdrv +# attaches). Built-in device_initcalls run BEFORE the dw_mmc/SDIO controller +# probes — initcalls are sequential, so aicbsp_init blocks [3.3-7.5]s while the +# mmc controller only probes at [7.9]s afterward, and the eager bring-up +# deadlocks (it waits for a card the blocked mmc probe hasn't enumerated). +# Late module load, after the mmc-pwrseq enumerates the card, is the +# vendor-proven flow. See PORT-PROGRESS.md. config AIC_WLAN_SUPPORT - bool "AIC wireless Support" - default y + tristate "AIC wireless Support" + default m help This is support for the AIC wireless chip (AIC8800DC SDIO combo - wifi+BT on the WardenOS 86-Panel). + wifi+BT on the WardenOS 86-Panel). Build as a module (m); built-in + deadlocks the two-stage SDIO bring-up (see note above). config AIC_FW_PATH depends on AIC_WLAN_SUPPORT diff --git a/kernel/rv1106-enablement/wifi/kbuild/aic8800/aic8800_fdrv/Makefile b/kernel/rv1106-enablement/wifi/kbuild/aic8800/aic8800_fdrv/Makefile index 8c0ba85..26138f0 100755 --- a/kernel/rv1106-enablement/wifi/kbuild/aic8800/aic8800_fdrv/Makefile +++ b/kernel/rv1106-enablement/wifi/kbuild/aic8800/aic8800_fdrv/Makefile @@ -10,12 +10,13 @@ # 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. +# md5.o: fdrv carries its OWN copy (vendor ships md5.c in both aic8800_bsp/ and +# aic8800_fdrv/). As separate modules each .ko needs its own MD5 — bsp does not +# EXPORT_SYMBOL(MD5Init/...), so fdrv.ko cannot resolve them from aic8800_bsp.ko +# (modpost: "MD5Final undefined"). The two copies are byte-identical and live in +# separate module namespaces, so there is no collision. (When these were briefly +# built =y this object was dropped to avoid a vmlinux multiple-definition; the +# module build restores it.) ccflags-y += -DCONFIG_RWNX_FULLMAC ccflags-y += -DAICWF_SDIO_SUPPORT @@ -60,6 +61,7 @@ ccflags-y += -Wno-implicit-fallthrough -Wno-unused-function -Wno-unused-variable obj-$(CONFIG_AIC8800_WLAN_SUPPORT) += aic8800_fdrv.o aic8800_fdrv-y := \ + md5.o \ rwnx_msg_tx.o \ rwnx_msg_rx.o \ rwnx_utils.o \