u-boot-brain/common/spl
Samuel Holland cf70553e2c spl: fit: Minimally parse OS properties with FIT_IMAGE_TINY
Some boards, specifically 64-bit Allwinner boards (sun50i), are
extremely limited on SPL size. One strategy that was used to make space
was to remove the FIT "os" property parsing code, because it uses a
rather large lookup table.

However, this forces the legacy FIT parsing code path, which requires
the "firmware" entry in the FIT to reference the U-Boot binary, even if
U-Boot is not the next binary in the boot sequence (for example, on
sun50i boards, ATF is run first).

This prevents the same FIT image from being used with a SPL with
CONFIG_SPL_FIT_IMAGE_TINY=n and CONFIG_SPL_ATF=y, because the boot
method selection code looks at `spl_image.os`, which is only set from
the "firmware" entry's "os" property.

To be able to use CONFIG_SPL_ATF=y, the "firmware" entry in the FIT
must be ATF, and U-Boot must be a loadable. For this to work, we need to
parse the "os" property just enough to tell U-Boot from other images, so
we can find it in the loadables list to append the FDT, and so we don't
try to append the FDT to ATF (which could clobber adjacent firmware).

So add the minimal code necessary to distinguish U-Boot/non-U-Boot
loadables with CONFIG_SPL_FIT_IMAGE_TINY=y. This adds about 300 bytes,
much less than the 7400 bytes added by CONFIG_SPL_FIT_IMAGE_TINY=n.

Acked-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-10-22 11:43:43 +05:30
..
Kconfig spl: fit: Minimally parse OS properties with FIT_IMAGE_TINY 2020-10-22 11:43:43 +05:30
Makefile spl: Extract legacy image handling into separate file 2020-04-27 20:29:33 +02:00
spl_atf.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_bootrom.c spl: pass args to board_return_to_bootrom 2019-10-08 16:35:16 +02:00
spl_dfu.c env: Drop environment.h header file where not needed 2019-08-11 16:43:41 -04:00
spl_ext.c spl: fix ext4fs_mount return code handling 2020-07-17 08:51:01 -04:00
spl_fat.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_fit.c spl: fit: Minimally parse OS properties with FIT_IMAGE_TINY 2020-10-22 11:43:43 +05:30
spl_legacy.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_mmc.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_nand.c spl: fit: improve spl_nand_fit_read(...) readability 2020-07-08 17:21:46 -04:00
spl_net.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_nor.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_onenand.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_opensbi.c riscv: Make SiFive HiFive Unleashed board boot again 2020-07-24 14:55:04 +08:00
spl_optee.S Rockchip-focused changes for v2018.11-rc2: 2018-10-05 13:40:42 -04:00
spl_ram.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_sata.c spl: sata: support U-Boot load from raw sata disk 2019-07-24 14:15:36 -04:00
spl_sdp.c sdp: call board_usb_init at spl_sdp_load_image 2020-09-01 14:47:43 +02:00
spl_spi.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_ubi.c common: Drop image.h from common header 2020-05-18 17:33:33 -04:00
spl_usb.c spl: usb: Only init usb once 2020-08-11 20:34:46 +05:30
spl_xip.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_ymodem.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl.c spl: Avoid printing boot device if silent console is enabled 2020-10-14 11:16:34 -04:00