[BACK]Return to README CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / evbarm / nslu2

File: [cvs.NetBSD.org] / src / sys / arch / evbarm / nslu2 / README (download)

Revision 1.7, Sun Nov 22 19:09:15 2009 UTC (14 years, 4 months ago) by mbalmer
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, yamt-nfs-mp-base9, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base7, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, uebayasi-xip, tls-maxphys-base-20171202, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, thorpej-ifq-base, thorpej-ifq, thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, thorpej-altq-separation-base, thorpej-altq-separation, rmind-uvmplock-nbase, rmind-uvmplock-base, rmind-uvmplock, rmind-smpnet-nbase, rmind-smpnet-base, rmind-smpnet, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, nick-nhusb, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, matt-premerge-20091211, matt-nb8-mediatek-base, matt-nb8-mediatek, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, localcount-20160914, khorben-n900, jym-xensuspend-nbase, jym-xensuspend-base, jruoho-x86intr-base, jruoho-x86intr, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3, jdolecek-ncq-base, jdolecek-ncq, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, cherry-xenmp-base, cherry-xenmp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, bouyer-sunxi-drm-base, bouyer-sunxi-drm, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache, HEAD
Changes since 1.6: +2 -2 lines

more s/the the/the/

$NetBSD: README,v 1.7 2009/11/22 19:09:15 mbalmer Exp $

NetBSD for the Linksys NSLU2 (a.k.a. "Slug")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The NSLU2 (Network Storage Link for USB 2.0 Disk Drives) is a small, cheap
NAS device consisting of an Intel IXP420 (Xscale) CPU, a 10/100mbit Ethernet
port, and two USB 2.0 ports. It has 32MB of SDRAM and 8MB of Flash memory,
and runs RedBoot/Linux out of the box.

It is eminently hackable.

The guys over at http://www.nslu2-linux.org/ have done a good job of
documenting just about every aspect of the hardware and original firmware.
They also provide a custom "Unslung" Linux distribution to replace the
original hobbled kernel/userland.

Because of the amount of documentation available, and the fact that Slugs
are available so cheaply (I paid just over UKP 50 for mine, brand new) I
decided to buy one and port NetBSD to it.

This is the result of that effort.

Note: The Slug's IXP420 CPU runs in big-endian mode, so when building a
cross toolchain you must pass "-m evbarm -a armeb" to build.sh.



Current status
==============

The following bits of Slug hardware are not (yet?) supported:

 - Flash ROM
   You can write gzboot kernels (when support is added) to Flash using
   RedBoot, so all is not lost.

 - Buzzer
   In the absence of a decent API to expose the onboard buzzer to userland,
   this is not yet supported. I envisage using timer1 to generate an
   interrupt at the required rate (1-2 kHz). The handler will toggle the
   buzzer GPIO pin. Obviously timer1 will be configured only when necessary
   as a 1-2 kHz interrupt rate will sap a fair bit of CPU horsepower.

Everything else is fully supported, including the power/reset buttons and
disk activity/status LEDs.

Non-hardware items on the TODO list include:

 - gzboot support.
   The Slug's 8MB of Flash is split into 5 segments:

    1 0x50000000-0x5003ffff: RedBoot (with some additional bits at the end).
    2 0x50040000-0x5005ffff: Sysconf (used by the Linksys firmware).
    3 0x50060000-0x5015ffff: Self-extracting compressed kernel image.
    4 0x50160000-0x507dffff: Compressed ramdisk image.
    5 0x507e0000-0x507fffff: SerComm Flash trailer.

   Segments 1, 2, and 5 should be considered immutable. Segments 3 and 4
   have a 16-byte header, the first 4 bytes of which describe the length
   of the image contained in that segment (not including the header).

   On power-up, RedBoot copies the image in segment 3 into SDRAM at 0x01d00000,
   and the image in segment 4 into SDRAM at 0x01000000. RedBoot then jumps to
   0x01d00000. This is just a regular ARM Linux compressed kernel bootloader.

   So, we need to create a version of gzboot linked not at Flash address
   0x50060000, but at 0x01d00000 instead. The only downside is that it looks
   like the combined size of gzboot plus compressed kernel cannot exceed 1MB.

   To support an md(4) root filesystem, we will need to modify gzboot to
   decompress the ramdisk image from segment 4 and copy it to the correct
   place in the decompressed kernel image.

 - Move the kernel link address closer to the start of SDRAM. We waste a
   little under 2MB with the current setup.



Getting NetBSD onto the NSLU2
=============================

Thanks to the efforts of the guys over at www.nslu2-linux.org, hacking the
Slug is a pretty easy proposition, but some soldering skills are essential.
For a first-time install of NetBSD (at least until someone comes up with a
nice easy binary install image) you will almost certainly require access to
the serial console. This means firing up your trusty soldering iron and
hooking up a MAX3232 chip to your Slug. While your soldering iron is hot,
you should seriously consider de-restricting your Slug's CPU core clock
speed (133MHz stock, 266MHz de-restricted) by removing a single surface-
mount resistor. Full instructions for both these mods are on the above
website.

Once you have console access you can interrupt RedBoot's auto-boot process
using CTRL-C. You are now in a position to download a NetBSD kernel into
SDRAM.

You will have to configure a TFTP server on a machine hooked up to the same
Ethernet segment as the Slug. This machine's Ethernet interface must also
be configured to have an address in the 192.168.0.0/24 subnet since the
Slug's Ethernet *always* defaults to 192.168.0.1 when running RedBoot.
There seems to be no way to alter this, so the best course of action will
probably be to set up an alias on the server's interface. 192.168.0.2 is
a good choice.

Assuming you've done all that and have dropped a suitable kernel image
into the TFTP directory, the following commands will load and run the
kernel.

redboot> ip_address -h 192.168.0.2
redboot> load -r -b 0x200000 netbsd.bin
redboot> go

At this point you should mount a root filesystem from a USB disk device.
The ethernet is now supported, so you may also be able to use a NFS root.
USB Ethernet devices can also be used for a NFS root.

Note that the kernel will always report the CPU core clock speed as 266MHz
even if your Slug's CPU clock is running at a stock 133MHz.


Burning a NetBSD kernel into Flash
==================================

TBD (waiting for gzboot support).