<?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=Piet</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=Piet"/>
	<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Special:Contributions/Piet"/>
	<updated>2026-05-04T23:57:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=583</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=583"/>
		<updated>2012-03-21T05:52:16Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* Configuring U-Boot to Boot Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress, though virtually complete. Just needs to have an a another engineer at Tensilica run through this procedure and make sure that we haven&#039;t missed anything.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5 and Fedora Core 9. Test done while using the Fedora 9 based kernel and the stable branch of the Xtensa kernel appear, so far, to be a bit better. Not seeing any compile errors while stressing the system with LTP, two compiles, two mplayers, hifitest, top, pstree, and top for the&lt;br /&gt;
first 18 hours; appears to be running perfect till then. No gcc commands or ssh sessions getting killed until almost a day of testing. Only the Unaligned memory access warning on gethostid01 that a staff engineer diagnosed as being a mistake in the gethostid01 LTP test program. &lt;br /&gt;
&lt;br /&gt;
* NOTE for Internal Tensilica pre-release Testers:&lt;br /&gt;
** Codecs available at /fac/vol6/audio/release/bin/l32r_LE5_pic.&lt;br /&gt;
** LX200 bitstream available at /home/marc/XTAV200/test_mmuhifi_c3.3core.&lt;br /&gt;
** Instructions to install and set up U-Boot available at http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot. &lt;br /&gt;
*** Checkout the snapshot_2+SMP branch of the U-Boot git repo for pre-built binaries.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot pre-installed, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development just before booting.&lt;br /&gt;
&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
* Suggest how to add their code to buildroot and come up again with their same development environment.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039; &lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039; &lt;br /&gt;
                                &lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                        &lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                  &lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                     &lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 &lt;br /&gt;
                origin/snapshot_2+SMP                                                         &lt;br /&gt;
          [Create]                                                                            &lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                    &lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currently our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz         [NOTE: TO BE UPDATED]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp.git&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                               [NOTE: The snapshot_2+SMP-stable so far appears to be a bit better]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
