All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH 0/7] Switch am335x_evm.h based boards to use config_distro_bootcmd.
@ 2014-10-03 22:08 Vagrant Cascadian
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 1/7] Allow checking in multiple partitions for scan_dev_for_boot Vagrant Cascadian
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Vagrant Cascadian @ 2014-10-03 22:08 UTC (permalink / raw)
  To: u-boot


In order to not change behavior significantly, several changes to
config_distro_bootcmd were added to make it more flexible, and
am335x_evm.h was adapted to make use of them:

- Allow multiple partitions per device, rather than only searching on
  partition 1. Make the number of partitions configurable.

- Added BOOTENV_INIT_COMMAND and BOOTENV_POST_COMMAND as definitions
  for commands that need to be run before or after the standard
  "bootcmd".

- Added support for importing uEnv.txt files to
  config_distro_bootcmd.h.

 include/config_distro_bootcmd.h   | 53 ++++++++++++++++++++++++++++++++++++++++++++++-------
 include/config_distro_defaults.h  |  2 ++
 include/configs/am335x_evm.h      | 26 +++++++++++++++++---------
 include/configs/ti_armv7_common.h |  1 +
 4 files changed, 66 insertions(+), 16 deletions(-)


Vagrant Cascadian (7):
  Allow checking in multiple partitions for scan_dev_for_boot.
  Allow overriding boot_partitions default value by setting    
    BOOTENV_BOOT_PARTITIONS before including config_distro_bootcmd.
  Add BOOTENV_INIT_COMMAND for commands that may be needed to run before
        bootcmd, such as setting the fdt file variables for platfroms
    that     detect on boot.
  Add BOOTENV_POST_COMMAND, which is appended to the end of bootcmd.
  Only set CONFIG_BOOTDELAY if not already set.
  Add support for loading environment from uEnv.txt in    
    config_distro_bootcmd.
  Switch am335x_evm.h to use config_distro_defaults and    
    config_distro_bootcmd. Add scriptaddr to DEFAULT_LINUX_BOOT_ENV, as 
       scriptaddr is used for boot scripts in config_distro_bootcmd.

 include/config_distro_bootcmd.h   | 53 +++++++++++++++++++++++++++++++++------
 include/config_distro_defaults.h  |  2 ++
 include/configs/am335x_evm.h      | 26 ++++++++++++-------
 include/configs/ti_armv7_common.h |  1 +
 4 files changed, 66 insertions(+), 16 deletions(-)

-- 
2.1.0

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

* [U-Boot] [RFC PATCH 1/7] Allow checking in multiple partitions for scan_dev_for_boot.
  2014-10-03 22:08 [U-Boot] [RFC PATCH 0/7] Switch am335x_evm.h based boards to use config_distro_bootcmd Vagrant Cascadian
@ 2014-10-03 22:08 ` Vagrant Cascadian
  2014-10-07  3:48   ` Stephen Warren
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 2/7] Allow overriding boot_partitions default value by setting BOOTENV_BOOT_PARTITIONS before including config_distro_bootcmd Vagrant Cascadian
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Vagrant Cascadian @ 2014-10-03 22:08 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
---

 include/config_distro_bootcmd.h | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index be616e8..5e5e5e3 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -163,7 +163,7 @@
 	"boot_prefixes=/ /boot/\0" \
 	"boot_scripts=boot.scr.uimg boot.scr\0" \
 	BOOTENV_BOOT_TARGETS \
-	"bootpart=1\0" \
+	"boot_partitions=1\0" \
 	\
 	"boot_extlinux="                                                  \
 		"sysboot ${devtype} ${devnum}:${bootpart} any "           \
@@ -194,10 +194,13 @@
 		"done\0"                                                  \
 	\
 	"scan_dev_for_boot="                                              \
-		"echo Scanning ${devtype} ${devnum}...; "                 \
-		"for prefix in ${boot_prefixes}; do "                     \
-			"run scan_dev_for_extlinux; "                     \
-			"run scan_dev_for_scripts; "                      \
+		"for partition in ${boot_partitions}; do "                \
+			"echo Scanning ${devtype} ${devnum}:${partition}...; " \
+			"setenv bootpart ${partition};"                   \
+			"for prefix in ${boot_prefixes}; do "             \
+				"run scan_dev_for_extlinux; "             \
+				"run scan_dev_for_scripts; "              \
+			"done;"                                           \
 		"done\0"                                                  \
 	\
 	BOOT_TARGET_DEVICES(BOOTENV_DEV)                                  \
-- 
2.1.0

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

* [U-Boot] [RFC PATCH 2/7] Allow overriding boot_partitions default value by setting BOOTENV_BOOT_PARTITIONS before including config_distro_bootcmd.
  2014-10-03 22:08 [U-Boot] [RFC PATCH 0/7] Switch am335x_evm.h based boards to use config_distro_bootcmd Vagrant Cascadian
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 1/7] Allow checking in multiple partitions for scan_dev_for_boot Vagrant Cascadian
@ 2014-10-03 22:08 ` Vagrant Cascadian
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 3/7] Add BOOTENV_INIT_COMMAND for commands that may be needed to run before bootcmd, such as setting the fdt file variables for platfroms that detect on boot Vagrant Cascadian
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Vagrant Cascadian @ 2014-10-03 22:08 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
---

 include/config_distro_bootcmd.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 5e5e5e3..a93354a 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -152,6 +152,10 @@
 #define BOOTENV_BOOT_TARGETS \
 	"boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0"
 
+#ifndef BOOTENV_BOOT_PARTITIONS
+#define BOOTENV_BOOT_PARTITIONS "1"
+#endif
+
 #define BOOTENV_DEV(devtypeu, devtypel, instance) \
 	BOOTENV_DEV_##devtypeu(devtypeu, devtypel, instance)
 #define BOOTENV \
@@ -163,7 +167,7 @@
 	"boot_prefixes=/ /boot/\0" \
 	"boot_scripts=boot.scr.uimg boot.scr\0" \
 	BOOTENV_BOOT_TARGETS \
-	"boot_partitions=1\0" \
+	"boot_partitions="BOOTENV_BOOT_PARTITIONS"\0" \
 	\
 	"boot_extlinux="                                                  \
 		"sysboot ${devtype} ${devnum}:${bootpart} any "           \
-- 
2.1.0

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

* [U-Boot] [RFC PATCH 3/7] Add BOOTENV_INIT_COMMAND for commands that may be needed to run before bootcmd, such as setting the fdt file variables for platfroms that detect on boot.
  2014-10-03 22:08 [U-Boot] [RFC PATCH 0/7] Switch am335x_evm.h based boards to use config_distro_bootcmd Vagrant Cascadian
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 1/7] Allow checking in multiple partitions for scan_dev_for_boot Vagrant Cascadian
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 2/7] Allow overriding boot_partitions default value by setting BOOTENV_BOOT_PARTITIONS before including config_distro_bootcmd Vagrant Cascadian
@ 2014-10-03 22:08 ` Vagrant Cascadian
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 4/7] Add BOOTENV_POST_COMMAND, which is appended to the end of bootcmd Vagrant Cascadian
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Vagrant Cascadian @ 2014-10-03 22:08 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
---

 include/config_distro_bootcmd.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index a93354a..515a2f9 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -156,6 +156,10 @@
 #define BOOTENV_BOOT_PARTITIONS "1"
 #endif
 
+#ifndef BOOTENV_INIT_COMMAND
+#define BOOTENV_INIT_COMMAND
+#endif
+
 #define BOOTENV_DEV(devtypeu, devtypel, instance) \
 	BOOTENV_DEV_##devtypeu(devtypeu, devtypel, instance)
 #define BOOTENV \
@@ -209,7 +213,8 @@
 	\
 	BOOT_TARGET_DEVICES(BOOTENV_DEV)                                  \
 	\
-	"bootcmd=" BOOTENV_SET_USB_NEED_INIT BOOTENV_SET_SCSI_NEED_INIT   \
+	"bootcmd=" BOOTENV_INIT_COMMAND                                   \
+		BOOTENV_SET_USB_NEED_INIT BOOTENV_SET_SCSI_NEED_INIT      \
 		"for target in ${boot_targets}; do "                      \
 			"run bootcmd_${target}; "                         \
 		"done\0"
-- 
2.1.0

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

