[PATCH 04/14] env: nand: Put ENV_INVALID into gd->env_valid if default environment

Marek Behún kabel at kernel.org
Fri Oct 22 15:47:15 CEST 2021


From: Marek Behún <marek.behun at nic.cz>

env_nand_init() says the environment is valid even if it is assigning
default environment due to not being able to access nand pre-reloaction
(determined by macro values). Change this to ENV_INVALID and let the
generic env_init() function, which calls this initializer, assign the
default environment.

Signed-off-by: Marek Behún <marek.behun at nic.cz>
---
 env/nand.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/env/nand.c b/env/nand.c
index be82e97d69..21aa367d5b 100644
--- a/env/nand.c
+++ b/env/nand.c
@@ -107,8 +107,7 @@ static int env_nand_init(void)
 	gd->env_addr = (ulong)env_ptr->data;
 
 #else /* ENV_IS_EMBEDDED || CONFIG_NAND_ENV_DST */
-	gd->env_addr	= (ulong)&default_environment[0];
-	gd->env_valid	= ENV_VALID;
+	gd->env_valid	= ENV_INVALID;
 #endif /* ENV_IS_EMBEDDED || CONFIG_NAND_ENV_DST */
 
 	return 0;
-- 
2.32.0



More information about the U-Boot mailing list