There is also a more up-to-date branch named &#039;&#039;&#039;snapshot_2+SMP-stable&#039;&#039;&#039; that has more recent kernel bug-fixes from kernel.org &lt;br /&gt;
but it hasn&#039;t been tested as extensively but so far may be show to be a bit more stable than the well tested snapshot_2+SMP branch &lt;br /&gt;
when memory gets tight under very heavy loads. This preconfigured 3-core HiFi2 branch has a few NFS bug fixes but nothing that immediately appears to have been a&lt;br /&gt;
problem in this environment. Test up to now appear to be a bit better under heavy memory congestion. If you want to use this branch use the following git commands:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP-stable origin/snapshot_2+SMP-stable&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP-stable&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
As in the build root case, you can also checkout the branch easily from via &#039;&#039;&#039;git gui&#039;&#039;&#039; using the same procedure&lt;br /&gt;
mentioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;          [Note: You may have to make dir /tftpboot]&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recommend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ln -s /var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                                 [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;     [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
      $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root file-system over NFS.&lt;br /&gt;
This file system was built using buildroot into a compressed cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio.gz&lt;br /&gt;
&lt;br /&gt;
We will also be adding two additional small files-systems to make your development environment more comfortable&lt;br /&gt;
and less time consuming to get started:&lt;br /&gt;
&lt;br /&gt;
    /usr/default                                                                    [Home Directory for user &#039;default&#039;]&lt;br /&gt;
    /usr/local                                                                      [File system to place enhancements not done by buildroot]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your boards file-systems and unpack the cpio and tar files.&lt;br /&gt;
For example here we will export three files-systems in /export:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;/exports/hifi-2_home_default&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;/exports/hifi-2_usr_local&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s and example of unpacking the three files-systems:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039; [Getting binary files in buildroot git repository]&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip rootfs.xtensa_test_mmuhifi_c3.cpio.gz&#039;&#039;&#039;                            [Uncompressing file-system cpio file]&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip hifi-2_home_default.tar.gz&#039;&#039;&#039;                                       [Uncompress /home/default tar ball]&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip hifi-2_usr_local.tar.gz&#039;&#039;&#039;                                          [Uncompress /usr/local tar ball]&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf hifi-2_home_default.tar&#039;&#039;&#039;                                          [Tar in boards /home/default for export]&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf hifi-2_usr_local.tar&#039;&#039;&#039;                                             [Tar in boards /usr/local for export]&lt;br /&gt;
&lt;br /&gt;
Next add two lines to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)                     [Boards File-systems]&lt;br /&gt;
    /export                 *(rw,no_root_squash,sync,no_wdelay)                     [Buildroot source code]&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file systems now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /export  *&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
If it fails to boot U-Boot or you happen to have a board without it there are instructions&lt;br /&gt;
at http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot to make it easy to install.&lt;br /&gt;
&lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
When you initially power on your LX200 board it will come with a very long wait period before booting and will be waiting to be configured.&lt;br /&gt;
You can also hit one of the blue buttons next to the blue LED that&#039;s next to the PCI connector to reset the board. &lt;br /&gt;
&lt;br /&gt;
The minicom session should look like the following:&lt;br /&gt;
&lt;br /&gt;
    U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:07&lt;br /&gt;
    IP:     192.168.11.105&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    Autobooting in 999999 seconds, press &amp;lt;SPACE&amp;gt; to stop &#039;&#039;&#039;&amp;lt;SPACE&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;printenv&#039;&#039;&#039;&lt;br /&gt;
    baudrate=38400&lt;br /&gt;
    ethaddr=00:50:C2:13:6f:07&lt;br /&gt;
    ethact=open_ethernet&lt;br /&gt;
    serverip=192.168.11.55&lt;br /&gt;
    nfsroot_server=192.168.11.55&lt;br /&gt;
    root-path=/exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    bootargs_using_bootp=console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&lt;br /&gt;
    bootcmd=tftpboot; bootm&lt;br /&gt;
    netmask=255.255.255.0&lt;br /&gt;
    gatewayip=192.168.11.1&lt;br /&gt;
    nfs_boot_args=root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    bootfile=uImage.xtensa-2.6.29-smp.test_mmuhifi_c3-stable&lt;br /&gt;
    autostart=no&lt;br /&gt;
    bootdelay=999999&lt;br /&gt;
    ipaddr=192.168.11.105&lt;br /&gt;
    misc_boot_args=debug coredump_filter=0xff&lt;br /&gt;
    hostname=HiFi-2&lt;br /&gt;
    nfsaddrs=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:HiFi-2&lt;br /&gt;
    bootargs=console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:HiFi-2 root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&lt;br /&gt;
    stdin=serial&lt;br /&gt;
    stdout=serial&lt;br /&gt;
    stderr=serial&lt;br /&gt;
    ver=U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
     &lt;br /&gt;
    Environment size: 788/131068 bytes&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to configure U-Boot to automatically boot the Linux kernel on power-up (using the root file system exported over NFS as described further above).&lt;br /&gt;
You need to configure UBoot with the IP addresses that are practical in your environment. When using BOOTP or DHCP many of the IP addresses are in the DHCP&lt;br /&gt;
config file. Here we first present the simple case where all of the addresses are provided in the U-Boot environment variables:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip        192.168.11.55&#039;&#039;&#039;                                                         [TFTP server IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server  192.168.11.55&#039;&#039;&#039;                                                         [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr          192.168.11.105&#039;&#039;&#039;                                                        [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv netmask         255.255.255.0&#039;&#039;&#039;                                                         [Network Mask for a Internet Class C local network]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv gatewayip       192.168.11.1&#039;&#039;&#039;                                                          [Gateway address for default route]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile        uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                              [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path       /export2/DC_B_330HiFi_3Core_MMU/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                     [Location of root filesystem on NFS Server; Limit ~50 bytes]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfs_boot_args   root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;               [NFS Args used in bootargs]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv hostname        HiFi-2_NFS_Based&#039;&#039;&#039;                                                      [Hostname]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsaddrs        ${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;       [IP addresses needed by NFS when not using DHCP or BOOTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv misc_boot_args  debug coredump_filter=0xff&#039;&#039;&#039;                                            [Enable kernel debug messages and core files on a SEGV sig] &lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs        console=ttyS0,38400 ip=${nfsaddrs} ${nfs_boot_args} ${misc_boot_args}&#039;&#039;&#039; [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd         tftpboot\; bootm&#039;&#039;&#039;                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay       5&#039;&#039;&#039;                                                                     [Delay 5 seconds before booting automatically]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart       yes&#039;&#039;&#039;                                                                   [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you don&#039;t feel like setting up an NFS exports you can could use a root filesystem simply located in the kernel RAM.&lt;br /&gt;
In this case only TFTP will be used on the local Ethernet to load the kernel. This could be set up with these commands:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip        192.168.11.55&#039;&#039;&#039;                                                           [TFTP server IP Address: My Workstation] &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr          192.168.11.105&#039;&#039;&#039;                                                          [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv netmask         255.255.255.0&#039;&#039;&#039;                                                           [Network Mask for a Internet Class C local network]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv gatewayip       192.168.11.1&#039;&#039;&#039;                                                            [Gateway address for default route]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile        uImage.xtensa-2.6.29-smp.test_mmuhifi_c3.ramfs&#039;&#039;&#039;                          [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path       /export2/DC_B_330HiFi_3Core_MMU/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                       [Location of root filesystem on NFS Server; Limit ~50 bytes]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ramfs_boot_args root=/dev/ramfs&#039;&#039;&#039;                                                         [RAMFS Args used in bootargs]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv hostname        HiFi-2_RamFS_Based&#039;&#039;&#039;                                                      [Hostname]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsaddrs        ${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;         [IP addresses needed by NFS when not using DHCP or BOOTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv misc_boot_args  debug coredump_filter=0xff&#039;&#039;&#039;                                              [Enable kernel debug messages and core files on a SEGV sig] &lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs        console=ttyS0,38400 ip=${nfsaddrs} ${ramfs_boot_args} ${misc_boot_args}&#039;&#039;&#039; [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd         tftpboot\; bootm&#039;&#039;&#039;                                                        [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay       5&#039;&#039;&#039;                                                                       [Delay 5 seconds before booting automatically]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart       yes&#039;&#039;&#039;                                                                     [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can also set up your dhcp server with your domain information and boot with much less information&lt;br /&gt;
and it&#039;s no longer necessary to edit the targets /etc/resolve.conf with your domain server information:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;       [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=dhcp  root=nfs coredump_filter=0xff&#039;&#039;&#039;       [Args passed to Linux while booting with DHCP  proto]&lt;br /&gt;
&lt;br /&gt;
If you want to boot with bootp or dhcp you may want your /etc/dhcp.conf file to look something like this:&lt;br /&gt;
&lt;br /&gt;
    allow bootp;&lt;br /&gt;
    boot-unknown-clients off;&lt;br /&gt;
    ignore unknown-clients;&lt;br /&gt;
    not authoritative;&lt;br /&gt;
    ddns-update-style ad-hoc;&lt;br /&gt;
     &lt;br /&gt;
    option domain-name &amp;quot;hq.tensilica.com&amp;quot;;&lt;br /&gt;
     &lt;br /&gt;
    subnet 192.168.11.0 netmask 255.255.255.0 {&lt;br /&gt;
        default-lease-time 2592000;     # 30 days&lt;br /&gt;
        max-lease-time 31557600;        # 1 year&lt;br /&gt;
        next-server = option dhcp-server-identifier;&lt;br /&gt;
        option routers 192.168.11.1;&lt;br /&gt;
        group {&lt;br /&gt;
                use-host-decl-names on;&lt;br /&gt;
                    ##&lt;br /&gt;
                    ## RTOS13   192.168.11.105: HelloSoft LX200 SMP Board on Piet&#039;s Desk&lt;br /&gt;
                    ##              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0F&lt;br /&gt;
                    ##              Little Endian:       1 1 1 1 0 0 * *&lt;br /&gt;
                    ##          Running HiFi-2&lt;br /&gt;
                    ##&lt;br /&gt;
                    ## hifi2.hq.tensilica.com:192.168.11.105::0x9b0ba8c0&lt;br /&gt;
     &lt;br /&gt;
                    host hifi2 {&lt;br /&gt;
                        hardware ethernet 00:50:c2:13:6f:07;&lt;br /&gt;
                        fixed-address hifi2.hq.tensilica.com;&lt;br /&gt;
                        next-server pdelaney_fc5.hq.tensilica.com;&lt;br /&gt;
                            option root-path &amp;quot;/exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
                        option domain-name &amp;quot;hq.tensilica.com&amp;quot;;&lt;br /&gt;
                        option domain-name-servers 192.168.15.20,192.168.15.21;&lt;br /&gt;
                    }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
For more information on setting up the Linux Kernel boot parameters see the http://www.linuxdocs.org/HOWTOs/BootPrompt-HOWTO-3.html webpage.&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks we mentioned that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we are suggesting to mounting /home/default and /usr/local files-systems which have&lt;br /&gt;
a number of files useful for getting started.  &lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export/hifi-2_home_default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
    drwxrwxrwx   12 root     root         4096 Dec  1 23:33 Audio_Tests/&lt;br /&gt;
    drwxr-xr-x    2 default  default      4096 Oct 28 17:46 Files/&lt;br /&gt;
    drwxr-xr-x    6 root     root         4096 Dec  2 02:46 LTP_Test/&lt;br /&gt;
    drwxr-xr-x    2 root     root         4096 Nov 20 15:13 Music/&lt;br /&gt;
    -rw-r--r--    1 10415    10000         841 Nov 20 01:18 SSH_Keys&lt;br /&gt;
    drwxr-xr-x    2 root     root         4096 Nov 13 12:14 Tests/&lt;br /&gt;
    drwxr-xr-x    2 10415    10000        4096 Nov 19 23:23 hifitest/&lt;br /&gt;
    drwxr-xr-x    5 root     root         4096 Dec  2 05:33 mplayer_packages/&lt;br /&gt;
    -rwxr-xr-x    1 10415    10000         544 Dec  2 03:01 save_root_files*&lt;br /&gt;
    -rw-r--r--    1 root     root        37888 Dec  2 03:13 saved_root_files.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball in the /home/default file system called &#039;&#039;&#039;saved_root_files.tar&#039;&#039;&#039;. &lt;br /&gt;
This is a tar file of files that developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                           [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                  [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                    [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                          [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                              [Your locations of DNS servers; used when your not using DHCP to boot the kernel]&lt;br /&gt;
                                                 [NOTE: restore symlink  /etc/resolv.conf -&amp;gt; /proc/net/pnp if using DHCP]&lt;br /&gt;
    etc/TZ                                       [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key           [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key           [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                               [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                         [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                     [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                              [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                   [Changed root and default user&#039;s shell to bash; runs std bash RC files to set ulimits; adds /usr/local/bin to search path]&lt;br /&gt;
    etc/shadow                                   [Changed default and root users login password to &#039;linux1&#039;, needed to ssh to the board]&lt;br /&gt;
    exports/                                     [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    usr/local                                    [Makes /usr/local so it can be mounted on; it has local additions, including /usr/local/src]&lt;br /&gt;
    codecs                                       [Makes /codecs for a NFS partition with Tensilica HiFi-2 Codecs to be mounted; the file-system should contain ...&lt;br /&gt;
                                                  ... /codecs/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&lt;br /&gt;
                                                  ... /codecs/xa_hifi2_l32r_LE5_pic_aacplus_v2_dec_lib_2_2_api_1_15_lib.tgz ]&lt;br /&gt;
     &lt;br /&gt;
Now lets assume your going to stay with mosts of these changes and modify a few of them after tar&#039;ing in these changes to the root file-system.&lt;br /&gt;
So here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/hifi-2_home_default/saved_root_files.tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system before booting it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/resolv.conf&#039;&#039;&#039;                   [Place your domain information if not using a DHCP boot]&lt;br /&gt;
                                                 [Restore symlink resolv.conf -&amp;gt; /proc/net/pnp if using DHCP]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                         [Change fstab entry for boards root filesystem, and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;               [You might want to disable mounting of non-root NFS file systems ...&lt;br /&gt;
                                                  ... on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing for HiFi 2 ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailoring your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful and provided in the &#039;&#039;&#039;saved_root_files&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
   1. Added a root password to that you can login with ssh.&lt;br /&gt;
   2. Running rdate with an ntp server on booting.&lt;br /&gt;
   3. Adding NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-in build environment from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
   6. Mounting Tensilica HiFi-2 Codecs to easily get mplayer working with HiFi-2 TIE instructions.&lt;br /&gt;
&lt;br /&gt;
== Building Linux Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Host ===&lt;br /&gt;
&lt;br /&gt;
You can use the open source toolchain included in the buildroot tree.&lt;br /&gt;
&lt;br /&gt;
Given the location of the buildroot tree and the name of the core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;setenv BUILDROOT_DIR  /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;setenv CORENAME       test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can either set the PATH and invoke tools prefixed with &amp;lt;tt&amp;gt;xtensa_${CORENAME}-linux-&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;setenv PATH   ${BUILDROOT_DIR}/build_xtensa_${CORENAME}/staging_dir/usr/bin:${PATH}&lt;br /&gt;
   $ &#039;&#039;&#039;xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;xtensa_test_mmuhifi_c3-linux-gdb hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
or alternatively invoke the tools with absolute paths:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gdb hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Target ===&lt;br /&gt;
This is the simplest.  (Much slower of course at 45 MHz across a slow Ethernet link than on a workstation,&lt;br /&gt;
but very convenient.)  Just login to the target system and use the native &amp;lt;tt&amp;gt;gcc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using XCC (Xtensa Tools) ===&lt;br /&gt;
&lt;br /&gt;
There are two approaches to compiling with Tensilica&#039;s XCC compiler (part of Xtensa Tools).&lt;br /&gt;
The normal one, described below, is to initially setup a virtual core&lt;br /&gt;
that has built-in references to the library and include files for the target Linux system.&lt;br /&gt;
Alternatively, one could skip this initial setup and just use Xtensa Tools to create&lt;br /&gt;
object files and link them using host or target GCC tools.&lt;br /&gt;
However, such objects must be built without dependencies on such things as the C library,&lt;br /&gt;
which can be harder than it sounds (for example, flags and structures, such as &amp;lt;tt&amp;gt;open()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;O_EXCL&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;stat()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;struct stat&amp;lt;/tt&amp;gt;, must be avoided because their definitions likely differ between the&lt;br /&gt;
Xtensa Tools&#039; default C library and the Linux uClibc library).&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note&#039;&#039;&#039;: Codecs such as MP3 and AAC are typically written in C with TIE extensions and can only be compiled with XCC.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For full details, see the guide.  A summary follows.&lt;br /&gt;
&lt;br /&gt;
==== Initial Setup ====&lt;br /&gt;
&lt;br /&gt;
The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv USER              someuser&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_ROOT       /home/${USER}/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_TOOLS_ROOT /home/${USER}/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ &#039;&#039;&#039;${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                                \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--sysroot=./build_xtensa_${CORENAME}/staging_dir&#039;                                         \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
==== Regular Use ====&lt;br /&gt;
&lt;br /&gt;
Assuming the above completed successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables (assuming values of XTENSA_ROOT and XTENSA_TOOLS_ROOT used earlier):&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_CORE      default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you can use Xtensa Tools to assemble, compile, and link applications for the Linux target specified during setup.  For example:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;echo &#039;int main() {printf(&amp;quot;Hello!\\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;xt-xcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp hello ${TARGET_SYSROOT}/root&#039;&#039;&#039;                             [NOTE: This step isn&#039;t necessary if your src file system is mounted on the targer; Ex: /export]&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;/root/hello&#039;&#039;&#039;&lt;br /&gt;
    Hello!&lt;br /&gt;
    [root@hifi ~]#&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
=== Limited (No Setup) Use of Xtensa Tools for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting XCC into our search path and set the standard XTENSA_* environment variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_CORE      test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
    &#039;&#039;&#039;setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/hifi-2_home_default/Audio_Tests&#039;&#039;&#039;                           [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the LX200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpful.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, though&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages&lt;br /&gt;
with the standard:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ssh root@hifi&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi ~] # &#039;&#039;&#039;cd /usr/local/src&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;mkdir &amp;lt;package&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;wget &amp;lt;url_to_package&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;gunzip &amp;lt;package.tgz&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;cd package&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;.configure&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here are two examples, the invaluable strace and vim GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
This can be a useful effort prior to adding a package to buildroot or&lt;br /&gt;
for compiling packages with debug enabled. For example on of our developers&lt;br /&gt;
compiled uClibc with -g to debug problems in this package.&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile mplayer on the LX200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling an audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the plugin Makefile slightly, and they are available in /home/default/mplayer_packages.&lt;br /&gt;
These additions just instruct make how to fetch the codecs and build and install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note. With these Makefile additions and the Tensilica&lt;br /&gt;
codecs available in the /plugins directory is very easy.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    # We assume Tensilica Codecs have been mounted at /codecs&lt;br /&gt;
    # via /etc/fstab during boot.&lt;br /&gt;
    #&lt;br /&gt;
    CODEC_PACKAGE=xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib&lt;br /&gt;
    CODEC_PACKAGE_LOCATION=/codecs&lt;br /&gt;
    MPLAYER_DEVEL_LOCATION=/home/default/buildroot_mplayer_stuff&lt;br /&gt;
     &lt;br /&gt;
    all: &#039;&#039;&#039;$(XA_CODEC_NAME)&#039;&#039;&#039; $(SLIBNAME) $(XA_CODEC_NAME).so&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    $(CODEC_PACKAGE).tgz:&lt;br /&gt;
            cp $(CODEC_PACKAGE_LOCATION)/$(CODEC_PACKAGE).tgz .&lt;br /&gt;
    &lt;br /&gt;
    $(CODEC_PACKAGE).tar:: $(CODEC_PACKAGE).tgz&lt;br /&gt;
            gunzip $(CODEC_PACKAGE).tgz&lt;br /&gt;
    &lt;br /&gt;
    $(XA_CODEC_NAME):: $(CODEC_PACKAGE).tar&lt;br /&gt;
              tar xf $(CODEC_PACKAGE).tar&lt;br /&gt;
    &lt;br /&gt;
    install::&lt;br /&gt;
            @-mkdir /etc/mplayer&lt;br /&gt;
            cp codecs.conf /etc/mplayer&lt;br /&gt;
            @-mkdir /usr/lib/mplayer&lt;br /&gt;
            cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
            cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
            chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
            chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
The make file will be just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install. To add mp3 and aac plugins to mplayer you just type &#039;&#039;&#039;make&#039;&#039;&#039; followed by &#039;&#039;&#039;make install&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]# &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
    cp /codecs/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&lt;br /&gt;
    gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&lt;br /&gt;
    tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Ic&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c: In function &#039;xa_mp3_decode_frame&#039;:&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:185: warning: pointer targets in passing argument 1 of &#039;xa_mp3_audio_read&#039; differ in signedness&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:163: warning: unused variable &#039;j&#039;&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c: In function &#039;mp3_codec_init&#039;:&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:517: warning: pointer targets in passing argument 1 of &#039;xa_mp3_audio_read&#039; differ in signedness&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c: At top level:&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:112: warning: &#039;pack_32_to_24_bits&#039; defined but not used&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Ic&lt;br /&gt;
    ad_xa_mp3_dec.c: In function &#039;xa_mp3_audio_read&#039;:&lt;br /&gt;
    ad_xa_mp3_dec.c:26: warning: pointer targets in passing argument 2 of &#039;demux_read_data&#039; differ in signedness&lt;br /&gt;
    ad_xa_mp3_dec.c: In function &#039;init&#039;:&lt;br /&gt;
    ad_xa_mp3_dec.c:42: warning: pointer targets in passing argument 1 of &#039;xa_mp3_decode_frame&#039; differ in signedness&lt;br /&gt;
    ad_xa_mp3_dec.c: At top level:&lt;br /&gt;
    ad_xa_mp3_dec.c:52: warning: unused parameter &#039;sh&#039;&lt;br /&gt;
    ad_xa_mp3_dec.c:56: warning: unused parameter &#039;arg&#039;&lt;br /&gt;
    ad_xa_mp3_dec.c:78: warning: unused parameter &#039;sh_audio&#039;&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Im&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Ie&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]#&lt;br /&gt;
&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]# &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
    mkdir: cannot create directory &#039;/etc/mplayer&#039;: File exists&lt;br /&gt;
    make: [install] Error 1 (ignored)&lt;br /&gt;
    cp codecs.conf /etc/mplayer&lt;br /&gt;
    mkdir: cannot create directory &#039;/usr/lib/mplayer&#039;: File exists&lt;br /&gt;
    make: [install] Error 1 (ignored)&lt;br /&gt;
    cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
    cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
    chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
    chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
The makefile unpacked of the Tensilica mp3 codec tarball will installed the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
Now, having built and installed the mp3 plugin, do the same for the AAC codec.&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# cd /home/default/mplayer_packages/mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
    [root@hifi mplayer_hifi2_aacplus_v2_plugin]# &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi mplayer_hifi2_aacplus_v2_plugin]# &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Additional codecs can be downloaded from the mplayer web site, configured,&lt;br /&gt;
compiled and can be installed as usual.&lt;br /&gt;
&lt;br /&gt;
   http://www.mplayerhq.hu/DOCS/HTML/en/codec-installation.html&lt;br /&gt;
&lt;br /&gt;
   [opencore-amr | opencore-amr]&lt;br /&gt;
&lt;br /&gt;
opencore-amr builds fine and the x264-snapshot compiles completely&lt;br /&gt;
but the Makefile and code needs to be set up for ARCH xtensa. The&lt;br /&gt;
GPL AAC decoder, faad, has out of date autoconf files, config.sub&lt;br /&gt;
and config.guess, need to be updated for Xtensa. This can be easily&lt;br /&gt;
done by copying config.sub and config.guess from the x264-snapshot&lt;br /&gt;
which had up to date versions recognizing xtensa correctly. &lt;br /&gt;
&lt;br /&gt;
Add on codec install by default to /usr/local/lib and the ldconfig&lt;br /&gt;
config file /etc/ld.so.conf needs to have /usr/local/lib added.&lt;br /&gt;
&lt;br /&gt;
Lots of opportunity likely exists for optimizing these codec for&lt;br /&gt;
Xtensa extensibility. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Adding Packages and/or Codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a challenging experience and&lt;br /&gt;
worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, under extreme conditions memory can get tight and cause application to be killed.&lt;br /&gt;
    a. We will be trying procedure documented in U-Boot Manual to swap over NFS.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the complete C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler was crashing and make had to be restarted.&lt;br /&gt;
       We are not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel being enabled or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
   &lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
   &lt;br /&gt;
    c. We saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During weeks&lt;br /&gt;
       of testing we haven&#039;t seen the U-Boot environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot was hanging periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to have be worse when network activity is high.&lt;br /&gt;
     This problem also seems to have gone away in the past few weeks.&lt;br /&gt;
     It may have been a duplication with MAC addresses.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  11. The busybox vesion of vi doesn&#039;t work very good, we are using symbolic pointer&lt;br /&gt;
     &lt;br /&gt;
       /usr/local/bin/vi ---&amp;gt; /usr/local/bin/vim&lt;br /&gt;
     &lt;br /&gt;
       /usr/local/bin is searched first via bash profile and rc. &lt;br /&gt;
       The vim version works great and doesn&#039;t seem to use very much memory.&lt;br /&gt;
   &lt;br /&gt;
   12. mplayer codecs by default install to /usr/local/lib but&lt;br /&gt;
       the &#039;&#039;&#039;ldconfig&#039;&#039;&#039; config file needs to be updated to search /usr/local/lib. &lt;br /&gt;
           Ex:&lt;br /&gt;
                /etc/ld.so.conf:&lt;br /&gt;
                     # /usr/local/src/faad2-2.7/:&lt;br /&gt;
                     #               libfaad.a         libfaad.la        libfaad.so@&lt;br /&gt;
                     #               libfaad.so.2@     libfaad.so.2.0.0* libmp4ff.a&lt;br /&gt;
                     #&lt;br /&gt;
                     /usr/local/lib&lt;br /&gt;
        &lt;br /&gt;
       /etc/ld.so.conf.d exist but is being ignored by &#039;&#039;&#039;ldconfig&#039;&#039;&#039; even if included via ld.so.conf:&lt;br /&gt;
                include ld.so.conf.d/*.conf&lt;br /&gt;
       &lt;br /&gt;
       REMIND: update /home/default/save_root_files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
* maxim&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=582</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=582"/>
		<updated>2012-03-21T05:50:01Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* Configuring U-Boot to Boot Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress, though virtually complete. Just needs to have an a another engineer at Tensilica run through this procedure and make sure that we haven&#039;t missed anything.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5 and Fedora Core 9. Test done while using the Fedora 9 based kernel and the stable branch of the Xtensa kernel appear, so far, to be a bit better. Not seeing any compile errors while stressing the system with LTP, two compiles, two mplayers, hifitest, top, pstree, and top for the&lt;br /&gt;
first 18 hours; appears to be running perfect till then. No gcc commands or ssh sessions getting killed until almost a day of testing. Only the Unaligned memory access warning on gethostid01 that a staff engineer diagnosed as being a mistake in the gethostid01 LTP test program. &lt;br /&gt;
&lt;br /&gt;
* NOTE for Internal Tensilica pre-release Testers:&lt;br /&gt;
** Codecs available at /fac/vol6/audio/release/bin/l32r_LE5_pic.&lt;br /&gt;
** LX200 bitstream available at /home/marc/XTAV200/test_mmuhifi_c3.3core.&lt;br /&gt;
** Instructions to install and set up U-Boot available at http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot. &lt;br /&gt;
*** Checkout the snapshot_2+SMP branch of the U-Boot git repo for pre-built binaries.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot pre-installed, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development just before booting.&lt;br /&gt;
&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
* Suggest how to add their code to buildroot and come up again with their same development environment.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039; &lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039; &lt;br /&gt;
                                &lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                        &lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                  &lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                     &lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 &lt;br /&gt;
                origin/snapshot_2+SMP                                                         &lt;br /&gt;
          [Create]                                                                            &lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                    &lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currently our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz         [NOTE: TO BE UPDATED]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp.git&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                               [NOTE: The snapshot_2+SMP-stable so far appears to be a bit better]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
There is also a more up-to-date branch named &#039;&#039;&#039;snapshot_2+SMP-stable&#039;&#039;&#039; that has more recent kernel bug-fixes from kernel.org &lt;br /&gt;
but it hasn&#039;t been tested as extensively but so far may be show to be a bit more stable than the well tested snapshot_2+SMP branch &lt;br /&gt;
when memory gets tight under very heavy loads. This preconfigured 3-core HiFi2 branch has a few NFS bug fixes but nothing that immediately appears to have been a&lt;br /&gt;
problem in this environment. Test up to now appear to be a bit better under heavy memory congestion. If you want to use this branch use the following git commands:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP-stable origin/snapshot_2+SMP-stable&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP-stable&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
As in the build root case, you can also checkout the branch easily from via &#039;&#039;&#039;git gui&#039;&#039;&#039; using the same procedure&lt;br /&gt;
mentioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;          [Note: You may have to make dir /tftpboot]&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recommend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ln -s /var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                                 [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;     [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
      $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root file-system over NFS.&lt;br /&gt;
This file system was built using buildroot into a compressed cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio.gz&lt;br /&gt;
&lt;br /&gt;
We will also be adding two additional small files-systems to make your development environment more comfortable&lt;br /&gt;
and less time consuming to get started:&lt;br /&gt;
&lt;br /&gt;
    /usr/default                                                                    [Home Directory for user &#039;default&#039;]&lt;br /&gt;
    /usr/local                                                                      [File system to place enhancements not done by buildroot]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your boards file-systems and unpack the cpio and tar files.&lt;br /&gt;
For example here we will export three files-systems in /export:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;/exports/hifi-2_home_default&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;/exports/hifi-2_usr_local&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s and example of unpacking the three files-systems:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039; [Getting binary files in buildroot git repository]&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip rootfs.xtensa_test_mmuhifi_c3.cpio.gz&#039;&#039;&#039;                            [Uncompressing file-system cpio file]&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip hifi-2_home_default.tar.gz&#039;&#039;&#039;                                       [Uncompress /home/default tar ball]&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip hifi-2_usr_local.tar.gz&#039;&#039;&#039;                                          [Uncompress /usr/local tar ball]&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf hifi-2_home_default.tar&#039;&#039;&#039;                                          [Tar in boards /home/default for export]&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf hifi-2_usr_local.tar&#039;&#039;&#039;                                             [Tar in boards /usr/local for export]&lt;br /&gt;
&lt;br /&gt;
Next add two lines to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)                     [Boards File-systems]&lt;br /&gt;
    /export                 *(rw,no_root_squash,sync,no_wdelay)                     [Buildroot source code]&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file systems now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /export  *&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
If it fails to boot U-Boot or you happen to have a board without it there are instructions&lt;br /&gt;
at http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot to make it easy to install.&lt;br /&gt;
&lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
When you initially power on your LX200 board it will come with a very long wait period before booting and will be waiting to be configured.&lt;br /&gt;
You can also hit one of the blue buttons next to the blue LED that&#039;s next to the PCI connector to reset the board. &lt;br /&gt;
&lt;br /&gt;
The minicom session should look like the following:&lt;br /&gt;
&lt;br /&gt;
    U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:07&lt;br /&gt;
    IP:     192.168.11.105&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    Autobooting in 999999 seconds, press &amp;lt;SPACE&amp;gt; to stop &#039;&#039;&#039;&amp;lt;SPACE&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;printenv&#039;&#039;&#039;&lt;br /&gt;
    baudrate=38400&lt;br /&gt;
    ethaddr=00:50:C2:13:6f:07&lt;br /&gt;
    ethact=open_ethernet&lt;br /&gt;
    serverip=192.168.11.55&lt;br /&gt;
    nfsroot_server=192.168.11.55&lt;br /&gt;
    root-path=/exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    bootargs_using_bootp=console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&lt;br /&gt;
    bootcmd=tftpboot; bootm&lt;br /&gt;
    netmask=255.255.255.0&lt;br /&gt;
    gatewayip=192.168.11.1&lt;br /&gt;
    nfs_boot_args=root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    bootfile=uImage.xtensa-2.6.29-smp.test_mmuhifi_c3-stable&lt;br /&gt;
    autostart=no&lt;br /&gt;
    bootdelay=999999&lt;br /&gt;
    ipaddr=192.168.11.105&lt;br /&gt;
    misc_boot_args=debug coredump_filter=0xff&lt;br /&gt;
    hostname=HiFi-2&lt;br /&gt;
    nfsaddrs=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:HiFi-2&lt;br /&gt;
    bootargs=console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:HiFi-2 root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&lt;br /&gt;
    stdin=serial&lt;br /&gt;
    stdout=serial&lt;br /&gt;
    stderr=serial&lt;br /&gt;
    ver=U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
     &lt;br /&gt;
    Environment size: 788/131068 bytes&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to configure U-Boot to automatically boot the Linux kernel on power-up (using the root file system exported over NFS as described further above).&lt;br /&gt;
You need to configure UBoot with the IP addresses that are practical in your environment. When using BOOTP or DHCP many of the IP addresses are in the DHCP&lt;br /&gt;
config file. Here we first present the simple case where all of the addresses are provided in the U-Boot environment variables:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip        192.168.11.55&#039;&#039;&#039;                                                         [TFTP server IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server  192.168.11.55&#039;&#039;&#039;                                                         [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr          192.168.11.105&#039;&#039;&#039;                                                        [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv netmask         255.255.255.0&#039;&#039;&#039;                                                         [Network Mask for a Internet Class C local network]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv gatewayip       192.168.11.1&#039;&#039;&#039;                                                          [Gateway address for default route]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile        uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                              [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path       /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                            [Location of root filesystem on NFS Server; Limit ~50 bytes]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfs_boot_args   root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;               [NFS Args used in bootargs]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv hostname        HiFi-2_NFS_Based&#039;&#039;&#039;                                                      [Hostname]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsaddrs        ${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;       [IP addresses needed by NFS when not using DHCP or BOOTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv misc_boot_args  debug coredump_filter=0xff&#039;&#039;&#039;                                            [Enable kernel debug messages and core files on a SEGV sig] &lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs        console=ttyS0,38400 ip=${nfsaddrs} ${nfs_boot_args} ${misc_boot_args}&#039;&#039;&#039; [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd         tftpboot\; bootm&#039;&#039;&#039;                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay       5&#039;&#039;&#039;                                                                     [Delay 5 seconds before booting automatically]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart       yes&#039;&#039;&#039;                                                                   [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you don&#039;t feel like setting up an NFS exports you can could use a root filesystem simply located in the kernel RAM.&lt;br /&gt;
In this case only TFTP will be used on the local Ethernet to load the kernel. This could be set up with these commands:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip        192.168.11.55&#039;&#039;&#039;                                                           [TFTP server IP Address: My Workstation] &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr          192.168.11.105&#039;&#039;&#039;                                                          [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv netmask         255.255.255.0&#039;&#039;&#039;                                                           [Network Mask for a Internet Class C local network]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv gatewayip       192.168.11.1&#039;&#039;&#039;                                                            [Gateway address for default route]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile        uImage.xtensa-2.6.29-smp.test_mmuhifi_c3.ramfs&#039;&#039;&#039;                          [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path       /export2/DC_B_330HiFi_3Core_MMU/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                       [Location of root filesystem on NFS Server; Limit ~50 bytes]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ramfs_boot_args root=/dev/ramfs&#039;&#039;&#039;                                                         [RAMFS Args used in bootargs]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv hostname        HiFi-2_RamFS_Based&#039;&#039;&#039;                                                      [Hostname]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsaddrs        ${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;         [IP addresses needed by NFS when not using DHCP or BOOTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv misc_boot_args  debug coredump_filter=0xff&#039;&#039;&#039;                                              [Enable kernel debug messages and core files on a SEGV sig] &lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs        console=ttyS0,38400 ip=${nfsaddrs} ${ramfs_boot_args} ${misc_boot_args}&#039;&#039;&#039; [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd         tftpboot\; bootm&#039;&#039;&#039;                                                        [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay       5&#039;&#039;&#039;                                                                       [Delay 5 seconds before booting automatically]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart       yes&#039;&#039;&#039;                                                                     [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can also set up your dhcp server with your domain information and boot with much less information&lt;br /&gt;
and it&#039;s no longer necessary to edit the targets /etc/resolve.conf with your domain server information:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;       [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=dhcp  root=nfs coredump_filter=0xff&#039;&#039;&#039;       [Args passed to Linux while booting with DHCP  proto]&lt;br /&gt;
&lt;br /&gt;
If you want to boot with bootp or dhcp you may want your /etc/dhcp.conf file to look something like this:&lt;br /&gt;
&lt;br /&gt;
    allow bootp;&lt;br /&gt;
    boot-unknown-clients off;&lt;br /&gt;
    ignore unknown-clients;&lt;br /&gt;
    not authoritative;&lt;br /&gt;
    ddns-update-style ad-hoc;&lt;br /&gt;
     &lt;br /&gt;
    option domain-name &amp;quot;hq.tensilica.com&amp;quot;;&lt;br /&gt;
     &lt;br /&gt;
    subnet 192.168.11.0 netmask 255.255.255.0 {&lt;br /&gt;
        default-lease-time 2592000;     # 30 days&lt;br /&gt;
        max-lease-time 31557600;        # 1 year&lt;br /&gt;
        next-server = option dhcp-server-identifier;&lt;br /&gt;
        option routers 192.168.11.1;&lt;br /&gt;
        group {&lt;br /&gt;
                use-host-decl-names on;&lt;br /&gt;
                    ##&lt;br /&gt;
                    ## RTOS13   192.168.11.105: HelloSoft LX200 SMP Board on Piet&#039;s Desk&lt;br /&gt;
                    ##              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0F&lt;br /&gt;
                    ##              Little Endian:       1 1 1 1 0 0 * *&lt;br /&gt;
                    ##          Running HiFi-2&lt;br /&gt;
                    ##&lt;br /&gt;
                    ## hifi2.hq.tensilica.com:192.168.11.105::0x9b0ba8c0&lt;br /&gt;
     &lt;br /&gt;
                    host hifi2 {&lt;br /&gt;
                        hardware ethernet 00:50:c2:13:6f:07;&lt;br /&gt;
                        fixed-address hifi2.hq.tensilica.com;&lt;br /&gt;
                        next-server pdelaney_fc5.hq.tensilica.com;&lt;br /&gt;
                            option root-path &amp;quot;/exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
                        option domain-name &amp;quot;hq.tensilica.com&amp;quot;;&lt;br /&gt;
                        option domain-name-servers 192.168.15.20,192.168.15.21;&lt;br /&gt;
                    }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
For more information on setting up the Linux Kernel boot parameters see the http://www.linuxdocs.org/HOWTOs/BootPrompt-HOWTO-3.html webpage.&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks we mentioned that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we are suggesting to mounting /home/default and /usr/local files-systems which have&lt;br /&gt;
a number of files useful for getting started.  &lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export/hifi-2_home_default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
    drwxrwxrwx   12 root     root         4096 Dec  1 23:33 Audio_Tests/&lt;br /&gt;
    drwxr-xr-x    2 default  default      4096 Oct 28 17:46 Files/&lt;br /&gt;
    drwxr-xr-x    6 root     root         4096 Dec  2 02:46 LTP_Test/&lt;br /&gt;
    drwxr-xr-x    2 root     root         4096 Nov 20 15:13 Music/&lt;br /&gt;
    -rw-r--r--    1 10415    10000         841 Nov 20 01:18 SSH_Keys&lt;br /&gt;
    drwxr-xr-x    2 root     root         4096 Nov 13 12:14 Tests/&lt;br /&gt;
    drwxr-xr-x    2 10415    10000        4096 Nov 19 23:23 hifitest/&lt;br /&gt;
    drwxr-xr-x    5 root     root         4096 Dec  2 05:33 mplayer_packages/&lt;br /&gt;
    -rwxr-xr-x    1 10415    10000         544 Dec  2 03:01 save_root_files*&lt;br /&gt;
    -rw-r--r--    1 root     root        37888 Dec  2 03:13 saved_root_files.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball in the /home/default file system called &#039;&#039;&#039;saved_root_files.tar&#039;&#039;&#039;. &lt;br /&gt;
This is a tar file of files that developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                           [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                  [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                    [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                          [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                              [Your locations of DNS servers; used when your not using DHCP to boot the kernel]&lt;br /&gt;
                                                 [NOTE: restore symlink  /etc/resolv.conf -&amp;gt; /proc/net/pnp if using DHCP]&lt;br /&gt;
    etc/TZ                                       [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key           [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key           [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                               [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                         [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                     [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                              [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                   [Changed root and default user&#039;s shell to bash; runs std bash RC files to set ulimits; adds /usr/local/bin to search path]&lt;br /&gt;
    etc/shadow                                   [Changed default and root users login password to &#039;linux1&#039;, needed to ssh to the board]&lt;br /&gt;
    exports/                                     [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    usr/local                                    [Makes /usr/local so it can be mounted on; it has local additions, including /usr/local/src]&lt;br /&gt;
    codecs                                       [Makes /codecs for a NFS partition with Tensilica HiFi-2 Codecs to be mounted; the file-system should contain ...&lt;br /&gt;
                                                  ... /codecs/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&lt;br /&gt;
                                                  ... /codecs/xa_hifi2_l32r_LE5_pic_aacplus_v2_dec_lib_2_2_api_1_15_lib.tgz ]&lt;br /&gt;
     &lt;br /&gt;
Now lets assume your going to stay with mosts of these changes and modify a few of them after tar&#039;ing in these changes to the root file-system.&lt;br /&gt;
So here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/hifi-2_home_default/saved_root_files.tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system before booting it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/resolv.conf&#039;&#039;&#039;                   [Place your domain information if not using a DHCP boot]&lt;br /&gt;
                                                 [Restore symlink resolv.conf -&amp;gt; /proc/net/pnp if using DHCP]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                         [Change fstab entry for boards root filesystem, and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;               [You might want to disable mounting of non-root NFS file systems ...&lt;br /&gt;
                                                  ... on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing for HiFi 2 ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailoring your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful and provided in the &#039;&#039;&#039;saved_root_files&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
   1. Added a root password to that you can login with ssh.&lt;br /&gt;
   2. Running rdate with an ntp server on booting.&lt;br /&gt;
   3. Adding NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-in build environment from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
   6. Mounting Tensilica HiFi-2 Codecs to easily get mplayer working with HiFi-2 TIE instructions.&lt;br /&gt;
&lt;br /&gt;
== Building Linux Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Host ===&lt;br /&gt;
&lt;br /&gt;
You can use the open source toolchain included in the buildroot tree.&lt;br /&gt;
&lt;br /&gt;
Given the location of the buildroot tree and the name of the core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;setenv BUILDROOT_DIR  /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;setenv CORENAME       test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can either set the PATH and invoke tools prefixed with &amp;lt;tt&amp;gt;xtensa_${CORENAME}-linux-&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;setenv PATH   ${BUILDROOT_DIR}/build_xtensa_${CORENAME}/staging_dir/usr/bin:${PATH}&lt;br /&gt;
   $ &#039;&#039;&#039;xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;xtensa_test_mmuhifi_c3-linux-gdb hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
or alternatively invoke the tools with absolute paths:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gdb hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Target ===&lt;br /&gt;
This is the simplest.  (Much slower of course at 45 MHz across a slow Ethernet link than on a workstation,&lt;br /&gt;
but very convenient.)  Just login to the target system and use the native &amp;lt;tt&amp;gt;gcc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using XCC (Xtensa Tools) ===&lt;br /&gt;
&lt;br /&gt;
There are two approaches to compiling with Tensilica&#039;s XCC compiler (part of Xtensa Tools).&lt;br /&gt;
The normal one, described below, is to initially setup a virtual core&lt;br /&gt;
that has built-in references to the library and include files for the target Linux system.&lt;br /&gt;
Alternatively, one could skip this initial setup and just use Xtensa Tools to create&lt;br /&gt;
object files and link them using host or target GCC tools.&lt;br /&gt;
However, such objects must be built without dependencies on such things as the C library,&lt;br /&gt;
which can be harder than it sounds (for example, flags and structures, such as &amp;lt;tt&amp;gt;open()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;O_EXCL&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;stat()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;struct stat&amp;lt;/tt&amp;gt;, must be avoided because their definitions likely differ between the&lt;br /&gt;
Xtensa Tools&#039; default C library and the Linux uClibc library).&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note&#039;&#039;&#039;: Codecs such as MP3 and AAC are typically written in C with TIE extensions and can only be compiled with XCC.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For full details, see the guide.  A summary follows.&lt;br /&gt;
&lt;br /&gt;
==== Initial Setup ====&lt;br /&gt;
&lt;br /&gt;
The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv USER              someuser&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_ROOT       /home/${USER}/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_TOOLS_ROOT /home/${USER}/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ &#039;&#039;&#039;${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                                \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--sysroot=./build_xtensa_${CORENAME}/staging_dir&#039;                                         \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
==== Regular Use ====&lt;br /&gt;
&lt;br /&gt;
Assuming the above completed successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables (assuming values of XTENSA_ROOT and XTENSA_TOOLS_ROOT used earlier):&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_CORE      default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you can use Xtensa Tools to assemble, compile, and link applications for the Linux target specified during setup.  For example:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;echo &#039;int main() {printf(&amp;quot;Hello!\\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;xt-xcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp hello ${TARGET_SYSROOT}/root&#039;&#039;&#039;                             [NOTE: This step isn&#039;t necessary if your src file system is mounted on the targer; Ex: /export]&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;/root/hello&#039;&#039;&#039;&lt;br /&gt;
    Hello!&lt;br /&gt;
    [root@hifi ~]#&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
=== Limited (No Setup) Use of Xtensa Tools for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting XCC into our search path and set the standard XTENSA_* environment variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_CORE      test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
    &#039;&#039;&#039;setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/hifi-2_home_default/Audio_Tests&#039;&#039;&#039;                           [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the LX200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpful.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, though&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages&lt;br /&gt;
with the standard:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ssh root@hifi&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi ~] # &#039;&#039;&#039;cd /usr/local/src&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;mkdir &amp;lt;package&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;wget &amp;lt;url_to_package&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;gunzip &amp;lt;package.tgz&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;cd package&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;.configure&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here are two examples, the invaluable strace and vim GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
This can be a useful effort prior to adding a package to buildroot or&lt;br /&gt;
for compiling packages with debug enabled. For example on of our developers&lt;br /&gt;
compiled uClibc with -g to debug problems in this package.&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile mplayer on the LX200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling an audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the plugin Makefile slightly, and they are available in /home/default/mplayer_packages.&lt;br /&gt;
These additions just instruct make how to fetch the codecs and build and install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note. With these Makefile additions and the Tensilica&lt;br /&gt;
codecs available in the /plugins directory is very easy.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    # We assume Tensilica Codecs have been mounted at /codecs&lt;br /&gt;
    # via /etc/fstab during boot.&lt;br /&gt;
    #&lt;br /&gt;
    CODEC_PACKAGE=xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib&lt;br /&gt;
    CODEC_PACKAGE_LOCATION=/codecs&lt;br /&gt;
    MPLAYER_DEVEL_LOCATION=/home/default/buildroot_mplayer_stuff&lt;br /&gt;
     &lt;br /&gt;
    all: &#039;&#039;&#039;$(XA_CODEC_NAME)&#039;&#039;&#039; $(SLIBNAME) $(XA_CODEC_NAME).so&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    $(CODEC_PACKAGE).tgz:&lt;br /&gt;
            cp $(CODEC_PACKAGE_LOCATION)/$(CODEC_PACKAGE).tgz .&lt;br /&gt;
    &lt;br /&gt;
    $(CODEC_PACKAGE).tar:: $(CODEC_PACKAGE).tgz&lt;br /&gt;
            gunzip $(CODEC_PACKAGE).tgz&lt;br /&gt;
    &lt;br /&gt;
    $(XA_CODEC_NAME):: $(CODEC_PACKAGE).tar&lt;br /&gt;
              tar xf $(CODEC_PACKAGE).tar&lt;br /&gt;
    &lt;br /&gt;
    install::&lt;br /&gt;
            @-mkdir /etc/mplayer&lt;br /&gt;
            cp codecs.conf /etc/mplayer&lt;br /&gt;
            @-mkdir /usr/lib/mplayer&lt;br /&gt;
            cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
            cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
            chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
            chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
The make file will be just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install. To add mp3 and aac plugins to mplayer you just type &#039;&#039;&#039;make&#039;&#039;&#039; followed by &#039;&#039;&#039;make install&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]# &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
    cp /codecs/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&lt;br /&gt;
    gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&lt;br /&gt;
    tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Ic&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c: In function &#039;xa_mp3_decode_frame&#039;:&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:185: warning: pointer targets in passing argument 1 of &#039;xa_mp3_audio_read&#039; differ in signedness&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:163: warning: unused variable &#039;j&#039;&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c: In function &#039;mp3_codec_init&#039;:&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:517: warning: pointer targets in passing argument 1 of &#039;xa_mp3_audio_read&#039; differ in signedness&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c: At top level:&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:112: warning: &#039;pack_32_to_24_bits&#039; defined but not used&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Ic&lt;br /&gt;
    ad_xa_mp3_dec.c: In function &#039;xa_mp3_audio_read&#039;:&lt;br /&gt;
    ad_xa_mp3_dec.c:26: warning: pointer targets in passing argument 2 of &#039;demux_read_data&#039; differ in signedness&lt;br /&gt;
    ad_xa_mp3_dec.c: In function &#039;init&#039;:&lt;br /&gt;
    ad_xa_mp3_dec.c:42: warning: pointer targets in passing argument 1 of &#039;xa_mp3_decode_frame&#039; differ in signedness&lt;br /&gt;
    ad_xa_mp3_dec.c: At top level:&lt;br /&gt;
    ad_xa_mp3_dec.c:52: warning: unused parameter &#039;sh&#039;&lt;br /&gt;
    ad_xa_mp3_dec.c:56: warning: unused parameter &#039;arg&#039;&lt;br /&gt;
    ad_xa_mp3_dec.c:78: warning: unused parameter &#039;sh_audio&#039;&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Im&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Ie&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]#&lt;br /&gt;
&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]# &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
    mkdir: cannot create directory &#039;/etc/mplayer&#039;: File exists&lt;br /&gt;
    make: [install] Error 1 (ignored)&lt;br /&gt;
    cp codecs.conf /etc/mplayer&lt;br /&gt;
    mkdir: cannot create directory &#039;/usr/lib/mplayer&#039;: File exists&lt;br /&gt;
    make: [install] Error 1 (ignored)&lt;br /&gt;
    cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
    cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
    chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
    chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
The makefile unpacked of the Tensilica mp3 codec tarball will installed the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
Now, having built and installed the mp3 plugin, do the same for the AAC codec.&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# cd /home/default/mplayer_packages/mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
    [root@hifi mplayer_hifi2_aacplus_v2_plugin]# &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi mplayer_hifi2_aacplus_v2_plugin]# &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Additional codecs can be downloaded from the mplayer web site, configured,&lt;br /&gt;
compiled and can be installed as usual.&lt;br /&gt;
&lt;br /&gt;
   http://www.mplayerhq.hu/DOCS/HTML/en/codec-installation.html&lt;br /&gt;
&lt;br /&gt;
   [opencore-amr | opencore-amr]&lt;br /&gt;
&lt;br /&gt;
opencore-amr builds fine and the x264-snapshot compiles completely&lt;br /&gt;
but the Makefile and code needs to be set up for ARCH xtensa. The&lt;br /&gt;
GPL AAC decoder, faad, has out of date autoconf files, config.sub&lt;br /&gt;
and config.guess, need to be updated for Xtensa. This can be easily&lt;br /&gt;
done by copying config.sub and config.guess from the x264-snapshot&lt;br /&gt;
which had up to date versions recognizing xtensa correctly. &lt;br /&gt;
&lt;br /&gt;
Add on codec install by default to /usr/local/lib and the ldconfig&lt;br /&gt;
config file /etc/ld.so.conf needs to have /usr/local/lib added.&lt;br /&gt;
&lt;br /&gt;
Lots of opportunity likely exists for optimizing these codec for&lt;br /&gt;
Xtensa extensibility. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Adding Packages and/or Codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a challenging experience and&lt;br /&gt;
worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, under extreme conditions memory can get tight and cause application to be killed.&lt;br /&gt;
    a. We will be trying procedure documented in U-Boot Manual to swap over NFS.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the complete C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler was crashing and make had to be restarted.&lt;br /&gt;
       We are not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel being enabled or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
   &lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
   &lt;br /&gt;
    c. We saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During weeks&lt;br /&gt;
       of testing we haven&#039;t seen the U-Boot environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot was hanging periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to have be worse when network activity is high.&lt;br /&gt;
     This problem also seems to have gone away in the past few weeks.&lt;br /&gt;
     It may have been a duplication with MAC addresses.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  11. The busybox vesion of vi doesn&#039;t work very good, we are using symbolic pointer&lt;br /&gt;
     &lt;br /&gt;
       /usr/local/bin/vi ---&amp;gt; /usr/local/bin/vim&lt;br /&gt;
     &lt;br /&gt;
       /usr/local/bin is searched first via bash profile and rc. &lt;br /&gt;
       The vim version works great and doesn&#039;t seem to use very much memory.&lt;br /&gt;
   &lt;br /&gt;
   12. mplayer codecs by default install to /usr/local/lib but&lt;br /&gt;
       the &#039;&#039;&#039;ldconfig&#039;&#039;&#039; config file needs to be updated to search /usr/local/lib. &lt;br /&gt;
           Ex:&lt;br /&gt;
                /etc/ld.so.conf:&lt;br /&gt;
                     # /usr/local/src/faad2-2.7/:&lt;br /&gt;
                     #               libfaad.a         libfaad.la        libfaad.so@&lt;br /&gt;
                     #               libfaad.so.2@     libfaad.so.2.0.0* libmp4ff.a&lt;br /&gt;
                     #&lt;br /&gt;
                     /usr/local/lib&lt;br /&gt;
        &lt;br /&gt;
       /etc/ld.so.conf.d exist but is being ignored by &#039;&#039;&#039;ldconfig&#039;&#039;&#039; even if included via ld.so.conf:&lt;br /&gt;
                include ld.so.conf.d/*.conf&lt;br /&gt;
       &lt;br /&gt;
       REMIND: update /home/default/save_root_files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
* maxim&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=581</id>
		<title>SMP HiFi 2 Development Board</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=SMP_HiFi_2_Development_Board&amp;diff=581"/>
		<updated>2012-03-21T05:40:18Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* Configuring U-Boot to Boot Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &amp;quot;community&amp;quot; guide for how to use the LX200 board based 3-core SMP HiFi-2 Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please feel free to ask at the [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress, though virtually complete. Just needs to have an a another engineer at Tensilica run through this procedure and make sure that we haven&#039;t missed anything.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5 and Fedora Core 9. Test done while using the Fedora 9 based kernel and the stable branch of the Xtensa kernel appear, so far, to be a bit better. Not seeing any compile errors while stressing the system with LTP, two compiles, two mplayers, hifitest, top, pstree, and top for the&lt;br /&gt;
first 18 hours; appears to be running perfect till then. No gcc commands or ssh sessions getting killed until almost a day of testing. Only the Unaligned memory access warning on gethostid01 that a staff engineer diagnosed as being a mistake in the gethostid01 LTP test program. &lt;br /&gt;
&lt;br /&gt;
* NOTE for Internal Tensilica pre-release Testers:&lt;br /&gt;
** Codecs available at /fac/vol6/audio/release/bin/l32r_LE5_pic.&lt;br /&gt;
** LX200 bitstream available at /home/marc/XTAV200/test_mmuhifi_c3.3core.&lt;br /&gt;
** Instructions to install and set up U-Boot available at http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot. &lt;br /&gt;
*** Checkout the snapshot_2+SMP branch of the U-Boot git repo for pre-built binaries.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to someone who received an LX200 board setup by Tensilica&lt;br /&gt;
for HiFi2 development.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the LX200 board for HiFi2 development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot pre-installed, ready to boot a linux kernel.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for HiFi-2 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
* Suggests a possible way to tailor the board for easy codec development just before booting.&lt;br /&gt;
&lt;br /&gt;
Once the development board is up and running, this document:&lt;br /&gt;
* Shows how to add the Tensilica provided codec packages to the Mplayer packages used by Buildroot, including building and installing.&lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging codecs.&lt;br /&gt;
* Suggest how to add their code to buildroot and come up again with their same development environment.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest HiFi-2 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The HiFi-2 development environment is maintained in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;&#039;git&#039;&#039;&#039;, download a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the codec development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The HiFi-2 snapshot is in the process of being made.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039; &lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039; &lt;br /&gt;
                                &lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                        &lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                  &lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                     &lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 &lt;br /&gt;
                origin/snapshot_2+SMP                                                         &lt;br /&gt;
          [Create]                                                                            &lt;br /&gt;
      [Reposirory]--&amp;gt; Quit                                                                    &lt;br /&gt;
&lt;br /&gt;
If there are issues installing &#039;&#039;&#039;git&#039;&#039;&#039;, as a last resort, an alternative is ftp (may not always get updated, is currently our of date, waste disk space, so may be dropped at some point):&lt;br /&gt;
&lt;br /&gt;
         http://www.linux-xtensa.org/pub/snapshots/buildroot-xtensa-smp.2-Nov-2009.tar.gz         [NOTE: TO BE UPDATED]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Linux Kernel Snapshot ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp.git&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd kernel/xtensa-2.6.29-smp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;                               [NOTE: The snapshot_2+SMP-stable so far appears to be a bit better]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for the 3-core HiFi2 on the LX200).&lt;br /&gt;
There is also a more up-to-date branch named &#039;&#039;&#039;snapshot_2+SMP-stable&#039;&#039;&#039; that has more recent kernel bug-fixes from kernel.org &lt;br /&gt;
but it hasn&#039;t been tested as extensively but so far may be show to be a bit more stable than the well tested snapshot_2+SMP branch &lt;br /&gt;
when memory gets tight under very heavy loads. This preconfigured 3-core HiFi2 branch has a few NFS bug fixes but nothing that immediately appears to have been a&lt;br /&gt;
problem in this environment. Test up to now appear to be a bit better under heavy memory congestion. If you want to use this branch use the following git commands:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track snapshot_2+SMP-stable origin/snapshot_2+SMP-stable&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout snapshot_2+SMP-stable&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
As in the build root case, you can also checkout the branch easily from via &#039;&#039;&#039;git gui&#039;&#039;&#039; using the same procedure&lt;br /&gt;
mentioned above.&lt;br /&gt;
&lt;br /&gt;
Now, assuming we are still in the kernel &#039;&#039;&#039;xtensa-2.6.29-smp&#039;&#039;&#039; directory&lt;br /&gt;
copy the kernel U-Boot Image (&#039;&#039;&#039;uImage&#039;&#039;&#039;) to the tftp directory; Ex:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp arch/xtensa/boot/uImage /tftpboot/uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;          [Note: You may have to make dir /tftpboot]&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recommend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ln -s /var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                                 [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;     [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
      $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The LX200 board running Linux needs to mount its root file-system over NFS.&lt;br /&gt;
This file system was built using buildroot into a compressed cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio.gz&lt;br /&gt;
&lt;br /&gt;
We will also be adding two additional small files-systems to make your development environment more comfortable&lt;br /&gt;
and less time consuming to get started:&lt;br /&gt;
&lt;br /&gt;
    /usr/default                                                                    [Home Directory for user &#039;default&#039;]&lt;br /&gt;
    /usr/local                                                                      [File system to place enhancements not done by buildroot]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your boards file-systems and unpack the cpio and tar files.&lt;br /&gt;
For example here we will export three files-systems in /export:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;/exports/LINUX_ROOT.HiFi-2_DemoBoard.buildroot-xtensa-smp&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;/exports/hifi-2_home_default&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;/exports/hifi-2_usr_local&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s and example of unpacking the three files-systems:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039; [Getting binary files in buildroot git repository]&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip rootfs.xtensa_test_mmuhifi_c3.cpio.gz&#039;&#039;&#039;                            [Uncompressing file-system cpio file]&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip hifi-2_home_default.tar.gz&#039;&#039;&#039;                                       [Uncompress /home/default tar ball]&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip hifi-2_usr_local.tar.gz&#039;&#039;&#039;                                          [Uncompress /usr/local tar ball]&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf hifi-2_home_default.tar&#039;&#039;&#039;                                          [Tar in boards /home/default for export]&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf hifi-2_usr_local.tar&#039;&#039;&#039;                                             [Tar in boards /usr/local for export]&lt;br /&gt;
&lt;br /&gt;
Next add two lines to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)                     [Boards File-systems]&lt;br /&gt;
    /export                 *(rw,no_root_squash,sync,no_wdelay)                     [Buildroot source code]&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file systems now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mypc.foobar.com:&lt;br /&gt;
      /export  *&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux ==&lt;br /&gt;
&lt;br /&gt;
Your LX200 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
If it fails to boot U-Boot or you happen to have a board without it there are instructions&lt;br /&gt;
at http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot to make it easy to install.&lt;br /&gt;
&lt;br /&gt;
The board has a DIP switch (next to the power on/off switch) that provides the 6 LSBs&lt;br /&gt;
of the Ethernet MAC, in switch positions 1 thru 6. &lt;br /&gt;
&lt;br /&gt;
              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0a&lt;br /&gt;
              Little Endian:       0 1 0 1 0 0 * *&lt;br /&gt;
                                                 ^&lt;br /&gt;
                                                 |&lt;br /&gt;
                                                 +------ Enables booting U-Boot from Flash&lt;br /&gt;
&lt;br /&gt;
DIP switch 8 should be shipped in the ON position to enable U-Boot booting from flash.&lt;br /&gt;
See Sections 4.2.3 and 4.2.4 of the &#039;&#039;&#039;Tensilica Avnet (XT-AV200) Board User&#039;s Guide&#039;&#039;&#039; &lt;br /&gt;
for details. Make sure to select a unique MAC address for you board.&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
When you initially power on your LX200 board it will come with a very long wait period before booting and will be waiting to be configured.&lt;br /&gt;
You can also hit one of the blue buttons next to the blue LED that&#039;s next to the PCI connector to reset the board. &lt;br /&gt;
&lt;br /&gt;
The minicom session should look like the following:&lt;br /&gt;
&lt;br /&gt;
    U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:07&lt;br /&gt;
    IP:     192.168.11.105&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    Autobooting in 999999 seconds, press &amp;lt;SPACE&amp;gt; to stop &#039;&#039;&#039;&amp;lt;SPACE&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;printenv&#039;&#039;&#039;&lt;br /&gt;
    baudrate=38400&lt;br /&gt;
    ethaddr=00:50:C2:13:6f:07&lt;br /&gt;
    ethact=open_ethernet&lt;br /&gt;
    serverip=192.168.11.55&lt;br /&gt;
    nfsroot_server=192.168.11.55&lt;br /&gt;
    root-path=/exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    bootargs_using_bootp=console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&lt;br /&gt;
    bootcmd=tftpboot; bootm&lt;br /&gt;
    netmask=255.255.255.0&lt;br /&gt;
    gatewayip=192.168.11.1&lt;br /&gt;
    nfs_boot_args=root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
    bootfile=uImage.xtensa-2.6.29-smp.test_mmuhifi_c3-stable&lt;br /&gt;
    autostart=no&lt;br /&gt;
    bootdelay=999999&lt;br /&gt;
    ipaddr=192.168.11.105&lt;br /&gt;
    misc_boot_args=debug coredump_filter=0xff&lt;br /&gt;
    hostname=HiFi-2&lt;br /&gt;
    nfsaddrs=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:HiFi-2&lt;br /&gt;
    bootargs=console=ttyS0,38400 ip=192.168.11.105:192.168.11.55:192.168.11.1:255.255.255.0:HiFi-2 root=/dev/nfs rw nfsroot=192.168.11.55:/exports/LINUX_ROOT.HiFi-2 debug coredump_filter=0xff&lt;br /&gt;
    stdin=serial&lt;br /&gt;
    stdout=serial&lt;br /&gt;
    stderr=serial&lt;br /&gt;
    ver=U-Boot 2009.08 (Nov 15 2009 - 22:03:26)&lt;br /&gt;
     &lt;br /&gt;
    Environment size: 788/131068 bytes&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to configure U-Boot to automatically boot the Linux kernel on power-up (using the root file system exported over NFS as described further above).&lt;br /&gt;
You need to configure UBoot with the IP addresses that are practical in your environment. When using BOOTP or DHCP many of the IP addresses are in the DHCP&lt;br /&gt;
config file. Here we first present the simple case where all of the addresses are provided in the U-Boot environment variables:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip        192.168.11.55&#039;&#039;&#039;                                                         [TFTP server IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server  192.168.11.55&#039;&#039;&#039;                                                         [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr          192.168.11.105&#039;&#039;&#039;                                                        [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv netmask         255.255.255.0&#039;&#039;&#039;                                                         [Network Mask for a Internet Class C local network]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv gatewayip       192.168.11.1&#039;&#039;&#039;                                                          [Gateway address for default route]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile        uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                              [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path       /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                                            [Location of root filesystem on NFS Server; Limit ~50 bytes]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfs_boot_args   root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;               [NFS Args used in bootargs]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv hostname        HiFi-2_NFS Based&#039;&#039;&#039;                                                      [Hostname]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsaddrs        ${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;       [IP addresses needed by NFS when not using DHCP or BOOTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv misc_boot_args  debug coredump_filter=0xff&#039;&#039;&#039;                                            [Enable kernel debug messages and core files on a SEGV sig] &lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs        console=ttyS0,38400 ip=${nfsaddrs} ${nfs_boot_args} ${misc_boot_args}&#039;&#039;&#039; [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd         tftpboot\; bootm&#039;&#039;&#039;                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay       5&#039;&#039;&#039;                                                                     [Delay 5 seconds before booting automatically]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart       yes&#039;&#039;&#039;                                                                   [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you don&#039;t feel like setting up an NFS exports you can could use a root filesystem simply located in the kernel RAM.&lt;br /&gt;
In this case only TFTP will be used on the local Ethernet to load the kernel. This could be set up with these commands:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip        192.168.11.55&#039;&#039;&#039;                                                           [TFTP server IP Address: My Workstation] &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr          192.168.11.105&#039;&#039;&#039;                                                          [HOST IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv netmask         255.255.255.0&#039;&#039;&#039;                                                           [Network Mask for a Internet Class C local network]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv gatewayip       192.168.11.1&#039;&#039;&#039;                                                            [Gateway address for default route]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile        uImage.xtensa-2.6.29-smp.test_mmuhifi_c3.ramfs&#039;&#039;&#039;                          [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path       /export2/DC_B_330HiFi_3Core_MMU/LINUX_ROOT.HiFi-2&#039;&#039;&#039;                       [Location of root filesystem on NFS Server; Limit ~50 bytes]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ramfs_boot_args root=/dev/ramfs&#039;&#039;&#039;                                                         [RAMFS Args used in bootargs]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv hostname        HiFi-2_RamFS Based&#039;&#039;&#039;                                                      [Hostname]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsaddrs        ${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;         [IP addresses needed by NFS when not using DHCP or BOOTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv misc_boot_args  debug coredump_filter=0xff&#039;&#039;&#039;                                              [Enable kernel debug messages and core files on a SEGV sig] &lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs        console=ttyS0,38400 ip=${nfsaddrs} ${ramfs_boot_args} ${misc_boot_args}&#039;&#039;&#039; [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd         tftpboot\; bootm&#039;&#039;&#039;                                                        [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay       5&#039;&#039;&#039;                                                                       [Delay 5 seconds before booting automatically]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart       yes&#039;&#039;&#039;                                                                     [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can also set up your dhcp server with your domain information and boot with much less information&lt;br /&gt;
and it&#039;s no longer necessary to edit the targets /etc/resolve.conf with your domain server information:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;       [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=dhcp  root=nfs coredump_filter=0xff&#039;&#039;&#039;       [Args passed to Linux while booting with DHCP  proto]&lt;br /&gt;
&lt;br /&gt;
If you want to boot with bootp or dhcp you may want your /etc/dhcp.conf file to look something like this:&lt;br /&gt;
&lt;br /&gt;
    allow bootp;&lt;br /&gt;
    boot-unknown-clients off;&lt;br /&gt;
    ignore unknown-clients;&lt;br /&gt;
    not authoritative;&lt;br /&gt;
    ddns-update-style ad-hoc;&lt;br /&gt;
     &lt;br /&gt;
    option domain-name &amp;quot;hq.tensilica.com&amp;quot;;&lt;br /&gt;
     &lt;br /&gt;
    subnet 192.168.11.0 netmask 255.255.255.0 {&lt;br /&gt;
        default-lease-time 2592000;     # 30 days&lt;br /&gt;
        max-lease-time 31557600;        # 1 year&lt;br /&gt;
        next-server = option dhcp-server-identifier;&lt;br /&gt;
        option routers 192.168.11.1;&lt;br /&gt;
        group {&lt;br /&gt;
                use-host-decl-names on;&lt;br /&gt;
                    ##&lt;br /&gt;
                    ## RTOS13   192.168.11.105: HelloSoft LX200 SMP Board on Piet&#039;s Desk&lt;br /&gt;
                    ##              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0F&lt;br /&gt;
                    ##              Little Endian:       1 1 1 1 0 0 * *&lt;br /&gt;
                    ##          Running HiFi-2&lt;br /&gt;
                    ##&lt;br /&gt;
                    ## hifi2.hq.tensilica.com:192.168.11.105::0x9b0ba8c0&lt;br /&gt;
     &lt;br /&gt;
                    host hifi2 {&lt;br /&gt;
                        hardware ethernet 00:50:c2:13:6f:07;&lt;br /&gt;
                        fixed-address hifi2.hq.tensilica.com;&lt;br /&gt;
                        next-server pdelaney_fc5.hq.tensilica.com;&lt;br /&gt;
                            option root-path &amp;quot;/exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
                        option domain-name &amp;quot;hq.tensilica.com&amp;quot;;&lt;br /&gt;
                        option domain-name-servers 192.168.15.20,192.168.15.21;&lt;br /&gt;
                    }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
For more information on setting up the Linux Kernel boot parameters see the http://www.linuxdocs.org/HOWTOs/BootPrompt-HOWTO-3.html webpage.&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks we mentioned that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we are suggesting to mounting /home/default and /usr/local files-systems which have&lt;br /&gt;
a number of files useful for getting started.  &lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export/hifi-2_home_default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
    drwxrwxrwx   12 root     root         4096 Dec  1 23:33 Audio_Tests/&lt;br /&gt;
    drwxr-xr-x    2 default  default      4096 Oct 28 17:46 Files/&lt;br /&gt;
    drwxr-xr-x    6 root     root         4096 Dec  2 02:46 LTP_Test/&lt;br /&gt;
    drwxr-xr-x    2 root     root         4096 Nov 20 15:13 Music/&lt;br /&gt;
    -rw-r--r--    1 10415    10000         841 Nov 20 01:18 SSH_Keys&lt;br /&gt;
    drwxr-xr-x    2 root     root         4096 Nov 13 12:14 Tests/&lt;br /&gt;
    drwxr-xr-x    2 10415    10000        4096 Nov 19 23:23 hifitest/&lt;br /&gt;
    drwxr-xr-x    5 root     root         4096 Dec  2 05:33 mplayer_packages/&lt;br /&gt;
    -rwxr-xr-x    1 10415    10000         544 Dec  2 03:01 save_root_files*&lt;br /&gt;
    -rw-r--r--    1 root     root        37888 Dec  2 03:13 saved_root_files.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball in the /home/default file system called &#039;&#039;&#039;saved_root_files.tar&#039;&#039;&#039;. &lt;br /&gt;
This is a tar file of files that developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                           [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                  [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                    [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                          [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                              [Your locations of DNS servers; used when your not using DHCP to boot the kernel]&lt;br /&gt;
                                                 [NOTE: restore symlink  /etc/resolv.conf -&amp;gt; /proc/net/pnp if using DHCP]&lt;br /&gt;
    etc/TZ                                       [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key           [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key           [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                               [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                         [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                     [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                              [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                   [Changed root and default user&#039;s shell to bash; runs std bash RC files to set ulimits; adds /usr/local/bin to search path]&lt;br /&gt;
    etc/shadow                                   [Changed default and root users login password to &#039;linux1&#039;, needed to ssh to the board]&lt;br /&gt;
    exports/                                     [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    usr/local                                    [Makes /usr/local so it can be mounted on; it has local additions, including /usr/local/src]&lt;br /&gt;
    codecs                                       [Makes /codecs for a NFS partition with Tensilica HiFi-2 Codecs to be mounted; the file-system should contain ...&lt;br /&gt;
                                                  ... /codecs/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&lt;br /&gt;
                                                  ... /codecs/xa_hifi2_l32r_LE5_pic_aacplus_v2_dec_lib_2_2_api_1_15_lib.tgz ]&lt;br /&gt;
     &lt;br /&gt;
Now lets assume your going to stay with mosts of these changes and modify a few of them after tar&#039;ing in these changes to the root file-system.&lt;br /&gt;
So here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/hifi-2_home_default/saved_root_files.tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system before booting it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/resolv.conf&#039;&#039;&#039;                   [Place your domain information if not using a DHCP boot]&lt;br /&gt;
                                                 [Restore symlink resolv.conf -&amp;gt; /proc/net/pnp if using DHCP]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                         [Change fstab entry for boards root filesystem, and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;               [You might want to disable mounting of non-root NFS file systems ...&lt;br /&gt;
                                                  ... on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your LX200. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the LX200 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing for HiFi 2 ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailoring your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful and provided in the &#039;&#039;&#039;saved_root_files&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
   1. Added a root password to that you can login with ssh.&lt;br /&gt;
   2. Running rdate with an ntp server on booting.&lt;br /&gt;
   3. Adding NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-in build environment from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
   6. Mounting Tensilica HiFi-2 Codecs to easily get mplayer working with HiFi-2 TIE instructions.&lt;br /&gt;
&lt;br /&gt;
== Building Linux Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Host ===&lt;br /&gt;
&lt;br /&gt;
You can use the open source toolchain included in the buildroot tree.&lt;br /&gt;
&lt;br /&gt;
Given the location of the buildroot tree and the name of the core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;setenv BUILDROOT_DIR  /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;setenv CORENAME       test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can either set the PATH and invoke tools prefixed with &amp;lt;tt&amp;gt;xtensa_${CORENAME}-linux-&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;setenv PATH   ${BUILDROOT_DIR}/build_xtensa_${CORENAME}/staging_dir/usr/bin:${PATH}&lt;br /&gt;
   $ &#039;&#039;&#039;xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;xtensa_test_mmuhifi_c3-linux-gdb hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
or alternatively invoke the tools with absolute paths:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gdb hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Target ===&lt;br /&gt;
This is the simplest.  (Much slower of course at 45 MHz across a slow Ethernet link than on a workstation,&lt;br /&gt;
but very convenient.)  Just login to the target system and use the native &amp;lt;tt&amp;gt;gcc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using XCC (Xtensa Tools) ===&lt;br /&gt;
&lt;br /&gt;
There are two approaches to compiling with Tensilica&#039;s XCC compiler (part of Xtensa Tools).&lt;br /&gt;
The normal one, described below, is to initially setup a virtual core&lt;br /&gt;
that has built-in references to the library and include files for the target Linux system.&lt;br /&gt;
Alternatively, one could skip this initial setup and just use Xtensa Tools to create&lt;br /&gt;
object files and link them using host or target GCC tools.&lt;br /&gt;
However, such objects must be built without dependencies on such things as the C library,&lt;br /&gt;
which can be harder than it sounds (for example, flags and structures, such as &amp;lt;tt&amp;gt;open()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;O_EXCL&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;stat()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;struct stat&amp;lt;/tt&amp;gt;, must be avoided because their definitions likely differ between the&lt;br /&gt;
Xtensa Tools&#039; default C library and the Linux uClibc library).&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note&#039;&#039;&#039;: Codecs such as MP3 and AAC are typically written in C with TIE extensions and can only be compiled with XCC.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For full details, see the guide.  A summary follows.&lt;br /&gt;
&lt;br /&gt;
==== Initial Setup ====&lt;br /&gt;
&lt;br /&gt;
The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv USER              someuser&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_ROOT       /home/${USER}/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_TOOLS_ROOT /home/${USER}/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;setenv CORENAME         test_mmuhifi_c3&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ &#039;&#039;&#039;${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                                \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--sysroot=./build_xtensa_${CORENAME}/staging_dir&#039;                                         \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
==== Regular Use ====&lt;br /&gt;
&lt;br /&gt;
Assuming the above completed successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables (assuming values of XTENSA_ROOT and XTENSA_TOOLS_ROOT used earlier):&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_CORE      default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you can use Xtensa Tools to assemble, compile, and link applications for the Linux target specified during setup.  For example:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;echo &#039;int main() {printf(&amp;quot;Hello!\\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;xt-xcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp hello ${TARGET_SYSROOT}/root&#039;&#039;&#039;                             [NOTE: This step isn&#039;t necessary if your src file system is mounted on the targer; Ex: /export]&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;/root/hello&#039;&#039;&#039;&lt;br /&gt;
    Hello!&lt;br /&gt;
    [root@hifi ~]#&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
=== Limited (No Setup) Use of Xtensa Tools for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting XCC into our search path and set the standard XTENSA_* environment variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_CORE      test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3/config&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
    &#039;&#039;&#039;setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/hifi-2_home_default/Audio_Tests&#039;&#039;&#039;                           [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the LX200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                                               [NOTE: This is being done on the LX200 board]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpful.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, though&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages&lt;br /&gt;
with the standard:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ssh root@hifi&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi ~] # &#039;&#039;&#039;cd /usr/local/src&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;mkdir &amp;lt;package&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;wget &amp;lt;url_to_package&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;gunzip &amp;lt;package.tgz&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;cd package&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;.configure&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here are two examples, the invaluable strace and vim GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
This can be a useful effort prior to adding a package to buildroot or&lt;br /&gt;
for compiling packages with debug enabled. For example on of our developers&lt;br /&gt;
compiled uClibc with -g to debug problems in this package.&lt;br /&gt;
&lt;br /&gt;
== Compiling the Mplayer Plugins and linking them with MPEG-1 Audio Layer 3 (MP3) and MPEG-4 AAC Codecs ==&lt;br /&gt;
&lt;br /&gt;
Mplayer is provided as an example environment for developing and testing Codecs and HiFi 2 software. There&lt;br /&gt;
are two ways to build Mplayer and the plug-in modules that use the codecs. The buildroot&lt;br /&gt;
tree (pulled with git) has a copy of mplayer and the plugins that can be built in the&lt;br /&gt;
snapshot via &#039;make menuconfig&#039;. This is a good environment to use once codecs are&lt;br /&gt;
developed and debugged. &lt;br /&gt;
&lt;br /&gt;
To facilitate development the mplayer packages can be copied to your NFS mounted development&lt;br /&gt;
environment. From there you can just configure mplayer to compile on the board and debug&lt;br /&gt;
mplayer and your codecs with gdb locally. &lt;br /&gt;
&lt;br /&gt;
In the default user home directory we have a directory /home/default/buildroot_mplayer_stuff&lt;br /&gt;
with a copy of three of the mplayer packages:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [root@hifi buildroot_mplayer_stuff]# &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
     drwxr-xr-x   34 root     root         4096 Nov 10 05:01 MPlayer-1.0rc2/&lt;br /&gt;
     drwxr-xr-x    4 root     root         4096 Nov 10 01:36 mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
     drwxr-xr-x    3 root     root         4096 Nov 10 00:57 mplayer_hifi2_mp3_plugin/&lt;br /&gt;
&lt;br /&gt;
they were simply copied from the buildroot-xtensa-HiFi2-Snapshot.2/package directory.&lt;br /&gt;
&lt;br /&gt;
To get your development environment ready to compile the mplayer plug-ins you need &lt;br /&gt;
to configure Mplayer to use the local C compiler and linker:&lt;br /&gt;
&lt;br /&gt;
    # &#039;&#039;&#039;cd /home/default/buildroot_mplayer_stuff/MPlayer-1.0rc2/&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;CFLAGS=&amp;quot;-g3&amp;quot; ./configure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will take about 15 minutes to configure. After that you can build the&lt;br /&gt;
plugins or mplayer. If you want to recompile mplayer it&#039;s likely best/necessary&lt;br /&gt;
to use the same args to .configure as used by buildroot:&lt;br /&gt;
&lt;br /&gt;
        .CFLAGS=&amp;quot;-g3&amp;quot; ./configure \&lt;br /&gt;
                --prefix=/usr \&lt;br /&gt;
                --confdir=/etc/mplayer \&lt;br /&gt;
                --with-extraincdir=/usr/include \&lt;br /&gt;
                --with-extralibdir=/lib \&lt;br /&gt;
                --disable-gui \&lt;br /&gt;
                --enable-mad \&lt;br /&gt;
                --enable-fbdev \&lt;br /&gt;
                --disable-mencoder \&lt;br /&gt;
                --disable-dvdnav \&lt;br /&gt;
                --disable-dvdread \&lt;br /&gt;
                --disable-dvdread-internal \&lt;br /&gt;
                --disable-libdvdcss-internal \&lt;br /&gt;
                --disable-big-endian \&lt;br /&gt;
                --disable-nemesi \&lt;br /&gt;
                --disable-tv \&lt;br /&gt;
                --enable-dynamic-plugins&lt;br /&gt;
&lt;br /&gt;
We are currently able to compile mplayer on the LX200 but&lt;br /&gt;
due to space limitations it&#039;s not possible to compile it -O0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s focus on compiling linking the plugins. They are a nice&lt;br /&gt;
example of compiling an audio application on the LX200.&lt;br /&gt;
&lt;br /&gt;
We modified the plugin Makefile slightly, and they are available in /home/default/mplayer_packages.&lt;br /&gt;
These additions just instruct make how to fetch the codecs and build and install the plugins as explained&lt;br /&gt;
in the Chapter 7 of the Linux HiFi application note. With these Makefile additions and the Tensilica&lt;br /&gt;
codecs available in the /plugins directory is very easy.&lt;br /&gt;
&lt;br /&gt;
For example the mp3 plugin has this addition:&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    # We assume Tensilica Codecs have been mounted at /codecs&lt;br /&gt;
    # via /etc/fstab during boot.&lt;br /&gt;
    #&lt;br /&gt;
    CODEC_PACKAGE=xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib&lt;br /&gt;
    CODEC_PACKAGE_LOCATION=/codecs&lt;br /&gt;
    MPLAYER_DEVEL_LOCATION=/home/default/buildroot_mplayer_stuff&lt;br /&gt;
     &lt;br /&gt;
    all: &#039;&#039;&#039;$(XA_CODEC_NAME)&#039;&#039;&#039; $(SLIBNAME) $(XA_CODEC_NAME).so&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    $(CODEC_PACKAGE).tgz:&lt;br /&gt;
            cp $(CODEC_PACKAGE_LOCATION)/$(CODEC_PACKAGE).tgz .&lt;br /&gt;
    &lt;br /&gt;
    $(CODEC_PACKAGE).tar:: $(CODEC_PACKAGE).tgz&lt;br /&gt;
            gunzip $(CODEC_PACKAGE).tgz&lt;br /&gt;
    &lt;br /&gt;
    $(XA_CODEC_NAME):: $(CODEC_PACKAGE).tar&lt;br /&gt;
              tar xf $(CODEC_PACKAGE).tar&lt;br /&gt;
    &lt;br /&gt;
    install::&lt;br /&gt;
            @-mkdir /etc/mplayer&lt;br /&gt;
            cp codecs.conf /etc/mplayer&lt;br /&gt;
            @-mkdir /usr/lib/mplayer&lt;br /&gt;
            cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
            cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
            chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
            chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
The make file will be just providing a codec config file for mplayer at &#039;&#039;&#039;/etc/mplayer/codecs.conf&#039;&#039;&#039; and&lt;br /&gt;
copying the plug-in to &#039;&#039;&#039;/usr/lib/mplayer&#039;&#039;&#039;. To install the mp3 codec plugin and mplayer&lt;br /&gt;
config file just copy your codec that was compiled with &#039;&#039;&#039;xcc&#039;&#039;&#039; to the directory, compile it,&lt;br /&gt;
and install. To add mp3 and aac plugins to mplayer you just type &#039;&#039;&#039;make&#039;&#039;&#039; followed by &#039;&#039;&#039;make install&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]# &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
    cp /codecs/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz .&lt;br /&gt;
    gunzip xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&lt;br /&gt;
    tar xf xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tar&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Ic&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c: In function &#039;xa_mp3_decode_frame&#039;:&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:185: warning: pointer targets in passing argument 1 of &#039;xa_mp3_audio_read&#039; differ in signedness&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:163: warning: unused variable &#039;j&#039;&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c: In function &#039;mp3_codec_init&#039;:&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:517: warning: pointer targets in passing argument 1 of &#039;xa_mp3_audio_read&#039; differ in signedness&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c: At top level:&lt;br /&gt;
    xa_mp3_dec_sample_testbench.c:112: warning: &#039;pack_32_to_24_bits&#039; defined but not used&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Ic&lt;br /&gt;
    ad_xa_mp3_dec.c: In function &#039;xa_mp3_audio_read&#039;:&lt;br /&gt;
    ad_xa_mp3_dec.c:26: warning: pointer targets in passing argument 2 of &#039;demux_read_data&#039; differ in signedness&lt;br /&gt;
    ad_xa_mp3_dec.c: In function &#039;init&#039;:&lt;br /&gt;
    ad_xa_mp3_dec.c:42: warning: pointer targets in passing argument 1 of &#039;xa_mp3_decode_frame&#039; differ in signedness&lt;br /&gt;
    ad_xa_mp3_dec.c: At top level:&lt;br /&gt;
    ad_xa_mp3_dec.c:52: warning: unused parameter &#039;sh&#039;&lt;br /&gt;
    ad_xa_mp3_dec.c:56: warning: unused parameter &#039;arg&#039;&lt;br /&gt;
    ad_xa_mp3_dec.c:78: warning: unused parameter &#039;sh_audio&#039;&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Im&lt;br /&gt;
    cc -I../libavcodec -I../libavformat -I. -I.. -I../libavutil -W -Wall -O2   -pipe -g3  -D_REENTRANT -DHAVE_CONFIG_H -I/usr/include  -DNDEBUG -fvisibility=hidden -Ixa_mp3_dec/include -I../MPlayer-1.0rc2 -Ie&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]#&lt;br /&gt;
&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]# &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
    mkdir: cannot create directory &#039;/etc/mplayer&#039;: File exists&lt;br /&gt;
    make: [install] Error 1 (ignored)&lt;br /&gt;
    cp codecs.conf /etc/mplayer&lt;br /&gt;
    mkdir: cannot create directory &#039;/usr/lib/mplayer&#039;: File exists&lt;br /&gt;
    make: [install] Error 1 (ignored)&lt;br /&gt;
    cp ad_xa_mp3_dec.so /usr/lib/mplayer/&lt;br /&gt;
    cp xa_mp3_dec.so /usr/lib/mplayer&lt;br /&gt;
    chmod 755 /usr/lib/mplayer/ad_xa_mp3_dec.so&lt;br /&gt;
    chmod 755 /usr/lib/mplayer/xa_mp3_dec.so&lt;br /&gt;
    [root@hifi mplayer_hifi2_mp3_plugin]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
The makefile unpacked of the Tensilica mp3 codec tarball will installed the following files:&lt;br /&gt;
 &lt;br /&gt;
    xa_mp3_dec/&lt;br /&gt;
    xa_mp3_dec/README&lt;br /&gt;
    xa_mp3_dec/include/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/&lt;br /&gt;
    xa_mp3_dec/include/mp3_dec/xa_mp3_dec_api.h&lt;br /&gt;
    xa_mp3_dec/include/xa_apicmd_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_handler.h&lt;br /&gt;
    xa_mp3_dec/include/xa_error_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_memory_standards.h&lt;br /&gt;
    xa_mp3_dec/include/xa_type_def.h&lt;br /&gt;
    xa_mp3_dec/test/&lt;br /&gt;
    xa_mp3_dec/test/build/&lt;br /&gt;
    xa_mp3_dec/test/build/ldscript_stream_data.txt&lt;br /&gt;
    xa_mp3_dec/test/build/makefile_testbench_sample&lt;br /&gt;
    xa_mp3_dec/test/build/paramfilesimple.txt&lt;br /&gt;
    xa_mp3_dec/test/include/&lt;br /&gt;
    xa_mp3_dec/test/include/id3_tag_decode.h&lt;br /&gt;
    xa_mp3_dec/test/src/&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_sample_testbench.c&lt;br /&gt;
    xa_mp3_dec/test/src/id3_tag_decode.c&lt;br /&gt;
    xa_mp3_dec/test/src/stream_data.c&lt;br /&gt;
    xa_mp3_dec/test/src/xa_mp3_dec_error_handler.c&lt;br /&gt;
    xa_mp3_dec/test/test_inp/&lt;br /&gt;
    xa_mp3_dec/test/test_inp/compl.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_inp/hihat.mp3&lt;br /&gt;
    xa_mp3_dec/test/test_out/&lt;br /&gt;
    xa_mp3_dec/test/test_out/force_mkdir.txt&lt;br /&gt;
    xa_mp3_dec/test/test_ref/&lt;br /&gt;
    xa_mp3_dec/test/test_ref/compl_24bit.wav&lt;br /&gt;
    xa_mp3_dec/test/test_ref/hihat_16bit.wav&lt;br /&gt;
    xa_mp3_dec/lib/&lt;br /&gt;
    xa_mp3_dec/lib/xa_mp3_dec.a&lt;br /&gt;
    xa_mp3_dec/doc/&lt;br /&gt;
    xa_mp3_dec/doc/HiFi2-MP3-DecoderProgrammersGuide.pdf&lt;br /&gt;
&lt;br /&gt;
Now, having built and installed the mp3 plugin, do the same for the AAC codec.&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# cd /home/default/mplayer_packages/mplayer_hifi2_aacplus_v2_plugin/&lt;br /&gt;
    [root@hifi mplayer_hifi2_aacplus_v2_plugin]# &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi mplayer_hifi2_aacplus_v2_plugin]# &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Additional codecs can be downloaded from the mplayer web site, configured,&lt;br /&gt;
compiled and can be installed as usual.&lt;br /&gt;
&lt;br /&gt;
   http://www.mplayerhq.hu/DOCS/HTML/en/codec-installation.html&lt;br /&gt;
&lt;br /&gt;
   [opencore-amr | opencore-amr]&lt;br /&gt;
&lt;br /&gt;
opencore-amr builds fine and the x264-snapshot compiles completely&lt;br /&gt;
but the Makefile and code needs to be set up for ARCH xtensa. The&lt;br /&gt;
GPL AAC decoder, faad, has out of date autoconf files, config.sub&lt;br /&gt;
and config.guess, need to be updated for Xtensa. This can be easily&lt;br /&gt;
done by copying config.sub and config.guess from the x264-snapshot&lt;br /&gt;
which had up to date versions recognizing xtensa correctly. &lt;br /&gt;
&lt;br /&gt;
Add on codec install by default to /usr/local/lib and the ldconfig&lt;br /&gt;
config file /etc/ld.so.conf needs to have /usr/local/lib added.&lt;br /&gt;
&lt;br /&gt;
Lots of opportunity likely exists for optimizing these codec for&lt;br /&gt;
Xtensa extensibility. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - Add missing C file, make clean deletes it!]&lt;br /&gt;
&lt;br /&gt;
The xa_mp3_dec.a archive will be used by the Makefile in&lt;br /&gt;
the mplayer_hifi2_mp3_plugin directory to make the mplayer plug-in. &lt;br /&gt;
Section 6 of the &#039;&#039;&#039;Using Tensilica HiFi 2 Codec on Xtensa Linux with MPlayer&#039;&#039; Application Note&lt;br /&gt;
has a detailed description of the encapsulation process used by the plug-ins.&lt;br /&gt;
&lt;br /&gt;
== Adding Packages and/or Codec to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a challenging experience and&lt;br /&gt;
worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, under extreme conditions memory can get tight and cause application to be killed.&lt;br /&gt;
    a. We will be trying procedure documented in U-Boot Manual to swap over NFS.&lt;br /&gt;
  &lt;br /&gt;
  3. Building the complete C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler was crashing and make had to be restarted.&lt;br /&gt;
       We are not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel being enabled or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
   &lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
   &lt;br /&gt;
    c. We saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During weeks&lt;br /&gt;
       of testing we haven&#039;t seen the U-Boot environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot was hanging periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to have be worse when network activity is high.&lt;br /&gt;
     This problem also seems to have gone away in the past few weeks.&lt;br /&gt;
     It may have been a duplication with MAC addresses.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  11. The busybox vesion of vi doesn&#039;t work very good, we are using symbolic pointer&lt;br /&gt;
     &lt;br /&gt;
       /usr/local/bin/vi ---&amp;gt; /usr/local/bin/vim&lt;br /&gt;
     &lt;br /&gt;
       /usr/local/bin is searched first via bash profile and rc. &lt;br /&gt;
       The vim version works great and doesn&#039;t seem to use very much memory.&lt;br /&gt;
   &lt;br /&gt;
   12. mplayer codecs by default install to /usr/local/lib but&lt;br /&gt;
       the &#039;&#039;&#039;ldconfig&#039;&#039;&#039; config file needs to be updated to search /usr/local/lib. &lt;br /&gt;
           Ex:&lt;br /&gt;
                /etc/ld.so.conf:&lt;br /&gt;
                     # /usr/local/src/faad2-2.7/:&lt;br /&gt;
                     #               libfaad.a         libfaad.la        libfaad.so@&lt;br /&gt;
                     #               libfaad.so.2@     libfaad.so.2.0.0* libmp4ff.a&lt;br /&gt;
                     #&lt;br /&gt;
                     /usr/local/lib&lt;br /&gt;
        &lt;br /&gt;
       /etc/ld.so.conf.d exist but is being ignored by &#039;&#039;&#039;ldconfig&#039;&#039;&#039; even if included via ld.so.conf:&lt;br /&gt;
                include ld.so.conf.d/*.conf&lt;br /&gt;
       &lt;br /&gt;
       REMIND: update /home/default/save_root_files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Main Xtensa Linux resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Thanks to=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc&lt;br /&gt;
* dan&lt;br /&gt;
* maxim&lt;br /&gt;
&lt;br /&gt;
And the rest of the people in the Linux-Xtensa mailing list, if you cannot go through some of the steps, don&#039;t hesitate to ask on the mailing list, there&#039;s always somebody willing to help you!&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=580</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=580"/>
		<updated>2012-03-21T02:37:11Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; U-Boot for the new DC233, with the V3 MMU, is now working fine and checked into the master branch. Work is almost complete with the Linux 2.6.29-smp kernel, with&lt;br /&gt;
Linux now booting from this updated U-Boot. The kernel on the &#039;Initialize_MMU_Inside_vmlinux&#039; branch seems to be working fine, and has survived 14 hours of stress testing so far.&lt;br /&gt;
Plain is to merge this and a few additional branches to the master branch and then move forward to a newer version of the Linux kernel.&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type: &lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;make dc233c_xtav110_config&#039;&#039;&#039;      &lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                          &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes. &lt;br /&gt;
&lt;br /&gt;
This is likely a good time to copy &#039;&#039;&#039;mkimage&#039;&#039;&#039; to your ${HOME}/bin directory&lt;br /&gt;
for later use while building the Linux kernel. The &#039;&#039;&#039;mkimage&#039;&#039;&#039; program was&lt;br /&gt;
just built in the tool directory by the above &#039;&#039;&#039;make all&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
  $ &#039;&#039;&#039;cd tools&#039;&#039;&#039;&lt;br /&gt;
  $ &#039;&#039;&#039;cp mkimage ~/bin&#039;&#039;&#039;                                           [NOTE: &#039;&#039;&#039;mkimage&#039;&#039;&#039; should be in your search PATH while building the Linux kernel]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) if V3_MMU&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) else&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0XD0000000&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) end&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 9 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
  Erased 9 sectors&lt;br /&gt;
  U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 9 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a &#039;&#039;&#039;LX200&#039;&#039;&#039; with the &#039;&#039;&#039;V2 MMU&#039;&#039;&#039; with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, on the LX110 move DIP switch 4 to the ON position.  &lt;br /&gt;
Next, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV110: Avnet board + Xilinx LX110 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 48 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:00&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=579</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=579"/>
		<updated>2012-03-21T02:34:10Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; U-Boot for the new DC233, with the V3 MMU, is now working fine and checked into the master branch. Work is almost complete with the Linux 2.6.29-smp kernel, with&lt;br /&gt;
Linux now booting from this updated U-Boot. The kernel on the &#039;Initialize_MMU_Inside_vmlinux&#039; branch seems to be working fine, and has survived 14 hours of stress testing so far.&lt;br /&gt;
Plain is to merge this and a few additional branches to the master branch and then move forward to a newer version of the Linux kernel.&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type: &lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;make dc233c_xtav110_config&#039;&#039;&#039;      &lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                          &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes. &lt;br /&gt;
&lt;br /&gt;
This is likely a good time to copy &#039;&#039;&#039;mkimage&#039;&#039;&#039; to your ${HOME}/bin directory&lt;br /&gt;
for later use while building the Linux kernel. The &#039;&#039;&#039;mkimage&#039;&#039;&#039; program was&lt;br /&gt;
just built in the tool directory by the above &#039;&#039;&#039;make all&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
  $ &#039;&#039;&#039;cd tools&#039;&#039;&#039;&lt;br /&gt;
  $ &#039;&#039;&#039;cp mkimage ~/bin&#039;&#039;&#039;                                           [NOTE: &#039;&#039;&#039;mkimage&#039;&#039;&#039; should be in your search PATH while building the Linux kernel]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
if V3_MMU&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
else&lt;br /&gt;
    (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0XD0000000&#039;&#039;&#039;&lt;br /&gt;
end&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 9 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
  Erased 9 sectors&lt;br /&gt;
  U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 9 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a &#039;&#039;&#039;LX200&#039;&#039;&#039; with the &#039;&#039;&#039;V2 MMU&#039;&#039;&#039; with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, on the LX110 move DIP switch 4 to the ON position.  &lt;br /&gt;
Next, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV110: Avnet board + Xilinx LX110 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 48 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:00&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=578</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=578"/>
		<updated>2012-03-16T21:18:48Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; U-Boot for the new DC233, with the V3 MMU, is now working fine and checked into the master branch. Work is almost complete with the Linux 2.6.29-smp kernel, with&lt;br /&gt;
Linux now booting from this updated U-Boot. The kernel on the &#039;Initialize_MMU_Inside_vmlinux&#039; branch seems to be working fine, and has survived 14 hours of stress testing so far.&lt;br /&gt;
Plain is to merge this and a few additional branches to the master branch and then move forward to a newer version of the Linux kernel.&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type: &lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;make dc233c_xtav110_config&#039;&#039;&#039;      &lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                          &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes. &lt;br /&gt;
&lt;br /&gt;
This is likely a good time to copy &#039;&#039;&#039;mkimage&#039;&#039;&#039; to your ${HOME}/bin directory&lt;br /&gt;
for later use while building the Linux kernel. The &#039;&#039;&#039;mkimage&#039;&#039;&#039; program was&lt;br /&gt;
just built in the tool directory by the above &#039;&#039;&#039;make all&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
  $ &#039;&#039;&#039;cd tools&#039;&#039;&#039;&lt;br /&gt;
  $ &#039;&#039;&#039;cp mkimage ~/bin&#039;&#039;&#039;                                           [NOTE: &#039;&#039;&#039;mkimage&#039;&#039;&#039; should be in your search PATH while building the Linux kernel]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 9 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
  Erased 9 sectors&lt;br /&gt;
  U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 9 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a &#039;&#039;&#039;LX200&#039;&#039;&#039; with the &#039;&#039;&#039;V2 MMU&#039;&#039;&#039; with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, on the LX110 move DIP switch 4 to the ON position.  &lt;br /&gt;
Next, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV110: Avnet board + Xilinx LX110 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 48 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:00&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Buildroot_Snapshots&amp;diff=565</id>
		<title>Buildroot Snapshots</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Buildroot_Snapshots&amp;diff=565"/>
		<updated>2011-06-22T07:22:32Z</updated>

		<summary type="html">&lt;p&gt;Piet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Stable Snapshots of Buildroot and the Linux kernel [CURRENTLY OUT OF DATE] =&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. Unfortunately the current snapshots are very old and need to be replaced with new versions. We currently recommend you clone git repositories and use stable branches/tags.&lt;br /&gt;
&lt;br /&gt;
(If you want the latest sources instead, please refer to the&lt;br /&gt;
latest [[Buildroot_Build_Instructions]].)&lt;br /&gt;
&lt;br /&gt;
Unofficial LTP test results are available in the [[LTP_Results| LTP Test Results]] page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=1 style=&amp;quot;text-align:center&amp;quot; cellpadding=4 cellspacing=0&lt;br /&gt;
|+ &#039;&#039;&#039;List of GIT Commit Points for Each Snapshot and the Current Recommended Source Code&#039;&#039;&#039; &lt;br /&gt;
|-   &lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Snapshot&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Linux Kernel&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Buildroot&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
! GIT Tree !! Commit/Tag !! GIT Tree !! Commit/Tag/Branch&lt;br /&gt;
|-&lt;br /&gt;
| linux-xtensa-20080123.tar.gz || xtensa-2.6.24 || 50f17d5ba5d2 || buildroot-xtensa || dd6f0d70fb1f&lt;br /&gt;
| First snapshot [No Longer Supported]&lt;br /&gt;
|-   &lt;br /&gt;
| linux-xtensa-20080711.tar.gz || xtensa-2.6.24 || ce5325b68b14 || buildroot-xtensa || 16f39dfdde4b&lt;br /&gt;
| Second snapshot [No Longer Supported]&lt;br /&gt;
|-&lt;br /&gt;
|                              || xtensa-2.6.29-smp ||          || buildroot-xtensa-HiFi2-Snapshot || snapshot_2+SMP          &lt;br /&gt;
| Second snapshot + SMP [Only Available via GIT]&lt;br /&gt;
&lt;br /&gt;
|-   &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=564</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=564"/>
		<updated>2011-05-03T04:28:41Z</updated>

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

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

		<summary type="html">&lt;p&gt;Piet: /* Configuring U-Boot to Boot Linux [Needs to be Updated for A2000 [Suresh?] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a PRIVATE guide for how to use the A2000 board in a comfortable and productive Development environment.&lt;br /&gt;
If something doesn&#039;t work or isn&#039;t covered in this guide, please keep the discussion limited to involved parties.&lt;br /&gt;
Access to the git repositories is limited and being monitored; unauthorized access is a felony and will be prosecuted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#ffffcc; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NEWS:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress, though virtually complete. Just needs to have an a another engineer at Tensilica run through this procedure and make sure that we haven&#039;t missed anything.&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Fedora Core 5 and Fedora Core 9. Test done while using the Fedora 9 based kernel and the stable branch of the Xtensa kernel appear, so far, to be a bit better. Not seeing any compile errors while stressing the system with LTP, two compiles, two mplayers, hifitest, top, pstree, and top for the&lt;br /&gt;
first 18 hours; appears to be running perfect till then. No gcc commands or ssh sessions getting killed until almost a day of testing. Only the Unaligned memory access warning on gethostid01 that a staff engineer diagnosed as being a mistake in the gethostid01 LTP test program. &lt;br /&gt;
&lt;br /&gt;
* NOTES for Tensilica and Transwitch Developers:&lt;br /&gt;
** [To be provided in the future]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document is addressed to developers who have received an A2000 prototyping board from Transwitch&lt;br /&gt;
for Linux development and testing.&lt;br /&gt;
&lt;br /&gt;
This document goes over the steps needed to set up the A2000 board for Linux development.&lt;br /&gt;
To summarize: &lt;br /&gt;
* Setup the board.  It likely comes with U-boot and a flash version of Linux pre-installed, ready to mount a linux root filesystem via NFS.&lt;br /&gt;
* Install &#039;&#039;&#039;git&#039;&#039;&#039;.&lt;br /&gt;
* Download buildroot and linux kernel trees, pre-configured and built for A2000 development.&lt;br /&gt;
* Setup a TFTP server to provide the linux kernel to U-Boot.&lt;br /&gt;
* Setup an NFS server to export a linux root file system.&lt;br /&gt;
* Setup the Linux kernel to boot from the root file system provided by the NFS server.&lt;br /&gt;
* Suggests a possible way to tailor the board for easy software development just before booting.&lt;br /&gt;
&lt;br /&gt;
Once the development board is up and running, this document: &lt;br /&gt;
* Demonstrates two procedures for compiling, linking, and debugging applications in a productive development environment.&lt;br /&gt;
* Suggest how developers can add their code to buildroot and come up again with their same development environment.&lt;br /&gt;
&lt;br /&gt;
All development is expected to be done on a Linux host.  (One can in principle use Windows to&lt;br /&gt;
develop target libraries.  However, linking and subsequent steps need to be done in Linux.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading the Latest A2000 Buildroot and Kernel Snapshots ==&lt;br /&gt;
&lt;br /&gt;
The A2000 development environment is maintained here in a source code version control system named &#039;git&#039;.   The &#039;&#039;&#039;git&#039;&#039;&#039; tools are useful when working with this development environment, though they are not strictly necessary.  This document generally assumes the use of &#039;&#039;&#039;git&#039;&#039;&#039;, which provides more opportunities for modifying this environment as needed (e.g. building more optional buildroot packages).  But points out alternatives to allow getting up and running without having to set it up.&lt;br /&gt;
&lt;br /&gt;
=== Installing git ===&lt;br /&gt;
&lt;br /&gt;
On Fedora git is usually available as a RPM and can be easily installed with YUM:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;yum install git&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;yum install git-gui&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;yum install qgit&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively, you should always be able to install &#039;&#039;&#039;git&#039;&#039;&#039;, by downloading a recent tarball from the [http://www.kernel.org/pub/software/scm/git/ official site].  &lt;br /&gt;
For example, &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with enough disk space, and do:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball, and make and install it. Here we show how to install it to your ~/bin directory:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
        $ &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The git makefile can be instructed to install &#039;&#039;&#039;git&#039;&#039;&#039; to &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt; as root for system wide access:&lt;br /&gt;
&lt;br /&gt;
        $ &#039;&#039;&#039;cp git-1.6.5.tar.gz&#039;&#039;&#039; /tmp&lt;br /&gt;
        $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
        Password: &lt;br /&gt;
        # &#039;&#039;&#039;cd /usr/local/src/&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;mkdir git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cp /tmp/git-1.6.5.tar.gz .&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;gunzip git-1.6.5.tar.gz&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;tar xf git-1.6.5.tar&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;cd git-1.6.5&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make prefix=/usr/local&#039;&#039;&#039;&lt;br /&gt;
        # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;INSTALL&#039;&#039; instruction at the top of the git src directory for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &#039;&#039;&#039;git&#039;&#039;&#039; provides easy access to the binaries used to bring up the A2000 development environment, and leaves in place the infrastructure to modify and build this environment should you wish to. Any changes to &#039;&#039;&#039;git&#039;&#039;&#039;-managed source trees are easily observed with the &#039;&#039;&#039;git&#039;&#039;&#039; tools.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Buildroot Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: The A2000 snapshot is in the process of being made and is only available to a few Tensilica and Transwitch Developers. &lt;br /&gt;
You must use your linux-xtensa.org login user name and password and be in the txcc user group. If you don&#039;t have an account, &lt;br /&gt;
and need one, write to: &lt;br /&gt;
* Pete Delaney&amp;gt; &amp;lt;piet@tensilica.com&amp;gt;, &lt;br /&gt;
* Marc Gauthier &amp;lt;marc@tensilica.com&amp;gt;, &lt;br /&gt;
* Suresh Kadavath &amp;lt;Suresh.Kadavath@transwitch.com&amp;gt;,&lt;br /&gt;
* Shimon Edelhaus &amp;lt;Shimon.Edelhaus@transwitch.com&amp;gt;, and&lt;br /&gt;
* Prasanna Rao &amp;lt;Prasanna.Rao@transwitch.com&amp;gt;&lt;br /&gt;
to receive a login user-name and initial password.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the buildroot environment (toolchain and root filesystem), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space.&lt;br /&gt;
It&#039;s recommended to keep the git repo&#039;s used for A2000 development together on a filesystem that is exported with NFS write permission.&lt;br /&gt;
For this A2000 board wiki page we will use &#039;&#039;&#039;/exports/src/Transswitch/Development&#039;&#039;&#039; and set a tcsh environment variable &#039;A2000_ROOT&#039; to refer to it.&lt;br /&gt;
In this case you would do the following:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv A2000_ROOT /exports/src/Transswitch/Development&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -r $A2000_ROOT&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd $A2000_ROOT&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;git clone ssh+git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;git clone ssh+git://user@git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
Ex:&lt;br /&gt;
    $ &#039;&#039;&#039;git clone ssh+git://piet@git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git clone ssh+git://txcc@git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git clone ssh+git://ksuresh@git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git clone ssh+git://sunal@git.linux-xtensa.org/git/buildroot/buildroot-xtensa-HiFi2-Snapshot.git&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;ln -s buildroot-xtensa-HiFi2-Snapshot buildroot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track TXCC_A2000_Stable origin/TXCC_A2000_Stable&#039;&#039;&#039;   [NOTE: TXCC_A2000 Branch &#039;&#039;&#039;isn&#039;t currently booting&#039;&#039;&#039;, module problem with ttys]&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout TXCC_A2000_Stable&#039;&#039;&#039; &lt;br /&gt;
                                &lt;br /&gt;
The last two lines checkout the latest branch (preconfigured for Development on the A2000 board). Outside of Tensilica this will take a rather long time due to the current limitation of using a single T1 line. Subsequent updates can be downloaded quickly using [http://www.kernel.org/pub/software/scm/git/docs/git-pull.html git-pull].&lt;br /&gt;
&lt;br /&gt;
You can examine the tree (git repository) and its history visually using &amp;lt;tt&amp;gt;git gui&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The git GUI is a faster and more convenient method for checking out the HiFi-2 snapshot.  To check out the snapshot_2+SMP branch simply run the command &#039;git gui&#039; and then pull down the branch-&amp;gt;create menu. Next select &amp;lt;&amp;gt;Match Tracking Branch Name  and click on &#039;&#039;origin/snapshot_2+SMP&#039;&#039;. Finally hit the Create Button.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git gui&#039;&#039;&#039;&#039;&#039;                                                                        &lt;br /&gt;
       [Branch] -&amp;gt; Create...                                                                  &lt;br /&gt;
          &amp;lt;&amp;gt; Match Tracking Branch Name                                                     &lt;br /&gt;
          &amp;lt;&amp;gt; Tracking Branch                                                                 &lt;br /&gt;
                origin/TXCC-A2000_Stable                             [NOTE: TXCC_A2000 Branch &#039;&#039;&#039;isn&#039;t currently booting&#039;&#039;&#039;, module problem with ttys]                                                   &lt;br /&gt;
          [Create]                                                                            &lt;br /&gt;
      [Repository]--&amp;gt; Quit&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING&#039;&#039;&#039;&lt;br /&gt;
Currently it seems to be necessary for their to exist a symbolic pointer at &#039;&#039;&#039;/opt/buildroot&#039;&#039;&#039; to the location&lt;br /&gt;
of the buildroot that your going to used. Packages like openssl have &#039;&#039;&#039;&amp;quot;/opt/buildroot&amp;quot;&#039;&#039;&#039; explicitly in the TXCC&lt;br /&gt;
a2000_src. It&#039;s also convenient to have a symlink to the name of the git repo checked out to &#039;&#039;&#039;buildroot&#039;&#039;&#039;&lt;br /&gt;
which we snuck in above.&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;cd $A2000_ROOT&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;ln -s buildroot-xtensa-HiFi2-Snapshot buildroot       [Also done above  when you checked out the git repo]&lt;br /&gt;
     $ &#039;&#039;&#039;ln -s $TXCC_ROOT/buildroot /opt/buildroot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Your symlinks will end up looking like this:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;cd /opt&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;ls -l buildroot&#039;&#039;&#039;&lt;br /&gt;
         buildroot -&amp;gt; /exports/src/Transswitch/Development/buildroot-xtensa-HiFi2-Snapshot&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039; cd  $A2000_ROOT&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;ls -l buildroot&#039;&#039;&#039;&lt;br /&gt;
           buildroot -&amp;gt; buildroot-xtensa-HiFi2-Snapshot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following packages/utilities are needed on the Host machine for the build process.  Please make sure that they are installed before proceeding further.&lt;br /&gt;
    - help2man ---&amp;gt; use &#039;yum install help2man&#039; to install.&lt;br /&gt;
    - automake ---&amp;gt; use &#039;yum install automake&#039; to install.&lt;br /&gt;
&lt;br /&gt;
Now is likely a good time to start your buildroot building, it will take a quite a while. We recommend&lt;br /&gt;
starting with the default configurations and modifying them if need in the &#039;&#039;&#039;menuconfig&#039;&#039;&#039; menus.&lt;br /&gt;
&lt;br /&gt;
Currently uClibc isn&#039;t adding -g to the uClibc compile options, so you likely want to do that&lt;br /&gt;
one for now while initializing the menus:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;cd $A2000_ROOT/buildroot&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;    &lt;br /&gt;
          uClibc development/debugging options ---&amp;gt;&lt;br /&gt;
                ()  Enter any extra CFLAGS to use to build uClibc&lt;br /&gt;
                    -g&lt;br /&gt;
                (-g) Enter any extra CFLAGS to use to build uClibc &lt;br /&gt;
          uClibc development/debugging options  ---&amp;gt; &lt;br /&gt;
          Exit&lt;br /&gt;
            yes&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next fire off the buildroot build:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;make |&amp;amp; tee Make.log&lt;br /&gt;
&lt;br /&gt;
That could take a few hours to build, so now lets move on to the other git repos.&lt;br /&gt;
&lt;br /&gt;
=== Installing and Building the Linux Kernel Snapshot (Not Locked) ===&lt;br /&gt;
&lt;br /&gt;
To install the Linux kernel environment (kernel src, config, and HiFi-2 kernel U-Boot image), &amp;lt;tt&amp;gt;cd&amp;lt;/tt&amp;gt; to a location with a few GB of available disk space.&lt;br /&gt;
We recomend currently keeping all of the git repos together at the root of your TXCC workspace, &#039;&#039;&#039;TXCC_ROOT&#039;&#039;&#039;, and do:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd $A2000_ROOT&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git+ssh://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp-txcc.git&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;git clone git+ssh://user@git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp-txcc.git&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd xtensa-2.6.29-smp-txcc&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;git branch --track A2000 origin/A2000&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;git checkout A2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
As in the build root case, you can also checkout the branch easily from via &#039;&#039;&#039;git gui&#039;&#039;&#039; using the same procedure&lt;br /&gt;
mentioned above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE: On some system, like Fedora Core 9, the tftpboot directory has been moved to /var/lib/tftpboot.&lt;br /&gt;
In this case we recommend that you just added a symbolic pointer from /etc to  /var/lib/tftpboot:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;su&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;cd /etc&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ln -s /var/lib/tftpboot/ tftpboot&#039;&#039;&#039;&lt;br /&gt;
    # &#039;&#039;&#039;ls -ld tftpboot&#039;&#039;&#039;&lt;br /&gt;
        lrwxrwxrwx 1 root root 18 2009-11-23 21:14 tftpboot -&amp;gt; /var/lib/tftpboot/&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
== Setting up a TFTP Server to provide the Linux kernel to U-Boot ==&lt;br /&gt;
&lt;br /&gt;
The TFTP service is part of the xinetd and is installed on Fedora workstations. &lt;br /&gt;
You can see that it&#039;s installed with the check config command which manages the &lt;br /&gt;
/etc/rc.d/init.d startup scripts and with the yum search command:&lt;br /&gt;
&lt;br /&gt;
     $ &#039;&#039;&#039;chkconfig --list&#039;&#039;&#039;&lt;br /&gt;
        NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
        acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;
        xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        ypbind          0:off   1:off   2:off   3:on    4:on    5:on    6:off&lt;br /&gt;
        yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;
 &lt;br /&gt;
        xinetd based services:&lt;br /&gt;
                amanda:         off&lt;br /&gt;
                auth:           off&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                .&lt;br /&gt;
                rsync:          off&lt;br /&gt;
                &#039;&#039;&#039;tftp:           on&#039;&#039;&#039;                                                                 [NOTE that tftp is enabled]&lt;br /&gt;
                time:           off&lt;br /&gt;
                time-udp:       off&lt;br /&gt;
                uucp:           off&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $&lt;br /&gt;
       $ &#039;&#039;&#039;yum search tftp-server&#039;&#039;&#039;&lt;br /&gt;
        Loading &amp;quot;installonlyn&amp;quot; plugin&lt;br /&gt;
        Searching Packages:&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        Reading repository metadata in from local files&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        &#039;&#039;&#039;tftp-server.i386                         0.41-1.2.1             installed&#039;&#039;&#039;     [NOTE that tftp server is installed as part of the inet daemon]&lt;br /&gt;
        Matched from:&lt;br /&gt;
        tftp-server&lt;br /&gt;
        The Trivial File Transfer Protocol (TFTP) is normally used only for&lt;br /&gt;
        booting diskless workstations.  The tftp-server package provides the&lt;br /&gt;
        server for TFTP, which allows users to transfer files to and from a&lt;br /&gt;
        remote machine. TFTP provides very little security, and should not be&lt;br /&gt;
        enabled unless it is expressly needed.  The TFTP server is run from&lt;br /&gt;
        /etc/xinetd.d/tftp, and is disabled by default on Red Hat Linux systems.&lt;br /&gt;
      $&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TFTP is not normally enabled, to enable it just edit the file /etc/xinetd.d/tftp&lt;br /&gt;
and change the disable field to no:&lt;br /&gt;
&lt;br /&gt;
        # default: off&lt;br /&gt;
        # description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
        #       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
        #       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
        #       and to start the installation process for some operating systems.&lt;br /&gt;
        service tftp&lt;br /&gt;
        {&lt;br /&gt;
                socket_type             = dgram&lt;br /&gt;
                protocol                = udp&lt;br /&gt;
                wait                    = yes&lt;br /&gt;
                user                    = root&lt;br /&gt;
                server                  = /usr/sbin/in.tftpd                                [NOTE: /var/lib/tftpboot on Fedora Core 9]&lt;br /&gt;
                server_args             = -s /tftpboot&lt;br /&gt;
                &#039;&#039;&#039;disable                 = no&#039;&#039;&#039;&lt;br /&gt;
                per_source              = 11&lt;br /&gt;
                cps                     = 100 2&lt;br /&gt;
                flags                   = IPv4&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up an NFS Server to export the Root Filesystem ==&lt;br /&gt;
&lt;br /&gt;
The A2000 board running Linux can mount its root file-system from flash or over NFS.&lt;br /&gt;
Both file system were built using buildroot but a complete development filesystem&lt;br /&gt;
is available for developers in a compressed cpio format file,&lt;br /&gt;
and left in:&lt;br /&gt;
&lt;br /&gt;
    buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2/rootfs.xtensa_test_mmuhifi_c3.cpio.gz&lt;br /&gt;
&lt;br /&gt;
We will also be adding two additional small files-systems to make your development environment more comfortable&lt;br /&gt;
and less time consuming to get started:&lt;br /&gt;
&lt;br /&gt;
    /usr/default                                                                    [Home Directory for user &#039;default&#039;]&lt;br /&gt;
    /usr/local                                                                      [File system to place enhancements not done by buildroot]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pick a place on your workstation to export your boards file-systems and unpack the cpio and tar files.&lt;br /&gt;
For example here we will export three files-systems in /export:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;/exports/a2000_root&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;/exports/hifi-2_home_default&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;/exports/hifi-2_usr_local&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s and example of unpacking the three files-systems:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd buildroot-xtensa-HiFi2-Snapshot/buildroot-xtensa-smp/binaries/HiFi-2&#039;&#039;&#039; [Getting binary files in buildroot git repository]&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip rootfs.xtensa_test_mmuhifi_c3.cpio.gz&#039;&#039;&#039;                           [Uncompressing file-system cpio file]&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip a2000_home_default.tar.gz&#039;&#039;&#039;                                       [Uncompress /home/default tar ball]&lt;br /&gt;
    $ &#039;&#039;&#039;gunzip a2000_usr_local.tar.gz&#039;&#039;&#039;                                          [Uncompress /usr/local tar ball]&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;WHERE=$PWD&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;mkdir -p /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/a2000_root&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;cpio -i &amp;lt; $WHERE/rootfs.xtensa_test_mmuhifi_c3.cpio&#039;&#039;&#039;&lt;br /&gt;
    $&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf a2000_home_default.tar&#039;&#039;&#039;                                          [Tar in boards /home/default for export]&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf a2000_usr_local.tar&#039;&#039;&#039;                                             [Tar in boards /usr/local for export]&lt;br /&gt;
&lt;br /&gt;
Next add two lines to /etc/exports:&lt;br /&gt;
&lt;br /&gt;
    /exports                *(rw,no_root_squash,sync,no_wdelay)                     [Boards File-systems]&lt;br /&gt;
    /export                 *(rw,no_root_squash,sync,no_wdelay)                     [Buildroot source code]&lt;br /&gt;
&lt;br /&gt;
and restart you nfs services:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;/etc/rc.d/init.d/nfs restart&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
    $ &#039;&#039;&#039;/sbin/chkconfig nfs on&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The showmount command should show your NFS file systems now being exported:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;showmount -e&#039;&#039;&#039;&lt;br /&gt;
      Export list for mylinuxsystem.foobar.com:&lt;br /&gt;
      /export  *&lt;br /&gt;
      /exports *&lt;br /&gt;
    $&lt;br /&gt;
&lt;br /&gt;
== Configuring U-Boot to Boot Linux [Needs to be Updated for A2000 [Suresh?] ==&lt;br /&gt;
&lt;br /&gt;
Your A2000 board should have arrived with U-Boot installed in the flash ready to use. &lt;br /&gt;
If it fails to boot U-Boot or you happen to have a board without it there are instructions&lt;br /&gt;
at http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot to make it easy to instal&lt;br /&gt;
&lt;br /&gt;
Next, connect a serial interface to a text based terminal emulation program,&lt;br /&gt;
set to 38400 bps, no parity, 1 stop bit, no handshaking.&lt;br /&gt;
For an example of setting [http://en.wikipedia.org/wiki/Minicom minicom]&lt;br /&gt;
for this, see [[minicom_xtboard_setup|here]].&lt;br /&gt;
&lt;br /&gt;
When you initially power on your LX200 board it will come with a very long wait period before booting and will be waiting to be configured.&lt;br /&gt;
You can also hit one of the blue buttons next to the blue LED that&#039;s next to the PCI connector to reset the board. &lt;br /&gt;
&lt;br /&gt;
The minicom session should look like the following:&lt;br /&gt;
&lt;br /&gt;
        U-Boot 1.4 (Mar 14 2010 - 15:44:29)&lt;br /&gt;
 &lt;br /&gt;
        Board:  A2000 CPU: Xtensa C1_LX21M_V2 at 400.00 MHz&lt;br /&gt;
        SysRAM: 128 MB&lt;br /&gt;
 &lt;br /&gt;
        1st DATAFLASH INFORMATION&lt;br /&gt;
        DataFlash:MX25L12845E&lt;br /&gt;
        Nb pages:  65536&lt;br /&gt;
        Page Size:    256&lt;br /&gt;
        Size=16777216 bytes&lt;br /&gt;
        Logical address: 0x00000000&lt;br /&gt;
        Nb Erase Blocks:    256&lt;br /&gt;
        Erase Block Size:  65536&lt;br /&gt;
        Area 0: 00000000 to 0007FFFF&lt;br /&gt;
        Area 1: 00080000 to 00E7FFFF&lt;br /&gt;
        Area 2: 00E80000 to 00FBFFFF&lt;br /&gt;
        Area 3: 00FC0000 to 00FFFFFF&lt;br /&gt;
 &lt;br /&gt;
        2nd DATAFLASH INFORMATION&lt;br /&gt;
        DataFlash:MX25L12845E&lt;br /&gt;
        Nb pages:  65536&lt;br /&gt;
        Page Size:    256&lt;br /&gt;
        Size=16777216 bytes&lt;br /&gt;
        Logical address: 0x01000000&lt;br /&gt;
        Nb Erase Blocks:    256&lt;br /&gt;
        Erase Block Size:  65536&lt;br /&gt;
        Area 0: 01000000 to 01FFFFFF&lt;br /&gt;
        crc matched&lt;br /&gt;
        In:    serial&lt;br /&gt;
        Out:   serial&lt;br /&gt;
        Err:   serial&lt;br /&gt;
        MAC 0:    00:22:33:44:55:66&lt;br /&gt;
        IP:     192.168.11.237&lt;br /&gt;
        GMAC0&lt;br /&gt;
        Ethernet Link UP, Link Speed 1Gbps&lt;br /&gt;
        Hit any key to stop autoboot:  0&lt;br /&gt;
 &lt;br /&gt;
        U-Boot&amp;gt; printenv&lt;br /&gt;
        bootcmd=fsload ${SPLoadAddr} /boot/linux_sp.elf;fsload ${NPLoadAddr} /boot/roses_np.bin; bootelf ${SPLoadAddr}&lt;br /&gt;
        update_uboot=tftpboot ${UBootLoadAddr} ${uboot_img};erase ${UBootStart} ${UBootEnd};cp.b ${UBootLoadAddr} ${UBootStart} ${UBootSize};erase ${UBootCfgStart} ${UBoot}&lt;br /&gt;
        bootdelay=5&lt;br /&gt;
        baudrate=38400&lt;br /&gt;
        ethaddr=00:22:33:44:55:66&lt;br /&gt;
        netmask=255.255.255.0&lt;br /&gt;
        uboot_img=boot_sflash.bin&lt;br /&gt;
        fw_img=a2000_jffs&lt;br /&gt;
       cmbd_img=refmta&lt;br /&gt;
        cfg_img=a2000_config&lt;br /&gt;
        sp_img=linux_sp.elf&lt;br /&gt;
        np_img=roses_np.bin&lt;br /&gt;
        resv2_img=flash2_image&lt;br /&gt;
        resv3_img=flash3_or_flash4_image&lt;br /&gt;
        resv4_img=flash3_or_flash4_image&lt;br /&gt;
        tmpLoadAddr=0xD7000000&lt;br /&gt;
        UBootLoadAddr=0xD6000000&lt;br /&gt;
        SPLoadAddr=0xD5000000&lt;br /&gt;
        NPLoadAddr=0xD7000000&lt;br /&gt;
        UBootStart=0x00000000&lt;br /&gt;
        UBootEnd=0x0007FFFF&lt;br /&gt;
        UBootSize=0x00080000&lt;br /&gt;
        FwStart=0x00080000&lt;br /&gt;
        FwEnd=0x00E7FFFF&lt;br /&gt;
        FwSize=0x00E00000&lt;br /&gt;
        FwCfgStart=0x00E80000&lt;br /&gt;
        FwCfgEnd=0x00FBFFFF&lt;br /&gt;
        FwCfgSize=0x00140000&lt;br /&gt;
        UBootCfgStart=0x00FC0000&lt;br /&gt;
        UBootCfgEnd=0x00FFFFFF&lt;br /&gt;
        UBootCfgSize=0x00040000&lt;br /&gt;
        CmbdStart=0x00080000&lt;br /&gt;
        CmbdEnd=0x00FBFFFF&lt;br /&gt;
        CmbdSize=0x00F40000&lt;br /&gt;
        Resv2Start=0x01000000&lt;br /&gt;
        Resv2End=0x01FFFFFF&lt;br /&gt;
        Resv3Start=0x02000000&lt;br /&gt;
        Resv3End=0x02FFFFFF&lt;br /&gt;
        Resv4Start=0x03000000&lt;br /&gt;
        Resv4End=0x03FFFFFF&lt;br /&gt;
        ResvSize=0x01000000&lt;br /&gt;
        progjffs=tftp&lt;br /&gt;
        imget=tftp&lt;br /&gt;
        config=tftp&lt;br /&gt;
        progjffs2=tftp&lt;br /&gt;
        progjffs3=tftp&lt;br /&gt;
        progjffs4=tftp&lt;br /&gt;
        nwboot=tftp&lt;br /&gt;
        ethact=GMAC0&lt;br /&gt;
        gmac0_addr=00:22:33:44:55:66&lt;br /&gt;
        gmac1_addr=00:22:33:44:55:67&lt;br /&gt;
        gmac2_addr=00:22:33:44:55:68&lt;br /&gt;
        ipaddr=192.168.11.237&lt;br /&gt;
        serverip=192.168.11.55&lt;br /&gt;
        bootargs=debug&lt;br /&gt;
        stdin=serial&lt;br /&gt;
        stdout=serial&lt;br /&gt;
        stderr=serial&lt;br /&gt;
        ver=U-Boot&lt;br /&gt;
 &lt;br /&gt;
        Environment&lt;br /&gt;
        U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
Here&#039;s how to configure U-Boot to automatically boot the Linux kernel on power-up (using the root file system exported over NFS as described further above).&lt;br /&gt;
You need to configure UBoot with the IP addresses that are practical in your environment. When using BOOTP or DHCP many of the IP addresses are in the DHCP&lt;br /&gt;
config file. Here we first present the simple case where all of the addresses are provided in the U-Boot environment variables:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip        192.168.11.55&#039;&#039;&#039;                                                         [TFTP server IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsroot_server  192.168.11.55&#039;&#039;&#039;                                                         [Root NFS Servers IP Address: My Workstation]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr          192.168.11.237&#039;&#039;&#039;                                                        [BOARD/TARGET IP address]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv netmask         255.255.255.0&#039;&#039;&#039;                                                         [Network Mask for a Internet Class C local network]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv gatewayip       192.168.11.1&#039;&#039;&#039;                                                          [Gateway address for default route]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile        uImage.xtensa-2.6.29-smp.test_mmuhifi_c3&#039;&#039;&#039;                              [File to fetch with TFTP and pass to bootm]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv root-path       /export2/Transwitch/LINUX_ROOT&#039;&#039;&#039;                                        [Location of root filesystem on NFS Server; Limit ~50 bytes]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfs_boot_args   root=/dev/nfs rw nfsroot=${nfsroot_server}:${root-path}&#039;&#039;&#039;               [NFS Args used in bootargs]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv hostname        HiFi-2&#039;&#039;&#039;                                                                [Hostname]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv nfsaddrs        ${ipaddr}:${nfsroot_server}:${gatewayip}:${netmask}:${hostname}&#039;&#039;&#039;       [IP addresses needed by NFS when not using DHCP or BOOTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv misc_boot_args  debug coredump_filter=0xff&#039;&#039;&#039;                                            [Enable kernel debug messages and core files on a SEGV sig] &lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootargs        console=ttyS0,38400 ip=${nfsaddrs} ${nfs_boot_args} ${misc_boot_args}&#039;&#039;&#039; [Args passed to Linux while booting with DHCP proto]&lt;br /&gt;
    U-boot&amp;gt; &#039;&#039;&#039;setenv bootcmd         tftpboot\; bootm&#039;&#039;&#039;                                                      [Boot Linux after fetching it with TFTP]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootdelay       5&#039;&#039;&#039;                                                                     [Delay 5 seconds before booting automatically]&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv autostart       yes&#039;&#039;&#039;                                                                   [Boot automatically on power-up/reset]&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set up your dhcp server with your domain information and boot with much less information&lt;br /&gt;
and it&#039;s no longer necessary to edit the targets /etc/resolve.conf with your domain server information:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=bootp root=nfs coredump_filter=0xff&#039;&#039;&#039;       [Args passed to Linux while booting with BOOTP proto]&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootargs_using_bootp console=ttyS0,38400 ip=dhcp  root=nfs coredump_filter=0xff&#039;&#039;&#039;       [Args passed to Linux while booting with DHCP  proto]&lt;br /&gt;
&lt;br /&gt;
If you want to boot with bootp or dhcp you may want your /etc/dhcp.conf file to look something like this:&lt;br /&gt;
&lt;br /&gt;
    allow bootp;&lt;br /&gt;
    boot-unknown-clients off;&lt;br /&gt;
    ignore unknown-clients;&lt;br /&gt;
    not authoritative;&lt;br /&gt;
    ddns-update-style ad-hoc;&lt;br /&gt;
     &lt;br /&gt;
    option domain-name &amp;quot;hq.tensilica.com&amp;quot;;&lt;br /&gt;
     &lt;br /&gt;
    subnet 192.168.11.0 netmask 255.255.255.0 {&lt;br /&gt;
        default-lease-time 2592000;     # 30 days&lt;br /&gt;
        max-lease-time 31557600;        # 1 year&lt;br /&gt;
        next-server = option dhcp-server-identifier;&lt;br /&gt;
        option routers 192.168.11.1;&lt;br /&gt;
        group {&lt;br /&gt;
                use-host-decl-names on;&lt;br /&gt;
                    ##&lt;br /&gt;
                    ## RTOS13   192.168.11.105: HelloSoft LX200 SMP Board on Piet&#039;s Desk&lt;br /&gt;
                    ##              DIP Swithes for MAC: 1 2 3 4 5 6 7 8    ethaddr=00:50:C2:13:6f:0F&lt;br /&gt;
                    ##              Little Endian:       1 1 1 1 0 0 * *&lt;br /&gt;
                    ##          Running HiFi-2&lt;br /&gt;
                    ##&lt;br /&gt;
                    ## hifi2.hq.tensilica.com:192.168.11.105::0x9b0ba8c0&lt;br /&gt;
     &lt;br /&gt;
                    host hifi2 {&lt;br /&gt;
                        hardware ethernet 00:50:c2:13:6f:07;&lt;br /&gt;
                        fixed-address hifi2.hq.tensilica.com;&lt;br /&gt;
                        next-server pdelaney_fc5.hq.tensilica.com;&lt;br /&gt;
                            option root-path &amp;quot;/exports/LINUX_ROOT.HiFi-2&lt;br /&gt;
                        option domain-name &amp;quot;hq.tensilica.com&amp;quot;;&lt;br /&gt;
                        option domain-name-servers 192.168.15.20,192.168.15.21;&lt;br /&gt;
                    }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
For more information on setting up the Linux Kernel boot parameters see the http://www.linuxdocs.org/HOWTOs/BootPrompt-HOWTO-3.html webpage.&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to Booting ==&lt;br /&gt;
&lt;br /&gt;
There are a few tweaks we mentioned that developers have found convenient to add to the the root file-system before booting.&lt;br /&gt;
As an initial environment for developing we are suggesting to mounting /home/default and /usr/local files-systems which have&lt;br /&gt;
a number of files useful for getting started.  &lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /export/a2000_home_default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
    drwxrwxrwx   12 root     root         4096 Dec  1 23:33 Audio_Tests/&lt;br /&gt;
    drwxr-xr-x    2 default  default      4096 Oct 28 17:46 Files/&lt;br /&gt;
    drwxr-xr-x    6 root     root         4096 Dec  2 02:46 LTP_Test/&lt;br /&gt;
    drwxr-xr-x    2 root     root         4096 Nov 20 15:13 Music/&lt;br /&gt;
    -rw-r--r--    1 10415    10000         841 Nov 20 01:18 SSH_Keys&lt;br /&gt;
    drwxr-xr-x    2 root     root         4096 Nov 13 12:14 Tests/&lt;br /&gt;
    drwxr-xr-x    2 10415    10000        4096 Nov 19 23:23 hifitest/&lt;br /&gt;
    drwxr-xr-x    5 root     root         4096 Dec  2 05:33 mplayer_packages/&lt;br /&gt;
    -rwxr-xr-x    1 10415    10000         544 Dec  2 03:01 save_root_files*&lt;br /&gt;
    -rw-r--r--    1 root     root        37888 Dec  2 03:13 saved_root_files.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice a file tar ball in the /home/default file system called &#039;&#039;&#039;saved_root_files.tar&#039;&#039;&#039;. &lt;br /&gt;
This is a tar file of files that developers have found convenient to add and replace on the root file system after&lt;br /&gt;
adding a new buildroot file system. Here is a list of the files and a brief explanation on why it&#039;s convenient to add or replace them:&lt;br /&gt;
&lt;br /&gt;
    root/.bash_profile                           [added &#039;ulimit -c unlimited to allow core dumps to be created]&lt;br /&gt;
    root/.bashrc&lt;br /&gt;
    etc/profile                                  [added &#039;ulimit -c unlimited to allow core dumps to be created]                                        &lt;br /&gt;
    etc/fstab                                    [Tells the system how to mount extra NFS file systems like /home/default]&lt;br /&gt;
    etc/init.d/S90local                          [Mounts /home/default]&lt;br /&gt;
    etc/resolv.conf                              [Your locations of DNS servers; used when your not using DHCP to boot the kernel]&lt;br /&gt;
                                                 [NOTE: restore symlink  /etc/resolv.conf -&amp;gt; /proc/net/pnp if using DHCP]&lt;br /&gt;
    etc/TZ                                       [Your time zone, currently set to California TZ]&lt;br /&gt;
    etc/dropbear/dropbear_rsa_host_key           [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/dropbear/dropbear_dss_host_key           [Old DropBrer keys, useful if you prefer Dropbear of sshd]&lt;br /&gt;
    etc/ssh_config                               [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/ssh_host_dsa_key                         [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_dsa_key.pub                     [sshd keys - Takes 30 minutes to generate, saves time on initial boot]&lt;br /&gt;
    etc/ssh_host_key                                            &lt;br /&gt;
    etc/ssh_host_key.pub&lt;br /&gt;
    etc/ssh_host_rsa_key&lt;br /&gt;
    etc/ssh_host_rsa_key.pub&lt;br /&gt;
    etc/sshd_config                              [Typically tailored with things like allowing root logins via ssh]&lt;br /&gt;
    etc/rndc.key                                                 &lt;br /&gt;
    etc/random-seed                              [Generated during 1st boot]&lt;br /&gt;
    etc/passwd                                   [Changed root and default user&#039;s shell to bash; runs std bash RC files to set ulimits; adds /usr/local/bin to search path]&lt;br /&gt;
    etc/shadow                                   [Changed default and root users login password to &#039;linux1&#039;, needed to ssh to the board]&lt;br /&gt;
    exports/                                     [The path to where the board can mount extra file systems like /home/default.&lt;br /&gt;
    usr/local                                    [Makes /usr/local so it can be mounted on; it has local additions, including /usr/local/src]&lt;br /&gt;
    codecs                                       [Makes /codecs for a NFS partition with Tensilica HiFi-2 Codecs to be mounted; the file-system should contain ...&lt;br /&gt;
                                                  ... /codecs/xa_hifi2_l32r_LE5_pic_mp3_dec_lib_3_1_api_1_15_lib.tgz&lt;br /&gt;
                                                  ... /codecs/xa_hifi2_l32r_LE5_pic_aacplus_v2_dec_lib_2_2_api_1_15_lib.tgz ]&lt;br /&gt;
     &lt;br /&gt;
Now lets assume your going to stay with mosts of these changes and modify a few of them after tar&#039;ing in these changes to the root file-system.&lt;br /&gt;
So here we add the tar ball files to the boards root filesystem.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/a2000_root&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;tar xf /exports/a2000_home_default/saved_root_files.tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a good time to edit a few files on the boards file system before booting it.&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cd /exports/a2000_root&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/resolv.conf&#039;&#039;&#039;                   [Place your domain information if not using a DHCP boot]&lt;br /&gt;
                                                 [Restore symlink resolv.conf -&amp;gt; /proc/net/pnp if using DHCP]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/fstab&#039;&#039;&#039;                         [Change fstab entry for boards root filesystem, and others to your taste]&lt;br /&gt;
    $ &#039;&#039;&#039;vi etc/init.d/S90local&#039;&#039;&#039;               [You might want to disable mounting of non-root NFS file systems ...&lt;br /&gt;
                                                  ... on the 1st Boot and add this once you try it manually]&lt;br /&gt;
&lt;br /&gt;
== Booting Linux for the 1st Time ==&lt;br /&gt;
&lt;br /&gt;
We should now be ready to boot linux on your A2000. You have exported the root file-system and made the&lt;br /&gt;
kernel available to a TFTP server. Now let&#039;s start with hitting the reset button on the A2000 and it should&lt;br /&gt;
auto-boot the kernel, resulting in output such as [[HiFi2_Board_Example_Linux_Boot_Log|this example log]].&lt;br /&gt;
&lt;br /&gt;
== Tailoring your system prior to developing for A2000 ==&lt;br /&gt;
&lt;br /&gt;
To make your experience more pleasant we suggest you tailoring your environment.&lt;br /&gt;
Here are some of the changes that we have found helpful and provided in the &#039;&#039;&#039;saved_root_files&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
   1. Added a root password to that you can login with ssh.&lt;br /&gt;
   2. Running rdate with an ntp server on booting.&lt;br /&gt;
   3. Adding NFS mounts to /etc/fstab for your code and buildroot code.&lt;br /&gt;
   4. Copy in previous ssh server encryption keys to /etc/dropbear to speed up your initial boot.&lt;br /&gt;
   5. Mount a &#039;default&#039; user home directory with:&lt;br /&gt;
      a. Linux Test Suite pre-patch to test the system&lt;br /&gt;
      b. Audio test example files&lt;br /&gt;
      c. Copies of Mplayer and its Plug-in build environment from Buildroot modified slightly to make installation easy.&lt;br /&gt;
      d. Misc audio test programs.&lt;br /&gt;
   6. Mounting Tensilica HiFi-2 Codecs to easily get mplayer working with HiFi-2 TIE instructions.&lt;br /&gt;
&lt;br /&gt;
== Building Linux Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Host ===&lt;br /&gt;
&lt;br /&gt;
You can use the open source toolchain included in the buildroot tree.&lt;br /&gt;
&lt;br /&gt;
Given the location of the buildroot tree and the name of the core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;setenv BUILDROOT_DIR  /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot.12&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;setenv CORENAME       centillium_c1p600&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can either set the PATH and invoke tools prefixed with &amp;lt;tt&amp;gt;xtensa_${CORENAME}-linux-&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;setenv PATH   ${BUILDROOT_DIR}/build_xtensa_${CORENAME}/staging_dir/usr/bin:${PATH}&lt;br /&gt;
   $ &#039;&#039;&#039;xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;xtensa_test_mmuhifi_c3-linux-gdb hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
or alternatively invoke the tools with absolute paths:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;${BUILDROOT_DIR}/build_xtensa_test_mmuhifi_c3/staging_dir/usr/bin/xtensa_test_mmuhifi_c3-linux-gdb hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using GCC on the Target ===&lt;br /&gt;
This is the simplest.  (Much slower of course at 45 MHz across a slow Ethernet link than on a workstation,&lt;br /&gt;
but very convenient.)  Just login to the target system and use the native &amp;lt;tt&amp;gt;gcc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Linux Applications Using XCC (Xtensa Tools) ===&lt;br /&gt;
&lt;br /&gt;
There are two approaches to compiling with Tensilica&#039;s XCC compiler (part of Xtensa Tools).&lt;br /&gt;
The normal one, described below, is to initially setup a virtual core&lt;br /&gt;
that has built-in references to the library and include files for the target Linux system.&lt;br /&gt;
Alternatively, one could skip this initial setup and just use Xtensa Tools to create&lt;br /&gt;
object files and link them using host or target GCC tools.&lt;br /&gt;
However, such objects must be built without dependencies on such things as the C library,&lt;br /&gt;
which can be harder than it sounds (for example, flags and structures, such as &amp;lt;tt&amp;gt;open()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;O_EXCL&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;stat()&amp;lt;/tt&amp;gt;&#039;s &amp;lt;tt&amp;gt;struct stat&amp;lt;/tt&amp;gt;, must be avoided because their definitions likely differ between the&lt;br /&gt;
Xtensa Tools&#039; default C library and the Linux uClibc library).&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note&#039;&#039;&#039;: Code written in C with TIE extensions and can only be compiled with XCC.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section 4.3 of the latest &#039;&#039;Xtensa OSKit Guide&#039;&#039; (from Tensilica&#039;s&lt;br /&gt;
RC-2009.0 release) describes how to setup XCC to compile Linux applications.&lt;br /&gt;
For full details, see the guide.  A summary follows.&lt;br /&gt;
&lt;br /&gt;
==== Initial Setup ====&lt;br /&gt;
&lt;br /&gt;
The XTENSA_TOOLS_ROOT, XTENSA_ROOT, BUILDROOT_DIR, and TARGET_SYSROOT&lt;br /&gt;
environment variables must be set according to where things were installed;&lt;br /&gt;
values shown here are for illustration only.  The CORENAME variable, set correctly&lt;br /&gt;
below for this board, reflects&lt;br /&gt;
the name of the core as known to open source tools (as opposed to XTENSA_CORE&lt;br /&gt;
which is the core name as known to Xtensa Tools; both happen to match here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv USER              someuser&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_ROOT       /home/${USER}/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/test_mmuhifi_c3&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_TOOLS_ROOT /home/${USER}/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv TARGET_SYSROOT    /exports/LINUX_ROOT.HiFi-2&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv BUILDROOT_DIR     /export/src/HiFi-2_DemoBoard/buildroot-xtensa-HiFi2-Snapshot&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;setenv CORENAME         centillium_c1p600&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    $ &#039;&#039;&#039;cd ${BUILDROOT_DIR}&lt;br /&gt;
    $ &#039;&#039;&#039;${XTENSA_ROOT}/xtensa-elf/src/linux/bin/xt-xcc-linux-install                                \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--sysroot=./build_xtensa_${CORENAME}/staging_dir                                         \&#039;&#039;&#039;&lt;br /&gt;
        &#039;&#039;&#039;--linux-gcc=./build_xtensa_${CORENAME}/staging_dir/usr/bin/xtensa_${CORENAME}-linux-gcc&lt;br /&gt;
&lt;br /&gt;
==== Regular Use ====&lt;br /&gt;
&lt;br /&gt;
Assuming the above completed successfully, you can now build applications using Xtensa Tools.  First set the usual environment variables (assuming values of XTENSA_ROOT and XTENSA_TOOLS_ROOT used earlier):&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_CORE      default&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv XTENSA_SYSTEM    ${XTENSA_ROOT}-linux/config&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;setenv PATH             ${XTENSA_TOOLS_ROOT}/bin:${PATH}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you can use Xtensa Tools to assemble, compile, and link applications for the Linux target specified during setup.  For example:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;echo &#039;#include &amp;lt;stdio.h&amp;gt;&#039; &amp;gt; hello.c&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;echo &#039;int main() {printf(&amp;quot;Hello!\\n&amp;quot;);return 0;}&#039; &amp;gt;&amp;gt; hello.c&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;xt-xcc -g hello.c -o hello&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then copy it where the target can see it:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;cp hello ${TARGET_SYSROOT}/root&#039;&#039;&#039;                             [NOTE: This step isn&#039;t necessary if your src file system is mounted on the targer; Ex: /export]&lt;br /&gt;
&lt;br /&gt;
And run it on the target:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;/root/hello&#039;&#039;&#039;&lt;br /&gt;
    Hello!&lt;br /&gt;
    [root@hifi ~]#&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more interesting example that uses Tensilica TIE features.              [NOTE: WE need a FLIX example]&lt;br /&gt;
(This cannot be compiled using GCC.)&lt;br /&gt;
&lt;br /&gt;
    $ cd ${TARGET_SYSROOT}/home/default/Audio_Tests&lt;br /&gt;
    $ xt-xcc -g hifitest.c -o hifitest&lt;br /&gt;
&lt;br /&gt;
In a ssh termulator window on the board you can now run hifitest:&lt;br /&gt;
&lt;br /&gt;
    [root@hifi ~]# &#039;&#039;&#039;cd /home/default/Audio_Tests/&#039;&#039;&#039;&lt;br /&gt;
    [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
    cnt:0x0, pid:23178; Eatting cpu; time:0 &#039;&#039;&#039;&amp;lt;control-C&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    [root@hifi Audio_Tests]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the source code for the [[hifitest.c|hifitest.c source file]] used above.&lt;br /&gt;
&lt;br /&gt;
=== Limited (No Setup) Use of Xtensa Tools for Linux Targets ===&lt;br /&gt;
&lt;br /&gt;
Below we illustrate compiling a simple audio test program on a workstation.&lt;br /&gt;
We start by referring to the XTENSA tools build by Xplorer, putting XCC into our search path and set the standard XTENSA_* environment variables.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_CORE      centillium_c1p600&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_ROOT      /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/centillium_c1p600&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_SYSTEM    /home/pdelaney/Xplorer/XtDevTools/install/builds/RC-2009.0-linux/centillium_c1p600/config&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;setenv XTENSA_TOOLS     /home/pdelaney/Xplorer/XtDevTools/install/tools/RC-2009.0-linux/XtensaTools/bin&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
    &#039;&#039;&#039;setenv PATH ${XTENSA_TOOLS}:${PATH}&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    [piet@fc9desktop Tests]      $ &#039;&#039;&#039;cd /exports/hifi-2_home_default/Audio_Tests&#039;&#039;&#039;                           [NOTE: This is being done on a Workstation]&lt;br /&gt;
    [piet@fc9desktop Audio_Tests]$ &#039;&#039;&#039;xt-xcc -g3 -O0 -fPIC -c hifitest.c&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we link the object on the LX200 board and run gdb on the TIE enhanced code:&lt;br /&gt;
&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gcc -g hifitest.o -o hifitest&#039;&#039;&#039;                                                [REMIND: Replace with a FLIX Example Test]&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;./hifitest&#039;&#039;&#039;&lt;br /&gt;
                             cnt:0x0, pid:4640; Eatting cpu; time:0&lt;br /&gt;
                             cnt:0x0, pid:4640; Eating Tie; time:7&lt;br /&gt;
   ^C&lt;br /&gt;
   [root@hifi Audio_Tests]# &#039;&#039;&#039;gdb ./hifitest&#039;&#039;&#039;                                               [NOTE: This is being done on the A2000 board; REMIND: update to a pthreads example]&lt;br /&gt;
   GNU gdb 6.6&lt;br /&gt;
   Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;
   GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
   welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
   Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
   There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
   This GDB was configured as &amp;quot;xtensa_test_mmuhifi_c3-linux-uclibc&amp;quot;...&lt;br /&gt;
    Using host libthread_db library &amp;quot;/lib/libthread_db.so.1&amp;quot;.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;break main&#039;&#039;&#039;&lt;br /&gt;
   Breakpoint 1 at 0x400401: file /exports/default/Audio_Tests/hifitest.c, line 20.&lt;br /&gt;
   (gdb) &#039;&#039;&#039;run&#039;&#039;&#039;&lt;br /&gt;
   Starting program: /home/default/Audio_Tests/hifitest &lt;br /&gt;
    &lt;br /&gt;
   Breakpoint 1, main (argc=1, argv=0x3fb3fab4)&lt;br /&gt;
       at /exports/default/Audio_Tests/hifitest.c:20&lt;br /&gt;
   20	     time_t time0 = time(NULL);&lt;br /&gt;
   (gdb) &#039;&#039;&#039;step&#039;&#039;&#039;&lt;br /&gt;
   21	  time_t time1 = time(NULL);&lt;br /&gt;
&lt;br /&gt;
== Compiling Generic GPL Packages ==&lt;br /&gt;
&lt;br /&gt;
For your development you may want to add a few GPL packages that you find helpful.&lt;br /&gt;
This can be done on the LX200 just as you would on a normal workstation, though&lt;br /&gt;
much slower. For example here we configure and build a few common GPL packages&lt;br /&gt;
with the standard:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ssh root@hifi&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi ~] # &#039;&#039;&#039;cd /usr/local/src&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;mkdir &amp;lt;package&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;wget &amp;lt;url_to_package&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;gunzip &amp;lt;package.tgz&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi src] # &#039;&#039;&#039;cd package&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;.configure&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
   [root@hifi &amp;lt;package&amp;gt; ] # &#039;&#039;&#039;make install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here are two examples, the invaluable strace and vim GPL packages:&lt;br /&gt;
&lt;br /&gt;
  [[Building the Strace Package]]&lt;br /&gt;
&lt;br /&gt;
  [[Building the vim Package]]&lt;br /&gt;
&lt;br /&gt;
This can be a useful effort prior to adding a package to buildroot or&lt;br /&gt;
for compiling packages with debug enabled. For example on of our developers&lt;br /&gt;
compiled uClibc with -g to debug problems in this package.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Adding Packages to Buildroot ==&lt;br /&gt;
&lt;br /&gt;
Xtensa developers provide detailed instructions on building the root filesystem and the Linux kernel.&lt;br /&gt;
* [[Buildroot_Build_Instructions|Instructions for building and booting Linux (buildroot)]].&lt;br /&gt;
&lt;br /&gt;
Building a comprehensive development environment with buildroot can be a challenging experience and&lt;br /&gt;
worthy of providing some tips on process.&lt;br /&gt;
Here are notes of the configs used for the three menuconfigs in this 2nd snapshot&lt;br /&gt;
provided with SMP additions:&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP Snapshot menuconfig | menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP uclibc-menuconfig   | uclibc-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
     $ &#039;&#039;&#039;make [[HiFi-2 snapshot_2 SMP busybox-menuconfig  | busybox-menuconfig]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[TO BE DONE - making a new tar ball of saved files, building buildroot, ...]&lt;br /&gt;
&lt;br /&gt;
== Known Problems being investigated, suggested that you know about and possibly avoid ==&lt;br /&gt;
&lt;br /&gt;
  1. Using NFS mounts with default parameters causes memory congestion. Use these mount options:&lt;br /&gt;
      &lt;br /&gt;
      &#039;&#039;&#039;vers=2,rsize=4096,wsize=4096,hard,nointr,nolock,nolock,timeo=11,retrans=3,noauto&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
     this is extremely important to add to your /etc/fstab on the target.&lt;br /&gt;
     &lt;br /&gt;
  2. Can&#039;t swap over NFS yet, under extreme conditions memory can get tight and cause application to be killed.&lt;br /&gt;
    a. We will be trying procedure documented in U-Boot Manual to swap over NFS.&lt;br /&gt;
       i) See Section [TBD]&lt;br /&gt;
  &lt;br /&gt;
  3. Building the complete C development with X11 doesn&#039;t work with buildroot.&lt;br /&gt;
   &lt;br /&gt;
  4. Though Mplayer plug-in can be compiled, Mplayer can be compiled but still has a few issues:&lt;br /&gt;
    a. Can&#039;t be compiled -O0 due to limited memory while compiling one file,&lt;br /&gt;
    b. Compiler was crashing and make had to be restarted.&lt;br /&gt;
       We are not seeing this problem with root build on Fedore Core 9.&lt;br /&gt;
       Perhaps this was caused by debug kernel being enabled or LTP using all of the memory.&lt;br /&gt;
   &lt;br /&gt;
  5. U-boot has flash problems:&lt;br /&gt;
    a. Sectors marked Read-Only come up Writeable after a reset/reboot.&lt;br /&gt;
   &lt;br /&gt;
    b. Flashing a large number of sectors (like the kernel) sometimes&lt;br /&gt;
       results in an Error (Ex: Vcc) and had to be retried.&lt;br /&gt;
   &lt;br /&gt;
    c. We saw environment variables trashed on reset/reboot once.&lt;br /&gt;
       It&#039;s possible that U-boot in flash could get whacked&lt;br /&gt;
       and the board will need to be re-flashed. During weeks&lt;br /&gt;
       of testing we haven&#039;t seen the U-Boot environment getting whacked.&lt;br /&gt;
     &lt;br /&gt;
  6. gdb appears to be crashing on target when debugging &lt;br /&gt;
     on latest root with uclibc left unstriped and with debug;&lt;br /&gt;
     core dump sent to maxim.&lt;br /&gt;
      &lt;br /&gt;
  7. U-Boot was hanging periodically when loading the kernel with&lt;br /&gt;
     tftp; appears to have be worse when network activity is high.&lt;br /&gt;
     This problem also seems to have gone away in the past few weeks.&lt;br /&gt;
     It may have been a duplication with MAC addresses.&lt;br /&gt;
   &lt;br /&gt;
  8. &#039;top&#039; command only shows all cpu&#039;s or cpu0; cpu 1 and 2 missing.&lt;br /&gt;
               &lt;br /&gt;
  9. Program dore dump require ulimit -c to be set but root uses /bin/sh&lt;br /&gt;
     which is a link to bash but causes it to skip running the bash&lt;br /&gt;
     startup scripts. Changing root to /bin/bash seems to mess up&lt;br /&gt;
     ssh logins.&lt;br /&gt;
    &lt;br /&gt;
  10. For kernel to be compiled on the LX200 (for self checking:&lt;br /&gt;
      a. Xtensa makefile needs to be fixed:&lt;br /&gt;
           CC      init/do_mounts.o&lt;br /&gt;
           LD      init/mounts.o&lt;br /&gt;
         /bin/sh: xtensa_test_mmuhifi_c3-linux-uclibc-ld: command not found&lt;br /&gt;
         make[1]: *** [init/mounts.o] Error 127&lt;br /&gt;
       &lt;br /&gt;
      b. Need to add ncurses-devel package for &#039;make menuconfig&#039;&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  11. The busybox vesion of vi doesn&#039;t work very good, we are using symbolic pointer&lt;br /&gt;
     &lt;br /&gt;
       /usr/local/bin/vi ---&amp;gt; /usr/local/bin/vim&lt;br /&gt;
     &lt;br /&gt;
       /usr/local/bin is searched first via bash profile and rc. &lt;br /&gt;
       The vim version works great and doesn&#039;t seem to use very much memory.&lt;br /&gt;
   &lt;br /&gt;
   12. mplayer codecs by default install to /usr/local/lib but&lt;br /&gt;
       the &#039;&#039;&#039;ldconfig&#039;&#039;&#039; config file needs to be updated to search /usr/local/lib. &lt;br /&gt;
           Ex:&lt;br /&gt;
                /etc/ld.so.conf:&lt;br /&gt;
                     # /usr/local/src/faad2-2.7/:&lt;br /&gt;
                     #               libfaad.a         libfaad.la        libfaad.so@&lt;br /&gt;
                     #               libfaad.so.2@     libfaad.so.2.0.0* libmp4ff.a&lt;br /&gt;
                     #&lt;br /&gt;
                     /usr/local/lib&lt;br /&gt;
        &lt;br /&gt;
       /etc/ld.so.conf.d exist but is being ignored by &#039;&#039;&#039;ldconfig&#039;&#039;&#039; even if included via ld.so.conf:&lt;br /&gt;
                include ld.so.conf.d/*.conf&lt;br /&gt;
       &lt;br /&gt;
       REMIND: update /home/default/save_root_files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Further reading=&lt;br /&gt;
&lt;br /&gt;
Some Notable Xtensa Linux and Transwitch resources are:&lt;br /&gt;
&lt;br /&gt;
* [http://www.transwitch.com/products/product/page.jsp?product=190 Transwitch A2000]&lt;br /&gt;
* [http://www.transwitch.com/support/index.jsp Transwitch Support]&lt;br /&gt;
* [http://linux-xtensa.org/ Linux/Xtensa Wiki]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions Buildroot Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Kernel_Build_Instructions Kernel Build Instructions]&lt;br /&gt;
* [http://wiki.linux-xtensa.org/index.php/Setting_up_U-Boot Setting up U-Boot]&lt;br /&gt;
* [http://lists.linux-xtensa.org/mailman/listinfo Linux/Xtensa Mailing List]&lt;br /&gt;
* http://git.linux-xtensa.org/cgi-bin/git.cgi GIT Repositories]&lt;br /&gt;
&lt;br /&gt;
=Maintained by=&lt;br /&gt;
&lt;br /&gt;
* piet&lt;br /&gt;
* marc ?&lt;br /&gt;
* suresh ?&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=561</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=561"/>
		<updated>2011-01-06T06:07:44Z</updated>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		<summary type="html">&lt;p&gt;Piet: /* Configure buildroot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These instructions explain how to build a toolchain, root filesystem and kernel for Linux running on an Xtensa processor.  These instructions apply specifically to the XTAV60 (LX60) board.&lt;br /&gt;
&lt;br /&gt;
Some general notes on these instructions:&lt;br /&gt;
&lt;br /&gt;
*  They are a work in progress.  If you are using the latest development sources, the build process may change, so you should be sure to get the latest version of this document at [http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions].  If you are using one of the development snapshot releases, you should use the version of the build instructions included with that snapshot.&lt;br /&gt;
&lt;br /&gt;
*  The following was tested on x86 machines running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on newer Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Xtensa Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&lt;br /&gt;
**  &#039;&#039;&#039;NOTE:&#039;&#039;&#039; this assumes the default selection of packages in buildroot.  Selecting extra packages may require a more recent host OS or more recent version of certain tools.  For example, the default version of &amp;lt;tt&amp;gt;find&amp;lt;/tt&amp;gt; on RHEL4 is too old to allow building all X11 packages in buildroot, so it is necessary to upgrade the host version of &amp;lt;tt&amp;gt;findutils&amp;lt;/tt&amp;gt; on RHEL4 to build these packages.&lt;br /&gt;
&lt;br /&gt;
*  Lines prefixed with &amp;quot;sudo&amp;quot; need to be executed as root.  The rest is best executed as a non-root user.  (It is possible to install &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; as a non-root user if root access is an issue.  How to do this isn&#039;t shown here.)&lt;br /&gt;
&lt;br /&gt;
*  Lines that set environment variables assume a Bourne compatible shell (e.g., /bin/sh or bash), but are easily adapted to other shells.&lt;br /&gt;
&lt;br /&gt;
*  Instructions are assumed executed all in order (e.g., commands assume current directory and environment variables set earlier).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your host system ==&lt;br /&gt;
&lt;br /&gt;
If you are using one of the snapshot releases, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
If you want to work with the latest development sources, you will need&lt;br /&gt;
[[Installing GIT|&amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; installed on your system]].&lt;br /&gt;
&lt;br /&gt;
== Download buildroot and the Linux kernel ==&lt;br /&gt;
&lt;br /&gt;
The following section describes how to download the latest&lt;br /&gt;
versions of buildroot and of the Linux kernel.&lt;br /&gt;
Skip this step if you are using one of the&lt;br /&gt;
[http://wiki.linux-xtensa.org/index.php/Buildroot_Snapshots snapshot releases].&lt;br /&gt;
&lt;br /&gt;
For most users, just execute the following:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa.git buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp.git linux&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;&amp;lt;/tt&amp;gt; is the path to an empty directory on a disk with&lt;br /&gt;
at least 4 GB available space.  You end up with the following file structure,&lt;br /&gt;
which is assumed by the rest of this document:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;workdir&amp;gt;/&lt;br /&gt;
            /buildroot&lt;br /&gt;
            /linux&lt;br /&gt;
&lt;br /&gt;
The MASTER branch of the buildroot repository is often is a state of development.&lt;br /&gt;
It&#039;s recommended to use the last snapshot for application developers. In the&lt;br /&gt;
case of the HiFi-2 development board a &#039;snapshot_2+SMP&#039; branch is recommended&lt;br /&gt;
in the currently experimental SMP git repository:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-HiFi2-Snapshot.git buildroot&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git branch --track snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
If you happen to have write access to either repository, or want more details,&lt;br /&gt;
see the [http://wiki.linux-xtensa.org/index.php/Repository_Access repository access] page.&lt;br /&gt;
&lt;br /&gt;
== Install any required processor specific overlay ==&lt;br /&gt;
&lt;br /&gt;
This step is required if you are targeting a custom Xtensa processor.&lt;br /&gt;
If you use a Diamond 232L Standard Core, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
To configure buildroot and the kernel to use a custom Xtensa processor&lt;br /&gt;
configuration, you need to overlay a set of files customized for your&lt;br /&gt;
processor configuration onto toolchain sources (gcc, binutils, gdb, etc)&lt;br /&gt;
and the Linux kernel.  This process has been automated using a script&lt;br /&gt;
located in the buildroot source tree.&lt;br /&gt;
For usage information, you can invoke it without arguments:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
which displays a help message similar to the following:&lt;br /&gt;
&lt;br /&gt;
 xt-buildroot-overlay-install version 1.3&lt;br /&gt;
 Usage:  xt-buildroot-overlay-install &amp;lt;parameters&amp;gt; [&amp;lt;options&amp;gt;]&lt;br /&gt;
 Where &amp;lt;parameters&amp;gt; are:&lt;br /&gt;
   -t file.tgz     Specify path to the Xtensa Linux overlay tarball, typically&lt;br /&gt;
                   &amp;lt;xtensa_root&amp;gt;/src/xtensa-config-overlay.tar.gz&lt;br /&gt;
   -b dir          Path to the base of the buildroot source tree, in which&lt;br /&gt;
                   package specific overlay tarballs get installed.&lt;br /&gt;
   -k dir          Path to the base of the Linux kernel source tree, in which&lt;br /&gt;
                   the Linux kernel specific overlay gets installed.&lt;br /&gt;
   -c config_name  Name for the Xtensa processor configuration as it will be&lt;br /&gt;
                   known to the open source community.  Must be a lowercase&lt;br /&gt;
                   identifier, starting with a letter, consisting of letters&lt;br /&gt;
                   and numbers and underscores, not ending with underscore&lt;br /&gt;
                   and not containing consecutive underscores.  For examples:&lt;br /&gt;
                      dc232b , dc232b_be , mmubasele , fsf , s5000 .&lt;br /&gt;
   -l long_name    Long name for the Xtensa processor configuration, human-&lt;br /&gt;
                   readable with spaces etc allowed (must be quoted).&lt;br /&gt;
                   For example:  &#039;Diamond 232L Standard Core Rev.B (LE)&#039;&lt;br /&gt;
                   Try to keep it within approximately 40 characters.&lt;br /&gt;
 And &amp;lt;options&amp;gt; are:&lt;br /&gt;
   -f              If package specific overlay tarballs already exist in&lt;br /&gt;
                   the destination source tree, overwrite them without asking.&lt;br /&gt;
   --help          Show this usage message.&lt;br /&gt;
&lt;br /&gt;
Note that the Xtensa Linux overlay tarball MUST be obtained from an Xtensa&lt;br /&gt;
core package built using release RB-2008.3 or later.&lt;br /&gt;
&lt;br /&gt;
Here is an example invocation of the overlay installation script:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install -t blinkcore-config-overlay.tar.gz&#039;&#039;&#039; \&lt;br /&gt;
         &#039;&#039;&#039;-b ./buildroot -k ./linux -c superzip -l &amp;quot;ChipCorp SuperZIP Blink Accelerator Core&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The script extracts some relevant information from the overlay tarball,&lt;br /&gt;
presents it along with relevant parameters to the user, and prompts&lt;br /&gt;
for confirmation before proceeding.&lt;br /&gt;
&lt;br /&gt;
The chosen processor name (-c option) must be unique among known Xtensa processors.&lt;br /&gt;
It is also probably wise to avoid names confusingly similar to other (non-Xtensa) processors.&lt;br /&gt;
If you expect at some point to contribute support for your custom processor to the&lt;br /&gt;
open-source community, this name will likely be long-lived.&lt;br /&gt;
(One way to contribute support for a custom processor might be to submit the overlay tarball&lt;br /&gt;
or files to the linux-xtensa.org maintainers.)&lt;br /&gt;
&lt;br /&gt;
In the steps below, buildroot and the Linux kernel must be configured&lt;br /&gt;
(in their respective &amp;lt;code&amp;gt;&#039;&#039;make menuconfig&#039;&#039;&amp;lt;/code&amp;gt; steps) to select&lt;br /&gt;
the &amp;lt;code&amp;gt;&#039;&#039;custom&#039;&#039;&amp;lt;/code&amp;gt; Xtensa processor option.&lt;br /&gt;
This presents an extra configuration menu entry where you must provide&lt;br /&gt;
the name of the Xtensa processor.  Set it to the same name&lt;br /&gt;
as was specified in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option above.&lt;br /&gt;
&lt;br /&gt;
== Build a toolchain and root filesystem using buildroot ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  for more details on generic buildroot topics not covered in this simple how-to,&lt;br /&gt;
see [http://buildroot.uclibc.org/ buildroot.uclibc.org].&lt;br /&gt;
&lt;br /&gt;
=== Configure buildroot ===&lt;br /&gt;
&lt;br /&gt;
The first time you configure buildroot, start with defaults for your Xtensa processor:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;/buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./target/xtensa/setup-config &amp;lt;i&amp;gt;&amp;lt;corename&amp;gt;&amp;lt;/i&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;corename&amp;gt;&#039;&#039; is the overlay name of your selected Xtensa or Diamond core&lt;br /&gt;
(e.g., &#039;&#039;&#039;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;
   &#039;&#039;&#039;$ make menuconfig&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make uclibc-menuconfig&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make busybox-menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Build buildroot ===&lt;br /&gt;
&lt;br /&gt;
Just type:&lt;br /&gt;
&lt;br /&gt;
   $ 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;| XTAV110 (LX110)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV200 (LX200)&lt;br /&gt;
|  30  || 31250&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 41667&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exit menuconfig, saving your configuration changes.&lt;br /&gt;
&lt;br /&gt;
Backup your configuration outside the build directory.  For example:&lt;br /&gt;
&lt;br /&gt;
   $ cp ../build-xtav60/.config config.xtav60.saved&lt;br /&gt;
&lt;br /&gt;
If you do a clean rebuild of the kernel (e.g., &amp;quot;rm -rf ../build-xtav60&amp;quot;)&lt;br /&gt;
you can now configure it with simply:&lt;br /&gt;
   $ mkdir ../build-xtav60 ; cp config.xtav60.saved ../build-xtav60/.config&lt;br /&gt;
Of course if you update the kernel, you&#039;ll probably again have to do:&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa  menuconfig&lt;br /&gt;
and save a new copy of your configuration.&lt;br /&gt;
&lt;br /&gt;
=== Build the kernel ===&lt;br /&gt;
&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa&lt;br /&gt;
&lt;br /&gt;
The build will issue a few warnings which are normal.&lt;br /&gt;
Once complete, the bootable image is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
and the uncompressed ELF file containing kernel symbols is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
There is also a RedBoot bootable image (if you use RedBoot) in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/zImage.redboot&lt;br /&gt;
&lt;br /&gt;
=== Install Xtensa Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to download the kernel over OCD, you need &amp;lt;tt&amp;gt;xt-gdb&amp;lt;/tt&amp;gt;&lt;br /&gt;
which is part of Tensilica&#039;s Xtensa Tools package.  This must be obtained&lt;br /&gt;
from Tensilica, and is not the same toolchain as built by buildroot.&lt;br /&gt;
You also need to install the corresponding Tensilica core package,&lt;br /&gt;
so that the Xtensa Tools know about your particular configured&lt;br /&gt;
Tensilica core.&lt;br /&gt;
&lt;br /&gt;
The toolchain built using buildroot can be configured to&lt;br /&gt;
include GDB, but that version of GDB does not support&lt;br /&gt;
communicating with Tensilica&#039;s Xtensa OCD Daemon, and&lt;br /&gt;
thus cannot be used to download the kernel over OCD.&lt;br /&gt;
&lt;br /&gt;
In this example, it is assumed that the machine hosting the&lt;br /&gt;
Xtensa Tools has access to the &amp;lt;workdir&amp;gt; directory tree.&lt;br /&gt;
&lt;br /&gt;
=== Install and setup the Xtensa OCD Daemon ===&lt;br /&gt;
&lt;br /&gt;
Setup and connect your JTAG probe, etc.&lt;br /&gt;
&lt;br /&gt;
=== Connect a terminal server ===&lt;br /&gt;
&lt;br /&gt;
At 38400 bps 8N1 no flow control to the XTAV60 serial port.&lt;br /&gt;
&lt;br /&gt;
=== Optionally, setup networking ===&lt;br /&gt;
&lt;br /&gt;
This step is optional.&lt;br /&gt;
&lt;br /&gt;
Setup the board&#039;s MAC address using dipswitches&lt;br /&gt;
(see XTAV60 or XTAV200 board docs as appropriate)&lt;br /&gt;
and connect the board to a network that has a&lt;br /&gt;
DHCP server that will respond to that MAC address.&lt;br /&gt;
If you don&#039;t do this step, you&#039;ll simply not have network&lt;br /&gt;
access, and the boot process will take a minute or so longer&lt;br /&gt;
while the kernel times out waiting for a BOOTP response.&lt;br /&gt;
You can edit the kernel configuration and rebuild the kernel&lt;br /&gt;
to avoid using bootp (in particular, remove &amp;quot;ip=bootp&amp;quot; from&lt;br /&gt;
the kernel cmdline).&lt;br /&gt;
&lt;br /&gt;
=== Download and run the kernel ===&lt;br /&gt;
&lt;br /&gt;
Reset the board (see board documentation).&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   $ xt-gdb &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
&lt;br /&gt;
   (xt-gdb) target remote &amp;lt;ocdhost&amp;gt;:20000 0&lt;br /&gt;
   (xt-gdb) reset&lt;br /&gt;
   (xt-gdb) load&lt;br /&gt;
   (xt-gdb) set $pc = &amp;amp;_ResetVector&lt;br /&gt;
   (xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
   (xt-gdb) c&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;ocdhost&amp;gt; is the IP address or DNS name of the machine&lt;br /&gt;
running the Xtensa OCD daemon.  The Linux kernel should&lt;br /&gt;
start booting as soon as &#039;c&#039; (continue) is executed.&lt;br /&gt;
&lt;br /&gt;
You should eventually get a login prompt.&lt;br /&gt;
Just login as root (no password).&lt;br /&gt;
&lt;br /&gt;
Try various Linux commands.  Look at &amp;lt;tt&amp;gt;/bin&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;/sbin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt;, etc to see what&#039;s available.&lt;br /&gt;
&lt;br /&gt;
Note:  no need to setup an NFS or TFTP server.  The filesystem&lt;br /&gt;
is contained within the kernel image.  You may be able to mount&lt;br /&gt;
other filesystems over NFS though, if you wish, after booting.&lt;br /&gt;
&lt;br /&gt;
=== Mounting the Root Filesystem Over NFS ===&lt;br /&gt;
&lt;br /&gt;
If you build more than the minimal set of packages using&lt;br /&gt;
buildroot, the root filesystem can easily grow too large to&lt;br /&gt;
fit comfortably (or at all) inside the kernel.  In this case,&lt;br /&gt;
rather than follow the instructions exactly as above,&lt;br /&gt;
you&#039;ll want to mount the root filesystem over NFS.&lt;br /&gt;
&lt;br /&gt;
You may also want to mount the root filesystem over NFS to&lt;br /&gt;
make changes to the filesystem persistent across runs and&lt;br /&gt;
accessible from your development host.&lt;br /&gt;
&lt;br /&gt;
First you need to install the root filesystem generated&lt;br /&gt;
using buildroot, to a machine that can serve it over NFS.&lt;br /&gt;
Assuming this machine runs Linux, one way to install it is&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
 mkdir &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
 cd &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
 sudo cpio -i -d -m -F &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio --no-absolute-filenames&lt;br /&gt;
&lt;br /&gt;
You then need to enable the NFS server on your system&lt;br /&gt;
(if not already active), and export this filesystem.&lt;br /&gt;
How you do this depends on your host Linux distribution.&lt;br /&gt;
For example, on some Fedora releases, one might:&lt;br /&gt;
&lt;br /&gt;
* add the export path to &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; using a line such as&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;  *(rw,sync,no_root_squash,no_all_squash)&lt;br /&gt;
&lt;br /&gt;
* turn on the NFS server if needed:&lt;br /&gt;
&lt;br /&gt;
 sudo /sbin/chkconfig nfs on&lt;br /&gt;
&lt;br /&gt;
* tell the NFS server about the new exported filesystem&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/sbin/exportfs -a&lt;br /&gt;
 sudo /usr/sbin/exportfs -r&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second, follow the instructions in the previous sections,&lt;br /&gt;
then configure the kernel again as follows.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is disabled (rather than enabled as done in previous sections).&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, under the line &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;,&lt;br /&gt;
select the boot parameters line and set it to something like this:&lt;br /&gt;
&lt;br /&gt;
 console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=&#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039;:&#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039; is the IP address of your NFS server, and &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
is the exported filesystem path.&lt;br /&gt;
&lt;br /&gt;
Save this configuration, rebuild the kernel, and follow the&lt;br /&gt;
instructions in previous sections to download and run the kernel.&lt;br /&gt;
If everything goes well and is setup correctly, your kernel should&lt;br /&gt;
now boot with a root filesystem mounted over NFS.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the Instruction Set Simulator (ISS) ==&lt;br /&gt;
&lt;br /&gt;
You can build and run a Linux kernel in the Xtensa Instruction Set&lt;br /&gt;
Simulator (ISS).  The following instructions have only been tried&lt;br /&gt;
with an ISS from the RB-2008.3 release of Xtensa Tools.  Bear in&lt;br /&gt;
mind that the XTAV60 port is likely much more stable than the ISS port&lt;br /&gt;
of Linux at this point in time.&lt;br /&gt;
&lt;br /&gt;
Note:  Depending on your host OS version, you may need to install&lt;br /&gt;
Xtensa Tools on a separate machine.&lt;br /&gt;
&lt;br /&gt;
=== Configure and Build the Kernel for ISS ===&lt;br /&gt;
&lt;br /&gt;
Repeat all the same instructions as above for building the kernel for the&lt;br /&gt;
XTAV60 board, except that when initially configuring the kernel,&lt;br /&gt;
start from a ISS platform template instead. For example for the &lt;br /&gt;
DC233C Variant:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ mkdir build-iss&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ cd linux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa KBUILD_DEFCONFIG=iss_dc233c_defconfig defconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above make example configures the kernel using the default configuration found in&lt;br /&gt;
&#039;&#039;&#039;arch/xtensa/configs/iss_dc233_defconfig&#039;&#039;&#039;. Most important to note is that the&lt;br /&gt;
root file system mounted when Linux boots comes via the targets device &#039;&#039;&#039;/dev/simdisk0&#039;&#039;&#039; &lt;br /&gt;
which is defined in the kernel &#039;&#039;&#039;.config&#039;&#039;&#039; file. For example:&lt;br /&gt;
&lt;br /&gt;
         CONFIG_SIMDISK0_FILENAME=&amp;quot;/export2/DC_C_233L/LINUX_ROOT.ext2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The SIMDISK file name and VARIANT name are typically configured when running &#039;&#039;&#039;make menuconfig&#039;&#039;&#039;, Ex:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and selecting&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Platform options&#039;&#039;&#039; ---&amp;gt; &#039;&#039;&#039;Host filename for a simulated device&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and entering the pathname to the .ext2 file there. Ex: &#039;&#039;&#039;/export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You often want to change the VARIANT to the one you desire, Ex: FSF. You do this via &lt;br /&gt;
the top level menu:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Processor type and features ---&amp;gt;Xtensa Processor Custom Core Variant Name&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the new SIMDISK approach you copy the EXT2 Filesystem file generated by Buildroot&lt;br /&gt;
to a location to be accessed by Xtensa Linux. Ex:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ cp /export2/DC_C_233L/src/buildroot-xtensa-HiFi2-Snapshot/binaries/dc233c/rootfs.xtensa_dc233c.ext2 /export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; There is an old &#039;&#039;&#039;iss_defconfig&#039;&#039;&#039; that tries to use a &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet &lt;br /&gt;
interface that currently isn&#039;t supported.&lt;br /&gt;
Previously with this old iss_defconfig using the &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet interface&lt;br /&gt;
it was suggested to set up the initramfs filesystem, and do the following.&lt;br /&gt;
Under &#039;&#039;&#039;Bus Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;PCI support&#039;&#039;&#039;.&lt;br /&gt;
Under &#039;&#039;&#039;Platform Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;.&lt;br /&gt;
Hopefully we will someday be able to support the use of a network interface with&lt;br /&gt;
ISS simulation and then be able to mount NFS root partitions again. So I&#039;m leaving&lt;br /&gt;
this note for future exploration of this mechanism. Hope you don&#039;t mind the clutter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Continue configuring and building the kernel as usual.&lt;br /&gt;
&lt;br /&gt;
===  Run the Kernel on ISS ===&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ xt-gdb &amp;lt;workdir&amp;gt;/build-iss/arch/xtensa/boot/Image.elf&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) target sim --turbo --memlimit=128&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-iss/vmlinux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) run&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Wait patiently while Linux boots ... (maybe a minute). The setting of the &#039;&#039;&#039;memlimit&#039;&#039;&#039;&lt;br /&gt;
needs to match the PLATFORM_DEFAULT_MEM_SIZE defined in /arch/xtensa/platforms/iss/include/platform/hardware.h.&lt;br /&gt;
Currently this limit us 128 MegaBytes:&lt;br /&gt;
&lt;br /&gt;
    #define PLATFORM_DEFAULT_MEM_SIZE       0x08000000      /* 13,4217,728 128M */&lt;br /&gt;
&lt;br /&gt;
and we will be extending this for the DC233L to take advantage of it&#039;s V3 MMU.   &lt;br /&gt;
&lt;br /&gt;
Login as root (no password).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  Input via ISS is cooked, so everything typed gets echoed.&lt;br /&gt;
Also, time as reported by the kernel does not progress&lt;br /&gt;
according to true wall-clock time:  it currently depends on&lt;br /&gt;
a simulated processor clock, which advances at various speeds&lt;br /&gt;
according to load.&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=540</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=540"/>
		<updated>2011-01-06T03:47:29Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* 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 x86 machines running RedHat Enterprise Linux 4 (RHEL4) and Fedora Core 3 (FC3).  It is expected to work on newer Fedora releases (e.g., was tested on FC6) but to maintain host compatibility with Xtensa Tools, it is best to avoid Fedora releases beyond FC5.  Other host distributions likely work but have not been tested.&lt;br /&gt;
**  &#039;&#039;&#039;NOTE:&#039;&#039;&#039; this assumes the default selection of packages in buildroot.  Selecting extra packages may require a more recent host OS or more recent version of certain tools.  For example, the default version of &amp;lt;tt&amp;gt;find&amp;lt;/tt&amp;gt; on RHEL4 is too old to allow building all X11 packages in buildroot, so it is necessary to upgrade the host version of &amp;lt;tt&amp;gt;findutils&amp;lt;/tt&amp;gt; on RHEL4 to build these packages.&lt;br /&gt;
&lt;br /&gt;
*  Lines prefixed with &amp;quot;sudo&amp;quot; need to be executed as root.  The rest is best executed as a non-root user.  (It is possible to install &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; as a non-root user if root access is an issue.  How to do this isn&#039;t shown here.)&lt;br /&gt;
&lt;br /&gt;
*  Lines that set environment variables assume a Bourne compatible shell (e.g., /bin/sh or bash), but are easily adapted to other shells.&lt;br /&gt;
&lt;br /&gt;
*  Instructions are assumed executed all in order (e.g., commands assume current directory and environment variables set earlier).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup your host system ==&lt;br /&gt;
&lt;br /&gt;
If you are using one of the snapshot releases, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
If you want to work with the latest development sources, you will need&lt;br /&gt;
[[Installing GIT|&amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; installed on your system]].&lt;br /&gt;
&lt;br /&gt;
== Download buildroot and the Linux kernel ==&lt;br /&gt;
&lt;br /&gt;
The following section describes how to download the latest&lt;br /&gt;
versions of buildroot and of the Linux kernel.&lt;br /&gt;
Skip this step if you are using one of the&lt;br /&gt;
[http://wiki.linux-xtensa.org/index.php/Buildroot_Snapshots snapshot releases].&lt;br /&gt;
&lt;br /&gt;
For most users, just execute the following:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-xtensa.git buildroot&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/kernel/xtensa-2.6.29-smp.git linux&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;&amp;lt;workdir&amp;gt;&amp;lt;/tt&amp;gt; is the path to an empty directory on a disk with&lt;br /&gt;
at least 4 GB available space.  You end up with the following file structure,&lt;br /&gt;
which is assumed by the rest of this document:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;workdir&amp;gt;/&lt;br /&gt;
            /buildroot&lt;br /&gt;
            /linux&lt;br /&gt;
&lt;br /&gt;
The MASTER branch of the buildroot repository is often is a state of development.&lt;br /&gt;
It&#039;s recommended to use the last snapshot for application developers. In the&lt;br /&gt;
case of the HiFi-2 development board a &#039;snapshot_2+SMP&#039; branch is recommended&lt;br /&gt;
in the currently experimental SMP git repository:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ git clone git://git.linux-xtensa.org/git/buildroot/buildroot-HiFi2-Snapshot.git buildroot&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git branch --track snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;$ git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
If you happen to have write access to either repository, or want more details,&lt;br /&gt;
see the [http://wiki.linux-xtensa.org/index.php/Repository_Access repository access] page.&lt;br /&gt;
&lt;br /&gt;
== Install any required processor specific overlay ==&lt;br /&gt;
&lt;br /&gt;
This step is required if you are targeting a custom Xtensa processor.&lt;br /&gt;
If you use a Diamond 232L Standard Core, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
To configure buildroot and the kernel to use a custom Xtensa processor&lt;br /&gt;
configuration, you need to overlay a set of files customized for your&lt;br /&gt;
processor configuration onto toolchain sources (gcc, binutils, gdb, etc)&lt;br /&gt;
and the Linux kernel.  This process has been automated using a script&lt;br /&gt;
located in the buildroot source tree.&lt;br /&gt;
For usage information, you can invoke it without arguments:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ cd &amp;lt;workdir&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
which displays a help message similar to the following:&lt;br /&gt;
&lt;br /&gt;
 xt-buildroot-overlay-install version 1.3&lt;br /&gt;
 Usage:  xt-buildroot-overlay-install &amp;lt;parameters&amp;gt; [&amp;lt;options&amp;gt;]&lt;br /&gt;
 Where &amp;lt;parameters&amp;gt; are:&lt;br /&gt;
   -t file.tgz     Specify path to the Xtensa Linux overlay tarball, typically&lt;br /&gt;
                   &amp;lt;xtensa_root&amp;gt;/src/xtensa-config-overlay.tar.gz&lt;br /&gt;
   -b dir          Path to the base of the buildroot source tree, in which&lt;br /&gt;
                   package specific overlay tarballs get installed.&lt;br /&gt;
   -k dir          Path to the base of the Linux kernel source tree, in which&lt;br /&gt;
                   the Linux kernel specific overlay gets installed.&lt;br /&gt;
   -c config_name  Name for the Xtensa processor configuration as it will be&lt;br /&gt;
                   known to the open source community.  Must be a lowercase&lt;br /&gt;
                   identifier, starting with a letter, consisting of letters&lt;br /&gt;
                   and numbers and underscores, not ending with underscore&lt;br /&gt;
                   and not containing consecutive underscores.  For examples:&lt;br /&gt;
                      dc232b , dc232b_be , mmubasele , fsf , s5000 .&lt;br /&gt;
   -l long_name    Long name for the Xtensa processor configuration, human-&lt;br /&gt;
                   readable with spaces etc allowed (must be quoted).&lt;br /&gt;
                   For example:  &#039;Diamond 232L Standard Core Rev.B (LE)&#039;&lt;br /&gt;
                   Try to keep it within approximately 40 characters.&lt;br /&gt;
 And &amp;lt;options&amp;gt; are:&lt;br /&gt;
   -f              If package specific overlay tarballs already exist in&lt;br /&gt;
                   the destination source tree, overwrite them without asking.&lt;br /&gt;
   --help          Show this usage message.&lt;br /&gt;
&lt;br /&gt;
Note that the Xtensa Linux overlay tarball MUST be obtained from an Xtensa&lt;br /&gt;
core package built using release RB-2008.3 or later.&lt;br /&gt;
&lt;br /&gt;
Here is an example invocation of the overlay installation script:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ ./buildroot/target/xtensa/xt-buildroot-overlay-install -t blinkcore-config-overlay.tar.gz&#039;&#039;&#039; \&lt;br /&gt;
         &#039;&#039;&#039;-b ./buildroot -k ./linux -c superzip -l &amp;quot;ChipCorp SuperZIP Blink Accelerator Core&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The script extracts some relevant information from the overlay tarball,&lt;br /&gt;
presents it along with relevant parameters to the user, and prompts&lt;br /&gt;
for confirmation before proceeding.&lt;br /&gt;
&lt;br /&gt;
The chosen processor name (-c option) must be unique among known Xtensa processors.&lt;br /&gt;
It is also probably wise to avoid names confusingly similar to other (non-Xtensa) processors.&lt;br /&gt;
If you expect at some point to contribute support for your custom processor to the&lt;br /&gt;
open-source community, this name will likely be long-lived.&lt;br /&gt;
(One way to contribute support for a custom processor might be to submit the overlay tarball&lt;br /&gt;
or files to the linux-xtensa.org maintainers.)&lt;br /&gt;
&lt;br /&gt;
In the steps below, buildroot and the Linux kernel must be configured&lt;br /&gt;
(in their respective &amp;lt;code&amp;gt;&#039;&#039;make menuconfig&#039;&#039;&amp;lt;/code&amp;gt; steps) to select&lt;br /&gt;
the &amp;lt;code&amp;gt;&#039;&#039;custom&#039;&#039;&amp;lt;/code&amp;gt; Xtensa processor option.&lt;br /&gt;
This presents an extra configuration menu entry where you must provide&lt;br /&gt;
the name of the Xtensa processor.  Set it to the same name&lt;br /&gt;
as was specified in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option above.&lt;br /&gt;
&lt;br /&gt;
== Build a toolchain and root filesystem using buildroot ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  for more details on generic buildroot topics not covered in this simple how-to,&lt;br /&gt;
see [http://buildroot.uclibc.org/ buildroot.uclibc.org].&lt;br /&gt;
&lt;br /&gt;
=== Configure buildroot ===&lt;br /&gt;
&lt;br /&gt;
The first time you configure buildroot, start with defaults for your Xtensa processor:&lt;br /&gt;
&lt;br /&gt;
   $ 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;| XTAV110 (LX110)&lt;br /&gt;
|  30  || 33333&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 40000&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| XTAV200 (LX200)&lt;br /&gt;
|  30  || 31250&lt;br /&gt;
|-&lt;br /&gt;
|  40  || 41667&lt;br /&gt;
|-&lt;br /&gt;
|  50  || 50000&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exit menuconfig, saving your configuration changes.&lt;br /&gt;
&lt;br /&gt;
Backup your configuration outside the build directory.  For example:&lt;br /&gt;
&lt;br /&gt;
   $ cp ../build-xtav60/.config config.xtav60.saved&lt;br /&gt;
&lt;br /&gt;
If you do a clean rebuild of the kernel (e.g., &amp;quot;rm -rf ../build-xtav60&amp;quot;)&lt;br /&gt;
you can now configure it with simply:&lt;br /&gt;
   $ mkdir ../build-xtav60 ; cp config.xtav60.saved ../build-xtav60/.config&lt;br /&gt;
Of course if you update the kernel, you&#039;ll probably again have to do:&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa  menuconfig&lt;br /&gt;
and save a new copy of your configuration.&lt;br /&gt;
&lt;br /&gt;
=== Build the kernel ===&lt;br /&gt;
&lt;br /&gt;
   $ make O=../build-xtav60 ARCH=xtensa&lt;br /&gt;
&lt;br /&gt;
The build will issue a few warnings which are normal.&lt;br /&gt;
Once complete, the bootable image is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
and the uncompressed ELF file containing kernel symbols is in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
There is also a RedBoot bootable image (if you use RedBoot) in:&lt;br /&gt;
      &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/zImage.redboot&lt;br /&gt;
&lt;br /&gt;
=== Install Xtensa Tools for the selected core ===&lt;br /&gt;
&lt;br /&gt;
If you opt to download the kernel over OCD, you need &amp;lt;tt&amp;gt;xt-gdb&amp;lt;/tt&amp;gt;&lt;br /&gt;
which is part of Tensilica&#039;s Xtensa Tools package.  This must be obtained&lt;br /&gt;
from Tensilica, and is not the same toolchain as built by buildroot.&lt;br /&gt;
You also need to install the corresponding Tensilica core package,&lt;br /&gt;
so that the Xtensa Tools know about your particular configured&lt;br /&gt;
Tensilica core.&lt;br /&gt;
&lt;br /&gt;
The toolchain built using buildroot can be configured to&lt;br /&gt;
include GDB, but that version of GDB does not support&lt;br /&gt;
communicating with Tensilica&#039;s Xtensa OCD Daemon, and&lt;br /&gt;
thus cannot be used to download the kernel over OCD.&lt;br /&gt;
&lt;br /&gt;
In this example, it is assumed that the machine hosting the&lt;br /&gt;
Xtensa Tools has access to the &amp;lt;workdir&amp;gt; directory tree.&lt;br /&gt;
&lt;br /&gt;
=== Install and setup the Xtensa OCD Daemon ===&lt;br /&gt;
&lt;br /&gt;
Setup and connect your JTAG probe, etc.&lt;br /&gt;
&lt;br /&gt;
=== Connect a terminal server ===&lt;br /&gt;
&lt;br /&gt;
At 38400 bps 8N1 no flow control to the XTAV60 serial port.&lt;br /&gt;
&lt;br /&gt;
=== Optionally, setup networking ===&lt;br /&gt;
&lt;br /&gt;
This step is optional.&lt;br /&gt;
&lt;br /&gt;
Setup the board&#039;s MAC address using dipswitches&lt;br /&gt;
(see XTAV60 or XTAV200 board docs as appropriate)&lt;br /&gt;
and connect the board to a network that has a&lt;br /&gt;
DHCP server that will respond to that MAC address.&lt;br /&gt;
If you don&#039;t do this step, you&#039;ll simply not have network&lt;br /&gt;
access, and the boot process will take a minute or so longer&lt;br /&gt;
while the kernel times out waiting for a BOOTP response.&lt;br /&gt;
You can edit the kernel configuration and rebuild the kernel&lt;br /&gt;
to avoid using bootp (in particular, remove &amp;quot;ip=bootp&amp;quot; from&lt;br /&gt;
the kernel cmdline).&lt;br /&gt;
&lt;br /&gt;
=== Download and run the kernel ===&lt;br /&gt;
&lt;br /&gt;
Reset the board (see board documentation).&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   $ xt-gdb &amp;lt;workdir&amp;gt;/build-xtav60/arch/xtensa/boot/Image.elf&lt;br /&gt;
&lt;br /&gt;
   (xt-gdb) target remote &amp;lt;ocdhost&amp;gt;:20000 0&lt;br /&gt;
   (xt-gdb) reset&lt;br /&gt;
   (xt-gdb) load&lt;br /&gt;
   (xt-gdb) set $pc = &amp;amp;_ResetVector&lt;br /&gt;
   (xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-xtav60/vmlinux&lt;br /&gt;
   (xt-gdb) c&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;ocdhost&amp;gt; is the IP address or DNS name of the machine&lt;br /&gt;
running the Xtensa OCD daemon.  The Linux kernel should&lt;br /&gt;
start booting as soon as &#039;c&#039; (continue) is executed.&lt;br /&gt;
&lt;br /&gt;
You should eventually get a login prompt.&lt;br /&gt;
Just login as root (no password).&lt;br /&gt;
&lt;br /&gt;
Try various Linux commands.  Look at &amp;lt;tt&amp;gt;/bin&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;/sbin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt;, etc to see what&#039;s available.&lt;br /&gt;
&lt;br /&gt;
Note:  no need to setup an NFS or TFTP server.  The filesystem&lt;br /&gt;
is contained within the kernel image.  You may be able to mount&lt;br /&gt;
other filesystems over NFS though, if you wish, after booting.&lt;br /&gt;
&lt;br /&gt;
=== Mounting the Root Filesystem Over NFS ===&lt;br /&gt;
&lt;br /&gt;
If you build more than the minimal set of packages using&lt;br /&gt;
buildroot, the root filesystem can easily grow too large to&lt;br /&gt;
fit comfortably (or at all) inside the kernel.  In this case,&lt;br /&gt;
rather than follow the instructions exactly as above,&lt;br /&gt;
you&#039;ll want to mount the root filesystem over NFS.&lt;br /&gt;
&lt;br /&gt;
You may also want to mount the root filesystem over NFS to&lt;br /&gt;
make changes to the filesystem persistent across runs and&lt;br /&gt;
accessible from your development host.&lt;br /&gt;
&lt;br /&gt;
First you need to install the root filesystem generated&lt;br /&gt;
using buildroot, to a machine that can serve it over NFS.&lt;br /&gt;
Assuming this machine runs Linux, one way to install it is&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
 mkdir &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
 cd &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
 sudo cpio -i -d -m -F &#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/binaries/uclibc/rootfs.xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;.cpio --no-absolute-filenames&lt;br /&gt;
&lt;br /&gt;
You then need to enable the NFS server on your system&lt;br /&gt;
(if not already active), and export this filesystem.&lt;br /&gt;
How you do this depends on your host Linux distribution.&lt;br /&gt;
For example, on some Fedora releases, one might:&lt;br /&gt;
&lt;br /&gt;
* add the export path to &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; using a line such as&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;  *(rw,sync,no_root_squash,no_all_squash)&lt;br /&gt;
&lt;br /&gt;
* turn on the NFS server if needed:&lt;br /&gt;
&lt;br /&gt;
 sudo /sbin/chkconfig nfs on&lt;br /&gt;
&lt;br /&gt;
* tell the NFS server about the new exported filesystem&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/sbin/exportfs -a&lt;br /&gt;
 sudo /usr/sbin/exportfs -r&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second, follow the instructions in the previous sections,&lt;br /&gt;
then configure the kernel again as follows.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General setup&#039;&#039;&#039;, make sure the&lt;br /&gt;
&#039;&#039;&#039;Initial RAM filesystem and RAM disk (initramfs/initrd) support&#039;&#039;&#039;&lt;br /&gt;
entry is disabled (rather than enabled as done in previous sections).&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Platform options&#039;&#039;&#039;, under the line &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;,&lt;br /&gt;
select the boot parameters line and set it to something like this:&lt;br /&gt;
&lt;br /&gt;
 console=ttyS0,38400 ip=dhcp root=/dev/nfs rw nfsroot=&#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039;:&#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&amp;lt;server_ip&amp;gt;&#039;&#039; is the IP address of your NFS server, and &#039;&#039;&amp;lt;exportpath&amp;gt;&#039;&#039;&lt;br /&gt;
is the exported filesystem path.&lt;br /&gt;
&lt;br /&gt;
Save this configuration, rebuild the kernel, and follow the&lt;br /&gt;
instructions in previous sections to download and run the kernel.&lt;br /&gt;
If everything goes well and is setup correctly, your kernel should&lt;br /&gt;
now boot with a root filesystem mounted over NFS.&lt;br /&gt;
&lt;br /&gt;
== Build and Run a Linux Kernel on the Instruction Set Simulator (ISS) ==&lt;br /&gt;
&lt;br /&gt;
You can build and run a Linux kernel in the Xtensa Instruction Set&lt;br /&gt;
Simulator (ISS).  The following instructions have only been tried&lt;br /&gt;
with an ISS from the RB-2008.3 release of Xtensa Tools.  Bear in&lt;br /&gt;
mind that the XTAV60 port is likely much more stable than the ISS port&lt;br /&gt;
of Linux at this point in time.&lt;br /&gt;
&lt;br /&gt;
Note:  Depending on your host OS version, you may need to install&lt;br /&gt;
Xtensa Tools on a separate machine.&lt;br /&gt;
&lt;br /&gt;
=== Configure and Build the Kernel for ISS ===&lt;br /&gt;
&lt;br /&gt;
Repeat all the same instructions as above for building the kernel for the&lt;br /&gt;
XTAV60 board, except that when initially configuring the kernel,&lt;br /&gt;
start from a ISS platform template instead. For example for the &lt;br /&gt;
DC233C Variant:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ mkdir build-iss&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ cd linux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa KBUILD_DEFCONFIG=iss_dc233c_defconfig defconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above make example configures the kernel using the default configuration found in&lt;br /&gt;
&#039;&#039;&#039;arch/xtensa/configs/iss_dc233_defconfig&#039;&#039;&#039;. Most important to note is that the&lt;br /&gt;
root file system mounted when Linux boots comes via the targets device &#039;&#039;&#039;/dev/simdisk0&#039;&#039;&#039; &lt;br /&gt;
which is defined in the kernel &#039;&#039;&#039;.config&#039;&#039;&#039; file. For example:&lt;br /&gt;
&lt;br /&gt;
         CONFIG_SIMDISK0_FILENAME=&amp;quot;/export2/DC_C_233L/LINUX_ROOT.ext2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The SIMDISK file name and VARIANT name are typically configured when running &#039;&#039;&#039;make menuconfig&#039;&#039;&#039;, Ex:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ make O=../build-iss ARCH=xtensa menuconfig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and selecting&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Platform options&#039;&#039;&#039; ---&amp;gt; &#039;&#039;&#039;Host filename for a simulated device&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and entering the pathname to the .ext2 file there. Ex: &#039;&#039;&#039;/export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You often want to change the VARIANT to the one you desire, Ex: FSF. You do this via &lt;br /&gt;
the top level menu:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;Xtensa Processor type and features ---&amp;gt;Xtensa Processor Custom Core Variant Name&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the new SIMDISK approach you copy the EXT2 Filesystem file generated by Buildroot&lt;br /&gt;
to a location to be accessed by Xtensa Linux. Ex:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;$ cp /export2/DC_C_233L/src/buildroot-xtensa-HiFi2-Snapshot/binaries/dc233c/rootfs.xtensa_dc233c.ext2 /export2/DC_C_233L/LINUX_ROOT.ext2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; There is an old &#039;&#039;&#039;iss_defconfig&#039;&#039;&#039; that tries to use a &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet &lt;br /&gt;
interface that currently isn&#039;t supported.&lt;br /&gt;
Previously with this old iss_defconfig using the &#039;&#039;&#039;tuntap&#039;&#039;&#039; Ethernet interface&lt;br /&gt;
it was suggested to set up the initramfs filesystem, and do the following.&lt;br /&gt;
Under &#039;&#039;&#039;Bus Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;PCI support&#039;&#039;&#039;.&lt;br /&gt;
Under &#039;&#039;&#039;Platform Options&#039;&#039;&#039;, deselect &#039;&#039;&#039;Default bootloader kernel arguments&#039;&#039;&#039;.&lt;br /&gt;
Hopefully we will someday be able to support the use of a network interface with&lt;br /&gt;
ISS simulation and then be able to mount NFS root partitions again. So I&#039;m leaving&lt;br /&gt;
this note for future exploration of this mechanism. Hope you don&#039;t mind the clutter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Continue configuring and building the kernel as usual.&lt;br /&gt;
&lt;br /&gt;
===  Run the Kernel on ISS ===&lt;br /&gt;
&lt;br /&gt;
Using Xtensa Tools, invoke:&lt;br /&gt;
&lt;br /&gt;
   &#039;&#039;&#039;$ xt-gdb &amp;lt;workdir&amp;gt;/build-iss/arch/xtensa/boot/Image.elf&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) target sim --turbo --memlimit=128&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) symbol-file &amp;lt;workdir&amp;gt;/build-iss/vmlinux&#039;&#039;&#039;&lt;br /&gt;
   &#039;&#039;&#039;(xt-gdb) run&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Wait patiently while Linux boots ... (maybe a minute). The setting of the &#039;&#039;&#039;memlimit&#039;&#039;&#039;&lt;br /&gt;
needs to match the PLATFORM_DEFAULT_MEM_SIZE defined in /arch/xtensa/platforms/iss/include/platform/hardware.h.&lt;br /&gt;
Currently this limit us 128 MegaBytes:&lt;br /&gt;
&lt;br /&gt;
    #define PLATFORM_DEFAULT_MEM_SIZE       0x08000000      /* 13,4217,728 128M */&lt;br /&gt;
&lt;br /&gt;
and we will be extending this for the DC233L to take advantage of it&#039;s V3 MMU.   &lt;br /&gt;
&lt;br /&gt;
Login as root (no password).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  Input via ISS is cooked, so everything typed gets echoed.&lt;br /&gt;
Also, time as reported by the kernel does not progress&lt;br /&gt;
according to true wall-clock time:  it currently depends on&lt;br /&gt;
a simulated processor clock, which advances at various speeds&lt;br /&gt;
according to load.&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Instructions_for_building_and_booting_Linux&amp;diff=539</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=539"/>
		<updated>2011-01-06T03:46:23Z</updated>

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

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

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

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

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

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

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; U-Boot for the new DC233, with the V3 MMU, is now working fine and checked into the master branch. Work is almost complete with the Linux 2.6.29-smp kernel, with&lt;br /&gt;
Linux now booting from this updated U-Boot. The kernel on the &#039;Initialize_MMU_Inside_vmlinux&#039; branch seems to be working fine, and has survived 14 hours of stress testing so far.&lt;br /&gt;
Plain is to merge this and a few additional branches to the master branch and then move forward to a newer version of the Linux kernel.&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type: &lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;make dc233c_xtav110_config&#039;&#039;&#039;      &lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                          &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes. &lt;br /&gt;
&lt;br /&gt;
This is likely a good time to copy &#039;&#039;&#039;mkimage&#039;&#039;&#039; to your ${HOME}/bin directory&lt;br /&gt;
for later use while building the Linux kernel. The &#039;&#039;&#039;mkimage&#039;&#039;&#039; program was&lt;br /&gt;
just built in the tool directory by the above &#039;&#039;&#039;make all&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
  $ &#039;&#039;&#039;cd tools&#039;&#039;&#039;&lt;br /&gt;
  $ &#039;&#039;&#039;cp mkimage ~/bin&#039;&#039;&#039;                                           [NOTE: &#039;&#039;&#039;mkimage&#039;&#039;&#039; should be in your search PATH while building the Linux kernel]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 9 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
  Erased 9 sectors&lt;br /&gt;
  U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 9 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a &#039;&#039;&#039;LX200&#039;&#039;&#039; with the &#039;&#039;&#039;V2 MMU&#039;&#039;&#039; with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, on the LX110 move DIP switch 4 to the ON position.  &lt;br /&gt;
Next, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV110: Avnet board + Xilinx LX110 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 48 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:00&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=532</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=532"/>
		<updated>2010-11-24T00:07:57Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; U-Boot for the new DC233, with the V3 MMU, is now working fine and checked into the master branch. Work is almost complete with the Linux 2.6.29-smp kernel, with&lt;br /&gt;
Linux now booting from this updated U-Boot. The kernel on the &#039;Initialize_MMU_Inside_vmlinux&#039; branch seems to be working fine, and has survived 14 hours of stress testing so far.&lt;br /&gt;
Plain is to merge this and a few additional branches to the master branch and then move forward to a newer version of the Linux kernel.&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;            &lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                          &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes. &lt;br /&gt;
&lt;br /&gt;
This is likely a good time to copy &#039;&#039;&#039;mkimage&#039;&#039;&#039; to your ${HOME}/bin directory&lt;br /&gt;
for later use while building the Linux kernel. The &#039;&#039;&#039;mkimage&#039;&#039;&#039; program was&lt;br /&gt;
just built in the tool directory by the above &#039;&#039;&#039;make all&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
  $ &#039;&#039;&#039;cd tools&#039;&#039;&#039;&lt;br /&gt;
  $ &#039;&#039;&#039;cp mkimage ~/bin&#039;&#039;&#039;                                           [NOTE: &#039;&#039;&#039;mkimage&#039;&#039;&#039; should be in your search PATH while building the Linux kernel]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 9 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
  Erased 9 sectors&lt;br /&gt;
  U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 9 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a &#039;&#039;&#039;LX200&#039;&#039;&#039; with the &#039;&#039;&#039;V2 MMU&#039;&#039;&#039; with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, on the LX110 move DIP switch 4 to the ON position.  &lt;br /&gt;
Next, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV110: Avnet board + Xilinx LX110 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 48 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:00&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=531</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=531"/>
		<updated>2010-11-24T00:03:10Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; U-Boot for the new DC233, with the V3 MMU, is now working fine and checked into the master branch. Work is almost complete with the Linux 2.6.29-smp kernel, with&lt;br /&gt;
Linux now booting from this updated U-Boot. The kernel on the &#039;Initialize_MMU_Inside_vmlinux&#039; branch seems to be working fine, and has survived 14 hours of stress testing so far.&lt;br /&gt;
Plain is to merge this and a few additional branches to the master branch and then move forward to a newer version of the Linux kernel.&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;            &lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                          &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes. &lt;br /&gt;
&lt;br /&gt;
This is likely a good time to copy &#039;mkimage&#039; to your ${HOME}/bin directory&lt;br /&gt;
for later use while building the Linux kernel. The &#039;mkimage&#039; program is&lt;br /&gt;
in the tool directory:&lt;br /&gt;
&lt;br /&gt;
  $ &#039;&#039;&#039;cd tools&#039;&lt;br /&gt;
  $ &#039;&#039;&#039;cp mkimage ~/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 9 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
  Erased 9 sectors&lt;br /&gt;
  U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 9 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a &#039;&#039;&#039;LX200&#039;&#039;&#039; with the &#039;&#039;&#039;V2 MMU&#039;&#039;&#039; with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, on the LX110 move DIP switch 4 to the ON position.  &lt;br /&gt;
Next, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV110: Avnet board + Xilinx LX110 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 48 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:00&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=530</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=530"/>
		<updated>2010-11-18T04:25:29Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; The New DC233, with the V3 MMU, is now working. Work is in progress with the Linux 2.6.29-smp kernel to boot from this updated U-Boot. U-Boot is starting to work for the LX110 with the V3_MMU, having a minor problem with the LCD display and the kernel isn&#039;t booting, likely need to get the Load Address correct for V3 MMU. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                                 [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]   &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes.&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 9 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
  Erased 9 sectors&lt;br /&gt;
  U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 9 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a &#039;&#039;&#039;LX200&#039;&#039;&#039; with the &#039;&#039;&#039;V2 MMU&#039;&#039;&#039; with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, on the LX110 move DIP switch 4 to the ON position.  &lt;br /&gt;
Next, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV110: Avnet board + Xilinx LX110 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 48 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:00&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=529</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=529"/>
		<updated>2010-11-16T09:55:09Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; The New DC233, with the V3 MMU, is now working. Work is in progress with the Linux 2.6.29-smp kernel to boot from this updated U-Boot. U-Boot is starting to work for the LX110 with the V3_MMU, having a minor problem with the LCD display and the kernel isn&#039;t booting, likely need to get the Load Address correct for V3 MMU. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                                 [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]   &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes.&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 10 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a &#039;&#039;&#039;LX200&#039;&#039;&#039; with the &#039;&#039;&#039;V2 MMU&#039;&#039;&#039; with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, on the LX110 move DIP switch 4 to the ON position.  &lt;br /&gt;
Next, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the new &#039;&#039;&#039;V3 MMU&#039;&#039;&#039; the serial console should print something like the following:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV110: Avnet board + Xilinx LX110 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 48 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:00&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=528</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=528"/>
		<updated>2010-11-16T09:52:24Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress, UART and FLASH Working, fixing LCD) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; The New DC233, with the V3 MMU, is now working. Work is in progress with the Linux 2.6.29-smp kernel to boot from this updated U-Boot. U-Boot is starting to work for the LX110 with the V3_MMU, having a minor problem with the LCD display and the kernel isn&#039;t booting, likely need to get the Load Address correct for V3 MMU. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                                 [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]   &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes.&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 10 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a LX200 with the V2 MMU with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, on the LX110 move DIP switch 4 to the ON position.  &lt;br /&gt;
Next, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new V3 MMU the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX110 with the new V3 MMU the serial console should print something like the following:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV110: Avnet board + Xilinx LX110 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 48 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:00&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=527</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=527"/>
		<updated>2010-11-16T09:40:06Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress, UART and FLASH Working, fixing LCD) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress, UART and FLASH Working, fixing LCD) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; The New DC233, with the V3 MMU, is now working. Work is in progress with the Linux 2.6.29-smp kernel to boot from this updated U-Boot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                                 [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]   &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes.&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 10 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a LX200 with the V2 MMU with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, on the LX110 move DIP switch 4 to the ON position.  &lt;br /&gt;
Next, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new V3 MMU the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX110 with the new V3 MMU the serial console should print something like the following:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV110: Avnet board + Xilinx LX110 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 48 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:00&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
    &lt;br /&gt;
    U-Boot 2009.08-dirty (Nov 15 2010 - 23:04:45)&lt;br /&gt;
    &lt;br /&gt;
    CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=526</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=526"/>
		<updated>2010-11-16T09:26:28Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress, UART and FLASH Working, fixing LCD) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; The New DC233, with the V3 MMU, is now working. Work is in progress with the Linux 2.6.29-smp kernel to boot from this updated U-Boot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                                 [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]   &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes.&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 10 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a LX200 with the V2 MMU with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new V3 MMU the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
&lt;br /&gt;
   CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=525</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=525"/>
		<updated>2010-11-16T09:20:47Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; The New DC233, with the V3 MMU, is now working. Work is in progress with the Linux 2.6.29-smp kernel to boot from this updated U-Boot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                                 [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]   &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes.&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 10 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX110&#039;&#039;&#039; with the &#039;&#039;&#039;V3-MMU&#039;&#039;&#039; here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a LX200 with the V2 MMU with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new V3 MMU the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
&lt;br /&gt;
   CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=524</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=524"/>
		<updated>2010-11-16T09:19:54Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; The New DC233, with the V3 MMU, is now working. Work is in progress with the Linux 2.6.29-smp kernel to boot from this updated U-Boot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                                 [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]   &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes.&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 10 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the LX110 with the V3-MMU here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
       &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
            &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a LX200 with the V2 MMU with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new V3 MMU the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
&lt;br /&gt;
   CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=523</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=523"/>
		<updated>2010-11-16T09:18:46Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; The New DC233, with the V3 MMU, is now working. Work is in progress with the Linux 2.6.29-smp kernel to boot from this updated U-Boot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                                 [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]   &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes.&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 10 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the LX110 with the V3-MMU here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a LX200 with the V2 MMU with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new V3 MMU the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
&lt;br /&gt;
   CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
	<entry>
		<id>http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=522</id>
		<title>Setting up U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.linux-xtensa.org/index.php?title=Setting_up_U-Boot&amp;diff=522"/>
		<updated>2010-11-16T09:15:19Z</updated>

		<summary type="html">&lt;p&gt;Piet: /* LX60 and LX200 U-Boot Installation (LX110 in Progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LX60 and LX200 U-Boot Installation (LX110 in Progress) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;News:&#039;&#039;&#039; The New DC233, with the V3 MMU, is now working. Work is in progress with the Linux 2.6.29-smp kernel to boot from this updated U-Boot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Summary:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.denx.de/wiki/UBoot U-Boot] is a very popular boot loader; especially within the [http://elinux.org/Bootloader Embedded Linux community]. &lt;br /&gt;
The U-Boot loader runs on the FPGA boards which are equipped with a dip switch, number 8, which can select where the memory location for the reset&lt;br /&gt;
vector (0XFE00,0000) comes from. With switch number 8 off the board will map the memory at the reset vector to a small block of SRAM located in the&lt;br /&gt;
I/O block with the UART and Ethernet buffer memory. When switch number 8 is on the Avnet boards map the beginning of the Flash Memory at 0XF800,000&lt;br /&gt;
to the reset vector at 0xFE00,000. &lt;br /&gt;
&lt;br /&gt;
What we are going to do here is build a version of U-Boot for your Avnet board and Variant, install that ELF file into memory&lt;br /&gt;
with xt-gdb and run U-Boot. Then we are going to download a another copy of this identical program with &#039;&#039;&#039;tftp&#039;&#039;&#039;. The version we&lt;br /&gt;
are going to download is just the ELF file with the headers and debug information removed. It&#039;s just the actual bits that get&lt;br /&gt;
loaded into memory. For the new V3 MMU the default &#039;&#039;&#039;loadaddr&#039;&#039;&#039; is typically 0x20,0000 and for the older V2 MMU this is in the &lt;br /&gt;
Linux mapping equivalent, 0xD0200,0000. The default location can be change by setting the U-Boot &#039;loadaddr&#039; environment variable&lt;br /&gt;
or by changing the variable &#039;&#039;&#039;CONFIG_SYS_LOAD_ADDR&#039;&#039;&#039; in the boards U-Boot config file.&lt;br /&gt;
&lt;br /&gt;
Once the virgin copy of the U-Boot program has been loaded into memory, the Flash memory is un-protected and errasd, then the &lt;br /&gt;
memory with the U-Boot program in it is copied to the flash memory and protected. Next you will set dip switch 8 on, recycle&lt;br /&gt;
power on the board, and U-Boot will be accessible via the serial UART at 38400 baud. U-Boot works without any MMU mapping,&lt;br /&gt;
and should be fine on configurations without an MMU. Only an ethernet and serial interface are required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proceedure:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A local port to the Xtensa architecture is now available at linux-xtensa.org.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; directly, use something like:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039;  This path is subject to change.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The U-Boot git repository has a branch with a HiFi 2 snapshot made for&lt;br /&gt;
the LX200 [[SMP HiFi 2 Development Board]]. With this branch you can simply check&lt;br /&gt;
out the snapshot_2+SMP branch which includes the binaries which are discussed below:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git branch --track snapshot_2+SMP origin/snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;git checkout snapshot_2+SMP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;ls -l u-boot u-boot.bin tools/mkimage&#039;&#039;&#039; &lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica  45016 2009-12-07 19:40 tools/mkimage           [This is a small program you need to put in your search path to build kernel U-Boot images]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 635339 2009-12-07 19:40 u-boot                  [Started with xt-gdb to bring up the 1st instance of a HiFi 2 U-Boot]&lt;br /&gt;
     -rwxr-xr-x 1 piet tensilica 144944 2009-12-07 19:40 u-boot.bin              [Loaded by the 1st instance of U-Boot, it&#039;s a HiFi2 version of u-boot that will be put in flash]&lt;br /&gt;
   $&lt;br /&gt;
&lt;br /&gt;
Unless you are using a U-Boot snapshot you need to build U-Boot for which you must have built the Buildroot toolchain for XTensa core.&lt;br /&gt;
Set your PATH to point to the toolchain built using buildroot. For example:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;export PATH=&amp;quot;&#039;&#039;&amp;lt;workdir&amp;gt;&#039;&#039;/buildroot/build_xtensa_&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;/staging_dir/usr/bin:$PATH&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 where &#039;&#039;&#039;&amp;lt;cname&amp;gt;&#039;&#039;&#039; is the name of the Xtensa core variant you wish to build for (e.g., &amp;lt;tt&amp;gt;dc232b&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;dc233c&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To build U-Boot, use the cloned git tree pulled above, you should be at the top level of the tree in the &#039;&#039;&#039;u-boot&#039;&#039;&#039; directory ,  then configure it for your board and Xtensa core variant as follows:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 make &amp;lt;cname&amp;gt;&#039;&#039;&#039;_&amp;lt;board&amp;gt;_&#039;&#039;&#039;config&lt;br /&gt;
&#039;dc232b&#039;dc&lt;br /&gt;
This should only take a few seconds. For example, to build U-boot for the &#039;xtav60&#039; board and the older &#039;dc232b&#039; core with the V2 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;cd u-boot&#039;&#039;&#039;&lt;br /&gt;
   $ &#039;&#039;&#039;make dc232b_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for the new &#039;dc233c&#039; core with the new V3 MMU type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav60_config&#039;&#039;&#039;                                  [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
or for a &#039;xtav200&#039; board type with the new &#039;dc233c&#039; core type:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make dc233c_xtav200_config&#039;&#039;&#039;                                 [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]   &lt;br /&gt;
&lt;br /&gt;
or for the snapshot_2+SMP branch you can also build U-Boot for the HiFi 2 core:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make test_mmuhifi_c3_xtav200_config&#039;&#039;&#039;                        [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under &amp;lt;tt&amp;gt;include/asm-xtensa/variant-&amp;lt;cname&amp;gt;&amp;lt;/tt&amp;gt;. The core specific headers are described in the &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt; file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.&lt;br /&gt;
&lt;br /&gt;
After the configuration step, to actually build U-Boot, simply:&lt;br /&gt;
&lt;br /&gt;
   $ &#039;&#039;&#039;make all&#039;&#039;&#039;                                                   [NOTE: You can skip this step with the the HiFi-2 snapshot_2+SMP branch; binaries are pre-built]&lt;br /&gt;
&lt;br /&gt;
This will take a quite a few minutes.&lt;br /&gt;
&lt;br /&gt;
Next, start xt-gdb and load u-boot from the top of the git repository:&lt;br /&gt;
   &lt;br /&gt;
   $ &#039;&#039;&#039;xt-gdb -n&#039;&#039;&#039;                                                  [NOTE: Even with the HiFi 2 snapshot_2+SMP branch you still may have to put U-Boot on the board]            &lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;file u-boot&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;target remote localhost:20000 0&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;reset&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;load&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;break panic&#039;&#039;&#039;&lt;br /&gt;
   (xt-gdb) &#039;&#039;&#039;continue&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hopefully U-Boot will start, and display on the LCD in the case of a LX60.&lt;br /&gt;
&lt;br /&gt;
  U-Boot 50.00 Mhz&lt;br /&gt;
&lt;br /&gt;
Often you will be starting with the boards flash in an unknown state and it&#039;s best to unprotect and erase the entire flash. Just type &#039;&#039;&#039;protect off all&#039;&#039;&#039; followed by &#039;&#039;&#039;erase all&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect off all&#039;&#039;&#039;&lt;br /&gt;
    Un-Protect Flash Bank # 1&lt;br /&gt;
    ................................................................................................................................... done&lt;br /&gt;
    U-Boot&amp;gt;  &#039;&#039;&#039;erase all&#039;&#039;&#039;&lt;br /&gt;
    Erase Flash Bank # 1 &lt;br /&gt;
    ..........................................................................................................&lt;br /&gt;
    Flash erase timeout at address f8d40000 da0&lt;br /&gt;
    Flash erase error at address f8d40000&lt;br /&gt;
    ........................ done&lt;br /&gt;
    U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The timeout and error messages are likley just warning messages and you board has been errased. You can see that with the flash info command &#039;&#039;&#039;flinfo&#039;&#039;&#039;. Below is an example with a LX200 board, which has a much larger flash than the smaller LX60:&lt;br /&gt;
 &lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E      F8FE8000 E      F8FF0000 E&lt;br /&gt;
      F8FF8000 E&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new LX110 looks very similar to the LX200, also with with 16Mb of Flash:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      F8000000 E      F8020000 E      F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      F8FE0000 E&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now set your preliminary U-Boot environment variables to point to your TFTP server so we can download yet another copy of U-Boot. At Tensilica we use a machine in the RTOS group called rtos-lab2. Folks using the [[SMP HiFi 2 Development Board]] likely have set up their workstation with a TFTP server.      &lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.78&#039;&#039;&#039;           rtos-lab2&lt;br /&gt;
or&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv serverip 192.168.11.55&#039;&#039;&#039;           pdelaney_fc9&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv ipaddr 192.168.11.95&#039;&#039;&#039;            I/P address of RTOS5, Piet&#039;s LX60; MAC: 00:05:C2:13:6f:0a&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;setenv bootfile u-boot.bin&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;saveenv&#039;&#039;&#039;&lt;br /&gt;
    Saving Environment to Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Un-Protected 4 sectors&lt;br /&gt;
    Erasing Flash...&lt;br /&gt;
    .... done&lt;br /&gt;
    Erased 4 sectors&lt;br /&gt;
    Writing to Flash... done&lt;br /&gt;
    .... done&lt;br /&gt;
    Protected 4 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, download &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; from the tftp server using the info we just entered into U-Boot&#039;s enviroment variables.&lt;br /&gt;
Here for example is the case for a LX60 running the HiFi-2 Bitstream with the older V2 MMU. Note that it starts up&lt;br /&gt;
in the D-gazillion (0XD0000000) region:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 107592 (1a448 hex)&lt;br /&gt;
&lt;br /&gt;
For the V3 MMU U-Boot is loaded from host pdelaney_fc9 into memory with virtual == physical. Here is a DC233L, with V3 MMU, example:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: T ########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 109964 (1ad8c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now things get a bit tricky here for the LX60. The FLASH has &#039;&#039;&#039;Two sizes of Flash Sectors&#039;&#039;&#039;.&lt;br /&gt;
The first 8 sectors are small 0x2000 (8KB) and apparently intended for parameters. The rest&lt;br /&gt;
of the 4MB flash is composed of larger 0x10000 (64KB) sectors.  Our code doesn&#039;t differentiate&lt;br /&gt;
between the sectors and the LX60 hardware is going to map 0XF800,0000 to 0XFE00,0000 so this&lt;br /&gt;
makes us use of all 8 of the 8KB sectors and the 1st 64KB sector at F8010000. So we are going&lt;br /&gt;
to flash up to F801FFFF below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On a LX200 we have much more space and can easily fit a version of U-boot that has been compiled without optimization, make debugging much easier.&lt;br /&gt;
So in this case the image is a bit larger, but relatively similar to the LX60 (2 sectors):&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;tftpboot&#039;&#039;&#039;&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0xd2000000&lt;br /&gt;
    Loading: ###############&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 205852 (3241c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a LX110 we have less memory than an LX60, but FLASH sectors like the LX200.  It turns out that the u-boot image&lt;br /&gt;
compiled with optimization is just a bit larger than 1 sector, so like the LX200 we will need to write u-boot&lt;br /&gt;
into two sectors. Here&#039;s and example tftpboot of U-Bot for the LX110:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; tftpboot&lt;br /&gt;
    Using open_ethernet device&lt;br /&gt;
    TFTP from server 192.168.11.55; our IP address is 192.168.11.95&lt;br /&gt;
    Filename &#039;u-boot.bin&#039;.&lt;br /&gt;
    Load address: 0x2000000&lt;br /&gt;
    Loading: ##########&lt;br /&gt;
    done&lt;br /&gt;
    Bytes transferred = 144956 (2363c hex)&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for both the LX200 and the LX60 that the image size, &#039;&#039;&#039;(3241c hex)&#039;&#039;&#039; in this case, is a bit less than 0x40000 or 10 sectors, &lt;br /&gt;
so turn off protection on the 1st 11 sectors and&lt;br /&gt;
erase the current contents. &lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX60&#039;&#039;&#039; you do this:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F801FFFF&#039;&#039;&#039;&lt;br /&gt;
        erase F8000000 F801FFFF&lt;br /&gt;
        ... done&lt;br /&gt;
&lt;br /&gt;
For the &#039;&#039;&#039;LX200&#039;&#039;&#039; and the &#039;&#039;&#039;LX110&#039;&#039;&#039; the starting address &#039;&#039;&#039;(F8000000)&#039;&#039;&#039; is the same as with the LX60 but the last address &#039;&#039;&#039;(F803FFFF)&#039;&#039;&#039; is &#039;twice&#039; as high:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;protect off F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  ... done&lt;br /&gt;
  Un-Protected 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;erase F8000000 F803FFFF&#039;&#039;&#039;&lt;br /&gt;
  Erased 2 sectors&lt;br /&gt;
  U-Boot&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy the the image of u-boot.bin in memory to the flash. For the XL60 with the &#039;&#039;&#039;OLD&#039;&#039;&#039; V2 MMU you copy 0x20000&lt;br /&gt;
bytes from 0xd2000000 to 0XF8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the LX60 with the &#039;&#039;&#039;NEW&#039;&#039;&#039; V3 MMU you copy 0x24000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 20000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX200 you copy 0x40000 bytes from 0xd2000000 to 0XF8000000...0XF803FFFF:&lt;br /&gt;
&lt;br /&gt;
  U-Boot&amp;gt; &#039;&#039;&#039;cp.b d2000000 F8000000 40000&#039;&#039;&#039;&lt;br /&gt;
  Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
For the LX110 with a V3-MMU you copy 0x40000 bytes from 0x2000000 to F8000000:&lt;br /&gt;
    U-Boot&amp;gt; cp.b 2000000 F8000000 40000&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we protect these sectors so that U-Boot isn&#039;t easily erased by accident.&lt;br /&gt;
Below is what it looks like on a LX60 with the New V3 MMU with a subsequent display of the flash info:&lt;br /&gt;
&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;cp.b 2000000 F8000000 2000&#039;&#039;&#039;&lt;br /&gt;
    Copy to Flash... done&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000        F8002000        F8004000        F8006000        F8008000&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F800A000        F800C000        F800E000        F8010000        &#039;&#039;&#039;F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000&lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .......... done&lt;br /&gt;
    Protected 10 sectors&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors&lt;br /&gt;
      AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x2257&lt;br /&gt;
      Erase timeout: 8192 ms, write timeout: 1 ms&lt;br /&gt;
 &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8002000   RO   F8004000   RO   F8006000   RO   F8008000   RO&lt;br /&gt;
      F800A000   RO   F800C000   RO   F800E000   RO   F8010000   RO&#039;&#039;&#039;   F8020000 E&lt;br /&gt;
      F8030000 E      F8040000 E      F8050000 E      F8060000 E      F8070000 E&lt;br /&gt;
      F8080000 E      F8090000 E      F80A0000 E      F80B0000 E      F80C0000 E&lt;br /&gt;
      F80D0000 E      F80E0000 E      F80F0000 E      F8100000 E      F8110000 E&lt;br /&gt;
      F8120000 E      F8130000 E      F8140000 E      F8150000 E      F8160000 E&lt;br /&gt;
      F8170000 E      F8180000 E      F8190000 E      F81A0000 E      F81B0000 E&lt;br /&gt;
      F81C0000 E      F81D0000 E      F81E0000 E      F81F0000 E      F8200000 E&lt;br /&gt;
      F8210000 E      F8220000 E      F8230000 E      F8240000 E      F8250000 E&lt;br /&gt;
      F8260000 E      F8270000 E      F8280000 E      F8290000 E      F82A0000 E&lt;br /&gt;
      F82B0000 E      F82C0000 E      F82D0000 E      F82E0000 E      F82F0000 E&lt;br /&gt;
      F8300000 E      F8310000 E      F8320000 E      F8330000 E      F8340000 E&lt;br /&gt;
      F8350000 E      F8360000 E      F8370000 E      F8380000 E      F8390000 E&lt;br /&gt;
      F83A0000 E      F83B0000 E      F83C0000 E      F83D0000 E      F83E0000  &lt;br /&gt;
      &#039;&#039;&#039;F83F0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the LX110 with the V3-MMU here&#039;s what the flash info looks like after we&lt;br /&gt;
protect the first two sectors with U-Boot copied to it:&lt;br /&gt;
&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; flinfo&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 32 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E &lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E  &lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E  &lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E  &lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt; help&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Below is what it looks like on a LX200 with the V2 MMU with a subsequent display of the flash info.&lt;br /&gt;
Notice that the Flash Sectors are 10X as large on the LX200:&lt;br /&gt;
&lt;br /&gt;
   U-Boot&amp;gt; &#039;&#039;&#039;protect on F8000000 F802FFFF&#039;&#039;&#039;&lt;br /&gt;
    .. done&lt;br /&gt;
    Protected 2 sectors&lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
&lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E      F8060000 E      F8080000 E&lt;br /&gt;
      F80A0000 E      F80C0000 E      F80E0000 E      F8100000 E      F8120000 E&lt;br /&gt;
      F8140000 E      F8160000 E      F8180000 E      F81A0000 E      F81C0000 E&lt;br /&gt;
      F81E0000 E      F8200000 E      F8220000 E      F8240000 E      F8260000 E&lt;br /&gt;
      F8280000 E      F82A0000 E      F82C0000 E      F82E0000 E      F8300000 E&lt;br /&gt;
      F8320000 E      F8340000 E      F8360000 E      F8380000 E      F83A0000 E&lt;br /&gt;
      F83C0000 E      F83E0000 E      F8400000 E      F8420000 E      F8440000 E&lt;br /&gt;
      F8460000 E      F8480000 E      F84A0000 E      F84C0000 E      F84E0000 E&lt;br /&gt;
      F8500000 E      F8520000 E      F8540000 E      F8560000 E      F8580000 E&lt;br /&gt;
      F85A0000 E      F85C0000 E      F85E0000 E      F8600000 E      F8620000 E&lt;br /&gt;
      F8640000 E      F8660000 E      F8680000 E      F86A0000 E      F86C0000 E&lt;br /&gt;
      F86E0000 E      F8700000 E      F8720000 E      F8740000 E      F8760000 E&lt;br /&gt;
      F8780000 E      F87A0000 E      F87C0000 E      F87E0000 E      F8800000 E&lt;br /&gt;
      F8820000 E      F8840000 E      F8860000 E      F8880000 E      F88A0000 E&lt;br /&gt;
      F88C0000 E      F88E0000 E      F8900000 E      F8920000 E      F8940000 E&lt;br /&gt;
      F8960000 E      F8980000 E      F89A0000 E      F89C0000 E      F89E0000 E&lt;br /&gt;
      F8A00000 E      F8A20000 E      F8A40000 E      F8A60000 E      F8A80000 E&lt;br /&gt;
      F8AA0000 E      F8AC0000 E      F8AE0000 E      F8B00000 E      F8B20000 E&lt;br /&gt;
      F8B40000 E      F8B60000 E      F8B80000 E      F8BA0000 E      F8BC0000 E&lt;br /&gt;
      F8BE0000 E      F8C00000 E      F8C20000 E      F8C40000 E      F8C60000 E&lt;br /&gt;
      F8C80000 E      F8CA0000 E      F8CC0000 E      F8CE0000 E      F8D00000 E&lt;br /&gt;
      F8D20000 E      F8D40000 E      F8D60000 E      F8D80000 E      F8DA0000 E&lt;br /&gt;
      F8DC0000 E      F8DE0000 E      F8E00000 E      F8E20000 E      F8E40000 E&lt;br /&gt;
      F8E60000 E      F8E80000 E      F8EA0000 E      F8EC0000 E      F8EE0000 E&lt;br /&gt;
      F8F00000 E      F8F20000 E      F8F40000 E      F8F60000 E      F8F80000 E&lt;br /&gt;
      F8FA0000 E      F8FC0000 E      &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased and protected the last four sectors&lt;br /&gt;
of this LX200.&lt;br /&gt;
&lt;br /&gt;
On both the LX60 and the LX200 now move DIP switch 8 to the ON position, power cycle the board. On the LX60 you should see U-boot in the LCD display. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;LX60&#039;&#039;&#039; with the new V3 MMU the serial console should print something like the following:&lt;br /&gt;
  &lt;br /&gt;
   U-Boot 2009.08-dirty (Sep 10 2010 - 18:23:26)&lt;br /&gt;
 &lt;br /&gt;
    CPU:    Xtensa dc233c at 50.00 MHz&lt;br /&gt;
    Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 64 MB&lt;br /&gt;
    Flash:  4 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:    00:50:C2:13:6f:0a&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    open_ethernet&lt;br /&gt;
    U-Boot&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;LX200&#039;&#039;&#039;, shown below with the old V2 MMU, you should see something like the following. In this case we also show the flash info command, &#039;&#039;&#039;flinfo&#039;&#039;&#039;, being invoked just after booting U-Boot:&lt;br /&gt;
&lt;br /&gt;
   CPU:    Xtensa test_mmuhifi_c3 at 41.6777 MHz&lt;br /&gt;
    Board:  XT-AV200: Avnet board + Xilinx LX200 FPGA + Tensilica bitstream&lt;br /&gt;
    SysRAM: 96 MB&lt;br /&gt;
    Flash: 16 MB&lt;br /&gt;
    In:    serial&lt;br /&gt;
    Out:   serial&lt;br /&gt;
    Err:   serial&lt;br /&gt;
    MAC:&lt;br /&gt;
    IP:     192.168.11.95&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    U-Boot&amp;gt; &#039;&#039;&#039;flinfo&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 131 Sectors&lt;br /&gt;
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18&lt;br /&gt;
      Erase timeout: 4096 ms, write timeout: 1 ms&lt;br /&gt;
      Buffer write timeout: 2 ms, buffer size: 64 bytes&lt;br /&gt;
      &lt;br /&gt;
      Sector Start Addresses:&lt;br /&gt;
      &#039;&#039;&#039;F8000000   RO   F8020000   RO&#039;&#039;&#039;   F8040000 E RO   F8060000 E RO   F8080000 E RO&lt;br /&gt;
      F80A0000 E RO   F80C0000 E RO   F80E0000 E RO   F8100000 E RO   F8120000 E RO&lt;br /&gt;
      F8140000 E RO   F8160000 E RO   F8180000 E RO   F81A0000 E RO   F81C0000 E RO&lt;br /&gt;
      F81E0000 E RO   F8200000 E RO   F8220000 E RO   F8240000 E RO   F8260000 E RO&lt;br /&gt;
      F8280000 E RO   F82A0000 E RO   F82C0000 E RO   F82E0000 E RO   F8300000 E RO&lt;br /&gt;
      F8320000 E RO   F8340000 E RO   F8360000 E RO   F8380000 E RO   F83A0000 E RO&lt;br /&gt;
      F83C0000 E RO   F83E0000 E RO   F8400000 E RO   F8420000 E RO   F8440000 E RO&lt;br /&gt;
      F8460000 E RO   F8480000 E RO   F84A0000 E RO   F84C0000 E RO   F84E0000 E RO&lt;br /&gt;
      F8500000 E RO   F8520000 E RO   F8540000 E RO   F8560000 E RO   F8580000 E RO&lt;br /&gt;
      F85A0000 E RO   F85C0000 E RO   F85E0000 E RO   F8600000 E RO   F8620000 E RO&lt;br /&gt;
      F8640000 E RO   F8660000 E RO   F8680000 E RO   F86A0000 E RO   F86C0000 E RO&lt;br /&gt;
      F86E0000 E RO   F8700000 E RO   F8720000 E RO   F8740000 E RO   F8760000 E RO&lt;br /&gt;
      F8780000 E RO   F87A0000 E RO   F87C0000 E RO   F87E0000 E RO   F8800000 E RO&lt;br /&gt;
      F8820000 E RO   F8840000 E RO   F8860000 E RO   F8880000 E RO   F88A0000 E RO&lt;br /&gt;
      F88C0000 E RO   F88E0000 E RO   F8900000 E RO   F8920000 E RO   F8940000 E RO&lt;br /&gt;
      F8960000 E RO   F8980000 E RO   F89A0000 E RO   F89C0000 E RO   F89E0000 E RO&lt;br /&gt;
      F8A00000 E RO   F8A20000 E RO   F8A40000 E RO   F8A60000 E RO   F8A80000 E RO&lt;br /&gt;
      F8AA0000 E RO   F8AC0000 E RO   F8AE0000 E RO   F8B00000 E RO   F8B20000 E RO&lt;br /&gt;
      F8B40000 E RO   F8B60000 E RO   F8B80000 E RO   F8BA0000 E RO   F8BC0000 E RO&lt;br /&gt;
      F8BE0000 E RO   F8C00000 E RO   F8C20000 E RO   F8C40000 E RO   F8C60000 E RO&lt;br /&gt;
      F8C80000 E RO   F8CA0000 E RO   F8CC0000 E RO   F8CE0000 E RO   F8D00000 E RO&lt;br /&gt;
      F8D20000 E RO   F8D40000 E RO   F8D60000 E RO   F8D80000 E RO   F8DA0000 E RO&lt;br /&gt;
      F8DC0000 E RO   F8DE0000 E RO   F8E00000 E RO   F8E20000 E RO   F8E40000 E RO&lt;br /&gt;
      F8E60000 E RO   F8E80000 E RO   F8EA0000 E RO   F8EC0000 E RO   F8EE0000 E RO&lt;br /&gt;
      F8F00000 E RO   F8F20000 E RO   F8F40000 E RO   F8F60000 E RO   F8F80000 E RO&lt;br /&gt;
      F8FA0000 E RO   F8FC0000 E RO   &#039;&#039;&#039;F8FE0000   RO   F8FE8000   RO   F8FF0000   RO&#039;&#039;&#039;&lt;br /&gt;
      &#039;&#039;&#039;F8FF8000   RO&#039;&#039;&#039;&lt;br /&gt;
    U-Boot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the 1st two sectors with U-Boot saved in them came up as not being erased (&#039;&#039;&#039;E&#039;&#039;&#039;) but that all sectors came up Read Only (&#039;&#039;&#039;RO&#039;&#039;&#039;).&lt;br /&gt;
Same with the last four sectors that the U-Boot &#039;&#039;&#039;saveenv&#039;&#039;&#039; command Erased. This is likely a &#039;&#039;&#039;bug&#039;&#039;&#039; on the LX200 boards with some preliminary investigation.&lt;br /&gt;
We will be discussing this with the U-Boot developers sometime in the future prior to pushing our U-boot changes upstream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If U-Boot fails to boot ya might try making sure your U-Boot &#039;&#039;&#039;serverip&#039;&#039;&#039; environment variable matches the address of the tftp server where&lt;br /&gt;
you have copied your &#039;&#039;&#039;u-boot.bin&#039;&#039;&#039; file to and comparing the bits in the flash that got mapped to 0xfe00,0000 to what in the file:&lt;br /&gt;
&lt;br /&gt;
 u-boot]$ &#039;&#039;&#039;od -t x4  u-boot.bin | more&#039;&#039;&#039;&lt;br /&gt;
    .0000000 00000206 fe000040 ffffffff a0fffe21&lt;br /&gt;
    .0000020 00000002 fe01ad14 fe01ad8c 03f95030&lt;br /&gt;
    .0000040 03f9aa78 04000000 00040003 03f8147c&lt;br /&gt;
    .0000060 03f81418 00000000 00000000 00000000&lt;br /&gt;
    .0000100 5300000c 13a00013 4800130c 13493013&lt;br /&gt;
    .0000120 0c130200 13e62032 22002010 a03200a0&lt;br /&gt;
    .0000140 1d837680 82037282 72822372 63728243&lt;br /&gt;
    .0000160 72007272 72720872 18727210 2201d222&lt;br /&gt;
    .0000200 020c80c2 3d80a032 1d8376f0 d20372d2&lt;br /&gt;
    .0000220 72d22372 6372d243 f20072f2 72f20872&lt;br /&gt;
    .0000240 1872f210 2201d222 200080c2 ffd92100&lt;br /&gt;
    .0000260 37ffda31 02481d12 22681258 145722cb&lt;br /&gt;
    .0000300 ee1467f1 664b0678 444b0479 06f43457&lt;br /&gt;
    .0000320 0000fff8 31ffd221 4320ffd2 40443bc0&lt;br /&gt;
    .0000340 84764142 4b020903 32020c22 837680a0&lt;br /&gt;
    .0000360 04728211 82247282 72824472 01d22264&lt;br /&gt;
    .0000400 1180c222 c821ffc8 13e620ff 41002010&lt;br /&gt;
    .0000420 04d0ffc7 ffc64100 fffffd86 1049c500&lt;br /&gt;
    .0000440 e52049d5 49f53049 00003400 00000000&lt;br /&gt;
    .0000460 00000000 00000000 00000000 00000000&lt;br /&gt;
    .&lt;br /&gt;
    .(gdb) &#039;&#039;&#039;x/100x 0xfe000000&#039;&#039;&#039;&lt;br /&gt;
    .0xfe000000 &amp;lt;_ResetVector&amp;gt;:         0x00000206      0xfe000040      0xffffffff      0xa0fffe21&lt;br /&gt;
    .0xfe000010 &amp;lt;_ResetVector+16&amp;gt;:      0x00000002      0xfe01ad14      0xfe01ad8c      0x03f95030&lt;br /&gt;
    .0xfe000020 &amp;lt;_ResetVector+32&amp;gt;:      0x03f9aa78      0x04000000      0x00040003      0x03f8147c&lt;br /&gt;
    .0xfe000030 &amp;lt;_ResetVector+48&amp;gt;:      0x03f81418      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .0xfe000040 &amp;lt;_start&amp;gt;:               0x5300000c      0x13a00013      0x4800130c      0x13493013&lt;br /&gt;
    .0xfe000050 &amp;lt;_start+16&amp;gt;:            0x0c130200      0x13e62032      0x22002010      0xa03200a0&lt;br /&gt;
    .0xfe000060 &amp;lt;_start+32&amp;gt;:            0x1d837680      0x82037282      0x72822372      0x63728243&lt;br /&gt;
    .0xfe000070 &amp;lt;_start+48&amp;gt;:            0x72007272      0x72720872      0x18727210      0x2201d222&lt;br /&gt;
    .0xfe000080 &amp;lt;_start+64&amp;gt;:            0x020c80c2      0x3d80a032      0x1d8376f0      0xd20372d2&lt;br /&gt;
    .0xfe000090 &amp;lt;_start+80&amp;gt;:            0x72d22372      0x6372d243      0xf20072f2      0x72f20872&lt;br /&gt;
    .0xfe0000a0 &amp;lt;_start+96&amp;gt;:            0x1872f210      0x2201d222      0x200080c2      0xffd92100&lt;br /&gt;
    .0xfe0000b0 &amp;lt;_start+112&amp;gt;:           0x37ffda31      0x02481d12      0x22681258      0x145722cb&lt;br /&gt;
    .0xfe0000c0 &amp;lt;_start+128&amp;gt;:           0xee1467f1      0x664b0678      0x444b0479      0x06f43457&lt;br /&gt;
    .0xfe0000d0 &amp;lt;_start+144&amp;gt;:           0x0000fff8      0x31ffd221      0x4320ffd2      0x40443bc0&lt;br /&gt;
    .0xfe0000e0 &amp;lt;_start+160&amp;gt;:           0x84764142      0x4b020903      0x32020c22      0x837680a0&lt;br /&gt;
    .0xfe0000f0 &amp;lt;_start+176&amp;gt;:           0x04728211      0x82247282      0x72824472      0x01d22264&lt;br /&gt;
    .0xfe000100 &amp;lt;_start+192&amp;gt;:           0x1180c222      0xc821ffc8      0x13e620ff      0x41002010&lt;br /&gt;
    .0xfe000110 &amp;lt;_reset+1&amp;gt;:             0x04d0ffc7      0xffc64100      0x00fffd86      0x1049c500&lt;br /&gt;
    .0xfe000120:                        0xe52049d5      0x49f53049      0x00003400      0x00000000&lt;br /&gt;
    .0xfe000130:                        0x00000000      0x00000000      0x00000000      0x00000000&lt;br /&gt;
    .(gdb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further details on U-Boot in general are in the generic &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; at the top of the U-Boot tree. Details specific to the Xtensa architecture are in &amp;lt;tt&amp;gt;doc/README.xtensa&amp;lt;/tt&amp;gt;. Details specific to a board are in &amp;lt;tt&amp;gt;board[/&amp;lt;family&amp;gt;]/&amp;lt;board&amp;gt;/README&amp;lt;/tt&amp;gt; (for example &amp;lt;tt&amp;gt;board/avnet/xtav60/README&amp;lt;/tt&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Piet</name></author>
	</entry>
</feed>