📄 compiling_u-boot.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="clear"><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#compiling_u-boot" class="toc">Compiling U-Boot</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#configure_u-boot" class="toc">Configure U-Boot</a></span></div><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#customize_u-boot_commands" class="toc">Customize U-Boot Commands</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#build_u-boot_to_boot_from_serial_flash" class="toc">Build U-Boot to boot from serial flash</a></span></div></li></ul></li><li class="level2"><div class="li"><span class="li"><a href="#testing_the_newly_built_u-boot" class="toc">Testing the newly built U-Boot</a></span></div></li></ul></li></ul></div></div><h2><a name="compiling_u-boot" id="compiling_u-boot">Compiling U-Boot</a></h2><div class="level2"><p>The latest release of Das U-Boot for Blackfin processor can be found on the Blackfin/uClinux <a href="http://blackfin.uclinux.org/projects/uboot533" class="urlextern" title="http://blackfin.uclinux.org/projects/uboot533" rel="nofollow">website</a>. Click on the <em>Files</em> tab to obtain the latest release of U-Boot. Once the file has been downloaded unzip it using the command: </p><p>Apply any patches as per instructions given in the release description. (The release description can be viewed by clicking on the release name on the page where the file is downloaded from.) Generally only the latest patch will need to be applied. Change directory (<code>cd</code>) to the U-Boot directory that was just created and run the following commands:</p><p> <a href="installing_the_blackfin_tool_chain.html" class="wikilink1" title="installing_the_blackfin_tool_chain.html">Installing the Blackfin Tool Chain</a> </p><p></p><p>Replace <code><board></code> with the specific board/configuration you are using. Currently, the BF533/2/1 and BF536/6/4 are supported with both serial and parallel Flash. The reason which different configurations are needed is the On-Chip BootRom requires different file formats depending on different how it is being booted (Parallel Flash, Serial Flash, or Serial UART).</p><ul><li class="level1"><div class="li"> <code>stamp_config</code> : for a BF533-stamp board (Parallel Flash)</div></li><li class="level1"><div class="li"> <code>serial_stamp_config</code> : for a BF533-stamp board (Serial Flash)</div></li><li class="level1"><div class="li"> <code>ezkit533_config</code> : for an BF533-ezkit (Parallel Flash)</div></li><li class="level1"><div class="li"> <code>bf534_config</code> : for BF534 Board (Parallel Flash)</div></li><li class="level1"><div class="li"> <code>bf537_config</code> : for BF537-ezkit or BF537-STAMP Board (Parallel Flash)</div></li><li class="level1"><div class="li"> <code>serial_bf537_config</code> : for a BF537-stamp board (Serial Flash)</div></li><li class="level1"><div class="li"> <code>ezkit561_config</code> : for an BF561-ezkit</div></li></ul><p> Once U-Boot has compiled successfully the following files will be created in the U-Boot directory: </p><ul><li class="level1"><div class="li"> <code>u-boot</code> - This is the elf file that is used to create the other file formats.</div></li><li class="level1"><div class="li"> <code>u-boot.bin</code> - This is a binary file that can be used to upgrade U鈥態oot if an older version of U鈥態oot is already installed on the target system. See <a href="upgrading_u-boot.html" class="wikilink1" title="upgrading_u-boot.html">Upgrading U鈥態oot</a> for instructions on how to use this file.</div></li><li class="level1"><div class="li"> <code>u-boot.hex</code> - This file is not normally needed, and therefore not created. It is necessary if you want to use ADI’s VDSP++ programmer to program U-Boot into a platform. If you need the hex file, you can create it with the following command:</div></li></ul><p></p></div><!-- SECTION [1-2794] --><h2><a name="configure_u-boot" id="configure_u-boot">Configure U-Boot</a></h2><div class="level2"></div><!-- SECTION [2795-2823] --><h3><a name="customize_u-boot_commands" id="customize_u-boot_commands">Customize U-Boot Commands</a></h3><div class="level3"><p>In the <code>./include/configs/<board>.h</code> file controls what commands are included in U-Boot. For example, to add the SPI EEPROM commands to the parallel flash U-Boot, just add <code>CFG_CMD_EEPROM</code> to the variable <code>CONFIG_COMMANDS</code>, and a <code>#define CONFIG_SPI</code>, <code>#define CONFIG_SPI_BAUD 2</code>. Feel free to look around the other <code>.h</code> files to see what options are available.</p><p>The <board> value here is the same as the <board> value used above when running the <code>make <board>_config</code> above.</p></div><!-- SECTION [2824-3351] --><h3><a name="build_u-boot_to_boot_from_serial_flash" id="build_u-boot_to_boot_from_serial_flash">Build U-Boot to boot from serial flash</a></h3><div class="level3"><p>U-Boot can be configured to boot either from parallel NOR flash or serial NOR Flash:</p><ul><li class="level1"><div class="li"> Parallel NOR Flash - has a full address/data (memory) interface that allows random access to any location. It is block-erasable (many words will be erased at once), but is typically programmable as words or bytes at a time. Since this is connected to the address bus, on the BF533, the max Flash is 4Megbytes (max external addressable memory).</div></li><li class="level1"><div class="li"> Serial NOR Flash - a four-wire SPI-compatible interface as used for serial EEPROM which provides a sequential read access. They offer densities up to 8Mbytes.<a href="http://www.st.com/stonline/products/families/memories/fl_ser/sf_code.htm" class="urlextern" title="http://www.st.com/stonline/products/families/memories/fl_ser/sf_code.htm" rel="nofollow">ST Flash</a> has been validated with uClinux/Blackfin, and drivers are available.</div></li></ul><p> If you are using the serial flash option, you must convert the bin file to an LDR file. When Blackfin Bootmode(SYSCR[1:2]) is configured in the way that boot ROM loads boot code from SPI serial ROM, the boot ROM can will parse this LDR file and load uboot to SDRAM. </p><p> Enter the bin2ldr tools directory </p><ol><li class="level1"><div class="li"> a macro <code>APP_ENTRY</code> in the <code>bin2ldr.h</code> defines where the uboot will be loaded. Modify this macro to fit for your target board.</div></li><li class="level2"><div class="li"> Implement the script <code>runme.sh</code> to get the LDR format file.</div></li><li class="level2"><div class="li"> file description:</div><ul><li class="level4"><div class="li"> <code>app.bin</code>: the original file u-boot.bin</div></li><li class="level4"><div class="li"> <code>app.ldr</code>: the binary LDR format file</div></li><li class="level4"><div class="li"> <code>app.hex</code>: the HEX LDR format file.</div></li></ul></li></ol><p><code>app.hex</code><code><a href="http://blackfin.uclinux.org/frs/?group_id=20" class="urlextern" title="http://blackfin.uclinux.org/frs/?group_id=20" rel="nofollow">M25P64.dxe</a></code><code>app.ldr</code><code>run update</code></p></div><!-- SECTION [3352-5475] --><h2><a name="testing_the_newly_built_u-boot" id="testing_the_newly_built_u-boot">Testing the newly built U-Boot</a></h2><div class="level2"><p>With recent U-Boots, to test a newly built U-Boot, just download it on the network with <code>tftp 0×1000000 u-boot.bin</code> or load it via the serial port with <code>loadb</code>, and then just type <code>go 0×1000000</code>. This will relocate U-Boot from <code>0×1000000</code> in SDRAM to the location where it normally runs from, and will allow you to test it, while keeping the known good U-Boot in flash. </p></div><!-- SECTION [5476-] --></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -