All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V3 1/3] ARM: tegra: convert tegra to use distro defaults
@ 2014-02-04 22:59 Stephen Warren
  2014-02-04 22:59 ` [U-Boot] [PATCH V3 2/3] ARM: tegra: rework boot scripts Stephen Warren
  2014-02-04 22:59 ` [U-Boot] [PATCH V3 3/3] ARM: tegra: implement bootcmd_pxe Stephen Warren
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Warren @ 2014-02-04 22:59 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

Modify all Tegra boards to include the "distro defaults" header, so that
all the config options distros expect are enabled. Remove any #defines
that enable the same options from the Tegra files.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
v3: No change.
v2: No change.

Note: These patches depend on:
a) The very latest u-boot/master, in particular "config: add config_distro_defaults.h",
   which may not have replicated out to the git server yet.
b) The very latest u-boot-tegra/next.

I suggest rebasing u-boot-tegra/next on top of u-boot/master once the
required commit has shown up there.
---
 include/configs/tegra-common.h | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
index 522cd4133d77..bbe417a13ec7 100644
--- a/include/configs/tegra-common.h
+++ b/include/configs/tegra-common.h
@@ -29,7 +29,6 @@
 #define CONFIG_DISPLAY_BOARDINFO
 
 #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
-#define CONFIG_OF_LIBFDT		/* enable passing of devicetree */
 
 /* Environment */
 #define CONFIG_ENV_VARS_UBOOT_CONFIG
@@ -69,33 +68,20 @@
 #undef CONFIG_CMD_NET		/* network support */
 
 /* turn on command-line edit/hist/auto */
-#define CONFIG_CMDLINE_EDITING
 #define CONFIG_COMMAND_HISTORY
-#define CONFIG_AUTO_COMPLETE
 
 /* turn on commonly used storage-related commands */
-
-#define CONFIG_DOS_PARTITION
-#define CONFIG_EFI_PARTITION
 #define CONFIG_PARTITION_UUIDS
-#define CONFIG_FS_EXT4
-#define CONFIG_FS_FAT
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_FS_GENERIC
 #define CONFIG_CMD_PART
 
 #define CONFIG_SYS_NO_FLASH
 
 #define CONFIG_CONSOLE_MUX
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
-#define CONFIG_BOOTDELAY	2		/* -1 to disable auto boot */
 
 /*
  * Miscellaneous configurable options
  */
-#define CONFIG_SYS_LONGHELP		/* undef to save memory */
-#define CONFIG_SYS_HUSH_PARSER		/* use "hush" command parser */
 #define CONFIG_SYS_PROMPT		V_PROMPT
 /*
  * Increasing the size of the IO buffer as default nfsargs size is more
@@ -133,8 +119,6 @@
 #define CONFIG_TEGRA_GPIO
 #define CONFIG_CMD_GPIO
 #define CONFIG_CMD_ENTERRCM
-#define CONFIG_CMD_BOOTZ
-#define CONFIG_SUPPORT_RAW_INITRD
 
 /* Defines for SPL */
 #define CONFIG_SPL
@@ -157,4 +141,8 @@
 #define CONFIG_BOUNCE_BUFFER
 #define CONFIG_CRC32_VERIFY
 
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+#endif
+
 #endif /* _TEGRA_COMMON_H_ */
-- 
1.8.1.5

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

* [U-Boot] [PATCH V3 2/3] ARM: tegra: rework boot scripts
  2014-02-04 22:59 [U-Boot] [PATCH V3 1/3] ARM: tegra: convert tegra to use distro defaults Stephen Warren
