Skip to contentSkip to conversation

tegra: use generic fs commands in BOOTCOMMAND

PATCH New Stephen Warren 2 participants 3 messages Nov 5, 2012 – Nov 6, 2012 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tegra: use generic fs commands in BOOTCOMMAND

From: Stephen Warren <[email protected]>

Modify tegra-common-post.h's BOOTCOMMAND definition to use the generic filesystem command load rather than separate fatload and ext2load. This removes the need to iterate over supported filesystem types in the boot command.

This requires editing all board config headers to enable the new commands. The now-unused commands are left enabled to assue backwards compatibility with any user scripts. Boards (all from Avionic Design) which define custom BOOTCOMMAND values are not affected.

tegra generic fs cmds fixup
---
Tom, this patch is based on u-boot/master, since it depends on commit f9b55e2 "fs: rename fsload command to load" having been applied. I guess you'll need to either rebase u-boot-tegra/next onto that, or wait until you pick up that commit for other reasons.

 include/configs/harmony.h           |    3 ++
 include/configs/paz00.h             |    3 ++
 include/configs/seaboard.h          |    3 ++
 include/configs/tegra-common-post.h |   39 ++++++++++++++--------------------
 include/configs/trimslice.h         |    3 ++
 include/configs/ventana.h           |    3 ++
 include/configs/whistler.h          |    3 ++
 7 files changed, 34 insertions(+), 23 deletions(-)
include/configs/harmony.h +3 -0
index 040bfe4..4839676 100644
@@ -58,8 +58,11 @@
 
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
+#define CONFIG_FS_EXT4
+#define CONFIG_FS_FAT
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
 
 /* NAND support */
 #define CONFIG_CMD_NAND
include/configs/paz00.h +3 -0
index 5603de9..38c79cf 100644
@@ -45,8 +45,11 @@
 
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
+#define CONFIG_FS_EXT4
+#define CONFIG_FS_FAT
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/seaboard.h +3 -0
index ab10bd0..0605582 100644
@@ -71,8 +71,11 @@
 
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
+#define CONFIG_FS_EXT4
+#define CONFIG_FS_FAT
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/tegra-common-post.h +16 -23
index 6f310be..ab62e71 100644
@@ -30,18 +30,6 @@
 
 #else
 
-#ifdef CONFIG_CMD_EXT2
-#define BOOT_FSTYPE_EXT2 "ext2 "
-#else
-#define BOOT_FSTYPE_EXT2 ""
-#endif
-
-#ifdef CONFIG_CMD_FAT
-#define BOOT_FSTYPE_FAT "fat"
-#else
-#define BOOT_FSTYPE_FAT ""
-#endif
-
 #ifdef CONFIG_CMD_MMC
 #define BOOTCMDS_MMC \
 	"mmc_boot=" \
@@ -98,7 +86,7 @@
 	"rootpart=1\0" \
 	\
 	"script_boot="                                                    \
-		"if ${fs}load ${devtype} ${devnum}:${rootpart} "          \
+		"if load ${devtype} ${devnum}:${rootpart} "               \
 				"${scriptaddr} ${prefix}${script}; then " \
 			"echo ${script} found! Executing ...;"            \
 			"source ${scriptaddr};"                           \
@@ -106,11 +94,9 @@
 	\
 	"scan_boot="                                                      \
 		"echo Scanning ${devtype} ${devnum}...; "                 \
-		"for fs in ${boot_fstypes}; do "                          \
-			"for prefix in ${boot_prefixes}; do "             \
-				"for script in ${boot_scripts}; do "      \
-					"run script_boot; "               \
-				"done; "                                  \
+		"for prefix in ${boot_prefixes}; do "                     \
+			"for script in ${boot_scripts}; do "              \
+				"run script_boot; "                       \
 			"done; "                                          \
 		"done;\0"                                                 \
 	\
@@ -120,11 +106,6 @@
 		BOOT_TARGETS_DHCP " " \
 		"\0" \
 	\
