mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* barebox environment early loading
@ 2021-09-09 11:58 Dusan Radic
  2021-09-09 17:16 ` Oleksij Rempel
  0 siblings, 1 reply; 2+ messages in thread
From: Dusan Radic @ 2021-09-09 11:58 UTC (permalink / raw)
  To: barebox

Hello there,

is there a possibility  to read an environment variable as soon as in
ipufb.c?
To be more accurate, before the frame buffer is initalised I need set
the bus_format manually and the correct value is stored in a non
volatile environment variable.
I have tried the following

const char* value;

value = getenv("nv.dataval");

However the result is always NULL.

If I try the same somewhere in board.c then I get the correct value,
but that ist too late to configure the frame buffer.

Has anyone managed to read the environment early, and if yes how? Do I
have to somehow manually load the environment path?  I have tried this
default_environment_path_set(default_environment_path); but it doesn't
seem to work.

I am using barebox 2017.12.0

Help would be appreciated.
Best regards,
Dule

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: barebox environment early loading
  2021-09-09 11:58 barebox environment early loading Dusan Radic
@ 2021-09-09 17:16 ` Oleksij Rempel
  0 siblings, 0 replies; 2+ messages in thread
From: Oleksij Rempel @ 2021-09-09 17:16 UTC (permalink / raw)
  To: Dusan Radic, barebox

Hello Dusan,

Am 09.09.21 um 13:58 schrieb Dusan Radic:
> Hello there,
>
> is there a possibility  to read an environment variable as soon as in
> ipufb.c?
> To be more accurate, before the frame buffer is initalised I need set
> the bus_format manually and the correct value is stored in a non
> volatile environment variable.
> I have tried the following
>
> const char* value;
>
> value = getenv("nv.dataval");
>
> However the result is always NULL.
>
> If I try the same somewhere in board.c then I get the correct value,
> but that ist too late to configure the frame buffer.
>
> Has anyone managed to read the environment early, and if yes how? Do I
> have to somehow manually load the environment path?  I have tried this
> default_environment_path_set(default_environment_path); but it doesn't
> seem to work.
>
> I am using barebox 2017.12.0

uii... drop it, it stinks :D

First of all, update it to the latest version - 2021.08.0 or even next.
Then port the board code to the DEEP_PROBE.
Grep for BAREBOX_DEEP_PROBE_ENABLE. Then you will probably need
something like of_device_ensure_probed() to ensure your environment
storage is probed.

There are probably some more challenges, but this are initial steps.

--
Regards,
Oleksij

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-09 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 11:58 barebox environment early loading Dusan Radic
2021-09-09 17:16 ` Oleksij Rempel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox