README revision 1.1
11.1Sscw$NetBSD: README,v 1.1 2006/02/28 20:40:33 scw Exp $ 21.1Sscw 31.1SscwNetBSD for the Linksys NSLU2 (a.k.a. "Slug") 41.1Sscw~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 51.1Sscw 61.1SscwThe NSLU2 (Network Storage Link for USB 2.0 Disk Drives) is a small, cheap 71.1SscwNAS device consisting of an Intel IXP420 (Xscale) CPU, a 10/100mbit Ethernet 81.1Sscwport, and two USB 2.0 ports. It has 32MB of SDRAM and 8MB of Flash memory, 91.1Sscwand runs RedBoot/Linux out of the box. 101.1Sscw 111.1SscwIt is eminently hackable. 121.1Sscw 131.1SscwThe guys over at http://www.nslu2-linux.org/ have done a good job of 141.1Sscwdocumenting just about every aspect of the hardware and original firmware. 151.1SscwThey also provide a custom "Unslung" Linux distribution to replace the 161.1Sscworiginal hobbled kernel/userland. 171.1Sscw 181.1SscwBecause of the amount of documentation available, and the fact that Slugs 191.1Sscware available so cheaply (I paid just over UKP 50 for mine, brand new) I 201.1Sscwdecided to buy one and port NetBSD to it. 211.1Sscw 221.1SscwThis is the result of that effort. 231.1Sscw 241.1SscwNote: The Slug's IXP420 CPU runs in big-endian mode, so when building a 251.1Sscwcross toolchain you must pass "-m evbarm -a armeb" to build.sh. 261.1Sscw 271.1Sscw 281.1Sscw 291.1SscwCurrent status 301.1Sscw============== 311.1Sscw 321.1SscwThe following bits of Slug hardware are not (yet?) supported: 331.1Sscw 341.1Sscw - NPE Ethernet 351.1Sscw Someone will have to port Intel's IXP425 access library before this can 361.1Sscw be made to work. If that someone is you, the source code is available 371.1Sscw online here: 381.1Sscw 391.1Sscw http://www.intel.com/design/network/products/npfamily/ixp425.htm 401.1Sscw 411.1Sscw Look under "Tools & Software", then select "Register/Login" to download 421.1Sscw "Intel(R) IXP400 Software". Documentation is available in the 431.1Sscw "Technical Documents" section. 441.1Sscw 451.1Sscw The easiest option will be to download the non-crypto version of the 461.1Sscw Access Library. The crypto-enabled version requires a lot more form 471.1Sscw filling. The Slug's IXP420 has no crypto capabilities anyway. 481.1Sscw 491.1Sscw - Flash ROM 501.1Sscw You can write gzboot kernels (when support is added) to Flash using 511.1Sscw RedBoot, so all is not lost. 521.1Sscw 531.1Sscw - Buzzer 541.1Sscw In the absence of a decent API to expose the onboard buzzer to userland, 551.1Sscw this is not yet supported. I envisage using timer1 to generate an 561.1Sscw interrupt at the required rate (1-2KHz). The handler will toggle the 571.1Sscw buzzer GPIO pin. Obviously timer1 will be configured only when necessary 581.1Sscw as a 1-2KHz interrupt rate will sap a fair bit of CPU horsepower. 591.1Sscw 601.1SscwEverything else is fully supported, including the power/reset buttons and 611.1Sscwdisk activity/status LEDs. 621.1Sscw 631.1SscwNon-hardware items on the TODO list include: 641.1Sscw 651.1Sscw - gzboot support. 661.1Sscw This needs to emulate a "vmlinuz" compressed Linux kernel image so that 671.1Sscw RedBoot will invoke the kernel from Flash at power-up. 681.1Sscw 691.1Sscw - Move the kernel link address closer to the start of SDRAM. We waste a 701.1Sscw little under 2MB with the current setup. 711.1Sscw 721.1Sscw - The clock runs slow. In ixp425_timer.c, COUNTS_PER_SEC is defined as 731.1Sscw 66666600 instead of 66666667. This, together with rounding errors, is 741.1Sscw almost certainly the cause. 751.1Sscw 761.1Sscw 771.1Sscw 781.1SscwGetting NetBSD onto the NSLU2 791.1Sscw============================= 801.1Sscw 811.1SscwThanks to the efforts of the guys over at www.nslu2-linux.org, hacking the 821.1SscwSlug is a pretty easy proposition, but some soldering skills are essential. 831.1SscwFor a first-time install of NetBSD (at least until someone comes up with a 841.1Sscwnice easy binary install image) you will almost certainly require access to 851.1Sscwthe serial console. This means firing up your trusty soldering iron and 861.1Sscwhooking up a MAX3232 chip to your Slug. While your soldering iron is hot, 871.1Sscwyou should seriously consider de-restricting your Slug's CPU core clock 881.1Sscwspeed (133MHz stock, 266MHz de-restricted) by removing a single surface- 891.1Sscwmount resistor. Full instructions for both the these mods are on the above 901.1Sscwwebsite. 911.1Sscw 921.1SscwOnce you have console access you can interrupt RedBoot's auto-boot process 931.1Sscwusing CTRL-C. You are now in a position to download a NetBSD kernel into 941.1SscwSDRAM. 951.1Sscw 961.1SscwYou will have to configure a TFTP server on a machine hooked up to the same 971.1SscwEthernet segment as the Slug. This machine's Ethernet interface must also 981.1Sscwbe configured to have an address in the 192.168.0.0/24 subnet since the 991.1SscwSlug's Ethernet *always* defaults to 192.168.0.1 when running RedBoot. 1001.1SscwThere seems to be no way to alter this, so the best course of action will 1011.1Sscwprobably be to set up an alias on the server's interface. 192.168.0.2 is 1021.1Sscwa good choice. 1031.1Sscw 1041.1SscwAssuming you've done all that and have dropped a suitable kernel image 1051.1Sscwinto the TFTP directory, the following commands will load and run the 1061.1Sscwkernel. 1071.1Sscw 1081.1Sscwredboot> ip_address -h 192.168.0.2 1091.1Sscwredboot> load -r -b 0x200000 netbsd.bin 1101.1Sscwredboot> go 1111.1Sscw 1121.1SscwAt this point your only real option is to mount the root filesystem from 1131.1Sscwa USB disk device as the onboard Ethernet is not (yet?) supported. However, 1141.1Sscwthere's nothing to stop you using a USB-Ethernet interface... 1151.1Sscw 1161.1SscwNote that the kernel will always report the CPU core clock speed as 266MHz 1171.1Sscweven if your Slug's CPU clock is running at a stock 133MHz. 1181.1Sscw 1191.1Sscw 1201.1Sscw 1211.1SscwBurning a NetBSD kernel into Flash 1221.1Sscw================================== 1231.1Sscw 1241.1SscwTBD (waiting for gzboot support). 1251.1Sscw 126