Skip to contentSkip to conversation

imx: nitrogen6x: Convert Sabrelite to distro boot support

PATCH Superseded Guillaume GARDET 7 participants 42 messages Apr 6, 2018 – May 17, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imx: nitrogen6x: Convert Sabrelite to distro boot support

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 include/configs/nitrogen6x.h | 86 ++++++++++----------------------------------
 1 file changed, 18 insertions(+), 68 deletions(-)
include/configs/nitrogen6x.h +18 -68
index c73cfb7f7e..2e2c499cb6 100644
@@ -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" \
Signature · 1 line
2.13.6
#1 lore raw

PATCH v2 1/1 imx: nitrogen6x: Convert Sabrelite to distro boot support

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>

---
Changes in V2:
* add mx6qsabrelite_defconfig update

 configs/mx6qsabrelite_defconfig | 16 ++------
 include/configs/nitrogen6x.h    | 86 +++++++++--------------------------------
 2 files changed, 22 insertions(+), 80 deletions(-)
configs/mx6qsabrelite_defconfig +4 -12
index 7499704058..c644754929 100644
@@ -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
include/configs/nitrogen6x.h +18 -68

100 lines not on this page · raw message

Signature · 1 line
2.13.6
#2 lore raw

v3 cover Update sabrelite and nitrogen6x boards to use distro boot support

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.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>

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(-)
Signature · 1 line
2.13.6
#3 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 arch/arm/mach-imx/mx6/soc.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
arch/arm/mach-imx/mx6/soc.c +34 -0
index 9b3d8f69b2..c4cb752c76 100644
@@ -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)
 {
Signature · 1 line
2.13.6
#5 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

Hi,

Le 11/04/2018 à 16:23, Fabio Estevam a écrit :

Quoted 6 lines

Hi Guillaume,

On Wed, Apr 11, 2018 at 7:38 AM, Guillaume GARDET
<[email protected]> 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?

Quoted 6 lines
Quoted 6 lines
Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
reviewer
#6 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

Quoted 3 lines · Guillaume Gardet

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

#7 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

In reply to Guillaume GARDET

Hi Guillaume,

Quoted 18 lines · Guillaume GARDET
Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 arch/arm/mach-imx/mx6/soc.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
arch/arm/mach-imx/mx6/soc.c +0 -0
index 9b3d8f69b2..c4cb752c76 100644
@@ -446,6 +446,40 @@ int arch_cpu_init(void)
 	return 0;
 }
 

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 458

Quoted 10 lines
arch/arm/mach-imx/mx6/soc.c +10 -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.

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 460

Quoted 2 lines
arch/arm/mach-imx/mx6/soc.c +2 -0
+	else if (is_cpu_type(MXC_CPU_MX6D))
+		env_set("soc", "imx6d");

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

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 468

Quoted 8 lines
arch/arm/mach-imx/mx6/soc.c +8 -0
+	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.

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 476

Quoted 8 lines
arch/arm/mach-imx/mx6/soc.c +8 -0
+	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

#8 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

Le 11/04/2018 à 17:46, Gary Bisson a écrit :

Quoted 38 lines

Hi Guillaume,

Quoted 18 lines · Guillaume GARDET
Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
  arch/arm/mach-imx/mx6/soc.c | 34 ++++++++++++++++++++++++++++++++++
  1 file changed, 34 insertions(+)
arch/arm/mach-imx/mx6/soc.c +0 -0
index 9b3d8f69b2..c4cb752c76 100644
@@ -446,6 +446,40 @@ int arch_cpu_init(void)
  	return 0;
  }
 

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 458

Quoted 10 lines
arch/arm/mach-imx/mx6/soc.c +10 -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.

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 460

Quoted 2 lines
arch/arm/mach-imx/mx6/soc.c +2 -0
+	else if (is_cpu_type(MXC_CPU_MX6D))
+		env_set("soc", "imx6d");

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

Quoted 9 lines

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 468

Quoted 8 lines
arch/arm/mach-imx/mx6/soc.c +8 -0
+	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?

Quoted 11 lines

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 476

Quoted 9 lines
arch/arm/mach-imx/mx6/soc.c +8 -0
+	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

Quoted 4 lines

Regards,
Gary

reviewer
#9 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

Quoted 2 lines · Guillaume Gardet

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.

#10 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