* [U-Boot] [RFC PATCH 4/7] Add BOOTENV_POST_COMMAND, which is appended to the end of bootcmd.
  2014-10-03 22:08 [U-Boot] [RFC PATCH 0/7] Switch am335x_evm.h based boards to use config_distro_bootcmd Vagrant Cascadian
                   ` (2 preceding siblings ...)
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 3/7] Add BOOTENV_INIT_COMMAND for commands that may be needed to run before bootcmd, such as setting the fdt file variables for platfroms that detect on boot Vagrant Cascadian
@ 2014-10-03 22:08 ` Vagrant Cascadian
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 5/7] Only set CONFIG_BOOTDELAY if not already set Vagrant Cascadian
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Vagrant Cascadian @ 2014-10-03 22:08 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
---

 include/config_distro_bootcmd.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 515a2f9..2503431 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -160,6 +160,10 @@
 #define BOOTENV_INIT_COMMAND
 #endif
 
+#ifndef BOOTENV_POST_COMMAND
+#define BOOTENV_POST_COMMAND
+#endif
+
 #define BOOTENV_DEV(devtypeu, devtypel, instance) \
 	BOOTENV_DEV_##devtypeu(devtypeu, devtypel, instance)
 #define BOOTENV \
@@ -217,6 +221,8 @@
 		BOOTENV_SET_USB_NEED_INIT BOOTENV_SET_SCSI_NEED_INIT      \
 		"for target in ${boot_targets}; do "                      \
 			"run bootcmd_${target}; "                         \
-		"done\0"
+		"done;"                                                   \
+		BOOTENV_POST_COMMAND                                      \
+		"\0"
 
 #endif  /* _CONFIG_CMD_DISTRO_BOOTCMD_H */
-- 
2.1.0

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

* [U-Boot] [RFC PATCH 5/7] Only set CONFIG_BOOTDELAY if not already set.
  2014-10-03 22:08 [U-Boot] [RFC PATCH 0/7] Switch am335x_evm.h based boards to use config_distro_bootcmd Vagrant Cascadian
                   ` (3 preceding siblings ...)
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 4/7] Add BOOTENV_POST_COMMAND, which is appended to the end of bootcmd Vagrant Cascadian
@ 2014-10-03 22:08 ` Vagrant Cascadian
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 6/7] Add support for loading environment from uEnv.txt in config_distro_bootcmd Vagrant Cascadian
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 7/7] Switch am335x_evm.h to use config_distro_defaults and config_distro_bootcmd. Add scriptaddr to DEFAULT_LINUX_BOOT_ENV, as scriptaddr is used for boot scripts " Vagrant Cascadian
  6 siblings, 0 replies; 14+ messages in thread
From: Vagrant Cascadian @ 2014-10-03 22:08 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
---

 include/config_distro_defaults.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/config_distro_defaults.h b/include/config_distro_defaults.h
index 5d18a4b..fc67c42 100644
--- a/include/config_distro_defaults.h
+++ b/include/config_distro_defaults.h
@@ -45,7 +45,9 @@
 
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_AUTO_COMPLETE
+#ifndef CONFIG_BOOTDELAY
 #define CONFIG_BOOTDELAY     2
+#endif
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_MENU
 #define CONFIG_DOS_PARTITION
-- 
2.1.0

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

* [U-Boot] [RFC PATCH 6/7] Add support for loading environment from uEnv.txt in config_distro_bootcmd.
  2014-10-03 22:08 [U-Boot] [RFC PATCH 0/7] Switch am335x_evm.h based boards to use config_distro_bootcmd Vagrant Cascadian
                   ` (4 preceding siblings ...)
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 5/7] Only set CONFIG_BOOTDELAY if not already set Vagrant Cascadian
@ 2014-10-03 22:08 ` Vagrant Cascadian
  2014-10-07  3:55   ` Stephen Warren
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 7/7] Switch am335x_evm.h to use config_distro_defaults and config_distro_bootcmd. Add scriptaddr to DEFAULT_LINUX_BOOT_ENV, as scriptaddr is used for boot scripts " Vagrant Cascadian
  6 siblings, 1 reply; 14+ messages in thread
From: Vagrant Cascadian @ 2014-10-03 22:08 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
---

 include/config_distro_bootcmd.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 2503431..aaa010e 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -174,6 +174,7 @@
 	BOOTENV_SHARED_IDE \
 	"boot_prefixes=/ /boot/\0" \
 	"boot_scripts=boot.scr.uimg boot.scr\0" \
+	"boot_uenv_files=uEnv.txt\0" \
 	BOOTENV_BOOT_TARGETS \
 	"boot_partitions="BOOTENV_BOOT_PARTITIONS"\0" \
 	\
@@ -205,6 +206,25 @@
 			"fi; "                                            \
 		"done\0"                                                  \
 	\
+	"import_uenv_file="                                               \
+		"load ${devtype} ${devnum}:${bootpart} "                  \
+			"${scriptaddr} ${prefix}${uenv_file}; "           \
+		"env import -t -r ${scriptaddr} ${filesize}\0; "          \
+		"if test -n $uenvcmd; then "                              \
+			"echo Running uenvcmd ...;"                       \
+			"run uenvcmd;"                                    \
+		"fi;\0"                                                   \
+	\
+	"scan_dev_for_uenv_files="                                        \
+		"for uenv_file in ${boot_uenv_files}; do "                \
+			"if test -e ${devtype} ${devnum}:${bootpart} "    \
+					"${prefix}${uenv_file}; then "    \
+				"echo Found U-boot env file"              \
+					"${prefix}${uenv_file}; "         \
+				"run import_uenv_file; "                  \
+			"fi; "                                            \
+		"done\0"                                                  \
+	\
 	"scan_dev_for_boot="                                              \
 		"for partition in ${boot_partitions}; do "                \
 			"echo Scanning ${devtype} ${devnum}:${partition}...; " \
@@ -212,6 +232,7 @@
 			"for prefix in ${boot_prefixes}; do "             \
 				"run scan_dev_for_extlinux; "             \
 				"run scan_dev_for_scripts; "              \
+				"run scan_dev_for_uenv_files; "           \
 			"done;"                                           \
 		"done\0"                                                  \
 	\
-- 
2.1.0

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

* [U-Boot] [RFC PATCH 7/7] Switch am335x_evm.h to use config_distro_defaults and config_distro_bootcmd. Add scriptaddr to DEFAULT_LINUX_BOOT_ENV, as scriptaddr is used for boot scripts in config_distro_bootcmd.
  2014-10-03 22:08 [U-Boot] [RFC PATCH 0/7] Switch am335x_evm.h based boards to use config_distro_bootcmd Vagrant Cascadian
                   ` (5 preceding siblings ...)
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 6/7] Add support for loading environment from uEnv.txt in config_distro_bootcmd Vagrant Cascadian
@ 2014-10-03 22:08 ` Vagrant Cascadian
  2014-10-24 16:22   ` Dennis Gilmore
  6 siblings, 1 reply; 14+ messages in thread
From: Vagrant Cascadian @ 2014-10-03 22:08 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
---

 include/configs/am335x_evm.h      | 26 +++++++++++++++++---------
 include/configs/ti_armv7_common.h |  1 +
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index e2f7ead..b25d990 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -18,6 +18,21 @@
 
 #include <configs/ti_am335x_common.h>
 
+#include <config_distro_defaults.h>
+
+#define BOOTENV_BOOT_PARTITIONS "2"
+
+#define BOOTENV_INIT_COMMAND "run findfdt ;"
+#ifdef CONFIG_NAND
+#define BOOTENV_POST_COMMAND "run nandboot ;"
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(MMC, mmc, 1)
+
+#include <config_distro_bootcmd.h>
+
 #ifndef CONFIG_SPL_BUILD
 # define CONFIG_FIT
 # define CONFIG_TIMESTAMP
@@ -185,17 +200,10 @@
 		"if test $fdtfile = undefined; then " \
 			"echo WARNING: Could not determine device tree to use; fi; \0" \
 	NANDARGS \
-	DFUARGS
+	DFUARGS \
+	BOOTENV
 #endif
 
