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

warp 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 eMMC changes depending on the kernel version.
In order to avoid such issue, use UUID method to specify the rootfs location.
Succesfully tested booting a NXP 4.1 and also a mainline 4.12 kernel.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- configs/warp_defconfig | 1 + include/configs/warp.h | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/configs/warp_defconfig b/configs/warp_defconfig index e29afe7..36b3b16 100644 --- a/configs/warp_defconfig +++ b/configs/warp_defconfig @@ -10,6 +10,7 @@ CONFIG_CMD_BOOTZ=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set CONFIG_CMD_MMC=y +CONFIG_CMD_PART=y CONFIG_CMD_I2C=y CONFIG_CMD_USB=y CONFIG_CMD_DFU=y diff --git a/include/configs/warp.h b/include/configs/warp.h index e3f79b1..3898315 100644 --- a/include/configs/warp.h +++ b/include/configs/warp.h @@ -95,10 +95,10 @@ "ip_dyn=yes\0" \ "mmcdev=0\0" \ "mmcpart=1\0" \ - "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ + "finduuid=part uuid mmc 0:2 uuid\0" \ "dfu_alt_info=boot raw 0x2 0x400 mmcpart 1\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 ...; " \ @@ -106,6 +106,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 " \

On Tue, Jul 11, 2017 at 2:24 PM, Fabio Estevam fabio.estevam@nxp.com wrote:
warp 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 eMMC changes depending on the kernel version.
In order to avoid such issue, use UUID method to specify the rootfs location.
Succesfully tested booting a NXP 4.1 and also a mainline 4.12 kernel.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Acked-by: Otavio Salvador otavio@ossystems.com.br

On 11/07/2017 19:24, Fabio Estevam wrote:
warp 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 eMMC changes depending on the kernel version.
In order to avoid such issue, use UUID method to specify the rootfs location.
Succesfully tested booting a NXP 4.1 and also a mainline 4.12 kernel.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Applied to -master, thanks !
Best regards, Stefano Babic
participants (3)
-
Fabio Estevam
-
Otavio Salvador
-
Stefano Babic