[U-Boot] [PATCH 1/4] wandboard: Set fdt based on board_rev and board_name

From: Fabio Berton fabio.berton@ossystems.com.br
New kernel linux-wandboard version 4.1.15_1.1.0_ga changed device tree name adding board revision on file name. The new names are:
- imx6dl-wandboard-revb1 - imx6dl-wandboard-revc1 - imx6q-wandboard-revb1 - imx6q-wandboard-revc1
This fixes the Wandboard C1 revision device tree files.
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br ---
include/configs/wandboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h index 2a6c6fbb70..4291be4068 100644 --- a/include/configs/wandboard.h +++ b/include/configs/wandboard.h @@ -105,9 +105,9 @@ "fi\0" \ "findfdt="\ "if test $board_name = C1 && test $board_rev = MX6Q ; then " \ - "setenv fdtfile imx6q-wandboard.dtb; fi; " \ + "setenv fdtfile imx6q-wandboard-revc1.dtb; fi; " \ "if test $board_name = C1 && test $board_rev = MX6DL ; then " \ - "setenv fdtfile imx6dl-wandboard.dtb; fi; " \ + "setenv fdtfile imx6dl-wandboard-revc1.dtb; fi; " \ "if test $board_name = B1 && test $board_rev = MX6Q ; then " \ "setenv fdtfile imx6q-wandboard-revb1.dtb; fi; " \ "if test $board_name = B1 && test $board_rev = MX6DL ; then " \

From: Fabio Berton fabio.berton@ossystems.com.br
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.
This change was made based on U-Boot commit:
- ca4f338e2efece5196eb2178e5f7d07be828da6e
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br ---
include/configs/wandboard.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h index 4291be4068..88d387f025 100644 --- a/include/configs/wandboard.h +++ b/include/configs/wandboard.h @@ -89,6 +89,7 @@ "fdt_addr=0x18000000\0" \ "ip_dyn=yes\0" \ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ + "finduuid=part uuid mmc 0:1 uuid\0" \ "update_sd_firmware_filename=u-boot.imx\0" \ "update_sd_firmware=" \ "if test ${ip_dyn} = yes; then " \ @@ -130,6 +131,7 @@
#define CONFIG_BOOTCOMMAND \ "run findfdt; " \ + "run finduuid; " \ "run distro_bootcmd"
#include <config_distro_bootcmd.h>

On Mon, Jul 10, 2017 at 5:04 PM, Otavio Salvador otavio@ossystems.com.br wrote:
From: Fabio Berton fabio.berton@ossystems.com.br
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.
This change was made based on U-Boot commit:
- ca4f338e2efece5196eb2178e5f7d07be828da6e
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br
Reviewed-by: Fabio Estevam fabio.estevam@nxp.com

From: Fabio Berton fabio.berton@ossystems.com.br
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.
This change was made based on U-Boot commit:
- ca4f338e2efece5196eb2178e5f7d07be828da6e
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br ---
include/configs/mx6cuboxi.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h index bc22f56d1d..35a9ef6df7 100644 --- a/include/configs/mx6cuboxi.h +++ b/include/configs/mx6cuboxi.h @@ -84,6 +84,7 @@ "console=" CONSOLE_DEV ",115200\0" \ "bootm_size=0x10000000\0" \ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ + "finduuid=part uuid mmc 0:1 uuid\0" \ "update_sd_firmware=" \ "if test ${ip_dyn} = yes; then " \ "setenv get_cmd dhcp; " \ @@ -112,6 +113,7 @@
#define CONFIG_BOOTCOMMAND \ "run findfdt; " \ + "run finduuid; " \ "run distro_bootcmd"
#define BOOT_TARGET_DEVICES(func) \

On Mon, Jul 10, 2017 at 5:04 PM, Otavio Salvador otavio@ossystems.com.br wrote:
From: Fabio Berton fabio.berton@ossystems.com.br
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.
This change was made based on U-Boot commit:
- ca4f338e2efece5196eb2178e5f7d07be828da6e
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br
Reviewed-by: Fabio Estevam fabio.estevam@nxp.com

From: Fabio Berton fabio.berton@ossystems.com.br
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.
Also add CONFIG_BOOTCOMMAND to run finduuid function and distro_bootcmd.
This change was made based on U-Boot commit:
- ca4f338e2efece5196eb2178e5f7d07be828da6e
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br ---
include/configs/embestmx6boards.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/configs/embestmx6boards.h b/include/configs/embestmx6boards.h index 749a9e3bc1..61f0c95d55 100644 --- a/include/configs/embestmx6boards.h +++ b/include/configs/embestmx6boards.h @@ -15,7 +15,6 @@
#define CONFIG_MXC_UART_BASE UART2_BASE #define CONSOLE_DEV "ttymxc1" -#define CONFIG_MMCROOT "/dev/mmcblk1p2"
#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
@@ -140,6 +139,10 @@ func(PXE, pxe, na) \ func(DHCP, dhcp, na)
+#define CONFIG_BOOTCOMMAND \ + "run finduuid; " \ + "run distro_bootcmd" + #include <config_distro_bootcmd.h>
#define CONSOLE_STDIN_SETTINGS \ @@ -157,6 +160,7 @@ CONSOLE_ENV_SETTINGS \ MEM_LAYOUT_ENV_SETTINGS \ "fdtfile=" CONFIG_FDTFILE "\0" \ + "finduuid=part uuid mmc 0:1 uuid\0" \ BOOTENV
#endif /* __RIOTBOARD_CONFIG_H */

