common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment in SPL
PATCH v3 1/1 common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment in SPL
From: Ying Zhang <[email protected]>
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.
---
Compared with the previous version, add symbol CONFIG_SPL_ENV_SUPPORT in include/configs/a3m071.h.
README | 3 +++ common/Makefile | 19 +++++++++---------- include/configs/a3m071.h | 1 + include/configs/am335x_evm.h | 1 + include/configs/pcm051.h | 1 + 5 files changed, 15 insertions(+), 10 deletions(-)
README +3 -0
@@ -2985,6 +2985,9 @@ 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_PAD_TO Image offset to which the SPL should be padded before appending the SPL payload. By default, this is defined as
common/Makefile +9 -10
@@ -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
@@ -67,7 +66,6 @@ COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o COBJS-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o COBJS-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o -COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o # command COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
@@ -215,18 +213,16 @@ 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 endif +# core command +COBJS-y += cmd_nvedit.o +# environment +COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
COBJS-$(CONFIG_BOUNCE_BUFFER) += bouncebuf.o
COBJS-y += console.o
COBJS-y += dlmalloc.o
include/configs/a3m071.h +1 -0
@@ -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)@this address */ #define CONFIG_SYS_SPL_ARGS_ADDR 0x01800000
include/configs/am335x_evm.h +1 -0
@@ -325,6 +325,7 @@#define CONFIG_SPL_GPIO_SUPPORT #define CONFIG_SPL_YMODEM_SUPPORT #define CONFIG_SPL_NET_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT #define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"#define CONFIG_SPL_ETH_SUPPORT #define CONFIG_SPL_SPI_SUPPORT
include/configs/pcm051.h +1 -0
@@ -224,6 +224,7 @@#define CONFIG_SPL_GPIO_SUPPORT #define CONFIG_SPL_YMODEM_SUPPORT #define CONFIG_SPL_NET_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT #define CONFIG_SPL_NET_VCI_STRING "pcm051 U-Boot SPL"#define CONFIG_SPL_ETH_SUPPORT #define CONFIG_SPL_SPI_SUPPORT
Signature · 1 line
1.7.0.4
PATCH v3 1/1 common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment in SPL
Quoted 9 lines · ying.zhang at freescale.com
From: Ying Zhang <[email protected]>
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_SUPPORTto replaceCONFIG_SPL_NET_SUPPORTfor environment in common/Makefile.Signed-off-by Ying Zhang <[email protected]>
[snip]
common/Makefile COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o · line 70
Quoted 6 lines
# environmentcommon/Makefile +0
-1@@ -67,7 +66,6 @@ COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o COBJS-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o COBJS-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o -COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
You need to move all of these options down so that adding them to SPL later, as needed, doesn't have further deltas, and to keep things organized still.
common/Makefile COBJS-$(CONFIG_CMD_GPT) += cmd_gpt.o · line 216
Quoted 9 lines
common/Makefile +0
-2# command COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o@@ -215,18 +213,16 @@ 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
This CONFIG_ENV_IS_IN_FLASH is now duplicated and needs to be removed, when you move all of the other CONFIG_ENV_IS_... down to the always part of the Makefile.
[snip]
Quoted 17 lines
include/configs/am335x_evm.h +1
-0@@ -325,6 +325,7 @@#define CONFIG_SPL_GPIO_SUPPORT #define CONFIG_SPL_YMODEM_SUPPORT #define CONFIG_SPL_NET_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT #define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"#define CONFIG_SPL_ETH_SUPPORT #define CONFIG_SPL_SPI_SUPPORT include/configs/pcm051.h +0
-0
include/configs/pcm051.h line 230
Quoted 7 lines
include/configs/pcm051.h +1
-0@@ -224,6 +224,7 @@#define CONFIG_SPL_GPIO_SUPPORT #define CONFIG_SPL_YMODEM_SUPPORT #define CONFIG_SPL_NET_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT #define CONFIG_SPL_NET_VCI_STRING "pcm051 U-Boot SPL"#define CONFIG_SPL_ETH_SUPPORT #define CONFIG_SPL_SPI_SUPPORT
Have you made sure these two boards still compile? I bet they don't as they aren't setting CONFIG_ENV_IS_NOWHERE for SPL and CONFIG_ENV_IS_...somewhere-else for non-SPL.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130515/a43d1bcd/attachment.pgp>
PATCH v3 1/1 common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment in SPL
-----Original Message-----
From: Tom Rini [mailto:tom.rini at gmail.com] On Behalf Of Tom Rini
Sent: Wednesday, May 15, 2013 10:07 PM
To: Zhang Ying-B40530
Cc: u-boot at lists.denx.de; Wood Scott-B07421; afleming at gmail.com; Xie Xiaobo-R63061; Zhang Ying-B40530
Subject: Re: [U-Boot] [PATCH v3] common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment in SPL
Quoted 9 lines · ying.zhang at freescale.com
From: Ying Zhang <[email protected]>
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_SUPPORTto replaceCONFIG_SPL_NET_SUPPORTfor environment in common/Makefile.Signed-off-by Ying Zhang <[email protected]>
[snip]
common/Makefile COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o · line 70
Quoted 6 lines
# environmentcommon/Makefile +0
-1@@ -67,7 +66,6 @@ COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o COBJS-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o COBJS-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o -COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
You need to move all of these options down so that adding them to SPL later, as needed, doesn't have further deltas, and to keep things organized still.
common/Makefile COBJS-$(CONFIG_CMD_GPT) += cmd_gpt.o · line 216
Quoted 9 lines
common/Makefile +0
-2# command COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o@@ -215,18 +213,16 @@ 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
This CONFIG_ENV_IS_IN_FLASH is now duplicated and needs to be removed, when you move all of the other CONFIG_ENV_IS_... down to the always part of the Makefile.
[snip]
Quoted 17 lines
include/configs/am335x_evm.h +1
-0@@ -325,6 +325,7 @@#define CONFIG_SPL_GPIO_SUPPORT #define CONFIG_SPL_YMODEM_SUPPORT #define CONFIG_SPL_NET_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT #define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"#define CONFIG_SPL_ETH_SUPPORT #define CONFIG_SPL_SPI_SUPPORT include/configs/pcm051.h +0
-0
include/configs/pcm051.h line 230
Quoted 7 lines
include/configs/pcm051.h +1
-0@@ -224,6 +224,7 @@#define CONFIG_SPL_GPIO_SUPPORT #define CONFIG_SPL_YMODEM_SUPPORT #define CONFIG_SPL_NET_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT #define CONFIG_SPL_NET_VCI_STRING "pcm051 U-Boot SPL"#define CONFIG_SPL_ETH_SUPPORT #define CONFIG_SPL_SPI_SUPPORT
Have you made sure these two boards still compile? I bet they don't as they aren't setting CONFIG_ENV_IS_NOWHERE for SPL and CONFIG_ENV_IS_...somewhere-else for non-SPL.
[Zhang Ying]
Oh, there are some confusion. I thought CONFIG_ENV_IS_xxx defined is consistent for both SPL and non-SPL.
If you want to set CONFIG_ENV_IS_NOWHERE for SPL and CONFIG_ENV_IS_xxx somewhere-else for non-SPL, so all of lines CONFIG_ENV_IS_... cann't be moved to the public area, because CONFIG_ENV_IS_NOWHERE has always been not effective and CONFIG_ENV_IS_... has been effective in common/Makefile.
Unless we define some new symbols that for SPL?
PATCH v3 1/1 common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment in SPL
On Thu, May 16, 2013 at 07:17:50AM +0000, Zhang Ying-B40530 wrote:
[snip]
Quoted 9 lines
Oh, there are some confusion. I thought
CONFIG_ENV_IS_xxxdefined is consistent for both SPL and non-SPL.
If you want to setCONFIG_ENV_IS_NOWHEREfor SPL andCONFIG_ENV_IS_xxxsomewhere-else for non-SPL, so all of linesCONFIG_ENV_IS_... cann't be moved to the public area, becauseCONFIG_ENV_IS_NOWHEREhas always been not effective andCONFIG_ENV_IS_... has been effective in common/Makefile.Unless we define some new symbols that for SPL?
OK, you're right, this is a bit more complex than it looks. Today, a3m071 relies on SPL always building cmd_nvedit.o and env_common.o and duplicated CONFIG_ENV_IS_IN_FLASH in the SPL section. CONFIG_SPL_NET_SUPPORT relies on the same always-built ins and adds env_nowhere.o which works because the regular CONFIG_ENV_IS_IN_... section is in the non-SPL-only area.
Part of the answer / problem is, wow, OK, we need to re-sort common/ a bit:
$ ls common/*.c | wc -l 160 $ ls common/cmd*.c | wc -l 106 $ ls common/env*.c | wc -l 17
Now, your end-goal is to have env from, I assume, NAND, also exist on SPL? I guess for now, lets go ahead and duplicate a few lines of ENV_IS.. inside the SPL area and when you add NAND env, add ifneq ($(CONFIG_SPL_NET_SUPPORT),y)...endif around it and add to the README that CONFIG_SPL_NET_SUPPORT conflicts with SPL env from nand.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130516/d2c1a5e8/attachment.pgp>