Personal
 Page
Status: public - Last updated: August 2006


Installation procedure for linux on virtexII-pro FPGA

    Basic installation

  1. Build hardware system with EDK 8.1 (XILINX)
  2. Create Board Support Package (BSP) in EDK 8.1

  3. Using the Xilinx EDK we can build a baseline system. To setup EDK to recognize the XUP system, you need to set the Peripheral Repository Directory
    to look for the XUP library, e.g. C:\xupv2p\lib. You can get this XUP library at EDK-XUP-V2ProPack.zip
    I zipped the entire EDK build directory EDK_fpga_ppc_linux.zip Get a cross compiler for PPC405 (crosstool)
  4. Get the linux source (2.4.26) for bitmover
  5. Configure the kernel with this config
  6. Copy the BSP package to the kernel source BSP packages
  7. Compile the linux kernel linuxppc_2_4_devel
  8. Create an ACE-file from .bit (hardware) and .elf (software) file system.ace
  9. Using an ACE file allows you to more easily program the FPGA and load software on it than using a Parallel-IV cable and XMD.

    To generate an ACE file from a Xilinx xygwin shell:

    xmd -tcl genace.tcl -opt xupGenace.opt

    where the file xupGenace.opt contains the following:

    -jprog
    -board user
    -target ppc_hw
    -hw implementation/download.bit
    -elf TestApp_memory/executable.elf
    -configdevice devicenr 1 idcode 0x1127e093 irlength 14 partname xc2vp30
    -debugdevice devicenr 1 cpunr 1
    -ace system.ace
     

  10. Create a root file system with busybox
  11. My Busybox config file is config_busybox_1.2.1Easy to use script for creating the root file system mkrootfs
  12. The created root file-system rootfs
  13. To be contiunued ...

Networking

Static IP adress networking

Put the following lines in your /etc/init.d/rcS0 file:
/sbin/ifconfig eth0 your_IP up
/sbin/route add default gateway_IP
Don't start /sbin/udhcpc !!!

Mounting a Remote Root File System Using NFS

With networking operational, you can now get the board to boot 'diskless' (mount its root file system from somewhere else other than the CF). This can have some nice advantages for system development. That is, you can edit things on the root file system from a Linux box and not have to keep copying it over to the CF  card. There are at least two options for this: BOOTP and NFS. This document will only discuss NFS.

  1. Be sure NFS is configured into the kernel as well as "Root file system on NFS".

  2. On the kernel command line when it boots, use the following:
    (To boot from CF: console=ttyS0,38400 root=/dev/xsysace/disc0/part3 rw )

    To boot from nfs: console=ttyS0,38400 root=/dev/nfs nfsaddrs=client:server:gateway:netmask rw nfsroot=/opt/xup_rootfs

    The "root=/dev/nfs" tells it to look at NFS for the root file system.

    Client is what the board's address will be (we insert 192.168.0.10 here).  Server is the address of the machine that actually will serve the root file system (we use 192.168.0.1). It can be any address that is reachable.  Gateway is how the board is to get to the network, and thereby to the server (we use 192.168.0.1).  Netmask should be obvious (we use 255.255.255.0). Server and gateway can both be the same but they need not be.

  3. As before, if you use this option, remove any commands which set up the network to a hard IP address (like in /etc/init.d/rcS) which you may have set or things will not work as desired.  

To install NFS on ubuntu execute the following command:

sudo apt-get install nfs-kernel-server

Put the following in /etc/exports:

/opt/xup_rootfs 192.168.0.10(rw,no_root_squash,sync)

where the first arg is what is to be NFS-exported and the second arg is who to export it to (the board).

Next, put the following in /etc/hosts.deny:

portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

This prevents any machine from using these services.

Then, put the following in /etc/hosts.allow to allow the board access to the services:

portmap:192.168.0.10
lockd:192.168.0.10
mountd:192.168.0.10
rquotad:192.168.0.10
statd:192.168.0.10

Finally, any time you change /etc/exports, you should get the daemon to re-read that file using:

exportfs -ra

A good short document on how to do this setup is at: 

http://nfs.sourceforge.net/nfs-howto/server.html

Another document on Linux kernel command line parameters for this is:

http://stommel.tamu.edu/~baum/linux-kernel/nfsroot.txt.

15.1 Other NFS Mounts

To mount other volumes, do the following:

mount -t nfs 192.168.0.1:/remoteDirectoryName localDirectoryName


Installing a native gcc compiler for powerpc405

I used the debian packages for powerpc 4xx and extracted them to a build directory (dpkg -x * build/) The resulting build directory and corresponding debian files are found here.

Problems with using EDK on linux

  1. Problem: Creating the ace-file with " xmd -tcl genace.tcl -opt xupGenace.opt " gives the following error: Error: Executable zImage.elf does not contain start address..

  2. Solution : Xilinx Answer Record #23192, which tells you to change line 378 of %XILIND_EDK%\data\xmd\genace.tcl from calling mb-objdump to calling powerpc-eabi-objdump.

Problems with "/etc/init.s/rcS" in root filesystem

  1. Problem: the kernel boots with following error "Bummer: /etc/init.d/rcS file not found" and logging in keept repeating the login box

  2. Solution : The first thing to look at is a wrong (msdos instead of unix) file format for rcS Dos file format plague!! A second thing to look at is the selection of a default shell in busybox. If in your inittab a /bin/sh shell is selected you need to specify this shell in busybox (for example ash) undel Shell --> Choose your default shell(Ash).

Performing a hardware software codesign with powerpc 405 and virtex-II pro fpga