Skip to contentSkip to conversation

ARM: tegra: convert tegra to use distro defaults

PATCH New Stephen Warren 2 participants 8 messages Feb 5, 2014 – Feb 27, 2014 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/3 ARM: tegra: convert tegra to use distro defaults

From: Stephen Warren <[email protected]>

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.

---
v4: No change.
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".
b) The very latest u-boot-tegra/next.

I suggest rebasing u-boot-tegra/next on top of u-boot/master before applying this series.

---
 include/configs/tegra-common.h | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
include/configs/tegra-common.h +4 -16
index 522cd4133d77..bbe417a13ec7 100644
@@ -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_ */
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH v4 1/3 ARM: tegra: convert tegra to use distro defaults

Quoted 5 lines · Stephen Warren

From: Stephen Warren <[email protected]>

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.

Tom, does this series look good? I'd really like to get it into 2014.04 so that Tegra can demonstrate the use of extlinux.conf boot scripts. Note that I posted an updated patch 2/3 V5. Thanks.

#2 lore raw

PATCH v4 2/3 ARM: tegra: rework boot scripts

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Update the common Tegra boot scripts in the default environment to

a) Make use of the new "test -e" shell command to avoid some error messages.

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.

---
v4:
* Prioritize extlinux.conf over boot.scr.uimg when searching; it makes sense to use the cross-distro/-bootloader (hopeful) standard first.
* Replace ; in the middle of echo'd text in boot scripts.
* Add missing space between commands in boot scripts.
* s/exists/test -e/ in commmit description.
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(-)
include/configs/tegra-common-post.h +30 -9
index e1a3bbc62636..3bf55ce428f2 100644
@@ -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 sysboot_boot; "                              \
+			"run script_boot; "                               \
+		"done\0"                                                  \
 	\
 	"boot_targets=" \
 		BOOT_TARGETS_MMC " " \
Signature · 1 line
1.8.1.5
#3 lore raw

PATCH v4 2/3 ARM: tegra: rework boot scripts

Hi Stephen,

I noticed one issue

Quoted 79 lines · On Wed, 5 Feb 2014 09:24:58 -0700 Stephen Warren <[email protected]> wrote:

From: Stephen Warren <[email protected]>

Update the common Tegra boot scripts in the default environment to

a) Make use of the new "test -e" shell command to avoid some error messages.

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.

---
v4:
* Prioritize extlinux.conf over boot.scr.uimg when searching; it makes sense to use the cross-distro/-bootloader (hopeful) standard first.
* Replace ; in the middle of echo'd text in boot scripts.
* Add missing space between commands in boot scripts.
* s/exists/test -e/ in commmit description.
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(-)

(quoted diff) +0 -0

b/include/configs/tegra-common-post.h index e1a3bbc62636..3bf55ce428f2 100644 --- a/include/configs/tegra-common-post.h +++ b/include/configs/tegra-common-post.h @@ -69,20 +69,41 @@
#define BOOTCMDS_COMMON \

include/configs/tegra-common-post.h +1 -0
 	"rootpart=1\0" \
 	\
+	"do_script_boot="

\

(quoted diff) +1 -0
+		"load ${devtype} ${devnum}:${rootpart}

" \

(quoted diff) +1 -0
+			"${scriptaddr} ${prefix}${script};

" \

(quoted diff) +1 -0
+		"source

${scriptaddr}\0" \

(quoted diff) +1 -0
+	\
 	"script_boot="

\

(quoted diff) +0 -1
-		"if load ${devtype} ${devnum}:${rootpart}

" \

(quoted diff) +0 -1
-				"${scriptaddr} ${prefix}${script};

then " \

(quoted diff) +0 -1
-			"echo ${script} found!

Executing ...;" \

(quoted diff) +0 -1
-			"source

${scriptaddr};" \

(quoted diff) +0 -1
-		"fi;\0"

\

(quoted diff) +1 -0
+		"for script in ${boot_scripts}; do

" \

(quoted diff) +1 -0
+			"if test -e ${devtype} ${devnum}:${rootpart}

" \

(quoted diff) +1 -0
+					"${prefix}${script}; then

" \

(quoted diff) +1 -0
+				"echo Found U-Boot script

" \

(quoted diff) +1 -0
+					"${prefix}${script};

" \

(quoted diff) +1 -0
+				"run do_script_boot;

" \

(quoted diff) +1 -0
+				"echo SCRIPT FAILED: continuing...;

" \

(quoted diff) +1 -0
+			"fi;

" \

(quoted diff) +1 -0
+		"done\0"

\

(quoted diff) +2 -0
+	\
+	"do_sysboot_boot="

\

(quoted diff) +1 -0
+		"sysboot ${devtype} ${devnum}:${rootpart} any

" \

(quoted diff) +1 -0
+			"${scriptaddr}
Quoted 1 line

${prefix}extlinux.conf\0" \

extlinux config files are placed into an extlinux directory you will need to use ${prefix}extlinux/extlinux.conf

Quoted 35 lines
(quoted diff) +2 -0
+	\
+	"sysboot_boot="

\

(quoted diff) +1 -0
+		"if test -e ${devtype} ${devnum}:${rootpart}

" \

(quoted diff) +1 -0
+				"${prefix}extlinux.conf; then

" \

(quoted diff) +1 -0
+			"echo Found extlinux config

" \

(quoted diff) +1 -0
+				"${prefix}extlinux.conf;

" \

(quoted diff) +1 -0
+			"run do_sysboot_boot;

" \

(quoted diff) +1 -0
+			"echo SCRIPT FAILED: continuing...;

" \

(quoted diff) +1 -0
+		"fi\0"

\ \
"scan_boot="
\ "echo Scanning ${devtype} ${devnum}...; " \
"for prefix in ${boot_prefixes}; do
" \

(quoted diff) +0 -1
-			"for script in ${boot_scripts}; do

" \

(quoted diff) +0 -1
-				"run script_boot;

" \

(quoted diff) +0 -1
-			"done;

" \

(quoted diff) +0 -1
-		"done;\0"

\

(quoted diff) +1 -0
+			"run sysboot_boot;

" \

(quoted diff) +1 -0
+			"run script_boot;

" \

(quoted diff) +1 -0
+		"done\0"

\ \

include/configs/tegra-common-post.h line 109

Quoted 2 lines
include/configs/tegra-common-post.h +0 -0
 	"boot_targets=" \
 		BOOT_TARGETS_MMC " " \

Dennis

#4 lore raw

PATCH v4 2/3 ARM: tegra: rework boot scripts

Quoted 20 lines · Dennis Gilmore

Hi Stephen,

I noticed one issue

Quoted 12 lines · On Wed, 5 Feb 2014 09:24:58 -0700 Stephen Warren <[email protected]> wrote:

From: Stephen Warren <[email protected]>

Update the common Tegra boot scripts in the default environment to

a) Make use of the new "test -e" shell command to avoid some error messages.

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.

include/configs/tegra-common-post.h index renamed from include/configs/tegra-common-post.h +0 -0
Quoted 9 lines
Quoted 6 lines
include/configs/tegra-common-post.h index renamed from include/configs/tegra-common-post.h +1 -0
+	"do_sysboot_boot="

\

include/configs/tegra-common-post.h index renamed from include/configs/tegra-common-post.h +1 -0
+		"sysboot ${devtype} ${devnum}:${rootpart} any

" \

include/configs/tegra-common-post.h index renamed from include/configs/tegra-common-post.h +1 -0
+			"${scriptaddr}

${prefix}extlinux.conf\0" \

extlinux config files are placed into an extlinux directory you will need to use ${prefix}extlinux/extlinux.conf

What places them there? The spec doesn't say anything about placement of this file. Since this is a new feature, I don't think there's any de-facto standard, is there? I'd prefer that the files be placed in the same location as any other boot file, to avoid pointless extra directory levels (i.e. / for a partition that's mounted as /boot, or in /boot for a partition that's mounted as /).

#5 lore raw

PATCH v4 2/3 ARM: tegra: rework boot scripts

Quoted 32 lines · On Thu, 13 Feb 2014 09:39:41 -0700 Stephen Warren <[email protected]> wrote:
Quoted 21 lines · Dennis Gilmore

Hi Stephen,

I noticed one issue

Quoted 13 lines · On Wed, 5 Feb 2014 09:24:58 -0700 Stephen Warren <[email protected]> wrote:

From: Stephen Warren <[email protected]>

Update the common Tegra boot scripts in the default environment to

a) Make use of the new "test -e" shell command to avoid some error messages.

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.

(quoted diff) +0 -0

b/include/configs/tegra-common-post.h index

Quoted 9 lines
Quoted 6 lines
(quoted diff) +1 -0
+	"do_sysboot_boot="

\

(quoted diff) +1 -0
+		"sysboot ${devtype} ${devnum}:${rootpart} any

" \

(quoted diff) +1 -0
+			"${scriptaddr}

${prefix}extlinux.conf\0" \

extlinux config files are placed into an extlinux directory you will need to use ${prefix}extlinux/extlinux.conf

Quoted 6 lines

What places them there? The spec doesn't say anything about placement of this file. Since this is a new feature, I don't think there's any de-facto standard, is there? I'd prefer that the files be placed in the same location as any other boot file, to avoid pointless extra directory levels (i.e. / for a partition that's mounted as /boot, or in /boot for a partition that's mounted as /).

http://www.syslinux.org/wiki/index.php/EXTLINUX

anaconda and the image creation tools both use /boot/extlinux according to http://shallowsky.com/linux/extlinux.html debian also uses it

extlinux is not bootloaderspec. bootloaderspec does say where to put
them:

Inside the $BOOT/loader/entries/ directory each OS vendor may drop one or more configuration snippets with the suffix ".conf", one for each boot menu item. The file name of the file is used for identification of the boot item, but shall never be presented to the user in the UI. The file name may be chosen freely but should be unique enough to avoid clashes between OS installations. More specifically it is suggested to include the machine ID (/etc/machine-id or the D-Bus machine ID for OSes that lack /etc/machine-id), the kernel version (as returned by uname -r) and an OS identifier (The ID field of /etc/os-release). Example:
$BOOT/loader/entries/6a9857a393724b7a981ebb5b8495b9ea-3.8.0-2.fc19.x86_64.conf

to implement bootloader spec fully u-boot will need to find all the .conf snippets in the loader/entries/ directory and load them up and show the menu.

It just happens that bootloaderspec uses the same format used by extlinux for its snippets

Dennis

#6 lore raw

PATCH v4 2/3 ARM: tegra: rework boot scripts

Quoted 43 lines · Dennis Gilmore
Quoted 32 lines · On Thu, 13 Feb 2014 09:39:41 -0700 Stephen Warren <[email protected]> wrote:
Quoted 21 lines · Dennis Gilmore

Hi Stephen,

I noticed one issue

Quoted 13 lines · On Wed, 5 Feb 2014 09:24:58 -0700 Stephen Warren <[email protected]> wrote:

From: Stephen Warren <[email protected]>

Update the common Tegra boot scripts in the default environment to

a) Make use of the new "test -e" shell command to avoid some error messages.

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.

(quoted diff) +0 -0

b/include/configs/tegra-common-post.h index

Quoted 9 lines
Quoted 6 lines
(quoted diff) +1 -0
+	"do_sysboot_boot="

\

(quoted diff) +1 -0
+		"sysboot ${devtype} ${devnum}:${rootpart} any

" \

(quoted diff) +1 -0
+			"${scriptaddr}

${prefix}extlinux.conf\0" \

extlinux config files are placed into an extlinux directory you will need to use ${prefix}extlinux/extlinux.conf

Quoted 6 lines

What places them there? The spec doesn't say anything about placement of this file. Since this is a new feature, I don't think there's any de-facto standard, is there? I'd prefer that the files be placed in the same location as any other boot file, to avoid pointless extra directory levels (i.e. / for a partition that's mounted as /boot, or in /boot for a partition that's mounted as /).

Quoted 5 lines

http://www.syslinux.org/wiki/index.php/EXTLINUX

anaconda and the image creation tools both use /boot/extlinux according to http://shallowsky.com/linux/extlinux.html debian also uses it

OK. I wasn't aware that people were using these config files for anything yet; I thought it was something new being rolled out to get bootloader-agnostic boot config on ARM, and assumed that non-ARM was still using e.g. grub etc.

Neither of those links specify that the extlinux.conf file has to be named (/boot)/extlinux/extlinux.conf. The first link simply specifies that it's possible to put the file in such a sub-directory, and the second that Debian just happens to do so.

Still, in the interests of conforming to the de-facto standard, I'll repost the Tegra and bcm2835 boot script patches to adjust to that.

Quoted 5 lines

extlinux is not bootloaderspec. bootloaderspec does say where to put
them:

Inside the $BOOT/loader/entries/ directory each OS vendor may drop one
...

Ah right. I'd meant to say that bootloaderspec doesn't say anything about an "extlinux/" directory, not to say that it didn't say anything about where to put the files.

#7 lore raw

PATCH v4 3/3 ARM: tegra: implement bootcmd_pxe

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

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.

---
v4: No change.
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(-)
include/configs/tegra-common-post.h +17 -1
index 3bf55ce428f2..76dad4e88cd9 100644
@@ -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; " \
include/configs/tegra114-common.h +4 -0
index 1bf5af5b3830..bff5447fe421 100644
@@ -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"
include/configs/tegra20-common.h +4 -0
index d2c45321b46a..933130a405da 100644
@@ -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"
include/configs/tegra30-common.h +4 -0
index edb930e032bc..4b6f8d128e63 100644
@@ -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"
Signature · 1 line
1.8.1.5