Sheeva1 server installation

Finally, I successfully run Kuro Sheeva with eSATA drive.

I use the enclosure of GW3.5AA-SUE by Kurouto Shikou. The capability of this enclosure is 1.5Gbps. Perhaps, this might be the cause of troubles.

Successfull combination

  • Kuro Sheeva
  • Enclosure: GW3.5AA-SUE
  • Disk: ST3750640AS
  • U-boot: 1.1.4 + 3.4.27 + patch
  • Kernel: Debian squeeze

Output of 'ide reset' by U-boot

Here is the output of U-boot:

Marvell>> ide reset
Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
[0 1 0]: Enable DMA mode (6)
  Device 1 @ 0 1:
Model: ST3750640AS                              Firm: 3.AAE    Ser#:             3QD0KCHW
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 715404.8 MB = 698.6 GB (1465149168 x 512)

And the one of kernel:

Waiting for /dev to be fully populated...sata_mv sata_mv.0: version 1.28
sata_mv sata_mv.0: slots 32 ports 2
scsi0 : sata_mv
scsi1 : sata_mv
ata1: SATA max UDMA/133 irq 21
ata2: SATA max UDMA/133 irq 21
ata1: SATA link down (SStatus 0 SControl F300)
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl F300)
ata2.00: ATA-7: ST3750640AS, 3.AAE, max UDMA/133
ata2.00: 1465149168 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata2.00: configured for UDMA/133
scsi 1:0:0:0: Direct-Access     ATA      ST3750640AS      3.AA PQ: 0 ANSI: 5
sd 1:0:0:0: [sda] 1465149168 512-byte logical blocks: (750 GB/698 GiB)
sd 1:0:0:0: Attached scsi generic sg0 type 0
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3
sd 1:0:0:0: [sda] Attached SCSI disk

Failures

I failed many times by old U-boot, bad disk drives, etc. Here, I describe a failure of a drive.

The disk drive of 'Maxtor 6V250F0' works by the kernel somehow, but it doesn't work by U-boot.

Even for the kernel, it takes sometime to timeout (3.0Gbps connection?).

Output of the kernel:

Waiting for /dev to be fully populated...sata_mv sata_mv.0: version 1.28
sata_mv sata_mv.0: slots 32 ports 2
scsi0 : sata_mv
scsi1 : sata_mv
ata1: SATA max UDMA/133 irq 21
ata2: SATA max UDMA/133 irq 21
ata1: SATA link down (SStatus 0 SControl F300)
ata2: link is slow to respond, please be patient (ready=0)
ata2: SRST failed (errno=-16)
ata2: link is slow to respond, please be patient (ready=0)
ata2: SRST failed (errno=-16)
ata2: link is slow to respond, please be patient (ready=0)
ata2: SRST failed (errno=-16)
ata2: limiting SATA link speed to 1.5 Gbps
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl F310)
ata2.00: ATA-7: Maxtor 6V250F0, VA111630, max UDMA/133
ata2.00: 490234752 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata2.00: configured for UDMA/133
scsi 1:0:0:0: Direct-Access     ATA      Maxtor 6V250F0   VA11 PQ: 0 ANSI: 5
sd 1:0:0:0: [sda] 490234752 512-byte logical blocks: (251 GB/233 GiB)
sd 1:0:0:0: Attached scsi generic sg0 type 0
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3 sda4
sd 1:0:0:0: [sda] Attached SCSI disk

Installing U-boot 1.1.4 + 3.4.27 + alpha

I read enable eSATA of SheevaPlug (in Japanese), and follow its instructions. In my case, it is cross build.

Get OpenOCD

OpenOCD in Squeeze is new enough to burn flash ROM of Kuro Sheeva, though I need to kill it at the end of the process. Just do: apt-get install openocd

Get cross compiler from EmDebian

I create the file /etc/apt/sources.list.d/emdebian.list with following content:

deb http://www.emdebian.org/debian/ squeeze main

Then install, binutils-arm-linux-gnueabi, gcc-4.4-arm-linux-gnueabi and others.

Build of U-boot 1.1.4 + 3.4.27 + alpha

Files are:

And I do:

$ tar xvf u-boot-1.1.4.tar.bz2
$ mv u-boot-1.1.4 u-boot-3.4.27
$ unzip -o u-boot-3.4.27.zip
$ cd u-boot-3.4.27
$ patch -p1 < ../pathch-3.4.27-pingtoo-01
$ patch -p1 < ../u-boot-1.1.4.diff
$ edit board/mv_feroceon/mv_kw/mv_main.c

Edit line 1127:

1127     if (devId == MV_6180_DEV_ID || boardId == RD_88F6281A_PCAC_ID || devId == MV_6280_DEV_ID || boardId == SHEEVA_PLUG_ID)

to:

1127     if (devId == MV_6180_DEV_ID || boardId == RD_88F6281A_PCAC_ID)

Then, invoke following commands:

$ make CROSS_COMPILE=arm-linux-gnueabi- mrproper
$ make CROSS_COMPILE=arm-linux-gnueabi- rd88f6281Sheevaplug_config LE=1 NBOOT=1 USB=1

But here I see failiure because of dash. I need to edit last line of include/config.mk to remove '-e'. It is because dash's internal command 'echo' is not compatible to /bin/echo which accepts '-e' option.

Then, invoke make, and we have u-boot-rd88f6281Sheevaplug_400db_nand.bin.

$ make CROSS_COMPILE=arm-linux-gnueabi- all

Copy u-boot-rd88f6281Sheevaplug_400db_nand.bin to uboot.bin. Then invoke OpenOCD and burn it.

$ openocd -f board/sheevaplug.cfg -c init -c sheevaplug_reflash_uboot
Open On-Chip Debugger 0.3.1 (2009-11-25-12:22)
$URL$
For bug reports, read
      http://openocd.berlios.de/doc/doxygen/bugs.html
2000 kHz
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
dcc downloads are enabled
Warn : use 'feroceon.cpu' as target identifier, not '0'
Info : clock speed 2000 kHz
Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (mfg: 0x1e9, part: 0x0a02, ver: 0x2)
Info : Embedded ICE version 0
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x000000d3 pc: 0xffff0000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
0 0 1 0: 00052078
NAND flash device 'NAND 512MiB 3,3V 8-bit' found
erased blocks 0 to 5 on NAND flash device #0 'NAND 512MiB 3,3V 8-bit'
wrote file uboot.bin to NAND flash 0 up to offset 0x00074000 in 67.729034s
  C-c

Note that I kill openocd at the end.

U-boot settings (1)

I set following variables on U-boot.

setenv mainlineLinux yes
setenv arcNumber 2678
saveenv

Install Debian Squeeze on to Flash

I read Installing Debian To Flash, and I have SD-card with Debian Squeeze installed already.

I run following commands in U-boot, to initialize IDE and SD card, then to load kernel and initial ramdisk and to kick boot process.

ide reset
mmcinit
ext2load mmc 0:1 0x800000 /uImage
ext2load mmc 0:1 0x1100000 /uInitrd
set bootargs console=ttyS0,115200
bootm 0x800000 0x1100000

Then login to Debian GNU/Linux as root. I do create UBIFS root filesystem on /dev/mtd2.

ubiformat /dev/mtd2 -s 512
ubiattach /dev/ubi_ctrl -m 2
ubimkvol /dev/ubi0 -N rootfs -m
mount -t ubifs ubi0:rootfs /mnt

Copy the filesystem from original.

mkdir /tmp/rootfs
mount -o bind / /tmp/rootfs
cd /tmp/rootfs
sync
cp -a . /mnt/

and create /etc/fstab, which includes following two lines at least.

/dev/root  /              ubifs   defaults,noatime,rw                      0 0
tmpfs     /tmp            tmpfs   defaults,nosuid,nodev                    0 0

Setup of eSATA disk

I decide put /boot, /var, and /home partitions on eSATA. And create those partition by cfdisk. Then, I make filesystem and swap on those partitions.:

mke2fs -L boot /dev/sda1
mkswap -L swap /dev/sda2
mkfs.ext4 -L var /dev/sda3
mkfs.ext4 -L home /dev/sda4

I put following entries into /etc/fstab:

LABEL=boot /boot ext2 defaults 0 0
LABEL=swap none  swap sw       0 0
LABEL=var  /var  ext4 defaults 0 2
LABEL=home /home ext4 defaults 0 2

Then, mount boot on /mnt and copy contents of /boot, unmount it.

Then, mount var on /mnt and copy contents of /var, unmount it.

Then, mount home on /mnt and copy contents of /home, unmount it.

Then, invoke:

shutdown -r now

U-boot settings (2)

On reboot, I do following settings on U-boot.

setenv bootargs 'console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs'
setenv bootcmd_nand 'nand read.e 0x800000 0x100000 0x400000'
setenv bootcmd_sata 'ide reset; ext2load ide 1:1 0x800000 /uImage; ext2load ide 1:1 0x1100000 /uInitrd'
setenv bootcmd 'run bootcmd_sata; bootm 0x800000 0x1100000'
saveenv

Here, I save original nand boot process into bootcmd_nand variable. When I will want to boot from flash, I will do:

setenv bootcmd 'run bootcmd_nand; bootm 0x800000'
saveenv