All of lore.kernel.org
 help / color / mirror / Atom feed
* Location of U-Boot environment for BeagleBone Black
@ 2015-04-23  7:10 Craig McQueen
  2015-04-24 13:29 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Craig McQueen @ 2015-04-23  7:10 UTC (permalink / raw)
  To: yocto

I'm building Yocto for BeagleBone using the meta-ti layer and the kernel and U-Boot provided by that layer.

I'm having some trouble understanding the location where U-Boot saves its environment for BeagleBone Black.

After doing some reading, it looks as though it might be saving environment on a "special" eMMC boot partition (which is not the same as the FAT16 partition 1 I created to store MLO and u-boot.img).

However, this is only when booting from the on-board eMMC I think. When booting from SD card, where is environment stored? I can do "saveenv" command in U-Boot, and it says it's saving it to MMC.

U-Boot# saveenv
Saving Environment to MMC...
Writing to MMC(1)... done

But then after a reboot, it says:

MMC: block number 0x100 exceeds max(0x0)
MMC: block number 0x200 exceeds max(0x0)
*** Error - No Valid Environment Area found
Using default environment

So does that mean that U-Boot can't use a saved environment when booting from SD card?

Actually, based on some simple testing, it seems that it _is_ writing to the boot partition of the on-board eMMC, and loading it when it reboots from SD card, despite the error message. This is confusing.

What about the case of a board with no eMMC, such as BeagleBone White? Where would it save environment then?

How can I erase the saved environment when booting from eMMC, to ensure that U-Boot defaults will be used? I see that when Linux boots, there are block devices /dev/mmcblk0boot0 and /dev/mmcblk0boot1. But it seems I can't write to them:

# dd if=/dev/zero of=/dev/mmcblk0boot1 bs=1k count=1k
dd: writing '/dev/mmcblk0boot1': Operation not permitted
1+0 records in
0+0 records out

-- 
Craig McQueen



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

* Re: Location of U-Boot environment for BeagleBone Black
  2015-04-23  7:10 Location of U-Boot environment for BeagleBone Black Craig McQueen
@ 2015-04-24 13:29 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2015-04-24 13:29 UTC (permalink / raw)
  To: Craig McQueen; +Cc: yocto

On Thu, Apr 23, 2015 at 05:10:21PM +1000, Craig McQueen wrote:
> I'm building Yocto for BeagleBone using the meta-ti layer and the kernel and U-Boot provided by that layer.
> 
> I'm having some trouble understanding the location where U-Boot saves its environment for BeagleBone Black.
> 
> After doing some reading, it looks as though it might be saving environment on a "special" eMMC boot partition (which is not the same as the FAT16 partition 1 I created to store MLO and u-boot.img).
> 
> However, this is only when booting from the on-board eMMC I think. When booting from SD card, where is environment stored? I can do "saveenv" command in U-Boot, and it says it's saving it to MMC.
> 
> U-Boot# saveenv
> Saving Environment to MMC...
> Writing to MMC(1)... done
> 
> But then after a reboot, it says:
> 
> MMC: block number 0x100 exceeds max(0x0)
> MMC: block number 0x200 exceeds max(0x0)
> *** Error - No Valid Environment Area found
> Using default environment
> 
> So does that mean that U-Boot can't use a saved environment when booting from SD card?
> 
> Actually, based on some simple testing, it seems that it _is_ writing to the boot partition of the on-board eMMC, and loading it when it reboots from SD card, despite the error message. This is confusing.

First, please post the whole boot log, not just part.  That will make it
easier to explain what is going on I believe.

> What about the case of a board with no eMMC, such as BeagleBone White? Where would it save environment then?

There's a number of different places that env could be stored.  I forget
if meta-ti is patching things such that it saves to a file on the FAT
partition for example.

> How can I erase the saved environment when booting from eMMC, to ensure that U-Boot defaults will be used? I see that when Linux boots, there are block devices /dev/mmcblk0boot0 and /dev/mmcblk0boot1. But it seems I can't write to them:
> 
> # dd if=/dev/zero of=/dev/mmcblk0boot1 bs=1k count=1k
> dd: writing '/dev/mmcblk0boot1': Operation not permitted
> 1+0 records in
> 0+0 records out

In Linux you need to unlock these first.  Google should point out the
file you need to write to.

-- 
Tom


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

end of thread, other threads:[~2015-04-24 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-23  7:10 Location of U-Boot environment for BeagleBone Black Craig McQueen
2015-04-24 13:29 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.