1. Start by installing the Codesourcery Toolchain setup, shown here : [http://nas-central.org/index.php/Setting_up_the_codesourcery_toolchain_for_X86_to_ARM9_cross_compiling Setting up the CodeSourcery Toolchain for x86-to-ARM Cross-Compiling]. There is a handy auto-install script provided that is advantageous to use.

1. Start by installing the Codesourcery Toolchain setup, shown here : [http://nas-central.org/index.php/Setting_up_the_codesourcery_toolchain_for_X86_to_ARM9_cross_compiling Setting up the CodeSourcery Toolchain for x86-to-ARM Cross-Compiling]. There is a handy auto-install script provided that is advantageous to use.

Now that your toolchain is set up, you have two choices for building U-Boot from Buffalo's GPL sources. The first choice, 1.1.1 Buff109, is ready to go, without any alterations needed and is known to work. The second choice, 1.1.4-working (the name of the directory inside the archive) is not quite ready for use, but is probably very close. It is tempting to try to work with it, since '''NetConsole is in this source already, just needing setup'''. It remains to be seen if whatever new U-Boot we get in the near future is developed from the Buffalo source, or from vanilla sources (perhaps more likely).

Background & Facts

What is U-Boot?

U-Boot, or Das U-Boot, is a open-source, universal bootloader that is used in the LinkStation Pro/Live/KuroPro and other ARM-based NAS devices that Buffalo Technology makes. It has become more widespread in its use in other brands as well. Pre-ARM LinkStations/Kuro's had a proprietary bootloader, though LinuxNotIncluded and other members of the community here worked to bring U-Boot to the PPC and Mipsel based LinkStation devices as well.

We are all looking forward to a new, clean port of U-Boot for the LinkStation Pro.

Why upgrade it?

The build of U-Boot that is stock on the LS Pro (v1 and v2) and its contemporaries has very limited features, at least in comparision to what we have for the PPC LinkStations. Some noteworthy limitations to and exclusions from its capabilities include:

no NetConsole - with netconsole and NetCat, one can connect to the unit with serial-style console control, over the network

maximum number of arguments is 16, making changes of some of the more complicated env vars from the U-Boot side difficult or impossible

missing commands:

run - run commands in an environment variable

dhcp - invoke DHCP client to obtain IP/boot params

bdinfo - print Board Info structure

loadb - load binary file over serial line (kermit mode)

loads - load S-Record file over serial line

ping - send ICMP ECHO_REQUEST to network host

coninfo - print console devices and information

crc32 - checksum calculation

While some of these commands aren't really essential, the first few are quite advantageous to have, and missing them is an impediment. It is notable that LinuxNotIncluded's ports to PPC and Mipsel have all of these capabilities.

Acknowledgements

Thanks to jonli447, lb_worm and others who worked on this and left a trail to follow for the rest of us. Also, thanks to bbradley, Nicolas Pitre, Dominic Rath and others who are working on a clean port of U-Boot for Feroceon or doing great things w/ OpenOCD so we can have a better U-Boot for LS Pro's and the other ARM-based LinkStations.

By default it is the 2005q3 toolchain, and this is the (a) correct one to use for building U-Boot from the 1.1.1 source.

2. Adjust your environmental variables so that linking is correct.

3. Test your setup. It is suggested that you test your cross-compiler setup by building Linux 2.6.12 or 2.6.16, for instance. See this article for directions on how this is done. Both of these articles:

Now that your toolchain is set up, you have two choices for building U-Boot from Buffalo's GPL sources. The first choice, 1.1.1 Buff109, is ready to go, without any alterations needed and is known to work. The second choice, 1.1.4-working (the name of the directory inside the archive) is not quite ready for use, but is probably very close. It is tempting to try to work with it, since NetConsole is in this source already, just needing setup. It remains to be seen if whatever new U-Boot we get in the near future is developed from the Buffalo source, or from vanilla sources (perhaps more likely).

5. In the source, some symlinks have to be added to get it to compile. Trying any make *_config command will reveal problems. In particular, you may need to change the following directories so that the names are symlinks rather than actual directories:

include/asm/proc
include/asm/arch
include/asm

pointing, of course to the ARM counterparts for these.

6. Either configure manually and make, or use the buffalomake.sh script. Problem/Impasse: The images built with this source are too large. They must be 256k or smaller, and what is created is around 580kb.

Vanilla Sources

This is a work in progress. At least one community member is currently working on this.

Flashing U-Boot to Your LS Pro

WARNING!

There is a possibility that you could brick your NAS with these instructions. Please make sure that you read the entire page carefully. WARNING: Modifying your LinkStation or Kuro can void your warranty. Incorrect flashing procedures can turn your unit into a Brick. Flashing success is not guaranteed. Do not flash your box unless your are willing to use JTAG to recover it, in the event that there is an unforeseen problem. JTAG recovery generally works well, but is not a guarantee of recovery from bricking one's box.

From a Linux Box using JTAG

See this article on JTAG for the LS Pro for instructions and details. Normally, this is a last resort method for flashing U-Boot to ROM. It is used most often when one doesn't have a functioning U-Boot in ROM already.

From within U-Boot

1. Read the Brick Warning above first!. You brick it, you bought it.

2. Set up a tftp server and have your known valid u-boot image (called my_u-boot.bin here, adjust to your situation) sitting at its root directory. You may have to adjust either your U-Boot env vars or your network to have the tftp server at the correct ip given in U-Boots serverip variable.

3. While connected to the U-Boot console (either serial or netcat connection), from the U-Boot side issue the following commands (adjust my_u-boot.bin to your situation):

From within Linux on your LinkStation Pro

1. Read the Brick Warning above first!. You brick it, you bought it.

2. Not yet successfully tested, though it should be possible by using dd commands to an mtd dev. Should be possible, either from foonas-em, foonas, or even from FreeLink or JTY-MOD. If anyone has done this, please add your content here, after letting the community know at the Forum.