[PATCH u-boot-mvebu 20/31] arm: mvebu: Implement return_to_bootrom() via U-Boot's SPL framework

Stefan Roese sr at denx.de
Thu Jul 15 10:46:11 CEST 2021


On 08.07.21 19:30, Marek Behún wrote:
> From: Pali Rohár <pali at kernel.org>
> 
> U-Boot's SPL framework already has an API for loading U-Boot via
> BootROM.
> 
> Implement the function board_return_to_bootrom() for mvebu SPL code.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>
> Reviewed-by: Marek Behún <marek.behun at nic.cz>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   arch/arm/mach-mvebu/Kconfig |  4 ++++
>   arch/arm/mach-mvebu/spl.c   | 12 ++++++++++++
>   2 files changed, 16 insertions(+)
> 
> diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
> index cda65f7478..2133d9a172 100644
> --- a/arch/arm/mach-mvebu/Kconfig
> +++ b/arch/arm/mach-mvebu/Kconfig
> @@ -257,6 +257,7 @@ config MVEBU_SPL_BOOT_DEVICE_SPI
>   	select SPL_SPI_FLASH_SUPPORT
>   	select SPL_SPI_LOAD
>   	select SPL_SPI_SUPPORT
> +	select SPL_BOOTROM_SUPPORT
>   
>   config MVEBU_SPL_BOOT_DEVICE_MMC
>   	bool "SDIO/MMC card"
> @@ -267,14 +268,17 @@ config MVEBU_SPL_BOOT_DEVICE_MMC
>   	select SPL_GPIO_SUPPORT
>   	select SPL_LIBDISK_SUPPORT
>   	select SPL_MMC_SUPPORT
> +	select SPL_BOOTROM_SUPPORT
>   
>   config MVEBU_SPL_BOOT_DEVICE_SATA
>   	bool "SATA"
>   	select SPL_SATA_SUPPORT
>   	select SPL_LIBDISK_SUPPORT
> +	select SPL_BOOTROM_SUPPORT
>   
>   config MVEBU_SPL_BOOT_DEVICE_UART
>   	bool "UART"
> +	select SPL_BOOTROM_SUPPORT
>   
>   endchoice
>   
> diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
> index 16ebb7a59e..836eb18889 100644
> --- a/arch/arm/mach-mvebu/spl.c
> +++ b/arch/arm/mach-mvebu/spl.c
> @@ -79,6 +79,18 @@ u32 spl_boot_device(void)
>   	return get_boot_device();
>   }
>   
> +int board_return_to_bootrom(struct spl_image_info *spl_image,
> +			    struct spl_boot_device *bootdev)
> +{
> +	u32 *regs = *(u32 **)CONFIG_SPL_BOOTROM_SAVE;
> +
> +	printf("Returning to BootROM (return address 0x%08x)...\n", regs[13]);
> +	return_to_bootrom();
> +
> +	/* NOTREACHED - return_to_bootrom() does not return */
> +	hang();
> +}
> +
>   void board_init_f(ulong dummy)
>   {
>   	int ret;
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list