diff --git a/README.md b/README.md index 1805498..e4940dc 100644 --- a/README.md +++ b/README.md @@ -33,15 +33,20 @@ login. Root is locked. | Works out of the box | Needs firmware from Windows | Not supported | |---------------------------------|-----------------------------|---------------| -| UFS storage, USB, keyboard, touchpad, touchscreen | Audio | LTE modem | -| WiFi + Bluetooth (ath10k WCN3990) | Sensor hub — lid switch, accelerometer, auto-rotate | | -| Graphics (freedreno, Adreno 630) | Hardware video decode (venus) | | -| Battery and charging | | | +| UFS storage, USB, keyboard, touchpad, touchscreen | Graphics (Adreno 630 zap shader) | LTE modem | +| WiFi + Bluetooth (ath10k WCN3990) | Audio | | +| Battery and charging | Sensor hub — lid switch, accelerometer, auto-rotate | | +| Display (unaccelerated) | Hardware video decode (venus) | | -Qualcomm allows the Adreno and ath10k firmware to be redistributed, so Fedora -ships it and this image includes it. The SDM850 DSP and display blobs are signed -per model and exist only in your machine's Windows partition. Run -`sudo c630-firmware` once after installing — see [docs/firmware.md](docs/firmware.md). +Fedora ships everything Qualcomm permits to be redistributed, which covers +WiFi and Bluetooth outright. Graphics is the awkward case: the generic Adreno +pieces (`a630_gmu.bin`, `a630_sqe.fw`) are packaged, but the C630's device tree +asks for a **model-signed** zap shader, `qcdxkmsuc850.mbn`, which exists only in +your machine's Windows partition — Fedora's generic `sdm845/a630_zap.mbn` is not +what this device requests. Audio, sensors and video decode are the same story. + +Run `sudo c630-firmware` once after installing — see +[docs/firmware.md](docs/firmware.md) for the full list and a manual fallback. ## Building diff --git a/config/packages/base.pkgs b/config/packages/base.pkgs index 9735605..825ae99 100644 --- a/config/packages/base.pkgs +++ b/config/packages/base.pkgs @@ -13,10 +13,14 @@ kernel-modules kernel-modules-extra linux-firmware -# qcom-firmware carries the Adreno 630 bits (a630_gmu.bin, a630_sqe.fw, -# sdm845/a630_zap.mbn) that freedreno needs for accelerated graphics. -# atheros-firmware carries ath10k WCN3990 including wlanmdsp.mbn, so WiFi -# works without touching the Windows partition. +# atheros-firmware carries ath10k WCN3990 including wlanmdsp.mbn, so WiFi and +# Bluetooth work without touching the Windows partition. +# +# qcom-firmware carries the generic Adreno 630 bits (a630_gmu.bin, a630_sqe.fw). +# Necessary but not sufficient: the C630's device tree asks for a model-signed +# zap shader, qcom/sdm850/LENOVO/81JL/qcdxkmsuc850.mbn, which only exists in the +# machine's Windows partition. Fedora's generic sdm845/a630_zap.mbn is a +# different device's file and will not be loaded. See docs/firmware.md. qcom-firmware atheros-firmware diff --git a/docs/firmware.md b/docs/firmware.md index a3ec1ab..82bf20b 100644 --- a/docs/firmware.md +++ b/docs/firmware.md @@ -10,27 +10,66 @@ installs them: | Package | Files | Enables | |---|---|---| -| `qcom-firmware` | `qcom/a630_gmu.bin`, `qcom/a630_sqe.fw`, `qcom/sdm845/a630_zap.mbn` | Adreno 630 — accelerated graphics via freedreno | | `atheros-firmware` | `ath10k/WCN3990/hw1.0/{firmware-5.bin,board-2.bin,wlanmdsp.mbn}` | WiFi and Bluetooth | +| `qcom-firmware` | `qcom/a630_gmu.bin`, `qcom/a630_sqe.fw` | The generic half of the Adreno 630 — necessary but not sufficient | -So graphics and networking work on a freshly written image with no extra steps. +Networking therefore works on a freshly written image. Graphics does not: see +below. ## What has to come off the Windows partition -The SDM850's DSP and display firmware is signed against per-model keys. Nobody -can redistribute it, and it exists on your machine only inside its Windows -install: +These are signed against per-model keys, so nobody can redistribute them and +they exist on your machine only inside its Windows install. The list is not a +guess — it is every `firmware-name` property in the mainline device tree, +`arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts`: -| File | Enables | -|---|---| -| `qcadsp850.mbn` | Audio DSP — speakers, microphone | -| `qccdsp850.mbn` | Compute DSP — sensor hub, so lid switch, accelerometer, auto-rotate | -| `qcdxkmsuc850.mbn` | Display/UEFI secure code | -| `qcdsp1v2850.mbn`, `qcdsp2850.mbn` | Modem DSP stages | -| `ipa_fws.elf` | IPA — needed by the modem path | +| File | Device tree node | Lost without it | +|---|---|---| +| `qcdxkmsuc850.mbn` | `gpu_zap_shader` | **Accelerated graphics** | +| `qcadsp850.mbn` | `adsp_pas` | Audio — speakers, microphone | +| `qcslpi850.mbn` | `slpi_pas` | Sensor hub — lid switch, accelerometer, auto-rotate | +| `qccdsp850.mbn` | `cdsp_pas` | Compute DSP offload | +| `qcvss850.mbn` | `venus` | Hardware video decode | +| `qcdsp1v2850.mbn` | `mss_pil` | Modem, stage 1 | +| `qcdsp2850.mbn` | `mss_pil` | Modem, stage 2 | +| `ipa_fws.elf` | `ipa` | IPA datapath, needed by the modem | They belong under `/lib/firmware/updates/qcom/sdm850/LENOVO/81JL/`. +The GPU one is worth calling out, because it is easy to assume otherwise: +Fedora does ship an `sdm845/a630_zap.mbn`, but that is the generic +Snapdragon 845 zap shader and **not** what this device asks for. The C630's +device tree names `qcom/sdm850/LENOVO/81JL/qcdxkmsuc850.mbn` specifically, so +until you supply it you get an unaccelerated display. + +Each file is independent, so a partial recovery is still worth having — +`qcdxkmsuc850.mbn` on its own buys you working graphics. + +## Finding them on a backup + +If Windows is long gone from the machine but you kept a copy of the files, one +search catches all eight, since seven share a suffix: + +```sh +find /mnt/backup -type f \ + \( -iname 'qc*850.mbn' -o -iname 'ipa_fws.elf' -o -iname 'bdwlan*.bin' \) \ + -printf '%10s %p\n' +``` + +They originally lived in `C:\Windows\System32\DriverStore\FileRepository\`, in +directories named `qcdx850.inf_arm64_*` and `qcadsp*.inf_arm64_*`. If the loose +files turn up nothing, look for those directories wholesale: + +```sh +find /mnt/backup -type d -iname 'qc*.inf_arm64_*' +``` + +Expect a few hundred KB to a few MB each. `file` reports them as `data` — they +are signed Qualcomm MBN containers, not ELF, apart from `ipa_fws.elf`. + +Lenovo does not appear to publish a driver package for the 81JL containing +these, so an old backup or a surviving Windows partition are the only routes. + ## Extracting them The image ships Fedora's `qcom-firmware-extract`. Run it once: diff --git a/docs/install.md b/docs/install.md index a85d2eb..5c6803f 100644 --- a/docs/install.md +++ b/docs/install.md @@ -4,8 +4,8 @@ Leave Windows in place. Lenovo ships firmware updates only through Windows, and the per-model Qualcomm blobs Linux needs live in that partition — wiping it -means losing audio and the sensor hub permanently. Update everything through -Lenovo Vantage first. +means losing accelerated graphics, audio and the sensor hub permanently. +Update everything through Lenovo Vantage first. Disable Secure Boot. The image is not signed for it: @@ -37,7 +37,8 @@ grows the root partition. Several minutes on a USB stick is normal. Log in as ## Extract the Qualcomm firmware -Audio, the sensor hub and video decode do not work until you do this: +Accelerated graphics, audio, the sensor hub and video decode do not work +until you do this: ```sh sudo c630-firmware diff --git a/overlay/etc/motd.d/c630.in b/overlay/etc/motd.d/c630.in index d1be7a0..8884f8b 100644 --- a/overlay/etc/motd.d/c630.in +++ b/overlay/etc/motd.d/c630.in @@ -1,7 +1,7 @@ Fedora @FEDORA_RELEASE@ for the @DEVICE_DESC@ (built @BUILD_DATE@ from @BUILD_REF@) - Graphics and WiFi work with the firmware Fedora ships. Audio, the sensor - hub and hardware video decode need per-model blobs from the Windows - partition — run `sudo c630-firmware` once to extract them. + WiFi and Bluetooth work with the firmware Fedora ships. Accelerated + graphics, audio, the sensor hub and video decode all need per-model blobs + from the Windows partition — run `sudo c630-firmware` once to extract them. diff --git a/overlay/usr/local/sbin/c630-firmware b/overlay/usr/local/sbin/c630-firmware index 235f21b..04b677b 100755 --- a/overlay/usr/local/sbin/c630-firmware +++ b/overlay/usr/local/sbin/c630-firmware @@ -2,14 +2,18 @@ # # Pull the model-specific Qualcomm blobs off this machine's Windows partition. # -# Fedora ships everything for the C630 that Qualcomm allows to be redistributed -# — Adreno 630 (graphics) and ath10k WCN3990 (WiFi/Bluetooth) both work out of -# the box. What it cannot ship is the per-model signed firmware: the ADSP, the -# compute DSP, and the display/UEFI blob. Those are signed against this -# machine's own keys and live only in its Windows install. +# 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 them you lose audio, the sensor hub (lid switch, accelerometer, -# auto-rotate) and hardware video decode. Everything else still works. +# 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