Skip to contentSkip to conversation

BBB + uboot 2014.07 - not booting

PATCH In review Maciej Borzecki 6 participants 17 messages Aug 19, 2014 – Sep 3, 2014 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

Hi all,

There seems to be a problem booting BBB from SD card with uboot 2014.07 from meta-ti, 2013.07 from yocto seems to work.
The card is partitioned as follows:

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 22527 10240 c W95 FAT32 (LBA)
/dev/mmcblk0p2 22528 227327 102400 83 Linux

I've already tried different cards.

This is all I get on the serial console:

U-Boot SPL 2014.07 (Aug 19 2014 - 10:45:01)
MMC: block number 0x100 exceeds max(0x0)
MMC: block number 0x200 exceeds max(0x0)
*** Error - No Valid Environment Area found
Using default environment

MMC: block number 0x1 exceeds max(0x0)
** Can't read partition table on 0:0 **
** Partition 1 not valid on device 0 **
spl_register_fat_device: fat register err - -1
### ERROR ### Please RESET the board ###

Signature · 18 lines
Maciej Borzęcki 
Senior Software Engineer Open-RnD Sp. z o.o. 
www.open-rnd.pl, Facebook, Twitter 
mobile: +48 telefon, fax: +48 42 657 9079 

Niniejsza wiadomość wraz z załącznikami może zawierać chronione prawem lub 
poufne informacje i została wysłana wyłącznie do wiadomości i użytku osób, do 
których została zaadresowana. Jeśli wiadomość została otrzymana przypadkowo 
zabrania się jej kopiowania lub rozsyłania do osób trzecich. W takim przypadku 
uprasza się o natychmiastowe zniszczenie wiadomości oraz poinformowanie 
nadawcy o zaistniałej sytuacji za pomocą wiadomości zwrotnej. Dziękujemy. 

This message, including any attachments hereto, may contain privileged or 
confidential information and is sent solely for the attention and use of the 
intended addressee(s). If you are not an intended addressee, you may neither 
use this message nor copy or deliver it to anyone. In such case, you should 
immediately destroy this message and kindly notify the sender by reply email. 
Thank you.
#1 lore raw

Maciej,

Quoted 21 lines · Maciej Borzecki

Hi all,

There seems to be a problem booting BBB from SD card with uboot 2014.07 from
meta-ti, 2013.07 from yocto seems to work.
The card is partitioned as follows:

Device         Boot     Start       End Blocks  Id System
/dev/mmcblk0p1 *         2048     22527 10240   c W95 FAT32 (LBA)
/dev/mmcblk0p2          22528    227327 102400  83 Linux

I've already tried different cards.

This is all I get on the serial console:

U-Boot SPL 2014.07 (Aug 19 2014 - 10:45:01)
MMC: block number 0x100 exceeds max(0x0)
MMC: block number 0x200 exceeds max(0x0)
*** Error - No Valid Environment Area found
Using default environment

Quoted 8 lines

MMC: block number 0x1 exceeds max(0x0)
** Can't read partition table on 0:0 **
** Partition 1 not valid on device 0 **
spl_register_fat_device: fat register err - -1
### ERROR ### Please RESET the board ###

--

I don't have this issue on SD card, bug I'm facing with another error when MLO is installed on eMMC. This is my error message:

U-Boot SPL 2014.07 (Aug 13 2014 - 08:23:53)
omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
spl: mmc init failed: err - -19
### ERROR ### Please RESET the board ###

Anyone have tested the MLO on eMMC?

Regards,

--
*dS
Diego Sueiro

Administrador do Embarcados
www.embarcados.com.br
<http://www.embarcados.com.br/?utm_source=assinatura_diego&utm_medium=e-mail&utm_campaign=Assinatura%20Email%20Diego>

/*long live rock 'n roll*/

#2 lore raw
Quoted 11 lines · Diego Sueiro

I don't have this issue on SD card, bug I'm facing with another error when MLO is installed on eMMC. This is my error message:

U-Boot SPL 2014.07 (Aug 13 2014 - 08:23:53)
omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
spl: mmc init failed: err - -19
### ERROR ### Please RESET the board ###

Anyone have tested the MLO on eMMC?

I did some tests using yocto and meta-ti on daisy branch (beaglebone black) using u-boot_2014.07.bb (upstream) and u-boot-ti-staging_2014.07.bb recipes. And the results:

- u-boot_2014.07: MLO works on SDcard and eMMC(2GB)
- u-boot-ti-staging: MLO works on eMMC(2GB), but fails on SDcard

I did not tracked the differences yet.

Could someone test the MLO on eMMC for u-boot-ti-staging(v2014.07)?

Regards,

--
*dS
Diego Sueiro

Administrador do Embarcados
www.embarcados.com.br
<http://www.embarcados.com.br/?utm_source=assinatura_diego&utm_medium=e-mail&utm_campaign=Assinatura%20Email%20Diego>

/*long live rock 'n roll*/

#3 lore raw

From: [email protected] [mailto:[email protected]] On Behalf Of Diego Sueiro
Sent: Tuesday, August 19, 2014 3:00 PM
To: Maciej Borzecki
Cc: meta-ti mailing list
Subject: Re: [meta-ti] BBB + uboot 2014.07 - not booting

On Tue, Aug 19, 2014 at 11:39 AM, Diego Sueiro <[email protected]<mailto:[email protected]>> wrote:

I don't have this issue on SD card, bug I'm facing with another error when MLO is installed on eMMC. This is my error message:
U-Boot SPL 2014.07 (Aug 13 2014 - 08:23:53)
omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
spl: mmc init failed: err - -19
### ERROR ### Please RESET the board ###

