⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uboot.html

📁 9200的开发资料:包括uboot
💻 HTML
字号:
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Author" content="Mohammed Amine SAYA">
   <title>Setting up U-Boot environmental Variables</title>
</head>
<body bgcolor="#FFFFFF">

<center>
<h1>

<hr WIDTH="100%"><a NAME="Setting up U-Boot environmental Variables"></a>Setting up U-Boot environmental Variables</h1></center>

<hr WIDTH="100%">
<br>U-boot is a boot loader for AT91RM9200DK, that can be installed in a boot ROM 
and used to configure AT91RM9200DK and to run linux in SDRAM thanks to its ability 
to download kernel images and ramdisks. Binaries can be downloaded using either 
Kermit through the serial link or through TFTP transfer using the ethernet link.

The development of U-Boot is closely related to Linux: some parts of
the source code originate in the Linux source tree, we have some
header files in common, and special provision has been made to
support booting of Linux images.

<blockquote>
<blockquote>

<li><a href="#Sample_Monitor_Commands">Sample Monitor Commands</a></li>

<li><a href="#Sample_Environment_Variables">Sample Environment Variables</a></li>

<li><a href="#General_Setup">General Setup</a></li>

<li><a href="#Kernel">For Kernel</a></li>

<li><a href="#local_ramdisk">For local ramdisk</a></li>

<li><a href="#NFS_ramdisk">For NFS ramdisk</a></li>

</blockquote>
</blockquote>

<h2><a NAME="Sample_Monitor_Commands"></a>Sample Monitor Commands</h2>

<table>
<tr>
<td>
<dl>
<dd>go</dd>
<dd>run</dd>
<dd>bootm</dd>
<dd>bootp</dd>
<dd>tftpboot</dd>
<dd>&nbsp;</dd>
<dd>loadb</dd>
<dd>printenv</dd>
<dd>setenv</dd>
<dd>saveenv</dd>
</dl> 
</td>
<td>
<dl>
<dd>- start application at address 'addr'</dd>
<dd>- run commands in an environment variable</dd>
<dd>- boot application image from memory</dd>
<dd>- boot image via network using BootP/TFTP protocol</dd>
<dd>- boot image via network using TFTP protocol and env variables </dd>
<dd>&nbsp;&nbsp;&nbsp;"ipaddr" and "serverip" (and eventually "gatewayip")</dd>
<dd>- load binary file over serial line (kermit mode)</dd>
<dd>- print environment variables</dd>
<dd>- set environment variables</dd>
<dd>- save environment variables to persistent storage</dd>
</dl>
</td>
</tr>
</table>

<h2><a NAME="Sample_Environment_Variables"></a>Sample Environment Variables</h2>

<table>
<tr>
<td>
<dl>
<dd>baudrate</dd>
<dd>bootdelay</dd>
<dd>bootcmd</dd>
<dd>bootargs</dd>
<dd>bootfile</dd>
<dd>ipaddr</dd>
<dd>serverip</dd>
<dd>loadaddr</dd>
<dd>ethaddr</dd>
</dl> 
</td>
</tr>
</table>

<h2><a NAME="General_Setup"></a>General Setup</h2>
You have to set up some variables like network and bootdelay ones. It goes like 
this : 
<dl>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>setenv ethaddr 12:34:56:78:99:aa</b></font></dd>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>setenv ipaddr 10.159.245.178</b></font></dd>

  <dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>setenv serverip 
    10.159.245.156</b></font></dd>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>setenv bootdelay 3</b></font></dd>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>saveenv</b></font></dd>

</dl>

<p><font color=red><b>Note :</b></font> The values given to these variables should be set to whatever your system and network, especially for ip and ethernet addresses which should match your network parameters.  

<h2><a NAME="Kernel"></a>For Kernel</h2>
Before we hit the command setting let's take a look at on how a TFTP server works.
TFTP (Trivial File Transfer Protocol) allows to exchange files across the network, a TFTPSERVER that is running on a PC(host) handles all TFTP request.
Files sought out are fetched from a root directory already configured in TFTPSERVER config file. the paths used in the following commands start from the root directory of TFTPSERVER.   
The command used to download a kernel image and place it in a specific SDRAM address is :

<dl>

  <dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>tftp 21000000 
    AS/uImage</b></font></dd>

</dl>

<p>If you want to save this variable and make U-Boot automaticaly fetch the kernel image and turn it on
you have to save it in a bootcmd, it goes like this :

<dl>

  <dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>setenv bootcmd 
    tftp 21000000 AS/uImage\; go 21000000</b></font></dd>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>saveenv</b></font></dd>

<p>Reboot your board
</dl>


<h2><a NAME="local_ramdisk"></a>For local ramdisk</h2>
In order to download a remote ramdisk and mount it localy on the board you have to set a variable that will lead U-Boot to it.
It goes like this :

<dl>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>tftp 21100000 AS/ramdisk</b></font></dd>

</dl>

As shown before you can make the boot sequence automatic by setting a bootcmd variable. It goes like this :

<dl>

  <dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>setenv bootcmd 
    tftp AS/ramdisk\; tftp 21000000 AS/uImage\; go 21000000</b></font></dd>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>saveenv</b></font></dd>

<p>Reboot your board

</dl>


<h2><a NAME="NFS_ramdisk"></a>For NFS ramdisk</h2>
<p>For a using a NFS ramdisk you need to use a built kernel which support NFS 
  server. For more information refers to<a href="Compiling_Linux_Kernel.html#nfs_kernel"> 
  kernel configuration using NFS ramdisk section</a>.</p>
<p>For a NFS mounting ramdisk you need to have a NFS server running from which 
  the board's NFS client can fetch the ramdisk. First of all you have to make 
  sure that there is a NFS server running on your PC (host) and second of all 
  you have to edit a file called exports located in /etc and add the following 
  entry : </p>
<dl>

<dd><font face="italic" color="gray"><b>/usr/home/amine/RD/rd &nbsp;&nbsp;&nbsp;root(rw,no_root_squash,insecure)</b></font></dd>

<p>Then you need to enter the following command :<br>

<dd>[&nbsp;root@host&nbsp;]&nbsp;<font face="italic" color="gray"><b>exportfs -r</b></font></dd>

</dl>

After all this you need to go back to your board and set some variables on U-Boot, it goes like this :

<dl>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>setenv bootargs root=/dev/nfs rw nfsroot=10.159.245.142:/usr/home/amine/RD/rd ip=10.159.245.180 console=ttyS4,115200 mem=31M </b></font></dd>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>saveenv</b></font></dd>

  <dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>tftp 21000000 
    AS/uImage</b></font></dd>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>bootm 21000000</b></font></dd>

<p>In case you want to launch it automaticaly you can set a bootcmd variable, it goes like this :<br>

  <dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>setenv bootcmd 
    tftp 21000000 AS/uImage\; bootm 21000000</b></font></dd>

<dd>&nbsp;U-Boot&nbsp;>&nbsp;<font face="italic" color="gray"><b>saveenv</b></font></dd>

<p>Reboot your board
</dl>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -