One of the things I had wanted to try out with my ML605 was EDK and embedded linux. Xilinx provided a basic system with (partial) built-in self test features. There was also a guide at xilinx.wikidot.org. I chose to use the latter, as its usually better to understand how to make changes to your system than to rely on things just working. This is a short explanation of what I did to get linux running on my ML605. It’s mostly a copy from the wiki, but with a few changes to get around some specific issues I encountered.
For linux, most of this will need settings64.sh to be sourced from the ISE directory. This might be done automatically, but if not, you should do it to be able to start XPS. I only tested this in 64b Linux, so some steps might be different in windows.
Disclaimer — its up to you to make sure these steps produce sane bit/elf files for your system. Basically, you should be double-checking the pads/HW to ensure the designs won’t break anything physically. This isn’t an official guide from Xilinx.
The Hardware Aspect
The first real step to to launch EDK/XPS. These were my general steps:
- Start with Base System Builder
- Board: Select ML605
- System: Single Processor System
- MicroBlaze: Processor Type : MicroBlaze; System Clock Frequency : 100MHz;
- Peripheral: Remove the unused peripherals. add xps_timer
- Cache: Enable both (Sizes will be chosen later)
- Application: Doesn’t matter at this time.
The above image shows the peripherals I included. SysACE is optional, as are a lot of other things. For a first-run, its usually best to start simple, so I’ve removed the things that might get in the way.
The next step is to configure the microblaze. The base system builder doesn’t provide for all of the configuration options.
- Double Click on microblaze_0 in the bus interfaces tab to get the GUI.
- Select Linux with MMU.
- Click Next, and set any options you’d like.
- Make sure to make a special note for all options related to instructions — these will be required later.
When finished, click OK.
To work properly, the interrupts should be configured. This can be done by clicking on the port tab, then selecting xps_intc_0’s interrupt connections. As shown, this will bring up a screen that allows the interrupt lines from various modules to be connected. Click OK when done.
Finally, go to the menu, and click on “Hardware” – “Generate Bitstream” and wait for the design to build. This will actually take 15+ minutes, so be patient. After this is done, close XPS/EDK.
Git and the Device Tree
The next stage is using Git to get the device tree generator. This document isn’t intended to show you how to install Git in linux. Once you have Git, use the following:
git clone git://git.xilinx.com/device-tree.git
The next step is to copy the bsp directory into your project directory. Your project directory is typically the one with “system.xmp” in it.
cp -r <device_tree_dir>/bsp <edk_dir>/
The next step is to re-launch EDK (XPS) and reload your project. In the menu, click “Software” and choose “Software Platform Settings”.
The right picture shows the place where you can select “device-tree” under the “OS & Library Settings” Section. The next step is to configure this as shown in the left picture.
Finally, go back to the menu and select “Software” – “Generate Libraries and BSPs”. That’s all there is to this part of the design. You can exit XPS now.
Building the Kernel
The first thing that needs to be done is to use get the build tools. This can be done using Git.
git clone git://git.xilinx.com/xldk/microblaze_v1.0.git # do this in the directory you want to extract the build tools in tar jxpf mb_gnu_tools_bin.tar.bz
The next thing to do is to set on the build environment.
# long paths weren't meant for wordpress. export PATH=$XILINX_EDK/gnu/microblaze/lin64/libexec/gcc/ ... ... microblaze-xilinx-elf/4.1.2/:$PATH export PATH=<mb_gnu_tools_dir>/bin:$PATH export CROSS_COMPILE=mb-linux-
The guide for the ML507 on xilinx.wikidot.org has the above steps spread across a few pages. On my system, a few things weren’t set up correctly to get everything to build correctly. I repeatedly got the error “mb-gcc: error trying to exec ‘cc1’: execvp: No such file or directory”. This is what the above changes to $PATH are intended to fix.
git clone git://git.xilinx.com/linux-2.6-xlnx.git cp <edk_project>/microblaze_v1.0/initramfs_minimal.cpio.gz \ <kernel_dir>/ ##cp $EDK/microblaze_0/libsrc/device-tree/xilinx.dts cp <edk_project>/microblaze_0/libsrc/device-tree_v0_00_x/xilinx.dts \ <kernel_dir>/arch/microblaze/boot/dts/
This will get the files required to build the kernel. The initfs should be in the root directory of the kernel — the one with “Makefile” in it. The xilinx.dts file created in the last step is needed to tell the kernel about the memory addresses and configuration of the various devices.
make ARCH=microblaze xilinx_mmu_defconfig make ARCH=microblaze menuconfig make ARCH=microblaze simpleImage.xilinx
These commands are used to configure and build the kernel. “xilinx_mmu_defconfig” will give a sane default kernel config. Its not valid just yet though. In menuconfig, set the special instructions up as they were in EDK.
The last command will build the kernel and place it in arch/microblaze/boot/simpleImage.xilinx .
Conclusions
The final part is common to other EDK projects loaded with JTAG. First, you should check the _pad.txt report from the hardware build. It can be useful to double check the IO locations.
Next, copy the system.bit file and simpleImage.xilinx image into a directory. Then use the Xilinx EDK Bash Shell to run XMD. From there:
XMD% fpga -f system.bit XMD% connect mb mdm XMD% dow simpleImage.xilinx XMD% con
The “downloading” program command is a bit confusing at first. It dumps some information to the terminal, then stops. It really does look like the program stops responding because there isn’t a progress bar anywhere, and it takes over a minute. Once the system is programed, you have a minimal linux system. At this point, it doens’t do anything useful. You can run vi, and things like ls, but everything is running from RAM. For fun, run “top” to see how much RAM you have. It’ll be less than you think due to the early access IP in EDK12.2.
(ISE/EDK and Microblaze are Xilinx Products.)





