powerpc: mpc85xx: Add support for generating QorIQ pre-PBL eSDHC boot sector
authorPali Rohár <pali@kernel.org>
Wed, 11 May 2022 18:57:31 +0000 (20:57 +0200)
committerPeng Fan <peng.fan@nxp.com>
Fri, 29 Jul 2022 11:49:13 +0000 (19:49 +0800)
commit786d9f1a82eaf09f13e6b4348b555f95360a7721
treea576f5e63a5f0275ea0b0c7015089cd68b77ddf4
parent87069c79e830b2ab909537946a1e1db0e5fe7d8c
powerpc: mpc85xx: Add support for generating QorIQ pre-PBL eSDHC boot sector

QorIQ U-Boot binary for SD card booting compiled during build process
(either u-boot.bin or u-boot-with-spl.bin) cannot be directly loaded by
QorIQ pre-PBL BootROM. Compiled U-Boot binary first needs to be processed
by Freescale boot_format tool as described in doc/README.mpc85xx-sd-spi-boot

BootROM requires that image on SD card must contain special boot sector.
Implement support for generating this special boot sector directly in
U-Boot start code. Boot sector needs to be at the beginning of the image,
so when compiling only proper U-Boot without SPL then it needs to be in
proper U-Boot. When compiling SPL with proper U-Boot then it needs to be
only in SPL.

Support can be enabled by a new config option FSL_PREPBL_ESDHC_BOOT_SECTOR.
Via other two additional options FSL_PREPBL_ESDHC_BOOT_SECTOR_START and
FSL_PREPBL_ESDHC_BOOT_SECTOR_DATA it is possible to tune how final U-Boot
image could be stored on the SD card.

Signed-off-by: Pali Rohár <pali@kernel.org>
arch/powerpc/cpu/mpc85xx/Kconfig
arch/powerpc/cpu/mpc85xx/start.S
arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
arch/powerpc/cpu/mpc85xx/u-boot.lds