[PATCH next v2 4/6] rockchip: rk3588: insert u-boot,spl-boot-device into U-Boot device tree

Kever Yang kever.yang at rock-chips.com
Wed Jan 17 11:16:09 CET 2024


Hi Quentin,

On 2023/11/9 01:25, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz at theobroma-systems.com>
>
> It is possible to boot U-Boot proper from a different storage medium
> than the one used by the BOOTROM to load the SPL. This information is
> stored in the u-boot,spl-boot-device Device Tree property and is
> accessible from U-Boot proper so that it has knowledge at runtime where
> it was loaded from.
>
> Let's add support for this feature for rk3588 the same way it was done
> for px30 and rk3399.
>
> Cc: Quentin Schulz <foss+uboot at 0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz at theobroma-systems.com>
> ---
>   arch/arm/mach-rockchip/rk3588/rk3588.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/rk3588/rk3588.c b/arch/arm/mach-rockchip/rk3588/rk3588.c
> index b1f535fad50..fde5f281b0a 100644
> --- a/arch/arm/mach-rockchip/rk3588/rk3588.c
> +++ b/arch/arm/mach-rockchip/rk3588/rk3588.c
> @@ -163,3 +163,11 @@ int arch_cpu_init(void)
>   	return 0;
>   }
>   #endif
> +
> +#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)
> +const char * const spl_boot_devices[BOOT_DEVICE_NONE + 1] = {
> +	[BOOT_DEVICE_MMC2] = "/mmc at fe2e0000",
> +	[BOOT_DEVICE_MMC1] = "/mmc at fe2c0000",

This may be wrong because I found that the mmc0 alias is not the same 
for all the boards.

Rockchip platform do set SD card alias as mmc0 before no alias used by 
kernel, and after kernel enable

the use of alias, the different board has different mmc0:

arch/arm/dts/rk3588-rock-5b.dts:        mmc0 = &sdhci;
arch/arm/dts/rk3588-edgeble-neu6b.dtsi:        mmc0 = &sdhci;
arch/arm/dts/rk3588s-orangepi-5.dts:        mmc0 = &sdmmc;
arch/arm/dts/rk3588s-rock-5a.dts:        mmc0 = &sdhci;
arch/arm/dts/rk3588-edgeble-neu6b-io-u-boot.dtsi:        mmc0 = &sdmmc;
arch/arm/dts/rk3588-edgeble-neu6a.dtsi:        mmc0 = &sdhci;
arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi:        mmc0 = &sdmmc;
arch/arm/dts/rk3588-quartzpro64.dts:        mmc0 = &sdhci;
arch/arm/dts/rk3588-evb1-v10.dts:        mmc0 = &sdhci;
arch/arm/dts/rk3588-orangepi-5-plus.dts:        mmc0 = &sdhci;
arch/arm/dts/rk3588-nanopc-t6.dts:        mmc0 = &sdhci;


Thanks,
- Kever
> +	[BOOT_DEVICE_SPI] = "/spi at fe2b0000/flash at 0",
> +};
> +#endif
>


More information about the U-Boot mailing list