Difference between revisions of "U-boot for LS Pro"
Davy gravy (Talk | contribs) (→Using the 1.1.1 Buff109 source) |
Davy gravy (Talk | contribs) (→From a Linux Box using JTAG) |
||
Line 82: | Line 82: | ||
{{Brick| 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.}} | {{Brick| 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=== | ===From a Linux Box using JTAG=== | ||
− | See this article on [http://buffalo.nas-central.org/index.php/JTAG_%26_OpenOCD_for_LS-Pro JTAG for the LS Pro] for instructions and details. | + | See this article on [http://buffalo.nas-central.org/index.php/JTAG_%26_OpenOCD_for_LS-Pro 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=== | ===From within U-Boot=== |
Revision as of 18:51, 2 March 2008
Contents
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.
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.
Ready-Made U-Boot Images for LS Pro
Stock
- for the LS Pro V1
- for the LS Pro V2
Custom
- for the LS Pro V2 u-boot-full-DG_buffalo_nas_central-02282008.bin Note: this is experimental - read the Brick Warning below and use at your risk. It has been tested in a LS Pro V2 and works w/ the stock firmware and foonas. Forum thread and post pertaining to it: Custom U-Boot Image Available for LS Pro V2
Building U-Boot from ...
Buffalo GPL sources
1. Start by installing the Codesourcery Toolchain setup, shown here : Setting up the CodeSourcery Toolchain for x86-to-ARM Cross-Compiling. There is a handy auto-install script provided that is advantageous to use.
- Follow all the direction on the page linked to.
- 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:
yield some good instructions and further hints.
Using the 1.1.1 Buff109 source
4. Get the source ready and read up on U-Boot.
- Download and untar the source u-boot-1.1.1_buf109.tar.gz to wherever you are going to compile it, probably in COMPILING.
- Read the README in the source for a lot of useful information about configuring U-Boot.
- Read the documentation on U-Boot, like this U-Boot Reference/Manual from the developer Denx.
5. (Optional) Make any adjustments to include/configs/db88f5181.h that you want to. Tinkering with this can have serious consequences - like a broken U-Boot, so use caution.
6. In the script buffalomake.sh comment out the line third line to look like this:
#. /opt/cross.conf
7. Run the script.
./buffalomake.sh
OR configure manually and make.
8. After a few minutes you should find a u-boot.bin in the source directory.
9. Make sure you read the Brick Warning before you attempt to flash.
Using the 1.1.4 "working" source
4. Download and untar the source u-boot-1.1.4.zip to wherever you are going to compile it, probably in COMPILING.
5. In the source, some symlinks have to be added to get it to compile. Trying to build using the script in the Buff109 sources will reveal the problems.
6. Either configure manually and make, or use the buffalomake.sh script. Problem/Impasse: The images are too large. They must be 256k or smaller.
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
![]() |
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):
tftp 0x00100000 my_u-boot.bin protect off 1:0-63 erase 1:0-63 cp.b ${fileaddr} 0xfffc0000 ${filesize} protect on 1:0-63 saveenv
This should yield output similar to this.
Marvell>> tftp 0x00100000 u-boot_davy_02082008.bin Using egiga0 device TFTP from server 192.168.11.149; our IP address is 192.168.11.150 Filename 'u-boot_davy_02082008.bin'. Load address: 0x100000 Loading: ################################################# done Bytes transferred = 245776 (3c010 hex) Marvell>> protect off 1:0-63 Un-Protect Flash Sectors 0-63 in Bank # 1 ................................................................ done Marvell>> erase 1:0-63 Erase Flash Sectors 0-63 in Bank # 1 ................................................................ Marvell>> cp.b ${fileaddr} 0xfffc0000 ${filesize} Copy to Flash... done Marvell>> protect on 1:0-63 Protect Flash Sectors 0-63 in Bank # 1 ................................................................ done Marvell>> saveenv Saving Environment to Flash... . Un-Protected 1 sectors Erasing Flash... . Erased 1 sectors Writing to Flash... done . Protected 1 sectors
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. 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.
References
Forum Threads Related to this Subject
Build System for U-Boot on LS Pro
Exact Diffs Between LS Pro U-Boot for v1 & v2 Machines