qcom: implement DTB UEFI capsule update with post-boot verification - #111
Open
guanquan (GuanquanTian) wants to merge 1369 commits into
Open
guanquan (GuanquanTian) wants to merge 1369 commits into
guanquan (GuanquanTian) wants to merge 1369 commits into
Conversation
Unlike the CPU, the GPU does not throttle its speed automatically when it reaches high temperatures. Set up GPU cooling by throttling the GPU speed when reaching 115°C. Signed-off-by: Aastha Pandey <aastha.pandey@oss.qualcomm.com> (cherry picked from commit ce608bd50df182f40501ca742697cbb5caed22d6)
Enable USB configfs support for UVC (USB Video Class) and UAC2 (USB Audio Class 2) function drivers in the Qualcomm ARM64 defconfig. This allows the platform to expose video and audio gadget functions via configfs, enabling use cases such as USB camera and audio device emulation over gadget mode. These options are required for test and development scenarios involving multimedia streaming over USB. Signed-off-by: Pratham Pratap <pratham.pratap@oss.qualcomm.com> (cherry picked from commit c8f71c6be43ccb516c7f1840b0b874c9b0e4fe3d)
… panel" This reverts commit 7aa3e6667b315fae478317d505b75023a51360b6. Shikra-IQS-EVK needs DSI-HDMI in place of DSI Panel. Signed-off-by: Mohit Dsor <mdsor@qti.qualcomm.com> (cherry picked from commit 4639d6f4464970b5147fdedb8a117e25246201c5)
This reverts commit 872330a93c804b1c2afede355d49f64a29e91f2d. Shikra-IQS-EVK needs DSI-HDMI in place of DSI Panel. Signed-off-by: Mohit Dsor <mdsor@qti.qualcomm.com> (cherry picked from commit e5fd4c5dab8aba0b182e60f15edcaf0b9bcd278d)
Added lt9611uxd node to iqs evk board and done changes like regulators and gpios needed for it. Signed-off-by: Mohit Dsor <mdsor@qti.qualcomm.com> (cherry picked from commit 9896f69f0a1205466ce2703a95a21f53b55968b8)
Add Last Level Cache table and configs for the Shikra SoC. Signed-off-by: Komal Bajaj <komal.bajaj@oss.qualcomm.com> (cherry picked from commit c4f07b31a7fecd9971bdfe09842de83e45b1f609)
Set ice clk rate from sdhci msm platform driver, needed for target which are having legacy ice support, and need sdhci msm platform driver to set rate. Link: https://lore.kernel.org/all/20260529081045.2877910-2-ram.gupta@oss.qualcomm.com/ Signed-off-by: Ram Prakash Gupta <ram.gupta@oss.qualcomm.com> Signed-off-by: Pradeep P V K <pradeep.pragallapati@oss.qualcomm.com> (cherry picked from commit 02b47c255b4029dd2da14e3351f46ccf40ce4194)
Switch WiFi supply nodes to PMU regulators and move power control from driver to pwrseq, aligning with the Bluetooth power model. Also remove unused dummy WLAN 3.3V regulator. Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com> (cherry picked from commit 94eb471718d95c27e31f0c7edf5a206aa704fa12)
Add PSCI SYSTEM_RESET2 reboot-modes for sm8750-mtp and sm8750-qrd for use by the psci-reboot-mode driver. The following modes are defined: - bootloader: reboot into fastboot mode for fastboot flashing. - edl: reboot into emergency download mode for image loading via the Firehose protocol. Link: https://lore.kernel.org/r/20260529-psci_sys_reset-dt-changes-for-pakala-v2-1-1964ebf1924c@oss.qualcomm.com Signed-off-by: Anurag Pateriya <anurag.pateriya@oss.qualcomm.com> (cherry picked from commit d7f29faab25794e50a846cbae1bc4bd450c80c14)
Add reboot-mode child nodes to shikra-evk.dtsi to configure fastboot (mode-bootloader) and EDL (mode-edl) reboot modes, since all EVK board DTS files include this shared DTSI. Signed-off-by: Anurag Pateriya <apateriy@qti.qualcomm.com> (cherry picked from commit 90df8a960d0300b35f8a7b9bbdc38c4280e32a9a)
PCIe-to-USB bridge UPD720201 does not advertise D3cold support until firmware is loaded post pci enumeration. This results in upd blocking D3cold entry during system suspend and causing overall failure to enter XO shutdown. Hence, add a quirk to advertise D3cold PME capability since the HW actually supports and advertises it post firmware loading. Link: https://lore.kernel.org/all/20260430-d3cold_support-v1-1-6734f280c481@oss.qualcomm.com/ Signed-off-by: Sushrut Shree Trivedi <sushrut.trivedi@oss.qualcomm.com> (cherry picked from commit 2557ced2fdda1e9364140ee861bf5807a331def3)
…rgets eUSB2 targets handle wakeup interrupts differently depending on device speed when operating in host mode. According to the eUSB2 specification, remote wakeup signaling in host mode is detected via different data-line assertions based on the connected device speed. When a low-speed device is connected, the host repeater drives eD+ to logic '1' upon detecting a K-state on the USB lines during remote wakeup (eUSB2 specification, Section 5.5.14). When a full-speed or high-speed device is connected, the host repeater drives eD- to logic '1' upon detecting a K-state on the USB line during remote wakeup (eUSB2 specification, Sections 5.5.15 and 5.5.18). Since the eUSB2 PHY's "DP" and "DM" interrupt lines monitor the eD+ and eD- line states, configure the wakeup interrupts accordingly Link: https://lore.kernel.org/all/20260511094422.3561509-1-krishna.kurapati@oss.qualcomm.com/ Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com> Signed-off-by: Pratham Pratap <pratham.pratap@oss.qualcomm.com> (cherry picked from commit e929e6d4fe8556b3d25732242a7e516947983723)
In order to enable combo mode on CSI1 mode, resources needs to be in shared mode. This change adds required resources under res-mgr node. Signed-off-by: Vadlamani Manjusha <mvadlama@qti.qualcomm.com> (cherry picked from commit b7de1d752e129c1883a76fa496545847834881b4)
Prevent GPIOs managed by pinctrl from being requested and freed via the GPIO framework. Restrict GPIO request/free operations to non-pinctrl GPIOs by adding appropriate conditions. Signed-off-by: Vadlamani Manjusha <mvadlama@qti.qualcomm.com> (cherry picked from commit fc647a8ed68a7d50d7cddc7111014addd57c064f)
Add remoteproc PAS loader for SoCCP with its SMP2P. On Kaanapali, it is brought up by bootloader, so set the status "okay". Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com> Signed-off-by: Yijie Yang <yijie.yang@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260326-knp-soccp-dt-v1-1-a60c2ae36e9b@oss.qualcomm.com (cherry picked from commit 3f9dfdaf6bb96bafb076847406e041ca1efd00cf)
Add SoCCP node on Kaanapali QRD board. Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com> Signed-off-by: Yijie Yang <yijie.yang@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260326-knp-soccp-dt-v1-2-a60c2ae36e9b@oss.qualcomm.com (cherry picked from commit e51c63c4d717fb80bce93d4aada0629754cbb6bf)
Add SoCCP node on Kaanapali MTP board. Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com> Signed-off-by: Yijie Yang <yijie.yang@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260326-knp-soccp-dt-v1-3-a60c2ae36e9b@oss.qualcomm.com (cherry picked from commit dc0c616d6302d39cd49eb3c3df0ba7e517ecfca3)
Add PSCI SYSTEM_RESET2 reboot-modes for kaanapali-mtp and kaanapali-qrd for use by the psci-reboot-mode driver. The following modes are defined: - bootloader: reboot into fastboot mode for fastboot flashing. - edl: reboot into emergency download mode for image loading via the Firehose protocol. Link: https://lore.kernel.org/all/20260529-psci_sys_reset-dt-changes-for-pakala-v1-2-7c32161cf50b@oss.qualcomm.com/ Signed-off-by: Xin Liu <xin.liu@oss.qualcomm.com> Signed-off-by: Anurag Pateriya <anurag.pateriya@oss.qualcomm.com> (cherry picked from commit 0fa62a7f1fc9497b61161a6aef4d1897995e5f84)
…n staging dtso Add CTCU, QDSS replicator, dual ETR (tmc_etr/tmc_etr1), ETR replicator, SWAO replicator, and tmc_etf out-port to complete the DDR memory trace routing path in the kaanapali staging overlay. Signed-off-by: Jie Gan <jie.gan@oss.qualcomm.com> (cherry picked from commit 02b6b2a2375321bbf98042a06371fa5369d55e4c)
…divider Add device tree bindings for the Qualcomm Peripheral Web's PDM GP_MN clock divider. The hardware generates a fractional output frequency from a fixed input clock (typically TCXO4) using the relation Fout = Fin * (M / N), with duty cycle controlled by a separate D register. The clock output is routed over a gpio controlled pin. Link: https://lore.kernel.org/r/20260602-pdm_clk_gp_mnd_v1-v1-1-1522662b6c53@oss.qualcomm.com Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com> (cherry picked from commit b40e7dbd6b5ce988ec22e3428060a77adeb7c5cb)
The PDM (Pulse Density Modulation) hardware block on Qualcomm SoCs contains a GP_MN clock divider that produces a fractional output frequency from a fixed input clock (typically TCXO4): Fout = Fin * (M / N) The hardware encodes the period in the NDIV register as the 1's complement of (N - M), and controls the duty cycle via a separate DUTY register that counts the number of low-phase native clock cycles over the period N. Add a standalone platform driver for this block that uses rational_best_approximation() to find the closest M/N pair within the 9-bit M and 13-bit N hardware limits, programs the MDIV, NDIV, and DUTY registers via regmap, and implements the full clk_ops surface including determine_rate, set_rate, recalc_rate, get_duty_cycle, and set_duty_cycle. The PDM AHB bus clock is gated around every register access. Link: https://lore.kernel.org/r/20260602-pdm_clk_gp_mnd_v1-v1-2-1522662b6c53@oss.qualcomm.com Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com> (cherry picked from commit a832eb6ab586eacf06f26da7a8298e320174b276)
Unlike the CPU, the CDSP does not throttle its speed automatically when it reaches high temperatures in hamoa. Set up CDSP cooling by throttling the cdsp when it reaches 105°C. Signed-off-by: Dipa Ramesh Mantre <dipa.mantre@oss.qualcomm.com> (cherry picked from commit 3a0e3a57a352718db3e2a3874d2560fcc43b4de6)
Update the path for the camera icp firmware. Signed-off-by: Chandan Kumar Jha <cjha@qti.qualcomm.com> (cherry picked from commit d8f6f41d809852c58cf61768b73f378b19cc83a9)
Add a new host quirk UFSHCD_QUIRK_SKIP_DEVICE_RESET to allow host controller drivers to skip asserting device reset during UFS power down. When RST_N is asserted, the UFS device firmware wakes up and executes its internal reset routine. This routine initializes multiple hardware blocks and causing the device to draw a large curreny during this time. If the power rail transitions to LPM (Low Power Mode) while the device is still drawing this elevated current, it may trigger an OCP (Over Current Protection) fault in the regulator. For some UFS devices (e.g., Micron), the elevated current draw persists until the reset line is deasserted, making a fixed delay insufficient to prevent OCP. This quirk allows such devices to skip device reset during UFS power down. The device reset will instead be asserted as part of the platform shutdown sequence. Link: https://lore.kernel.org/linux-scsi/20260531235011.1052706-2-nitin.rawat@oss.qualcomm.com/ Signed-off-by: Nitin Rawat <nitin.rawat@oss.qualcomm.com> Signed-off-by: Pradeep P V K <pradeep.pragallapati@oss.qualcomm.com> (cherry picked from commit 1f2a619664b709bf62d59c4660c673014babce5a)
A previous fix [1] addressed an OCP (Over Current Protection) issue during UFS power down (PC=3) by adding a 10ms delay after asserting HWRST. The delay allows the UFS device to complete its reset routine before the power rail transitions to LPM (Low Power Mode). However, this fix is insufficient for certain Micron UFS parts. Unlike other vendors whose reset routine completes within ~10ms, Micron parts continue to draw current beyond the LPM threshold for a longer duration after reset is asserted, specifically until the reset is deasserted (RST_N goes high). No fixed delay can reliably cover this window since there is currently no mechanism for the host to query whether the device reset routine has completed. Enable the UFSHCD_QUIRK_SKIP_DEVICE_RESET quirk to skip device assert reset during UFS power down for Micron parts. For all other vendors, the existing behavior (assert reset + 10ms delay) is preserved. This quirk is applicable only during shutdown. The device reset will be asserted as part of the platform shutdown sequences. [1] commit 5127be4 ("scsi: ufs: ufs-qcom: Fix UFS OCP issue during UFS power down (PC=3)") Link: https://lore.kernel.org/linux-scsi/20260531235011.1052706-3-nitin.rawat@oss.qualcomm.com/ Signed-off-by: Nitin Rawat <nitin.rawat@oss.qualcomm.com> Signed-off-by: Pradeep P V K <pradeep.pragallapati@oss.qualcomm.com> (cherry picked from commit 6a34168ee0709f9806be1a07788b8c52fce6d229)
Arm heterogeneous configurations should have separate PMU nodes for each CPU arch as the arch specific events can be different. The "arm,armv8-pmuv3" compatible is also intended for s/w models rather than specific arch implementations. All the kryo CPUs are missing PMU compatibles, so they can't be fixed. Signed-off-by: Komal Bajaj <komal.bajaj@oss.qualcomm.com> (cherry picked from commit b13b14e497f09970cdb10e5ffde09278458786d6)
…itions The ARM PMUs share the same per-cpu (PPI) interrupt, so we need to switch to interrupt-cells = <4> in the GIC node to allow adding an interrupt partition map phandle as the 4th cell value for GIC_PPI interrupts. Signed-off-by: Komal Bajaj <komal.bajaj@oss.qualcomm.com> (cherry picked from commit bf449f3bcc8154d4a9e42c29031362f953f56c76)
Add cache-size properties to the L2 cache for cpu3 (256 KiB) and the shared L3 cache (512 KiB) to allow the kernel to correctly report cache topology. Also correct the dynamic-power-coefficient for cpu3 from 486 to 489 to reflect the accurate power model for that CPU cluster. Signed-off-by: Komal Bajaj <komal.bajaj@oss.qualcomm.com> (cherry picked from commit d0e416db53dd5e81e391b5b5a624283740b86639)
The SCM node requires the CE1 clock to be enabled for cryptographic operations. Add the core clock reference and clock-names property to allow the SCM driver to manage it correctly. Also add #reset-cells = <1> to expose the SCM reset controller interface. Signed-off-by: Komal Bajaj <komal.bajaj@oss.qualcomm.com> (cherry picked from commit 7a3de337a6748569c2c1b9a7d5057d157b91ae12)
The reserved-memory list allocates memory regions well below memory node address, such as hyp@80000000 and smem@86000000. Correct the memory node base address from 0xa0000000 to 0x80000000, which is the actual start of DRAM on shikra. Signed-off-by: Komal Bajaj <komal.bajaj@oss.qualcomm.com> (cherry picked from commit 801dfaf7d8957784dd47a327a93f551b5fc56c9b)
Add flag "aggregator-rx" to the Hamoa and Purwa camera dtsi. This change enables the aggregated CSIPHY to enable the GMSL Camera and Per-port feature. Signed-off-by: Vishal Verma <vishverm@qti.qualcomm.com>
…ear scaling The UFS clock frequency and gear speed do not necessarily have a strict one-to-one correspondence on all platforms. Introduce a device tree based configuration interface that allows specifying the HS gear speed for each supported operating frequency via the "opp-level" property in the OPP table. When this property is not configured, the driver falls back to the default frequency-to-gear mapping table. Signed-off-by: Ziqi Chen <ziqi.chen@oss.qualcomm.com> Signed-off-by: Nitin Rawat <nitin.rawat@oss.qualcomm.com> Signed-off-by: Giri Prasad Goriparthi <giri.goriparthi@oss.qualcomm.com>
Assign the appropriate UFS HS gear speed levels to each OPP frequency entry in the device tree, enabling proper per-frequency gear scaling (G1 at 75MHz, G3 at 150MHz, G5 at 300MHz). Signed-off-by: Nitin Rawat <nitin.rawat@oss.qualcomm.com> Signed-off-by: Giri Prasad Goriparthi <giri.goriparthi@oss.qualcomm.com>
…m-kernel This repository was renamed from pkg-linux-qcom-canonical to ubuntu-qcom-kernel. The uses: reference to the reusable build-kernel.yml workflow on main still pointed at the old repository name. GitHub redirects the old name, so this was not causing failures yet, but it should not rely on that redirect indefinitely. Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
Reference the reserved memory region for audio PD dynamic loading and remote heap requirements. Add the required VMID list for memory ownership transfers. Link: https://lore.kernel.org/all/20260629-hamoa-remoteheap-v1-1-aa868b7a6e65@oss.qualcomm.com/ Signed-off-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com> Signed-off-by: Jianping Li <jianping.li@oss.qualcomm.com>
Flatten usb controller nodes and update to using latest bindings and flattened driver approach. Tested this patch on CRD platform. For testing purpose, modified dr_mode property and added usb-role-switch property to the 3 super speed capable DRD controllers and valdiated both host and device mode. Also validated host mode on the multiport controller. Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260323103119.1801139-1-krishna.kurapati@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This reverts commit 3f88068. Disable HLOS memory dump table setup.
…0NB-A001 Add the BOE 0x0b21 panel entry used in the K&D Technology KD116N36-30NB-A001 eDP LCM, place the EDID here for subsequent reference. Timing values come from the KD116N36-30NB-A001 spec. 00 ff ff ff ff ff ff 00 09 e5 21 0b 00 00 00 00 01 1e 01 04 a5 1a 0e 78 0a 24 10 97 59 54 8e 27 1e 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 b2 39 80 d4 70 38 4b 40 30 20 36 00 04 8c 10 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fe 00 51 56 31 31 36 46 48 42 2d 4e 38 31 0a 00 b3 Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com> Link: https://lore.kernel.org/all/20260901-edp-id-boe-v1-1-f5e2c44255f7@oss.qualcomm.com
FROMLIST: media: qcom: iris: add firmware debug logging support
…evel FROMLIST: scsi: ufs: ufs-qcom: Add specified gear support for multi gear scaling
Revert "UBUNTU: [Config] enable QCOM memdump"
QCLINUX: arm64: dts: qcom: Add flag to enable aggregated CSIPHY
FROMLIST: drm/panel-edp: Add support for BOE panel used in KD116N36-3…
…devel FROMLIST: arm64: dts: qcom: hamoa: add audio PD remote heap region
…sb-dt UPSTREAM: arm64: dts: qcom: hamoa/purwa: Flatten usb controller nodes
X0 shutdown fix audio
Adds qcom_capsule_tool (vendored as-is from cbsp-boot-utilities) as a plain Python package under debian.qcom/scripts, invoked via `python3 -m qcom_capsule_tool.cli <subcommand>`. The `create` subcommand runs the full pipeline -- SYSFW_VERSION.bin generation, FvUpdate.xml generation from a partitions.conf, firmware volume creation, JSON config update, and signed FMP capsule generation -- from a single command. FvUpdate.xml generation reads partition layout from a vendored qcom-ptool partitions.conf rather than fetching qcom-ptool over the network at build time, and marks any partitions passed via --update-partitions as Operation=UPDATE with all others left Operation=IGNORE. patch_capsule_cert transparently handles both plain-ELF and .xz-compressed uefi_dtbs/xbl_config images when patching in QcCapsuleRootCert. Vendored from: - qcom_capsule_tool: qualcomm/cbsp-boot-utilities @ 8a0f1deef97beae600910506bfba488976465828 - partitions.conf: qualcomm-linux/qcom-ptool @ fb8c99c308732eaaba427233029f33c5327beebf Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
Adds build-dtb-image.sh (vendored from qcom-dtb-metadata). Given a directory of .dtb/.dtbo files and a list of --soc names, it filters the FIT image source to only the DTBs needed for those SoCs, builds an external-data FIT image with mkimage, and wraps it in a FAT image (via mtools, no loop device) sized with --size. --prune skips any DTB the .its references but that is missing from the source directory instead of failing the build. Vendored from: - build-dtb-image.sh: qualcomm-linux/qcom-dtb-metadata @ f1596a6b726c232743f968786de375a91d954eca Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
Adds a dtb-capsule-PKGVER-ABINUM-qcom package (non-per-flavour, same
guard as linux-bpf-dev) that ships a signed UEFI capsule and
provenance manifest for the hamoa/purwa device tree, plus a systemd
service that verifies the update on next boot.
At build time, the first flavour's .dtb/.dtbo files are sha256-summed
into a provenance manifest, whose own sha256 is injected into each
DTB under /qcom-dtb-capsule-provenance/dtb-provenance-sha256 via
fdtput, and also dropped into that flavour's linux-modules package at
/usr/lib/modules/<kver>/dtb-provenance-sha256 so a running system can
verify its DTB and linux-modules package came from the same build.
build-dtb-image.sh packs the DTBs for hamoa and purwa into a
FAT-wrapped FIT image, and qcom_capsule_tool's `create` subcommand
signs one capsule per machine using each machine's FMP GUID.
The package installs each machine's .cap file, capsule.env (FMP_GUID
+ qcom-ptool TARGET), the provenance manifest, and the expected
kernel release under /usr/share/dtb-capsule/, alongside a static
Provides/Conflicts/Replaces: dtb-capsule-qcom virtual package name so
upgrading to a new kver's dtb-capsule package lets dpkg cleanly
replace the previous one instead of erroring out on the shared,
non-kver-scoped file paths (verify-capsule-result.sh, expected-kver,
the systemd service, etc.).
postinst fails the install (exit 1) if linux-modules-<kver> is not
actually installed — defense-in-depth against --force-depends
bypassing the declared package Depends, since postinst is not
re-invoked just because the dependency is installed afterward. It
also cross-checks this package's own expected-dtb-sha256 against the
target linux-modules package's dtb-provenance-sha256, refusing to
stage a capsule when the two were not built together. Otherwise it
clears any stale ESRT-dedup cache and verify-state from a prior
attempt, and matches the device's ESRT FMP GUID against the shipped
capsule.env files; if the running DTB's content already matches what
this package would stage, staging is skipped and any leftover .cap
is cleared, so the next boot's verifier doesn't mistake it for an
unconsumed capsule. Otherwise it copies the matching capsule into
/boot/efi/EFI/UpdateCapsule and sets the OsIndications
capsule-delivery bit via efivar so firmware applies it on next boot.
prerm removes this package's own staged-but-unconsumed capsule on
removal, since that file lives outside dpkg's file list and would
otherwise be left for firmware to apply pre-OS on the next boot.
dtb-capsule-verify.service/verify-capsule-result.sh check on next
boot that the capsule applied cleanly, in two phases:
- kver_match_state answers whether the installed dtb-capsule
package's target kernel matches the one running right now.
It's deliberately direction-agnostic — the expected kernel may be
a newer one not yet rebooted into, or an older one being rolled
back to, and both are handled by the same checks. A dpkg record
for the expected kernel in an abnormal state (half-installed,
stuck purge, etc.) is package_mismatch; a merely absent record
(autoremoved, or never installed) is not treated as an error and
falls through to a self-consistency check on the running
kernel's own DTB content, landing on no_capsule_for_running_kernel
(content fine, just nothing staged for this kernel), on
kernel_dtb_mismatch (the running kernel's own linux-modules
package disagrees with its DTB), or, when that self-consistency
can't be determined at all (no provenance data), on unknown
rather than silently falling through as if the kernel were a
match. An unconsumed capsule, or content that already matches
what's expected, both mean the device is simply awaiting reboot —
tracked as reboot_pending or, once a real reboot has come and
gone without reaching the expected kernel (a boot_id change
against a persisted tracking file), escalated to reboot_stalled
so a genuinely stuck upgrade doesn't keep reporting the same
harmless "awaiting reboot" line.
- dtb_pairing_state (only reached once kver_match_state=ok) answers
whether firmware paired the running kernel with the correct DTB
content. Content self-consistency is checked first and
short-circuits to apply_confirmed regardless of ESRT state; ESRT
is consulted only to diagnose a mismatch, first by scanning every
other installed kernel's own dtb-provenance-sha256 for a match
against the running DTB (suspected_dtb_rollback, naming a
rollback_target_kver) before falling back to a per-file sha256
diff against the provenance manifest (content_mismatch_localized).
Each check writes a one-line human-readable summary as the last field
of last-verify-state, so the verdict is readable without decoding the
other fields; dtb-capsule-motd.sh reuses that summary to surface any
non-healthy state at login.
Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
…ee dir Builds the dtb-provenance-content-sha256sums.txt manifest from the files under usr/lib/firmware/<abi_release>-<flavour>/device-tree/qcom in the linux-modules package (populated by dtbs_install), instead of the raw kernel build directory. That directory holds only the final dtb-y targets actually shipped to the device, so the manifest no longer includes .dtbo overlay fragments that are never installed standalone and would otherwise be reported as missing by verify-capsule-result.sh's on-device sha256 comparison. The manifest's own sha256 (dtb-provenance-sha256) is also dropped into this flavour's linux-modules package at /usr/lib/modules/<abi_release>-<flavour>/dtb-provenance-sha256, so a running system can verify its installed DTB and linux-modules came from the same build via a plain file comparison, rather than needing a runtime hash of some unrelated package file. The same sha256 is additionally written into the dtb-capsule package itself as expected-dtb-sha256, so postinst can refuse to stage a capsule whose build doesn't match the target kernel's linux-modules package. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
Temporary workaround: the on-device meta for this target already defines the DTB partitions as dtb_a/dtb_b, not dtb/dtb_BACKUP, so a capsule built against the vendored partitions.conf's dtb/dtb_BACKUP names fails to apply on real hardware. Renaming the vendored partitions.conf entries to match lets the capsule target the correct partitions. The proper fix is to update the meta's own partition table instead of the vendored partitions.conf; this rename is a stopgap until that's done. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
guanquan (GuanquanTian)
force-pushed
the
dtb-capsule-resolute-devel-tip
branch
2 times, most recently
from
September 8, 2026 07:41
cfa8652 to
fe76d42
Compare
…ernel Adds /usr/sbin/dtb-capsule-recovery, which scans installed kernels for one whose own dtb-provenance-sha256 matches the running DTB and points GRUB's default boot entry at it (grub-set-default), via --auto for scripted use or interactive selection otherwise. verify-capsule-result.sh invokes it automatically (best-effort) when kver_match_state lands on kernel_dtb_mismatch, reboot_stalled, apply_failed, or suspected_dtb_rollback. Before attempting recovery, it scans for a kernel whose DTB matches the running DTB. If found, recovery proceeds; otherwise, the error state is preserved for manual intervention. This ensures a device stuck on a mismatched kernel/DTB pairing converges back to a known-good one on its own. dtb-capsule-motd.sh points admins at the tool for these states. The dtb-capsule package now Recommends grub2-common. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
Add secrets: inherit to allow premerge-pr.yml to access GitHub Secrets (FMPCERT, FMPROOT, RMPSUB) needed for DTB capsule certificate injection during kernel build. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
guanquan (GuanquanTian)
force-pushed
the
dtb-capsule-resolute-devel-tip
branch
from
September 15, 2026 04:54
fe76d42 to
a6174b3
Compare
Removes the stray FLOWCHART-UPDATES-v3.md and IMPLEMENTATION-SUMMARY-P1-P4.md that accidentally got committed alongside the dtb-capsule-recovery code change, and replaces them with an up-to-date implementation summary and flowchart set under debian.qcom/docs/, so design docs live with the code they describe instead of the repo root. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
guanquan (GuanquanTian)
force-pushed
the
dtb-capsule-resolute-devel-tip
branch
from
September 15, 2026 06:03
a6174b3 to
9d7b0cc
Compare
Tingwei Zhang (quic-tingweiz)
force-pushed
the
resolute-qcom-devel
branch
from
September 22, 2026 02:39
76e7f56 to
99880ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a complete DTB UEFI capsule update system for Qualcomm devices, including:
Changes
Design Highlights