Wednesday, April 7, 2010

Getting Linux2.6 working on Xilinx XUP board

Hardware Setup:

  1. Setup EDK project: Should be able to figure this out...Make sure you enable interrupts for Rs232_uart(for console)
  2. generate bitstreams

Software Setup:

  1. Get sources: linux2.6 from git.xilinx.com/ you can also get a generic kernel from kernel.org but should configure it properly by enabling only a select few drivers. 
  2. Setup the cross compiler: I used scripts from http://www.kegel.com/crosstool. Change the scripts to select minor-version 2. (gcc version 4.1.2)  4.1.0 doesn't compile2.6
  3. generate xilinx.dts (required for 2.6 kernel) file for your hardware setting (EDK project). This file is generated using xilinx device-tree. A harder way to do this is to manually edit one of the virtex***.dts files  in $LinuxTree/arch/powerpc/boot/dts/virtex***.dts matching you EDK system.mhs and.mss files
  4. Copy this file to the linuxtree
  5. Copy initramd before compiling. generate config for virtex2p board using virtexdefconfig files using:                                                                                                                 make ARCH=powerpc 40x/virtex_defconfig CROSS_COMPILE=powerpc-405-linux-gnu-      
  6. Compile the kernel using                                                                                                                              make ARCH=powerpc   simpleImage.xilinx CROSS_COMPILE=powerpc-405-linux-gnu-       
  7. make ARCH=powerpc   simpleImage.initrd.xilinx CROSS_COMPILE=powerpc-405-linux-gnu-   
  8. download the elf files generated in the folder arch/powerpc/boot/simpleImage[.initrd].xilinx.elf         
    Note: If the console do not respond after
                            Finalizing device tree... flat tree at 0x71e300
It could be mostly due to the Uart driver. Change it from uartlite to uart_16650(xps_uart16650) also could be some issue with the interrupt to this core.

If the kernel crashes, disable the cache setup on powerpc and try rebuilding

       

           

    No comments: