This HOW-TO should make it easy for anyone to load and run NetBSD on a
PogoPlug without having to disassemble the device and solder on a serial
adapter. If you won't be using a serial port, skip the next part.
Pins on the PogoPlug (Mobile and Series 4) are numbered one through four
immediately behind the SD card (where behind means towards the rear where
the plugs are). One is farthest back and four is closest to the SD card
slot. TxD is really transmit and RxD, receive. Connect at 115200 baud.
1: power (3.3 volts)
2: TxD
3: RxD
4: ground
If you're not using a serial connection, you'll have to create an account
at
http://my.pogoplug.com/, activate the device at
http://my.pogoplug.com/, then navigate to Settings (starting with the tiny
gear icon in the top right of the web interface), select Security, then
enable ssh for your PogoPlug. Choose your own ssh password. Then, ssh as
user root to the IP of your PogoPlug.
Connect ethernet to a network where the PogoPlug can get a DHCP lease and
access to the Internet. Either with a serial console or via ssh, you're at
a root prompt. Paste in these lines to get tools and the NetBSD kernel.
cd /tmp
wget
http://download.doozan.com/uboot/nandwrite
wget
http://download.doozan.com/uboot/flash_erase
wget
http://ftp.netbsd.org/pub/NetBSD/misc/jklos/netbsd.pogo
chmod +x nandwrite flash_erase
If you like, you can get nanddump (via wget
http://download.doozan.com/uboot/nanddump) and back up mtd3 before
overwriting and scp it somewhere else. Something like this would work:
/nanddump -f pogov4mtd3.dump -o /dev/mtd3
Now we flash the actual NetBSD kernel. mtd3 is labeled "failsafe" in the
mtd map and is 8 megs from the start of flash and 8 megs long. The block
size on the PogoPlug is 131072 bytes, so 64 blocks of 128k each works out
to 8 megs. The "-p" option of nandwrite is to pad the kernel to fit whole
blocks.
/flash_erase /dev/mtd3 0 64
/nandwrite -p /dev/mtd3 netbsd.pogo
Next, we write the environment variable bootcmd. Note that the mw commands
in the beginning are necessary so that NetBSD can use the SD card slot.
Enter the following as one continuous line (keep spaces where it wraps):
/usr/local/cloudengines/bin/blparam bootcmd='mw f1010004 11113311; mw
f1010008 551111; if ping 192.168.58.254; then run boot_nand; fi; nand
read.e 0x800000 0x800000 0x500000; bootm 0x800000'
For PogoPlug Pink, the beginning of mtd3 is 0x2500000, so use:
/usr/local/cloudengines/bin/blparam bootcmd='if ping 192.168.58.254; then
run boot_nand; fi; nand read.e 0x800000 0x2500000 0x500000; bootm 0x800000'
Note that the kernel's current size is 4380032 bytes (but it may change,
so please check), or 0x42d580 in hex, so we can round up to 0x500000 in
the nand read.e command like so. If you make a custom kernel, be sure to
make sure the read.e command loads the entire kernel.
nand read.e 0x800000 0x800000 0x500000
We decide whether to boot NetBSD or GNU/Linux based on whether we can ping
a machine on the network so we can download and flash a new kernel using
GNU/Linux, if we like, without a serial console. Creating an alias is as
simple as something like:
ifconfig usmsc0 inet 192.168.58.254 netmask 0xffffff00 alias Once back in
GNU/Linux, you can rerun the above but with a new kernel or your own
custom kernel. A sample kernel configuration file for NetBSD-current is
here:
http://ftp.netbsd.org/pub/NetBSD/misc/jklos/POGO
These notes can also be found here:
http://ftp.netbsd.org/pub/NetBSD/misc/jklos/pogoplug_notes
You can use another NetBSD machine to install NetBSD to an SD card and
the kernel you just installed will use that as the root filesystem. A link
for a quick NetBSD installation how-to will come soon.