-	"boot_fstypes=" \
-		BOOT_FSTYPE_EXT2 " " \
-		BOOT_FSTYPE_FAT " " \
-		"\0" \
-	\
 	"boot_prefixes=/ /boot/\0" \
 	\
 	"boot_scripts=boot.scr.uimg boot.scr\0" \
@@ -226,12 +207,24 @@
 #ifdef CONFIG_EFI_PARTITION
 #undef CONFIG_EFI_PARTITION
 #endif
+#ifdef CONFIG_CMD_FS_GENERIC
+#undef CONFIG_CMD_FS_GENERIC
+#endif
+#ifdef CONFIG_CMD_EXT4
+#undef CONFIG_CMD_EXT4
+#endif
 #ifdef CONFIG_CMD_EXT2
 #undef CONFIG_CMD_EXT2
 #endif
 #ifdef CONFIG_CMD_FAT
 #undef CONFIG_CMD_FAT
 #endif
+#ifdef CONFIG_FS_EXT4
+#undef CONFIG_FS_EXT4
+#endif
+#ifdef CONFIG_FS_FAT
+#undef CONFIG_FS_FAT
+#endif
 
 /* remove USB */
 #ifdef CONFIG_USB_EHCI
include/configs/trimslice.h +3 -0
index 165bc73..334d3a3 100644
@@ -69,8 +69,11 @@
 
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
+#define CONFIG_FS_EXT4
+#define CONFIG_FS_FAT
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
 
 /* Environment in SPI */
 #define CONFIG_ENV_IS_IN_SPI_FLASH
include/configs/ventana.h +3 -0
index 4c9b31c..b55ebc9 100644
@@ -52,8 +52,11 @@
 
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
+#define CONFIG_FS_EXT4
+#define CONFIG_FS_FAT
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/whistler.h +3 -0
index 1c7803b..1e554d8 100644
@@ -61,8 +61,11 @@
 
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
+#define CONFIG_FS_EXT4
+#define CONFIG_FS_FAT
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
 
 /*
  * Environment in eMMC, at the end of 2nd "boot sector". Note: This assumes
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 tegra: use generic fs commands in BOOTCOMMAND

Hi Stephen,

Quoted 7 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Modify tegra-common-post.h's BOOTCOMMAND definition to use the generic filesystem command load rather than separate fatload and ext2load. This removes the need to iterate over supported filesystem types in the boot command.

Quoted 6 lines

This requires editing all board config headers to enable the new commands. The now-unused commands are left enabled to assue backwards compatibility with any user scripts. Boards (all from Avionic Design) which define custom BOOTCOMMAND values are not affected.

I tested this on Seaboard and it worked just as before (although didn't actually load a kernel since there was not one there).

Quoted 1 line

tegra generic fs cmds fixup

What is this?

Quoted 6 lines

---
Tom, this patch is based on u-boot/master, since it depends on commit f9b55e2 "fs: rename fsload command to load" having been applied. I guess you'll need to either rebase u-boot-tegra/next onto that, or wait until you pick up that commit for other reasons.

Regards,
Simon

#2 lore raw

PATCH 1/1 tegra: use generic fs commands in BOOTCOMMAND

Quoted 14 lines · Simon Glass

Hi Stephen,

Quoted 11 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Modify tegra-common-post.h's BOOTCOMMAND definition to use the generic filesystem command load rather than separate fatload and ext2load. This removes the need to iterate over supported filesystem types in the boot command.

This requires editing all board config headers to enable the new commands. The now-unused commands are left enabled to assue backwards compatibility with any user scripts. Boards (all from Avionic Design) which define custom BOOTCOMMAND values are not affected.

...

Quoted 3 lines
Quoted 1 line

tegra generic fs cmds fixup

What is this?

Oops. That's the commit subject from where I squashed some fixes. Perhaps Tom can remove it when he applies this, assuming I don't need to repost for any reason.