This is an old revision of the document!
This page group together all the common U-Boot informations (ie: not related with a specific board)
Sources are available in the Git repository: u-boot-lacie.git. At least, the following branches should be availables:
Checkout command:
git clone http://git.lacie-nas.org/u-boot-lacie.git
or
git clone git://lacie-nas.org/u-boot-lacie.git
To compile U-Boot images, you could use the following commands (toolchain path, cross-compiler and board names to be replaced):
PATH=/usr/local/x-tools/arm-2010q1/bin/:$PATH CROSS_COMPILE=arm-none-eabi- make netspace_v2_config PATH=/usr/local/x-tools/arm-2010q1/bin/:$PATH CROSS_COMPILE=arm-none-eabi- make u-boot.kwb
For the supported boards, some pre-compiled U-Boot images are availables in the FTP repository.
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.
$ mkdir /tmp/tools && cd /tmp/tools
$ wget ftp://lacie-nas.org/tools/clunc-1.1.tar.gz $ tar xf clunc-1.1.tar.gz
$ wget ftp://lacie-nas.org/tools/u-boot-netconsole.tar.gz $ tar xf u-boot-netconsole.tar.gz
$ wget ftp://ftp.lacie-nas.org/u-boot/u-boot-netspace_v2.kwb -O /var/tftpboot/u-boot-netspace_v2.kwb
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 /tmp/tools/clunc-1.1 $ ./clunc -i <NAS_IP> Marvell>> version U-Boot 1.1.4 (Jan 17 2011 - 21:48:29) Marvell version: 3.4.16 LaCie 1.5.9 256MB
Marvell>> bubt u-boot-netspace_v2.kwb Using egiga0 device TFTP from server 192.168.0.13; our IP address is 192.168.0.15 Filename 'u-boot-netspace_v2.kwb'. 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
Marvell>> reset
U-Boot mainline don't provide a magic packet mechanism to configure the IP address. Instead DHCP is used. It means that 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:
Example with dhcpdump:
$ sudo dhcpdump -i eth0 ... snip ... TIME: 2011-07-15 16:31:50.686 IP: 0.0.0.0 (2:50:43:7e:8d:94) > 255.255.255.255 (ff:ff:ff:ff:ff:ff) OP: 1 (BOOTPREQUEST) HTYPE: 1 (Ethernet) HLEN: 6 HOPS: 0 XID: 437e9de1 SECS: 6 FLAGS: 0 CIADDR: 0.0.0.0 YIADDR: 0.0.0.0 SIADDR: 0.0.0.0 GIADDR: 0.0.0.0 CHADDR: 02:50:43:7e:8d:94:00:00:00:00:00:00:00:00:00:00 SNAME: . FNAME: . OPTION: 53 ( 1) DHCP message type 3 (DHCPREQUEST) OPTION: 57 ( 2) Maximum DHCP message size 576 OPTION: 54 ( 4) Server identifier 192.168.0.254 OPTION: 50 ( 4) Request IP address 192.168.0.15 ---------------------------------------------------------------------------
The netconsole configuration rely on some environment variables: ipaddr, ncip, stdin, stdout and stderr (for more information, please refer to the file README.NetConsole included in U-Boot sources). After the update, this variables will be initialized with the default (or built-in) values and the netconsole is configured to broadcast UDP messages.
<note important> netcat don't handle the UDP broadcast messages. The dedicated U-Boot tools netconsole and ncb must be used. </note>
$ cd /tmp/tools/u-boot-netconsole $ ./netconsole 192.168.0.15 ^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
ns2> print autoload=no baudrate=115200 bootargs=console=ttyS0,115200 bootcmd=dhcp && run netconsole; if run usbload || run diskload; then bootm; fi bootdelay=3 bootfile=uImage diskload=ide reset && ext2load ide 0:1 $loadaddr /boot/$bootfile dnsip=212.27.40.240 ethact=egiga0 ethaddr=02:50:43:92:75:b8 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,nc stdin=serial,nc stdout=serial,nc usbload=us Environment size: 604/4092 bytes
<<released>> ns2> button ns2> echo $? 0
<<pressed>> ns2> button ns2> echo $? 1
Marvell>> set bootargs console=ttyS0,115200 Marvell>> saveenv Saving Environment to SPI Flash... SF: Detected MX25L4005A with page size 256, total 512 KiB Erasing SPI flash...Writing to SPI flash...done
Marvell>> usb start Marvell>> usb storage Device 0: Vendor: UFD Rev: 7.77 Prod: Type: Hard Disk Capacity: 125.0 MB = 0.1 GB (256000 x 512) Marvell>> fatls usb 0:1 boot/ 0 file(s), 1 dir(s) Marvell>> fatls usb 0:1 /boot ./ ../ 4902372 uimage-kw-2.6.37-rc3-miniroot 1 file(s), 2 dir(s) Marvell>> fatload usb 0:1 0x800000 /boot/uimage-kw-2.6.37-rc3-miniroot 4902372 reading /boot/uimage-kw-2.6.37-rc3-miniroot 4902372 bytes read Marvell>> setenv bootargs console=ttyS0,115200 Marvell>> bootm 0x800000 ## Booting kernel from Legacy Image at 00800000 ... Image Name: Linux-2.6.37-rc3-00799-g2dd0ff5- Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 4902308 Bytes = 4.7 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK Loading Kernel Image ... OK OK Starting kernel ...
SoC: Kirkwood 88F6281_A0 DRAM: 256 MiB SF: Detected MX25L4005A with page size 256, total 512 KiB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: egiga0 88E1116 Initialized on egiga0 Marvell>> ide reset Reset IDE: Bus 0: ........OK Device 0: Model: SAMSUNG HD103SI Firm: 1AG01118 Ser#: S1Y5J1KS504652 Type: Hard Disk Supports 48-bit addressing Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512) Marvell>> ide part 0 Partition Map for IDE device 0 -- Partition Type: DOS Partition Start Sector Num Sectors Type 1 63 1975932 83 2 195334335 195334335 83 Marvell>> ext2ls ide 0:1 /boot Failed to mount ext2 filesystem... <DIR> 4096 . <DIR> 4096 .. 4507632 uImage-kw-2.6.36-rc2-pm-miniroot Marvell>> ext2load ide 0:1 0x800000 /boot/uImage-kw-2.6.36-rc2-pm-miniroot Loading file "/boot/uImage-kw-2.6.36-rc2-pm-miniroot" from ide device 0:1 (hda1) 4507632 bytes read Marvell>> bootm 0x800000 ## Booting kernel from Legacy Image at 00800000 ... Image Name: Linux-2.6.36-rc2-00011-g63a3f43- Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 4507568 Bytes = 4.3 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK Loading Kernel Image ... OK OK Starting kernel ...
ns2> setenv ipaddr 192.168.0.17; setenv serverip 192.168.0.13; ns2> tftpboot 0x800000 u-boot-netspace_v2.kwb Using egiga0 device TFTP from server 192.168.0.13; our IP address is 192.168.0.17 Filename 'u-boot-netspace_v2.kwb'. Load address: 0x800000 Loading: ########################################## done Bytes transferred = 214220 (344cc hex) ns2> fl probe 0:0 SF: Detected MX25L4005A with page size 256, total 512 KiB 512 KiB MX25L4005A at 0:0 is now current device ns2> sf erase 0 0x40000 Usage: sf erase offset len ns2> sf erase 0 0x40000 ns2> sf write 0x800000 0 0x40000 ns2> reset resetting ... U-Boot 2010.12-00216-g5bbbf69 (Jan 24 2011 - 21:38:00) LaCie Network Space v2 SoC: Kirkwood 88F6281_A0 DRAM: 256 MiB SF: Detected MX25L4005A with page size 256, total 512 KiB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: egiga0 88E1116 Initialized on egiga0 Hit any key to stop autoboot: 3 ns2>