Anyone have tested the MLO on eMMC?

I did some tests using yocto and meta-ti on daisy branch (beaglebone black) using u-boot_2014.07.bb<http://u-boot_2014.07.bb> (upstream) and u-boot-ti-staging_2014.07.bb<http://u-boot-ti-staging_2014.07.bb> recipes. And the results:

* u-boot_2014.07: MLO works on SDcard and eMMC(2GB)
* u-boot-ti-staging: MLO works on eMMC(2GB), but fails on SDcard
I did not tracked the differences yet.

Could someone test the MLO on eMMC for u-boot-ti-staging(v2014.07)?
[Franklin] I just booted up the board and it worked fine for me on the SD Card. I am however using a slightly newer commit "8bd803d2c552f5f85a79b4bfed7b322fbaf89e27" which is the latest commit on that branch.

Give that one a shot and see if it works for you.

Regards,

--
*dS
Diego Sueiro

Administrador do Embarcados www.embarcados.com.br<http://www.embarcados.com.br/?utm_source=assinatura_diego&utm_medium=e-mail&utm_campaign=Assinatura%20Email%20Diego>

/*long live rock 'n roll*/

#4 lore raw
In reply to Maciej Borzecki

I am seeing the same behavior with an SD card with u-boot from current meta-ti master (MLO-beaglebone-2014.07-r1+gitrAUTOINC+8bd803d2c5)

I partition the cards and create the boot/root partitions with:

sudo dd if=/dev/zero of=${MMC} bs=1024 count=1024
( echo ,9,0x0C,* ; echo ,,,- ) \
| sudo sfdisk -D -H 255 -S 63 ${MMC}

${SUDO} mkfs.vfat -F 16 -n boot ${MMC}1
${SUDO} mkfs -t ${FSTYPE} -L rootfs ${MMC}2

${SUDO} cp -p MLO u-boot.img ${MPROOT}/boot

This process works with poky master and yocto-bsp on beaglebone.

I recall from long ago that some TI systems were picky about the partitioning of the boot media. Would somebody with an SD card image that boots the current meta-ti master provide the output of fdisk -lu from it, or a pointer to instructions for doing the formatting? For reference, what doesn't work is:

llc[325]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 7892 MB, 7892631552 bytes
255 heads, 63 sectors/track, 959 cylinders, total 15415296 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1   *          63      144584       72261    c  W95 FAT32 (LBA)
/dev/sdh2          144585    15406334     7630875   83  Linux

Thanks.

Peter

Quoted 26 lines · Maciej Borzecki

Hi all,

There seems to be a problem booting BBB from SD card with uboot 2014.07 from meta-ti, 2013.07 from yocto seems to work.
The card is partitioned as follows:

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 22527 10240 c W95 FAT32 (LBA)
/dev/mmcblk0p2 22528 227327 102400 83 Linux

I've already tried different cards.

This is all I get on the serial console:

U-Boot SPL 2014.07 (Aug 19 2014 - 10:45:01)
MMC: block number 0x100 exceeds max(0x0)
MMC: block number 0x200 exceeds max(0x0)
*** Error - No Valid Environment Area found
Using default environment

MMC: block number 0x1 exceeds max(0x0)
** Can't read partition table on 0:0 **
** Partition 1 not valid on device 0 **
spl_register_fat_device: fat register err - -1
### ERROR ### Please RESET the board ###

#5 lore raw

Peter,

Quoted 12 lines · Peter A. Bigot

I am seeing the same behavior with an SD card with u-boot from current meta-ti master (MLO-beaglebone-2014.07-r1+gitrAUTOINC+8bd803d2c5)

I partition the cards and create the boot/root partitions with:

sudo dd if=/dev/zero of=${MMC} bs=1024 count=1024
( echo ,9,0x0C,* ; echo ,,,- ) \
| sudo sfdisk -D -H 255 -S 63 ${MMC}

${SUDO} mkfs.vfat -F 16 -n boot ${MMC}1
${SUDO} mkfs -t ${FSTYPE} -L rootfs ${MMC}2

Quoted 7 lines

${SUDO} cp -p MLO u-boot.img ${MPROOT}/boot

This process works with poky master and yocto-bsp on beaglebone.

I recall from long ago that some TI systems were picky about the partitioning of the boot media.

This is not true for recent Sitara SoCs:
http://permalink.gmane.org/gmane.comp.handhelds.openembedded/64088

Quoted 14 lines

Would somebody with an SD card image that boots the current meta-ti master provide the output of fdisk -lu from it, or a pointer to instructions for doing the formatting? For reference, what doesn't work is:

llc[325]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 7892 MB, 7892631552 bytes
255 heads, 63 sectors/track, 959 cylinders, total 15415296 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Quoted 4 lines
   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1   *          63      144584       72261    c  W95 FAT32 (LBA)
/dev/sdh2          144585    15406334     7630875   83  Linux

I'm using the following partition layout (both working on eMMC and sdcard with u-boot_2014.07.bb):

# fdisk -lu /dev/mmcblk0

Disk /dev/mmcblk0: 1920 MB, 1920991232 bytes, 3751936 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos
Disk identifier: 0x00000000

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *          63       80324       40131    c  W95 FAT32 (LBA)
/dev/mmcblk0p2           80325     1558304      738990   83  Linux
/dev/mmcblk0p3         1558305     3036284      738990   83  Linux
/dev/mmcblk0p4         3036285     3743144      353430    5  Extended
/dev/mmcblk0p5         3036348     3068414       16033+  83  Linux
/dev/mmcblk0p6         3068478     3743144      337333+  83  Linux

With u-boot-ti-staging_2014.07.bb I just can boot from sdcard. I'm using daisy branch, meta-linaro-toolchain with gcc 4.8.

Regards,

--
*dS
Diego Sueiro

Administrador do Embarcados
www.embarcados.com.br
<http://www.embarcados.com.br/?utm_source=assinatura_diego&utm_medium=e-mail&utm_campaign=Assinatura%20Email%20Diego>

/*long live rock 'n roll*/

#6 lore raw
Quoted 52 lines · Diego Sueiro

Peter,

On Mon, Sep 1, 2014 at 6:10 PM, Peter A. Bigot <[email protected] <mailto:[email protected]>> wrote:

    I am seeing the same behavior with an SD card with u-boot from
    current meta-ti master
    (MLO-beaglebone-2014.07-r1+gitrAUTOINC+8bd803d2c5)

    I partition the cards and create the boot/root partitions with:

    sudo dd if=/dev/zero of=${MMC} bs=1024 count=1024
    ( echo ,9,0x0C,* ; echo ,,,- ) \
      | sudo sfdisk -D -H 255 -S 63 ${MMC}

    ${SUDO} mkfs.vfat -F 16 -n boot ${MMC}1
    ${SUDO} mkfs -t ${FSTYPE} -L rootfs ${MMC}2

    ${SUDO} cp -p MLO u-boot.img ${MPROOT}/boot

    This process works with poky master and yocto-bsp on beaglebone.

    I recall from long ago that some TI systems were picky about the
    partitioning of the boot media.

This is not true for recent Sitara SoCs:
http://permalink.gmane.org/gmane.comp.handhelds.openembedded/64088

Would somebody with an SD card image that boots the current meta-ti master provide the output of fdisk -lu from it, or a pointer to instructions for doing the formatting? For reference, what doesn't work is:

llc[325]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 7892 MB, 7892631552 bytes
255 heads, 63 sectors/track, 959 cylinders, total 15415296 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdh1 * 63 144584 72261 c W95 FAT32 (LBA)
/dev/sdh2 144585 15406334 7630875 83 Linux

I'm using the following partition layout (both working on eMMC and sdcard with u-boot_2014.07.bb <http://u-boot_2014.07.bb>):

    # fdisk -lu /dev/mmcblk0
Quoted 11 lines
    Disk /dev/mmcblk0: 1920 MB, 1920991232 bytes, 3751936 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x00000000

            Device Boot      Start     End      Blocks   Id  System
    /dev/mmcblk0p1   *          63   80324       40131    c  W95 FAT32
    (LBA)

Thanks. That does appear to be an eMMC partition, which probably shouldn't matter, but I replicated the configuration on a 2GB class 4 uSD card, and an 8GB class 6, and it doesn't work on either one.

llc[77]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 3965 MB, 3965190144 bytes
255 heads, 63 sectors/track, 482 cylinders, total 7744512 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1   *          63       80324       40131    c  W95 FAT32 (LBA)
/dev/sdh2           80325     7743329     3831502+  83  Linux

Anybody got a uSD partition layout that works? I'm suspecting an issue with the heads/sectors/cylinders configuration.

(FWIW: I'm also using u-boot-staging-ti, as that's the default for beaglebone on the master branch.)

Peter

#7 lore raw
Quoted 84 lines · Peter A. Bigot

On 09/01/2014 04:53 PM, Diego Sueiro wrote:

Peter,

Quoted 13 lines · Peter A. Bigot

I am seeing the same behavior with an SD card with u-boot from current meta-ti master (MLO-beaglebone-2014.07-r1+gitrAUTOINC+8bd803d2c5)

I partition the cards and create the boot/root partitions with:

sudo dd if=/dev/zero of=${MMC} bs=1024 count=1024
( echo ,9,0x0C,* ; echo ,,,- ) \
| sudo sfdisk -D -H 255 -S 63 ${MMC}

${SUDO} mkfs.vfat -F 16 -n boot ${MMC}1
${SUDO} mkfs -t ${FSTYPE} -L rootfs ${MMC}2

Quoted 6 lines

${SUDO} cp -p MLO u-boot.img ${MPROOT}/boot

This process works with poky master and yocto-bsp on beaglebone.

I recall from long ago that some TI systems were picky about the partitioning of the boot media.

This is not true for recent Sitara SoCs:
http://permalink.gmane.org/gmane.comp.handhelds.openembedded/64088

Quoted 15 lines

Would somebody with an SD card image that boots the current meta-ti master provide the output of fdisk -lu from it, or a pointer to instructions for doing the formatting? For reference, what doesn't work is:

llc[325]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 7892 MB, 7892631552 bytes
255 heads, 63 sectors/track, 959 cylinders, total 15415296 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Quoted 3 lines
   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1   *          63      144584       72261    c  W95 FAT32 (LBA)
/dev/sdh2          144585    15406334     7630875   83  Linux

I'm using the following partition layout (both working on eMMC and sdcard with u-boot_2014.07.bb):

# fdisk -lu /dev/mmcblk0

Disk /dev/mmcblk0: 1920 MB, 1920991232 bytes, 3751936 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 63 80324 40131 c W95 FAT32 (LBA)

Thanks. That does appear to be an eMMC partition, which probably shouldn't matter, but I replicated the configuration on a 2GB class 4 uSD card, and an 8GB class 6, and it doesn't work on either one.