@ 2014-02-04 22:59 ` Stephen Warren
  2014-02-05  9:16   ` Andreas Färber
  2014-02-04 22:59 ` [U-Boot] [PATCH V3 3/3] ARM: tegra: implement bootcmd_pxe Stephen Warren
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2014-02-04 22:59 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

Update the common Tegra boot scripts in the default environment to

a) Make use of the new "exists" shell command to avoid some error
   messges.

b) Allow booting using the sysboot command and extlinux.conf. This
   allows easy creation of boot menus, and provides a simple interface
   for distros to parameterize/configure the boot process.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
v3: s/exists/test -e/ in shell commands.
v2: No change.
---
 include/configs/tegra-common-post.h | 39 ++++++++++++++++++++++++++++---------
 1 file changed, 30 insertions(+), 9 deletions(-)

diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
index e1a3bbc62636..5acbdc3a1890 100644
--- a/include/configs/tegra-common-post.h
+++ b/include/configs/tegra-common-post.h
@@ -69,20 +69,41 @@
 #define BOOTCMDS_COMMON \
 	"rootpart=1\0" \
 	\
+	"do_script_boot="                                                 \
+		"load ${devtype} ${devnum}:${rootpart} "                  \
+			"${scriptaddr} ${prefix}${script}; "              \
+		"source ${scriptaddr}\0"                                  \
+	\
 	"script_boot="                                                    \
-		"if load ${devtype} ${devnum}:${rootpart} "               \
-				"${scriptaddr} ${prefix}${script}; then " \
-			"echo ${script} found! Executing ...;"            \
-			"source ${scriptaddr};"                           \
-		"fi;\0"                                                   \
+		"for script in ${boot_scripts}; do "                      \
+			"if test -e ${devtype} ${devnum}:${rootpart} "    \
+					"${prefix}${script}; then "       \
+				"echo Found U-Boot script "               \
+					"${prefix}${script}; "            \
+				"run do_script_boot;"                     \
+				"echo SCRIPT FAILED; continuing...; "     \
+			"fi; "                                            \
+		"done\0"                                                  \
+	\
+	"do_sysboot_boot="                                                \
+		"sysboot ${devtype} ${devnum}:${rootpart} any "           \
+			"${scriptaddr} ${prefix}extlinux.conf\0"          \
+	\
+	"sysboot_boot="                                                   \
+		"if test -e ${devtype} ${devnum}:${rootpart} "            \
+				"${prefix}extlinux.conf; then "           \
+			"echo Found extlinux config "                     \
+				"${prefix}extlinux.conf; "                \
+			"run do_sysboot_boot;"                            \
+			"echo SCRIPT FAILED; continuing...; "             \
+		"fi\0"                                                    \
 	\
 	"scan_boot="                                                      \
 		"echo Scanning ${devtype} ${devnum}...; "                 \
 		"for prefix in ${boot_prefixes}; do "                     \
-			"for script in ${boot_scripts}; do "              \
-				"run script_boot; "                       \
-			"done; "                                          \
-		"done;\0"                                                 \
+			"run script_boot; "                               \
+			"run sysboot_boot; "                              \
+		"done\0"                                                  \
 	\
 	"boot_targets=" \
 		BOOT_TARGETS_MMC " " \
-- 
1.8.1.5

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

* [U-Boot] [PATCH V3 3/3] ARM: tegra: implement bootcmd_pxe
  2014-02-04 22:59 [U-Boot] [PATCH V3 1/3] ARM: tegra: convert tegra to use distro defaults Stephen Warren
  2014-02-04 22:59 ` [U-Boot] [PATCH V3 2/3] ARM: tegra: rework boot scripts Stephen Warren
@ 2014-02-04 22:59 ` Stephen Warren
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2014-02-04 22:59 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

This retrieves a PXE config file over the network, and executes it. This
allows an extlinux config file  to be retrieved over the network and
executed, whereas the existing bootcmd_dhcp retrieves a U-Boot script.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
v3: No change.
v2: No change.
---
 include/configs/tegra-common-post.h | 18 +++++++++++++++++-
 include/configs/tegra114-common.h   |  4 ++++
 include/configs/tegra20-common.h    |  4 ++++
 include/configs/tegra30-common.h    |  4 ++++
 4 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
index 5acbdc3a1890..c998675efdeb 100644
--- a/include/configs/tegra-common-post.h
+++ b/include/configs/tegra-common-post.h
@@ -66,6 +66,20 @@
 #define BOOT_TARGETS_DHCP ""
 #endif
 
+#if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE)
+#define BOOTCMDS_PXE \
+	"bootcmd_pxe=" \
+		BOOTCMD_INIT_USB \
+		"dhcp; " \
+		"if pxe get; then " \
+			"pxe boot; " \
+		"fi\0"
+#define BOOT_TARGETS_PXE "pxe"
+#else
+#define BOOTCMDS_PXE ""
+#define BOOT_TARGETS_PXE ""
+#endif
+
 #define BOOTCMDS_COMMON \
 	"rootpart=1\0" \
 	\
@@ -108,6 +122,7 @@
 	"boot_targets=" \
 		BOOT_TARGETS_MMC " " \
 		BOOT_TARGETS_USB " " \
+		BOOT_TARGETS_PXE " " \
 		BOOT_TARGETS_DHCP " " \
 		"\0" \
 	\
@@ -117,7 +132,8 @@
 	\
 	BOOTCMDS_MMC \
 	BOOTCMDS_USB \
-	BOOTCMDS_DHCP
+	BOOTCMDS_DHCP \
+	BOOTCMDS_PXE
 
 #define CONFIG_BOOTCOMMAND \
 	"set usb_need_init; " \
diff --git a/include/configs/tegra114-common.h b/include/configs/tegra114-common.h
index 1bf5af5b3830..bff5447fe421 100644
--- a/include/configs/tegra114-common.h
+++ b/include/configs/tegra114-common.h
@@ -46,6 +46,9 @@
  * scriptaddr can be pretty much anywhere that doesn't conflict with something
  *   else. Put it above BOOTMAPSZ to eliminate conflicts.
  *
+ * pxefile_addr_r can be pretty much anywhere that doesn't conflict with
+ *   something else. Put it above BOOTMAPSZ to eliminate conflicts.
+ *
  * kernel_addr_r must be within the first 128M of RAM in order for the
  *   kernel's CONFIG_AUTO_ZRELADDR option to work. Since the kernel will
  *   decompress itself to 0x8000 after the start of RAM, kernel_addr_r
@@ -63,6 +66,7 @@
  */
 #define MEM_LAYOUT_ENV_SETTINGS \
 	"scriptaddr=0x90000000\0" \
+	"pxefile_addr_r=0x90100000\0" \
 	"kernel_addr_r=0x81000000\0" \
 	"fdt_addr_r=0x82000000\0" \
 	"ramdisk_addr_r=0x82100000\0"
diff --git a/include/configs/tegra20-common.h b/include/configs/tegra20-common.h
index d2c45321b46a..933130a405da 100644
--- a/include/configs/tegra20-common.h
+++ b/include/configs/tegra20-common.h
@@ -44,6 +44,9 @@
  * scriptaddr can be pretty much anywhere that doesn't conflict with something
  *   else. Put it above BOOTMAPSZ to eliminate conflicts.
  *
+ * pxefile_addr_r can be pretty much anywhere that doesn't conflict with
+ *   something else. Put it above BOOTMAPSZ to eliminate conflicts.
+ *
  * kernel_addr_r must be within the first 128M of RAM in order for the
  *   kernel's CONFIG_AUTO_ZRELADDR option to work. Since the kernel will
  *   decompress itself to 0x8000 after the start of RAM, kernel_addr_r
@@ -61,6 +64,7 @@
  */
 #define MEM_LAYOUT_ENV_SETTINGS \
 	"scriptaddr=0x10000000\0" \
+	"pxefile_addr_r=0x10100000\0" \
 	"kernel_addr_r=0x01000000\0" \
 	"fdt_addr_r=0x02000000\0" \
 	"ramdisk_addr_r=0x02100000\0"
diff --git a/include/configs/tegra30-common.h b/include/configs/tegra30-common.h
index edb930e032bc..4b6f8d128e63 100644
--- a/include/configs/tegra30-common.h
+++ b/include/configs/tegra30-common.h
@@ -43,6 +43,9 @@
  * scriptaddr can be pretty much anywhere that doesn't conflict with something
  *   else. Put it above BOOTMAPSZ to eliminate conflicts.
  *
+ * pxefile_addr_r can be pretty much anywhere that doesn't conflict with
+ *   something else. Put it above BOOTMAPSZ to eliminate conflicts.
+ *
  * kernel_addr_r must be within the first 128M of RAM in order for the
  *   kernel's CONFIG_AUTO_ZRELADDR option to work. Since the kernel will
  *   decompress itself to 0x8000 after the start of RAM, kernel_addr_r
@@ -60,6 +63,7 @@
  */
 #define MEM_LAYOUT_ENV_SETTINGS \
 	"scriptaddr=0x90000000\0" \
+	"pxefile_addr_r=0x90100000\0" \
 	"kernel_addr_r=0x81000000\0" \
 	"fdt_addr_r=0x82000000\0" \
 	"ramdisk_addr_r=0x82100000\0"
-- 
1.8.1.5

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

* [U-Boot] [PATCH V3 2/3] ARM: tegra: rework boot scripts
  2014-02-04 22:59 ` [U-Boot] [PATCH V3 2/3] ARM: tegra: rework boot scripts Stephen Warren
@ 2014-02-05  9:16   ` Andreas Färber
  2014-02-05 16:13     ` Stephen Warren
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Färber @ 2014-02-05  9:16 UTC (permalink / raw)
  To: u-boot

Am 04.02.2014 23:59, schrieb Stephen Warren:
> From: Stephen Warren <swarren@nvidia.com>
> 
> Update the common Tegra boot scripts in the default environment to
> 
> a) Make use of the new "exists" shell command to avoid some error
>    messges.

"messages"; and "exists" became "test -e"

> 
> b) Allow booting using the sysboot command and extlinux.conf. This
>    allows easy creation of boot menus, and provides a simple interface
>    for distros to parameterize/configure the boot process.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> v3: s/exists/test -e/ in shell commands.
> v2: No change.
> ---
>  include/configs/tegra-common-post.h | 39 ++++++++++++++++++++++++++++---------
>  1 file changed, 30 insertions(+), 9 deletions(-)
> 
> diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
> index e1a3bbc62636..5acbdc3a1890 100644
> --- a/include/configs/tegra-common-post.h
> +++ b/include/configs/tegra-common-post.h
> @@ -69,20 +69,41 @@
>  #define BOOTCMDS_COMMON \
>  	"rootpart=1\0" \
>  	\
> +	"do_script_boot="                                                 \
> +		"load ${devtype} ${devnum}:${rootpart} "                  \
> +			"${scriptaddr} ${prefix}${script}; "              \
> +		"source ${scriptaddr}\0"                                  \
> +	\
>  	"script_boot="                                                    \
> -		"if load ${devtype} ${devnum}:${rootpart} "               \
> -				"${scriptaddr} ${prefix}${script}; then " \
> -			"echo ${script} found! Executing ...;"            \
> -			"source ${scriptaddr};"                           \
> -		"fi;\0"                                                   \
> +		"for script in ${boot_scripts}; do "                      \
> +			"if test -e ${devtype} ${devnum}:${rootpart} "    \
> +					"${prefix}${script}; then "       \
> +				"echo Found U-Boot script "               \
> +					"${prefix}${script}; "            \
> +				"run do_script_boot;"                     \
> +				"echo SCRIPT FAILED; continuing...; "     \

This is not going to work, "continuing..." would be treated as command.

> +			"fi; "                                            \
> +		"done\0"                                                  \
> +	\
> +	"do_sysboot_boot="                                                \
> +		"sysboot ${devtype} ${devnum}:${rootpart} any "           \
> +			"${scriptaddr} ${prefix}extlinux.conf\0"          \
> +	\
> +	"sysboot_boot="                                                   \
> +		"if test -e ${devtype} ${devnum}:${rootpart} "            \
> +				"${prefix}extlinux.conf; then "           \
> +			"echo Found extlinux config "                     \
> +				"${prefix}extlinux.conf; "                \
> +			"run do_sysboot_boot;"                            \
> +			"echo SCRIPT FAILED; continuing...; "             \

Dito. Also note that there's no space before either echo.

Cheers,
Andreas

> +		"fi\0"                                                    \
>  	\
>  	"scan_boot="                                                      \
>  		"echo Scanning ${devtype} ${devnum}...; "                 \
>  		"for prefix in ${boot_prefixes}; do "                     \
> -			"for script in ${boot_scripts}; do "              \
> -				"run script_boot; "                       \
> -			"done; "                                          \
> -		"done;\0"                                                 \
> +			"run script_boot; "                               \
> +			"run sysboot_boot; "                              \
> +		"done\0"                                                  \
>  	\
>  	"boot_targets=" \
>  		BOOT_TARGETS_MMC " " \

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imend?rffer; HRB 16746 AG N?rnberg

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

* [U-Boot] [PATCH V3 2/3] ARM: tegra: rework boot scripts
  2014-02-05  9:16   ` Andreas Färber
@ 2014-02-05 16:13     ` Stephen Warren
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2014-02-05 16:13 UTC (permalink / raw)
  To: u-boot

On 02/05/2014 02:16 AM, Andreas F?rber wrote:
> Am 04.02.2014 23:59, schrieb Stephen Warren:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> Update the common Tegra boot scripts in the default environment to
>>
>> a) Make use of the new "exists" shell command to avoid some error
>>    messges.
>>
>> b) Allow booting using the sysboot command and extlinux.conf. This
>>    allows easy creation of boot menus, and provides a simple interface
>>    for distros to parameterize/configure the boot process.

>> diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h

>>  	"script_boot="                                                    \
>> -		"if load ${devtype} ${devnum}:${rootpart} "               \
>> -				"${scriptaddr} ${prefix}${script}; then " \
>> -			"echo ${script} found! Executing ...;"            \
>> -			"source ${scriptaddr};"                           \
>> -		"fi;\0"                                                   \
>> +		"for script in ${boot_scripts}; do "                      \
>> +			"if test -e ${devtype} ${devnum}:${rootpart} "    \
>> +					"${prefix}${script}; then "       \
>> +				"echo Found U-Boot script "               \
>> +					"${prefix}${script}; "            \
>> +				"run do_script_boot;"                     \
>> +				"echo SCRIPT FAILED; continuing...; "     \
> 
> This is not going to work, "continuing..." would be treated as command.

But I tested it:-)

It seems that U-Boot just ignores the unknown command (well, it prints
an error that I didn't notice) and continues on. So, it kinda works but
certainly doesn't do what's intended;-)

Thanks for pointing out the issues. I'll also have to revise the
Raspberry Pi patches that have the same issue.

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

end of thread, other threads:[~2014-02-05 16:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-04 22:59 [U-Boot] [PATCH V3 1/3] ARM: tegra: convert tegra to use distro defaults Stephen Warren
2014-02-04 22:59 ` [U-Boot] [PATCH V3 2/3] ARM: tegra: rework boot scripts Stephen Warren
2014-02-05  9:16   ` Andreas Färber
2014-02-05 16:13     ` Stephen Warren
2014-02-04 22:59 ` [U-Boot] [PATCH V3 3/3] ARM: tegra: implement bootcmd_pxe Stephen Warren

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.