Files
c630/overlay/usr/local/sbin/c630-firmware
rob thijssen b05c982a77
Some checks failed
build image / build (push) Has been cancelled
Write up the onboard WiFi investigation, and ship the services it needs
aarch64-laptops' support table ticks WiFi for this machine, so the path exists.
Following their WiFi README got considerably further and then stopped somewhere
useful to have documented.

Two of the four services they list are in the kernel now (pd-mapper, qrtr-ns).
The other two, rmtfs and tqftpserv, are packaged in Fedora and shipped
disabled — tqftpserv was not even installed. Both are now in base.pkgs and
enabled by stage2. Enabling them took qrtr-lookup from 19 registered services
to 25; a working setup is said to show around 40.

The step worth having written down: the modem does not read wlanmdsp.mbn from
/lib/firmware. It asks tqftpserv for it over TFTP, from
/lib/firmware/readonly/firmware/image/. Nothing reports this as an error —
ath10k_snoc binds, registers a QMI client, and waits forever for a service that
never registers. c630-firmware now places the file there, and creates the
writable area the modem asks tqftpserv for.

Where it stops: the modem boots and dies at "RF stuck in QLINK start state",
about every 42 seconds, never reaching the point of requesting wlanmdsp. Three
firmware pairings give three distinct failures, recorded in the doc — the _nm
"no modem" variants, which are the obvious idea and would skip cellular RF
entirely, turn out not to be signed for this device.

The result that narrows it: aarch64-laptops' own wifi directory carries the
qcdsp1v2850.mbn, qcdsp2850.mbn and wlanmdsp.mbn from the setup whose table ticks
WiFi. All three differ from the WOA-Project copies. Installed here with the
services running and wlanmdsp in the TFTP path, they produce the identical QLINK
failure — so it is neither the firmware nor the userspace. What is left is the
kernel: 5.x from 2019 there against 7.1.5 here, with both of their ath10k
patches long since upstream. That points at a regression, and confirming it
means a bisect rather than another file.

Also record what is untried: the other eight driver versions (this machine's
UEFI is from 2019 and the newest package may be the wrong vintage),
mcfg_subsys_ext850.cab, and building board-2.bin from the C630's own bdwlan.*
files.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWRjNJMistCy6ngXH5aJLS
2026-07-28 08:52:08 +03:00

83 lines
3.2 KiB
Bash
Executable File

#!/usr/bin/bash
#
# Pull the model-specific Qualcomm blobs off this machine's Windows partition.
#
# Fedora ships everything for the C630 that Qualcomm allows to be
# redistributed, which covers ath10k WCN3990 (WiFi/Bluetooth) outright. What it
# cannot ship is the per-model signed firmware, which is signed against this
# machine's own keys and lives only in its Windows install.
#
# Without those you lose accelerated graphics, audio, the sensor hub (lid
# switch, accelerometer, auto-rotate) and hardware video decode.
#
# Graphics is the surprising one. The generic Adreno 630 pieces are packaged,
# but this device's tree asks for a model-signed zap shader —
# qcom/sdm850/LENOVO/81JL/qcdxkmsuc850.mbn — and Fedora's generic
# sdm845/a630_zap.mbn is a different device's file.
set -euo pipefail
if [ "$(id -u)" -ne 0 ]; then
echo "c630-firmware: needs root — try: sudo c630-firmware" >&2
exit 1
fi
echo "Looking for a Windows installation to extract firmware from..."
echo
if ! command -v qcom-firmware-extract >/dev/null; then
echo "qcom-firmware-extract is not installed. Install it with:" >&2
echo " sudo dnf install qcom-firmware-extract" >&2
exit 1
fi
qcom-firmware-extract "$@"
echo
# Only the GPU zap shader has to travel in the initramfs. msm_dpu probes around
# six seconds in, while the initramfs is still the root filesystem, and never
# retries. Everything else — ADSP, CDSP, SLPI, venus, modem — is probed well
# after the real root is mounted and loads from there quite happily.
#
# This matters: qcdsp2850.mbn alone is 60MB. Globbing the whole directory into
# the initramfs, which is what this used to do, would have bloated it roughly
# twentyfold to no purpose.
FW_DIR=/usr/lib/firmware/updates/qcom/sdm850/LENOVO/81JL
if [ -f "${FW_DIR}/qcdxkmsuc850.mbn" ]; then
printf 'install_items+=" %s/qcdxkmsuc850.mbn "\n' "$FW_DIR" \
> /etc/dracut.conf.d/20-c630-zap-shader.conf
echo "GPU zap shader will be included in the initramfs."
fi
# The modem does not read wlanmdsp.mbn from /lib/firmware directly — it asks
# tqftpserv for it by path. Without this, onboard WiFi cannot start even with
# every other file in place, and nothing says so: ath10k_snoc simply waits
# forever for a QMI service that never registers. It also wants somewhere
# writable. See docs/firmware.md.
if [ -f "${FW_DIR}/wlanmdsp.mbn" ]; then
install -D -o root -g root -m 644 \
"${FW_DIR}/wlanmdsp.mbn" /lib/firmware/readonly/firmware/image/wlanmdsp.mbn
mkdir -p /lib/firmware/readwrite/ota_firewall
: > /lib/firmware/readwrite/ota_firewall/ruleset
chmod -R 0777 /lib/firmware/readwrite
echo "Placed wlanmdsp.mbn where tqftpserv will serve it to the modem."
fi
echo "Regenerating the initramfs..."
dracut --force --regenerate-all
cat <<'EOF'
Done. Reboot to pick up the new firmware.
If qcom-firmware-extract could not find the Windows partition, mount it by hand
and point the tool at it:
sudo mkdir -p /mnt/windows
sudo mount /dev/disk/by-partlabel/Windows /mnt/windows # adjust as needed
sudo qcom-firmware-extract --windows-dir /mnt/windows
See docs/firmware.md in the c630 repo for the full file list and the manual
fallback if the tool does not recognise this model.
EOF