[SPAM] [PATCH 1/2] rockchip: rk3399: fix incorrect boot-device in u-boot, spl-boot-device

Xavier Drudis Ferran xdrudis at tinet.cat
Mon Jul 18 23:10:49 CEST 2022


El Fri, Jul 15, 2022 at 05:15:51PM +0200, Quentin Schulz deia:
> From: Quentin Schulz <quentin.schulz at theobroma-systems.com>
> 
> On RK3399, mmc0 is eMMC and mmc1 is SD card, c.f. console:
> MMC:   mmc at fe320000: 1, mmc at fe330000: 0
> 
> In arch/arm/mach-rockchip/spl-boot-order.c:board_boot_order, the
> boot_device (BOOT_DEVICE_*) value is gotten from spl_node_to_boot_device
> function. Said function returns BOOT_DEVICE_MMC1 for mmc0 (eMMC) and
> BOOT_DEVICE_MMC2 for mmc1 (SD card).
> 
> Since the SD card controller is at mmc at fe320000, it should be associated
> with BOOT_DEVICE_MMC2 and not BOOT_DEVICE_MMC1. Same applies to eMMC.
> 
> Let's fix that by swapping the two BOOT_DEVICEs.
> 
> Cc: Quentin Schulz <foss+uboot at 0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz at theobroma-systems.com>

There's a thread here on what the proper naming would be
https://lists.denx.de/pipermail/u-boot/2022-July/489155.html

I agree it's not been consistent, and I'd do it like in this patch,
but I don't feel strongly about any option nor pretend to stop any
discussion.

Tested on a Rock-Pi-4B and didn't see any regression.
Tested-by: Xavier Drudis Ferran <xdrudis at tinet.cat>



> ---
>  arch/arm/mach-rockchip/rk3399/rk3399.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
> index 691d69dc59..f280cb1dbf 100644
> --- a/arch/arm/mach-rockchip/rk3399/rk3399.c
> +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
> @@ -180,8 +180,8 @@ const char *spl_decode_boot_device(u32 boot_device)
>  		u32 boot_device;
>  		const char *ofpath;
>  	} spl_boot_devices_tbl[] = {
> -		{ BOOT_DEVICE_MMC1, "/mmc at fe320000" },
> -		{ BOOT_DEVICE_MMC2, "/mmc at fe330000" },
> +		{ BOOT_DEVICE_MMC2, "/mmc at fe320000" },
> +		{ BOOT_DEVICE_MMC1, "/mmc at fe330000" },
>  		{ BOOT_DEVICE_SPI, "/spi at ff1d0000" },
>  	};
>  
> -- 
> 2.36.1
> 


More information about the U-Boot mailing list