building (and modifying) u-boot: vanilla u-boot will not load uImage

I’m probably missing something very simple here, but I’m not sure what is going on so I thought I would see if anyone would be able to help.

I am building u-boot from the source, because I need to trim about 4+ seconds or so out of u-boot. With the u-boot.img that you download from the http://angstrom-distribution.org/demo/beaglebone site, it takes about 7-8 seconds before the kernel is loaded. Waaaayyy to long for my application, so I need to start ripping things out. However, when I build the vanilla version with no modifications, I get the output below. There are no errors, but uImage is never loaded. I then tried Robert C. Nelson’s approach by applying his patch and using zImage and modifying the uEnv.txt file the way he suggested. Still did not work. This time however, I did get an error about “unable to read file zImage”.

I currently am not doing anything special with the uEnv.txt file - it only contains optargs=quiet. I tried what was suggested in beaglebone 3.8 kernel page (https://github.com/beagleboard/kernel/tree/3.8), but no luck there either.

Is there something I am missing or doing wrong? (by the way, I’m booting from the uSD card)

U-Boot SPL 2013.04-dirty (May 29 2013 - 10:52:39)
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img

U-Boot 2013.04-dirty (May 29 2013 - 10:52:39)
I2C: ready
DRAM: 512 MiB
WARNING: Caches not enabled
NAND: No NAND device found!!!
0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
Net: not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot: 0
gpio: pin 53 (gpio 53) value is 1
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 0
reading uEnv.txt
15 bytes read in 3 ms (4.9 KiB/s)
Importing environment from mmc …
gpio: pin 55 (gpio 55) value is 1
mmc1(part 0) is current device
mmc_send_cmd : timeout: No status update
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 1
reading uEnv.txt
14 bytes read in 3 ms (3.9 KiB/s)
Importing environment from mmc …
gpio: pin 55 (gpio 55) value is 1
U-Boot#

I'm probably missing something very simple here, but I'm not sure what is
going on so I thought I would see if anyone would be able to help.

I am building u-boot from the source, because I need to trim about 4+
seconds or so out of u-boot. With the u-boot.img that you download from the
http://angstrom-distribution.org/demo/beaglebone site, it takes about 7-8
seconds before the kernel is loaded. Waaaayyy to long for my application,
so I need to start ripping things out. However, when I build the vanilla
version with no modifications, I get the output below. There are no errors,
but uImage is never loaded. I then tried Robert C. Nelson's approach by
applying his patch and using zImage and modifying the uEnv.txt file the way
he suggested. Still did not work. This time however, I did get an error
about "unable to read file zImage".

Yeah, my patch relies on things in the uEnv.txt file (uenvcmd=xyz(aka
something) or it halts).. I've gone the, well i support a lot of
boards, lets try to make all the bootloaders generic approach. :wink:

I currently am not doing anything special with the uEnv.txt file - it only
contains optargs=quiet. I tried what was suggested in beaglebone 3.8 kernel
page (https://github.com/beagleboard/kernel/tree/3.8), but no luck there
either.

Is there something I am missing or doing wrong? (by the way, I'm booting
from the uSD card)

U-Boot SPL 2013.04-dirty (May 29 2013 - 10:52:39)
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx,
SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx,
SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img

U-Boot 2013.04-dirty (May 29 2013 - 10:52:39)
I2C: ready
DRAM: 512 MiB
WARNING: Caches not enabled
NAND: No NAND device found!!!
0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx,
SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx,
SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
Net: <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot: 0
gpio: pin 53 (gpio 53) value is 1
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 0
reading uEnv.txt
15 bytes read in 3 ms (4.9 KiB/s)
Importing environment from mmc ...

If you want to speed things up, reading uEnv.txt is one spot... Just
hard code your boot settings into u-boot and drop the uEnv.txt
checking.. If you know your "board", there's lots of little checks
you can hardcode and bypass too as the u-boot target supports 5
different ti boards, each with i2c reads and switch statements to
support them all.

gpio: pin 55 (gpio 55) value is 1
mmc1(part 0) is current device
mmc_send_cmd : timeout: No status update
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 1
reading uEnv.txt
14 bytes read in 3 ms (3.9 KiB/s)
Importing environment from mmc ...
gpio: pin 55 (gpio 55) value is 1
U-Boot#

Based on above, I'm just guessing you never defined uenvcmd, as it's
waiting here:
https://github.com/RobertCNelson/Bootloader-Builder/blob/master/patches/v2013.04/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L196

and i have it set to just "lockup" there..

Regards,

I'm probably missing something very simple here, but I'm not sure what is
going on so I thought I would see if anyone would be able to help.

I am building u-boot from the source, because I need to trim about 4+
seconds or so out of u-boot. With the u-boot.img that you download from the
http://angstrom-distribution.org/demo/beaglebone site, it takes about 7-8
seconds before the kernel is loaded. Waaaayyy to long for my application,
so I need to start ripping things out. However, when I build the vanilla
version with no modifications, I get the output below. There are no errors,
but uImage is never loaded. I then tried Robert C. Nelson's approach by
applying his patch and using zImage and modifying the uEnv.txt file the way
he suggested. Still did not work. This time however, I did get an error
about "unable to read file zImage".

Yeah, my patch relies on things in the uEnv.txt file (uenvcmd=xyz(aka
something) or it halts).. I've gone the, well i support a lot of
boards, lets try to make all the bootloaders generic approach. :wink:

I currently am not doing anything special with the uEnv.txt file - it only
contains optargs=quiet. I tried what was suggested in beaglebone 3.8 kernel
page (https://github.com/beagleboard/kernel/tree/3.8), but no luck there
either.

Is there something I am missing or doing wrong? (by the way, I'm booting
from the uSD card)

U-Boot SPL 2013.04-dirty (May 29 2013 - 10:52:39)
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx,
SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx,
SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img

U-Boot 2013.04-dirty (May 29 2013 - 10:52:39)
I2C: ready
DRAM: 512 MiB
WARNING: Caches not enabled
NAND: No NAND device found!!!
0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx,
SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx,
SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
Net: <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot: 0
gpio: pin 53 (gpio 53) value is 1
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 0
reading uEnv.txt
15 bytes read in 3 ms (4.9 KiB/s)
Importing environment from mmc ...

If you want to speed things up, reading uEnv.txt is one spot... Just
hard code your boot settings into u-boot and drop the uEnv.txt
checking.. If you know your "board", there's lots of little checks
you can hardcode and bypass too as the u-boot target supports 5
different ti boards, each with i2c reads and switch statements to
support them all.

gpio: pin 55 (gpio 55) value is 1
mmc1(part 0) is current device
mmc_send_cmd : timeout: No status update
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 1
reading uEnv.txt
14 bytes read in 3 ms (3.9 KiB/s)
Importing environment from mmc ...
gpio: pin 55 (gpio 55) value is 1
U-Boot#

Based on above, I'm just guessing you never defined uenvcmd, as it's
waiting here:
https://github.com/RobertCNelson/Bootloader-Builder/blob/master/patches/v2013.04/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L196

and i have it set to just "lockup" there..

This should help out anyone else who gets stuck here:
https://github.com/RobertCNelson/Bootloader-Builder/commit/41717edcb5d383e171b2dad75e8b53bc80c77ca6

as it would just lock up:

Importing environment from mmc ...
gpio: pin 55 (gpio 55) value is 1
is uenvcmd defined?
U-Boot#

Regards,

Thanks Robert. Right now I’m just trying to get the vanilla u-boot to work for the BBB. I found out that if I use a uSD card, it works just fine. If I copy MLO and u-boot.img to the eMMC, it does not work. (See below)

Hit any key to stop autoboot: 0
mmc_send_cmd : timeout: No status update
Card did not respond to voltage select!
mmc0(part 0) is current device
mmc_send_cmd : timeout: No status update
Card did not respond to voltage select!
Booting from nand …

no devices available
Wrong Image Format for bootm command
ERROR: can’t get kernel image!
U-Boot#

If I use MLO and u-boot.img from the Angstrom/beaglebone page, (http://downloads.angstrom-distribution.org/demo/beaglebone/u-boot-beaglebone-2013.04-r0.img), I get a different result. There seems to be a patch that someone did for u-boot that I do not have. I did a quick search (grep) for the text: “No micro SD card found” but I did not find any results.

Hit any key to stop autoboot: 0
gpio: pin 53 (gpio 53) value is 1
Card did not respond to voltage select!
mmc0(part 0) is current device
mmc_send_cmd : timeout: No status update
Card did not respond to voltage select!
No micro SD card found, setting mmcdev to 1
mmc1(part 0) is current device
mmc_send_cmd : timeout: No status update
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 1
reading uEnv.txt
14 bytes read in 3 ms (3.9 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc …
gpio: pin 55 (gpio 55) value is 1
4206504 bytes read in 725 ms (5.5 MiB/s)
gpio: pin 56 (gpio 56) value is 1
23769 bytes read in 35 ms (663.1 KiB/s)
Booting from mmc …

Booting kernel from Legacy Image at 80007fc0 …

Image Name: Linux-3.8.13-00605-gc8a0632-dirt
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4206440 Bytes = 4 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum … OK

Flattened Device Tree blob at 80f80000

Booting using the fdt blob at 0x80f80000
XIP Kernel Image … OK
OK
Using Device Tree in place at 80f80000, end 80f88cd8

Starting kernel …

What am I missing?

Thanks Robert. Right now I'm just trying to get the vanilla u-boot to work
for the BBB. I found out that if I use a uSD card, it works just fine. If
I copy MLO and u-boot.img to the eMMC, it does not work. (See below)

Hit any key to stop autoboot: 0
mmc_send_cmd : timeout: No status update
Card did not respond to voltage select!
mmc0(part 0) is current device
mmc_send_cmd : timeout: No status update
Card did not respond to voltage select!
Booting from nand ...

no devices available
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot#

Well, it seems obvious, 'vanilla' v2013.04 u-boot will not work out of
the box. :wink: One reason, u-boot was frozen/released before the offical
final beaglebone black's where released..

If I use MLO and u-boot.img from the Angstrom/beaglebone page,
(http://downloads.angstrom-distribution.org/demo/beaglebone/u-boot-beaglebone-2013.04-r0.img),
I get a different result. There seems to be a patch that someone did for
u-boot that I do not have. I did a quick search (grep) for the text: "No
micro SD card found" but I did not find any results.

Patches angstrom uses:
https://github.com/beagleboard/meta-beagleboard/blob/master/common-bsp/recipes-bsp/u-boot/u-boot-denx_2013.04.bb#L17

Hit any key to stop autoboot: 0
gpio: pin 53 (gpio 53) value is 1
Card did not respond to voltage select!
mmc0(part 0) is current device
mmc_send_cmd : timeout: No status update
Card did not respond to voltage select!
No micro SD card found, setting mmcdev to 1
mmc1(part 0) is current device
mmc_send_cmd : timeout: No status update
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 1
reading uEnv.txt
14 bytes read in 3 ms (3.9 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc ...
gpio: pin 55 (gpio 55) value is 1
4206504 bytes read in 725 ms (5.5 MiB/s)
gpio: pin 56 (gpio 56) value is 1
23769 bytes read in 35 ms (663.1 KiB/s)
Booting from mmc ...
## Booting kernel from Legacy Image at 80007fc0 ...
   Image Name: Linux-3.8.13-00605-gc8a0632-dirt
   Image Type: ARM Linux Kernel Image (uncompressed)
   Data Size: 4206440 Bytes = 4 MiB
   Load Address: 80008000
   Entry Point: 80008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 80f80000
   Booting using the fdt blob at 0x80f80000
   XIP Kernel Image ... OK
OK
   Using Device Tree in place at 80f80000, end 80f88cd8

Starting kernel ...

What am I missing?

Regards,

Yep, just found that. It was hiding in plain sight. Looks like there are 20 patches that Koen submitted… I’ll give this a try. Thanks!
https://github.com/beagleboard/meta-beagleboard/tree/master/common-bsp/recipes-bsp/u-boot/u-boot-denx