Boards may need to read on-device metadata before choosing the raw MMC partition containing the next boot stage. This series makes the existing partition hook usable after MMC initialization and adds board selection as an alternative to fixed partition numbers or types.
The board hook owns hardware-area selection. A failed dynamic selection stops the current MMC load attempt without filesystem fallback; other configured boot devices may still be tried. Out-of-tree spl_mmc_boot_partition() overrides must accept the added struct mmc * argument; the in-tree STM32MP1 override is updated here. Changes in v3: - Make dynamic selection a peer of fixed-number and partition-type modes. - Move selection into a helper with separate branches for each policy. - Share the partition-loading guard while preserving platform defaults, explicit loads and existing fallback behavior. - Link to v2: https://patch.msgid.link/20260911-ccaione-upstream-part-dynamic-v2-0-295fefc9a...@baylibre.com Changes in v2: - Reuse spl_mmc_boot_partition() instead of adding a second public hook. - Pass the initialized MMC device and boot-device ID to the hook, and defer selection until after any raw Falcon boot attempt. - Keep explicit partition loads independent of next-stage selection, without splitting the MMC loader into preparation and loading functions. - Make dynamic selection an option within existing raw partition mode, select its partition library and hide the unused fixed partition number. - Restrict STM32's fixed hook and MMC2 partition setting to fixed mode. - Keep a weak default and diagnose nonpositive dynamic selections before filesystem fallback, while preserving fixed-mode behavior. - Link to v1: https://patch.msgid.link/20260910-ccaione-upstream-part-dynamic-v1-1-381414ad9...@baylibre.com Signed-off-by: Carlo Caione <[email protected]> --- Carlo Caione (2): spl: mmc: select the boot partition after device initialization spl: mmc: make raw partition selection a choice arch/arm/mach-k3/r5/Kconfig | 4 +- arch/arm/mach-stm32mp/stm32mp1/spl.c | 4 +- common/spl/Kconfig | 13 +++++++ common/spl/spl_mmc.c | 72 ++++++++++++++++++++++++++---------- include/part.h | 3 +- include/spl.h | 21 +++++++---- 6 files changed, 86 insertions(+), 31 deletions(-) --- base-commit: 527115ef6783cec49e5610c523c124b399011361 change-id: 20260909-ccaione-upstream-part-dynamic-4c192e2d4bb6 Best regards, -- Carlo Caione <[email protected]>
