obsolete - Configuring, Building, and Loading Linux on a Virtex Board

Related Links

Several other projects have successfully run Linux on Virtex boards before. Most of these designs used arch/ppc of the kernel which is now being deprecated. For detailed instructions related to these separate projects, see these related links:

[http://splish.ee.byu.edu/projects/LinuxFPGA/configuring.htm]

[http://www.klingauf.de/v2p/index.phtml]

[http://www.crhc.uiuc.edu/IMPACT/gsrc/hardwarelab/docs/kernel-HOWTO.html#toc1]

However, as the purpose of this wiki is to support the open source Xilinx Linux Kernel for many different types of users, it is necessary to use these only as a reference and to build a more superior and general reference here on this site.

Kernel Documentation

  • The first place to look is always in the Documentation directory of the kernel tree. The documentation is sort of random but can be very helpful.
  • More kernel documentation can be generated using an automated doc system built into the kernel.
    • The following command will cause some html docs to be generated in the Documentation/DocBook directory of the kernel tree.
    • make ARCH=powerpc htmldocs

Outline

A simple minded outline of the Virtex Linux Project goes as follows:

1) Get the MLD, gen-mhs-devtree, from the Xilinx Git tree repository using Git or the snapshot feature from http://git.xilinx.com
2) Setup the Xilinx EDK to use the MLD to generate the device tree
3) Generate a device tree (dts) file from the Xilinx EDK
4) Copy .dts to linux-2.6-xlnx/arch/powerpc/boot/dts
5) Configure the kernel
6) Build the kernel
7) Load and run the kernel

Generating a Device Tree

The Linux kernel from the git tree has device tree files, ml507.dts and ml405.dts, in the arch/powerpc/boot/dts directory which are designed to work with the hardware reference designs available from this site. Users who have a Xilinx board, ML405 or ML507, should build the Linux kernel using the provided dts file to get a solid baseline before generating a new device tree file. After a baseline is established, the new dts files can be compared to the existing to verify any differences.

The page, Generating A Device Tree, has details on how to generate a device tree for the arch/powerpc Linux kernel.

Setting Up the Build Environment

Set environment variable CROSS_COMPILE to point to the correct cross compiler (consider the DENX ELDK).

Update the path to allow access to the binaries for the tools you are using.

It's best to specify ARCH=powerpc on the command line to prevent problems, although some setup an environment variable for it.

Configuring the Kernel

The easiest way to get a kernel configuration that's close is to use the provided default configuration for the boards provided by Xilinx.

make ARCH=powerpc ml405_defconfig

or

make ARCH=powerpc ml507_defconfig

Console UART Selection

The 16550 UART is the default UART in the kernel configuration. If you want to use the UART Lite, you need to enable the driver and the console for it. The device tree also should be modified to specify 'console=ttyUL0' in '/chosen/bootargs'.

The LL TEMAC and I2C drivers are enabled in the default kernel configurations for the boards.

Static Device Tree Selection

To use a device tree file other than the default, set 'kernel options -> Static device tree' to the desired device tree file which must be located in the arch/powerpc/boot/dts directory. By default, the kernel configurations for each board are setup to use ml405.dts or ml507.dts.

Building the Linux Kernel

The following command creates zImage, an elf file without an elf extension, in the arch/powerpc/boot directory. It will also geneate zImage.virtex. Both files can be downloaded or used to generate a systemace image with.

make ARCH=powerpc zImage

Loading and Running the Kernel onto the Board

Start XMD from the Linux kernel root directory.

XMD For the ML405 board

XMD% connect ppc hw -debugdevice deviceNr 3 cpunr 1

XMD For the ML507 board

XMD% connect ppc hw -debugdevice deviceNr 5 cpunr 1

Run the kernel

XMD% dow arch/powerpc/boot/zImage
XMD% run

There should be kernel console output on the serial port at 9600 baud.

Debugging Kernel Boot Problems

See the page Debugging Kernel Boot Problems for more details.

ACE files

This TCL script, genace.tcl, included in the Xilinx EDK, is used to take a bitstream (system.bit) and an elf file (zImage.virtex) to create a SysAce file (*.ace) that you can use to program and boot the Virtex board using compact flash.

See Xilinx EDK documentation on how to use this script.

page_revision: 25, last_edited: 1254167884|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License