mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Lars Pedersen <lapeddk@gmail.com>, barebox@lists.infradead.org
Subject: Re: barebox environment raw partition on beaglebone black
Date: Thu, 15 Feb 2024 14:47:31 +0100	[thread overview]
Message-ID: <5a7f3262-a549-47da-8658-afb81ff380fa@pengutronix.de> (raw)
In-Reply-To: <CAKd8=GtV4EtC5Bx+t=YOfLXEFKB_-1N=HbU4hfCaLK6Lw3YMhA@mail.gmail.com>

Hi Lars,

On 15.02.24 14:01, Lars Pedersen wrote:
> Hi.
> 
> I'm trying to create a barebox environment by using af emmc a raw
> partition offset on the beaglebone black.
> 
> For testing I appended the following into am33x-boneblack.dts.
> 
> / {
>     chosen {
>         environment {
>             compatible = "barebox,environment";
>             device-path = &environment_emmc;
>         };
>     };
> 
>     aliases {
>         state = &state_emmc;
>     };
> 
>     state_emmc: state {

[snip]

Keep in mind that state is unrelated to environment:

 - state: power-fail safe set of predefined variables used for mostly bootstate
 - environment: where you would keep scripts, variables and resources.
    In the field, you'd probably only use the immutable barebox built-in environment
    (+ state), but for development, the mutable environment is very handy.

> state: New state registered 'state'
> state state.of: Fresh state detected, continuing with defaults

State looks ok.

> environment load /mnt/mmc1.0/barebox.env: No such file or directory
> Maybe you have to create the partition.
> changing USB current limit to 1300 mA... done
> 
> Hit m for menu or any to stop autoboot:    1
> ---------------------------------------------------
> 
> Why does it try to read the env on a partition on
> /mnt/mmc1.0/barebox.env? Is it because barebox.bin also is read from
> this partition?

Check out omap_env_init(), which registers the environment if system boots from
SD/MMC. This seems to take precedence over what's in the device tree. Indeed,
upstream AM335x platforms only configure an environment in the DT if it's outside
SD, on NAND or NOR.

I think placing the environment on the FAT makes sense as the MLO is there as well.
Why would you like to move it?

Cheers,
Ahmad

> 
> Thanks.
> 
> /Lars
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




  reply	other threads:[~2024-02-15 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 13:01 Lars Pedersen
2024-02-15 13:47 ` Ahmad Fatoum [this message]
2024-02-15 14:29   ` Lars Pedersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5a7f3262-a549-47da-8658-afb81ff380fa@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=lapeddk@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox