Terastation TS-XL

Install Firmware from NAND
If blank drives are inserted the device will boot from it's internal NAND and eventually go into EM mode. Once the device is in EM mode the firmware can be installed using tsupdater in debug mode, see Enable Debug mode for LSUpdater/TSUpdater.

Other Methods
This device is much less flexible about what partitions/filesystems it will attempt to boot from. I recommend installing from NAND so that the device will build appropriate partitions for you. It is possible to install via TFTP or loading files directly if desired.

Device Notes
The serial port on the front of the device outputs the devices console output which can be used for troubleshooting. The port has input disabled.

It is supposed to be possible to re-enable input on the serial port by removing a chip from the pcb (I have not yet tried this). see: Terastation III Serial console (Buffalo NAS Central)

Although it's possible to change uboot environment variables from within the stock firmware, changing the bootcmd does not seem to affect the boot process for some reason. I attempted to change the location that uboot loads the initrd image and confirmed the change persisted through a reboot but the console output shows that it still loads from the default address. see below for a workaround.

U-boot max file sizes
The stock U-boot will crash if you try to load a kernel image larger than (somewhere between 4-6MB, still looking for actual limit).

The stock U-boot loads the initrd after the kernel but earlier in memory. this means that if the initrd is larger than 23mb it will overlap the kernel. If you create an initrd uboot image with 23mb of padding at the beginning followed by a copy of the kernel (to re-write it in the proper location) you can then append a larger initrd image (provided you hardcode the new offset into your kernel's cmdline).

Partition table notes
The stock firmware partitions the disks using GPT partition tables. It writes the MAC address of eth0 to 0x28 of the beginning of the disk when formatting a disk, it then checks this at boot time to determine whether the disk is "owned" by this device. The boot loader does not seem to do anything differently if this doesn't match or is missing but I have not tested it extensively.

00000000 01 00 00 00 00 00 00 00  20 00 00 00 00 00 00 00  |........ .......| 00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| 00000020  00 00 00 00 00 00 00 00  30 30 3a 31 64 3a 37 33  |........00:1d:73| 00000030 3a 66 66 3a 34 66 3a 66  62 00 00 00 00 00 00 00  |:ff:4f:fb.......| 00000040 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

boot partition requirements
The boot files are loaded using u-boot's ext2load function with hardcoded parameters. To boot successfully the boot partition must be:
 * the first partition on the disk
 * either a regular partition or part of a raid1 array using metadata version 0.9
 * formatted using the ext2 or ext3 filesystem
 * have an inode size of 128 bytes (newer distros have started using 256 as the default)
 * relatively small, 1GB is usually more than enough for /boot (I have not yet experimented to determine the max allowable size)

The filesystem can be created with: mkfs.ext3 -I 128 /dev/sdx1

U-Boot env
bootargs=console=ttyS0,115200 mtdparts=physmapped-flash.0:32m(root) baudrate=115200 loads_echo=0 ipaddr=192.168.11.150 serverip=192.168.11.1 rootpath=/mnt/ARM_FS/ netmask=255.255.255.0 fw_image_base=0x0 fw_image_size=0x0 console=console=ttyS0,115200 CASset=min MALLOC_len=1 ethprime=egiga0 bootargs_end=:::DB78xx0:eth0:none standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x2000000; ethmtu=1500 eth1mtu=1500 ethact=egiga0 ethaddr=00:1D:73:E7:A5:67 eth1addr=00:1D:73:E7:A5:68 stdin=serial stdout=serial stderr=serial mainlineLinux=no enaMonExt=no enaFlashBuf=yes enaCpuStream=yes enaWrAllo=no enaFPU=yes pexMode=RC disL2Cache=no setL2CacheWT=no disL2Prefetch=yes setL2Size256K=no disL2Ecc=no sata_dma_mode=yes netbsd_en=no vxworks_en=no buffalo_ver=BOOTVER=2.11 buffalo_minor_ver=BOOT_MINOR_VER=1.02 build_time=16:22:33 initrd=initrd.buffalo kernel=uImage.buffalo bootargs_base=console=ttyS0,115200 bootargs_root=root=/dev/sda2 rw initrd=0x00900040,15M panic=5 def_tftp=tftp 0x02000000 $(kernel); tftp 0x00900000 $(initrd); setenv bootargs $(bootargs_base) $(bootargs_root) $(buffalo_ver) tftpboot=yes; bootm 0x02000000 0x00900000 bootdelay=3 disaMvPnp=no usb0Mode=host usb1Mode=host usb2Mode=host EnableNandBoot=1 bootcmd= ext2load ide 2:1 0x02000000 /$(kernel); ext2load ide 2:1 0x00900000 /$(initrd); setenv bootargs $(bootargs_base) $(bootargs_root) $(buffalo_ver); bootm 0x02000000 0x00900000

Buffalo Resources

 * Product Description
 * Manuals, Firmware, etc