User Tools

Site Tools


toh:globalscale:sheevaplug

SheevaPlug

I have install OpenWrt BARRIER BREAKER on the NAND memory of a SheevaPlug with success.

Hope these notes will help to explain how reproduce it.

There are a lot of advantages to put OpenWrt on a SheevaPlug, for example:

  • Have a system it can be shutdown as a modem.
  • Use an external USB hard drive and spin it down for noise reduction.
  • Have fast restart of the system, very good thing for a PBX
  • Etc …

Unfortunately, there aren't any pre-built images offered for download for the SheevaPLug device.

In fact the port is simple. It just needs to regenerate a openwrt-kirkwood-uImage file after having enabled the SheevaPlug motherboard support.

Hardware

What You Need To Know

:!: Support dropped for Sheevaplug.

  1. The jffs2-nand support is only available on the barrier_breaker version.
  2. The rootfs size reserved by u-boot will be too small by default.
  3. Never use /snapshots/trunk/kirkwood/uboot-kirkwood-sheevaplug/ to update your u-boot.

Preparations

Might look like a bad joke, but in fact when I started the SheevaPlug port I'd only read the Wiki documentation. All the necessary info for build it on you own devices is there.

  1. You will be using OpenWrt Buildroot for this, so read about it
  2. Pull OpenWrt Buildroot per svn/git and install its prerequisites on your system: OpenWrt Buildroot – Installation
  3. See howto use it OpenWrt Buildroot – Usage
  4. In case questions pop up, cf. OpenWrt Buildroot – Technical Reference (Work in Progress)

Debian 7 :

sudo apt-get install libncurses5-dev zlib1g-dev gawk subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache gettext libssl-dev xsltproc

Note: If you simply and swiftly want to cross compile a program, see crosscompile.

Procedure

1. Pull OpenWrt Buildroot and install its dependencies

2. Pull sources for BARRIER BREAKER

cd ~
mkdir -p ~/openwrt
cd ~/openwrt
svn co svn://svn.openwrt.org/openwrt/branches/barrier_breaker
cd barrier_breaker
make menuconfig
  - Target System ---> Marvell Kirkwood
  - Target Profile ---> Generic (default)
  - Save and Exit
make kernel_menuconfig
  - System Type  ---> Marvell Kirkwood Implementations  --->
 [*] Marvell eSATA SheevaPlug Reference Board
 [*] Marvell SheevaPlug Reference Board
  - Save and Exit
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make prereq
make oldconfig
make menuconfig
  - LuCI  ---> 1. Collections  ---> <*> luci-ssl
  - Target Images  ---> [*] jffs2 for NAND
  - Save and Exit

Then we start the compilation

make

It results in a minimally functioning system , but that probably a wrong thing to stop you work here. The better is build all others available packages as module, especially kernel-modules. That because lot of packages can depends of kernel sign. That can take days to generate all packages as opkg format, but that a good way for never have to recompile anything.

3. Prepare a TFTP server

Unfortunately for you I have use a TFTP server for inject both kernel and rootfs image on the SheevaPlug NAND. I have use Debian 7 host for all my test, then the exemple is for GNU/Linux system. For other OS it should be possible, you just have to put openwrt-kirkwood-uImage and openwrt-kirkwood-generic-jffs2-nand-2048-128k.img on the “root” of you tftp server.

apt-get install tftpd-hpa

Take a look on /etc/default/tftpd-hpa file , it should look like that:

# /etc/default/tftpd-hpa
RUN_DAEMON="yes"
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure --verbose"

then

/etc/init.d/tftpd-hpa restart
[ ok ] Restarting HPA's tftpd: in.tftpd.

copy openwrt-kirkwood-uImage and openwrt-kirkwood-generic-jffs2-nand-2048-128k.img on /srv/tftp/ directory

cp ./bin/kirkwood/openwrt-kirkwood-uImage /srv/tftp/
cp ./bin/kirkwood/openwrt-kirkwood-generic-jffs2-nand-2048-128k.img /srv/tftp/

Very hard , that all

4. Deal with u-boot

You probably have to update you u-boot , you can found it here: http://people.debian.org/~tbm/u-boot/ And you should follow that doc: http://www.cyrius.com/debian/kirkwood/sheevaplug/uboot-upgrade/

Never use the u-boot file generate by OpenWrt SDK, or found on anywhere of OpenWrt, that simply break you device. Prefer Debian u-boot file.

  1. Connect the sheevaPlug MiniUSB to a USB port of you computer
  2. Open a terminal session
  3. Use screen or Minicom
screen /dev/ttyUSB0 115200

Start by creating a backup of you u-boot environment variables, by printenv and copy past the result inside you favorite text editor.

Marvell>> printenv

Unset almost every variables by use : sentenv VARIABLE_NAME '' when it's pretty clean inject it environment setting :

 setenv loadaddr '0x6400000'
 setenv console 'console=ttyS0,115200 panic=20'
 setenv bootargs_root 'root=/dev/mtdblock2 rootfstype=jffs2'
 setenv kernel_name 'openwrt-kirkwood-uImage'
 setenv rootfs_name 'openwrt-kirkwood-generic-jffs2-nand-2048-128k.img'
 setenv download_kernel 'mw $(loadaddr) 0xffff 0x300000; tftp $(loadaddr) $(kernel_name);'
 setenv flash_kernel 'nand erase 0x100000 0x400000; nand write.e $(loadaddr) 0x100000 0x400000;'
 setenv download_rootfs 'mw $(loadaddr) 0xffff 0x200000; tftp $(loadaddr) $(rootfs_name);'
 setenv flash_rootfs 'nand erase 0x500000 0xfb00000; nand write.e $(loadaddr) 0x500000 0x900000;'
 setenv load_openwrt 'setenv bootargs $(console) $(bootargs_root); nand read $(loadaddr) 0x100000 0x400000; bootm $(loadaddr)'
 setenv bootcmd 'run load_openwrt'
 saveenv
 setenv arcNumber '2097

If you have an eSATA SheevaPlug »> you have to inform u-boot «< If you have an eSATA SheevaPlug, type:

setenv machid a76

Found you ethadd and replace 'XX:XX:XX:XX:XX:XX' by you true Mac Addr, you can found with you MAC Addr on a sticker put on the back of you device

 setenv ethaddr 'XX:XX:XX:XX:XX:XX'

As you imagine you should save you setting

saveenv

If you have DHCP it inject TFTP information:

 dhcp;run download_kernel;run flash_kernel;run download_rootfs;run flash_rootfs;reset;

Else:

 setenv ipaddr '192.168.1.100'
 setenv serverip '192.168.1.10'
 run download_kernel;run flash_kernel;run download_rootfs;run flash_rootfs;reset;

where ipaddr is you IP address on you network, and serverip the TFTP server IP adress on you network.

5. First boot

At first boot, the filesytem ill take a moment to grow the rootfs partition to MAX size, ot can be slow (5 minutes)

Troubleshooting

Download a valide u-boot from here : http://people.debian.org/~tbm/u-boot/

cd $HOME
wget http://people.debian.org/~tbm/u-boot/2013.10-2/sheevaplug/u-boot.kwb
wget http://people.debian.org/~tbm/u-boot/2013.10-2/sheevaplug/uboot.elf

Install openocd for can unbrike you SheevaPlug device.

sudo apt-get update && apt-get install openocd telnet screen

Power connect the SheevaPlug and connect the miniusb port to you computer.

Open a terminal session and initialize openocd:

#openocd -f /usr/share/openocd/scripts/board/sheevaplug.cfg -s /usr/share/openocd/scripts
Open On-Chip Debugger 0.5.0 (2011-08-09-08:45)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
2000 kHz
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
dcc downloads are enabled
Warn : use 'feroceon.cpu' as target identifier, not '0'
sheevaplug_load_uboot
Info : clock speed 2000 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: feroceon.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Embedded ICE version 0
Info : feroceon.cpu: hardware has 1 breakpoint/watchpoint unit
Error: unexpected Feroceon EICE version signature

Download a valide u-boot.elf Copy it on you home Open a other terminal session and connect you with telnet on localhost 4444.

user@youhost:~$ telnet localhost 4444
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
>

You obtain a prompt, that the moment to inject a valid u-boot and write it on the NAND.

reset;sheevaplug_init;load_image u-boot.elf;resume 0x00600000

Now you can see Uboot starting to run “screen /dev/ttyUSB0 115200” you are ready to start restoring your plug.

Reference Documents: https://newit.co.uk/forum/index.php?topic=2835.0;wap2

Notes

I don't provide any image that because my images, don't respect default OpenWrt configuration, I have totally made my own thing, via the amazing OpenWrt SDK. It's still an OpenWrt but it's ready out of the box for my own personal usage. Here is what I have done:

 Compile nativelly the entire GNU Core Utilities, and not install busybox
 Compile nativelly NTPD
 Compile nativelly SSHD and not install dropbear
 Compile nativelly Asterisk 11 - chan_sscp-b (for Cisco support)
 Compile nativelly DJBDNS and not dnsmasq then not install dhcp server thing
 Compile nativelly StrangSwan an IPSEC thing
 Not install Luci
 Inject all my default config file, via the ./script/env and ./file/ directory

Tags

toh/globalscale/sheevaplug.txt · Last modified: 2018/06/17 12:30 by tmomas