public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] x86: theadorable-x86: Generate and pass root=PARTUUID instead of /dev/sdaX
Date: Mon, 22 Oct 2018 14:07:55 +0200	[thread overview]
Message-ID: <20181022120756.4523-3-sr@denx.de> (raw)
In-Reply-To: <20181022120756.4523-1-sr@denx.de>

To enable the root device selection (kernel cmd-line) via PARTUUID, this
patch enables CMD_PART on all missing theadorable-x86 boards and
changes the default environment to generate the root=PARTUUID string
automatically.

This fixes problems that have been noticed on systems with multiple
SATA/AHCI controller connected via PCIe, where the device name for the
root device / partition (/dev/sdaX) was incorrect.

Signed-off-by: Stefan Roese <sr@denx.de>
---
 ...able-x86-conga-qa3-e3845-pcie-x4_defconfig |  1 +
 .../theadorable-x86-conga-qa3-e3845_defconfig |  1 +
 include/configs/theadorable-x86-common.h      | 35 +++++++++++--------
 3 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig b/configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig
index a3865024e8..e9febb465b 100644
--- a/configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig
+++ b/configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
diff --git a/configs/theadorable-x86-conga-qa3-e3845_defconfig b/configs/theadorable-x86-conga-qa3-e3845_defconfig
index 8cd170feb7..ee3d7f01ab 100644
--- a/configs/theadorable-x86-conga-qa3-e3845_defconfig
+++ b/configs/theadorable-x86-conga-qa3-e3845_defconfig
@@ -25,6 +25,7 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
diff --git a/include/configs/theadorable-x86-common.h b/include/configs/theadorable-x86-common.h
index dd2bfb0a10..e0a033bec1 100644
--- a/include/configs/theadorable-x86-common.h
+++ b/include/configs/theadorable-x86-common.h
@@ -62,33 +62,40 @@
 		"then run swupdate;"				\
 		"else run yocto_boot;run swupdate;"		\
 		"fi\0"						\
+	"setroot=part uuid scsi 0:${partnr} uuid;"		\
+		"setenv root PARTUUID=${uuid}\0"		\
+	"setroot_ubuntu=setenv partnr ${ubuntu_part};run setroot\0" \
+	"setroot_yocto=setenv partnr ${yocto_part};run setroot\0" \
 	"ubuntu_args=setenv bootargs "				\
-		"root=/dev/sda${ubuntu_part} ro\0"		\
+		"root=${root} ro\0"				\
 	"ubuntu_args_quiet=setenv bootargs "			\
-		"root=/dev/sda${ubuntu_part} ro quiet\0"	\
+		"root=${root} ro quiet\0"			\
 	"ubuntu_load=load scsi 0:${ubuntu_part} 03000000 "	\
 		"/boot/vmlinuz-${kernel-ver};"			\
 		"load scsi 0:${ubuntu_part} 04000000 "		\
 		"/boot/initrd.img-${kernel-ver}\0"		\
-	"ubuntu_boot=run ubuntu_args_quiet addmtd addmisc "	\
-		"ubuntu_load boot\0"				\
-	"ubuntu_boot_console=run ubuntu_args addtty_ubuntu "	\
+	"ubuntu_boot=run setroot_ubuntu ubuntu_args_quiet "	\
 		"addmtd addmisc ubuntu_load boot\0"		\
-	"net_args=setenv bootargs root=/dev/sda${ubuntu_part} ro\0" \
-	"net_boot=run start_eth net_args addtty_yocto addmtd addmisc;" \
+	"ubuntu_boot_console=run setroot_ubuntu ubuntu_args "	\
+		"addtty_ubuntu addmtd addmisc ubuntu_load boot\0" \
+	"net_args=setenv bootargs root=${root} ro\0"		\
+	"net_boot=run start_eth setroot_ubuntu net_args "	\
+		"addtty_ubuntu addmtd addmisc;"			\
 		"tftp 03000000 ${tftpdir}/bzImage;"		\
 		"load scsi 0:${ubuntu_part} 04000000 "		\
 		"/boot/initrd.img-${kernel-ver};"		\
 		"run boot\0"					\
-	"yocto_args=setenv bootargs root=/dev/sda${yocto_part} " \
-		"panic=1\0"				\
-	"yocto_args_fast=setenv bootargs root=/dev/sda${yocto_part} " \
+	"yocto_args=setenv bootargs root=${root} "		\
+		"panic=1\0"					\
+	"yocto_args_fast=setenv bootargs root=${root} "		\
 		"quiet panic=1\0"				\
-	"yocto_boot=run yocto_args addmtd addmisc addtty_yocto;" \
+	"yocto_boot=run setroot_yocto yocto_args addmtd addmisc " \
+		"addtty_yocto;"	\
 		"if run yocto_load;then zboot 03000000;fi\0"	\
-	"yocto_boot_fast=run yocto_args_fast addmtd addmisc "	\
-		"addtty_yocto yocto_load;zboot 03000000\0"	\
-	"yocto_boot_tftp=run yocto_args addmtd addmisc addtty_yocto " \
+	"yocto_boot_fast=run setroot_yocto yocto_args_fast addmtd " \
+		"addmisc addtty_yocto yocto_load;zboot 03000000\0" \
+	"yocto_boot_tftp=run setroot_yocto yocto_args addmtd "	\
+		"addmisc addtty_yocto "				\
 		"start_eth yocto_load_tftp;zboot 03000000\0"	\
 	"yocto_kernel=bzImage\0"				\
 	"yocto_load=load scsi 0:${yocto_part} 03000000 "	\
-- 
2.19.1

  parent reply	other threads:[~2018-10-22 12:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 12:07 [U-Boot] [PATCH 1/4] x86: BayTrail: southcluster.asl: Change PCI 64 bit address range / region Stefan Roese
2018-10-22 12:07 ` [U-Boot] [PATCH 2/4] x86: theadorable-x86-common: Change pci hotplug cmdline parameters (again) Stefan Roese
2018-10-23  4:54   ` Bin Meng
2018-10-25 13:05     ` Bin Meng
2018-10-22 12:07 ` Stefan Roese [this message]
2018-10-23  4:54   ` [U-Boot] [PATCH 3/4] x86: theadorable-x86: Generate and pass root=PARTUUID instead of /dev/sdaX Bin Meng
2018-10-25 13:05     ` Bin Meng
2018-10-22 12:07 ` [U-Boot] [PATCH 4/4] x86: theadorable-x86-xxx_defconfig: Move VGA BIOS to make room for U-Boot Stefan Roese
2018-10-23  4:54   ` Bin Meng
2018-10-25 13:05     ` Bin Meng
2018-10-23  4:54 ` [U-Boot] [PATCH 1/4] x86: BayTrail: southcluster.asl: Change PCI 64 bit address range / region Bin Meng
2018-10-25 13:05   ` Bin Meng

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=20181022120756.4523-3-sr@denx.de \
    --to=sr@denx.de \
    --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