# $NetBSD: ARIES2_HOWTO.txt,v 1.1 2007/06/09 13:32:04 dsieger Exp $ This document describes setting up NetBSD on a Senao 5354AP1 Aries2 access point, which is based on the Atheros AP30 development board containing an AR5312 chip. Hardware configuration: ----------------------- AR5312 processor (MIPS4Kc core) running at 220MHz 8MB RAM 2MB SST 39VF160 flash onboard 10/100 ethernet onboard 802.11a wlan device onboard 802.11b/g wlan device external RS232 port (DB9) Caveat: ------- As shipped from Senao, these boxes have a stock vxworks bootloader in flash. I have not figured out how to safely update the flash without turning the box into a paperweight, so we will not be using the flash device, although a basic driver for it is provided. Requirements ------------ You will need a machine with a serial port and a matching that you can use to connect to the DB9 port on the Senao box. You may also need a null modem, depending on the configuration of the serial port on the host you use. You will also need a system that can serve files via NFS to host a root filesystem for this box. (See the Caveats about flash above. A memory disk system can be used, but very very little useful software can fit in the 8MB of RAM we have available, and even less in the 2MB flash.) You will also need a way to serve the kernel to the box over the network. The Senao unit can load kernels via either TFTP or FTP. TFTP is usually preferable, since it involves no username/password, and is simple enough that configuring it will probably not introduce any security holes in your host system. You will need a DHCP server that you can configure to supply necessary boot information for the unit. In particular, the root filesystem and initial IP configuration are gathered via DHCP. You will also need either a system that can build NetBSD software, or you will need to obtain prebuilt software from some other source. (Most of the software is available on ftp.NetBSD.org, for example.) Kernel Compilation ------------------ The AP30 kernel is part of the evbmips port of NetBSD. Unlike other evbmips machines, the AP30 (as with all Atheros WiSoCs) can only run in big-endian mode. So we will use the evbmips-eb port. (On ftp.NetBSD.org directory names are evbmips-mipseb.) To build a kernel, on a NetBSD system you can use the following command in a source tree that has been updated to contain the relevant sources (updated in -current as of June 7, 2006): ./build.sh -m evbmips-eb kernel=AP30 This will generate a kernel image for the AP30 in with the file name src/sys/arch/evbmips/compile/obj/AP30/netbsd That file should be placed somewhere where it can be located via tftp or FTP. For the purposes of demonstration, we will assume you copied that file to /tftpboot/ap30 on your TFTP server. Root Filesystem --------------- The root filesystem for our system can be prepared by downloading the "sets" from the ftp.NetBSD.org server. Make sure you use the evbmips-mipseb sets, as the little endian sets WILL NOT WORK. Only base.tgz and etc.tgz are absolutely necessary, but you might want to pick up the others while you are there. Normally it is sufficient to extract these into a directory that is being exported via NFS. The directory should be exported to no more than one Access Point (/etc in particular doesn't share well), and you probably want to allow read/write root access. (There are ways using memory disks to work around this to have read-only filesystems, but these techniques are beyond the scope of this document.) You may wish to perform additional configuration in the root filesystem, such as editing /etc/rc.conf. I also *highly* recommend creating a swap file and exporting that over NFS. As painfully slow as swapping over NFS is, its even more painful running out of RAM, which is really, really likely on this platform with only 8MB RAM. DHCP Configuration ------------------ You will need to configure DHCP to provide basic configuration parameters for your unit. Here is an example configuration entry that I use with ISC DHCP: host ap30 { hardware ethernet 00:02:6f:34:ea:30; fixed-address 192.168.251.17; filename "ap30"; option host-name "ap30"; option root-path "/export/ap30/root"; next-server 192.168.251.21; ddns-updates off; } My server (192.168.251.21) exports via NFS the root directory for my AP30 in /export/ap30/root. Note that I have my unit with a fixed IP address because it makes it easier to configure NFS permissions. It also make the vxworks configuration a bit simpler. Cabling ------- Connect the serial port of the AP30 to your terminal server or host running a terminal application. The default configuration is 115200 baud, 8 data bits, no parity, 1 stop bit. (115200,8n1) Connect the AP30's ethernet port to the network of the server. You'll need power, too, of course. Firmware Configuration ---------------------- Having taken care of all of the above, you're ready to configure the device. Go ahead and power the unit on, while you have the serial port connected. In your terminal window, press ESC. You should see something like this: ar531x rev 0x00005742 firmware startup... SDRAM TEST...PASSED Atheros AR5001AP default version 1.4 and then a countdown from about 4 seconds. If you press ESC while counting down, you will get a [Boot:] prompt. (Which may be cut of slightly, e.g. "oot:]" or something similar.) Press "?" to get help from the bootloader. Press "p" to print the current configuration. I recommend making a print out of this and saving, it case you ever want to restore the original configuration. We're not touching the flash, so in theory you could switch back and forth between NetBSD and the original firmware that the unit came with. After doing that, press "c" to change the parameters. Here's a sample of how I have my unit configured boot device : ae unit number : 0 processor number : 0 file name : ap30 inet on ethernet (e) : 192.168.251.17:0xffffff00 host inet (h) : 192.168.251.21 flags (f) : 0x84 This disables automatic booting, and will tftp a kernel file named "ap30" from my server at 192.168.251.21, and it will use 192.168.251.17/24 as my local IP address. The flags bit is interesting, because with that you can configure the unit to boot using tftp or ftp, select whether the unit autoboots or not, and even configure proxy arp or bootp. (I've not tested the last two.) Here are the flags from the help: Boot flags: 0x02 - load local system symbols 0x04 - don't autoboot 0x08 - quick autoboot (no countdown) 0x20 - disable login security 0x40 - use bootp to get boot parameters 0x80 - use tftp to get boot image 0x100 - use proxy arp 0x20 has no effect for NetBSD, but it allows you to login to the stock firmware (if you left the other boot configuration alone) without a password. I've not tried 0x08, and I don't recommend you do so either. Its quite likely that using that option will make it impossible to get back to the firmware later. You can use either TFTP or FTP, but I've had more luck with TFTP. FTP seems to occasionally have problems -- I suspect that the FTP code in the client isn't quite as robust as the TFTP code. Booting ------- Once you're done changing configuration, simply use the "@" command to boot using the selected configuration. There is no way to send boot options to the kernel at the moment. I.e. you cannot send "-v" or "-a" to the kernel. This is a limitation of the firmware, and to change it I would have to introduce an intermediate bootloader stage. For the moment, I have no plans to do this, as doing so would probably be of very limited use, and ultimately it would reduce the available memory, which on this platform is a particularly limited resource.