Skip to content

WCN3990 wifi: device-matched wlanmdsp and SOM-tuned board data - #126

Merged
greatgitsby merged 2 commits into
commaai:masterfrom
greatgitsby:wifi-userspace-c
Jul 4, 2026
Merged

WCN3990 wifi: device-matched wlanmdsp and SOM-tuned board data#126
greatgitsby merged 2 commits into
commaai:masterfrom
greatgitsby:wifi-userspace-c

Conversation

@greatgitsby

@greatgitsby greatgitsby commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

fixes the 5GHz crashing seen during comma hack, working on home network

The generic linux-firmware wlanmdsp.mbn (WLAN.HL.2.0-01387-QCAHLSWMTPLZ-1,
2018-07-19) crashes the WLAN Q6/DSP on 5 GHz DFS channels with
'halphy_caldb.c:3021: Assertion 0 failed', producing the ath10k
'failed to synchronize setup for vdev 0 restart 0: -110' / vdev-start
failure loop. 2.4 GHz is unaffected.

wlanmdsp.mbn is the vendor-signed WLAN firmware image sideloaded to the
modem DSP via tqftpserv; per the ath10k list it is signed for a specific
SoC/device and the generic linux-firmware copy is not calibration-matched
to this board's RF, so its 5 GHz PHY cal DB asserts. Board data is not the
cause: the board-2.bin entry ath10k selects
(bus=snoc,qmi-board-id=ff,qmi-chip-id=30214) is already byte-identical to
the device's /firmware/image/bdwlan.bin.

Replace the embedded wlanmdsp.mbn with the device's own downstream image
(WLAN.HL.2.0.c10-00459-QCAHLSWMTPLZ-1, from /firmware/image/wlanmdsp.mbn).
firmware-5.bin and board-2.bin are unchanged (same WLAN.HL.2.0 interface
descriptor). No config change: the EXTRA_FIRMWARE path is identical, only
the blob contents differ. This blob also feeds the rootfs /lib/firmware
copy via the Dockerfile, so both the built-in and userspace copies match.
5 GHz DFS vdev start still crashed the WLAN DSP (halphy_caldb.c:3026
assert) after the wlanmdsp swap. Root cause: wrong board/cal data.
Mainline was serving the generic default board-2.bin entry
(bus=snoc,qmi-board-id=ff,qmi-chip-id=30214 == generic bdwlan.bin),
but AGNOS does NOT use bdwlan.bin: comma ships RF-tuned board files
in /usr/comma/wlan/ (bdwlan.b00, bdwlan.b01, agnos-builder PRs #199
'Custom bdwlan per SOM type' and #377 'B01 wlan config') and patches
cnss_daemon to select /usr/comma/wlan/bdwlan.b%02x by the SOM id read
from /sys/.../vendor:gpio-som-id/som_id (4 GPIO straps, tlmm 105-108,
bit0 first; driver: agnos-kernel-sdm845 gpio_som_id.c). The legacy
mici DT has no wlan board-id; QMI board_id is 0xff on both stacks.

mici SOM id determined as 1 -> bdwlan.b01: tlmm gpio105 (bit0) reads 1
against a pull-down (hard-strapped high) while gpio106-108 read 0;
only b00/b01 exist, so id=1 is the only consistent hit. bdwlan.b01
differs from generic bdwlan.bin in 298 bytes (RF/cal tuning).

Implementation:
- append two variant-keyed entries to board-2.bin (upstream entries
  untouched):
    bus=snoc,...,qmi-chip-id=30214,variant=comma-mici -> bdwlan.b01
    bus=snoc,...,qmi-chip-id=30214,variant=comma-tizi -> bdwlan.b00
- set qcom,calibration-variant in each board's &wifi DT node; 6.18
  ath10k_core_check_dt picks it up and tries the variant name first.

tizi->b00 mapping is inferred from PR ordering (b00 predates b01);
tizi was unreachable to verify its SOM id. mici is verified as above.

Watch on flash-test dmesg: 'board_file api 2' with non-zero crc32,
no halphy_caldb assert, vdev 0 starts on freq 5500.
@greatgitsby
greatgitsby marked this pull request as ready for review July 4, 2026 01:40
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

vamOS System Profile

Changes vs master

Metric Change
Used space 3437.5MB → 3437.2MB (-.2MB)
Sparse image 3392.3MB → 3392.0MB (-.2MB)
Package count 524 → 524
Directory size changes (>1MB)
Directory Change

Metric Value
Used space 3437.2MB / 5959.5MB
Files 56143
Directories 4762
Symlinks 3589
Packages 524

Top 10 Directories

Directory Size

Category Breakdown

Category Size %
xbps packages 2502.8MB 72.8%
Python venv 591.7MB 17.2%
Firmware 11.2MB .3%
Other 331.3MB 9.6%

Top 10 Packages by Size

Package Size
mit-krb5-libs-1.21.3_1 270.4MB
gawk-5.3.2_1 210.3MB
llvm-21_3 148.6MB
libldns-1.9.2_1 124.3MB
pd-mapper-1.0_1 73.9MB
libclang21-21.1.7_1 70.2MB
glib-2.88.0_1 67.4MB
gcc-14.2.1+20250405_4 66.6MB
libcap-progs-2.78_1 56MB
cmake-4.2.2_2 53.2MB

Top 30 Files by Size

File Size
/usr/lib/llvm/21/lib/libLLVM.so.21.1 124.3MB
/usr/lib/llvm/21/lib/libMLIR.so.21.1 89.7MB
/usr/lib/llvm/21/bin/mlir-transform-opt 82.9MB
/usr/lib/llvm/21/lib/libclang-cpp.so.21.1 56MB
/usr/lib/llvm/21/bin/mlir-translate 53.2MB
/usr/bin/uv 52.6MB
/usr/lib/llvm/21/bin/llvm-exegesis 52MB
/usr/lib/llvm/21/bin/llvm-bolt-binary-analysis 50.6MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/gnat1 40.1MB
/usr/bin/gdb 39.1MB
/usr/lib/libgallium-26.1.3.so 37.7MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/cc1plus 37.3MB
/usr/lib/libllvm-qcom.so 35.2MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/cc1 35.2MB
/usr/lib/libRusticlOpenCL.so.1.0.0 34.3MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/lto1 33.9MB
/usr/bin/lto-dump 33.9MB
/usr/local/venv/bin/ruff 31.8MB
/usr/share/icu/78.3/icudt78l.dat 31.5MB
/usr/lib/llvm/21/lib/libclang.so.21.1.7 30.2MB
/usr/lib/llvm/21/bin/c-index-test 28.6MB
/usr/local/venv/lib/python3.12/site-packages/gcc_arm_none_eabi/toolchain/libexec/gcc/arm-none-eabi/13.2.1/cc1 28.2MB
/usr/lib/libz3.so 27.9MB
/usr/bin/run 26.7MB
/usr/local/venv/lib/python3.12/site-packages/numpy.libs/libscipy_openblas64_-71e1b124.so 23.6MB
/usr/comma/updater 23.5MB
/usr/comma/setup 23.5MB
/usr/comma/reset 23.5MB
/usr/local/uv/python/cpython-3.12.13-linux-aarch64-gnu/bin/python3.12 22.2MB
/usr/local/uv/python/cpython-3.12.13-linux-aarch64-gnu/lib/libpython3.12.so.1.0 22.1MB

@greatgitsby
greatgitsby merged commit 9869d6e into commaai:master Jul 4, 2026
4 checks passed
@greatgitsby
greatgitsby deleted the wifi-userspace-c branch July 4, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant