The power supply of my eSata SheevaPlug died recently. Quite impressively, it triggered the 16 amps automatic circuit breaker, but fortunately, the rest of the SheevaPlug still works.
Because of this event, I had a look at the plugcomputer.org forum and found a post about the IB-NAS6210. It is a NAS case for a single 3,5“ hard disk (+ 1 eSATA port) using the same hardware platform as the SheevaPlug, which is ideally suited for my use as a remote backup system. Furthermore, it has an integrated USB hub with 3 external USB ports (2 on the rear and one on the front). However, it has only 256 MB of RAM, 256 MB of flash and no SD card slot. I don’t care, since it can boot via the USB ports (and apparently also via SATA) and 256MB of RAM are plenty for my purposes. What’s best, I got it for 66 Euros.
Attaching the serial port
The following steps will most probably void the warranty on your box. I take no responsability for your actions. Furthermore, RaidSonic may change the hardware at any time (even without changing the type label), rendering this description completely useless or even harmful. You have been warned.
In order to be able to boot your own system, U-Boot has to be configured accordingly via the serial console. The box I have (with the type label „IB-NAS6210-B“) has a 3.3v serial port connector on the PCB. Opening the case (which makes a high quality impression considering the price, btw.) to get at the connector is really easy (remove the HDD tray when doing that):
Unscrew the four screws on the back to remove the back plate.
Unscrew the two rear case feet:
Now you should be able to the slide out the PCB assembly. The connector for the serial port is „buried“ under cables next to the power connector for the hard drive.
The PCBs of the IB-NAS6220 (2-bay version) and the IB-NAS6210 seem to be essentially the same. Thus, the serial connector is at the same place and has the same pinout as described here:
The connector is labeled with „J5“ and has a 2.0mm pitch. As said, it is a 3.3v interface which can’t be connected directly to a PC’s serial port. Thus, I needed to build an adapter using a MAX3232 like described here (obviously, you have to adapt the pinout of the 3.3v serial side.) As a note: The 3.3v pin of the connector is not needed for the serial connection. There are serial to USB adapters that provide 3.3v Vcc for some reason. Do not connect this to the 3.3v pin! As said, do not connect it at all.
Boot from USB
Serial settings are 1152008N1.
Here is the output of U-Boot when booting:
__ __ _ _
| \/ | __ _ _ ____ _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| | | | (_| | | \ V / __/ | |
|_| |_|\__,_|_| \_/ \___|_|_|
_ _ ____ _
| | | | | __ ) ___ ___ | |_
| | | |___| _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
\___/ |____/ \___/ \___/ \__|
** MARVELL BOARD: DB-88F6281A-BP LE
U-Boot 1.1.4 (Oct 12 2009 - 13:41:53) Marvell version: 3.4.16
U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006CEE60
Soc: MV88F6281 Rev 3 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz
DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS base 0x00000000 size 256MB
DRAM Total size 256MB 16bit width
Flash: 0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
CPU : Marvell Feroceon (Rev 1)
Write allocate disabled
USB 0: host mode
PEX 0: interface detected no Link.
Net: egiga0 [PRIME]
The U-Boot is rather old, but works for me (but there is a modern U-Boot available). It seems to be rather picky regarding USB sticks. Especially larger ones do not seem to work. You may have to try a few to find a working one.
Here are the original environment variables:
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$
(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
bootargs_root=ubi.mtd=2,2048 root=ubi0:rootfs rootfstype=ubifs init=/linuxrc
bootcmd=nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000
Environment size: 1192/131068 bytes
Note: The following is a description of how to get a stock Debian Squeeze install to boot on the IB-NAS 6210/6220. By now, these devices are supported natively in the Linux kernel (as of 3.5). Using the new kernel support you get: the original MTD partition layout, support for the LEDs, support for the buttons, and the ability to turn off power when shutting down the device. Additionally, Arch Linux ARM supports the devices directly (based on the previous patch, but both versions provide the same functionality anyway).
In order to boot from USB, I copied my SheevaPlug Debian Squeeze install from an SD-Card to an USB-Stick that is partioned as follows:
# fdisk -ucl /dev/sda
Disk /dev/sda: 4051 MB, 4051697664 bytes
125 heads, 62 sectors/track, 1021 cylinders, total 7913472 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x046352a3
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 411647 204800 83 Linux
/dev/sda2 411648 7913471 3750912 83 Linux
Partition 1 is the boot filesystem (ext2) with uImage and uInitrd. Partition 2 is the root filesystem (ext3). After copying the data from the SD-Card, I changed /etc/fstab to adapt the UUIDs of the boot and root partitions. As I found out, you should also use the UUID of the root device in the „root“ parameter to the kernel (or the LABEL), since the USB stick may be detected as /dev/sda or as /dev/sdb depending on the type of hard disk… (Thus, a parameter like „root=/dev/sda2“ does not work reliably)
In U-Boot, the following commands should do the trick to let the box boot from USB (if the partitions are laid out as above). Of course, you will have to use the UUID or the LABEL of your root device:
setenv mainlineLinux yes
setenv arcNumber 1680
setenv bootargs_console console=ttyS0,115200
setenv bootargs_root 'root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rootdelay=10'
setenv bootcmd_usb 'usb start; ext2load usb 0:1 0x00800000 /uImage; ext2load usb 0:1 0x01100000 /uInitrd'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_usb; bootm 0x00800000 0x01100000'
This should leave the original firmware in the NAND untouched. If you ever decide to return to the original firmware, you should be able to do this by restoring the original environment variables as listed above. (I did not verify this, since I even never booted into the original firmware once).
IMPORTANT: The arcNumber used here (1680 for „Marvell DB-88F6281-BP Development Board“) uses an MTD partitioning that is incompatible with the layout of the IB-NAS6210. You should not do anything with the mtd partitions!
Note that there is a short description (in German) in the comments below on how to install ArchLinux ARM. Thanks sudoquai!
Adapting the flash-kernel script of Debian Squeeze
Debian’s flash-kernel script does not know the machine used here („Marvell DB-88F6281-BP Development Board“) and refuses to install a new kernel. A simple patch helps.
Kernel Patch adding direct support for the IB-NAS62x0
The constant blinking of the power LED made me nervous. Therefore, I developed a patch to support the 6210 and 6220 boxes directly. This patch was then converted to flattened devicetree and is part of the mainline Linux kernel as of 3.5. Have a look here on how to compile the kernel in order to be able to boot it using the original U-Boot.
Non FDT patch
As said above, the original patch was using the ‚classical‘ way of supporting new boards, which is deprecated now. I do not maintain this version anymore. But, if you still want to use it, here it is: linux-3.1-rc9.nas6210.patch.
In contrast to the support for the „Marvell DB-88F6281-BP Development Board“ used above, the patch uses the original MTD partitioning found on my device. Use arcNumber 3104 for booting with this patch.
Newer U-Boot for the IB-NAS62x0
For the brave at heart, U-Boot supports the IB-NAS62x0 as of version 2012.07. Thanks to Luka and Gerald for driving this.
Note: The default MTD partitioning of U-Boot deviates from the one found originally on the device.