On Mon, Jul 10, 2017 at 5:04 PM, Otavio Salvador otavio@ossystems.com.br wrote:
From: Fabio Berton fabio.berton@ossystems.com.br
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.
Also add CONFIG_BOOTCOMMAND to run finduuid function and distro_bootcmd.
This change was made based on U-Boot commit:
- ca4f338e2efece5196eb2178e5f7d07be828da6e
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br
Reviewed-by: Fabio Estevam fabio.estevam@nxp.com

On Mon, Jul 10, 2017 at 5:04 PM, Otavio Salvador otavio@ossystems.com.br wrote:
From: Fabio Berton fabio.berton@ossystems.com.br
New kernel linux-wandboard version 4.1.15_1.1.0_ga changed device tree name adding board revision on file name. The new names are:
- imx6dl-wandboard-revb1
- imx6dl-wandboard-revc1
- imx6q-wandboard-revb1
- imx6q-wandboard-revc1
This fixes the Wandboard C1 revision device tree files.
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br
include/configs/wandboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h index 2a6c6fbb70..4291be4068 100644 --- a/include/configs/wandboard.h +++ b/include/configs/wandboard.h @@ -105,9 +105,9 @@ "fi\0" \ "findfdt="\ "if test $board_name = C1 && test $board_rev = MX6Q ; then " \
"setenv fdtfile imx6q-wandboard.dtb; fi; " \
"setenv fdtfile imx6q-wandboard-revc1.dtb; fi; " \
This breaks the usage of mainline kernel as there is no -revc1 suffix in the wandboard dtb files there.
linux-wandboard needs to rename the dts files like mainline does:
imx6q-wandboard.dtb (for rev C1) imx6q-wandboard-revb1.dtb imx6dl-wandboard.dtb (for rev C1) imx6dl-wandboard-revb1.dtb
If they can't rename their dts, then they would need to carry this patch on their own U-Boot tree.

On Mon, Jul 10, 2017 at 5:14 PM, Fabio Estevam festevam@gmail.com wrote:
On Mon, Jul 10, 2017 at 5:04 PM, Otavio Salvador otavio@ossystems.com.br wrote:
From: Fabio Berton fabio.berton@ossystems.com.br
New kernel linux-wandboard version 4.1.15_1.1.0_ga changed device tree name adding board revision on file name. The new names are:
- imx6dl-wandboard-revb1
- imx6dl-wandboard-revc1
- imx6q-wandboard-revb1
- imx6q-wandboard-revc1
This fixes the Wandboard C1 revision device tree files.
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br
include/configs/wandboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h index 2a6c6fbb70..4291be4068 100644 --- a/include/configs/wandboard.h +++ b/include/configs/wandboard.h @@ -105,9 +105,9 @@ "fi\0" \ "findfdt="\ "if test $board_name = C1 && test $board_rev = MX6Q ; then " \
"setenv fdtfile imx6q-wandboard.dtb; fi; " \
"setenv fdtfile imx6q-wandboard-revc1.dtb; fi; " \
This breaks the usage of mainline kernel as there is no -revc1 suffix in the wandboard dtb files there.
linux-wandboard needs to rename the dts files like mainline does:
imx6q-wandboard.dtb (for rev C1) imx6q-wandboard-revb1.dtb imx6dl-wandboard.dtb (for rev C1) imx6dl-wandboard-revb1.dtb
If they can't rename their dts, then they would need to carry this patch on their own U-Boot tree.
No problem; I am sending it here so people can look and if there is interest possibly help improving Wandboard kernel. We carry this on u-boot-fslc fork so it is fine for me.

