This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| uboot_common [2011/07/15 16:53] – simon | uboot_common [2011/07/15 23:28] (current) – delete page simon | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== U-Boot ====== | ||
| - | This page group together all the common [[http:// | ||
| - | |||
| - | ===== Repository ===== | ||
| - | |||
| - | Sources are available in the [[http:// | ||
| - | |||
| - | * **stable** is used to build the images distributed via a [[ftp:// | ||
| - | * **master** is a development branch, holding the patches waiting to be merged mainline. | ||
| - | |||
| - | Checkout command: | ||
| - | |||
| - | git clone http:// | ||
| - | or | ||
| - | git clone git:// | ||
| - | |||
| - | ===== Build ===== | ||
| - | |||
| - | To compile U-Boot images, you could use the following commands (toolchain path, cross-compiler and board names to be replaced): | ||
| - | |||
| - | PATH=/ | ||
| - | PATH=/ | ||
| - | | ||
| - | ===== Downloads ===== | ||
| - | |||
| - | For the supported boards, some pre-compiled U-Boot images are availables in the [[ftp:// | ||
| - | |||
| - | ===== Install from a LaCie stock U-Boot ===== | ||
| - | |||
| - | ==== Why ? ==== | ||
| - | |||
| - | * The LaCie stock U-Boot comes with a huge limitation. At reset, U-Boot reinitialize the boot environment variables (stored in Flash) with some built-in values. This includes the boot commands sequence. As a consequence, | ||
| - | |||
| - | * Save flash size (a LaCie U-Boot image size is ~450KB against ~230KB for a mainline one). | ||
| - | |||
| - | * Boot reliably from USB. | ||
| - | |||
| - | * Some command line enhancements: | ||
| - | |||
| - | * Be able to add a new feature. | ||
| - | |||
| - | ==== Update step by step ==== | ||
| - | |||
| - | This section present step by step how to update the stock U-Boot with a mainline version. A Network Space v2 board is used but the process should work with all the other LaCie boards supported by U-Boot mainline. | ||
| - | |||
| - | === Preparations === | ||
| - | |||
| - | * Create a work directory | ||
| - | |||
| - | $ mkdir /tmp/tools && cd /tmp/tools | ||
| - | |||
| - | * Get [[CLUNC|CLUNC]] | ||
| - | |||
| - | $ wget ftp:// | ||
| - | $ tar xf clunc-1.1.tar.gz | ||
| - | |||
| - | * Get U-Boot **netconsole** utility | ||
| - | |||
| - | $ wget ftp:// | ||
| - | $ tar xf u-boot-netconsole.tar.gz | ||
| - | |||
| - | * Setup and enable a TFTP server. The configuration really depends on your OS. For example, a Linux distribution could be use **inetd** (the configuration file is / | ||
| - | |||
| - | * Install the new u-boot image into the TFTP root directory (could be / | ||
| - | |||
| - | $ wget ftp:// | ||
| - | | ||
| - | === Run CLUNC and connect to the LaCie U-Boot console === | ||
| - | |||
| - | Both a serial or a network console can be used to connect to U-Boot. For this how-to, the netconsole way is preferred because it is cheaper. The user don't have to build/buy a serial cable. | ||
| - | |||
| - | $ cd / | ||
| - | $ ./clunc -i < | ||
| - | Marvell>> | ||
| - | U-Boot 1.1.4 (Jan 17 2011 - 21:48:29) Marvell version: 3.4.16 | ||
| - | | ||
| - | === Flash the new U-Boot image === | ||
| - | |||
| - | Marvell>> | ||
| - | Using egiga0 device | ||
| - | TFTP from server 192.168.0.13; | ||
| - | Filename ' | ||
| - | Load address: 0x2000000 | ||
| - | Loading: ########################################## | ||
| - | done | ||
| - | Bytes transferred = 214220 (344cc hex) | ||
| - | Un-Protect Flash Monitor space | ||
| - | | ||
| - | **Warning** | ||
| - | If U-Boot Endiannes is going to change (LE->BE or BE->LE), Then Env parameters should be overriden.. | ||
| - | Override Env parameters? (y/n) n | ||
| - | Erase 0 - 125 sectors... | ||
| - | ................................................................. | ||
| - | ............................................................. | ||
| - | Copy to Flash... done | ||
| - | Protect Flash Monitor space | ||
| - | | ||
| - | === Restart === | ||
| - | |||
| - | Marvell>> | ||
| - | | ||
| - | === Retrieve the NAS IP address === | ||
| - | |||
| - | U-Boot mainline don't provide a magic packet mechanism to configure the IP address. Instead DHCP is used. It means that [[CLUNC|CLUNC]] becomes useless from this point. Ensure that the NAS is connected to your local network and that a DHCP server is running. | ||
| - | |||
| - | Some possible ways to retrieve the NAS IP address: | ||
| - | |||
| - | * Use an utility like **dhcpdump**. | ||
| - | * Look in the DHCP server log. | ||
| - | * Configure and run your own DHCP server. | ||
| - | |||
| - | Example with **dhcpdump**: | ||
| - | |||
| - | $ sudo dhcpdump -i eth0 | ||
| - | | ||
| - | ... snip ... | ||
| - | | ||
| - | TIME: 2011-07-15 16: | ||
| - | IP: 0.0.0.0 (2: | ||
| - | OP: 1 (BOOTPREQUEST) | ||
| - | | ||
| - | HLEN: 6 | ||
| - | HOPS: 0 | ||
| - | XID: 437e9de1 | ||
| - | SECS: 6 | ||
| - | | ||
| - | CIADDR: 0.0.0.0 | ||
| - | YIADDR: 0.0.0.0 | ||
| - | SIADDR: 0.0.0.0 | ||
| - | GIADDR: 0.0.0.0 | ||
| - | CHADDR: 02: | ||
| - | | ||
| - | | ||
| - | OPTION: | ||
| - | OPTION: | ||
| - | OPTION: | ||
| - | OPTION: | ||
| - | --------------------------------------------------------------------------- | ||
| - | |||
| - | The IP address is **192.168.0.15** | ||
| - | |||
| - | === Connect to U-Boot via netconsole === | ||
| - | |||
| - | The netconsole configuration rely on some environment variables: **ipaddr**, **ncip**, **stdin**, **stdout** and **stderr** (for more information, | ||
| - | |||
| - | <note important> | ||
| - | **netcat** don't handle the UDP broadcast messages. The dedicated U-Boot tools **netconsole** and **ncb** must be used. | ||
| - | </ | ||
| - | |||
| - | * Run **netconsole** and interrupt boot process (Ctrl-C): | ||
| - | |||
| - | $ cd / | ||
| - | $ ./ | ||
| - | ^C | ||
| - | ns2> version | ||
| - | arm-none-eabi-gcc (Sourcery G++ Lite 2010q1-188) 4.4.1 | ||
| - | GNU ld (Sourcery G++ Lite 2010q1-188) 2.19.51.20090709 | ||
| - | |||
| - | === Default configuration === | ||
| - | |||
| - | * Here is a default environment sample: | ||
| - | |||
| - | ns2> print | ||
| - | autoload=no | ||
| - | baudrate=115200 | ||
| - | bootargs=console=ttyS0, | ||
| - | bootcmd=dhcp && run netconsole; if run usbload || run diskload; then bootm; fi | ||
| - | bootdelay=3 | ||
| - | bootfile=uImage | ||
| - | diskload=ide reset && ext2load ide 0:1 $loadaddr / | ||
| - | dnsip=212.27.40.240 | ||
| - | ethact=egiga0 | ||
| - | ethaddr=02: | ||
| - | gatewayip=192.168.0.254 | ||
| - | ipaddr=192.168.0.15 | ||
| - | loadaddr=0x800000 | ||
| - | netconsole=set stdin $stdin,nc; set stdout $stdout,nc; set stderr $stderr,nc; | ||
| - | netmask=255.255.255.0 | ||
| - | stderr=serial, | ||
| - | stdin=serial, | ||
| - | stdout=serial, | ||
| - | usbload=us | ||
| - | Environment size: 604/4092 bytes | ||
| - | |||
| - | === Configure U-Boot to suit your own needs === | ||
| - | |||
| - | * Modify the U-Boot environment. | ||
| - | |||
| - | * Use GPIO button. The **button** command allow to check the GPIO button status. | ||
| - | |||
| - | << | ||
| - | ns2> button | ||
| - | ns2> echo $? | ||
| - | 0 | ||
| - | |||
| - | << | ||
| - | ns2> button | ||
| - | ns2> echo $? | ||
| - | 1 | ||
| - | |||
| - | ===== Update U-Boot mainline ===== | ||
| - | |||
| - | ns2> tftpboot 0x800000 u-boot-netspace_v2.kwb | ||
| - | Using egiga0 device | ||
| - | TFTP from server 192.168.0.13; | ||
| - | Filename ' | ||
| - | Load address: 0x800000 | ||
| - | Loading: ########################################## | ||
| - | done | ||
| - | Bytes transferred = 214220 (344cc hex) | ||
| - | ns2> sf probe 0 | ||
| - | SF: Detected MX25L4005 with page size 64 KiB, total 512 KiB | ||
| - | ns2> sf erase 0 0x50000 | ||
| - | ns2> sf write 0x800000 0 0x50000 | ||
| - | ns2> reset | ||
| - | resetting ... | ||
| - | |||
| - | ===== Links ===== | ||
| - | |||
| - | * [[http:// | ||