OpenWrt Forum Archive

Topic: wrt400n, all atheros design, is this interesting?

The content of this topic has been archived between 16 Jan 2014 and 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I know new router designs by linksys aren't normally very interesting around here, but perhaps this one is interesting?  I have to admit, I'm not very familiar with atheros support...

http://www.smallnetbuilder.com/index.ph … ;Itemid=96

Internal Details

I already did a detailed review of the 400N's insides (along with the new WRT320N and WET610N). The 400N is a complete redesign of the 600N, using an all-Atheros design including an AR7161 600 MHz Wireless Network Processing Unit (WNPU), dual-band AR9220 and single-band AR9223 single-chip draft 11n radios, AR8216 10/100 switch, 32 MB of RAM and 8 MB of flash

netprince wrote:

I know new router designs by linksys aren't normally very interesting around here, but perhaps this one is interesting?  I have to admit, I'm not very familiar with atheros support...

We have support for several AR71xx based devices already, so this one would be interesting.

Regards,
Gabor

I ordered one via my work.  Will crack it open and hunt for serial when it arrives.

Great! I'm waiting for a bootlog then. wink

It also looks like it is Linux based since the firmaware is availible on Linksys GPL site.

According to SmallNetBuilder who have reviewed the device the performance should be really good. It's a shame though that it don't have an USB port.

The linksys board appears to be a very slightly modified reference design by U-Media. They basically swapped out the gig switch for a 10/100 and removed the USB port.

It should be running U-Boot and Linux.

It's a fast sucker, that's for sure.

Ok, I have finally found a few minutes to rip open this router.  I managed to break everyone of the plastic clips.  I think the serial port is fairly well marked.  I'll try to get some high res photos later as well as some dumps...

(Last edited by netprince on 8 Apr 2009, 19:16)

Looking forward for it smile

This looks like the best thing since sliced bread! smile I wish I could get my hands on one of those...

Anybody know where I can buy one in Europe?

Alright, here is the boot log.  I will post the pictures later tonight, dinnertime now...

þ

U-Boot 1.1.4 (Oct 22 2008 - 12:35:32)

AP94 (ar7100) U-boot 0.0.12
DRAM:  b8050000: 0xc0140180
32 MB
Top of RAM usable for U-Boot at: 82000000
Reserving 4308k for U-Boot at: 81bc8000
Reserving 192k for malloc() at: 81b98000
Reserving 44 Bytes for Board Info at: 81b97fd4
Reserving 36 Bytes for Global Data at: 81b97fb0
Reserving 128k for boot params() at: 81b77fb0
Stack Pointer at: 81b77f98
Now running in RAM - U-Boot at: 81bc8000
id read 0x100000ff
flash size 8MB, sector count = 128
Flash:  8 MB
In:    serial
Out:   serial
Err:   serial
Net:   ag7100_enet_initialize...
No valid address in Flash. Using fixed address
eth0: 00:03:7f:09:0b:ad
eth0 up
No valid address in Flash. Using fixed address
eth1: 00:03:7f:09:0b:ad
eth1 up
eth0, eth1
Press CTRL+C to stop autoboot:  0
## Booting image at bf040000 ...
   Image Name:   Linux Kernel Image
   Created:      2008-12-24   4:42:08 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    886355 Bytes = 865.6 kB
   Load Address: 80002000
   Entry Point:  8026c000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8026c000) ...
## Giving linux memsize in bytes, 33554432

Starting kernel ...

Linux version 2.6.15--LSDK-7.3.0.268 (marmot@localhost.localdomain) (gcc version 3.4.4) #1 Wed Dec 24 12:14:33 CST 2008
flash_size passed from bootloader = 8
arg 1: console=ttyS0,115200
arg 2: root=31:03
arg 3: rootfstype=squashfs
arg 4: init=/sbin/init
arg 5: mtdparts=ar7100-nor0:192k(uboot),64k(env),1280k(linux),6336k(rootfs),64k(nvram),64k(factory),128k(language),64k(caldata)
CPU revision is: 00019374
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Built 1 zonelists
Kernel command line: console=ttyS0,115200 root=31:03 rootfstype=squashfs init=/sbin/init mtdparts=ar7100-nor0:192k(uboot),64k(env),1280k(linux),6336k(rootfs),64k(nvram),64k(factory),128k(language),64k(caldata)
Primary instruction cache 64kB, physically tagged, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, linesize 32 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).
Cache parity protection disabled
PID hash table entries: 256 (order: 8, 4096 bytes)
Using 340.000 MHz high precision timer.
Console: colour dummy device 80x25
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 29476k/32768k available (2060k kernel code, 3276k reserved, 407k data, 152k init, 0k highmem)
Mount-cache hash table entries: 512
Checking for 'wait' instruction...  available.
NET: Registered protocol family 16
AR7100 GPIOC major 0
squashfs: version 3.1 includes LZMA decompression support (2006/08/29) Phillip Lougher
Initializing Cryptographic API
io scheduler noop registered
io scheduler deadline registered
Serial: 8250/16550 driver $Revision: #1 $ 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x0 (irq = 19) is a 16550A
RAMDISK driver initialized: 1 RAM disks of 1024K size 1024 blocksize
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
PPP MPPE Compression module registered
NET: Registered protocol family 24
8 cmdlinepart partitions found on MTD device ar7100-nor0
Creating 8 MTD partitions on "ar7100-nor0":
0x00000000-0x00030000 : "uboot"
0x00030000-0x00040000 : "env"
0x00040000-0x00180000 : "linux"
0x00180000-0x007b0000 : "rootfs"
0x007b0000-0x007c0000 : "nvram"
0x007c0000-0x007d0000 : "factory"
0x007d0000-0x007f0000 : "language"
0x007f0000-0x00800000 : "caldata"
u32 classifier
    Perfomance counters on
    OLD policer on
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
ip_conntrack version 2.4 (256 buckets, 2048 max) - 224 bytes per conntrack
init NAT GRE
ip_conntrack_rtsp v0.6.21 loading
ip_nat_rtsp v0.6.21 loading
ip_ct_h323: init success
ip_conntrack_pptp version 3.0 loaded
ip_nat_h323: init success
ip_nat_pptp version 3.0 loaded
ip_tables: (C) 2000-2002 Netfilter core team
ipt_AUTOFW loading
ipt_trigger : register proc success
ipt_time loading
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 10
lo: Disabled Privacy Extensions
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 152k freed
Warning: unable to open an initial console.
waitpid: No child processes
vconfig config_loopback, route: No child processes
waitpid: No child processes
brctl addbr br0: No child processes
et0macaddr 00:23:69:73:3D:6B
SIOCSIFHWADDRwaitpid: No child processes
lan_config hw ether up: No child processes
waitpid: No child processes
ifconfig, br0: No child processes
waitpid: No child processes
brctl addbr br0: No child processes
ARPING to 192.168.1.1 from 192.168.1.1 via br0
Sent 1 probes (1waitpid: No child processes
wan_deconfig: No child processes
waitpid: No child processes
wan_config ether fail: No child processes
waitpid: No child processes
wan_config mtu up: No child processes
athstats
80211stats
wlanconfig
pktlogconf
pktlogdump
radartool
ret is 0, ssid tester2, new_ssid tester2
ret is 0, ssid tester5, new_ssid tester5
Args: 1
Creating ap for tester2 on
Added ath0 mode master
The command noedgech needs exactly 1 argument(s)...
Invalid command : ampdumin
Created ath0 mode ap for tester2
lo        no wireless extensions.

sit0      no wireless extensions.

ip6tnl0   no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

br0       no wireless extensions.

wifi0     no wireless extensions.

wifi1     no wireless extensions.

arping: bind
Error for wireless request "Minimum RTS Threshold should be 256 bytes" (8B22) :
    invalid argument "0".
Modules already loaded
Creating ap for tester5 on
Added ath1 mode master
The command noedgech needs exactly 1 argument(s)...
Invalid command : ampdumin
Created ath1 mode ap for tester5
lo        no wireless extensions.

sit0      no wireless extensions.

ip6tnl0   no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

br0       no wireless extensions.

wifi0     no wireless extensions.

wifi1     no wireless extensions.

arping: bind
Error for wireless request "Minimum RTS Threshold should be 256 bytes" (8B22) :
    invalid argument "0".
wl0_macaddr 00:23:69:73:3D:6A
wl1_macaddr 00:23:69:73:3D:69
iptables: waitpid: No child processes
/bin/shwaitpid: No child processes
g_wl_interface is ath0


BusyBox v1.01 (2008.12.24-04:42+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

/ # (nvram_unset)exclusive zone
shared_nvram->writing 1
l2_packet_receive - recvfrom: Network is down
l2_packet_receive - recvfrom: Network is down

Here are the high res images, sorry for not creating thumbnails...


http://www.psyc.vt.edu/openwrt/wrt400n/IMG_1091.JPG
http://www.psyc.vt.edu/openwrt/wrt400n/IMG_1089.JPG
http://www.psyc.vt.edu/openwrt/wrt400n/IMG_1092.JPG
http://www.psyc.vt.edu/openwrt/wrt400n/IMG_1093.JPG
http://www.psyc.vt.edu/openwrt/wrt400n/IMG_1094.JPG
http://www.psyc.vt.edu/openwrt/wrt400n/IMG_1095.JPG
http://www.psyc.vt.edu/openwrt/wrt400n/IMG_1096.JPG
http://www.psyc.vt.edu/openwrt/wrt400n/IMG_1101.JPG

(Last edited by netprince on 9 Apr 2009, 00:06)

More possibly interesting bits?

# uname -a
Linux (none) 2.6.15--LSDK-7.3.0.268 #1 Wed Dec 24 12:14:33 CST 2008 mips unknown
# ps
  PID  Uid     VmSize Stat Command
    1 root       1060 S   /sbin/init
    2 root            SWN [ksoftirqd/0]
    3 root            SW< [events/0]
    4 root            SW< [khelper]
    5 root            SW< [kthread]
    6 root            SW< [kblockd/0]
    7 root            SW  [pdflush]
    8 root            SW  [pdflush]
   10 root            SW< [aio/0]
    9 root            SW  [kswapd0]
   11 root            SW  [mtdblockd]
   13 root        340 S   /sbin/syslogd -n
 1054 root        632 S   /bin/httpd
 1064 root        640 S   /bin/udhcpd /tmp/udhcpd.conf
 1067 nobody      348 S   dnsmasq
 1075 root        488 S   /bin/sh
 1077 root        280 S   lld2d br0
 1080 root        612 S   hostapd /tmp/topology.conf
 1086 root        288 S   /sbin/hnapssdp
 1091 root        348 R   ps
# cat pci
PCI devices found:
  Bus  0, device   0, function  0:
    Class ffff: PCI device 168c:0029 (rev 255).
      IRQ 48.
      Master Capable.  Latency=168.
      Non-prefetchable 32 bit memory at 0x10000000 [0x1000ffff].
  Bus  0, device   1, function  0:
    Class 0280: PCI device 168c:0029 (rev 1).
      IRQ 49.
      Master Capable.  Latency=168.
      Non-prefetchable 32 bit memory at 0x10010000 [0x1001ffff].
# cat cpuinfo
system type             : Atheros AR7100 (hydra)
processor               : 0
cpu model               : MIPS 24K V7.4
BogoMIPS                : 451.58
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 16
extra interrupt vector  : yes
hardware watchpoint     : yes
ASEs implemented        : mips16
VCED exceptions         : not available
VCEI exceptions         : not available
# lsmod
Module                  Size  Used by    Tainted: P
wlan_scan_ap 9408 2 - Live 0xc005e000
ath_pktlog 15424 0 - Live 0xc0059000
wlan_me 10176 0 - Live 0xc0026000
wlan_acl 4576 2 - Live 0xc004f000
wlan_wep 6112 0 - Live 0xc004c000
wlan_tkip 13408 2 - Live 0xc002e000
wlan_ccmp 8608 0 - Live 0xc002a000
wlan_xauth 1344 0 - Live 0xc0024000
ath_pci 60224 0 - Live 0xc0062000
ath_dev 133616 2 ath_pktlog,ath_pci, Live 0xc0112000
ath_dfs 38976 1 ath_dev, Live 0xc0041000
ath_rate_atheros 49424 2 ath_pktlog,ath_dev, Live 0xc0033000
wlan 262048 12 wlan_scan_ap,ath_pktlog,wlan_me,wlan_acl,wlan_wep,wlan_tkip,wlan_ccmp,wlan_xauth,ath_pci,ath_dev, Live 0xc00d1000
ath_hal 315776 6 ath_pktlog,ath_pci,ath_dev,ath_dfs, Live 0xc0082000
WRT400N_gpio_mod 4640 0 - Live 0xc000f000
WRT400N_led_wsc_mod 5472 0 - Live 0xc000c000
ag7100_mod 32624 0 - Live 0xc001b000
# cat cmdline
console=ttyS0,115200 root=31:03 rootfstype=squashfs init=/sbin/init mtdparts=ar7100-nor0:192k(uboot),64k(env),1280k(linux),6336k(rootfs),64k(nvram),64k(factory),128k(language),64k(caldata)
# cat mtd
dev:    size   erasesize  name
mtd0: 00030000 00010000 "uboot"
mtd1: 00010000 00010000 "env"
mtd2: 00140000 00010000 "linux"
mtd3: 00630000 00010000 "rootfs"
mtd4: 00010000 00010000 "nvram"
mtd5: 00010000 00010000 "factory"
mtd6: 00020000 00010000 "language"
mtd7: 00010000 00010000 "caldata"

Let me know if there is something else anyone wants to see...

u-boot help, I'm just tooling around here, not sure what to do next...

Press CTRL+C to stop autoboot:  0
ar7100> help
?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
echo    - echo args to console
erase   - erase FLASH memory
exit    - exit script
flinfo  - print FLASH memory information
go      - start application at address 'addr'
help    - print online help
iminfo  - print header information for application image
imls    - list all images found in flash
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mii     - MII utility commands
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
pci     - list and access PCI Configuration Space
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
progmac - Set ethernet MAC addresses
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
tftpd   - tftp server
version - print monitor version
autoscr - run script from memory
ar7100>

So am I missing something?  Is this thing junk?

I've been trying to figure out how to try a tftpboot, any pointers?

Hi,

netprince wrote:

So am I missing something?  Is this thing junk?

This  thing is not junk, although it is just not yet supported.

I've been trying to figure out how to try a tftpboot, any pointers?

Well, if the tftpboot is working in u-boot then you can try an image without flashing anything.
You should build a ramdisk image, then try:

setenv serverip 192.168.1.254; setenv ipaddr 192.168.1.1
tftp 0xa0800000 openwrt-ar71xx-uImage-lzma.bin; bootm 0xa0800000

Regards,
Gabor

Thanks for that.  The tftpboot does seem to work:

ar7100> setenv serverip 192.168.1.2
ar7100> setenv ipaddr 192.168.1.1
ar7100> tftpboot 0xa0800000 openwrt-ar71xx-uImage-lzma.bin
Using eth0 device
TFTP from server 192.168.1.2; our IP address is 192.168.1.1
Filename 'openwrt-ar71xx-uImage-lzma.bin'.
Load address: 0xa0800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #############################
done
Bytes transferred = 2474937 (25c3b9 hex)
ar7100> bootm 0xa0800000
## Booting image at a0800000 ...
   Image Name:   MIPS OpenWrt Linux-2.6.28.9
   Created:      2009-04-09  20:08:11 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    2474873 Bytes =  2.4 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 33554432

Starting kernel ...

Linux version 2.6.28.9 (psycadmin@psycadmin-desktop) (gcc version 4.1.2) #1 Thu Apr 9 16:08:0                               4 EDT 2009
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2 (id:0xaa), CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MHz
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00002000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200 init=/etc/                               preinit
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000000
Readback ErrCtl register=00000000
PID hash table entries: 128 (order: 7, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 28048k/32768k available (1819k kernel code, 4720k reserved, 331k data, 1792k init, 0k                                highmem)
SLUB: Genslabs=6, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
Mount-cache hash table entries: 512
net_namespace: 480 bytes
NET: Registered protocol family 16
MIPS: machine is Generic AR71xx board
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs Apr  9 2009 16:06:00 Installing.
msgmni has been set to 54
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
Atheros AR71xx SPI Controller driver version 0.2.2
Atheros AR71xx hardware watchdog driver version 0.1.0
TCP vegas registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Freeing unused kernel memory: 1792k freed
Algorithmics/MIPS FPU Emulator v1.5
[sighandler]: No more events to be processed, quitting.
[cleanup]: Waiting for children.
[cleanup]: All children terminated.
- preinit -
Press CTRL-C for failsafe

Please press Enter to activate this console. cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US
        (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
        (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
        (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: US
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
nf_conntrack version 0.5.0 (512 buckets, 2048 max)
gpio-buttons driver version 0.1.1



BusyBox v1.11.3 (2009-04-09 15:52:25 EDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge, r15171) -------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/#

Not much available via ifconfig:

root@OpenWrt:/lib/modules/2.6.28.9# ifconfig -a
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Will play around with it more later...

How do I include the ag71xx driver in the firmware?  I am not seeing it in dmesg.  I also cant seem to find it in menuconfig.  I am using the ar71xx/ar913x target, and the default profile (no wifi) profile.  Perhaps its included but not correctly detecting the switch?  Is there a way to tell if its in the kernel?

root@OpenWrt:/proc/sys# dmesg
Linux version 2.6.28.9 (psycadmin@psycadmin-desktop) (gcc version 4.1.2) #1 Thu Apr 9 16:08:04 EDT 2009
prom: fw_arg0=00000006, fw_arg1=a1b77fb0, fw_arg2=a1b78470, fw_arg3=00000008
MyLoader: sysp=aaaa5554, boardp=aaaa5554, parts=aaaa5554
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2 (id:0xaa), CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MHz
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00002000
On node 0 totalpages: 8192
free_area_init_node: node 0, pgdat 80277c00, node_mem_map 81000000
  Normal zone: 64 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 8128 pages, LIFO batch:0
  Movable zone: 0 pages used for memmap
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200 init=/etc/preinit
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000000
Readback ErrCtl register=00000000
PID hash table entries: 128 (order: 7, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 28048k/32768k available (1819k kernel code, 4720k reserved, 331k data, 1792k init, 0k highmem)
SLUB: Genslabs=6, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
Mount-cache hash table entries: 512
net_namespace: 480 bytes
NET: Registered protocol family 16
MIPS: machine is Generic AR71xx board
NET: Registered protocol family 2
Switched to high resolution mode on CPU 0
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs Apr  9 2009 16:06:00 Installing.
msgmni has been set to 54
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
Atheros AR71xx SPI Controller driver version 0.2.2
Atheros AR71xx hardware watchdog driver version 0.1.0
ar71xx-wdt: timeout=15 secs (max=25)
TCP vegas registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Freeing unused kernel memory: 1792k freed
Algorithmics/MIPS FPU Emulator v1.5
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US
        (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
        (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
        (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: US
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
nf_conntrack version 0.5.0 (512 buckets, 2048 max)
gpio-buttons driver version 0.1.1
ar71xx-wdt: enabling watchdog timer

Been looking at the build log, it looks like the ag71xx driver was included in my build.  I noticed the 'cat iomem' doesn't list any mii_ctrl devices like yapoo listed here: http://forum.openwrt.org/viewtopic.php?id=17975

root@OpenWrt:/proc# cat iomem
00000000-01ffffff : System RAM
  00060000-00226c4b : Kernel code
  00226c4c-00279b9f : Kernel data
18020000-1802ffff : serial8250.0
  18020000-1802001f : serial
18040000-1804ffff : AR71xx GPIO controller
root@OpenWrt:/proc# cat ioports
root@OpenWrt:/proc#

I'm going to pull the GPL sources and see if that helps...

(Last edited by netprince on 15 Apr 2009, 19:24)

I now have ethernet working, and I also copied in the settings for LEDs, Buttons, and MTD partitions and tried to create the correct support files.  I have tested ethernet, LEDs, and buttons, they are working fine. 

I suppose the next step is to flash the firmware onto the chip?  Whats the trick for doing that in u-boot?

diff -urN target.old/linux/ar71xx/base-files/lib/ar71xx.sh target/linux/ar71xx/base-files/lib/ar71xx.sh
--- target.old/linux/ar71xx/base-files/lib/ar71xx.sh    2009-04-22 12:12:15.000000000 -0400
+++ target/linux/ar71xx/base-files/lib/ar71xx.sh    2009-04-23 10:46:04.000000000 -0400
@@ -52,6 +52,9 @@
     *WNR2000)
         name="wnr2000"
         ;;
+    *WRT400N)
+        name="wrt400n"
+        ;;
     *)
         name="generic"
         ;;
diff -urN target.old/linux/ar71xx/config-2.6.28 target/linux/ar71xx/config-2.6.28
--- target.old/linux/ar71xx/config-2.6.28    2009-04-22 12:12:15.000000000 -0400
+++ target/linux/ar71xx/config-2.6.28    2009-04-22 15:23:37.000000000 -0400
@@ -18,6 +18,7 @@
 CONFIG_AR71XX_MACH_TL_WR941ND=y
 CONFIG_AR71XX_MACH_UBNT=y
 CONFIG_AR71XX_MACH_WNR2000=y
+CONFIG_AR71XX_MACH_WRT400N=y
 CONFIG_AR71XX_MACH_WP543=y
 CONFIG_AR71XX_WDT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
diff -urN target.old/linux/ar71xx/files/arch/mips/ar71xx/Kconfig target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig
--- target.old/linux/ar71xx/files/arch/mips/ar71xx/Kconfig    2009-04-22 12:12:15.000000000 -0400
+++ target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig    2009-04-23 10:44:01.000000000 -0400
@@ -39,6 +39,10 @@
     bool "NETGEAR WNR2000 board support"
     default y
 
+config AR71XX_MACH_WRT400N
+    bool "Linksys WRT400N board support"
+    default y
+
 config AR71XX_MACH_MZK_W04NU
     bool "Planex MZK-W04NU board support"
     default y
diff -urN target.old/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt400n.c target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt400n.c
--- target.old/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt400n.c    1969-12-31 19:00:00.000000000 -0500
+++ target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt400n.c    2009-04-22 15:20:55.000000000 -0400
@@ -0,0 +1,157 @@
+/*
+ *  Linksys wrt400n board support
+ *
+ *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2009 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/platform_device.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/input.h>
+
+#include <asm/mips_machine.h>
+#include <asm/mach-ar71xx/ar71xx.h>
+
+#include "devices.h"
+
+#define WRT400N_GPIO_LED_ORANGE    5
+#define WRT400N_GPIO_LED_GREEN    4
+#define WRT400N_GPIO_LED_POWER    1
+#define WRT400N_GPIO_LED_WLAN    0
+
+#define WRT400N_GPIO_BTN_RESET    8
+#define WRT400N_GPIO_BTN_WLSEC    3
+
+#define WRT400N_BUTTONS_POLL_INTERVAL    20
+
+#ifdef CONFIG_MTD_PARTITIONS
+static struct mtd_partition wrt400n_partitions[] = {
+    {
+        .name        = "uboot",
+        .offset        = 0,
+        .size        = 0x030000,
+        .mask_flags    = MTD_WRITEABLE,
+    } , {
+        .name        = "env",
+        .offset        = 0x030000,
+        .size        = 0x010000,
+    } , {
+        .name        = "linux",
+        .offset        = 0x040000,
+        .size        = 0x140000,
+    } , {
+        .name        = "rootfs",
+        .offset        = 0x180000,
+        .size        = 0x630000,
+    } , {
+        .name        = "nvram",
+        .offset        = 0x7b0000,
+        .size        = 0x010000,
+    } , {
+        .name        = "factory",
+        .offset        = 0x7c0000,
+        .size        = 0x010000,
+    } , {
+        .name        = "language",
+        .offset        = 0x7d0000,
+        .size        = 0x020000,
+    } , {
+        .name        = "caldata",
+        .offset        = 0x7f0000,
+        .size        = 0x010000,
+    }
+};
+#endif /* CONFIG_MTD_PARTITIONS */
+
+static struct flash_platform_data wrt400n_flash_data = {
+#ifdef CONFIG_MTD_PARTITIONS
+        .parts          = wrt400n_partitions,
+        .nr_parts       = ARRAY_SIZE(wrt400n_partitions),
+#endif
+};
+
+static struct spi_board_info wrt400n_spi_info[] = {
+    {
+        .bus_num    = 0,
+        .chip_select    = 0,
+        .max_speed_hz    = 25000000,
+        .modalias    = "m25p80",
+        .platform_data  = &wrt400n_flash_data,
+    }
+};
+
+static struct gpio_led wrt400n_leds_gpio[] __initdata = {
+    {
+        .name        = "wrt400n:green:status",
+        .gpio        = WRT400N_GPIO_LED_GREEN,
+        .active_low    = 1,
+    }, {
+        .name        = "wrt400n:amber:aoss",
+        .gpio        = WRT400N_GPIO_LED_ORANGE,
+        .active_low    = 1,
+    }, {
+        .name        = "wrt400n:green:wlan",
+        .gpio        = WRT400N_GPIO_LED_WLAN,
+        .active_low    = 1,
+    }, {
+        .name        = "wrt400n:green:power",
+        .gpio        = WRT400N_GPIO_LED_POWER,
+        .active_low    = 1,
+    }
+};
+
+static struct gpio_button wrt400n_gpio_buttons[] __initdata = {
+    {
+        .desc        = "reset",
+        .type        = EV_KEY,
+        .code        = BTN_0,
+        .threshold    = 5,
+        .gpio        = WRT400N_GPIO_BTN_RESET,
+        .active_low    = 1,
+    } , {
+        .desc        = "wlsec",
+        .type        = EV_KEY,
+        .code        = BTN_1,
+        .threshold    = 5,
+        .gpio        = WRT400N_GPIO_BTN_WLSEC,
+        .active_low    = 1,
+    }
+};
+
+static void __init wrt400n_setup(void)
+{
+    ar71xx_add_device_mdio(0x0);
+
+    ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+    ar71xx_eth0_data.phy_mask = 0xf;
+    ar71xx_eth0_data.speed = SPEED_100;
+    ar71xx_eth0_data.duplex = DUPLEX_FULL;
+    ar71xx_eth0_data.has_ar8216 = 1;
+
+    ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+    ar71xx_eth1_data.phy_mask = 0x10;
+
+    ar71xx_add_device_eth(0);
+    ar71xx_add_device_eth(1);
+
+    ar71xx_add_device_spi(NULL, wrt400n_spi_info,
+                  ARRAY_SIZE(wrt400n_spi_info));
+
+    ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wrt400n_leds_gpio),
+                    wrt400n_leds_gpio);
+
+    ar71xx_add_device_gpio_buttons(-1, WRT400N_BUTTONS_POLL_INTERVAL,
+                    ARRAY_SIZE(wrt400n_gpio_buttons),
+                    wrt400n_gpio_buttons);
+
+    ar91xx_add_device_wmac();
+}
+
+MIPS_MACHINE(AR71XX_MACH_WRT400N, "Linksys WRT400N", wrt400n_setup);
diff -urN target.old/linux/ar71xx/files/arch/mips/ar71xx/Makefile target/linux/ar71xx/files/arch/mips/ar71xx/Makefile
--- target.old/linux/ar71xx/files/arch/mips/ar71xx/Makefile    2009-04-22 12:12:15.000000000 -0400
+++ target/linux/ar71xx/files/arch/mips/ar71xx/Makefile    2009-04-22 15:21:49.000000000 -0400
@@ -23,3 +23,4 @@
 obj-$(CONFIG_AR71XX_MACH_UBNT)        += mach-ubnt.o
 obj-$(CONFIG_AR71XX_MACH_WNR2000)    += mach-wnr2000.o
 obj-$(CONFIG_AR71XX_MACH_WP543)        += mach-wp543.o
+obj-$(CONFIG_AR71XX_MACH_WRT400N)    += mach-wrt400n.o
diff -urN target.old/linux/ar71xx/files/arch/mips/ar71xx/prom.c target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
--- target.old/linux/ar71xx/files/arch/mips/ar71xx/prom.c    2009-04-22 12:12:15.000000000 -0400
+++ target/linux/ar71xx/files/arch/mips/ar71xx/prom.c    2009-04-22 15:44:07.000000000 -0400
@@ -78,6 +78,9 @@
         .name        = "WNR2000",
         .mach_type    = AR71XX_MACH_WNR2000,
     }, {
+        .name        = "WRT400N",
+        .mach_type    = AR71XX_MACH_WRT400N,
+    }, {
         .name        = "PB42",
         .mach_type    = AR71XX_MACH_PB42,
     }, {
diff -urN target.old/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h
--- target.old/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h    2009-04-22 12:12:15.000000000 -0400
+++ target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h    2009-04-23 09:39:44.000000000 -0400
@@ -130,6 +130,7 @@
 #define AR71XX_MACH_TL_WR941ND    16    /* TP-LINK TL-WR941ND */
 #define AR71XX_MACH_UBNT_RSPRO    17    /* Ubiquiti RouterStation Pro */
 #define AR71XX_MACH_AP81    18    /* Atheros AP81 */
+#define AR71XX_MACH_WRT400N    19    /* Linksys WRT400N */
 
 /*
  * PLL block
diff -urN target.old/linux/ar71xx/files/drivers/net/ag71xx/Kconfig target/linux/ar71xx/files/drivers/net/ag71xx/Kconfig
--- target.old/linux/ar71xx/files/drivers/net/ag71xx/Kconfig    2009-04-22 12:12:15.000000000 -0400
+++ target/linux/ar71xx/files/drivers/net/ag71xx/Kconfig    2009-04-23 10:49:42.000000000 -0400
@@ -17,7 +17,7 @@
     bool "special support for the Atheros AR8216 switch"
     depends on AG71XX
     default n
-    default y if AR71XX_MACH_WNR2000 || AR71XX_MACH_MZK_W04NU
+    default y if AR71XX_MACH_WNR2000 || AR71XX_MACH_MZK_W04NU || AR71XX_MACH_WRT400N
     help
       Say 'y' here if you want to enable special support for the
       Atheros AR8216 switch found on some boards.

Hi,

netprince wrote:

I now have ethernet working, and I also copied in the settings for LEDs, Buttons, and MTD partitions and tried to create the correct support files.  I have tested ethernet, LEDs, and buttons, they are working fine.

Congratulations.

I suppose the next step is to flash the firmware onto the chip?  Whats the trick for doing that in u-boot?

Here are some info, although it is for a different board.

diff -urN target.old/linux/ar71xx/base-files/lib/ar71xx.sh target/linux/ar71xx/base-files/lib/ar71xx.sh
--- target.old/linux/ar71xx/base-files/lib/ar71xx.sh    2009-04-22 12:12:15.000000000 -0400
+++ target/linux/ar71xx/base-files/lib/ar71xx.sh    2009-04-23 10:46:04.000000000 -0400
<...>

Can you send this patch for me via e-mail?

Regards,
Gabor

Any updates on this or other attempts on getting OpenWRT running on the WRT400N?

Partial support was added to trunk.  (flash partitions, LEDs, and buttons)  I'm still working on the image Makefile so that a usable image is created.  Looks like linksys didn't include the source for the image creation utility, so it may not be possible to flash via the stock web interface.

Is that a JTAG connector next to serial?  Certainly looks like it.

Interesting the serial is 4-pins, guess they have finally dropped the NC pin that has been hanging around forever.

Think it's worth ordering?  I have a WRT610n that is sitting on the shelf collecting dust at the moment.
I'd like a new project to fiddle with if there is SOME hope of getting at least basic 802.11abg working on it.
I'd gladly settle for at least basic working dual-band since I have 802.11abg clients in my house
no 802.11n as yet nor as yet any particular drive to upgrade.  I prefer 802.11a for lower interference
from neighbors so my clients connect preferentially to the 802.11a SSID.

I haven't even gotten to try ath9k yet, will try after my next image build.