-#define CONFIG_BOOTCOMMAND \
-	"run findfdt; " \
-	"run mmcboot;" \
-	"setenv mmcdev 1; " \
-	"setenv bootpart 1:2; " \
-	"run mmcboot;" \
-	"run nandboot;"
-
 /* NS16550 Configuration */
 #define CONFIG_SYS_NS16550_COM1		0x44e09000	/* Base EVM has UART0 */
 #define CONFIG_SYS_NS16550_COM2		0x48022000	/* UART1 */
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
index 85171db..f405fea 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -54,6 +54,7 @@
 #define DEFAULT_LINUX_BOOT_ENV \
 	"loadaddr=0x82000000\0" \
 	"kernel_addr_r=0x82000000\0" \
+	"scriptaddr=0x82000000\0" \
 	"fdtaddr=0x88000000\0" \
 	"fdt_addr_r=0x88000000\0" \
 	"rdaddr=0x88080000\0" \
-- 
2.1.0

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

* [U-Boot] [RFC PATCH 1/7] Allow checking in multiple partitions for scan_dev_for_boot.
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 1/7] Allow checking in multiple partitions for scan_dev_for_boot Vagrant Cascadian
@ 2014-10-07  3:48   ` Stephen Warren
  2014-10-07  6:07     ` Vagrant Cascadian
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Warren @ 2014-10-07  3:48 UTC (permalink / raw)
  To: u-boot

On 10/03/2014 03:08 PM, Vagrant Cascadian wrote:

Some standalone description of this change, and justification for it,
should really be present in the commit message. Patch 0/7 doesn't get
applied anywhere.

> diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h

> -	"bootpart=1\0" \
> +	"boot_partitions=1\0" \

Instead of searching a hard-coded list of partitions, I think it'd be
better to have the script automatically determine which partition to
boot from based on the partition tables' bootable flag or partition
type. I had always intended these scripts to do that, but never got
around to doing it. I think the $dev:$part syntax already chooses the
first partition marked bootable if you don't specify a partition. Would
that work?

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

* [U-Boot] [RFC PATCH 6/7] Add support for loading environment from uEnv.txt in config_distro_bootcmd.
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 6/7] Add support for loading environment from uEnv.txt in config_distro_bootcmd Vagrant Cascadian
@ 2014-10-07  3:55   ` Stephen Warren
  2014-10-07  6:26     ` Vagrant Cascadian
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Warren @ 2014-10-07  3:55 UTC (permalink / raw)
  To: u-boot

On 10/03/2014 03:08 PM, Vagrant Cascadian wrote:


> diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h

>  			"for prefix in ${boot_prefixes}; do "             \
>  				"run scan_dev_for_extlinux; "             \
>  				"run scan_dev_for_scripts; "              \
> +				"run scan_dev_for_uenv_files; "           \
>  			"done;"                                           \

I've always thought of uEnv.txt being stored in a single hard-coded
location, and used to set e.g. $boot_targets to influence which
locations get searched for boot files. However, this patch appears to
use it to house actual boot command sequences.

In other words, I intended:

* (Optionally, and preferably via CONFIG_PREBOOT) load uEnv.txt from a
hard-coded location.
* Search a list of locations for boot files, of type extlinux.conf (or
for legacy reasons, boot .scr)

However, this patch now allows:

* Search a list of locations for boot files, of type extlinux.conf, or
for legacy reasons, boot .scr, or uEnv.txt

I don't think that's something we should encourage in
config_distro_bootcmd.h; the entire point of this header file is to
define a single way (extlinux.conf) for distros to define the available
boot options. Yes unfortunately we have boot.scr too as a legacy option,
but perhaps someday we can drop that. If we grow more options (allowing
boot scripts in uEnv.txt) that removes the standardization.

If we absolutely have to support uEnv.txt for legacy reasons on some
platforms, we should at least make it optional so that we don't add
support for it to all the other platforms that don't want to pick up
legacy stuff. Perhaps we should "run scan_dev_hook" and allow boards to
define arbitrary stuff there, so there's no mention at all of uEnv.txt
in config_distro_bootcmd.h.

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

* [U-Boot] [RFC PATCH 1/7] Allow checking in multiple partitions for scan_dev_for_boot.
  2014-10-07  3:48   ` Stephen Warren
@ 2014-10-07  6:07     ` Vagrant Cascadian
  0 siblings, 0 replies; 14+ messages in thread
