<?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=Bwilson</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=Bwilson"/>
	<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Special:Contributions/Bwilson"/>
	<updated>2026-05-05T01:06:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Main_Page&amp;diff=151</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Main_Page&amp;diff=151"/>
		<updated>2008-07-14T22:51:46Z</updated>

		<summary type="html">&lt;p&gt;Bwilson: /* &amp;lt;big&amp;gt;Welcome to the Linux/Xtensa Wiki&amp;lt;/big&amp;gt; */&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;
* [[Instruction Set Simulators|Running Linux in a Simulator]]&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>Bwilson</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=140</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=140"/>
		<updated>2008-06-24T16:49:27Z</updated>

		<summary type="html">&lt;p&gt;Bwilson: Use &amp;quot;Xtensa Tools&amp;quot; instead of &amp;quot;Tensilica Tools&amp;quot;.&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 an x86 machine running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on other 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;
&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;
=== Download buildroot sources ===&lt;br /&gt;
&lt;br /&gt;
Buildroot is used to build the toolchain and root filesystem.&lt;br /&gt;
First setup a work area:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&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.&lt;br /&gt;
The following creates and populates the &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;/buildroot&amp;lt;/tt&amp;gt; directory:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/buildroot/buildroot-xtensa buildroot&lt;br /&gt;
&lt;br /&gt;
=== Download Linux kernel sources ===&lt;br /&gt;
&lt;br /&gt;
First you need to decide which kernel tree to work with.&lt;br /&gt;
(You can also download multiple kernel source trees of course.)&lt;br /&gt;
&lt;br /&gt;
For now this is simple, there is just one active tree.&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 active tree.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;xtensa-2.6.24&amp;lt;/tt&amp;gt; tree is based on the released 2.6.24 kernel&lt;br /&gt;
from &amp;lt;tt&amp;gt;kernel.org&amp;lt;/tt&amp;gt;.&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;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/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;workdir&amp;gt;/&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).  For the purposes of this document, we assume &#039;&#039;&amp;lt;dir&amp;gt;&#039;&#039; is named &amp;lt;tt&amp;gt;linux&amp;lt;/tt&amp;gt;, like this:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/kernel/xtensa-2.6.24 linux&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;
== 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>Bwilson</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=139</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=139"/>
		<updated>2008-06-24T16:45:13Z</updated>

		<summary type="html">&lt;p&gt;Bwilson: Use &amp;quot;Xtensa Tools&amp;quot; instead of &amp;quot;Tensilica Tools&amp;quot; and update current RB release name&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 an x86 machine running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on other Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Tensilica Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&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;
=== Download buildroot sources ===&lt;br /&gt;
&lt;br /&gt;
Buildroot is used to build the toolchain and root filesystem.&lt;br /&gt;
First setup a work area:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&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.&lt;br /&gt;
The following creates and populates the &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;/buildroot&amp;lt;/tt&amp;gt; directory:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/buildroot/buildroot-xtensa buildroot&lt;br /&gt;
&lt;br /&gt;
=== Download Linux kernel sources ===&lt;br /&gt;
&lt;br /&gt;
First you need to decide which kernel tree to work with.&lt;br /&gt;
(You can also download multiple kernel source trees of course.)&lt;br /&gt;
&lt;br /&gt;
For now this is simple, there is just one active tree.&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 active tree.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;xtensa-2.6.24&amp;lt;/tt&amp;gt; tree is based on the released 2.6.24 kernel&lt;br /&gt;
from &amp;lt;tt&amp;gt;kernel.org&amp;lt;/tt&amp;gt;.&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;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/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;workdir&amp;gt;/&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).  For the purposes of this document, we assume &#039;&#039;&amp;lt;dir&amp;gt;&#039;&#039; is named &amp;lt;tt&amp;gt;linux&amp;lt;/tt&amp;gt;, like this:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/kernel/xtensa-2.6.24 linux&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 Tensilica Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to downloading 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 Software Tools.  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 Tensilica Software 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;
Tensilica 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 Tensilica 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;
== 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>Bwilson</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=138</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=138"/>
		<updated>2008-06-24T16:40:17Z</updated>

		<summary type="html">&lt;p&gt;Bwilson: RB-2008.3 has now been released.&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 an x86 machine running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on other Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Tensilica Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&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;
=== Download buildroot sources ===&lt;br /&gt;
&lt;br /&gt;
Buildroot is used to build the toolchain and root filesystem.&lt;br /&gt;
First setup a work area:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&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.&lt;br /&gt;
The following creates and populates the &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;/buildroot&amp;lt;/tt&amp;gt; directory:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/buildroot/buildroot-xtensa buildroot&lt;br /&gt;
&lt;br /&gt;
=== Download Linux kernel sources ===&lt;br /&gt;
&lt;br /&gt;
First you need to decide which kernel tree to work with.&lt;br /&gt;
(You can also download multiple kernel source trees of course.)&lt;br /&gt;
&lt;br /&gt;
For now this is simple, there is just one active tree.&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 active tree.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;xtensa-2.6.24&amp;lt;/tt&amp;gt; tree is based on the released 2.6.24 kernel&lt;br /&gt;
from &amp;lt;tt&amp;gt;kernel.org&amp;lt;/tt&amp;gt;.&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;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/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;workdir&amp;gt;/&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).  For the purposes of this document, we assume &#039;&#039;&amp;lt;dir&amp;gt;&#039;&#039; is named &amp;lt;tt&amp;gt;linux&amp;lt;/tt&amp;gt;, like this:&lt;br /&gt;
&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/kernel/xtensa-2.6.24 linux&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 Tensilica Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to downloading 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 Software Tools.  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 Tensilica Software 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;
Tensilica 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 Tensilica 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;
== 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 release RB-2007.2 of Tensilica 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;
Tensilica 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 Tensilica 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>Bwilson</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Buildroot_Snapshots&amp;diff=121</id>
		<title>Buildroot Snapshots</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Buildroot_Snapshots&amp;diff=121"/>
		<updated>2008-01-24T23:48:23Z</updated>

		<summary type="html">&lt;p&gt;Bwilson: replace subversion- and git-based instructions with a link to the download 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;/div&gt;</summary>
		<author><name>Bwilson</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=118</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=118"/>
		<updated>2008-01-21T22:01:49Z</updated>

		<summary type="html">&lt;p&gt;Bwilson: /* Install any required processor specific overlay */&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 an x86 machine running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on other Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Tensilica Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&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 subversion and git 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;
== Ensure you have all needed packages installed on your system ==&lt;br /&gt;
&lt;br /&gt;
If you are using one of the snapshot releases, you can skip this step.&lt;br /&gt;
If you want to work with the latest development sources, you will need&lt;br /&gt;
Subversion and &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Install the &#039;&#039;Subversion&#039;&#039; source control tools ===&lt;br /&gt;
&lt;br /&gt;
First verify whether you already have Subversion installed.  Try:&lt;br /&gt;
&lt;br /&gt;
   $ svn help&lt;br /&gt;
&lt;br /&gt;
which should output a help page.  If not,&lt;br /&gt;
download and install the [http://subversion.tigris.org/ Subversion]&lt;br /&gt;
source control tools:&lt;br /&gt;
&lt;br /&gt;
   $ sudo yum install subversion&lt;br /&gt;
&lt;br /&gt;
This may install dependent packages (e.g., &#039;apr&#039;, etc).&lt;br /&gt;
&lt;br /&gt;
Documentation for Subversion is available online at http://svnbook.red-bean.com/&lt;br /&gt;
or by typing &amp;lt;code&amp;gt;svn help&amp;lt;/code&amp;gt; at a shell prompt.&lt;br /&gt;
&lt;br /&gt;
=== Download and install the &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; source control tools ===&lt;br /&gt;
&lt;br /&gt;
First determine whether you already have &#039;&#039;git&#039;&#039; installed.  Try:&lt;br /&gt;
&lt;br /&gt;
   $ git&lt;br /&gt;
&lt;br /&gt;
which should output a help page.  If instead &#039;&#039;git&#039;&#039; is not found,&lt;br /&gt;
download and install the &#039;&#039;git&#039;&#039; source control tools.&lt;br /&gt;
&lt;br /&gt;
On FC6, you can just do the following&lt;br /&gt;
(which installs documentation accessible with &amp;lt;code&amp;gt;man git&amp;lt;/code&amp;gt;&lt;br /&gt;
or &amp;lt;code&amp;gt;git help&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
   $ sudo yum install git&lt;br /&gt;
&lt;br /&gt;
On FC3, yum doesn&#039;t know about git, so you have to do something like:&lt;br /&gt;
&lt;br /&gt;
   $ cd /tmp&lt;br /&gt;
   $ lwp-download http://kernel.org/pub/software/scm/git/git-1.5.3.1.tar.bz2&lt;br /&gt;
   $ tar xfj git-1.5.3.1.tar.bz2&lt;br /&gt;
   $ cd git-1.5.3.1&lt;br /&gt;
   $ make prefix=/usr/local all&lt;br /&gt;
   $ sudo make prefix=/usr/local install&lt;br /&gt;
&lt;br /&gt;
and make sure &amp;lt;code&amp;gt;/usr/local/bin&amp;lt;/code&amp;gt; is in your PATH.&lt;br /&gt;
This doesn&#039;t install git documentation.  For that, you have&lt;br /&gt;
to build &#039;&#039;doc&#039;&#039; and &#039;&#039;info&#039;&#039; make targets, which require first&lt;br /&gt;
installing other packages such as &#039;&#039;asciidoc&#039;&#039; and others.&lt;br /&gt;
However, for this example, documentation is not necessary.&lt;br /&gt;
You can find online docs such as a&lt;br /&gt;
[http://www.kernel.org/pub/software/scm/git/docs/tutorial.html tutorial]&lt;br /&gt;
and [http://www.kernel.org/pub/software/scm/git/docs/ manual pages].&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;
=== Download buildroot sources ===&lt;br /&gt;
&lt;br /&gt;
Buildroot is used to build the toolchain and root filesystem.&lt;br /&gt;
First setup a work area:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&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.&lt;br /&gt;
The following creates and populates the &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;/buildroot&amp;lt;/tt&amp;gt; directory:&lt;br /&gt;
&lt;br /&gt;
   $ svn co svn://linux-xtensa.org/var/svn/repos/buildroot/trunk buildroot&lt;br /&gt;
&lt;br /&gt;
=== Download Linux kernel sources ===&lt;br /&gt;
&lt;br /&gt;
First you need to decide which kernel tree to work with.&lt;br /&gt;
(You can also download multiple kernel source trees of course.)&lt;br /&gt;
&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 most current.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;xtensa-2.6.24&amp;lt;/tt&amp;gt; tree is based on the release candidate 2.6.24-rc&#039;&#039;n&#039;&#039; kernel&lt;br /&gt;
from &amp;lt;tt&amp;gt;kernel.org&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;xtensa-devel&amp;lt;/tt&amp;gt; tree contains the most recent changes but is not as stable.&lt;br /&gt;
It also gets updated semi-regularly with the very latest Linux kernel tree from &amp;lt;tt&amp;gt;kernel.org&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The &amp;lt;tt&amp;gt;xtensa-devel&amp;lt;/tt&amp;gt; tree is about to be recreated from scratch; if you&lt;br /&gt;
have previously cloned this tree, you will have to clone it again once this happens to&lt;br /&gt;
avoid confusing git when pulling (from what would be a mismatching tree).&lt;br /&gt;
&lt;br /&gt;
To get the stable tree into directory &amp;lt;dir&amp;gt; (which must not already exist):&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/kernel/xtensa-2.6.24 &amp;lt;dir&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates and populates the &amp;lt;workdir&amp;gt;/&amp;lt;dir&amp;gt; directory.  If &amp;lt;dir&amp;gt; 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).  For the purposes of this document, we assume &amp;lt;dir&amp;gt; is named &amp;lt;tt&amp;gt;linux&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Similarly, to get the development tree:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/kernel/xtensa-devel &amp;lt;dir&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the latter &amp;lt;tt&amp;gt;xtensa-devel&amp;lt;/tt&amp;gt; tree currently contains two branches:&lt;br /&gt;
&#039;&#039;&#039;master&#039;&#039;&#039; (the default branch checked out by the clone command above),&lt;br /&gt;
and &#039;&#039;&#039;testing&#039;&#039;&#039;.&lt;br /&gt;
&#039;&#039;Note: more branches will be added when the tree is recreated.&#039;&#039;&lt;br /&gt;
Often, development&lt;br /&gt;
checkins are made to the &#039;&#039;&#039;testing&#039;&#039;&#039; branch before getting repackaged&lt;br /&gt;
and integrated over to the &#039;&#039;&#039;master&#039;&#039;&#039; branch some time later.&lt;br /&gt;
You can switch to another branch (within the cloned repository)&lt;br /&gt;
using the &amp;lt;tt&amp;gt;git-checkout&amp;lt;/tt&amp;gt; command, for example:&lt;br /&gt;
&lt;br /&gt;
   $ git checkout testing&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.1&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;/xtensa-elf/src/linux/misc/linux-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.  Until this release&lt;br /&gt;
becomes available (sometime in early 2008), the overlay tarball can be obtained&lt;br /&gt;
by providing Tensilica customer support with your processor configuration&lt;br /&gt;
and TIE (such as, .xcf and .tdb files); they should be able to generate it&lt;br /&gt;
for active customers.&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-linux-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;
Note:  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;
Note:  You need the TERM environment variable properly set for curses&lt;br /&gt;
based tools to work.&lt;br /&gt;
&lt;br /&gt;
The first time you configure buildroot, start with defaults for Xtensa processors:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;/buildroot&lt;br /&gt;
   $ cp target/xtensa/defconfig .config&lt;br /&gt;
   $ make menuconfig&lt;br /&gt;
&lt;br /&gt;
You should get a curses interface for configuring buildroot.&lt;br /&gt;
Make the following changes:&lt;br /&gt;
&lt;br /&gt;
* Change &#039;&#039;&#039;Target Architecture Variant&#039;&#039;&#039; to desired Xtensa or Diamond core (e.g., &#039;&#039;&#039;dc232b&#039;&#039;&#039;)&lt;br /&gt;
* Make any other desired changes (e.g., selecting additional packages)&lt;br /&gt;
* Exit and save the configuration&lt;br /&gt;
&lt;br /&gt;
If later you want to change the buildroot configuration without losing&lt;br /&gt;
other changes made so far, just use &#039;&#039;make menuconfig&#039;&#039; by itself:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;/buildroot&lt;br /&gt;
   $ make menuconfig&lt;br /&gt;
&lt;br /&gt;
=== Configure uClibc ===&lt;br /&gt;
&lt;br /&gt;
Apply the default uClibc configuration for Xtensa processors:&lt;br /&gt;
&lt;br /&gt;
   $ make uclibc-config&lt;br /&gt;
&lt;br /&gt;
To further customize uClibc, you can then optionally configure it like this:&lt;br /&gt;
&lt;br /&gt;
   $ make uclibc-menuconfig&lt;br /&gt;
&lt;br /&gt;
=== Build buildroot ===&lt;br /&gt;
&lt;br /&gt;
   $ make&lt;br /&gt;
&lt;br /&gt;
THIS WILL TAKE A LONG TIME (from 20 minutes to perhaps an hour or many,&lt;br /&gt;
depending on your system and on whether you enabled extra packages in&lt;br /&gt;
your buildroot configuration).&lt;br /&gt;
&lt;br /&gt;
Wait patiently for 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 does not check many dependencies, so it will usually NOT rebuild things that depend on whatever you have fixed.  Here&#039;s one possible sequence to retry the make 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 svn checkout.&lt;br /&gt;
&lt;br /&gt;
  $ rm -rf *build_xtensa* binaries&lt;br /&gt;
  $ make uclibc-config&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
It should not be necessary to empty the &#039;dl&#039; subdirectory, which contains tarballs downloaded from the Internet, or the .config file, which contains the buildroot configuration.  Customizations to the uClibc configuration should have ended up getting saved in target/xtensa/uClibc.config , 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  || 34091&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 Tensilica Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to downloading 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 Software Tools.  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 Tensilica Software 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;
Tensilica 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 Tensilica 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;
== 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 release RB-2007.2 of Tensilica 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;
Tensilica 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 Tensilica 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>Bwilson</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=114</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=114"/>
		<updated>2008-01-16T19:59:55Z</updated>

		<summary type="html">&lt;p&gt;Bwilson: &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 an x86 machine running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on other Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Tensilica Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&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 subversion and git 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;
== Ensure you have all needed packages installed on your system ==&lt;br /&gt;
&lt;br /&gt;
If you are using one of the snapshot releases, you can skip this step.&lt;br /&gt;
If you want to work with the latest development sources, you will need&lt;br /&gt;
Subversion and &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Install the &#039;&#039;Subversion&#039;&#039; source control tools ===&lt;br /&gt;
&lt;br /&gt;
First verify whether you already have Subversion installed.  Try:&lt;br /&gt;
&lt;br /&gt;
   $ svn help&lt;br /&gt;
&lt;br /&gt;
which should output a help page.  If not,&lt;br /&gt;
download and install the [http://subversion.tigris.org/ Subversion]&lt;br /&gt;
source control tools:&lt;br /&gt;
&lt;br /&gt;
   $ sudo yum install subversion&lt;br /&gt;
&lt;br /&gt;
This may install dependent packages (e.g., &#039;apr&#039;, etc).&lt;br /&gt;
&lt;br /&gt;
Documentation for Subversion is available online at http://svnbook.red-bean.com/&lt;br /&gt;
or by typing &amp;lt;code&amp;gt;svn help&amp;lt;/code&amp;gt; at a shell prompt.&lt;br /&gt;
&lt;br /&gt;
=== Download and install the &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; source control tools ===&lt;br /&gt;
&lt;br /&gt;
First determine whether you already have &#039;&#039;git&#039;&#039; installed.  Try:&lt;br /&gt;
&lt;br /&gt;
   $ git&lt;br /&gt;
&lt;br /&gt;
which should output a help page.  If instead &#039;&#039;git&#039;&#039; is not found,&lt;br /&gt;
download and install the &#039;&#039;git&#039;&#039; source control tools.&lt;br /&gt;
&lt;br /&gt;
On FC6, you can just do the following&lt;br /&gt;
(which installs documentation accessible with &amp;lt;code&amp;gt;man git&amp;lt;/code&amp;gt;&lt;br /&gt;
or &amp;lt;code&amp;gt;git help&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
   $ sudo yum install git&lt;br /&gt;
&lt;br /&gt;
On FC3, yum doesn&#039;t know about git, so you have to do something like:&lt;br /&gt;
&lt;br /&gt;
   $ cd /tmp&lt;br /&gt;
   $ lwp-download http://kernel.org/pub/software/scm/git/git-1.5.3.1.tar.bz2&lt;br /&gt;
   $ tar xfj git-1.5.3.1.tar.bz2&lt;br /&gt;
   $ cd git-1.5.3.1&lt;br /&gt;
   $ make prefix=/usr/local all&lt;br /&gt;
   $ sudo make prefix=/usr/local install&lt;br /&gt;
&lt;br /&gt;
and make sure &amp;lt;code&amp;gt;/usr/local/bin&amp;lt;/code&amp;gt; is in your PATH.&lt;br /&gt;
This doesn&#039;t install git documentation.  For that, you have&lt;br /&gt;
to build &#039;&#039;doc&#039;&#039; and &#039;&#039;info&#039;&#039; make targets, which require first&lt;br /&gt;
installing other packages such as &#039;&#039;asciidoc&#039;&#039; and others.&lt;br /&gt;
However, for this example, documentation is not necessary.&lt;br /&gt;
You can find online docs such as a&lt;br /&gt;
[http://www.kernel.org/pub/software/scm/git/docs/tutorial.html tutorial]&lt;br /&gt;
and [http://www.kernel.org/pub/software/scm/git/docs/ manual pages].&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.  Skip this step if&lt;br /&gt;
you are using one of the snapshot releases.&lt;br /&gt;
&lt;br /&gt;
=== Download buildroot sources ===&lt;br /&gt;
&lt;br /&gt;
Buildroot is used to build the toolchain and root filesystem.&lt;br /&gt;
First setup a work area:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&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.&lt;br /&gt;
The following creates and populates the &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;/buildroot&amp;lt;/tt&amp;gt; directory:&lt;br /&gt;
&lt;br /&gt;
   $ svn co svn://linux-xtensa.org/var/svn/repos/buildroot/trunk buildroot&lt;br /&gt;
&lt;br /&gt;
=== Download Linux kernel sources ===&lt;br /&gt;
&lt;br /&gt;
First you need to decide which kernel tree to work with.&lt;br /&gt;
(You can also download multiple kernel source trees of course.)&lt;br /&gt;
&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 most current.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;xtensa-2.6.24&amp;lt;/tt&amp;gt; tree is based on the release candidate 2.6.24-rc&#039;&#039;n&#039;&#039; kernel&lt;br /&gt;
from &amp;lt;tt&amp;gt;kernel.org&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;xtensa-devel&amp;lt;/tt&amp;gt; tree contains the most recent changes but is not as stable.&lt;br /&gt;
It also gets updated semi-regularly with the very latest Linux kernel tree from &amp;lt;tt&amp;gt;kernel.org&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The &amp;lt;tt&amp;gt;xtensa-devel&amp;lt;/tt&amp;gt; tree is about to be recreated from scratch; if you&lt;br /&gt;
have previously cloned this tree, you will have to clone it again once this happens to&lt;br /&gt;
avoid confusing git when pulling (from what would be a mismatching tree).&lt;br /&gt;
&lt;br /&gt;
To get the stable tree into directory &amp;lt;dir&amp;gt; (which must not already exist):&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/kernel/xtensa-2.6.24 &amp;lt;dir&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates and populates the &amp;lt;workdir&amp;gt;/&amp;lt;dir&amp;gt; directory.  If &amp;lt;dir&amp;gt; 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).  For the purposes of this document, we assume &amp;lt;dir&amp;gt; is named &amp;lt;tt&amp;gt;linux&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Similarly, to get the development tree:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;&lt;br /&gt;
   $ git clone git://git.linux-xtensa.org/kernel/xtensa-devel &amp;lt;dir&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the latter &amp;lt;tt&amp;gt;xtensa-devel&amp;lt;/tt&amp;gt; tree currently contains two branches:&lt;br /&gt;
&#039;&#039;&#039;master&#039;&#039;&#039; (the default branch checked out by the clone command above),&lt;br /&gt;
and &#039;&#039;&#039;testing&#039;&#039;&#039;.&lt;br /&gt;
&#039;&#039;Note: more branches will be added when the tree is recreated.&#039;&#039;&lt;br /&gt;
Often, development&lt;br /&gt;
checkins are made to the &#039;&#039;&#039;testing&#039;&#039;&#039; branch before getting repackaged&lt;br /&gt;
and integrated over to the &#039;&#039;&#039;master&#039;&#039;&#039; branch some time later.&lt;br /&gt;
You can switch to another branch (within the cloned repository)&lt;br /&gt;
using the &amp;lt;tt&amp;gt;git-checkout&amp;lt;/tt&amp;gt; command, for example:&lt;br /&gt;
&lt;br /&gt;
   $ git checkout testing&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.1&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;/xtensa-elf/src/linux/misc/linux-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 , 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.  Until this release&lt;br /&gt;
becomes available (sometime in early 2008), the overlay tarball can be obtained&lt;br /&gt;
by providing Tensilica customer support with your processor configuration&lt;br /&gt;
and TIE (such as, .xcf and .tdb files); they should be able to generate it&lt;br /&gt;
for active customers.&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-linux-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;
&lt;br /&gt;
== Build a toolchain and root filesystem using buildroot ==&lt;br /&gt;
&lt;br /&gt;
Note:  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;
Note:  You need the TERM environment variable properly set for curses&lt;br /&gt;
based tools to work.&lt;br /&gt;
&lt;br /&gt;
The first time you configure buildroot, start with defaults for Xtensa processors:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;/buildroot&lt;br /&gt;
   $ cp target/xtensa/defconfig .config&lt;br /&gt;
   $ make menuconfig&lt;br /&gt;
&lt;br /&gt;
You should get a curses interface for configuring buildroot.&lt;br /&gt;
Make the following changes:&lt;br /&gt;
&lt;br /&gt;
* Change &#039;&#039;&#039;Target Architecture Variant&#039;&#039;&#039; to desired Xtensa or Diamond core (e.g., &#039;&#039;&#039;dc232b&#039;&#039;&#039;)&lt;br /&gt;
* Make any other desired changes (e.g., selecting additional packages)&lt;br /&gt;
* Exit and save the configuration&lt;br /&gt;
&lt;br /&gt;
If later you want to change the buildroot configuration without losing&lt;br /&gt;
other changes made so far, just use &#039;&#039;make menuconfig&#039;&#039; by itself:&lt;br /&gt;
&lt;br /&gt;
   $ cd &amp;lt;workdir&amp;gt;/buildroot&lt;br /&gt;
   $ make menuconfig&lt;br /&gt;
&lt;br /&gt;
=== Configure uClibc ===&lt;br /&gt;
&lt;br /&gt;
Apply the default uClibc configuration for Xtensa processors:&lt;br /&gt;
&lt;br /&gt;
   $ make uclibc-config&lt;br /&gt;
&lt;br /&gt;
To further customize uClibc, you can then optionally configure it like this:&lt;br /&gt;
&lt;br /&gt;
   $ make uclibc-menuconfig&lt;br /&gt;
&lt;br /&gt;
=== Build buildroot ===&lt;br /&gt;
&lt;br /&gt;
   $ make&lt;br /&gt;
&lt;br /&gt;
THIS WILL TAKE A LONG TIME (from 20 minutes to perhaps an hour or many,&lt;br /&gt;
depending on your system and on whether you enabled extra packages in&lt;br /&gt;
your buildroot configuration).&lt;br /&gt;
&lt;br /&gt;
Wait patiently for 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 does not check many dependencies, so it will usually NOT rebuild things that depend on whatever you have fixed.  Here&#039;s one possible sequence to retry the make 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 svn checkout.&lt;br /&gt;
&lt;br /&gt;
  $ rm -rf *build_xtensa* binaries&lt;br /&gt;
  $ make uclibc-config&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
It should not be necessary to empty the &#039;dl&#039; subdirectory, which contains tarballs downloaded from the Internet, or the .config file, which contains the buildroot configuration.  Customizations to the uClibc configuration should have ended up getting saved in target/xtensa/uClibc.config , 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;
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 with the 232L (or selected) core ===&lt;br /&gt;
&lt;br /&gt;
This can be done a a different machine than the one used so far,&lt;br /&gt;
as long as it has access to the &amp;lt;workdir&amp;gt; directory tree.&lt;br /&gt;
&lt;br /&gt;
For this example, Xtensa Tools are only needed for downloading&lt;br /&gt;
the kernel over OCD using &amp;lt;code&amp;gt;xt-gdb&amp;lt;/code&amp;gt;.&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 Tensilica 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;
== 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 release RB-2007.2 of Tensilica 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;
Tensilica 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 Tensilica 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>Bwilson</name></author>
	</entry>
</feed>