Le 11/04/2018 à 18:06, Fabio Estevam a écrit :

Quoted 5 lines
Quoted 2 lines · Guillaume Gardet

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

Quoted 9 lines

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

reviewer
#11 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

On Thu, Apr 12, 2018 at 5:13 AM, Guillaume Gardet
<[email protected]> wrote:
script that picks the correct dtb.

Quoted 5 lines
Quoted 1 line

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.

Quoted 2 lines

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.

#12 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

Hi Fabio, Guillaume

Quoted 11 lines · Fabio Estevam

On Thu, Apr 12, 2018 at 5:13 AM, Guillaume Gardet
<[email protected]> wrote:
script that picks the correct dtb.

Quoted 5 lines
Quoted 1 line

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

#13 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

Le 12/04/2018 à 14:36, Gary Bisson a écrit :

Quoted 19 lines

Hi Fabio, Guillaume

Quoted 9 lines · Fabio Estevam

On Thu, Apr 12, 2018 at 5:13 AM, Guillaume Gardet
<[email protected]> wrote:
script that picks the correct dtb.

Quoted 4 lines

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.

Quoted 6 lines

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

#14 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

Hi Guillaume,

Quoted 29 lines · Guillaume Gardet

Le 12/04/2018 à 14:36, Gary Bisson a écrit :

Quoted 19 lines

Hi Fabio, Guillaume

Quoted 9 lines · Fabio Estevam

On Thu, Apr 12, 2018 at 5:13 AM, Guillaume Gardet
<[email protected]> wrote:
script that picks the correct dtb.

Quoted 4 lines

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.

Quoted 6 lines

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.

Quoted 7 lines

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

#15 lore raw

PATCH v3 1/3 imx6: Define 'soc' env var for imx6 SoC

Le 12/04/2018 à 14:58, Gary Bisson a écrit :

Quoted 37 lines

Hi Guillaume,

Quoted 27 lines · Guillaume Gardet

Le 12/04/2018 à 14:36, Gary Bisson a écrit :

Quoted 19 lines

Hi Fabio, Guillaume

Quoted 9 lines · Fabio Estevam

On Thu, Apr 12, 2018 at 5:13 AM, Guillaume Gardet
<[email protected]> wrote:
script that picks the correct dtb.

Quoted 4 lines

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.

Quoted 6 lines

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.

Quoted 7 lines

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

Quoted 5 lines

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

Quoted 4 lines

Regards,
Gary

#16 lore raw

PATCH v3 2/3 imx6: Convert sabrelite and nitrogen6x boards to distro boot support

In reply to Guillaume GARDET

Boot tested on sabrelite board.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 include/configs/nitrogen6x.h | 180 +++++++++++++------------------------------
 1 file changed, 54 insertions(+), 126 deletions(-)
include/configs/nitrogen6x.h +54 -126
index 7d2cf0bd8c..589c5b1ae8 100644
@@ -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
Signature · 1 line
2.13.6
#17 lore raw

PATCH v3 3/3 imx6: sabrelite: update defconfig to use distro defaults

In reply to Guillaume GARDET

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 configs/mx6qsabrelite_defconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
configs/mx6qsabrelite_defconfig +5 -10
index 7499704058..fee33cfff1 100644
@@ -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
Signature · 1 line
2.13.6
#18 lore raw

v4 cover Update sabrelite and nitrogen6x boards to use distro boot support

In reply to Guillaume GARDET

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.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>

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(-)
Signature · 1 line
2.13.6
#19 lore raw

PATCH v4 1/2 imx6: Convert sabrelite and nitrogen6x boards to distro boot support

Boot tested on sabrelite board.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 include/configs/nitrogen6x.h | 180 +++++++++++++------------------------------
 1 file changed, 54 insertions(+), 126 deletions(-)
include/configs/nitrogen6x.h +54 -126
index 7d2cf0bd8c..f6dce6c069 100644
@@ -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
Signature · 1 line
2.13.6
#20 lore raw

PATCH v4 1/2 imx6: Convert sabrelite and nitrogen6x boards to distro boot support

Hi Guillaume,

Quoted 17 lines · Guillaume GARDET

Boot tested on sabrelite board.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 include/configs/nitrogen6x.h | 180 +++++++++++++------------------------------
 1 file changed, 54 insertions(+), 126 deletions(-)
