U-Boot for the LinkStation V2

LinkStation V2 port version 1.0.1
20 September 2007

Das U-Boot

U-Boot is a universal boot loader released with full source code under the Gnu Public License (GPL). For an overview of U-Boot, you can read Introduction to Das U-Boot, the universal open source bootloader .

Supported Hardware

The LinkStation port of U-Boot described here supports the mips based LinkStation V2 (model HD-HLAN-2).

Do not attempt to use this port of U-Boot on a the LinkStation version 1 (HD-HLAN-1), the LinkStation HG (HD-HGLAN), the Kurobox, or the Kurobox HG as they use a PowerPC processor which is completely different from the MIPS processor used in the LinkStation version 2. Moreover, do not try to use the port on any of the LinkStation Pro models as they use an ARM processor. To find out more about the different LinkStation models, visit www.nas-central.org.


Supported Commands

?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dhcp    - invoke DHCP client to obtain IP/boot params
diskboot- boot from IDE device
echo    - echo args to console
erase   - erase FLASH memory
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
flinfo  - print FLASH memory information
go      - start application at address 'addr'
help    - print online help
ide     - IDE sub-system
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
pci     - list and access PCI Configuration Space
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
tftpboot- boot image via network using TFTP protocol
version - print monitor version

RAM Build and Uloader

Normally, U-Boot resides in the on-board flash and starts executing at reset. It initialises the CPU, the memory controller and the serial port and then relocates itself at the upper end of the RAM area. After relocation, U-Boot completes the hardware initialisation and then it either proceeds to boot the OS kernel or displays a command prompt and waits for operator input.

U-Boot for the LinkStation V2 can be built to start from RAM. The only difference between the ROM and RAM builds is the link address. U-Boot ckecks if it was started from RAM and skips the DDR controller initialisation code. You can test your RAM build using uloader.o which is a kernel module written specifically for the purpose of loading and starting a RAM build of U-Boot.

Even for the same model, there are hardware differences between the individual LinkStations and, due to these differences, U-Boot might not work properly in some instances. For example, your flash chip might not be supported by the current version of the U-Boot port. It is strongly recommended that you test thoroughly U-Boot on your LinkStation using a RAM build before building the ROM version and attempting to burn it into flash. Once you have the RAM build up and running you can use it to install (burn) the ROM version.

Source Code

U-Boot for the LinkStation is distributed as a patch for U-Boot version 1.1.4. You can compile it using either a cross toolchain or, if you have a development environment installed, natively on your LinkStation. I used the DENX Embedded Linux Development Kit (ELDK) version 4.0 which comes with gcc 4.0.0 (gcc (GCC) 4.0.0 (DENX ELDK 4.0 4.0.0) with specific patches for MIPS.

Uloader is distributed as a gzip-ed tar archive containing the full source code, the binary module, uloader.o, compiled for the original LinkStation V2 kernel and a simple bash script which uses uloader.o to load a RAM build of U-Boot and start it.


After you unpack U-Boot 1.1.4 and apply the U-Boot for the LinkStation patch you will find full installation instructions in the file board/ls2/INSTALL in the U-Boot directory tree. Full installation instructions are also available on-line.

When installing firmware on an embedded computer things can go wrong. The power can go down in the middle of the flash or the flash operation can fail rendering your LinkStation unusable. Please read the installation instructions carefully.

If you are not prepared to brick your LinkStation, do not attempt to install U-Boot.



E-mail your questions and comments at u-boot (at) linuxnotincluded (dot) org (dot) uk.


DENX Embedded Linux Development Kit (ELDK) on-line documentation

DENX Embedded Linux Development Kit (ELDK) version 4.0

U-Boot version 1.1.4 sources

U-Boot for the LinkStation V2 patch version 1.0.0

Uloader version 1.0 compiled for the original Linkstation V2

Installation Instructions

Old versions

U-Boot for the LinkStation