[U-Boot] [PATCH v4] common/Makefile: Add new symbol CONFIG_SPL_ENV_xxx for environment in SPL

ying.zhang at freescale.com ying.zhang at freescale.com
Thu May 16 10:46:10 CEST 2013


From: Ying Zhang <b40530 at freescale.com>

There will need the environment in SPL for reasons other than network
support (in particular, hwconfig contains info for how to set up DDR).

Add a new symbol CONFIG_SPL_ENV_SUPPORT to replace CONFIG_SPL_NET_SUPPORT
for environment in common/Makefile.
Meanwhile we add the following symbol for different storage medium:
	CONFIG_SPL_ENV_IS_IN_NAND
	CONFIG_SPL_ENV_IS_IN_MMC
	CONFIG_SPL_ENV_IS_IN_SPI_FLASH
	CONFIG_SPL_ENV_IS_NOWHERE

Signed-off-by: Ying Zhang <b40530 at freescale.com>
---
Compared with the previous version, add symbol CONFIG_SPL_ENV_IS_IN_NOWHERE
in include/configs/am335x_evm.h and include/configs/am335x_evm.h

 README                       |   15 +++++++++++++++
 common/Makefile              |   19 +++++++++++--------
 include/configs/a3m071.h     |    1 +
 include/configs/am335x_evm.h |    2 ++
 include/configs/pcm051.h     |    2 ++
 5 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/README b/README
index 0c4cb20..04f12a5 100644
--- a/README
+++ b/README
@@ -2992,6 +2992,21 @@ FIT uImage format:
 		CONFIG_SPL_LIBGENERIC_SUPPORT
 		Support for lib/libgeneric.o in SPL binary
 
+		CONFIG_SPL_ENV_SUPPORT
+		Support for the environment operating in SPL binary
+
+		CONFIG_SPL_ENV_IS_NOWHERE
+		Store ENV in memory only in SPL binary
+
+		CONFIG_SPL_ENV_IS_IN_MMC
+		Store ENV in MMC/SD Card in SPL binary
+
+		CONFIG_SPL_ENV_IS_IN_NAND
+		Store ENV in nand in SPL binary
+
+		CONFIG_SPL_ENV_IS_IN_SPI_FLASH
+		Store ENV in SPI flash in SPL binary
+
 		CONFIG_SPL_PAD_TO
 		Image offset to which the SPL should be padded before appending
 		the SPL payload. By default, this is defined as
diff --git a/common/Makefile b/common/Makefile
index f50bf2e..352a3c3 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -44,7 +44,6 @@ COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_r.o
 COBJS-y += cmd_boot.o
 COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o
 COBJS-y += cmd_help.o
-COBJS-y += cmd_nvedit.o
 COBJS-y += cmd_version.o
 
 # environment
@@ -215,18 +214,22 @@ COBJS-$(CONFIG_CMD_GPT) += cmd_gpt.o
 endif
 
 ifdef CONFIG_SPL_BUILD
-COBJS-y += cmd_nvedit.o
 COBJS-y += env_common.o
 COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
 COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += cmd_nvedit.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_attr.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_callback.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_common.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_flags.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_nowhere.o
 COBJS-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
+# environment
+COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_common.o
+COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_attr.o
+COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_flags.o
+COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_callback.o
+COBJS-$(CONFIG_SPL_ENV_IS_NOWHERE) += env_nowhere.o
+COBJS-$(CONFIG_SPL_ENV_IS_IN_MMC) += env_mmc.o
+COBJS-$(CONFIG_SPL_ENV_IS_IN_NAND) += env_nand.o
+COBJS-$(CONFIG_SPL_ENV_IS_IN_SPI_FLASH) += env_sf.o
 endif
+# core command
+COBJS-y += cmd_nvedit.o
 COBJS-$(CONFIG_BOUNCE_BUFFER) += bouncebuf.o
 COBJS-y += console.o
 COBJS-y += dlmalloc.o
diff --git a/include/configs/a3m071.h b/include/configs/a3m071.h
index e9af825..8f29229 100644
--- a/include/configs/a3m071.h
+++ b/include/configs/a3m071.h
@@ -426,6 +426,7 @@
 #define CONFIG_SPL_BSS_MAX_SIZE		(64 << 10)
 
 #define CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_ENV_SUPPORT
 /* Place patched DT blob (fdt) at this address */
 #define CONFIG_SYS_SPL_ARGS_ADDR	0x01800000
 
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index ef00306..ca132a7 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -325,6 +325,8 @@
 #define CONFIG_SPL_GPIO_SUPPORT
 #define CONFIG_SPL_YMODEM_SUPPORT
 #define CONFIG_SPL_NET_SUPPORT
+#define CONFIG_SPL_ENV_SUPPORT
+#define CONFIG_SPL_ENV_IS_NOWHERE
 #define CONFIG_SPL_NET_VCI_STRING	"AM335x U-Boot SPL"
 #define CONFIG_SPL_ETH_SUPPORT
 #define CONFIG_SPL_SPI_SUPPORT
diff --git a/include/configs/pcm051.h b/include/configs/pcm051.h
index d0ea74e..532f2be 100644
--- a/include/configs/pcm051.h
+++ b/include/configs/pcm051.h
@@ -224,6 +224,8 @@
 #define CONFIG_SPL_GPIO_SUPPORT
 #define CONFIG_SPL_YMODEM_SUPPORT
 #define CONFIG_SPL_NET_SUPPORT
+#define CONFIG_SPL_ENV_SUPPORT
+#define CONFIG_SPL_ENV_IS_NOWHERE
 #define CONFIG_SPL_NET_VCI_STRING	"pcm051 U-Boot SPL"
 #define CONFIG_SPL_ETH_SUPPORT
 #define CONFIG_SPL_SPI_SUPPORT
-- 
1.7.0.4




More information about the U-Boot mailing list