include/configs/nitrogen6x.h +0 -0
index 7d2cf0bd8c..f6dce6c069 100644

include/configs/nitrogen6x.h line 102

Quoted 2 lines
include/configs/nitrogen6x.h +0 -0
@@ -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

Quoted 193 lines
include/configs/nitrogen6x.h +54 -126
+#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
Signature · 1 line
2.13.6

Regards,
Gary

#21 lore raw

PATCH v4 2/2 imx6: sabrelite: update defconfig to use distro defaults

In reply to Guillaume GARDET

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 configs/mx6qsabrelite_defconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
configs/mx6qsabrelite_defconfig +5 -10
index 7499704058..fee33cfff1 100644
@@ -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
Signature · 1 line
2.13.6
#22 lore raw

v5 cover Update sabrelite and nitrogen6x boards to use distro boot support

In reply to Guillaume GARDET

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.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>

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(-)
Signature · 1 line
2.13.6
#23 lore raw

PATCH v5 1/2 imx6: Convert sabrelite and nitrogen6x boards to distro boot support

Boot tested on sabrelite board.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 include/configs/nitrogen6x.h | 179 +++++++++++--------------------------------
 1 file changed, 43 insertions(+), 136 deletions(-)
include/configs/nitrogen6x.h +43 -136
index 7d2cf0bd8c..0d0be2a955 100644
@@ -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
Signature · 1 line
2.13.6
#25 lore raw

PATCH v5 2/2 imx6: sabrelite: update defconfig to use distro defaults

In reply to Guillaume GARDET

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 configs/mx6qsabrelite_defconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
configs/mx6qsabrelite_defconfig +5 -10
index 7499704058..fee33cfff1 100644
@@ -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
Signature · 1 line
2.13.6
#26 lore raw

PATCH v5 2/2 imx6: sabrelite: update defconfig to use distro defaults

Hi Guillaume,

Quoted 17 lines · Guillaume GARDET

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 configs/mx6qsabrelite_defconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
configs/mx6qsabrelite_defconfig +0 -0
index 7499704058..fee33cfff1 100644

configs/mx6qsabrelite_defconfig CONFIG_ARCH_MX6=y · line 11

Quoted 10 lines
configs/mx6qsabrelite_defconfig +3 -1
@@ -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.

configs/mx6qsabrelite_defconfig CONFIG_ARCH_MX6=y · line 17

Quoted 8 lines
configs/mx6qsabrelite_defconfig +0 -2
 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

#27 lore raw

PATCH v5 2/2 imx6: sabrelite: update defconfig to use distro defaults

Hi,

Le 18/04/2018 à 16:44, Gary Bisson a écrit :

Quoted 43 lines

Hi Guillaume,

Quoted 17 lines · Guillaume GARDET

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
  configs/mx6qsabrelite_defconfig | 15 +++++----------
  1 file changed, 5 insertions(+), 10 deletions(-)
configs/mx6qsabrelite_defconfig +0 -0
index 7499704058..fee33cfff1 100644

configs/mx6qsabrelite_defconfig CONFIG_ARCH_MX6=y · line 11

Quoted 10 lines
configs/mx6qsabrelite_defconfig +3 -1
@@ -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.

configs/mx6qsabrelite_defconfig CONFIG_ARCH_MX6=y · line 17

Quoted 8 lines
configs/mx6qsabrelite_defconfig +0 -2
  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?

Quoted 1 line

Many of our OS images now rely on it.

Ok, patch V6 sent just now.

Guillaume

Quoted 4 lines

Regards,
Gary

#28 lore raw

v6 cover Update sabrelite and nitrogen6x boards to use distro boot support

In reply to Guillaume GARDET

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.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>

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(-)
Signature · 1 line
2.13.6
#29 lore raw

PATCH v6 1/2 imx6: Convert sabrelite and nitrogen6x boards to distro boot support

Boot tested on sabrelite board.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 include/configs/nitrogen6x.h | 179 +++++++++++--------------------------------
 1 file changed, 43 insertions(+), 136 deletions(-)
include/configs/nitrogen6x.h +43 -136
index 7d2cf0bd8c..0d0be2a955 100644
@@ -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
Signature · 1 line
2.13.6
#30 lore raw

PATCH v6 1/2 imx6: Convert sabrelite and nitrogen6x boards to distro boot support

