README revision 1.1.2.2 1 1.1.2.2 yamt $NetBSD: README,v 1.1.2.2 2006/03/01 09:27:46 yamt Exp $
2 1.1.2.2 yamt
3 1.1.2.2 yamt NetBSD for the Linksys NSLU2 (a.k.a. "Slug")
4 1.1.2.2 yamt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 1.1.2.2 yamt
6 1.1.2.2 yamt The NSLU2 (Network Storage Link for USB 2.0 Disk Drives) is a small, cheap
7 1.1.2.2 yamt NAS device consisting of an Intel IXP420 (Xscale) CPU, a 10/100mbit Ethernet
8 1.1.2.2 yamt port, and two USB 2.0 ports. It has 32MB of SDRAM and 8MB of Flash memory,
9 1.1.2.2 yamt and runs RedBoot/Linux out of the box.
10 1.1.2.2 yamt
11 1.1.2.2 yamt It is eminently hackable.
12 1.1.2.2 yamt
13 1.1.2.2 yamt The guys over at http://www.nslu2-linux.org/ have done a good job of
14 1.1.2.2 yamt documenting just about every aspect of the hardware and original firmware.
15 1.1.2.2 yamt They also provide a custom "Unslung" Linux distribution to replace the
16 1.1.2.2 yamt original hobbled kernel/userland.
17 1.1.2.2 yamt
18 1.1.2.2 yamt Because of the amount of documentation available, and the fact that Slugs
19 1.1.2.2 yamt are available so cheaply (I paid just over UKP 50 for mine, brand new) I
20 1.1.2.2 yamt decided to buy one and port NetBSD to it.
21 1.1.2.2 yamt
22 1.1.2.2 yamt This is the result of that effort.
23 1.1.2.2 yamt
24 1.1.2.2 yamt Note: The Slug's IXP420 CPU runs in big-endian mode, so when building a
25 1.1.2.2 yamt cross toolchain you must pass "-m evbarm -a armeb" to build.sh.
26 1.1.2.2 yamt
27 1.1.2.2 yamt
28 1.1.2.2 yamt
29 1.1.2.2 yamt Current status
30 1.1.2.2 yamt ==============
31 1.1.2.2 yamt
32 1.1.2.2 yamt The following bits of Slug hardware are not (yet?) supported:
33 1.1.2.2 yamt
34 1.1.2.2 yamt - NPE Ethernet
35 1.1.2.2 yamt Someone will have to port Intel's IXP425 access library before this can
36 1.1.2.2 yamt be made to work. If that someone is you, the source code is available
37 1.1.2.2 yamt online here:
38 1.1.2.2 yamt
39 1.1.2.2 yamt http://www.intel.com/design/network/products/npfamily/ixp425.htm
40 1.1.2.2 yamt
41 1.1.2.2 yamt Look under "Tools & Software", then select "Register/Login" to download
42 1.1.2.2 yamt "Intel(R) IXP400 Software". Documentation is available in the
43 1.1.2.2 yamt "Technical Documents" section.
44 1.1.2.2 yamt
45 1.1.2.2 yamt The easiest option will be to download the non-crypto version of the
46 1.1.2.2 yamt Access Library. The crypto-enabled version requires a lot more form
47 1.1.2.2 yamt filling. The Slug's IXP420 has no crypto capabilities anyway.
48 1.1.2.2 yamt
49 1.1.2.2 yamt - Flash ROM
50 1.1.2.2 yamt You can write gzboot kernels (when support is added) to Flash using
51 1.1.2.2 yamt RedBoot, so all is not lost.
52 1.1.2.2 yamt
53 1.1.2.2 yamt - Buzzer
54 1.1.2.2 yamt In the absence of a decent API to expose the onboard buzzer to userland,
55 1.1.2.2 yamt this is not yet supported. I envisage using timer1 to generate an
56 1.1.2.2 yamt interrupt at the required rate (1-2KHz). The handler will toggle the
57 1.1.2.2 yamt buzzer GPIO pin. Obviously timer1 will be configured only when necessary
58 1.1.2.2 yamt as a 1-2KHz interrupt rate will sap a fair bit of CPU horsepower.
59 1.1.2.2 yamt
60 1.1.2.2 yamt Everything else is fully supported, including the power/reset buttons and
61 1.1.2.2 yamt disk activity/status LEDs.
62 1.1.2.2 yamt
63 1.1.2.2 yamt Non-hardware items on the TODO list include:
64 1.1.2.2 yamt
65 1.1.2.2 yamt - gzboot support.
66 1.1.2.2 yamt This needs to emulate a "vmlinuz" compressed Linux kernel image so that
67 1.1.2.2 yamt RedBoot will invoke the kernel from Flash at power-up.
68 1.1.2.2 yamt
69 1.1.2.2 yamt - Move the kernel link address closer to the start of SDRAM. We waste a
70 1.1.2.2 yamt little under 2MB with the current setup.
71 1.1.2.2 yamt
72 1.1.2.2 yamt - The clock runs slow. In ixp425_timer.c, COUNTS_PER_SEC is defined as
73 1.1.2.2 yamt 66666600 instead of 66666667. This, together with rounding errors, is
74 1.1.2.2 yamt almost certainly the cause.
75 1.1.2.2 yamt
76 1.1.2.2 yamt
77 1.1.2.2 yamt
78 1.1.2.2 yamt Getting NetBSD onto the NSLU2
79 1.1.2.2 yamt =============================
80 1.1.2.2 yamt
81 1.1.2.2 yamt Thanks to the efforts of the guys over at www.nslu2-linux.org, hacking the
82 1.1.2.2 yamt Slug is a pretty easy proposition, but some soldering skills are essential.
83 1.1.2.2 yamt For a first-time install of NetBSD (at least until someone comes up with a
84 1.1.2.2 yamt nice easy binary install image) you will almost certainly require access to
85 1.1.2.2 yamt the serial console. This means firing up your trusty soldering iron and
86 1.1.2.2 yamt hooking up a MAX3232 chip to your Slug. While your soldering iron is hot,
87 1.1.2.2 yamt you should seriously consider de-restricting your Slug's CPU core clock
88 1.1.2.2 yamt speed (133MHz stock, 266MHz de-restricted) by removing a single surface-
89 1.1.2.2 yamt mount resistor. Full instructions for both the these mods are on the above
90 1.1.2.2 yamt website.
91 1.1.2.2 yamt
92 1.1.2.2 yamt Once you have console access you can interrupt RedBoot's auto-boot process
93 1.1.2.2 yamt using CTRL-C. You are now in a position to download a NetBSD kernel into
94 1.1.2.2 yamt SDRAM.
95 1.1.2.2 yamt
96 1.1.2.2 yamt You will have to configure a TFTP server on a machine hooked up to the same
97 1.1.2.2 yamt Ethernet segment as the Slug. This machine's Ethernet interface must also
98 1.1.2.2 yamt be configured to have an address in the 192.168.0.0/24 subnet since the
99 1.1.2.2 yamt Slug's Ethernet *always* defaults to 192.168.0.1 when running RedBoot.
100 1.1.2.2 yamt There seems to be no way to alter this, so the best course of action will
101 1.1.2.2 yamt probably be to set up an alias on the server's interface. 192.168.0.2 is
102 1.1.2.2 yamt a good choice.
103 1.1.2.2 yamt
104 1.1.2.2 yamt Assuming you've done all that and have dropped a suitable kernel image
105 1.1.2.2 yamt into the TFTP directory, the following commands will load and run the
106 1.1.2.2 yamt kernel.
107 1.1.2.2 yamt
108 1.1.2.2 yamt redboot> ip_address -h 192.168.0.2
109 1.1.2.2 yamt redboot> load -r -b 0x200000 netbsd.bin
110 1.1.2.2 yamt redboot> go
111 1.1.2.2 yamt
112 1.1.2.2 yamt At this point your only real option is to mount the root filesystem from
113 1.1.2.2 yamt a USB disk device as the onboard Ethernet is not (yet?) supported. However,
114 1.1.2.2 yamt there's nothing to stop you using a USB-Ethernet interface...
115 1.1.2.2 yamt
116 1.1.2.2 yamt Note that the kernel will always report the CPU core clock speed as 266MHz
117 1.1.2.2 yamt even if your Slug's CPU clock is running at a stock 133MHz.
118 1.1.2.2 yamt
119 1.1.2.2 yamt
120 1.1.2.2 yamt
121 1.1.2.2 yamt Burning a NetBSD kernel into Flash
122 1.1.2.2 yamt ==================================
123 1.1.2.2 yamt
124 1.1.2.2 yamt TBD (waiting for gzboot support).
125 1.1.2.2 yamt
126