[PATCH 0/5] Qualcomm: teach the build system to emit signed ELF images
Casey Connolly
casey.connolly at linaro.org
Thu May 22 22:39:38 CEST 2025
With several new Qualcomm platforms appearing on the mailing list, all
of which build U-Boot as an ELF, sign it, and then flash it to some
partition on the board, we're getting a lot of defconfigs which just
contain a debug UART and a TEXT_BASE address. This leads to needless
rebuilds in CI of effectively the same image, and needless duplication
of build instructions.
To address this, let's introduce a new tool "mkmbn.py", this is based
on the existing qtestsign[1] tool but is (currently) hardcoded to
only handle the Dragonwing and IPQ boards which use MBN header v6.
Additionally, the tool contains a lookup table that maps from a boards
DT compatible property to the load address it needs. Since it's highly
unusual for different boards using the same SoC to have different load
addresses, generic platform matching is also done (e.g. "qcom,qcm6490").
With this tool in place, we introduce a "u-boot.mbn" target in the
Makefile, this can be invoked to build a Qualcomm signed ELF image for
supported targets.
Finally, the defconfigs are cleaned up by moving the debug UART
definitions to config fragments (since it doesn't make sense to have
them enabled by default anyway) and remove CONFIG_REMAKE_ELF. Notably,
the qcs9100_defconfig is removed entirely since the same binary can
be created with just make arguments. This platform entirely lacked
documentation to begin with, which should be addressed by future
patches.
The Qualcomm documentation is also cleaned up, a new "signing" page
is added to briefly cover the what and why of MBN signing, and board
specific pages are updated to explain the new build process.
These patches have been tested on the RB3 Gen 2, but additionally
testing for other platforms would be super useful.
[1]: https://github.com/msm8916-mainline/qtestsign
To: Tom Rini <trini at konsulko.com>
To: Neil Armstrong <neil.armstrong at linaro.org>
To: Sumit Garg <sumit.garg at kernel.org>
Cc: u-boot at lists.denx.de
Cc: u-boot-qcom at groups.io
Cc: Varadarajan Narayanan <quic_varada at quicinc.com>
Cc: Balaji Selvanathan <balaji.selvanathan at oss.qualcomm.com>
Cc: Aswin Murugan <aswin.murugan at oss.qualcomm.com>
Signed-off-by: Casey Connolly <casey.connolly at linaro.org>
---
Casey Connolly (5):
tools: add mkmbn tool for Qualcomm
Makefile: add u-boot.mbn target for mach-snapdragon
configs: qualcomm: use fragments for debug UART
configs: qualcomm: use mkmbn and stop creating ELF files
doc: board/qualcomm: update docs for new u-boot.mbn target
Makefile | 3 +
arch/arm/mach-snapdragon/Makefile | 8 +
board/qualcomm/debug-qcm6490.config | 5 +
board/qualcomm/debug-qcs9100.config | 5 +
configs/qcm6490_defconfig | 10 --
configs/qcom_ipq9574_mmc_defconfig | 1 -
configs/qcs9100_defconfig | 18 ---
doc/board/qualcomm/index.rst | 1 +
doc/board/qualcomm/rb3gen2.rst | 27 ++--
doc/board/qualcomm/rdp.rst | 16 +-
doc/board/qualcomm/signing.rst | 29 ++++
tools/qcom/mkmbn/cert.py | 158 ++++++++++++++++++
tools/qcom/mkmbn/elf.py | 243 ++++++++++++++++++++++++++++
tools/qcom/mkmbn/hashseg.py | 308 ++++++++++++++++++++++++++++++++++++
tools/qcom/mkmbn/mkmbn.py | 99 ++++++++++++
15 files changed, 876 insertions(+), 55 deletions(-)
---
base-commit: 8f85a7345ed5df70a155f0630da72970eb01d87a
change-id: 20250522-b4-qcom-tooling-improvements-ab40585b11a1
Casey Connolly <casey.connolly at linaro.org>
More information about the U-Boot
mailing list