Quoted 11 lines · Guillaume GARDET

Boot tested on sabrelite board.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
  include/configs/nitrogen6x.h | 179 +++++++++++--------------------------------
  1 file changed, 43 insertions(+), 136 deletions(-)

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.

Signature · 1 line
wbr, Denis
#31 lore raw

PATCH v6 2/2 imx6: sabrelite: update defconfig to use distro defaults

In reply to Guillaume GARDET

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>
---
 configs/mx6qsabrelite_defconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
configs/mx6qsabrelite_defconfig +5 -10
index 7499704058..54a9fc84a1 100644
@@ -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
Signature · 1 line
2.13.6
#32 lore raw

v6 cover Update sabrelite and nitrogen6x boards to use distro boot support

In reply to Guillaume GARDET

Hi,

just a friendly reminder for those 2 patches.

Guillaume

Le 18/04/2018 à 17:04, Guillaume GARDET a écrit :

Quoted 39 lines

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.

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>

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(-)
#33 lore raw

v6 cover Update sabrelite and nitrogen6x boards to use distro boot support

In reply to Guillaume GARDET

Hi Guillaume,

Quoted 6 lines · Guillaume GARDET

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

Quoted 33 lines
Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Gary Bisson <[email protected]>

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(-)
Signature · 5 lines
=====================================================================
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
=====================================================================
#34 lore raw

v6 cover Update sabrelite and nitrogen6x boards to use distro boot support

Quoted 10 lines · Stefano Babic

Hi Guillaume,

Quoted 6 lines · Guillaume GARDET

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.

Quoted 6 lines

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

#35 lore raw

v6 cover Update sabrelite and nitrogen6x boards to use distro boot support

Quoted 11 lines · Troy Kisky
Quoted 10 lines · Stefano Babic

Hi Guillaume,

Quoted 6 lines · Guillaume GARDET

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.

Quoted 8 lines
Quoted 6 lines

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.

Quoted 3 lines

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

Best regards,
Stefano

Signature · 5 lines
=====================================================================
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
=====================================================================
#36 lore raw

PATCH 1/1 imx: nitrogen6x: Convert Sabrelite to distro boot support

In reply to Guillaume GARDET

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.

Quoted 15 lines · Guillaume GARDET

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 include/configs/nitrogen6x.h | 86 ++++++++++----------------------------------
 1 file changed, 18 insertions(+), 68 deletions(-)
include/configs/nitrogen6x.h +0 -0
index c73cfb7f7e..2e2c499cb6 100644

include/configs/nitrogen6x.h line 104

Quoted 3 lines
include/configs/nitrogen6x.h +0 -0
@@ -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.

include/configs/nitrogen6x.h line 110

Quoted 6 lines
include/configs/nitrogen6x.h +6 -0
+#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].

include/configs/nitrogen6x.h line 119

Quoted 12 lines
include/configs/nitrogen6x.h +5 -3
+	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.

include/configs/nitrogen6x.h line 120

Quoted 1 line
include/configs/nitrogen6x.h +0 -0
 	"fdt_addr=0x18000000\0" \

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

Quoted 80 lines
include/configs/nitrogen6x.h +7 -65
-	"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" \
Signature · 1 line
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

#37 lore raw

PATCH 1/1 imx: nitrogen6x: Convert Sabrelite to distro boot support

Le 09/04/2018 à 16:40, Gary Bisson a écrit :

Quoted 24 lines

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.

Quoted 17 lines · Guillaume GARDET

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
  include/configs/nitrogen6x.h | 86 ++++++++++----------------------------------
  1 file changed, 18 insertions(+), 68 deletions(-)
include/configs/nitrogen6x.h +0 -0
index c73cfb7f7e..2e2c499cb6 100644
@@ -102,82 +102,32 @@
  #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
 
Quoted 2 lines

include/configs/nitrogen6x.h line 104

Quoted 1 line
include/configs/nitrogen6x.h +0 -0
  #if defined(CONFIG_SABRELITE)

Please also switch nitrogen6x to it, not only sabrelite.

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

Quoted 12 lines

include/configs/nitrogen6x.h line 110

Quoted 7 lines
include/configs/nitrogen6x.h +6 -0
+#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’"

Quoted 2 lines

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.

Quoted 18 lines

include/configs/nitrogen6x.h line 119

Quoted 13 lines
include/configs/nitrogen6x.h +5 -3
+	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.

Quoted 5 lines

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

include/configs/nitrogen6x.h line 120

Quoted 1 line
include/configs/nitrogen6x.h +0 -0
  	"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.

Quoted 74 lines
Quoted 74 lines
include/configs/nitrogen6x.h +7 -63
-	"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; " \
Quoted 8 lines
Quoted 7 lines
include/configs/nitrogen6x.h +0 -2
-	"done; " \
-	"run netboot; "
  #else
  #define CONFIG_EXTRA_ENV_SETTINGS \
  	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
Signature · 1 line
2.13.6

The rest looks good to me.

Ok. Thanks.

Guillaume

Quoted 7 lines

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

#38 lore raw

PATCH 1/1 imx: nitrogen6x: Convert Sabrelite to distro boot support

Hi Guillaume,

Quoted 29 lines · Guillaume Gardet

Le 09/04/2018 à 16:40, Gary Bisson a écrit :

Quoted 17 lines

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.

Quoted 10 lines · Guillaume GARDET

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
  include/configs/nitrogen6x.h | 86 ++++++++++----------------------------------
  1 file changed, 18 insertions(+), 68 deletions(-)
Quoted 8 lines

include/configs/nitrogen6x.h line 103

Quoted 7 lines
include/configs/nitrogen6x.h +0 -0
index c73cfb7f7e..2e2c499cb6 100644
@@ -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.

Quoted 1 line

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

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

Quoted 11 lines
Quoted 11 lines

include/configs/nitrogen6x.h line 110

Quoted 6 lines
include/configs/nitrogen6x.h +6 -0
+#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’"

Quoted 4 lines
Quoted 2 lines

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.

Quoted 17 lines
Quoted 17 lines

include/configs/nitrogen6x.h line 119

Quoted 12 lines
include/configs/nitrogen6x.h +5 -3
+	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.

Quoted 7 lines
Quoted 5 lines

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

include/configs/nitrogen6x.h line 120

Quoted 1 line
include/configs/nitrogen6x.h +0 -0
  	"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

#39 lore raw

PATCH 1/1 imx: nitrogen6x: Convert Sabrelite to distro boot support

Quoted 47 lines · Gary Bisson

Hi Guillaume,

Quoted 29 lines · Guillaume Gardet
Quoted 17 lines · Gary Bisson

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.

Quoted 10 lines · Guillaume GARDET

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

Cc Troy Kisky <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
  include/configs/nitrogen6x.h | 86 ++++++++++----------------------------------
  1 file changed, 18 insertions(+), 68 deletions(-)
Quoted 8 lines

include/configs/nitrogen6x.h line 103

Quoted 7 lines
include/configs/nitrogen6x.h +0 -0
index c73cfb7f7e..2e2c499cb6 100644
@@ -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.

Quoted 1 line

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

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

Quoted 11 lines
Quoted 11 lines

include/configs/nitrogen6x.h line 110

Quoted 6 lines
include/configs/nitrogen6x.h +6 -0
+#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’"

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

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.

Quoted 33 lines
Quoted 17 lines
Quoted 17 lines

include/configs/nitrogen6x.h line 119

Quoted 12 lines
include/configs/nitrogen6x.h +5 -3
+ 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.

Quoted 7 lines
Quoted 5 lines

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

include/configs/nitrogen6x.h line 120

Quoted 1 line
include/configs/nitrogen6x.h +0 -0
          "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

reviewer
#40 lore raw

PATCH 1/1 imx: nitrogen6x: Convert Sabrelite to distro boot support

In reply to Gary Bisson

Hi Gary,

Quoted 11 lines · Gary Bisson

include/configs/nitrogen6x.h line 119

Quoted 8 lines

#define CONFIG_EXTRA_ENV_SETTINGS \

include/configs/nitrogen6x.h +1 -3
-     "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

#41 lore raw

PATCH 1/1 imx: nitrogen6x: Convert Sabrelite to distro boot support

Hi Fabio,

Quoted 14 lines · Fabio Estevam

Hi Gary,

Quoted 9 lines · Gary Bisson
Quoted 8 lines

#define CONFIG_EXTRA_ENV_SETTINGS \

include/configs/nitrogen6x.h +1 -3
-     "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" \
Quoted 5 lines
Quoted 2 lines

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