[U-Boot] [RFC 3/3] xpedite5370: Add uboot-doc support

John Schmoller jschmoller at xes-inc.com
Tue Jul 28 18:34:03 CEST 2009


Add uboot-doc support to the XPedite5370. Incorporates
templates to override the defaults and includes memory
maps.

Signed-off-by: John Schmoller <jschmoller at xes-inc.com>
---
 board/xes/xpedite5370/manual/book_info.tmpl        |   52 ++++++
 board/xes/xpedite5370/manual/booting_linux.tmpl    |  179 ++++++++++++++++++++
 board/xes/xpedite5370/manual/booting_vxworks.tmpl  |  166 ++++++++++++++++++
 board/xes/xpedite5370/manual/manual.tmpl           |   30 ++++
 board/xes/xpedite5370/manual/redundant_images.tmpl |   50 ++++++
 board/xes/xpedite5370/manual/scripting.tmpl        |  168 ++++++++++++++++++
 include/configs/XPEDITE5370.h                      |   47 +++++
 7 files changed, 692 insertions(+), 0 deletions(-)
 create mode 100644 board/xes/xpedite5370/manual/book_info.tmpl
 create mode 100644 board/xes/xpedite5370/manual/booting_linux.tmpl
 create mode 100644 board/xes/xpedite5370/manual/booting_vxworks.tmpl
 create mode 100644 board/xes/xpedite5370/manual/manual.tmpl
 create mode 100644 board/xes/xpedite5370/manual/redundant_images.tmpl
 create mode 100644 board/xes/xpedite5370/manual/scripting.tmpl

