From b74ab737369bbbe66c15cbe6c0d0b6a351b00c96 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Mon, 18 May 2009 16:07:22 +0200 Subject: nand_spl: read environment early, when booting from NAND using nand_spl Currently, when booting from NAND using nand_spl, in the beginning the default environment is used until later in boot process the dynamic environment is read out. This way environment variables that must be interpreted early, like the baudrate or "silent", cannot be modified dynamically and remain at their default values. Fix this problem by reading out main and redundand (if used) copies of the environment in the nand_spl code. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Scott Wood --- nand_spl/nand_boot.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'nand_spl/nand_boot.c') diff --git a/nand_spl/nand_boot.c b/nand_spl/nand_boot.c index c7eadad1b9..be2e69c287 100644 --- a/nand_spl/nand_boot.c +++ b/nand_spl/nand_boot.c @@ -246,6 +246,16 @@ void nand_boot(void) ret = nand_load(&nand_info, CONFIG_SYS_NAND_U_BOOT_OFFS, CONFIG_SYS_NAND_U_BOOT_SIZE, (uchar *)CONFIG_SYS_NAND_U_BOOT_DST); +#ifdef CONFIG_NAND_ENV_DST + nand_load(&nand_info, CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, + (uchar *)CONFIG_NAND_ENV_DST); + +#ifdef CONFIG_ENV_OFFSET_REDUND + nand_load(&nand_info, CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE, + (uchar *)CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE); +#endif +#endif + if (nand_chip.select_chip) nand_chip.select_chip(&nand_info, -1); -- cgit v1.2.1