Loading Linux on ML507

From Cpre584
Jump to navigation Jump to search
  1. The website to be followed is http://xilinx.wikidot.com/powerpc-linux
  2. The following things need to be taken care while loading linux on ML507 board
    1. The linux source has to be downloaded using git git clone git://git.xilinx.com/linux-2.6-xlnx.git. Do not try to get the snapshot from the website http://git.xilinx.com . It might not contain the virtex440-ml507.dts file. Instead it might contain ml507.dts, which would lead to errors while building the linux kernel
    2. In the dts (virtex440-ml507.dts) file the following boot arguments need to be updated
      1. ip=on (DHCP) => ip=192.168.1.10 (Which assigns linux a static IP address)
      2. Change root to root=/dev/ram rw. This makes the filesystem read write.
    3. Before connecting to the ml507 board using the connect command, the fpga must be programmed with the reference bitfile available at https://secure.xilinx.com/webreg/clickthrough.do?cid=111799 (you will need to have a Xilinx account to access the project). It is called ug511_ppc440_emb_ref.zip.The bitfile to be downloaded is ml507_ppc440_emb_ref/ready_for_download/download.bit. Use impact to download this bit file onto FPGA and then connect to the board.
    4. The kernel image file simpleImage.virtex440-ml507.elf needs to be loaded onto the board instead of the simpleImage.initrd.virtex440-ml507.elf file. The initrd* file contains the ram disk image. However, one of the fall 2009 teams used the simpleImage.initrd.virtex440-ml507.elf successfully, assuming the previous steps.

Detailed notes from Fall 2009 dmrisse/adamj: I originally wrote this as a script (on this machine), but eventually just used it for notes. Here are the steps for building and loading the kernel enumerated:

  1. source /usr/local/bin/Xilinx_src
  2. create a project directory such as /home/$USER/583/project
  3. cd to that directory
  4. git clone git://git.xilinx.com/device-tree.git
  5. git clone git://git.xilinx.com/linux-2.6.git
  6. edit ./linux-2.6-xlnx/arch/powerpc/boot/dts/virtex440-ml507.dts as shown above for IP address and file system writeability.
  7. PATH=$PATH:/opt/eldk/usr/bin
  8. export CROSS_COMPILE=ppc_4xx-
  9. cd ./linux-2.6-xlnx
  10. make ARCH=powerpc simpleImage.virtex440-ml507
  11. make ARCH=powerpc simpleImage.initrd.virtex440-ml507 (this is the image I used)
  12. Use iMPACT to load a suitable bitfile as described above. We ended up basing our project partially on MP2, so that bitfile provided a basis.
  13. cd ./arch/powerpc/boot
  14. (from the website above using XMD:
    1. connect ppc hw -debugdevice deviceNr 5 cpunr 1
    2. dow simpleImage.initrd.virtex440-ml507.elf
    3. run
    4. (when done) stop
  15. use minicom to connect to and watch the kernel boot up. Alternately, you can telnet to 192.168.1.10. Login with user and password both "root" (can also FTP in to load files into it). The kernel doesn't come with many binaries; things in /bin are all sym-links to busybox.

How we compiled software for the ppc Linux kernel:

  1. Since one of this did the VHDL project and the other focused on the software side, I had to include files from his directory. Assuming a Xilinx project like MP2 in /home/$USER/583/project.
  2. source /usr/local/bin/Xilinx_src
  3. PATH=/opt/phj_eldk/usr/bin:$PATH
  4. export CROSS_COMPILE=ppc_4xx-
  5. cd to directory with source code you want to build (my example is a self-contained .c file).
  6. powerpc-linux-gcc -static -o myBinary.exe -I /home/$USER/583/project/ppc440_0/include -L /home/$USER/project/ppc_440)0/lib mySource.c
  7. myBinary.exe is an arbitrary choice, you could leave out the -o file.exe altogether.
  8. Use FTP to put the executable onto the ppc linux kernel while its running.
  9. chmod +x the binary on the PPC (or chmod u+x or whatever...).
  10. now you can run the binary on Linux on the PPC on the FPGA.