diff --git a/board/xes/xpedite5370/manual/book_info.tmpl b/board/xes/xpedite5370/manual/book_info.tmpl
new file mode 100644
index 0000000..3e6ec85
--- /dev/null
+++ b/board/xes/xpedite5370/manual/book_info.tmpl
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<info>
+  <title>${BOARD} U-Boot Manual</title>
+  <subtitle>U-Boot User&apos;s Manual</subtitle>
+  <releaseinfo>U-Boot version: ${VERSION}</releaseinfo>
+  <titleabbrev>${BOARD}</titleabbrev>
+  <pubdate>${DATE}</pubdate>
+  <address>
+    <personname>Extreme Engineering Solutions, Inc.</personname>
+    <street>3225 Demming Way, Suite 120</street>
+    <city>Middleton, </city>
+    <state>WI </state>
+    <postcode>53562-1408 </postcode>
+    <country>USA</country>
+    <phone>Phone: (608) 833-1155</phone>
+    <fax>Fax: (608) 827-6171</fax>
+    <uri>Web: http://xes-inc.com</uri>
+    <email>E-mail: sales at xes-inc.com</email>
+  </address>
+  <mediaobject>
+    <imageobject>
+      <imagedata fileref="/home/jschmoller/trunk/share/src/images/xes_logo_with_name_left.svg"/>
+    </imageobject>
+  </mediaobject>
+  <legalnotice>
+    <para>
+      U-Boot is free software; you can redistribute it and/or
+      modify it under the terms of the GNU General Public License as
+      published by the Free Software Foundation; either version 2 of
+      the License, or (at your option) any later version.
+    </para>
+
+    <para>
+      U-Boot is distributed in the hope that it will be useful,
+      but WITHOUT ANY WARRANTY; without even the implied warranty of
+      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+      GNU General Public License for more details.
+    </para>
+
+    <para>
+      You should have received a copy of the GNU General Public License
+      along with this program; if not, write to the
+      <orgname>Free Software Foundation, Inc.</orgname>,
+      <address><street>59 Temple Place, Suite 330</street>
+	<city>Boston</city>, <state>MA</state> <postcode>02111-1307</postcode>
+	<country>USA</country>
+      </address>
+    </para>
+  </legalnotice>
+</info>
+
diff --git a/board/xes/xpedite5370/manual/booting_linux.tmpl b/board/xes/xpedite5370/manual/booting_linux.tmpl
new file mode 100644
index 0000000..d026d1b
--- /dev/null
+++ b/board/xes/xpedite5370/manual/booting_linux.tmpl
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<chapter version="5.0" xml:id="uboot_booting_linux_chapter"
+	 xmlns="http://docbook.org/ns/docbook"
+	 xmlns:xi="http://www.w3.org/2001/XInclude">
+  <title>Booting Linux</title>
+
+
+  <sect1 xml:id="uboot_booting_linux">
+    <title>Booting Linux with U-Boot</title>
+    <sect2 xml:id="uboot_booting_linux_intro">
+      <title>Booting Linux</title>
+      <para>The following is intended to be a Quick Start guide for booting a
+	Linux kernel. More information can be found in your Linux Manual.
+      </para>
+
+      <para>Your Linux kernel can be booted from either RAM or from Flash.
+	Images booted from RAM will need to be downloaded from the network
+	using <link linkend="uboot_cmd_tftpboot"><literal>tftp</literal></link>
+	on every reset. Images booted from Flash will be copied from Flash to
+	RAM automatically.
+      </para>
+
+      <sect3 xml:id="uboot_booting_linux_ram">
+	<title>Booting from RAM</title>
+	<para>To boot an image from RAM, you will need to have your Linux
+	  kernel and Flat Device Tree image on a TFTP server. See
+	  <link linkend="uboot_setup_network">
+	  <literal>Networking</literal></link> for more information about
+	  TFTP and TFTP servers. Next, you will need to set up your
+	  <link linkend="uboot_env_sect_networking">
+	  <literal>network environment variables</literal></link> to point to
+	  your TFTP server.
+#ifdef CONFIG_CMD_DHCP
+	  You can use a DHCP server to accomplish this if
+	  your network has one set up using the
+	  <link linkend="uboot_cmd_dhcp"><literal>dhcp</literal></link> command.
+#endif
+	  Set <link linkend="uboot_env_osfile"><literal>osfile</literal></link>
+	  to the path to your Linux kernel on your TFTP server and set
+	  <link linkend="uboot_env_fdtfile"><literal>fdtfile</literal></link>
+	  to the path to your Flat Device Tree image on your TFTP server.
+	  Finally,
+	  type <link linkend="uboot_cmd_run"><literal>run</literal></link>
+	  <link linkend="uboot_env_bootcmd_net">
+	  <literal>bootcmd_net</literal></link> to download and boot your
+	  Linux kernel. This option assumes you are booting an NFS file system.
+	</para>
+
+	<para>Your console input/output should look something like this.
+	  <screen>
+=> run bootcmd_net
+Enet starting in 1000BT/FD
+Speed: 1000, full duplex
+Using eTSEC1 device
+TFTP from server 10.52.0.33; our IP address is 10.52.250.134; sending through gateway 10.52.0.1
+Filename &apos;/home/jschmoller/uImage-XPedite5370-S2.6.23.17-fsl_r1&apos;.
+Load address: 0x1000000
+Loading: *###############################################################
+	 #################################################################
+	 #################################################################
+	 #################################################################
+	 ######
+done
+Bytes transferred = 3901275 (3b875b hex)
+Enet starting in 1000BT/FD
+Speed: 1000, full duplex
+Using eTSEC1 device
+TFTP from server 10.52.0.33; our IP address is 10.52.250.134; sending through gateway 10.52.0.1
+Filename &apos;/home/jschmoller/xpedite5370.dtb-XPedite5370-S2.6.23.17-fsl_r1&apos;.
+Load address: 0xc00000
+Loading: *##
+done
+Bytes transferred = 16384 (4000 hex)
+## Booting kernel from Legacy Image at 01000000 ...
+   Image Name:   Linux-2.6.23.17-fsl_r1
+   Created:      2008-08-06  16:46:04 UTC
+   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
+   Data Size:    3901211 Bytes =  3.7 MB
+   Load Address: 00000000
+   Entry Point:  00000000
+   Verifying Checksum ... OK
+   Uncompressing Kernel Image ... OK
+	  </screen>
+	</para>
+      </sect3>
+
+      <sect3 xml:id="uboot_booting_linux_flash">
+	<title>Booting from Flash</title>
+	<para>To boot an image from Flash, you will need to follow a similar
+	  procedure to load the Kernel and FDT for the first time. Make sure
+	  you have your Kernel and FDT on your TFTP server.  Set your
+	  <link linkend="uboot_env_sect_networking">
+	  <literal>network environment variables</literal></link> to point to
+	  your TFTP server. Set
+	  <link linkend="uboot_env_osfile"><literal>osfile</literal></link> to
+	  the path to your Linux kernel on your TFTP server and set
+	  <link linkend="uboot_env_fdtfile"><literal>fdtfile</literal></link>
+	  to the path to your Flat Device Tree image on your TFTP server. Then,
+	  type <link linkend="uboot_cmd_run"><literal>run</literal></link>
+	  <link linkend="uboot_env_prog_os1"><literal>prog_os1</literal></link>
+	  to load the Primary OS, or type <link linkend="uboot_cmd_run">
+	  <literal>run</literal></link> <link linkend="uboot_env_prog_os2">
+	  <literal>prog_os2</literal></link> to load the Secondary OS. Next,
+	  you&apos;ll need to load the FDT by running either
+	  <link linkend="uboot_env_prog_fdt1">
+	  <literal>prog_fdt1</literal></link> or <link linkend="env_prog_fdt2">
+	  <literal>prog_fdt2</literal></link>. Once the image and FDT are
+	  loaded into Flash, you can boot the Primary Image by typing
+	  <link linkend="uboot_cmd_run"><literal>run</literal></link>
+	  <link linkend="uboot_env_bootcmd_flash1">
+	  <literal>bootcmd_flash1</literal></link> at the prompt or you can
+	  boot the Secondary Image by typing <link linkend="uboot_cmd_run">
+	  <literal>run</literal></link>
+	  <link linkend="uboot_env_bootcmd_flash2">
+	  <literal>bootcmd_flash2</literal></link> at the prompt.
+	</para>
+
+	<para>Your console input/output should look something like this.
+	  <screen>
+=> setenv gatewayip 10.52.0.1
+=> setenv netmask 255.255.255.0
+=> setenv ipaddr 10.52.250.134
+=> setenv serverip 10.52.0.33
+=> setenv osfile /home/jschmoller/uImage-XPedite5370-S2.6.23.17-fsl_r1
+=> setenv fdtfile /home/jschmoller/xpedite5370.dtb-XPedite5370-S2.6.23.17-fsl_r1
+=> run prog_os1
+Enet starting in 1000BT/FD
+Speed: 1000, full duplex
+Using eTSEC1 device
+TFTP from server 10.52.0.33; our IP address is 10.52.254.15
+Filename &apos;/home/jschmoller/uImage-XPedite5370-S2.6.23.17-fsl_r1&apos;.
+Load address: 0x1000000
+Loading: #################################################################
+	 #################################################################
+	 #################################################################
+	 #################################################################
+	 ######
+done
+Bytes transferred = 3901275 (3b875b hex)
+
+.............................. done
+Erased 30 sectors
+Copy to Flash... done
+Total of 3901275 bytes were the same
+OS PROGRAM SUCCEEDED
+
+=> run prog_fdt1
+Enet starting in 1000BT/FD
+Speed: 1000, full duplex
+Using eTSEC1 device
+TFTP from server 10.52.0.33; our IP address is 10.52.250.134
+Filename &apos;/home/jschmoller/xpedite5370.dtb-XPedite5370-S2.6.23.17-fsl_r1&apos;.
+Load address: 0xc00000
+Loading: ##
+done
+Bytes transferred = 16384 (4000 hex)
+
+. done
+Erased 1 sectors
+Copy to Flash... done
+Total of 16384 bytes were the same
+FDT PROGRAM SUCCEEDED
+=> run bootcmd_flash1
+## Booting kernel from Legacy Image at fef00000 ...
+   Image Name:   Linux-2.6.23.17-fsl_r1
+   Created:      2008-08-06  16:46:04 UTC
+   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
+   Data Size:    3901211 Bytes =  3.7 MB
+   Load Address: 00000000
+   Entry Point:  00000000
+   Verifying Checksum ... OK
+   Uncompressing Kernel Image ... OK
+	  </screen>
+	</para>
+      </sect3>
+    </sect2>
+  </sect1>
+</chapter>
diff --git a/board/xes/xpedite5370/manual/booting_vxworks.tmpl b/board/xes/xpedite5370/manual/booting_vxworks.tmpl
new file mode 100644
index 0000000..c10ba6f
--- /dev/null
+++ b/board/xes/xpedite5370/manual/booting_vxworks.tmpl
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<chapter version="5.0" xml:id="uboot_booting_vxworks_chapter"
+	 xmlns="http://docbook.org/ns/docbook"
+	 xmlns:xi="http://www.w3.org/2001/XInclude">
+  <title>Booting VxWorks</title>
+
+  <sect1 xml:id="uboot_booting_vxworks">
+    <title>Booting VxWorks with U-Boot</title>
+    <sect2 os="vxworks" xml:id="uboot_booting_vxworks_intro">
+      <title>VxWorks</title>
+
+      <para>The following is intended to be a Quick Start guide for booting a
+	VxWorks image. More information can be found in your VxWorks Manual.
+      </para>
+
+      <para>VxWorks images can be booted from either RAM or Flash. VxWorks
+	images also come in a uImage format and an ELF format.  The boot
+	command for an ELF image is <link linkend="uboot_cmd_bootvx">
+	<literal>bootvx</literal></link> and the boot command for a uImage is
+	<link linkend="uboot_cmd_bootm"><literal>bootm</literal></link>.
+      </para>
+
+      <sect3 xml:id="uboot_booting_vxworks_ram">
+	<title>Booting from RAM</title>
+	<para>VxWorks requires a string of arguments to be passed to it in
+	  order to function properly. To boot from RAM, begin by setting the
+	  <link linkend="uboot_env_root_args">
+	  <literal>root_args</literal></link> string to something like the
+	  following: <literal>motetsec(0,0)host:&lt;Path to VxWorks image&gt;
+	  h=&lt;Host IP&gt; e=&lt;Board IP&gt;:&lt;Netmask&gt; u=drives
+	  pw=drives</literal> and the <link linkend="uboot_env_misc_args">
+	  <literal>misc_args</literal></link> to <literal>f=0x0</literal>.
+	  Replace the items in &lt;&gt;&apos;s with the appropriate values.
+	  Next, configure your <link linkend="uboot_env_sect_networking">
+	  <literal>network environment variables</literal></link> to point to
+	  your TFTP server. Download the VxWorks image by typing
+	  <link linkend="uboot_cmd_tftpboot"><literal>tftpboot</literal></link>
+	  <literal>0x1000000 &lt;Path to VxWorks image&gt;</literal>. Finally,
+	  use the boot command specified above and type
+	  <literal>&lt;Boot Command&gt; 0x1000000</literal> at the prompt to
+	  finish booting your VxWorks image.
+	</para>
+
+	<para>Your console input/output should look something like this.
+	  <screen>
+=> setenv root_args motetsec(0,0)host:/home/mstarzewski/xes8572-vxWorks.st
+h=10.52.0.33 e=10.52.250.134:ffff0000 u=drives pw=drives
+=> setenv misc_args f=0x0
+=> setenv gatewayip 10.52.0.1
+=> setenv netmask 255.255.255.0
+=> setenv ipaddr 10.52.250.134
+=> setenv serverip 10.52.0.33
+=> tftp 1000000 /home/mstarzewski/xes8572-vxWorks.st
+Enet starting in 1000BT/FD
+
+Speed: 1000, full duplex
+Using eTSEC1 device
+TFTP from server 10.52.0.33; our IP address is 10.52.250.134; sending through gateway 10.52.0.1
+Filename &apos;/home/mstarzewski/xes8572-vxWorks.st&apos;.
+Load address: 0x1000000
+Loading: #################################################################
+	 ######################################################
+done
+Bytes transferred = 1740761 (1a8fd9 hex)
+=> bootvx 1000000
+## Ethernet MAC address not copied to NV RAM
+Loading .text @ 0x00100000 (1263808 bytes)
+Loading .sdata2 @ 0x002348c0 (432 bytes)
+Loading .data @ 0x00234a70 (128320 bytes)
+Loading .sdata @ 0x00253fb0 (2752 bytes)
+Clearing .sbss @ 0x00254a70 (2144 bytes)
+Clearing .bss @ 0x002552d0 (252128 bytes)
+## Using bootline (@ 0x4200): motetsec(0,0)host:/home/mstarzewski/xes8572-vxWorks.st
+h=10.52.0.33 e=10.52.250.134:ffff0000 u=drives pw=drives f=0x0
+## Starting vxWorks at 0x00100000 ...
+Target Name: vxTarget
+...
+	  </screen>
+	</para>
+      </sect3>
+
+      <sect3>
+	<title>Booting from Flash</title>
+	<para>VxWorks requires a string of arguments to be passed to it in
+	  order to function properly. To boot from Flash, begin by setting the
+	  <link linkend="uboot_env_root_args">
+	  <literal>root_args</literal></link> string to something like the
+	  following: <literal>motetsec(0,0)host:
+	  &lt;Path to VxWorks image&gt; h=&lt;Host IP&gt; e=&lt;Board IP&gt;:
+	  &lt;Netmask&gt; u=drives pw=drives</literal> and the
+	  <link linkend="uboot_env_misc_args">
+	  <literal>misc_args</literal></link> to <literal>f=0x0</literal>.
+	  Replace the items in &lt;&gt;&apos;s with the appropriate values.
+	  Next, configure your <link linkend="uboot_env_sect_networking">
+	  <literal>network environment variables</literal></link> to point to
+	  your TFTP server. Download the VxWorks image by typing
+	  <link linkend="uboot_cmd_tftpboot"><literal>tftpboot</literal></link>
+	  <literal>1000000 &lt;Path to VxWorks image&gt;</literal>. To program
+	  the image to Flash, start by clearing space for it. For the Primary
+	  image, type <link linkend="uboot_cmd_erase"><literal>erase</literal>
+	  </link> <literal>fef00000 +&amp;</literal>
+	  <link linkend="uboot_env_filesize"><literal>filesize</literal></link>
+	  and for the Secondary image, type <link linkend="uboot_cmd_erase">
+	  <literal>erase</literal></link> <literal>f6f00000</literal>
+	  <link linkend="uboot_env_filesize">
+	  <literal>+$filesize</literal></link>. Next, copy the image from RAM
+	  to Flash. Type <link linkend="uboot_cmd_cp">
+	  <literal>cp.b</literal></link>
+	  <literal>1000000 fef00000 $filesize</literal> for the Primary image
+	  and <link linkend="uboot_cmd_cp"><literal>cp.b</literal></link>
+	  <literal>1000000 f6f00000 $filesize</literal> for the Secondary image.
+	  Finally, use the boot command specified above and type
+	  <literal>&lt;Boot Command&gt; fef00000</literal> or
+	  <literal>&lt;Boot Command&gt; f6f00000</literal> at the prompt to
+	  finish booting your VxWorks image.
+	</para>
+
+	<para>Your console input/output should look something like this.
+	  <screen>
+=> setenv root_args motetsec(0,0)host:/home/mstarzewski/xes8572-vxWorks.st
+h=10.52.0.33 e=10.52.250.134:ffff0000 u=drives pw=drives
+=> setenv misc_args f=0x0
+=> setenv gatewayip 10.52.0.1
+=> setenv netmask 255.255.255.0
+=> setenv ipaddr 10.52.250.134
+=> setenv serverip 10.52.0.33
+=> tftp 1000000 /home/mstarzewski/xes8572-vxWorks.st
+Enet starting in 1000BT/FD
+Speed: 1000, full duplex
+Using eTSEC1 device
+TFTP from server 10.52.0.33; our IP address is 10.52.250.134; sending through gateway 10.52.0.1
+Filename &apos;/home/mstarzewski/xes8572-vxWorks.st&apos;.
+Load address: 0x1000000
+Loading: #################################################################
+	 ######################################################
+done
+Bytes transferred = 1740761 (1a8fd9 hex)
+=> erase fef00000 +$filesize
+
+.............. done
+Erased 14 sectors
+=> cp.b 1000000 fef00000 $filesize
+
+Copy to Flash... done
+=> bootvx fef00000
+## Ethernet MAC address not copied to NV RAM
+Loading .text @ 0x00100000 (1296720 bytes)
+Loading .sdata2 @ 0x0023c950 (192 bytes)
+Loading .data @ 0x0023ca20 (136656 bytes)
+Loading .sdata @ 0x0025dff0 (2384 bytes)
+Clearing .sbss @ 0x0025e940 (2240 bytes)
+Clearing .bss @ 0x0025f200 (251184 bytes)
+## Using bootline (@ 0x4200): motetsec(0,0)host:/home/mstarzewski/xes8572-vxWorks.st
+h=10.52.0.33 e=10.52.250.134:ffff0000 u=drives pw=drives f=0x0
+## Starting vxWorks at 0x00100000 ...
+Target Name: vxTarget
+...
+	  </screen>
+	</para>
+      </sect3>
+    </sect2>
+  </sect1>
+</chapter>
+
+
diff --git a/board/xes/xpedite5370/manual/manual.tmpl b/board/xes/xpedite5370/manual/manual.tmpl
new file mode 100644
index 0000000..dfac2e6
--- /dev/null
+++ b/board/xes/xpedite5370/manual/manual.tmpl
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<book xmlns="http://docbook.org/ns/docbook"
+      xmlns:xi="http://www.w3.org/2001/XInclude"
+      version="5.0"
+      xml:id="uboot_manual">
+
+  <xi:include href="${TOPDIR}/doc/manual/book_info.xml"/>
+
+  <xi:include href="${TOPDIR}/doc/manual/introduction.xml"/>
+
+  <xi:include href="${TOPDIR}/doc/manual/setup.xml"/>
+
+  <xi:include href="${TOPDIR}/doc/manual/booting_linux.xml"/>
+
+  <xi:include href="${TOPDIR}/doc/manual/booting_vxworks.xml"/>
+
+  <xi:include href="${TOPDIR}/doc/manual/memory_resources.xml"/>
+
+  <xi:include href="${TOPDIR}/doc/manual/redundant_images.xml"/>
+
+  <xi:include href="${TOPDIR}/doc/manual/posts.xml"/>
+
+  <xi:include href="${TOPDIR}/doc/manual/environment_variables.xml"/>
+
+  <xi:include href="${TOPDIR}/doc/manual/commands.xml"/>
+
+  <xi:include href="${TOPDIR}/doc/manual/scripting.xml"/>
+
+</book>
diff --git a/board/xes/xpedite5370/manual/redundant_images.tmpl b/board/xes/xpedite5370/manual/redundant_images.tmpl
new file mode 100644
index 0000000..af6000c
--- /dev/null
+++ b/board/xes/xpedite5370/manual/redundant_images.tmpl
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<chapter version="5.0" xml:id="uboot_redundant_images_chapter"
+	 xmlns="http://docbook.org/ns/docbook"
+	 xmlns:xi="http://www.w3.org/2001/XInclude">
+  <title>Redundant Images</title>
+
+  <sect1 xml:id="uboot_redundant_images">
+    <title>Using Redundant Images with U-Boot</title>
+    <para>The ${BOARD} has two Flash banks, which can be used to hold dual or
+      redundant images. The board is configured with dual U-Boot images (see
+      <link linkend="uboot_memmap_recommended_flash_memory_map">
+      <literal>U-Boot Recommended Memory Regions</literal></link>). It can
+      also be configured with dual or redundant OS images. Sometimes it is
+      advantageous to store two different kernels in the primary and secondary
+      partitions. For example, the most recent version of the user&apos;s kernel
+      image could be stored in one partition, while a previous stable version
+      is kept in the other.
+    </para>
+
+    <para>Or, one kernel could be compiled with debug enabled
+      and the other without. Or the two OS partitions can also be used for
+      redundancy. The U-Boot uImage file has support for checksumming and can
+      be used to verify the integrity of an image. If the checksum fails on one
+      partition, U-Boot can be configured to boot the other partition&apos;s
+      image. This fallback image could be a carbon copy of the first, or could
+      send out notification of the first image&apos;s failure. Fallback is
+      easily configured; the fallback image does not necessarily need to be
+      from the same boot device.
+    </para>
+
+    <para>For example, if the checksum fails on an
+      image in flash, the fallback image could be downloaded over Ethernet.
+      For example, a simple script for booting one uImage and failing over to
+      the second could be written as
+      <link linkend="uboot_cmd_setenv"><literal>setenv</literal></link>
+      <link linkend="uboot_env_bootcmd"><literal>bootcmd</literal></link>
+      <link linkend="uboot_cmd_bootm"><literal>bootm</literal></link>
+      <literal>0xfef00000\;</literal>
+      <link linkend="uboot_cmd_bootm"><literal>bootm</literal></link>
+      <literal>0xf6f00000</literal>. In this example, U-Boot will attempt to
+      boot the Primary OS and will not return if the checksum is valid so
+      Secondary OS will not be called. If the Primary OS is corrupt, U-Boot
+      will return to a prompt where the Secondary OS will be executed.
+    </para>
+  </sect1>
+</chapter>
+
+
+
diff --git a/board/xes/xpedite5370/manual/scripting.tmpl b/board/xes/xpedite5370/manual/scripting.tmpl
new file mode 100644
index 0000000..f5e8a43
--- /dev/null
+++ b/board/xes/xpedite5370/manual/scripting.tmpl
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<chapter version="5.0" xml:id="uboot_scripting_chapter"
+	 xmlns="http://docbook.org/ns/docbook"
+	 xmlns:xi="http://www.w3.org/2001/XInclude">
+  <title>Scripting</title>
+
+  <sect1 xml:id="uboot_scripting">
+    <title>Scripting in U-Boot</title>
+    <sect2 xml:id="uboot_scripting_dollar_sign">
+      <title>Variable Expansion with $</title>
+      <para>Variable substitution can be done with the $ character. For
+	instance, <link linkend="uboot_cmd_printenv">
+	<literal>printenv</literal></link> <link linkend="uboot_env_bootargs">
+	<literal>bootargs</literal></link> could also be executed with
+	<link linkend="uboot_cmd_echo"><literal>echo</literal></link>
+	<link linkend="uboot_env_bootargs"><literal>$bootargs</literal></link>.
+	More powerfully, this variable substitution can be used in scripting.
+	See the example in the next section.
+      </para>
+    </sect2>
+
+    <sect2 xml:id="uboot_scripting_conditionals">
+      <title>Conditionals</title>
+      <para>U-Boot has a scripting language which can be used to customize
+	command execution. It contains if..then..else..fi, for..do..done,
+	while..do..done and until..do..done control flow operations.
+      </para>
+
+      <para>As an example, take the X-ES environment variable
+	<link linkend="uboot_env_bootcmd_net">
+	<literal>bootcmd_net</literal></link>.
+	<screen>
+bootcmd_net=run set_bootargs; $download_cmd $osaddr $osfile; if test $? -eq 0;
+then if test -n $fdtaddr; then $download_cmd $fdtaddr $fdtfile;
+if test $? -eq 0; then bootm $osaddr - $fdtaddr; else; echo FDT DOWNLOAD FAILED;
+fi; else; bootm $osaddr; fi; else; echo OS DOWNLOAD FAILED; fi;
+	</screen>
+	To walk through the script, we start with
+	<link linkend="uboot_cmd_run"><literal>run</literal></link>
+	<link linkend="uboot_env_set_bootargs">
+	<literal>set_bootargs</literal></link>, which executes the commands
+	stored in <link linkend="uboot_env_set_bootargs">
+	<literal>set_bootargs</literal></link>. Next, we execute the command
+	stored in <link linkend="uboot_env_download_cmd">
+	<literal>download_cmd</literal></link> which in most cases is
+	<link linkend="uboot_cmd_dhcp"><literal>dhcp</literal></link> or
+	<link linkend="uboot_cmd_tftpboot"><literal>tftp</literal></link> and
+	download the file stored in <link linkend="uboot_env_osfile">
+	<literal>osfile</literal></link> to the address stored in
+	<link linkend="uboot_env_osaddr"><literal>osaddr</literal></link>. The
+	next step is interesting. We start an <literal>if</literal> conditional,
+	and use the <link linkend="uboot_cmd_test">
+	<literal>test</literal></link> command to check to see if the return
+	value (<literal>$?</literal>) of the
+	<link linkend="uboot_env_download_cmd">
+	<literal>download_cmd</literal></link> is <literal>0</literal>.	If it
+	isn&apos;t, meaning the download failed, we find the matching
+	<literal>then</literal> and see that we echo
+	<literal>DOWNLOAD FAILED</literal>. If it is <literal>0</literal>
+	meaning the download completed successfully, we start a new
+	<literal>if</literal> conditional and test to see if
+	<link linkend="uboot_env_fdtaddr"><literal>fdtaddr</literal></link> is
+	defined. If it is, use <link linkend="uboot_env_download_cmd">
+	<literal>download_cmd</literal></link> to download the file stored in
+	<link linkend="uboot_env_fdtfile"><literal>fdtfile</literal></link> to
+	the address stored in <link linkend="uboot_env_fdtaddr">
+	<literal>fdtaddr</literal></link>. Again, we verify that the download
+	completed successfully.  If everything has worked up until now, we
+	complete the script with
+	<link linkend="uboot_cmd_bootm"><literal>bootm</literal></link>
+	<link linkend="uboot_env_osaddr"><literal>osaddr</literal></link>
+	<literal>-</literal> <link linkend="uboot_env_fdtaddr">
+	<literal>fdtaddr</literal></link> and boot the image we just downloaded.
+	If <link linkend="uboot_env_fdtaddr"><literal>fdtaddr</literal></link>
+	had been undefined, we would have executed
+	<link linkend="uboot_cmd_bootm"><literal>bootm</literal></link>
+	<link linkend="uboot_env_osaddr"><literal>osaddr</literal></link>
+	instead.
+      </para>
+    </sect2>
+
+    <sect2 xml:id="uboot_scripting_and_or">
+      <title>&amp;&amp; and ||</title>
+      <para>Another feature of the U-Boot scripting language are the
+	<literal>&amp;&amp;</literal> and <literal>||</literal> functions. The
+	<literal>&amp;&amp;</literal> is an if and only if command. For
+	instance, the command
+	<link linkend="uboot_cmd_echo"><literal>echo</literal></link>
+	<literal>$do_stuff &amp;&amp;</literal>
+	<link linkend="uboot_cmd_run"><literal>run</literal></link>
+	<literal>$do_stuff</literal> would run <literal>do_stuff</literal>
+	only if the <link linkend="uboot_cmd_echo">
+	<literal>echo</literal></link> command returned successfully, meaning
+	that <literal>do_stuff</literal> is defined. If
+	<literal>do_stuff</literal> was not defined, the
+	<link linkend="uboot_cmd_run"><literal>run</literal></link> command
+	would not be executed. Similarly, the <literal>||</literal> command will
+	execute the second command only if the first command fails. For
+	instance, if <literal>bank1</literal> stored the location of the OS in
+	flash bank 1 and <literal>bank2</literal> stored the location of the
+	OS in flash bank 2, the following command would try to boot the image
+	in bank 1. If unsuccessful it would boot the image in bank 2.  If that
+	failed, it would attempt to download the file over the network, and if
+	that succeeded, it would boot the image.
+	<screen>
+<literal>bootm $bank1 || bootm $bank2 || tftp $osaddr $osfile &amp;&amp; bootm</literal>
+	</screen>
+      </para>
+    </sect2>
+
+    <sect2 xml:id="uboot_scripting_quotes_and_ticks">
+      <title>Quotes and tick marks</title>
+      <para>Quotation marks and tick marks also have a special meaning in
+	U-Boot scripting. Let&apos;s say you wanted to create an environment
+	variable called <literal>do_stuff</literal> and this variable was going
+	to run <link linkend="uboot_env_set_bootargs">
+	<literal>set_bootargs</literal></link> then run
+	<link linkend="uboot_env_bootcmd"><literal>bootcmd</literal></link>.
+	Depending on how you format the command, it&apos;s execution will
+	change. You could save the command as
+	<screen>
+setenv do_stuff &quot;run $set_bootargs; run $bootcmd&quot;
+	</screen>
+	When you <link linkend="uboot_cmd_printenv">
+	<literal>printenv</literal></link> <literal>do_stuff</literal> you
+	should see something like
+	<screen>
+do_stuff=run setenv bootargs ${console_args} ${root_args} ${misc_args}; run run bootcmd_flash1
+	</screen>
+	Notice how the variables specified with the $ were expanded. Now, if
+	you do the same thing, replacing the quotation marks with tick marks,
+	<screen>
+setenv do_stuff &apos;run $set_bootargs; run $bootcmd&apos;
+	</screen>
+	you will see different behavior.
+	<screen>
+do_stuff=run $set_bootargs; run $bootcmd
+	</screen>
+	Notice how the variables specified with the $ were not expanded. In
+	most cases, this would be the desired behavior as these variables
+	would be expanded when they are executed.  Then, any changes made to
+	<link linkend="uboot_env_set_bootargs">
+	<literal>set_bootargs</literal></link> and
+	<link linkend="uboot_env_bootcmd"><literal>bootcmd</literal></link>
+	between the time that <literal>do_stuff</literal> was set and it was
+	run would change the functionality of <literal>do_stuff</literal>.
+	For example,
+	<screen>
+setenv printscript print
+setenv do_stuff &quot;$printscript&quot;
+setenv printscript echo do nothing
+run do_stuff
+	</screen>
+	would result in printing all the environment variables, rather than
+	printing &quot;do nothing&quot;, whereas
+	<screen>
+setenv printscript print
+setenv do_stuff &apos;$printscript&apos;
+setenv printscript echo do nothing
+run do_stuff
+	</screen>
+	would result in printing &quot;do nothing&quot;.
+      </para>
+    </sect2>
+  </sect1>
+</chapter>
+
diff --git a/include/configs/XPEDITE5370.h b/include/configs/XPEDITE5370.h
index acb62ad..9322789 100644
--- a/include/configs/XPEDITE5370.h
+++ b/include/configs/XPEDITE5370.h
@@ -70,6 +70,15 @@
 #define CONFIG_SYS_SDRAM_BASE		CONFIG_SYS_DDR_SDRAM_BASE
 #define CONFIG_VERY_BIG_RAM
 
+/**
+ * @memmap: EEPROM Memory Map
+ * @entry: 0x2000: 0x3fff: Unused/Customer Available
+ * @entry: 0x1000: 0x1fff: Backup U-Boot Environment
+ * @entry: 0x0200: 0x0fff: Board Specific Information (SPD, etc.)
+ * @entry: 0x0100: 0x01ff: VxWorks Bootline (Optional)
+ * @entry: 0x0000: 0x00ff: Reset Configuration Data (Optional)
+ */
+
 #ifndef __ASSEMBLY__
 extern unsigned long get_board_sys_clk(unsigned long dummy);
 extern unsigned long get_board_ddr_clk(unsigned long dummy);
@@ -117,6 +126,24 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
  * 0xf800_0000	0xffff_ffff	NOR Flash 1		128M non-cacheable
  */
 
+/**
+ * @memmap: System Memory Map
+ * @entry: 0xf800_0000: 0xffff_ffff: NOR Flash 1
+ * @entry: 0xf000_0000: 0xf7ff_ffff: NOR Flash 2
+ * @entry: 0xef90_0000: 0xefff_ffff: Reserved
+ * @entry: 0xef80_0000: 0xef8f_ffff: NAND Flash
+ * @entry: 0xef10_0000: 0xef7f_ffff: Reserved
+ * @entry: 0xef00_0000: 0xef0f_ffff: CCSR/IMMR
+ * @entry: 0xe900_0000: 0xeeff_ffff: Reserved
+ * @entry: 0xe880_0000: 0xe8ff_ffff: PCI Express 2 I/O
+ * @entry: 0xe800_0000: 0xe87f_ffff: PCI Express 1 I/O
+ * @entry: 0xe000_0000: 0xe7ff_ffff: SRAM/SSRAM/L1 Cache
+ * @entry: 0xd000_0000: 0xdfff_ffff: Reserved
+ * @entry: 0xc000_0000: 0xcfff_ffff: PCI Express 2 Memory
+ * @entry: 0x8000_0000: 0xbfff_ffff: PCI Express 1 Memory
+ * @entry: 0x0000_0000: 0x7fff_ffff: DDR2 SDRAM
+ */
+
 #define CONFIG_SYS_LBC_LCRR	(LCRR_CLKDIV_4 | LCRR_EADC_3)
 
 /*
@@ -147,6 +174,7 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 #define CONFIG_SYS_FLASH_AUTOPROTECT_LIST	{ {0xfff40000, 0xc0000}, \
 						  {0xf7f40000, 0xc0000} }
 #define CONFIG_SYS_MONITOR_BASE	TEXT_BASE	/* start of monitor */
