Re: [yocto] Location of U-Boot environment for BeagleBone Black

2015-04-24 Thread Tom Rini
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
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Location of U-Boot environment for BeagleBone Black

2015-04-23 Thread Craig McQueen
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

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto