SMP HiFi 2 Development Board

From Linux/Xtensa
Revision as of 01:33, 4 November 2009 by Piet (talk | contribs)
Jump to navigation Jump to search

These instructions explain how to use HiFi-2 Codec Development environment on a LX200 FPGA board.

Some general notes on these instructions:

  • They are a work in progress, it's currently being prepared for a Tensilica customer.
  • The following was tested on x86 machines running RedHat Fedora Core 5.

Introduction

We will be going over the steps needed to set up you LX200 board for codec development. Your board likely comes with U-boot preinstalled on it to boot a linux kernel. You will be downloading a copy of buildroot and a linux kernel that have been pre-configured and build for HiFi-2 development. You will be setting up a NFS server to export a linux root file system and setting up the Linux kernel to boot from your NFS file server. Once your running on your development board we will suggest how to taylor your board for easy development of your codecs.

Downloading The latest HiFI-2 Snapshot

The HiFi-2 development environment is maintain in a source code version control system named 'git' that is likely a good environemt for you to use when working with this development environemt, thought it can be done without it. We will assume you will be using 'git' but will point out allternatives for those not interested in investing the time to set it up.

Installing git

   The Git source code Version Control System can be easily installed by downloading a recient tar ball to your system from:
        http://www.kernel.org/pub/software/scm/git/
   Then simpley unpack the tar ball, drop into the git src code, and then make and install it.
       cp ~piet/Desktop/git-1.6.5.tar.gz .
       gunzip git-1.6.5.tar.gz
       tar xf git-1.6.5.tar
       cd git-1.6.5
       make
       make install

Getting the Latest HiFi-2 Snapshot

 The HiFi-2 snapshot is in the process of being made. Their are two major components, a Linux kernel git reposiory, and a buildroot git repository. We will download both preconfigured for easily running HiFi-2 codecs. Both the kernel and buildroot are available via git and compressed tar balls. With git being arguable preferable as it will allow you to easly see any changes you have made from this reference starting point.

The buildtoot environment can be downloaded with git by using the following command:

  $ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot

once git is finished, do a cd to buildroot-xtensa-HiFi2-Snapshot and checkout the latest stuff; which is currently the snapshot_2+SMP branch. This can be done at the command line with:

   $ cd buildroot-xtensa-HiFi2-Snapshot
   $ git branch --track snapshot_2+SMP origin/snapshot_2+SMP
   $ checkout snapshot_2+SMP

The git GUI is also convenient for checking out the HiFi-2 snapshot and provides a comfortable way for viewing the state of the git repository. To check out the snapshot_2+SMP branch simply run the command 'git gui' and then pull down the branch->create menu. Next put snapshot_2+SMP into the Name block, select Tracking Branch in the Starting Revision section, and select the origin/snapshot_2+SMP branch. Finally hit the Create button. This will create your tracking branch which can be easy kept in sync with our git repository.

Alternativly you can currently ftp a compress tar ball from our ftp server:

        http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz


Setting up a NFS Server to export the Root Filesystem

Your buildroot has a cpio file that we will use to build a root file system to export via NFS to your LX200 board. We will also be adding an additional minor changes to make your development environment more comfortable. The cpio file with your root file system was build and left in:

   buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio

Pick a place on your workstation to export you root and unpack the cpio file into that directory.

   cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2
   cp rootfs.xtensa_test_mmuhifi_c3.cpio /tmp
   cd /exports/
   mkdir LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp
   cp /tmp/rootfs.xtensa_test_mmuhifi_c3.cpio
   cat rootfs.xtensa_test_mmuhifi_c3.cpio | cpio -i

Next add a line to /etc/exports:

   /exports                *(rw,no_root_squash,sync,no_wdelay)

and restart you nfs services:

   $ /etc/rc.d/init.d/nfs restart

The showmount command should show your NFS file system now being exported:

   $ showmount -e
     Export list for pdelaney_fc5.hq.tensilica.com:
     /exports *
   $




Booting Linux with U-Boot

Tayloring your system prior to developing your codec

Compiling your codec and linking it with Mplayer

Adding your codec to Buildtoot