[U-Boot] [PATCH] cmd: nvedit: env_get_f must check for env_get_char error codes

Goldschmidt Simon sgoldschmidt at de.pepperl-fuchs.com
Sat Feb 3 10:27:32 UTC 2018


On 02/02/2018 21:04, York Sun wrote:
> On 02/02/2018 10:51 AM, Maxime Ripard wrote:
> 
> <snip>
> 
>>>>>
>>>> Simon,
>>>>
>>>> This patch looks correct. But it doesn't fix NOR flash. Do you have plan
>>>> to add .get_char function to other drivers? Without that function, we
>>>> cannot get env variables before relocation.
>>>
>>> Ehrm, sorry  I don't plan to do that, no: my target seems to run fine
>>> without this.
>>>
>>> Given that only the eeprom and nvram env drivers support the get_char
>>> method, I don't know if this is widely used at all. Maybe a better fallback
>>> would be to just remove that get_char code path totally and always load from
>>> the internal (default) environment until the full environment is available
>>> (after relocation).
>>>
>>> After all, the environment variables loaded via get_char are not CRC checked
>>> at all. To me, this is another indication that this code is not really
>>> useful and should probably be removed.
>>
>> To be honest, I'm not really sure what get_char was here for in the
>> first place, so getting rid of it sounds like a good idea :)
>>
> 
> On almost all my boards, a variable hwconfig is read before relocation
> to determine DDR configuration. This has been broken. I don't mind you
> remove some dead code. But this is breaking almost all my boards booting
> from NOR flash.

When talking about removing a feature I meant the code that
exists for 2 env drivers only where single characters are loaded
from an external environment without checking its crc first.

The thing you seem to need is reading from the default environment
before relocation. This should not be removed, of course!

I might prepare a patch to better show what I mean...

Simon


More information about the U-Boot mailing list