From: Vagrant Cascadian @ 2014-10-07  6:07 UTC (permalink / raw)
  To: u-boot

Thanks for the review!

On 2014-10-06, Stephen Warren <swarren@nvidia.com> wrote:
> On 10/03/2014 03:08 PM, Vagrant Cascadian wrote:
>
> Some standalone description of this change, and justification for it,
> should really be present in the commit message. Patch 0/7 doesn't get
> applied anywhere.

Of course; that was a consequence of learning how patman/git-send-email
work... trial by fire... I'll use more verbose commit messages in the
future.


>> diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
>
>> -	"bootpart=1\0" \
>> +	"boot_partitions=1\0" \
>
> Instead of searching a hard-coded list of partitions, I think it'd be
> better to have the script automatically determine which partition to
> boot from based on the partition tables' bootable flag or partition
> type. I had always intended these scripts to do that, but never got
> around to doing it. I think the $dev:$part syntax already chooses the
> first partition marked bootable if you don't specify a partition. Would
> that work?

I suspect that might work. I merely went with the simplest approach to
extend what was already there, by supporting an arbitrary number of
partitions to search, and leaving the defaults as is.

The BeagleBone Black board ships with various boot files on the first
FAT partition, but newer images available for it moved boot files
(kernel/initrd/dtb/uEnv.txt) onto the second (ext4?) partition, as the
FAT partition is exported as a multifunction device over USB... So
ideally u-boot could support multiple partitions to search, to support
multiple generations of images without having to manually configure
u-boot.


live well,
  vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141006/e638dc33/attachment.pgp>

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

* [U-Boot] [RFC PATCH 6/7] Add support for loading environment from uEnv.txt in config_distro_bootcmd.
  2014-10-07  3:55   ` Stephen Warren
@ 2014-10-07  6:26     ` Vagrant Cascadian
  0 siblings, 0 replies; 14+ messages in thread
From: Vagrant Cascadian @ 2014-10-07  6:26 UTC (permalink / raw)
  To: u-boot

On 2014-10-06, Stephen Warren wrote:
> On 10/03/2014 03:08 PM, Vagrant Cascadian wrote:
>
>> diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
>
>>  			"for prefix in ${boot_prefixes}; do "             \
>>  				"run scan_dev_for_extlinux; "             \
>>  				"run scan_dev_for_scripts; "              \
>> +				"run scan_dev_for_uenv_files; "           \
>>  			"done;"                                           \
>
> I've always thought of uEnv.txt being stored in a single hard-coded
> location, and used to set e.g. $boot_targets to influence which
> locations get searched for boot files. However, this patch appears to
> use it to house actual boot command sequences.

I took the behavior of the am335x_evm.h based boards and tryed to
generalize it. If that's not desired, then allowing for some hook to
maintain backwards compatibility for those boards would be nice to make
it feasible for boards to migrate to config_distro_bootcmd without
breaking backwards compatibility.


> In other words, I intended:
>
> * (Optionally, and preferably via CONFIG_PREBOOT) load uEnv.txt from a
> hard-coded location.
> * Search a list of locations for boot files, of type extlinux.conf (or
> for legacy reasons, boot .scr)
>
> However, this patch now allows:
>
> * Search a list of locations for boot files, of type extlinux.conf, or
> for legacy reasons, boot .scr, or uEnv.txt

> I don't think that's something we should encourage in
> config_distro_bootcmd.h; the entire point of this header file is to
> define a single way (extlinux.conf) for distros to define the available
> boot options. Yes unfortunately we have boot.scr too as a legacy option,
> but perhaps someday we can drop that. If we grow more options (allowing
> boot scripts in uEnv.txt) that removes the standardization.

Sure.


> If we absolutely have to support uEnv.txt for legacy reasons on some
> platforms, we should at least make it optional so that we don't add
> support for it to all the other platforms that don't want to pick up
> legacy stuff. Perhaps we should "run scan_dev_hook" and allow boards to
> define arbitrary stuff there, so there's no mention at all of uEnv.txt
> in config_distro_bootcmd.h.

