diff mbox series

[U-Boot,v3,2/3] env: Don't check CONFIG_ENV_OFFSET_REDUND for SPL build

Message ID 20190225153300.11668-2-martyn.welch@collabora.com
State Accepted
Delegated to: Tom Rini
Headers show
Series [U-Boot,v3,1/3] Add support for the MT41K128M16JT125K memory modules | expand

Commit Message

Martyn Welch Feb. 25, 2019, 3:32 p.m. UTC
When booting using an SPL on am335x, if we want to support booting with
the boot ROM loader via USB (which uses RNDIS, making bootp and tftp
calls) we need to enable gadget eth in the SPL to load the main U-Boot
image. To enable CONFIG_SPL_ETH_SUPPORT, we must enable
CONFIG_SPL_ENV_SUPPORT as the environment is used by the eth support, but
we don't actually need to have environment variables saved in the SPL
environment. We do however have environment variables saved in the main
U-Boot image and enable CONFIG_ENV_OFFSET_REDUND (we are storing in raw
NAND). In such instances, even with the build config enabling both
CONFIG_CMD_SAVEENV and CONFIG_CMD_NAND, these options aren't set when
building the SPL, but CONFIG_ENV_OFFSET_REDUND still is.

Don't check this configuration option for SPL builds to enable the above
configuration.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

---

Changes in v3: None
Changes in v2:
- Reword commit message to better describe the issue

 env/nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini April 12, 2019, 4:30 p.m. UTC | #1
On Mon, Feb 25, 2019 at 03:32:59PM +0000, Martyn Welch wrote:

> When booting using an SPL on am335x, if we want to support booting with
> the boot ROM loader via USB (which uses RNDIS, making bootp and tftp
> calls) we need to enable gadget eth in the SPL to load the main U-Boot
> image. To enable CONFIG_SPL_ETH_SUPPORT, we must enable
> CONFIG_SPL_ENV_SUPPORT as the environment is used by the eth support, but
> we don't actually need to have environment variables saved in the SPL
> environment. We do however have environment variables saved in the main
> U-Boot image and enable CONFIG_ENV_OFFSET_REDUND (we are storing in raw
> NAND). In such instances, even with the build config enabling both
> CONFIG_CMD_SAVEENV and CONFIG_CMD_NAND, these options aren't set when
> building the SPL, but CONFIG_ENV_OFFSET_REDUND still is.
> 
> Don't check this configuration option for SPL builds to enable the above
> configuration.
> 
> Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/env/nand.c b/env/nand.c
index 29eda66fad..d0b95f483d 100644
--- a/env/nand.c
+++ b/env/nand.c
@@ -26,7 +26,7 @@ 
 #if defined(CONFIG_CMD_SAVEENV) && defined(CONFIG_CMD_NAND) && \
 		!defined(CONFIG_SPL_BUILD)
 #define CMD_SAVEENV
-#elif defined(CONFIG_ENV_OFFSET_REDUND)
+#elif defined(CONFIG_ENV_OFFSET_REDUND) && !defined(CONFIG_SPL_BUILD)
 #error CONFIG_ENV_OFFSET_REDUND must have CONFIG_CMD_SAVEENV & CONFIG_CMD_NAND
 #endif