llc[77]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 3965 MB, 3965190144 bytes
255 heads, 63 sectors/track, 482 cylinders, total 7744512 sectors

Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1   *          63       80324       40131    c  W95 FAT32 (LBA)
/dev/sdh2           80325     7743329     3831502+  83  Linux
Quoted 5 lines

Anybody got a uSD partition layout that works? I'm suspecting an issue with the heads/sectors/cylinders configuration.

(FWIW: I'm also using u-boot-staging-ti, as that's the default for beaglebone on the master branch.)

You could bypass the whole fat partition (On omap4+ bootrom generations (including the am335x)):

dd if=MLO of=/dev/sdX count=1 seek=1 conv=notrunc bs=128k dd if=u-boot.img of=/dev/sdX count=2 seek=1 conv=notrunc bs=384k

Just make sure to leave a 1mb hole when you create a partition for everything else.

Regards,

Signature · 2 lines
Robert Nelson
http://www.rcn-ee.com/
#8 lore raw
In reply to Peter A. Bigot
Quoted 79 lines · On Monday 01 of September 2014 18:28:14 Peter A. Bigot wrote:
Quoted 53 lines · Diego Sueiro

Peter,

On Mon, Sep 1, 2014 at 6:10 PM, Peter A. Bigot <[email protected]

<mailto:[email protected]>> wrote:

    I am seeing the same behavior with an SD card with u-boot from
    current meta-ti master
    (MLO-beaglebone-2014.07-r1+gitrAUTOINC+8bd803d2c5)
    
    I partition the cards and create the boot/root partitions with:
    
    sudo dd if=/dev/zero of=${MMC} bs=1024 count=1024
    ( echo ,9,0x0C,* ; echo ,,,- ) \
    
      | sudo sfdisk -D -H 255 -S 63 ${MMC}
    
    ${SUDO} mkfs.vfat -F 16 -n boot ${MMC}1
    ${SUDO} mkfs -t ${FSTYPE} -L rootfs ${MMC}2
    
    ${SUDO} cp -p MLO u-boot.img ${MPROOT}/boot
    
    This process works with poky master and yocto-bsp on beaglebone.
    
    I recall from long ago that some TI systems were picky about the
    partitioning of the boot media.

This is not true for recent Sitara SoCs:
http://permalink.gmane.org/gmane.comp.handhelds.openembedded/64088

Would somebody with an SD card image that boots the current meta-ti master provide the output of fdisk -lu from it, or a pointer to instructions for doing the formatting? For reference, what doesn't work is:

llc[325]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 7892 MB, 7892631552 bytes
255 heads, 63 sectors/track, 959 cylinders, total 15415296 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System

/dev/sdh1 * 63 144584 72261 c W95 FAT32 (LBA)
/dev/sdh2 144585 15406334 7630875 83 Linux

I'm using the following partition layout (both working on eMMC and

sdcard with u-boot_2014.07.bb <http://u-boot_2014.07.bb>):

    # fdisk -lu /dev/mmcblk0
Quoted 11 lines
    Disk /dev/mmcblk0: 1920 MB, 1920991232 bytes, 3751936 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x00000000
    
            Device Boot      Start     End      Blocks   Id  System
    
    /dev/mmcblk0p1   *          63   80324       40131    c  W95 FAT32
    (LBA)

Thanks. That does appear to be an eMMC partition, which probably shouldn't matter, but I replicated the configuration on a 2GB class 4 uSD card, and an 8GB class 6, and it doesn't work on either one.

llc[77]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 3965 MB, 3965190144 bytes
255 heads, 63 sectors/track, 482 cylinders, total 7744512 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Quoted 6 lines
    Device Boot      Start         End      Blocks   Id  System
/dev/sdh1   *          63       80324       40131    c  W95 FAT32 (LBA)

/dev/sdh2 80325 7743329 3831502+ 83 Linux

Anybody got a uSD partition layout that works? I'm suspecting an issue with the heads/sectors/cylinders configuration.

Try looking here:
http://article.gmane.org/gmane.linux.embedded.yocto.meta-ti/4371

Although I could not confirm this, it seems that the first partition on SD needs to have an even block count (not sure about eMMC though, but I'm guessing the same rules apply).

Signature · 18 lines
Maciej Borzęcki 
Senior Software Engineer Open-RnD Sp. z o.o. 
www.open-rnd.pl, Facebook, Twitter 
mobile: +48 telefon, fax: +48 42 657 9079 

Niniejsza wiadomość wraz z załącznikami może zawierać chronione prawem lub 
poufne informacje i została wysłana wyłącznie do wiadomości i użytku osób, do 
których została zaadresowana. Jeśli wiadomość została otrzymana przypadkowo 
zabrania się jej kopiowania lub rozsyłania do osób trzecich. W takim przypadku 
uprasza się o natychmiastowe zniszczenie wiadomości oraz poinformowanie 
nadawcy o zaistniałej sytuacji za pomocą wiadomości zwrotnej. Dziękujemy. 

This message, including any attachments hereto, may contain privileged or 
confidential information and is sent solely for the attention and use of the 
intended addressee(s). If you are not an intended addressee, you may neither 
use this message nor copy or deliver it to anyone. In such case, you should 
immediately destroy this message and kindly notify the sender by reply email. 
Thank you.
#9 lore raw
Quoted 83 lines · Maciej Borzecki
Quoted 82 lines · On Monday 01 of September 2014 18:28:14 Peter A. Bigot wrote:
Quoted 53 lines · Diego Sueiro

Peter,

On Mon, Sep 1, 2014 at 6:10 PM, Peter A. Bigot <[email protected]

<mailto:[email protected]>> wrote:

     I am seeing the same behavior with an SD card with u-boot from
     current meta-ti master
     (MLO-beaglebone-2014.07-r1+gitrAUTOINC+8bd803d2c5)
     
     I partition the cards and create the boot/root partitions with:
     
     sudo dd if=/dev/zero of=${MMC} bs=1024 count=1024
     ( echo ,9,0x0C,* ; echo ,,,- ) \
     
       | sudo sfdisk -D -H 255 -S 63 ${MMC}
     
     ${SUDO} mkfs.vfat -F 16 -n boot ${MMC}1
     ${SUDO} mkfs -t ${FSTYPE} -L rootfs ${MMC}2
     
     ${SUDO} cp -p MLO u-boot.img ${MPROOT}/boot
     
     This process works with poky master and yocto-bsp on beaglebone.
     
     I recall from long ago that some TI systems were picky about the
     partitioning of the boot media.

This is not true for recent Sitara SoCs:
http://permalink.gmane.org/gmane.comp.handhelds.openembedded/64088

Would somebody with an SD card image that boots the current meta-ti master provide the output of fdisk -lu from it, or a pointer to instructions for doing the formatting? For reference, what doesn't work is:

llc[325]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 7892 MB, 7892631552 bytes
255 heads, 63 sectors/track, 959 cylinders, total 15415296 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System

/dev/sdh1 * 63 144584 72261 c W95 FAT32 (LBA)
/dev/sdh2 144585 15406334 7630875 83 Linux

I'm using the following partition layout (both working on eMMC and

sdcard with u-boot_2014.07.bb <http://u-boot_2014.07.bb>):

     # fdisk -lu /dev/mmcblk0
Quoted 11 lines
     Disk /dev/mmcblk0: 1920 MB, 1920991232 bytes, 3751936 sectors
     Units = sectors of 1 * 512 = 512 bytes
     Sector size (logical/physical): 512 bytes / 512 bytes
     I/O size (minimum/optimal): 512 bytes / 512 bytes
     Disk label type: dos
     Disk identifier: 0x00000000
     
             Device Boot      Start     End      Blocks   Id  System
     
     /dev/mmcblk0p1   *          63   80324       40131    c  W95 FAT32
     (LBA)

Thanks. That does appear to be an eMMC partition, which probably shouldn't matter, but I replicated the configuration on a 2GB class 4 uSD card, and an 8GB class 6, and it doesn't work on either one.

llc[77]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 3965 MB, 3965190144 bytes
255 heads, 63 sectors/track, 482 cylinders, total 7744512 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdh1 * 63 80324 40131 c W95 FAT32 (LBA)
/dev/sdh2 80325 7743329 3831502+ 83 Linux

Quoted 8 lines
Quoted 2 lines

Anybody got a uSD partition layout that works? I'm suspecting an issue with the heads/sectors/cylinders configuration.

Try looking here:
http://article.gmane.org/gmane.linux.embedded.yocto.meta-ti/4371

Although I could not confirm this, it seems that the first partition on SD needs to have an even block count (not sure about eMMC though, but I'm guessing the same rules apply).

I had seen that, and did try even block counts, which didn't help. Please try applying the u-boot patch I sent to your build and seeing if that fixes the issue for you. The symptoms you described fit it precisely.

It's not obvious whether the problem remains when the upstream changes to u-boot that conflict with it are present, but they're past 2014.07 so it'd be good to get that patch into meta-ti or the TI u-boot branch. I'd push it to OE Core but they're still at 2013.07 which doesn't have this problem. If it also fixes the problems you and Diego are having that's more evidence it's worth adding.

Peter

#10 lore raw
Quoted 93 lines · On Tuesday 02 of September 2014 06:42:11 Peter A. Bigot wrote:
Quoted 92 lines · Maciej Borzecki
Quoted 80 lines · On Monday 01 of September 2014 18:28:14 Peter A. Bigot wrote:
Quoted 54 lines · Diego Sueiro

Peter,

On Mon, Sep 1, 2014 at 6:10 PM, Peter A. Bigot <[email protected]

<mailto:[email protected]>> wrote:

     I am seeing the same behavior with an SD card with u-boot from
     current meta-ti master
     (MLO-beaglebone-2014.07-r1+gitrAUTOINC+8bd803d2c5)
     
     I partition the cards and create the boot/root partitions with:
     
     sudo dd if=/dev/zero of=${MMC} bs=1024 count=1024
     ( echo ,9,0x0C,* ; echo ,,,- ) \
     
       | sudo sfdisk -D -H 255 -S 63 ${MMC}
     
     ${SUDO} mkfs.vfat -F 16 -n boot ${MMC}1
     ${SUDO} mkfs -t ${FSTYPE} -L rootfs ${MMC}2
     
     ${SUDO} cp -p MLO u-boot.img ${MPROOT}/boot
     
     This process works with poky master and yocto-bsp on beaglebone.
     
     I recall from long ago that some TI systems were picky about the
     partitioning of the boot media.

This is not true for recent Sitara SoCs:
http://permalink.gmane.org/gmane.comp.handhelds.openembedded/64088

     Would somebody with an SD card image that boots the current
     meta-ti master provide the output of fdisk -lu from it, or a
     pointer to instructions for doing the formatting?  For reference,
     what doesn't work is:
     
     llc[325]$ sudo fdisk -lu /dev/sdh
     
     Disk /dev/sdh: 7892 MB, 7892631552 bytes
     255 heads, 63 sectors/track, 959 cylinders, total 15415296 sectors
     Units = sectors of 1 * 512 = 512 bytes
     Sector size (logical/physical): 512 bytes / 512 bytes
     I/O size (minimum/optimal): 512 bytes / 512 bytes
     Disk identifier: 0x00000000
     
        Device Boot      Start         End      Blocks  Id  System
     
     /dev/sdh1   *          63      144584       72261    c W95 FAT32
     (LBA)
     /dev/sdh2          144585    15406334     7630875   83 Linux

I'm using the following partition layout (both working on eMMC and

sdcard with u-boot_2014.07.bb <http://u-boot_2014.07.bb>):

     # fdisk -lu /dev/mmcblk0
Quoted 11 lines
     Disk /dev/mmcblk0: 1920 MB, 1920991232 bytes, 3751936 sectors
     Units = sectors of 1 * 512 = 512 bytes
     Sector size (logical/physical): 512 bytes / 512 bytes
     I/O size (minimum/optimal): 512 bytes / 512 bytes
     Disk label type: dos
     Disk identifier: 0x00000000
     
             Device Boot      Start     End      Blocks   Id  System
     
     /dev/mmcblk0p1   *          63   80324       40131    c  W95 FAT32
     (LBA)

Thanks. That does appear to be an eMMC partition, which probably shouldn't matter, but I replicated the configuration on a 2GB class 4 uSD card, and an 8GB class 6, and it doesn't work on either one.

llc[77]$ sudo fdisk -lu /dev/sdh

Disk /dev/sdh: 3965 MB, 3965190144 bytes
255 heads, 63 sectors/track, 482 cylinders, total 7744512 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Quoted 7 lines

Device Boot Start End Blocks Id System

/dev/sdh1 * 63 80324 40131 c W95 FAT32 (LBA)
/dev/sdh2 80325 7743329 3831502+ 83 Linux

Anybody got a uSD partition layout that works? I'm suspecting an issue with the heads/sectors/cylinders configuration.

Try looking here:
http://article.gmane.org/gmane.linux.embedded.yocto.meta-ti/4371

Quoted 7 lines
Quoted 3 lines

Although I could not confirm this, it seems that the first partition on SD needs to have an even block count (not sure about eMMC though, but I'm guessing the same rules apply).

I had seen that, and did try even block counts, which didn't help. Please try applying the u-boot patch I sent to your build and seeing if that fixes the issue for you. The symptoms you described fit it precisely.

The patch works as advertised. I've applied it on uboot-ti 053adddee4c97315059e08d4b3f5ebd264ed295f
Great job, thanks.

Quoted 7 lines

It's not obvious whether the problem remains when the upstream changes to u-boot that conflict with it are present, but they're past 2014.07 so it'd be good to get that patch into meta-ti or the TI u-boot branch. I'd push it to OE Core but they're still at 2013.07 which doesn't have this problem. If it also fixes the problems you and Diego are having that's more evidence it's worth adding.

Signature · 18 lines
Maciej Borzęcki 
Senior Software Engineer Open-RnD Sp. z o.o. 
www.open-rnd.pl, Facebook, Twitter 
mobile: +48 telefon, fax: +48 42 657 9079 

Niniejsza wiadomość wraz z załącznikami może zawierać chronione prawem lub 
poufne informacje i została wysłana wyłącznie do wiadomości i użytku osób, do 
których została zaadresowana. Jeśli wiadomość została otrzymana przypadkowo 
zabrania się jej kopiowania lub rozsyłania do osób trzecich. W takim przypadku 
uprasza się o natychmiastowe zniszczenie wiadomości oraz poinformowanie 
nadawcy o zaistniałej sytuacji za pomocą wiadomości zwrotnej. Dziękujemy. 

This message, including any attachments hereto, may contain privileged or 
confidential information and is sent solely for the attention and use of the 
intended addressee(s). If you are not an intended addressee, you may neither 
use this message nor copy or deliver it to anyone. In such case, you should 
immediately destroy this message and kindly notify the sender by reply email. 
Thank you.
#11 lore raw
In reply to Maciej Borzecki
Quoted 20 lines · Maciej Borzecki

Hi all,

There seems to be a problem booting BBB from SD card with uboot 2014.07 from meta-ti, 2013.07 from yocto seems to work.
The card is partitioned as follows:

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 22527 10240 c W95 FAT32 (LBA)
/dev/mmcblk0p2 22528 227327 102400 83 Linux

I've already tried different cards.

This is all I get on the serial console:

U-Boot SPL 2014.07 (Aug 19 2014 - 10:45:01)
MMC: block number 0x100 exceeds max(0x0)
MMC: block number 0x200 exceeds max(0x0)
*** Error - No Valid Environment Area found
Using default environment

Quoted 5 lines

MMC: block number 0x1 exceeds max(0x0)
** Can't read partition table on 0:0 **
** Partition 1 not valid on device 0 **
spl_register_fat_device: fat register err - -1
### ERROR ### Please RESET the board ###

This is a bug in handling mmc_switch_part: what's happening is that the code reconfigures the mmc device to look at the partition on which the environment is to be found, but fails to restore it to reflect the state of the whole device. I.e., the mmc capacity and lba are zero in my case (I have no partition 2 on the uSD card), but mmc_switch_part() returns -ENODEV on the attempt to switch back in fini_mmc_for_env() without also resetting the capacity to what the rest of the system expects.

I'll follow up here with a patch based on the ti-uboot repository. It conflicts with an upstream patch in u-boot master; I'll let Tom or somebody else sort that out.

Peter

#12 lore raw

PATCH 1/1 mmc: restore capacity when switching to partition 0

The capacity and lba for an MMC device with part_num 0 reflects the whole device. When mmc_switch_part() successfully switches to a partition, the capacity is changed to that partition. As partition 0 does not physically exist, attempts to switch back to the whole device will indicate an error, but should still restore the capacity setting.

---
 drivers/mmc/mmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mmc/mmc.c +4 -3
index b5477b1..b05c6ee 100644
@@ -596,10 +596,11 @@ int mmc_switch_part(int dev_num, unsigned int part_num)
 	ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
 			 (mmc->part_config & ~PART_ACCESS_MASK)
 			 | (part_num & PART_ACCESS_MASK));
-	if (ret)
-		return ret;
 
-	return mmc_set_capacity(mmc, part_num);
+	if ((0 == ret) || ((-ENODEV == ret) && (0 == part_num)))
+		ret = mmc_set_capacity(mmc, part_num);
+
+	return ret;
 }
 
 int mmc_getcd(struct mmc *mmc)
Signature · 1 line
1.8.5.5
#13 lore raw

Re: [ti-uboot][PATCH] mmc: restore capacity when switching to partition 0

Quoted 5 lines · Peter A. Bigot

The capacity and lba for an MMC device with part_num 0 reflects the whole device. When mmc_switch_part() successfully switches to a partition, the capacity is changed to that partition. As partition 0 does not physically exist, attempts to switch back to the whole device will indicate an error, but should still restore the capacity setting.

In other words:

# mmc dev 0:1
...
# mmc dev 0:0

Fails? And the following patch fixes it.

Quoted 11 lines
---
 drivers/mmc/mmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mmc/mmc.c +0 -0
index b5477b1..b05c6ee 100644

drivers/mmc/mmc.c int mmc_switch_part(int dev_num, unsigned int part_num) · line 600

Quoted 8 lines
drivers/mmc/mmc.c +1 -3
@@ -596,10 +596,11 @@ int mmc_switch_part(int dev_num, unsigned int part_num)
 	ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
 			 (mmc->part_config & ~PART_ACCESS_MASK)
 			 | (part_num & PART_ACCESS_MASK));
