Loading Linux on ML507: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m 1 revision |
(No difference)
|
Latest revision as of 17:49, 27 February 2012
- The website to be followed is http://xilinx.wikidot.com/powerpc-linux
- The following things need to be taken care while loading linux on ML507 board
- 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
- In the dts (virtex440-ml507.dts) file the following boot arguments need to be updated
- ip=on (DHCP) => ip=192.168.1.10 (Which assigns linux a static IP address)
- Change root to root=/dev/ram rw. This makes the filesystem read write.
- 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.
- 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:
- source /usr/local/bin/Xilinx_src
- create a project directory such as /home/$USER/583/project
- cd to that directory
- git clone git://git.xilinx.com/device-tree.git
- git clone git://git.xilinx.com/linux-2.6.git
- edit ./linux-2.6-xlnx/arch/powerpc/boot/dts/virtex440-ml507.dts as shown above for IP address and file system writeability.
- PATH=$PATH:/opt/eldk/usr/bin
- export CROSS_COMPILE=ppc_4xx-
- cd ./linux-2.6-xlnx
- make ARCH=powerpc simpleImage.virtex440-ml507
- make ARCH=powerpc simpleImage.initrd.virtex440-ml507 (this is the image I used)
- 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.
- cd ./arch/powerpc/boot
- (from the website above using XMD:
- connect ppc hw -debugdevice deviceNr 5 cpunr 1
- dow simpleImage.initrd.virtex440-ml507.elf
- run
- (when done) stop
- 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:
- 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.
- source /usr/local/bin/Xilinx_src
- PATH=/opt/phj_eldk/usr/bin:$PATH
- export CROSS_COMPILE=ppc_4xx-
- cd to directory with source code you want to build (my example is a self-contained .c file).
- 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
- myBinary.exe is an arbitrary choice, you could leave out the -o file.exe altogether.
- Use FTP to put the executable onto the ppc linux kernel while its running.
- chmod +x the binary on the PPC (or chmod u+x or whatever...).
- now you can run the binary on Linux on the PPC on the FPGA.