[U-Boot] [PATCH 1/3] nand: allow demand initialization

Scott Wood scottwood at freescale.com
Mon Oct 11 22:29:41 CEST 2010


On Sun, Oct 10, 2010 at 06:37:40AM -0400, Mike Frysinger wrote:
> diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> index 3f1d077..e0be7e5 100644
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -309,6 +309,8 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
>  	if (argc < 2)
>  		goto usage;
>  
> +	nand_init();
> +
>  	if (quiet_str)
>  		quiet = simple_strtoul(quiet_str, NULL, 0) != 0;
>  

Also do_nandboot().

> diff --git a/common/env_nand.c b/common/env_nand.c
> index 4e8307a..3dffebd 100644
> --- a/common/env_nand.c
> +++ b/common/env_nand.c
> @@ -359,6 +359,8 @@ void env_relocate_spec(void)
>  		return;
>  	}
>  
> +	nand_init();
> +
>  	if (readenv(CONFIG_ENV_OFFSET, (u_char *) tmp_env1))
>  		puts("No Valid Environment Area found\n");
>  
> @@ -404,6 +406,8 @@ void env_relocate_spec(void)
>  	free(tmp_env1);
>  	free(tmp_env2);
>  
> +#else
> +	nand_init();
>  #endif /* ! ENV_IS_EMBEDDED */

Do we really need to initialize NAND if the environment is embedded, or
could it be delayed to when the environment is saved?

-Scott



More information about the U-Boot mailing list