u-boot/common/spl
Anshul Dalal fd2bccec19 spl: return header size to spl_load in os boot
During linux build process the header size is computed including the BSS
whereas it's removed when creating the uncompressed image. Therefore the
size of the uncompressed image on filesystem will be smaller than the
size specified in the header.

This causes issues when loading the kernel image from the SPL (as in
falcon boot) with spl_load since it compares the read file size from the
FS to the header size form the image. Which leads to the following check
in `include/spl_load.h` failing to -EIO when loading kernel image:

  return read < spl_image->size ? -EIO : 0;

Therefore we should return the header size back to spl_load instead of
the file size in falcon boot when not loading a FIT image.

Bug report:
https://lore.kernel.org/u-boot/20250214111656.2358748-1-anshuld@ti.com/

Fixes: 775074165d ("spl: Add generic spl_load function")
Reported-by: Anshul Dalal <anshuld@ti.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
2025-03-30 09:15:34 -06:00
..
Kconfig config: falcon: move CFG_SYS_SPI_* to Kconfig 2025-03-30 09:15:31 -06:00
Kconfig.nxp spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_... 2023-10-06 14:38:11 -04:00
Kconfig.tpl spl: Use CONFIG_VAL() to obtain the SPL stack 2025-03-13 10:36:10 -06:00
Kconfig.vpl arm: Support a separate stack for VPL 2025-03-13 10:36:10 -06:00
Makefile spl: Add support for a relocating jump to the next phase 2025-01-22 09:47:50 -06:00
spl_atf.c spl: Drop use of uintptr_t 2024-12-27 15:16:10 -06:00
spl_blk_fs.c spl: Create a function to init spl_load_info 2024-08-23 15:58:42 -06:00
spl_bootrom.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_dfu.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_ext.c spl: return header size to spl_load in os boot 2025-03-30 09:15:34 -06:00
spl_fat.c spl: return header size to spl_load in os boot 2025-03-30 09:15:34 -06:00
spl_fit.c vbe: Allow VBE to disable adding loadables to the FDT 2025-02-03 16:01:36 -06:00
spl_imx_container.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_legacy.c spl: Drop use of uintptr_t 2024-12-27 15:16:10 -06:00
spl_mmc.c spl: mmc: Avoid size growth in spl_mmc_find_device() debug 2024-12-27 15:16:10 -06:00
spl_nand.c spl: Create a function to init spl_load_info 2024-08-23 15:58:42 -06:00
spl_net.c spl: Create a function to init spl_load_info 2024-08-23 15:58:42 -06:00
spl_nor.c spl: Create a function to init spl_load_info 2024-08-23 15:58:42 -06:00
spl_nvme.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_onenand.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_opensbi.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_optee.S Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
spl_ram.c spl: Create a function to init spl_load_info 2024-08-23 15:58:42 -06:00
spl_reloc.c spl: Adjust debugging and xPL symbols 2025-02-03 16:00:42 -06:00
spl_sata.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_sdp.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_semihosting.c spl: Create a function to init spl_load_info 2024-08-23 15:58:42 -06:00
spl_spi.c config: falcon: move CFG_SYS_SPI_* to Kconfig 2025-03-30 09:15:31 -06:00
spl_ubi.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_upl.c upl: Add support for Universal Payload in SPL 2024-08-09 16:03:20 -06:00
spl_usb.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_xip.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
spl_ymodem.c spl: Create a function to init spl_load_info 2024-08-23 15:58:42 -06:00
spl.c vbe: Provide VPL binman-symbols for the next phase 2025-02-03 16:01:36 -06:00