If you arrived here by search engine, and just want to install a new uBoot on your device, please see this page.

Building uBoot for the Seagate Dockstar, GoFlex Net, and Pogoplug Pink

The Dockstar comes with a very old version of uBoot installed to /dev/mtd0. This bootloader works well enough to boot the built-in Pogoplug install on the NAND, but it's lacking some of the nice features of uBoot, like booting from USB or NFS.

To unlock the Dockstar, we need to install an updated uBoot. There are two methods of doing this:

The replacement uBoot is the best option, but it's not risk free. You can brick your Dockstar by flashing a bad image to /dev/mtd0. However, if you use a known image, like the one I've provided, it's no riskier than flashing new firmware on any other device. And it comes with some advantages: with only one bootloader on your dockstar, it will boot several seconds faster, it will boot more reliably, and most importantly, it leaves the 219-megabyte partition on /dev/mtd3 available to be used any way you see fit.

The "chained bootloader" technique is an older technique that was used by projects before there was a good replacement for the uBoot on mtd0. It doesn't touch any of the stock firmware so if something goes wrong, you can always attach a serial cable and restore your system. It's not a perfect solution, however: the "chained" loading commands don't always boot properly. Sometimes it boots into your USB device and sometimes it boots into the original Pogoplug install.

Configure an ARM cross-compiler

I followed the directions at NAS Central. For building the latest versions of uBoot, I used arm-2009q3. For building the old Cloud Engines uBoot, I used arm-2006q1. The older arm-2006q1 package is packaged a little differently than the newer version, so I had to tweak the NAS Central install script a little to install it. Unless you really want to mess with the old version of uBoot, you do not need to install the arm-2006q1 toolchain.

Build replacement uBoot (replaces the existing uBoot on /dev/mtd0)

WARNING: Writing to /dev/mtd0 can brick your device.

Get the latest uBoot release and apply patches

wget ftp://ftp.denx.de/pub/u-boot/u-boot-2010.09.tar.bz2 tar -xjvf u-boot-2010.09.tar.bz2 cd u-boot-2010.09 wget http://projects.doozan.com/uboot/patches/general.patch wget http://projects.doozan.com/uboot/patches/mach-dockstar.patch # You can also grab mach-pinkpogo.patch and mach-goflexnet.patch # if you're interested in building uBoot for those platforms patch -p1 < general.patch patch -p1 < mach-dockstar.patch # Switch to the cross compiler environment codesourcery-arm-2009q3.sh make distclean make dockstar_config make u-boot.kwb dd if=u-boot.kwb of=uboot.mtd0.kwb bs=512k conv=sync

This will create a file called uboot.mtd0.kwb that you can flash to /dev/mtd0

Testing your new uBoot

This assumes you have a serial cable to watch and interact with the uBoot process. If you do not have a serial cable, you should not be playing with mtd0.

Configure a TFTP server someplace on your network. The example below assumes that your TFTP server is at 192.168.0.100 and that 192.168.0.200 is an acceptable IP address for uBoot to use. You should alter these values for your specific network.

Copy the uboot.mtd0.kwb file to /tftproot

Interrupt the Pogoplug uBoot loader and enter the following commands:

setenv ipaddr 192.168.0.200 setenv serverip 192.168.0.100 tftp 0x800000 uboot.mtd0.kwb go 0x800200

Notice that we load the image at 0x800000 but start running it from 0x800200. This is because the first 0x200 bytes of are the kirkwood image header, and the real executable starts after the header.

If your new uBoot loads successfully, you can make things permanent by writing it to mtd0.

Backup /dev/mtd0

To create an image of mtd0, you need to dump the nand without ecc. using "dd if=/dev/mtd0 of=mtd0.DOESNOTWORK" will automatically do ecc for you and will result in a corrupt image. To successfully dump the nand, you need to do the following:

cd /tmp wget http://download.doozan.com/uboot/nanddump chmod +x nanddump ./nanddump -nof mtd0.backup /dev/mtd0 ./nanddump -nof uboot-original -s 0 -l 0x80000 /dev/mtd0

Writing your new uBoot to /dev/mtd0

# Erase the first 512k of /dev/mtd0 flash_erase /dev/mtd0 0 4 # Write the new bootloader nandwrite /dev/mtd0 uboot.mtd0.kwb # Cross your fingers and reboot..

Build chained uBoot (installs on /dev/mtd3)

Get the latest uBoot source code and apply patches

git clone git://git.denx.de/u-boot.git u-boot cd u-boot wget http://projects.doozan.com/uboot/patches/uboot.mtd3.patch patch -p1 < uboot.mtd3.patch wget http://projects.doozan.com/uboot/patches/mkDockstar.mtd3 chmod +x mkDockstar.mtd3 # Switch to the cross compiler environment codesourcery-arm-2009q3.sh ./mkDockstar.mtd3

Testing your new uBoot

This assumes you have a serial cable to watch and interact with the uBoot process. If you do not have a serial cable, you can follow the intsructions for "Writing your new uBoot" and just hope for the best.

Configure a TFTP server someplace on your network. The example below assumes that your TFTP server is at 192.168.0.100 and that 192.168.0.200 is an acceptable IP address for uBoot to use. You should alter these values for your specific network.

Copy the uboot.mtd3.bin file to /tftproot

Interrupt the Pogoplug uBoot loader and enter the following commands:

setenv ipaddr 192.168.0.200 setenv serverip 192.168.0.100 tftp 0x800000 uboot.mtd3.bin go 0x800000

This loads our new uBoot into memory at address 0x800000 and starts running it. The first uBoot is already loaded into memory at 0x600000, so this puts us just beyond that environment. If your new uBoot loads successfully, you can make things permanent by writing it to mtd3.

Writing your new uBoot to /dev/mtd3

Boot to the original Pogoplug environment and enter the following commands:

flash_eraseall /dev/mtd3 nandwrite /dev/mtd3 uboot.mtd3.bin

Playing with the old uBoot code

The Cloud Engines open source page has a download link for their uBoot Bootloader, pogoplug-u-boot-1.1.4.tgz. There is also an older file called pogoplug-u-boot-1.1.4.pp2.0.tar.bz2 that I found referenced in this post on the Pogoplug forum. This older file is more interesting for us because it has a 'redstone_config' make target, which is the development name for the Dockstar board. Make sure you use the install the older arm-2006q1 cross compiler to build these sources.

wget http://download.pogoplug.com/opensource/pogoplug-u-boot-1.1.4.pp2.0.tar.bz2 tar -xjvf pogoplug-u-boot-1.1.4.pp2.0.tar.bz2 cd u-boot # Switch to the cross compiler environment codesourcery-arm-2006q1.sh make mrproper make redstone_config make

A few points of interest regarding the original Pogoplug uBoot's boot process:

Please visit the forum for more uBoot information.

Have fun!

-- Jeff