-	if (ret)
-		return ret;
 
-	return mmc_set_capacity(mmc, part_num);
+	if ((0 == ret) || ((-ENODEV == ret) && (0 == part_num)))

This is backwards from how we usually code things:

if ((ret == 0) || ((ret == -ENODEV) && (part_num == 0)))

And should have a comment above it that's a short summary of the commit message so this doesn't get lost later on.

Quoted 14 lines
drivers/mmc/mmc.c +3 -0
+		ret = mmc_set_capacity(mmc, part_num);
+
+	return ret;
 }
 
 int mmc_getcd(struct mmc *mmc)
Signature · 7 lines
1.8.5.5

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti

And speaking of getting lost, this isn't the U-Boot mailing list so the change would get lost with the next release. Please make sure to post
the next version to the u-boot ML as well and CC Pantelis. Thanks!

Signature · 1 line
Tom
#14 lore raw

Re: [ti-uboot][PATCH] mmc: restore capacity when switching to partition 0

Quoted 7 lines · Tom Rini
Quoted 5 lines · Peter A. Bigot

The capacity and lba for an MMC device with part_num 0 reflects the whole device. When mmc_switch_part() successfully switches to a partition, the capacity is changed to that partition. As partition 0 does not physically exist, attempts to switch back to the whole device will indicate an error, but should still restore the capacity setting.

Quoted 6 lines

In other words:

# mmc dev 0:1
...
# mmc dev 0:0

Fails?

I don't know. This error occurs in SPL mode where there is no command line and only one device. From the companion email:

This is a bug in handling mmc_switch_part: what's happening is that the code reconfigures the mmc device to look at the partition on which the environment is to be found, but fails to restore it to reflect the state of the whole device. I.e., the mmc capacity and lba are zero in my case (I have no partition 2 on the uSD card), but mmc_switch_part() returns -ENODEV on the attempt to switch back in fini_mmc_for_env() without also resetting the capacity to what the rest of the system expects.

Quoted 18 lines

And the following patch fixes it.

Quoted 16 lines
---
  drivers/mmc/mmc.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mmc/mmc.c +0 -2
index b5477b1..b05c6ee 100644
@@ -596,10 +596,11 @@ int mmc_switch_part(int dev_num, unsigned int part_num)
  	ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
  			 (mmc->part_config & ~PART_ACCESS_MASK)
  			 | (part_num & PART_ACCESS_MASK));
-	if (ret)
-		return ret;
 
Quoted 2 lines

drivers/mmc/mmc.c int mmc_switch_part(int dev_num, unsigned int part_num) · line 600

Quoted 2 lines
drivers/mmc/mmc.c +1 -1
-	return mmc_set_capacity(mmc, part_num);
+	if ((0 == ret) || ((-ENODEV == ret) && (0 == part_num)))

Yes. There are several ways to fix it; this is the one with the minimal change from existing behavior. (It is necessary to try the mmc_switch() call even if part_num is zero since that resets some internal driver state.)

Quoted 3 lines

This is backwards from how we usually code things:

if ((ret == 0) || ((ret == -ENODEV) && (part_num == 0)))

OK; I default to yoda conditions since it saves me at least once a year, but can swap things back around. No objection to explicit parenthesization (the GNU folks hate it).

Quoted 2 lines

And should have a comment above it that's a short summary of the commit message so this doesn't get lost later on.

OK.

Quoted 10 lines
Quoted 10 lines
drivers/mmc/mmc.c +3 -0
+		ret = mmc_set_capacity(mmc, part_num);
+
+	return ret;
  }
 
  int mmc_getcd(struct mmc *mmc)
Signature · 1 line
1.8.5.5
Quoted 5 lines
Quoted 5 lines
Signature · 4 lines
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti

If I update this patch, will you see the patch gets into ti-uboot?

Quoted 3 lines

And speaking of getting lost, this isn't the U-Boot mailing list so the change would get lost with the next release. Please make sure to post
the next version to the u-boot ML as well and CC Pantelis. Thanks!

This fix is specific to 2014.07, and may or may not also be influenced by TI-specific patches. AFAICT u-boot doesn't maintain a stable-release patch branch.

I mentioned in deleted material that subsequent changes rework how the environment code manipulates the mmc device so it doesn't apply to u-boot master. There are several such changes that are cumulative, so there's some rework to be done. I'd have to switch over to using u-boot master to see if the problem still remains in the current implementation. At this time that's not in scope for me.

Peter

#15 lore raw

Re: [ti-uboot][PATCH] mmc: restore capacity when switching to partition 0

Quoted 18 lines · Peter A. Bigot
Quoted 7 lines · Tom Rini
Quoted 5 lines · Peter A. Bigot

The capacity and lba for an MMC device with part_num 0 reflects the whole device. When mmc_switch_part() successfully switches to a partition, the capacity is changed to that partition. As partition 0 does not physically exist, attempts to switch back to the whole device will indicate an error, but should still restore the capacity setting.

Quoted 6 lines

In other words:

# mmc dev 0:1
...
# mmc dev 0:0

Fails?

I don't know. This error occurs in SPL mode where there is no command line and only one device. From the companion email:

Quoted 8 lines

This is a bug in handling mmc_switch_part: what's happening is that the code reconfigures the mmc device to look at the partition on which the environment is to be found, but fails to restore it to reflect the state of the whole device. I.e., the mmc capacity and lba are zero in my case (I have no partition 2 on the uSD card), but mmc_switch_part() returns -ENODEV on the attempt to switch back in fini_mmc_for_env() without also resetting the capacity to what the rest of the system expects.

OK.

Quoted 47 lines
Quoted 7 lines

And the following patch fixes it.

Quoted 5 lines
---
 drivers/mmc/mmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
Quoted 12 lines

drivers/mmc/mmc.c int mmc_switch_part(int dev_num, unsigned int part_num) · line 599

Quoted 12 lines
drivers/mmc/mmc.c +1 -3
index b5477b1..b05c6ee 100644
@@ -596,10 +596,11 @@ int mmc_switch_part(int dev_num, unsigned int part_num)
 	ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
 			 (mmc->part_config & ~PART_ACCESS_MASK)
 			 | (part_num & PART_ACCESS_MASK));
-	if (ret)
-		return ret;
-	return mmc_set_capacity(mmc, part_num);
+	if ((0 == ret) || ((-ENODEV == ret) && (0 == part_num)))

Yes. There are several ways to fix it; this is the one with the minimal change from existing behavior. (It is necessary to try the mmc_switch() call even if part_num is zero since that resets some internal driver state.)

Quoted 3 lines

This is backwards from how we usually code things:

if ((ret == 0) || ((ret == -ENODEV) && (part_num == 0)))

OK; I default to yoda conditions since it saves me at least once a year, but can swap things back around. No objection to explicit parenthesization (the GNU folks hate it).

Quoted 2 lines

And should have a comment above it that's a short summary of the commit message so this doesn't get lost later on.

OK.

Quoted 9 lines
Quoted 9 lines
drivers/mmc/mmc.c +3 -0
+		ret = mmc_set_capacity(mmc, part_num);
+
+	return ret;
 }
 int mmc_getcd(struct mmc *mmc)
Signature · 1 line
1.8.5.5
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Signature · 4 lines
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti

If I update this patch, will you see the patch gets into ti-uboot?

This is probably "good enough" for meta-ti, especially if you get it into mainline as it could be in v2014.10.

Quoted 8 lines
Quoted 3 lines

And speaking of getting lost, this isn't the U-Boot mailing list so the change would get lost with the next release. Please make sure to post
the next version to the u-boot ML as well and CC Pantelis. Thanks!

This fix is specific to 2014.07, and may or may not also be influenced by TI-specific patches. AFAICT u-boot doesn't maintain a stable-release patch branch.

Quoted 7 lines

I mentioned in deleted material that subsequent changes rework how the environment code manipulates the mmc device so it doesn't apply to u-boot master. There are several such changes that are cumulative, so there's some rework to be done. I'd have to switch over to using u-boot master to see if the problem still remains in the current implementation. At this time that's not in scope for me.

Well, Pantelis? How does this all look when compared with master?

Signature · 1 line
Tom
#16 lore raw

Re: [ti-uboot][PATCH] mmc: restore capacity when switching to partition 0

Quoted 5 lines · Tom Rini
Quoted 2 lines · Peter A. Bigot

If I update this patch, will you see the patch gets into ti-uboot?

This is probably "good enough" for meta-ti, especially if you get it into mainline as it could be in v2014.10.

If the existing patch is ok for you to put into ti-uboot I won't rework it. Thanks.

I've verified the problem does exist in 2014.10-rc2 and will prepare a patch and submit it upstream.

Peter