PowerPC U-boot

The purpose of this page is to document the u-boot for Xilinx project. Xilinx provides a Git tree which includes u-boot to run on the Xilinx boards. This is a development project as it's not complete yet.

U-boot is now in the public Git tree from Xilinx at git://git.xilinx.com or http://git.xilinx.com. The project repository is u-boot-xlnx. This work is derived from Peter Ryser's Git tree and the work he was doing late in 2007.

The State of the Project

It's working with a polled mode LL TEMAC driver in DMA SG mode and able to tftp a kernel with arch/powerpc. It has worked with arch/ppc kernels but is no longer being tested with it. As of 7/30/08 the ML405 and the ML507 boards are both supported. The network interface currently only works at 100 Mbit.

Tested Hardware and Reference System

The reference design bit stream is the same as used for Open Source Linux for PowerPC as noted on the following page.


There's been a history of u-boot running on many of the Xilinx boards so it should be possible to get other boards working with some work. The ML403 is not directly supported, but is the same board as the ML405 with a smaller FPGA.

People Involved With U-boot/Xilinx Development

Robert Zach of so-logic.net

Ricardo Ribalda of Universidad Autonoma de Madrid, working with Qtechnology

Known Issues

  • The ML405 board is noticably slow when TFTPing a Linux kernel image. It typically takes 14 seconds to download the kernel, but I have seen up to 28 with no known reasons.

Resolved Issues

  • (resolved as of 7/30/08) The build looks up trying to create a huge s-record file such that you need to control-c out of it. A binary image, u-boot, should have been successfully built.
    • thanks to Robert Zach of so-logic.net for the fix
  • (resolved) Additional network testing has shown that the network interface works fine over the corporate network but not well when going point to point with a NIC on a PC. The TFTP server shows resends, maybe it's faster such that packets are being dropped. The TFTP of a kernel image appears to work, but then when it is booted from memory (bootm), u-boot indicates a checksum error on the kernel image.
    • resolution: The NIC on the PC was set up for an MTU size of 1300 bytes which caused IP fragmentation. U-boot does not handle fragmentation. Changing the MTU size on the NIC solved the problem.
  • (resolved as of 8/14/08) The network interface only works at 100 Mbit. Additional PHY processing needs to be added for 10/1000 Mbit rates.

Tasks That Still Need To Be Done

We would be happy to receive patches for any problem correction or to help it progress forward. Please send any patches against the Git tree to moc.xnilix|tig#moc.xnilix|tig.

  • (completed) The ability to pass the emac address to the Linux kernel thru the device tree
  • The ability to configure itself from a device tree (low priority)

Cloning the public U-boot Tree

git clone git://git.xilinx.com/u-boot-xlnx.git

Pushes From The U-boot Development Tree

The page, Pushes From U-boot Development Git Tree, tells a brief history of the changes that have been pushed from the internal development Git tree at Xilinx to the public Git tree.

Details About Xilinx U-boot

  • The Xilinx boards are under board/xilinx directory in the u-boot-xlnx tree.
  • The xparameters.h file in the ml405 and ml507 directories control the addresses of the devices for the drivers in u-boot and the devices that are available to u-boot. This file can be taken from a Xilinx EDK project.

Building and Loading U-boot On A Virtex Board

Building Linux For U-boot

A uImage should be built to work with u-boot. This is a special image with a header that is u-boot specific. This image does not include any device tree blob in it such that the device tree must be downloaded to u-boot and then passed to the kernel.

make ARCH=powerpc uImage

Building A Device Tree Blob

A device tree file, such as ml507.dts or ml405.dts, is compiled using the device tree compiler, dtc, that is in the Linux kernel directory (arch/powerpc/boot). The results is a dtb file that can be downloaded to memory and passed to the Linux kernel. U-boot is designed to be able to alter the device tree as it configures the hardware and finds additional information, such as the mac address from eeprom.

The following command, executed from a Linux kernel root directory, compiles the dts file into a dtb file.

arch/powerpc/boot/dtc -b 0 -V 17 -R 4 -S 0x3000 -I dts -O dtb -o ml507.dtb -f arch/powerpc/boot/dts/virtex440-ml507.dts

If the above does not work (newer kernel versions) the dtc (device-tree compiler) may be located in: scripts/dtc/dtc instead of arch/powerpc/boot/dtc. Thus, the command to compile the dts would be:

scripts/dtc/dtc -b 0 -V 17 -R 4 -S 0x3000 -I dts -O dtb -o ml507.dtb -f arch/powerpc/boot/dts/virtex440-ml507.dts

Building U-boot

Assuming the tools are setup correctly with CROSS_COMPILE.

In the u-boot directory, the following commands will build it based on the desired board.

make ml507_config


make ml405_config

Converting a Ramdisk to be Usable by U-boot (optional)

mkimage -A ppc -O linux -T ramdisk -C gzip -d arch/powerpc/boot/ramdisk.image.gz uramdisk.image.gz

Loading It With XMD For the ML507

XMD% connect ppc hw -debugdevice deviceNr 5 cpunr 1
XMD% dow u-boot
XMD% run

NOTE: The 'connect' command used above assumes that you are targeting either the PPC440 on a ML507. For all other target systems, modify the deviceNr <N> and cpunr <M> values accordingly.

You should get output on a terminal connected to the ML507 at 9600.

Loading It With XMD For the ML405

XMD% connect ppc hw -debugdevice deviceNr 3 cpunr 1
XMD% dow u-boot
XMD% run

You should get output on a terminal connected to the ML405 at 9600.

Loading and Executing a Linux Kernel (arch/powerpc)

Assuming u-boot is running on the ML507, you have a TFTP server running, access to a kernel image that is ready for uboot loading (not a normal kernel image as u-boot requires a special header).

Setup the environment in u-boot to access your FTP server.

=> setenv ipaddr  (or your favorite IP address for testing)
=> setenv serverip (or your favorite TFTP server for testing)

FTP the device tree blob from the FTP server into memory of the ML507.

=> tftp 0x1000000 ml507.dtb

FTP the Linux kernel uImage from the FTP server into memory of the ML507.

=> tftp 0x1C00000 arch/powerpc/boot/uImage

FTP the ram disk image from the FTP server into the memory of the ML507. This step is optional.

=> tftp 0x1800000 uramdisk.image.gz

If not using a ramdisk, boot the Linux kernel passing the addresses of the device tree blob and the kernel image. This assumes no ram disk and the "-" replaces the address of a ramdisk

=> bootm 0x1c00000 - 0x1000000


If using a ramdisk, boot the Linux kernel passing the addresses of the device tree blob, the kernel image, and the ramdisk image.

=> bootm 0x1c00000 0x1800000 0x1000000

The kernel should start running now and can be seen on the terminal.

Saving the Environment

If you have pulled from the GIT tree after 9/8/08, you can save the environment to the I2C epprom on the ML405 and the ML507.

The following command will write the environment to the I2C eeprom so that you don't have to continually setup the environment.

=> saveenv

Outdated Documentation

Prior to 9/8/08, the following command was needed to start u-boot on the ML507.

XMD% rwr dbcr0 0x30000000

Prior to 9/8/08, u-boot didn't pull the MAC address from the board I2C EEPROM.

=> setenv ethaddr 00:00:00:80:80:80    (or your favorite mac address for testing)

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License