Fon Fon2100 aka. La Fonera

These are the first generation devices sold by Fon. There is experimental support for them in FreeWRT trunk. Installation without attached serial console is not possible.

Architecture: MIPS
Vendor: Atheros
Bootloader: RedBoot
System-On-Chip:  Atheros AR2315
CPU Speed: 183 MHz
Flash size: 8 MiB
RAM: 16 MiB (only 7 MiB enabled by default)
Wireless: Integrated Atheros 802.11b/g
Ethernet: 1x 100MBit/s
USB: no
Serial: yes
JTAG: no
NVRAM: no

Serial Console

Attaching a serial console is quite straight forward, the necessary pins are already soldered on board. Having it boot and display something is a bigger problem: the device won't boot with TX attached, so plug in the power cable with serial console detached. Then after a few seconds attach the serial console, default settings are 9600Baud, 8N1. Hit Ctrl-C to cancel auto bootup and enter RedBoot? prompt.

Installation

To transfer the kernel and rootfs you need a working TFTP setup attached to the ethernet port of the Fonera. RedBoot? allows either manual configuration of the interface or using dhcp, so having a dhcpd running is not a bad idea.

Start by killing the flash's content using:

RedBoot> fis init

you can verify the clean flash using 'fis list':

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xA8000000  0xA8000000  0x00030000  0x00000000
FIS directory     0xA87E0000  0xA87E0000  0x0000F000  0x00000000
RedBoot config    0xA87EF000  0xA87EF000  0x00001000  0x00000000

Now it's time to create some partitions and fill them with the images loaded via TFTP before. By default RedBoot? loads images into some free RAM area which can be addressed later using the variable '%{FREEMEMLO}'.

RedBoot> load -r -b %{FREEMEMLO} kernel-atheros-2.6-atheros-fon2100-jffs2.lzma
  [...]
RedBoot> fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7

The command 'fis create' by default takes the data loaded by the last 'load' command as input for a partition starting at the first free block of the flash space. important are the values for the RAM address (-r) and entry point (-e), these are linux specific and need to have exactly these values. The partition name 'vmlinux.bin.l7' is just what is configured within RedBoot? to default boot from, so this could also be changed.

After creating the first partition, some math is needed to calculate the free space for rootfs and fwcf. First look at the partition table:

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xA8000000  0xA8000000  0x00030000  0x00000000
vmlinux.bin.l7    0xA8030000  0x80041000  0x000A0000  0x80041000
FIS directory     0xA87E0000  0xA87E0000  0x0000F000  0x00000000
RedBoot config    0xA87EF000  0xA87EF000  0x00001000  0x00000000

The first free block is at 0xA8030000 + 0x000A0000 (address and size of vmlinux.bin.l7), i.e. 0xA80D0000. So total free space is 0xA87E0000 - 0xA80D0000 = 0x00710000. Because we have to keep two blocks of 0x10000 each for fwcf, the available space for the rootfs is actually 0x20000 Bytes less, i.e. 0x006F0000. Having these values in mind, we can load and flash the rootfs:

RedBoot> load -r -b %{FREEMEMLO} rootfs-atheros-2.6-atheros-fon2100.jffs2
  [...]
RedBoot> fis create -l 0x6F0000 rootfs
  [...]

Finally fwcf (input data doesn't matter) and the final reset:

RedBoot> fis create -b %{FREEMEMLO} -l 0x20000 fwcf
  [...]
RedBoot> reset

If everything went fine, the box should now load and execute the kernel:

+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:1d:90:b0
IP: 10.23.42.201/255.255.255.0, Gateway: 10.23.42.1
Default server: 10.23.42.1
                 
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug  7 2006
                 
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
                 
Board: ap51      
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 1.000 seconds - enter ^C to abort
RedBoot> fis load -l vmlinux.bin.l7
Image loaded from 0x80041000-0x80241000
RedBoot> exec    
Now booting linux kernel:
 Base address 0x80030000 Entry 0x80041000
 Cmdline :       
Linux version 2.6.23.12 (n0-1@nuty) (gcc version 3.4.4 (FreeWRT rev. 3661)) #3 Thu Sep 11 23:42:04 CEST 2008
CPU revision is: 00019064
Determined physical RAM map:
 memory: 01000000 @ 00000000 (usable)
Built 1 zonelists in Zone order.  Total pages: 4064
Kernel command line: console=ttyS0,9600 init=/etc/preinit rootfstype=jffs2 root=/dev/mtdblock2
Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 16kB, 4-way, linesize 16 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
PID hash table entries: 64 (order: 6, 256 bytes)
Using 92.000 MHz high precision timer.
console [ttyS0] enabled
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 13908k/16384k available (1661k kernel code, 2476k reserved, 234k data, 92k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
Radio config found at offset 0xf8(0x1f8)
Generic PHY: Registered new driver
Time: MIPS clocksource has been installed.
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0xb1100003 (irq = 37) is a 16550A
ICPlus IP175C: Registered new driver
eth0: Dropping NETIF_F_SG since no checksum feature.
eth0: Atheros AR231x: 00:18:84:1d:90:b0, irq 4
ar2313_eth_mii: probed
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:00)
cmdlinepart partition parsing not available
Searching for RedBoot partition table in spiflash at offset 0x7d0000
Searching for RedBoot partition table in spiflash at offset 0x7e0000
6 RedBoot partitions found on MTD device spiflash
Creating 6 MTD partitions on "spiflash":
0x00000000-0x00030000 : "RedBoot"
0x00030000-0x000d0000 : "vmlinux.bin.l7"
0x000d0000-0x007c0000 : "rootfs"
0x007c0000-0x007e0000 : "fwcf"
0x007e0000-0x007ef000 : "FIS directory"
0x007ef000-0x007f0000 : "RedBoot config"
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
eth0: Configuring MAC for full duplex
VFS: Mounted root (jffs2 filesystem) readonly.
Freeing unused kernel memory: 92k freed
Warning: unable to open an initial console.
Algorithmics/MIPS FPU Emulator v1.5
Notice: opened initial console now.
/etc/preinit[31]: reset_switch: not found
Press reset now to enter Failsafe!
init started:  BusyBox v1.4.2 (2008-09-10 14:45:29 CEST) multi-call binary
                 
Please press Enter to activate this console. wlan: 0.8.4.2 (0.9.3.3)
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 0.9.18.0 (AR5212, AR5312, RF2316, TX_DESC_SWAP)
ath_rate_sample: 1.2 (0.9.3.3)
ath_ahb: 0.9.4.5 (0.9.3.3)
ath_pci: switching rfkill capability off
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
wifi0: mac 11.0 phy 4.8 radio 7.0
wifi0: Use hw queue 1 for WME_AC_BE traffic
wifi0: Use hw queue 0 for WME_AC_BK traffic
wifi0: Use hw queue 2 for WME_AC_VI traffic
wifi0: Use hw queue 3 for WME_AC_VO traffic
wifi0: Use hw queue 8 for CAB traffic
wifi0: Use hw queue 9 for beacons
wifi0: Atheros 2315 WiSoC: mem=0xb0000000, irq=3
wlan: mac acl policy registered