+#define CONFIG_REDUNDANT_MONITORS
 
 /*
  * Chip select configuration
@@ -435,6 +463,10 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 #define CONFIG_ENV_SECT_SIZE	0x20000		/* 128k (one sector) for env */
 #define CONFIG_ENV_SIZE		0x8000
 #define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE - (256 * 1024))
+#define	CONFIG_IPADDR		0.0.0.0
+#define CONFIG_SERVERIP		0.0.0.0
+#define CONFIG_GATEWAYIP	0.0.0.0
+#define CONFIG_NETMASK		255.255.0.0
 
 /*
  * Flash memory map:
@@ -450,6 +482,21 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
  * f6f00000 - f7efffff     Sec OS image (16MB)
  * f0000000 - f6efffff     Sec OS Use/Filesystem (111MB)
  */
+
+/**
+ * @memmap: Recommended Flash Memory Map
+ * @entry: 0xfff8_0000: 0xffff_ffff: Primary U-Boot Image
+ * @entry: 0xfff4_0000: 0xfff7_ffff: Primary U-Boot Environment
+ * @entry: 0xfff0_0000: 0xfff3_ffff: Primary Flat-Device Tree
+ * @entry: 0xfef0_0000: 0xffef_ffff: Primary Operating System Image
+ * @entry: 0xf800_0000: 0xfeef_ffff: Primary Operating System Use/Filesystem
+ * @entry: 0xf7f8_0000: 0xf7ff_ffff: Secondary U-Boot Image
+ * @entry: 0xf7f4_0000: 0xf7f7_ffff: Secondary U-Boot Environment
+ * @entry: 0xf7f0_0000: 0xf7f3_ffff: Secondary Flat-Device Tree
+ * @entry: 0xf6f0_0000: 0xf7ef_ffff: Secondary Operating System Image
+ * @entry: 0xf000_0000: 0xf6ef_ffff: Secondary Operating System Use/Filesystem
+ */
+
 #define CONFIG_UBOOT1_ENV_ADDR	MK_STR(0xfff80000)
 #define CONFIG_UBOOT2_ENV_ADDR	MK_STR(0xf7f80000)
 #define CONFIG_FDT1_ENV_ADDR	MK_STR(0xfff00000)
-- 
1.6.0.4



More information about the U-Boot mailing list