Patch to boot over USB cable

I have created a patch for the OMAP3EVM u-boot to create an image for download into OMAP internal RAM (64k). This allows a complete boot to Linux over USB only, without any RS-232 serial cables. The difference between this and Nishanth Menon’s procedures (found here: http://nishanthmenon.blogspot.com/2008/12/towards-creating-beagleboard-nand.html) is simply that the RS232 serial port is not required.

I’m posting this to the Beagle board group, because it appears this is where the activity is, and it should not be hard to port it to the beagle board. If anybody has any input into this, or finds this useful, please share…

Here’s an executive summary of the boot process:

  • Setup OMAP3EVM to boot via USB
  • Start Martin Mueller’s omap3_usbload to download the u-boot.bin image
  • Run a kermit script to talk to the board over /dev/ttyACM0, and download uImage/ramdisk images.
  • bootm
  • Linux boots to the command line.

Also note: this builds off of a u-boot USB dev branch, not mainline u-boot.

The details:

  • Images:

  • omap3_usbload:

  • Download and build omap3_usbload (Nishanth Menon’s pusb should work as well):
    http://groups.google.com/group/beagleboard/browse_thread/thread/2b9e99886bb7a747

  • Note: requires the libusb package.

  • u-boot

  • Get Steve’s Sakoman’s u-boot usb dev branch:

  • See http://elinux.org/U-boot_musb_gadget_support

  • In short (from gitorious):
    git clone git://gitorious.org/u-boot-omap3/mainline.git
    cd mainline
    git checkout --track -b omap3-dev-usb origin/omap3-dev-usb

  • Current latest commit is commit 6c4dabfd6e32eed49624f773fc39140c4b1322b1

  • Apply the attached patch (Note: I’m new to git, and I’ve just attached a “diff -urN” patch. With a little help, I’d be happy to
    upload a proper “git” patch). For example:

  • cd mainline

  • patch -p1 < …/u-boot-omap3evm-usb-boot.patch

  • Build u-boot:
    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- omap3_evm_config
    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

  • You now have a downloadable u-boot.bin. Copy it to u-boot2.bin to avoid confusion. I’ll use that name in the script later.

  • Kermit

  • Download CKermit with your favorite package manager.

  • Also you’ll need the attached kermrc script. It was created from: http://www.denx.de/wiki/DULG/SystemSetup, section 4.3,
    with the notable exception about send/recv buffers (see notes at end of this email).

  • uImage

  • You’ll need the default OMAP3EVM Linux image, but you’ll have to rebuild it and make one change:

  • Remove defines for the ethernet driver. If you include it, the driver will crash on boot because this u-boot does not
    initialize the Ethernet core. The applicable configs are:

CONFIG_MII is not set

CONFIG_SMSC911X_OMAP3EVM is not set

  • ramdisk:

  • For my example below, I convert the ramdisk to uboot format. To do this:
    mkimage -n ‘uboot ext2 ramdisk rootfs’ -A arm -O linux -T ramdisk -C gzip -d
    ~/OMAP35x_SDK_1.0.2/ramdisk-min.gz ramdisk.ext2.gz.uboot

  • OMAP3EVM Board setup:

  • The jumpers need to be set for USB boot. For my board, I’ve set it to boot USB boot first, MMC boot second, which is:
    SW4 (1-8): ON OFF OFF ON ON OFF OFF OFF

  • Connect the USB cable to your Linux host

  • Connect a serial cable to see the Linux console (not required, but recommened for first time at least).

  • On the host:

  • Given the attached scripts and the above built binaries, run:
    ./usbload

  • usbload/kermrc scripts currently have the image names embedded in them. They should all be in the current dir.

  • Output you should see on host:
    bri@bri-desktop:~/tmp/Beagle/omap3_usb/host$ ./usbload

TI OMAP3 USB boot ROM tool, version 0.1
© 2008 Martin Mueller <martinmm@pfump.org>

found device!
download ok
Loading Linux image…
Done Loading Linux image.
Loading RamDisk image…
Done Loading RamDisk image.
Booting Linux… Check serial console for more messages.

In addition, you will see the kermit download manager in the terminal in full screen.

  • Notes:
  • The memory map on the target is:
    0x40200000 Internal RAM start. Max top of stack
    0x40201000 Top of stack, start of code/data/bss
    0x4020F000 Reserved for ROM boot code.
  • The u-boot image created is VERY tight in memory. We have 60k to use, and the image is within 256 bytes of the max.
    Be aware of this if/when porting to the beagle board. Most of the changes in the patch were to reduce the code size.
  • kermit download over /dev/ttyACM0 will not work if the send/receive buffers are greater than 128 or so. They have been
    set to 128 in kermrc.
  • omap3_usbload must be run as root, as libusb seems to require it. The usbload script uses sudo to do this.

Hope this is useful to someone. If I’ve missed anything, just ask…

Thanks for all the community support!

u-boot-omap3evm-usb-boot.patch (12.2 KB)

kermrc (677 Bytes)

usbboot (109 Bytes)

Brian Silverman said the following on 06/23/2009 03:46 AM:

I have created a patch for the OMAP3EVM u-boot to create an image for
download into OMAP internal RAM (64k). This allows a complete boot to
Linux over USB only, without any RS-232 serial cables. The difference
between this and Nishanth Menon's procedures (found
here: Nishanth' tech rambles: Towards creating a beagleboard NAND recovery script)
is simply that the RS232 serial port is not required.

Finally!!! Cool.. thanks.

I'm posting this to the Beagle board group, because it appears this is
where the activity is, and it should not be hard to port it to the
beagle board. If anybody has any input into this, or finds this
useful, please share...

could you post the required changes on u-boot mailing list? it will be
pretty interesting there. :slight_smile:

- On the host:
    - Given the attached scripts and the above built binaries, run:
        ./usbload
    - usbload/kermrc scripts currently have the image names embedded
in them. They should all be in the current dir.

you can use omap-u-boot-utils -> ucmd and ukermit also if you like
(along with pusb) just use /dev/ttyACM0 instead of /dev/ttyUSB0 ;)..

Regards,
Nishanth Menon

Nishanth Menon wrote:

Brian Silverman said the following on 06/23/2009 03:46 AM:
> I have created a patch for the OMAP3EVM u-boot to create an image for
> download into OMAP internal RAM (64k). This allows a complete boot to
> Linux over USB only, without any RS-232 serial cables. The difference
> between this and Nishanth Menon's procedures (found
> here: Nishanth' tech rambles: Towards creating a beagleboard NAND recovery script)
> is simply that the RS232 serial port is not required.
Finally!!! Cool.. thanks.
>
> I'm posting this to the Beagle board group, because it appears this is
> where the activity is, and it should not be hard to port it to the
> beagle board.

Huh -- I need more details on it :slight_smile:

Best,

Dio