public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Igor Opaniuk <igor.opaniuk@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/5] colibri_imx7: use UUID for rootfs
Date: Wed, 29 May 2019 13:00:39 +0300	[thread overview]
Message-ID: <20190529100043.14802-1-igor.opaniuk@gmail.com> (raw)

From: Igor Opaniuk <igor.opaniuk@toradex.com>

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.

Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---
 include/configs/colibri_imx7.h | 47 ++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 19 deletions(-)

diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h
index 5a4b9801cb..8bc75aba59 100644
--- a/include/configs/colibri_imx7.h
+++ b/include/configs/colibri_imx7.h
@@ -51,14 +51,22 @@
 #define CONFIG_SERVERIP			192.168.10.1
 
 #define EMMC_BOOTCMD \
-	"emmcargs=ip=off root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait\0" \
-	"emmcboot=run setup; " \
+	"set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} ro " \
+		"rootfstype=ext4 rootwait\0" \
+	"emmcboot=run setup; run emmcfinduuid; run set_emmcargs; " \
 		"setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \
 		"${vidargs}; echo Booting from internal eMMC chip...; " \
 		"run m4boot && " \
-		"load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-emmc-${fdt_board}.dtb && " \
-		"load mmc 0:1 ${kernel_addr_r} ${boot_file} && " \
-		"run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
+		"load mmc ${emmcdev}:${emmcbootpart} ${fdt_addr_r} " \
+		"${soc}-colibri-emmc-${fdt_board}.dtb && " \
+		"load mmc ${emmcdev}:${emmcbootpart} ${kernel_addr_r} " \
+		"${boot_file} && run fdt_fixup && " \
+		"bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
+	"emmcbootpart=1\0" \
+	"emmcdev=0\0" \
+	"emmcfinduuid=part uuid mmc ${emmcdev}:${emmcrootpart} uuid\0" \
+	"emmcrootpart=2\0"
+
 
 #define MEM_LAYOUT_ENV_SETTINGS \
 	"bootm_size=0x10000000\0" \
@@ -69,24 +77,25 @@
 	"ramdisk_addr_r=0x82100000\0"
 
 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
-#define SD_BOOTCMD \
-	"sdargs=root=/dev/mmcblk0p2 ro rootwait\0" \
-	"sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \
-	"${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
-	"run m4boot && " \
-	"load mmc 0:1 ${kernel_addr_r} ${kernel_file} && " \
-	"load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
-	"run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
+#define SD_BOOTDEV 0
 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
+#define SD_BOOTDEV 1
+#endif
+
 #define SD_BOOTCMD \
-	"sdargs=root=/dev/mmcblk1p2 ro rootwait\0" \
-	"sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \
+	"set_sdargs=setenv sdargs root=PARTUUID=${uuid} ro rootwait\0" \
+	"sdboot=run setup; run sdfinduuid; run set_sdargs; " \
+	"setenv bootargs ${defargs} ${sdargs} " \
 	"${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
 	"run m4boot && " \
-	"load mmc 1:1 ${kernel_addr_r} ${kernel_file} && " \
-	"load mmc 1:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
-	"run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
-#endif
+	"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=" __stringify(SD_BOOTDEV) "\0" \
+	"sdfinduuid=part uuid mmc ${sddev}:${sdrootpart} uuid\0" \
+	"sdrootpart=2\0"
 
 
 #define NFS_BOOTCMD \
-- 
2.17.1

             reply	other threads:[~2019-05-29 10:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 10:00 Igor Opaniuk [this message]
2019-05-29 10:00 ` [U-Boot] [PATCH v2 2/5] colibri-imx6ull: use UUID for rootfs Igor Opaniuk
2019-06-10  9:41   ` sbabic at denx.de
2019-05-29 10:00 ` [U-Boot] [PATCH v2 3/5] colibri_vf: " Igor Opaniuk
2019-06-10  9:39   ` sbabic at denx.de
2019-05-29 10:00 ` [U-Boot] [PATCH v2 4/5] apalis_imx6: " Igor Opaniuk
2019-06-10  9:59   ` sbabic at denx.de
2019-05-29 10:00 ` [U-Boot] [PATCH v2 5/5] apalis-tk1: " Igor Opaniuk
2019-06-10  9:49   ` sbabic at denx.de
2019-06-10  9:41 ` [U-Boot] [PATCH v2 1/5] colibri_imx7: " sbabic at denx.de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190529100043.14802-1-igor.opaniuk@gmail.com \
    --to=igor.opaniuk@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox