[qcom-next] qcom: Add FIT capsule support with multi-partition updates#69
Open
balajiselvanathan wants to merge 7 commits into
Open
[qcom-next] qcom: Add FIT capsule support with multi-partition updates#69balajiselvanathan wants to merge 7 commits into
balajiselvanathan wants to merge 7 commits into
Conversation
Add comprehensive FIT capsule update support for Qualcomm platforms alongside existing RAW capsule implementation. The new FIT support enables multi-partition firmware updates with automatic partition discovery. Refactor qcom_configure_capsule_updates() to use compile-time mutual exclusivity between CONFIG_EFI_CAPSULE_FIRMWARE_FIT and CONFIG_EFI_CAPSULE_FIRMWARE_RAW using #elif preprocessor directives. Add board-specific FIT capsule GUIDs for QCS615, QCS6490, and Lemans platforms with automatic board detection from device tree compatible strings. Each board uses a unique GUID to prevent cross-board flashing accidents. The FIT implementation discovers all SCSI/eMMC partitions across multiple devices, applies A/B selection logic based on GPT vendor attributes, and generates a comprehensive DFU string for multi-partition updates. A single ESRT entry represents all partitions for simplified firmware management. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add proper tracking of last attempt version and status for firmware updates to enable accurate ESRT (EFI System Resource Table) reporting. This allows the OS to query firmware update history and status. Introduce helper functions to manage last attempt information and map internal error codes to UEFI-compliant status codes. The fw_version is now only updated on successful updates, preserving the previous version on failures to maintain accurate ESRT state. Update last attempt information at all failure points in the update flow, including verification failures, resource allocation errors, and device errors. This ensures the OS always has visibility into the most recent update attempt and its outcome. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add last attempt status tracking to RAW capsule updates to enable proper ESRT reporting. This allows the OS to query firmware update history and determine the outcome of previous update attempts. Track last attempt information at all failure points in the update flows. Update the FMP state variable with both success and failure status to maintain accurate firmware state information. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
When capsule authentication fails, update the image pointers to skip past the authentication wrapper before returning. This allows the caller to access the FMP payload header and extract firmware version information even when authentication check fails. Additionally, call efi_firmware_get_fw_version() in the error path of efi_firmware_verify_image() to ensure version information is retrieved regardless of authentication status. This corrects error reporting by providing version details for ESRT, even for rejected capsules. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Switch from CONFIG_EFI_CAPSULE_FIRMWARE_RAW to CONFIG_EFI_CAPSULE_FIRMWARE_FIT in the default Qualcomm configuration. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add Python tool to convert Qualcomm FvUpdate.xml files into FIT capsule images compatible with U-Boot capsule update system. The tool provides end-to-end conversion from XML firmware manifests to deployable capsule files. The converter parses FvUpdate.xml UPDATE operations, validates binary files, generates ITS descriptors, compiles FIT images using mkimage, and creates final capsules using mkeficapsule. It supports board-specific GUIDs, firmware versioning, and capsule signing. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add comprehensive documentation for the fvupdate_to_fit.py tool that converts Qualcomm FvUpdate.xml files to FIT capsule images. The documentation covers usage, command-line options, deployment workflow, and troubleshooting guidance. Include an example FvUpdate.xml file demonstrating the expected XML structure with UPDATE operations for multiple firmware partitions. The documentation provides complete end-to-end guidance from XML conversion through capsule deployment in U-Boot, including board- specific GUIDs for QCS615, QCS6490, and Lemans platforms. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Member
As I can see the discussion upstream, let's use the standard RAW formats supported by both U-Boot and edk2 for capsule updates. |
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.
Add FIT capsule support for Qualcomm platforms enabling
multi-partition firmware updates with automatic partition discovery,
A/B slot selection, and board-specific GUIDs.
Includes Python conversion tool (fvupdate_to_fit.py) for generating FIT capsules
from FvUpdate.xml files, ESRT status tracking improvements, and
comprehensive documentation.
Maintains backward compatibility with existing RAW capsule implementation.
Upstream Link: https://lore.kernel.org/u-boot/20260522-capsule-v1-0-ff0ac9978d48@oss.qualcomm.com/