OpenWrt Forum Archive

Topic: Atheros 9580 wireless card detection issue

The content of this topic has been archived on 26 Jun 2015. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am trying to flash new firmware on tplink wdr3500 router with openwrt package.I can successfully build and flash new binary but issue in detection of Atheros 9580 wireless card.It's give me error like "[   11.700000] ath: phy0: ath_ahb_eeprom_read: flash read failed, offset ffffffff is out of range" for more understand i also attach boot log.

Let me know where is the problem.



Booting image at 9f020000 ...
   Uncompressing Kernel Image ... OK

Starting kernel ...

[    0.000000] Linux version 3.18.8 (paresh@paresh-Studio-1555) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r44620) ) #2 Sat Mar 7 17:54:00 IST 2015
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] SoC: Atheros AR9344 rev 2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x07ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x07ffffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000-0x07ffffff]
[    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: 32512
[    0.000000] Kernel command line:  board=TL-WDR3500 console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 126316K/131072K available (2270K kernel code, 114K rwdata, 412K rodata, 200K init, 179K bss, 4756K reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.000000] Clocks: CPU:560.000MHz, DDR:450.000MHz, AHB:225.000MHz, Ref:40.000MHz
[    0.000000] Calibrating delay loop... 278.93 BogoMIPS (lpj=1394688)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.070000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.080000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.080000] NET: Registered protocol family 16
[    0.090000] MIPS: machine is TP-LINK TL-WDR3500
[    0.090000] registering PCI controller with io_map_base unset
[    0.550000] PCI host bridge to bus 0000:00
[    0.550000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[    0.560000] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.560000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.570000] pci 0000:00:00.0: invalid calibration data
[    0.570000] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1001ffff 64bit]
[    0.580000] pci 0000:00:00.0: BAR 6: assigned [mem 0x10020000-0x1002ffff pref]
[    0.580000] pci 0000:00:00.0: using irq 40 for pin 1
[    0.590000] Switched to clocksource MIPS
[    0.590000] NET: Registered protocol family 2
[    0.600000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.600000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.610000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.610000] TCP: reno registered
[    0.620000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.620000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.630000] NET: Registered protocol family 1
[    0.630000] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.650000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.650000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.660000] msgmni has been set to 246
[    0.680000] io scheduler noop registered
[    0.680000] io scheduler deadline registered (default)
[    0.690000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
▒[    0.720000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 2500000) is a 16550A
[    0.720000] console [ttyS0] enabled
[    0.720000] console [ttyS0] enabled
[    0.730000] bootconsole [early0] disabled
[    0.730000] bootconsole [early0] disabled
[    0.740000] m25p80 spi0.0: found s25fl064k, expected m25p80
[    0.750000] m25p80 spi0.0: s25fl064k (8192 Kbytes)
[    0.750000] 5 tp-link partitions found on MTD device spi0.0
[    0.760000] Creating 5 MTD partitions on "spi0.0":
[    0.760000] 0x000000000000-0x000000020000 : "u-boot"
[    0.770000] 0x000000020000-0x00000011c8f8 : "kernel"
[    0.770000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.790000] 0x00000011c8f8-0x0000007f0000 : "rootfs"
[    0.790000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.810000] mtd: device 2 (rootfs) set to be root filesystem
[    0.810000] 1 squashfs-split partitions found on MTD device rootfs
[    0.820000] 0x0000002e0000-0x0000007f0000 : "rootfs_data"
[    0.820000] 0x0000007f0000-0x000000800000 : "art"
[    0.830000] 0x000000020000-0x0000007f0000 : "firmware"
[    0.850000] libphy: ag71xx_mdio: probed
[    1.450000] ag71xx-mdio.1: Found an AR934X built-in switch
[    1.490000] eth0: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[    2.090000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd042, driver=Generic PHY]
[    2.100000] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[    2.100000] TCP: cubic registered
[    2.110000] NET: Registered protocol family 17
[    2.110000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    2.130000] 8021q: 802.1Q VLAN Support v1.8
[    2.140000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    2.150000] Freeing unused kernel memory: 200K (8031e000 - 80350000)
[    3.060000] init: Console is alive
[    3.070000] init: - watchdog -
[    4.130000] usbcore: registered new interface driver usbfs
[    4.140000] usbcore: registered new interface driver hub
[    4.150000] usbcore: registered new device driver usb
[    4.160000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.160000] ehci-platform: EHCI generic platform driver
[    4.170000] ehci-platform ehci-platform: EHCI Host Controller
[    4.170000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[    4.180000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[    4.210000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[    4.210000] hub 1-0:1.0: USB hub found
[    4.220000] hub 1-0:1.0: 1 port detected
[    5.120000] init: - preinit -
[    5.750000] random: mktemp urandom read with 9 bits of entropy available
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    8.940000] jffs2: notice: (334) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[    8.960000] mount_root: switching to jffs2 overlay
[    9.000000] procd: - early -
[    9.010000] procd: - watchdog -
[    9.710000] procd: - ubus -
[   10.720000] procd: - init -
Please press Enter to activate this console.
[   11.370000] NET: Registered protocol family 10
[   11.380000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   11.390000] Loading modules backported from Linux version master-2014-11-04-0-gf3660a2
[   11.400000] Backport generated by backports.git backports-20141023-2-g4ff890b
[   11.410000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   11.430000] nf_conntrack version 0.5.0 (1976 buckets, 7904 max)
[   11.470000] xt_time: kernel timezone is -0000
[   11.490000] cfg80211: Calling CRDA to update world regulatory domain
[   11.520000] cfg80211: World regulatory domain updated:
[   11.520000] cfg80211:  DFS Master region: unset
[   11.530000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   11.540000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   11.550000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   11.550000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[   11.560000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   11.570000] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[   11.580000] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   11.590000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   11.600000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[   11.650000] PPP generic driver version 2.4.2
[   11.660000] NET: Registered protocol family 24

[   11.700000] ath: phy0: ath_ahb_eeprom_read: flash read failed, offset ffffffff is out of range
[   11.710000] ath: phy0: Unable to initialize hardware; initialization status: -5
[   11.720000] ath9k ar934x_wmac: failed to initialize device
[   11.730000] ath9k: probe of ar934x_wmac failed with error -5
[   11.730000] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)

[   11.980000] ieee80211 phy1: Atheros AR9300 Rev:4 mem=0xb0000000, irq=40
[   11.990000] cfg80211: Calling CRDA for country: US
[   12.000000] cfg80211: Regulatory domain changed to country: US
[   12.000000] cfg80211:  DFS Master region: FCC
[   12.010000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   12.020000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A)
[   12.020000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 1700 mBm), (N/A)
[   12.030000] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (0 s)
[   12.040000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
[   12.050000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
[   18.650000] device eth0 entered promiscuous mode
[   18.660000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   18.680000] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   21.350000] eth1: link up (100Mbps/Full duplex)
[   21.350000] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   80.040000] random: nonblocking pool is initialized

I fixed this problem, you can try the latest 12.09, If failed again,

This patch is for openwrt_12.09 (AA) kernel 3.3.8
It adds the function for the case that having calibration data in eeprom of wifi pci card.
Compat-wireless provides the way "AH_USE_EEPROM"(see the macro below) to read the calibration data,
but the ap91_pci_init functionalities does has the correspond API. Thus ap91_pci_init() is not perfect.

macro in hw.h of compat-wireless
/* ah_flags */
#define AH_USE_EEPROM   0x1


After using the below patch, we can init the card(most of thoes are 5GHz pci card, such as AR958x) like thie way:
        ...
        ap91_pci_init(NULL, NULL);
        ...



Signed-off-by: banglang.huang<banglang.huang@foxmail.com>
---
diff --git a/arch/mips/ath79/dev-ap9x-pci.c b/arch/mips/ath79/dev-ap9x-pci.c
index c08e438..561e9b2 100644
--- a/arch/mips/ath79/dev-ap9x-pci.c
+++ b/arch/mips/ath79/dev-ap9x-pci.c
@@ -92,6 +92,12 @@ static int ap91_pci_plat_dev_init(struct pci_dev *dev)
  return 0;
}

+static int ap91_pci_plat_dev_init_simple(struct pci_dev *dev)
+{
+ dev->dev.platform_data = NULL;
+
+ return 0;
+}
__init void ap91_pci_init(u8 *cal_data, u8 *mac_addr)
{
  if (cal_data)
@@ -103,7 +109,11 @@ __init void ap91_pci_init(u8 *cal_data, u8 *mac_addr)
   ap9x_wmac0_data.macaddr = ap9x_wmac0_mac;
  }

- ath79_pci_set_plat_dev_init(ap91_pci_plat_dev_init);
+ if((!cal_data) && (!mac_addr))
+  ath79_pci_set_plat_dev_init(ap91_pci_plat_dev_init_simple);
+ else
+  ath79_pci_set_plat_dev_init(ap91_pci_plat_dev_init);
+
  ath79_register_pci();

  pci_enable_ath9k_fixup(0, ap9x_wmac0_data.eeprom_data);

Also getting below error while loading OpenWrt firmware.

ath: phy0: eeprom contains invalid mac address: 81:56:70:53:4a:da
[   11.520000] ath: phy0: random mac address will be used: 02:a0:fe:cc:55:38
[   11.530000] ath: Invalid EEPROM contents
[   11.540000] ath9k ar934x_wmac: failed to initialize device
[   11.540000] ath9k: probe of ar934x_wmac failed with error -22
[   11.550000] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[   11.560000] ath: phy1: eeprom contains invalid mac address: d1:16:38:41:4a:fa
[   11.560000] ath: phy1: random mac address will be used: 96:3f:b5:e0:0e:fd
[   11.570000] ath: Invalid EEPROM contents
[   11.580000] ath9k 0000:00:00.0: Failed to initialize device
[   11.580000] ath9k: probe of 0000:00:00.0 failed with error -22

sanjay143u wrote:

Also getting below error while loading OpenWrt firmware.

ath: phy0: eeprom contains invalid mac address: 81:56:70:53:4a:da
[   11.520000] ath: phy0: random mac address will be used: 02:a0:fe:cc:55:38
[   11.530000] ath: Invalid EEPROM contents
[   11.540000] ath9k ar934x_wmac: failed to initialize device
[   11.540000] ath9k: probe of ar934x_wmac failed with error -22
[   11.550000] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[   11.560000] ath: phy1: eeprom contains invalid mac address: d1:16:38:41:4a:fa
[   11.560000] ath: phy1: random mac address will be used: 96:3f:b5:e0:0e:fd
[   11.570000] ath: Invalid EEPROM contents
[   11.580000] ath9k 0000:00:00.0: Failed to initialize device
[   11.580000] ath9k: probe of 0000:00:00.0 failed with error -22



maybe you can trace the source code or debug it with printk function in compat-wireless-xxxx.

Thanks for reply. How can i patch arch kernel with CONFIG_ATH_USER_REGD ???

WDR 3500 wireless cards have been detected.

But when creating AP with hostapd/wpad-mini, its gives error "ath: Unable to reset hardware; reset status -5"
. Then my WDR 3500 got hangs and just reboot.

Can you please help me ?

ath: phy0: eeprom contains invalid mac address: 81:5e:78:53:4a:fa
[   11.340000] ath: phy0: random mac address will be used: 6e:b5:38:bb:c9:b5
[   11.350000] Sanjay->ath: EEPROM regdomain: 0xd6bc
[   11.350000] ath: EEPROM indicates we should expect a country code
[   11.350000] Sanjay ath: invalid regulatory domain/country code 0x96bc
[   11.350000] ath: Sanjay-->Invalid EEPROM contents
[   11.350000] ath9k ar934x_wmac: failed to initialize device
[   11.360000] ath9k: probe of ar934x_wmac failed with error -22
[   11.360000] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[   11.370000] ath: phy1: eeprom contains invalid mac address: c1:16:38:43:4a:fa
[   11.380000] ath: phy1: random mac address will be used: e2:b2:eb:ff:2e:0c
[   11.390000] Sanjay->ath: EEPROM regdomain: 0xd6fc
[   11.390000] ath: EEPROM indicates we should expect a country code
[   11.390000] Sanjay ath: invalid regulatory domain/country code 0x96fc
[   11.390000] ath: Sanjay-->Invalid EEPROM contents
[   11.390000] ath9k 0000:00:00.0: Failed to initialize device
[   11.400000] ath9k: probe of 0000:00:00.0 failed with error -22
[   81.390000] random: nonblocking pool is initialized

I am getting this error. each time its reads domain/country code 0x96bc & 0x96fc.. and hence give Invalid EEPROM contents error.

Please suggest whats going wrong. Whether it is issue with EEPROM reading if so then what is the issue.
Also loading original TPLINK WDR3500 firmware, works great.

Please help me.

My board is TP-WDR3500 V3  so which snapshost i have to use.???

The discussion might have continued from here.