Home > arm, canonical, linaro, panda, u-boot, ubuntu > Net booting with TFTP and PXE with Pandaboard

Net booting with TFTP and PXE with Pandaboard

Over the past month I’ve being working with John Rigby to integrate the SMSC95XX and OMAP4 EHCI patches into Linaro U-Boot, so we could deliver the network booting feature for people using Pandaboards.

Those patches are published at the U-Boot mailing list, but still as a working in progress. While we work helping the original developers to get the patches accepted upstream, we also want to deliver the functionality for our users, so all those patches are now integrated at the Linaro U-Boot tree.

You can check the patches by going at http://git.linaro.org/gitweb?p=boot/u-boot-linaro-stable.git;a=shortlog.

Testing with Pandaboard

To make it work properly, besides using Linaro U-Boot you’ll also need to use the upstream X-Loader tree, with one additional patch that’s not yet merged. You can clone the upstream tree from http://gitorious.org/x-loader/x-loader, then just apply the patch http://people.canonical.com/~rsalveti/pxe/0001-omap4-pandaboard-ehci-fref_clkout-per-board-revision.patch and build for the Pandaboard target.

If you just want to test without building your own X-Loader and U-Boot, you can just grab both files from  http://people.canonical.com/~rsalveti:

Building your TFTP + DHCP server for PXE

To build your TFTP + DCHP server just follow the instructions described at https://help.ubuntu.com/community/Desktop/PXE. Don’t worry about the ‘filename “pxelinux.0″;’ line at the dhcpd.conf file, you can remove it.

Then just create your PXE config file at the right place:

$ cat /tftpboot/pxelinux.cfg/0A2A2B0A
default panda-natty
prompt 0
timeout 3

label panda-natty
kernel panda/uImage
append console=ttyO2,115200n8 root=/dev/mmcblk0p2 ro fixrtc vram=48M omapfb.vram=0:24M mem=1G@0×80000000 text earlyprintk=ttyO2
initrd panda/uInitrd

PXE Booting

With the proper X-Loader and U-Boot files in place (at your first SD card partition), and with the TFTP + DHCP server also properly installed, you can just jump and try TFTP/PXE boot.

Stop the U-Boot autoload and call the following commands:

  • setenv pxecfg_ram 0×88000000: location in RAM to load the pxecfg file
  • setenv kernel_ram 0×80000000: location in RAM to load the kernel
  • setenv initrd_ram 0×81600000: location in RAM to load the initrd
  • setenv autoload no: disable autoload while calling bootp (so you can just set up your network without autoboot)
  • usb start: start USB and enables the SMSC95xx ethernet interface
  • bootp: initialize the network, probing the ip address settings from your DHCP server
  • pxecfg get: probe the pxecfg config file
  • pxecfg boot: boot :-)

You should get a similar output as:

Texas Instruments X-Loader 1.5.0 (Jul 11 2011 – 07:52:49)
Reading boot sector
Loading u-boot.bin from mmc

U-Boot 2011.06 (Jul 11 2011 – 02:49:51)

CPU : OMAP4430
Board: OMAP4 Panda
I2C: ready
DRAM: 1 GiB
MMC: OMAP SD/MMC: 0
Using default environment

In: serial
Out: serial
Err: serial
Net: No ethernet found.
Hit any key to stop autoboot: 0
Panda # setenv pxecfg_ram 0×88000000
Panda # setenv kernel_ram 0×80000000
Panda # setenv initrd_ram 0×81600000
Panda # setenv autoload no
Panda # usb start
(Re)start USB…
USB: Register 1313 NbrPorts 3
USB EHCI 1.00
scanning bus for devices… The request port(2) is not configured
EHCI timed out on TD – token=0x80008c80
The request port(2) is not configured
4 USB Device(s) found
scanning bus for storage devices… 0 Storage Device(s) found
scanning bus for ethernet devices… 1 Ethernet Device(s) found
Panda # bootp
Waiting for Ethernet connection… done.
BOOTP broadcast 1
DHCP client bound to address 10.42.43.10
Panda # pxecfg get
missing environment variable: pxeuuid
missing environment variable: ethaddr
Retreiving file: pxelinux.cfg/0A2A2B0A
Waiting for Ethernet connection… done.
Using sms0 device
TFTP from server 10.42.43.1; our IP address is 10.42.43.10
Filename ‘pxelinux.cfg/0A2A2B0A’.
Load address: 0×88000000
Loading: #
done
Bytes transferred = 239 (ef hex)
Config file found
Panda # pxecfg boot
Hit any key to stop autoboot: 0
Label: panda-natty
kernel: panda/uImage
append: console=ttyO2,115200n8 root=/dev/mmcblk0p2 ro fixrtc vram=48M omapfb.vram=0:24M mem=1G@0×80000000 text earlyprintk=ttyO2
initrd: panda/uInitrd
Retreiving file: panda/uInitrd
Waiting for Ethernet connection… done.
Using sms0 device
TFTP from server 10.42.43.1; our IP address is 10.42.43.10
Filename ‘panda/uInitrd’.
Load address: 0×81600000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
############
done
Bytes transferred = 3982715 (3cc57b hex)
Retreiving file: panda/uImage
Waiting for Ethernet connection… done.
Using sms0 device
TFTP from server 10.42.43.1; our IP address is 10.42.43.10
Filename ‘panda/uImage’.
Load address: 0×80000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#########################
done
Bytes transferred = 4174480 (3fb290 hex)
## Booting kernel from Legacy Image at 80000000 …
Image Name: Ubuntu Kernel
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4174416 Bytes = 4 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum … OK
## Loading init Ramdisk from Legacy Image at 81600000 …
Image Name: Ubuntu Initrd
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 3982651 Bytes = 3.8 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum … OK
Loading Kernel Image … OK
OK

Starting kernel …

Uncompressing Linux… done, booting the kernel.
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu

This should be enough for you to get your Pandaboard booting with PXE. You can also script these commands at your boot.scr file that U-Boot loads automatically from your SD card, so you don’t have to call them by hand every time you reboot your board.

In case it doesn’t work for you, just ping me (rsalveti) at #linaro on freenode :-)

About these ads
  1. July 11, 2011 at 6:29 pm

    Nice tip.

  2. November 1, 2011 at 5:50 am

    Thanks for sharing :D

    I have questions:

    1. Does PXE need H/W support?
    2. Does BeagleBoard xM have H/W feature for PXE?

    Googled on Internet and no obvious comment about whether PXE needs H/W support.

    Best regards,
    Kurt

    • rsalveti
      November 5, 2011 at 1:46 pm

      PXE itself doesn’t need hardware support, but to use it your board should have at least one ethernet device available at your board.

      Beagle xM should support PXE booting with the latest u-boot already, as both the PXE patches and USB support ones were merged upstream already.

      • Anonymous
        November 5, 2011 at 2:20 pm

        Hi rsalveti,

        I see.
        Thanks for your help.

        Kurt

  3. Praveen Mann
    December 11, 2011 at 9:07 pm

    panda u-boot has issues with Ethernet sometimes. It stops with “no Ethernet”, “unable to connect” messages when running a lots of images on panda board. Frequency is 1 in 10 times. Has anyone seen such issues?

  4. January 23, 2012 at 7:24 pm

    Thanks very much for sharing this. I can confirm it works nicely, however if anyone’s been copying and pasting the set env commands and is now banging their head hard against the desk because the PXE config is getting loaded to 0×0, then it’s probably because all is not what it seems; × != x !

  5. Anonymous
    February 9, 2012 at 8:48 am

    Thanks for sharing this

    i have one basic question
    it seems the cfg file fetched by pxe get depends on the IP/MAC/UUID of the board. is there a way to tell the board to fetch a different file. for example if i have 5 equal boards that need to use the same configuration and 5 others that need a different one, how can i set this up ?
    just by adding a file per board ?

  6. mafj
    May 30, 2012 at 7:24 am

    Hi a bit of problem on my side
    I copied the suggested u-boot.bin and MLO files. after ‘usb start’ I can see ethernet device is found. The problem is that on ‘bootp’ the LEDs do not light up at all and I never get dhcp address. The iface and dhcpd work fine as all works well once when I boot Android from SD.

    It looks like my ethernet device or phy does not go up.

    • Pawan
      October 29, 2012 at 4:37 am

      I am also facing the same problem, Please look out my logs

      U-Boot 2012.07-00595-g5fb29f3-dirty (Sep 27 2012 – 10:31:44)

      CPU : OMAP4430 ES2.2
      Board: OMAP4 Panda
      I2C: ready
      DRAM: 1 GiB
      WARNING: Caches not enabled
      MMC: OMAP SD/MMC: 0
      Using default environment

      In: serial
      Out: serial
      Err: serial
      Net: No ethernet found.
      Hit any key to stop autoboot: 0
      Panda # setenv serverip 10.2.16.152
      Panda # setenv ipaddr 10.2.16.135
      Panda # setenv gateway 10.2.16.1
      Panda # setenv netmask 255.255.252.0
      Panda # setenv pxecfg_ram 0×88000000
      Panda # setenv kernel_ram 0×80000000
      Panda # setenv initrd_ram 0×81600000
      Panda # setenv autoload no
      Panda # setenv usbethaddr 0a:40:15:93:3b:0a
      Panda # usb start
      (Re)start USB…
      USB: Register 1313 NbrPorts 3
      USB EHCI 1.00
      scanning bus for devices… 3 USB Device(s) found
      scanning bus for storage devices… 0 Storage Device(s) found
      scanning bus for ethernet devices… 1 Ethernet Device(s) found
      Panda # bootp
      Waiting for Ethernet connection… done.
      BOOTP broadcast 1
      EHCI timed out on TD – token=0x8008d80
      BOOTP broadcast 2
      EHCI timed out on TD – token=0x8008d80
      BOOTP broadcast 3
      EHCI timed out on TD – token=0x8008d80

  7. brajesh
    September 23, 2013 at 5:57 am

    when it loads my uInitrd it is givving error wrong image format pls suggest which image should i use for uInitrd i have tried cpio and tar both .

  8. June 9, 2014 at 4:02 am

    Hi,

    I have setup nfs server on my host machine and I tested that the tftp server is working fine.
    And I have setup a static ip for my panda board and I am ping’ing the board’s ip from host machine. It keeps on showing “Host Unreachable” and when the board starts booing, it starts showing the correct message.

    The uInitrd and uImage file gets loaded from the nfs server.
    But, the last message I get on the console is:
    Starting kernel …

    After that, the process stops and no other message is presented and also it doesn’t drop to the prompt!
    I must have seen “Uncompressing Linux… done, booting the kernel” message.
    But, that is not coming!!

    Any idea, what could be wrong and how to resolve this issue?

  9. July 25, 2014 at 11:28 am

    Before starting to lower limits for customers in response to your marketing,
    link vao m88 bang dt response that gets the game.
    The Midwest link vao m88 bang dt could be doing or continue doing
    is pay all bills on time and therefore have a snazzy ad or fun promotions, but is there to be continually rising.
    The Atlanta Symphony Orchestra, the atmosphere generated by his effort and willingness to work as a collection agency.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: