U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 0/6] Qualcomm: teach the build system to emit signed ELF images
@ 2026-05-11 13:57 Casey Connolly
  2026-05-11 13:57 ` [PATCH v7 1/6] config.mk: support vendor generic includes Casey Connolly
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Casey Connolly @ 2026-05-11 13:57 UTC (permalink / raw)
  To: u-boot, Sumit Garg, u-boot-qcom
  Cc: Tom Rini, Casey Connolly, Neil Armstrong, Balaji Selvanathan,
	Varadarajan Narayanan, Quentin Schulz, Heinrich Schuchardt,
	Marek Vasut, Peng Fan, Jaehoon Chung, Aswin Murugan,
	Ilias Apalodimas, Michal Simek, David Lechner

Currently the build process for flashing U-Boot as the first-stage
bootloader on Qualcomm platforms requires a manual step of test-signing
the emitted ELF binary with the appropriate settings for it to be
properly accepted by the pre-loader.

To address this, let's introduce a new tool "mkmbn.py", this is based
on the existing qtestsign[1] tool but introduces lookup table that maps
from a boards DT compatible property to the load address it needs.

A new config option (QCOM_GENERATE_MBN) is added so that
BUILD_TARGET can be set automatically and avoid the need to manually
specify the target on the cmdline. The make target is added in
board/qualcomm/config.mk with a minor adjustment to the toplevel
config.mk to properly check this path.

The various platforms which currently rely on manual post-processing
with qtestsign are adapted to leverage mkmbn instead. New platforms can
be supported just by adding an entry to mkmbn.py with the same data that
would otherwise be encoded in the qtestsign cmdline args.

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.

[1]: https://github.com/msm8916-mainline/qtestsign

---
Changes in v7:
- Adjust config.mk include to include both generic vendor config.mk
  path and board-specific path so that both can be used simultaneously.
- Also enable mkmbn for db410c
- Rename db410c/820c defconfigs to have qcom_ prefix
- Link to v6: https://patch.msgid.link/20260505-b4-qcom-tooling-improvements-v6-0-a5fb673f4af6@linaro.org

Changes in v6:
- Drop binman in favour of introducing a make target and associated
  kconfig infra, this drastically simplifies the tooling.
- Various minor fixes/improvements to mkmbn.py
- Link to v5: https://lore.kernel.org/r/20250722-b4-qcom-tooling-improvements-v5-0-df143f1247fc@linaro.org

Changes in v5:
- Rebase on master (dropped trogdor chromebook series)
- Directly import the MBN signing code from qtestsign and then adjust
  it in a separate commit so it can be updated in the future.
- Disable BINMAN_FDT when ARCH_SNAPDRAGON is enabled
- Set default value for BINMAN_DTB in mach-snapdragon/Kconfig rather
  than having to set it in all defconfigs.
- Add a comment to the top of mkmbn.py explaining it's purpose.
- Link to v4: https://lore.kernel.org/r/20250613-b4-qcom-tooling-improvements-v4-0-7ea1c68779fa@linaro.org

Changes in v4:
- Rework how qtestsign code is imported to make it easier to sync with upstream in the future.
- Actually raise an exception when mkmbn fails in an unexpected way.
- Link to v3: https://lore.kernel.org/r/20250612-b4-qcom-tooling-improvements-v3-0-76f34cf216e2@linaro.org

Changes in v3:
- Fixup Makefiles and add missing qcom-binman.dts
- Adjust wording to reflect changes to build process
- Link to v2: https://lore.kernel.org/r/20250602-b4-qcom-tooling-improvements-v2-0-c7d19c0d4a8b@linaro.org

Changes in v2:
- Reworked to use binman with a plugin to build the u-boot.mbn file
- Added some fixes for binman to work with OF_UPSTREAM and with tools
  in the srctree toolpath rather than objtree for out of tree builds.
- Link to v1: https://lore.kernel.org/r/20250522-b4-qcom-tooling-improvements-v1-0-8141b8955cfb@linaro.org

To: u-boot@lists.denx.de
To: Sumit Garg <sumit.garg@kernel.org>
To: u-boot-qcom@groups.io
Cc: Tom Rini <trini@konsulko.com>
Cc: Casey Connolly <casey.connolly@linaro.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Cc: Varadarajan Narayanan <quic_varada@quicinc.com>
Cc: Quentin Schulz <quentin.schulz@cherry.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Marek Vasut <marek.vasut+renesas@mailbox.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Michal Simek <michal.simek@amd.com>
Cc: David Lechner <dlechner@baylibre.com>

---
Casey Connolly (6):
      config.mk: support vendor generic includes
      tools: qcom: introduce mkmbn library
      tools: qcom: add mkmbn.py
      doc: board/qualcomm: update docs for new u-boot.mbn target
      mach-snapdragon: add kconfig infra for building MBN files
      configs: qcom: use mkmbn and stop building ELF files

 Kconfig                                            |   1 +
 arch/arm/mach-snapdragon/Kconfig                   |  11 +
 board/qualcomm/config.mk                           |  14 +
 config.mk                                          |   8 +-
 configs/qcm6490_defconfig                          |   2 +-
 ...0c_defconfig => qcom_dragonboard410c_defconfig} |   2 +-
 ...0c_defconfig => qcom_dragonboard820c_defconfig} |   0
 configs/qcom_ipq9574_mmc_defconfig                 |   2 +-
 configs/qcom_qcs615_defconfig                      |   2 +-
 configs/qcom_qcs8300_defconfig                     |   2 +-
 configs/qcom_qcs9100_defconfig                     |   2 +-
 doc/board/qualcomm/board.rst                       |   2 +-
 doc/board/qualcomm/dragonboard410c.rst             |  19 +-
 doc/board/qualcomm/dragonwing.rst                  |  14 +-
 doc/board/qualcomm/index.rst                       |   1 +
 doc/board/qualcomm/rb3gen2.rst                     |  30 +-
 doc/board/qualcomm/rdp.rst                         |   5 +-
 doc/board/qualcomm/signing.rst                     |  29 ++
 tools/mkmbn                                        |   1 +
 tools/qcom/mkmbn/cert.py                           | 127 ++++++++
 tools/qcom/mkmbn/elf.py                            | 241 ++++++++++++++
 tools/qcom/mkmbn/hashseg.py                        | 356 +++++++++++++++++++++
 tools/qcom/mkmbn/mkmbn.py                          | 165 ++++++++++
 23 files changed, 986 insertions(+), 50 deletions(-)
---
base-commit: bb0f3eebb3c196d9b6efbbd1e5aa9b16abbb9ad6

// Casey (she/they)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-07-20 13:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 13:57 [PATCH v7 0/6] Qualcomm: teach the build system to emit signed ELF images Casey Connolly
2026-05-11 13:57 ` [PATCH v7 1/6] config.mk: support vendor generic includes Casey Connolly
2026-06-08 14:27   ` Tom Rini
2026-05-11 13:57 ` [PATCH v7 2/6] tools: qcom: introduce mkmbn library Casey Connolly
2026-05-11 13:57 ` [PATCH v7 3/6] tools: qcom: add mkmbn.py Casey Connolly
2026-05-11 13:57 ` [PATCH v7 4/6] doc: board/qualcomm: update docs for new u-boot.mbn target Casey Connolly
2026-05-11 13:57 ` [PATCH v7 5/6] mach-snapdragon: add kconfig infra for building MBN files Casey Connolly
2026-06-08 14:28   ` Tom Rini
2026-05-11 13:57 ` [PATCH v7 6/6] configs: qcom: use mkmbn and stop building ELF files Casey Connolly
2026-05-21 12:23   ` Stephan Gerhold
2026-07-20 13:10 ` [PATCH v7 0/6] Qualcomm: teach the build system to emit signed ELF images Casey Connolly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox