Poky Linux on Xilinx Virtex

From SecretLab

Jump to: navigation, search

Contents

Using pre-built images

Several pre-built images are provided for a quick Linux board bring, images can be downloaded from http://www.secretlab.ca/aalonso/poky-images/. This section explains how to deploy these images on Xilinx Virtex Powerpc based target boards.

Poky-image-minimal provides a minimal environment using a serial console as main interface

Poky-image-sato provides Sato Desktop base system


Preparing Compact Flash

To be done, newer versions of fdisk doesn't produce a compatible partition table for system ace, easier way is to take a know to work card and create an image from it.

Partition layout from know to work CF

dd if=/dev/sdx of=mbr-cf.img count=1

Write partition table in new CF

dd if=mbr-cf.img of=/dev/sdx count=1


Virtex4

The next table shows how to deploy the images for Poky Linux minimal file system board bring up: Virtex4 poky-image-minimal

Virtex4 images
Image Description Deployment Partition
u-boot_ml405.ace Ace image bitstream + u-boot elf Copy Fat16
uImage.bin Kernel Image Copy Fat16
uImage.dtb Kernel device tree Copy Fat16
poky-image-minimal-pandaboard.rootfs.tar.bz2 Root file system Untar Ext3
modules-2.6.37-rc4-r6-virtex4.tgz Kernel modules Untar Ext3

Virtex5

The next table shows how to deploy the images for Poky Linux Sato Desktop file system: Virtex5 poky-image-minimal

Virtex5 images
Image Description Deployment Partition
u-boot_ml507.ace Ace image bitstream + u-boot elf Copy Fat16
uImage.bin Kernel Image Copy Fat16
uImage.dtb Kernel device tree Copy Fat16
poky-image-sato-virtex5.tar.gz Root file system Untar Ext3
modules-2.6.37-rc4-r6-virtex5.tgz Kernel modules Untar Ext3

Fixing kernel modules deployment

The distributed Kernel modules overrides the user and group owner with the local user who untars the kernel modules, in the rootfs the owner is root to fix this is necessary to change the owner:

sudo chown root:root -R /media/boot/lib

Board setup

  • Connect Serial cable
  • Open minicom, set baud rate to 9600
  • Power on
  • set boot arguments

uboot boot arguments

setenv 'baudrate 9600'
setenv 'bootargs console=ttyUL0 ip=on root=/dev/xsa2 rw rootfstype=ext2 rootdelay=1'
setenv 'load_dtb fatload ace 0 0x03000000 uImage.dtb 12288'
setenv 'load_kernel fatload ace 0 0x03020000 uImage.bin 1867766'
setenv 'boot_addr 0x03020000 - 0x03000000'
setenv 'go run load_dtb; run load_kernel; bootm $(boot_addr)'
setenv 'bootcmd run go'
saveenv
Sample output
U-Boot 1.3.4-dirty (Jan 10 2011 - 14:01:29)

### No HW ID - assuming Virtex-4 FX12 or FX20
DRAM:  32 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0 
reading uImage.dtb

21073 bytes read
reading uImage.bin

1972411 bytes read
## Booting kernel from Legacy Image at 03020000 ...
   Image Name:   Linux-2.6.37-rc4
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1972347 Bytes =  1.9 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 03000000
   Booting using the fdt blob at 0x3000000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 007f7000, end 007ff250 ... OK

Root file system generation

This section explains the procedure for installing Poky build framework, Xilinx BSP layer and the configuration needed to generate rootfs images for the Virtex4,5 platforms.

*Note: ${POKYROOT} is the absolute path where Poky is installed in your system.
       Replace ${POKYROOT} where applicable.

Get Poky

git clone git://git.pokylinux.org/poky.git

Get Pandaboard meta layer

cd ${POKYROOT}/poky
git clone git://git.pokylinux.org/meta-xilinx.git

Setup poky environment

source poky-init-build-env

Target board configuration

Edit local configuration file

vim ${POKYROOT}/build/conf/local.conf

Set the target machine details

MACHINE ?= "virtex4"

Set the hardware reference project

XILINX_BSP_PATH = "${HOME}/workspace/xilinx-ml405"

Set the target board

XILINX_BOARD = "ml405"

Set the the default serial console

KERNEL_CONSOLE = "ttyUL0"
SERIAL_CONSOLE = "9600 ttyUL0"

If hardware project uses uart 550 module replace ttyUL0 for ttyS0

Enable gnueabi toolchain built

GLIBCTARGETOS ?= "linux-gnueabi"

Xilinx BSP meta layer configuration

Edit bblayer configuration file to add the search path for meta-xilinx BSP recipes

vim ${POKYROOT}/build/conf/bblayers.conf
BBLAYERS = " \
           ${POKYROOT}/meta \
           ${POKYROOT}/meta-xilinx \
           "

Build basic console image

bitbake poky-image-minimal

Build Sato desktop image

bitbake poky-image-sato

Deployment

All images needed to bring Poky Linux to Virtex platforms are stored at:

${POKYROOT}/build/tmp/deploy/images/
Personal tools