[SPL] ELF loader support - design discussion

Urvashi Sharma <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <CAJM1RwPMXB8qLm4+4h_hBLqsq9=YBW_GndXroi5En4VGBVq-oA@mail.gmail.com>
Hi Everyone,

Hope you all are doing well.

I'm working on a use case that requires booting via SPL in Falcon Mode,
where SPL is the natural choice given its minimal footprint. Our board
specifically needs to load an ELF image from storage (e.g., MMC/NAND/SPI)
directly into memory as part of this boot flow.

U-Boot already provides the bootelf shell command for working with ELF
binaries: it parses an ELF image, maps each segment to its linked address,
and jumps to the entry point. However, bootelf assumes the ELF is already
resident in memory - it does not read from storage itself. This differs
from the existing SPL image loading methods (MMC, NAND, SPI, etc.), which
combine storage access with image parsing in a single step. Since the FIT
and legacy image formats also don't meet our needs, there is currently no
existing SPL loader path that can take an ELF image from storage into
memory.

To close this gap, I'm planning to implement a new ELF loader within SPL,
built on the existing spl_image_loader framework (registered via
SPL_LOAD_IMAGE_METHOD) that already lets board/SoC vendors plug in their
own storage-aware image-loading implementations.

Since this would be a significant effort, I wanted to check with the
community before proceeding - has anyone worked on something similar, or
have any suggestions/concerns I should consider?

Thanks,
Urvashi

PS: New to U-Boot, so please bear with me if I've missed any existing
convention or prior discussion on this topic.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.