On Mon, Jul 10, 2017 at 3:30 PM, Otavio Salvador otavio.salvador@ossystems.com.br wrote:
On Mon, Jul 10, 2017 at 5:14 PM, Fabio Estevam festevam@gmail.com wrote:
On Mon, Jul 10, 2017 at 5:04 PM, Otavio Salvador otavio@ossystems.com.br wrote:
From: Fabio Berton fabio.berton@ossystems.com.br
New kernel linux-wandboard version 4.1.15_1.1.0_ga changed device tree name adding board revision on file name. The new names are:
- imx6dl-wandboard-revb1
- imx6dl-wandboard-revc1
- imx6q-wandboard-revb1
- imx6q-wandboard-revc1
This fixes the Wandboard C1 revision device tree files.
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br
include/configs/wandboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h index 2a6c6fbb70..4291be4068 100644 --- a/include/configs/wandboard.h +++ b/include/configs/wandboard.h @@ -105,9 +105,9 @@ "fi\0" \ "findfdt="\ "if test $board_name = C1 && test $board_rev = MX6Q ; then " \
"setenv fdtfile imx6q-wandboard.dtb; fi; " \
"setenv fdtfile imx6q-wandboard-revc1.dtb; fi; " \
This breaks the usage of mainline kernel as there is no -revc1 suffix in the wandboard dtb files there.
linux-wandboard needs to rename the dts files like mainline does:
imx6q-wandboard.dtb (for rev C1) imx6q-wandboard-revb1.dtb imx6dl-wandboard.dtb (for rev C1) imx6dl-wandboard-revb1.dtb
If they can't rename their dts, then they would need to carry this patch on their own U-Boot tree.
No problem; I am sending it here so people can look and if there is interest possibly help improving Wandboard kernel. We carry this on u-boot-fslc fork so it is fine for me.
How do you guys want to do the revd1'?
imx6<>-wandboard-revd1.dtb ?
https://github.com/wandboard-org/linux/commit/e093a1186879eef78d91f22f1e4708...
(let's make sure we don't rename the dtb like we did in the revb1 -> revc1 era, that was shortsighted mess)
Regards,

On Mon, Jul 10, 2017 at 6:14 PM, Robert Nelson robertcnelson@gmail.com wrote:
How do you guys want to do the revd1'?
imx6<>-wandboard-revd1.dtb ?
https://github.com/wandboard-org/linux/commit/e093a1186879eef78d91f22f1e4708...
Looking at this dts it seems we only need to add a imx6qp variant.
The other revd1 changes do not affect mainline as far as I can see.
I don't have access to a imx6qp wandboard myself to mainline the dts.

On Mon, Jul 10, 2017 at 4:24 PM, Fabio Estevam festevam@gmail.com wrote:
On Mon, Jul 10, 2017 at 6:14 PM, Robert Nelson robertcnelson@gmail.com wrote:
How do you guys want to do the revd1'?
imx6<>-wandboard-revd1.dtb ?
https://github.com/wandboard-org/linux/commit/e093a1186879eef78d91f22f1e4708...
Looking at this dts it seems we only need to add a imx6qp variant.
The other revd1 changes do not affect mainline as far as I can see.
I don't have access to a imx6qp wandboard myself to mainline the dts.
They added a real pmic, to the board: ;)
https://github.com/wandboard-org/linux/commit/e093a1186879eef78d91f22f1e4708...
I've recently picked up the quad/quadplus, but been to busy to test u-boot/kernel on it yet..
Regards,

Hi Otavio, Fabio,
On 10/07/2017 22:04, Otavio Salvador wrote:
From: Fabio Berton fabio.berton@ossystems.com.br
New kernel linux-wandboard version 4.1.15_1.1.0_ga changed device tree name adding board revision on file name. The new names are:
- imx6dl-wandboard-revb1
- imx6dl-wandboard-revc1
- imx6q-wandboard-revb1
- imx6q-wandboard-revc1
This fixes the Wandboard C1 revision device tree files.
Signed-off-by: Fabio Berton fabio.berton@ossystems.com.br Signed-off-by: Otavio Salvador otavio@ossystems.com.br
include/configs/wandboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h index 2a6c6fbb70..4291be4068 100644 --- a/include/configs/wandboard.h +++ b/include/configs/wandboard.h @@ -105,9 +105,9 @@ "fi\0" \ "findfdt="\ "if test $board_name = C1 && test $board_rev = MX6Q ; then " \
"setenv fdtfile imx6q-wandboard.dtb; fi; " \
"if test $board_name = C1 && test $board_rev = MX6DL ; then " \"setenv fdtfile imx6q-wandboard-revc1.dtb; fi; " \
"setenv fdtfile imx6dl-wandboard.dtb; fi; " \
"if test $board_name = B1 && test $board_rev = MX6Q ; then " \ "setenv fdtfile imx6q-wandboard-revb1.dtb; fi; " \ "if test $board_name = B1 && test $board_rev = MX6DL ; then " \"setenv fdtfile imx6dl-wandboard-revc1.dtb; fi; " \
Fine with me - I will push the series to -next.
Best regards, Stefano

Hi Stefano,
On Tue, Jul 11, 2017 at 7:57 AM, Stefano Babic sbabic@denx.de wrote:
Fine with me - I will push the series to -next.
Please do not apply this one 1/4 as it will break the usage of U-Boot with mainline kernel.
The other three patches are OK.
Thanks

On 11/07/2017 12:59, Fabio Estevam wrote:
Hi Stefano,
On Tue, Jul 11, 2017 at 7:57 AM, Stefano Babic sbabic@denx.de wrote:
Fine with me - I will push the series to -next.
Please do not apply this one 1/4 as it will break the usage of U-Boot with mainline kernel.
imx6dl-wandboard.dts is already for C1. Thanks for pointing this !
The other three patches are OK.
Ok, they will be merged.
Regards, Stefano
participants (5)
-
Fabio Estevam
-
Otavio Salvador
-
Otavio Salvador
-
Robert Nelson
-
Stefano Babic