diff mbox

[U-Boot,RFC,3/3] move wandboard over to use the generic distro configuratin and environment

Message ID 1392659798-1665-4-git-send-email-dennis@ausil.us
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Dennis Gilmore Feb. 17, 2014, 5:56 p.m. UTC
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
---
 include/configs/wandboard.h | 87 +++++++--------------------------------------
 1 file changed, 12 insertions(+), 75 deletions(-)

Comments

Otavio Salvador Feb. 19, 2014, 11:52 a.m. UTC | #1
Hello Dennis,

the short log should use the standard for the commit logs.

On Mon, Feb 17, 2014 at 2:56 PM, Dennis Gilmore <dennis@ausil.us> wrote:
> Signed-off-by: Dennis Gilmore <dennis@ausil.us>
> ---
>  include/configs/wandboard.h | 87 +++++++--------------------------------------
>  1 file changed, 12 insertions(+), 75 deletions(-)
>
> diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
> index 3488472..bb7aadd 100644
> --- a/include/configs/wandboard.h
> +++ b/include/configs/wandboard.h
> @@ -41,6 +41,11 @@
>  #define CONFIG_CONS_INDEX              1
>  #define CONFIG_BAUDRATE                        115200
>
> +#ifndef CONFIG_SPL_BUILD
> +#include <config_distro_defaults.h>
> +#include <config_distro_bootcmd.h>
> +#endif
> +
>  /* Command definition */
>  #include <config_cmd_default.h>
>
> @@ -49,8 +54,6 @@
>  #define CONFIG_CMD_BMODE
>  #define CONFIG_CMD_SETEXPR
>
> -#define CONFIG_BOOTDELAY               5
> -
>  #define CONFIG_SYS_MEMTEST_START       0x10000000
>  #define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
>  #define CONFIG_LOADADDR                        0x12000000
> @@ -66,15 +69,8 @@
>  #define CONFIG_CMD_MMC
>  #define CONFIG_GENERIC_MMC
>  #define CONFIG_BOUNCE_BUFFER
> -#define CONFIG_CMD_EXT2
> -#define CONFIG_CMD_FAT
> -#define CONFIG_DOS_PARTITION
>
>  /* Ethernet Configuration */
> -#define CONFIG_CMD_PING
> -#define CONFIG_CMD_DHCP
> -#define CONFIG_CMD_MII
> -#define CONFIG_CMD_NET
>  #define CONFIG_FEC_MXC
>  #define CONFIG_MII
>  #define IMX_FEC_BASE                   ENET_BASE_ADDR
> @@ -114,8 +110,12 @@
>         "fdt_high=0xffffffff\0" \
>         "initrd_high=0xffffffff\0" \
>         "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
> -       "fdt_addr=0x18000000\0" \
> +       "fdt_addr_r=0x18000000\0" \
>         "boot_fdt=try\0" \
> +       "pxefile_addr_r=0x17e00000\0" \
> +       "scriptaddr=0x17d00000\0" \
> +       "kernel_addr_r=0x13000000\0" \
> +       "ramdisk_addr_r=0x15000000\0" \

At least the address that are common to SoCs shouldn't be duplicated
here, do it?

>         "ip_dyn=yes\0" \
>         "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
>         "mmcpart=1\0" \
> @@ -134,70 +134,12 @@
>                                 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
>                         "fi; "  \
>                 "fi\0" \
> -       "mmcargs=setenv bootargs console=${console},${baudrate} " \
> -               "root=${mmcroot}\0" \
> -       "loadbootscript=" \
> -               "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
> -       "bootscript=echo Running bootscript from mmc ...; " \
> -               "source\0" \
> -       "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
> -       "loadfdt=fatload 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 " \
> -                               "bootz ${loadaddr} - ${fdt_addr}; " \
> -                       "else " \
> -                               "if test ${boot_fdt} = try; then " \
> -                                       "bootz; " \
> -                               "else " \
> -                                       "echo WARN: Cannot load the DT; " \
> -                               "fi; " \
> -                       "fi; " \
> -               "else " \
> -                       "bootz; " \
> -               "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} ${image}; " \
> -               "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> -                       "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
> -                               "bootz ${loadaddr} - ${fdt_addr}; " \
> -                       "else " \
> -                               "if test ${boot_fdt} = try; then " \
> -                                       "bootz; " \
> -                               "else " \
> -                                       "echo WARN: Cannot load the DT; " \
> -                               "fi; " \
> -                       "fi; " \
> -               "else " \
> -                       "bootz; " \
> -               "fi;\0"
> +       BOOTCMDS_COMMON
>
>  #define CONFIG_BOOTCOMMAND \
> -          "mmc dev ${mmcdev}; if mmc rescan; then " \
> -                  "if run loadbootscript; then " \
> -                          "run bootscript; " \
> -                  "else " \
> -                          "if run loadimage; then " \
> -                                  "run mmcboot; " \
> -                          "else run netboot; " \
> -                          "fi; " \
> -                  "fi; " \
> -          "else run netboot; fi"
> +       "for target in ${boot_targets}; do run bootcmd_${target}; done"
>
>  /* Miscellaneous configurable options */
> -#define CONFIG_SYS_LONGHELP
> -#define CONFIG_SYS_HUSH_PARSER
> -#define CONFIG_AUTO_COMPLETE
>  #define CONFIG_SYS_CBSIZE              256
>
>  /* Print Buffer Size */
> @@ -207,8 +149,6 @@
>
>  #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
>
> -#define CONFIG_CMDLINE_EDITING
> -
>  /* Physical Memory Map */
>  #define CONFIG_NR_DRAM_BANKS           1
>  #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
> @@ -231,9 +171,6 @@
>  #define CONFIG_ENV_OFFSET              (6 * 64 * 1024)
>  #define CONFIG_SYS_MMC_ENV_DEV         0
>
> -#define CONFIG_OF_LIBFDT
> -#define CONFIG_CMD_BOOTZ
> -
>  #ifndef CONFIG_SYS_DCACHE_OFF
>  #define CONFIG_CMD_CACHE
>  #endif
> --
> 1.8.5.3
>
Stephen Warren Feb. 19, 2014, 5:50 p.m. UTC | #2
On 02/17/2014 10:56 AM, Dennis Gilmore wrote:
> Signed-off-by: Dennis Gilmore <dennis@ausil.us>

> diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h

> -	"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; " \
...

This one also removes nfsroot stuff.

Admittedly I would personally argue that nfsroot setup belong in the
boot.scr that comes from some TFTP server, and I wrote the Tegra boot
scripts assuming that, but I probably got away with that for Tegra since
we never had any nfsroot setup in the default environment. People using
these boards might like to keep their working features:-) Perhaps we
could persuade people to adapt though?
diff mbox

Patch

diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 3488472..bb7aadd 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -41,6 +41,11 @@ 
 #define CONFIG_CONS_INDEX		1
 #define CONFIG_BAUDRATE			115200
 
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+#include <config_distro_bootcmd.h>
+#endif
+
 /* Command definition */
 #include <config_cmd_default.h>
 
@@ -49,8 +54,6 @@ 
 #define CONFIG_CMD_BMODE
 #define CONFIG_CMD_SETEXPR
 
-#define CONFIG_BOOTDELAY		5
-
 #define CONFIG_SYS_MEMTEST_START	0x10000000
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
 #define CONFIG_LOADADDR			0x12000000
@@ -66,15 +69,8 @@ 
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
 #define CONFIG_BOUNCE_BUFFER
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-#define CONFIG_DOS_PARTITION
 
 /* Ethernet Configuration */
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_NET
 #define CONFIG_FEC_MXC
 #define CONFIG_MII
 #define IMX_FEC_BASE			ENET_BASE_ADDR
@@ -114,8 +110,12 @@ 
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
-	"fdt_addr=0x18000000\0" \
+	"fdt_addr_r=0x18000000\0" \
 	"boot_fdt=try\0" \
+	"pxefile_addr_r=0x17e00000\0" \
+	"scriptaddr=0x17d00000\0" \
+	"kernel_addr_r=0x13000000\0" \
+	"ramdisk_addr_r=0x15000000\0" \
 	"ip_dyn=yes\0" \
 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
 	"mmcpart=1\0" \
@@ -134,70 +134,12 @@ 
 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
 			"fi; "	\
 		"fi\0" \
-	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
-	"loadbootscript=" \
-		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
-		"source\0" \
-	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
-	"loadfdt=fatload 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 " \
-				"bootz ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootz; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootz; " \
-		"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} ${image}; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-				"bootz ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootz; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootz; " \
-		"fi;\0"
+	BOOTCMDS_COMMON
 
 #define CONFIG_BOOTCOMMAND \
-	   "mmc dev ${mmcdev}; if mmc rescan; then " \
-		   "if run loadbootscript; then " \
-			   "run bootscript; " \
-		   "else " \
-			   "if run loadimage; then " \
-				   "run mmcboot; " \
-			   "else run netboot; " \
-			   "fi; " \
-		   "fi; " \
-	   "else run netboot; fi"
+	"for target in ${boot_targets}; do run bootcmd_${target}; done"
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_LONGHELP
-#define CONFIG_SYS_HUSH_PARSER
-#define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE		256
 
 /* Print Buffer Size */
@@ -207,8 +149,6 @@ 
 
 #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
 
-#define CONFIG_CMDLINE_EDITING
-
 /* Physical Memory Map */
 #define CONFIG_NR_DRAM_BANKS		1
 #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
@@ -231,9 +171,6 @@ 
 #define CONFIG_ENV_OFFSET		(6 * 64 * 1024)
 #define CONFIG_SYS_MMC_ENV_DEV		0
 
-#define CONFIG_OF_LIBFDT
-#define CONFIG_CMD_BOOTZ
-
 #ifndef CONFIG_SYS_DCACHE_OFF
 #define CONFIG_CMD_CACHE
 #endif