diff mbox series

[U-Boot] mx6slevk: Use PARTUUID to specify the rootfs location

Message ID 1506949897-28845-1-git-send-email-festevam@gmail.com
State Accepted
Commit a0046393dae74364b7a7b7ed5e2af8431a3d680c
Delegated to: Stefano Babic
Headers show
Series [U-Boot] mx6slevk: Use PARTUUID to specify the rootfs location | expand

Commit Message

Fabio Estevam Oct. 2, 2017, 1:11 p.m. UTC
From: Fabio Estevam <fabio.estevam@nxp.com>

mx6slevk can run different kernel versions, such as NXP 4.1 or mainline.
    
Currently the rootfs location is passed via mmcblk number and the
problem with this approach is that the mmcblk number for the SD
card changes depending on the kernel version.
    
In order to avoid such issue, use the UUID method to specify the
rootfs location.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 configs/mx6slevk_defconfig     | 1 +
 configs/mx6slevk_spl_defconfig | 1 +
 include/configs/mx6slevk.h     | 5 +++--
 3 files changed, 5 insertions(+), 2 deletions(-)

Comments

Stefano Babic Oct. 12, 2017, 4:23 p.m. UTC | #1
On 02/10/2017 15:11, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> mx6slevk can run different kernel versions, such as NXP 4.1 or mainline.
>     
> Currently the rootfs location is passed via mmcblk number and the
> problem with this approach is that the mmcblk number for the SD
> card changes depending on the kernel version.
>     
> In order to avoid such issue, use the UUID method to specify the
> rootfs location.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic
Tom Rini Oct. 12, 2017, 7 p.m. UTC | #2
On Mon, Oct 02, 2017 at 10:11:37AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> mx6slevk can run different kernel versions, such as NXP 4.1 or mainline.
>     
> Currently the rootfs location is passed via mmcblk number and the
> problem with this approach is that the mmcblk number for the SD
> card changes depending on the kernel version.
>     
> In order to avoid such issue, use the UUID method to specify the
> rootfs location.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
>  configs/mx6slevk_defconfig     | 1 +
>  configs/mx6slevk_spl_defconfig | 1 +
>  include/configs/mx6slevk.h     | 5 +++--
>  3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/configs/mx6slevk_defconfig b/configs/mx6slevk_defconfig
> index 1c28942..641fa85 100644
> --- a/configs/mx6slevk_defconfig
> +++ b/configs/mx6slevk_defconfig
> @@ -13,6 +13,7 @@ CONFIG_CMD_BOOTZ=y
>  CONFIG_CMD_GPIO=y
>  CONFIG_CMD_I2C=y
>  CONFIG_CMD_MMC=y
> +CONFIG_CMD_PART=y
>  CONFIG_CMD_SF=y
>  CONFIG_CMD_USB=y
>  # CONFIG_CMD_SETEXPR is not set
> diff --git a/configs/mx6slevk_spl_defconfig b/configs/mx6slevk_spl_defconfig
> index 4d4f273..8fadbcc 100644
> --- a/configs/mx6slevk_spl_defconfig
> +++ b/configs/mx6slevk_spl_defconfig
> @@ -21,6 +21,7 @@ CONFIG_CMD_BOOTZ=y
>  CONFIG_CMD_GPIO=y
>  CONFIG_CMD_I2C=y
>  CONFIG_CMD_MMC=y
> +CONFIG_CMD_PART=y
>  CONFIG_CMD_SF=y
>  CONFIG_CMD_USB=y
>  CONFIG_CMD_DHCP=y
> diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
> index 25c83e8..9ddb143 100644
> --- a/include/configs/mx6slevk.h
> +++ b/include/configs/mx6slevk.h
> @@ -53,9 +53,9 @@
>  	"ip_dyn=yes\0" \
>  	"mmcdev=1\0" \
>  	"mmcpart=1\0" \
> -	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
> +	"finduuid=part uuid mmc 1:2 uuid\0" \
>  	"mmcargs=setenv bootargs console=${console},${baudrate} " \
> -		"root=${mmcroot}\0" \
> +		"root=PARTUUID=${uuid} rootwait rw\0" \

Shouldn't mmcpart be changed to 2 here as well and finduud be part uuid
${mmcdev}:${mmcpart} ?  This would also make things a bit more
scriptable for use in other distros.
Fabio Estevam Oct. 12, 2017, 7:10 p.m. UTC | #3
On Thu, Oct 12, 2017 at 4:00 PM, Tom Rini <trini@konsulko.com> wrote:

> Shouldn't mmcpart be changed to 2 here as well and finduud be part uuid
> ${mmcdev}:${mmcpart} ?  This would also make things a bit more
> scriptable for use in other distros.

mmcpart is still used to load kernel and dtb from the fat partition,
so it should remain at 1.

I can probably remove this partition scheme assumptions from U-Boot
and use distro_config instead for the next release.

Thanks


>
> --
> Tom
Tom Rini Oct. 12, 2017, 7:21 p.m. UTC | #4
On Thu, Oct 12, 2017 at 04:10:27PM -0300, Fabio Estevam wrote:
> On Thu, Oct 12, 2017 at 4:00 PM, Tom Rini <trini@konsulko.com> wrote:
> 
> > Shouldn't mmcpart be changed to 2 here as well and finduud be part uuid
> > ${mmcdev}:${mmcpart} ?  This would also make things a bit more
> > scriptable for use in other distros.
> 
> mmcpart is still used to load kernel and dtb from the fat partition,
> so it should remain at 1.
> 
> I can probably remove this partition scheme assumptions from U-Boot
> and use distro_config instead for the next release.

OK, thanks.
diff mbox series

Patch

diff --git a/configs/mx6slevk_defconfig b/configs/mx6slevk_defconfig
index 1c28942..641fa85 100644
--- a/configs/mx6slevk_defconfig
+++ b/configs/mx6slevk_defconfig
@@ -13,6 +13,7 @@  CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
diff --git a/configs/mx6slevk_spl_defconfig b/configs/mx6slevk_spl_defconfig
index 4d4f273..8fadbcc 100644
--- a/configs/mx6slevk_spl_defconfig
+++ b/configs/mx6slevk_spl_defconfig
@@ -21,6 +21,7 @@  CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
index 25c83e8..9ddb143 100644
--- a/include/configs/mx6slevk.h
+++ b/include/configs/mx6slevk.h
@@ -53,9 +53,9 @@ 
 	"ip_dyn=yes\0" \
 	"mmcdev=1\0" \
 	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
+	"finduuid=part uuid mmc 1:2 uuid\0" \
 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
+		"root=PARTUUID=${uuid} rootwait rw\0" \
 	"loadbootscript=" \
 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
 	"bootscript=echo Running bootscript from mmc ...; " \
@@ -63,6 +63,7 @@ 
 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
 	"mmcboot=echo Booting from mmc ...; " \
+		"run finduuid; " \
 		"run mmcargs; " \
 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
 			"if run loadfdt; then " \