]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
env: nand: Put ENV_INVALID into gd->env_valid if default environment
authorMarek Behún <marek.behun@nic.cz>
Fri, 22 Oct 2021 13:47:15 +0000 (15:47 +0200)
committerSimon Glass <sjg@chromium.org>
Sun, 31 Oct 2021 18:26:44 +0000 (12:26 -0600)
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@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
env/nand.c

index be82e97d69cd878b78269fb779f229e587aec426..21aa367d5bdfedf45fb7805bfa5b7f35b3b1ec9b 100644 (file)
@@ -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;