Sheevaplug Notes

My notes for getting from bare plastic to reliable boot with Fedora 17 and a SheevaPlug.

Getting /dev/ttyUSB0 Working on my F-17 Laptop

Kempy suggests connecting by running
sudo chown uucp /dev/ttyUSB0; sudo cu -s 115200 -l /dev/ttyUSB0
Although this works, I prefer to add myself to the dialout group. Best way on F-17 seems to be:
usermod -a -G dialout your-username.
Now I can connect as an ordinary user like this:
cu -s 115200 -l /dev/ttyUSB0

Modem-manager kept taking over the port so I would get:
cu: /dev/ttyUSB0: Line in use
when I tried to connect to my device.

The cleanest fix I found after much Googling is to add a custom file to /usr/lib/udev/rules.d. I called mine
77-mm-usb-cust-device-blacklist.rules. Perhaps this file would be better placed in /etc/udev/rules.d.

# edit this file, it will not be overwritten on update

ACTION!="add|change", GOTO="mm_usb_device_blacklist_end"
SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_end"
ENV{DEVTYPE}!="usb_device",  GOTO="mm_usb_device_blacklist_end"

# Custom for Sheevaplug: Product: SheevaPlug JTAGKey FT2232D B
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", ENV{ID_MM_DEVICE_IGNORE}="1"

LABEL="mm_usb_device_blacklist_end"

Installation

I installed Fedora-17-arm-kirkwood-mmcblk0.img.xz accoring to the instructions on the Fedorra site. Although I followed the steps carfully a couple of times, I couldn’t get my plug to boot. I remembered reading and ignoring something about updating u-boot to the DENX version from the Marvell version provided with the plug. I followed Martin Michlmayre’s clear instructions for u-boot update. After this update, everything as detailed on the Fedora site just worked. Note that a newer (2012.04.01-2) version of u-boot would not boot the image either.

For the Sheevaplug change usb 1:1 to usb 0:1 in the bootloader commands on the these lines:

set loadInitrd 'fatload usb 0:1 0x7400000 uInitrd-kirkwood'
set loadImage 'fatload usb 0:1 0x6400000 uImage-kirkwood'

I had to set the time by hand (date MMDDhhmmYY and hwclock -w)to get networking (and ntpd) working. This issue recurred whenever the plug was cold booted and turned out to be due to a dead RTC battery.

Changing the RTC battery.

Pry out the four feet on the bottome and remove four screws underneath. I had to pry up one metal tab on the batery holder to slide the battery out. A firm push with a screwdrive was required as the battery had leaked and was stuck in place. I cleaned the holder before installing the new battery. The original battery was an LR1130. AG10 is another part number for the same battery. 389 is the same size and specs but silver not alkaline. The first two numbers cost pennies a piece but are not available locally. A 398 was almost $6 at Radio Shack and seems to work fine other than the damage to my wallet.

yum update

I ran yum update and the updated system was not bootable. The cause of the un-bootable system was a bad kernel, see bug 834977. Update: happily, 3.7.3-101.fc17.armv5tel.kirkwood does boot.

I discovered that the problem was the 3.5.6-1 kernel by mounting the by USB stick on my laptop and reverting to the old kernel. Here’s a listing of the boot partition after yum update:

total 39824
-rw-r--r--. 1 usr usr       71 Jun 18 05:53 boot.scr
-rw-r--r--. 1 usr usr       62 Dec  9 04:28 klist.txt
-rw-r--r--. 1 usr usr      436 Jun 18 05:53 README.txt
-rw-r--r--. 1 usr usr  3291896 Jun 18 05:58 uImage-3.4.2-3.fc17.armv5tel.kirkwood
-rw-r--r--. 1 usr usr  3350824 Dec  9 04:27 uImage-3.5.6-1.fc17.armv5tel.kirkwood
-rw-r--r--. 1 usr usr  3350824 Dec  9 04:27 uImage-kirkwood
-rw-r--r--. 1 usr usr 10112646 Jun 18 05:58 uInitrd-3.4.2-3.fc17.armv5tel.kirkwood
-rw-r--r--. 1 usr usr 10308294 Dec  9 04:28 uInitrd-3.5.6-1.fc17.armv5tel.kirkwood
-rw-r--r--. 1 usr usr 10308294 Dec  9 04:28 uInitrd-kirkwood

Because the partition is fat you can’t ln to change the uImage and uInitrd-kirkwood to point to the old files. So I used cp -a:

cp -a uImage-3.4.2-3.fc17.armv5tel.kirkwood uImage-kirkwood
cp -a uInitrd-3.4.2-3.fc17.armv5tel.kirkwood uInitrd-kirkwood

System boots. Another way of doing this should be to change the values of loadImage and loadInitrd to point the the specific image and initrd.

Booting from an SD Card

The USB stick was at risk of being unplugged by curious fingers so I dd‘d the system from the USB stick to a an SD card.

U-boot commands for the SD card were gleaned by looking at this Debian page and applying to the fedora instructions. These u-boot instructions set up u-boot to boot the system from the SD card. mmc init is repeated because it fails the first time on a cold boot. Booting should be tested under all conditions: reboot from the OS, after hardware reset and cold boot.

Marvell>> set loadImage fatload mmc 1:1 0x6400000 uImage-kirkwood
Marvell>> set loadInitrd fatload mmc 1:1 0x7400000 uInitrd-kirkwood
Marvell>> set bootcmd 'mmc init 1; mmc init 1; ${loadImage}; ${loadInitrd} ; bootm 0x6400000 0x7400000'
Marvell>> saveenv
Marvell>> boot

Leave a Reply

Your email address will not be published. Required fields are marked *