Sounds reasonable. It might be desireable to have multiple hook
locations, to be able to run before or after various points. Some of the
other patches in this series implement generic hooks to be run as part
of "bootcmd". Obviously, there's a balance to be struck not putting too
many hooks in.

Thanks for the review and comments!


live well,
  vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141006/30e9fac7/attachment.pgp>

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

* [U-Boot] [RFC PATCH 7/7] Switch am335x_evm.h to use config_distro_defaults and config_distro_bootcmd. Add scriptaddr to DEFAULT_LINUX_BOOT_ENV, as scriptaddr is used for boot scripts in config_distro_bootcmd.
  2014-10-03 22:08 ` [U-Boot] [RFC PATCH 7/7] Switch am335x_evm.h to use config_distro_defaults and config_distro_bootcmd. Add scriptaddr to DEFAULT_LINUX_BOOT_ENV, as scriptaddr is used for boot scripts " Vagrant Cascadian
@ 2014-10-24 16:22   ` Dennis Gilmore
  2014-10-27  5:33     ` Rob Herring
  0 siblings, 1 reply; 14+ messages in thread
From: Dennis Gilmore @ 2014-10-24 16:22 UTC (permalink / raw)
  To: u-boot

On Fri,  3 Oct 2014 15:08:43 -0700
Vagrant Cascadian <vagrant@debian.org> wrote:

> Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
> ---
> 
>  include/configs/am335x_evm.h      | 26 +++++++++++++++++---------
>  include/configs/ti_armv7_common.h |  1 +
>  2 files changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/include/configs/am335x_evm.h
> b/include/configs/am335x_evm.h index e2f7ead..b25d990 100644
> --- a/include/configs/am335x_evm.h
> +++ b/include/configs/am335x_evm.h
> @@ -18,6 +18,21 @@
>  
>  #include <configs/ti_am335x_common.h>
>  
> +#include <config_distro_defaults.h>
> +
> +#define BOOTENV_BOOT_PARTITIONS "2"

On Fedora we use partition 1 everywhere for /boot so this should be "1
2" though partition 2 is swap in out standard images. we really need to
read the partition table and find the bootable partition. 

We are defaulting to telling people to put u-boot and the MLO in raw
disk space.

> +
> +#define BOOTENV_INIT_COMMAND "run findfdt ;"
> +#ifdef CONFIG_NAND
> +#define BOOTENV_POST_COMMAND "run nandboot ;"
> +#endif
> +
> +#define BOOT_TARGET_DEVICES(func) \
> +	func(MMC, mmc, 0) \
> +	func(MMC, mmc, 1)
> +
> +#include <config_distro_bootcmd.h>
> +
>  #ifndef CONFIG_SPL_BUILD
>  # define CONFIG_FIT
>  # define CONFIG_TIMESTAMP
> @@ -185,17 +200,10 @@
>  		"if test $fdtfile = undefined; then " \
>  			"echo WARNING: Could not determine device
> tree to use; fi; \0" \ NANDARGS \
> -	DFUARGS
> +	DFUARGS \
> +	BOOTENV
>  #endif
>  
> -#define CONFIG_BOOTCOMMAND \
> -	"run findfdt; " \
> -	"run mmcboot;" \
> -	"setenv mmcdev 1; " \
> -	"setenv bootpart 1:2; " \
> -	"run mmcboot;" \
> -	"run nandboot;"
> -
>  /* NS16550 Configuration */
>  #define CONFIG_SYS_NS16550_COM1		0x44e09000	/*
> Base EVM has UART0 */ #define CONFIG_SYS_NS16550_COM2
> 0x48022000	/* UART1 */ diff --git
> a/include/configs/ti_armv7_common.h
> b/include/configs/ti_armv7_common.h index 85171db..f405fea 100644 ---
> a/include/configs/ti_armv7_common.h +++
> b/include/configs/ti_armv7_common.h @@ -54,6 +54,7 @@
>  #define DEFAULT_LINUX_BOOT_ENV \
>  	"loadaddr=0x82000000\0" \
>  	"kernel_addr_r=0x82000000\0" \
> +	"scriptaddr=0x82000000\0" \
>  	"fdtaddr=0x88000000\0" \
>  	"fdt_addr_r=0x88000000\0" \
>  	"rdaddr=0x88080000\0" \

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

* [U-Boot] [RFC PATCH 7/7] Switch am335x_evm.h to use config_distro_defaults and config_distro_bootcmd. Add scriptaddr to DEFAULT_LINUX_BOOT_ENV, as scriptaddr is used for boot scripts in config_distro_bootcmd.
  2014-10-24 16:22   ` Dennis Gilmore
