bk99.de entertain the web since 1997

A computer in a wall plug: Debian on the SheevaPlug

Summary

In November 2009 I installed Debian Squeeze on a Marvell SheevaPlug, a complete ARM computer in the housing of a plug-in power supply, and booted it from an SDHC card. The way led through the serial console, the U-Boot boot loader and a TFTP server that loaded kernel and installer into the device. This post from my old blog shows the steps of the time, what the device could do and why it was a forerunner of the Raspberry Pi.

A computer that fits into the socket

Marvell presented the SheevaPlug in early 2009 as a reference design for its “plug computing” and sold it from February 2009 for 99 US dollars. The concept: a full Linux computer in the housing of a plug-in power supply that sits directly in the wall socket and uses a few watts.

At boot, mine reported a Marvell Kirkwood 88F6281 CPU at 1.2 GHz, 512 MB of DDR2 RAM and 512 MB of NAND flash, plus Gigabit Ethernet, USB 2.0 and an SD card reader. From the factory it ran an Ubuntu system from flash. The idea was to turn it into small servers: network storage, print server, download station, anything that should run all the time and draw hardly any power.

Access via the serial console

The plug had a mini-USB port with a USB-to-serial converter behind it. I found the Windows driver well hidden in the support package on the enclosed CD; it was unsigned but still worked on 64-bit Vista. With PuTTY on COM4 at 115,200 baud the console was up.

One detail you do not forget: on first boot the device clock was set to 22 May 2029. Before anything involving certificates or package sources worked, the time had to be right:

root@debian:~# date
Tue May 22 01:03:58 UTC 2029
root@debian:~# ntpdate ntp.bk99.de
... step time server ... offset -615361606.846183 sec
root@debian:~# hwclock --systohc

Preparing U-Boot

The SheevaPlug boots from the U-Boot boot loader. For a Debian kernel from the official Linux tree to start instead of the Marvell kernel, two variables had to be set: mainlineLinux and arcNumber, the machine number by which the kernel recognises the board.

U-Boot 1.1.4 (Sep 14 2009 - 15:36:37) Marvell version: 3.4.19
Soc: 88F6281 A0 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
DRAM Total size 512MB  16bit width
NAND:512 MB
Net:   egiga0 [PRIME], egiga1

Marvell>> setenv mainlineLinux yes
Marvell>> setenv arcNumber 2097
Marvell>> saveenv
Marvell>> reset

Installer via TFTP

There was no CD drive, so kernel and installer came over the network. A TFTP server on the LAN provided the two files, U-Boot loaded them to fixed addresses in memory and started the Debian installer, which wrote the system to the 8 GB SDHC card.

Marvell>> setenv serverip 172.16.48.20
Marvell>> setenv ipaddr 172.16.48.101
Marvell>> tftpboot 0x0800000 uInitrd
Bytes transferred = 2690046 (290bfe hex)
Marvell>> tftpboot 0x400000 uImage
Marvell>> setenv bootargs console=ttyS0,115200n8 base-installer/initramfs-tools/driver-policy=most
Marvell>> bootm 0x400000 0x0800000
## Booting image at 00400000 ...
   Image Name:   Debian kernel
## Loading Ramdisk Image at 00800000 ...
   Image Name:   debian-installer ramdisk
Starting kernel ...

After that a normal Debian installer ran over the serial console. Finally U-Boot had to learn to load kernel and initrd from the SD card at boot instead of from the network:

setenv bootargs_console console=ttyS0,115200
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage'
setenv bootcmd 'setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x400000 0x0800000'
saveenv
run bootcmd

Debian Squeeze was still the testing branch in November 2009; it was only officially released in February 2011. The ARM kernels for the plug were mainly maintained by Martin Michlmayr at the time, who also wrote the guides for it.

What the device could do and what became of it

As a small server for network services the plug was entirely sufficient, and Debian soon supported it directly in the installer. The GuruPlug followed in 2010 as a successor with Wi-Fi and Bluetooth, and various manufacturers built network storage on the same Kirkwood platform.

Three years later the Raspberry Pi arrived and turned the idea of a cheap, frugal ARM computer for everyone into a mass product, with graphics output, a large community and no mandatory serial console. What remains of the SheevaPlug: U-Boot as the boot loader on almost every ARM board, and the knowledge that you can install a computer over TFTP and a serial line even when it has neither screen nor drive.

Numbers at a glance

  • SheevaPlug: Marvell Kirkwood 88F6281 at 1.2 GHz, 512 MB DDR2, 512 MB NAND flash, Gigabit Ethernet, USB 2.0, SD card.
  • Marvell sold the reference design from February 2009 for 99 US dollars.
  • U-Boot variables for mainline kernels: mainlineLinux=yes and arcNumber=2097.
  • The serial console ran at 115,200 baud via a built-in USB-to-serial converter.
  • Debian 6.0 “Squeeze” was officially released in February 2011.

References

Remarks

  • This post combines my SheevaPlug pages from 20 and 21 November 2009 in the old Plone blog, including the boot logs and my notes. In 2026 I retrieved them from the Web Archive and revised them.
  • I shortened the boot logs to the essential lines; the full logs of the time are in the Web Archive.

Original post in the Web Archive