Skip to content

qcom-capsule: enable capsule generation for hamoa (iq-x7181-evk)#2300

Open
xueqnie wants to merge 4 commits into
qualcomm-linux:masterfrom
xueqnie:ostree-capsule
Open

qcom-capsule: enable capsule generation for hamoa (iq-x7181-evk)#2300
xueqnie wants to merge 4 commits into
qualcomm-linux:masterfrom
xueqnie:ostree-capsule

Conversation

@xueqnie
Copy link
Copy Markdown
Contributor

@xueqnie xueqnie commented May 27, 2026

Enable UEFI FMP capsule generation for the Hamoa platform (iq-x7181-evk).
Hamoa uses SPINOR flash and only updates the DTB partition via capsule.

This extends the qcom-capsule class with a CAPSULE_ENTRIES mechanism for
dynamic FvUpdate.xml generation and guards xbl_config.elf cert injection
for platforms that lack this component.

Built and verified capsule generation produces a valid .cap file targeting
the SPINOR dtb_a/dtb_b A/B partitions.

Bump SRCREV to b5c7d77 which includes our GenFfs/GenFv PATH fallback
fix (352ec67) merged upstream. Drop the now-redundant local patch.

Signed-off-by: Xueqian Nie <xueqnie@qti.qualcomm.com>
Copy link
Copy Markdown
Contributor

@lumag lumag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split the second commit into atomical logical chunks.

@lumag
Copy link
Copy Markdown
Contributor

lumag commented May 28, 2026

Also please drop the description of the changes from the PR description. If you want to keep the 'testing' part, please rewrite it to be an English text rather than an unreadable bullet list.

xueqnie added 3 commits May 28, 2026 08:21
Add hamoa to COMPATIBLE_MACHINE in the capsule recipe and set the
IQ-X7181 ESRT GUID in the machine configuration.

Signed-off-by: Xueqian Nie <xueqnie@qti.qualcomm.com>
Define the capsule partition layout for iq-x7181-evk via a bbappend.
Hamoa uses SPINOR flash and only updates the DTB partition via capsule,
targeting the dtb_a/dtb_b A/B partitions.

Signed-off-by: Xueqian Nie <xueqnie@qti.qualcomm.com>
Extend the capsule class to support platforms like hamoa that lack
xbl_config.elf and need dynamic FvUpdate.xml generation:

- CAPSULE_ENTRIES variable flag system generates FvUpdate.xml at build
  time from per-machine flags, replacing the need for a static XML file
- Guard the xbl_config.elf cert injection block so it is skipped on
  platforms where xbl_config.elf is not present
- Stage kernel DTB vfat image as dtb.bin when QCOM_DTB_DEFAULT is set
  and CAPSULE_ENTRIES includes a dtb entry

Signed-off-by: Xueqian Nie <xueqnie@qti.qualcomm.com>
@xueqnie
Copy link
Copy Markdown
Contributor Author

xueqnie commented May 28, 2026

Also please drop the description of the changes from the PR description. If you want to keep the 'testing' part, please rewrite it to be an English text rather than an unreadable bullet list.
done


QCOM_BOOT_FIRMWARE = "firmware-qcom-boot-iq-x7181"

CAPSULE_GUID = "0F6D58FC-2258-4D27-9E23-D77219B0897C"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need a separate GUID?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each platform requires a unique ESRT GUID so the OS firmware update stack can identify which device a capsule targets. The IQ-X7181 GUID is defined in cbsp-boot-utilities documentation.

@@ -0,0 +1,10 @@
CAPSULE_FLASH_TYPE:iq-x7181-evk = "NORUFS"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useless before the next commit. And I guess that the previous commit is also useless. Could you order them?

@@ -59,13 +59,24 @@ XBLCONFIG_DTB_SECTION ?= ""
BOOTBINS_DIR ?= "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CAPSULE_ENTRIES variable flag system generates

No, the flag can't generate anything. Also you are still describing the contents. Start by describing the issue. What is not working?

# ---------------------------------------------------------------------------
# To provide a board/project-specific capsule layout, append your file to
# SRC_URI and name it FvUpdate.xml, e.g. in a .bbappend or local.conf:
# SRC_URI:append = " file://my-board-FvUpdate.xml;subdir=fvupdate"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you dropping this comment?

do_compile[depends] += "${@'${QCOM_BOOT_FIRMWARE}:do_deploy' if d.getVar('QCOM_BOOT_FIRMWARE') else ''}"

# Pull in the kernel DTB vfat image when capsule includes a dtb entry.
do_compile[depends] += "${@'virtual/kernel:do_deploy' if 'dtb' in (d.getVar('CAPSULE_ENTRIES') or '').split() else ''}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need or '' here, There is a default value.


lines.append('</FVItems>')

out = os.path.join(workdir, 'FvUpdate.xml')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will clean this file? Can we use ${B} instad?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fiixed

DTB_PATCH=$(echo "${POST_DDR_LINE}" | sed "s|.* -> '||;s|'.*||" | xargs basename)
DTB_SECTION=$(echo "${POST_DDR_LINE}" | sed "s/.*PH# \([0-9]*\).*/\1/")
fi
# Stage kernel DTB vfat image as dtb.bin so FVCreation.py can find it
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a separate commit.

file://0001-FVCreation-fall-back-to-PATH-when-locating-GenFfs-Ge.patch \
"
SRCREV = "c25b41a49595aca2a3480db050dee78edd2a3bff"
SRCREV = "b5c7d77383b0090f62daeea9bf059a2bbbef6376"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs coordination with #2288.

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

COMPATIBLE_MACHINE = "qcm6490|qcs9100|qcs8300|qcs615"
COMPATIBLE_MACHINE = "qcm6490|qcs9100|qcs8300|qcs615|hamoa"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only be done after all the other changes, reorder the commits logically.

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.

3 participants