@ 2014-10-27  5:33     ` Rob Herring
  0 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2014-10-27  5:33 UTC (permalink / raw)
  To: u-boot

On Sat, Oct 25, 2014 at 12:22 AM, Dennis Gilmore <dennis@ausil.us> wrote:
> On Fri,  3 Oct 2014 15:08:43 -0700
> Vagrant Cascadian <vagrant@debian.org> wrote:
>
>> Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
>> ---
>>
>>  include/configs/am335x_evm.h      | 26 +++++++++++++++++---------
>>  include/configs/ti_armv7_common.h |  1 +
>>  2 files changed, 18 insertions(+), 9 deletions(-)
>>
>> diff --git a/include/configs/am335x_evm.h
>> b/include/configs/am335x_evm.h index e2f7ead..b25d990 100644
>> --- a/include/configs/am335x_evm.h
>> +++ b/include/configs/am335x_evm.h
>> @@ -18,6 +18,21 @@
>>
>>  #include <configs/ti_am335x_common.h>
>>
>> +#include <config_distro_defaults.h>
>> +
>> +#define BOOTENV_BOOT_PARTITIONS "2"
>
> On Fedora we use partition 1 everywhere for /boot so this should be "1
> 2" though partition 2 is swap in out standard images. we really need to
> read the partition table and find the bootable partition.

u-boot already supports looking for the (1st) bootable partition.
Giving "<dev>:-" for commands will do that. I think that only works
for DOS partititons, so we need to do something different for GPT
partitions like looking for a certain UUID.

> We are defaulting to telling people to put u-boot and the MLO in raw
> disk space.

Really? I'd think we'd want this to be a raw partition at least to be
discoverable in some way. What the SOC ROM codes require is probably
all over the map, so we can really only define what we would like to
see.

Rob

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

end of thread, other threads:[~2014-10-27  5:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-03 22:08 [U-Boot] [RFC PATCH 0/7] Switch am335x_evm.h based boards to use config_distro_bootcmd Vagrant Cascadian
2014-10-03 22:08 ` [U-Boot] [RFC PATCH 1/7] Allow checking in multiple partitions for scan_dev_for_boot Vagrant Cascadian
2014-10-07  3:48   ` Stephen Warren
2014-10-07  6:07     ` Vagrant Cascadian
2014-10-03 22:08 ` [U-Boot] [RFC PATCH 2/7] Allow overriding boot_partitions default value by setting BOOTENV_BOOT_PARTITIONS before including config_distro_bootcmd Vagrant Cascadian
2014-10-03 22:08 ` [U-Boot] [RFC PATCH 3/7] Add BOOTENV_INIT_COMMAND for commands that may be needed to run before bootcmd, such as setting the fdt file variables for platfroms that detect on boot Vagrant Cascadian
2014-10-03 22:08 ` [U-Boot] [RFC PATCH 4/7] Add BOOTENV_POST_COMMAND, which is appended to the end of bootcmd Vagrant Cascadian
2014-10-03 22:08 ` [U-Boot] [RFC PATCH 5/7] Only set CONFIG_BOOTDELAY if not already set Vagrant Cascadian
2014-10-03 22:08 ` [U-Boot] [RFC PATCH 6/7] Add support for loading environment from uEnv.txt in config_distro_bootcmd Vagrant Cascadian
2014-10-07  3:55   ` Stephen Warren
2014-10-07  6:26     ` Vagrant Cascadian
2014-10-03 22:08 ` [U-Boot] [RFC PATCH 7/7] Switch am335x_evm.h to use config_distro_defaults and config_distro_bootcmd. Add scriptaddr to DEFAULT_LINUX_BOOT_ENV, as scriptaddr is used for boot scripts " Vagrant Cascadian
2014-10-24 16:22   ` Dennis Gilmore
2014-10-27  5:33     ` Rob Herring

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