[U-Boot] [RFC PATCH 1/2] sunxi: retrieve FEL-provided values to environment variables

Bernhard Nortmann
2015-09-11T09:08:28Z

Hi Hans!

Am 10.09.2015 um 20:34 schrieb Hans de Goede:
>
> What if the user interrupts auto-boot with a fel provided boot.scr
> and then does "saveenv" ?
>
> Then we end up with a fel_data_addr and fel_data_size permanently
> in the env.
>
> At a minimum this function must always do:
>
> setenv("fel_data_addr", NULL);
> setenv("fel_data_size", NULL);
>
> (rather then only when we've a spl fel header but no addr / size)
>
> So that we do not end up trying to interpret old values ever.

Good point.

>
> Ideally though we would find another way not involving putting these
> in the environment (not sure if that is easily doable).

I also have no idea how to achieve that, especially if we want to keep
the FEL case "in line" with other, more conventional ways of booting.

> Maybe clear all env variables here?
>
> Or even better clear them all unconditionally, and then set
> them when the checks succeed ?
>

That's something that may be best aligned somehow with the NAND and
MMC boot handling, if possible? I.e. have some centralized piece of
code that determines the active boot method and retrieves/presets the
environments accordingly. I'll have to re-examine that more closely.

Regards, B. Nortmann