1 (edited by cmtsij 2013-04-18 11:30:28)

Topic: Add support of VIZIO XWR100 (based on WRT400N)

I am trying to port VIZIO XWR100. (modified based on WRT400N)

I got a "Data bus error" when wifi start.

root@(none):/tmp# wifi restart
Configuration file: /var/run/hostapd-phy0.conf
[ 1693.200000] Data bus error, epc == 80d61a0c, ra == 80d61a08
[ 1693.200000] Oops[#1]:
[ 1693.200000] Cpu 0
[ 1693.200000] $ 0   : 00000000 00000000 deadc0de 80d2fbf8
[ 1693.200000] $ 4   : b0008048 b0000000 02000020 00000000
[ 1693.200000] $ 8   : 00000006 00000001 00000000 00000000
[ 1693.200000] $12   : 10030000 0000002c 00000000 00000000
[ 1693.200000] $16   : ffffffff 00008048 81b0d7e0 02000020
[ 1693.200000] $20   : 0000016d 00000000 00000002 00007894
[ 1693.200000] $24   : 00000000 00000000
[ 1693.200000] $28   : 8090a000 8090bc68 ffbfffff 80d61a08
[ 1693.200000] Hi    : 00000000
[ 1693.200000] Lo    : 19d60000
[ 1693.200000] epc   : 80d61a0c ath_start_rfkill_poll+0x1f4/0x548 [ath9k]
[ 1693.200000]     Tainted: G           O
[ 1693.200000] ra    : 80d61a08 ath_start_rfkill_poll+0x1f0/0x548 [ath9k]
[ 1693.200000] Status: 1000f403    KERNEL EXL IE
[ 1693.200000] Cause : 1080001c
[ 1693.200000] PrId  : 00019374 (MIPS 24Kc)
[ 1693.200000] Modules linked in: ath9k(O) ath79_wdt ath9k_common(O) ath9k_hw(O) ath(O) mac80211(O) cfg80211(O) compat(O) ledtrig_timer ledtrig_default
_on leds_gpio gpio_button_hotplug(O)
[ 1693.200000] Process hostapd (pid: 947, threadinfo=8090a000, task=81b3edb8, tls=77c73440)
[ 1693.200000] Stack : 00000000 00000000 00000000 00000004 81b40010 00000004 81b40010 81b4019c
        00000002 80d0dd38 00000001 00000001 00000000 80d04a08 000002c7 00000000
        81b40010 81b4019c 00000000 81b40030 00000001 00000001 00000000 00000000
        20000000 80d07144 81b0c000 80c21210 00000000 81b40010 00000001 81b87810
        81b40030 81b0e074 00000000 00000001 81b40010 81b0d7e0 81b4019c 81b87810
        ...
[ 1693.200000] Call Trace:
[ 1693.200000] [<80d61a0c>] ath_start_rfkill_poll+0x1f4/0x548 [ath9k]
[ 1693.200000] [<80d0dd38>] ar9002_hw_attach_phy_ops+0x2004/0x28c4 [ath9k_hw]
[ 1693.200000]
[ 1693.200000]
Code: 0c06160b  00852021  8e45088c <00508024> 02138025  02002021  0c061611  00b12821  8fbf0024
[ 1693.380000] ---[ end trace ab1b548cc310307c ]---
[ 1693.380000] Kernel panic - not syncing: Fatal exception in interrupt

This is full boot message with openwrt firmware

U-Boot 1.1.4 (Jan 18 2010 - 15:46:20)

AP94 (ar7100) U-boot 0.0.12
DRAM:  b8050000: 0xc0140180
32 MB
Top of RAM usable for U-Boot at: 82000000
Reserving 220k for U-Boot at: 81fc8000
Reserving 192k for malloc() at: 81f98000
Reserving 44 Bytes for Board Info at: 81f97fd4
Reserving 36 Bytes for Global Data at: 81f97fb0
Reserving 128k for boot params() at: 81f77fb0
Stack Pointer at: 81f77f98
Now running in RAM - U-Boot at: 81fc8000
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
Hit any key to stop autoboot:  1  0 
## Booting image at bf040000 ...
   Image Name:   MIPS OpenWrt Linux-3.8.7
   Created:      2013-04-18   9:13:01 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1003810 Bytes = 980.3 kB
   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 ...

[    0.000000] Linux version 3.8.7 (xxxxxx) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2012.12 r36332) ) #6 Thu Apr 18 17:12:39 CST 2013
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7161 rev 2
[    0.000000] Clocks: CPU:680.000MHz, DDR:340.000MHz, AHB:170.000MHz, Ref:40.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x01ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=WRT400N console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] __ex_table already sorted, skipping sort
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 28856k/32768k available (2162k kernel code, 3912k reserved, 578k data, 264k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.000000] Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
[    0.060000] pid_max: default: 32768 minimum: 301
[    0.060000] Mount-cache hash table entries: 512
[    0.070000] NET: Registered protocol family 16
[    0.070000] MIPS: machine is Linksys WRT400N
[    0.780000] registering PCI controller with io_map_base unset
[    0.790000] bio: create slab <bio-0> at 0
[    0.800000] PCI host bridge to bus 0000:00
[    0.800000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x16ffffff]
[    0.810000] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.810000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.820000] pci 0000:00:11.0: fixup device configuration
[    0.820000] pci 0000:00:12.0: fixup device configuration
[    0.830000] pci 0000:00:11.0: BAR 0: assigned [mem 0x10000000-0x1000ffff]
[    0.830000] pci 0000:00:12.0: BAR 0: assigned [mem 0x10010000-0x1001ffff]
[    0.840000] pci 0000:00:11.0: using irq 40 for pin 1
[    0.840000] pci 0000:00:12.0: using irq 41 for pin 1
[    0.850000] Switching to clocksource MIPS
[    0.850000] NET: Registered protocol family 2
[    0.860000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[    0.860000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[    0.870000] TCP: Hash tables configured (established 512 bind 512)
[    0.870000] TCP: reno registered
[    0.880000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.880000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.890000] NET: Registered protocol family 1
[    0.900000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.910000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.920000] msgmni has been set to 56
[    0.930000] io scheduler noop registered
[    0.930000] io scheduler deadline registered (default)
[    0.930000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.960000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[    0.970000] console [ttyS0] enabled, bootconsole disabled
[    0.970000] console [ttyS0] enabled, bootconsole disabled
[    0.980000] ath79-spi ath79-spi: master is unqueued, this is deprecated
[    0.990000] m25p80 spi0.0: found w25x64, expected m25p80
[    0.990000] m25p80 spi0.0: w25x64 (8192 Kbytes)
[    1.000000] Creating 9 MTD partitions on "spi0.0":
[    1.000000] 0x000000000000-0x000000030000 : "uboot"
[    1.010000] 0x000000030000-0x000000040000 : "env"
[    1.020000] 0x000000040000-0x0000001b0000 : "linux"
[    1.020000] 0x0000001b0000-0x0000007e0000 : "rootfs"
[    1.030000] mtd: partition "rootfs" set to be root filesystem
[    1.040000] mtd: partition "rootfs_data" created automatically, ofs=360000, len=480000 
[    1.040000] 0x000000360000-0x0000007e0000 : "rootfs_data"
[    1.050000] 0x0000007b0000-0x0000007c0000 : "nvram"
[    1.060000] 0x0000007c0000-0x0000007d0000 : "factory"
[    1.060000] 0x0000007d0000-0x0000007f0000 : "language"
[    1.070000] 0x0000007f0000-0x000000800000 : "caldata"
[    1.080000] 0x000000040000-0x0000007b0000 : "firmware"
[    1.100000] libphy: ag71xx_mdio: probed
[    1.100000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RMII
[    1.410000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:RMII
[    1.720000] ag71xx ag71xx.1 eth1: connected to PHY at ag71xx-mdio.0:04 [uid=004dd043, driver=Generic PHY]
[    1.730000] TCP: cubic registered
[    1.730000] NET: Registered protocol family 17
[    1.740000] 8021q: 802.1Q VLAN Support v1.8
[    1.750000] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    1.760000] Freeing unused kernel memory: 264k freed
[    3.400000] eth0: link up (100Mbps/Full duplex)
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
jffs2 not ready yet; using ramdisk
- init -
[    6.670000] eth0: link down
[    7.180000] Compat-drivers backport release: compat-drivers-2013-01-21-1
[    7.180000] Backport based on wireless-testing.git master-2013-02-22
[    7.190000] compat.git: wireless-testing.git
[    7.220000] cfg80211: Calling CRDA to update world regulatory domain
[    7.220000] cfg80211: World regulatory domain updated:
[    7.230000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[    7.240000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    7.240000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    7.250000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    7.260000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    7.270000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    7.470000] NET: Registered protocol family 10
[    7.640000] usbcore: registered new interface driver usbfs
[    7.650000] usbcore: registered new interface driver hub
[    7.650000] usbcore: registered new device driver usb
[    8.110000] PCI: Enabling device 0000:00:11.0 (0000 -> 0002)
[    8.140000] ath_start_rfkill_poll():207
[    8.140000] ath_start_rfkill_poll():209
[    8.140000] ath_start_rfkill_poll():211
[    8.150000] ath_start_rfkill_poll():217
[    8.150000] ieee80211 phy0: Atheros AR9287 Rev:2 mem=0xb0000000, irq=40
[    8.160000] PCI: Enabling device 0000:00:12.0 (0000 -> 0002)
[    8.180000] ath_start_rfkill_poll():207
[    8.190000] ath_start_rfkill_poll():209
[    8.190000] ath_start_rfkill_poll():211
[    8.200000] ath_start_rfkill_poll():217
[    8.200000] ieee80211 phy1: Atheros AR9280 Rev:2 mem=0xb0010000, irq=41
[    8.240000] PPP generic driver version 2.4.2
[    8.330000] ip_tables: (C) 2000-2006 Netfilter Core Team
[    8.460000] NET: Registered protocol family 24
[    8.480000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    8.490000] ehci-platform: EHCI generic platform driver
[    8.510000] nf_conntrack version 0.5.0 (455 buckets, 1820 max)
[    8.750000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    8.890000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

Please press Enter to activate this console. [   12.960000] eth0: link up (100Mbps/Full duplex)
[   12.970000] device eth0 entered promiscuous mode
[   12.970000] br-lan: port 1(eth0) entered forwarding state
[   12.980000] br-lan: port 1(eth0) entered forwarding state
[   12.990000] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   14.980000] br-lan: port 1(eth0) entered forwarding state
[   15.730000] eth1: link up (100Mbps/Full duplex)
[   15.730000] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   18.720000] Data bus error, epc == 80c21a0c, ra == 80c21a08
[   18.720000] Oops[#1]:
[   18.720000] Cpu 0
[   18.720000] $ 0   : 00000000 00000000 deadc0de 80cafbf8
[   18.720000] $ 4   : b0008048 b0000000 02000020 00000000
[   18.720000] $ 8   : 00000006 00000001 00000000 00000000
[   18.720000] $12   : 10030000 0000002c 00000000 00000000
[   18.720000] $16   : ffffffff 00008048 80ce17e0 02000020
[   18.720000] $20   : 0000016d 00000000 00000002 00007894
[   18.720000] $24   : 00000000 00000000                  
[   18.720000] $28   : 80b72000 80b73c68 ffbfffff 80c21a08
[   18.720000] Hi    : 00000000
[   18.720000] Lo    : 19d60000
[   18.720000] epc   : 80c21a0c ath_start_rfkill_poll+0x1f4/0x548 [ath9k]
[   18.720000]     Tainted: G           O
[   18.720000] ra    : 80c21a08 ath_start_rfkill_poll+0x1f0/0x548 [ath9k]
[   18.720000] Status: 1000f403    KERNEL EXL IE 
[   18.720000] Cause : 1080001c
[   18.720000] PrId  : 00019374 (MIPS 24Kc)
[   18.720000] Modules linked in: ath79_wdt ohci_hcd ledtrig_usbdev ledtrig_netdev ip6t_REJECT ip6t_rt ip6t_hbh ip6t_mh ip6t_ipv6header ip6t_frag ip6t_eui64 ip6t_ah ip6table_raw ip6table_mangle ip6table_filter ip6_tables nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_irc nf_nat_ftp nf_conntrack_irc nf_conntrack_ftp ipt_MASQUERADE iptable_nat xt_nat nf_nat_ipv4 nf_nat pppoe xt_conntrack xt_CT iptable_raw xt_state nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack ehci_platform ehci_hcd pppox ipt_REJECT xt_TCPMSS xt_LOG xt_comment xt_multiport xt_mac xt_limit iptable_mangle iptable_filter ip_tables xt_tcpudp x_tables ppp_async ppp_generic slhc ath9k(O) ath9k_common(O) ath9k_hw(O) ath(O) mac80211(O) usbcore usb_common nls_base crc_ccitt ipv6 cfg80211(O) compat(O) arc4 crypto_blkcipher aead ledtrig_timer ledtrig_default_on leds_gpio gpio_button_hotplug(O)
[   18.720000] Process hostapd (pid: 1127, threadinfo=80b72000, task=80b89d18, tls=77072440)
[   18.720000] Stack : 80b72000 80b73c90 ffbfffff 00000004 80c1c010 00000004 80c1c010 80c1c19c
        00000002 80c8dd38 00000001 00000001 00000000 80c84a08 000002c7 00000000
        80c1c010 80c1c19c 00000000 80c1c030 00000001 00000001 00000000 00000000
        20000000 80c87144 80ce0000 81be1210 00000000 80c1c010 00000001 81bae810
        80c1c030 80ce2074 00000000 00000001 80c1c010 80ce17e0 80c1c19c 81bae810
        ...
[   18.720000] Call Trace:
[   18.720000] [<80c21a0c>] ath_start_rfkill_poll+0x1f4/0x548 [ath9k]
[   18.720000] [<80c8dd38>] ar9002_hw_attach_phy_ops+0x2004/0x28c4 [ath9k_hw]
[   18.720000] 
[   18.720000] 
Code: 0c06160b  00852021  8e45088c <00508024> 02138025  02002021  0c061611  00b12821  8fbf0024 
[   18.950000] ---[ end trace 7eb22e5b51963169 ]---
[   18.960000] Kernel panic - not syncing: Fatal exception in interrupt
[   18.960000] Rebooting in 3 seconds..

I try to enter failsafe mode. => fine
insmod wireless relative module.   => fine
generate /etc/config/wireless by "wifi detect" => fine
start wifi by "wifi restart" => kernel panic !!


Others information:
iw list

root@(none):/# iw list
Wiphy phy1
    Band 1:
        Capabilities: 0x11ce
            HT20/HT40
            SM Power Save disabled
            RX HT40 SGI
            TX STBC
            RX STBC 1-stream
            Max AMSDU length: 3839 bytes
            DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 8 usec (0x06)
        HT TX/RX MCS rate indexes supported: 0-15
        Frequencies:
            * 5180 MHz [36] (20.0 dBm)
            * 5200 MHz [40] (20.0 dBm)
            * 5220 MHz [44] (20.0 dBm)
            * 5240 MHz [48] (20.0 dBm)
            * 5260 MHz [52] (disabled)
            * 5280 MHz [56] (disabled)
            * 5300 MHz [60] (disabled)
            * 5320 MHz [64] (disabled)
            * 5500 MHz [100] (disabled)
            * 5520 MHz [104] (disabled)
            * 5540 MHz [108] (disabled)
            * 5560 MHz [112] (disabled)
            * 5580 MHz [116] (disabled)
            * 5600 MHz [120] (disabled)
            * 5620 MHz [124] (disabled)
            * 5640 MHz [128] (disabled)
            * 5660 MHz [132] (disabled)
            * 5680 MHz [136] (disabled)
            * 5700 MHz [140] (disabled)
            * 5745 MHz [149] (20.0 dBm) (passive scanning, no IBSS)
            * 5765 MHz [153] (20.0 dBm) (passive scanning, no IBSS)
            * 5785 MHz [157] (20.0 dBm) (passive scanning, no IBSS)
            * 5805 MHz [161] (20.0 dBm) (passive scanning, no IBSS)
            * 5825 MHz [165] (20.0 dBm) (passive scanning, no IBSS)
        Bitrates (non-HT):
            * 6.0 Mbps
            * 9.0 Mbps
            * 12.0 Mbps
            * 18.0 Mbps
            * 24.0 Mbps
            * 36.0 Mbps
            * 48.0 Mbps
            * 54.0 Mbps
    max # scan SSIDs: 4
    max scan IEs length: 2261 bytes
    Coverage class: 0 (up to 0m)
    Supported Ciphers:
        * WEP40 (00-0f-ac:1)
        * WEP104 (00-0f-ac:5)
        * TKIP (00-0f-ac:2)
        * CCMP (00-0f-ac:4)
        * CMAC (00-0f-ac:6)
    Available Antennas: TX 0x3 RX 0x3
    Configured Antennas: TX 0x3 RX 0x3
    Supported interface modes:
         * IBSS
         * managed
         * AP
         * AP/VLAN
         * WDS
         * monitor
         * mesh point
         * P2P-client
         * P2P-GO
    software interface modes (can always be added):
         * AP/VLAN
         * monitor
    valid interface combinations:
         * #{ managed, WDS, P2P-client } <= 2048, #{ AP, mesh point, P2P-GO } <= 8, #{ IBSS } <= 1,
           total <= 2048, #channels <= 1, STA/AP BI must match
    Supported commands:
         * new_interface
         * set_interface
         * new_key
         * start_ap
         * new_station
         * new_mpath
         * set_mesh_config
         * set_bss
         * authenticate
         * associate
         * deauthenticate
         * disassociate
         * join_ibss
         * join_mesh
         * remain_on_channel
         * set_tx_bitrate_mask
         * frame
         * frame_wait_cancel
         * set_wiphy_netns
         * set_channel
         * set_wds_peer
         * tdls_mgmt
         * tdls_oper
         * probe_client
         * set_noack_map
         * register_beacons
         * Unknown command (89)
         * Unknown command (92)
         * connect
         * disconnect
    Supported TX frame types:
         * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * (null): 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
    Supported RX frame types:
         * IBSS: 0x40 0xb0 0xc0 0xd0
         * managed: 0x40 0xd0
         * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * mesh point: 0xb0 0xc0 0xd0
         * P2P-client: 0x40 0xd0
         * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * (null): 0x40 0xd0
    Device supports RSN-IBSS.
    HT Capability overrides:
         * MCS: ff ff ff ff ff ff ff ff ff ff
         * maximum A-MSDU length
         * supported channel width
         * short GI for 40 MHz
         * max A-MPDU length exponent
         * min MPDU start spacing
    Device supports TX status socket option.
    Device supports HT-IBSS.
Wiphy phy0
    Band 1:
        Capabilities: 0x11ee
            HT20/HT40
            SM Power Save disabled
            RX HT20 SGI
            RX HT40 SGI
            TX STBC
            RX STBC 1-stream
            Max AMSDU length: 3839 bytes
            DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 8 usec (0x06)
        HT TX/RX MCS rate indexes supported: 0-15
        Frequencies:
            * 2412 MHz [1] (20.0 dBm)
            * 2417 MHz [2] (20.0 dBm)
            * 2422 MHz [3] (20.0 dBm)
            * 2427 MHz [4] (20.0 dBm)
            * 2432 MHz [5] (20.0 dBm)
            * 2437 MHz [6] (20.0 dBm)
            * 2442 MHz [7] (20.0 dBm)
            * 2447 MHz [8] (20.0 dBm)
            * 2452 MHz [9] (20.0 dBm)
            * 2457 MHz [10] (20.0 dBm)
            * 2462 MHz [11] (20.0 dBm)
            * 2467 MHz [12] (20.0 dBm) (passive scanning, no IBSS)
            * 2472 MHz [13] (20.0 dBm) (passive scanning, no IBSS)
            * 2484 MHz [14] (20.0 dBm) (passive scanning, no IBSS)
        Bitrates (non-HT):
            * 1.0 Mbps
            * 2.0 Mbps (short preamble supported)
            * 5.5 Mbps (short preamble supported)
            * 11.0 Mbps (short preamble supported)
            * 6.0 Mbps
            * 9.0 Mbps
            * 12.0 Mbps
            * 18.0 Mbps
            * 24.0 Mbps
            * 36.0 Mbps
            * 48.0 Mbps
            * 54.0 Mbps
    max # scan SSIDs: 4
    max scan IEs length: 2257 bytes
    Coverage class: 0 (up to 0m)
    Supported Ciphers:
        * WEP40 (00-0f-ac:1)
        * WEP104 (00-0f-ac:5)
        * TKIP (00-0f-ac:2)
        * CCMP (00-0f-ac:4)
        * CMAC (00-0f-ac:6)
    Available Antennas: TX 0x3 RX 0x3
    Configured Antennas: TX 0x3 RX 0x3
    Supported interface modes:
         * IBSS
         * managed
         * AP
         * AP/VLAN
         * WDS
         * monitor
         * mesh point
         * P2P-client
         * P2P-GO
    software interface modes (can always be added):
         * AP/VLAN
         * monitor
    valid interface combinations:
         * #{ managed, WDS, P2P-client } <= 2048, #{ AP, mesh point, P2P-GO } <= 8, #{ IBSS } <= 1,
           total <= 2048, #channels <= 1, STA/AP BI must match
    Supported commands:
         * new_interface
         * set_interface
         * new_key
         * start_ap
         * new_station
         * new_mpath
         * set_mesh_config
         * set_bss
         * authenticate
         * associate
         * deauthenticate
         * disassociate
         * join_ibss
         * join_mesh
         * remain_on_channel
         * set_tx_bitrate_mask
         * frame
         * frame_wait_cancel
         * set_wiphy_netns
         * set_channel
         * set_wds_peer
         * tdls_mgmt
         * tdls_oper
         * probe_client
         * set_noack_map
         * register_beacons
         * Unknown command (89)
         * Unknown command (92)
         * connect
         * disconnect
    Supported TX frame types:
         * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * (null): 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
    Supported RX frame types:
         * IBSS: 0x40 0xb0 0xc0 0xd0
         * managed: 0x40 0xd0
         * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * mesh point: 0xb0 0xc0 0xd0
         * P2P-client: 0x40 0xd0
         * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * (null): 0x40 0xd0
    Device supports RSN-IBSS.
    HT Capability overrides:
         * MCS: ff ff ff ff ff ff ff ff ff ff
         * maximum A-MSDU length
         * supported channel width
         * short GI for 40 MHz
         * max A-MPDU length exponent
         * min MPDU start spacing
    Device supports TX status socket option.
    Device supports HT-IBSS.
root@(none):/# 
root@(none):/# 

modified mach-wrt400n.c for XWR100.

/*
 *  Linksys WRT400N board support
 *
 *  Copyright (C) 2009-2012 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/mtd/mtd.h>
#include <linux/mtd/partitions.h>

#include <asm/mach-ath79/ath79.h>

#include "dev-ap9x-pci.h"
#include "dev-eth.h"
#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#include "dev-m25p80.h"
#include "machtypes.h"

#define WRT400N_GPIO_LED_POWER        1
#define WRT400N_GPIO_LED_WPS_BLUE    4
#define WRT400N_GPIO_LED_WPS_AMBER    5
#define WRT400N_GPIO_LED_WLAN        6

#define WRT400N_GPIO_BTN_RESET        8
#define WRT400N_GPIO_BTN_WLSEC        3

#define WRT400N_KEYS_POLL_INTERVAL    20    /* msecs */
#define WRT400N_KEYS_DEBOUNE_INTERVAL    (3 * WRT400N_KEYS_POLL_INTERVAL)

#define WRT400N_MAC_ADDR_OFFSET        0x110C
#define WRT400N_CALDATA0_OFFSET        0x1000
#define WRT400N_CALDATA1_OFFSET        0x5000

static struct mtd_partition wrt400n_partitions[] = {
    {
        .name        = "uboot",
        .offset        = 0,
        .size        = 0x030000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "env",
        .offset        = 0x030000,
        .size        = 0x010000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "linux",
        .offset        = 0x040000,
        .size        = 0x170000,
    }, {
        .name        = "rootfs",
        .offset        = 0x1B0000,
        .size        = 0x630000,
    }, {
        .name        = "nvram",
        .offset        = 0x7b0000,
        .size        = 0x010000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "factory",
        .offset        = 0x7c0000,
        .size        = 0x010000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "language",
        .offset        = 0x7d0000,
        .size        = 0x020000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "caldata",
        .offset        = 0x7f0000,
        .size        = 0x010000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "firmware",
        .offset        = 0x040000,
        .size        = 0x770000,
    }
};

static struct flash_platform_data wrt400n_flash_data = {
    .parts        = wrt400n_partitions,
    .nr_parts    = ARRAY_SIZE(wrt400n_partitions),
};

static struct gpio_led wrt400n_leds_gpio[] __initdata = {
    {
        .name        = "wrt400n:blue:wps",
        .gpio        = WRT400N_GPIO_LED_WPS_BLUE,
        .active_low    = 1,
    }, {
        .name        = "wrt400n:amber:wps",
        .gpio        = WRT400N_GPIO_LED_WPS_AMBER,
        .active_low    = 1,
    }, {
        .name        = "wrt400n:blue:wlan",
        .gpio        = WRT400N_GPIO_LED_WLAN,
        .active_low    = 1,
    }, {
        .name        = "wrt400n:blue:power",
        .gpio        = WRT400N_GPIO_LED_POWER,
        .active_low    = 0,
        .default_trigger = "default-on",
    }
};

static struct gpio_keys_button wrt400n_gpio_keys[] __initdata = {
    {
        .desc        = "reset",
        .type        = EV_KEY,
        .code        = KEY_RESTART,
        .debounce_interval = WRT400N_KEYS_DEBOUNE_INTERVAL,
        .gpio        = WRT400N_GPIO_BTN_RESET,
        .active_low    = 1,
    }, {
        .desc        = "wlsec",
        .type        = EV_KEY,
        .code        = KEY_WPS_BUTTON,
        .debounce_interval = WRT400N_KEYS_DEBOUNE_INTERVAL,
        .gpio        = WRT400N_GPIO_BTN_WLSEC,
        .active_low    = 1,
    }
};

static void __init wrt400n_setup(void)
{
    u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
    u8 *mac = art + WRT400N_MAC_ADDR_OFFSET;

    ath79_register_mdio(0, 0x0);

    ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
    ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
    ath79_eth0_data.speed = SPEED_100;
    ath79_eth0_data.duplex = DUPLEX_FULL;

    ath79_init_mac(ath79_eth1_data.mac_addr, mac, 2);
    ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
    ath79_eth1_data.phy_mask = 0x10;

    ath79_register_eth(0);
    ath79_register_eth(1);

    ath79_register_m25p80(&wrt400n_flash_data);

    ath79_register_leds_gpio(-1, ARRAY_SIZE(wrt400n_leds_gpio),
                 wrt400n_leds_gpio);

    ath79_register_gpio_keys_polled(-1, WRT400N_KEYS_POLL_INTERVAL,
                    ARRAY_SIZE(wrt400n_gpio_keys),
                    wrt400n_gpio_keys);
    //ap94_pci_init(art + WRT400N_CALDATA0_OFFSET, art + 0x110C,
    //          art + WRT400N_CALDATA1_OFFSET, art + 0x520C);
    
    ap94_pci_init(    art + WRT400N_CALDATA0_OFFSET, 
                    art + 0x110C,
                    art + WRT400N_CALDATA1_OFFSET, 
                    art + 0x520C);
}

MIPS_MACHINE(ATH79_MACH_WRT400N, "WRT400N", "Linksys WRT400N", wrt400n_setup);

If someone need more information, please kindly let me know.
I really want make openwrt to work on this device.
If possible, I can create a teamview remote for debug. (console with XWR100)

Thanks,

Re: Add support of VIZIO XWR100 (based on WRT400N)

Update:
According wikidevi VIZIO_XWR100)
This device have two wireless: AR9220 for 5GHz and AR9227 for 2.4GHz.
I try to init AR9220 ONLY in mach-wrt400n.c, and it can work great and get no error.

    //enable 5GHZ
    ap94_pci_init(    NULL /*art + WRT400N_CALDATA0_OFFSET*/, 
                    NULL /*art + 0x110C*/,
                    art + WRT400N_CALDATA1_OFFSET, 
                    art + 0x520C );

But I switch to init AR9227 ONLY, the data bus error happened!!

    //enable 2.4GHZ
    ap94_pci_init(    art + WRT400N_CALDATA0_OFFSET, 
                    art + 0x110C,
                    NULL /*art + WRT400N_CALDATA1_OFFSET*/, 
                    NULL /*art + 0x520C*/ );

Does OpenWrt support AR9227 ?
I can't find other similar device with AR9227. (most ar7xxx devices with AR9223)

3 (edited by jaceq 2013-04-19 07:45:44)

Re: Add support of VIZIO XWR100 (based on WRT400N)

To me it looks like there is something wrong with GPIO for led, when you try to bring wifi up, it tries to enable LED on wrong GPIO...
I'd suggets, hash out GPIO definitions for wifi leds in your mach file rebuild and re-try.

(I came across similar problem before...)

4 (edited by dony71 2013-04-19 20:22:48)

Re: Add support of VIZIO XWR100 (based on WRT400N)

cmtsij wrote:

I am trying to port VIZIO XWR100. (modified based on WRT400N)

I got a "Data bus error" when wifi start.

root@(none):/tmp# wifi restart
Configuration file: /var/run/hostapd-phy0.conf
[ 1693.200000] Data bus error, epc == 80d61a0c, ra == 80d61a08
[ 1693.200000] Oops[#1]:
[ 1693.200000] Cpu 0
[ 1693.200000] $ 0   : 00000000 00000000 deadc0de 80d2fbf8
[ 1693.200000] $ 4   : b0008048 b0000000 02000020 00000000
[ 1693.200000] $ 8   : 00000006 00000001 00000000 00000000
[ 1693.200000] $12   : 10030000 0000002c 00000000 00000000
[ 1693.200000] $16   : ffffffff 00008048 81b0d7e0 02000020
[ 1693.200000] $20   : 0000016d 00000000 00000002 00007894
[ 1693.200000] $24   : 00000000 00000000
[ 1693.200000] $28   : 8090a000 8090bc68 ffbfffff 80d61a08
[ 1693.200000] Hi    : 00000000
[ 1693.200000] Lo    : 19d60000
[ 1693.200000] epc   : 80d61a0c ath_start_rfkill_poll+0x1f4/0x548 [ath9k]
[ 1693.200000]     Tainted: G           O
[ 1693.200000] ra    : 80d61a08 ath_start_rfkill_poll+0x1f0/0x548 [ath9k]
[ 1693.200000] Status: 1000f403    KERNEL EXL IE
[ 1693.200000] Cause : 1080001c
[ 1693.200000] PrId  : 00019374 (MIPS 24Kc)
[ 1693.200000] Modules linked in: ath9k(O) ath79_wdt ath9k_common(O) ath9k_hw(O) ath(O) mac80211(O) cfg80211(O) compat(O) ledtrig_timer ledtrig_default
_on leds_gpio gpio_button_hotplug(O)
[ 1693.200000] Process hostapd (pid: 947, threadinfo=8090a000, task=81b3edb8, tls=77c73440)
[ 1693.200000] Stack : 00000000 00000000 00000000 00000004 81b40010 00000004 81b40010 81b4019c
        00000002 80d0dd38 00000001 00000001 00000000 80d04a08 000002c7 00000000
        81b40010 81b4019c 00000000 81b40030 00000001 00000001 00000000 00000000
        20000000 80d07144 81b0c000 80c21210 00000000 81b40010 00000001 81b87810
        81b40030 81b0e074 00000000 00000001 81b40010 81b0d7e0 81b4019c 81b87810
        ...
[ 1693.200000] Call Trace:
[ 1693.200000] [<80d61a0c>] ath_start_rfkill_poll+0x1f4/0x548 [ath9k]
[ 1693.200000] [<80d0dd38>] ar9002_hw_attach_phy_ops+0x2004/0x28c4 [ath9k_hw]
[ 1693.200000]
[ 1693.200000]
Code: 0c06160b  00852021  8e45088c <00508024> 02138025  02002021  0c061611  00b12821  8fbf0024
[ 1693.380000] ---[ end trace ab1b548cc310307c ]---
[ 1693.380000] Kernel panic - not syncing: Fatal exception in interrupt

This is full boot message with openwrt firmware

U-Boot 1.1.4 (Jan 18 2010 - 15:46:20)

AP94 (ar7100) U-boot 0.0.12
DRAM:  b8050000: 0xc0140180
32 MB
Top of RAM usable for U-Boot at: 82000000
Reserving 220k for U-Boot at: 81fc8000
Reserving 192k for malloc() at: 81f98000
Reserving 44 Bytes for Board Info at: 81f97fd4
Reserving 36 Bytes for Global Data at: 81f97fb0
Reserving 128k for boot params() at: 81f77fb0
Stack Pointer at: 81f77f98
Now running in RAM - U-Boot at: 81fc8000
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
Hit any key to stop autoboot:  1  0 
## Booting image at bf040000 ...
   Image Name:   MIPS OpenWrt Linux-3.8.7
   Created:      2013-04-18   9:13:01 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1003810 Bytes = 980.3 kB
   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 ...

[    0.000000] Linux version 3.8.7 (xxxxxx) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2012.12 r36332) ) #6 Thu Apr 18 17:12:39 CST 2013
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7161 rev 2
[    0.000000] Clocks: CPU:680.000MHz, DDR:340.000MHz, AHB:170.000MHz, Ref:40.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x01ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=WRT400N console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] __ex_table already sorted, skipping sort
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 28856k/32768k available (2162k kernel code, 3912k reserved, 578k data, 264k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.000000] Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
[    0.060000] pid_max: default: 32768 minimum: 301
[    0.060000] Mount-cache hash table entries: 512
[    0.070000] NET: Registered protocol family 16
[    0.070000] MIPS: machine is Linksys WRT400N
[    0.780000] registering PCI controller with io_map_base unset
[    0.790000] bio: create slab <bio-0> at 0
[    0.800000] PCI host bridge to bus 0000:00
[    0.800000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x16ffffff]
[    0.810000] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.810000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.820000] pci 0000:00:11.0: fixup device configuration
[    0.820000] pci 0000:00:12.0: fixup device configuration
[    0.830000] pci 0000:00:11.0: BAR 0: assigned [mem 0x10000000-0x1000ffff]
[    0.830000] pci 0000:00:12.0: BAR 0: assigned [mem 0x10010000-0x1001ffff]
[    0.840000] pci 0000:00:11.0: using irq 40 for pin 1
[    0.840000] pci 0000:00:12.0: using irq 41 for pin 1
[    0.850000] Switching to clocksource MIPS
[    0.850000] NET: Registered protocol family 2
[    0.860000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[    0.860000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[    0.870000] TCP: Hash tables configured (established 512 bind 512)
[    0.870000] TCP: reno registered
[    0.880000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.880000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.890000] NET: Registered protocol family 1
[    0.900000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.910000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.920000] msgmni has been set to 56
[    0.930000] io scheduler noop registered
[    0.930000] io scheduler deadline registered (default)
[    0.930000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.960000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[    0.970000] console [ttyS0] enabled, bootconsole disabled
[    0.970000] console [ttyS0] enabled, bootconsole disabled
[    0.980000] ath79-spi ath79-spi: master is unqueued, this is deprecated
[    0.990000] m25p80 spi0.0: found w25x64, expected m25p80
[    0.990000] m25p80 spi0.0: w25x64 (8192 Kbytes)
[    1.000000] Creating 9 MTD partitions on "spi0.0":
[    1.000000] 0x000000000000-0x000000030000 : "uboot"
[    1.010000] 0x000000030000-0x000000040000 : "env"
[    1.020000] 0x000000040000-0x0000001b0000 : "linux"
[    1.020000] 0x0000001b0000-0x0000007e0000 : "rootfs"
[    1.030000] mtd: partition "rootfs" set to be root filesystem
[    1.040000] mtd: partition "rootfs_data" created automatically, ofs=360000, len=480000 
[    1.040000] 0x000000360000-0x0000007e0000 : "rootfs_data"
[    1.050000] 0x0000007b0000-0x0000007c0000 : "nvram"
[    1.060000] 0x0000007c0000-0x0000007d0000 : "factory"
[    1.060000] 0x0000007d0000-0x0000007f0000 : "language"
[    1.070000] 0x0000007f0000-0x000000800000 : "caldata"
[    1.080000] 0x000000040000-0x0000007b0000 : "firmware"
[    1.100000] libphy: ag71xx_mdio: probed
[    1.100000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RMII
[    1.410000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:RMII
[    1.720000] ag71xx ag71xx.1 eth1: connected to PHY at ag71xx-mdio.0:04 [uid=004dd043, driver=Generic PHY]
[    1.730000] TCP: cubic registered
[    1.730000] NET: Registered protocol family 17
[    1.740000] 8021q: 802.1Q VLAN Support v1.8
[    1.750000] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    1.760000] Freeing unused kernel memory: 264k freed
[    3.400000] eth0: link up (100Mbps/Full duplex)
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
jffs2 not ready yet; using ramdisk
- init -
[    6.670000] eth0: link down
[    7.180000] Compat-drivers backport release: compat-drivers-2013-01-21-1
[    7.180000] Backport based on wireless-testing.git master-2013-02-22
[    7.190000] compat.git: wireless-testing.git
[    7.220000] cfg80211: Calling CRDA to update world regulatory domain
[    7.220000] cfg80211: World regulatory domain updated:
[    7.230000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[    7.240000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    7.240000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    7.250000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    7.260000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    7.270000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    7.470000] NET: Registered protocol family 10
[    7.640000] usbcore: registered new interface driver usbfs
[    7.650000] usbcore: registered new interface driver hub
[    7.650000] usbcore: registered new device driver usb
[    8.110000] PCI: Enabling device 0000:00:11.0 (0000 -> 0002)
[    8.140000] ath_start_rfkill_poll():207
[    8.140000] ath_start_rfkill_poll():209
[    8.140000] ath_start_rfkill_poll():211
[    8.150000] ath_start_rfkill_poll():217
[    8.150000] ieee80211 phy0: Atheros AR9287 Rev:2 mem=0xb0000000, irq=40
[    8.160000] PCI: Enabling device 0000:00:12.0 (0000 -> 0002)
[    8.180000] ath_start_rfkill_poll():207
[    8.190000] ath_start_rfkill_poll():209
[    8.190000] ath_start_rfkill_poll():211
[    8.200000] ath_start_rfkill_poll():217
[    8.200000] ieee80211 phy1: Atheros AR9280 Rev:2 mem=0xb0010000, irq=41
[    8.240000] PPP generic driver version 2.4.2
[    8.330000] ip_tables: (C) 2000-2006 Netfilter Core Team
[    8.460000] NET: Registered protocol family 24
[    8.480000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    8.490000] ehci-platform: EHCI generic platform driver
[    8.510000] nf_conntrack version 0.5.0 (455 buckets, 1820 max)
[    8.750000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    8.890000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

Please press Enter to activate this console. [   12.960000] eth0: link up (100Mbps/Full duplex)
[   12.970000] device eth0 entered promiscuous mode
[   12.970000] br-lan: port 1(eth0) entered forwarding state
[   12.980000] br-lan: port 1(eth0) entered forwarding state
[   12.990000] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   14.980000] br-lan: port 1(eth0) entered forwarding state
[   15.730000] eth1: link up (100Mbps/Full duplex)
[   15.730000] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   18.720000] Data bus error, epc == 80c21a0c, ra == 80c21a08
[   18.720000] Oops[#1]:
[   18.720000] Cpu 0
[   18.720000] $ 0   : 00000000 00000000 deadc0de 80cafbf8
[   18.720000] $ 4   : b0008048 b0000000 02000020 00000000
[   18.720000] $ 8   : 00000006 00000001 00000000 00000000
[   18.720000] $12   : 10030000 0000002c 00000000 00000000
[   18.720000] $16   : ffffffff 00008048 80ce17e0 02000020
[   18.720000] $20   : 0000016d 00000000 00000002 00007894
[   18.720000] $24   : 00000000 00000000                  
[   18.720000] $28   : 80b72000 80b73c68 ffbfffff 80c21a08
[   18.720000] Hi    : 00000000
[   18.720000] Lo    : 19d60000
[   18.720000] epc   : 80c21a0c ath_start_rfkill_poll+0x1f4/0x548 [ath9k]
[   18.720000]     Tainted: G           O
[   18.720000] ra    : 80c21a08 ath_start_rfkill_poll+0x1f0/0x548 [ath9k]
[   18.720000] Status: 1000f403    KERNEL EXL IE 
[   18.720000] Cause : 1080001c
[   18.720000] PrId  : 00019374 (MIPS 24Kc)
[   18.720000] Modules linked in: ath79_wdt ohci_hcd ledtrig_usbdev ledtrig_netdev ip6t_REJECT ip6t_rt ip6t_hbh ip6t_mh ip6t_ipv6header ip6t_frag ip6t_eui64 ip6t_ah ip6table_raw ip6table_mangle ip6table_filter ip6_tables nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_irc nf_nat_ftp nf_conntrack_irc nf_conntrack_ftp ipt_MASQUERADE iptable_nat xt_nat nf_nat_ipv4 nf_nat pppoe xt_conntrack xt_CT iptable_raw xt_state nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack ehci_platform ehci_hcd pppox ipt_REJECT xt_TCPMSS xt_LOG xt_comment xt_multiport xt_mac xt_limit iptable_mangle iptable_filter ip_tables xt_tcpudp x_tables ppp_async ppp_generic slhc ath9k(O) ath9k_common(O) ath9k_hw(O) ath(O) mac80211(O) usbcore usb_common nls_base crc_ccitt ipv6 cfg80211(O) compat(O) arc4 crypto_blkcipher aead ledtrig_timer ledtrig_default_on leds_gpio gpio_button_hotplug(O)
[   18.720000] Process hostapd (pid: 1127, threadinfo=80b72000, task=80b89d18, tls=77072440)
[   18.720000] Stack : 80b72000 80b73c90 ffbfffff 00000004 80c1c010 00000004 80c1c010 80c1c19c
        00000002 80c8dd38 00000001 00000001 00000000 80c84a08 000002c7 00000000
        80c1c010 80c1c19c 00000000 80c1c030 00000001 00000001 00000000 00000000
        20000000 80c87144 80ce0000 81be1210 00000000 80c1c010 00000001 81bae810
        80c1c030 80ce2074 00000000 00000001 80c1c010 80ce17e0 80c1c19c 81bae810
        ...
[   18.720000] Call Trace:
[   18.720000] [<80c21a0c>] ath_start_rfkill_poll+0x1f4/0x548 [ath9k]
[   18.720000] [<80c8dd38>] ar9002_hw_attach_phy_ops+0x2004/0x28c4 [ath9k_hw]
[   18.720000] 
[   18.720000] 
Code: 0c06160b  00852021  8e45088c <00508024> 02138025  02002021  0c061611  00b12821  8fbf0024 
[   18.950000] ---[ end trace 7eb22e5b51963169 ]---
[   18.960000] Kernel panic - not syncing: Fatal exception in interrupt
[   18.960000] Rebooting in 3 seconds..

I try to enter failsafe mode. => fine
insmod wireless relative module.   => fine
generate /etc/config/wireless by "wifi detect" => fine
start wifi by "wifi restart" => kernel panic !!


Others information:
iw list

root@(none):/# iw list
Wiphy phy1
    Band 1:
        Capabilities: 0x11ce
            HT20/HT40
            SM Power Save disabled
            RX HT40 SGI
            TX STBC
            RX STBC 1-stream
            Max AMSDU length: 3839 bytes
            DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 8 usec (0x06)
        HT TX/RX MCS rate indexes supported: 0-15
        Frequencies:
            * 5180 MHz [36] (20.0 dBm)
            * 5200 MHz [40] (20.0 dBm)
            * 5220 MHz [44] (20.0 dBm)
            * 5240 MHz [48] (20.0 dBm)
            * 5260 MHz [52] (disabled)
            * 5280 MHz [56] (disabled)
            * 5300 MHz [60] (disabled)
            * 5320 MHz [64] (disabled)
            * 5500 MHz [100] (disabled)
            * 5520 MHz [104] (disabled)
            * 5540 MHz [108] (disabled)
            * 5560 MHz [112] (disabled)
            * 5580 MHz [116] (disabled)
            * 5600 MHz [120] (disabled)
            * 5620 MHz [124] (disabled)
            * 5640 MHz [128] (disabled)
            * 5660 MHz [132] (disabled)
            * 5680 MHz [136] (disabled)
            * 5700 MHz [140] (disabled)
            * 5745 MHz [149] (20.0 dBm) (passive scanning, no IBSS)
            * 5765 MHz [153] (20.0 dBm) (passive scanning, no IBSS)
            * 5785 MHz [157] (20.0 dBm) (passive scanning, no IBSS)
            * 5805 MHz [161] (20.0 dBm) (passive scanning, no IBSS)
            * 5825 MHz [165] (20.0 dBm) (passive scanning, no IBSS)
        Bitrates (non-HT):
            * 6.0 Mbps
            * 9.0 Mbps
            * 12.0 Mbps
            * 18.0 Mbps
            * 24.0 Mbps
            * 36.0 Mbps
            * 48.0 Mbps
            * 54.0 Mbps
    max # scan SSIDs: 4
    max scan IEs length: 2261 bytes
    Coverage class: 0 (up to 0m)
    Supported Ciphers:
        * WEP40 (00-0f-ac:1)
        * WEP104 (00-0f-ac:5)
        * TKIP (00-0f-ac:2)
        * CCMP (00-0f-ac:4)
        * CMAC (00-0f-ac:6)
    Available Antennas: TX 0x3 RX 0x3
    Configured Antennas: TX 0x3 RX 0x3
    Supported interface modes:
         * IBSS
         * managed
         * AP
         * AP/VLAN
         * WDS
         * monitor
         * mesh point
         * P2P-client
         * P2P-GO
    software interface modes (can always be added):
         * AP/VLAN
         * monitor
    valid interface combinations:
         * #{ managed, WDS, P2P-client } <= 2048, #{ AP, mesh point, P2P-GO } <= 8, #{ IBSS } <= 1,
           total <= 2048, #channels <= 1, STA/AP BI must match
    Supported commands:
         * new_interface
         * set_interface
         * new_key
         * start_ap
         * new_station
         * new_mpath
         * set_mesh_config
         * set_bss
         * authenticate
         * associate
         * deauthenticate
         * disassociate
         * join_ibss
         * join_mesh
         * remain_on_channel
         * set_tx_bitrate_mask
         * frame
         * frame_wait_cancel
         * set_wiphy_netns
         * set_channel
         * set_wds_peer
         * tdls_mgmt
         * tdls_oper
         * probe_client
         * set_noack_map
         * register_beacons
         * Unknown command (89)
         * Unknown command (92)
         * connect
         * disconnect
    Supported TX frame types:
         * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * (null): 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
    Supported RX frame types:
         * IBSS: 0x40 0xb0 0xc0 0xd0
         * managed: 0x40 0xd0
         * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * mesh point: 0xb0 0xc0 0xd0
         * P2P-client: 0x40 0xd0
         * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * (null): 0x40 0xd0
    Device supports RSN-IBSS.
    HT Capability overrides:
         * MCS: ff ff ff ff ff ff ff ff ff ff
         * maximum A-MSDU length
         * supported channel width
         * short GI for 40 MHz
         * max A-MPDU length exponent
         * min MPDU start spacing
    Device supports TX status socket option.
    Device supports HT-IBSS.
Wiphy phy0
    Band 1:
        Capabilities: 0x11ee
            HT20/HT40
            SM Power Save disabled
            RX HT20 SGI
            RX HT40 SGI
            TX STBC
            RX STBC 1-stream
            Max AMSDU length: 3839 bytes
            DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 8 usec (0x06)
        HT TX/RX MCS rate indexes supported: 0-15
        Frequencies:
            * 2412 MHz [1] (20.0 dBm)
            * 2417 MHz [2] (20.0 dBm)
            * 2422 MHz [3] (20.0 dBm)
            * 2427 MHz [4] (20.0 dBm)
            * 2432 MHz [5] (20.0 dBm)
            * 2437 MHz [6] (20.0 dBm)
            * 2442 MHz [7] (20.0 dBm)
            * 2447 MHz [8] (20.0 dBm)
            * 2452 MHz [9] (20.0 dBm)
            * 2457 MHz [10] (20.0 dBm)
            * 2462 MHz [11] (20.0 dBm)
            * 2467 MHz [12] (20.0 dBm) (passive scanning, no IBSS)
            * 2472 MHz [13] (20.0 dBm) (passive scanning, no IBSS)
            * 2484 MHz [14] (20.0 dBm) (passive scanning, no IBSS)
        Bitrates (non-HT):
            * 1.0 Mbps
            * 2.0 Mbps (short preamble supported)
            * 5.5 Mbps (short preamble supported)
            * 11.0 Mbps (short preamble supported)
            * 6.0 Mbps
            * 9.0 Mbps
            * 12.0 Mbps
            * 18.0 Mbps
            * 24.0 Mbps
            * 36.0 Mbps
            * 48.0 Mbps
            * 54.0 Mbps
    max # scan SSIDs: 4
    max scan IEs length: 2257 bytes
    Coverage class: 0 (up to 0m)
    Supported Ciphers:
        * WEP40 (00-0f-ac:1)
        * WEP104 (00-0f-ac:5)
        * TKIP (00-0f-ac:2)
        * CCMP (00-0f-ac:4)
        * CMAC (00-0f-ac:6)
    Available Antennas: TX 0x3 RX 0x3
    Configured Antennas: TX 0x3 RX 0x3
    Supported interface modes:
         * IBSS
         * managed
         * AP
         * AP/VLAN
         * WDS
         * monitor
         * mesh point
         * P2P-client
         * P2P-GO
    software interface modes (can always be added):
         * AP/VLAN
         * monitor
    valid interface combinations:
         * #{ managed, WDS, P2P-client } <= 2048, #{ AP, mesh point, P2P-GO } <= 8, #{ IBSS } <= 1,
           total <= 2048, #channels <= 1, STA/AP BI must match
    Supported commands:
         * new_interface
         * set_interface
         * new_key
         * start_ap
         * new_station
         * new_mpath
         * set_mesh_config
         * set_bss
         * authenticate
         * associate
         * deauthenticate
         * disassociate
         * join_ibss
         * join_mesh
         * remain_on_channel
         * set_tx_bitrate_mask
         * frame
         * frame_wait_cancel
         * set_wiphy_netns
         * set_channel
         * set_wds_peer
         * tdls_mgmt
         * tdls_oper
         * probe_client
         * set_noack_map
         * register_beacons
         * Unknown command (89)
         * Unknown command (92)
         * connect
         * disconnect
    Supported TX frame types:
         * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * (null): 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
    Supported RX frame types:
         * IBSS: 0x40 0xb0 0xc0 0xd0
         * managed: 0x40 0xd0
         * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * mesh point: 0xb0 0xc0 0xd0
         * P2P-client: 0x40 0xd0
         * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * (null): 0x40 0xd0
    Device supports RSN-IBSS.
    HT Capability overrides:
         * MCS: ff ff ff ff ff ff ff ff ff ff
         * maximum A-MSDU length
         * supported channel width
         * short GI for 40 MHz
         * max A-MPDU length exponent
         * min MPDU start spacing
    Device supports TX status socket option.
    Device supports HT-IBSS.
root@(none):/# 
root@(none):/# 

modified mach-wrt400n.c for XWR100.

/*
 *  Linksys WRT400N board support
 *
 *  Copyright (C) 2009-2012 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/mtd/mtd.h>
#include <linux/mtd/partitions.h>

#include <asm/mach-ath79/ath79.h>

#include "dev-ap9x-pci.h"
#include "dev-eth.h"
#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#include "dev-m25p80.h"
#include "machtypes.h"

#define WRT400N_GPIO_LED_POWER        1
#define WRT400N_GPIO_LED_WPS_BLUE    4
#define WRT400N_GPIO_LED_WPS_AMBER    5
#define WRT400N_GPIO_LED_WLAN        6

#define WRT400N_GPIO_BTN_RESET        8
#define WRT400N_GPIO_BTN_WLSEC        3

#define WRT400N_KEYS_POLL_INTERVAL    20    /* msecs */
#define WRT400N_KEYS_DEBOUNE_INTERVAL    (3 * WRT400N_KEYS_POLL_INTERVAL)

#define WRT400N_MAC_ADDR_OFFSET        0x110C
#define WRT400N_CALDATA0_OFFSET        0x1000
#define WRT400N_CALDATA1_OFFSET        0x5000

static struct mtd_partition wrt400n_partitions[] = {
    {
        .name        = "uboot",
        .offset        = 0,
        .size        = 0x030000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "env",
        .offset        = 0x030000,
        .size        = 0x010000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "linux",
        .offset        = 0x040000,
        .size        = 0x170000,
    }, {
        .name        = "rootfs",
        .offset        = 0x1B0000,
        .size        = 0x630000,
    }, {
        .name        = "nvram",
        .offset        = 0x7b0000,
        .size        = 0x010000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "factory",
        .offset        = 0x7c0000,
        .size        = 0x010000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "language",
        .offset        = 0x7d0000,
        .size        = 0x020000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "caldata",
        .offset        = 0x7f0000,
        .size        = 0x010000,
        .mask_flags    = MTD_WRITEABLE,
    }, {
        .name        = "firmware",
        .offset        = 0x040000,
        .size        = 0x770000,
    }
};

static struct flash_platform_data wrt400n_flash_data = {
    .parts        = wrt400n_partitions,
    .nr_parts    = ARRAY_SIZE(wrt400n_partitions),
};

static struct gpio_led wrt400n_leds_gpio[] __initdata = {
    {
        .name        = "wrt400n:blue:wps",
        .gpio        = WRT400N_GPIO_LED_WPS_BLUE,
        .active_low    = 1,
    }, {
        .name        = "wrt400n:amber:wps",
        .gpio        = WRT400N_GPIO_LED_WPS_AMBER,
        .active_low    = 1,
    }, {
        .name        = "wrt400n:blue:wlan",
        .gpio        = WRT400N_GPIO_LED_WLAN,
        .active_low    = 1,
    }, {
        .name        = "wrt400n:blue:power",
        .gpio        = WRT400N_GPIO_LED_POWER,
        .active_low    = 0,
        .default_trigger = "default-on",
    }
};

static struct gpio_keys_button wrt400n_gpio_keys[] __initdata = {
    {
        .desc        = "reset",
        .type        = EV_KEY,
        .code        = KEY_RESTART,
        .debounce_interval = WRT400N_KEYS_DEBOUNE_INTERVAL,
        .gpio        = WRT400N_GPIO_BTN_RESET,
        .active_low    = 1,
    }, {
        .desc        = "wlsec",
        .type        = EV_KEY,
        .code        = KEY_WPS_BUTTON,
        .debounce_interval = WRT400N_KEYS_DEBOUNE_INTERVAL,
        .gpio        = WRT400N_GPIO_BTN_WLSEC,
        .active_low    = 1,
    }
};

static void __init wrt400n_setup(void)
{
    u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
    u8 *mac = art + WRT400N_MAC_ADDR_OFFSET;

    ath79_register_mdio(0, 0x0);

    ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
    ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
    ath79_eth0_data.speed = SPEED_100;
    ath79_eth0_data.duplex = DUPLEX_FULL;

    ath79_init_mac(ath79_eth1_data.mac_addr, mac, 2);
    ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
    ath79_eth1_data.phy_mask = 0x10;

    ath79_register_eth(0);
    ath79_register_eth(1);

    ath79_register_m25p80(&wrt400n_flash_data);

    ath79_register_leds_gpio(-1, ARRAY_SIZE(wrt400n_leds_gpio),
                 wrt400n_leds_gpio);

    ath79_register_gpio_keys_polled(-1, WRT400N_KEYS_POLL_INTERVAL,
                    ARRAY_SIZE(wrt400n_gpio_keys),
                    wrt400n_gpio_keys);
    //ap94_pci_init(art + WRT400N_CALDATA0_OFFSET, art + 0x110C,
    //          art + WRT400N_CALDATA1_OFFSET, art + 0x520C);
    
    ap94_pci_init(    art + WRT400N_CALDATA0_OFFSET, 
                    art + 0x110C,
                    art + WRT400N_CALDATA1_OFFSET, 
                    art + 0x520C);
}

MIPS_MACHINE(ATH79_MACH_WRT400N, "WRT400N", "Linksys WRT400N", wrt400n_setup);

If someone need more information, please kindly let me know.
I really want make openwrt to work on this device.
If possible, I can create a teamview remote for debug. (console with XWR100)

Thanks,

this router is very cheap now on 1saleaday.com, only $20
i just order 1 and will join the party to make this router working on openwrt
can you check in patches in git for any changes you modified so far for xwr100 ?

Re: Add support of VIZIO XWR100 (based on WRT400N)

Hi dony71,
I would push my modification for XWR100 on github later,
Because today is weekend....I need to be together with my daughter.

Thanks,

6 (edited by cmtsij 2013-04-20 19:33:22)

Re: Add support of VIZIO XWR100 (based on WRT400N)

here is my modification for XWR100.
https://github.com/cmtsij/openwrt  @xwr100_alpha
Please select WRT400 when make menuconfig. (this is alpha version)

Wiki for XWR100: http://wiki.openwrt.org/toh/vizio/xwr100

Re: Add support of VIZIO XWR100 (based on WRT400N)

thank's cmtsij
is this source based on attitude adjustment?

Re: Add support of VIZIO XWR100 (based on WRT400N)

No, base on BARRIER BREAKER.
base on git  01ca6e26f97769bf7e81ca0d0311d726ed0c00f3.
or base on svn svn://svn.openwrt.org/openwrt/trunk@36367

9 (edited by cmtsij 2013-04-22 11:58:00)

Re: Add support of VIZIO XWR100 (based on WRT400N)

UPDATE:

source code:
    xwr100_alpha branch is CLOSED/DELETED. (depend on WRT400N)
    Please use xwr100 branch, and build with new Target Profile for "Vizio XWR100".
    add usb support.

wireless:
     Disable 2.4GHz interface for workaround. (Only enable 5GHz in mach-xwr100.c .)

led:
    userspace action of LEDs are configured. (USB, WLAN, and POWER).

image:
    support using factory image in Vizio WEB UI to OpenWrt.

10 (edited by dony71 2013-04-22 23:31:57)

Re: Add support of VIZIO XWR100 (based on WRT400N)

instruction to flash image is missing
can you add this guideline?

Re: Add support of VIZIO XWR100 (based on WRT400N)

dony71 wrote:

instruction to flash image is missing
can you add this guideline?

After you build the image from source,
You can login Vizio stock WEB GUI, find the version page, and [advance] button,
and upgrade with the file "openwrt/bin/ar71xx/openwrt-ar71xx-generic-xwr100-squashfs-factory.bin".
After that, the device would become a openwrt device.
If you need upgrade again, please use "openwrt/bin/ar71xx/openwrt-ar71xx-generic-xwr100-squashfs-sysupgrade.bin"

Hint:
    factory image: from stock to openwrt
    sysupgrade image: from openwrt to openwrt

Thanks,

12 (edited by dony71 2013-04-23 02:44:17)

Re: Add support of VIZIO XWR100 (based on WRT400N)

cmtsij wrote:
dony71 wrote:

instruction to flash image is missing
can you add this guideline?

After you build the image from source,
You can login Vizio stock WEB GUI, find the version page, and [advance] button,
and upgrade with the file "openwrt/bin/ar71xx/openwrt-ar71xx-generic-xwr100-squashfs-factory.bin".
After that, the device would become a openwrt device.
If you need upgrade again, please use "openwrt/bin/ar71xx/openwrt-ar71xx-generic-xwr100-squashfs-sysupgrade.bin"

Hint:
    factory image: from stock to openwrt
    sysupgrade image: from openwrt to openwrt

Thanks,

my compiled image crash and i need to flash from serial console
how to do if i want to upgrade from serial console?
i remember last time you put in readme?

Re: Add support of VIZIO XWR100 (based on WRT400N)

dony71 wrote:

my compiled image crash and i need to flash from serial console
how to do if i want to upgrade from serial console?
i remember last time you put in readme?

you need a tftp server (with server ip: 192.168.1.5)
command on host:
    cp build_dir/target-mips_r2_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/vmlinux-xwr100.uImage TFTP_ROOT/vmlinux.lzma.uImage
    cp bin/ar71xx/openwrt-ar71xx-generic-root.squashfs-64k TFTP_ROOT/rootfs.squash

connand on device:
    printenv
----------------
loadLinux=tftpboot 0x80010000 vmlinux.lzma.uImage;erase 0xbf040000 +0x160000;cp.b 0x80010000 0xbf040000 0x160000                                     
loadFiles=tftpboot 0x80010000 rootfs.squash;erase 0xbf1b0000 +0x600000;cp.b 0x80010000 0xbf1b0000 0x600000
upgrade=run loadLinux;run loadFiles
----------------
if you see the the lines on above, just command "run upgrade".
If Not, please use those two commands to flash:
    tftpboot 0x80010000 vmlinux.lzma.uImage;erase 0xbf040000 +0x160000;cp.b 0x80010000 0xbf040000 0x160000
    tftpboot 0x80010000 rootfs.squash;erase 0xbf1b0000 +0x600000;cp.b 0x80010000 0xbf1b0000 0x600000
upgrade=run loadLinux;run loadFiles

14 (edited by dony71 2013-04-24 01:00:38)

Re: Add support of VIZIO XWR100 (based on WRT400N)

also do you know how to flash back original vizio firmware?

15 (edited by cmtsij 2013-12-16 06:18:10)

Re: Add support of VIZIO XWR100 (based on WRT400N)

dony71 wrote:

also do you know how to flash back original vizio firmware?

yes, you need to extract kernel and rootfs from stock released firmware.
http://store.vizio.com/documents/downloads/accessories/XWR100/677VIZIO_1.01.02_Jun-9-2010.bin
mirror url:
    https://github.com/cmtsij/Vizio_XWR100_ … 9-2010.bin

I used a command "binwalk" to parse stock firmware and find out the offset of kernel and rootfs.

$ binwalk 677VIZIO_1.01.02_Jun-9-2010.bin 

DECIMAL       HEX           DESCRIPTION
-------------------------------------------------------------------------------------------------------
60            0x3C          uImage header, header size: 64 bytes, header CRC: 0xB0EFB4D1, created: Fri Jun 11 23:40:22 2010, image size: 1039679 bytes, Data Address: 0x80002000, Entry Point: 0x802DE000, data CRC: 0x8671563A, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: Linux Kernel Image
124           0x7C          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 3133574 bytes
1039803       0xFDDBB       Squashfs filesystem, big endian, version 3.0, size: 3800569 bytes, 638 inodes, blocksize: 65536 bytes, created: Fri Jun 11 23:41:16 2010
4417467       0x4367BB      PNG image, 375 x 682, 8-bit colormap, non-interlaced
4466639       0x4427CF      PNG image, 157 x 49, 8-bit/color RGBA, non-interlaced
4473924       0x444444      GIF image data, version 89a, 1 x 1 

you need two sections : "uImage header" and "Squashfs filesystem"
use "dd" command to extact the "uImage heade" as kernal image
dd if=677VIZIO_1.01.02_Jun-9-2010.bin  of=vmlinux.lzma.uImage bs=1 skip=60 count=1507328
(count size is maxium size of linux mtdblock)

agiain, to extract "Squashfs filesystem" as root file system
dd if=677VIZIO_1.01.02_Jun-9-2010.bin  of=rootfs.squash bs=1 skip=1039803 count=6291456
(count size is maxium size of rootfs mtdblock)

after extracting, you can use tftp to flash back vizio stock from openwrt to vizio.

Also I backup all stock firmware by dump /dev/mtdblockX before working to being OpenWrt.
If you did that, you can roll back vizio firmware by dump those mtdblock back easily.

Good Luck.

Re: Add support of VIZIO XWR100 (based on WRT400N)

barrier breaker is still premature and don't have Luci
so i modify backfire.10.3.1 and i have the same issue
interestingly kernel panic coming from ath9k_deinit_device
===========================================
Configuration file: /var/run/hostapd-phy0.conf
PCI error 1 at PCI addr 0x10017820
Data bus error, epc == 80de1aa0, ra == 80de1a9c
Oops[#1]:
Cpu 0
$ 0   : 00000000 00000000 deadc0de 00000000
$ 4   : b0008048 b0000000 02000020 00000000
$ 8   : 80de1a0c 00000003 00000004 80cc1044
$12   : 00000005 00000006 00000001 00000000
$16   : 80cc15c0 80cc8000 00008048 ffffffff
$20   : 02000020 00000002 00007894 ffbfffff
$24   : 00000010 00000000
$28   : 816d0000 816d1ca0 80cc8164 80de1a9c
Hi    : 00000000
Lo    : 19d60000
epc   : 80de1aa0 ath9k_deinit_device+0x174/0x488 [ath9k]
    Not tainted
ra    : 80de1a9c ath9k_deinit_device+0x170/0x488 [ath9k]
Status: 1000f403    KERNEL EXL IE
Cause : 1080001c
PrId  : 00019374 (MIPS 24Kc)
Modules linked in: usb_storage ohci_hcd nf_nat_snmp_basic nf_nat_sip nf_conntrac
k_sip nf_nat_rtsp nf_conntrack_rtsp nf_nat_pptp nf_conntrack_pptp nf_nat_h323 nf
_conntrack_h323 nf_nat_proto_gre nf_conntrack_proto_gre nf_nat_amanda nf_conntra
ck_amanda nf_nat_tftp nf_conntrack_tftp nf_nat_irc nf_conntrack_irc nf_nat_ftp n
f_conntrack_ftp xt_quota xt_pkttype xt_owner ipt_REDIRECT ipt_NETMAP ipt_MASQUER
ADE iptable_nat nf_nat xt_CONNMARK xt_recent xt_helper xt_conntrack xt_connmark
xt_connbytes xt_NOTRACK iptable_raw xt_state nf_conntrack_ipv4 nf_defrag_ipv4 nf
_conntrack ehci_hcd sd_mod pppoe pppox ipt_REJECT xt_TCPMSS ipt_LOG xt_comment x
t_multiport xt_mac xt_limit iptable_mangle iptable_filter ip_tables xt_tcpudp x_
tables ppp_async ppp_generic slhc vfat fat ext4 jbd2 cifs ath9k ath9k_common ath
9k_hw ath nls_utf8 mac80211 usbcore ts_fsm ts_bm ts_kmp scsi_mod nls_base mbcach
e crc16 crc_ccitt cfg80211 compat arc4 aes_generic deflate ecb cbc leds_gpio but
ton_hotplug gpio_buttons input_polldev input_core
Process hostapd (pid: 8888, threadinfo=816d0000, task=81883ae8, tls=00000000)
Stack : 00000001 00000000 81a89d68 816d1cd8 816d1cd8 80cc8000 0000016d 00000004
        00000002 80d8ce5c 80cc8000 00000000 00000001 20000000 000002c7 80d8474c
        80cc8000 80d84f58 00000001 80cc8000 00000000 00000000 80cc1e5c 20000000
        00000000 80cc8164 00000000 80d86014 00000001 80cc0a40 80cc1e5c 00000001
        7f813dd0 7f813df0 80cc8000 80cc15c0 80ca8800 80cc8164 80cc1e5c 00000001
        ...
Call Trace:
[<80de1aa0>] ath9k_deinit_device+0x174/0x488 [ath9k]


Code: 0c060ee9  00852021  8e050894 <00531024> 00548025  00b22821  0c060efe  0200
2021  8fbf0024
Disabling lock debugging due to kernel taint
Kernel panic - not syncing: Fatal exception in interrupt

17 (edited by cmtsij 2013-04-24 18:28:22)

Re: Add support of VIZIO XWR100 (based on WRT400N)

Hi dony71,
I buld a workaround version with Luci.
Download here: http://d-h.st/K4i
It's based on barrier breaker.
Please help to verify this and feedback.
Thanks.

18 (edited by dony71 2013-04-26 00:08:15)

Re: Add support of VIZIO XWR100 (based on WRT400N)

cmtsij wrote:

Hi dony71,
I buld a workaround version with Luci.
Download here: http://d-h.st/K4i
It's based on barrier breaker.
Please help to verify this and feedback.
Thanks.

i integrate lots of module in my backfire firmware
so no more space when i try sysupgrade
can you send me uImage and roofs?
also if you kindly integrate luci in your git
so that i can compile by myself?

i notice you modify ath9k to fix wlan0 issue
i try to modify backfire source which based on kernel 2.6.32.27
however i couldn't find any
read modify write register function (ath9k_reg_rmw)
can you tell me where this function needed?

Re: Add support of VIZIO XWR100 (based on WRT400N)

Here is the tftp image: http://d-h.st/nqZ.
Also, you can build a trunk iamge with Luci by follow this : http://wiki.openwrt.org/doc/devel/feeds#install

I wouldn't backporting this workaround onto backfire.
if you need to modify backfire to let XWR100 work, I think you need do it yourself.

wlan0 is on PCI bus, and kernel iomap this PCI control on  a range of memory.
kernel use this range to control wireless interface.
ath9k_reg_rmw() is a function to access(read/write) the mapped memory.
diffent offset is diffent pci command.

20 (edited by dony71 2013-04-30 20:02:39)

Re: Add support of VIZIO XWR100 (based on WRT400N)

i notice switch doesn't work
swconfig dev eth1 show or swconfig dev AR8236 return
Failed to connect to the switch
any idea to patch this to work?

21 (edited by cmtsij 2013-05-02 09:56:40)

Re: Add support of VIZIO XWR100 (based on WRT400N)

dony71 wrote:

i notice switch doesn't work
swconfig dev eth1 show or swconfig dev AR8236 return
Failed to connect to the switch
any idea to patch this to work?

Please take a look another branch
https://github.com/cmtsij/openwrt/tree/xwr100_switch
status:
     swconfig: work
know issue:
     eth0.1: fail to use. (I add eth0,1 into LAN, and remove eth0 out of LAN)

Because I don't know how/when to use vlan function.
I would stop trace or study switch function.

If you find out something, still be welcome to discuss.
Thanks,

22 (edited by dony71 2013-05-02 21:25:52)

Re: Add support of VIZIO XWR100 (based on WRT400N)

cmtsij wrote:
dony71 wrote:

i notice switch doesn't work
swconfig dev eth1 show or swconfig dev AR8236 return
Failed to connect to the switch
any idea to patch this to work?

Please take a look another branch
https://github.com/cmtsij/openwrt/tree/xwr100_switch
status:
     swconfig: work
know issue:
     eth0.1: fail to use. (I add eth0,1 into LAN, and remove eth0 out of LAN)

Because I don't know how/when to use vlan function.
I would stop trace or study switch function.

If you find out something, still be welcome to discuss.
Thanks,

you cannot make use of this switch to build vlan connection because
switch is attached to device name switch0 instead of eth0
that's why if you attach eth0.1, it fails to use because switch name is not eth0
however if manually i configure LAN to attached switch0.1 (name of vlan switch0 vlan_id 1)
in /etc/config/network under options ifname 'switch0.1'
then device eth0 will be down, but irq and address map to CPU being assigned to eth0
which makes no connectivity also in LAN
i think somehow need to patch the code to change device switch0 becomes eth0
for switch function.
i read in forum, i guess if switch attached with device eth0, in dmesg will show similar like this

kern.info kernel: [    0.660000] ag71xx_mdio: probed
kern.info kernel: [    0.660000] eth0: Atheros AG71xx at 0xb9000000, irq 4
kern.info kernel: [    1.240000] eth0: AR8316 switch driver attached.
kern.info kernel: [    1.240000] ar8316: Using port 4 as switch port
kern.info kernel: [    1.340000] ag71xx ag71xx.0: eth0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd041, driver=Atheros AR8216/AR8236/AR8316]

Re: Add support of VIZIO XWR100 (based on WRT400N)

switch info of dmesg in XWR100:

[    3.000000] switch0: Atheros AR8236 switch registered on ag71xx-mdio.0
[    3.020000] libphy: ag71xx_mdio: probed
[    3.020000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RMII
[    3.330000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:RMII
[    3.640000] ag71xx ag71xx.1 eth1: connected to PHY at ag71xx-mdio.0:04 [uid=004dd043, driver=Atheros AR8216/AR8236/AR8316]

swconfig list:

root@OpenWrt:/# swconfig list
Found: switch0 - ag71xx-mdio.0
root@OpenWrt:/#

current switch config in /etc/config/network

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 4'

Re: Add support of VIZIO XWR100 (based on WRT400N)

cmtsij wrote:

switch info of dmesg in XWR100:

[    3.000000] switch0: Atheros AR8236 switch registered on ag71xx-mdio.0
[    3.020000] libphy: ag71xx_mdio: probed
[    3.020000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RMII
[    3.330000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:RMII
[    3.640000] ag71xx ag71xx.1 eth1: connected to PHY at ag71xx-mdio.0:04 [uid=004dd043, driver=Atheros AR8216/AR8236/AR8316]

swconfig list:

root@OpenWrt:/# swconfig list
Found: switch0 - ag71xx-mdio.0
root@OpenWrt:/#

current switch config in /etc/config/network

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 4'

you see switch0 but you cannot use it because switch0 is not binding to eth0
you can try this configuration below, still cannot use eth0.1 for vlan
http://coderazzi.net/howto/openwrt/tl841n/vlans.htm

Re: Add support of VIZIO XWR100 (based on WRT400N)

btw, i don't like barrier breaker.
luci is lagging, also today i try to use USB pendrive
it's so buggy, cannot mounted to dev, not useable at all
i check backfire code, it seems ar8236 not implemented yet
then i check attitude adjustment, ar8236 is implemented, but
i don't understand why code doesn't use any phy_id detection
can you help how to modify on attitude adjustment?