All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to distro boot support
@ 2018-04-06 10:05 Guillaume GARDET
  2018-04-09  6:39 ` [U-Boot] [PATCH V2] " Guillaume GARDET
  2018-04-09 14:40 ` [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to " Gary Bisson
  0 siblings, 2 replies; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-06 10:05 UTC (permalink / raw)
  To: u-boot

Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
---
 include/configs/nitrogen6x.h | 86 ++++++++++----------------------------------
 1 file changed, 18 insertions(+), 68 deletions(-)

diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index c73cfb7f7e..2e2c499cb6 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -102,82 +102,32 @@
 #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
 
 #if defined(CONFIG_SABRELITE)
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(MMC, mmc, 1) \
+	func(SATA, sata, 0) \
+	func(USB, usb, 0) \
+	func(PXE, pxe, na) \
+	func(DHCP, dhcp, na)
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"script=boot.scr\0" \
-	"uimage=uImage\0" \
 	"console=ttymxc1\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
-	"fdt_file=imx6q-sabrelite.dtb\0" \
+	"fdtfile=imx6q-sabrelite.dtb\0" \
 	"fdt_addr=0x18000000\0" \
-	"boot_fdt=try\0" \
+	"fdt_addr_r=0x18000000\0" \
+	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"  \
+	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
+	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+	"ramdisk_addr_r=0x13000000\0" \
+	"ramdiskaddr=0x13000000\0" \
 	"ip_dyn=yes\0" \
 	"usb_pgood_delay=2000\0" \
-	"mmcdevs=0 1\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
-	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
-	"loadbootscript=" \
-		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
-		"source\0" \
-	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
-	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-	"mmcboot=echo Booting from mmc ...; " \
-		"run mmcargs; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if run loadfdt; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0" \
-	"netargs=setenv bootargs console=${console},${baudrate} " \
-		"root=/dev/nfs " \
-	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-		"netboot=echo Booting from net ...; " \
-		"run netargs; " \
-		"if test ${ip_dyn} = yes; then " \
-			"setenv get_cmd dhcp; " \
-		"else " \
-			"setenv get_cmd tftp; " \
-		"fi; " \
-		"${get_cmd} ${uimage}; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0"
+	BOOTENV
 
-#define CONFIG_BOOTCOMMAND \
-	"for mmcdev in ${mmcdevs}; do " \
-		"mmc dev ${mmcdev}; " \
-		"if mmc rescan; then " \
-			"if run loadbootscript; then " \
-				"run bootscript; " \
-			"else " \
-				"if run loaduimage; then " \
-					"run mmcboot; " \
-				"fi; " \
-			"fi; " \
-		"fi; " \
-	"done; " \
-	"run netboot; "
 #else
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V2] imx: nitrogen6x: Convert Sabrelite to distro boot support
  2018-04-06 10:05 [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to distro boot support Guillaume GARDET
@ 2018-04-09  6:39 ` Guillaume GARDET
  2018-04-11 10:38   ` [U-Boot] [PATCH V3 0/3] Update sabrelite and nitrogen6x boards to use " Guillaume GARDET
  2018-04-09 14:40 ` [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to " Gary Bisson
  1 sibling, 1 reply; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-09  6:39 UTC (permalink / raw)
  To: u-boot


Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>

---
Changes in V2:
  * add mx6qsabrelite_defconfig update

 configs/mx6qsabrelite_defconfig | 16 ++------
 include/configs/nitrogen6x.h    | 86 +++++++++--------------------------------
 2 files changed, 22 insertions(+), 80 deletions(-)

diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
index 7499704058..c644754929 100644
--- a/configs/mx6qsabrelite_defconfig
+++ b/configs/mx6qsabrelite_defconfig
@@ -3,17 +3,15 @@ CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x17800000
 CONFIG_TARGET_NITROGEN6X=y
 CONFIG_CMD_HDMIDETECT=y
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE"
 CONFIG_BOOTDELAY=3
+# CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
-CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
-CONFIG_SYS_ALT_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -22,21 +20,15 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_DWC_AHSATA=y
-CONFIG_FSL_ESDHC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 7d2cf0bd8c..3161b1dd79 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -102,82 +102,32 @@
 #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
 
 #if defined(CONFIG_SABRELITE)
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(MMC, mmc, 1) \
+	func(SATA, sata, 0) \
+	func(USB, usb, 0) \
+	func(PXE, pxe, na) \
+	func(DHCP, dhcp, na)
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"script=boot.scr\0" \
-	"uimage=uImage\0" \
 	"console=ttymxc1\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
-	"fdt_file=imx6q-sabrelite.dtb\0" \
+	"fdtfile=imx6q-sabrelite.dtb\0" \
 	"fdt_addr=0x18000000\0" \
-	"boot_fdt=try\0" \
+	"fdt_addr_r=0x18000000\0" \
+	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"  \
+	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
+	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+	"ramdisk_addr_r=0x13000000\0" \
+	"ramdiskaddr=0x13000000\0" \
 	"ip_dyn=yes\0" \
 	"usb_pgood_delay=2000\0" \
-	"mmcdevs=0 1\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
-	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
-	"loadbootscript=" \
-		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
-		"source\0" \
-	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
-	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-	"mmcboot=echo Booting from mmc ...; " \
-		"run mmcargs; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if run loadfdt; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0" \
-	"netargs=setenv bootargs console=${console},${baudrate} " \
-		"root=/dev/nfs " \
-	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-		"netboot=echo Booting from net ...; " \
-		"run netargs; " \
-		"if test ${ip_dyn} = yes; then " \
-			"setenv get_cmd dhcp; " \
-		"else " \
-			"setenv get_cmd tftp; " \
-		"fi; " \
-		"${get_cmd} ${uimage}; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0"
+	BOOTENV
 
-#define CONFIG_BOOTCOMMAND \
-	"for mmcdev in ${mmcdevs}; do " \
-		"mmc dev ${mmcdev}; " \
-		"if mmc rescan; then " \
-			"if run loadbootscript; then " \
-				"run bootscript; " \
-			"else " \
-				"if run loaduimage; then " \
-					"run mmcboot; " \
-				"fi; " \
-			"fi; " \
-		"fi; " \
-	"done; " \
-	"run netboot; "
 #else
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to distro boot support
  2018-04-06 10:05 [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to distro boot support Guillaume GARDET
  2018-04-09  6:39 ` [U-Boot] [PATCH V2] " Guillaume GARDET
@ 2018-04-09 14:40 ` Gary Bisson
  2018-04-09 15:17   ` Guillaume Gardet
  2018-04-09 17:27   ` Fabio Estevam
  1 sibling, 2 replies; 42+ messages in thread
From: Gary Bisson @ 2018-04-09 14:40 UTC (permalink / raw)
  To: u-boot

Hi Guillaume,

Thanks for your patch! Switching the upstream nitrogen6x configuration
to distro bootcmd has been in our todo list for some time since we also
use that in our own git repo.

On Fri, Apr 06, 2018 at 12:05:48PM +0200, Guillaume GARDET wrote:
> Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
> 
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> ---
>  include/configs/nitrogen6x.h | 86 ++++++++++----------------------------------
>  1 file changed, 18 insertions(+), 68 deletions(-)
> 
> diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
> index c73cfb7f7e..2e2c499cb6 100644
> --- a/include/configs/nitrogen6x.h
> +++ b/include/configs/nitrogen6x.h
> @@ -102,82 +102,32 @@
>  #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
>  
>  #if defined(CONFIG_SABRELITE)

Please also switch nitrogen6x to it, not only sabrelite.

> +#define BOOT_TARGET_DEVICES(func) \
> +	func(MMC, mmc, 0) \
> +	func(MMC, mmc, 1) \
> +	func(SATA, sata, 0) \
> +	func(USB, usb, 0) \
> +	func(PXE, pxe, na) \

That currently doesn't build because CMD_PXE isn't selected in the
sabrelite defconfig.
"include/config_distro_bootcmd.h:319:2: error: expected ‘}’ before
‘BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE’"

Which brings a good point, all the above should depend on the storage
command being present, like done here [1].

> +	func(DHCP, dhcp, na)
> +
> +#include <config_distro_bootcmd.h>
> +
>  #define CONFIG_EXTRA_ENV_SETTINGS \
> -	"script=boot.scr\0" \
> -	"uimage=uImage\0" \
>  	"console=ttymxc1\0" \
>  	"fdt_high=0xffffffff\0" \
>  	"initrd_high=0xffffffff\0" \
> -	"fdt_file=imx6q-sabrelite.dtb\0" \
> +	"fdtfile=imx6q-sabrelite.dtb\0" \

I wish the default efi_fdtfile would work, Fabio is there any plan to
populate the ${soc} variable like it is done for i.MX7? [2]
Then a small patch in the nitrogen6x.c would set the proper board env
variable.

That way there would be no difference in this header between sabrelite
vs. nitrogen6x.

>  	"fdt_addr=0x18000000\0" \

Do we need to keep fdt_addr since we define fdt_addr_r below?

> -	"boot_fdt=try\0" \
> +	"fdt_addr_r=0x18000000\0" \
> +	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"  \
> +	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
> +	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
> +	"ramdisk_addr_r=0x13000000\0" \
> +	"ramdiskaddr=0x13000000\0" \
>  	"ip_dyn=yes\0" \
>  	"usb_pgood_delay=2000\0" \
> -	"mmcdevs=0 1\0" \
> -	"mmcpart=1\0" \
> -	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
> -	"mmcargs=setenv bootargs console=${console},${baudrate} " \
> -		"root=${mmcroot}\0" \
> -	"loadbootscript=" \
> -		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
> -	"bootscript=echo Running bootscript from mmc ...; " \
> -		"source\0" \
> -	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
> -	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
> -	"mmcboot=echo Booting from mmc ...; " \
> -		"run mmcargs; " \
> -		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> -			"if run loadfdt; then " \
> -				"bootm ${loadaddr} - ${fdt_addr}; " \
> -			"else " \
> -				"if test ${boot_fdt} = try; then " \
> -					"bootm; " \
> -				"else " \
> -					"echo WARN: Cannot load the DT; " \
> -				"fi; " \
> -			"fi; " \
> -		"else " \
> -			"bootm; " \
> -		"fi;\0" \
> -	"netargs=setenv bootargs console=${console},${baudrate} " \
> -		"root=/dev/nfs " \
> -	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
> -		"netboot=echo Booting from net ...; " \
> -		"run netargs; " \
> -		"if test ${ip_dyn} = yes; then " \
> -			"setenv get_cmd dhcp; " \
> -		"else " \
> -			"setenv get_cmd tftp; " \
> -		"fi; " \
> -		"${get_cmd} ${uimage}; " \
> -		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> -			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
> -				"bootm ${loadaddr} - ${fdt_addr}; " \
> -			"else " \
> -				"if test ${boot_fdt} = try; then " \
> -					"bootm; " \
> -				"else " \
> -					"echo WARN: Cannot load the DT; " \
> -				"fi; " \
> -			"fi; " \
> -		"else " \
> -			"bootm; " \
> -		"fi;\0"
> +	BOOTENV
>  
> -#define CONFIG_BOOTCOMMAND \
> -	"for mmcdev in ${mmcdevs}; do " \
> -		"mmc dev ${mmcdev}; " \
> -		"if mmc rescan; then " \
> -			"if run loadbootscript; then " \
> -				"run bootscript; " \
> -			"else " \
> -				"if run loaduimage; then " \
> -					"run mmcboot; " \
> -				"fi; " \
> -			"fi; " \
> -		"fi; " \
> -	"done; " \
> -	"run netboot; "
>  #else
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
> -- 
> 2.13.6

The rest looks good to me.

Regards,
Gary

[1] https://github.com/boundarydevices/u-boot-imx6/blob/boundary-v2017.07/include/configs/boundary.h#L209
[2] http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/mach-imx/mx7/soc.c;hb=HEAD#l188

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to distro boot support
  2018-04-09 14:40 ` [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to " Gary Bisson
@ 2018-04-09 15:17   ` Guillaume Gardet
  2018-04-10 11:50     ` Gary Bisson
  2018-04-09 17:27   ` Fabio Estevam
  1 sibling, 1 reply; 42+ messages in thread
From: Guillaume Gardet @ 2018-04-09 15:17 UTC (permalink / raw)
  To: u-boot



Le 09/04/2018 à 16:40, Gary Bisson a écrit :
> Hi Guillaume,
>
> Thanks for your patch! Switching the upstream nitrogen6x configuration
> to distro bootcmd has been in our todo list for some time since we also
> use that in our own git repo.
>
> On Fri, Apr 06, 2018 at 12:05:48PM +0200, Guillaume GARDET wrote:
>> Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
>>
>> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> Cc: Fabio Estevam <fabio.estevam@nxp.com>
>> ---
>>   include/configs/nitrogen6x.h | 86 ++++++++++----------------------------------
>>   1 file changed, 18 insertions(+), 68 deletions(-)
>>
>> diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
>> index c73cfb7f7e..2e2c499cb6 100644
>> --- a/include/configs/nitrogen6x.h
>> +++ b/include/configs/nitrogen6x.h
>> @@ -102,82 +102,32 @@
>>   #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
>>   
>>   #if defined(CONFIG_SABRELITE)
> Please also switch nitrogen6x to it, not only sabrelite.

Should we keep all the 6x scripts stuff or not?

>
>> +#define BOOT_TARGET_DEVICES(func) \
>> +	func(MMC, mmc, 0) \
>> +	func(MMC, mmc, 1) \
>> +	func(SATA, sata, 0) \
>> +	func(USB, usb, 0) \
>> +	func(PXE, pxe, na) \
> That currently doesn't build because CMD_PXE isn't selected in the
> sabrelite defconfig.
> "include/config_distro_bootcmd.h:319:2: error: expected ‘}’ before
> ‘BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE’"
>
> Which brings a good point, all the above should depend on the storage
> command being present, like done here [1].

No, we just need to update the defconfig, see V2 of this patch sent earlier today.

>
>> +	func(DHCP, dhcp, na)
>> +
>> +#include <config_distro_bootcmd.h>
>> +
>>   #define CONFIG_EXTRA_ENV_SETTINGS \
>> -	"script=boot.scr\0" \
>> -	"uimage=uImage\0" \
>>   	"console=ttymxc1\0" \
>>   	"fdt_high=0xffffffff\0" \
>>   	"initrd_high=0xffffffff\0" \
>> -	"fdt_file=imx6q-sabrelite.dtb\0" \
>> +	"fdtfile=imx6q-sabrelite.dtb\0" \
> I wish the default efi_fdtfile would work, Fabio is there any plan to
> populate the ${soc} variable like it is done for i.MX7? [2]
> Then a small patch in the nitrogen6x.c would set the proper board env
> variable.
>
> That way there would be no difference in this header between sabrelite
> vs. nitrogen6x.
>
>>   	"fdt_addr=0x18000000\0" \
> Do we need to keep fdt_addr since we define fdt_addr_r below?

It was for backward compatibility, if people had some script using it.

>
>> -	"boot_fdt=try\0" \
>> +	"fdt_addr_r=0x18000000\0" \
>> +	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"  \
>> +	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
>> +	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
>> +	"ramdisk_addr_r=0x13000000\0" \
>> +	"ramdiskaddr=0x13000000\0" \
>>   	"ip_dyn=yes\0" \
>>   	"usb_pgood_delay=2000\0" \
>> -	"mmcdevs=0 1\0" \
>> -	"mmcpart=1\0" \
>> -	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
>> -	"mmcargs=setenv bootargs console=${console},${baudrate} " \
>> -		"root=${mmcroot}\0" \
>> -	"loadbootscript=" \
>> -		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
>> -	"bootscript=echo Running bootscript from mmc ...; " \
>> -		"source\0" \
>> -	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
>> -	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
>> -	"mmcboot=echo Booting from mmc ...; " \
>> -		"run mmcargs; " \
>> -		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
>> -			"if run loadfdt; then " \
>> -				"bootm ${loadaddr} - ${fdt_addr}; " \
>> -			"else " \
>> -				"if test ${boot_fdt} = try; then " \
>> -					"bootm; " \
>> -				"else " \
>> -					"echo WARN: Cannot load the DT; " \
>> -				"fi; " \
>> -			"fi; " \
>> -		"else " \
>> -			"bootm; " \
>> -		"fi;\0" \
>> -	"netargs=setenv bootargs console=${console},${baudrate} " \
>> -		"root=/dev/nfs " \
>> -	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
>> -		"netboot=echo Booting from net ...; " \
>> -		"run netargs; " \
>> -		"if test ${ip_dyn} = yes; then " \
>> -			"setenv get_cmd dhcp; " \
>> -		"else " \
>> -			"setenv get_cmd tftp; " \
>> -		"fi; " \
>> -		"${get_cmd} ${uimage}; " \
>> -		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
>> -			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
>> -				"bootm ${loadaddr} - ${fdt_addr}; " \
>> -			"else " \
>> -				"if test ${boot_fdt} = try; then " \
>> -					"bootm; " \
>> -				"else " \
>> -					"echo WARN: Cannot load the DT; " \
>> -				"fi; " \
>> -			"fi; " \
>> -		"else " \
>> -			"bootm; " \
>> -		"fi;\0"
>> +	BOOTENV
>>   
>> -#define CONFIG_BOOTCOMMAND \
>> -	"for mmcdev in ${mmcdevs}; do " \
>> -		"mmc dev ${mmcdev}; " \
>> -		"if mmc rescan; then " \
>> -			"if run loadbootscript; then " \
>> -				"run bootscript; " \
>> -			"else " \
>> -				"if run loaduimage; then " \
>> -					"run mmcboot; " \
>> -				"fi; " \
>> -			"fi; " \
>> -		"fi; " \
>> -	"done; " \
>> -	"run netboot; "
>>   #else
>>   #define CONFIG_EXTRA_ENV_SETTINGS \
>>   	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
>> -- 
>> 2.13.6
> The rest looks good to me.

Ok. Thanks.

Guillaume

>
> Regards,
> Gary
>
> [1] https://github.com/boundarydevices/u-boot-imx6/blob/boundary-v2017.07/include/configs/boundary.h#L209
> [2] http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/mach-imx/mx7/soc.c;hb=HEAD#l188
>

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to distro boot support
  2018-04-09 14:40 ` [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to " Gary Bisson
  2018-04-09 15:17   ` Guillaume Gardet
@ 2018-04-09 17:27   ` Fabio Estevam
  2018-04-10 12:05     ` Gary Bisson
  1 sibling, 1 reply; 42+ messages in thread
From: Fabio Estevam @ 2018-04-09 17:27 UTC (permalink / raw)
  To: u-boot

Hi Gary,

On Mon, Apr 9, 2018 at 11:40 AM, Gary Bisson
<gary.bisson@boundarydevices.com> wrote:

>>  #define CONFIG_EXTRA_ENV_SETTINGS \
>> -     "script=boot.scr\0" \
>> -     "uimage=uImage\0" \
>>       "console=ttymxc1\0" \
>>       "fdt_high=0xffffffff\0" \
>>       "initrd_high=0xffffffff\0" \
>> -     "fdt_file=imx6q-sabrelite.dtb\0" \
>> +     "fdtfile=imx6q-sabrelite.dtb\0" \
>
> I wish the default efi_fdtfile would work, Fabio is there any plan to
> populate the ${soc} variable like it is done for i.MX7? [2]

It seems we didn't need to do this yet, but if you see a need for it,
please post a patch.

Thanks

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to distro boot support
  2018-04-09 15:17   ` Guillaume Gardet
@ 2018-04-10 11:50     ` Gary Bisson
  2018-04-13  5:08       ` Joe Hershberger
  0 siblings, 1 reply; 42+ messages in thread
From: Gary Bisson @ 2018-04-10 11:50 UTC (permalink / raw)
  To: u-boot

Hi Guillaume,

On Mon, Apr 09, 2018 at 05:17:44PM +0200, Guillaume Gardet wrote:
> 
> 
> Le 09/04/2018 à 16:40, Gary Bisson a écrit :
> > Hi Guillaume,
> > 
> > Thanks for your patch! Switching the upstream nitrogen6x configuration
> > to distro bootcmd has been in our todo list for some time since we also
> > use that in our own git repo.
> > 
> > On Fri, Apr 06, 2018 at 12:05:48PM +0200, Guillaume GARDET wrote:
> > > Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
> > > 
> > > Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> > > Cc: Troy Kisky <troy.kisky@boundarydevices.com>
> > > Cc: Stefano Babic <sbabic@denx.de>
> > > Cc: Fabio Estevam <fabio.estevam@nxp.com>
> > > ---
> > >   include/configs/nitrogen6x.h | 86 ++++++++++----------------------------------
> > >   1 file changed, 18 insertions(+), 68 deletions(-)
> > > 
> > > diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
> > > index c73cfb7f7e..2e2c499cb6 100644
> > > --- a/include/configs/nitrogen6x.h
> > > +++ b/include/configs/nitrogen6x.h
> > > @@ -102,82 +102,32 @@
> > >   #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
> > >   #if defined(CONFIG_SABRELITE)
> > Please also switch nitrogen6x to it, not only sabrelite.
> 
> Should we keep all the 6x scripts stuff or not?

No, we need to switch to something standard, let's remove it.

> > > +#define BOOT_TARGET_DEVICES(func) \
> > > +	func(MMC, mmc, 0) \
> > > +	func(MMC, mmc, 1) \
> > > +	func(SATA, sata, 0) \
> > > +	func(USB, usb, 0) \
> > > +	func(PXE, pxe, na) \
> > That currently doesn't build because CMD_PXE isn't selected in the
> > sabrelite defconfig.
> > "include/config_distro_bootcmd.h:319:2: error: expected ‘}’ before
> > ‘BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE’"
> > 
> > Which brings a good point, all the above should depend on the storage
> > command being present, like done here [1].
> 
> No, we just need to update the defconfig, see V2 of this patch sent earlier today.

I know updating the defconfig makes it build. My point is that it would
be more flexible to do like in the link provided so that someone that
removes CMD_PXE from the defconfig for any reason can still build.

> > > +	func(DHCP, dhcp, na)
> > > +
> > > +#include <config_distro_bootcmd.h>
> > > +
> > >   #define CONFIG_EXTRA_ENV_SETTINGS \
> > > -	"script=boot.scr\0" \
> > > -	"uimage=uImage\0" \
> > >   	"console=ttymxc1\0" \
> > >   	"fdt_high=0xffffffff\0" \
> > >   	"initrd_high=0xffffffff\0" \
> > > -	"fdt_file=imx6q-sabrelite.dtb\0" \
> > > +	"fdtfile=imx6q-sabrelite.dtb\0" \
> > I wish the default efi_fdtfile would work, Fabio is there any plan to
> > populate the ${soc} variable like it is done for i.MX7? [2]
> > Then a small patch in the nitrogen6x.c would set the proper board env
> > variable.
> > 
> > That way there would be no difference in this header between sabrelite
> > vs. nitrogen6x.
> > 
> > >   	"fdt_addr=0x18000000\0" \
> > Do we need to keep fdt_addr since we define fdt_addr_r below?
> 
> It was for backward compatibility, if people had some script using it.

I think it should be dropped.

Regards,
Gary

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to distro boot support
  2018-04-09 17:27   ` Fabio Estevam
@ 2018-04-10 12:05     ` Gary Bisson
  0 siblings, 0 replies; 42+ messages in thread
From: Gary Bisson @ 2018-04-10 12:05 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On Mon, Apr 09, 2018 at 02:27:31PM -0300, Fabio Estevam wrote:
> Hi Gary,
> 
> On Mon, Apr 9, 2018 at 11:40 AM, Gary Bisson
> <gary.bisson@boundarydevices.com> wrote:
> 
> >>  #define CONFIG_EXTRA_ENV_SETTINGS \
> >> -     "script=boot.scr\0" \
> >> -     "uimage=uImage\0" \
> >>       "console=ttymxc1\0" \
> >>       "fdt_high=0xffffffff\0" \
> >>       "initrd_high=0xffffffff\0" \
> >> -     "fdt_file=imx6q-sabrelite.dtb\0" \
> >> +     "fdtfile=imx6q-sabrelite.dtb\0" \
> >
> > I wish the default efi_fdtfile would work, Fabio is there any plan to
> > populate the ${soc} variable like it is done for i.MX7? [2]
> 
> It seems we didn't need to do this yet, but if you see a need for it,
> please post a patch.

Will do.

Thanks,
Gary

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 0/3] Update sabrelite and nitrogen6x boards to use distro boot support
  2018-04-09  6:39 ` [U-Boot] [PATCH V2] " Guillaume GARDET
@ 2018-04-11 10:38   ` Guillaume GARDET
  2018-04-11 10:38     ` [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC Guillaume GARDET
                       ` (3 more replies)
  0 siblings, 4 replies; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-11 10:38 UTC (permalink / raw)
  To: u-boot

This patch serie updates sabrelite and nitrogen6x boards to use distro boot support.
Sabrelite has been boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
Nitrogen6* boards have been build tested only.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

Changes in V3:
  * Add imx6 soc definition
  * Also update nitrogen6x config, not only sabrelite
  * Split mx6qsabrelite_defconfig update to a separate patch
Changes in V2:
  * add mx6qsabrelite_defconfig update

Guillaume GARDET (3):
  imx6: Define 'soc' env var for imx6 SoC
  imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  imx6: sabrelite: update defconfig to use distro defaults

 arch/arm/mach-imx/mx6/soc.c     |  34 ++++++++
 configs/mx6qsabrelite_defconfig |  15 ++--
 include/configs/nitrogen6x.h    | 180 ++++++++++++----------------------------
 3 files changed, 93 insertions(+), 136 deletions(-)

-- 
2.13.6

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-11 10:38   ` [U-Boot] [PATCH V3 0/3] Update sabrelite and nitrogen6x boards to use " Guillaume GARDET
@ 2018-04-11 10:38     ` Guillaume GARDET
  2018-04-11 14:23       ` Fabio Estevam
  2018-04-11 15:46       ` Gary Bisson
  2018-04-11 10:38     ` [U-Boot] [PATCH V3 2/3] imx6: Convert sabrelite and nitrogen6x boards to distro boot support Guillaume GARDET
                       ` (2 subsequent siblings)
  3 siblings, 2 replies; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-11 10:38 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

---
 arch/arm/mach-imx/mx6/soc.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index 9b3d8f69b2..c4cb752c76 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -446,6 +446,40 @@ int arch_cpu_init(void)
 	return 0;
 }
 
+ #ifdef CONFIG_ARCH_MISC_INIT
+ int arch_misc_init(void)
+ {
+ #ifdef CONFIG_ENV_VARS_UBOOT_CONFIG
+	if (is_cpu_type(MXC_CPU_MX6QP))
+		env_set("soc", "imx6qp");
+	else if (is_cpu_type(MXC_CPU_MX6Q))
+		env_set("soc", "imx6q");
+	else if (is_cpu_type(MXC_CPU_MX6DP))
+		env_set("soc", "imx6dp");
+	else if (is_cpu_type(MXC_CPU_MX6D))
+		env_set("soc", "imx6d");
+	else if (is_mx6dl( ))
+		env_set("soc", "imx6dl");
+	else if (is_mx6sx( ))
+		env_set("soc", "imx6sx");
+	else if (is_mx6sl( ))
+		env_set("soc", "imx6sl");
+	else if (is_mx6solo( ))
+		env_set("soc", "imx6solo");
+	else if (is_mx6ul( ))
+		env_set("soc", "imx6ul");
+	else if (is_mx6ull( ))
+		env_set("soc", "imx6ull");
+	else if (is_mx6sll( ))
+		env_set("soc", "imx6sll");
+	else
+		env_set("soc", "imx6");
+ #endif
+
+	return 0;
+ }
+ #endif
+
 #ifdef CONFIG_ENV_IS_IN_MMC
 __weak int board_mmc_get_env_dev(int devno)
 {
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 2/3] imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  2018-04-11 10:38   ` [U-Boot] [PATCH V3 0/3] Update sabrelite and nitrogen6x boards to use " Guillaume GARDET
  2018-04-11 10:38     ` [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC Guillaume GARDET
@ 2018-04-11 10:38     ` Guillaume GARDET
  2018-04-11 10:38     ` [U-Boot] [PATCH V3 3/3] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
  2018-04-12 13:28     ` [U-Boot] [PATCH V4 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  3 siblings, 0 replies; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-11 10:38 UTC (permalink / raw)
  To: u-boot

Boot tested on sabrelite board.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

---
 include/configs/nitrogen6x.h | 180 +++++++++++++------------------------------
 1 file changed, 54 insertions(+), 126 deletions(-)

diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 7d2cf0bd8c..589c5b1ae8 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -101,140 +101,68 @@
 #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
 #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
 
+#ifdef CONFIG_CMD_MMC
+#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
+#else
+#define DISTRO_BOOT_DEV_MMC(func)
+#endif
+
+#ifdef CONFIG_CMD_SATA
+#define DISTRO_BOOT_DEV_SATA(func) func(SATA, sata, 0)
+#else
+#define DISTRO_BOOT_DEV_SATA(func)
+#endif
+
+#ifdef CONFIG_USB_STORAGE
+#define DISTRO_BOOT_DEV_USB(func) func(USB, usb, 0)
+#else
+#define DISTRO_BOOT_DEV_USB(func)
+#endif
+
+#ifdef CONFIG_CMD_PXE
+#define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na)
+#else
+#define DISTRO_BOOT_DEV_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_DHCP
+#define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na)
+#else
+#define DISTRO_BOOT_DEV_DHCP(func)
+#endif
+
+
 #if defined(CONFIG_SABRELITE)
+#define FDTFILE "fdtfile=imx6q-sabrelite.dtb\0"
+#else 
+/* fdtfile depends on nitrogen6x board used, so leave it to config distro fallback */
+#define FDTFILE
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+	DISTRO_BOOT_DEV_MMC(func) \
+	DISTRO_BOOT_DEV_SATA(func) \
+	DISTRO_BOOT_DEV_USB(func) \
+	DISTRO_BOOT_DEV_PXE(func) \
+	DISTRO_BOOT_DEV_DHCP(func)
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"script=boot.scr\0" \
-	"uimage=uImage\0" \
 	"console=ttymxc1\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
-	"fdt_file=imx6q-sabrelite.dtb\0" \
-	"fdt_addr=0x18000000\0" \
-	"boot_fdt=try\0" \
+	"fdt_addr_r=0x18000000\0" \
+	FDTFILE \
+	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"  \
+	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
+	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+	"ramdisk_addr_r=0x13000000\0" \
+	"ramdiskaddr=0x13000000\0" \
 	"ip_dyn=yes\0" \
 	"usb_pgood_delay=2000\0" \
-	"mmcdevs=0 1\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
-	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
-	"loadbootscript=" \
-		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
-		"source\0" \
-	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
-	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-	"mmcboot=echo Booting from mmc ...; " \
-		"run mmcargs; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if run loadfdt; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0" \
-	"netargs=setenv bootargs console=${console},${baudrate} " \
-		"root=/dev/nfs " \
-	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-		"netboot=echo Booting from net ...; " \
-		"run netargs; " \
-		"if test ${ip_dyn} = yes; then " \
-			"setenv get_cmd dhcp; " \
-		"else " \
-			"setenv get_cmd tftp; " \
-		"fi; " \
-		"${get_cmd} ${uimage}; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0"
-
-#define CONFIG_BOOTCOMMAND \
-	"for mmcdev in ${mmcdevs}; do " \
-		"mmc dev ${mmcdev}; " \
-		"if mmc rescan; then " \
-			"if run loadbootscript; then " \
-				"run bootscript; " \
-			"else " \
-				"if run loaduimage; then " \
-					"run mmcboot; " \
-				"fi; " \
-			"fi; " \
-		"fi; " \
-	"done; " \
-	"run netboot; "
-#else
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
-	"umsdevs=" CONFIG_UMSDEVS "\0" \
-	"usb_pgood_delay=2000\0" \
-	"console=ttymxc1\0" \
-	"clearenv=if sf probe || sf probe || sf probe 1 ; then " \
-		"sf erase 0xc0000 0x2000 && " \
-		"echo restored environment to factory default ; fi\0" \
-	"bootcmd=for dtype in ${bootdevs}" \
-		"; do " \
-			"if itest.s \"xusb\" == \"x${dtype}\" ; then " \
-				"usb start ;" \
-			"fi; " \
-			"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
-				"load " \
-					"${dtype} ${disk}:1 " \
-					"10008000 " \
-					"/6x_bootscript" \
-					"&& source 10008000 ; " \
-			"done ; " \
-		"done; " \
-		"setenv stdout serial,vga ; " \
-		"echo ; echo 6x_bootscript not found ; " \
-		"echo ; echo serial console at 115200, 8N1 ; echo ; " \
-		"echo details at http://boundarydevices.com/6q_bootscript ; " \
-		"setenv stdout serial;" \
-		"setenv stdin serial,usbkbd;" \
-		"for dtype in ${umsdevs} ; do " \
-			"if itest.s sata == ${dtype}; then " \
-				"initcmd='sata init' ;" \
-			"else " \
-				"initcmd='mmc rescan' ;" \
-			"fi; " \
-			"for disk in 0 1 ; do " \
-				"if $initcmd && $dtype dev $disk ; then " \
-					"setenv stdout serial,vga; " \
-					"echo expose ${dtype} ${disk} " \
-						"over USB; " \
-					"ums 0 $dtype $disk ;" \
-				"fi; " \
-		"	done; " \
-		"done ;" \
-		"setenv stdout serial,vga; " \
-		"echo no block devices found;" \
-		"\0" \
-	"initrd_high=0xffffffff\0" \
-	"upgradeu=for dtype in ${bootdevs}" \
-		"; do " \
-		"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
-			"load ${dtype} ${disk}:1 10008000 " \
-				"/6x_upgrade " \
-				"&& source 10008000 ; " \
-		"done ; " \
-	"done\0" \
+	BOOTENV
 
-#endif
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END	       0x10010000
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 3/3] imx6: sabrelite: update defconfig to use distro defaults
  2018-04-11 10:38   ` [U-Boot] [PATCH V3 0/3] Update sabrelite and nitrogen6x boards to use " Guillaume GARDET
  2018-04-11 10:38     ` [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC Guillaume GARDET
  2018-04-11 10:38     ` [U-Boot] [PATCH V3 2/3] imx6: Convert sabrelite and nitrogen6x boards to distro boot support Guillaume GARDET
@ 2018-04-11 10:38     ` Guillaume GARDET
  2018-04-12 13:28     ` [U-Boot] [PATCH V4 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  3 siblings, 0 replies; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-11 10:38 UTC (permalink / raw)
  To: u-boot

Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots on sabrelite board.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

---
 configs/mx6qsabrelite_defconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
index 7499704058..fee33cfff1 100644
--- a/configs/mx6qsabrelite_defconfig
+++ b/configs/mx6qsabrelite_defconfig
@@ -3,15 +3,15 @@ CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x17800000
 CONFIG_TARGET_NITROGEN6X=y
 CONFIG_CMD_HDMIDETECT=y
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE"
 CONFIG_BOOTDELAY=3
+# CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
-CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
@@ -22,17 +22,12 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_DWC_AHSATA=y
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-11 10:38     ` [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC Guillaume GARDET
@ 2018-04-11 14:23       ` Fabio Estevam
  2018-04-11 14:41         ` Guillaume Gardet
  2018-04-11 15:46       ` Gary Bisson
  1 sibling, 1 reply; 42+ messages in thread
From: Fabio Estevam @ 2018-04-11 14:23 UTC (permalink / raw)
  To: u-boot

Hi Guillaume,

On Wed, Apr 11, 2018 at 7:38 AM, Guillaume GARDET
<guillaume.gardet@free.fr> wrote:

Please explain in the commit log why this is needed. Thanks

> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Gary Bisson <gary.bisson@boundarydevices.com>

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-11 14:23       ` Fabio Estevam
@ 2018-04-11 14:41         ` Guillaume Gardet
  2018-04-11 15:41           ` Fabio Estevam
  0 siblings, 1 reply; 42+ messages in thread
From: Guillaume Gardet @ 2018-04-11 14:41 UTC (permalink / raw)
  To: u-boot

Hi,


Le 11/04/2018 à 16:23, Fabio Estevam a écrit :
> Hi Guillaume,
>
> On Wed, Apr 11, 2018 at 7:38 AM, Guillaume GARDET
> <guillaume.gardet@free.fr> wrote:
>
> Please explain in the commit log why this is needed. Thanks

This is for efi fdtfile fallback definition for default distro config for nitrogen6x board.
Is it ok for you?

>
>> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> Cc: Fabio Estevam <fabio.estevam@nxp.com>
>> Cc: Gary Bisson <gary.bisson@boundarydevices.com>

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-11 14:41         ` Guillaume Gardet
@ 2018-04-11 15:41           ` Fabio Estevam
  0 siblings, 0 replies; 42+ messages in thread
From: Fabio Estevam @ 2018-04-11 15:41 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 11, 2018 at 11:41 AM, Guillaume Gardet
<guillaume.gardet@free.fr> wrote:

> This is for efi fdtfile fallback definition for default distro config for
> nitrogen6x board.
> Is it ok for you?

Yes, this is the explanation that I was looking for :-)

Please send a new version with this info added in the commit log.

Thanks

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-11 10:38     ` [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC Guillaume GARDET
  2018-04-11 14:23       ` Fabio Estevam
@ 2018-04-11 15:46       ` Gary Bisson
  2018-04-11 15:52         ` Guillaume Gardet
  1 sibling, 1 reply; 42+ messages in thread
From: Gary Bisson @ 2018-04-11 15:46 UTC (permalink / raw)
  To: u-boot

Hi Guillaume,

On Wed, Apr 11, 2018 at 12:38:48PM +0200, Guillaume GARDET wrote:
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
> 
> ---
>  arch/arm/mach-imx/mx6/soc.c | 34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
> index 9b3d8f69b2..c4cb752c76 100644
> --- a/arch/arm/mach-imx/mx6/soc.c
> +++ b/arch/arm/mach-imx/mx6/soc.c
> @@ -446,6 +446,40 @@ int arch_cpu_init(void)
>  	return 0;
>  }
>  
> + #ifdef CONFIG_ARCH_MISC_INIT
> + int arch_misc_init(void)
> + {
> + #ifdef CONFIG_ENV_VARS_UBOOT_CONFIG
> +	if (is_cpu_type(MXC_CPU_MX6QP))
> +		env_set("soc", "imx6qp");
> +	else if (is_cpu_type(MXC_CPU_MX6Q))
> +		env_set("soc", "imx6q");
> +	else if (is_cpu_type(MXC_CPU_MX6DP))
> +		env_set("soc", "imx6dp");

If we want that soc variable to be used for dtb names, then the above
won't work. A i.MX6DP platform has its dtb named imx6qp-board.dtb.

> +	else if (is_cpu_type(MXC_CPU_MX6D))
> +		env_set("soc", "imx6d");

Same here, a Dual CPU actually uses a imx6q-board.dtb.

> +	else if (is_mx6dl( ))
> +		env_set("soc", "imx6dl");
> +	else if (is_mx6sx( ))
> +		env_set("soc", "imx6sx");
> +	else if (is_mx6sl( ))
> +		env_set("soc", "imx6sl");
> +	else if (is_mx6solo( ))
> +		env_set("soc", "imx6solo");

Same here, a Solo CPU uses a imx6dl-board.dtb.

> +	else if (is_mx6ul( ))
> +		env_set("soc", "imx6ul");
> +	else if (is_mx6ull( ))
> +		env_set("soc", "imx6ull");
> +	else if (is_mx6sll( ))
> +		env_set("soc", "imx6sll");
> +	else
> +		env_set("soc", "imx6");

In that case we most likely miss a CPU definition, maybe "unknown" would
be more explicit?

Regards,
Gary

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-11 15:46       ` Gary Bisson
@ 2018-04-11 15:52         ` Guillaume Gardet
  2018-04-11 16:06           ` Fabio Estevam
  0 siblings, 1 reply; 42+ messages in thread
From: Guillaume Gardet @ 2018-04-11 15:52 UTC (permalink / raw)
  To: u-boot



Le 11/04/2018 à 17:46, Gary Bisson a écrit :
> Hi Guillaume,
>
> On Wed, Apr 11, 2018 at 12:38:48PM +0200, Guillaume GARDET wrote:
>> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> Cc: Fabio Estevam <fabio.estevam@nxp.com>
>> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
>>
>> ---
>>   arch/arm/mach-imx/mx6/soc.c | 34 ++++++++++++++++++++++++++++++++++
>>   1 file changed, 34 insertions(+)
>>
>> diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
>> index 9b3d8f69b2..c4cb752c76 100644
>> --- a/arch/arm/mach-imx/mx6/soc.c
>> +++ b/arch/arm/mach-imx/mx6/soc.c
>> @@ -446,6 +446,40 @@ int arch_cpu_init(void)
>>   	return 0;
>>   }
>>   
>> + #ifdef CONFIG_ARCH_MISC_INIT
>> + int arch_misc_init(void)
>> + {
>> + #ifdef CONFIG_ENV_VARS_UBOOT_CONFIG
>> +	if (is_cpu_type(MXC_CPU_MX6QP))
>> +		env_set("soc", "imx6qp");
>> +	else if (is_cpu_type(MXC_CPU_MX6Q))
>> +		env_set("soc", "imx6q");
>> +	else if (is_cpu_type(MXC_CPU_MX6DP))
>> +		env_set("soc", "imx6dp");
> If we want that soc variable to be used for dtb names, then the above
> won't work. A i.MX6DP platform has its dtb named imx6qp-board.dtb.
>
>> +	else if (is_cpu_type(MXC_CPU_MX6D))
>> +		env_set("soc", "imx6d");
> Same here, a Dual CPU actually uses a imx6q-board.dtb.
>
>> +	else if (is_mx6dl( ))
>> +		env_set("soc", "imx6dl");
>> +	else if (is_mx6sx( ))
>> +		env_set("soc", "imx6sx");
>> +	else if (is_mx6sl( ))
>> +		env_set("soc", "imx6sl");
>> +	else if (is_mx6solo( ))
>> +		env_set("soc", "imx6solo");
> Same here, a Solo CPU uses a imx6dl-board.dtb.

So, how to handle dtb filenames? Update with wrong soc definition ? Or drop this patch and define a FDTFILE for each flavor?

>
>> +	else if (is_mx6ul( ))
>> +		env_set("soc", "imx6ul");
>> +	else if (is_mx6ull( ))
>> +		env_set("soc", "imx6ull");
>> +	else if (is_mx6sll( ))
>> +		env_set("soc", "imx6sll");
>> +	else
>> +		env_set("soc", "imx6");
> In that case we most likely miss a CPU definition, maybe "unknown" would
> be more explicit?

Currently soc is defined to imx6, so I think it is a good idea to keep imx6 definition.

Guillaume


>
> Regards,
> Gary
>

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-11 15:52         ` Guillaume Gardet
@ 2018-04-11 16:06           ` Fabio Estevam
  2018-04-12  8:13             ` Guillaume Gardet
  0 siblings, 1 reply; 42+ messages in thread
From: Fabio Estevam @ 2018-04-11 16:06 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 11, 2018 at 12:52 PM, Guillaume Gardet
<guillaume.gardet@free.fr> wrote:

> So, how to handle dtb filenames? Update with wrong soc definition ? Or drop
> this patch and define a FDTFILE for each flavor?

You can take a look at how we handle this for wandboard, cuboxi,
sabresd, for example.

Taking mx6sabresd as an example you can look at board_late_init() in
board/freescale/mx6sabresd/mx6sabresd.c

Then inside  include/configs/mx6sabre_common.h check for the findfdt
script that picks the correct dtb.

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-11 16:06           ` Fabio Estevam
@ 2018-04-12  8:13             ` Guillaume Gardet
  2018-04-12 11:14               ` Fabio Estevam
  0 siblings, 1 reply; 42+ messages in thread
From: Guillaume Gardet @ 2018-04-12  8:13 UTC (permalink / raw)
  To: u-boot



Le 11/04/2018 à 18:06, Fabio Estevam a écrit :
> On Wed, Apr 11, 2018 at 12:52 PM, Guillaume Gardet
> <guillaume.gardet@free.fr> wrote:
>
>> So, how to handle dtb filenames? Update with wrong soc definition ? Or drop
>> this patch and define a FDTFILE for each flavor?
> You can take a look at how we handle this for wandboard, cuboxi,
> sabresd, for example.
>
> Taking mx6sabresd as an example you can look at board_late_init() in
> board/freescale/mx6sabresd/mx6sabresd.c
>
> Then inside  include/configs/mx6sabre_common.h check for the findfdt
> script that picks the correct dtb.
>
Ok. So, how would you like to proceed?
Remove the generic mx6 'soc' definition and use a board sepcific 'board_rev' (or maybe a static definition if one configuration match a single dtb) to define the right dtb?

Could you tell me which DTB should work with the various nitrogen6x boards config?

Here are the one I could get from upstream kernel dts folder and possible config match:
* imx6q-nitrogen6x.dts     =>     nitrogen6q2g_defconfig nitrogen6q_defconfig
* imx6q-nitrogen6_max.dts     =>     none?
* imx6q-nitrogen6_som2.dts     =>     none?
* imx6qp-nitrogen6_max.dts     =>     none?
* imx6qp-nitrogen6_som2.dts     =>     none?
* imx6dl-nitrogen6x.dts     =>     nitrogen6dl2g_defconfig nitrogen6dl_defconfig
* imx6sx-nitrogen6sx.dts     =>     nitrogen6s1g_defconfig nitrogen6s_defconfig
* imx6q-sabrelite.dts     =>     mx6qsabrelite_defconfig
* imx6dl-sabrelite.dts     =>     none?


Guillaume

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-12  8:13             ` Guillaume Gardet
@ 2018-04-12 11:14               ` Fabio Estevam
  2018-04-12 12:36                 ` Gary Bisson
  0 siblings, 1 reply; 42+ messages in thread
From: Fabio Estevam @ 2018-04-12 11:14 UTC (permalink / raw)
  To: u-boot

On Thu, Apr 12, 2018 at 5:13 AM, Guillaume Gardet
<guillaume.gardet@free.fr> wrote:
script that picks the correct dtb.
>>
> Ok. So, how would you like to proceed?
> Remove the generic mx6 'soc' definition and use a board sepcific 'board_rev'
> (or maybe a static definition if one configuration match a single dtb) to
> define the right dtb?

I prefer to keep the same solution as done in other boards sucn as
mx6sabresd, wandboard and cuboxi.

> Could you tell me which DTB should work with the various nitrogen6x boards
> config?

I will let Gary confirm this one, as I am not familiar with the board
variants from Boundary Devices.

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-12 11:14               ` Fabio Estevam
@ 2018-04-12 12:36                 ` Gary Bisson
  2018-04-12 12:48                   ` Guillaume Gardet
  0 siblings, 1 reply; 42+ messages in thread
From: Gary Bisson @ 2018-04-12 12:36 UTC (permalink / raw)
  To: u-boot

Hi Fabio, Guillaume

On Thu, Apr 12, 2018 at 08:14:51AM -0300, Fabio Estevam wrote:
> On Thu, Apr 12, 2018 at 5:13 AM, Guillaume Gardet
> <guillaume.gardet@free.fr> wrote:
> script that picks the correct dtb.
> >>
> > Ok. So, how would you like to proceed?
> > Remove the generic mx6 'soc' definition and use a board sepcific 'board_rev'
> > (or maybe a static definition if one configuration match a single dtb) to
> > define the right dtb?
> 
> I prefer to keep the same solution as done in other boards sucn as
> mx6sabresd, wandboard and cuboxi.

Ok. My suggestion was to have something generic so that it matches the
fdt name set in config_distro_bootcmd.h
(${soc}-${board}${boardver}.dtb).

I especially like the naming in that standard, don't think board_rev
should be the SOC name.

This would also avoid redundancy in each board_late_init functions since
only the board name would need to be setup (and boardver in some cases
like wandboard).

Guillaume, please forget that point for now and just set your fdtfile
name in the config file. I'll update the board file later on.

Regards,
Gary

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-12 12:36                 ` Gary Bisson
@ 2018-04-12 12:48                   ` Guillaume Gardet
  2018-04-12 12:58                     ` Gary Bisson
  0 siblings, 1 reply; 42+ messages in thread
From: Guillaume Gardet @ 2018-04-12 12:48 UTC (permalink / raw)
  To: u-boot



Le 12/04/2018 à 14:36, Gary Bisson a écrit :
> Hi Fabio, Guillaume
>
> On Thu, Apr 12, 2018 at 08:14:51AM -0300, Fabio Estevam wrote:
>> On Thu, Apr 12, 2018 at 5:13 AM, Guillaume Gardet
>> <guillaume.gardet@free.fr> wrote:
>> script that picks the correct dtb.
>>> Ok. So, how would you like to proceed?
>>> Remove the generic mx6 'soc' definition and use a board sepcific 'board_rev'
>>> (or maybe a static definition if one configuration match a single dtb) to
>>> define the right dtb?
>> I prefer to keep the same solution as done in other boards sucn as
>> mx6sabresd, wandboard and cuboxi.
> Ok. My suggestion was to have something generic so that it matches the
> fdt name set in config_distro_bootcmd.h
> (${soc}-${board}${boardver}.dtb).
>
> I especially like the naming in that standard, don't think board_rev
> should be the SOC name.
>
> This would also avoid redundancy in each board_late_init functions since
> only the board name would need to be setup (and boardver in some cases
> like wandboard).
>
> Guillaume, please forget that point for now and just set your fdtfile
> name in the config file. I'll update the board file later on.

Ok.

Could you just confirm which DTB should work with the various nitrogen6x boards config, please?
Are the following ok?
* imx6q-nitrogen6x.dts     =>     nitrogen6q2g_defconfig nitrogen6q_defconfig
* imx6dl-nitrogen6x.dts     =>     nitrogen6dl2g_defconfig nitrogen6dl_defconfig
* imx6sx-nitrogen6sx.dts     =>     nitrogen6s1g_defconfig nitrogen6s_defconfig
* imx6q-sabrelite.dts     =>     mx6qsabrelite_defconfig

Guillaume

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-12 12:48                   ` Guillaume Gardet
@ 2018-04-12 12:58                     ` Gary Bisson
  2018-04-12 13:07                       ` Guillaume Gardet
  0 siblings, 1 reply; 42+ messages in thread
From: Gary Bisson @ 2018-04-12 12:58 UTC (permalink / raw)
  To: u-boot

Hi Guillaume,

On Thu, Apr 12, 2018 at 02:48:07PM +0200, Guillaume Gardet wrote:
> 
> 
> Le 12/04/2018 à 14:36, Gary Bisson a écrit :
> > Hi Fabio, Guillaume
> > 
> > On Thu, Apr 12, 2018 at 08:14:51AM -0300, Fabio Estevam wrote:
> > > On Thu, Apr 12, 2018 at 5:13 AM, Guillaume Gardet
> > > <guillaume.gardet@free.fr> wrote:
> > > script that picks the correct dtb.
> > > > Ok. So, how would you like to proceed?
> > > > Remove the generic mx6 'soc' definition and use a board sepcific 'board_rev'
> > > > (or maybe a static definition if one configuration match a single dtb) to
> > > > define the right dtb?
> > > I prefer to keep the same solution as done in other boards sucn as
> > > mx6sabresd, wandboard and cuboxi.
> > Ok. My suggestion was to have something generic so that it matches the
> > fdt name set in config_distro_bootcmd.h
> > (${soc}-${board}${boardver}.dtb).
> > 
> > I especially like the naming in that standard, don't think board_rev
> > should be the SOC name.
> > 
> > This would also avoid redundancy in each board_late_init functions since
> > only the board name would need to be setup (and boardver in some cases
> > like wandboard).
> > 
> > Guillaume, please forget that point for now and just set your fdtfile
> > name in the config file. I'll update the board file later on.
> 
> Ok.
> 
> Could you just confirm which DTB should work with the various nitrogen6x boards config, please?
> Are the following ok?
> * imx6q-nitrogen6x.dts     =>     nitrogen6q2g_defconfig nitrogen6q_defconfig
> * imx6dl-nitrogen6x.dts     =>     nitrogen6dl2g_defconfig nitrogen6dl_defconfig
> * imx6sx-nitrogen6sx.dts     =>     nitrogen6s1g_defconfig nitrogen6s_defconfig

No, imx6sx is different than imx6s. Solo is the same as imx6dl as far as
the kernl is concerned.

Maybe just leave fdt_file blank for nitrogen6x for now, it's only necessary
for PXE which isn't enabled in nitrogen6*defconfig.

Regards,
Gary

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC
  2018-04-12 12:58                     ` Gary Bisson
@ 2018-04-12 13:07                       ` Guillaume Gardet
  0 siblings, 0 replies; 42+ messages in thread
From: Guillaume Gardet @ 2018-04-12 13:07 UTC (permalink / raw)
  To: u-boot



Le 12/04/2018 à 14:58, Gary Bisson a écrit :
> Hi Guillaume,
>
> On Thu, Apr 12, 2018 at 02:48:07PM +0200, Guillaume Gardet wrote:
>>
>> Le 12/04/2018 à 14:36, Gary Bisson a écrit :
>>> Hi Fabio, Guillaume
>>>
>>> On Thu, Apr 12, 2018 at 08:14:51AM -0300, Fabio Estevam wrote:
>>>> On Thu, Apr 12, 2018 at 5:13 AM, Guillaume Gardet
>>>> <guillaume.gardet@free.fr> wrote:
>>>> script that picks the correct dtb.
>>>>> Ok. So, how would you like to proceed?
>>>>> Remove the generic mx6 'soc' definition and use a board sepcific 'board_rev'
>>>>> (or maybe a static definition if one configuration match a single dtb) to
>>>>> define the right dtb?
>>>> I prefer to keep the same solution as done in other boards sucn as
>>>> mx6sabresd, wandboard and cuboxi.
>>> Ok. My suggestion was to have something generic so that it matches the
>>> fdt name set in config_distro_bootcmd.h
>>> (${soc}-${board}${boardver}.dtb).
>>>
>>> I especially like the naming in that standard, don't think board_rev
>>> should be the SOC name.
>>>
>>> This would also avoid redundancy in each board_late_init functions since
>>> only the board name would need to be setup (and boardver in some cases
>>> like wandboard).
>>>
>>> Guillaume, please forget that point for now and just set your fdtfile
>>> name in the config file. I'll update the board file later on.
>> Ok.
>>
>> Could you just confirm which DTB should work with the various nitrogen6x boards config, please?
>> Are the following ok?
>> * imx6q-nitrogen6x.dts     =>     nitrogen6q2g_defconfig nitrogen6q_defconfig
>> * imx6dl-nitrogen6x.dts     =>     nitrogen6dl2g_defconfig nitrogen6dl_defconfig
>> * imx6sx-nitrogen6sx.dts     =>     nitrogen6s1g_defconfig nitrogen6s_defconfig
> No, imx6sx is different than imx6s. Solo is the same as imx6dl as far as
> the kernl is concerned.
>
> Maybe just leave fdt_file blank for nitrogen6x for now, it's only necessary
> for PXE which isn't enabled in nitrogen6*defconfig.

Ok, I will leave it as is for now, but fdtfile must also be defined for EFI boot. Otherwise, you start your EFI payload without device tree.


Guillaume


>
> Regards,
> Gary
>

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V4 0/2] Update sabrelite and nitrogen6x boards to use distro boot support
  2018-04-11 10:38   ` [U-Boot] [PATCH V3 0/3] Update sabrelite and nitrogen6x boards to use " Guillaume GARDET
                       ` (2 preceding siblings ...)
  2018-04-11 10:38     ` [U-Boot] [PATCH V3 3/3] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
@ 2018-04-12 13:28     ` Guillaume GARDET
  2018-04-12 13:28       ` [U-Boot] [PATCH V4 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
                         ` (2 more replies)
  3 siblings, 3 replies; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-12 13:28 UTC (permalink / raw)
  To: u-boot

This patch serie updates sabrelite and nitrogen6x boards to use distro boot support.
Sabrelite has been boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
Nitrogen6* boards have been build tested only.

Currently, only the Sabrelite has fdtfile defined.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

Changes in V4:
  * Remove imx6 soc definition
  * Change comment on not defined fdtfile (no more fallback)

Changes in V3:
  * Add imx6 soc definition
  * Also update nitrogen6x config, not only sabrelite
  * Split mx6qsabrelite_defconfig update to a separate patch
Changes in V2:
  * add mx6qsabrelite_defconfig update


Guillaume GARDET (2):
  imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  imx6: sabrelite: update defconfig to use distro defaults

 configs/mx6qsabrelite_defconfig |  15 ++--
 include/configs/nitrogen6x.h    | 180 ++++++++++++----------------------------
 2 files changed, 59 insertions(+), 136 deletions(-)

-- 
2.13.6

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V4 1/2] imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  2018-04-12 13:28     ` [U-Boot] [PATCH V4 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
@ 2018-04-12 13:28       ` Guillaume GARDET
  2018-04-16  7:45         ` Gary Bisson
  2018-04-12 13:28       ` [U-Boot] [PATCH V4 2/2] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
  2018-04-16 12:47       ` [U-Boot] [PATCH V5 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  2 siblings, 1 reply; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-12 13:28 UTC (permalink / raw)
  To: u-boot

Boot tested on sabrelite board.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

---
 include/configs/nitrogen6x.h | 180 +++++++++++++------------------------------
 1 file changed, 54 insertions(+), 126 deletions(-)

diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 7d2cf0bd8c..f6dce6c069 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -101,140 +101,68 @@
 #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
 #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
 
+#ifdef CONFIG_CMD_MMC
+#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
+#else
+#define DISTRO_BOOT_DEV_MMC(func)
+#endif
+
+#ifdef CONFIG_CMD_SATA
+#define DISTRO_BOOT_DEV_SATA(func) func(SATA, sata, 0)
+#else
+#define DISTRO_BOOT_DEV_SATA(func)
+#endif
+
+#ifdef CONFIG_USB_STORAGE
+#define DISTRO_BOOT_DEV_USB(func) func(USB, usb, 0)
+#else
+#define DISTRO_BOOT_DEV_USB(func)
+#endif
+
+#ifdef CONFIG_CMD_PXE
+#define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na)
+#else
+#define DISTRO_BOOT_DEV_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_DHCP
+#define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na)
+#else
+#define DISTRO_BOOT_DEV_DHCP(func)
+#endif
+
+
 #if defined(CONFIG_SABRELITE)
+#define FDTFILE "fdtfile=imx6q-sabrelite.dtb\0"
+#else
+/* FIXME: nitrogen6x covers multiple configs. Define fdtfile for each supported config. */
+#define FDTFILE
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+	DISTRO_BOOT_DEV_MMC(func) \
+	DISTRO_BOOT_DEV_SATA(func) \
+	DISTRO_BOOT_DEV_USB(func) \
+	DISTRO_BOOT_DEV_PXE(func) \
+	DISTRO_BOOT_DEV_DHCP(func)
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"script=boot.scr\0" \
-	"uimage=uImage\0" \
 	"console=ttymxc1\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
-	"fdt_file=imx6q-sabrelite.dtb\0" \
-	"fdt_addr=0x18000000\0" \
-	"boot_fdt=try\0" \
+	"fdt_addr_r=0x18000000\0" \
+	FDTFILE \
+	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"  \
+	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
+	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+	"ramdisk_addr_r=0x13000000\0" \
+	"ramdiskaddr=0x13000000\0" \
 	"ip_dyn=yes\0" \
 	"usb_pgood_delay=2000\0" \
-	"mmcdevs=0 1\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
-	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
-	"loadbootscript=" \
-		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
-		"source\0" \
-	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
-	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-	"mmcboot=echo Booting from mmc ...; " \
-		"run mmcargs; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if run loadfdt; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0" \
-	"netargs=setenv bootargs console=${console},${baudrate} " \
-		"root=/dev/nfs " \
-	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-		"netboot=echo Booting from net ...; " \
-		"run netargs; " \
-		"if test ${ip_dyn} = yes; then " \
-			"setenv get_cmd dhcp; " \
-		"else " \
-			"setenv get_cmd tftp; " \
-		"fi; " \
-		"${get_cmd} ${uimage}; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0"
-
-#define CONFIG_BOOTCOMMAND \
-	"for mmcdev in ${mmcdevs}; do " \
-		"mmc dev ${mmcdev}; " \
-		"if mmc rescan; then " \
-			"if run loadbootscript; then " \
-				"run bootscript; " \
-			"else " \
-				"if run loaduimage; then " \
-					"run mmcboot; " \
-				"fi; " \
-			"fi; " \
-		"fi; " \
-	"done; " \
-	"run netboot; "
-#else
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
-	"umsdevs=" CONFIG_UMSDEVS "\0" \
-	"usb_pgood_delay=2000\0" \
-	"console=ttymxc1\0" \
-	"clearenv=if sf probe || sf probe || sf probe 1 ; then " \
-		"sf erase 0xc0000 0x2000 && " \
-		"echo restored environment to factory default ; fi\0" \
-	"bootcmd=for dtype in ${bootdevs}" \
-		"; do " \
-			"if itest.s \"xusb\" == \"x${dtype}\" ; then " \
-				"usb start ;" \
-			"fi; " \
-			"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
-				"load " \
-					"${dtype} ${disk}:1 " \
-					"10008000 " \
-					"/6x_bootscript" \
-					"&& source 10008000 ; " \
-			"done ; " \
-		"done; " \
-		"setenv stdout serial,vga ; " \
-		"echo ; echo 6x_bootscript not found ; " \
-		"echo ; echo serial console at 115200, 8N1 ; echo ; " \
-		"echo details at http://boundarydevices.com/6q_bootscript ; " \
-		"setenv stdout serial;" \
-		"setenv stdin serial,usbkbd;" \
-		"for dtype in ${umsdevs} ; do " \
-			"if itest.s sata == ${dtype}; then " \
-				"initcmd='sata init' ;" \
-			"else " \
-				"initcmd='mmc rescan' ;" \
-			"fi; " \
-			"for disk in 0 1 ; do " \
-				"if $initcmd && $dtype dev $disk ; then " \
-					"setenv stdout serial,vga; " \
-					"echo expose ${dtype} ${disk} " \
-						"over USB; " \
-					"ums 0 $dtype $disk ;" \
-				"fi; " \
-		"	done; " \
-		"done ;" \
-		"setenv stdout serial,vga; " \
-		"echo no block devices found;" \
-		"\0" \
-	"initrd_high=0xffffffff\0" \
-	"upgradeu=for dtype in ${bootdevs}" \
-		"; do " \
-		"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
-			"load ${dtype} ${disk}:1 10008000 " \
-				"/6x_upgrade " \
-				"&& source 10008000 ; " \
-		"done ; " \
-	"done\0" \
+	BOOTENV
 
-#endif
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END	       0x10010000
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V4 2/2] imx6: sabrelite: update defconfig to use distro defaults
  2018-04-12 13:28     ` [U-Boot] [PATCH V4 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  2018-04-12 13:28       ` [U-Boot] [PATCH V4 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
@ 2018-04-12 13:28       ` Guillaume GARDET
  2018-04-16 12:47       ` [U-Boot] [PATCH V5 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  2 siblings, 0 replies; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-12 13:28 UTC (permalink / raw)
  To: u-boot

Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots on sabrelite board.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

---
 configs/mx6qsabrelite_defconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
index 7499704058..fee33cfff1 100644
--- a/configs/mx6qsabrelite_defconfig
+++ b/configs/mx6qsabrelite_defconfig
@@ -3,15 +3,15 @@ CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x17800000
 CONFIG_TARGET_NITROGEN6X=y
 CONFIG_CMD_HDMIDETECT=y
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE"
 CONFIG_BOOTDELAY=3
+# CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
-CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
@@ -22,17 +22,12 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_DWC_AHSATA=y
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to distro boot support
  2018-04-10 11:50     ` Gary Bisson
@ 2018-04-13  5:08       ` Joe Hershberger
  0 siblings, 0 replies; 42+ messages in thread
From: Joe Hershberger @ 2018-04-13  5:08 UTC (permalink / raw)
  To: u-boot

On Tue, Apr 10, 2018 at 6:50 AM, Gary Bisson
<gary.bisson@boundarydevices.com> wrote:
> Hi Guillaume,
>
> On Mon, Apr 09, 2018 at 05:17:44PM +0200, Guillaume Gardet wrote:
>>
>>
>> Le 09/04/2018 à 16:40, Gary Bisson a écrit :
>> > Hi Guillaume,
>> >
>> > Thanks for your patch! Switching the upstream nitrogen6x configuration
>> > to distro bootcmd has been in our todo list for some time since we also
>> > use that in our own git repo.
>> >
>> > On Fri, Apr 06, 2018 at 12:05:48PM +0200, Guillaume GARDET wrote:
>> > > Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
>> > >
>> > > Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>> > > Cc: Troy Kisky <troy.kisky@boundarydevices.com>
>> > > Cc: Stefano Babic <sbabic@denx.de>
>> > > Cc: Fabio Estevam <fabio.estevam@nxp.com>
>> > > ---
>> > >   include/configs/nitrogen6x.h | 86 ++++++++++----------------------------------
>> > >   1 file changed, 18 insertions(+), 68 deletions(-)
>> > >
>> > > diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
>> > > index c73cfb7f7e..2e2c499cb6 100644
>> > > --- a/include/configs/nitrogen6x.h
>> > > +++ b/include/configs/nitrogen6x.h
>> > > @@ -102,82 +102,32 @@
>> > >   #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
>> > >   #if defined(CONFIG_SABRELITE)
>> > Please also switch nitrogen6x to it, not only sabrelite.
>>
>> Should we keep all the 6x scripts stuff or not?
>
> No, we need to switch to something standard, let's remove it.
>
>> > > +#define BOOT_TARGET_DEVICES(func) \
>> > > + func(MMC, mmc, 0) \
>> > > + func(MMC, mmc, 1) \
>> > > + func(SATA, sata, 0) \
>> > > + func(USB, usb, 0) \
>> > > + func(PXE, pxe, na) \
>> > That currently doesn't build because CMD_PXE isn't selected in the
>> > sabrelite defconfig.
>> > "include/config_distro_bootcmd.h:319:2: error: expected ‘}’ before
>> > ‘BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE’"
>> >
>> > Which brings a good point, all the above should depend on the storage
>> > command being present, like done here [1].
>>
>> No, we just need to update the defconfig, see V2 of this patch sent earlier today.
>
> I know updating the defconfig makes it build. My point is that it would
> be more flexible to do like in the link provided so that someone that
> removes CMD_PXE from the defconfig for any reason can still build.

Agreed. Also, be careful to check for CONFIG_CMD_DHCP and
CONFIG_CMD_PXE for the PXE case.

>> > > + func(DHCP, dhcp, na)
>> > > +
>> > > +#include <config_distro_bootcmd.h>
>> > > +
>> > >   #define CONFIG_EXTRA_ENV_SETTINGS \
>> > > - "script=boot.scr\0" \
>> > > - "uimage=uImage\0" \
>> > >           "console=ttymxc1\0" \
>> > >           "fdt_high=0xffffffff\0" \
>> > >           "initrd_high=0xffffffff\0" \
>> > > - "fdt_file=imx6q-sabrelite.dtb\0" \
>> > > + "fdtfile=imx6q-sabrelite.dtb\0" \
>> > I wish the default efi_fdtfile would work, Fabio is there any plan to
>> > populate the ${soc} variable like it is done for i.MX7? [2]
>> > Then a small patch in the nitrogen6x.c would set the proper board env
>> > variable.
>> >
>> > That way there would be no difference in this header between sabrelite
>> > vs. nitrogen6x.
>> >
>> > >           "fdt_addr=0x18000000\0" \
>> > Do we need to keep fdt_addr since we define fdt_addr_r below?
>>
>> It was for backward compatibility, if people had some script using it.
>
> I think it should be dropped.
>
> Regards,
> Gary
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V4 1/2] imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  2018-04-12 13:28       ` [U-Boot] [PATCH V4 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
@ 2018-04-16  7:45         ` Gary Bisson
  0 siblings, 0 replies; 42+ messages in thread
From: Gary Bisson @ 2018-04-16  7:45 UTC (permalink / raw)
  To: u-boot

Hi Guillaume,

On Thu, Apr 12, 2018 at 03:28:21PM +0200, Guillaume GARDET wrote:
> Boot tested on sabrelite board.
> 
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
> 
> ---
>  include/configs/nitrogen6x.h | 180 +++++++++++++------------------------------
>  1 file changed, 54 insertions(+), 126 deletions(-)
> 
> diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
> index 7d2cf0bd8c..f6dce6c069 100644
> --- a/include/configs/nitrogen6x.h
> +++ b/include/configs/nitrogen6x.h
> @@ -101,140 +101,68 @@
>  #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
>  #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC

Many of the macros above this line are obsolete with that patch, please
remove.

@@ -80,27 +80,6 @@

 #define CONFIG_PREBOOT                 ""

-#ifdef CONFIG_CMD_SATA
-#define CONFIG_DRIVE_SATA "sata "
-#else
-#define CONFIG_DRIVE_SATA
-#endif
-
-#ifdef CONFIG_CMD_MMC
-#define CONFIG_DRIVE_MMC "mmc "
-#else
-#define CONFIG_DRIVE_MMC
-#endif
-
-#ifdef CONFIG_USB_STORAGE
-#define CONFIG_DRIVE_USB "usb "
-#else
-#define CONFIG_DRIVE_USB
-#endif
-
-#define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
-#define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
-
 #ifdef CONFIG_CMD_MMC

> +#ifdef CONFIG_CMD_MMC
> +#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
> +#else
> +#define DISTRO_BOOT_DEV_MMC(func)
> +#endif
> +
> +#ifdef CONFIG_CMD_SATA
> +#define DISTRO_BOOT_DEV_SATA(func) func(SATA, sata, 0)
> +#else
> +#define DISTRO_BOOT_DEV_SATA(func)
> +#endif
> +
> +#ifdef CONFIG_USB_STORAGE
> +#define DISTRO_BOOT_DEV_USB(func) func(USB, usb, 0)
> +#else
> +#define DISTRO_BOOT_DEV_USB(func)
> +#endif
> +
> +#ifdef CONFIG_CMD_PXE
> +#define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na)
> +#else
> +#define DISTRO_BOOT_DEV_PXE(func)
> +#endif
> +
> +#ifdef CONFIG_CMD_DHCP
> +#define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na)
> +#else
> +#define DISTRO_BOOT_DEV_DHCP(func)
> +#endif
> +
> +
>  #if defined(CONFIG_SABRELITE)
> +#define FDTFILE "fdtfile=imx6q-sabrelite.dtb\0"
> +#else
> +/* FIXME: nitrogen6x covers multiple configs. Define fdtfile for each supported config. */
> +#define FDTFILE
> +#endif
> +
> +#define BOOT_TARGET_DEVICES(func) \
> +	DISTRO_BOOT_DEV_MMC(func) \
> +	DISTRO_BOOT_DEV_SATA(func) \
> +	DISTRO_BOOT_DEV_USB(func) \
> +	DISTRO_BOOT_DEV_PXE(func) \
> +	DISTRO_BOOT_DEV_DHCP(func)
> +
> +#include <config_distro_bootcmd.h>
> +
>  #define CONFIG_EXTRA_ENV_SETTINGS \
> -	"script=boot.scr\0" \
> -	"uimage=uImage\0" \
>  	"console=ttymxc1\0" \
>  	"fdt_high=0xffffffff\0" \
>  	"initrd_high=0xffffffff\0" \
> -	"fdt_file=imx6q-sabrelite.dtb\0" \
> -	"fdt_addr=0x18000000\0" \
> -	"boot_fdt=try\0" \
> +	"fdt_addr_r=0x18000000\0" \
> +	FDTFILE \
> +	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"  \
> +	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
> +	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
> +	"ramdisk_addr_r=0x13000000\0" \
> +	"ramdiskaddr=0x13000000\0" \
>  	"ip_dyn=yes\0" \
>  	"usb_pgood_delay=2000\0" \
> -	"mmcdevs=0 1\0" \
> -	"mmcpart=1\0" \
> -	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
> -	"mmcargs=setenv bootargs console=${console},${baudrate} " \
> -		"root=${mmcroot}\0" \
> -	"loadbootscript=" \
> -		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
> -	"bootscript=echo Running bootscript from mmc ...; " \
> -		"source\0" \
> -	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
> -	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
> -	"mmcboot=echo Booting from mmc ...; " \
> -		"run mmcargs; " \
> -		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> -			"if run loadfdt; then " \
> -				"bootm ${loadaddr} - ${fdt_addr}; " \
> -			"else " \
> -				"if test ${boot_fdt} = try; then " \
> -					"bootm; " \
> -				"else " \
> -					"echo WARN: Cannot load the DT; " \
> -				"fi; " \
> -			"fi; " \
> -		"else " \
> -			"bootm; " \
> -		"fi;\0" \
> -	"netargs=setenv bootargs console=${console},${baudrate} " \
> -		"root=/dev/nfs " \
> -	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
> -		"netboot=echo Booting from net ...; " \
> -		"run netargs; " \
> -		"if test ${ip_dyn} = yes; then " \
> -			"setenv get_cmd dhcp; " \
> -		"else " \
> -			"setenv get_cmd tftp; " \
> -		"fi; " \
> -		"${get_cmd} ${uimage}; " \
> -		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> -			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
> -				"bootm ${loadaddr} - ${fdt_addr}; " \
> -			"else " \
> -				"if test ${boot_fdt} = try; then " \
> -					"bootm; " \
> -				"else " \
> -					"echo WARN: Cannot load the DT; " \
> -				"fi; " \
> -			"fi; " \
> -		"else " \
> -			"bootm; " \
> -		"fi;\0"
> -
> -#define CONFIG_BOOTCOMMAND \
> -	"for mmcdev in ${mmcdevs}; do " \
> -		"mmc dev ${mmcdev}; " \
> -		"if mmc rescan; then " \
> -			"if run loadbootscript; then " \
> -				"run bootscript; " \
> -			"else " \
> -				"if run loaduimage; then " \
> -					"run mmcboot; " \
> -				"fi; " \
> -			"fi; " \
> -		"fi; " \
> -	"done; " \
> -	"run netboot; "
> -#else
> -#define CONFIG_EXTRA_ENV_SETTINGS \
> -	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
> -	"umsdevs=" CONFIG_UMSDEVS "\0" \
> -	"usb_pgood_delay=2000\0" \
> -	"console=ttymxc1\0" \
> -	"clearenv=if sf probe || sf probe || sf probe 1 ; then " \
> -		"sf erase 0xc0000 0x2000 && " \
> -		"echo restored environment to factory default ; fi\0" \
> -	"bootcmd=for dtype in ${bootdevs}" \
> -		"; do " \
> -			"if itest.s \"xusb\" == \"x${dtype}\" ; then " \
> -				"usb start ;" \
> -			"fi; " \
> -			"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
> -				"load " \
> -					"${dtype} ${disk}:1 " \
> -					"10008000 " \
> -					"/6x_bootscript" \
> -					"&& source 10008000 ; " \
> -			"done ; " \
> -		"done; " \
> -		"setenv stdout serial,vga ; " \
> -		"echo ; echo 6x_bootscript not found ; " \
> -		"echo ; echo serial console at 115200, 8N1 ; echo ; " \
> -		"echo details at http://boundarydevices.com/6q_bootscript ; " \
> -		"setenv stdout serial;" \
> -		"setenv stdin serial,usbkbd;" \
> -		"for dtype in ${umsdevs} ; do " \
> -			"if itest.s sata == ${dtype}; then " \
> -				"initcmd='sata init' ;" \
> -			"else " \
> -				"initcmd='mmc rescan' ;" \
> -			"fi; " \
> -			"for disk in 0 1 ; do " \
> -				"if $initcmd && $dtype dev $disk ; then " \
> -					"setenv stdout serial,vga; " \
> -					"echo expose ${dtype} ${disk} " \
> -						"over USB; " \
> -					"ums 0 $dtype $disk ;" \
> -				"fi; " \
> -		"	done; " \
> -		"done ;" \
> -		"setenv stdout serial,vga; " \
> -		"echo no block devices found;" \
> -		"\0" \
> -	"initrd_high=0xffffffff\0" \
> -	"upgradeu=for dtype in ${bootdevs}" \
> -		"; do " \
> -		"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
> -			"load ${dtype} ${disk}:1 10008000 " \
> -				"/6x_upgrade " \
> -				"&& source 10008000 ; " \
> -		"done ; " \
> -	"done\0" \
> +	BOOTENV
>  
> -#endif
>  /* Miscellaneous configurable options */
>  #define CONFIG_SYS_MEMTEST_START       0x10000000
>  #define CONFIG_SYS_MEMTEST_END	       0x10010000
> -- 
> 2.13.6

Regards,
Gary

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V5 0/2] Update sabrelite and nitrogen6x boards to use distro boot support
  2018-04-12 13:28     ` [U-Boot] [PATCH V4 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  2018-04-12 13:28       ` [U-Boot] [PATCH V4 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
  2018-04-12 13:28       ` [U-Boot] [PATCH V4 2/2] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
@ 2018-04-16 12:47       ` Guillaume GARDET
  2018-04-16 12:47         ` [U-Boot] [PATCH V5 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
                           ` (2 more replies)
  2 siblings, 3 replies; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-16 12:47 UTC (permalink / raw)
  To: u-boot

This patch serie updates sabrelite and nitrogen6x boards to use distro boot support.
Sabrelite has been boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
Nitrogen6* boards have been build tested only.

Currently, only the Sabrelite has fdtfile defined.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

Changes in V5:
  * remove obsolete code from include/configs/nitrogen6x.h
  
Changes in V4:
  * Remove imx6 soc definition
  * Change comment on not defined fdtfile (no more fallback)

Changes in V3:
  * Add imx6 soc definition
  * Also update nitrogen6x config, not only sabrelite
  * Split mx6qsabrelite_defconfig update to a separate patch
Changes in V2:
  * add mx6qsabrelite_defconfig update



Guillaume GARDET (2):
  imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  imx6: sabrelite: update defconfig to use distro defaults

 configs/mx6qsabrelite_defconfig |  15 ++--
 include/configs/nitrogen6x.h    | 179 ++++++++++------------------------------
 2 files changed, 48 insertions(+), 146 deletions(-)

-- 
2.13.6

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V5 1/2] imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  2018-04-16 12:47       ` [U-Boot] [PATCH V5 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
@ 2018-04-16 12:47         ` Guillaume GARDET
  2018-04-18 14:37           ` Gary Bisson
  2018-04-16 12:47         ` [U-Boot] [PATCH V5 2/2] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
  2018-04-18 15:04         ` [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  2 siblings, 1 reply; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-16 12:47 UTC (permalink / raw)
  To: u-boot

Boot tested on sabrelite board.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

---
 include/configs/nitrogen6x.h | 179 +++++++++++--------------------------------
 1 file changed, 43 insertions(+), 136 deletions(-)

diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 7d2cf0bd8c..0d0be2a955 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -80,161 +80,68 @@
 
 #define CONFIG_PREBOOT                 ""
 
-#ifdef CONFIG_CMD_SATA
-#define CONFIG_DRIVE_SATA "sata "
+#ifdef CONFIG_CMD_MMC
+#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
 #else
-#define CONFIG_DRIVE_SATA
+#define DISTRO_BOOT_DEV_MMC(func)
 #endif
 
-#ifdef CONFIG_CMD_MMC
-#define CONFIG_DRIVE_MMC "mmc "
+#ifdef CONFIG_CMD_SATA
+#define DISTRO_BOOT_DEV_SATA(func) func(SATA, sata, 0)
 #else
-#define CONFIG_DRIVE_MMC
+#define DISTRO_BOOT_DEV_SATA(func)
 #endif
 
 #ifdef CONFIG_USB_STORAGE
-#define CONFIG_DRIVE_USB "usb "
+#define DISTRO_BOOT_DEV_USB(func) func(USB, usb, 0)
 #else
-#define CONFIG_DRIVE_USB
+#define DISTRO_BOOT_DEV_USB(func)
+#endif
+
+#ifdef CONFIG_CMD_PXE
+#define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na)
+#else
+#define DISTRO_BOOT_DEV_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_DHCP
+#define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na)
+#else
+#define DISTRO_BOOT_DEV_DHCP(func)
 #endif
 
-#define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
-#define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
 
 #if defined(CONFIG_SABRELITE)
+#define FDTFILE "fdtfile=imx6q-sabrelite.dtb\0"
+#else
+/* FIXME: nitrogen6x covers multiple configs. Define fdtfile for each supported config. */
+#define FDTFILE
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+	DISTRO_BOOT_DEV_MMC(func) \
+	DISTRO_BOOT_DEV_SATA(func) \
+	DISTRO_BOOT_DEV_USB(func) \
+	DISTRO_BOOT_DEV_PXE(func) \
+	DISTRO_BOOT_DEV_DHCP(func)
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"script=boot.scr\0" \
-	"uimage=uImage\0" \
 	"console=ttymxc1\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
-	"fdt_file=imx6q-sabrelite.dtb\0" \
-	"fdt_addr=0x18000000\0" \
-	"boot_fdt=try\0" \
+	"fdt_addr_r=0x18000000\0" \
+	FDTFILE \
+	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"  \
+	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
+	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+	"ramdisk_addr_r=0x13000000\0" \
+	"ramdiskaddr=0x13000000\0" \
 	"ip_dyn=yes\0" \
 	"usb_pgood_delay=2000\0" \
-	"mmcdevs=0 1\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
-	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
-	"loadbootscript=" \
-		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
-		"source\0" \
-	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
-	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-	"mmcboot=echo Booting from mmc ...; " \
-		"run mmcargs; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if run loadfdt; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0" \
-	"netargs=setenv bootargs console=${console},${baudrate} " \
-		"root=/dev/nfs " \
-	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-		"netboot=echo Booting from net ...; " \
-		"run netargs; " \
-		"if test ${ip_dyn} = yes; then " \
-			"setenv get_cmd dhcp; " \
-		"else " \
-			"setenv get_cmd tftp; " \
-		"fi; " \
-		"${get_cmd} ${uimage}; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0"
-
-#define CONFIG_BOOTCOMMAND \
-	"for mmcdev in ${mmcdevs}; do " \
-		"mmc dev ${mmcdev}; " \
-		"if mmc rescan; then " \
-			"if run loadbootscript; then " \
-				"run bootscript; " \
-			"else " \
-				"if run loaduimage; then " \
-					"run mmcboot; " \
-				"fi; " \
-			"fi; " \
-		"fi; " \
-	"done; " \
-	"run netboot; "
-#else
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
-	"umsdevs=" CONFIG_UMSDEVS "\0" \
-	"usb_pgood_delay=2000\0" \
-	"console=ttymxc1\0" \
-	"clearenv=if sf probe || sf probe || sf probe 1 ; then " \
-		"sf erase 0xc0000 0x2000 && " \
-		"echo restored environment to factory default ; fi\0" \
-	"bootcmd=for dtype in ${bootdevs}" \
-		"; do " \
-			"if itest.s \"xusb\" == \"x${dtype}\" ; then " \
-				"usb start ;" \
-			"fi; " \
-			"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
-				"load " \
-					"${dtype} ${disk}:1 " \
-					"10008000 " \
-					"/6x_bootscript" \
-					"&& source 10008000 ; " \
-			"done ; " \
-		"done; " \
-		"setenv stdout serial,vga ; " \
-		"echo ; echo 6x_bootscript not found ; " \
-		"echo ; echo serial console at 115200, 8N1 ; echo ; " \
-		"echo details at http://boundarydevices.com/6q_bootscript ; " \
-		"setenv stdout serial;" \
-		"setenv stdin serial,usbkbd;" \
-		"for dtype in ${umsdevs} ; do " \
-			"if itest.s sata == ${dtype}; then " \
-				"initcmd='sata init' ;" \
-			"else " \
-				"initcmd='mmc rescan' ;" \
-			"fi; " \
-			"for disk in 0 1 ; do " \
-				"if $initcmd && $dtype dev $disk ; then " \
-					"setenv stdout serial,vga; " \
-					"echo expose ${dtype} ${disk} " \
-						"over USB; " \
-					"ums 0 $dtype $disk ;" \
-				"fi; " \
-		"	done; " \
-		"done ;" \
-		"setenv stdout serial,vga; " \
-		"echo no block devices found;" \
-		"\0" \
-	"initrd_high=0xffffffff\0" \
-	"upgradeu=for dtype in ${bootdevs}" \
-		"; do " \
-		"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
-			"load ${dtype} ${disk}:1 10008000 " \
-				"/6x_upgrade " \
-				"&& source 10008000 ; " \
-		"done ; " \
-	"done\0" \
+	BOOTENV
 
-#endif
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END	       0x10010000
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V5 2/2] imx6: sabrelite: update defconfig to use distro defaults
  2018-04-16 12:47       ` [U-Boot] [PATCH V5 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  2018-04-16 12:47         ` [U-Boot] [PATCH V5 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
@ 2018-04-16 12:47         ` Guillaume GARDET
  2018-04-18 14:44           ` Gary Bisson
  2018-04-18 15:04         ` [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  2 siblings, 1 reply; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-16 12:47 UTC (permalink / raw)
  To: u-boot

Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots on sabrelite board.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

---
 configs/mx6qsabrelite_defconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
index 7499704058..fee33cfff1 100644
--- a/configs/mx6qsabrelite_defconfig
+++ b/configs/mx6qsabrelite_defconfig
@@ -3,15 +3,15 @@ CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x17800000
 CONFIG_TARGET_NITROGEN6X=y
 CONFIG_CMD_HDMIDETECT=y
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE"
 CONFIG_BOOTDELAY=3
+# CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
-CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
@@ -22,17 +22,12 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_DWC_AHSATA=y
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V5 1/2] imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  2018-04-16 12:47         ` [U-Boot] [PATCH V5 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
@ 2018-04-18 14:37           ` Gary Bisson
  0 siblings, 0 replies; 42+ messages in thread
From: Gary Bisson @ 2018-04-18 14:37 UTC (permalink / raw)
  To: u-boot

Hi Guillaume,

On Mon, Apr 16, 2018 at 02:47:37PM +0200, Guillaume GARDET wrote:
> Boot tested on sabrelite board.
> 
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Gary Bisson <gary.bisson@boundarydevices.com>

Reviewed-by: Gary Bisson <gary.bisson@boundarydevices.com>

Regards,
Gary

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V5 2/2] imx6: sabrelite: update defconfig to use distro defaults
  2018-04-16 12:47         ` [U-Boot] [PATCH V5 2/2] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
@ 2018-04-18 14:44           ` Gary Bisson
  2018-04-18 15:05             ` Guillaume Gardet
  0 siblings, 1 reply; 42+ messages in thread
From: Gary Bisson @ 2018-04-18 14:44 UTC (permalink / raw)
  To: u-boot

Hi Guillaume,

On Mon, Apr 16, 2018 at 02:47:38PM +0200, Guillaume GARDET wrote:
> Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots on sabrelite board.
> 
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
> 
> ---
>  configs/mx6qsabrelite_defconfig | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
> index 7499704058..fee33cfff1 100644
> --- a/configs/mx6qsabrelite_defconfig
> +++ b/configs/mx6qsabrelite_defconfig
> @@ -3,15 +3,15 @@ CONFIG_ARCH_MX6=y
>  CONFIG_SYS_TEXT_BASE=0x17800000
>  CONFIG_TARGET_NITROGEN6X=y
>  CONFIG_CMD_HDMIDETECT=y
> +CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE"
>  CONFIG_BOOTDELAY=3
> +# CONFIG_USE_BOOTCOMMAND is not set
>  CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
> -CONFIG_SUPPORT_RAW_INITRD=y
> +CONFIG_ARCH_MISC_INIT=y

The above config breaks the build since there's no arch_misc_init
function in the board file.

>  CONFIG_BOARD_EARLY_INIT_F=y
> -CONFIG_HUSH_PARSER=y
>  CONFIG_FASTBOOT=y
>  CONFIG_FASTBOOT_BUF_ADDR=0x12000000
> -CONFIG_CMD_BOOTZ=y
>  CONFIG_CMD_MEMTEST=y
>  CONFIG_SYS_ALT_MEMTEST=y
>  # CONFIG_CMD_FLASH is not set

Also, can you add CMD_GPT so that GPT parition tables are supported?

Many of our OS images now rely on it.

Regards,
Gary

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support
  2018-04-16 12:47       ` [U-Boot] [PATCH V5 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  2018-04-16 12:47         ` [U-Boot] [PATCH V5 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
  2018-04-16 12:47         ` [U-Boot] [PATCH V5 2/2] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
@ 2018-04-18 15:04         ` Guillaume GARDET
  2018-04-18 15:04           ` [U-Boot] [PATCH V6 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
                             ` (3 more replies)
  2 siblings, 4 replies; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-18 15:04 UTC (permalink / raw)
  To: u-boot

This patch serie updates sabrelite and nitrogen6x boards to use distro boot support.
Sabrelite has been boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
Nitrogen6* boards have been build tested only.

Currently, only the Sabrelite has fdtfile defined.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

Changes in V6:
  * added CONFIG_CMD_GPT to sabrelite defconfig
  * remove CONFIG_ARCH_MISC_INIT to sabrelite defconfig

Changes in V5:
  * remove obsolete code from include/configs/nitrogen6x.h
  
Changes in V4:
  * Remove imx6 soc definition
  * Change comment on not defined fdtfile (no more fallback)

Changes in V3:
  * Add imx6 soc definition
  * Also update nitrogen6x config, not only sabrelite
  * Split mx6qsabrelite_defconfig update to a separate patch
Changes in V2:
  * add mx6qsabrelite_defconfig update


Guillaume GARDET (2):
  imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  imx6: sabrelite: update defconfig to use distro defaults

 configs/mx6qsabrelite_defconfig |  15 ++--
 include/configs/nitrogen6x.h    | 179 ++++++++++------------------------------
 2 files changed, 48 insertions(+), 146 deletions(-)

-- 
2.13.6

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V6 1/2] imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  2018-04-18 15:04         ` [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
@ 2018-04-18 15:04           ` Guillaume GARDET
  2018-05-17  7:17             ` Denis Pynkin
  2018-04-18 15:04           ` [U-Boot] [PATCH V6 2/2] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
                             ` (2 subsequent siblings)
  3 siblings, 1 reply; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-18 15:04 UTC (permalink / raw)
  To: u-boot

Boot tested on sabrelite board.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

---
 include/configs/nitrogen6x.h | 179 +++++++++++--------------------------------
 1 file changed, 43 insertions(+), 136 deletions(-)

diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 7d2cf0bd8c..0d0be2a955 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -80,161 +80,68 @@
 
 #define CONFIG_PREBOOT                 ""
 
-#ifdef CONFIG_CMD_SATA
-#define CONFIG_DRIVE_SATA "sata "
+#ifdef CONFIG_CMD_MMC
+#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
 #else
-#define CONFIG_DRIVE_SATA
+#define DISTRO_BOOT_DEV_MMC(func)
 #endif
 
-#ifdef CONFIG_CMD_MMC
-#define CONFIG_DRIVE_MMC "mmc "
+#ifdef CONFIG_CMD_SATA
+#define DISTRO_BOOT_DEV_SATA(func) func(SATA, sata, 0)
 #else
-#define CONFIG_DRIVE_MMC
+#define DISTRO_BOOT_DEV_SATA(func)
 #endif
 
 #ifdef CONFIG_USB_STORAGE
-#define CONFIG_DRIVE_USB "usb "
+#define DISTRO_BOOT_DEV_USB(func) func(USB, usb, 0)
 #else
-#define CONFIG_DRIVE_USB
+#define DISTRO_BOOT_DEV_USB(func)
+#endif
+
+#ifdef CONFIG_CMD_PXE
+#define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na)
+#else
+#define DISTRO_BOOT_DEV_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_DHCP
+#define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na)
+#else
+#define DISTRO_BOOT_DEV_DHCP(func)
 #endif
 
-#define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
-#define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
 
 #if defined(CONFIG_SABRELITE)
+#define FDTFILE "fdtfile=imx6q-sabrelite.dtb\0"
+#else
+/* FIXME: nitrogen6x covers multiple configs. Define fdtfile for each supported config. */
+#define FDTFILE
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+	DISTRO_BOOT_DEV_MMC(func) \
+	DISTRO_BOOT_DEV_SATA(func) \
+	DISTRO_BOOT_DEV_USB(func) \
+	DISTRO_BOOT_DEV_PXE(func) \
+	DISTRO_BOOT_DEV_DHCP(func)
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"script=boot.scr\0" \
-	"uimage=uImage\0" \
 	"console=ttymxc1\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
-	"fdt_file=imx6q-sabrelite.dtb\0" \
-	"fdt_addr=0x18000000\0" \
-	"boot_fdt=try\0" \
+	"fdt_addr_r=0x18000000\0" \
+	FDTFILE \
+	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"  \
+	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
+	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+	"ramdisk_addr_r=0x13000000\0" \
+	"ramdiskaddr=0x13000000\0" \
 	"ip_dyn=yes\0" \
 	"usb_pgood_delay=2000\0" \
-	"mmcdevs=0 1\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
-	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
-	"loadbootscript=" \
-		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
-		"source\0" \
-	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
-	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-	"mmcboot=echo Booting from mmc ...; " \
-		"run mmcargs; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if run loadfdt; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0" \
-	"netargs=setenv bootargs console=${console},${baudrate} " \
-		"root=/dev/nfs " \
-	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-		"netboot=echo Booting from net ...; " \
-		"run netargs; " \
-		"if test ${ip_dyn} = yes; then " \
-			"setenv get_cmd dhcp; " \
-		"else " \
-			"setenv get_cmd tftp; " \
-		"fi; " \
-		"${get_cmd} ${uimage}; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootm; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootm; " \
-		"fi;\0"
-
-#define CONFIG_BOOTCOMMAND \
-	"for mmcdev in ${mmcdevs}; do " \
-		"mmc dev ${mmcdev}; " \
-		"if mmc rescan; then " \
-			"if run loadbootscript; then " \
-				"run bootscript; " \
-			"else " \
-				"if run loaduimage; then " \
-					"run mmcboot; " \
-				"fi; " \
-			"fi; " \
-		"fi; " \
-	"done; " \
-	"run netboot; "
-#else
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
-	"umsdevs=" CONFIG_UMSDEVS "\0" \
-	"usb_pgood_delay=2000\0" \
-	"console=ttymxc1\0" \
-	"clearenv=if sf probe || sf probe || sf probe 1 ; then " \
-		"sf erase 0xc0000 0x2000 && " \
-		"echo restored environment to factory default ; fi\0" \
-	"bootcmd=for dtype in ${bootdevs}" \
-		"; do " \
-			"if itest.s \"xusb\" == \"x${dtype}\" ; then " \
-				"usb start ;" \
-			"fi; " \
-			"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
-				"load " \
-					"${dtype} ${disk}:1 " \
-					"10008000 " \
-					"/6x_bootscript" \
-					"&& source 10008000 ; " \
-			"done ; " \
-		"done; " \
-		"setenv stdout serial,vga ; " \
-		"echo ; echo 6x_bootscript not found ; " \
-		"echo ; echo serial console at 115200, 8N1 ; echo ; " \
-		"echo details at http://boundarydevices.com/6q_bootscript ; " \
-		"setenv stdout serial;" \
-		"setenv stdin serial,usbkbd;" \
-		"for dtype in ${umsdevs} ; do " \
-			"if itest.s sata == ${dtype}; then " \
-				"initcmd='sata init' ;" \
-			"else " \
-				"initcmd='mmc rescan' ;" \
-			"fi; " \
-			"for disk in 0 1 ; do " \
-				"if $initcmd && $dtype dev $disk ; then " \
-					"setenv stdout serial,vga; " \
-					"echo expose ${dtype} ${disk} " \
-						"over USB; " \
-					"ums 0 $dtype $disk ;" \
-				"fi; " \
-		"	done; " \
-		"done ;" \
-		"setenv stdout serial,vga; " \
-		"echo no block devices found;" \
-		"\0" \
-	"initrd_high=0xffffffff\0" \
-	"upgradeu=for dtype in ${bootdevs}" \
-		"; do " \
-		"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
-			"load ${dtype} ${disk}:1 10008000 " \
-				"/6x_upgrade " \
-				"&& source 10008000 ; " \
-		"done ; " \
-	"done\0" \
+	BOOTENV
 
-#endif
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_MEMTEST_START       0x10000000
 #define CONFIG_SYS_MEMTEST_END	       0x10010000
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V6 2/2] imx6: sabrelite: update defconfig to use distro defaults
  2018-04-18 15:04         ` [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  2018-04-18 15:04           ` [U-Boot] [PATCH V6 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
@ 2018-04-18 15:04           ` Guillaume GARDET
  2018-05-16  7:20           ` [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume Gardet
  2018-05-17  9:51           ` Stefano Babic
  3 siblings, 0 replies; 42+ messages in thread
From: Guillaume GARDET @ 2018-04-18 15:04 UTC (permalink / raw)
  To: u-boot

Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots on sabrelite board.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>

---
 configs/mx6qsabrelite_defconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
index 7499704058..54a9fc84a1 100644
--- a/configs/mx6qsabrelite_defconfig
+++ b/configs/mx6qsabrelite_defconfig
@@ -3,36 +3,31 @@ CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x17800000
 CONFIG_TARGET_NITROGEN6X=y
 CONFIG_CMD_HDMIDETECT=y
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE"
 CONFIG_BOOTDELAY=3
+# CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
-CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+# CONFIG_RANDOM_UUID is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SATA=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
+# CONFIG_ISO_PARTITION is not set
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_DWC_AHSATA=y
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V5 2/2] imx6: sabrelite: update defconfig to use distro defaults
  2018-04-18 14:44           ` Gary Bisson
@ 2018-04-18 15:05             ` Guillaume Gardet
  0 siblings, 0 replies; 42+ messages in thread
From: Guillaume Gardet @ 2018-04-18 15:05 UTC (permalink / raw)
  To: u-boot

Hi,


Le 18/04/2018 à 16:44, Gary Bisson a écrit :
> Hi Guillaume,
>
> On Mon, Apr 16, 2018 at 02:47:38PM +0200, Guillaume GARDET wrote:
>> Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots on sabrelite board.
>>
>> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> Cc: Fabio Estevam <fabio.estevam@nxp.com>
>> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
>>
>> ---
>>   configs/mx6qsabrelite_defconfig | 15 +++++----------
>>   1 file changed, 5 insertions(+), 10 deletions(-)
>>
>> diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
>> index 7499704058..fee33cfff1 100644
>> --- a/configs/mx6qsabrelite_defconfig
>> +++ b/configs/mx6qsabrelite_defconfig
>> @@ -3,15 +3,15 @@ CONFIG_ARCH_MX6=y
>>   CONFIG_SYS_TEXT_BASE=0x17800000
>>   CONFIG_TARGET_NITROGEN6X=y
>>   CONFIG_CMD_HDMIDETECT=y
>> +CONFIG_DISTRO_DEFAULTS=y
>>   CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE"
>>   CONFIG_BOOTDELAY=3
>> +# CONFIG_USE_BOOTCOMMAND is not set
>>   CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
>> -CONFIG_SUPPORT_RAW_INITRD=y
>> +CONFIG_ARCH_MISC_INIT=y
> The above config breaks the build since there's no arch_misc_init
> function in the board file.
>
>>   CONFIG_BOARD_EARLY_INIT_F=y
>> -CONFIG_HUSH_PARSER=y
>>   CONFIG_FASTBOOT=y
>>   CONFIG_FASTBOOT_BUF_ADDR=0x12000000
>> -CONFIG_CMD_BOOTZ=y
>>   CONFIG_CMD_MEMTEST=y
>>   CONFIG_SYS_ALT_MEMTEST=y
>>   # CONFIG_CMD_FLASH is not set
> Also, can you add CMD_GPT so that GPT parition tables are supported?
>
> Many of our OS images now rely on it.

Ok, patch V6 sent just now.

Guillaume

>
> Regards,
> Gary
>

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support
  2018-04-18 15:04         ` [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
  2018-04-18 15:04           ` [U-Boot] [PATCH V6 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
  2018-04-18 15:04           ` [U-Boot] [PATCH V6 2/2] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
@ 2018-05-16  7:20           ` Guillaume Gardet
  2018-05-17  9:51           ` Stefano Babic
  3 siblings, 0 replies; 42+ messages in thread
From: Guillaume Gardet @ 2018-05-16  7:20 UTC (permalink / raw)
  To: u-boot

Hi,

just a friendly reminder for those 2 patches.


Guillaume



Le 18/04/2018 à 17:04, Guillaume GARDET a écrit :
> This patch serie updates sabrelite and nitrogen6x boards to use distro boot support.
> Sabrelite has been boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
> Nitrogen6* boards have been build tested only.
>
> Currently, only the Sabrelite has fdtfile defined.
>
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
>
> Changes in V6:
>    * added CONFIG_CMD_GPT to sabrelite defconfig
>    * remove CONFIG_ARCH_MISC_INIT to sabrelite defconfig
>
> Changes in V5:
>    * remove obsolete code from include/configs/nitrogen6x.h
>    
> Changes in V4:
>    * Remove imx6 soc definition
>    * Change comment on not defined fdtfile (no more fallback)
>
> Changes in V3:
>    * Add imx6 soc definition
>    * Also update nitrogen6x config, not only sabrelite
>    * Split mx6qsabrelite_defconfig update to a separate patch
> Changes in V2:
>    * add mx6qsabrelite_defconfig update
>
>
> Guillaume GARDET (2):
>    imx6: Convert sabrelite and nitrogen6x boards to distro boot support
>    imx6: sabrelite: update defconfig to use distro defaults
>
>   configs/mx6qsabrelite_defconfig |  15 ++--
>   include/configs/nitrogen6x.h    | 179 ++++++++++------------------------------
>   2 files changed, 48 insertions(+), 146 deletions(-)
>

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V6 1/2] imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  2018-04-18 15:04           ` [U-Boot] [PATCH V6 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
@ 2018-05-17  7:17             ` Denis Pynkin
  0 siblings, 0 replies; 42+ messages in thread
From: Denis Pynkin @ 2018-05-17  7:17 UTC (permalink / raw)
  To: u-boot

On 04/18/2018 06:04 PM, Guillaume GARDET wrote:
> Boot tested on sabrelite board.
> 
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
> 
> ---
>   include/configs/nitrogen6x.h | 179 +++++++++++--------------------------------
>   1 file changed, 43 insertions(+), 136 deletions(-)

Tested-by: Denis Pynkin <denis.pynkin@collabora.com>

Tested with SabreLite board:

mmc0 is current device
Scanning mmc 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
318 bytes read in 47 ms (5.9 KiB/s)
1:      Linux 4.14.0-0.bpo.2-armmp
Retrieving file: /initrd.img-4.14.0-0.bpo.2-armmp
6654596 bytes read in 481 ms (13.2 MiB/s)
Retrieving file: /vmlinuz-4.14.0-0.bpo.2-armmp
3985920 bytes read in 309 ms (12.3 MiB/s)
append: root=UUID=ddc5cc49-8a42-4eef-b36f-c5202cb6573aconsole=tty0 
console=ttymxc1,115200n8 plymouth.ignore-serial-consoles root=LABEL=system
Retrieving file: /dtbs/4.14.0-0.bpo.2-armmp/imx6q-sabrelite.dtb
42927 bytes read in 614 ms (67.4 KiB/s)


Used own defconfig file with this patch and enabled 
"CONFIG_DISTRO_DEFAULTS=y"

Guillaume, thank you for adding the patch.

-- 
wbr, Denis

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support
  2018-04-18 15:04         ` [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
                             ` (2 preceding siblings ...)
  2018-05-16  7:20           ` [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume Gardet
@ 2018-05-17  9:51           ` Stefano Babic
  2018-05-17 15:45             ` Troy Kisky
  3 siblings, 1 reply; 42+ messages in thread
From: Stefano Babic @ 2018-05-17  9:51 UTC (permalink / raw)
  To: u-boot

Hi Guillaume,

On 18/04/2018 17:04, Guillaume GARDET wrote:
> This patch serie updates sabrelite and nitrogen6x boards to use distro boot support.
> Sabrelite has been boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
> Nitrogen6* boards have been build tested only.
> 
> Currently, only the Sabrelite has fdtfile defined.
> 

Fine, but Troy is the maintainer for this board and I have not yet seen
if he agrees to switch the board to the distro environment. I would like
to have his ACK before pushing this.

Best regards,
Stefano Babic

> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Troy Kisky <troy.kisky@boundarydevices.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
> 
> Changes in V6:
>   * added CONFIG_CMD_GPT to sabrelite defconfig
>   * remove CONFIG_ARCH_MISC_INIT to sabrelite defconfig
> 
> Changes in V5:
>   * remove obsolete code from include/configs/nitrogen6x.h
>   
> Changes in V4:
>   * Remove imx6 soc definition
>   * Change comment on not defined fdtfile (no more fallback)
> 
> Changes in V3:
>   * Add imx6 soc definition
>   * Also update nitrogen6x config, not only sabrelite
>   * Split mx6qsabrelite_defconfig update to a separate patch
> Changes in V2:
>   * add mx6qsabrelite_defconfig update
> 
> 
> Guillaume GARDET (2):
>   imx6: Convert sabrelite and nitrogen6x boards to distro boot support
>   imx6: sabrelite: update defconfig to use distro defaults
> 
>  configs/mx6qsabrelite_defconfig |  15 ++--
>  include/configs/nitrogen6x.h    | 179 ++++++++++------------------------------
>  2 files changed, 48 insertions(+), 146 deletions(-)
> 


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support
  2018-05-17  9:51           ` Stefano Babic
@ 2018-05-17 15:45             ` Troy Kisky
  2018-05-17 15:46               ` Stefano Babic
  0 siblings, 1 reply; 42+ messages in thread
From: Troy Kisky @ 2018-05-17 15:45 UTC (permalink / raw)
  To: u-boot

On 5/17/2018 2:51 AM, Stefano Babic wrote:
> Hi Guillaume,
> 
> On 18/04/2018 17:04, Guillaume GARDET wrote:
>> This patch serie updates sabrelite and nitrogen6x boards to use distro boot support.
>> Sabrelite has been boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
>> Nitrogen6* boards have been build tested only.
>>
>> Currently, only the Sabrelite has fdtfile defined.
>>
> 
> Fine, but Troy is the maintainer for this board and I have not yet seen
> if he agrees to switch the board to the distro environment. I would like
> to have his ACK before pushing this.
> 
> Best regards,
> Stefano Babic

Sorry, for the delay

Acked-by: Troy Kisky <troy.kisky@boundarydevices.com>

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support
  2018-05-17 15:45             ` Troy Kisky
@ 2018-05-17 15:46               ` Stefano Babic
  0 siblings, 0 replies; 42+ messages in thread
From: Stefano Babic @ 2018-05-17 15:46 UTC (permalink / raw)
  To: u-boot

On 17/05/2018 17:45, Troy Kisky wrote:
> On 5/17/2018 2:51 AM, Stefano Babic wrote:
>> Hi Guillaume,
>>
>> On 18/04/2018 17:04, Guillaume GARDET wrote:
>>> This patch serie updates sabrelite and nitrogen6x boards to use distro boot support.
>>> Sabrelite has been boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots.
>>> Nitrogen6* boards have been build tested only.
>>>
>>> Currently, only the Sabrelite has fdtfile defined.
>>>
>>
>> Fine, but Troy is the maintainer for this board and I have not yet seen
>> if he agrees to switch the board to the distro environment. I would like
>> to have his ACK before pushing this.
>>
>> Best regards,
>> Stefano Babic
> 
> Sorry, for the delay

No worry.
> 
> Acked-by: Troy Kisky <troy.kisky@boundarydevices.com>
> 

I apply the patches to u-boot-imx, thanks !

Best regards,
Stefano


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2018-05-17 15:46 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-06 10:05 [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to distro boot support Guillaume GARDET
2018-04-09  6:39 ` [U-Boot] [PATCH V2] " Guillaume GARDET
2018-04-11 10:38   ` [U-Boot] [PATCH V3 0/3] Update sabrelite and nitrogen6x boards to use " Guillaume GARDET
2018-04-11 10:38     ` [U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC Guillaume GARDET
2018-04-11 14:23       ` Fabio Estevam
2018-04-11 14:41         ` Guillaume Gardet
2018-04-11 15:41           ` Fabio Estevam
2018-04-11 15:46       ` Gary Bisson
2018-04-11 15:52         ` Guillaume Gardet
2018-04-11 16:06           ` Fabio Estevam
2018-04-12  8:13             ` Guillaume Gardet
2018-04-12 11:14               ` Fabio Estevam
2018-04-12 12:36                 ` Gary Bisson
2018-04-12 12:48                   ` Guillaume Gardet
2018-04-12 12:58                     ` Gary Bisson
2018-04-12 13:07                       ` Guillaume Gardet
2018-04-11 10:38     ` [U-Boot] [PATCH V3 2/3] imx6: Convert sabrelite and nitrogen6x boards to distro boot support Guillaume GARDET
2018-04-11 10:38     ` [U-Boot] [PATCH V3 3/3] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
2018-04-12 13:28     ` [U-Boot] [PATCH V4 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
2018-04-12 13:28       ` [U-Boot] [PATCH V4 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
2018-04-16  7:45         ` Gary Bisson
2018-04-12 13:28       ` [U-Boot] [PATCH V4 2/2] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
2018-04-16 12:47       ` [U-Boot] [PATCH V5 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
2018-04-16 12:47         ` [U-Boot] [PATCH V5 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
2018-04-18 14:37           ` Gary Bisson
2018-04-16 12:47         ` [U-Boot] [PATCH V5 2/2] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
2018-04-18 14:44           ` Gary Bisson
2018-04-18 15:05             ` Guillaume Gardet
2018-04-18 15:04         ` [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume GARDET
2018-04-18 15:04           ` [U-Boot] [PATCH V6 1/2] imx6: Convert sabrelite and nitrogen6x boards to " Guillaume GARDET
2018-05-17  7:17             ` Denis Pynkin
2018-04-18 15:04           ` [U-Boot] [PATCH V6 2/2] imx6: sabrelite: update defconfig to use distro defaults Guillaume GARDET
2018-05-16  7:20           ` [U-Boot] [PATCH V6 0/2] Update sabrelite and nitrogen6x boards to use distro boot support Guillaume Gardet
2018-05-17  9:51           ` Stefano Babic
2018-05-17 15:45             ` Troy Kisky
2018-05-17 15:46               ` Stefano Babic
2018-04-09 14:40 ` [U-Boot] [PATCH] imx: nitrogen6x: Convert Sabrelite to " Gary Bisson
2018-04-09 15:17   ` Guillaume Gardet
2018-04-10 11:50     ` Gary Bisson
2018-04-13  5:08       ` Joe Hershberger
2018-04-09 17:27   ` Fabio Estevam
2018-04-10 12:05     ` Gary Bisson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.