Accessing non-volatile variables from Linux
Trent Piepho
tpiepho at kymetacorp.com
Wed Jan 25 12:51:43 PST 2017
On Wed, 2017-01-25 at 14:21 -0500, Frank Hunleth wrote:
> I'm wondering if it's possible to read and modify Barebox environment
> variables from Linux in a way similar to U-Boot's fw_printenv and
> fw_setenv. If that's not possible, is there another way for communicating
> between Linux and Barebox? Apologies if I totally missed a section in the
> docs that describes this.
This might not be useful for what you want, but it could be. Many SoCs
have "handoff" registers that don't have any predefined use and are
preserved across a soft reset.
You can write to the register(s) from Linux, then reboot to Barebox and
see the value, which could then trigger some action in Barebox.
Of course the registers are not preserved across a hard reset, which
might be a plus or minus depending on what you want to do.
This allows you to pass info to barebox without having to worry about
what happens if the env is corrupted while being modified. The barebox
env format is NOT a log based FS designed to prevent this!
More information about the barebox
mailing list