diff mbox series

[U-Boot,3/5] colibri_vf: use UUID for rootfs

Message ID 20190513091555.14037-3-igor.opaniuk@toradex.com
State Superseded
Delegated to: Stefano Babic
Headers show
Series [U-Boot,1/5] colibri_imx7: use UUID for rootfs | expand

Commit Message

Igor Opaniuk May 13, 2019, 9:15 a.m. UTC
Replace usage of "/dev/mmcblk*p*" with a proper UUID of rootfs
partition. This fixes the issue, when MMC controllers are probed in
a different order in U-boot and Linux kernel.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---
 include/configs/colibri_vf.h | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Comments

Marcel Ziswiler May 24, 2019, 7:47 a.m. UTC | #1
On Mon, 2019-05-13 at 12:15 +0300, Igor Opaniuk wrote:
> Replace usage of "/dev/mmcblk*p*" with a proper UUID of rootfs
> partition. This fixes the issue, when MMC controllers are probed in
> a different order in U-boot and Linux kernel.
> 
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>

Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>

> ---
>  include/configs/colibri_vf.h | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/include/configs/colibri_vf.h
> b/include/configs/colibri_vf.h
> index 0d57e303a1..da9a8426ec 100644
> --- a/include/configs/colibri_vf.h
> +++ b/include/configs/colibri_vf.h
> @@ -68,12 +68,19 @@
>  	"run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
>  
>  #define SD_BOOTCMD \
> -	"sdargs=root=/dev/mmcblk0p2 ro rootwait\0"	\
> -	"sdboot=run setup; setenv bootargs ${defargs} ${sdargs}
> ${mtdparts} " \
> +	"set_sdargs=setenv sdargs root=PARTUUID=${uuid} ro rootwait\0"	
> \
> +	"sdboot=run setup; run sdfinduuid; run set_sdargs; " \
> +	"setenv bootargs ${defargs} ${sdargs} ${mtdparts} " \
>  	"${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
> -	"load mmc 0:1 ${kernel_addr_r} ${kernel_file} && " \
> -	"load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb &&
> " \
> +	"load mmc ${sddev}:${sdbootpart} ${kernel_addr_r}
> ${kernel_file} && " \
> +	"load mmc ${sddev}:${sdbootpart} ${fdt_addr_r} " \
> +		"${soc}-colibri-${fdt_board}.dtb && " \
>  	"run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
> +	"sdbootpart=1\0" \
> +	"sddev=0\0" \
> +	"sdfinduuid=part uuid mmc ${sddev}:${sdrootpart} uuid\0" \
> +	"sdrootpart=2\0"
> +
>  
>  #define UBI_BOOTCMD \
>  	"ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
diff mbox series

Patch

diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 0d57e303a1..da9a8426ec 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -68,12 +68,19 @@ 
 	"run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
 
 #define SD_BOOTCMD \
-	"sdargs=root=/dev/mmcblk0p2 ro rootwait\0"	\
-	"sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${mtdparts} " \
+	"set_sdargs=setenv sdargs root=PARTUUID=${uuid} ro rootwait\0"	\
+	"sdboot=run setup; run sdfinduuid; run set_sdargs; " \
+	"setenv bootargs ${defargs} ${sdargs} ${mtdparts} " \
 	"${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
-	"load mmc 0:1 ${kernel_addr_r} ${kernel_file} && " \
-	"load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
+	"load mmc ${sddev}:${sdbootpart} ${kernel_addr_r} ${kernel_file} && " \
+	"load mmc ${sddev}:${sdbootpart} ${fdt_addr_r} " \
+		"${soc}-colibri-${fdt_board}.dtb && " \
 	"run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
+	"sdbootpart=1\0" \
+	"sddev=0\0" \
+	"sdfinduuid=part uuid mmc ${sddev}:${sdrootpart} uuid\0" \
+	"sdrootpart=2\0"
+
 
 #define UBI_BOOTCMD \
 	"ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \