<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.linux-xtensa.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Marc</id>
	<title>Linux/Xtensa - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.linux-xtensa.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Marc"/>
	<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Special:Contributions/Marc"/>
	<updated>2026-05-05T01:07:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Toolchain_and_Embedded_Distributions&amp;diff=765</id>
		<title>Toolchain and Embedded Distributions</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Toolchain_and_Embedded_Distributions&amp;diff=765"/>
		<updated>2017-05-16T20:39:14Z</updated>

		<summary type="html">&lt;p&gt;Marc: Typo fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[Toolchain Overlay File]] ==&lt;br /&gt;
&lt;br /&gt;
Because Xtensa is a configurable and extensible processor architecture that allows to define additional registers and instructions, the toolchain is the main software component that usually needs to be adapted for a specific Xtensa processor configuration. Tensilica provides a small set of configuration files in the form of an &#039;&#039;overlay&#039;&#039; that replace the versions in the toolchain sources. The [[Toolchain Overlay File]] is a version of that &#039;&#039;overlay&#039;&#039; provided by Tensilica with a specific format required for crosstool-NG and buildroot. A script to convert the &#039;&#039;overlay&#039;&#039; provided by Tensilica can be found under [[Toolchain Overlay File]]&lt;br /&gt;
&lt;br /&gt;
== Start from scratch with FSF/OSS sources ==&lt;br /&gt;
&lt;br /&gt;
Creating a toolchain and bootable root file system starting from sources is certainly the most challenging approach. It usually requires additional patches and sometimes matching versions of sources. While support for Xtensa is integrated in most toolchain tools, they must be patched for a specific Xtensa processor configuration. The &#039;&#039;overlay&#039;&#039; mentioned above includes a necessary set of configuration files together with information explaining the process to patch the toolchain sources.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; cross compilers running on 64bit hosts are known to produce broken code. For some more details see the [http://lists.linux-xtensa.org/pipermail/linux-xtensa/Week-of-Mon-20130715/001140.html explanation] of Chris Zankel.&lt;br /&gt;
&lt;br /&gt;
== [http://crosstool-ng.org/ crosstool-NG] &amp;lt;small&amp;gt;([[crosstool-NG|build instructions for Xtensa]])&amp;lt;/small&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
crosstool-NG (http://crosstool-ng.org/) provides a system to build a complete toolchain. It supports various C-libraries (Multilib, uClibc, glibc, and eglibc), but can also be used to build a &#039;bare&#039; toolchain. Starting with release 1.22.0 the mainline crosstool-NG repository includes support for Xtensa. The process of patching the toolchain and other architecture specific software is fully automated using the [[Toolchain Overlay File]]. More information for building a toolchain for Xtensa using crosstool-NG can be found [[crosstool-NG|here]].&lt;br /&gt;
&lt;br /&gt;
== [http://www.buildroot.org BuildRoot] &amp;lt;small&amp;gt;([[Buildroot|build instructions for Xtensa]])&amp;lt;/small&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Buildroot is a set of Makefiles and patches that makes it easy to generate a cross-compilation toolchain and root file system for your target Linux system. The Xtensa architecture is fully supported in the official tree, including support for specific processor configuration using the [[Toolchain Overlay File]]. For build instructions, see [[Buildroot]].&lt;br /&gt;
&lt;br /&gt;
== [http://www.openadk.org OpenADK] ==&lt;br /&gt;
&lt;br /&gt;
OpenADK is a set of Makefiles and patches that makes it easy to generate a cross-compilation toolchain and root file system for your target Linux system. The Xtensa architecture is fully supported, including support for specific processor configuration using the [[Toolchain Overlay File]]. At the moment only Qemu emulation (dc232b,dc233c) targets are available. New configurations can be simply added.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Toolchain_Overlay_File&amp;diff=693</id>
		<title>Toolchain Overlay File</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Toolchain_Overlay_File&amp;diff=693"/>
		<updated>2013-07-08T23:07:37Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Conversion Script */ Copy xtensa-xtregs.c instead of xtensa-regmap.c to gdbserver sources&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;Overlay&#039;&#039; is a tar file that includes modified versions of processor configuration dependent files that are required by various toolchain tools, such as binutils, gcc, and gdb. The overlay described here has a specific layout and is intended for toolchain generators, such as buildroot or crosstool-NG. &lt;br /&gt;
&lt;br /&gt;
== Creating the overlay ==&lt;br /&gt;
&lt;br /&gt;
The overlay file shipped by Tensilica uses a flat directory structure, which is not suitable for buildroot or crosstool-NG at the moment. It is part of the generated processor package, and can be found in the XtDevTools directory:&lt;br /&gt;
&lt;br /&gt;
 XtDevTools/install/build/$VERSION/$XTENSA_CORE/src/xtensa-config-overlay.tar.gz&lt;br /&gt;
&lt;br /&gt;
The following script converts the directory structure of that file by creating a new overlay file, called xtensa-overlay.tgz, and extracting the necessary files from the Tensilica overlay. Simply provide the path and name of the overlay provided by Tensilica when running the script:&lt;br /&gt;
&lt;br /&gt;
 ./script xtensa-config-overlay.tar.gz&lt;br /&gt;
&lt;br /&gt;
This will create the file xtensa-overlay.tgz required by buildroot or crosstool-NG. For more information how to configure those generators, please see [[Buildroot]] or [[crosstool-NG]].&lt;br /&gt;
&lt;br /&gt;
== Conversion Script ==&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 TMPDIR=`mktemp -d`&lt;br /&gt;
 tar xzf $1 -C $TMPDIR&lt;br /&gt;
 mkdir -p $TMPDIR/overlay/binutils/bfd $TMPDIR/overlay/binutils/ld \&lt;br /&gt;
          $TMPDIR/overlay/binutils/include $TMPDIR/overlay/gcc/include \&lt;br /&gt;
          $TMPDIR/overlay/gdb/bfd $TMPDIR/overlay/gdb/gdb/regformats \&lt;br /&gt;
          $TMPDIR/overlay/gdb/gdb/gdbserver $TMPDIR/overlay/gdb/include&lt;br /&gt;
 mv $TMPDIR/src/binutils/xtensa-config.h $TMPDIR/overlay/binutils/include&lt;br /&gt;
 mv $TMPDIR/src/binutils/xtensa-modules.c $TMPDIR/overlay/binutils/bfd&lt;br /&gt;
 mv $TMPDIR/src/gcc/xtensa-config.h $TMPDIR/overlay/gcc/include&lt;br /&gt;
 mv $TMPDIR/src/gdb/xtensa-config.c $TMPDIR/overlay/gdb/gdb&lt;br /&gt;
 mv $TMPDIR/src/gdb/xtensa-config.h $TMPDIR/overlay/gdb/include&lt;br /&gt;
 mv $TMPDIR/src/gdb/xtensa-modules.c $TMPDIR/overlay/gdb/bfd&lt;br /&gt;
 mv $TMPDIR/src/gdb/xtensa-xtregs.c $TMPDIR/overlay/gdb/gdb/gdbserver&lt;br /&gt;
 mv $TMPDIR/src/gdb/reg-xtensa.dat $TMPDIR/overlay/gdb/gdb/regformats&lt;br /&gt;
 tar czf xtensa-overlay.tgz -C $TMPDIR/overlay/ binutils gcc gdb&lt;br /&gt;
 rm -fr $TMPDIR&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Main_Page&amp;diff=588</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Main_Page&amp;diff=588"/>
		<updated>2012-12-08T09:40:40Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* &amp;lt;big&amp;gt;Welcome to the Linux/Xtensa Wiki&amp;lt;/big&amp;gt; */ Wiki account creation disabled&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;amp;nbsp;&lt;br /&gt;
= &amp;lt;big&amp;gt;Welcome to the Linux/Xtensa Wiki&amp;lt;/big&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Wiki project provides information about the [http://en.wikipedia.org/wiki/Linux Linux] port to the [http://www.tensilica.com Xtensa processor architecture].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width:45%;height=100%; background:#ffffff;&amp;quot; valign=top|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Getting Started&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Supported Processors]]&lt;br /&gt;
* [[Evaluation Platforms|Evaluation Platforms]]&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Support&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Internet Resources]]&lt;br /&gt;
* [[OpenSource Software|OpenSource Tools and Applications]]&lt;br /&gt;
* [[KnownIssues|Known Kernel Issues and Limitations]]&lt;br /&gt;
* [[Hardware Issues|Things Hardware Designers Should Know]]&lt;br /&gt;
|style=&amp;quot;width:10%;height:100%;background:#ffffff;&amp;quot; |&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width:45%;height:100%; background:#ffffff;&amp;quot; valign=top|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Linux from Scratch&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Toolchain and Embedded Distributions]]&lt;br /&gt;
* [[Kernel Build Instructions|Kernel Build Instructions]]&lt;br /&gt;
* [[Boot Loader|Boot Loader]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Developers&#039; Resources&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Platform Porting|Porting the Kernel to a new Platform (Board)]]&lt;br /&gt;
* [[ABI Interface]]&lt;br /&gt;
* [[Xtensa on QEMU]]&lt;br /&gt;
&lt;br /&gt;
| colspan=3 |&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;small&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;  Due to spam, creation of new wiki accounts has been disabled until further notice.&lt;br /&gt;
If you want to get an account, and be able to edit or contribute anything,&lt;br /&gt;
please try sending an email to the&lt;br /&gt;
[http://lists.linux-xtensa.org/mailman/listinfo/linux-xtensa linux-xtensa mailing list]&lt;br /&gt;
identifying yourself and what you want to contribute.&lt;br /&gt;
&amp;lt;/small&amp;gt;&amp;lt;/i&amp;gt;&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=585</id>
		<title>Instructions for building and booting Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=585"/>
		<updated>2012-06-22T23:01:29Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Download buildroot and Linux kernel sources */ Simplify checkout lines&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions explain how to build a toolchain, root filesystem and kernel for Linux running on an Xtensa processor.  These instructions apply specifically to the XTAV60 (LX60) board.&lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.  If you are using the latest development sources, the build process may change, so you should be sure to get the latest version of this document at [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions].  If you are using one of the development snapshot releases, you should use the version of the build instructions included with that snapshot.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on newer Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Xtensa Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&lt;br /&gt;
**  &#039;&#039;&#039;NOTE:&#039;&#039;&#039; this assumes the default selection of packages in buildroot.  Selecting extra packages may require a more recent host OS or more recent version of certain tools.  For example, the default version of &amp;lt;tt&amp;gt;find&amp;lt;/tt&amp;gt; on RHEL4 is too old to allow building all X11 packages in buildroot, so it is necessary to upgrade the host version of &amp;lt;tt&amp;gt;findutils&amp;lt;/tt&amp;gt; on RHEL4 to build these packages.&lt;br /&gt;
&lt;br /&gt;
*  Lines prefixed with &amp;quot;sudo&amp;quot; need to be executed as root.  The rest is best executed as a non-root user.  (It is possible to install &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; as a non-root user if root access is an issue.  How to do this isn&#039;t shown here.)&lt;br /&gt;
&lt;br /&gt;
*  Lines that set environment variables assume a Bourne compatible shell (e.g., /bin/sh or bash), but are easily adapted to other shells.&lt;br /&gt;
&lt;br /&gt;
*  Instructions are assumed executed all in order (e.g., commands assume current directory and environment variables set earlier).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your host system ==&lt;br /&gt;
&lt;br /&gt;
If you are using one of the snapshot releases, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
If you want to work with the latest development sources, you will need&lt;br /&gt;
[[Installing GIT|&amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; installed on your system]].&lt;br /&gt;
&lt;br /&gt;
== Download buildroot and Linux kernel sources ==&lt;br /&gt;
&lt;br /&gt;
The following section describes how to download stable versions&lt;br /&gt;
of buildroot, and of the Linux kernel, for Xtensa cores.&lt;br /&gt;
&lt;br /&gt;
First, create an empty directory &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;&amp;lt;/tt&amp;gt; on a disk with&lt;br /&gt;
at least 4 GB available space.  After the download operations below,&lt;br /&gt;
you&#039;ll end up with the following file structure,&lt;br /&gt;
which is assumed by the rest of this document:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;workdir&amp;gt;/&lt;br /&gt;
            /buildroot&lt;br /&gt;
            /linux&lt;br /&gt;
&lt;br /&gt;
First download the buildroot sources.&lt;br /&gt;
The current stable source repository and branch have strange names,&lt;br /&gt;
bear with me, they&#039;re the correct ones to use.&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  If you happen to have write access to the repository, use &amp;lt;tt&amp;gt;&#039;&#039;&#039;git+ssh:&#039;&#039;&#039;&amp;lt;/tt&amp;gt; instead of &#039;&#039;&#039;&amp;lt;tt&amp;gt;git:&amp;lt;/tt&amp;gt;&#039;&#039;&#039; in the clone command below,&lt;br /&gt;
so that you can later easily push changes back to the repository.&lt;br /&gt;
For more details, see the [http://wiki.linux-xtensa.org/index.php/Repository_Access repository access] page.&lt;br /&gt;
&lt;br /&gt;
Download buildroot as follows:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ cd buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git checkout -b snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
then the Linux kernel sources:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp.git linux&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
Note how in the first case (buildroot), we use a non default branch,&lt;br /&gt;
so the last two commands setup tracking for that remote branch and&lt;br /&gt;
does a check-out of that branch in the working tree.&lt;br /&gt;
In the second case (linux), we use the default branch (&amp;lt;i&amp;gt;master&amp;lt;/i&amp;gt; branch)&lt;br /&gt;
which gets checked out by default.&lt;br /&gt;
&lt;br /&gt;
Major development updates to buildroot for Xtensa are expected to happen&lt;br /&gt;
in the following repository, mostly in the master branch.&lt;br /&gt;
However, although it has some more recent packages, this repository is often&lt;br /&gt;
in a state of development and not quite as stable as the above.&lt;br /&gt;
So, &#039;&#039;&#039;DON&#039;T DO THIS STEP&#039;&#039;&#039; unless you know what you are doing, and want to&lt;br /&gt;
experiment with this version of buildroot instead of the above.&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa.git buildroot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Install any required processor specific overlay ==&lt;br /&gt;
&lt;br /&gt;
This step is required if you are targeting a custom Xtensa processor.&lt;br /&gt;
If you use a Diamond 232L Standard Core, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
To configure buildroot and the kernel to use a custom Xtensa processor&lt;br /&gt;
configuration, you need to overlay a set of files customized for your&lt;br /&gt;
processor configuration onto toolchain sources (gcc, binutils, gdb, etc)&lt;br /&gt;
and the Linux kernel.  This process has been automated using a script&lt;br /&gt;
located in the buildroot source tree.&lt;br /&gt;
For usage information, you can invoke it without arguments:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
which displays a help message similar to the following:&lt;br /&gt;
&lt;br /&gt;
 xt-buildroot-overlay-install version 1.3&lt;br /&gt;
 Usage:  xt-buildroot-overlay-install &amp;lt;parameters&amp;gt; [&amp;lt;options&amp;gt;]&lt;br /&gt;
 Where &amp;lt;parameters&amp;gt; are:&lt;br /&gt;
   -t file.tgz     Specify path to the Xtensa Linux overlay tarball, typically&lt;br /&gt;
                   &amp;lt;xtensa_root&amp;gt;/src/xtensa-config-overlay.tar.gz&lt;br /&gt;
   -b dir          Path to the base of the buildroot source tree, in which&lt;br /&gt;
                   package specific overlay tarballs get installed.&lt;br /&gt;
   -k dir          Path to the base of the Linux kernel source tree, in which&lt;br /&gt;
                   the Linux kernel specific overlay gets installed.&lt;br /&gt;
   -c config_name  Name for the Xtensa processor configuration as it will be&lt;br /&gt;
                   known to the open source community.  Must be a lowercase&lt;br /&gt;
                   identifier, starting with a letter, consisting of letters&lt;br /&gt;
                   and numbers and underscores, not ending with underscore&lt;br /&gt;
                   and not containing consecutive underscores.  For examples:&lt;br /&gt;
                      dc232b , dc232b_be , mmubasele , fsf , s5000 .&lt;br /&gt;
   -l long_name    Long name for the Xtensa processor configuration, human-&lt;br /&gt;
                   readable with spaces etc allowed (must be quoted).&lt;br /&gt;
                   For example:  &#039;Diamond 232L Standard Core Rev.B (LE)&#039;&lt;br /&gt;
                   Try to keep it within approximately 40 characters.&lt;br /&gt;
 And &amp;lt;options&amp;gt; are:&lt;br /&gt;
   -f              If package specific overlay tarballs already exist in&lt;br /&gt;
                   the destination source tree, overwrite them without asking.&lt;br /&gt;
   --help          Show this usage message.&lt;br /&gt;
&lt;br /&gt;
Note that the Xtensa Linux overlay tarball MUST be obtained from an Xtensa&lt;br /&gt;
core package built using release RB-2008.3 or later.&lt;br /&gt;
&lt;br /&gt;
Here is an example invocation of the overlay installation script:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install -t blinkcore-config-overlay.tar.gz&#039;&#039;&#039; \&lt;br /&gt;
         &#039;&#039;&#039;-b ./buildroot -k ./linux -c superzip -l &amp;quot;ChipCorp SuperZIP Blink Accelerator Core&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The script extracts some relevant information from the overlay tarball,&lt;br /&gt;
presents it along with relevant parameters to the user, and prompts&lt;br /&gt;
for confirmation before proceeding.&lt;br /&gt;
&lt;br /&gt;
The chosen processor name (-c option) must be unique among known Xtensa processors.&lt;br /&gt;
It is also probably wise to avoid names confusingly similar to other (non-Xtensa) processors.&lt;br /&gt;
If you expect at some point to contribute support for your custom processor to the&lt;br /&gt;
open-source community, this name will likely be long-lived.&lt;br /&gt;
(One way to contribute support for a custom processor might be to submit the overlay tarball&lt;br /&gt;
or files to the linux-xtensa.org maintainers.)&lt;br /&gt;
&lt;br /&gt;
In the steps below, buildroot and the Linux kernel must be configured&lt;br /&gt;
(in their respective &amp;lt;code&amp;gt;&#039;&#039;make menuconfig&#039;&#039;&amp;lt;/code&amp;gt; steps) to select&lt;br /&gt;
the &amp;lt;code&amp;gt;&#039;&#039;custom&#039;&#039;&amp;lt;/code&amp;gt; Xtensa processor option.&lt;br /&gt;
This presents an extra configuration menu entry where you must provide&lt;br /&gt;
the name of the Xtensa processor.  Set it to the same name&lt;br /&gt;
as was specified in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option above.&lt;br /&gt;
&lt;br /&gt;
== Build a toolchain and root filesystem using buildroot ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  for more details on generic buildroot topics not covered in this simple how-to,&lt;br /&gt;
see [http://buildroot.uclibc.org/ buildroot.uclibc.org].&lt;br /&gt;
&lt;br /&gt;
=== Configure buildroot ===&lt;br /&gt;
&lt;br /&gt;
The first time you configure buildroot, start with defaults for your Xtensa processor:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;/buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./target/xtensa/setup-config &amp;lt;i&amp;gt;&amp;lt;corename&amp;gt;&amp;lt;/i&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039; is the overlay name of your selected Xtensa or Diamond core&lt;br /&gt;
(e.g., &#039;&#039;&#039;dc233c&#039;&#039;&#039;).  If you omit &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039;, a help message and a list&lt;br /&gt;
of currently installed Tensilica core overlays is displayed.&lt;br /&gt;
&lt;br /&gt;
Optionally, you can then customize your buildroot configuration, such as&lt;br /&gt;
selecting additional packages, setting various parameters, and so on.&lt;br /&gt;
The following make targets provide a &#039;&#039;curses&#039;&#039; (text-based graphical) interface&lt;br /&gt;
for configuring buildroot, the uClibc C library, and busybox, respectively.&lt;br /&gt;
(&#039;&#039;&#039;Note:&#039;&#039;&#039;  You need the &amp;lt;tt&amp;gt;TERM&amp;lt;/tt&amp;gt; environment variable properly set for&lt;br /&gt;
these curses based tools to work.)&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make menuconfig&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make uclibc-menuconfig&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make busybox-menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Build buildroot ===&lt;br /&gt;
&lt;br /&gt;
Just type:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
THIS WILL TAKE A LONG TIME (from about 30 minutes with defaults on a 3 GHz Pentium 4,&lt;br /&gt;
to perhaps an hour or many depending on your system and on whether&lt;br /&gt;
you enabled extra packages in your buildroot configuration).&lt;br /&gt;
&lt;br /&gt;
Wait patiently for the build to complete.  This builds an entire toolchain&lt;br /&gt;
as well as some basic packages, and constructs a root filesystem.&lt;br /&gt;
It might build many more packages if you selected them earlier with menuconfig.&lt;br /&gt;
&lt;br /&gt;
==== If Something Goes Wrong ====&lt;br /&gt;
&lt;br /&gt;
Perhaps you missed some step above and the build fails.  Or you&#039;re just switching to a different processor configuration, or making some change with unknown dependencies.  Either way, you&#039;ll probably need to fix the error and/or make the change, and redo the whole build.  The above &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; command usually works fine if you&lt;br /&gt;
just added a package using menuconfig, but otherwise does not check many dependencies, so it will usually NOT rebuild things that depend on whatever you have fixed or changed.  Here&#039;s one way to retry the make from scratch without having to wipe out the &amp;lt;tt&amp;gt;buildroot&amp;lt;/tt&amp;gt; directory tree completely and start again from the git cloning.&lt;br /&gt;
&lt;br /&gt;
  $ &#039;&#039;&#039;rm -rf *build_xtensa* binaries&#039;&#039;&#039;&lt;br /&gt;
  $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is not necessary to empty the &#039;dl&#039; subdirectory, which contains tarballs downloaded from the Internet, nor the .config file, which contains the buildroot configuration.  Customizations to the uClibc and &amp;lt;tt&amp;gt;busybox&amp;lt;/tt&amp;gt; configurations should have ended up getting saved in target/xtensa/uClibc.config and target/xtensa/busybox-config, respectively, so hopefully are preserved by the above sequence.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the XTAV60, AXAV110, or XTAV200 Boards ==&lt;br /&gt;
&lt;br /&gt;
References to the &#039;&#039;XTAV60 board&#039;&#039; refer to the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica1 LX60 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX60 (XT-AV60) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly, references to the &#039;&#039;XTAV200 board&#039;&#039; refers the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica2 LX200 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX200 (XT-AV200) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure the kernel ===&lt;br /&gt;
&lt;br /&gt;
The kernel build is a two-step process:  configure the kernel, and build it.&lt;br /&gt;
First, before we can do anything with the kernel, set your PATH to&lt;br /&gt;
point to the toolchain built using buildroot.&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; is the name of the Xtensa processor configuration you selected&lt;br /&gt;
when building the toolchain (e.g., &amp;lt;code&amp;gt;dc232b&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Now setup a destination for kernel builds.&lt;br /&gt;
We usually like to have the build directory separate from&lt;br /&gt;
the source directory, so we use &#039;O=&amp;lt;/destination/path&amp;gt;&#039; in&lt;br /&gt;
kernel make commands.  If you&#039;ll be routinely building multiple&lt;br /&gt;
configurations of the Linux kernel, it&#039;s good to have some&lt;br /&gt;
naming conventions for the build directory.  For example,&lt;br /&gt;
to experiment with multiple target platforms but only one&lt;br /&gt;
processor configuration, we include just the platform name here:&lt;br /&gt;
&lt;br /&gt;
   $&#039;&#039;&#039;mkdir build-xtav60&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start with the default kernel configuration for the Avnet board&lt;br /&gt;
(which works on both XTAV60 (LX60), XTAV110 (LX110), and XTAV200 (LX200) boards)&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd linux&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa KBUILD_DEFCONFIG=lx60_defconfig defconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This configures the kernel using the default configuration found in&lt;br /&gt;
&#039;&#039;&#039;arch/xtensa/configs/lx60_defconfig&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;  This kernel configuration has nothing to do with Xtensa&lt;br /&gt;
processor configuration.  That comes next.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now customize this a little bit to select the correct Xtensa processor&lt;br /&gt;
configuration, and to bundle the root filesystem into the kernel:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is enabled.  Underneath that, edit &#039;&#039;&#039;Initramfs source file(s)&#039;&#039;&#039;,&lt;br /&gt;
and enter the path to the cpio formatted root filesystem&lt;br /&gt;
generated by buildroot:&lt;br /&gt;
&lt;br /&gt;
      &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio.gz&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t forget to replace &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039; with the appropriate full path&lt;br /&gt;
and &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; with your Xtensa processor configuration name.)&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Processor type and features&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Xtensa Processor Configuration&#039;&#039;&#039; is correct and matches&lt;br /&gt;
the processor configuration name you used to build the toolchain with buildroot&lt;br /&gt;
(for example, &#039;&#039;dc232b&#039;&#039; for Diamond 232L Rev.B).&lt;br /&gt;
The kernel build selects a toolchain and processor variant specific headers&lt;br /&gt;
based on this selection.&lt;br /&gt;
If the desired processor configuration does not appear explicitly in the list,&lt;br /&gt;
simply select &#039;&#039;&#039;Custom Xtensa processor configuration&#039;&#039;&#039; and enter the&lt;br /&gt;
processor configuration name (all lowercase) into the next menu parameter,&lt;br /&gt;
&#039;&#039;&#039;Xtensa Processor Custom Variant Name&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Back in the main menu, under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;CPU clock rate&#039;&#039;&#039; entry is set correctly according to the following table:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Board !! Frequency selected in XPG &amp;lt;br/&amp;gt;(MHz) !! &#039;&#039;CPU clock rate&#039;&#039; setting &amp;lt;br/&amp;gt;(kHz)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV60  (LX60)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV110 (LX110)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV200 (LX200)&lt;br /&gt;
|  30  || 31250&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 41667&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exit menuconfig, saving your configuration changes.&lt;br /&gt;
&lt;br /&gt;
Backup your configuration outside the build directory.  For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cp ../build-xtav60/.config config.xtav60.saved&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you do a clean rebuild of the kernel (e.g., &amp;quot;rm -rf ../build-xtav60&amp;quot;)&lt;br /&gt;
you can now configure it with simply:&lt;br /&gt;
   $ &#039;&#039;&#039;mkdir ../build-xtav60 ; cp config.xtav60.saved ../build-xtav60/.config&#039;&#039;&#039;&lt;br /&gt;
Of course if you update the kernel, you&#039;ll probably again have to do:&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa  menuconfig&#039;&#039;&#039;&lt;br /&gt;
and save a new copy of your configuration.&lt;br /&gt;
&lt;br /&gt;
=== Build the kernel ===&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The build will issue a few warnings which are normal.&lt;br /&gt;
Once complete, the bootable image is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
and the uncompressed ELF file containing kernel symbols is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
There is also a RedBoot bootable image (if you use RedBoot) in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/zImage.redboot&lt;br /&gt;
&lt;br /&gt;
=== Install Xtensa Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to download the kernel over OCD, you need &amp;lt;tt&amp;gt;xt-gdb&amp;lt;/tt&amp;gt;&lt;br /&gt;
which is part of Tensilica&#039;s Xtensa Tools package.  This must be obtained&lt;br /&gt;
from Tensilica, and is not the same toolchain as built by buildroot.&lt;br /&gt;
You also need to install the corresponding Tensilica core package,&lt;br /&gt;
so that the Xtensa Tools know about your particular configured&lt;br /&gt;
Tensilica core.&lt;br /&gt;
&lt;br /&gt;
The toolchain built using buildroot can be configured to&lt;br /&gt;
include GDB, but that version of GDB does not support&lt;br /&gt;
communicating with Tensilica&#039;s Xtensa OCD Daemon, and&lt;br /&gt;
thus cannot be used to download the kernel over OCD.&lt;br /&gt;
&lt;br /&gt;
In this example, it is assumed that the machine hosting the&lt;br /&gt;
Xtensa Tools has access to the &amp;lt;workdir&amp;gt; directory tree.&lt;br /&gt;
&lt;br /&gt;
=== Install and setup the Xtensa OCD Daemon ===&lt;br /&gt;
&lt;br /&gt;
Setup and connect your JTAG probe, etc.&lt;br /&gt;
&lt;br /&gt;
=== Connect a terminal server ===&lt;br /&gt;
&lt;br /&gt;
At 38400 bps 8N1 no flow control to the XTAV60 serial port.&lt;br /&gt;
&lt;br /&gt;
=== Optionally, setup networking ===&lt;br /&gt;
&lt;br /&gt;
This step is optional.&lt;br /&gt;
&lt;br /&gt;
Setup the board&#039;s MAC address using dipswitches&lt;br /&gt;
(see XTAV60 or XTAV200 board docs as appropriate)&lt;br /&gt;
and connect the board to a network that has a&lt;br /&gt;
DHCP server that will respond to that MAC address.&lt;br /&gt;
If you don&#039;t do this step, you&#039;ll simply not have network&lt;br /&gt;
access, and the boot process will take a minute or so longer&lt;br /&gt;
while the kernel times out waiting for a BOOTP response.&lt;br /&gt;
You can edit the kernel configuration and rebuild the kernel&lt;br /&gt;
to avoid using bootp (in particular, remove &amp;quot;ip=bootp&amp;quot; from&lt;br /&gt;
the kernel cmdline).&lt;br /&gt;
&lt;br /&gt;
=== Download and run the kernel ===&lt;br /&gt;
&lt;br /&gt;
Reset the board (see board documentation).&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) target remote &amp;lt;ocdhost&amp;gt;:20000 0&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) reset&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) load&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) set $pc = &amp;amp;_ResetVector&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;ocdhost&amp;gt; is the IP address or DNS name of the machine&lt;br /&gt;
running the Xtensa OCD daemon.  The Linux kernel should&lt;br /&gt;
start booting as soon as &#039;c&#039; (continue) is executed.&lt;br /&gt;
&lt;br /&gt;
You should eventually get a login prompt.&lt;br /&gt;
Just login as root (no password).&lt;br /&gt;
&lt;br /&gt;
Try various Linux commands.  Look at &amp;lt;tt&amp;gt;/bin&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;/sbin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt;, etc to see what&#039;s available.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  no need to setup an NFS or TFTP server.  The filesystem&lt;br /&gt;
is contained within the kernel image.  You may be able to mount&lt;br /&gt;
other filesystems over NFS though, if you wish, after booting.&lt;br /&gt;
&lt;br /&gt;
Recently the MMU was modified to come up uninitialized and it&#039;s&lt;br /&gt;
necessary for the Linux kernel to map the MMU prior to running.&lt;br /&gt;
This means you can&#039;t place breakpoints in the kernel until the&lt;br /&gt;
mapping has been completed. It&#039;s likely worth while looking&lt;br /&gt;
at the example .xt-gdbinit file in the Kernel Xtensa Documentation:&lt;br /&gt;
&lt;br /&gt;
    xtensa-2.6.29-smp-xcc-O3/Documentation/xtensa/gdbmacros/xt-gdbinit&lt;br /&gt;
&lt;br /&gt;
When running on Avnet boards it&#039;s necessary to use a HardWare Breakpoint&lt;br /&gt;
at the kernel symbol &#039;&#039;&#039;set_breakpoints&#039;&#039;&#039; which is near &#039;&#039;&#039; _startup&#039;&#039;&#039; &lt;br /&gt;
and set your early kernel breakpoints once you get to this hardware breakpoint.&lt;br /&gt;
&lt;br /&gt;
With ISS simulation normal breakpoints must be used.&lt;br /&gt;
&lt;br /&gt;
Below is an example snippet from the sample &#039;&#039;&#039;xt-gdbinit&#039;&#039;&#039; script:&lt;br /&gt;
&lt;br /&gt;
    if $debug_hw_breakpoints_supported&lt;br /&gt;
      hbreak set_breakpoints&lt;br /&gt;
    else&lt;br /&gt;
      break set_breakpoints&lt;br /&gt;
    end&lt;br /&gt;
 &lt;br /&gt;
    set var $_startup = $bpnum&lt;br /&gt;
    commands $_startup&lt;br /&gt;
        set_breakpoints&lt;br /&gt;
        delete $_startup&lt;br /&gt;
        info breakpoints&lt;br /&gt;
        set var $doing_commands = 0&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Mounting the Root Filesystem Over NFS ===&lt;br /&gt;
&lt;br /&gt;
If you build more than the minimal set of packages using&lt;br /&gt;
buildroot, the root filesystem can easily grow too large to&lt;br /&gt;
fit comfortably (or at all) inside the kernel.  In this case,&lt;br /&gt;
rather than follow the instructions exactly as above,&lt;br /&gt;
you&#039;ll want to mount the root filesystem over NFS.&lt;br /&gt;
&lt;br /&gt;
You may also want to mount the root filesystem over NFS to&lt;br /&gt;
make changes to the filesystem persistent across runs and&lt;br /&gt;
accessible from your development host.&lt;br /&gt;
&lt;br /&gt;
First you need to install the root filesystem generated&lt;br /&gt;
using buildroot, to a machine that can serve it over NFS.&lt;br /&gt;
Assuming this machine runs Linux, one way to install it is&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;mkdir &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;cd &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;sudo cpio -i -d -m -F &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio --no-absolute-filenames &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You then need to enable the NFS server on your system&lt;br /&gt;
(if not already active), and export this filesystem.&lt;br /&gt;
How you do this depends on your host Linux distribution.&lt;br /&gt;
For example, on some Fedora releases, one might:&lt;br /&gt;
&lt;br /&gt;
* add the export path to &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; using a line such as&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;  *(rw,sync,no_root_squash,no_all_squash,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
* turn on the NFS server if needed:&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* tell the NFS server about the new exported filesystem&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /usr/sbin/exportfs -a&#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /usr/sbin/exportfs -r&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second, follow the instructions in the previous sections,&lt;br /&gt;
then configure the kernel again as follows.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is disabled (rather than enabled as done in previous sections).&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, under the line &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;,&lt;br /&gt;
select the boot parameters line and set it to something like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=&#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039;:&#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039; is the IP address of your NFS server, and &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
is the exported filesystem path.&lt;br /&gt;
&lt;br /&gt;
Another approach is to just specify the ip addresses directly in the CMDLINE&lt;br /&gt;
  &#039;&#039;&#039;CONFIG_CMDLINE=&amp;quot;console=ttyS0,38400 ip=192.168.11.95:192.168.11.220:192.168.11.1:255.255.255.0:HiFi-2 root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.DC_C_233L debug coredump_filter=0xff&amp;quot; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Where the IP addresses are in the form:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Save this configuration, rebuild the kernel, and follow the&lt;br /&gt;
instructions in previous sections to download and run the kernel.&lt;br /&gt;
If everything goes well and is setup correctly, your kernel should&lt;br /&gt;
now boot with a root filesystem mounted over NFS.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the Instruction Set Simulator (ISS) ==&lt;br /&gt;
&lt;br /&gt;
You can build and run a Linux kernel in the Xtensa Instruction Set&lt;br /&gt;
Simulator (ISS).  The following instructions have only been tried&lt;br /&gt;
with an ISS from the RB-2008.3 release of Xtensa Tools.  Bear in&lt;br /&gt;
mind that the XTAV60 port is likely much more stable than the ISS port&lt;br /&gt;
of Linux at this point in time.&lt;br /&gt;
&lt;br /&gt;
Note:  Depending on your host OS version, you may need to install&lt;br /&gt;
Xtensa Tools on a separate machine.&lt;br /&gt;
&lt;br /&gt;
=== Configure and Build the Kernel for ISS ===&lt;br /&gt;
&lt;br /&gt;
Repeat all the same instructions as above for building the kernel for an&lt;br /&gt;
Avnet board, except that when initially configuring the kernel,&lt;br /&gt;
start from a ISS platform template instead. For example for the &lt;br /&gt;
DC233C Variant:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ mkdir build-iss&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ cd linux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa KBUILD_DEFCONFIG=iss_dc233c_defconfig defconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above make example configures the kernel using the default configuration found in&lt;br /&gt;
&#039;&#039;&#039;arch/xtensa/configs/iss_dc233_defconfig&#039;&#039;&#039;. Most important to note is that the&lt;br /&gt;
root file system mounted when Linux boots comes via the targets device &#039;&#039;&#039;/dev/simdisk0&#039;&#039;&#039; &lt;br /&gt;
which is defined in the kernel &#039;&#039;&#039;.config&#039;&#039;&#039; file. For example:&lt;br /&gt;
&lt;br /&gt;
         &#039;&#039;&#039;CONFIG_SIMDISK0_FILENAME=&amp;quot;/export2/DC_C_233L/LINUX_ROOT.ext2&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The SIMDISK file name and VARIANT name are typically configured when running &#039;&#039;&#039;make menuconfig&#039;&#039;&#039;; Ex:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and selecting&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Platform options&#039;&#039;&#039; ---&amp;gt;  &#039;&#039;&#039;Host filename for a simulated device&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and entering the pathname to the .ext2 file there. Ex: &#039;&#039;&#039;/export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You often want to change the VARIANT to the one you desire, Ex: FSF. You do this via &lt;br /&gt;
the top level menu:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Processor type and features ---&amp;gt;  Xtensa Processor Custom Core Variant Name&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the new SIMDISK approach you copy the EXT2 Filesystem file generated by Buildroot&lt;br /&gt;
to a location to be accessed by Xtensa Linux. Ex:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ cp /export2/DC_C_233L/src/buildroot-xtensa-HiFi2-Snapshot/binaries/dc233c/rootfs.xtensa_dc233c.ext2 /export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; There is an old &#039;&#039;&#039;iss_defconfig&#039;&#039;&#039; that tries to use a &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet &lt;br /&gt;
interface that currently isn&#039;t supported.&lt;br /&gt;
Previously with this old iss_defconfig using the &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet interface&lt;br /&gt;
it was suggested to set up the initramfs filesystem, and do the following.&lt;br /&gt;
Under &#039;&#039;&#039;Bus Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;PCI support&#039;&#039;&#039;.&lt;br /&gt;
Under &#039;&#039;&#039;Platform Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;.&lt;br /&gt;
Hopefully we will someday be able to support the use of a network interface with&lt;br /&gt;
ISS simulation and then be able to mount NFS root partitions again. So I&#039;m leaving&lt;br /&gt;
this note for future exploration of this mechanism; Hope you don&#039;t mind the clutter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Continue configuring and building the kernel as usual.&lt;br /&gt;
&lt;br /&gt;
===  Run the Kernel on ISS ===&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ xt-gdb &amp;lt;workdir&amp;gt;/build-iss/arch/xtensa/boot/Image.elf&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) target sim --turbo --memlimit=128&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-iss/vmlinux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) run&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Wait patiently while Linux boots ... (maybe a minute). The setting of the &#039;&#039;&#039;memlimit&#039;&#039;&#039;&lt;br /&gt;
needs to match the PLATFORM_DEFAULT_MEM_SIZE defined in /arch/xtensa/platforms/iss/include/platform/hardware.h.&lt;br /&gt;
Currently this limit us 128 MegaBytes:&lt;br /&gt;
&lt;br /&gt;
    #define PLATFORM_DEFAULT_MEM_SIZE       0x08000000      /* 13,4217,728 128M */&lt;br /&gt;
&lt;br /&gt;
and we will be extending this for the DC233L to take advantage of it&#039;s V3 MMU.   &lt;br /&gt;
&lt;br /&gt;
Login as root (no password).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  Input via ISS is cooked, so everything typed gets echoed.&lt;br /&gt;
Also, time as reported by the kernel does not progress&lt;br /&gt;
according to true wall-clock time:  it currently depends on&lt;br /&gt;
a simulated processor clock, which advances at various speeds&lt;br /&gt;
according to load.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=584</id>
		<title>Instructions for building and booting Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=584"/>
		<updated>2012-06-14T19:24:32Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Download buildroot and the Linux kernel */ Clarify which trees to use&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions explain how to build a toolchain, root filesystem and kernel for Linux running on an Xtensa processor.  These instructions apply specifically to the XTAV60 (LX60) board.&lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.  If you are using the latest development sources, the build process may change, so you should be sure to get the latest version of this document at [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions].  If you are using one of the development snapshot releases, you should use the version of the build instructions included with that snapshot.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on newer Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Xtensa Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&lt;br /&gt;
**  &#039;&#039;&#039;NOTE:&#039;&#039;&#039; this assumes the default selection of packages in buildroot.  Selecting extra packages may require a more recent host OS or more recent version of certain tools.  For example, the default version of &amp;lt;tt&amp;gt;find&amp;lt;/tt&amp;gt; on RHEL4 is too old to allow building all X11 packages in buildroot, so it is necessary to upgrade the host version of &amp;lt;tt&amp;gt;findutils&amp;lt;/tt&amp;gt; on RHEL4 to build these packages.&lt;br /&gt;
&lt;br /&gt;
*  Lines prefixed with &amp;quot;sudo&amp;quot; need to be executed as root.  The rest is best executed as a non-root user.  (It is possible to install &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; as a non-root user if root access is an issue.  How to do this isn&#039;t shown here.)&lt;br /&gt;
&lt;br /&gt;
*  Lines that set environment variables assume a Bourne compatible shell (e.g., /bin/sh or bash), but are easily adapted to other shells.&lt;br /&gt;
&lt;br /&gt;
*  Instructions are assumed executed all in order (e.g., commands assume current directory and environment variables set earlier).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your host system ==&lt;br /&gt;
&lt;br /&gt;
If you are using one of the snapshot releases, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
If you want to work with the latest development sources, you will need&lt;br /&gt;
[[Installing GIT|&amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; installed on your system]].&lt;br /&gt;
&lt;br /&gt;
== Download buildroot and Linux kernel sources ==&lt;br /&gt;
&lt;br /&gt;
The following section describes how to download stable versions&lt;br /&gt;
of buildroot, and of the Linux kernel, for Xtensa cores.&lt;br /&gt;
&lt;br /&gt;
First, create an empty directory &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;&amp;lt;/tt&amp;gt; on a disk with&lt;br /&gt;
at least 4 GB available space.  After the download operations below,&lt;br /&gt;
you&#039;ll end up with the following file structure,&lt;br /&gt;
which is assumed by the rest of this document:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;workdir&amp;gt;/&lt;br /&gt;
            /buildroot&lt;br /&gt;
            /linux&lt;br /&gt;
&lt;br /&gt;
First download the buildroot sources.&lt;br /&gt;
The current stable source repository and branch have strange names,&lt;br /&gt;
bear with me, they&#039;re the correct ones to use.&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  If you happen to have write access to the repository, use &amp;lt;tt&amp;gt;&#039;&#039;&#039;git+ssh:&#039;&#039;&#039;&amp;lt;/tt&amp;gt; instead of &#039;&#039;&#039;&amp;lt;tt&amp;gt;git:&amp;lt;/tt&amp;gt;&#039;&#039;&#039; in the clone command below,&lt;br /&gt;
so that you can later easily push changes back to the repository.&lt;br /&gt;
For more details, see the [http://wiki.linux-xtensa.org/index.php/Repository_Access repository access] page.&lt;br /&gt;
&lt;br /&gt;
Download buildroot as follows:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ cd buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
then the Linux kernel sources:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp.git linux&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
Note how in the first case (buildroot), we use a non default branch,&lt;br /&gt;
so the last two commands setup tracking for that remote branch and&lt;br /&gt;
does a check-out of that branch in the working tree.&lt;br /&gt;
In the second case (linux), we use the default branch (&amp;lt;i&amp;gt;master&amp;lt;/i&amp;gt; branch)&lt;br /&gt;
which gets checked out by default.&lt;br /&gt;
&lt;br /&gt;
Major development updates to buildroot for Xtensa are expected to happen&lt;br /&gt;
in the following repository, mostly in the master branch.&lt;br /&gt;
However, although it has some more recent packages, this repository is often&lt;br /&gt;
in a state of development and not quite as stable as the above.&lt;br /&gt;
So, &#039;&#039;&#039;DON&#039;T DO THIS STEP&#039;&#039;&#039; unless you know what you are doing, and want to&lt;br /&gt;
experiment with this version of buildroot instead of the above.&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa.git buildroot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Install any required processor specific overlay ==&lt;br /&gt;
&lt;br /&gt;
This step is required if you are targeting a custom Xtensa processor.&lt;br /&gt;
If you use a Diamond 232L Standard Core, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
To configure buildroot and the kernel to use a custom Xtensa processor&lt;br /&gt;
configuration, you need to overlay a set of files customized for your&lt;br /&gt;
processor configuration onto toolchain sources (gcc, binutils, gdb, etc)&lt;br /&gt;
and the Linux kernel.  This process has been automated using a script&lt;br /&gt;
located in the buildroot source tree.&lt;br /&gt;
For usage information, you can invoke it without arguments:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
which displays a help message similar to the following:&lt;br /&gt;
&lt;br /&gt;
 xt-buildroot-overlay-install version 1.3&lt;br /&gt;
 Usage:  xt-buildroot-overlay-install &amp;lt;parameters&amp;gt; [&amp;lt;options&amp;gt;]&lt;br /&gt;
 Where &amp;lt;parameters&amp;gt; are:&lt;br /&gt;
   -t file.tgz     Specify path to the Xtensa Linux overlay tarball, typically&lt;br /&gt;
                   &amp;lt;xtensa_root&amp;gt;/src/xtensa-config-overlay.tar.gz&lt;br /&gt;
   -b dir          Path to the base of the buildroot source tree, in which&lt;br /&gt;
                   package specific overlay tarballs get installed.&lt;br /&gt;
   -k dir          Path to the base of the Linux kernel source tree, in which&lt;br /&gt;
                   the Linux kernel specific overlay gets installed.&lt;br /&gt;
   -c config_name  Name for the Xtensa processor configuration as it will be&lt;br /&gt;
                   known to the open source community.  Must be a lowercase&lt;br /&gt;
                   identifier, starting with a letter, consisting of letters&lt;br /&gt;
                   and numbers and underscores, not ending with underscore&lt;br /&gt;
                   and not containing consecutive underscores.  For examples:&lt;br /&gt;
                      dc232b , dc232b_be , mmubasele , fsf , s5000 .&lt;br /&gt;
   -l long_name    Long name for the Xtensa processor configuration, human-&lt;br /&gt;
                   readable with spaces etc allowed (must be quoted).&lt;br /&gt;
                   For example:  &#039;Diamond 232L Standard Core Rev.B (LE)&#039;&lt;br /&gt;
                   Try to keep it within approximately 40 characters.&lt;br /&gt;
 And &amp;lt;options&amp;gt; are:&lt;br /&gt;
   -f              If package specific overlay tarballs already exist in&lt;br /&gt;
                   the destination source tree, overwrite them without asking.&lt;br /&gt;
   --help          Show this usage message.&lt;br /&gt;
&lt;br /&gt;
Note that the Xtensa Linux overlay tarball MUST be obtained from an Xtensa&lt;br /&gt;
core package built using release RB-2008.3 or later.&lt;br /&gt;
&lt;br /&gt;
Here is an example invocation of the overlay installation script:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install -t blinkcore-config-overlay.tar.gz&#039;&#039;&#039; \&lt;br /&gt;
         &#039;&#039;&#039;-b ./buildroot -k ./linux -c superzip -l &amp;quot;ChipCorp SuperZIP Blink Accelerator Core&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The script extracts some relevant information from the overlay tarball,&lt;br /&gt;
presents it along with relevant parameters to the user, and prompts&lt;br /&gt;
for confirmation before proceeding.&lt;br /&gt;
&lt;br /&gt;
The chosen processor name (-c option) must be unique among known Xtensa processors.&lt;br /&gt;
It is also probably wise to avoid names confusingly similar to other (non-Xtensa) processors.&lt;br /&gt;
If you expect at some point to contribute support for your custom processor to the&lt;br /&gt;
open-source community, this name will likely be long-lived.&lt;br /&gt;
(One way to contribute support for a custom processor might be to submit the overlay tarball&lt;br /&gt;
or files to the linux-xtensa.org maintainers.)&lt;br /&gt;
&lt;br /&gt;
In the steps below, buildroot and the Linux kernel must be configured&lt;br /&gt;
(in their respective &amp;lt;code&amp;gt;&#039;&#039;make menuconfig&#039;&#039;&amp;lt;/code&amp;gt; steps) to select&lt;br /&gt;
the &amp;lt;code&amp;gt;&#039;&#039;custom&#039;&#039;&amp;lt;/code&amp;gt; Xtensa processor option.&lt;br /&gt;
This presents an extra configuration menu entry where you must provide&lt;br /&gt;
the name of the Xtensa processor.  Set it to the same name&lt;br /&gt;
as was specified in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option above.&lt;br /&gt;
&lt;br /&gt;
== Build a toolchain and root filesystem using buildroot ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  for more details on generic buildroot topics not covered in this simple how-to,&lt;br /&gt;
see [http://buildroot.uclibc.org/ buildroot.uclibc.org].&lt;br /&gt;
&lt;br /&gt;
=== Configure buildroot ===&lt;br /&gt;
&lt;br /&gt;
The first time you configure buildroot, start with defaults for your Xtensa processor:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;/buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./target/xtensa/setup-config &amp;lt;i&amp;gt;&amp;lt;corename&amp;gt;&amp;lt;/i&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039; is the overlay name of your selected Xtensa or Diamond core&lt;br /&gt;
(e.g., &#039;&#039;&#039;dc233c&#039;&#039;&#039;).  If you omit &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039;, a help message and a list&lt;br /&gt;
of currently installed Tensilica core overlays is displayed.&lt;br /&gt;
&lt;br /&gt;
Optionally, you can then customize your buildroot configuration, such as&lt;br /&gt;
selecting additional packages, setting various parameters, and so on.&lt;br /&gt;
The following make targets provide a &#039;&#039;curses&#039;&#039; (text-based graphical) interface&lt;br /&gt;
for configuring buildroot, the uClibc C library, and busybox, respectively.&lt;br /&gt;
(&#039;&#039;&#039;Note:&#039;&#039;&#039;  You need the &amp;lt;tt&amp;gt;TERM&amp;lt;/tt&amp;gt; environment variable properly set for&lt;br /&gt;
these curses based tools to work.)&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make menuconfig&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make uclibc-menuconfig&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make busybox-menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Build buildroot ===&lt;br /&gt;
&lt;br /&gt;
Just type:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
THIS WILL TAKE A LONG TIME (from about 30 minutes with defaults on a 3 GHz Pentium 4,&lt;br /&gt;
to perhaps an hour or many depending on your system and on whether&lt;br /&gt;
you enabled extra packages in your buildroot configuration).&lt;br /&gt;
&lt;br /&gt;
Wait patiently for the build to complete.  This builds an entire toolchain&lt;br /&gt;
as well as some basic packages, and constructs a root filesystem.&lt;br /&gt;
It might build many more packages if you selected them earlier with menuconfig.&lt;br /&gt;
&lt;br /&gt;
==== If Something Goes Wrong ====&lt;br /&gt;
&lt;br /&gt;
Perhaps you missed some step above and the build fails.  Or you&#039;re just switching to a different processor configuration, or making some change with unknown dependencies.  Either way, you&#039;ll probably need to fix the error and/or make the change, and redo the whole build.  The above &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; command usually works fine if you&lt;br /&gt;
just added a package using menuconfig, but otherwise does not check many dependencies, so it will usually NOT rebuild things that depend on whatever you have fixed or changed.  Here&#039;s one way to retry the make from scratch without having to wipe out the &amp;lt;tt&amp;gt;buildroot&amp;lt;/tt&amp;gt; directory tree completely and start again from the git cloning.&lt;br /&gt;
&lt;br /&gt;
  $ &#039;&#039;&#039;rm -rf *build_xtensa* binaries&#039;&#039;&#039;&lt;br /&gt;
  $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is not necessary to empty the &#039;dl&#039; subdirectory, which contains tarballs downloaded from the Internet, nor the .config file, which contains the buildroot configuration.  Customizations to the uClibc and &amp;lt;tt&amp;gt;busybox&amp;lt;/tt&amp;gt; configurations should have ended up getting saved in target/xtensa/uClibc.config and target/xtensa/busybox-config, respectively, so hopefully are preserved by the above sequence.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the XTAV60, AXAV110, or XTAV200 Boards ==&lt;br /&gt;
&lt;br /&gt;
References to the &#039;&#039;XTAV60 board&#039;&#039; refer to the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica1 LX60 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX60 (XT-AV60) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly, references to the &#039;&#039;XTAV200 board&#039;&#039; refers the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica2 LX200 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX200 (XT-AV200) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure the kernel ===&lt;br /&gt;
&lt;br /&gt;
The kernel build is a two-step process:  configure the kernel, and build it.&lt;br /&gt;
First, before we can do anything with the kernel, set your PATH to&lt;br /&gt;
point to the toolchain built using buildroot.&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; is the name of the Xtensa processor configuration you selected&lt;br /&gt;
when building the toolchain (e.g., &amp;lt;code&amp;gt;dc232b&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Now setup a destination for kernel builds.&lt;br /&gt;
We usually like to have the build directory separate from&lt;br /&gt;
the source directory, so we use &#039;O=&amp;lt;/destination/path&amp;gt;&#039; in&lt;br /&gt;
kernel make commands.  If you&#039;ll be routinely building multiple&lt;br /&gt;
configurations of the Linux kernel, it&#039;s good to have some&lt;br /&gt;
naming conventions for the build directory.  For example,&lt;br /&gt;
to experiment with multiple target platforms but only one&lt;br /&gt;
processor configuration, we include just the platform name here:&lt;br /&gt;
&lt;br /&gt;
   $&#039;&#039;&#039;mkdir build-xtav60&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start with the default kernel configuration for the Avnet board&lt;br /&gt;
(which works on both XTAV60 (LX60), XTAV110 (LX110), and XTAV200 (LX200) boards)&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd linux&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa KBUILD_DEFCONFIG=lx60_defconfig defconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This configures the kernel using the default configuration found in&lt;br /&gt;
&#039;&#039;&#039;arch/xtensa/configs/lx60_defconfig&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;  This kernel configuration has nothing to do with Xtensa&lt;br /&gt;
processor configuration.  That comes next.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now customize this a little bit to select the correct Xtensa processor&lt;br /&gt;
configuration, and to bundle the root filesystem into the kernel:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is enabled.  Underneath that, edit &#039;&#039;&#039;Initramfs source file(s)&#039;&#039;&#039;,&lt;br /&gt;
and enter the path to the cpio formatted root filesystem&lt;br /&gt;
generated by buildroot:&lt;br /&gt;
&lt;br /&gt;
      &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio.gz&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t forget to replace &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039; with the appropriate full path&lt;br /&gt;
and &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; with your Xtensa processor configuration name.)&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Processor type and features&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Xtensa Processor Configuration&#039;&#039;&#039; is correct and matches&lt;br /&gt;
the processor configuration name you used to build the toolchain with buildroot&lt;br /&gt;
(for example, &#039;&#039;dc232b&#039;&#039; for Diamond 232L Rev.B).&lt;br /&gt;
The kernel build selects a toolchain and processor variant specific headers&lt;br /&gt;
based on this selection.&lt;br /&gt;
If the desired processor configuration does not appear explicitly in the list,&lt;br /&gt;
simply select &#039;&#039;&#039;Custom Xtensa processor configuration&#039;&#039;&#039; and enter the&lt;br /&gt;
processor configuration name (all lowercase) into the next menu parameter,&lt;br /&gt;
&#039;&#039;&#039;Xtensa Processor Custom Variant Name&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Back in the main menu, under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;CPU clock rate&#039;&#039;&#039; entry is set correctly according to the following table:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Board !! Frequency selected in XPG &amp;lt;br/&amp;gt;(MHz) !! &#039;&#039;CPU clock rate&#039;&#039; setting &amp;lt;br/&amp;gt;(kHz)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV60  (LX60)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV110 (LX110)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV200 (LX200)&lt;br /&gt;
|  30  || 31250&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 41667&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exit menuconfig, saving your configuration changes.&lt;br /&gt;
&lt;br /&gt;
Backup your configuration outside the build directory.  For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cp ../build-xtav60/.config config.xtav60.saved&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you do a clean rebuild of the kernel (e.g., &amp;quot;rm -rf ../build-xtav60&amp;quot;)&lt;br /&gt;
you can now configure it with simply:&lt;br /&gt;
   $ &#039;&#039;&#039;mkdir ../build-xtav60 ; cp config.xtav60.saved ../build-xtav60/.config&#039;&#039;&#039;&lt;br /&gt;
Of course if you update the kernel, you&#039;ll probably again have to do:&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa  menuconfig&#039;&#039;&#039;&lt;br /&gt;
and save a new copy of your configuration.&lt;br /&gt;
&lt;br /&gt;
=== Build the kernel ===&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The build will issue a few warnings which are normal.&lt;br /&gt;
Once complete, the bootable image is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
and the uncompressed ELF file containing kernel symbols is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
There is also a RedBoot bootable image (if you use RedBoot) in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/zImage.redboot&lt;br /&gt;
&lt;br /&gt;
=== Install Xtensa Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to download the kernel over OCD, you need &amp;lt;tt&amp;gt;xt-gdb&amp;lt;/tt&amp;gt;&lt;br /&gt;
which is part of Tensilica&#039;s Xtensa Tools package.  This must be obtained&lt;br /&gt;
from Tensilica, and is not the same toolchain as built by buildroot.&lt;br /&gt;
You also need to install the corresponding Tensilica core package,&lt;br /&gt;
so that the Xtensa Tools know about your particular configured&lt;br /&gt;
Tensilica core.&lt;br /&gt;
&lt;br /&gt;
The toolchain built using buildroot can be configured to&lt;br /&gt;
include GDB, but that version of GDB does not support&lt;br /&gt;
communicating with Tensilica&#039;s Xtensa OCD Daemon, and&lt;br /&gt;
thus cannot be used to download the kernel over OCD.&lt;br /&gt;
&lt;br /&gt;
In this example, it is assumed that the machine hosting the&lt;br /&gt;
Xtensa Tools has access to the &amp;lt;workdir&amp;gt; directory tree.&lt;br /&gt;
&lt;br /&gt;
=== Install and setup the Xtensa OCD Daemon ===&lt;br /&gt;
&lt;br /&gt;
Setup and connect your JTAG probe, etc.&lt;br /&gt;
&lt;br /&gt;
=== Connect a terminal server ===&lt;br /&gt;
&lt;br /&gt;
At 38400 bps 8N1 no flow control to the XTAV60 serial port.&lt;br /&gt;
&lt;br /&gt;
=== Optionally, setup networking ===&lt;br /&gt;
&lt;br /&gt;
This step is optional.&lt;br /&gt;
&lt;br /&gt;
Setup the board&#039;s MAC address using dipswitches&lt;br /&gt;
(see XTAV60 or XTAV200 board docs as appropriate)&lt;br /&gt;
and connect the board to a network that has a&lt;br /&gt;
DHCP server that will respond to that MAC address.&lt;br /&gt;
If you don&#039;t do this step, you&#039;ll simply not have network&lt;br /&gt;
access, and the boot process will take a minute or so longer&lt;br /&gt;
while the kernel times out waiting for a BOOTP response.&lt;br /&gt;
You can edit the kernel configuration and rebuild the kernel&lt;br /&gt;
to avoid using bootp (in particular, remove &amp;quot;ip=bootp&amp;quot; from&lt;br /&gt;
the kernel cmdline).&lt;br /&gt;
&lt;br /&gt;
=== Download and run the kernel ===&lt;br /&gt;
&lt;br /&gt;
Reset the board (see board documentation).&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) target remote &amp;lt;ocdhost&amp;gt;:20000 0&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) reset&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) load&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) set $pc = &amp;amp;_ResetVector&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;ocdhost&amp;gt; is the IP address or DNS name of the machine&lt;br /&gt;
running the Xtensa OCD daemon.  The Linux kernel should&lt;br /&gt;
start booting as soon as &#039;c&#039; (continue) is executed.&lt;br /&gt;
&lt;br /&gt;
You should eventually get a login prompt.&lt;br /&gt;
Just login as root (no password).&lt;br /&gt;
&lt;br /&gt;
Try various Linux commands.  Look at &amp;lt;tt&amp;gt;/bin&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;/sbin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt;, etc to see what&#039;s available.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  no need to setup an NFS or TFTP server.  The filesystem&lt;br /&gt;
is contained within the kernel image.  You may be able to mount&lt;br /&gt;
other filesystems over NFS though, if you wish, after booting.&lt;br /&gt;
&lt;br /&gt;
Recently the MMU was modified to come up uninitialized and it&#039;s&lt;br /&gt;
necessary for the Linux kernel to map the MMU prior to running.&lt;br /&gt;
This means you can&#039;t place breakpoints in the kernel until the&lt;br /&gt;
mapping has been completed. It&#039;s likely worth while looking&lt;br /&gt;
at the example .xt-gdbinit file in the Kernel Xtensa Documentation:&lt;br /&gt;
&lt;br /&gt;
    xtensa-2.6.29-smp-xcc-O3/Documentation/xtensa/gdbmacros/xt-gdbinit&lt;br /&gt;
&lt;br /&gt;
When running on Avnet boards it&#039;s necessary to use a HardWare Breakpoint&lt;br /&gt;
at the kernel symbol &#039;&#039;&#039;set_breakpoints&#039;&#039;&#039; which is near &#039;&#039;&#039; _startup&#039;&#039;&#039; &lt;br /&gt;
and set your early kernel breakpoints once you get to this hardware breakpoint.&lt;br /&gt;
&lt;br /&gt;
With ISS simulation normal breakpoints must be used.&lt;br /&gt;
&lt;br /&gt;
Below is an example snippet from the sample &#039;&#039;&#039;xt-gdbinit&#039;&#039;&#039; script:&lt;br /&gt;
&lt;br /&gt;
    if $debug_hw_breakpoints_supported&lt;br /&gt;
      hbreak set_breakpoints&lt;br /&gt;
    else&lt;br /&gt;
      break set_breakpoints&lt;br /&gt;
    end&lt;br /&gt;
 &lt;br /&gt;
    set var $_startup = $bpnum&lt;br /&gt;
    commands $_startup&lt;br /&gt;
        set_breakpoints&lt;br /&gt;
        delete $_startup&lt;br /&gt;
        info breakpoints&lt;br /&gt;
        set var $doing_commands = 0&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Mounting the Root Filesystem Over NFS ===&lt;br /&gt;
&lt;br /&gt;
If you build more than the minimal set of packages using&lt;br /&gt;
buildroot, the root filesystem can easily grow too large to&lt;br /&gt;
fit comfortably (or at all) inside the kernel.  In this case,&lt;br /&gt;
rather than follow the instructions exactly as above,&lt;br /&gt;
you&#039;ll want to mount the root filesystem over NFS.&lt;br /&gt;
&lt;br /&gt;
You may also want to mount the root filesystem over NFS to&lt;br /&gt;
make changes to the filesystem persistent across runs and&lt;br /&gt;
accessible from your development host.&lt;br /&gt;
&lt;br /&gt;
First you need to install the root filesystem generated&lt;br /&gt;
using buildroot, to a machine that can serve it over NFS.&lt;br /&gt;
Assuming this machine runs Linux, one way to install it is&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;mkdir &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;cd &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;sudo cpio -i -d -m -F &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio --no-absolute-filenames &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You then need to enable the NFS server on your system&lt;br /&gt;
(if not already active), and export this filesystem.&lt;br /&gt;
How you do this depends on your host Linux distribution.&lt;br /&gt;
For example, on some Fedora releases, one might:&lt;br /&gt;
&lt;br /&gt;
* add the export path to &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; using a line such as&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;  *(rw,sync,no_root_squash,no_all_squash,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
* turn on the NFS server if needed:&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* tell the NFS server about the new exported filesystem&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /usr/sbin/exportfs -a&#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /usr/sbin/exportfs -r&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second, follow the instructions in the previous sections,&lt;br /&gt;
then configure the kernel again as follows.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is disabled (rather than enabled as done in previous sections).&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, under the line &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;,&lt;br /&gt;
select the boot parameters line and set it to something like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=&#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039;:&#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039; is the IP address of your NFS server, and &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
is the exported filesystem path.&lt;br /&gt;
&lt;br /&gt;
Another approach is to just specify the ip addresses directly in the CMDLINE&lt;br /&gt;
  &#039;&#039;&#039;CONFIG_CMDLINE=&amp;quot;console=ttyS0,38400 ip=192.168.11.95:192.168.11.220:192.168.11.1:255.255.255.0:HiFi-2 root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.DC_C_233L debug coredump_filter=0xff&amp;quot; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Where the IP addresses are in the form:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Save this configuration, rebuild the kernel, and follow the&lt;br /&gt;
instructions in previous sections to download and run the kernel.&lt;br /&gt;
If everything goes well and is setup correctly, your kernel should&lt;br /&gt;
now boot with a root filesystem mounted over NFS.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the Instruction Set Simulator (ISS) ==&lt;br /&gt;
&lt;br /&gt;
You can build and run a Linux kernel in the Xtensa Instruction Set&lt;br /&gt;
Simulator (ISS).  The following instructions have only been tried&lt;br /&gt;
with an ISS from the RB-2008.3 release of Xtensa Tools.  Bear in&lt;br /&gt;
mind that the XTAV60 port is likely much more stable than the ISS port&lt;br /&gt;
of Linux at this point in time.&lt;br /&gt;
&lt;br /&gt;
Note:  Depending on your host OS version, you may need to install&lt;br /&gt;
Xtensa Tools on a separate machine.&lt;br /&gt;
&lt;br /&gt;
=== Configure and Build the Kernel for ISS ===&lt;br /&gt;
&lt;br /&gt;
Repeat all the same instructions as above for building the kernel for an&lt;br /&gt;
Avnet board, except that when initially configuring the kernel,&lt;br /&gt;
start from a ISS platform template instead. For example for the &lt;br /&gt;
DC233C Variant:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ mkdir build-iss&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ cd linux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa KBUILD_DEFCONFIG=iss_dc233c_defconfig defconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above make example configures the kernel using the default configuration found in&lt;br /&gt;
&#039;&#039;&#039;arch/xtensa/configs/iss_dc233_defconfig&#039;&#039;&#039;. Most important to note is that the&lt;br /&gt;
root file system mounted when Linux boots comes via the targets device &#039;&#039;&#039;/dev/simdisk0&#039;&#039;&#039; &lt;br /&gt;
which is defined in the kernel &#039;&#039;&#039;.config&#039;&#039;&#039; file. For example:&lt;br /&gt;
&lt;br /&gt;
         &#039;&#039;&#039;CONFIG_SIMDISK0_FILENAME=&amp;quot;/export2/DC_C_233L/LINUX_ROOT.ext2&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The SIMDISK file name and VARIANT name are typically configured when running &#039;&#039;&#039;make menuconfig&#039;&#039;&#039;; Ex:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and selecting&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Platform options&#039;&#039;&#039; ---&amp;gt;  &#039;&#039;&#039;Host filename for a simulated device&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and entering the pathname to the .ext2 file there. Ex: &#039;&#039;&#039;/export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You often want to change the VARIANT to the one you desire, Ex: FSF. You do this via &lt;br /&gt;
the top level menu:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Processor type and features ---&amp;gt;  Xtensa Processor Custom Core Variant Name&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the new SIMDISK approach you copy the EXT2 Filesystem file generated by Buildroot&lt;br /&gt;
to a location to be accessed by Xtensa Linux. Ex:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ cp /export2/DC_C_233L/src/buildroot-xtensa-HiFi2-Snapshot/binaries/dc233c/rootfs.xtensa_dc233c.ext2 /export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; There is an old &#039;&#039;&#039;iss_defconfig&#039;&#039;&#039; that tries to use a &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet &lt;br /&gt;
interface that currently isn&#039;t supported.&lt;br /&gt;
Previously with this old iss_defconfig using the &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet interface&lt;br /&gt;
it was suggested to set up the initramfs filesystem, and do the following.&lt;br /&gt;
Under &#039;&#039;&#039;Bus Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;PCI support&#039;&#039;&#039;.&lt;br /&gt;
Under &#039;&#039;&#039;Platform Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;.&lt;br /&gt;
Hopefully we will someday be able to support the use of a network interface with&lt;br /&gt;
ISS simulation and then be able to mount NFS root partitions again. So I&#039;m leaving&lt;br /&gt;
this note for future exploration of this mechanism; Hope you don&#039;t mind the clutter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Continue configuring and building the kernel as usual.&lt;br /&gt;
&lt;br /&gt;
===  Run the Kernel on ISS ===&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ xt-gdb &amp;lt;workdir&amp;gt;/build-iss/arch/xtensa/boot/Image.elf&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) target sim --turbo --memlimit=128&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-iss/vmlinux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) run&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Wait patiently while Linux boots ... (maybe a minute). The setting of the &#039;&#039;&#039;memlimit&#039;&#039;&#039;&lt;br /&gt;
needs to match the PLATFORM_DEFAULT_MEM_SIZE defined in /arch/xtensa/platforms/iss/include/platform/hardware.h.&lt;br /&gt;
Currently this limit us 128 MegaBytes:&lt;br /&gt;
&lt;br /&gt;
    #define PLATFORM_DEFAULT_MEM_SIZE       0x08000000      /* 13,4217,728 128M */&lt;br /&gt;
&lt;br /&gt;
and we will be extending this for the DC233L to take advantage of it&#039;s V3 MMU.   &lt;br /&gt;
&lt;br /&gt;
Login as root (no password).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  Input via ISS is cooked, so everything typed gets echoed.&lt;br /&gt;
Also, time as reported by the kernel does not progress&lt;br /&gt;
according to true wall-clock time:  it currently depends on&lt;br /&gt;
a simulated processor clock, which advances at various speeds&lt;br /&gt;
according to load.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=567</id>
		<title>Instructions for building and booting Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=567"/>
		<updated>2011-11-11T05:12:21Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Download buildroot and the Linux kernel */ Fix incorrect checkout instructions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions explain how to build a toolchain, root filesystem and kernel for Linux running on an Xtensa processor.  These instructions apply specifically to the XTAV60 (LX60) board.&lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.  If you are using the latest development sources, the build process may change, so you should be sure to get the latest version of this document at [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions].  If you are using one of the development snapshot releases, you should use the version of the build instructions included with that snapshot.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on newer Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Xtensa Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&lt;br /&gt;
**  &#039;&#039;&#039;NOTE:&#039;&#039;&#039; this assumes the default selection of packages in buildroot.  Selecting extra packages may require a more recent host OS or more recent version of certain tools.  For example, the default version of &amp;lt;tt&amp;gt;find&amp;lt;/tt&amp;gt; on RHEL4 is too old to allow building all X11 packages in buildroot, so it is necessary to upgrade the host version of &amp;lt;tt&amp;gt;findutils&amp;lt;/tt&amp;gt; on RHEL4 to build these packages.&lt;br /&gt;
&lt;br /&gt;
*  Lines prefixed with &amp;quot;sudo&amp;quot; need to be executed as root.  The rest is best executed as a non-root user.  (It is possible to install &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; as a non-root user if root access is an issue.  How to do this isn&#039;t shown here.)&lt;br /&gt;
&lt;br /&gt;
*  Lines that set environment variables assume a Bourne compatible shell (e.g., /bin/sh or bash), but are easily adapted to other shells.&lt;br /&gt;
&lt;br /&gt;
*  Instructions are assumed executed all in order (e.g., commands assume current directory and environment variables set earlier).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your host system ==&lt;br /&gt;
&lt;br /&gt;
If you are using one of the snapshot releases, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
If you want to work with the latest development sources, you will need&lt;br /&gt;
[[Installing GIT|&amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; installed on your system]].&lt;br /&gt;
&lt;br /&gt;
== Download buildroot and the Linux kernel ==&lt;br /&gt;
&lt;br /&gt;
The following section describes how to download the latest&lt;br /&gt;
versions of buildroot and of the Linux kernel.&lt;br /&gt;
Skip this step if you are using one of the&lt;br /&gt;
[http://wiki.linux-xtensa.org/index.php/Buildroot_Snapshots snapshot releases].&lt;br /&gt;
&lt;br /&gt;
Adventurous users that want to use the &#039;&#039;&#039;bleeding edge&#039;&#039;&#039; code can execute the following:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa.git buildroot&#039;&#039;&#039;  [NOT RECOMMENDED, NEWER PACKAGES BUT DEVELOPMENT ENVIRONMENT BROKEN]&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp.git linux&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;&amp;lt;/tt&amp;gt; is the path to an empty directory on a disk with&lt;br /&gt;
at least 4 GB available space.  You end up with the following file structure,&lt;br /&gt;
which is assumed by the rest of this document:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;workdir&amp;gt;/&lt;br /&gt;
            /buildroot&lt;br /&gt;
            /linux&lt;br /&gt;
&lt;br /&gt;
The MASTER branch of the buildroot repository is often is a state of development.&lt;br /&gt;
It&#039;s recommended to use the last snapshot for application developers. In the&lt;br /&gt;
case of the Avnet development boards a &#039;snapshot_2+SMP&#039; branch is recommended&lt;br /&gt;
in the currently experimental SMP git repository:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git buildroot&#039;&#039;&#039;         [RECOMEND YOU USE THIS GIT REPO]&lt;br /&gt;
    &#039;&#039;&#039;$ cd buildroot&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
If you happen to have write access to either repository you should change &#039;&#039;&#039;git:&#039;&#039;&#039; to &#039;&#039;&#039;git+ssh:&#039;&#039;&#039;&lt;br /&gt;
For Example:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ git clone git+ssh://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git buildroot&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ cd buildroot&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For more details, see the [http://wiki.linux-xtensa.org/index.php/Repository_Access repository access] page.&lt;br /&gt;
&lt;br /&gt;
== Install any required processor specific overlay ==&lt;br /&gt;
&lt;br /&gt;
This step is required if you are targeting a custom Xtensa processor.&lt;br /&gt;
If you use a Diamond 232L Standard Core, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
To configure buildroot and the kernel to use a custom Xtensa processor&lt;br /&gt;
configuration, you need to overlay a set of files customized for your&lt;br /&gt;
processor configuration onto toolchain sources (gcc, binutils, gdb, etc)&lt;br /&gt;
and the Linux kernel.  This process has been automated using a script&lt;br /&gt;
located in the buildroot source tree.&lt;br /&gt;
For usage information, you can invoke it without arguments:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
which displays a help message similar to the following:&lt;br /&gt;
&lt;br /&gt;
 xt-buildroot-overlay-install version 1.3&lt;br /&gt;
 Usage:  xt-buildroot-overlay-install &amp;lt;parameters&amp;gt; [&amp;lt;options&amp;gt;]&lt;br /&gt;
 Where &amp;lt;parameters&amp;gt; are:&lt;br /&gt;
   -t file.tgz     Specify path to the Xtensa Linux overlay tarball, typically&lt;br /&gt;
                   &amp;lt;xtensa_root&amp;gt;/src/xtensa-config-overlay.tar.gz&lt;br /&gt;
   -b dir          Path to the base of the buildroot source tree, in which&lt;br /&gt;
                   package specific overlay tarballs get installed.&lt;br /&gt;
   -k dir          Path to the base of the Linux kernel source tree, in which&lt;br /&gt;
                   the Linux kernel specific overlay gets installed.&lt;br /&gt;
   -c config_name  Name for the Xtensa processor configuration as it will be&lt;br /&gt;
                   known to the open source community.  Must be a lowercase&lt;br /&gt;
                   identifier, starting with a letter, consisting of letters&lt;br /&gt;
                   and numbers and underscores, not ending with underscore&lt;br /&gt;
                   and not containing consecutive underscores.  For examples:&lt;br /&gt;
                      dc232b , dc232b_be , mmubasele , fsf , s5000 .&lt;br /&gt;
   -l long_name    Long name for the Xtensa processor configuration, human-&lt;br /&gt;
                   readable with spaces etc allowed (must be quoted).&lt;br /&gt;
                   For example:  &#039;Diamond 232L Standard Core Rev.B (LE)&#039;&lt;br /&gt;
                   Try to keep it within approximately 40 characters.&lt;br /&gt;
 And &amp;lt;options&amp;gt; are:&lt;br /&gt;
   -f              If package specific overlay tarballs already exist in&lt;br /&gt;
                   the destination source tree, overwrite them without asking.&lt;br /&gt;
   --help          Show this usage message.&lt;br /&gt;
&lt;br /&gt;
Note that the Xtensa Linux overlay tarball MUST be obtained from an Xtensa&lt;br /&gt;
core package built using release RB-2008.3 or later.&lt;br /&gt;
&lt;br /&gt;
Here is an example invocation of the overlay installation script:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install -t blinkcore-config-overlay.tar.gz&#039;&#039;&#039; \&lt;br /&gt;
         &#039;&#039;&#039;-b ./buildroot -k ./linux -c superzip -l &amp;quot;ChipCorp SuperZIP Blink Accelerator Core&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The script extracts some relevant information from the overlay tarball,&lt;br /&gt;
presents it along with relevant parameters to the user, and prompts&lt;br /&gt;
for confirmation before proceeding.&lt;br /&gt;
&lt;br /&gt;
The chosen processor name (-c option) must be unique among known Xtensa processors.&lt;br /&gt;
It is also probably wise to avoid names confusingly similar to other (non-Xtensa) processors.&lt;br /&gt;
If you expect at some point to contribute support for your custom processor to the&lt;br /&gt;
open-source community, this name will likely be long-lived.&lt;br /&gt;
(One way to contribute support for a custom processor might be to submit the overlay tarball&lt;br /&gt;
or files to the linux-xtensa.org maintainers.)&lt;br /&gt;
&lt;br /&gt;
In the steps below, buildroot and the Linux kernel must be configured&lt;br /&gt;
(in their respective &amp;lt;code&amp;gt;&#039;&#039;make menuconfig&#039;&#039;&amp;lt;/code&amp;gt; steps) to select&lt;br /&gt;
the &amp;lt;code&amp;gt;&#039;&#039;custom&#039;&#039;&amp;lt;/code&amp;gt; Xtensa processor option.&lt;br /&gt;
This presents an extra configuration menu entry where you must provide&lt;br /&gt;
the name of the Xtensa processor.  Set it to the same name&lt;br /&gt;
as was specified in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option above.&lt;br /&gt;
&lt;br /&gt;
== Build a toolchain and root filesystem using buildroot ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  for more details on generic buildroot topics not covered in this simple how-to,&lt;br /&gt;
see [http://buildroot.uclibc.org/ buildroot.uclibc.org].&lt;br /&gt;
&lt;br /&gt;
=== Configure buildroot ===&lt;br /&gt;
&lt;br /&gt;
The first time you configure buildroot, start with defaults for your Xtensa processor:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;/buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./target/xtensa/setup-config &amp;lt;i&amp;gt;&amp;lt;corename&amp;gt;&amp;lt;/i&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039; is the overlay name of your selected Xtensa or Diamond core&lt;br /&gt;
(e.g., &#039;&#039;&#039;dc233c&#039;&#039;&#039;).  If you omit &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039;, a help message and a list&lt;br /&gt;
of currently installed Tensilica core overlays is displayed.&lt;br /&gt;
&lt;br /&gt;
Optionally, you can then customize your buildroot configuration, such as&lt;br /&gt;
selecting additional packages, setting various parameters, and so on.&lt;br /&gt;
The following make targets provide a &#039;&#039;curses&#039;&#039; (text-based graphical) interface&lt;br /&gt;
for configuring buildroot, the uClibc C library, and busybox, respectively.&lt;br /&gt;
(&#039;&#039;&#039;Note:&#039;&#039;&#039;  You need the &amp;lt;tt&amp;gt;TERM&amp;lt;/tt&amp;gt; environment variable properly set for&lt;br /&gt;
these curses based tools to work.)&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make menuconfig&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make uclibc-menuconfig&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make busybox-menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Build buildroot ===&lt;br /&gt;
&lt;br /&gt;
Just type:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
THIS WILL TAKE A LONG TIME (from about 30 minutes with defaults on a 3 GHz Pentium 4,&lt;br /&gt;
to perhaps an hour or many depending on your system and on whether&lt;br /&gt;
you enabled extra packages in your buildroot configuration).&lt;br /&gt;
&lt;br /&gt;
Wait patiently for the build to complete.  This builds an entire toolchain&lt;br /&gt;
as well as some basic packages, and constructs a root filesystem.&lt;br /&gt;
It might build many more packages if you selected them earlier with menuconfig.&lt;br /&gt;
&lt;br /&gt;
==== If Something Goes Wrong ====&lt;br /&gt;
&lt;br /&gt;
Perhaps you missed some step above and the build fails.  Or you&#039;re just switching to a different processor configuration, or making some change with unknown dependencies.  Either way, you&#039;ll probably need to fix the error and/or make the change, and redo the whole build.  The above &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; command usually works fine if you&lt;br /&gt;
just added a package using menuconfig, but otherwise does not check many dependencies, so it will usually NOT rebuild things that depend on whatever you have fixed or changed.  Here&#039;s one way to retry the make from scratch without having to wipe out the &amp;lt;tt&amp;gt;buildroot&amp;lt;/tt&amp;gt; directory tree completely and start again from the git cloning.&lt;br /&gt;
&lt;br /&gt;
  $ &#039;&#039;&#039;rm -rf *build_xtensa* binaries&#039;&#039;&#039;&lt;br /&gt;
  $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is not necessary to empty the &#039;dl&#039; subdirectory, which contains tarballs downloaded from the Internet, nor the .config file, which contains the buildroot configuration.  Customizations to the uClibc and &amp;lt;tt&amp;gt;busybox&amp;lt;/tt&amp;gt; configurations should have ended up getting saved in target/xtensa/uClibc.config and target/xtensa/busybox-config, respectively, so hopefully are preserved by the above sequence.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the XTAV60, AXAV110, or XTAV200 Boards ==&lt;br /&gt;
&lt;br /&gt;
References to the &#039;&#039;XTAV60 board&#039;&#039; refer to the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica1 LX60 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX60 (XT-AV60) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly, references to the &#039;&#039;XTAV200 board&#039;&#039; refers the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica2 LX200 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX200 (XT-AV200) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure the kernel ===&lt;br /&gt;
&lt;br /&gt;
The kernel build is a two-step process:  configure the kernel, and build it.&lt;br /&gt;
First, before we can do anything with the kernel, set your PATH to&lt;br /&gt;
point to the toolchain built using buildroot.&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; is the name of the Xtensa processor configuration you selected&lt;br /&gt;
when building the toolchain (e.g., &amp;lt;code&amp;gt;dc232b&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Now setup a destination for kernel builds.&lt;br /&gt;
We usually like to have the build directory separate from&lt;br /&gt;
the source directory, so we use &#039;O=&amp;lt;/destination/path&amp;gt;&#039; in&lt;br /&gt;
kernel make commands.  If you&#039;ll be routinely building multiple&lt;br /&gt;
configurations of the Linux kernel, it&#039;s good to have some&lt;br /&gt;
naming conventions for the build directory.  For example,&lt;br /&gt;
to experiment with multiple target platforms but only one&lt;br /&gt;
processor configuration, we include just the platform name here:&lt;br /&gt;
&lt;br /&gt;
   $&#039;&#039;&#039;mkdir build-xtav60&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start with the default kernel configuration for the Avnet board&lt;br /&gt;
(which works on both XTAV60 (LX60), XTAV110 (LX110), and XTAV200 (LX200) boards)&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd linux&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa KBUILD_DEFCONFIG=lx60_defconfig defconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This configures the kernel using the default configuration found in&lt;br /&gt;
&#039;&#039;&#039;arch/xtensa/configs/lx60_defconfig&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;  This kernel configuration has nothing to do with Xtensa&lt;br /&gt;
processor configuration.  That comes next.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now customize this a little bit to select the correct Xtensa processor&lt;br /&gt;
configuration, and to bundle the root filesystem into the kernel:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is enabled.  Underneath that, edit &#039;&#039;&#039;Initramfs source file(s)&#039;&#039;&#039;,&lt;br /&gt;
and enter the path to the cpio formatted root filesystem&lt;br /&gt;
generated by buildroot:&lt;br /&gt;
&lt;br /&gt;
      &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio.gz&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t forget to replace &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039; with the appropriate full path&lt;br /&gt;
and &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; with your Xtensa processor configuration name.)&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Processor type and features&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Xtensa Processor Configuration&#039;&#039;&#039; is correct and matches&lt;br /&gt;
the processor configuration name you used to build the toolchain with buildroot&lt;br /&gt;
(for example, &#039;&#039;dc232b&#039;&#039; for Diamond 232L Rev.B).&lt;br /&gt;
The kernel build selects a toolchain and processor variant specific headers&lt;br /&gt;
based on this selection.&lt;br /&gt;
If the desired processor configuration does not appear explicitly in the list,&lt;br /&gt;
simply select &#039;&#039;&#039;Custom Xtensa processor configuration&#039;&#039;&#039; and enter the&lt;br /&gt;
processor configuration name (all lowercase) into the next menu parameter,&lt;br /&gt;
&#039;&#039;&#039;Xtensa Processor Custom Variant Name&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Back in the main menu, under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;CPU clock rate&#039;&#039;&#039; entry is set correctly according to the following table:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Board !! Frequency selected in XPG &amp;lt;br/&amp;gt;(MHz) !! &#039;&#039;CPU clock rate&#039;&#039; setting &amp;lt;br/&amp;gt;(kHz)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV60  (LX60)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV110 (LX110)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV200 (LX200)&lt;br /&gt;
|  30  || 31250&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 41667&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exit menuconfig, saving your configuration changes.&lt;br /&gt;
&lt;br /&gt;
Backup your configuration outside the build directory.  For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cp ../build-xtav60/.config config.xtav60.saved&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you do a clean rebuild of the kernel (e.g., &amp;quot;rm -rf ../build-xtav60&amp;quot;)&lt;br /&gt;
you can now configure it with simply:&lt;br /&gt;
   $ &#039;&#039;&#039;mkdir ../build-xtav60 ; cp config.xtav60.saved ../build-xtav60/.config&#039;&#039;&#039;&lt;br /&gt;
Of course if you update the kernel, you&#039;ll probably again have to do:&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa  menuconfig&#039;&#039;&#039;&lt;br /&gt;
and save a new copy of your configuration.&lt;br /&gt;
&lt;br /&gt;
=== Build the kernel ===&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The build will issue a few warnings which are normal.&lt;br /&gt;
Once complete, the bootable image is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
and the uncompressed ELF file containing kernel symbols is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
There is also a RedBoot bootable image (if you use RedBoot) in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/zImage.redboot&lt;br /&gt;
&lt;br /&gt;
=== Install Xtensa Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to download the kernel over OCD, you need &amp;lt;tt&amp;gt;xt-gdb&amp;lt;/tt&amp;gt;&lt;br /&gt;
which is part of Tensilica&#039;s Xtensa Tools package.  This must be obtained&lt;br /&gt;
from Tensilica, and is not the same toolchain as built by buildroot.&lt;br /&gt;
You also need to install the corresponding Tensilica core package,&lt;br /&gt;
so that the Xtensa Tools know about your particular configured&lt;br /&gt;
Tensilica core.&lt;br /&gt;
&lt;br /&gt;
The toolchain built using buildroot can be configured to&lt;br /&gt;
include GDB, but that version of GDB does not support&lt;br /&gt;
communicating with Tensilica&#039;s Xtensa OCD Daemon, and&lt;br /&gt;
thus cannot be used to download the kernel over OCD.&lt;br /&gt;
&lt;br /&gt;
In this example, it is assumed that the machine hosting the&lt;br /&gt;
Xtensa Tools has access to the &amp;lt;workdir&amp;gt; directory tree.&lt;br /&gt;
&lt;br /&gt;
=== Install and setup the Xtensa OCD Daemon ===&lt;br /&gt;
&lt;br /&gt;
Setup and connect your JTAG probe, etc.&lt;br /&gt;
&lt;br /&gt;
=== Connect a terminal server ===&lt;br /&gt;
&lt;br /&gt;
At 38400 bps 8N1 no flow control to the XTAV60 serial port.&lt;br /&gt;
&lt;br /&gt;
=== Optionally, setup networking ===&lt;br /&gt;
&lt;br /&gt;
This step is optional.&lt;br /&gt;
&lt;br /&gt;
Setup the board&#039;s MAC address using dipswitches&lt;br /&gt;
(see XTAV60 or XTAV200 board docs as appropriate)&lt;br /&gt;
and connect the board to a network that has a&lt;br /&gt;
DHCP server that will respond to that MAC address.&lt;br /&gt;
If you don&#039;t do this step, you&#039;ll simply not have network&lt;br /&gt;
access, and the boot process will take a minute or so longer&lt;br /&gt;
while the kernel times out waiting for a BOOTP response.&lt;br /&gt;
You can edit the kernel configuration and rebuild the kernel&lt;br /&gt;
to avoid using bootp (in particular, remove &amp;quot;ip=bootp&amp;quot; from&lt;br /&gt;
the kernel cmdline).&lt;br /&gt;
&lt;br /&gt;
=== Download and run the kernel ===&lt;br /&gt;
&lt;br /&gt;
Reset the board (see board documentation).&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) target remote &amp;lt;ocdhost&amp;gt;:20000 0&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) reset&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) load&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) set $pc = &amp;amp;_ResetVector&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;ocdhost&amp;gt; is the IP address or DNS name of the machine&lt;br /&gt;
running the Xtensa OCD daemon.  The Linux kernel should&lt;br /&gt;
start booting as soon as &#039;c&#039; (continue) is executed.&lt;br /&gt;
&lt;br /&gt;
You should eventually get a login prompt.&lt;br /&gt;
Just login as root (no password).&lt;br /&gt;
&lt;br /&gt;
Try various Linux commands.  Look at &amp;lt;tt&amp;gt;/bin&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;/sbin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt;, etc to see what&#039;s available.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  no need to setup an NFS or TFTP server.  The filesystem&lt;br /&gt;
is contained within the kernel image.  You may be able to mount&lt;br /&gt;
other filesystems over NFS though, if you wish, after booting.&lt;br /&gt;
&lt;br /&gt;
Recently the MMU was modified to come up uninitialized and it&#039;s&lt;br /&gt;
necessary for the Linux kernel to map the MMU prior to running.&lt;br /&gt;
This means you can&#039;t place breakpoints in the kernel until the&lt;br /&gt;
mapping has been completed. It&#039;s likely worth while looking&lt;br /&gt;
at the example .xt-gdbinit file in the Kernel Xtensa Documentation:&lt;br /&gt;
&lt;br /&gt;
    xtensa-2.6.29-smp-xcc-O3/Documentation/xtensa/gdbmacros/xt-gdbinit&lt;br /&gt;
&lt;br /&gt;
When running on Avnet boards it&#039;s necessary to use a HardWare Breakpoint&lt;br /&gt;
at the kernel symbol &#039;&#039;&#039;set_breakpoints&#039;&#039;&#039; which is near &#039;&#039;&#039; _startup&#039;&#039;&#039; &lt;br /&gt;
and set your early kernel breakpoints once you get to this hardware breakpoint.&lt;br /&gt;
&lt;br /&gt;
With ISS simulation normal breakpoints must be used.&lt;br /&gt;
&lt;br /&gt;
Below is an example snippet from the sample &#039;&#039;&#039;xt-gdbinit&#039;&#039;&#039; script:&lt;br /&gt;
&lt;br /&gt;
    if $debug_hw_breakpoints_supported&lt;br /&gt;
      hbreak set_breakpoints&lt;br /&gt;
    else&lt;br /&gt;
      break set_breakpoints&lt;br /&gt;
    end&lt;br /&gt;
 &lt;br /&gt;
    set var $_startup = $bpnum&lt;br /&gt;
    commands $_startup&lt;br /&gt;
        set_breakpoints&lt;br /&gt;
        delete $_startup&lt;br /&gt;
        info breakpoints&lt;br /&gt;
        set var $doing_commands = 0&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Mounting the Root Filesystem Over NFS ===&lt;br /&gt;
&lt;br /&gt;
If you build more than the minimal set of packages using&lt;br /&gt;
buildroot, the root filesystem can easily grow too large to&lt;br /&gt;
fit comfortably (or at all) inside the kernel.  In this case,&lt;br /&gt;
rather than follow the instructions exactly as above,&lt;br /&gt;
you&#039;ll want to mount the root filesystem over NFS.&lt;br /&gt;
&lt;br /&gt;
You may also want to mount the root filesystem over NFS to&lt;br /&gt;
make changes to the filesystem persistent across runs and&lt;br /&gt;
accessible from your development host.&lt;br /&gt;
&lt;br /&gt;
First you need to install the root filesystem generated&lt;br /&gt;
using buildroot, to a machine that can serve it over NFS.&lt;br /&gt;
Assuming this machine runs Linux, one way to install it is&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;mkdir &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;cd &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;sudo cpio -i -d -m -F &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio --no-absolute-filenames &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You then need to enable the NFS server on your system&lt;br /&gt;
(if not already active), and export this filesystem.&lt;br /&gt;
How you do this depends on your host Linux distribution.&lt;br /&gt;
For example, on some Fedora releases, one might:&lt;br /&gt;
&lt;br /&gt;
* add the export path to &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; using a line such as&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;  *(rw,sync,no_root_squash,no_all_squash,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
* turn on the NFS server if needed:&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* tell the NFS server about the new exported filesystem&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /usr/sbin/exportfs -a&#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /usr/sbin/exportfs -r&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second, follow the instructions in the previous sections,&lt;br /&gt;
then configure the kernel again as follows.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is disabled (rather than enabled as done in previous sections).&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, under the line &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;,&lt;br /&gt;
select the boot parameters line and set it to something like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=&#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039;:&#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039; is the IP address of your NFS server, and &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
is the exported filesystem path.&lt;br /&gt;
&lt;br /&gt;
Another approach is to just specify the ip addresses directly in the CMDLINE&lt;br /&gt;
  &#039;&#039;&#039;CONFIG_CMDLINE=&amp;quot;console=ttyS0,38400 ip=192.168.11.95:192.168.11.220:192.168.11.1:255.255.255.0:HiFi-2 root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.DC_C_233L debug coredump_filter=0xff&amp;quot; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Where the IP addresses are in the form:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Save this configuration, rebuild the kernel, and follow the&lt;br /&gt;
instructions in previous sections to download and run the kernel.&lt;br /&gt;
If everything goes well and is setup correctly, your kernel should&lt;br /&gt;
now boot with a root filesystem mounted over NFS.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the Instruction Set Simulator (ISS) ==&lt;br /&gt;
&lt;br /&gt;
You can build and run a Linux kernel in the Xtensa Instruction Set&lt;br /&gt;
Simulator (ISS).  The following instructions have only been tried&lt;br /&gt;
with an ISS from the RB-2008.3 release of Xtensa Tools.  Bear in&lt;br /&gt;
mind that the XTAV60 port is likely much more stable than the ISS port&lt;br /&gt;
of Linux at this point in time.&lt;br /&gt;
&lt;br /&gt;
Note:  Depending on your host OS version, you may need to install&lt;br /&gt;
Xtensa Tools on a separate machine.&lt;br /&gt;
&lt;br /&gt;
=== Configure and Build the Kernel for ISS ===&lt;br /&gt;
&lt;br /&gt;
Repeat all the same instructions as above for building the kernel for an&lt;br /&gt;
Avnet board, except that when initially configuring the kernel,&lt;br /&gt;
start from a ISS platform template instead. For example for the &lt;br /&gt;
DC233C Variant:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ mkdir build-iss&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ cd linux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa KBUILD_DEFCONFIG=iss_dc233c_defconfig defconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above make example configures the kernel using the default configuration found in&lt;br /&gt;
&#039;&#039;&#039;arch/xtensa/configs/iss_dc233_defconfig&#039;&#039;&#039;. Most important to note is that the&lt;br /&gt;
root file system mounted when Linux boots comes via the targets device &#039;&#039;&#039;/dev/simdisk0&#039;&#039;&#039; &lt;br /&gt;
which is defined in the kernel &#039;&#039;&#039;.config&#039;&#039;&#039; file. For example:&lt;br /&gt;
&lt;br /&gt;
         &#039;&#039;&#039;CONFIG_SIMDISK0_FILENAME=&amp;quot;/export2/DC_C_233L/LINUX_ROOT.ext2&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The SIMDISK file name and VARIANT name are typically configured when running &#039;&#039;&#039;make menuconfig&#039;&#039;&#039;; Ex:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and selecting&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Platform options&#039;&#039;&#039; ---&amp;gt;  &#039;&#039;&#039;Host filename for a simulated device&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and entering the pathname to the .ext2 file there. Ex: &#039;&#039;&#039;/export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You often want to change the VARIANT to the one you desire, Ex: FSF. You do this via &lt;br /&gt;
the top level menu:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Processor type and features ---&amp;gt;  Xtensa Processor Custom Core Variant Name&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the new SIMDISK approach you copy the EXT2 Filesystem file generated by Buildroot&lt;br /&gt;
to a location to be accessed by Xtensa Linux. Ex:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ cp /export2/DC_C_233L/src/buildroot-xtensa-HiFi2-Snapshot/binaries/dc233c/rootfs.xtensa_dc233c.ext2 /export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; There is an old &#039;&#039;&#039;iss_defconfig&#039;&#039;&#039; that tries to use a &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet &lt;br /&gt;
interface that currently isn&#039;t supported.&lt;br /&gt;
Previously with this old iss_defconfig using the &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet interface&lt;br /&gt;
it was suggested to set up the initramfs filesystem, and do the following.&lt;br /&gt;
Under &#039;&#039;&#039;Bus Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;PCI support&#039;&#039;&#039;.&lt;br /&gt;
Under &#039;&#039;&#039;Platform Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;.&lt;br /&gt;
Hopefully we will someday be able to support the use of a network interface with&lt;br /&gt;
ISS simulation and then be able to mount NFS root partitions again. So I&#039;m leaving&lt;br /&gt;
this note for future exploration of this mechanism; Hope you don&#039;t mind the clutter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Continue configuring and building the kernel as usual.&lt;br /&gt;
&lt;br /&gt;
===  Run the Kernel on ISS ===&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ xt-gdb &amp;lt;workdir&amp;gt;/build-iss/arch/xtensa/boot/Image.elf&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) target sim --turbo --memlimit=128&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-iss/vmlinux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) run&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Wait patiently while Linux boots ... (maybe a minute). The setting of the &#039;&#039;&#039;memlimit&#039;&#039;&#039;&lt;br /&gt;
needs to match the PLATFORM_DEFAULT_MEM_SIZE defined in /arch/xtensa/platforms/iss/include/platform/hardware.h.&lt;br /&gt;
Currently this limit us 128 MegaBytes:&lt;br /&gt;
&lt;br /&gt;
    #define PLATFORM_DEFAULT_MEM_SIZE       0x08000000      /* 13,4217,728 128M */&lt;br /&gt;
&lt;br /&gt;
and we will be extending this for the DC233L to take advantage of it&#039;s V3 MMU.   &lt;br /&gt;
&lt;br /&gt;
Login as root (no password).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  Input via ISS is cooked, so everything typed gets echoed.&lt;br /&gt;
Also, time as reported by the kernel does not progress&lt;br /&gt;
according to true wall-clock time:  it currently depends on&lt;br /&gt;
a simulated processor clock, which advances at various speeds&lt;br /&gt;
according to load.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=566</id>
		<title>Instructions for building and booting Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=566"/>
		<updated>2011-11-10T01:03:37Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Download buildroot and the Linux kernel */ Add missing &amp;#039;cd&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions explain how to build a toolchain, root filesystem and kernel for Linux running on an Xtensa processor.  These instructions apply specifically to the XTAV60 (LX60) board.&lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.  If you are using the latest development sources, the build process may change, so you should be sure to get the latest version of this document at [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions].  If you are using one of the development snapshot releases, you should use the version of the build instructions included with that snapshot.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on newer Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Xtensa Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&lt;br /&gt;
**  &#039;&#039;&#039;NOTE:&#039;&#039;&#039; this assumes the default selection of packages in buildroot.  Selecting extra packages may require a more recent host OS or more recent version of certain tools.  For example, the default version of &amp;lt;tt&amp;gt;find&amp;lt;/tt&amp;gt; on RHEL4 is too old to allow building all X11 packages in buildroot, so it is necessary to upgrade the host version of &amp;lt;tt&amp;gt;findutils&amp;lt;/tt&amp;gt; on RHEL4 to build these packages.&lt;br /&gt;
&lt;br /&gt;
*  Lines prefixed with &amp;quot;sudo&amp;quot; need to be executed as root.  The rest is best executed as a non-root user.  (It is possible to install &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; as a non-root user if root access is an issue.  How to do this isn&#039;t shown here.)&lt;br /&gt;
&lt;br /&gt;
*  Lines that set environment variables assume a Bourne compatible shell (e.g., /bin/sh or bash), but are easily adapted to other shells.&lt;br /&gt;
&lt;br /&gt;
*  Instructions are assumed executed all in order (e.g., commands assume current directory and environment variables set earlier).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your host system ==&lt;br /&gt;
&lt;br /&gt;
If you are using one of the snapshot releases, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
If you want to work with the latest development sources, you will need&lt;br /&gt;
[[Installing GIT|&amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; installed on your system]].&lt;br /&gt;
&lt;br /&gt;
== Download buildroot and the Linux kernel ==&lt;br /&gt;
&lt;br /&gt;
The following section describes how to download the latest&lt;br /&gt;
versions of buildroot and of the Linux kernel.&lt;br /&gt;
Skip this step if you are using one of the&lt;br /&gt;
[http://wiki.linux-xtensa.org/index.php/Buildroot_Snapshots snapshot releases].&lt;br /&gt;
&lt;br /&gt;
Adventurous users that want to use the &#039;&#039;&#039;bleeding edge&#039;&#039;&#039; code can execute the following:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa.git buildroot&#039;&#039;&#039;  [NOT RECOMMENDED, NEWER PACKAGES BUT DEVELOPMENT ENVIRONMENT BROKEN]&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp.git linux&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;&amp;lt;/tt&amp;gt; is the path to an empty directory on a disk with&lt;br /&gt;
at least 4 GB available space.  You end up with the following file structure,&lt;br /&gt;
which is assumed by the rest of this document:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;workdir&amp;gt;/&lt;br /&gt;
            /buildroot&lt;br /&gt;
            /linux&lt;br /&gt;
&lt;br /&gt;
The MASTER branch of the buildroot repository is often is a state of development.&lt;br /&gt;
It&#039;s recommended to use the last snapshot for application developers. In the&lt;br /&gt;
case of the Avnet development boards a &#039;snapshot_2+SMP&#039; branch is recommended&lt;br /&gt;
in the currently experimental SMP git repository:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git buildroot&#039;&#039;&#039;         [RECOMEND YOU USE THIS GIT REPO]&lt;br /&gt;
    &#039;&#039;&#039;$ cd buildroot&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git branch --track snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
If you happen to have write access to either repository you should change &#039;&#039;&#039;git:&#039;&#039;&#039; to &#039;&#039;&#039;git+ssh:&#039;&#039;&#039;&lt;br /&gt;
For Example:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ git clone git+ssh://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git buildroot&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ cd buildroot&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git branch --track snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For more details, see the [http://wiki.linux-xtensa.org/index.php/Repository_Access repository access] page.&lt;br /&gt;
&lt;br /&gt;
== Install any required processor specific overlay ==&lt;br /&gt;
&lt;br /&gt;
This step is required if you are targeting a custom Xtensa processor.&lt;br /&gt;
If you use a Diamond 232L Standard Core, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
To configure buildroot and the kernel to use a custom Xtensa processor&lt;br /&gt;
configuration, you need to overlay a set of files customized for your&lt;br /&gt;
processor configuration onto toolchain sources (gcc, binutils, gdb, etc)&lt;br /&gt;
and the Linux kernel.  This process has been automated using a script&lt;br /&gt;
located in the buildroot source tree.&lt;br /&gt;
For usage information, you can invoke it without arguments:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
which displays a help message similar to the following:&lt;br /&gt;
&lt;br /&gt;
 xt-buildroot-overlay-install version 1.3&lt;br /&gt;
 Usage:  xt-buildroot-overlay-install &amp;lt;parameters&amp;gt; [&amp;lt;options&amp;gt;]&lt;br /&gt;
 Where &amp;lt;parameters&amp;gt; are:&lt;br /&gt;
   -t file.tgz     Specify path to the Xtensa Linux overlay tarball, typically&lt;br /&gt;
                   &amp;lt;xtensa_root&amp;gt;/src/xtensa-config-overlay.tar.gz&lt;br /&gt;
   -b dir          Path to the base of the buildroot source tree, in which&lt;br /&gt;
                   package specific overlay tarballs get installed.&lt;br /&gt;
   -k dir          Path to the base of the Linux kernel source tree, in which&lt;br /&gt;
                   the Linux kernel specific overlay gets installed.&lt;br /&gt;
   -c config_name  Name for the Xtensa processor configuration as it will be&lt;br /&gt;
                   known to the open source community.  Must be a lowercase&lt;br /&gt;
                   identifier, starting with a letter, consisting of letters&lt;br /&gt;
                   and numbers and underscores, not ending with underscore&lt;br /&gt;
                   and not containing consecutive underscores.  For examples:&lt;br /&gt;
                      dc232b , dc232b_be , mmubasele , fsf , s5000 .&lt;br /&gt;
   -l long_name    Long name for the Xtensa processor configuration, human-&lt;br /&gt;
                   readable with spaces etc allowed (must be quoted).&lt;br /&gt;
                   For example:  &#039;Diamond 232L Standard Core Rev.B (LE)&#039;&lt;br /&gt;
                   Try to keep it within approximately 40 characters.&lt;br /&gt;
 And &amp;lt;options&amp;gt; are:&lt;br /&gt;
   -f              If package specific overlay tarballs already exist in&lt;br /&gt;
                   the destination source tree, overwrite them without asking.&lt;br /&gt;
   --help          Show this usage message.&lt;br /&gt;
&lt;br /&gt;
Note that the Xtensa Linux overlay tarball MUST be obtained from an Xtensa&lt;br /&gt;
core package built using release RB-2008.3 or later.&lt;br /&gt;
&lt;br /&gt;
Here is an example invocation of the overlay installation script:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install -t blinkcore-config-overlay.tar.gz&#039;&#039;&#039; \&lt;br /&gt;
         &#039;&#039;&#039;-b ./buildroot -k ./linux -c superzip -l &amp;quot;ChipCorp SuperZIP Blink Accelerator Core&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The script extracts some relevant information from the overlay tarball,&lt;br /&gt;
presents it along with relevant parameters to the user, and prompts&lt;br /&gt;
for confirmation before proceeding.&lt;br /&gt;
&lt;br /&gt;
The chosen processor name (-c option) must be unique among known Xtensa processors.&lt;br /&gt;
It is also probably wise to avoid names confusingly similar to other (non-Xtensa) processors.&lt;br /&gt;
If you expect at some point to contribute support for your custom processor to the&lt;br /&gt;
open-source community, this name will likely be long-lived.&lt;br /&gt;
(One way to contribute support for a custom processor might be to submit the overlay tarball&lt;br /&gt;
or files to the linux-xtensa.org maintainers.)&lt;br /&gt;
&lt;br /&gt;
In the steps below, buildroot and the Linux kernel must be configured&lt;br /&gt;
(in their respective &amp;lt;code&amp;gt;&#039;&#039;make menuconfig&#039;&#039;&amp;lt;/code&amp;gt; steps) to select&lt;br /&gt;
the &amp;lt;code&amp;gt;&#039;&#039;custom&#039;&#039;&amp;lt;/code&amp;gt; Xtensa processor option.&lt;br /&gt;
This presents an extra configuration menu entry where you must provide&lt;br /&gt;
the name of the Xtensa processor.  Set it to the same name&lt;br /&gt;
as was specified in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option above.&lt;br /&gt;
&lt;br /&gt;
== Build a toolchain and root filesystem using buildroot ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  for more details on generic buildroot topics not covered in this simple how-to,&lt;br /&gt;
see [http://buildroot.uclibc.org/ buildroot.uclibc.org].&lt;br /&gt;
&lt;br /&gt;
=== Configure buildroot ===&lt;br /&gt;
&lt;br /&gt;
The first time you configure buildroot, start with defaults for your Xtensa processor:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;/buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./target/xtensa/setup-config &amp;lt;i&amp;gt;&amp;lt;corename&amp;gt;&amp;lt;/i&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039; is the overlay name of your selected Xtensa or Diamond core&lt;br /&gt;
(e.g., &#039;&#039;&#039;dc233c&#039;&#039;&#039;).  If you omit &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039;, a help message and a list&lt;br /&gt;
of currently installed Tensilica core overlays is displayed.&lt;br /&gt;
&lt;br /&gt;
Optionally, you can then customize your buildroot configuration, such as&lt;br /&gt;
selecting additional packages, setting various parameters, and so on.&lt;br /&gt;
The following make targets provide a &#039;&#039;curses&#039;&#039; (text-based graphical) interface&lt;br /&gt;
for configuring buildroot, the uClibc C library, and busybox, respectively.&lt;br /&gt;
(&#039;&#039;&#039;Note:&#039;&#039;&#039;  You need the &amp;lt;tt&amp;gt;TERM&amp;lt;/tt&amp;gt; environment variable properly set for&lt;br /&gt;
these curses based tools to work.)&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make menuconfig&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make uclibc-menuconfig&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make busybox-menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Build buildroot ===&lt;br /&gt;
&lt;br /&gt;
Just type:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
THIS WILL TAKE A LONG TIME (from about 30 minutes with defaults on a 3 GHz Pentium 4,&lt;br /&gt;
to perhaps an hour or many depending on your system and on whether&lt;br /&gt;
you enabled extra packages in your buildroot configuration).&lt;br /&gt;
&lt;br /&gt;
Wait patiently for the build to complete.  This builds an entire toolchain&lt;br /&gt;
as well as some basic packages, and constructs a root filesystem.&lt;br /&gt;
It might build many more packages if you selected them earlier with menuconfig.&lt;br /&gt;
&lt;br /&gt;
==== If Something Goes Wrong ====&lt;br /&gt;
&lt;br /&gt;
Perhaps you missed some step above and the build fails.  Or you&#039;re just switching to a different processor configuration, or making some change with unknown dependencies.  Either way, you&#039;ll probably need to fix the error and/or make the change, and redo the whole build.  The above &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; command usually works fine if you&lt;br /&gt;
just added a package using menuconfig, but otherwise does not check many dependencies, so it will usually NOT rebuild things that depend on whatever you have fixed or changed.  Here&#039;s one way to retry the make from scratch without having to wipe out the &amp;lt;tt&amp;gt;buildroot&amp;lt;/tt&amp;gt; directory tree completely and start again from the git cloning.&lt;br /&gt;
&lt;br /&gt;
  $ &#039;&#039;&#039;rm -rf *build_xtensa* binaries&#039;&#039;&#039;&lt;br /&gt;
  $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is not necessary to empty the &#039;dl&#039; subdirectory, which contains tarballs downloaded from the Internet, nor the .config file, which contains the buildroot configuration.  Customizations to the uClibc and &amp;lt;tt&amp;gt;busybox&amp;lt;/tt&amp;gt; configurations should have ended up getting saved in target/xtensa/uClibc.config and target/xtensa/busybox-config, respectively, so hopefully are preserved by the above sequence.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the XTAV60, AXAV110, or XTAV200 Boards ==&lt;br /&gt;
&lt;br /&gt;
References to the &#039;&#039;XTAV60 board&#039;&#039; refer to the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica1 LX60 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX60 (XT-AV60) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly, references to the &#039;&#039;XTAV200 board&#039;&#039; refers the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica2 LX200 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX200 (XT-AV200) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure the kernel ===&lt;br /&gt;
&lt;br /&gt;
The kernel build is a two-step process:  configure the kernel, and build it.&lt;br /&gt;
First, before we can do anything with the kernel, set your PATH to&lt;br /&gt;
point to the toolchain built using buildroot.&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; is the name of the Xtensa processor configuration you selected&lt;br /&gt;
when building the toolchain (e.g., &amp;lt;code&amp;gt;dc232b&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Now setup a destination for kernel builds.&lt;br /&gt;
We usually like to have the build directory separate from&lt;br /&gt;
the source directory, so we use &#039;O=&amp;lt;/destination/path&amp;gt;&#039; in&lt;br /&gt;
kernel make commands.  If you&#039;ll be routinely building multiple&lt;br /&gt;
configurations of the Linux kernel, it&#039;s good to have some&lt;br /&gt;
naming conventions for the build directory.  For example,&lt;br /&gt;
to experiment with multiple target platforms but only one&lt;br /&gt;
processor configuration, we include just the platform name here:&lt;br /&gt;
&lt;br /&gt;
   $&#039;&#039;&#039;mkdir build-xtav60&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start with the default kernel configuration for the Avnet board&lt;br /&gt;
(which works on both XTAV60 (LX60), XTAV110 (LX110), and XTAV200 (LX200) boards)&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd linux&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa KBUILD_DEFCONFIG=lx60_defconfig defconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This configures the kernel using the default configuration found in&lt;br /&gt;
&#039;&#039;&#039;arch/xtensa/configs/lx60_defconfig&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;  This kernel configuration has nothing to do with Xtensa&lt;br /&gt;
processor configuration.  That comes next.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now customize this a little bit to select the correct Xtensa processor&lt;br /&gt;
configuration, and to bundle the root filesystem into the kernel:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is enabled.  Underneath that, edit &#039;&#039;&#039;Initramfs source file(s)&#039;&#039;&#039;,&lt;br /&gt;
and enter the path to the cpio formatted root filesystem&lt;br /&gt;
generated by buildroot:&lt;br /&gt;
&lt;br /&gt;
      &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio.gz&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t forget to replace &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039; with the appropriate full path&lt;br /&gt;
and &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; with your Xtensa processor configuration name.)&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Processor type and features&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Xtensa Processor Configuration&#039;&#039;&#039; is correct and matches&lt;br /&gt;
the processor configuration name you used to build the toolchain with buildroot&lt;br /&gt;
(for example, &#039;&#039;dc232b&#039;&#039; for Diamond 232L Rev.B).&lt;br /&gt;
The kernel build selects a toolchain and processor variant specific headers&lt;br /&gt;
based on this selection.&lt;br /&gt;
If the desired processor configuration does not appear explicitly in the list,&lt;br /&gt;
simply select &#039;&#039;&#039;Custom Xtensa processor configuration&#039;&#039;&#039; and enter the&lt;br /&gt;
processor configuration name (all lowercase) into the next menu parameter,&lt;br /&gt;
&#039;&#039;&#039;Xtensa Processor Custom Variant Name&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Back in the main menu, under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;CPU clock rate&#039;&#039;&#039; entry is set correctly according to the following table:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Board !! Frequency selected in XPG &amp;lt;br/&amp;gt;(MHz) !! &#039;&#039;CPU clock rate&#039;&#039; setting &amp;lt;br/&amp;gt;(kHz)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV60  (LX60)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV110 (LX110)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV200 (LX200)&lt;br /&gt;
|  30  || 31250&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 41667&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exit menuconfig, saving your configuration changes.&lt;br /&gt;
&lt;br /&gt;
Backup your configuration outside the build directory.  For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cp ../build-xtav60/.config config.xtav60.saved&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you do a clean rebuild of the kernel (e.g., &amp;quot;rm -rf ../build-xtav60&amp;quot;)&lt;br /&gt;
you can now configure it with simply:&lt;br /&gt;
   $ &#039;&#039;&#039;mkdir ../build-xtav60 ; cp config.xtav60.saved ../build-xtav60/.config&#039;&#039;&#039;&lt;br /&gt;
Of course if you update the kernel, you&#039;ll probably again have to do:&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa  menuconfig&#039;&#039;&#039;&lt;br /&gt;
and save a new copy of your configuration.&lt;br /&gt;
&lt;br /&gt;
=== Build the kernel ===&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make O=../build-xtav60 ARCH=xtensa&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The build will issue a few warnings which are normal.&lt;br /&gt;
Once complete, the bootable image is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
and the uncompressed ELF file containing kernel symbols is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
There is also a RedBoot bootable image (if you use RedBoot) in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/zImage.redboot&lt;br /&gt;
&lt;br /&gt;
=== Install Xtensa Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to download the kernel over OCD, you need &amp;lt;tt&amp;gt;xt-gdb&amp;lt;/tt&amp;gt;&lt;br /&gt;
which is part of Tensilica&#039;s Xtensa Tools package.  This must be obtained&lt;br /&gt;
from Tensilica, and is not the same toolchain as built by buildroot.&lt;br /&gt;
You also need to install the corresponding Tensilica core package,&lt;br /&gt;
so that the Xtensa Tools know about your particular configured&lt;br /&gt;
Tensilica core.&lt;br /&gt;
&lt;br /&gt;
The toolchain built using buildroot can be configured to&lt;br /&gt;
include GDB, but that version of GDB does not support&lt;br /&gt;
communicating with Tensilica&#039;s Xtensa OCD Daemon, and&lt;br /&gt;
thus cannot be used to download the kernel over OCD.&lt;br /&gt;
&lt;br /&gt;
In this example, it is assumed that the machine hosting the&lt;br /&gt;
Xtensa Tools has access to the &amp;lt;workdir&amp;gt; directory tree.&lt;br /&gt;
&lt;br /&gt;
=== Install and setup the Xtensa OCD Daemon ===&lt;br /&gt;
&lt;br /&gt;
Setup and connect your JTAG probe, etc.&lt;br /&gt;
&lt;br /&gt;
=== Connect a terminal server ===&lt;br /&gt;
&lt;br /&gt;
At 38400 bps 8N1 no flow control to the XTAV60 serial port.&lt;br /&gt;
&lt;br /&gt;
=== Optionally, setup networking ===&lt;br /&gt;
&lt;br /&gt;
This step is optional.&lt;br /&gt;
&lt;br /&gt;
Setup the board&#039;s MAC address using dipswitches&lt;br /&gt;
(see XTAV60 or XTAV200 board docs as appropriate)&lt;br /&gt;
and connect the board to a network that has a&lt;br /&gt;
DHCP server that will respond to that MAC address.&lt;br /&gt;
If you don&#039;t do this step, you&#039;ll simply not have network&lt;br /&gt;
access, and the boot process will take a minute or so longer&lt;br /&gt;
while the kernel times out waiting for a BOOTP response.&lt;br /&gt;
You can edit the kernel configuration and rebuild the kernel&lt;br /&gt;
to avoid using bootp (in particular, remove &amp;quot;ip=bootp&amp;quot; from&lt;br /&gt;
the kernel cmdline).&lt;br /&gt;
&lt;br /&gt;
=== Download and run the kernel ===&lt;br /&gt;
&lt;br /&gt;
Reset the board (see board documentation).&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) target remote &amp;lt;ocdhost&amp;gt;:20000 0&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) reset&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) load&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) set $pc = &amp;amp;_ResetVector&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;ocdhost&amp;gt; is the IP address or DNS name of the machine&lt;br /&gt;
running the Xtensa OCD daemon.  The Linux kernel should&lt;br /&gt;
start booting as soon as &#039;c&#039; (continue) is executed.&lt;br /&gt;
&lt;br /&gt;
You should eventually get a login prompt.&lt;br /&gt;
Just login as root (no password).&lt;br /&gt;
&lt;br /&gt;
Try various Linux commands.  Look at &amp;lt;tt&amp;gt;/bin&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;/sbin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt;, etc to see what&#039;s available.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  no need to setup an NFS or TFTP server.  The filesystem&lt;br /&gt;
is contained within the kernel image.  You may be able to mount&lt;br /&gt;
other filesystems over NFS though, if you wish, after booting.&lt;br /&gt;
&lt;br /&gt;
Recently the MMU was modified to come up uninitialized and it&#039;s&lt;br /&gt;
necessary for the Linux kernel to map the MMU prior to running.&lt;br /&gt;
This means you can&#039;t place breakpoints in the kernel until the&lt;br /&gt;
mapping has been completed. It&#039;s likely worth while looking&lt;br /&gt;
at the example .xt-gdbinit file in the Kernel Xtensa Documentation:&lt;br /&gt;
&lt;br /&gt;
    xtensa-2.6.29-smp-xcc-O3/Documentation/xtensa/gdbmacros/xt-gdbinit&lt;br /&gt;
&lt;br /&gt;
When running on Avnet boards it&#039;s necessary to use a HardWare Breakpoint&lt;br /&gt;
at the kernel symbol &#039;&#039;&#039;set_breakpoints&#039;&#039;&#039; which is near &#039;&#039;&#039; _startup&#039;&#039;&#039; &lt;br /&gt;
and set your early kernel breakpoints once you get to this hardware breakpoint.&lt;br /&gt;
&lt;br /&gt;
With ISS simulation normal breakpoints must be used.&lt;br /&gt;
&lt;br /&gt;
Below is an example snippet from the sample &#039;&#039;&#039;xt-gdbinit&#039;&#039;&#039; script:&lt;br /&gt;
&lt;br /&gt;
    if $debug_hw_breakpoints_supported&lt;br /&gt;
      hbreak set_breakpoints&lt;br /&gt;
    else&lt;br /&gt;
      break set_breakpoints&lt;br /&gt;
    end&lt;br /&gt;
 &lt;br /&gt;
    set var $_startup = $bpnum&lt;br /&gt;
    commands $_startup&lt;br /&gt;
        set_breakpoints&lt;br /&gt;
        delete $_startup&lt;br /&gt;
        info breakpoints&lt;br /&gt;
        set var $doing_commands = 0&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Mounting the Root Filesystem Over NFS ===&lt;br /&gt;
&lt;br /&gt;
If you build more than the minimal set of packages using&lt;br /&gt;
buildroot, the root filesystem can easily grow too large to&lt;br /&gt;
fit comfortably (or at all) inside the kernel.  In this case,&lt;br /&gt;
rather than follow the instructions exactly as above,&lt;br /&gt;
you&#039;ll want to mount the root filesystem over NFS.&lt;br /&gt;
&lt;br /&gt;
You may also want to mount the root filesystem over NFS to&lt;br /&gt;
make changes to the filesystem persistent across runs and&lt;br /&gt;
accessible from your development host.&lt;br /&gt;
&lt;br /&gt;
First you need to install the root filesystem generated&lt;br /&gt;
using buildroot, to a machine that can serve it over NFS.&lt;br /&gt;
Assuming this machine runs Linux, one way to install it is&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;mkdir &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;cd &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;sudo cpio -i -d -m -F &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio --no-absolute-filenames &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You then need to enable the NFS server on your system&lt;br /&gt;
(if not already active), and export this filesystem.&lt;br /&gt;
How you do this depends on your host Linux distribution.&lt;br /&gt;
For example, on some Fedora releases, one might:&lt;br /&gt;
&lt;br /&gt;
* add the export path to &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; using a line such as&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;  *(rw,sync,no_root_squash,no_all_squash,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
* turn on the NFS server if needed:&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* tell the NFS server about the new exported filesystem&lt;br /&gt;
&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /usr/sbin/exportfs -a&#039;&#039;&#039;&lt;br /&gt;
 $ &#039;&#039;&#039;sudo /usr/sbin/exportfs -r&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second, follow the instructions in the previous sections,&lt;br /&gt;
then configure the kernel again as follows.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is disabled (rather than enabled as done in previous sections).&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, under the line &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;,&lt;br /&gt;
select the boot parameters line and set it to something like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=&#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039;:&#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039; is the IP address of your NFS server, and &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
is the exported filesystem path.&lt;br /&gt;
&lt;br /&gt;
Another approach is to just specify the ip addresses directly in the CMDLINE&lt;br /&gt;
  &#039;&#039;&#039;CONFIG_CMDLINE=&amp;quot;console=ttyS0,38400 ip=192.168.11.95:192.168.11.220:192.168.11.1:255.255.255.0:HiFi-2 root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.DC_C_233L debug coredump_filter=0xff&amp;quot; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Where the IP addresses are in the form:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Save this configuration, rebuild the kernel, and follow the&lt;br /&gt;
instructions in previous sections to download and run the kernel.&lt;br /&gt;
If everything goes well and is setup correctly, your kernel should&lt;br /&gt;
now boot with a root filesystem mounted over NFS.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the Instruction Set Simulator (ISS) ==&lt;br /&gt;
&lt;br /&gt;
You can build and run a Linux kernel in the Xtensa Instruction Set&lt;br /&gt;
Simulator (ISS).  The following instructions have only been tried&lt;br /&gt;
with an ISS from the RB-2008.3 release of Xtensa Tools.  Bear in&lt;br /&gt;
mind that the XTAV60 port is likely much more stable than the ISS port&lt;br /&gt;
of Linux at this point in time.&lt;br /&gt;
&lt;br /&gt;
Note:  Depending on your host OS version, you may need to install&lt;br /&gt;
Xtensa Tools on a separate machine.&lt;br /&gt;
&lt;br /&gt;
=== Configure and Build the Kernel for ISS ===&lt;br /&gt;
&lt;br /&gt;
Repeat all the same instructions as above for building the kernel for an&lt;br /&gt;
Avnet board, except that when initially configuring the kernel,&lt;br /&gt;
start from a ISS platform template instead. For example for the &lt;br /&gt;
DC233C Variant:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ mkdir build-iss&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ cd linux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa KBUILD_DEFCONFIG=iss_dc233c_defconfig defconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above make example configures the kernel using the default configuration found in&lt;br /&gt;
&#039;&#039;&#039;arch/xtensa/configs/iss_dc233_defconfig&#039;&#039;&#039;. Most important to note is that the&lt;br /&gt;
root file system mounted when Linux boots comes via the targets device &#039;&#039;&#039;/dev/simdisk0&#039;&#039;&#039; &lt;br /&gt;
which is defined in the kernel &#039;&#039;&#039;.config&#039;&#039;&#039; file. For example:&lt;br /&gt;
&lt;br /&gt;
         &#039;&#039;&#039;CONFIG_SIMDISK0_FILENAME=&amp;quot;/export2/DC_C_233L/LINUX_ROOT.ext2&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The SIMDISK file name and VARIANT name are typically configured when running &#039;&#039;&#039;make menuconfig&#039;&#039;&#039;; Ex:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and selecting&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Platform options&#039;&#039;&#039; ---&amp;gt;  &#039;&#039;&#039;Host filename for a simulated device&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and entering the pathname to the .ext2 file there. Ex: &#039;&#039;&#039;/export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You often want to change the VARIANT to the one you desire, Ex: FSF. You do this via &lt;br /&gt;
the top level menu:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Processor type and features ---&amp;gt;  Xtensa Processor Custom Core Variant Name&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the new SIMDISK approach you copy the EXT2 Filesystem file generated by Buildroot&lt;br /&gt;
to a location to be accessed by Xtensa Linux. Ex:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ cp /export2/DC_C_233L/src/buildroot-xtensa-HiFi2-Snapshot/binaries/dc233c/rootfs.xtensa_dc233c.ext2 /export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; There is an old &#039;&#039;&#039;iss_defconfig&#039;&#039;&#039; that tries to use a &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet &lt;br /&gt;
interface that currently isn&#039;t supported.&lt;br /&gt;
Previously with this old iss_defconfig using the &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet interface&lt;br /&gt;
it was suggested to set up the initramfs filesystem, and do the following.&lt;br /&gt;
Under &#039;&#039;&#039;Bus Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;PCI support&#039;&#039;&#039;.&lt;br /&gt;
Under &#039;&#039;&#039;Platform Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;.&lt;br /&gt;
Hopefully we will someday be able to support the use of a network interface with&lt;br /&gt;
ISS simulation and then be able to mount NFS root partitions again. So I&#039;m leaving&lt;br /&gt;
this note for future exploration of this mechanism; Hope you don&#039;t mind the clutter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Continue configuring and building the kernel as usual.&lt;br /&gt;
&lt;br /&gt;
===  Run the Kernel on ISS ===&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ xt-gdb &amp;lt;workdir&amp;gt;/build-iss/arch/xtensa/boot/Image.elf&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) target sim --turbo --memlimit=128&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-iss/vmlinux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) run&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Wait patiently while Linux boots ... (maybe a minute). The setting of the &#039;&#039;&#039;memlimit&#039;&#039;&#039;&lt;br /&gt;
needs to match the PLATFORM_DEFAULT_MEM_SIZE defined in /arch/xtensa/platforms/iss/include/platform/hardware.h.&lt;br /&gt;
Currently this limit us 128 MegaBytes:&lt;br /&gt;
&lt;br /&gt;
    #define PLATFORM_DEFAULT_MEM_SIZE       0x08000000      /* 13,4217,728 128M */&lt;br /&gt;
&lt;br /&gt;
and we will be extending this for the DC233L to take advantage of it&#039;s V3 MMU.   &lt;br /&gt;
&lt;br /&gt;
Login as root (no password).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  Input via ISS is cooked, so everything typed gets echoed.&lt;br /&gt;
Also, time as reported by the kernel does not progress&lt;br /&gt;
according to true wall-clock time:  it currently depends on&lt;br /&gt;
a simulated processor clock, which advances at various speeds&lt;br /&gt;
according to load.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP-on-Xtensa&amp;diff=490</id>
		<title>SMP-on-Xtensa</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP-on-Xtensa&amp;diff=490"/>
		<updated>2010-05-06T20:43:32Z</updated>

		<summary type="html">&lt;p&gt;Marc: Tidbit of info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here&#039;s a [http://www.linux-xtensa.org/info/smp-interrupt-distrib.pdf diagram] of the interrupt distributor module, used by the initial Xtensa arch port of SMP Linux.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Evaluation_Platforms&amp;diff=489</id>
		<title>Evaluation Platforms</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Evaluation_Platforms&amp;diff=489"/>
		<updated>2010-05-06T20:25:27Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* SMP HiFi 2 Development Board */ Link to minimal SMP info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[image:board.jpg|right]]&lt;br /&gt;
= Evaluation and Prototyping Platforms =&lt;br /&gt;
&lt;br /&gt;
The following boards and simulators can be used for evaluation and prototyping purposes. Evaluation platforms generally fall into one of the following categories:&lt;br /&gt;
* instruction set simulators,&lt;br /&gt;
* emulation systems that use FPGAs to implement any Xtensa or Diamond core (within the capacity of the FPGAs), and&lt;br /&gt;
* boards that integrate a specific configured Xtensa or Diamond core(s) into an ASIC.&lt;br /&gt;
Field programmable gate arrays (FPGA) contain programmable logic that can be re-configured to emulate complex logic. Although slower than the dedicated circuitry of an ASIC (application specific integrated circuit), their re-configurability and practically zero NRE make them very useful for prototyping (for example, trying multiple Xtensa processor variants or configurations) or small volume applications. &lt;br /&gt;
&lt;br /&gt;
== Instruction Set Simulator ==&lt;br /&gt;
&lt;br /&gt;
Instruction Set Simulators (ISS) mimic the behavior of processors by simulating instructions, memory interface, and other I/O components. This allows developers to run and test their software long before real hardware becomes available. Functional simulators provide the best performance, whereas cycle-accurate simulators provide timing accuracy compatible to that of real hardware. The latter simulate the processor pipeline and external components synchronized to a virtual clock. Although this overhead reduces their performance, it can provide vital information to improve the implementation of algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Tensilica ISS ===&lt;br /&gt;
&lt;br /&gt;
[http://www.tensilica.com/ Tensilica] offers a commercial functional simulator (TurboXim) and cycle-accurate simulator for the Xtensa processor architecture, as part of their standard software development tools.  (You may be able to try a free limited time evaluation copy of this toolset.)  Tensilica also offers XTMP and XTSC for modeling systems of one or multiple processors alongside custom functional or cycle-accurate software models for other components.  Please visit [http://www.tensilica.com/ Tensilica&#039;s] website for further information.&lt;br /&gt;
&lt;br /&gt;
The standalone simulator (xt-iss), for example, simply takes an ELF file as its argument and starts simulating instructions from the reset vector. The option &amp;lt;code&amp;gt;--turbo&amp;lt;/code&amp;gt; invokes the (much faster) functional simulator TurboXim.&lt;br /&gt;
&lt;br /&gt;
 xt-iss &#039;&#039;[--turbo]&#039;&#039; Image.elf&lt;br /&gt;
&lt;br /&gt;
== Emulation Platforms and Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Avnet Virtex-4 LX60 and LX200 ===&lt;br /&gt;
&lt;br /&gt;
[http://www.em.avnet.com Avnet] offers the following development platforms for the Xilinx Virtex-4 LX FPGA that can emulate various&lt;br /&gt;
Xtensa processor configurations. The [http://www.em.avnet.com/tensilica1 LX60] is based on the Xilinx 4VLX60 and comes &lt;br /&gt;
with a 10/100 Ethernet PHY, DDR memory, flash memory, serial port, and 2 x 16 character LCD panel. The MAC controller, however, needs to be implemented inside the FPGA. MAC controllers are available from different vendors. [http://opencores.org OpenCores], for example, provides a free Ethernet controller supported by Linux and other operating systems. The [http://www.em.avnet.com/tensilica2 LX200] is based on the Xilinx XC4VLX200 and can emulate more complex processor configurations and extensions (for example the [http://www.tensilica.com/products/hifi_audio.htm HiFi 2 Audio Engine]) and provides the same components as the LX60 except for the LCD panel. &lt;br /&gt;
&lt;br /&gt;
[http://www.tensilica.com Tensilica] provides a bitstream that describes the configuration data to emulate the Diamond Standard DC232L processor (Rev.B) on the LX60 FPGA. Tensilica refers to this board and bitstream combination as the XTAV60 board.  It also includes support for the OpenCores Ethernet MAC. For further information, please, contact [http://www.tensilica.com/company/contact_us.htm Tensilica] directly.&lt;br /&gt;
&lt;br /&gt;
=== SMP HiFi 2 Development Board ===&lt;br /&gt;
Some info is available here on an [[SMP HiFi 2 Development Board]] based on the LX200 board from Tensilica, running [[SMP-on-Xtensa|SMP]] Linux.&lt;br /&gt;
It has three custom Xtensa [http://www.tensilica.com/products/hifi_audio.htm HiFi 2] cores with coherent shared memory, shared and interprocessor interrupts, and the standard LX200 I/O.&lt;br /&gt;
Runs a V2009.8 release of [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-boot]. The board boots a [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=kernel/xtensa-2.6.29-smp.git;a=summary 2.6.29 SMP Linux kernel] and runs a&lt;br /&gt;
snapshot of [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions buildroot] preconfigured with a C development environment, and the [http://www.tensilica.com/products/literature-docs/application-notes/audio-application-notes/using-tensilica-hifi2-codecs-on-xtensa-linux-with-mplayer.htm Mplayer] media player.&lt;br /&gt;
&lt;br /&gt;
=== A2000 Prototype and Development Board ===&lt;br /&gt;
For development a small amount of pre-release, and currently PRIVATE, info is temporally available here on an [[Transwitch A2000 Development Board]] based on the A2000 board from [http://www.transwitch.com/ Transwitch], &lt;br /&gt;
currently running 2.6.29-SMP Linux.&lt;br /&gt;
The [http://www.transwitch.com/products/product/page.jsp?product=190 Atlanta 2000] chip has two super-scalar 400Mhz LX2 Xtensa cores, each with a MMU supporting large caches, PCI, DMA, and quite a few specialized DSP processors for doing Telecommunication.&lt;br /&gt;
The board runs Version 1.4 of [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-boot] which boots a [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=kernel/xtensa-2.6.29-smp.git;a=summary 2.6.29 SMP Linux kernel] that runs a&lt;br /&gt;
snapshot of [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions buildroot] preconfigured with a C development environment or a production snapshot for running out of flash.&lt;br /&gt;
&lt;br /&gt;
=== Eve ZeBu ===&lt;br /&gt;
&lt;br /&gt;
[http://www.eve-team.com Eve] offers an emulation and verification system that can be used to emulate Xtensa processors. Similar to FPGA boards, the ZeBu system emulates the processor, but has a higher capacity to emulate larger processor configurations and additional peripherals. It also provides direct access to signals for debugging and verification.&lt;br /&gt;
&lt;br /&gt;
See the [[Linux on ZeBu]] page or contact [http://www.eve-team.com Eve] directly to request additional information.&lt;br /&gt;
&lt;br /&gt;
== ASIC Evaluation Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Stretch S55DVKxx and S56DVKxx ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stretchinc.com Stretch] provides software-configurable processors based on the Xtensa architecture. The S5000 processor supports Linux, and at 300MHz, it runs 5-10 times faster than FPGA based emulation platforms. The S55DVKxx and S56DVKxx development platforms provide 10/100/1000 Ethernet, serial, PCI (only S56DVKxx), and other interfaces.&lt;br /&gt;
&lt;br /&gt;
The Stretch platforms come with RedBoot as the bootloader. It can download and boot the kernel over network using TFTP or from flash. Make sure that RedBoot is configured with a valid Ethernet address or set to DHCP to obtain a valid address. The following commands load the kernel image &#039;&#039;zImage.redboot&#039;&#039; and boot the kernel:&lt;br /&gt;
&lt;br /&gt;
 RedBoot&amp;gt; load -r -b 0xd0200000 -h 192.168.1.5 zImage.redboot&lt;br /&gt;
 RedBoot&amp;gt; exec 0xd0200000&lt;br /&gt;
&lt;br /&gt;
Note that RedBoot requires that the tftp host is in the same subnet as the board.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Evaluation_Platforms&amp;diff=443</id>
		<title>Evaluation Platforms</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Evaluation_Platforms&amp;diff=443"/>
		<updated>2010-03-24T06:12:43Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* SMP HiFi 2 Development Board */ Update link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[image:board.jpg|right]]&lt;br /&gt;
= Evaluation and Prototyping Platforms =&lt;br /&gt;
&lt;br /&gt;
The following boards and simulators can be used for evaluation and prototyping purposes. Evaluation platforms generally fall into one of the following categories:&lt;br /&gt;
* instruction set simulators,&lt;br /&gt;
* emulation systems that use FPGAs to implement any Xtensa or Diamond core (within the capacity of the FPGAs), and&lt;br /&gt;
* boards that integrate a specific configured Xtensa or Diamond core(s) into an ASIC.&lt;br /&gt;
Field programmable gate arrays (FPGA) contain programmable logic that can be re-configured to emulate complex logic. Although slower than the dedicated circuitry of an ASIC (application specific integrated circuit), their re-configurability and practically zero NRE make them very useful for prototyping (for example, trying multiple Xtensa processor variants or configurations) or small volume applications. &lt;br /&gt;
&lt;br /&gt;
== Instruction Set Simulator ==&lt;br /&gt;
&lt;br /&gt;
Instruction Set Simulators (ISS) mimic the behavior of processors by simulating instructions, memory interface, and other I/O components. This allows developers to run and test their software long before real hardware becomes available. Functional simulators provide the best performance, whereas cycle-accurate simulators provide timing accuracy compatible to that of real hardware. The latter simulate the processor pipeline and external components synchronized to a virtual clock. Although this overhead reduces their performance, it can provide vital information to improve the implementation of algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Tensilica ISS ===&lt;br /&gt;
&lt;br /&gt;
[http://www.tensilica.com/ Tensilica] offers a commercial functional simulator (TurboXim) and cycle-accurate simulator for the Xtensa processor architecture, as part of their standard software development tools.  (You may be able to try a free limited time evaluation copy of this toolset.)  Tensilica also offers XTMP and XTSC for modeling systems of one or multiple processors alongside custom functional or cycle-accurate software models for other components.  Please visit [http://www.tensilica.com/ Tensilica&#039;s] website for further information.&lt;br /&gt;
&lt;br /&gt;
The standalone simulator (xt-iss), for example, simply takes an ELF file as its argument and starts simulating instructions from the reset vector. The option &amp;lt;code&amp;gt;--turbo&amp;lt;/code&amp;gt; invokes the (much faster) functional simulator TurboXim.&lt;br /&gt;
&lt;br /&gt;
 xt-iss &#039;&#039;[--turbo]&#039;&#039; Image.elf&lt;br /&gt;
&lt;br /&gt;
== Emulation Platforms and Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Avnet Virtex-4 LX60 and LX200 ===&lt;br /&gt;
&lt;br /&gt;
[http://www.em.avnet.com Avnet] offers the following development platforms for the Xilinx Virtex-4 LX FPGA that can emulate various&lt;br /&gt;
Xtensa processor configurations. The [http://www.em.avnet.com/tensilica1 LX60] is based on the Xilinx 4VLX60 and comes &lt;br /&gt;
with a 10/100 Ethernet PHY, DDR memory, flash memory, serial port, and 2 x 16 character LCD panel. The MAC controller, however, needs to be implemented inside the FPGA. MAC controllers are available from different vendors. [http://opencores.org OpenCores], for example, provides a free Ethernet controller supported by Linux and other operating systems. The [http://www.em.avnet.com/tensilica2 LX200] is based on the Xilinx XC4VLX200 and can emulate more complex processor configurations and extensions (for example the [http://www.tensilica.com/products/hifi_audio.htm HiFi 2 Audio Engine]) and provides the same components as the LX60 except for the LCD panel. &lt;br /&gt;
&lt;br /&gt;
[http://www.tensilica.com Tensilica] provides a bitstream that describes the configuration data to emulate the Diamond Standard DC232L processor (Rev.B) on the LX60 FPGA. Tensilica refers to this board and bitstream combination as the XTAV60 board.  It also includes support for the OpenCores Ethernet MAC. For further information, please, contact [http://www.tensilica.com/company/contact_us.htm Tensilica] directly.&lt;br /&gt;
&lt;br /&gt;
=== SMP HiFi 2 Development Board ===&lt;br /&gt;
Some info is available on an [[SMP HiFi 2 Development Board]] based on the LX200 board from Tensilica, running SMP Linux.&lt;br /&gt;
It has three custom Xtensa [http://www.tensilica.com/products/hifi_audio.htm HiFi 2] cores with coherent shared memory, shared and interprocessor interrupts, and the standard LX200 I/O.&lt;br /&gt;
Runs a V2009.8 release of [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-boot]. The board boots a [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=kernel/xtensa-2.6.29-smp.git;a=summary 2.6.29 SMP Linux kernel] and runs a&lt;br /&gt;
snapshot of [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions buildroot] preconfigured with a C development environment, and the [http://www.tensilica.com/products/literature-docs/application-notes/audio-application-notes/using-tensilica-hifi2-codecs-on-xtensa-linux-with-mplayer.htm Mplayer] media player.&lt;br /&gt;
&lt;br /&gt;
=== Eve ZeBu ===&lt;br /&gt;
&lt;br /&gt;
[http://www.eve-team.com Eve] offers an emulation and verification system that can be used to emulate Xtensa processors. Similar to FPGA boards, the ZeBu system emulates the processor, but has a higher capacity to emulate larger processor configurations and additional peripherals. It also provides direct access to signals for debugging and verification.&lt;br /&gt;
&lt;br /&gt;
See the [[Linux on ZeBu]] page or contact [http://www.eve-team.com Eve] directly to request additional information.&lt;br /&gt;
&lt;br /&gt;
== ASIC Evaluation Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Stretch S55DVKxx and S56DVKxx ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stretchinc.com Stretch] provides software-configurable processors based on the Xtensa architecture. The S5000 processor supports Linux, and at 300MHz, it runs 5-10 times faster than FPGA based emulation platforms. The S55DVKxx and S56DVKxx development platforms provide 10/100/1000 Ethernet, serial, PCI (only S56DVKxx), and other interfaces.&lt;br /&gt;
&lt;br /&gt;
The Stretch platforms come with RedBoot as the bootloader. It can download and boot the kernel over network using TFTP or from flash. Make sure that RedBoot is configured with a valid Ethernet address or set to DHCP to obtain a valid address. The following commands load the kernel image &#039;&#039;zImage.redboot&#039;&#039; and boot the kernel:&lt;br /&gt;
&lt;br /&gt;
 RedBoot&amp;gt; load -r -b 0xd0200000 -h 192.168.1.5 zImage.redboot&lt;br /&gt;
 RedBoot&amp;gt; exec 0xd0200000&lt;br /&gt;
&lt;br /&gt;
Note that RedBoot requires that the tftp host is in the same subnet as the board.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=371</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=371"/>
		<updated>2009-12-02T08:37:55Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Regular Use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to configure U-Boot to automatically boot the Linux kernel on power-up (using the root file system exported over NFS as described further above).&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing for HiFi 2 ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building Linux Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Host ===&lt;br /&gt;
&lt;br /&gt;
You can use the open source toolchain included in the buildroot tree.&lt;br /&gt;
&lt;br /&gt;
Given the location of the buildroot tree and the name of the core:&lt;br /&gt;
&lt;br /&gt;
   $ setenv BUILDROOT_DIR  /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
   $ setenv CORENAME       test_mmuhifi_c3&lt;br /&gt;
&lt;br /&gt;
You can either set the PATH and invoke tools prefixed with &amp;lt;tt&amp;gt;xtensa_${CORENAME}-linux-&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
   $ setenv PATH   ${BUILDROOT_DIR}/build_xtensa_${CORENAME}/staging_dir/usr/bin:${PATH}&lt;br /&gt;
   $ xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&lt;br /&gt;
   $ xtensa_test_mmuhifi_c3-linux-gdb hello&lt;br /&gt;
&lt;br /&gt;
or alternatively invoke the tools with absolute paths:&lt;br /&gt;
&lt;br /&gt;
   $ ${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&lt;br /&gt;
   $ ${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gdb hello&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Target ===&lt;br /&gt;
This is the simplest.  (Much slower of course at 45 MHz across a slow Ethernet link than on a workstation,&lt;br /&gt;
but convenient.)  Just login to the target system and use the native &amp;lt;tt&amp;gt;cc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using XCC (Xtensa Tools) ===&lt;br /&gt;
&lt;br /&gt;
There are two approaches to compiling with Tensilica&#039;s XCC compiler (part of Xtensa Tools).&lt;br /&gt;
The normal one, described below, is to initially setup a virtual core&lt;br /&gt;
that has built-in references to the library and include files for the target Linux system.&lt;br /&gt;
Alternatively, one could skip this initial setup and just use Xtensa Tools to create&lt;br /&gt;
object files and link them using host or target GCC tools.&lt;br /&gt;
However, such objects must be built without dependencies on such things as the C library,&lt;br /&gt;
which can be harder than it sounds (for example, flags and structures, such as &amp;lt;tt&amp;gt;open()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;O_EXCL&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;stat()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;struct stat&amp;lt;/tt&amp;gt;, must be avoided because their definitions likely differ between the&lt;br /&gt;
Xtensa Tools&#039; default C library and the Linux uClibc library).&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note&#039;&#039;&#039;: Codecs such as MP3 and AAC are typically written in C with TIE extensions and can only be compiled with XCC.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For full details, see the guide.  A summary follows.&lt;br /&gt;
&lt;br /&gt;
==== Initial Setup ====&lt;br /&gt;
&lt;br /&gt;
The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv USER              someuser&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/${USER}/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/${USER}/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
==== Regular Use ====&lt;br /&gt;
&lt;br /&gt;
Assuming the above completed successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables (assuming values of XTENSA_ROOT and XTENSA_TOOLS_ROOT used earlier):&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
Now you can use Xtensa Tools to assemble, compile, and link applications for the Linux target specified during setup.  For example:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
    Hello!&lt;br /&gt;
    [root@hifi ~]#&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
=== Limited (No Setup) Use of Xtensa Tools for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting XCC into our search path and set the standard XTENSA_* environment variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the LX200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpful.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, though&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the LX200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling an audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tarball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Adding a Codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a challenging experience and&lt;br /&gt;
worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=370</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=370"/>
		<updated>2009-12-02T08:26:14Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Configuring U-Boot to Boot Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to configure U-Boot to automatically boot the Linux kernel on power-up (using the root file system exported over NFS as described further above).&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing for HiFi 2 ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building Linux Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Host ===&lt;br /&gt;
&lt;br /&gt;
You can use the open source toolchain included in the buildroot tree.&lt;br /&gt;
&lt;br /&gt;
Given the location of the buildroot tree and the name of the core:&lt;br /&gt;
&lt;br /&gt;
   $ setenv BUILDROOT_DIR  /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
   $ setenv CORENAME       test_mmuhifi_c3&lt;br /&gt;
&lt;br /&gt;
You can either set the PATH and invoke tools prefixed with &amp;lt;tt&amp;gt;xtensa_${CORENAME}-linux-&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
   $ setenv PATH   ${BUILDROOT_DIR}/build_xtensa_${CORENAME}/staging_dir/usr/bin:${PATH}&lt;br /&gt;
   $ xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&lt;br /&gt;
   $ xtensa_test_mmuhifi_c3-linux-gdb hello&lt;br /&gt;
&lt;br /&gt;
or alternatively invoke the tools with absolute paths:&lt;br /&gt;
&lt;br /&gt;
   $ ${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&lt;br /&gt;
   $ ${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gdb hello&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Target ===&lt;br /&gt;
This is the simplest.  (Much slower of course at 45 MHz across a slow Ethernet link than on a workstation,&lt;br /&gt;
but convenient.)  Just login to the target system and use the native &amp;lt;tt&amp;gt;cc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using XCC (Xtensa Tools) ===&lt;br /&gt;
&lt;br /&gt;
There are two approaches to compiling with Tensilica&#039;s XCC compiler (part of Xtensa Tools).&lt;br /&gt;
The normal one, described below, is to initially setup a virtual core&lt;br /&gt;
that has built-in references to the library and include files for the target Linux system.&lt;br /&gt;
Alternatively, one could skip this initial setup and just use Xtensa Tools to create&lt;br /&gt;
object files and link them using host or target GCC tools.&lt;br /&gt;
However, such objects must be built without dependencies on such things as the C library,&lt;br /&gt;
which can be harder than it sounds (for example, flags and structures, such as &amp;lt;tt&amp;gt;open()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;O_EXCL&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;stat()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;struct stat&amp;lt;/tt&amp;gt;, must be avoided because their definitions likely differ between the&lt;br /&gt;
Xtensa Tools&#039; default C library and the Linux uClibc library).&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note&#039;&#039;&#039;: Codecs such as MP3 and AAC are typically written in C with TIE extensions and can only be compiled with XCC.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For full details, see the guide.  A summary follows.&lt;br /&gt;
&lt;br /&gt;
==== Initial Setup ====&lt;br /&gt;
&lt;br /&gt;
The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv USER              someuser&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/${USER}/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/${USER}/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
==== Regular Use ====&lt;br /&gt;
&lt;br /&gt;
Assuming the above completed successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables (assuming values of XTENSA_ROOT and XTENSA_TOOLS_ROOT used earlier):&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
Now you can use Xtensa Tools to assemble, compile, and link applications for the Linux target specified during setup.  For example:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
    Hello!&lt;br /&gt;
    [root@hifi ~]#&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
=== Limited (No Setup) Use of Xtensa Tools for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting XCC into our search path and set the standard XTENSA_* environment variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the LX200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpful.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, though&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the LX200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling an audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tarball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Adding a Codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a challenging experience and&lt;br /&gt;
worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=369</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=369"/>
		<updated>2009-12-02T08:11:11Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Building Linux Applications Using GCC on the Host */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing for HiFi 2 ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building Linux Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Host ===&lt;br /&gt;
&lt;br /&gt;
You can use the open source toolchain included in the buildroot tree.&lt;br /&gt;
&lt;br /&gt;
Given the location of the buildroot tree and the name of the core:&lt;br /&gt;
&lt;br /&gt;
   $ setenv BUILDROOT_DIR  /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
   $ setenv CORENAME       test_mmuhifi_c3&lt;br /&gt;
&lt;br /&gt;
You can either set the PATH and invoke tools prefixed with &amp;lt;tt&amp;gt;xtensa_${CORENAME}-linux-&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
   $ setenv PATH   ${BUILDROOT_DIR}/build_xtensa_${CORENAME}/staging_dir/usr/bin:${PATH}&lt;br /&gt;
   $ xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&lt;br /&gt;
   $ xtensa_test_mmuhifi_c3-linux-gdb hello&lt;br /&gt;
&lt;br /&gt;
or alternatively invoke the tools with absolute paths:&lt;br /&gt;
&lt;br /&gt;
   $ ${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&lt;br /&gt;
   $ ${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gdb hello&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Target ===&lt;br /&gt;
This is the simplest.  (Much slower of course at 45 MHz across a slow Ethernet link than on a workstation,&lt;br /&gt;
but convenient.)  Just login to the target system and use the native &amp;lt;tt&amp;gt;cc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using XCC (Xtensa Tools) ===&lt;br /&gt;
&lt;br /&gt;
There are two approaches to compiling with Tensilica&#039;s XCC compiler (part of Xtensa Tools).&lt;br /&gt;
The normal one, described below, is to initially setup a virtual core&lt;br /&gt;
that has built-in references to the library and include files for the target Linux system.&lt;br /&gt;
Alternatively, one could skip this initial setup and just use Xtensa Tools to create&lt;br /&gt;
object files and link them using host or target GCC tools.&lt;br /&gt;
However, such objects must be built without dependencies on such things as the C library,&lt;br /&gt;
which can be harder than it sounds (for example, flags and structures, such as &amp;lt;tt&amp;gt;open()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;O_EXCL&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;stat()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;struct stat&amp;lt;/tt&amp;gt;, must be avoided because their definitions likely differ between the&lt;br /&gt;
Xtensa Tools&#039; default C library and the Linux uClibc library).&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note&#039;&#039;&#039;: Codecs such as MP3 and AAC are typically written in C with TIE extensions and can only be compiled with XCC.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For full details, see the guide.  A summary follows.&lt;br /&gt;
&lt;br /&gt;
==== Initial Setup ====&lt;br /&gt;
&lt;br /&gt;
The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv USER              someuser&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/${USER}/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/${USER}/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
==== Regular Use ====&lt;br /&gt;
&lt;br /&gt;
Assuming the above completed successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables (assuming values of XTENSA_ROOT and XTENSA_TOOLS_ROOT used earlier):&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
Now you can use Xtensa Tools to assemble, compile, and link applications for the Linux target specified during setup.  For example:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
    Hello!&lt;br /&gt;
    [root@hifi ~]#&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
=== Limited (No Setup) Use of Xtensa Tools for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting XCC into our search path and set the standard XTENSA_* environment variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the LX200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpful.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, though&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the LX200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling an audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tarball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Adding a Codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a challenging experience and&lt;br /&gt;
worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=368</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=368"/>
		<updated>2009-12-02T08:02:10Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Building Linux Applications Using GCC on the Target */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing for HiFi 2 ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building Linux Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Host ===&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Target ===&lt;br /&gt;
This is the simplest.  (Much slower of course at 45 MHz across a slow Ethernet link than on a workstation,&lt;br /&gt;
but convenient.)  Just login to the target system and use the native &amp;lt;tt&amp;gt;cc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using XCC (Xtensa Tools) ===&lt;br /&gt;
&lt;br /&gt;
There are two approaches to compiling with Tensilica&#039;s XCC compiler (part of Xtensa Tools).&lt;br /&gt;
The normal one, described below, is to initially setup a virtual core&lt;br /&gt;
that has built-in references to the library and include files for the target Linux system.&lt;br /&gt;
Alternatively, one could skip this initial setup and just use Xtensa Tools to create&lt;br /&gt;
object files and link them using host or target GCC tools.&lt;br /&gt;
However, such objects must be built without dependencies on such things as the C library,&lt;br /&gt;
which can be harder than it sounds (for example, flags and structures, such as &amp;lt;tt&amp;gt;open()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;O_EXCL&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;stat()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;struct stat&amp;lt;/tt&amp;gt;, must be avoided because their definitions likely differ between the&lt;br /&gt;
Xtensa Tools&#039; default C library and the Linux uClibc library).&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note&#039;&#039;&#039;: Codecs such as MP3 and AAC are typically written in C with TIE extensions and can only be compiled with XCC.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For full details, see the guide.  A summary follows.&lt;br /&gt;
&lt;br /&gt;
==== Initial Setup ====&lt;br /&gt;
&lt;br /&gt;
The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv USER              someuser&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/${USER}/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/${USER}/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
==== Regular Use ====&lt;br /&gt;
&lt;br /&gt;
Assuming the above completed successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables (assuming values of XTENSA_ROOT and XTENSA_TOOLS_ROOT used earlier):&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
Now you can use Xtensa Tools to assemble, compile, and link applications for the Linux target specified during setup.  For example:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
    Hello!&lt;br /&gt;
    [root@hifi ~]#&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
=== Limited (No Setup) Use of Xtensa Tools for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting XCC into our search path and set the standard XTENSA_* environment variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the LX200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpful.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, though&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the LX200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling an audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tarball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Adding a Codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a challenging experience and&lt;br /&gt;
worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=367</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=367"/>
		<updated>2009-12-02T07:57:12Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Building Linux Applications Using XCC (Xtensa Tools) */ Intro and sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing for HiFi 2 ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building Linux Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Host ===&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Target ===&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using XCC (Xtensa Tools) ===&lt;br /&gt;
&lt;br /&gt;
There are two approaches to compiling with Tensilica&#039;s XCC compiler (part of Xtensa Tools).&lt;br /&gt;
The normal one, described below, is to initially setup a virtual core&lt;br /&gt;
that has built-in references to the library and include files for the target Linux system.&lt;br /&gt;
Alternatively, one could skip this initial setup and just use Xtensa Tools to create&lt;br /&gt;
object files and link them using host or target GCC tools.&lt;br /&gt;
However, such objects must be built without dependencies on such things as the C library,&lt;br /&gt;
which can be harder than it sounds (for example, flags and structures, such as &amp;lt;tt&amp;gt;open()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;O_EXCL&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;stat()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;struct stat&amp;lt;/tt&amp;gt;, must be avoided because their definitions likely differ between the&lt;br /&gt;
Xtensa Tools&#039; default C library and the Linux uClibc library).&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note&#039;&#039;&#039;: Codecs such as MP3 and AAC are typically written in C with TIE extensions and can only be compiled with XCC.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For full details, see the guide.  A summary follows.&lt;br /&gt;
&lt;br /&gt;
==== Initial Setup ====&lt;br /&gt;
&lt;br /&gt;
The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv USER              someuser&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/${USER}/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/${USER}/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
==== Regular Use ====&lt;br /&gt;
&lt;br /&gt;
Assuming the above completed successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables (assuming values of XTENSA_ROOT and XTENSA_TOOLS_ROOT used earlier):&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
Now you can use Xtensa Tools to assemble, compile, and link applications for the Linux target specified during setup.  For example:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
    Hello!&lt;br /&gt;
    [root@hifi ~]#&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
=== Limited (No Setup) Use of Xtensa Tools for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting XCC into our search path and set the standard XTENSA_* environment variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the LX200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpful.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, though&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the LX200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling an audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tarball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Adding a Codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a challenging experience and&lt;br /&gt;
worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=366</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=366"/>
		<updated>2009-12-02T07:46:24Z</updated>

		<summary type="html">&lt;p&gt;Marc: Re-order things by relevance&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing for HiFi 2 ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building Linux Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Host ===&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Target ===&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using XCC (Xtensa Tools) ===&lt;br /&gt;
&lt;br /&gt;
Codecs like MP3 and AAC have been written in C with TIE extensions and can only be compiled with XCC.&lt;br /&gt;
&lt;br /&gt;
There are two approaches to compiling with Tensilica&#039;s XCC compiler (part of Xtensa Tools).&lt;br /&gt;
The normal one, described below, is to initially setup a virtual core&lt;br /&gt;
that has built-in references to the library and include files for the target Linux system.&lt;br /&gt;
Alternatively, one could skip this initial setup and just use Xtensa Tools to create&lt;br /&gt;
object files and link them using host or target GCC tools.&lt;br /&gt;
However, such objects must be built without dependencies on such things as the C library,&lt;br /&gt;
which can be harder than it sounds (for example, flags such as &amp;lt;tt&amp;gt;open()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;O_EXCL&amp;lt;/tt&amp;gt;, and structures&lt;br /&gt;
such as &amp;lt;tt&amp;gt;struct stat&amp;lt;/tt&amp;gt; must be avoided, as their definitions likely differ between the&lt;br /&gt;
Xtensa Tools&#039; default C library and the Linux uClibc library).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For details, see the guide.&lt;br /&gt;
&lt;br /&gt;
A summary follows.  The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv USER              someuser&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/${USER}/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/${USER}/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
Assuming the above completes successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables:&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
And build something:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
=== Limited (No Setup) Use of Xtensa Tools for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting XCC into our search path and set the standard XTENSA_* environment variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the LX200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpful.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, though&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the LX200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling an audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tarball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Adding a Codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a challenging experience and&lt;br /&gt;
worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Evaluation_Platforms&amp;diff=363</id>
		<title>Evaluation Platforms</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Evaluation_Platforms&amp;diff=363"/>
		<updated>2009-12-02T07:09:04Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Mplayer HiFi 2 Codec Development Board */ Rename and reword a bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[image:board.jpg|right]]&lt;br /&gt;
= Evaluation and Prototyping Platforms =&lt;br /&gt;
&lt;br /&gt;
The following boards and simulators can be used for evaluation and prototyping purposes. Evaluation platforms generally fall into one of the following categories:&lt;br /&gt;
* instruction set simulators,&lt;br /&gt;
* emulation systems that use FPGAs to implement any Xtensa or Diamond core (within the capacity of the FPGAs), and&lt;br /&gt;
* boards that integrate a specific configured Xtensa or Diamond core(s) into an ASIC.&lt;br /&gt;
Field programmable gate arrays (FPGA) contain programmable logic that can be re-configured to emulate complex logic. Although slower than the dedicated circuitry of an ASIC (application specific integrated circuit), their re-configurability and practically zero NRE make them very useful for prototyping (for example, trying multiple Xtensa processor variants or configurations) or small volume applications. &lt;br /&gt;
&lt;br /&gt;
== Instruction Set Simulator ==&lt;br /&gt;
&lt;br /&gt;
Instruction Set Simulators (ISS) mimic the behavior of processors by simulating instructions, memory interface, and other I/O components. This allows developers to run and test their software long before real hardware becomes available. Functional simulators provide the best performance, whereas cycle-accurate simulators provide timing accuracy compatible to that of real hardware. The latter simulate the processor pipeline and external components synchronized to a virtual clock. Although this overhead reduces their performance, it can provide vital information to improve the implementation of algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Tensilica ISS ===&lt;br /&gt;
&lt;br /&gt;
[http://www.tensilica.com/ Tensilica] offers a commercial functional simulator (TurboXim) and cycle-accurate simulator for the Xtensa processor architecture, as part of their standard software development tools.  (You may be able to try a free limited time evaluation copy of this toolset.)  Tensilica also offers XTMP and XTSC for modeling systems of one or multiple processors alongside custom functional or cycle-accurate software models for other components.  Please visit [http://www.tensilica.com/ Tensilica&#039;s] website for further information.&lt;br /&gt;
&lt;br /&gt;
The standalone simulator (xt-iss), for example, simply takes an ELF file as its argument and starts simulating instructions from the reset vector. The option &amp;lt;code&amp;gt;--turbo&amp;lt;/code&amp;gt; invokes the (much faster) functional simulator TurboXim.&lt;br /&gt;
&lt;br /&gt;
 xt-iss &#039;&#039;[--turbo]&#039;&#039; Image.elf&lt;br /&gt;
&lt;br /&gt;
== Emulation Platforms and Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Avnet Virtex-4 LX60 and LX200 ===&lt;br /&gt;
&lt;br /&gt;
[http://www.em.avnet.com Avnet] offers the following development platforms for the Xilinx Virtex-4 LX FPGA that can emulate various&lt;br /&gt;
Xtensa processor configurations. The [http://www.em.avnet.com/tensilica1 LX60] is based on the Xilinx 4VLX60 and comes &lt;br /&gt;
with a 10/100 Ethernet PHY, DDR memory, flash memory, serial port, and 2 x 16 character LCD panel. The MAC controller, however, needs to be implemented inside the FPGA. MAC controllers are available from different vendors. [http://opencores.org OpenCores], for example, provides a free Ethernet controller supported by Linux and other operating systems. The [http://www.em.avnet.com/tensilica2 LX200] is based on the Xilinx XC4VLX200 and can emulate more complex processor configurations and extensions (for example the [http://www.tensilica.com/products/hifi_audio.htm HiFi 2 Audio Engine]) and provides the same components as the LX60 except for the LCD panel. &lt;br /&gt;
&lt;br /&gt;
[http://www.tensilica.com Tensilica] provides a bitstream that describes the configuration data to emulate the Diamond Standard DC232L processor (Rev.B) on the LX60 FPGA. Tensilica refers to this board and bitstream combination as the XTAV60 board.  It also includes support for the OpenCores Ethernet MAC. For further information, please, contact [http://www.tensilica.com/company/contact_us.htm Tensilica] directly.&lt;br /&gt;
&lt;br /&gt;
=== SMP HiFi 2 Development Board ===&lt;br /&gt;
Some info is available on an [[SMP HiFi 2 Development Board]] based on the LX200 board from Tensilica, running SMP Linux.&lt;br /&gt;
It has three custom Xtensa [http://www.tensilica.com/products/hifi_audio.htm HiFi 2] cores with coherent shared memory, shared and interprocessor interrupts, and the standard LX200 I/O.&lt;br /&gt;
Runs a V2009.8 release of [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-boot]. The board boots a [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=kernel/xtensa-2.6.29-smp;a=summary 2.6.29 SMP Linux kernel] and runs a&lt;br /&gt;
snapshot of [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions buildroot] preconfigured with a C development environment, and the [http://www.tensilica.com/products/literature-docs/application-notes/audio-application-notes/using-tensilica-hifi2-codecs-on-xtensa-linux-with-mplayer.htm Mplayer] media player.&lt;br /&gt;
&lt;br /&gt;
=== Eve ZeBu ===&lt;br /&gt;
&lt;br /&gt;
[http://www.eve-team.com Eve] offers an emulation and verification system that can be used to emulate Xtensa processors. Similar to FPGA boards, the ZeBu system emulates the processor, but has a higher capacity to emulate larger processor configurations and additional peripherals. It also provides direct access to signals for debugging and verification.&lt;br /&gt;
&lt;br /&gt;
See the [[Linux on ZeBu]] page or contact [http://www.eve-team.com Eve] directly to request additional information.&lt;br /&gt;
&lt;br /&gt;
== ASIC Evaluation Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Stretch S55DVKxx and S56DVKxx ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stretchinc.com Stretch] provides software-configurable processors based on the Xtensa architecture. The S5000 processor supports Linux, and at 300MHz, it runs 5-10 times faster than FPGA based emulation platforms. The S55DVKxx and S56DVKxx development platforms provide 10/100/1000 Ethernet, serial, PCI (only S56DVKxx), and other interfaces.&lt;br /&gt;
&lt;br /&gt;
The Stretch platforms come with RedBoot as the bootloader. It can download and boot the kernel over network using TFTP or from flash. Make sure that RedBoot is configured with a valid Ethernet address or set to DHCP to obtain a valid address. The following commands load the kernel image &#039;&#039;zImage.redboot&#039;&#039; and boot the kernel:&lt;br /&gt;
&lt;br /&gt;
 RedBoot&amp;gt; load -r -b 0xd0200000 -h 192.168.1.5 zImage.redboot&lt;br /&gt;
 RedBoot&amp;gt; exec 0xd0200000&lt;br /&gt;
&lt;br /&gt;
Note that RedBoot requires that the tftp host is in the same subnet as the board.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Mplayer_Hifi_2_Codec_Development_Board&amp;diff=362</id>
		<title>Mplayer Hifi 2 Codec Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Mplayer_Hifi_2_Codec_Development_Board&amp;diff=362"/>
		<updated>2009-12-02T07:00:37Z</updated>

		<summary type="html">&lt;p&gt;Marc: Mplayer Hifi 2 Codec Development Board moved to SMP HiFi 2 Development Board: Appropriate title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[SMP HiFi 2 Development Board]]&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=361</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=361"/>
		<updated>2009-12-02T07:00:37Z</updated>

		<summary type="html">&lt;p&gt;Marc: Mplayer Hifi 2 Codec Development Board moved to SMP HiFi 2 Development Board: Appropriate title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing your codec ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the XL200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, lets focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling a audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tar ball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpfull.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, thought&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling Tie Code with XCC ==&lt;br /&gt;
&lt;br /&gt;
Codecs like MP3 and AAC have been written in C with TIE extensions and can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;.&lt;br /&gt;
XCC is likely to large to run on the board without virtual memory. There are two approaches to compiling&lt;br /&gt;
Linux TIE code with &#039;&#039;&#039;xcc&#039;&#039;&#039;. The simple approach assumes the host workstation and target code running of the board&lt;br /&gt;
are similar enough that the library interfaces defined by the include files are compatable. This is often the&lt;br /&gt;
case for standard system calls, libc, and stdio.The proper approach uses a virtual core that we will create&lt;br /&gt;
that has built in references to the library and include files on the target code running on the LX200.&lt;br /&gt;
&lt;br /&gt;
=== Simply using Xtensa Tools to compile the TIE code on a workstation ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting &#039;&#039;&#039;xcc&#039;&#039;&#039; into our search path and set the standard XTENSA_* environement variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the XL200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using Tensilica&#039;s XCC Compiler ===&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For details, see the guide.&lt;br /&gt;
&lt;br /&gt;
A summary follows.  The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/someuser/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/someuser/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
Assuming the above completes successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables:&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
And build something:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
== Adding your codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a chalanging experience and worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=360</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=360"/>
		<updated>2009-12-02T05:48:54Z</updated>

		<summary type="html">&lt;p&gt;Marc: Fix typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing your codec ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the XL200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, lets focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling a audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tar ball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpfull.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, thought&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling Tie Code with XCC ==&lt;br /&gt;
&lt;br /&gt;
Codecs like MP3 and AAC have been written in C with TIE extensions and can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;.&lt;br /&gt;
XCC is likely to large to run on the board without virtual memory. There are two approaches to compiling&lt;br /&gt;
Linux TIE code with &#039;&#039;&#039;xcc&#039;&#039;&#039;. The simple approach assumes the host workstation and target code running of the board&lt;br /&gt;
are similar enough that the library interfaces defined by the include files are compatable. This is often the&lt;br /&gt;
case for standard system calls, libc, and stdio.The proper approach uses a virtual core that we will create&lt;br /&gt;
that has built in references to the library and include files on the target code running on the LX200.&lt;br /&gt;
&lt;br /&gt;
=== Simply using Xtensa Tools to compile the TIE code on a workstation ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting &#039;&#039;&#039;xcc&#039;&#039;&#039; into our search path and set the standard XTENSA_* environement variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the XL200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using Tensilica&#039;s XCC Compiler ===&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For details, see the guide.&lt;br /&gt;
&lt;br /&gt;
A summary follows.  The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/someuser/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/someuser/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
Assuming the above completes successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables:&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
And build something:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
== Adding your codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a chalanging experience and worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=359</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=359"/>
		<updated>2009-12-02T04:24:21Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Booting Linux for the 1st Time */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the &amp;quot;communitee&amp;quot;&amp;quot; guide for how to use HiFi-2 Codec Development environment on an LX200 FPGA board.&lt;br /&gt;
If somethinig doesn&#039;t work ir isn&#039;t vovered in these guides, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux//Xtensa Mailing List]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 codec development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for codec development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFI-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing your codec ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the XL200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, lets focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling a audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tar ball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpfull.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, thought&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling Tie Code with XCC ==&lt;br /&gt;
&lt;br /&gt;
Codecs like MP3 and AAC have been written in C with TIE extensions and can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;.&lt;br /&gt;
XCC is likely to large to run on the board without virtual memory. There are two approaches to compiling&lt;br /&gt;
Linux TIE code with &#039;&#039;&#039;xcc&#039;&#039;&#039;. The simple approach assumes the host workstation and target code running of the board&lt;br /&gt;
are similar enough that the library interfaces defined by the include files are compatable. This is often the&lt;br /&gt;
case for standard system calls, libc, and stdio.The proper approach uses a virtual core that we will create&lt;br /&gt;
that has built in references to the library and include files on the target code running on the LX200.&lt;br /&gt;
&lt;br /&gt;
=== Simply using Xtensa Tools to compile the TIE code on a workstation ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting &#039;&#039;&#039;xcc&#039;&#039;&#039; into our search path and set the standard XTENSA_* environement variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the XL200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using Tensilica&#039;s XCC Compiler ===&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For details, see the guide.&lt;br /&gt;
&lt;br /&gt;
A summary follows.  The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/someuser/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/someuser/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
Assuming the above completes successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables:&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
And build something:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
== Adding your codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a chalanging experience and worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=358</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=358"/>
		<updated>2009-12-02T04:23:36Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Booting Linux for the 1st Time */ Moved example log to separate page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the &amp;quot;communitee&amp;quot;&amp;quot; guide for how to use HiFi-2 Codec Development environment on an LX200 FPGA board.&lt;br /&gt;
If somethinig doesn&#039;t work ir isn&#039;t vovered in these guides, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux//Xtensa Mailing List]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 codec development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for codec development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFI-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing your codec ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the XL200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, lets focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling a audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tar ball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpfull.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, thought&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling Tie Code with XCC ==&lt;br /&gt;
&lt;br /&gt;
Codecs like MP3 and AAC have been written in C with TIE extensions and can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;.&lt;br /&gt;
XCC is likely to large to run on the board without virtual memory. There are two approaches to compiling&lt;br /&gt;
Linux TIE code with &#039;&#039;&#039;xcc&#039;&#039;&#039;. The simple approach assumes the host workstation and target code running of the board&lt;br /&gt;
are similar enough that the library interfaces defined by the include files are compatable. This is often the&lt;br /&gt;
case for standard system calls, libc, and stdio.The proper approach uses a virtual core that we will create&lt;br /&gt;
that has built in references to the library and include files on the target code running on the LX200.&lt;br /&gt;
&lt;br /&gt;
=== Simply using Xtensa Tools to compile the TIE code on a workstation ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting &#039;&#039;&#039;xcc&#039;&#039;&#039; into our search path and set the standard XTENSA_* environement variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the XL200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using Tensilica&#039;s XCC Compiler ===&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For details, see the guide.&lt;br /&gt;
&lt;br /&gt;
A summary follows.  The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/someuser/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/someuser/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
Assuming the above completes successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables:&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
And build something:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
== Adding your codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a chalanging experience and worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=HiFi2_Board_Example_Linux_Boot_Log&amp;diff=357</id>
		<title>HiFi2 Board Example Linux Boot Log</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=HiFi2_Board_Example_Linux_Boot_Log&amp;diff=357"/>
		<updated>2009-12-02T04:22:57Z</updated>

		<summary type="html">&lt;p&gt;Marc: Example log in separate page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;    U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:07&lt;br /&gt;
    IP:     192.168.11.105&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    Autobooting in 5 seconds, press &amp;lt;SPACE&amp;gt; to stop&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.105&lt;br /&gt;
    Filename &#039;uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: #################################################################&lt;br /&gt;
             ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 1161826 (11ba62 hex)&lt;br /&gt;
    Automatic boot of image at addr 0xD2000000 ...&lt;br /&gt;
    ## Booting kernel from Legacy Image at d2000000 ...&lt;br /&gt;
       Image Name:   Linux-2.6.29-rc7&lt;br /&gt;
       Image Type:   Xtensa Linux Kernel Image (gzip compressed)&lt;br /&gt;
       Data Size:    1161762 Bytes =  1.1 MB&lt;br /&gt;
       Load Address: d0001000&lt;br /&gt;
       Entry Point:  d0001000&lt;br /&gt;
       Verifying Checksum ... OK&lt;br /&gt;
       Uncompressing Kernel Image ... OK&lt;br /&gt;
     &lt;br /&gt;
    ## Linux Boot Params Starting At Address:0xd5f50000&lt;br /&gt;
       MEMORY:          tag:0x1003, type:0X1000, start:0X0, end:0X6000000&lt;br /&gt;
       COMMAND_LINE:    tag:0x1001, size:188, data:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;&lt;br /&gt;
       SERIAL_BAUDRATE: tag:0x1004, size:4, baudrate:38400&lt;br /&gt;
    &lt;br /&gt;
    ## Transferring Control to Linux Kernel At Address 0xd0001000 ...&lt;br /&gt;
    &lt;br /&gt;
     &lt;br /&gt;
    &lt;br /&gt;
    parse_bootparam: Ignoring tag 0x1004&lt;br /&gt;
    lx60 platform_init(bootparams:d5f50000)&lt;br /&gt;
    Linux version 2.6.29-rc7 (pdelaney@pdelaney_fc5.hq.tensilica.com) (gcc version 4.2.1) #201 SMP Tue Nov 17 23:49:39 PST 2009&lt;br /&gt;
    lx60 platform_setup(cmdline[0]:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;)&lt;br /&gt;
    smp_init_cpus: Core Count = 3&lt;br /&gt;
    smp_init_cpus: Core Id = 9320&lt;br /&gt;
    On node 0 totalpages: 24576&lt;br /&gt;
    free_area_init_node: node 0, pgdat d0196540, node_mem_map d01fa000&lt;br /&gt;
      Normal zone: 216 pages used for memmap&lt;br /&gt;
      Normal zone: 24360 pages, LIFO batch:3&lt;br /&gt;
    smp_prepare_boot_cpu:&lt;br /&gt;
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 24360&lt;br /&gt;
    Kernel command line: console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&lt;br /&gt;
    trap_init 0&lt;br /&gt;
    PID hash table entries: 512 (order: 9, 2048 bytes)&lt;br /&gt;
    time_init: Platform Calibrating CPU frequency&lt;br /&gt;
    time_init: ccount_per_jiffy:416777 [41.67 MHz], nsec_per_ccount:23&lt;br /&gt;
    Console: colour dummy device 80x25&lt;br /&gt;
    console [ttyS0] enabled&lt;br /&gt;
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)&lt;br /&gt;
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)&lt;br /&gt;
    Memory: 95196k/98304k available (1229k kernel code, 3040k reserved, 28k data, 72k init 0k highmem)&lt;br /&gt;
    Calibrating delay loop... 41.26 BogoMIPS (lpj=206336)&lt;br /&gt;
    Mount-cache hash table entries: 512&lt;br /&gt;
    cpu 1 fffd&lt;br /&gt;
    secondary_trap_init 1&lt;br /&gt;
    Calibrating delay loop... 41.67 BogoMIPS (lpj=208384)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:1, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:1, INTENABLE:7d&lt;br /&gt;
    cpu 2 fff9&lt;br /&gt;
    secondary_trap_init 2&lt;br /&gt;
    Calibrating delay loop... 41.57 BogoMIPS (lpj=207872)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:2, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:2, INTENABLE:7d&lt;br /&gt;
    Brought up 3 CPUs&lt;br /&gt;
    smp_cpus_done:&lt;br /&gt;
    net_namespace: 304 bytes&lt;br /&gt;
    NET: Registered protocol family 16&lt;br /&gt;
    lx60_init()&lt;br /&gt;
    bio: create slab &amp;lt;bio-0&amp;gt; at 0&lt;br /&gt;
    NET: Registered protocol family 2&lt;br /&gt;
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)&lt;br /&gt;
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP bind hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP: Hash tables configured (established 4096 bind 4096)&lt;br /&gt;
    TCP reno registered&lt;br /&gt;
   NET: Registered protocol family 1&lt;br /&gt;
    msgmni has been set to 186&lt;br /&gt;
    alg: No test for md5 (md5-generic)&lt;br /&gt;
    alg: No test for des (des-generic)&lt;br /&gt;
    alg: No test for des3_ede (des3_ede-generic)&lt;br /&gt;
    alg: No test for stdrng (krng)&lt;br /&gt;
    io scheduler noop registered (default)&lt;br /&gt;
    Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled&lt;br /&gt;
    serial8250: ttyS0 at MMIO 0x0 (irq = 3) is a 16550A&lt;br /&gt;
    oeth_probe: {&lt;br /&gt;
    oeth_setup: Open Ethernet Core Version 1.0.1&lt;br /&gt;
     : oeth_setup: Found id1:2000, id2:5c30 at phy_id:3.&lt;br /&gt;
     : Hardware MAC Address: 00:50:c2:13:6f:0f&lt;br /&gt;
    eth0 (): not using net_device_ops yet&lt;br /&gt;
    oeth_probe: }&lt;br /&gt;
    mice: PS/2 mouse device common for all mice&lt;br /&gt;
    TCP cubic registered&lt;br /&gt;
    NET: Registered protocol family 17&lt;br /&gt;
    RPC: Registered udp transport module.&lt;br /&gt;
    RPC: Registered tcp transport module.&lt;br /&gt;
    oeth_open:  Ready to process packets now on dev-&amp;gt;name:&#039;eth0&#039;, dev:d597d800;&lt;br /&gt;
    IP-Config: Complete:&lt;br /&gt;
         device=eth0, addr=192.168.11.105, mask=255.255.255.0, gw=192.168.11.1,&lt;br /&gt;
         host=&amp;quot;HiFi-2 Demo&amp;quot;, domain=, nis-domain=(none),&lt;br /&gt;
         bootserver=192.168.11.55, rootserver=192.168.11.55, rootpath=&lt;br /&gt;
    Looking up port of RPC 100003/2 on 192.168.11.55&lt;br /&gt;
    Looking up port of RPC 100005/1 on 192.168.11.55&lt;br /&gt;
    VFS: Mounted root (nfs filesystem) on device 0:11.&lt;br /&gt;
    Freeing unused kernel memory: 72k freed&lt;br /&gt;
    Starting portmap: done&lt;br /&gt;
    Initializing random number generator... done.&lt;br /&gt;
    Starting network...&lt;br /&gt;
    ip: RTNETLINK answers: File exists&lt;br /&gt;
    Starting sshd: OK&lt;br /&gt;
    Starting NFS statd: done&lt;br /&gt;
    Starting NFS services: done&lt;br /&gt;
    Starting NFS daemon: done&lt;br /&gt;
    Starting NFS mountd: done&lt;br /&gt;
    Starting domain name daemon: namedwarning: `named&#039; uses 32-bit capabilities (legacy support in use)&lt;br /&gt;
    failed&lt;br /&gt;
    Fri Nov 20 17:10:37 2009&lt;br /&gt;
    Mounting Other NFS Filesystems&lt;br /&gt;
    &lt;br /&gt;
    Welcome to your custom Xtensa HiFi-2 Codec Developemnt System&lt;br /&gt;
    hifi login: &#039;&#039;&#039;&#039;&#039;root&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
    Password: &#039;&#039;&#039;&#039;&#039;linux1&#039;&#039;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=356</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=356"/>
		<updated>2009-12-02T04:22:01Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Booting Linux for the 1st Time */ Add link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the &amp;quot;communitee&amp;quot;&amp;quot; guide for how to use HiFi-2 Codec Development environment on an LX200 FPGA board.&lt;br /&gt;
If somethinig doesn&#039;t work ir isn&#039;t vovered in these guides, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux//Xtensa Mailing List]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 codec development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for codec development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFI-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this]].&lt;br /&gt;
&lt;br /&gt;
    U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:07&lt;br /&gt;
    IP:     192.168.11.105&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    Autobooting in 5 seconds, press &amp;lt;SPACE&amp;gt; to stop&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.105&lt;br /&gt;
    Filename &#039;uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: #################################################################&lt;br /&gt;
             ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 1161826 (11ba62 hex)&lt;br /&gt;
    Automatic boot of image at addr 0xD2000000 ...&lt;br /&gt;
    ## Booting kernel from Legacy Image at d2000000 ...&lt;br /&gt;
       Image Name:   Linux-2.6.29-rc7&lt;br /&gt;
       Image Type:   Xtensa Linux Kernel Image (gzip compressed)&lt;br /&gt;
       Data Size:    1161762 Bytes =  1.1 MB&lt;br /&gt;
       Load Address: d0001000&lt;br /&gt;
       Entry Point:  d0001000&lt;br /&gt;
       Verifying Checksum ... OK&lt;br /&gt;
       Uncompressing Kernel Image ... OK&lt;br /&gt;
     &lt;br /&gt;
    ## Linux Boot Params Starting At Address:0xd5f50000&lt;br /&gt;
       MEMORY:          tag:0x1003, type:0X1000, start:0X0, end:0X6000000&lt;br /&gt;
       COMMAND_LINE:    tag:0x1001, size:188, data:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;&lt;br /&gt;
       SERIAL_BAUDRATE: tag:0x1004, size:4, baudrate:38400&lt;br /&gt;
    &lt;br /&gt;
    ## Transferring Control to Linux Kernel At Address 0xd0001000 ...&lt;br /&gt;
    &lt;br /&gt;
     &lt;br /&gt;
    &lt;br /&gt;
    parse_bootparam: Ignoring tag 0x1004&lt;br /&gt;
    lx60 platform_init(bootparams:d5f50000)&lt;br /&gt;
    Linux version 2.6.29-rc7 (pdelaney@pdelaney_fc5.hq.tensilica.com) (gcc version 4.2.1) #201 SMP Tue Nov 17 23:49:39 PST 2009&lt;br /&gt;
    lx60 platform_setup(cmdline[0]:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;)&lt;br /&gt;
    smp_init_cpus: Core Count = 3&lt;br /&gt;
    smp_init_cpus: Core Id = 9320&lt;br /&gt;
    On node 0 totalpages: 24576&lt;br /&gt;
    free_area_init_node: node 0, pgdat d0196540, node_mem_map d01fa000&lt;br /&gt;
      Normal zone: 216 pages used for memmap&lt;br /&gt;
      Normal zone: 24360 pages, LIFO batch:3&lt;br /&gt;
    smp_prepare_boot_cpu:&lt;br /&gt;
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 24360&lt;br /&gt;
    Kernel command line: console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&lt;br /&gt;
    trap_init 0&lt;br /&gt;
    PID hash table entries: 512 (order: 9, 2048 bytes)&lt;br /&gt;
    time_init: Platform Calibrating CPU frequency&lt;br /&gt;
    time_init: ccount_per_jiffy:416777 [41.67 MHz], nsec_per_ccount:23&lt;br /&gt;
    Console: colour dummy device 80x25&lt;br /&gt;
    console [ttyS0] enabled&lt;br /&gt;
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)&lt;br /&gt;
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)&lt;br /&gt;
    Memory: 95196k/98304k available (1229k kernel code, 3040k reserved, 28k data, 72k init 0k highmem)&lt;br /&gt;
    Calibrating delay loop... 41.26 BogoMIPS (lpj=206336)&lt;br /&gt;
    Mount-cache hash table entries: 512&lt;br /&gt;
    cpu 1 fffd&lt;br /&gt;
    secondary_trap_init 1&lt;br /&gt;
    Calibrating delay loop... 41.67 BogoMIPS (lpj=208384)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:1, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:1, INTENABLE:7d&lt;br /&gt;
    cpu 2 fff9&lt;br /&gt;
    secondary_trap_init 2&lt;br /&gt;
    Calibrating delay loop... 41.57 BogoMIPS (lpj=207872)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:2, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:2, INTENABLE:7d&lt;br /&gt;
    Brought up 3 CPUs&lt;br /&gt;
    smp_cpus_done:&lt;br /&gt;
    net_namespace: 304 bytes&lt;br /&gt;
    NET: Registered protocol family 16&lt;br /&gt;
    lx60_init()&lt;br /&gt;
    bio: create slab &amp;lt;bio-0&amp;gt; at 0&lt;br /&gt;
    NET: Registered protocol family 2&lt;br /&gt;
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)&lt;br /&gt;
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP bind hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP: Hash tables configured (established 4096 bind 4096)&lt;br /&gt;
    TCP reno registered&lt;br /&gt;
   NET: Registered protocol family 1&lt;br /&gt;
    msgmni has been set to 186&lt;br /&gt;
    alg: No test for md5 (md5-generic)&lt;br /&gt;
    alg: No test for des (des-generic)&lt;br /&gt;
    alg: No test for des3_ede (des3_ede-generic)&lt;br /&gt;
    alg: No test for stdrng (krng)&lt;br /&gt;
    io scheduler noop registered (default)&lt;br /&gt;
    Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled&lt;br /&gt;
    serial8250: ttyS0 at MMIO 0x0 (irq = 3) is a 16550A&lt;br /&gt;
    oeth_probe: {&lt;br /&gt;
    oeth_setup: Open Ethernet Core Version 1.0.1&lt;br /&gt;
     : oeth_setup: Found id1:2000, id2:5c30 at phy_id:3.&lt;br /&gt;
     : Hardware MAC Address: 00:50:c2:13:6f:0f&lt;br /&gt;
    eth0 (): not using net_device_ops yet&lt;br /&gt;
    oeth_probe: }&lt;br /&gt;
    mice: PS/2 mouse device common for all mice&lt;br /&gt;
    TCP cubic registered&lt;br /&gt;
    NET: Registered protocol family 17&lt;br /&gt;
    RPC: Registered udp transport module.&lt;br /&gt;
    RPC: Registered tcp transport module.&lt;br /&gt;
    oeth_open:  Ready to process packets now on dev-&amp;gt;name:&#039;eth0&#039;, dev:d597d800;&lt;br /&gt;
    IP-Config: Complete:&lt;br /&gt;
         device=eth0, addr=192.168.11.105, mask=255.255.255.0, gw=192.168.11.1,&lt;br /&gt;
         host=&amp;quot;HiFi-2 Demo&amp;quot;, domain=, nis-domain=(none),&lt;br /&gt;
         bootserver=192.168.11.55, rootserver=192.168.11.55, rootpath=&lt;br /&gt;
    Looking up port of RPC 100003/2 on 192.168.11.55&lt;br /&gt;
    Looking up port of RPC 100005/1 on 192.168.11.55&lt;br /&gt;
    VFS: Mounted root (nfs filesystem) on device 0:11.&lt;br /&gt;
    Freeing unused kernel memory: 72k freed&lt;br /&gt;
    Starting portmap: done&lt;br /&gt;
    Initializing random number generator... done.&lt;br /&gt;
    Starting network...&lt;br /&gt;
    ip: RTNETLINK answers: File exists&lt;br /&gt;
    Starting sshd: OK&lt;br /&gt;
    Starting NFS statd: done&lt;br /&gt;
    Starting NFS services: done&lt;br /&gt;
    Starting NFS daemon: done&lt;br /&gt;
    Starting NFS mountd: done&lt;br /&gt;
    Starting domain name daemon: namedwarning: `named&#039; uses 32-bit capabilities (legacy support in use)&lt;br /&gt;
    failed&lt;br /&gt;
    Fri Nov 20 17:10:37 2009&lt;br /&gt;
    Mounting Other NFS Filesystems&lt;br /&gt;
    &lt;br /&gt;
    Welcome to your custom Xtensa HiFi-2 Codec Developemnt System&lt;br /&gt;
    hifi login: &#039;&#039;&#039;root&#039;&#039;&#039;&lt;br /&gt;
    Password: &#039;&#039;&#039;linux1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing your codec ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the XL200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, lets focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling a audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tar ball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpfull.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, thought&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling Tie Code with XCC ==&lt;br /&gt;
&lt;br /&gt;
Codecs like MP3 and AAC have been written in C with TIE extensions and can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;.&lt;br /&gt;
XCC is likely to large to run on the board without virtual memory. There are two approaches to compiling&lt;br /&gt;
Linux TIE code with &#039;&#039;&#039;xcc&#039;&#039;&#039;. The simple approach assumes the host workstation and target code running of the board&lt;br /&gt;
are similar enough that the library interfaces defined by the include files are compatable. This is often the&lt;br /&gt;
case for standard system calls, libc, and stdio.The proper approach uses a virtual core that we will create&lt;br /&gt;
that has built in references to the library and include files on the target code running on the LX200.&lt;br /&gt;
&lt;br /&gt;
=== Simply using Xtensa Tools to compile the TIE code on a workstation ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting &#039;&#039;&#039;xcc&#039;&#039;&#039; into our search path and set the standard XTENSA_* environement variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the XL200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using Tensilica&#039;s XCC Compiler ===&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For details, see the guide.&lt;br /&gt;
&lt;br /&gt;
A summary follows.  The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/someuser/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/someuser/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
Assuming the above completes successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables:&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
And build something:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
== Adding your codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a chalanging experience and worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=355</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=355"/>
		<updated>2009-12-02T04:00:05Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Building Linux Applications Using Tensilica&amp;#039;s XCC Compiler */ Remove sources now in separate page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the &amp;quot;communitee&amp;quot;&amp;quot; guide for how to use HiFi-2 Codec Development environment on an LX200 FPGA board.&lt;br /&gt;
If somethinig doesn&#039;t work ir isn&#039;t vovered in these guides, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux//Xtensa Mailing List]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 codec development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for codec development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFI-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now lets start with hitting the reset button on the X200 and it should&lt;br /&gt;
auto-boot the kernel:&lt;br /&gt;
&lt;br /&gt;
    U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:07&lt;br /&gt;
    IP:     192.168.11.105&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    Autobooting in 5 seconds, press &amp;lt;SPACE&amp;gt; to stop&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.105&lt;br /&gt;
    Filename &#039;uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: #################################################################&lt;br /&gt;
             ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 1161826 (11ba62 hex)&lt;br /&gt;
    Automatic boot of image at addr 0xD2000000 ...&lt;br /&gt;
    ## Booting kernel from Legacy Image at d2000000 ...&lt;br /&gt;
       Image Name:   Linux-2.6.29-rc7&lt;br /&gt;
       Image Type:   Xtensa Linux Kernel Image (gzip compressed)&lt;br /&gt;
       Data Size:    1161762 Bytes =  1.1 MB&lt;br /&gt;
       Load Address: d0001000&lt;br /&gt;
       Entry Point:  d0001000&lt;br /&gt;
       Verifying Checksum ... OK&lt;br /&gt;
       Uncompressing Kernel Image ... OK&lt;br /&gt;
     &lt;br /&gt;
    ## Linux Boot Params Starting At Address:0xd5f50000&lt;br /&gt;
       MEMORY:          tag:0x1003, type:0X1000, start:0X0, end:0X6000000&lt;br /&gt;
       COMMAND_LINE:    tag:0x1001, size:188, data:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;&lt;br /&gt;
       SERIAL_BAUDRATE: tag:0x1004, size:4, baudrate:38400&lt;br /&gt;
    &lt;br /&gt;
    ## Transferring Control to Linux Kernel At Address 0xd0001000 ...&lt;br /&gt;
    &lt;br /&gt;
     &lt;br /&gt;
    &lt;br /&gt;
    parse_bootparam: Ignoring tag 0x1004&lt;br /&gt;
    lx60 platform_init(bootparams:d5f50000)&lt;br /&gt;
    Linux version 2.6.29-rc7 (pdelaney@pdelaney_fc5.hq.tensilica.com) (gcc version 4.2.1) #201 SMP Tue Nov 17 23:49:39 PST 2009&lt;br /&gt;
    lx60 platform_setup(cmdline[0]:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;)&lt;br /&gt;
    smp_init_cpus: Core Count = 3&lt;br /&gt;
    smp_init_cpus: Core Id = 9320&lt;br /&gt;
    On node 0 totalpages: 24576&lt;br /&gt;
    free_area_init_node: node 0, pgdat d0196540, node_mem_map d01fa000&lt;br /&gt;
      Normal zone: 216 pages used for memmap&lt;br /&gt;
      Normal zone: 24360 pages, LIFO batch:3&lt;br /&gt;
    smp_prepare_boot_cpu:&lt;br /&gt;
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 24360&lt;br /&gt;
    Kernel command line: console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&lt;br /&gt;
    trap_init 0&lt;br /&gt;
    PID hash table entries: 512 (order: 9, 2048 bytes)&lt;br /&gt;
    time_init: Platform Calibrating CPU frequency&lt;br /&gt;
    time_init: ccount_per_jiffy:416777 [41.67 MHz], nsec_per_ccount:23&lt;br /&gt;
    Console: colour dummy device 80x25&lt;br /&gt;
    console [ttyS0] enabled&lt;br /&gt;
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)&lt;br /&gt;
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)&lt;br /&gt;
    Memory: 95196k/98304k available (1229k kernel code, 3040k reserved, 28k data, 72k init 0k highmem)&lt;br /&gt;
    Calibrating delay loop... 41.26 BogoMIPS (lpj=206336)&lt;br /&gt;
    Mount-cache hash table entries: 512&lt;br /&gt;
    cpu 1 fffd&lt;br /&gt;
    secondary_trap_init 1&lt;br /&gt;
    Calibrating delay loop... 41.67 BogoMIPS (lpj=208384)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:1, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:1, INTENABLE:7d&lt;br /&gt;
    cpu 2 fff9&lt;br /&gt;
    secondary_trap_init 2&lt;br /&gt;
    Calibrating delay loop... 41.57 BogoMIPS (lpj=207872)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:2, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:2, INTENABLE:7d&lt;br /&gt;
    Brought up 3 CPUs&lt;br /&gt;
    smp_cpus_done:&lt;br /&gt;
    net_namespace: 304 bytes&lt;br /&gt;
    NET: Registered protocol family 16&lt;br /&gt;
    lx60_init()&lt;br /&gt;
    bio: create slab &amp;lt;bio-0&amp;gt; at 0&lt;br /&gt;
    NET: Registered protocol family 2&lt;br /&gt;
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)&lt;br /&gt;
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP bind hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP: Hash tables configured (established 4096 bind 4096)&lt;br /&gt;
    TCP reno registered&lt;br /&gt;
   NET: Registered protocol family 1&lt;br /&gt;
    msgmni has been set to 186&lt;br /&gt;
    alg: No test for md5 (md5-generic)&lt;br /&gt;
    alg: No test for des (des-generic)&lt;br /&gt;
    alg: No test for des3_ede (des3_ede-generic)&lt;br /&gt;
    alg: No test for stdrng (krng)&lt;br /&gt;
    io scheduler noop registered (default)&lt;br /&gt;
    Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled&lt;br /&gt;
    serial8250: ttyS0 at MMIO 0x0 (irq = 3) is a 16550A&lt;br /&gt;
    oeth_probe: {&lt;br /&gt;
    oeth_setup: Open Ethernet Core Version 1.0.1&lt;br /&gt;
     : oeth_setup: Found id1:2000, id2:5c30 at phy_id:3.&lt;br /&gt;
     : Hardware MAC Address: 00:50:c2:13:6f:0f&lt;br /&gt;
    eth0 (): not using net_device_ops yet&lt;br /&gt;
    oeth_probe: }&lt;br /&gt;
    mice: PS/2 mouse device common for all mice&lt;br /&gt;
    TCP cubic registered&lt;br /&gt;
    NET: Registered protocol family 17&lt;br /&gt;
    RPC: Registered udp transport module.&lt;br /&gt;
    RPC: Registered tcp transport module.&lt;br /&gt;
    oeth_open:  Ready to process packets now on dev-&amp;gt;name:&#039;eth0&#039;, dev:d597d800;&lt;br /&gt;
    IP-Config: Complete:&lt;br /&gt;
         device=eth0, addr=192.168.11.105, mask=255.255.255.0, gw=192.168.11.1,&lt;br /&gt;
         host=&amp;quot;HiFi-2 Demo&amp;quot;, domain=, nis-domain=(none),&lt;br /&gt;
         bootserver=192.168.11.55, rootserver=192.168.11.55, rootpath=&lt;br /&gt;
    Looking up port of RPC 100003/2 on 192.168.11.55&lt;br /&gt;
    Looking up port of RPC 100005/1 on 192.168.11.55&lt;br /&gt;
    VFS: Mounted root (nfs filesystem) on device 0:11.&lt;br /&gt;
    Freeing unused kernel memory: 72k freed&lt;br /&gt;
    Starting portmap: done&lt;br /&gt;
    Initializing random number generator... done.&lt;br /&gt;
    Starting network...&lt;br /&gt;
    ip: RTNETLINK answers: File exists&lt;br /&gt;
    Starting sshd: OK&lt;br /&gt;
    Starting NFS statd: done&lt;br /&gt;
    Starting NFS services: done&lt;br /&gt;
    Starting NFS daemon: done&lt;br /&gt;
    Starting NFS mountd: done&lt;br /&gt;
    Starting domain name daemon: namedwarning: `named&#039; uses 32-bit capabilities (legacy support in use)&lt;br /&gt;
    failed&lt;br /&gt;
    Fri Nov 20 17:10:37 2009&lt;br /&gt;
    Mounting Other NFS Filesystems&lt;br /&gt;
    &lt;br /&gt;
    Welcome to your custom Xtensa HiFi-2 Codec Developemnt System&lt;br /&gt;
    hifi login: &#039;&#039;&#039;root&#039;&#039;&#039;&lt;br /&gt;
    Password: &#039;&#039;&#039;linux1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing your codec ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the XL200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, lets focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling a audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tar ball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpfull.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, thought&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling Tie Code with XCC ==&lt;br /&gt;
&lt;br /&gt;
Codecs like MP3 and AAC have been written in C with TIE extensions and can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;.&lt;br /&gt;
XCC is likely to large to run on the board without virtual memory. There are two approaches to compiling&lt;br /&gt;
Linux TIE code with &#039;&#039;&#039;xcc&#039;&#039;&#039;. The simple approach assumes the host workstation and target code running of the board&lt;br /&gt;
are similar enough that the library interfaces defined by the include files are compatable. This is often the&lt;br /&gt;
case for standard system calls, libc, and stdio.The proper approach uses a virtual core that we will create&lt;br /&gt;
that has built in references to the library and include files on the target code running on the LX200.&lt;br /&gt;
&lt;br /&gt;
=== Simply using Xtensa Tools to compile the TIE code on a workstation ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting &#039;&#039;&#039;xcc&#039;&#039;&#039; into our search path and set the standard XTENSA_* environement variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the XL200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using Tensilica&#039;s XCC Compiler ===&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For details, see the guide.&lt;br /&gt;
&lt;br /&gt;
A summary follows.  The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/someuser/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/someuser/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
Assuming the above completes successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables:&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
And build something:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
== Adding your codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a chalanging experience and worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
     &lt;br /&gt;
   11. Copying vim-7.2.tar from /home/default/src to /usr/local/src resulted &lt;br /&gt;
       in a corrupt tar header. Apparently we have a NFS bug lurking in the kernel.&lt;br /&gt;
       On server tar file looks like this:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0&lt;br /&gt;
           ustar00moolmool000000 000000&lt;br /&gt;
           README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
    &lt;br /&gt;
       On the target/client it&#039;s different:&lt;br /&gt;
           vim72/000755 001750 001750 00000000000 11047345123 012000 5ustar00moolmool000000 000000 vim72/README.txt000644 001750 001750 00000011342 11047324103 013472 0ustar00moolmool000000 000000 README.txt for version 7.2 of Vim: Vi IMproved.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Hifitest.c&amp;diff=354</id>
		<title>Hifitest.c</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Hifitest.c&amp;diff=354"/>
		<updated>2009-12-02T03:56:17Z</updated>

		<summary type="html">&lt;p&gt;Marc: Example code in a separate page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;time.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;xtensa/tie/xt_hifi2.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #define INC 1&lt;br /&gt;
   &lt;br /&gt;
   main(int argc, char **argv)&lt;br /&gt;
   {&lt;br /&gt;
     int inc;&lt;br /&gt;
     int inc2;&lt;br /&gt;
     register ae_p24x2s p24_cnt;&lt;br /&gt;
     register ae_p24x2s p24_inc;&lt;br /&gt;
     register ae_p24x2s p24_pid;&lt;br /&gt;
     int cnt;&lt;br /&gt;
     int cnt2;&lt;br /&gt;
     int pid;&lt;br /&gt;
     int pid2;&lt;br /&gt;
     volatile int i, j, k, l;&lt;br /&gt;
     time_t time0 = time(NULL);&lt;br /&gt;
     time_t time1 = time(NULL);&lt;br /&gt;
   &lt;br /&gt;
   restart:&lt;br /&gt;
     cnt = 0;&lt;br /&gt;
     cnt2 = 0;&lt;br /&gt;
     inc = INC;&lt;br /&gt;
     pid = getpid();&lt;br /&gt;
     p24_cnt = AE_ZEROP48();&lt;br /&gt;
     p24_inc = AE_MOVPA24(inc);&lt;br /&gt;
     p24_pid = AE_MOVPA24(pid);&lt;br /&gt;
   &lt;br /&gt;
     while (1)&lt;br /&gt;
       {&lt;br /&gt;
         int errors = 0;&lt;br /&gt;
   &lt;br /&gt;
         if ((cnt &amp;amp; 0xffffff) == 0) {&lt;br /&gt;
   	time0 = time1;&lt;br /&gt;
   	time1 = time(NULL);&lt;br /&gt;
   	printf(&amp;quot;cnt:0x%x, pid:%d; Eatting cpu; time:%ld\n&amp;quot;, cnt, pid, (time1 - time0));&lt;br /&gt;
   	for(i = 0; i&amp;lt;1000; i++) {&lt;br /&gt;
   	    for(j = 0; j &amp;lt; 1000; j++) {&lt;br /&gt;
   	        for(k = 0; k &amp;lt; 10; k++) {&lt;br /&gt;
   			l++;&lt;br /&gt;
   	    	}&lt;br /&gt;
   	    }&lt;br /&gt;
   	}&lt;br /&gt;
   	time0 = time1;&lt;br /&gt;
   	time1 = time(NULL);&lt;br /&gt;
   	printf(&amp;quot;cnt:0x%x, pid:%d; Eating Tie; time:%ld\n&amp;quot;, cnt, pid, (time1 - time0));&lt;br /&gt;
         }	&lt;br /&gt;
         cnt = (cnt + inc) &amp;amp; 0xffffff;&lt;br /&gt;
         p24_cnt = AE_ADDP24(p24_cnt, p24_inc);&lt;br /&gt;
         cnt2 = AE_MOVAP24S_L(p24_cnt) &amp;amp; 0xffffff;&lt;br /&gt;
         pid2 = AE_MOVAP24S_L(p24_pid) &amp;amp; 0xffffff;&lt;br /&gt;
         inc2 = AE_MOVAP24S_L(p24_inc) &amp;amp; 0xffffff;&lt;br /&gt;
   &lt;br /&gt;
         if (cnt2 != cnt)&lt;br /&gt;
   	{&lt;br /&gt;
   	  swapon(&amp;quot;/tmp/cmt2&amp;quot;, 0);&lt;br /&gt;
   	  printf(&amp;quot;Error: cnt2:0x%x != cnt:0x%x\n&amp;quot;, cnt2, cnt);&lt;br /&gt;
   	  errors++;&lt;br /&gt;
   	}&lt;br /&gt;
         if (inc2 != inc)&lt;br /&gt;
   	{&lt;br /&gt;
   	  swapon(&amp;quot;/tmp/inc2&amp;quot;, 0);&lt;br /&gt;
   	  printf(&amp;quot;Error: inc2:%d != inc:%d\n&amp;quot;, cnt2, cnt);&lt;br /&gt;
   	  errors++;&lt;br /&gt;
   	}&lt;br /&gt;
         if ( pid2 != pid)&lt;br /&gt;
   	{&lt;br /&gt;
   	  swapon(&amp;quot;/tmp/pid2&amp;quot;, 0);&lt;br /&gt;
   	  printf(&amp;quot;Error: pid2:%d != pid:%d\n&amp;quot;, pid2, pid);&lt;br /&gt;
   	  errors++;&lt;br /&gt;
   	}&lt;br /&gt;
   &lt;br /&gt;
   	if (errors) {&lt;br /&gt;
   	    printf(&amp;quot;for...\n&amp;quot;);&lt;br /&gt;
   	    for(i=0; i &amp;lt; 0x3FFFF; i++) &lt;br /&gt;
   		j++;&lt;br /&gt;
   	    printf(&amp;quot;sleep 10\n&amp;quot;);&lt;br /&gt;
   	    sleep(10);	&lt;br /&gt;
   	    printf(&amp;quot;for...\n&amp;quot;);&lt;br /&gt;
   		for(i=0; i &amp;lt; 0x3FFFF; i++)&lt;br /&gt;
   			j++;	&lt;br /&gt;
   	    printf(&amp;quot;restart\n&amp;quot;);	&lt;br /&gt;
   	    goto restart;&lt;br /&gt;
   	}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=342</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=342"/>
		<updated>2009-12-01T22:02:02Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Building Linux Applications Using Tensilica&amp;#039;s XCC Compiler */ Remove odd comments, simplify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the &amp;quot;communitee&amp;quot;&amp;quot; guide for how to use HiFi-2 Codec Development environment on an LX200 FPGA board.&lt;br /&gt;
If somethinig doesn&#039;t work ir isn&#039;t vovered in these guides, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux//Xtensa Mailing List]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 codec development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for codec development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFI-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now lets start with hitting the reset button on the X200 and it should&lt;br /&gt;
auto-boot the kernel:&lt;br /&gt;
&lt;br /&gt;
    U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:07&lt;br /&gt;
    IP:     192.168.11.105&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    Autobooting in 5 seconds, press &amp;lt;SPACE&amp;gt; to stop&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.105&lt;br /&gt;
    Filename &#039;uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: #################################################################&lt;br /&gt;
             ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 1161826 (11ba62 hex)&lt;br /&gt;
    Automatic boot of image at addr 0xD2000000 ...&lt;br /&gt;
    ## Booting kernel from Legacy Image at d2000000 ...&lt;br /&gt;
       Image Name:   Linux-2.6.29-rc7&lt;br /&gt;
       Image Type:   Xtensa Linux Kernel Image (gzip compressed)&lt;br /&gt;
       Data Size:    1161762 Bytes =  1.1 MB&lt;br /&gt;
       Load Address: d0001000&lt;br /&gt;
       Entry Point:  d0001000&lt;br /&gt;
       Verifying Checksum ... OK&lt;br /&gt;
       Uncompressing Kernel Image ... OK&lt;br /&gt;
     &lt;br /&gt;
    ## Linux Boot Params Starting At Address:0xd5f50000&lt;br /&gt;
       MEMORY:          tag:0x1003, type:0X1000, start:0X0, end:0X6000000&lt;br /&gt;
       COMMAND_LINE:    tag:0x1001, size:188, data:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;&lt;br /&gt;
       SERIAL_BAUDRATE: tag:0x1004, size:4, baudrate:38400&lt;br /&gt;
    &lt;br /&gt;
    ## Transferring Control to Linux Kernel At Address 0xd0001000 ...&lt;br /&gt;
    &lt;br /&gt;
     &lt;br /&gt;
    &lt;br /&gt;
    parse_bootparam: Ignoring tag 0x1004&lt;br /&gt;
    lx60 platform_init(bootparams:d5f50000)&lt;br /&gt;
    Linux version 2.6.29-rc7 (pdelaney@pdelaney_fc5.hq.tensilica.com) (gcc version 4.2.1) #201 SMP Tue Nov 17 23:49:39 PST 2009&lt;br /&gt;
    lx60 platform_setup(cmdline[0]:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;)&lt;br /&gt;
    smp_init_cpus: Core Count = 3&lt;br /&gt;
    smp_init_cpus: Core Id = 9320&lt;br /&gt;
    On node 0 totalpages: 24576&lt;br /&gt;
    free_area_init_node: node 0, pgdat d0196540, node_mem_map d01fa000&lt;br /&gt;
      Normal zone: 216 pages used for memmap&lt;br /&gt;
      Normal zone: 24360 pages, LIFO batch:3&lt;br /&gt;
    smp_prepare_boot_cpu:&lt;br /&gt;
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 24360&lt;br /&gt;
    Kernel command line: console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&lt;br /&gt;
    trap_init 0&lt;br /&gt;
    PID hash table entries: 512 (order: 9, 2048 bytes)&lt;br /&gt;
    time_init: Platform Calibrating CPU frequency&lt;br /&gt;
    time_init: ccount_per_jiffy:416777 [41.67 MHz], nsec_per_ccount:23&lt;br /&gt;
    Console: colour dummy device 80x25&lt;br /&gt;
    console [ttyS0] enabled&lt;br /&gt;
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)&lt;br /&gt;
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)&lt;br /&gt;
    Memory: 95196k/98304k available (1229k kernel code, 3040k reserved, 28k data, 72k init 0k highmem)&lt;br /&gt;
    Calibrating delay loop... 41.26 BogoMIPS (lpj=206336)&lt;br /&gt;
    Mount-cache hash table entries: 512&lt;br /&gt;
    cpu 1 fffd&lt;br /&gt;
    secondary_trap_init 1&lt;br /&gt;
    Calibrating delay loop... 41.67 BogoMIPS (lpj=208384)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:1, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:1, INTENABLE:7d&lt;br /&gt;
    cpu 2 fff9&lt;br /&gt;
    secondary_trap_init 2&lt;br /&gt;
    Calibrating delay loop... 41.57 BogoMIPS (lpj=207872)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:2, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:2, INTENABLE:7d&lt;br /&gt;
    Brought up 3 CPUs&lt;br /&gt;
    smp_cpus_done:&lt;br /&gt;
    net_namespace: 304 bytes&lt;br /&gt;
    NET: Registered protocol family 16&lt;br /&gt;
    lx60_init()&lt;br /&gt;
    bio: create slab &amp;lt;bio-0&amp;gt; at 0&lt;br /&gt;
    NET: Registered protocol family 2&lt;br /&gt;
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)&lt;br /&gt;
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP bind hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP: Hash tables configured (established 4096 bind 4096)&lt;br /&gt;
    TCP reno registered&lt;br /&gt;
   NET: Registered protocol family 1&lt;br /&gt;
    msgmni has been set to 186&lt;br /&gt;
    alg: No test for md5 (md5-generic)&lt;br /&gt;
    alg: No test for des (des-generic)&lt;br /&gt;
    alg: No test for des3_ede (des3_ede-generic)&lt;br /&gt;
    alg: No test for stdrng (krng)&lt;br /&gt;
    io scheduler noop registered (default)&lt;br /&gt;
    Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled&lt;br /&gt;
    serial8250: ttyS0 at MMIO 0x0 (irq = 3) is a 16550A&lt;br /&gt;
    oeth_probe: {&lt;br /&gt;
    oeth_setup: Open Ethernet Core Version 1.0.1&lt;br /&gt;
     : oeth_setup: Found id1:2000, id2:5c30 at phy_id:3.&lt;br /&gt;
     : Hardware MAC Address: 00:50:c2:13:6f:0f&lt;br /&gt;
    eth0 (): not using net_device_ops yet&lt;br /&gt;
    oeth_probe: }&lt;br /&gt;
    mice: PS/2 mouse device common for all mice&lt;br /&gt;
    TCP cubic registered&lt;br /&gt;
    NET: Registered protocol family 17&lt;br /&gt;
    RPC: Registered udp transport module.&lt;br /&gt;
    RPC: Registered tcp transport module.&lt;br /&gt;
    oeth_open:  Ready to process packets now on dev-&amp;gt;name:&#039;eth0&#039;, dev:d597d800;&lt;br /&gt;
    IP-Config: Complete:&lt;br /&gt;
         device=eth0, addr=192.168.11.105, mask=255.255.255.0, gw=192.168.11.1,&lt;br /&gt;
         host=&amp;quot;HiFi-2 Demo&amp;quot;, domain=, nis-domain=(none),&lt;br /&gt;
         bootserver=192.168.11.55, rootserver=192.168.11.55, rootpath=&lt;br /&gt;
    Looking up port of RPC 100003/2 on 192.168.11.55&lt;br /&gt;
    Looking up port of RPC 100005/1 on 192.168.11.55&lt;br /&gt;
    VFS: Mounted root (nfs filesystem) on device 0:11.&lt;br /&gt;
    Freeing unused kernel memory: 72k freed&lt;br /&gt;
    Starting portmap: done&lt;br /&gt;
    Initializing random number generator... done.&lt;br /&gt;
    Starting network...&lt;br /&gt;
    ip: RTNETLINK answers: File exists&lt;br /&gt;
    Starting sshd: OK&lt;br /&gt;
    Starting NFS statd: done&lt;br /&gt;
    Starting NFS services: done&lt;br /&gt;
    Starting NFS daemon: done&lt;br /&gt;
    Starting NFS mountd: done&lt;br /&gt;
    Starting domain name daemon: namedwarning: `named&#039; uses 32-bit capabilities (legacy support in use)&lt;br /&gt;
    failed&lt;br /&gt;
    Fri Nov 20 17:10:37 2009&lt;br /&gt;
    Mounting Other NFS Filesystems&lt;br /&gt;
    &lt;br /&gt;
    Welcome to your custom Xtensa HiFi-2 Codec Developemnt System&lt;br /&gt;
    hifi login: &#039;&#039;&#039;root&#039;&#039;&#039;&lt;br /&gt;
    Password: &#039;&#039;&#039;linux1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing your codec ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the XL200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, lets focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling a audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tar ball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpfull.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, thought&lt;br /&gt;
much slower. For example here we configure and build the strace package:&lt;br /&gt;
&lt;br /&gt;
[[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling Tie Code with XCC ==&lt;br /&gt;
&lt;br /&gt;
Codecs like MP3 and AAC have been written in C with TIE extensions and can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;.&lt;br /&gt;
XCC is likely to large to run on the board without virtual memory. There are two approaches to compiling&lt;br /&gt;
Linux TIE code with &#039;&#039;&#039;xcc&#039;&#039;&#039;. The simple approach assumes the host workstation and target code running of the board&lt;br /&gt;
are similar enough that the library interfaces defined by the include files are compatable. This is often the&lt;br /&gt;
case for standard system calls, libc, and stdio.The proper approach uses a virtual core that we will create&lt;br /&gt;
that has built in references to the library and include files on the target code running on the LX200.&lt;br /&gt;
&lt;br /&gt;
=== Simply using Xtensa Tools to compile the TIE code on a workstation ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting &#039;&#039;&#039;xcc&#039;&#039;&#039; into our search path and set the standard XTENSA_* environement variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the XL200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using Tensilica&#039;s XCC Compiler ===&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For details, see the guide.&lt;br /&gt;
&lt;br /&gt;
A summary follows.  The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_ROOT       /home/someuser/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    $ setenv XTENSA_TOOLS_ROOT /home/someuser/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&lt;br /&gt;
    $ setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    $ setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&lt;br /&gt;
    &lt;br /&gt;
    $ setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ ${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                          \&lt;br /&gt;
        --sysroot=./build_xtensa_${CORENAME}/staging_dir                                    \&lt;br /&gt;
        --linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
Assuming the above completes successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables:&lt;br /&gt;
&lt;br /&gt;
    $ setenv XTENSA_CORE      default&lt;br /&gt;
    $ setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&lt;br /&gt;
    $ setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&lt;br /&gt;
&lt;br /&gt;
And build something:&lt;br /&gt;
&lt;br /&gt;
    $ echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&lt;br /&gt;
    $ echo &#039;int main() {printf(&amp;quot;Hello!\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&lt;br /&gt;
    $ xt-xcc -g hello.c -o hello&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ cp hello ${TARGET_SYSROOT}/root&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# /root/hello&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the code for the [[hifitest.c]] source file.&lt;br /&gt;
&lt;br /&gt;
For example the /home/default/AUDIO_Tests/hifitest.c&lt;br /&gt;
used above in the core cloning example:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
    #include &amp;lt;time.h&amp;gt;&lt;br /&gt;
    #include &amp;lt;xtensa/tie/xt_hifi2.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    #define INC 1&lt;br /&gt;
    &lt;br /&gt;
    main(int argc, char **argv)&lt;br /&gt;
    {&lt;br /&gt;
      int inc;&lt;br /&gt;
      int inc2;&lt;br /&gt;
      register ae_p24x2s p24_cnt;&lt;br /&gt;
      register ae_p24x2s p24_inc;&lt;br /&gt;
      register ae_p24x2s p24_pid;&lt;br /&gt;
      int cnt;&lt;br /&gt;
      int cnt2;&lt;br /&gt;
      int pid;&lt;br /&gt;
      int pid2;&lt;br /&gt;
      volatile int i, j, k, l;&lt;br /&gt;
      time_t time0 = time(NULL);&lt;br /&gt;
      time_t time1 = time(NULL);&lt;br /&gt;
    &lt;br /&gt;
    restart:&lt;br /&gt;
      cnt = 0;&lt;br /&gt;
      cnt2 = 0;&lt;br /&gt;
      inc = INC;&lt;br /&gt;
      pid = getpid();&lt;br /&gt;
      p24_cnt = AE_ZEROP48();&lt;br /&gt;
      p24_inc = AE_MOVPA24(inc);&lt;br /&gt;
      p24_pid = AE_MOVPA24(pid);&lt;br /&gt;
    &lt;br /&gt;
      while (1)&lt;br /&gt;
        {&lt;br /&gt;
          int errors = 0;&lt;br /&gt;
    &lt;br /&gt;
          if ((cnt &amp;amp; 0xffffff) == 0) {&lt;br /&gt;
    	time0 = time1;&lt;br /&gt;
    	time1 = time(NULL);&lt;br /&gt;
    	printf(&amp;quot;cnt:0x%x, pid:%d; Eatting cpu; time:%ld\n&amp;quot;, cnt, pid, (time1 - time0));&lt;br /&gt;
    	for(i = 0; i&amp;lt;1000; i++) {&lt;br /&gt;
    	    for(j = 0; j &amp;lt; 1000; j++) {&lt;br /&gt;
    	        for(k = 0; k &amp;lt; 10; k++) {&lt;br /&gt;
    			l++;&lt;br /&gt;
    	    	}&lt;br /&gt;
    	    }&lt;br /&gt;
    	}&lt;br /&gt;
    	time0 = time1;&lt;br /&gt;
    	time1 = time(NULL);&lt;br /&gt;
    	printf(&amp;quot;cnt:0x%x, pid:%d; Eating Tie; time:%ld\n&amp;quot;, cnt, pid, (time1 - time0));&lt;br /&gt;
          }	&lt;br /&gt;
          cnt = (cnt + inc) &amp;amp; 0xffffff;&lt;br /&gt;
          p24_cnt = AE_ADDP24(p24_cnt, p24_inc);&lt;br /&gt;
          cnt2 = AE_MOVAP24S_L(p24_cnt) &amp;amp; 0xffffff;&lt;br /&gt;
          pid2 = AE_MOVAP24S_L(p24_pid) &amp;amp; 0xffffff;&lt;br /&gt;
          inc2 = AE_MOVAP24S_L(p24_inc) &amp;amp; 0xffffff;&lt;br /&gt;
    &lt;br /&gt;
          if (cnt2 != cnt)&lt;br /&gt;
    	{&lt;br /&gt;
    	  swapon(&amp;quot;/tmp/cmt2&amp;quot;, 0);&lt;br /&gt;
    	  printf(&amp;quot;Error: cnt2:0x%x != cnt:0x%x\n&amp;quot;, cnt2, cnt);&lt;br /&gt;
    	  errors++;&lt;br /&gt;
    	}&lt;br /&gt;
          if (inc2 != inc)&lt;br /&gt;
    	{&lt;br /&gt;
    	  swapon(&amp;quot;/tmp/inc2&amp;quot;, 0);&lt;br /&gt;
    	  printf(&amp;quot;Error: inc2:%d != inc:%d\n&amp;quot;, cnt2, cnt);&lt;br /&gt;
    	  errors++;&lt;br /&gt;
    	}&lt;br /&gt;
          if ( pid2 != pid)&lt;br /&gt;
    	{&lt;br /&gt;
    	  swapon(&amp;quot;/tmp/pid2&amp;quot;, 0);&lt;br /&gt;
    	  printf(&amp;quot;Error: pid2:%d != pid:%d\n&amp;quot;, pid2, pid);&lt;br /&gt;
    	  errors++;&lt;br /&gt;
    	}&lt;br /&gt;
    &lt;br /&gt;
    	if (errors) {&lt;br /&gt;
    	    printf(&amp;quot;for...\n&amp;quot;);&lt;br /&gt;
    	    for(i=0; i &amp;lt; 0x3FFFF; i++) &lt;br /&gt;
    		j++;&lt;br /&gt;
    	    printf(&amp;quot;sleep 10\n&amp;quot;);&lt;br /&gt;
    	    sleep(10);	&lt;br /&gt;
    	    printf(&amp;quot;for...\n&amp;quot;);&lt;br /&gt;
    		for(i=0; i &amp;lt; 0x3FFFF; i++)&lt;br /&gt;
    			j++;	&lt;br /&gt;
    	    printf(&amp;quot;restart\n&amp;quot;);	&lt;br /&gt;
    	    goto restart;&lt;br /&gt;
    	}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
$&lt;br /&gt;
&lt;br /&gt;
== Adding your codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a chalanging experience and worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=341</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=341"/>
		<updated>2009-12-01T20:57:06Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Configuring U-Boot to Boot Linux */ Minicom info moved to separate page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the &amp;quot;communitee&amp;quot;&amp;quot; guide for how to use HiFi-2 Codec Development environment on an LX200 FPGA board.&lt;br /&gt;
If somethinig doesn&#039;t work ir isn&#039;t vovered in these guides, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux//Xtensa Mailing List]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 codec development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for codec development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFI-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on your NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now lets start with hitting the reset button on the X200 and it should&lt;br /&gt;
auto-boot the kernel:&lt;br /&gt;
&lt;br /&gt;
    U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:07&lt;br /&gt;
    IP:     192.168.11.105&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    Autobooting in 5 seconds, press &amp;lt;SPACE&amp;gt; to stop&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.105&lt;br /&gt;
    Filename &#039;uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: #################################################################&lt;br /&gt;
             ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 1161826 (11ba62 hex)&lt;br /&gt;
    Automatic boot of image at addr 0xD2000000 ...&lt;br /&gt;
    ## Booting kernel from Legacy Image at d2000000 ...&lt;br /&gt;
       Image Name:   Linux-2.6.29-rc7&lt;br /&gt;
       Image Type:   Xtensa Linux Kernel Image (gzip compressed)&lt;br /&gt;
       Data Size:    1161762 Bytes =  1.1 MB&lt;br /&gt;
       Load Address: d0001000&lt;br /&gt;
       Entry Point:  d0001000&lt;br /&gt;
       Verifying Checksum ... OK&lt;br /&gt;
       Uncompressing Kernel Image ... OK&lt;br /&gt;
     &lt;br /&gt;
    ## Linux Boot Params Starting At Address:0xd5f50000&lt;br /&gt;
       MEMORY:          tag:0x1003, type:0X1000, start:0X0, end:0X6000000&lt;br /&gt;
       COMMAND_LINE:    tag:0x1001, size:188, data:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;&lt;br /&gt;
       SERIAL_BAUDRATE: tag:0x1004, size:4, baudrate:38400&lt;br /&gt;
    &lt;br /&gt;
    ## Transferring Control to Linux Kernel At Address 0xd0001000 ...&lt;br /&gt;
    &lt;br /&gt;
     &lt;br /&gt;
    &lt;br /&gt;
    parse_bootparam: Ignoring tag 0x1004&lt;br /&gt;
    lx60 platform_init(bootparams:d5f50000)&lt;br /&gt;
    Linux version 2.6.29-rc7 (pdelaney@pdelaney_fc5.hq.tensilica.com) (gcc version 4.2.1) #201 SMP Tue Nov 17 23:49:39 PST 2009&lt;br /&gt;
    lx60 platform_setup(cmdline[0]:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;)&lt;br /&gt;
    smp_init_cpus: Core Count = 3&lt;br /&gt;
    smp_init_cpus: Core Id = 9320&lt;br /&gt;
    On node 0 totalpages: 24576&lt;br /&gt;
    free_area_init_node: node 0, pgdat d0196540, node_mem_map d01fa000&lt;br /&gt;
      Normal zone: 216 pages used for memmap&lt;br /&gt;
      Normal zone: 24360 pages, LIFO batch:3&lt;br /&gt;
    smp_prepare_boot_cpu:&lt;br /&gt;
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 24360&lt;br /&gt;
    Kernel command line: console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&lt;br /&gt;
    trap_init 0&lt;br /&gt;
    PID hash table entries: 512 (order: 9, 2048 bytes)&lt;br /&gt;
    time_init: Platform Calibrating CPU frequency&lt;br /&gt;
    time_init: ccount_per_jiffy:416777 [41.67 MHz], nsec_per_ccount:23&lt;br /&gt;
    Console: colour dummy device 80x25&lt;br /&gt;
    console [ttyS0] enabled&lt;br /&gt;
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)&lt;br /&gt;
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)&lt;br /&gt;
    Memory: 95196k/98304k available (1229k kernel code, 3040k reserved, 28k data, 72k init 0k highmem)&lt;br /&gt;
    Calibrating delay loop... 41.26 BogoMIPS (lpj=206336)&lt;br /&gt;
    Mount-cache hash table entries: 512&lt;br /&gt;
    cpu 1 fffd&lt;br /&gt;
    secondary_trap_init 1&lt;br /&gt;
    Calibrating delay loop... 41.67 BogoMIPS (lpj=208384)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:1, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:1, INTENABLE:7d&lt;br /&gt;
    cpu 2 fff9&lt;br /&gt;
    secondary_trap_init 2&lt;br /&gt;
    Calibrating delay loop... 41.57 BogoMIPS (lpj=207872)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:2, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:2, INTENABLE:7d&lt;br /&gt;
    Brought up 3 CPUs&lt;br /&gt;
    smp_cpus_done:&lt;br /&gt;
    net_namespace: 304 bytes&lt;br /&gt;
    NET: Registered protocol family 16&lt;br /&gt;
    lx60_init()&lt;br /&gt;
    bio: create slab &amp;lt;bio-0&amp;gt; at 0&lt;br /&gt;
    NET: Registered protocol family 2&lt;br /&gt;
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)&lt;br /&gt;
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP bind hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP: Hash tables configured (established 4096 bind 4096)&lt;br /&gt;
    TCP reno registered&lt;br /&gt;
   NET: Registered protocol family 1&lt;br /&gt;
    msgmni has been set to 186&lt;br /&gt;
    alg: No test for md5 (md5-generic)&lt;br /&gt;
    alg: No test for des (des-generic)&lt;br /&gt;
    alg: No test for des3_ede (des3_ede-generic)&lt;br /&gt;
    alg: No test for stdrng (krng)&lt;br /&gt;
    io scheduler noop registered (default)&lt;br /&gt;
    Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled&lt;br /&gt;
    serial8250: ttyS0 at MMIO 0x0 (irq = 3) is a 16550A&lt;br /&gt;
    oeth_probe: {&lt;br /&gt;
    oeth_setup: Open Ethernet Core Version 1.0.1&lt;br /&gt;
     : oeth_setup: Found id1:2000, id2:5c30 at phy_id:3.&lt;br /&gt;
     : Hardware MAC Address: 00:50:c2:13:6f:0f&lt;br /&gt;
    eth0 (): not using net_device_ops yet&lt;br /&gt;
    oeth_probe: }&lt;br /&gt;
    mice: PS/2 mouse device common for all mice&lt;br /&gt;
    TCP cubic registered&lt;br /&gt;
    NET: Registered protocol family 17&lt;br /&gt;
    RPC: Registered udp transport module.&lt;br /&gt;
    RPC: Registered tcp transport module.&lt;br /&gt;
    oeth_open:  Ready to process packets now on dev-&amp;gt;name:&#039;eth0&#039;, dev:d597d800;&lt;br /&gt;
    IP-Config: Complete:&lt;br /&gt;
         device=eth0, addr=192.168.11.105, mask=255.255.255.0, gw=192.168.11.1,&lt;br /&gt;
         host=&amp;quot;HiFi-2 Demo&amp;quot;, domain=, nis-domain=(none),&lt;br /&gt;
         bootserver=192.168.11.55, rootserver=192.168.11.55, rootpath=&lt;br /&gt;
    Looking up port of RPC 100003/2 on 192.168.11.55&lt;br /&gt;
    Looking up port of RPC 100005/1 on 192.168.11.55&lt;br /&gt;
    VFS: Mounted root (nfs filesystem) on device 0:11.&lt;br /&gt;
    Freeing unused kernel memory: 72k freed&lt;br /&gt;
    Starting portmap: done&lt;br /&gt;
    Initializing random number generator... done.&lt;br /&gt;
    Starting network...&lt;br /&gt;
    ip: RTNETLINK answers: File exists&lt;br /&gt;
    Starting sshd: OK&lt;br /&gt;
    Starting NFS statd: done&lt;br /&gt;
    Starting NFS services: done&lt;br /&gt;
    Starting NFS daemon: done&lt;br /&gt;
    Starting NFS mountd: done&lt;br /&gt;
    Starting domain name daemon: namedwarning: `named&#039; uses 32-bit capabilities (legacy support in use)&lt;br /&gt;
    failed&lt;br /&gt;
    Fri Nov 20 17:10:37 2009&lt;br /&gt;
    Mounting Other NFS Filesystems&lt;br /&gt;
    &lt;br /&gt;
    Welcome to your custom Xtensa HiFi-2 Codec Developemnt System&lt;br /&gt;
    hifi login: &#039;&#039;&#039;root&#039;&#039;&#039;&lt;br /&gt;
    Password: &#039;&#039;&#039;linux1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing your codec ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the XL200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, lets focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling a audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tar ball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpfull.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, thought&lt;br /&gt;
much slower. For example here we configure and build the strace package:&lt;br /&gt;
&lt;br /&gt;
[[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling Tie Code with XCC ==&lt;br /&gt;
&lt;br /&gt;
Codecs like MP3 and AAC have been written in C with TIE extensions and can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;.&lt;br /&gt;
XCC is likely to large to run on the board without virtual memory. There are two approaches to compiling&lt;br /&gt;
Linux TIE code with &#039;&#039;&#039;xcc&#039;&#039;&#039;. The simple approach assumes the host workstation and target code running of the board&lt;br /&gt;
are similar enough that the library interfaces defined by the include files are compatable. This is often the&lt;br /&gt;
case for standard system calls, libc, and stdio.The proper approach uses a virtual core that we will create&lt;br /&gt;
that has built in references to the library and include files on the target code running on the LX200.&lt;br /&gt;
&lt;br /&gt;
=== Simply using Xtensa Tools to compile the TIE code on a workstation ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting &#039;&#039;&#039;xcc&#039;&#039;&#039; into our search path and set the standard XTENSA_* environement variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the XL200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
=== The Proper Approach of Building TIE code for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
In section 4.3 of the &#039;&#039;&#039;Xtensa OSKit Guide&#039;&#039;&#039; there is a detailed description&lt;br /&gt;
of this intense procedure of building target binaries. As the founding father&lt;br /&gt;
of Java, Jim Gosling,&lt;br /&gt;
once wrote, &#039;&#039;&#039;&amp;quot;Not for Pregnant Woman or men with weak hearts&amp;quot;&#039;&#039;&#039;. This proceedure&lt;br /&gt;
depends on a number of packages to be right, like versions of Xprorer and &#039;&#039;&#039;gcc&#039;&#039;&#039;.&lt;br /&gt;
When it works it&#039;s much faster than compiling on the target.&lt;br /&gt;
&lt;br /&gt;
A summary of the procedure is available from the --help message of the&lt;br /&gt;
install script that set up a cloned core. &lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
     [piet@fc9desktop test_mmuhifi_c3]$ &#039;&#039;&#039;${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install --help&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Usage:&lt;br /&gt;
       &amp;lt;fullpath&amp;gt;/xt-xcc-linux-install  --sysroot=&amp;lt;target_sysroot&amp;gt;&lt;br /&gt;
                                       [--clone-core=&amp;lt;corename&amp;gt;]&lt;br /&gt;
                                       [--clone-root=&amp;lt;rootdir&amp;gt;]&lt;br /&gt;
                                       [--clone-registry=&amp;lt;registrydir&amp;gt;]&lt;br /&gt;
                                       [--c-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
                                       [--cxx-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
                                       [--lib-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
                                       [--linux-gcc=&amp;lt;path_to_target_gcc&amp;gt;]&lt;br /&gt;
                                       [--help]&lt;br /&gt;
 &lt;br /&gt;
       --sysroot=&amp;lt;target_sysroot&amp;gt;&lt;br /&gt;
            Specify the target sysroot directory, the root of a tree containing&lt;br /&gt;
            target header files and libraries for use by the compiler.  Although&lt;br /&gt;
            this can be the target filesystem as it appears on the host (for&lt;br /&gt;
            targets supporting native development), it is typically a different&lt;br /&gt;
            but similarly structured tree (for cross-development).  Xtensa Tools&lt;br /&gt;
            look for target headers in &amp;lt;target_sysroot&amp;gt;/usr/include, and for&lt;br /&gt;
            target libraries in &amp;lt;target_sysroot&amp;gt;/lib and &amp;lt;target_sysroot&amp;gt;/usr/lib.&lt;br /&gt;
            There is no default and this directory must be specified.&lt;br /&gt;
 &lt;br /&gt;
       [--c-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
            Specify an additional directory for the default C header search path.&lt;br /&gt;
     &lt;br /&gt;
       [--cxx-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
            Specify an additional directory for the default C++ header search path.&lt;br /&gt;
       &lt;br /&gt;
       [--lib-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
            Specify an extra dir. for the default library+startfile search path.&lt;br /&gt;
      &lt;br /&gt;
       [--linux-gcc=&amp;lt;path_to_target_gcc&amp;gt;]&lt;br /&gt;
            Specify the path to a host GCC targeting the Xtensa Linux system,&lt;br /&gt;
            which this script invokes to obtain additional lists of include&lt;br /&gt;
            directories for C headers, C++ headers, and libraries.&lt;br /&gt;
            This is often a convenient shorthand to specifying multiple&lt;br /&gt;
            --c-include , --cxx-include, and --lib-include options.&lt;br /&gt;
 &lt;br /&gt;
       [--clone-core=&amp;lt;corename&amp;gt;]&lt;br /&gt;
            Name of the clone core to install.  If omitted, the default is&lt;br /&gt;
            the original core name specified in the Xtensa Processor&lt;br /&gt;
            Generator with &#039;-linux&#039; appended to the name.&lt;br /&gt;
 &lt;br /&gt;
       [--clone-root=&amp;lt;rootdir&amp;gt;]&lt;br /&gt;
            Specify the directory where the clone core package will be&lt;br /&gt;
            installed.  If omitted, the default is a path derived by replacing&lt;br /&gt;
            the leaf directory of the original core package, &amp;lt;xtensa_root&amp;gt;,&lt;br /&gt;
            with the name of the clone core.&lt;br /&gt;
 &lt;br /&gt;
       [--clone-registry=&amp;lt;registrydir&amp;gt;]&lt;br /&gt;
            Specify the Xtensa core registry in which to register the new&lt;br /&gt;
            clone core name.  If omitted, the default core registry is&lt;br /&gt;
            used, located in Xtensa Tools at &amp;lt;xtensa_tools_root&amp;gt;/config.&lt;br /&gt;
       &lt;br /&gt;
       [--help]&lt;br /&gt;
            Display this message and exit without installing anything.&lt;br /&gt;
 &lt;br /&gt;
    This installer clones its containing Xtensa core package (using symlinks),&lt;br /&gt;
    and modifies the clone to make XCC build applications that run on Linux.&lt;br /&gt;
    For this to work, XCC must select this clone core name, and use the default&lt;br /&gt;
    Xtensa Linker Support Package (that is, avoid the -mlsp parameter).&lt;br /&gt;
 &lt;br /&gt;
    The installer registers the new clone core in the specified Xtensa core&lt;br /&gt;
    registry.  The clone core can be selected using either the XTENSA_CORE&lt;br /&gt;
    environment variable or the --xtensa-core=&amp;lt;corename&amp;gt; parameter to run&lt;br /&gt;
    xt-xcc (the XCC C/C++ compiler) and other Xtensa Tools.&lt;br /&gt;
 &lt;br /&gt;
    [piet@fc9desktop test_mmuhifi_c3]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below illustrates using this &#039;&#039;&#039;core cloning&#039;&#039;&#039; procedure:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_CORE      test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;setenv PATH ${XTENSA_TOOLS}:${PATH}&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;setenv TARGET_SYSROOT   /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv BUILDROOT_DIR    /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                                                         \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--sysroot=${BUILDROOT_DIR}/build_xtensa_${XTENSA_CORE}/staging_dir                                                 \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--clone-core=test_mmuhifi_c3-linux-clone                                                                           \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--linux-gcc=${BUILDROOT_DIR}/build_xtensa_${XTENSA_CORE}/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gcc&#039;&#039;&#039;                   [NOTE: Maxim used this for some reason on the C++ problem]&lt;br /&gt;
&lt;br /&gt;
The [[Normal Core Cloning Proceedure Output]] will have details on how to change your environment variables to&lt;br /&gt;
use the new cloned core:&lt;br /&gt;
&lt;br /&gt;
    ************************************************************&lt;br /&gt;
    * Installation Complete.&lt;br /&gt;
    ************************************************************&lt;br /&gt;
    To build Linux applications using XCC, set the XTENSA_CORE environment&lt;br /&gt;
    variable to &amp;quot;default&amp;quot; and XTENSA_SYSTEM to&lt;br /&gt;
    &amp;quot;/home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3-linux-clone/config&amp;quot;.&lt;br /&gt;
    &lt;br /&gt;
    Alternatively, set XTENSA_CORE to &amp;quot;test_mmuhifi_c3-linux-clone&amp;quot; and XTENSA_SYSTEM&lt;br /&gt;
    to &amp;quot;/home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/config&amp;quot;&lt;br /&gt;
    (or leave XTENSA_SYSTEM unset if that is the default registry).&lt;br /&gt;
&lt;br /&gt;
Next, we follow the suggested change of environment variables in a new termulator window with&lt;br /&gt;
a fresh environemnt:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_CORE      test_mmuhifi_c3-linux-clone&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/config&#039;&#039;&#039; &lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv PATH ${XTENSA_TOOLS}:${PATH}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;xt-xcc -c hifitest.c -o hifitest&#039;&#039;&#039;                                        [NOTE: This file has embedded TIE code in it; it can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simple procedure should work as long as you keep your tie code in files without&lt;br /&gt;
significant system include files. For example the /home/default/AUDIO_Tests/hifitest.c&lt;br /&gt;
used above in the core cloning example:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
    #include &amp;lt;time.h&amp;gt;&lt;br /&gt;
    #include &amp;lt;xtensa/tie/xt_hifi2.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    #define INC 1&lt;br /&gt;
    &lt;br /&gt;
    main(int argc, char **argv)&lt;br /&gt;
    {&lt;br /&gt;
      int inc;&lt;br /&gt;
      int inc2;&lt;br /&gt;
      register ae_p24x2s p24_cnt;&lt;br /&gt;
      register ae_p24x2s p24_inc;&lt;br /&gt;
      register ae_p24x2s p24_pid;&lt;br /&gt;
      int cnt;&lt;br /&gt;
      int cnt2;&lt;br /&gt;
      int pid;&lt;br /&gt;
      int pid2;&lt;br /&gt;
      volatile int i, j, k, l;&lt;br /&gt;
      time_t time0 = time(NULL);&lt;br /&gt;
      time_t time1 = time(NULL);&lt;br /&gt;
    &lt;br /&gt;
    restart:&lt;br /&gt;
      cnt = 0;&lt;br /&gt;
      cnt2 = 0;&lt;br /&gt;
      inc = INC;&lt;br /&gt;
      pid = getpid();&lt;br /&gt;
      p24_cnt = AE_ZEROP48();&lt;br /&gt;
      p24_inc = AE_MOVPA24(inc);&lt;br /&gt;
      p24_pid = AE_MOVPA24(pid);&lt;br /&gt;
    &lt;br /&gt;
      while (1)&lt;br /&gt;
        {&lt;br /&gt;
          int errors = 0;&lt;br /&gt;
    &lt;br /&gt;
          if ((cnt &amp;amp; 0xffffff) == 0) {&lt;br /&gt;
    	time0 = time1;&lt;br /&gt;
    	time1 = time(NULL);&lt;br /&gt;
    	printf(&amp;quot;cnt:0x%x, pid:%d; Eatting cpu; time:%ld\n&amp;quot;, cnt, pid, (time1 - time0));&lt;br /&gt;
    	for(i = 0; i&amp;lt;1000; i++) {&lt;br /&gt;
    	    for(j = 0; j &amp;lt; 1000; j++) {&lt;br /&gt;
    	        for(k = 0; k &amp;lt; 10; k++) {&lt;br /&gt;
    			l++;&lt;br /&gt;
    	    	}&lt;br /&gt;
    	    }&lt;br /&gt;
    	}&lt;br /&gt;
    	time0 = time1;&lt;br /&gt;
    	time1 = time(NULL);&lt;br /&gt;
    	printf(&amp;quot;cnt:0x%x, pid:%d; Eating Tie; time:%ld\n&amp;quot;, cnt, pid, (time1 - time0));&lt;br /&gt;
          }	&lt;br /&gt;
          cnt = (cnt + inc) &amp;amp; 0xffffff;&lt;br /&gt;
          p24_cnt = AE_ADDP24(p24_cnt, p24_inc);&lt;br /&gt;
          cnt2 = AE_MOVAP24S_L(p24_cnt) &amp;amp; 0xffffff;&lt;br /&gt;
          pid2 = AE_MOVAP24S_L(p24_pid) &amp;amp; 0xffffff;&lt;br /&gt;
          inc2 = AE_MOVAP24S_L(p24_inc) &amp;amp; 0xffffff;&lt;br /&gt;
    &lt;br /&gt;
          if (cnt2 != cnt)&lt;br /&gt;
    	{&lt;br /&gt;
    	  swapon(&amp;quot;/tmp/cmt2&amp;quot;, 0);&lt;br /&gt;
    	  printf(&amp;quot;Error: cnt2:0x%x != cnt:0x%x\n&amp;quot;, cnt2, cnt);&lt;br /&gt;
    	  errors++;&lt;br /&gt;
    	}&lt;br /&gt;
          if (inc2 != inc)&lt;br /&gt;
    	{&lt;br /&gt;
    	  swapon(&amp;quot;/tmp/inc2&amp;quot;, 0);&lt;br /&gt;
    	  printf(&amp;quot;Error: inc2:%d != inc:%d\n&amp;quot;, cnt2, cnt);&lt;br /&gt;
    	  errors++;&lt;br /&gt;
    	}&lt;br /&gt;
          if ( pid2 != pid)&lt;br /&gt;
    	{&lt;br /&gt;
    	  swapon(&amp;quot;/tmp/pid2&amp;quot;, 0);&lt;br /&gt;
    	  printf(&amp;quot;Error: pid2:%d != pid:%d\n&amp;quot;, pid2, pid);&lt;br /&gt;
    	  errors++;&lt;br /&gt;
    	}&lt;br /&gt;
    &lt;br /&gt;
    	if (errors) {&lt;br /&gt;
    	    printf(&amp;quot;for...\n&amp;quot;);&lt;br /&gt;
    	    for(i=0; i &amp;lt; 0x3FFFF; i++) &lt;br /&gt;
    		j++;&lt;br /&gt;
    	    printf(&amp;quot;sleep 10\n&amp;quot;);&lt;br /&gt;
    	    sleep(10);	&lt;br /&gt;
    	    printf(&amp;quot;for...\n&amp;quot;);&lt;br /&gt;
    		for(i=0; i &amp;lt; 0x3FFFF; i++)&lt;br /&gt;
    			j++;	&lt;br /&gt;
    	    printf(&amp;quot;restart\n&amp;quot;);	&lt;br /&gt;
    	    goto restart;&lt;br /&gt;
    	}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
$&lt;br /&gt;
&lt;br /&gt;
== Adding your codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a chalanging experience and worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Minicom_xtboard_setup&amp;diff=340</id>
		<title>Minicom xtboard setup</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Minicom_xtboard_setup&amp;diff=340"/>
		<updated>2009-12-01T20:36:06Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Minicom Setup for Tensilica Boards */ Put back link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Minicom Setup for Tensilica Boards =&lt;br /&gt;
&lt;br /&gt;
For using [http://en.wikipedia.org/wiki/Minicom minicom] as your&lt;br /&gt;
terminal emulator, you can save&lt;br /&gt;
settings by name and just invoke minicom with that name, for example:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;minicom myboard&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
which initializes with parameters from /etc/minirc.myboard:&lt;br /&gt;
&lt;br /&gt;
        # Machine-generated file - use &amp;quot;minicom -s&amp;quot; to change parameters.&lt;br /&gt;
        pr port             /dev/ttyS0&lt;br /&gt;
        pu minit&lt;br /&gt;
        pu mreset&lt;br /&gt;
        pu mdialpre&lt;br /&gt;
        pu mconnect&lt;br /&gt;
        pu mhangup&lt;br /&gt;
        pu mdialcan&lt;br /&gt;
        pu hasdcd           No&lt;br /&gt;
        pu rtscts           No&lt;br /&gt;
&lt;br /&gt;
The LX200 board expects to communicate at a baud rate of 38400 without parity and with 1 stop bit, &lt;br /&gt;
so the minicom &#039;&#039;&#039;Comm Parameters&#039;&#039;&#039; should be &amp;quot;Current: 38400 8N1&amp;quot; and can be displayed with &amp;lt;Ctrl-A&amp;gt; p:&lt;br /&gt;
&lt;br /&gt;
       Welcome to minicom 2.00.0&lt;br /&gt;
                            ┌───────────[Comm Parameters]────────────┐&lt;br /&gt;
        OPTIONS: History Buf│                                        │&lt;br /&gt;
        Compiled on Jun 15 2│ Current: 38400 8N1                     │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
        Press CTRL-A Z for h│   Speed          Parity          Data  │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
                            │ A: 300           L: None         S: 5  │&lt;br /&gt;
                            │ B: 1200          M: Even         T: 6  │&lt;br /&gt;
                            │ C: 2400          N: Odd          U: 7  │&lt;br /&gt;
                            │ D: 4800          O: Mark         V: 8  │&lt;br /&gt;
                            │ E: 9600          P: Space              │&lt;br /&gt;
                            │ F: 19200                      Stopbits │&lt;br /&gt;
                            │ G: 38400                         W: 1  │&lt;br /&gt;
                            │ H: 57600                         X: 2  │&lt;br /&gt;
                            │ I: 115200        Q: 8-N-1              │&lt;br /&gt;
                            │ J: 230400        R: 7-E-1              │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
                            │ Choice, or &amp;lt;Enter&amp;gt; to exit?            │&lt;br /&gt;
                            └────────────────────────────────────────┘&lt;br /&gt;
&lt;br /&gt;
[[Mplayer_Hifi_2_Codec_Development_Board#Configuring_U-Boot_to_Boot_Linux|(Back to U-Boot setup)]]&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Minicom_xtboard_setup&amp;diff=339</id>
		<title>Minicom xtboard setup</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Minicom_xtboard_setup&amp;diff=339"/>
		<updated>2009-12-01T20:33:13Z</updated>

		<summary type="html">&lt;p&gt;Marc: Put minicom setup info in a separate page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Minicom Setup for Tensilica Boards =&lt;br /&gt;
&lt;br /&gt;
For using [http://en.wikipedia.org/wiki/Minicom minicom] as your&lt;br /&gt;
terminal emulator, you can save&lt;br /&gt;
settings by name and just invoke minicom with that name, for example:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;minicom myboard&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
which initializes with parameters from /etc/minirc.myboard:&lt;br /&gt;
&lt;br /&gt;
        # Machine-generated file - use &amp;quot;minicom -s&amp;quot; to change parameters.&lt;br /&gt;
        pr port             /dev/ttyS0&lt;br /&gt;
        pu minit&lt;br /&gt;
        pu mreset&lt;br /&gt;
        pu mdialpre&lt;br /&gt;
        pu mconnect&lt;br /&gt;
        pu mhangup&lt;br /&gt;
        pu mdialcan&lt;br /&gt;
        pu hasdcd           No&lt;br /&gt;
        pu rtscts           No&lt;br /&gt;
&lt;br /&gt;
The LX200 board expects to communicate at a baud rate of 38400 without parity and with 1 stop bit, &lt;br /&gt;
so the minicom &#039;&#039;&#039;Comm Parameters&#039;&#039;&#039; should be &amp;quot;Current: 38400 8N1&amp;quot; and can be displayed with &amp;lt;Ctrl-A&amp;gt; p:&lt;br /&gt;
&lt;br /&gt;
       Welcome to minicom 2.00.0&lt;br /&gt;
                            ┌───────────[Comm Parameters]────────────┐&lt;br /&gt;
        OPTIONS: History Buf│                                        │&lt;br /&gt;
        Compiled on Jun 15 2│ Current: 38400 8N1                     │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
        Press CTRL-A Z for h│   Speed          Parity          Data  │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
                            │ A: 300           L: None         S: 5  │&lt;br /&gt;
                            │ B: 1200          M: Even         T: 6  │&lt;br /&gt;
                            │ C: 2400          N: Odd          U: 7  │&lt;br /&gt;
                            │ D: 4800          O: Mark         V: 8  │&lt;br /&gt;
                            │ E: 9600          P: Space              │&lt;br /&gt;
                            │ F: 19200                      Stopbits │&lt;br /&gt;
                            │ G: 38400                         W: 1  │&lt;br /&gt;
                            │ H: 57600                         X: 2  │&lt;br /&gt;
                            │ I: 115200        Q: 8-N-1              │&lt;br /&gt;
                            │ J: 230400        R: 7-E-1              │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
                            │ Choice, or &amp;lt;Enter&amp;gt; to exit?            │&lt;br /&gt;
                            └────────────────────────────────────────┘&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=338</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=338"/>
		<updated>2009-12-01T20:28:40Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Configuring U-Boot to Boot Linux */ Typo fixes; arp detects few aliases&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the &amp;quot;communitee&amp;quot;&amp;quot; guide for how to use HiFi-2 Codec Development environment on an LX200 FPGA board.&lt;br /&gt;
If somethinig doesn&#039;t work ir isn&#039;t vovered in these guides, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux//Xtensa Mailing List]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
   &lt;br /&gt;
*  Buildroot build with Fedora Core 9 also seems to be fine; perhaps better than when built on Fedore Core 5.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 codec development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for codec development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFI-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                           [56 key strokes]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;                                                       [28 key strokes]&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                                [8 key strokes]&lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                 [2 key strokes]&lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                      [1 key stroke]&lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 [1 key stroke]&lt;br /&gt;
                origin/snapshot_2+SMP                                                        [1 key stroke]&lt;br /&gt;
          [Create]                                                                           [1 key stroke]&lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                   [2 key strokes]&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currenty our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200). &lt;br /&gt;
As in the build root case, you can also do it from via git gui using the same proceedure&lt;br /&gt;
mantioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recomend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;/var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                      [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;       [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
        [piet@pdelaney_fc5 ~]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                        [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
For &amp;lt;tt&amp;gt;minicom&amp;lt;/tt&amp;gt; you can save&lt;br /&gt;
settings by name and just invoke, for example:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;minicom myboard&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
which initializes with parameters from /etc/minirc.myboard:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        # Machine-generated file - use &amp;quot;minicom -s&amp;quot; to change parameters.&lt;br /&gt;
        pr port             /dev/ttyS0&lt;br /&gt;
        pu minit&lt;br /&gt;
        pu mreset&lt;br /&gt;
        pu mdialpre&lt;br /&gt;
        pu mconnect&lt;br /&gt;
        pu mhangup&lt;br /&gt;
        pu mdialcan&lt;br /&gt;
        pu hasdcd           No&lt;br /&gt;
        pu rtscts           No&lt;br /&gt;
~                                                 &lt;br /&gt;
The LX200 board expects to communicate at a baud rate of 38400 without parity and with 1 stop bit, &lt;br /&gt;
so the minicom &#039;&#039;&#039;Comm Parameters&#039;&#039;&#039; should be &amp;quot;Current: 38400 8N1&amp;quot; and can be displayed with &amp;lt;Ctrl-A&amp;gt; p:&lt;br /&gt;
&lt;br /&gt;
       Welcome to minicom 2.00.0&lt;br /&gt;
                            ┌───────────[Comm Parameters]────────────┐&lt;br /&gt;
        OPTIONS: History Buf│                                        │&lt;br /&gt;
        Compiled on Jun 15 2│ Current: 38400 8N1                     │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
        Press CTRL-A Z for h│   Speed          Parity          Data  │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
                            │ A: 300           L: None         S: 5  │&lt;br /&gt;
                            │ B: 1200          M: Even         T: 6  │&lt;br /&gt;
                            │ C: 2400          N: Odd          U: 7  │&lt;br /&gt;
                            │ D: 4800          O: Mark         V: 8  │&lt;br /&gt;
                            │ E: 9600          P: Space              │&lt;br /&gt;
                            │ F: 19200                      Stopbits │&lt;br /&gt;
                            │ G: 38400                         W: 1  │&lt;br /&gt;
                            │ H: 57600                         X: 2  │&lt;br /&gt;
                            │ I: 115200        Q: 8-N-1              │&lt;br /&gt;
                            │ J: 230400        R: 7-E-1              │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
                            │                                        │&lt;br /&gt;
                            │ Choice, or &amp;lt;Enter&amp;gt; to exit?            │&lt;br /&gt;
                            └────────────────────────────────────────┘&lt;br /&gt;
&lt;br /&gt;
Many users of this board are interested in developing codecs and/or HiFi 2 software and will prefer to just boot linux with the root file system we just described how to export on you NFS server. We will use git now to pull a snapshot of a performance 2.6.29 linux kernel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                                          [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay 20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[REMIND: Update the above procedure, show two or thee approaches (ip, dhcp, bootp)]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we suggest mounting a /home/default files-system that has number of&lt;br /&gt;
files useful for getting started. Find another place to tar in the tar ball with the default users file system.&lt;br /&gt;
We chose to include this close to the cpio file with the root file-system. Copy the tar bar to where you are&lt;br /&gt;
exporting you root file-system and next to it add the &#039;default&#039; users file-system:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cp /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.10/binaries/default.tar .&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf default.tar&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls&#039;&#039;&#039;&lt;br /&gt;
      [TO BE ADDED]&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball called &#039;&#039;&#039;saved_files.tar&#039;&#039;&#039;. This ia a tar file of files that&lt;br /&gt;
developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief&lt;br /&gt;
explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                                          [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                                 [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                                   [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                                         [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                                             [Location of DNS servers when your not using DHCP to boot the kernel]&lt;br /&gt;
    etc/TZ                                                      [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key                          [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                                        [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                                    [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                                             [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                                             [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                                  [Changed default user&#039;s shell to bash]&lt;br /&gt;
    etc/shadow                                                  [Changed default and root users login password to &#039;linux1&#039;, need to ssh to the board]&lt;br /&gt;
    exports/                                                    [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    fac/                                                        [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
    fac/vol6/                                                   [Where we get the HiFi-2 codec from to install and build mplayer plugins]&lt;br /&gt;
&lt;br /&gt;
Now lets assume your going to stay with these changes and modify them after taring in these changes.&lt;br /&gt;
Here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/default/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system&lt;br /&gt;
before boot it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                                        [Change fstab entry for /home/default and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;                              [You might want to disable mounting of NFS file systems on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now lets start with hitting the reset button on the X200 and it should&lt;br /&gt;
auto-boot the kernel:&lt;br /&gt;
&lt;br /&gt;
    U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:07&lt;br /&gt;
    IP:     192.168.11.105&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    Autobooting in 5 seconds, press &amp;lt;SPACE&amp;gt; to stop&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.105&lt;br /&gt;
    Filename &#039;uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: #################################################################&lt;br /&gt;
             ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 1161826 (11ba62 hex)&lt;br /&gt;
    Automatic boot of image at addr 0xD2000000 ...&lt;br /&gt;
    ## Booting kernel from Legacy Image at d2000000 ...&lt;br /&gt;
       Image Name:   Linux-2.6.29-rc7&lt;br /&gt;
       Image Type:   Xtensa Linux Kernel Image (gzip compressed)&lt;br /&gt;
       Data Size:    1161762 Bytes =  1.1 MB&lt;br /&gt;
       Load Address: d0001000&lt;br /&gt;
       Entry Point:  d0001000&lt;br /&gt;
       Verifying Checksum ... OK&lt;br /&gt;
       Uncompressing Kernel Image ... OK&lt;br /&gt;
     &lt;br /&gt;
    ## Linux Boot Params Starting At Address:0xd5f50000&lt;br /&gt;
       MEMORY:          tag:0x1003, type:0X1000, start:0X0, end:0X6000000&lt;br /&gt;
       COMMAND_LINE:    tag:0x1001, size:188, data:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;&lt;br /&gt;
       SERIAL_BAUDRATE: tag:0x1004, size:4, baudrate:38400&lt;br /&gt;
    &lt;br /&gt;
    ## Transferring Control to Linux Kernel At Address 0xd0001000 ...&lt;br /&gt;
    &lt;br /&gt;
     &lt;br /&gt;
    &lt;br /&gt;
    parse_bootparam: Ignoring tag 0x1004&lt;br /&gt;
    lx60 platform_init(bootparams:d5f50000)&lt;br /&gt;
    Linux version 2.6.29-rc7 (pdelaney@pdelaney_fc5.hq.tensilica.com) (gcc version 4.2.1) #201 SMP Tue Nov 17 23:49:39 PST 2009&lt;br /&gt;
    lx60 platform_setup(cmdline[0]:&#039;console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&#039;)&lt;br /&gt;
    smp_init_cpus: Core Count = 3&lt;br /&gt;
    smp_init_cpus: Core Id = 9320&lt;br /&gt;
    On node 0 totalpages: 24576&lt;br /&gt;
    free_area_init_node: node 0, pgdat d0196540, node_mem_map d01fa000&lt;br /&gt;
      Normal zone: 216 pages used for memmap&lt;br /&gt;
      Normal zone: 24360 pages, LIFO batch:3&lt;br /&gt;
    smp_prepare_boot_cpu:&lt;br /&gt;
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 24360&lt;br /&gt;
    Kernel command line: console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:&amp;quot;HiFi-2 Demo&amp;quot; root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&lt;br /&gt;
    trap_init 0&lt;br /&gt;
    PID hash table entries: 512 (order: 9, 2048 bytes)&lt;br /&gt;
    time_init: Platform Calibrating CPU frequency&lt;br /&gt;
    time_init: ccount_per_jiffy:416777 [41.67 MHz], nsec_per_ccount:23&lt;br /&gt;
    Console: colour dummy device 80x25&lt;br /&gt;
    console [ttyS0] enabled&lt;br /&gt;
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)&lt;br /&gt;
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)&lt;br /&gt;
    Memory: 95196k/98304k available (1229k kernel code, 3040k reserved, 28k data, 72k init 0k highmem)&lt;br /&gt;
    Calibrating delay loop... 41.26 BogoMIPS (lpj=206336)&lt;br /&gt;
    Mount-cache hash table entries: 512&lt;br /&gt;
    cpu 1 fffd&lt;br /&gt;
    secondary_trap_init 1&lt;br /&gt;
    Calibrating delay loop... 41.67 BogoMIPS (lpj=208384)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:1, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:1, INTENABLE:7d&lt;br /&gt;
    cpu 2 fff9&lt;br /&gt;
    secondary_trap_init 2&lt;br /&gt;
    Calibrating delay loop... 41.57 BogoMIPS (lpj=207872)&lt;br /&gt;
    secondary_irq_init: set cached_irq_mask and enable interrupts))&lt;br /&gt;
    secondary_time_init()&lt;br /&gt;
    secondary_irq_enable(intrnum:6): cpu:2, INTENABLE:7c&lt;br /&gt;
    secondary_irq_enable(intrnum:0): cpu:2, INTENABLE:7d&lt;br /&gt;
    Brought up 3 CPUs&lt;br /&gt;
    smp_cpus_done:&lt;br /&gt;
    net_namespace: 304 bytes&lt;br /&gt;
    NET: Registered protocol family 16&lt;br /&gt;
    lx60_init()&lt;br /&gt;
    bio: create slab &amp;lt;bio-0&amp;gt; at 0&lt;br /&gt;
    NET: Registered protocol family 2&lt;br /&gt;
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)&lt;br /&gt;
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP bind hash table entries: 4096 (order: 3, 32768 bytes)&lt;br /&gt;
    TCP: Hash tables configured (established 4096 bind 4096)&lt;br /&gt;
    TCP reno registered&lt;br /&gt;
   NET: Registered protocol family 1&lt;br /&gt;
    msgmni has been set to 186&lt;br /&gt;
    alg: No test for md5 (md5-generic)&lt;br /&gt;
    alg: No test for des (des-generic)&lt;br /&gt;
    alg: No test for des3_ede (des3_ede-generic)&lt;br /&gt;
    alg: No test for stdrng (krng)&lt;br /&gt;
    io scheduler noop registered (default)&lt;br /&gt;
    Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled&lt;br /&gt;
    serial8250: ttyS0 at MMIO 0x0 (irq = 3) is a 16550A&lt;br /&gt;
    oeth_probe: {&lt;br /&gt;
    oeth_setup: Open Ethernet Core Version 1.0.1&lt;br /&gt;
     : oeth_setup: Found id1:2000, id2:5c30 at phy_id:3.&lt;br /&gt;
     : Hardware MAC Address: 00:50:c2:13:6f:0f&lt;br /&gt;
    eth0 (): not using net_device_ops yet&lt;br /&gt;
    oeth_probe: }&lt;br /&gt;
    mice: PS/2 mouse device common for all mice&lt;br /&gt;
    TCP cubic registered&lt;br /&gt;
    NET: Registered protocol family 17&lt;br /&gt;
    RPC: Registered udp transport module.&lt;br /&gt;
    RPC: Registered tcp transport module.&lt;br /&gt;
    oeth_open:  Ready to process packets now on dev-&amp;gt;name:&#039;eth0&#039;, dev:d597d800;&lt;br /&gt;
    IP-Config: Complete:&lt;br /&gt;
         device=eth0, addr=192.168.11.105, mask=255.255.255.0, gw=192.168.11.1,&lt;br /&gt;
         host=&amp;quot;HiFi-2 Demo&amp;quot;, domain=, nis-domain=(none),&lt;br /&gt;
         bootserver=192.168.11.55, rootserver=192.168.11.55, rootpath=&lt;br /&gt;
    Looking up port of RPC 100003/2 on 192.168.11.55&lt;br /&gt;
    Looking up port of RPC 100005/1 on 192.168.11.55&lt;br /&gt;
    VFS: Mounted root (nfs filesystem) on device 0:11.&lt;br /&gt;
    Freeing unused kernel memory: 72k freed&lt;br /&gt;
    Starting portmap: done&lt;br /&gt;
    Initializing random number generator... done.&lt;br /&gt;
    Starting network...&lt;br /&gt;
    ip: RTNETLINK answers: File exists&lt;br /&gt;
    Starting sshd: OK&lt;br /&gt;
    Starting NFS statd: done&lt;br /&gt;
    Starting NFS services: done&lt;br /&gt;
    Starting NFS daemon: done&lt;br /&gt;
    Starting NFS mountd: done&lt;br /&gt;
    Starting domain name daemon: namedwarning: `named&#039; uses 32-bit capabilities (legacy support in use)&lt;br /&gt;
    failed&lt;br /&gt;
    Fri Nov 20 17:10:37 2009&lt;br /&gt;
    Mounting Other NFS Filesystems&lt;br /&gt;
    &lt;br /&gt;
    Welcome to your custom Xtensa HiFi-2 Codec Developemnt System&lt;br /&gt;
    hifi login: &#039;&#039;&#039;root&#039;&#039;&#039;&lt;br /&gt;
    Password: &#039;&#039;&#039;linux1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing your codec ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile most of mplayer on the XL200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, lets focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling a audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the Makefile of the codes slightly, and will make it available.&lt;br /&gt;
These additions just instruct make how to install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # &#039;&#039;&#039;cd /fac/vol6/audio/release/bin/l32r_LE5_pic&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&#039;&#039;&#039;&lt;br /&gt;
        # &lt;br /&gt;
        # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd mplayer_hifi2_mp3_plugin&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make target_install&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 codec tar ball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpfull.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, thought&lt;br /&gt;
much slower. For example here we configure and build the strace package:&lt;br /&gt;
&lt;br /&gt;
[[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
== Compiling Tie Code with XCC ==&lt;br /&gt;
&lt;br /&gt;
Codecs like MP3 and AAC have been written in C with TIE extensions and can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;.&lt;br /&gt;
XCC is likely to large to run on the board without virtual memory. There are two approaches to compiling&lt;br /&gt;
Linux TIE code with &#039;&#039;&#039;xcc&#039;&#039;&#039;. The simple approach assumes the host workstation and target code running of the board&lt;br /&gt;
are similar enough that the library interfaces defined by the include files are compatable. This is often the&lt;br /&gt;
case for standard system calls, libc, and stdio.The proper approach uses a virtual core that we will create&lt;br /&gt;
that has built in references to the library and include files on the target code running on the LX200.&lt;br /&gt;
&lt;br /&gt;
=== Simply using Xtensa Tools to compile the TIE code on a workstation ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting &#039;&#039;&#039;xcc&#039;&#039;&#039; into our search path and set the standard XTENSA_* environement variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    setenv XTENSA_CORE      test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&lt;br /&gt;
    setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&lt;br /&gt;
    setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&lt;br /&gt;
     &lt;br /&gt;
    setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;                                       [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the XL200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
=== The Proper Approach of Building TIE code for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
In section 4.3 of the &#039;&#039;&#039;Xtensa OSKit Guide&#039;&#039;&#039; there is a detailed description&lt;br /&gt;
of this intense procedure of building target binaries. As the founding father&lt;br /&gt;
of Java, Jim Gosling,&lt;br /&gt;
once wrote, &#039;&#039;&#039;&amp;quot;Not for Pregnant Woman or men with weak hearts&amp;quot;&#039;&#039;&#039;. This proceedure&lt;br /&gt;
depends on a number of packages to be right, like versions of Xprorer and &#039;&#039;&#039;gcc&#039;&#039;&#039;.&lt;br /&gt;
When it works it&#039;s much faster than compiling on the target.&lt;br /&gt;
&lt;br /&gt;
A summary of the procedure is available from the --help message of the&lt;br /&gt;
install script that set up a cloned core. &lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
     [piet@fc9desktop test_mmuhifi_c3]$ &#039;&#039;&#039;${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install --help&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Usage:&lt;br /&gt;
       &amp;lt;fullpath&amp;gt;/xt-xcc-linux-install  --sysroot=&amp;lt;target_sysroot&amp;gt;&lt;br /&gt;
                                       [--clone-core=&amp;lt;corename&amp;gt;]&lt;br /&gt;
                                       [--clone-root=&amp;lt;rootdir&amp;gt;]&lt;br /&gt;
                                       [--clone-registry=&amp;lt;registrydir&amp;gt;]&lt;br /&gt;
                                       [--c-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
                                       [--cxx-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
                                       [--lib-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
                                       [--linux-gcc=&amp;lt;path_to_target_gcc&amp;gt;]&lt;br /&gt;
                                       [--help]&lt;br /&gt;
 &lt;br /&gt;
       --sysroot=&amp;lt;target_sysroot&amp;gt;&lt;br /&gt;
            Specify the target sysroot directory, the root of a tree containing&lt;br /&gt;
            target header files and libraries for use by the compiler.  Although&lt;br /&gt;
            this can be the target filesystem as it appears on the host (for&lt;br /&gt;
            targets supporting native development), it is typically a different&lt;br /&gt;
            but similarly structured tree (for cross-development).  Xtensa Tools&lt;br /&gt;
            look for target headers in &amp;lt;target_sysroot&amp;gt;/usr/include, and for&lt;br /&gt;
            target libraries in &amp;lt;target_sysroot&amp;gt;/lib and &amp;lt;target_sysroot&amp;gt;/usr/lib.&lt;br /&gt;
            There is no default and this directory must be specified.&lt;br /&gt;
 &lt;br /&gt;
       [--c-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
            Specify an additional directory for the default C header search path.&lt;br /&gt;
     &lt;br /&gt;
       [--cxx-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
            Specify an additional directory for the default C++ header search path.&lt;br /&gt;
       &lt;br /&gt;
       [--lib-include=&amp;lt;dir&amp;gt;]&lt;br /&gt;
            Specify an extra dir. for the default library+startfile search path.&lt;br /&gt;
      &lt;br /&gt;
       [--linux-gcc=&amp;lt;path_to_target_gcc&amp;gt;]&lt;br /&gt;
            Specify the path to a host GCC targeting the Xtensa Linux system,&lt;br /&gt;
            which this script invokes to obtain additional lists of include&lt;br /&gt;
            directories for C headers, C++ headers, and libraries.&lt;br /&gt;
            This is often a convenient shorthand to specifying multiple&lt;br /&gt;
            --c-include , --cxx-include, and --lib-include options.&lt;br /&gt;
 &lt;br /&gt;
       [--clone-core=&amp;lt;corename&amp;gt;]&lt;br /&gt;
            Name of the clone core to install.  If omitted, the default is&lt;br /&gt;
            the original core name specified in the Xtensa Processor&lt;br /&gt;
            Generator with &#039;-linux&#039; appended to the name.&lt;br /&gt;
 &lt;br /&gt;
       [--clone-root=&amp;lt;rootdir&amp;gt;]&lt;br /&gt;
            Specify the directory where the clone core package will be&lt;br /&gt;
            installed.  If omitted, the default is a path derived by replacing&lt;br /&gt;
            the leaf directory of the original core package, &amp;lt;xtensa_root&amp;gt;,&lt;br /&gt;
            with the name of the clone core.&lt;br /&gt;
 &lt;br /&gt;
       [--clone-registry=&amp;lt;registrydir&amp;gt;]&lt;br /&gt;
            Specify the Xtensa core registry in which to register the new&lt;br /&gt;
            clone core name.  If omitted, the default core registry is&lt;br /&gt;
            used, located in Xtensa Tools at &amp;lt;xtensa_tools_root&amp;gt;/config.&lt;br /&gt;
       &lt;br /&gt;
       [--help]&lt;br /&gt;
            Display this message and exit without installing anything.&lt;br /&gt;
 &lt;br /&gt;
    This installer clones its containing Xtensa core package (using symlinks),&lt;br /&gt;
    and modifies the clone to make XCC build applications that run on Linux.&lt;br /&gt;
    For this to work, XCC must select this clone core name, and use the default&lt;br /&gt;
    Xtensa Linker Support Package (that is, avoid the -mlsp parameter).&lt;br /&gt;
 &lt;br /&gt;
    The installer registers the new clone core in the specified Xtensa core&lt;br /&gt;
    registry.  The clone core can be selected using either the XTENSA_CORE&lt;br /&gt;
    environment variable or the --xtensa-core=&amp;lt;corename&amp;gt; parameter to run&lt;br /&gt;
    xt-xcc (the XCC C/C++ compiler) and other Xtensa Tools.&lt;br /&gt;
 &lt;br /&gt;
    [piet@fc9desktop test_mmuhifi_c3]$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below illustrates using this &#039;&#039;&#039;core cloning&#039;&#039;&#039; procedure:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_CORE      test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;setenv PATH ${XTENSA_TOOLS}:${PATH}&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;setenv TARGET_SYSROOT   /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv BUILDROOT_DIR    /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                                                         \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--sysroot=${BUILDROOT_DIR}/build_xtensa_${XTENSA_CORE}/staging_dir                                                 \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--clone-core=test_mmuhifi_c3-linux-clone                                                                           \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--linux-gcc=${BUILDROOT_DIR}/build_xtensa_${XTENSA_CORE}/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gcc&#039;&#039;&#039;                   [NOTE: Maxim used this for some reason on the C++ problem]&lt;br /&gt;
&lt;br /&gt;
The [[Normal Core Cloning Proceedure Output]] will have details on how to change your environment variables to&lt;br /&gt;
use the new cloned core:&lt;br /&gt;
&lt;br /&gt;
    ************************************************************&lt;br /&gt;
    * Installation Complete.&lt;br /&gt;
    ************************************************************&lt;br /&gt;
    To build Linux applications using XCC, set the XTENSA_CORE environment&lt;br /&gt;
    variable to &amp;quot;default&amp;quot; and XTENSA_SYSTEM to&lt;br /&gt;
    &amp;quot;/home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3-linux-clone/config&amp;quot;.&lt;br /&gt;
    &lt;br /&gt;
    Alternatively, set XTENSA_CORE to &amp;quot;test_mmuhifi_c3-linux-clone&amp;quot; and XTENSA_SYSTEM&lt;br /&gt;
    to &amp;quot;/home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/config&amp;quot;&lt;br /&gt;
    (or leave XTENSA_SYSTEM unset if that is the default registry).&lt;br /&gt;
&lt;br /&gt;
Next, we follow the suggested change of environment variables in a new termulator window with&lt;br /&gt;
a fresh environemnt:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_CORE      test_mmuhifi_c3-linux-clone&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/config&#039;&#039;&#039; &lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv PATH ${XTENSA_TOOLS}:${PATH}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/default/Audio_Tests&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;xt-xcc -c hifitest.c -o hifitest&#039;&#039;&#039;                                        [NOTE: This file has embedded TIE code in it; it can only be compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simple procedure should work as long as you keep your tie code in files without&lt;br /&gt;
significant system include files. For example the /home/default/AUDIO_Tests/hifitest.c&lt;br /&gt;
used above in the core cloning example:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
    #include &amp;lt;time.h&amp;gt;&lt;br /&gt;
    #include &amp;lt;xtensa/tie/xt_hifi2.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    #define INC 1&lt;br /&gt;
    &lt;br /&gt;
    main(int argc, char **argv)&lt;br /&gt;
    {&lt;br /&gt;
      int inc;&lt;br /&gt;
      int inc2;&lt;br /&gt;
      register ae_p24x2s p24_cnt;&lt;br /&gt;
      register ae_p24x2s p24_inc;&lt;br /&gt;
      register ae_p24x2s p24_pid;&lt;br /&gt;
      int cnt;&lt;br /&gt;
      int cnt2;&lt;br /&gt;
      int pid;&lt;br /&gt;
      int pid2;&lt;br /&gt;
      volatile int i, j, k, l;&lt;br /&gt;
      time_t time0 = time(NULL);&lt;br /&gt;
      time_t time1 = time(NULL);&lt;br /&gt;
    &lt;br /&gt;
    restart:&lt;br /&gt;
      cnt = 0;&lt;br /&gt;
      cnt2 = 0;&lt;br /&gt;
      inc = INC;&lt;br /&gt;
      pid = getpid();&lt;br /&gt;
      p24_cnt = AE_ZEROP48();&lt;br /&gt;
      p24_inc = AE_MOVPA24(inc);&lt;br /&gt;
      p24_pid = AE_MOVPA24(pid);&lt;br /&gt;
    &lt;br /&gt;
      while (1)&lt;br /&gt;
        {&lt;br /&gt;
          int errors = 0;&lt;br /&gt;
    &lt;br /&gt;
          if ((cnt &amp;amp; 0xffffff) == 0) {&lt;br /&gt;
    	time0 = time1;&lt;br /&gt;
    	time1 = time(NULL);&lt;br /&gt;
    	printf(&amp;quot;cnt:0x%x, pid:%d; Eatting cpu; time:%ld\n&amp;quot;, cnt, pid, (time1 - time0));&lt;br /&gt;
    	for(i = 0; i&amp;lt;1000; i++) {&lt;br /&gt;
    	    for(j = 0; j &amp;lt; 1000; j++) {&lt;br /&gt;
    	        for(k = 0; k &amp;lt; 10; k++) {&lt;br /&gt;
    			l++;&lt;br /&gt;
    	    	}&lt;br /&gt;
    	    }&lt;br /&gt;
    	}&lt;br /&gt;
    	time0 = time1;&lt;br /&gt;
    	time1 = time(NULL);&lt;br /&gt;
    	printf(&amp;quot;cnt:0x%x, pid:%d; Eating Tie; time:%ld\n&amp;quot;, cnt, pid, (time1 - time0));&lt;br /&gt;
          }	&lt;br /&gt;
          cnt = (cnt + inc) &amp;amp; 0xffffff;&lt;br /&gt;
          p24_cnt = AE_ADDP24(p24_cnt, p24_inc);&lt;br /&gt;
          cnt2 = AE_MOVAP24S_L(p24_cnt) &amp;amp; 0xffffff;&lt;br /&gt;
          pid2 = AE_MOVAP24S_L(p24_pid) &amp;amp; 0xffffff;&lt;br /&gt;
          inc2 = AE_MOVAP24S_L(p24_inc) &amp;amp; 0xffffff;&lt;br /&gt;
    &lt;br /&gt;
          if (cnt2 != cnt)&lt;br /&gt;
    	{&lt;br /&gt;
    	  swapon(&amp;quot;/tmp/cmt2&amp;quot;, 0);&lt;br /&gt;
    	  printf(&amp;quot;Error: cnt2:0x%x != cnt:0x%x\n&amp;quot;, cnt2, cnt);&lt;br /&gt;
    	  errors++;&lt;br /&gt;
    	}&lt;br /&gt;
          if (inc2 != inc)&lt;br /&gt;
    	{&lt;br /&gt;
    	  swapon(&amp;quot;/tmp/inc2&amp;quot;, 0);&lt;br /&gt;
    	  printf(&amp;quot;Error: inc2:%d != inc:%d\n&amp;quot;, cnt2, cnt);&lt;br /&gt;
    	  errors++;&lt;br /&gt;
    	}&lt;br /&gt;
          if ( pid2 != pid)&lt;br /&gt;
    	{&lt;br /&gt;
    	  swapon(&amp;quot;/tmp/pid2&amp;quot;, 0);&lt;br /&gt;
    	  printf(&amp;quot;Error: pid2:%d != pid:%d\n&amp;quot;, pid2, pid);&lt;br /&gt;
    	  errors++;&lt;br /&gt;
    	}&lt;br /&gt;
    &lt;br /&gt;
    	if (errors) {&lt;br /&gt;
    	    printf(&amp;quot;for...\n&amp;quot;);&lt;br /&gt;
    	    for(i=0; i &amp;lt; 0x3FFFF; i++) &lt;br /&gt;
    		j++;&lt;br /&gt;
    	    printf(&amp;quot;sleep 10\n&amp;quot;);&lt;br /&gt;
    	    sleep(10);	&lt;br /&gt;
    	    printf(&amp;quot;for...\n&amp;quot;);&lt;br /&gt;
    		for(i=0; i &amp;lt; 0x3FFFF; i++)&lt;br /&gt;
    			j++;	&lt;br /&gt;
    	    printf(&amp;quot;restart\n&amp;quot;);	&lt;br /&gt;
    	    goto restart;&lt;br /&gt;
    	}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
$&lt;br /&gt;
&lt;br /&gt;
== Adding your codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a chalanging experience and worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Trying procedure documented in U-Boot Manual.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;br /&gt;
       Not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
    c. Saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During a week&lt;br /&gt;
       or two of testing I haven&#039;t see environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot seems to hang periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to be worse when network activity is high.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=254</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=254"/>
		<updated>2009-11-13T16:43:49Z</updated>

		<summary type="html">&lt;p&gt;Marc: Rewording&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions explain how to use HiFi-2 Codec Development environment on an LX200 FPGA board.&lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 codec development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for codec development.&lt;br /&gt;
To summarize:&lt;br /&gt;
* Setup the board.  It likely comes with U-boot preinstalled, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development.&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFI-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it.  Note:  the install step may need to be run as root.&lt;br /&gt;
&lt;br /&gt;
        $ gunzip git-1.6.5.tar.gz&lt;br /&gt;
        $ tar xf git-1.6.5.tar&lt;br /&gt;
        $ cd git-1.6.5&lt;br /&gt;
        $ make&lt;br /&gt;
        $ make install&lt;br /&gt;
&lt;br /&gt;
This usually installs &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;$HOME/bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot&lt;br /&gt;
    $ cd buildroot-xtensa-HiFi2-Snapshot&lt;br /&gt;
    $ git branch --track snapshot_2+SMP origin/snapshot_2+SMP&lt;br /&gt;
    $ git checkout snapshot_2+SMP&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;No need to give two ways of doing the same thing? Delete this paragraph?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
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 &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next put &#039;&#039;snapshot_2+SMP&#039;&#039; into the Name block, select Tracking Branch in the Starting Revision section, and select the origin/snapshot_2+SMP branch. Finally hit the &#039;&#039;Create&#039;&#039; button. This will create your tracking branch which can be easy kept in sync with our git repository.&lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE, including adding a snapshot_2+SMP branch]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Condider installing Kernel in FLASH to avoid need for TFTP]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root filesystem over NFS.&lt;br /&gt;
This filesystem was built using buildroot into a cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
We will also be adding an additional minor changes to make your development environment more comfortable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your root and unpack the cpio file into that directory.&lt;br /&gt;
For example here we will set up an export in &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    $ cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&lt;br /&gt;
    $ WHERE=$PWD&lt;br /&gt;
    $ mkdir -p &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;&lt;br /&gt;
    $ cd &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;&lt;br /&gt;
    $ cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&lt;br /&gt;
&lt;br /&gt;
Next add a line to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ /etc/rc.d/init.d/nfs restart&lt;br /&gt;
or&lt;br /&gt;
    $ /sbin/chkconfig nfs on&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file system now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ showmount -e&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. Just connect a serial interface to a text based terminal emulation program like [http://en.wikipedia.org/wiki/Minicom minicom]. We usually just type:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;minicom xtboard&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
the boards expect to communicate at with a baud rate of 38400.&lt;br /&gt;
&lt;br /&gt;
Most users of this board are interested in developing codecs on and will prefer to just boot linux with the root file system we just described how to export on you NFS server. We will use git now to pull a snapshot of a performace 2.6.29 linux kerenel and configure U-Boot to automatically boot it after a power cycle.&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;                                                                        [TFTP server IP Address: RTOS-LAB2]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server 192.168.11.55&#039;&#039;&#039;                                                                  [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.155&#039;&#039;&#039;                                                                         [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                                             [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path /exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;                           [WARNING: Limit path to &amp;lt; 50 characters]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp=console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;               [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;  [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd tftpboot\; bootm&#039;&#039;&#039;                                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay=20&#039;&#039;&#039;                                                                                  [Delay 20 seconds before booting automaticaly]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart yes&#039;&#039;&#039;                                                                                 [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[REMIND: &#039;&#039;&#039;Shorten /exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp to /exports/LINUX_ROOT.HiFi-2_DemoBoard&#039;&#039;&#039;]    [Name to long for the kernel]&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing your codec ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailor you environment.&lt;br /&gt;
Here are some of the changes that we have found helpful:&lt;br /&gt;
&lt;br /&gt;
   1. Add a root password to that you can login with ssh.&lt;br /&gt;
   2. Run rdate with an ntp server on booting.&lt;br /&gt;
   3. Add NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-ins from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
&lt;br /&gt;
   [TO BE DONE - Where to get &#039;default&#039; user home directory tar ball and 1st boot patch]&lt;br /&gt;
&lt;br /&gt;
== Compiling your codec and linking it with Mplayer ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# ls -l&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&lt;br /&gt;
    # CFLAGS=&amp;quot;-O0 -g3&amp;quot; ./configure&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-O0 -g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&#039;s focus on the plugins as they are closest to the goal of developing codecs.&lt;br /&gt;
We modified the Makefile of the codes slightly, and hope to check this in&lt;br /&gt;
to buildroot. These additions just instruct make how to install the plugins.&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    target_install::&lt;br /&gt;
        -mkdir /etc/mplayer&lt;br /&gt;
        cp codecs.conf /etc/mplayer&lt;br /&gt;
        -mkdir /usr/lib/mplayer&lt;br /&gt;
        cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
        cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
        chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
It&#039;s just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with Xcc to the directory, compile it,&lt;br /&gt;
and install.&lt;br /&gt;
&lt;br /&gt;
        # cd /fac/vol6/audio/release/bin/l32r_LE5_pic&lt;br /&gt;
        # cp xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz /tmp&lt;br /&gt;
        # &lt;br /&gt;
        # cd /home/default/buildroot_mplayer_stuff&lt;br /&gt;
        # cd mplayer_hifi2_mp3_plugin&lt;br /&gt;
        # cp /tmp/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&lt;br /&gt;
        # gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&lt;br /&gt;
        # tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&lt;br /&gt;
        # make&lt;br /&gt;
        # make target_install&lt;br /&gt;
       &lt;br /&gt;
The unpacking of the Tensilica mp3 code tar ball will install the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Adding your codec to Buildroot ==&lt;br /&gt;
[TO BE DONE]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Playing raw audio .wav files eats a lot of memory and can congest the system.&lt;br /&gt;
    a. Using NFS over TCP helps with access time, perhaps an ethernet driver bug.&lt;br /&gt;
  2. Can&#039;t swap over NFS yet, memory can get tight and cause application to be killed.&lt;br /&gt;
    a. Try proceedure documented in U-Boot Manual.&lt;br /&gt;
  3. Compressed files seem to be un-accessable over NFS.&lt;br /&gt;
  4. Building the C development doesn&#039;t work with X11.&lt;br /&gt;
  5. Though Mplayer plug-in can be compiled, Mplayer still has a few issues.&lt;br /&gt;
    a. Can&#039;t be compiled -O0&lt;br /&gt;
    b. Compiler infrequently crashes and make has to be restarted.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=KnownIssues&amp;diff=196</id>
		<title>KnownIssues</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=KnownIssues&amp;diff=196"/>
		<updated>2009-10-14T14:49:14Z</updated>

		<summary type="html">&lt;p&gt;Marc: Typo/consistency fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Known Kernel Issues and Limitations =&lt;br /&gt;
&lt;br /&gt;
This page contains recommendations, notes, limitations, and requirements for the development of software on systems using Xtensa processors running Linux.&lt;br /&gt;
&lt;br /&gt;
Eventually all these should be duly reported and tracked in&lt;br /&gt;
the [http://bugs.linux-xtensa.org Mantis bug tracker].&lt;br /&gt;
For the time being, here are some of the main known issues (this is by no means an exhaustive list!).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 128 MB RAM Limit ==&lt;br /&gt;
&lt;br /&gt;
Kernel highmem support has not yet been implemented, thus restricting generally usable RAM to the first 128 MB (starting from physical address zero).  Implementing kernel highmem support should release this limitation, but it isn&#039;t yet clear whether an implementation is practical in the presence of cache aliasing (caches larger than 4 x N kB, for an N-way set-associative cache) on RB-200x release or earlier Tensilica processors.&lt;br /&gt;
&lt;br /&gt;
== Kernel loadable modules using FLIX with L32R ==&lt;br /&gt;
&lt;br /&gt;
The kernel module loader (for the Xtensa architecture) supports only the limited set of relocations needed for module loading.  This includes, for example, relocation of literals referenced by L32R instructions.  This loader is not given specific information about any custom TIE configured in the processor, and thus is currently not able to relocate L32R instructions encoded in a FLIX bundle.&lt;br /&gt;
&lt;br /&gt;
To ensure kernel modules load properly, they need to avoid L32R instructions within FLIX instruction bundles.&lt;br /&gt;
   &lt;br /&gt;
Existing kernel code does not generate such instructions, so it is not susceptible.&lt;br /&gt;
However, it is possible to generate FLIX instructions using assembly code, or using the Tensilica XCC compiler.  In the case of assembly code, simply avoid using L32R or MOVI instructions within a FLIX instruction bundle, unless a MOVI is known to fit without expanding (&amp;quot;relaxing&amp;quot;) into an L32R instruction.  In the case of XCC, pass the -mno-flix to the compiler (xt-xcc) to avoid generating FLIX bundles.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;:  The use of Tensilica software tools (including XCC) for Linux development is described in the &#039;&#039;Tensilica OSKit Guide&#039;&#039;, available from Tensilica.&lt;br /&gt;
&lt;br /&gt;
== Debugging Kernel Loadable Modules ==&lt;br /&gt;
&lt;br /&gt;
Debugging loadable modules isn&#039;t easy, a few pointers mentioned here might save you some time.  There is a mechanism that Amit Kalie mentioned on his KGDB webpage on loading the module symbols into gdb while loading a module [http://kgdb.linsyssoft.com/initmodule.htm Debuging init_module].&lt;br /&gt;
&lt;br /&gt;
The [http://linux.about.com/od/commands/l/blcmdl8_insmod.htm &amp;lt;tt&amp;gt;insmod&amp;lt;/tt&amp;gt; command] has a &amp;lt;tt&amp;gt;&#039;&#039;--map&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
option that dumps the module component offsets needed by Amit&#039;s approach.&lt;br /&gt;
Unfortunately the initial Xtensa buildroot snapshots have a version of &amp;lt;tt&amp;gt;insmod&amp;lt;/tt&amp;gt; that doesn&#039;t provide this option. Also, while debugging the kernel it&#039;s not convenient to run &amp;lt;tt&amp;gt;insmod&amp;lt;/tt&amp;gt; on the console of the target. &lt;br /&gt;
&lt;br /&gt;
A workaround to this problem is to hack the kernel &amp;lt;tt&amp;gt;module.c&amp;lt;/tt&amp;gt; file and enable debugging. &lt;br /&gt;
&lt;br /&gt;
    #if 1&lt;br /&gt;
    #define DEBUGP printk&lt;br /&gt;
    #else&lt;br /&gt;
    #define DEBUGP(fmt , a...)&lt;br /&gt;
    #endif&lt;br /&gt;
&lt;br /&gt;
This will enable &amp;lt;tt&amp;gt;module.c&amp;lt;/tt&amp;gt; to print the module section addresses. You then just list them in the gdb &amp;lt;tt&amp;gt;add-symbol-file&amp;lt;/tt&amp;gt; command using that command&#039;s section (&amp;lt;tt&amp;gt;&#039;&#039;-s&#039;&#039;&amp;lt;/tt&amp;gt;) options. &lt;br /&gt;
Note that the &amp;lt;tt&amp;gt;.text&amp;lt;/tt&amp;gt; section is specified without using the &amp;lt;tt&amp;gt;&#039;&#039;-s&#039;&#039;&amp;lt;/tt&amp;gt; option:  its address is given alone before any &amp;lt;tt&amp;gt;&#039;&#039;-s&#039;&#039;&amp;lt;/tt&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
    final section addresses:                  [Kernel Console Log/Output]&lt;br /&gt;
        0xc02a9098 .note.gnu.build-id&lt;br /&gt;
        0xc02b1000 .init.literal&lt;br /&gt;
        0xc02a7000 .text&lt;br /&gt;
        0xc02b11d8 .init.text&lt;br /&gt;
        0xc02a90bc .rodata&lt;br /&gt;
        0xc02a92c4 .rodata.str1.4&lt;br /&gt;
        0xc02ac27c .data&lt;br /&gt;
        0xc02ac640 __param&lt;br /&gt;
        0xc02ac668 .gnu.linkonce.this_module&lt;br /&gt;
        0xc02ac76c .bss&lt;br /&gt;
        0xc02aaf0c .symtab&lt;br /&gt;
        0xc02ab8fc .strtab&lt;br /&gt;
&lt;br /&gt;
    add-symbol-file /export/src/Transswitch/a2000_src/a2000_src/Linux_atlanta/ctlm-cpe/drivers/ctlmeth/ctlmeth.ko   \&lt;br /&gt;
        0xc02a7000                           \&lt;br /&gt;
        -s .data 0xc02ac27c                  \&lt;br /&gt;
        -s .init.text 0xc02b11d8             \&lt;br /&gt;
        -s .bss 0xc02ac76c                   \&lt;br /&gt;
        -s .init.literal 0xc02b1000          \&lt;br /&gt;
        -s  .rodata 0xc02a90bc&lt;br /&gt;
&lt;br /&gt;
You likely want to compile your modules unoptimized and unstripped to facilitate debugging and provide the path to the module source to gdb with the &amp;lt;tt&amp;gt;dir&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
For example:&lt;br /&gt;
    dir /home/pdelaney/src/Transswitch/a2000_src/a2000_src/Linux_atlanta/ctlm-cpe/drivers/ctlmeth/&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Evaluation_Platforms&amp;diff=194</id>
		<title>Evaluation Platforms</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Evaluation_Platforms&amp;diff=194"/>
		<updated>2009-09-19T20:35:59Z</updated>

		<summary type="html">&lt;p&gt;Marc: Remove for now.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[image:board.jpg|right]]&lt;br /&gt;
= Evaluation and Prototyping Platforms =&lt;br /&gt;
&lt;br /&gt;
The following boards and simulators can be used for evaluation and prototyping purposes. Evaluation platforms generally fall into one of the following categories:&lt;br /&gt;
* instruction set simulators,&lt;br /&gt;
* emulation systems that use FPGAs to implement any Xtensa or Diamond core (within the capacity of the FPGAs), and&lt;br /&gt;
* boards that integrate a specific configured Xtensa or Diamond core(s) into an ASIC.&lt;br /&gt;
Field programmable gate arrays (FPGA) contain programmable logic that can be re-configured to emulate complex logic. Although slower than the dedicated circuitry of an ASIC (application specific integrated circuit), their re-configurability and practically zero NRE make them very useful for prototyping (for example, trying multiple Xtensa processor variants or configurations) or small volume applications. &lt;br /&gt;
&lt;br /&gt;
== Instruction Set Simulator ==&lt;br /&gt;
&lt;br /&gt;
Instruction Set Simulators (ISS) mimic the behavior of processors by simulating instructions, memory interface, and other I/O components. This allows developers to run and test their software long before real hardware becomes available. Functional simulators provide the best performance, whereas cycle-accurate simulators provide timing accuracy compatible to that of real hardware. The latter simulate the processor pipeline and external components synchronized to a virtual clock. Although this overhead reduces their performance, it can provide vital information to improve the implementation of algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Tensilica ISS ===&lt;br /&gt;
&lt;br /&gt;
[http://www.tensilica.com/ Tensilica] offers a commercial functional simulator (TurboXim) and cycle-accurate simulator for the Xtensa processor architecture, as part of their standard software development tools.  (You may be able to try a free limited time evaluation copy of this toolset.)  Tensilica also offers XTMP and XTSC for modeling systems of one or multiple processors alongside custom functional or cycle-accurate software models for other components.  Please visit [http://www.tensilica.com/ Tensilica&#039;s] website for further information.&lt;br /&gt;
&lt;br /&gt;
The standalone simulator (xt-iss), for example, simply takes an ELF file as its argument and starts simulating instructions from the reset vector. The option &amp;lt;code&amp;gt;--turbo&amp;lt;/code&amp;gt; invokes the (much faster) functional simulator TurboXim.&lt;br /&gt;
&lt;br /&gt;
 xt-iss &#039;&#039;[--turbo]&#039;&#039; Image.elf&lt;br /&gt;
&lt;br /&gt;
== Emulation Platforms and Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Avnet Virtex-4 LX60 and LX200 ===&lt;br /&gt;
&lt;br /&gt;
[http://www.em.avnet.com Avnet] offers the following development platforms for the Xilinx Virtex-4 LX FPGA that can emulate various&lt;br /&gt;
Xtensa processor configurations. The [http://www.em.avnet.com/tensilica1 LX60] is based on the Xilinx 4VLX60 and comes &lt;br /&gt;
with a 10/100 Ethernet PHY, DDR memory, flash memory, serial port, and 2 x 16 character LCD panel. The MAC controller, however, needs to be implemented inside the FPGA. MAC controllers are available from different vendors. [http://opencores.org OpenCores], for example, provides a free Ethernet controller supported by Linux and other operating systems. The [http://www.em.avnet.com/tensilica2 LX200] is based on the Xilinx XC4VLX200 and can emulate more complex processor configurations and extensions (for example the [http://www.tensilica.com/products/hifi_audio.htm HiFi 2 Audio Engine]) and provides the same components as the LX60 except for the LCD panel. &lt;br /&gt;
&lt;br /&gt;
[http://www.tensilica.com Tensilica] provides a bitstream that describes the configuration data to emulate the Diamond Standard DC232L processor (Rev.B) on the LX60 FPGA. Tensilica refers to this board and bitstream combination as the XTAV60 board.  It also includes support for the OpenCores Ethernet MAC. For further information, please, contact [http://www.tensilica.com/company/contact_us.htm Tensilica] directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Eve ZeBu ===&lt;br /&gt;
&lt;br /&gt;
[http://www.eve-team.com Eve] offers an emulation and verification system that can be used to emulate Xtensa processors. Similar to FPGA boards, the ZeBu system emulates the processor, but has a higher capacity to emulate larger processor configurations and additional peripherals. It also provides direct access to signals for debugging and verification.&lt;br /&gt;
&lt;br /&gt;
See the [[Linux on ZeBu]] page or contact [http://www.eve-team.com Eve] directly to request additional information.&lt;br /&gt;
&lt;br /&gt;
== ASIC Evaluation Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Stretch S55DVKxx and S56DVKxx ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stretchinc.com Stretch] provides software-configurable processors based on the Xtensa architecture. The S5000 processor supports Linux, and at 300MHz, it runs 5-10 times faster than FPGA based emulation platforms. The S55DVKxx and S56DVKxx development platforms provide 10/100/1000 Ethernet, serial, PCI (only S56DVKxx), and other interfaces.&lt;br /&gt;
&lt;br /&gt;
The Stretch platforms come with RedBoot as the bootloader. It can download and boot the kernel over network using TFTP or from flash. Make sure that RedBoot is configured with a valid Ethernet address or set to DHCP to obtain a valid address. The following commands load the kernel image &#039;&#039;zImage.redboot&#039;&#039; and boot the kernel:&lt;br /&gt;
&lt;br /&gt;
 RedBoot&amp;gt; load -r -b 0xd0200000 -h 192.168.1.5 zImage.redboot&lt;br /&gt;
 RedBoot&amp;gt; exec 0xd0200000&lt;br /&gt;
&lt;br /&gt;
Note that RedBoot requires that the tftp host is in the same subnet as the board.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Repository_Access&amp;diff=176</id>
		<title>Repository Access</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Repository_Access&amp;diff=176"/>
		<updated>2009-07-26T20:34:47Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Accessing Linux kernel sources */ Mention 2.6.29-smp tree&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Access to GIT Repositories =&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;linux-xtensa.org&amp;lt;/tt&amp;gt; site hosts a number of GIT repositories.&lt;br /&gt;
They provide access to the latest sources for their respective projects.&lt;br /&gt;
Alternatively, one can download&lt;br /&gt;
[[Buildroot_Snapshots|snapshot releases]] which&lt;br /&gt;
are updated much less frequently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following sections describe how to access these source repositories.&lt;br /&gt;
&lt;br /&gt;
== Accessing buildroot sources ==&lt;br /&gt;
&lt;br /&gt;
Buildroot is used to build the toolchain and root filesystem.&lt;br /&gt;
The following downloads a copy of the entire GIT repository:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa buildroot&lt;br /&gt;
&lt;br /&gt;
Those with write access to the repository should use the &amp;lt;tt&amp;gt;git+ssh&amp;lt;/tt&amp;gt; method instead, like this:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git+ssh://git.linux-xtensa.org/git/buildroot/buildroot-xtensa buildroot&lt;br /&gt;
&lt;br /&gt;
Commits to this tree are automatically posted to the&lt;br /&gt;
[http://lists.linux-xtensa.org/mailman/listinfo/buildroot-xtensa-commits buildroot-xtensa-commits list].&lt;br /&gt;
&lt;br /&gt;
== Accessing Linux kernel sources ==&lt;br /&gt;
&lt;br /&gt;
There are normally multiple Linux kernel trees to choose from.&lt;br /&gt;
At the time of writing, the &amp;lt;tt&amp;gt;xtensa-2.6.24&amp;lt;/tt&amp;gt; tree is the lastest &amp;quot;official&amp;quot; tree.&lt;br /&gt;
This tree is based on the released 2.6.24 kernel from &amp;lt;tt&amp;gt;kernel.org&amp;lt;/tt&amp;gt;.&lt;br /&gt;
However, most of the activity currently is in an unofficial &amp;lt;tt&amp;gt;2.6.29-smp&amp;lt;/tt&amp;gt; tree.&lt;br /&gt;
&lt;br /&gt;
To get the &amp;lt;tt&amp;gt;xtensa-2.6.24&amp;lt;/tt&amp;gt; tree into directory &#039;&#039;&amp;lt;dir&amp;gt;&#039;&#039; (which must not already exist),&lt;br /&gt;
do this:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.24 &amp;lt;dir&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates and populates the &#039;&#039;&amp;lt;dir&amp;gt;&#039;&#039; directory.  If &#039;&#039;&amp;lt;dir&amp;gt;&#039;&#039; is omitted, it defaults to &amp;lt;tt&amp;gt;xtensa-2.6.24&amp;lt;/tt&amp;gt; (the last non-extension part of the cloned path).&lt;br /&gt;
Those with write access to the repository should use the &amp;lt;tt&amp;gt;git+ssh&amp;lt;/tt&amp;gt; method instead, like this:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git+ssh://git.linux-xtensa.org/git/kernel/xtensa-2.6.24 &amp;lt;dir&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commits to this tree are automatically posted to the&lt;br /&gt;
[http://lists.linux-xtensa.org/mailman/listinfo/linux-xtensa-devel-commits linux-xtensa-devel-commits list].&lt;br /&gt;
&lt;br /&gt;
== Accessing U-Boot bootloader sources ==&lt;br /&gt;
&lt;br /&gt;
A preliminary version of U-Boot for the Xtensa architecture is available.&lt;br /&gt;
The following downloads a copy of the entire GIT repository:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&lt;br /&gt;
&lt;br /&gt;
Those with write access to the repository should use the &amp;lt;tt&amp;gt;git+ssh&amp;lt;/tt&amp;gt; method instead, like this:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git+ssh://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039; &#039;&#039;&#039;PLEASE NOTE:&#039;&#039;&#039;  These paths are likely to change when the port becomes official.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Commits to this tree are not yet automatically posted to any list.&lt;br /&gt;
&lt;br /&gt;
== Write Access ==&lt;br /&gt;
&lt;br /&gt;
Only a small number of core developers have write access to these&lt;br /&gt;
repositories.  To submit changes, you are encouraged to submit patches to&lt;br /&gt;
the [http://lists.linux-xtensa.org/mailman/listinfo/linux-xtensa linux-xtensa mailing list].&lt;br /&gt;
Contributors are expected to consistently provide&lt;br /&gt;
good patches, and have a certain level of involvement and commitment&lt;br /&gt;
to the relevant project, before being considered for write access.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=LTP_Results&amp;diff=175</id>
		<title>LTP Results</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=LTP_Results&amp;diff=175"/>
		<updated>2009-05-20T23:44:03Z</updated>

		<summary type="html">&lt;p&gt;Marc: Include link to more accurate LTP results HTML page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= LTP Test Results =&lt;br /&gt;
&lt;br /&gt;
One of the more common ways of testing the Linux kernel is to use the [http://ltp.sourceforge.net/ Linux Test Project (LTP)] testsuite.  LTP contains many different tests and testsuites, a number of which are often not applicable in a given environment or test setup.&lt;br /&gt;
&lt;br /&gt;
Running LTP in a system constructed using [[Buildroot_Build_Instructions| buildroot]] typically involves the following steps:&lt;br /&gt;
&lt;br /&gt;
* When configuring buildroot (using e.g. &amp;lt;tt&amp;gt;make menuconfig&amp;lt;/tt&amp;gt;), under &#039;&#039;&#039;Package Selection for the target&#039;&#039;&#039;, unselect &#039;&#039;&#039;Hide applications that are provided by busybox&#039;&#039;&#039;, select &#039;&#039;&#039;&amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;&#039;&#039;&#039;, and select &#039;&#039;&#039;&amp;lt;tt&amp;gt;ltp-testsuite&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  Under later versions of LTP that can generate HTML, also go deeper in &#039;&#039;&#039;Interpreter languages / Scripting&#039;&#039;&#039; and select &#039;&#039;&#039;&amp;lt;tt&amp;gt;microperl&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  Then make buildroot as usual.  On the target, the LTP testsuite ends up in &amp;lt;tt&amp;gt;/root/ltp-full-&amp;lt;/tt&amp;gt;&#039;&#039;&amp;lt;VERSION&amp;gt;&#039;&#039;.&lt;br /&gt;
* LTP is generally much too big (~150 to 350 MB) to put in a root filesystem that is linked into the kernel (such as initramfs).  So you&#039;ll generally need to put your root filesystem somewhere else, such as [[Buildroot_Build_Instructions#Mounting_the_Root_Filesystem_Over_NFS| mounting over NFS]].&lt;br /&gt;
* Run LTP.  This can be as simple as:  &amp;lt;tt&amp;gt;cd /root/ltp-full-20070228 ; ./runltp&amp;lt;/tt&amp;gt;  although you&#039;ll typically want to pass &amp;lt;tt&amp;gt;runltp&amp;lt;/tt&amp;gt; a few options to specify output files, tests to run, etc.&lt;br /&gt;
&lt;br /&gt;
In some older or bleeding-edge/unstable environments, some tests may crash the kernel or just hang.  You may need to comment out these tests from the relevant test series under &amp;lt;tt&amp;gt;/runtest/&amp;lt;/tt&amp;gt;, or simply not request that test when running LTP, to complete running the tests.&lt;br /&gt;
&lt;br /&gt;
==  Results for the second snapshot (of July 2008)  ==&lt;br /&gt;
&lt;br /&gt;
Here are some [http://www.linux-xtensa.org/ltp/20090514c.html unofficial LTP results run on May 14, 2009] (and a [http://www.linux-xtensa.org/ltp/20090514c3.html more accurate report] from a patched copy of LTP&#039;s genhtml)&lt;br /&gt;
for the Linux for Xtensa [http://www.linux-xtensa.org/download.html snapshot] of July 11, 2008.&lt;br /&gt;
&lt;br /&gt;
The version of LTP used by buildroot, as of that snapshot, is 20070228.  However, that version does not generate HTML output.  This test run was made using LTP version 20090430 instead, to get HTML formatted results.  A number of buildroot files were updated to support this version of LTP (see below).&lt;br /&gt;
&lt;br /&gt;
LTP version 20090430 runs a few more tests by default relative to version 20070228.  Many of these new tests require a much larger set of packages installed on the target than the bare minimum root filesystem one gets by default following [[Buildroot_Build_Instructions| buildroot build instructions]].  Some of these tests are even specific to the x86 architecture.  Thus, instead of running LTP with a default set of tests, LTP was run with a specific set that excludes most of the new ones (but includes &amp;lt;tt&amp;gt;timer&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Also note that a number of kernel bugs were fixed since that snapshot, as reflected in various kernel git trees on linux-xtensa.org .  Three of these caused the kernel to crash or hang, and were commented out to obtain these test results:  &amp;lt;tt&amp;gt;mm01&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;runtest/mm&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;sem01&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;runtest/ipc&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;hackbench01&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;runtest/sched&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here is how LTP was invoked for this run:&lt;br /&gt;
&lt;br /&gt;
 cd /root/ltp-full-20090430&lt;br /&gt;
 time ./runltp -l 20090514c.log -g 20090514c.html -o 20090514c.out  -f syscalls,fs,fsx,mm,ipc,sched,math,nptl,pty,timers&lt;br /&gt;
&lt;br /&gt;
You may also be interested to note that due to certain bugs in LTP itself, LTP HTML output erroneously reports certain tests as passing when they are not (regardless of architecture).  Careful reading of the Test-Output column (in the absence of a clear PASS line therein) usually indicates the actual result.&lt;br /&gt;
&lt;br /&gt;
===  Buildroot patches for LTP 20090430  ===&lt;br /&gt;
&lt;br /&gt;
* Remove &amp;lt;tt&amp;gt;package/ltp-testsuite/ltp-testsuite-sh-is-not-C-code.patch&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Edit &amp;lt;tt&amp;gt;package/ltp-testsuite/ltp-testsuite.mk&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 6c6,7&lt;br /&gt;
 &amp;lt; LTP_TESTSUITE_VERSION:=20070228&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; LTP_TESTSUITE_VERSION:=20090430&lt;br /&gt;
 &amp;gt; #LTP_TESTSUITE_VERSION:=20070228&lt;br /&gt;
 17a19&lt;br /&gt;
 &amp;gt;            ltp-testsuite-newer.patch \&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Edit &amp;lt;tt&amp;gt;package/ltp-testsuite/ltp-testsuite.patch&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 40,41c40,41&lt;br /&gt;
 &amp;lt; @@ -20,7 +20,7 @@&lt;br /&gt;
 &amp;lt;  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; @@ -23,7 +23,7 @@&lt;br /&gt;
 &amp;gt;  %_64: CFLAGS += -D_FILE_OFFSET_BITS=64&lt;br /&gt;
 44,45c44,45&lt;br /&gt;
 &amp;lt; -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &amp;lt; +TARGETS =#$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; -TARGETS += $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &amp;gt; +TARGETS +=#$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 52c52&lt;br /&gt;
 &amp;lt; @@ -85,9 +85,7 @@&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; @@ -90,9 +90,7 @@&lt;br /&gt;
 63c63&lt;br /&gt;
 &amp;lt; @@ -96,10 +94,6 @@&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; @@ -101,10 +99,6 @@&lt;br /&gt;
&lt;br /&gt;
* Add &amp;lt;tt&amp;gt;package/ltp-testsuite/ltp-testsuite-newer.patch&amp;lt;/tt&amp;gt; (this disables a number of tests that don&#039;t build because they rely on recent system calls that did not exist in uClibc as of the July 2008 snapshot):&lt;br /&gt;
&lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/remap_file_pages/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/remap_file_pages/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/remap_file_pages/Makefile       2009-05-12 10:44:15.000000000 -0700&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/remap_file_pages/Makefile       2009-05-12 10:40:28.000000000 -0700&lt;br /&gt;
 @@ -20,7 +20,7 @@&lt;br /&gt;
  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/signalfd/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/signalfd/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/signalfd/Makefile       2008-11-11 00:31:27.000000000 -0800&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/signalfd/Makefile       2009-05-12 10:55:16.000000000 -0700&lt;br /&gt;
 @@ -19,7 +19,7 @@&lt;br /&gt;
  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/signalfd4/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/signalfd4/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/signalfd4/Makefile      2009-01-16 02:07:55.000000000 -0800&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/signalfd4/Makefile      2009-05-12 10:55:54.000000000 -0700&lt;br /&gt;
 @@ -20,7 +20,7 @@&lt;br /&gt;
  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/splice/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/splice/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/splice/Makefile 2009-05-12 11:12:23.000000000 -0700&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/splice/Makefile 2009-05-12 11:15:27.000000000 -0700&lt;br /&gt;
 @@ -20,7 +20,7 @@&lt;br /&gt;
  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 Only in ltp-full-20090430/testcases/kernel/syscalls/splice: splice01&lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/tee/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/tee/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/tee/Makefile    2009-05-12 11:12:52.000000000 -0700&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/tee/Makefile    2009-05-12 11:12:46.000000000 -0700&lt;br /&gt;
 @@ -20,7 +20,7 @@&lt;br /&gt;
  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/vmsplice/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/vmsplice/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/vmsplice/Makefile       2009-05-12 11:13:17.000000000 -0700&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/vmsplice/Makefile       2009-05-12 11:13:09.000000000 -0700&lt;br /&gt;
 @@ -21,7 +21,7 @@&lt;br /&gt;
  LDLIBS   += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/network/lib6/Makefile ltp-full-20090430-patched/testcases/network/lib6/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/network/lib6/Makefile   2009-01-22 01:26:10.000000000 -0800&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/network/lib6/Makefile   2009-05-12 11:45:19.000000000 -0700&lt;br /&gt;
 @@ -24,8 +24,8 @@&lt;br /&gt;
  LOADLIBES+=    -L../../../lib runcc.a -lltp -lpthread&lt;br /&gt;
 &lt;br /&gt;
  SRCS=$(wildcard *.c)&lt;br /&gt;
 -TARGETS= asapi_01 asapi_02 asapi_03 asapi_04 asapi_05 asapi_06 asapi_07 \&lt;br /&gt;
 -       getaddrinfo_01 in6_01 in6_02&lt;br /&gt;
 +TARGETS= asapi_01 asapi_02 asapi_03 asapi_07 \&lt;br /&gt;
 +       in6_02&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=LTP_Results&amp;diff=174</id>
		<title>LTP Results</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=LTP_Results&amp;diff=174"/>
		<updated>2009-05-19T23:21:54Z</updated>

		<summary type="html">&lt;p&gt;Marc: Add preliminary LTP test results for the July 2008 snapshot&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= LTP Test Results =&lt;br /&gt;
&lt;br /&gt;
One of the more common ways of testing the Linux kernel is to use the [http://ltp.sourceforge.net/ Linux Test Project (LTP)] testsuite.  LTP contains many different tests and testsuites, a number of which are often not applicable in a given environment or test setup.&lt;br /&gt;
&lt;br /&gt;
Running LTP in a system constructed using [[Buildroot_Build_Instructions| buildroot]] typically involves the following steps:&lt;br /&gt;
&lt;br /&gt;
* When configuring buildroot (using e.g. &amp;lt;tt&amp;gt;make menuconfig&amp;lt;/tt&amp;gt;), under &#039;&#039;&#039;Package Selection for the target&#039;&#039;&#039;, unselect &#039;&#039;&#039;Hide applications that are provided by busybox&#039;&#039;&#039;, select &#039;&#039;&#039;&amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;&#039;&#039;&#039;, and select &#039;&#039;&#039;&amp;lt;tt&amp;gt;ltp-testsuite&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  Under later versions of LTP that can generate HTML, also go deeper in &#039;&#039;&#039;Interpreter languages / Scripting&#039;&#039;&#039; and select &#039;&#039;&#039;&amp;lt;tt&amp;gt;microperl&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  Then make buildroot as usual.  On the target, the LTP testsuite ends up in &amp;lt;tt&amp;gt;/root/ltp-full-&amp;lt;/tt&amp;gt;&#039;&#039;&amp;lt;VERSION&amp;gt;&#039;&#039;.&lt;br /&gt;
* LTP is generally much too big (~150 to 350 MB) to put in a root filesystem that is linked into the kernel (such as initramfs).  So you&#039;ll generally need to put your root filesystem somewhere else, such as [[Buildroot_Build_Instructions#Mounting_the_Root_Filesystem_Over_NFS| mounting over NFS]].&lt;br /&gt;
* Run LTP.  This can be as simple as:  &amp;lt;tt&amp;gt;cd /root/ltp-full-20070228 ; ./runltp&amp;lt;/tt&amp;gt;  although you&#039;ll typically want to pass &amp;lt;tt&amp;gt;runltp&amp;lt;/tt&amp;gt; a few options to specify output files, tests to run, etc.&lt;br /&gt;
&lt;br /&gt;
In some older or bleeding-edge/unstable environments, some tests may crash the kernel or just hang.  You may need to comment out these tests from the relevant test series under &amp;lt;tt&amp;gt;/runtest/&amp;lt;/tt&amp;gt;, or simply not request that test when running LTP, to complete running the tests.&lt;br /&gt;
&lt;br /&gt;
==  Results for the second snapshot (of July 2008)  ==&lt;br /&gt;
&lt;br /&gt;
Here are some [http://www.linux-xtensa.org/ltp/20090514c.html unofficial LTP results run on May 14, 2009]&lt;br /&gt;
for the Linux for Xtensa [http://www.linux-xtensa.org/download.html snapshot] of July 11, 2008.&lt;br /&gt;
&lt;br /&gt;
The version of LTP used by buildroot, as of that snapshot, is 20070228.  However, that version does not generate HTML output.  This test run was made using LTP version 20090430 instead, to get HTML formatted results.  A number of buildroot files were updated to support this version of LTP (see below).&lt;br /&gt;
&lt;br /&gt;
LTP version 20090430 runs a few more tests by default relative to version 20070228.  Many of these new tests require a much larger set of packages installed on the target than the bare minimum root filesystem one gets by default following [[Buildroot_Build_Instructions| buildroot build instructions]].  Some of these tests are even specific to the x86 architecture.  Thus, instead of running LTP with a default set of tests, LTP was run with a specific set that excludes most of the new ones (but includes &amp;lt;tt&amp;gt;timer&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Also note that a number of kernel bugs were fixed since that snapshot, as reflected in various kernel git trees on linux-xtensa.org .  Three of these caused the kernel to crash or hang, and were commented out to obtain these test results:  &amp;lt;tt&amp;gt;mm01&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;runtest/mm&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;sem01&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;runtest/ipc&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;hackbench01&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;runtest/sched&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here is how LTP was invoked for this run:&lt;br /&gt;
&lt;br /&gt;
 cd /root/ltp-full-20090430&lt;br /&gt;
 time ./runltp -l 20090514c.log -g 20090514c.html -o 20090514c.out  -f syscalls,fs,fsx,mm,ipc,sched,math,nptl,pty,timers&lt;br /&gt;
&lt;br /&gt;
You may also be interested to note that due to certain bugs in LTP itself, LTP HTML output erroneously reports certain tests as passing when they are not (regardless of architecture).  Careful reading of the Test-Output column (in the absence of a clear PASS line therein) usually indicates the actual result.&lt;br /&gt;
&lt;br /&gt;
===  Buildroot patches for LTP 20090430  ===&lt;br /&gt;
&lt;br /&gt;
* Remove &amp;lt;tt&amp;gt;package/ltp-testsuite/ltp-testsuite-sh-is-not-C-code.patch&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Edit &amp;lt;tt&amp;gt;package/ltp-testsuite/ltp-testsuite.mk&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 6c6,7&lt;br /&gt;
 &amp;lt; LTP_TESTSUITE_VERSION:=20070228&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; LTP_TESTSUITE_VERSION:=20090430&lt;br /&gt;
 &amp;gt; #LTP_TESTSUITE_VERSION:=20070228&lt;br /&gt;
 17a19&lt;br /&gt;
 &amp;gt;            ltp-testsuite-newer.patch \&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Edit &amp;lt;tt&amp;gt;package/ltp-testsuite/ltp-testsuite.patch&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 40,41c40,41&lt;br /&gt;
 &amp;lt; @@ -20,7 +20,7 @@&lt;br /&gt;
 &amp;lt;  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; @@ -23,7 +23,7 @@&lt;br /&gt;
 &amp;gt;  %_64: CFLAGS += -D_FILE_OFFSET_BITS=64&lt;br /&gt;
 44,45c44,45&lt;br /&gt;
 &amp;lt; -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &amp;lt; +TARGETS =#$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; -TARGETS += $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &amp;gt; +TARGETS +=#$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 52c52&lt;br /&gt;
 &amp;lt; @@ -85,9 +85,7 @@&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; @@ -90,9 +90,7 @@&lt;br /&gt;
 63c63&lt;br /&gt;
 &amp;lt; @@ -96,10 +94,6 @@&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; @@ -101,10 +99,6 @@&lt;br /&gt;
 68c68&lt;br /&gt;
 &amp;lt; -#define MAX_SWAPFILES 32&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; -#define MAX_SWAPFILES 32&lt;br /&gt;
&lt;br /&gt;
* Add &amp;lt;tt&amp;gt;package/ltp-testsuite/ltp-testsuite-newer.patch&amp;lt;/tt&amp;gt; (this disables a number of tests that don&#039;t build because they rely on recent system calls that did not exist in uClibc as of the July 2008 snapshot):&lt;br /&gt;
&lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/remap_file_pages/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/remap_file_pages/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/remap_file_pages/Makefile       2009-05-12 10:44:15.000000000 -0700&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/remap_file_pages/Makefile       2009-05-12 10:40:28.000000000 -0700&lt;br /&gt;
 @@ -20,7 +20,7 @@&lt;br /&gt;
  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/signalfd/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/signalfd/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/signalfd/Makefile       2008-11-11 00:31:27.000000000 -0800&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/signalfd/Makefile       2009-05-12 10:55:16.000000000 -0700&lt;br /&gt;
 @@ -19,7 +19,7 @@&lt;br /&gt;
  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/signalfd4/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/signalfd4/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/signalfd4/Makefile      2009-01-16 02:07:55.000000000 -0800&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/signalfd4/Makefile      2009-05-12 10:55:54.000000000 -0700&lt;br /&gt;
 @@ -20,7 +20,7 @@&lt;br /&gt;
  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/splice/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/splice/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/splice/Makefile 2009-05-12 11:12:23.000000000 -0700&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/splice/Makefile 2009-05-12 11:15:27.000000000 -0700&lt;br /&gt;
 @@ -20,7 +20,7 @@&lt;br /&gt;
  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 Only in ltp-full-20090430/testcases/kernel/syscalls/splice: splice01&lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/tee/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/tee/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/tee/Makefile    2009-05-12 11:12:52.000000000 -0700&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/tee/Makefile    2009-05-12 11:12:46.000000000 -0700&lt;br /&gt;
 @@ -20,7 +20,7 @@&lt;br /&gt;
  LDLIBS += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/kernel/syscalls/vmsplice/Makefile ltp-full-20090430-patched/testcases/kernel/syscalls/vmsplice/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/kernel/syscalls/vmsplice/Makefile       2009-05-12 11:13:17.000000000 -0700&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/kernel/syscalls/vmsplice/Makefile       2009-05-12 11:13:09.000000000 -0700&lt;br /&gt;
 @@ -21,7 +21,7 @@&lt;br /&gt;
  LDLIBS   += -L../../../../lib -lltp&lt;br /&gt;
 &lt;br /&gt;
  SRCS    = $(wildcard *.c)&lt;br /&gt;
 -TARGETS = $(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 +TARGETS = #$(patsubst %.c,%,$(SRCS))&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;br /&gt;
 &lt;br /&gt;
 diff -ur ltp-full-20090430/testcases/network/lib6/Makefile ltp-full-20090430-patched/testcases/network/lib6/Makefile&lt;br /&gt;
 --- ltp-full-20090430/testcases/network/lib6/Makefile   2009-01-22 01:26:10.000000000 -0800&lt;br /&gt;
 +++ ltp-full-20090430-patched/testcases/network/lib6/Makefile   2009-05-12 11:45:19.000000000 -0700&lt;br /&gt;
 @@ -24,8 +24,8 @@&lt;br /&gt;
  LOADLIBES+=    -L../../../lib runcc.a -lltp -lpthread&lt;br /&gt;
 &lt;br /&gt;
  SRCS=$(wildcard *.c)&lt;br /&gt;
 -TARGETS= asapi_01 asapi_02 asapi_03 asapi_04 asapi_05 asapi_06 asapi_07 \&lt;br /&gt;
 -       getaddrinfo_01 in6_01 in6_02&lt;br /&gt;
 +TARGETS= asapi_01 asapi_02 asapi_03 asapi_07 \&lt;br /&gt;
 +       in6_02&lt;br /&gt;
 &lt;br /&gt;
  all: $(TARGETS)&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Buildroot_Snapshots&amp;diff=173</id>
		<title>Buildroot Snapshots</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Buildroot_Snapshots&amp;diff=173"/>
		<updated>2009-05-19T22:23:17Z</updated>

		<summary type="html">&lt;p&gt;Marc: Add link to LTP test results page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Stable Snapshots of Buildroot and the Linux kernel =&lt;br /&gt;
&lt;br /&gt;
As an alternative to using the latest source files from GIT and Subversion, you can use one of the snapshot bundles available on the [http://www.linux-xtensa.org/download.html download page].  These snapshots include versions of the Linux kernel and the Buildroot files that have been tested to work together, as well as associated build documentation that matches those snapshots.&lt;br /&gt;
&lt;br /&gt;
(If you want the latest sources instead, please refer to the&lt;br /&gt;
latest [[Buildroot_Build_Instructions]].)&lt;br /&gt;
&lt;br /&gt;
Unofficial LTP test results are available in the [[LTP_Results| LTP Test Results]] page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=1 style=&amp;quot;text-align:center&amp;quot; cellpadding=4 cellspacing=0&lt;br /&gt;
|+ &#039;&#039;&#039;List of GIT Commit Points for Each Snapshot&#039;&#039;&#039; &lt;br /&gt;
|-   &lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Snapshot&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Linux Kernel&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Buildroot&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
! GIT Tree !! Commit !! GIT Tree !! Commit&lt;br /&gt;
|-&lt;br /&gt;
| linux-xtensa-20080123.tar.gz || xtensa-2.6.24 || 50f17d5ba5d2 || buildroot-xtensa || dd6f0d70fb1f&lt;br /&gt;
| First snapshot&lt;br /&gt;
|-   &lt;br /&gt;
| linux-xtensa-20080711.tar.gz || xtensa-2.6.24 || ce5325b68b14 || buildroot-xtensa || 16f39dfdde4b&lt;br /&gt;
| Second snapshot&lt;br /&gt;
|-   &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=172</id>
		<title>Instructions for building and booting Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=172"/>
		<updated>2009-05-12T05:41:29Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Mounting the Root Filesystem Over NFS */ Slight clarifications&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions explain how to build a toolchain, root filesystem and kernel for Linux running on an Xtensa processor.  These instructions apply specifically to the XTAV60 (LX60) board.&lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.  If you are using the latest development sources, the build process may change, so you should be sure to get the latest version of this document at [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions].  If you are using one of the development snapshot releases, you should use the version of the build instructions included with that snapshot.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on newer Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Xtensa Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&lt;br /&gt;
**  &#039;&#039;&#039;NOTE:&#039;&#039;&#039; this assumes the default selection of packages in buildroot.  Selecting extra packages may require a more recent host OS or more recent version of certain tools.  For example, the default version of &amp;lt;tt&amp;gt;find&amp;lt;/tt&amp;gt; on RHEL4 is too old to allow building all X11 packages in buildroot, so it is necessary to upgrade the host version of &amp;lt;tt&amp;gt;findutils&amp;lt;/tt&amp;gt; on RHEL4 to build these packages.&lt;br /&gt;
&lt;br /&gt;
*  Lines prefixed with &amp;quot;sudo&amp;quot; need to be executed as root.  The rest is best executed as a non-root user.  (It is possible to install &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; as a non-root user if root access is an issue.  How to do this isn&#039;t shown here.)&lt;br /&gt;
&lt;br /&gt;
*  Lines that set environment variables assume a Bourne compatible shell (e.g., /bin/sh or bash), but are easily adapted to other shells.&lt;br /&gt;
&lt;br /&gt;
*  Instructions are assumed executed all in order (e.g., commands assume current directory and environment variables set earlier).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your host system ==&lt;br /&gt;
&lt;br /&gt;
If you are using one of the snapshot releases, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
If you want to work with the latest development sources, you will need&lt;br /&gt;
[[Installing GIT|&amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; installed on your system]].&lt;br /&gt;
&lt;br /&gt;
== Download buildroot and the Linux kernel ==&lt;br /&gt;
&lt;br /&gt;
The following section describes how to download the latest&lt;br /&gt;
versions of buildroot and of the Linux kernel.&lt;br /&gt;
Skip this step if you are using one of the&lt;br /&gt;
[http://wiki.linux-xtensa.org/index.php/Buildroot_Snapshots snapshot releases].&lt;br /&gt;
&lt;br /&gt;
For most users, just execute the following:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa buildroot&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.24 linux&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;&amp;lt;/tt&amp;gt; is the path to an empty directory on a disk with&lt;br /&gt;
at least 4 GB available space.  You end up with the following file structure,&lt;br /&gt;
which is assumed by the rest of this document:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;workdir&amp;gt;/&lt;br /&gt;
            /buildroot&lt;br /&gt;
            /linux&lt;br /&gt;
&lt;br /&gt;
If you happen to have write access to either repository, or want more details,&lt;br /&gt;
see the [http://wiki.linux-xtensa.org/index.php/Repository_Access repository access] page.&lt;br /&gt;
&lt;br /&gt;
== Install any required processor specific overlay ==&lt;br /&gt;
&lt;br /&gt;
This step is required if you are targeting a custom Xtensa processor.&lt;br /&gt;
If you use a Diamond 232L Standard Core, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
To configure buildroot and the kernel to use a custom Xtensa processor&lt;br /&gt;
configuration, you need to overlay a set of files customized for your&lt;br /&gt;
processor configuration onto toolchain sources (gcc, binutils, gdb, etc)&lt;br /&gt;
and the Linux kernel.  This process has been automated using a script&lt;br /&gt;
located in the buildroot source tree.&lt;br /&gt;
For usage information, you can invoke it without arguments:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ ./buildroot/target/xtensa/xt-buildroot-overlay-install&lt;br /&gt;
&lt;br /&gt;
which displays a help message similar to the following:&lt;br /&gt;
&lt;br /&gt;
 xt-buildroot-overlay-install version 1.3&lt;br /&gt;
 Usage:  xt-buildroot-overlay-install &amp;lt;parameters&amp;gt; [&amp;lt;options&amp;gt;]&lt;br /&gt;
 Where &amp;lt;parameters&amp;gt; are:&lt;br /&gt;
   -t file.tgz     Specify path to the Xtensa Linux overlay tarball, typically&lt;br /&gt;
                   &amp;lt;xtensa_root&amp;gt;/src/xtensa-config-overlay.tar.gz&lt;br /&gt;
   -b dir          Path to the base of the buildroot source tree, in which&lt;br /&gt;
                   package specific overlay tarballs get installed.&lt;br /&gt;
   -k dir          Path to the base of the Linux kernel source tree, in which&lt;br /&gt;
                   the Linux kernel specific overlay gets installed.&lt;br /&gt;
   -c config_name  Name for the Xtensa processor configuration as it will be&lt;br /&gt;
                   known to the open source community.  Must be a lowercase&lt;br /&gt;
                   identifier, starting with a letter, consisting of letters&lt;br /&gt;
                   and numbers and underscores, not ending with underscore&lt;br /&gt;
                   and not containing consecutive underscores.  For examples:&lt;br /&gt;
                      dc232b , dc232b_be , mmubasele , fsf , s5000 .&lt;br /&gt;
   -l long_name    Long name for the Xtensa processor configuration, human-&lt;br /&gt;
                   readable with spaces etc allowed (must be quoted).&lt;br /&gt;
                   For example:  &#039;Diamond 232L Standard Core Rev.B (LE)&#039;&lt;br /&gt;
                   Try to keep it within approximately 40 characters.&lt;br /&gt;
 And &amp;lt;options&amp;gt; are:&lt;br /&gt;
   -f              If package specific overlay tarballs already exist in&lt;br /&gt;
                   the destination source tree, overwrite them without asking.&lt;br /&gt;
   --help          Show this usage message.&lt;br /&gt;
&lt;br /&gt;
Note that the Xtensa Linux overlay tarball MUST be obtained from an Xtensa&lt;br /&gt;
core package built using release RB-2008.3 or later.&lt;br /&gt;
&lt;br /&gt;
Here is an example invocation of the overlay installation script:&lt;br /&gt;
&lt;br /&gt;
   $ ./buildroot/target/xtensa/xt-buildroot-overlay-install -t blinkcore-config-overlay.tar.gz \&lt;br /&gt;
         -b ./buildroot -k ./linux -c superzip -l &amp;quot;ChipCorp SuperZIP Blink Accelerator Core&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The script extracts some relevant information from the overlay tarball,&lt;br /&gt;
presents it along with relevant parameters to the user, and prompts&lt;br /&gt;
for confirmation before proceeding.&lt;br /&gt;
&lt;br /&gt;
The chosen processor name (-c option) must be unique among known Xtensa processors.&lt;br /&gt;
It is also probably wise to avoid names confusingly similar to other (non-Xtensa) processors.&lt;br /&gt;
If you expect at some point to contribute support for your custom processor to the&lt;br /&gt;
open-source community, this name will likely be long-lived.&lt;br /&gt;
(One way to contribute support for a custom processor might be to submit the overlay tarball&lt;br /&gt;
or files to the linux-xtensa.org maintainers.)&lt;br /&gt;
&lt;br /&gt;
In the steps below, buildroot and the Linux kernel must be configured&lt;br /&gt;
(in their respective &amp;lt;code&amp;gt;&#039;&#039;make menuconfig&#039;&#039;&amp;lt;/code&amp;gt; steps) to select&lt;br /&gt;
the &amp;lt;code&amp;gt;&#039;&#039;custom&#039;&#039;&amp;lt;/code&amp;gt; Xtensa processor option.&lt;br /&gt;
This presents an extra configuration menu entry where you must provide&lt;br /&gt;
the name of the Xtensa processor.  Set it to the same name&lt;br /&gt;
as was specified in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option above.&lt;br /&gt;
&lt;br /&gt;
== Build a toolchain and root filesystem using buildroot ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  for more details on generic buildroot topics not covered in this simple how-to,&lt;br /&gt;
see [http://buildroot.uclibc.org/ buildroot.uclibc.org].&lt;br /&gt;
&lt;br /&gt;
=== Configure buildroot ===&lt;br /&gt;
&lt;br /&gt;
The first time you configure buildroot, start with defaults for your Xtensa processor:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;/buildroot&lt;br /&gt;
   $ ./target/xtensa/setup-config &amp;lt;i&amp;gt;&amp;lt;corename&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039; is the overlay name of your selected Xtensa or Diamond core&lt;br /&gt;
(e.g., &#039;&#039;&#039;dc232b&#039;&#039;&#039;).  If you omit &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039;, a help message and a list&lt;br /&gt;
of currently installed Tensilica core overlays is displayed.&lt;br /&gt;
&lt;br /&gt;
Optionally, you can then customize your buildroot configuration, such as&lt;br /&gt;
selecting additional packages, setting various parameters, and so on.&lt;br /&gt;
The following make targets provide a &#039;&#039;curses&#039;&#039; (text-based graphical) interface&lt;br /&gt;
for configuring buildroot, the uClibc C library, and busybox, respectively.&lt;br /&gt;
(&#039;&#039;&#039;Note:&#039;&#039;&#039;  You need the &amp;lt;tt&amp;gt;TERM&amp;lt;/tt&amp;gt; environment variable properly set for&lt;br /&gt;
these curses based tools to work.)&lt;br /&gt;
&lt;br /&gt;
   $ make menuconfig&lt;br /&gt;
   $ make uclibc-menuconfig&lt;br /&gt;
   $ make busybox-menuconfig&lt;br /&gt;
&lt;br /&gt;
=== Build buildroot ===&lt;br /&gt;
&lt;br /&gt;
Just type:&lt;br /&gt;
&lt;br /&gt;
   $ make&lt;br /&gt;
&lt;br /&gt;
THIS WILL TAKE A LONG TIME (from about 30 minutes with defaults on a 3 GHz Pentium 4,&lt;br /&gt;
to perhaps an hour or many depending on your system and on whether&lt;br /&gt;
you enabled extra packages in your buildroot configuration).&lt;br /&gt;
&lt;br /&gt;
Wait patiently for the build to complete.  This builds an entire toolchain&lt;br /&gt;
as well as some basic packages, and constructs a root filesystem.&lt;br /&gt;
It might build many more packages if you selected them earlier with menuconfig.&lt;br /&gt;
&lt;br /&gt;
==== If Something Goes Wrong ====&lt;br /&gt;
&lt;br /&gt;
Perhaps you missed some step above and the build fails.  Or you&#039;re just switching to a different processor configuration, or making some change with unknown dependencies.  Either way, you&#039;ll probably need to fix the error and/or make the change, and redo the whole build.  The above &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; command usually works fine if you&lt;br /&gt;
just added a package using menuconfig, but otherwise does not check many dependencies, so it will usually NOT rebuild things that depend on whatever you have fixed or changed.  Here&#039;s one way to retry the make from scratch without having to wipe out the &amp;lt;tt&amp;gt;buildroot&amp;lt;/tt&amp;gt; directory tree completely and start again from the git cloning.&lt;br /&gt;
&lt;br /&gt;
  $ rm -rf *build_xtensa* binaries&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
It is not necessary to empty the &#039;dl&#039; subdirectory, which contains tarballs downloaded from the Internet, nor the .config file, which contains the buildroot configuration.  Customizations to the uClibc and &amp;lt;tt&amp;gt;busybox&amp;lt;/tt&amp;gt; configurations should have ended up getting saved in target/xtensa/uClibc.config and target/xtensa/busybox-config, respectively, so hopefully are preserved by the above sequence.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the XTAV60 or XTAV200 Board ==&lt;br /&gt;
&lt;br /&gt;
References to the &#039;&#039;XTAV60 board&#039;&#039; refer to the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica1 LX60 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX60 (XT-AV60) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly, references to the &#039;&#039;XTAV200 board&#039;&#039; refers the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica2 LX200 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX200 (XT-AV200) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure the kernel ===&lt;br /&gt;
&lt;br /&gt;
The kernel build is a two-step process:  configure the kernel, and build it.&lt;br /&gt;
First, before we can do anything with the kernel, set your PATH to&lt;br /&gt;
point to the toolchain built using buildroot.&lt;br /&gt;
&lt;br /&gt;
   $ export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; is the name of the Xtensa processor configuration you selected&lt;br /&gt;
when building the toolchain (e.g., &amp;lt;code&amp;gt;dc232b&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Now setup a destination for kernel builds.&lt;br /&gt;
We usually like to have the build directory separate from&lt;br /&gt;
the source directory, so we use &#039;O=&amp;lt;/destination/path&amp;gt;&#039; in&lt;br /&gt;
kernel make commands.  If you&#039;ll be routinely building multiple&lt;br /&gt;
configurations of the Linux kernel, it&#039;s good to have some&lt;br /&gt;
naming conventions for the build directory.  For example,&lt;br /&gt;
to experiment with multiple target platforms but only one&lt;br /&gt;
processor configuration, we include just the platform name here:&lt;br /&gt;
&lt;br /&gt;
   $ mkdir build-xtav60&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start with the default kernel configuration for the Avnet board&lt;br /&gt;
(which works on both XTAV60 (LX60) and XTAV200 (LX200) boards)&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
   $ cd linux&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa KBUILD_DEFCONFIG=lx60_defconfig defconfig&lt;br /&gt;
&lt;br /&gt;
This configures the kernel using the default configuration found in&lt;br /&gt;
arch/xtensa/configs/lx60_defconfig.&lt;br /&gt;
&lt;br /&gt;
NOTE:  This kernel configuration has nothing to do with Xtensa&lt;br /&gt;
processor configuration.  That comes next.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now customize this a little bit to select the correct Xtensa processor&lt;br /&gt;
configuration, and to bundle the root filesystem into the kernel:&lt;br /&gt;
&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa menuconfig&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is enabled.  Underneath that, edit &#039;&#039;&#039;Initramfs source file(s)&#039;&#039;&#039;,&lt;br /&gt;
and enter the path to the cpio formatted root filesystem&lt;br /&gt;
generated by buildroot:&lt;br /&gt;
&lt;br /&gt;
      &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio.gz&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t forget to replace &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039; with the appropriate full path&lt;br /&gt;
and &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; with your Xtensa processor configuration name.)&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Processor type and features&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Xtensa Processor Configuration&#039;&#039;&#039; is correct and matches&lt;br /&gt;
the processor configuration name you used to build the toolchain with buildroot&lt;br /&gt;
(for example, &#039;&#039;dc232b&#039;&#039; for Diamond 232L Rev.B).&lt;br /&gt;
The kernel build selects a toolchain and processor variant specific headers&lt;br /&gt;
based on this selection.&lt;br /&gt;
If the desired processor configuration does not appear explicitly in the list,&lt;br /&gt;
simply select &#039;&#039;&#039;Custom Xtensa processor configuration&#039;&#039;&#039; and enter the&lt;br /&gt;
processor configuration name (all lowercase) into the next menu parameter,&lt;br /&gt;
&#039;&#039;&#039;Xtensa Processor Custom Variant Name&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Back in the main menu, under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;CPU clock rate&#039;&#039;&#039; entry is set correctly according to the following table:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Board !! Frequency selected in XPG &amp;lt;br/&amp;gt;(MHz) !! &#039;&#039;CPU clock rate&#039;&#039; setting &amp;lt;br/&amp;gt;(kHz)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV60 (LX60)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV200 (LX200)&lt;br /&gt;
|  30  || 31250&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 41667&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exit menuconfig, saving your configuration changes.&lt;br /&gt;
&lt;br /&gt;
Backup your configuration outside the build directory.  For example:&lt;br /&gt;
&lt;br /&gt;
   $ cp ../build-xtav60/.config config.xtav60.saved&lt;br /&gt;
&lt;br /&gt;
If you do a clean rebuild of the kernel (e.g., &amp;quot;rm -rf ../build-xtav60&amp;quot;)&lt;br /&gt;
you can now configure it with simply:&lt;br /&gt;
   $ mkdir ../build-xtav60 ; cp config.xtav60.saved ../build-xtav60/.config&lt;br /&gt;
Of course if you update the kernel, you&#039;ll probably again have to do:&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa  menuconfig&lt;br /&gt;
and save a new copy of your configuration.&lt;br /&gt;
&lt;br /&gt;
=== Build the kernel ===&lt;br /&gt;
&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa&lt;br /&gt;
&lt;br /&gt;
The build will issue a few warnings which are normal.&lt;br /&gt;
Once complete, the bootable image is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
and the uncompressed ELF file containing kernel symbols is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
There is also a RedBoot bootable image (if you use RedBoot) in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/zImage.redboot&lt;br /&gt;
&lt;br /&gt;
=== Install Xtensa Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to download the kernel over OCD, you need &amp;lt;tt&amp;gt;xt-gdb&amp;lt;/tt&amp;gt;&lt;br /&gt;
which is part of Tensilica&#039;s Xtensa Tools package.  This must be obtained&lt;br /&gt;
from Tensilica, and is not the same toolchain as built by buildroot.&lt;br /&gt;
You also need to install the corresponding Tensilica core package,&lt;br /&gt;
so that the Xtensa Tools know about your particular configured&lt;br /&gt;
Tensilica core.&lt;br /&gt;
&lt;br /&gt;
The toolchain built using buildroot can be configured to&lt;br /&gt;
include GDB, but that version of GDB does not support&lt;br /&gt;
communicating with Tensilica&#039;s Xtensa OCD Daemon, and&lt;br /&gt;
thus cannot be used to download the kernel over OCD.&lt;br /&gt;
&lt;br /&gt;
In this example, it is assumed that the machine hosting the&lt;br /&gt;
Xtensa Tools has access to the &amp;lt;workdir&amp;gt; directory tree.&lt;br /&gt;
&lt;br /&gt;
=== Install and setup the Xtensa OCD Daemon ===&lt;br /&gt;
&lt;br /&gt;
Setup and connect your JTAG probe, etc.&lt;br /&gt;
&lt;br /&gt;
=== Connect a terminal server ===&lt;br /&gt;
&lt;br /&gt;
At 38400 bps 8N1 no flow control to the XTAV60 serial port.&lt;br /&gt;
&lt;br /&gt;
=== Optionally, setup networking ===&lt;br /&gt;
&lt;br /&gt;
This step is optional.&lt;br /&gt;
&lt;br /&gt;
Setup the board&#039;s MAC address using dipswitches&lt;br /&gt;
(see XTAV60 or XTAV200 board docs as appropriate)&lt;br /&gt;
and connect the board to a network that has a&lt;br /&gt;
DHCP server that will respond to that MAC address.&lt;br /&gt;
If you don&#039;t do this step, you&#039;ll simply not have network&lt;br /&gt;
access, and the boot process will take a minute or so longer&lt;br /&gt;
while the kernel times out waiting for a BOOTP response.&lt;br /&gt;
You can edit the kernel configuration and rebuild the kernel&lt;br /&gt;
to avoid using bootp (in particular, remove &amp;quot;ip=bootp&amp;quot; from&lt;br /&gt;
the kernel cmdline).&lt;br /&gt;
&lt;br /&gt;
=== Download and run the kernel ===&lt;br /&gt;
&lt;br /&gt;
Reset the board (see board documentation).&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   $ xt-gdb &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
&lt;br /&gt;
   (xt-gdb) target remote &amp;lt;ocdhost&amp;gt;:20000 0&lt;br /&gt;
   (xt-gdb) reset&lt;br /&gt;
   (xt-gdb) load&lt;br /&gt;
   (xt-gdb) set $pc = &amp;amp;_ResetVector&lt;br /&gt;
   (xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
   (xt-gdb) c&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;ocdhost&amp;gt; is the IP address or DNS name of the machine&lt;br /&gt;
running the Xtensa OCD daemon.  The Linux kernel should&lt;br /&gt;
start booting as soon as &#039;c&#039; (continue) is executed.&lt;br /&gt;
&lt;br /&gt;
You should eventually get a login prompt.&lt;br /&gt;
Just login as root (no password).&lt;br /&gt;
&lt;br /&gt;
Try various Linux commands.  Look at &amp;lt;tt&amp;gt;/bin&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;/sbin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt;, etc to see what&#039;s available.&lt;br /&gt;
&lt;br /&gt;
Note:  no need to setup an NFS or TFTP server.  The filesystem&lt;br /&gt;
is contained within the kernel image.  You may be able to mount&lt;br /&gt;
other filesystems over NFS though, if you wish, after booting.&lt;br /&gt;
&lt;br /&gt;
=== Mounting the Root Filesystem Over NFS ===&lt;br /&gt;
&lt;br /&gt;
If you build more than the minimal set of packages using&lt;br /&gt;
buildroot, the root filesystem can easily grow too large to&lt;br /&gt;
fit comfortably (or at all) inside the kernel.  In this case,&lt;br /&gt;
rather than follow the instructions exactly as above,&lt;br /&gt;
you&#039;ll want to mount the root filesystem over NFS.&lt;br /&gt;
&lt;br /&gt;
You may also want to mount the root filesystem over NFS to&lt;br /&gt;
make changes to the filesystem persistent across runs and&lt;br /&gt;
accessible from your development host.&lt;br /&gt;
&lt;br /&gt;
First you need to install the root filesystem generated&lt;br /&gt;
using buildroot, to a machine that can serve it over NFS.&lt;br /&gt;
Assuming this machine runs Linux, one way to install it is&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
 mkdir &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
 cd &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
 sudo cpio -i -d -m -F &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio --no-absolute-filenames&lt;br /&gt;
&lt;br /&gt;
You then need to enable the NFS server on your system&lt;br /&gt;
(if not already active), and export this filesystem.&lt;br /&gt;
How you do this depends on your host Linux distribution.&lt;br /&gt;
For example, on some Fedora releases, one might:&lt;br /&gt;
&lt;br /&gt;
* add the export path to &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; using a line such as&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;  *(rw,sync,no_root_squash,no_all_squash)&lt;br /&gt;
&lt;br /&gt;
* turn on the NFS server if needed:&lt;br /&gt;
&lt;br /&gt;
 sudo /sbin/chkconfig nfs on&lt;br /&gt;
&lt;br /&gt;
* tell the NFS server about the new exported filesystem&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/sbin/exportfs -a&lt;br /&gt;
 sudo /usr/sbin/exportfs -r&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second, follow the instructions in the previous sections,&lt;br /&gt;
then configure the kernel again as follows.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is disabled (rather than enabled as done in previous sections).&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, under the line &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;,&lt;br /&gt;
select the boot parameters line and set it to something like this:&lt;br /&gt;
&lt;br /&gt;
 console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=&#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039;:&#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039; is the IP address of your NFS server, and &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
is the exported filesystem path.&lt;br /&gt;
&lt;br /&gt;
Save this configuration, rebuild the kernel, and follow the&lt;br /&gt;
instructions in previous sections to download and run the kernel.&lt;br /&gt;
If everything goes well and is setup correctly, your kernel should&lt;br /&gt;
now boot with a root filesystem mounted over NFS.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the Instruction Set Simulator (ISS) ==&lt;br /&gt;
&lt;br /&gt;
You can build and run a Linux kernel in the Xtensa Instruction Set&lt;br /&gt;
Simulator (ISS).  The following instructions have only been tried&lt;br /&gt;
with an ISS from the RB-2008.3 release of Xtensa Tools.  Bear in&lt;br /&gt;
mind that the XTAV60 port is likely much more stable than the ISS port&lt;br /&gt;
of Linux at this point in time.&lt;br /&gt;
&lt;br /&gt;
Note:  Depending on your host OS version, you may need to install&lt;br /&gt;
Xtensa Tools on a separate machine.&lt;br /&gt;
&lt;br /&gt;
=== Configure and Build the Kernel for ISS ===&lt;br /&gt;
&lt;br /&gt;
Repeat all the same instructions as above for building the kernel for the&lt;br /&gt;
XTAV60 board, except that when initially configuring the kernel,&lt;br /&gt;
start from the ISS platform template instead:&lt;br /&gt;
&lt;br /&gt;
   $ mkdir build-iss&lt;br /&gt;
   $ cd linux&lt;br /&gt;
   $ make O=../build-iss ARCH=xtensa KBUILD_DEFCONFIG=iss_defconfig defconfig&lt;br /&gt;
&lt;br /&gt;
This configures the kernel using the default configuration found in&lt;br /&gt;
arch/xtensa/configs/iss_defconfig.&lt;br /&gt;
&lt;br /&gt;
Also, when running menuconfig:&lt;br /&gt;
&lt;br /&gt;
   $ make O=../build-iss ARCH=xtensa  menuconfig&lt;br /&gt;
&lt;br /&gt;
in addition to setting up the initramfs filesystem, do the following.&lt;br /&gt;
Under &#039;&#039;&#039;Bus Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;PCI support&#039;&#039;&#039;.&lt;br /&gt;
Under &#039;&#039;&#039;Platform Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Continue configuring and building the kernel as usual.&lt;br /&gt;
&lt;br /&gt;
===  Run the Kernel on ISS ===&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   $ xt-gdb &amp;lt;workdir&amp;gt;/build-iss/arch/xtensa/boot/Image.elf&lt;br /&gt;
&lt;br /&gt;
   (xt-gdb) target sim --turbo&lt;br /&gt;
   (xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-iss/vmlinux&lt;br /&gt;
   (xt-gdb) run&lt;br /&gt;
&lt;br /&gt;
Wait patiently while Linux boots ... (maybe a minute)&lt;br /&gt;
&lt;br /&gt;
Login as root (no password).&lt;br /&gt;
&lt;br /&gt;
Note:  Input via ISS is cooked, so everything typed gets echoed.&lt;br /&gt;
Also, time as reported by the kernel does not progress&lt;br /&gt;
according to true wall-clock time:  it currently depends on&lt;br /&gt;
a simulated processor clock, which advances at various speeds&lt;br /&gt;
according to load.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=171</id>
		<title>Instructions for building and booting Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=171"/>
		<updated>2009-05-12T05:24:16Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Build and run a Linux kernel... */ Add instructions for mounting root over NFS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions explain how to build a toolchain, root filesystem and kernel for Linux running on an Xtensa processor.  These instructions apply specifically to the XTAV60 (LX60) board.&lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.  If you are using the latest development sources, the build process may change, so you should be sure to get the latest version of this document at [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions].  If you are using one of the development snapshot releases, you should use the version of the build instructions included with that snapshot.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on newer Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Xtensa Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&lt;br /&gt;
**  &#039;&#039;&#039;NOTE:&#039;&#039;&#039; this assumes the default selection of packages in buildroot.  Selecting extra packages may require a more recent host OS or more recent version of certain tools.  For example, the default version of &amp;lt;tt&amp;gt;find&amp;lt;/tt&amp;gt; on RHEL4 is too old to allow building all X11 packages in buildroot, so it is necessary to upgrade the host version of &amp;lt;tt&amp;gt;findutils&amp;lt;/tt&amp;gt; on RHEL4 to build these packages.&lt;br /&gt;
&lt;br /&gt;
*  Lines prefixed with &amp;quot;sudo&amp;quot; need to be executed as root.  The rest is best executed as a non-root user.  (It is possible to install &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; as a non-root user if root access is an issue.  How to do this isn&#039;t shown here.)&lt;br /&gt;
&lt;br /&gt;
*  Lines that set environment variables assume a Bourne compatible shell (e.g., /bin/sh or bash), but are easily adapted to other shells.&lt;br /&gt;
&lt;br /&gt;
*  Instructions are assumed executed all in order (e.g., commands assume current directory and environment variables set earlier).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your host system ==&lt;br /&gt;
&lt;br /&gt;
If you are using one of the snapshot releases, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
If you want to work with the latest development sources, you will need&lt;br /&gt;
[[Installing GIT|&amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; installed on your system]].&lt;br /&gt;
&lt;br /&gt;
== Download buildroot and the Linux kernel ==&lt;br /&gt;
&lt;br /&gt;
The following section describes how to download the latest&lt;br /&gt;
versions of buildroot and of the Linux kernel.&lt;br /&gt;
Skip this step if you are using one of the&lt;br /&gt;
[http://wiki.linux-xtensa.org/index.php/Buildroot_Snapshots snapshot releases].&lt;br /&gt;
&lt;br /&gt;
For most users, just execute the following:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa buildroot&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.24 linux&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;&amp;lt;/tt&amp;gt; is the path to an empty directory on a disk with&lt;br /&gt;
at least 4 GB available space.  You end up with the following file structure,&lt;br /&gt;
which is assumed by the rest of this document:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;workdir&amp;gt;/&lt;br /&gt;
            /buildroot&lt;br /&gt;
            /linux&lt;br /&gt;
&lt;br /&gt;
If you happen to have write access to either repository, or want more details,&lt;br /&gt;
see the [http://wiki.linux-xtensa.org/index.php/Repository_Access repository access] page.&lt;br /&gt;
&lt;br /&gt;
== Install any required processor specific overlay ==&lt;br /&gt;
&lt;br /&gt;
This step is required if you are targeting a custom Xtensa processor.&lt;br /&gt;
If you use a Diamond 232L Standard Core, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
To configure buildroot and the kernel to use a custom Xtensa processor&lt;br /&gt;
configuration, you need to overlay a set of files customized for your&lt;br /&gt;
processor configuration onto toolchain sources (gcc, binutils, gdb, etc)&lt;br /&gt;
and the Linux kernel.  This process has been automated using a script&lt;br /&gt;
located in the buildroot source tree.&lt;br /&gt;
For usage information, you can invoke it without arguments:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ ./buildroot/target/xtensa/xt-buildroot-overlay-install&lt;br /&gt;
&lt;br /&gt;
which displays a help message similar to the following:&lt;br /&gt;
&lt;br /&gt;
 xt-buildroot-overlay-install version 1.3&lt;br /&gt;
 Usage:  xt-buildroot-overlay-install &amp;lt;parameters&amp;gt; [&amp;lt;options&amp;gt;]&lt;br /&gt;
 Where &amp;lt;parameters&amp;gt; are:&lt;br /&gt;
   -t file.tgz     Specify path to the Xtensa Linux overlay tarball, typically&lt;br /&gt;
                   &amp;lt;xtensa_root&amp;gt;/src/xtensa-config-overlay.tar.gz&lt;br /&gt;
   -b dir          Path to the base of the buildroot source tree, in which&lt;br /&gt;
                   package specific overlay tarballs get installed.&lt;br /&gt;
   -k dir          Path to the base of the Linux kernel source tree, in which&lt;br /&gt;
                   the Linux kernel specific overlay gets installed.&lt;br /&gt;
   -c config_name  Name for the Xtensa processor configuration as it will be&lt;br /&gt;
                   known to the open source community.  Must be a lowercase&lt;br /&gt;
                   identifier, starting with a letter, consisting of letters&lt;br /&gt;
                   and numbers and underscores, not ending with underscore&lt;br /&gt;
                   and not containing consecutive underscores.  For examples:&lt;br /&gt;
                      dc232b , dc232b_be , mmubasele , fsf , s5000 .&lt;br /&gt;
   -l long_name    Long name for the Xtensa processor configuration, human-&lt;br /&gt;
                   readable with spaces etc allowed (must be quoted).&lt;br /&gt;
                   For example:  &#039;Diamond 232L Standard Core Rev.B (LE)&#039;&lt;br /&gt;
                   Try to keep it within approximately 40 characters.&lt;br /&gt;
 And &amp;lt;options&amp;gt; are:&lt;br /&gt;
   -f              If package specific overlay tarballs already exist in&lt;br /&gt;
                   the destination source tree, overwrite them without asking.&lt;br /&gt;
   --help          Show this usage message.&lt;br /&gt;
&lt;br /&gt;
Note that the Xtensa Linux overlay tarball MUST be obtained from an Xtensa&lt;br /&gt;
core package built using release RB-2008.3 or later.&lt;br /&gt;
&lt;br /&gt;
Here is an example invocation of the overlay installation script:&lt;br /&gt;
&lt;br /&gt;
   $ ./buildroot/target/xtensa/xt-buildroot-overlay-install -t blinkcore-config-overlay.tar.gz \&lt;br /&gt;
         -b ./buildroot -k ./linux -c superzip -l &amp;quot;ChipCorp SuperZIP Blink Accelerator Core&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The script extracts some relevant information from the overlay tarball,&lt;br /&gt;
presents it along with relevant parameters to the user, and prompts&lt;br /&gt;
for confirmation before proceeding.&lt;br /&gt;
&lt;br /&gt;
The chosen processor name (-c option) must be unique among known Xtensa processors.&lt;br /&gt;
It is also probably wise to avoid names confusingly similar to other (non-Xtensa) processors.&lt;br /&gt;
If you expect at some point to contribute support for your custom processor to the&lt;br /&gt;
open-source community, this name will likely be long-lived.&lt;br /&gt;
(One way to contribute support for a custom processor might be to submit the overlay tarball&lt;br /&gt;
or files to the linux-xtensa.org maintainers.)&lt;br /&gt;
&lt;br /&gt;
In the steps below, buildroot and the Linux kernel must be configured&lt;br /&gt;
(in their respective &amp;lt;code&amp;gt;&#039;&#039;make menuconfig&#039;&#039;&amp;lt;/code&amp;gt; steps) to select&lt;br /&gt;
the &amp;lt;code&amp;gt;&#039;&#039;custom&#039;&#039;&amp;lt;/code&amp;gt; Xtensa processor option.&lt;br /&gt;
This presents an extra configuration menu entry where you must provide&lt;br /&gt;
the name of the Xtensa processor.  Set it to the same name&lt;br /&gt;
as was specified in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option above.&lt;br /&gt;
&lt;br /&gt;
== Build a toolchain and root filesystem using buildroot ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  for more details on generic buildroot topics not covered in this simple how-to,&lt;br /&gt;
see [http://buildroot.uclibc.org/ buildroot.uclibc.org].&lt;br /&gt;
&lt;br /&gt;
=== Configure buildroot ===&lt;br /&gt;
&lt;br /&gt;
The first time you configure buildroot, start with defaults for your Xtensa processor:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;/buildroot&lt;br /&gt;
   $ ./target/xtensa/setup-config &amp;lt;i&amp;gt;&amp;lt;corename&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039; is the overlay name of your selected Xtensa or Diamond core&lt;br /&gt;
(e.g., &#039;&#039;&#039;dc232b&#039;&#039;&#039;).  If you omit &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039;, a help message and a list&lt;br /&gt;
of currently installed Tensilica core overlays is displayed.&lt;br /&gt;
&lt;br /&gt;
Optionally, you can then customize your buildroot configuration, such as&lt;br /&gt;
selecting additional packages, setting various parameters, and so on.&lt;br /&gt;
The following make targets provide a &#039;&#039;curses&#039;&#039; (text-based graphical) interface&lt;br /&gt;
for configuring buildroot, the uClibc C library, and busybox, respectively.&lt;br /&gt;
(&#039;&#039;&#039;Note:&#039;&#039;&#039;  You need the &amp;lt;tt&amp;gt;TERM&amp;lt;/tt&amp;gt; environment variable properly set for&lt;br /&gt;
these curses based tools to work.)&lt;br /&gt;
&lt;br /&gt;
   $ make menuconfig&lt;br /&gt;
   $ make uclibc-menuconfig&lt;br /&gt;
   $ make busybox-menuconfig&lt;br /&gt;
&lt;br /&gt;
=== Build buildroot ===&lt;br /&gt;
&lt;br /&gt;
Just type:&lt;br /&gt;
&lt;br /&gt;
   $ make&lt;br /&gt;
&lt;br /&gt;
THIS WILL TAKE A LONG TIME (from about 30 minutes with defaults on a 3 GHz Pentium 4,&lt;br /&gt;
to perhaps an hour or many depending on your system and on whether&lt;br /&gt;
you enabled extra packages in your buildroot configuration).&lt;br /&gt;
&lt;br /&gt;
Wait patiently for the build to complete.  This builds an entire toolchain&lt;br /&gt;
as well as some basic packages, and constructs a root filesystem.&lt;br /&gt;
It might build many more packages if you selected them earlier with menuconfig.&lt;br /&gt;
&lt;br /&gt;
==== If Something Goes Wrong ====&lt;br /&gt;
&lt;br /&gt;
Perhaps you missed some step above and the build fails.  Or you&#039;re just switching to a different processor configuration, or making some change with unknown dependencies.  Either way, you&#039;ll probably need to fix the error and/or make the change, and redo the whole build.  The above &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; command usually works fine if you&lt;br /&gt;
just added a package using menuconfig, but otherwise does not check many dependencies, so it will usually NOT rebuild things that depend on whatever you have fixed or changed.  Here&#039;s one way to retry the make from scratch without having to wipe out the &amp;lt;tt&amp;gt;buildroot&amp;lt;/tt&amp;gt; directory tree completely and start again from the git cloning.&lt;br /&gt;
&lt;br /&gt;
  $ rm -rf *build_xtensa* binaries&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
It is not necessary to empty the &#039;dl&#039; subdirectory, which contains tarballs downloaded from the Internet, nor the .config file, which contains the buildroot configuration.  Customizations to the uClibc and &amp;lt;tt&amp;gt;busybox&amp;lt;/tt&amp;gt; configurations should have ended up getting saved in target/xtensa/uClibc.config and target/xtensa/busybox-config, respectively, so hopefully are preserved by the above sequence.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the XTAV60 or XTAV200 Board ==&lt;br /&gt;
&lt;br /&gt;
References to the &#039;&#039;XTAV60 board&#039;&#039; refer to the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica1 LX60 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX60 (XT-AV60) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly, references to the &#039;&#039;XTAV200 board&#039;&#039; refers the combination of&lt;br /&gt;
the Avnet [http://www.em.avnet.com/tensilica2 LX200 (Xilinx) Development Board]&lt;br /&gt;
and a Tensilica-provided FPGA bitstream containing a configured Tensilica&lt;br /&gt;
processor and basic peripheral IP.  For more details, please refer to the&lt;br /&gt;
&#039;&#039;Tensilica Avnet LX200 (XT-AV200) Board User&#039;s Guide&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure the kernel ===&lt;br /&gt;
&lt;br /&gt;
The kernel build is a two-step process:  configure the kernel, and build it.&lt;br /&gt;
First, before we can do anything with the kernel, set your PATH to&lt;br /&gt;
point to the toolchain built using buildroot.&lt;br /&gt;
&lt;br /&gt;
   $ export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; is the name of the Xtensa processor configuration you selected&lt;br /&gt;
when building the toolchain (e.g., &amp;lt;code&amp;gt;dc232b&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Now setup a destination for kernel builds.&lt;br /&gt;
We usually like to have the build directory separate from&lt;br /&gt;
the source directory, so we use &#039;O=&amp;lt;/destination/path&amp;gt;&#039; in&lt;br /&gt;
kernel make commands.  If you&#039;ll be routinely building multiple&lt;br /&gt;
configurations of the Linux kernel, it&#039;s good to have some&lt;br /&gt;
naming conventions for the build directory.  For example,&lt;br /&gt;
to experiment with multiple target platforms but only one&lt;br /&gt;
processor configuration, we include just the platform name here:&lt;br /&gt;
&lt;br /&gt;
   $ mkdir build-xtav60&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start with the default kernel configuration for the Avnet board&lt;br /&gt;
(which works on both XTAV60 (LX60) and XTAV200 (LX200) boards)&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
   $ cd linux&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa KBUILD_DEFCONFIG=lx60_defconfig defconfig&lt;br /&gt;
&lt;br /&gt;
This configures the kernel using the default configuration found in&lt;br /&gt;
arch/xtensa/configs/lx60_defconfig.&lt;br /&gt;
&lt;br /&gt;
NOTE:  This kernel configuration has nothing to do with Xtensa&lt;br /&gt;
processor configuration.  That comes next.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now customize this a little bit to select the correct Xtensa processor&lt;br /&gt;
configuration, and to bundle the root filesystem into the kernel:&lt;br /&gt;
&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa menuconfig&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is enabled.  Underneath that, edit &#039;&#039;&#039;Initramfs source file(s)&#039;&#039;&#039;,&lt;br /&gt;
and enter the path to the cpio formatted root filesystem&lt;br /&gt;
generated by buildroot:&lt;br /&gt;
&lt;br /&gt;
      &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio.gz&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t forget to replace &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039; with the appropriate full path&lt;br /&gt;
and &#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039; with your Xtensa processor configuration name.)&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Processor type and features&#039;&#039;&#039;,&lt;br /&gt;
make sure the &#039;&#039;&#039;Xtensa Processor Configuration&#039;&#039;&#039; is correct and matches&lt;br /&gt;
the processor configuration name you used to build the toolchain with buildroot&lt;br /&gt;
(for example, &#039;&#039;dc232b&#039;&#039; for Diamond 232L Rev.B).&lt;br /&gt;
The kernel build selects a toolchain and processor variant specific headers&lt;br /&gt;
based on this selection.&lt;br /&gt;
If the desired processor configuration does not appear explicitly in the list,&lt;br /&gt;
simply select &#039;&#039;&#039;Custom Xtensa processor configuration&#039;&#039;&#039; and enter the&lt;br /&gt;
processor configuration name (all lowercase) into the next menu parameter,&lt;br /&gt;
&#039;&#039;&#039;Xtensa Processor Custom Variant Name&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Back in the main menu, under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;CPU clock rate&#039;&#039;&#039; entry is set correctly according to the following table:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Board !! Frequency selected in XPG &amp;lt;br/&amp;gt;(MHz) !! &#039;&#039;CPU clock rate&#039;&#039; setting &amp;lt;br/&amp;gt;(kHz)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV60 (LX60)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV200 (LX200)&lt;br /&gt;
|  30  || 31250&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 41667&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exit menuconfig, saving your configuration changes.&lt;br /&gt;
&lt;br /&gt;
Backup your configuration outside the build directory.  For example:&lt;br /&gt;
&lt;br /&gt;
   $ cp ../build-xtav60/.config config.xtav60.saved&lt;br /&gt;
&lt;br /&gt;
If you do a clean rebuild of the kernel (e.g., &amp;quot;rm -rf ../build-xtav60&amp;quot;)&lt;br /&gt;
you can now configure it with simply:&lt;br /&gt;
   $ mkdir ../build-xtav60 ; cp config.xtav60.saved ../build-xtav60/.config&lt;br /&gt;
Of course if you update the kernel, you&#039;ll probably again have to do:&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa  menuconfig&lt;br /&gt;
and save a new copy of your configuration.&lt;br /&gt;
&lt;br /&gt;
=== Build the kernel ===&lt;br /&gt;
&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa&lt;br /&gt;
&lt;br /&gt;
The build will issue a few warnings which are normal.&lt;br /&gt;
Once complete, the bootable image is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
and the uncompressed ELF file containing kernel symbols is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
There is also a RedBoot bootable image (if you use RedBoot) in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/zImage.redboot&lt;br /&gt;
&lt;br /&gt;
=== Install Xtensa Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to download the kernel over OCD, you need &amp;lt;tt&amp;gt;xt-gdb&amp;lt;/tt&amp;gt;&lt;br /&gt;
which is part of Tensilica&#039;s Xtensa Tools package.  This must be obtained&lt;br /&gt;
from Tensilica, and is not the same toolchain as built by buildroot.&lt;br /&gt;
You also need to install the corresponding Tensilica core package,&lt;br /&gt;
so that the Xtensa Tools know about your particular configured&lt;br /&gt;
Tensilica core.&lt;br /&gt;
&lt;br /&gt;
The toolchain built using buildroot can be configured to&lt;br /&gt;
include GDB, but that version of GDB does not support&lt;br /&gt;
communicating with Tensilica&#039;s Xtensa OCD Daemon, and&lt;br /&gt;
thus cannot be used to download the kernel over OCD.&lt;br /&gt;
&lt;br /&gt;
In this example, it is assumed that the machine hosting the&lt;br /&gt;
Xtensa Tools has access to the &amp;lt;workdir&amp;gt; directory tree.&lt;br /&gt;
&lt;br /&gt;
=== Install and setup the Xtensa OCD Daemon ===&lt;br /&gt;
&lt;br /&gt;
Setup and connect your JTAG probe, etc.&lt;br /&gt;
&lt;br /&gt;
=== Connect a terminal server ===&lt;br /&gt;
&lt;br /&gt;
At 38400 bps 8N1 no flow control to the XTAV60 serial port.&lt;br /&gt;
&lt;br /&gt;
=== Optionally, setup networking ===&lt;br /&gt;
&lt;br /&gt;
This step is optional.&lt;br /&gt;
&lt;br /&gt;
Setup the board&#039;s MAC address using dipswitches&lt;br /&gt;
(see XTAV60 or XTAV200 board docs as appropriate)&lt;br /&gt;
and connect the board to a network that has a&lt;br /&gt;
DHCP server that will respond to that MAC address.&lt;br /&gt;
If you don&#039;t do this step, you&#039;ll simply not have network&lt;br /&gt;
access, and the boot process will take a minute or so longer&lt;br /&gt;
while the kernel times out waiting for a BOOTP response.&lt;br /&gt;
You can edit the kernel configuration and rebuild the kernel&lt;br /&gt;
to avoid using bootp (in particular, remove &amp;quot;ip=bootp&amp;quot; from&lt;br /&gt;
the kernel cmdline).&lt;br /&gt;
&lt;br /&gt;
=== Download and run the kernel ===&lt;br /&gt;
&lt;br /&gt;
Reset the board (see board documentation).&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   $ xt-gdb &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
&lt;br /&gt;
   (xt-gdb) target remote &amp;lt;ocdhost&amp;gt;:20000 0&lt;br /&gt;
   (xt-gdb) reset&lt;br /&gt;
   (xt-gdb) load&lt;br /&gt;
   (xt-gdb) set $pc = &amp;amp;_ResetVector&lt;br /&gt;
   (xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
   (xt-gdb) c&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;ocdhost&amp;gt; is the IP address or DNS name of the machine&lt;br /&gt;
running the Xtensa OCD daemon.  The Linux kernel should&lt;br /&gt;
start booting as soon as &#039;c&#039; (continue) is executed.&lt;br /&gt;
&lt;br /&gt;
You should eventually get a login prompt.&lt;br /&gt;
Just login as root (no password).&lt;br /&gt;
&lt;br /&gt;
Try various Linux commands.  Look at &amp;lt;tt&amp;gt;/bin&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;/sbin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt;, etc to see what&#039;s available.&lt;br /&gt;
&lt;br /&gt;
Note:  no need to setup an NFS or TFTP server.  The filesystem&lt;br /&gt;
is contained within the kernel image.  You may be able to mount&lt;br /&gt;
other filesystems over NFS though, if you wish, after booting.&lt;br /&gt;
&lt;br /&gt;
=== Mounting the Root Filesystem Over NFS ===&lt;br /&gt;
&lt;br /&gt;
If you build more than the minimal set of packages using&lt;br /&gt;
buildroot, the root filesystem can easily grow too large to&lt;br /&gt;
fit comfortably (or at all) inside the kernel.  In this case,&lt;br /&gt;
rather than follow the instructions exactly as above,&lt;br /&gt;
you&#039;ll want to mount the root filesystem over NFS.&lt;br /&gt;
&lt;br /&gt;
You may also want to mount the root filesystem over NFS to&lt;br /&gt;
make it easier to access files (e.g. generated on the target)&lt;br /&gt;
from your development host.&lt;br /&gt;
&lt;br /&gt;
First you need to install the root filesystem generated&lt;br /&gt;
using buildroot, to a machine that can serve it over NFS.&lt;br /&gt;
Assuming this machine runs Linux, one way to install it is&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
 mkdir &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
 cd &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
 sudo cpio -i -d -m -F &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio --no-absolute-filenames&lt;br /&gt;
&lt;br /&gt;
You then need to enable the NFS server on your system&lt;br /&gt;
(if not already active), and export this filesystem.&lt;br /&gt;
How you do this depends on your host Linux distribution.&lt;br /&gt;
For example, on some Fedora releases, one might:&lt;br /&gt;
&lt;br /&gt;
* add the export path to &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; using a line such as&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;  *(rw,sync,no_root_squash,no_all_squash)&lt;br /&gt;
&lt;br /&gt;
* turn on the NFS server if needed:&lt;br /&gt;
&lt;br /&gt;
 sudo /sbin/chkconfig nfs on&lt;br /&gt;
&lt;br /&gt;
* tell the NFS server about the new exported filesystem&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/sbin/exportfs -a&lt;br /&gt;
 sudo /usr/sbin/exportfs -r&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second, follow the instructions in the previous sections,&lt;br /&gt;
then configure the kernel again as follows.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is disabled (rather than enabled as done in previous sections).&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, under the line &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;,&lt;br /&gt;
select the boot parameters line and set it to something like this:&lt;br /&gt;
&lt;br /&gt;
 console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=&#039;&#039;&amp;lt;serverip&amp;gt;&#039;&#039;:&#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;serverip&amp;gt;&#039;&#039; is the IP address of your NFS server, and &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
is the exported filesystem path.&lt;br /&gt;
&lt;br /&gt;
Save this configuration, rebuild the kernel, and follow the&lt;br /&gt;
instructions in previous sections to download and run the kernel.&lt;br /&gt;
If everything goes well and is setup correctly, your kernel should&lt;br /&gt;
now boot with a root filesystem mounted over NFS.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the Instruction Set Simulator (ISS) ==&lt;br /&gt;
&lt;br /&gt;
You can build and run a Linux kernel in the Xtensa Instruction Set&lt;br /&gt;
Simulator (ISS).  The following instructions have only been tried&lt;br /&gt;
with an ISS from the RB-2008.3 release of Xtensa Tools.  Bear in&lt;br /&gt;
mind that the XTAV60 port is likely much more stable than the ISS port&lt;br /&gt;
of Linux at this point in time.&lt;br /&gt;
&lt;br /&gt;
Note:  Depending on your host OS version, you may need to install&lt;br /&gt;
Xtensa Tools on a separate machine.&lt;br /&gt;
&lt;br /&gt;
=== Configure and Build the Kernel for ISS ===&lt;br /&gt;
&lt;br /&gt;
Repeat all the same instructions as above for building the kernel for the&lt;br /&gt;
XTAV60 board, except that when initially configuring the kernel,&lt;br /&gt;
start from the ISS platform template instead:&lt;br /&gt;
&lt;br /&gt;
   $ mkdir build-iss&lt;br /&gt;
   $ cd linux&lt;br /&gt;
   $ make O=../build-iss ARCH=xtensa KBUILD_DEFCONFIG=iss_defconfig defconfig&lt;br /&gt;
&lt;br /&gt;
This configures the kernel using the default configuration found in&lt;br /&gt;
arch/xtensa/configs/iss_defconfig.&lt;br /&gt;
&lt;br /&gt;
Also, when running menuconfig:&lt;br /&gt;
&lt;br /&gt;
   $ make O=../build-iss ARCH=xtensa  menuconfig&lt;br /&gt;
&lt;br /&gt;
in addition to setting up the initramfs filesystem, do the following.&lt;br /&gt;
Under &#039;&#039;&#039;Bus Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;PCI support&#039;&#039;&#039;.&lt;br /&gt;
Under &#039;&#039;&#039;Platform Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Continue configuring and building the kernel as usual.&lt;br /&gt;
&lt;br /&gt;
===  Run the Kernel on ISS ===&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   $ xt-gdb &amp;lt;workdir&amp;gt;/build-iss/arch/xtensa/boot/Image.elf&lt;br /&gt;
&lt;br /&gt;
   (xt-gdb) target sim --turbo&lt;br /&gt;
   (xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-iss/vmlinux&lt;br /&gt;
   (xt-gdb) run&lt;br /&gt;
&lt;br /&gt;
Wait patiently while Linux boots ... (maybe a minute)&lt;br /&gt;
&lt;br /&gt;
Login as root (no password).&lt;br /&gt;
&lt;br /&gt;
Note:  Input via ISS is cooked, so everything typed gets echoed.&lt;br /&gt;
Also, time as reported by the kernel does not progress&lt;br /&gt;
according to true wall-clock time:  it currently depends on&lt;br /&gt;
a simulated processor clock, which advances at various speeds&lt;br /&gt;
according to load.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=KnownIssues&amp;diff=170</id>
		<title>KnownIssues</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=KnownIssues&amp;diff=170"/>
		<updated>2008-12-09T22:10:38Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Kernel loadable modules using FLIX with L32R */ Mention the OSKit guide for info about XCC for Linux.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Known Kernel Issues and Limitations =&lt;br /&gt;
&lt;br /&gt;
This page contains recommendations, notes, limitations, and requirements for the development of software on systems using Xtensa processors running Linux.&lt;br /&gt;
&lt;br /&gt;
Eventually all these should be duly reported and tracked in&lt;br /&gt;
the [http://bugs.linux-xtensa.org Mantis bug tracker].&lt;br /&gt;
For the time being, here are some of the main known issues (this is by no means an exhaustive list!).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 128 MB RAM Limit ==&lt;br /&gt;
&lt;br /&gt;
Kernel highmem support has not yet been implemented, thus restricting generally usable RAM to the first 128 MB (starting from physical address zero).  Implementing kernel highmem support should release this limitation, but it isn&#039;t yet clear whether an implementation is practical in the presence of cache aliasing (caches larger than 4 x N kB, for an N-way set-associative cache) on RB-200x release or earlier Tensilica processors.&lt;br /&gt;
&lt;br /&gt;
== Kernel loadable modules using FLIX with L32R ==&lt;br /&gt;
&lt;br /&gt;
The kernel module loader (for the Xtensa architecture) supports only the limited set of relocations needed for module loading.  This includes, for example, relocation of literals referenced by L32R instructions.  This loader is not given specific information about any custom TIE configured in the processor, and thus is currently not able to relocate L32R instructions encoded in a FLIX bundle.&lt;br /&gt;
&lt;br /&gt;
To ensure kernel modules load properly, they need to avoid L32R instructions within FLIX instruction bundles.&lt;br /&gt;
&lt;br /&gt;
Existing kernel code does not generate such instructions, so it is not susceptible.&lt;br /&gt;
However, it is possible to generate FLIX instructions using assembly code, or using the Tensilica XCC compiler.  In the case of assembly code, simply avoid using L32R or MOVI instructions within a FLIX instruction bundle, unless a MOVI is known to fit without expanding (&amp;quot;relaxing&amp;quot;) into an L32R instruction.  In the case of XCC, pass the -mno-flix to the compiler (xt-xcc) to avoid generating FLIX bundles.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;:  The use of Tensilica software tools (including XCC) for Linux development is described in the &#039;&#039;Tensilica OSKit Guide&#039;&#039;, available from Tensilica.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=KnownIssues&amp;diff=169</id>
		<title>KnownIssues</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=KnownIssues&amp;diff=169"/>
		<updated>2008-12-09T22:02:32Z</updated>

		<summary type="html">&lt;p&gt;Marc: Moved hardware contents to another page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Known Kernel Issues and Limitations =&lt;br /&gt;
&lt;br /&gt;
This page contains recommendations, notes, limitations, and requirements for the development of software on systems using Xtensa processors running Linux.&lt;br /&gt;
&lt;br /&gt;
Eventually all these should be duly reported and tracked in&lt;br /&gt;
the [http://bugs.linux-xtensa.org Mantis bug tracker].&lt;br /&gt;
For the time being, here are some of the main known issues (this is by no means an exhaustive list!).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 128 MB RAM Limit ==&lt;br /&gt;
&lt;br /&gt;
Kernel highmem support has not yet been implemented, thus restricting generally usable RAM to the first 128 MB (starting from physical address zero).  Implementing kernel highmem support should release this limitation, but it isn&#039;t yet clear whether an implementation is practical in the presence of cache aliasing (caches larger than 4 x N kB, for an N-way set-associative cache) on RB-200x release or earlier Tensilica processors.&lt;br /&gt;
&lt;br /&gt;
== Kernel loadable modules using FLIX with L32R ==&lt;br /&gt;
&lt;br /&gt;
The kernel module loader (for the Xtensa architecture) supports only the limited set of relocations needed for module loading.  This includes, for example, relocation of literals referenced by L32R instructions.  This loader is not given specific information about any custom TIE configured in the processor, and thus is currently not able to relocate L32R instructions encoded in a FLIX bundle.&lt;br /&gt;
&lt;br /&gt;
To ensure kernel modules load properly, they need to avoid L32R instructions within FLIX instruction bundles.&lt;br /&gt;
&lt;br /&gt;
Existing kernel code does not generate such instructions, so it is not susceptible.&lt;br /&gt;
However, it is possible to generate FLIX instructions using assembly code, or using the Tensilica XCC compiler.  In the case of assembly code, simply avoid using L32R or MOVI instructions within a FLIX instruction bundle, unless a MOVI is known to fit without expanding (&amp;quot;relaxing&amp;quot;) into an L32R instruction.  In the case of XCC, pass the -mno-flix to the compiler (xt-xcc) to avoid generating FLIX bundles.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Supported_Processor_Configurations&amp;diff=168</id>
		<title>Supported Processor Configurations</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Supported_Processor_Configurations&amp;diff=168"/>
		<updated>2008-12-09T22:01:53Z</updated>

		<summary type="html">&lt;p&gt;Marc: Move hardware related issues to this page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Hardware System Limitations =&lt;br /&gt;
&lt;br /&gt;
This page contains recommendations, notes, limitations, and requirements for the development of hardware systems using Xtensa processors running Linux.&lt;br /&gt;
&lt;br /&gt;
= Recommendations =&lt;br /&gt;
&lt;br /&gt;
== Atomic Memory Access Support ==&lt;br /&gt;
&lt;br /&gt;
For future compatibility with Linux kernel releases for the Xtensa architecture, please include support for the atomic load-conditional-store S32C1I instruction when designing your memory system. The memory system must provide for the atomic update of a memory location by holding off the load until all other transactions are complete, and holding off any other transactions once the atomic operation has started until it has finished.&lt;br /&gt;
&lt;br /&gt;
Tensilica&#039;s PIF Bridges all support this, but if you are using other bridges, this implementation should be verified.&lt;br /&gt;
&lt;br /&gt;
== Large RAM with Large Caches ==&lt;br /&gt;
&lt;br /&gt;
Tensilica asks to please contact Tensilica support if you are planning to use or build a linux based system that may require more than 128 MB of main RAM for an Xtensa processor configured with large caches (cache size &amp;gt; 4*N kB, for an N-way set associative cache). There are some system limitations that should be evaluated before proceeding.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Main_Page&amp;diff=167</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Main_Page&amp;diff=167"/>
		<updated>2008-12-09T21:57:46Z</updated>

		<summary type="html">&lt;p&gt;Marc: Move hardware design info to a separate page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;amp;nbsp;&lt;br /&gt;
= &amp;lt;big&amp;gt;Welcome to the Linux/Xtensa Wiki&amp;lt;/big&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Wiki project provides information about the [http://en.wikipedia.org/wiki/Linux Linux] port to the [http://www.tensilica.com Xtensa processor architecture].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width:45%;height=100%; background:#ffffff;&amp;quot; valign=top|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Getting Started&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Supported Processors]]&lt;br /&gt;
* [[Evaluation Platforms|Evaluation Platforms]]&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Support&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Internet Resources]]&lt;br /&gt;
* [[OpenSource Software|OpenSource Tools and Applications]]&lt;br /&gt;
* [[KnownIssues|Known Kernel Issues and Limitations]]&lt;br /&gt;
* [[Hardware Issues|Things Hardware Designers Should Know]]&lt;br /&gt;
|style=&amp;quot;width:10%;height:100%;background:#ffffff;&amp;quot; |&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width:45%;height:100%; background:#ffffff;&amp;quot; valign=top|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Linux from Scratch&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Toolchain and Embedded Distributions]]&lt;br /&gt;
* [[Kernel Build Instructions|Kernel Build Instructions]]&lt;br /&gt;
* [[Boot Loader|Boot Loader]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Developers&#039; Resources&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Platform Porting|Porting the Kernel to a new Platform (Board)]]&lt;br /&gt;
* [[ABI Interface]]&lt;br /&gt;
&lt;br /&gt;
| colspan=3 |&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=3 |&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;News&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
2008-07-14 Buildroot snapshot 20080711 posted, see download page.&amp;lt;br&amp;gt;&lt;br /&gt;
2008-04-25 Linux Xtensa 2.6.24 tree updated to 2.6.24.4.&amp;lt;br&amp;gt;&lt;br /&gt;
2008-01-23 Initial buildroot snapshot posted, see download page.&amp;lt;br&amp;gt;&lt;br /&gt;
2007-09-05 Moved to a new server.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Old news:&lt;br /&gt;
2007-04-24 Moved content to the public wiki.&amp;lt;br&amp;gt;&lt;br /&gt;
2007-01-16 Started adding content to this site.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;small&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  At this time, new users by default cannot edit any Wiki pages.&lt;br /&gt;
This may change in the future.&lt;br /&gt;
Meanwhile, if you want to edit or contribute anything, try sending an email to the&lt;br /&gt;
[http://lists.linux-xtensa.org/mailman/listinfo/linux-xtensa linux-xtensa mailing list]&lt;br /&gt;
identifying yourself and what you want to contribute.&lt;br /&gt;
&amp;lt;/small&amp;gt;&amp;lt;/i&amp;gt;&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=KnownIssues&amp;diff=166</id>
		<title>KnownIssues</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=KnownIssues&amp;diff=166"/>
		<updated>2008-12-09T21:53:59Z</updated>

		<summary type="html">&lt;p&gt;Marc: Gather other system info pages, and add info about kernel modules with FLIX and L32R&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Known Kernel Issues and Limitations =&lt;br /&gt;
&lt;br /&gt;
== Hardware System Limitations ==&lt;br /&gt;
&lt;br /&gt;
This section contains recommendations, notes, limitations, and requirements for the development of hardware systems using Xtensa processors running Linux.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Recommendations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For future compatibility with Linux kernel releases for the Xtensa architecture, please include support for the atomic load-conditional-store S32C1I instruction when designing your memory system. The memory system must provide for the atomic update of a memory location by holding off the load until all other transactions are complete, and holding off any other transactions once the atomic operation has started until it has finished.  Tensilica&#039;s PIF Bridges all support this but if you are using other bridges this implementation should be verified.&lt;br /&gt;
&lt;br /&gt;
Please contact Tensilica support if planning to use or build a linux based system that may require more than 128 MB of main RAM for an Xtensa processor configured with large caches (cache size &amp;gt; 4*N kB, for an N-way set associative cache). There are some system limitations that should be evaluated before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Software Limitations ==&lt;br /&gt;
&lt;br /&gt;
This section contains recommendations, notes, limitations, and requirements for the development of software on systems using Xtensa processors running Linux.&lt;br /&gt;
&lt;br /&gt;
Eventually all these should be duly reported and tracked in&lt;br /&gt;
the [http://bugs.linux-xtensa.org Mantis bug tracker].&lt;br /&gt;
For the time being, here are some of the main known issues (this is by no means an exhaustive list!).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 128 MB RAM Limit ===&lt;br /&gt;
&lt;br /&gt;
Kernel highmem support has not yet been implemented, thus restricting generally usable RAM to the first 128 MB (starting from physical address zero).  Implementing kernel highmem support should release this limitation, but it isn&#039;t yet clear whether an implementation is practical in the presence of cache aliasing (caches larger than 4 x N kB, for an N-way set-associative cache) on RB-200x release or earlier Tensilica processors.&lt;br /&gt;
&lt;br /&gt;
=== Kernel loadable modules using FLIX with L32R ===&lt;br /&gt;
&lt;br /&gt;
The kernel module loader (for the Xtensa architecture) supports only the limited set of relocations needed for module loading.  This includes, for example, relocation of literals referenced by L32R instructions.  This loader is not given specific information about any custom TIE configured in the processor, and thus is currently not able to relocate L32R instructions encoded in a FLIX bundle.&lt;br /&gt;
&lt;br /&gt;
To ensure kernel modules load properly, they need to avoid L32R instructions within FLIX instruction bundles.&lt;br /&gt;
&lt;br /&gt;
Existing kernel code does not generate such instructions, so it is not susceptible.&lt;br /&gt;
However, it is possible to generate FLIX instructions using assembly code, or using the Tensilica XCC compiler.  In the case of assembly code, simply avoid using L32R or MOVI instructions within a FLIX instruction bundle, unless a MOVI is known to fit without expanding (&amp;quot;relaxing&amp;quot;) into an L32R instruction.  In the case of XCC, pass the -mno-flix to the compiler (xt-xcc) to avoid generating FLIX bundles.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Main_Page&amp;diff=165</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Main_Page&amp;diff=165"/>
		<updated>2008-12-09T21:22:17Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* &amp;lt;big&amp;gt;Welcome to the Linux/Xtensa Wiki&amp;lt;/big&amp;gt; */ Add known issues page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;amp;nbsp;&lt;br /&gt;
= &amp;lt;big&amp;gt;Welcome to the Linux/Xtensa Wiki&amp;lt;/big&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Wiki project provides information about the [http://en.wikipedia.org/wiki/Linux Linux] port to the [http://www.tensilica.com Xtensa processor architecture].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width:45%;height=100%; background:#ffffff;&amp;quot; valign=top|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Getting Started&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Supported Processors]]&lt;br /&gt;
* [[Evaluation Platforms|Evaluation Platforms]]&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Support&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Internet Resources]]&lt;br /&gt;
* [[OpenSource Software|OpenSource Tools and Applications]]&lt;br /&gt;
* [[KnownIssues|Known Kernel Issues and Limitations]]&lt;br /&gt;
|style=&amp;quot;width:10%;height:100%;background:#ffffff;&amp;quot; |&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width:45%;height:100%; background:#ffffff;&amp;quot; valign=top|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Linux from Scratch&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Toolchain and Embedded Distributions]]&lt;br /&gt;
* [[Kernel Build Instructions|Kernel Build Instructions]]&lt;br /&gt;
* [[Boot Loader|Boot Loader]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Developers&#039; Resources&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Platform Porting|Porting the Kernel to a new Platform (Board)]]&lt;br /&gt;
* [[ABI Interface]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;System Developer Information&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[System Software|For Software Developers]]&lt;br /&gt;
* [[System Hardware|For Hardware Developers]]&lt;br /&gt;
&lt;br /&gt;
| colspan=3 |&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=3 |&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;News&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
2008-07-14 Buildroot snapshot 20080711 posted, see download page.&amp;lt;br&amp;gt;&lt;br /&gt;
2008-04-25 Linux Xtensa 2.6.24 tree updated to 2.6.24.4.&amp;lt;br&amp;gt;&lt;br /&gt;
2008-01-23 Initial buildroot snapshot posted, see download page.&amp;lt;br&amp;gt;&lt;br /&gt;
2007-09-05 Moved to a new server.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Old news:&lt;br /&gt;
2007-04-24 Moved content to the public wiki.&amp;lt;br&amp;gt;&lt;br /&gt;
2007-01-16 Started adding content to this site.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;small&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  At this time, new users by default cannot edit any Wiki pages.&lt;br /&gt;
This may change in the future.&lt;br /&gt;
Meanwhile, if you want to edit or contribute anything, try sending an email to the&lt;br /&gt;
[http://lists.linux-xtensa.org/mailman/listinfo/linux-xtensa linux-xtensa mailing list]&lt;br /&gt;
identifying yourself and what you want to contribute.&lt;br /&gt;
&amp;lt;/small&amp;gt;&amp;lt;/i&amp;gt;&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Main_Page&amp;diff=164</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Main_Page&amp;diff=164"/>
		<updated>2008-12-09T21:15:08Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* &amp;lt;big&amp;gt;Welcome to the Linux/Xtensa Wiki&amp;lt;/big&amp;gt; */ Moved ISS to evaluation platforms page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;amp;nbsp;&lt;br /&gt;
= &amp;lt;big&amp;gt;Welcome to the Linux/Xtensa Wiki&amp;lt;/big&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Wiki project provides information about the [http://en.wikipedia.org/wiki/Linux Linux] port to the [http://www.tensilica.com Xtensa processor architecture].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width:45%;height=100%; background:#ffffff;&amp;quot; valign=top|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Getting Started&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Supported Processors]]&lt;br /&gt;
* [[Evaluation Platforms|Evaluation Platforms]]&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Support&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Internet Resources]]&lt;br /&gt;
* [[OpenSource Software|OpenSource Tools and Applications]]&lt;br /&gt;
|style=&amp;quot;width:10%;height:100%;background:#ffffff;&amp;quot; |&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width:45%;height:100%; background:#ffffff;&amp;quot; valign=top|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Linux from Scratch&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Toolchain and Embedded Distributions]]&lt;br /&gt;
* [[Kernel Build Instructions|Kernel Build Instructions]]&lt;br /&gt;
* [[Boot Loader|Boot Loader]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Developers&#039; Resources&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Platform Porting|Porting the Kernel to a new Platform (Board)]]&lt;br /&gt;
* [[ABI Interface]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; ; width:350px; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;System Developer Information&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[System Software|For Software Developers]]&lt;br /&gt;
* [[System Hardware|For Hardware Developers]]&lt;br /&gt;
&lt;br /&gt;
| colspan=3 |&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=3 |&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-top:1em; border-bottom:1px solid #c0c0c0; &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;News&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
2008-07-14 Buildroot snapshot 20080711 posted, see download page.&amp;lt;br&amp;gt;&lt;br /&gt;
2008-04-25 Linux Xtensa 2.6.24 tree updated to 2.6.24.4.&amp;lt;br&amp;gt;&lt;br /&gt;
2008-01-23 Initial buildroot snapshot posted, see download page.&amp;lt;br&amp;gt;&lt;br /&gt;
2007-09-05 Moved to a new server.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Old news:&lt;br /&gt;
2007-04-24 Moved content to the public wiki.&amp;lt;br&amp;gt;&lt;br /&gt;
2007-01-16 Started adding content to this site.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;small&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  At this time, new users by default cannot edit any Wiki pages.&lt;br /&gt;
This may change in the future.&lt;br /&gt;
Meanwhile, if you want to edit or contribute anything, try sending an email to the&lt;br /&gt;
[http://lists.linux-xtensa.org/mailman/listinfo/linux-xtensa linux-xtensa mailing list]&lt;br /&gt;
identifying yourself and what you want to contribute.&lt;br /&gt;
&amp;lt;/small&amp;gt;&amp;lt;/i&amp;gt;&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Evaluation_Platforms&amp;diff=163</id>
		<title>Evaluation Platforms</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Evaluation_Platforms&amp;diff=163"/>
		<updated>2008-12-09T21:13:53Z</updated>

		<summary type="html">&lt;p&gt;Marc: ISS is really another evaluation platform, so move it here, and adjust intro text a bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[image:board.jpg|right]]&lt;br /&gt;
= Evaluation and Prototyping Platforms =&lt;br /&gt;
&lt;br /&gt;
The following boards and simulators can be used for evaluation and prototyping purposes. Evaluation platforms generally fall into one of the following categories:&lt;br /&gt;
* instruction set simulators,&lt;br /&gt;
* emulation systems that use FPGAs to implement any Xtensa or Diamond core (within the capacity of the FPGAs), and&lt;br /&gt;
* boards that integrate a specific configured Xtensa or Diamond core(s) into an ASIC.&lt;br /&gt;
Field programmable gate arrays (FPGA) contain programmable logic that can be re-configured to emulate complex logic. Although slower than the dedicated circuitry of an ASIC (application specific integrated circuit), their re-configurability and practically zero NRE make them very useful for prototyping (for example, trying multiple Xtensa processor variants or configurations) or small volume applications. &lt;br /&gt;
&lt;br /&gt;
== Instruction Set Simulator ==&lt;br /&gt;
&lt;br /&gt;
Instruction Set Simulators (ISS) mimic the behavior of processors by simulating instructions, memory interface, and other I/O components. This allows developers to run and test their software long before real hardware becomes available. Functional simulators provide the best performance, whereas cycle-accurate simulators provide timing accuracy compatible to that of real hardware. The latter simulate the processor pipeline and external components synchronized to a virtual clock. Although this overhead reduces their performance, it can provide vital information to improve the implementation of algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Tensilica ISS ===&lt;br /&gt;
&lt;br /&gt;
[http://www.tensilica.com/ Tensilica] offers a commercial functional simulator (TurboXim) and cycle-accurate simulator for the Xtensa processor architecture, as part of their standard software development tools.  (You may be able to try a free limited time evaluation copy of this toolset.)  Tensilica also offers XTMP and XTSC for modeling systems of one or multiple processors alongside custom functional or cycle-accurate software models for other components.  Please visit [http://www.tensilica.com/ Tensilica&#039;s] website for further information.&lt;br /&gt;
&lt;br /&gt;
The standalone simulator (xt-iss), for example, simply takes an ELF file as its argument and starts simulating instructions from the reset vector. The option &amp;lt;code&amp;gt;--turbo&amp;lt;/code&amp;gt; invokes the (much faster) functional simulator TurboXim.&lt;br /&gt;
&lt;br /&gt;
 xt-iss &#039;&#039;[--turbo]&#039;&#039; Image.elf&lt;br /&gt;
&lt;br /&gt;
== Emulation Platforms and Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Avnet Virtex-4 LX60 and LX200 ===&lt;br /&gt;
&lt;br /&gt;
[http://www.em.avnet.com Avnet] offers the following development platforms for the Xilinx Virtex-4 LX FPGA that can emulate various&lt;br /&gt;
Xtensa processor configurations. The [http://www.em.avnet.com/tensilica1 LX60] is based on the Xilinx 4VLX60 and comes &lt;br /&gt;
with a 10/100 Ethernet PHY, DDR memory, flash memory, serial port, and 2 x 16 character LCD panel. The MAC controller, however, needs to be implemented inside the FPGA. MAC controllers are available from different vendors. [http://opencores.org OpenCores], for example, provides a free Ethernet controller supported by Linux and other operating systems. The [http://www.em.avnet.com/tensilica2 LX200] is based on the Xilinx XC4VLX200 and can emulate more complex processor configurations and extensions (for example the [http://www.tensilica.com/products/hifi_audio.htm HiFi 2 Audio Engine]) and provides the same components as the LX60 except for the LCD panel. &lt;br /&gt;
&lt;br /&gt;
[http://www.tensilica.com Tensilica] provides a bitstream that describes the configuration data to emulate the Diamond Standard DC232L processor (Rev.B) on the LX60 FPGA. Tensilica refers to this board and bitstream combination as the XTAV60 board.  It also includes support for the OpenCores Ethernet MAC. For further information, please, contact [http://www.tensilica.com/company/contact_us.htm Tensilica] directly.&lt;br /&gt;
&lt;br /&gt;
=== Eve ZeBu ===&lt;br /&gt;
&lt;br /&gt;
[http://www.eve-team.com Eve] offers an emulation and verification system that can be used to emulate Xtensa processors. Similar to FPGA boards, the ZeBu system emulates the processor, but has a higher capacity to emulate larger processor configurations and additional peripherals. It also provides direct access to signals for debugging and verification.&lt;br /&gt;
&lt;br /&gt;
See the [[Linux on ZeBu]] page or contact [http://www.eve-team.com Eve] directly to request additional information.&lt;br /&gt;
&lt;br /&gt;
== ASIC Evaluation Platforms ==&lt;br /&gt;
&lt;br /&gt;
=== Stretch S55DVKxx and S56DVKxx ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stretchinc.com Stretch] provides software-configurable processors based on the Xtensa architecture. The S5000 processor supports Linux, and at 300MHz, it runs 5-10 times faster than FPGA based emulation platforms. The S55DVKxx and S56DVKxx development platforms provide 10/100/1000 Ethernet, serial, PCI (only S56DVKxx), and other interfaces.&lt;br /&gt;
&lt;br /&gt;
The Stretch platforms come with RedBoot as the bootloader. It can download and boot the kernel over network using TFTP or from flash. Make sure that RedBoot is configured with a valid Ethernet address or set to DHCP to obtain a valid address. The following commands load the kernel image &#039;&#039;zImage.redboot&#039;&#039; and boot the kernel:&lt;br /&gt;
&lt;br /&gt;
 RedBoot&amp;gt; load -r -b 0xd0200000 -h 192.168.1.5 zImage.redboot&lt;br /&gt;
 RedBoot&amp;gt; exec 0xd0200000&lt;br /&gt;
&lt;br /&gt;
Note that RedBoot requires that the tftp host is in the same subnet as the board.&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Supported_Processors&amp;diff=162</id>
		<title>Supported Processors</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Supported_Processors&amp;diff=162"/>
		<updated>2008-12-09T20:40:45Z</updated>

		<summary type="html">&lt;p&gt;Marc: /* Automatic Support for Custom Xtensa Cores */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Xtensa Processor Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[image:chip.jpg|right]]&lt;br /&gt;
The Xtensa processor architecture is a configurable, extensible, and synthesizable 32-bit RISC processor core. SoC and processor designers can select from a variety of options, such as instruction-set extensions, memory, cache, and interrupt configurations. Moreover, Xtensa processors can be extended with custom-defined instructions and registers, as well as custom port and queue interfaces. All Xtensa processors share a common base instruction set architecture, thereby ensuring compatibility of third party application software and development tools.&lt;br /&gt;
&lt;br /&gt;
Tensilica’s Diamond Standard Series processor family consists of a number of ready-to-use synthesizable cores and is based on the Xtensa processor architecture. The Diamond Standard 232L processor contains an MMU and fully supports running Linux.&lt;br /&gt;
&lt;br /&gt;
== Automatic Support for Custom Xtensa Cores ==&lt;br /&gt;
&lt;br /&gt;
Despite the endless possibilities provided by the configurability and extensibility of the Xtensa architecture, obtaining an open source toolchain and kernel that fully support a specific configured Xtensa core is a straightforward matter.  The process is mostly automated (scripted), avoiding any need to manually port the kernel to a new processor variant as is typical for a fixed processor architecture.  Modifications to toolchain and kernel sources are limited to a small set of configuration files, typically provided by Tensilica in the form of an &#039;&#039;overlay&#039;&#039; to be copied into the sources.  The development tools and kernel are subsequently configured and built as usual.  (Of course, you still have to port Linux to your particular board or platform.)&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel for example, all configuration files are located inside the Xtensa include directory in the kernel sources (&amp;lt;code&amp;gt;include/asm-xtensa/variant-&#039;&#039;config&#039;&#039;&amp;lt;/code&amp;gt;).  Adding support to the kernel&lt;br /&gt;
for a custom configured Xtensa processor generally involves copying the appropriate&lt;br /&gt;
configuration files into the appropriate variant directory.&lt;br /&gt;
See [[Buildroot_Build_Instructions#Install_any_required_processor_specific_overlay|Buildroot Overlay Installation]] for an automated method of installing these files in both toolchain and kernel sources.&lt;br /&gt;
&lt;br /&gt;
== Kernel and Processor Configuration ==&lt;br /&gt;
&lt;br /&gt;
Because the kernel is much closer to the hardware and provides an abstraction for many architectural options, it needs to be configured and compiled for a particular platform and processor configuration. It also requires development tools configured for the particular processor.  Note that a &#039;&#039;processor configuration&#039;&#039; is also often referred to as a &#039;&#039;core variant&#039;&#039;.  The following list shows processors currently supported by the kernel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellspacing=0 cellpadding=3&lt;br /&gt;
|+ Supported processors in the Linux kernel&lt;br /&gt;
|- style=&amp;quot;background:#f8f8f8;&amp;quot;&lt;br /&gt;
! Name !! Byte order !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Custom-configured Xtensa || little or big endian || Vendor specific, requires overlay&lt;br /&gt;
|-&lt;br /&gt;
| Diamond 232L || little or big endian || Rev.A and Rev.B&lt;br /&gt;
|-&lt;br /&gt;
| &#039;FSF&#039; || big endian || Only for verification&lt;br /&gt;
|-&lt;br /&gt;
| Stretch S5000 || little endian || For the S56xx platform&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Supported_Processors&amp;diff=161</id>
		<title>Supported Processors</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Supported_Processors&amp;diff=161"/>
		<updated>2008-12-09T20:37:58Z</updated>

		<summary type="html">&lt;p&gt;Marc: Reorganize, remove obsolete MontaVista specific verbiage, clarify a bit more.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Xtensa Processor Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[image:chip.jpg|right]]&lt;br /&gt;
The Xtensa processor architecture is a configurable, extensible, and synthesizable 32-bit RISC processor core. SoC and processor designers can select from a variety of options, such as instruction-set extensions, memory, cache, and interrupt configurations. Moreover, Xtensa processors can be extended with custom-defined instructions and registers, as well as custom port and queue interfaces. All Xtensa processors share a common base instruction set architecture, thereby ensuring compatibility of third party application software and development tools.&lt;br /&gt;
&lt;br /&gt;
Tensilica’s Diamond Standard Series processor family consists of a number of ready-to-use synthesizable cores and is based on the Xtensa processor architecture. The Diamond Standard 232L processor contains an MMU and fully supports running Linux.&lt;br /&gt;
&lt;br /&gt;
== Automatic Support for Custom Xtensa Cores ==&lt;br /&gt;
&lt;br /&gt;
Despite the endless possibilities provided by the configurability and extensibility of the Xtensa architecture, obtaining an open source toolchain and kernel that fully support a specific configured Xtensa core is a straightforward matter.  The process is mostly automated (scripted), avoiding any need to manually port the kernel to a new processor variant as is typical for a fixed processor architecture.  Modifications to toolchain and kernel sources are limited to a small set of configuration files, typically provided by Tensilica in the form of an &#039;&#039;overlay&#039;&#039; to be copied into the sources.  The development tools and kernel are subsequently configured and built as usual.&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel for example, all configuration files are located inside the Xtensa include directory in the kernel sources (&amp;lt;code&amp;gt;include/asm-xtensa/variant-&#039;&#039;config&#039;&#039;&amp;lt;/code&amp;gt;).  Adding support to the kernel&lt;br /&gt;
for a custom configured Xtensa processor generally involves copying the appropriate&lt;br /&gt;
configuration files into the appropriate variant directory.&lt;br /&gt;
See [[Buildroot_Build_Instructions#Install_any_required_processor_specific_overlay|Buildroot Overlay Installation]] for an automated method of installing these files in both toolchain and kernel sources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel and Processor Configuration ==&lt;br /&gt;
&lt;br /&gt;
Because the kernel is much closer to the hardware and provides an abstraction for many architectural options, it needs to be configured and compiled for a particular platform and processor configuration. It also requires development tools configured for the particular processor.  Note that a &#039;&#039;processor configuration&#039;&#039; is also often referred to as a &#039;&#039;core variant&#039;&#039;.  The following list shows processors currently supported by the kernel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellspacing=0 cellpadding=3&lt;br /&gt;
|+ Supported processors in the Linux kernel&lt;br /&gt;
|- style=&amp;quot;background:#f8f8f8;&amp;quot;&lt;br /&gt;
! Name !! Byte order !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Custom-configured Xtensa || little or big endian || Vendor specific, requires overlay&lt;br /&gt;
|-&lt;br /&gt;
| Diamond 232L || little or big endian || Rev.A and Rev.B&lt;br /&gt;
|-&lt;br /&gt;
| &#039;FSF&#039; || big endian || Only for verification&lt;br /&gt;
|-&lt;br /&gt;
| Stretch S5000 || little endian || For the S56xx platform&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Marc</name></author>
	</entry>
</feed>