On 5/11/22 03:38, Hiren Mehta wrote:
Hi All,

I was wondering if there is a way to override the gd->env_addr that is 
initialized in env_flash_init() for flash based environment.
As I see, env_addr depends on the env_ptr which is set to compile time value of 
CONFIG_ENV_ADDR.
I was thinking of doing it in board_early_init_f(). But, as I understand, the 
env_init() will override it.

Thanks,
-h

CONFIG_ENV_ADDR is the start address the flash sector containing the
environment. gd->env_addr is the address in RAM where the environment is
stored.

Please, explain why you want to change gd->env_addr. What do you want to
achieve?

Have a look at then 'env import' command which allows you to import an
alternative environment, e.g. as PREBOOT command.
Cf.
https://u-boot.readthedocs.io/en/latest/usage/cmd/env.html?highlight=env%20import#import

Best regards

Heinrich

Reply via email to