Virtex5 PowerPC 440 code was accepted in the Linux kernel mainline. In order for the Xilinx GIT tree to be synced with the kernel mainline, the Linux kernel in the Xilinx public GIT tree went thru some major changes as of 9/2/09 commit date (pushed out 9/8/08).
Users of any kernel version 2.6.27 or later from the Xilinx public GIT tree should use this page.
Xilinx does realize these types of changes are not convenient and not desired, but the precendence was already set in the kernel mainline such that there was a need to follow the precedence.
Major Changes
- For the ML507 board, a new bitstream is needed for the device tree, virtex440-ml507.dts, that is in the GIT tree. The Virtex 5 FXT Development Kit was released by Xilinx and this system is the new reference design for Open Source Linux and u-boot. This system is not available on this wiki site, but is available as a standard reference design from Xilinx at https://secure.xilinx.com/webreg/clickthrough.do?cid=111799. Users are required to have or create a Xilinx user account, but the system is available for free.
- The kernel default configuration files changed names and directories.
- There are now 40x and 44x subdirectories such that the directory has to also be specified when using the files.
- The default configuration files changed names, from ml405_defconfig to virtex4_defconfig, and from ml507_defconfig to virtex5_defconfig, such that they are less specific to the board.
- The device tree static files in the GIT tree changed names such that they are now virtex440-ml507.dts and virtex405-ml405.dts.
- Note that the device tree for the 440 must contain "xlnx,virtex440" and the device tree for 405 must contain "xlnx,virtex405".
- The build procedure changed and is quite different.
- A zImage is no longer an elf file and no longer contains the device tree compiled into the kernel.
- A simpleImage.*.elf file based on the dts file is now created from a kernel build with the "*" being the name of the dts file that is specified.
- Users may add their own dts file, named virtex440-<your name>.dts or virtex405-<your name>.dts., and then specify simpleImage.virtex440-<your name> or simpleImage.virtex405-<your name> in the make command line to build the unique target.
- A kernel configuration option, Extra Targets, was added and setup for the Xilinx boards so that specifying the zImage in the make command line builds the new simpleImage targets.
- See the notes below for more details about how to configure and build the kernel using the new procedure.
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.
Outline
A simple minded outline of the Virtex Linux Project goes as follows:
1) If you're using the reference design from Xilinx, you don't need to generate a new device tree file in the following several steps.
2) Get the MLD, now device-tree, (was 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 to the arch/powerpc/boot/dts directory
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, virtex440-ml507.dts and virtex405-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, Device Tree Generator, 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). For the ELDK 4.1, the value of CROSS_COMPILE should be "ppc_4xx-".
Update the path to allow access to the binaries for the tools you are using. For the ELDK, the bin and usr/bin directories of the ELDK need to be in your path.
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 40x/virtex4_defconfig
or
make ARCH=powerpc 44x/virtex5_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.
Building the Linux Kernel
The following command creates an elf file, simpleImage.virtex405-ml405.elf, or simpleImage.virtex440-ml507.elf, in the arch/powerpc/boot directory.
make ARCH=powerpc zImage
Note: There is a kernel configuration option called Extra Targets and it is setup in the default kernel configuration files for the ML405 and the ML507. It is set to build target simpleImage.virtex405-ml405 and simpleImage.initrd.virtex405-ml405 for the ML405 and simpleImage.virtex440-ml507.elf and simpleImage.initrd.virtex440-ml507.elf for the ML507.
Without the Extra Targets kernel configuration setup, the following command lines and targets are used rather than zImage.
To build the ML405 kernel:
make ARCH=powerpc simpleImage.virtex405-ml405
make ARCH=powerpc simpleImage.initrd.virtex405-ml405
To build the ML507 kernel:
make ARCH=powerpc simpleImage.virtex440-ml507
make ARCH=powerpc simpleImage.initrd.virtex440-ml507
Note that the initrd target builds an image with a ram disk.
Loading and Running the Kernel onto the Board
Start XMD from the Linux kernel root directory.
On the ML405 board
XMD% connect ppc hw -debugdevice deviceNr 3 cpunr 1
XMD% dow arch/powerpc/boot/simpleImage.virtex405-ml405.elf
XMD% run
On the ML507 board
XMD% connect ppc hw -debugdevice deviceNr 5 cpunr 1
XMD% dow arch/powerpc/boot/simpleImage.virtex440-ml507.elf
XMD% run
There should be kernel console output on the serial port at 9600 baud.
Using A Ramdisk For The Root File System
A root file system is required for Linux to boot and the easiest way to accomplish that is to use a ramdisk. Note that the default kernel command line incorporates "root=/dev/ram" which specifies a ramdisk is the root filesystem.
An initial ramdisk kernel image, a file named simpleImage.initrd.* , is generated by default for the zImage target. The kernel build process takes the kernel image and a ramdisk image and combines them into a single kernel image that can be downloaded to memory using XMD. A ramdisk image file, ramdisk.image.gz, is required to build the initrd kernel image and the ramdisk image file is not distributed in the kernel tree.
A ramdisk image, powerpc.ramdisk.image.gz, is located on the front page, http://xilinx.wikidot.com, and can be downloaded. It must be in the arch/powerpc/boot directory to be used when building a kernel image with the ramdisk.
The kernel image which has the ramdisk in it, simpleImage.initrd.*, can then be downloaded to the board using XMD and the kernel will boot and use the ramdisk for the root file system.
Debugging Kernel Boot Problems
See the page Debugging Kernel Boot Problems for more details.





