Gmane
From: Cyril Humbert <cyril.humbert <at> martec.fr>
Subject: Compulab CM-x270 with Unex CM10 (Atheros AR5414A): unable to attach hardware (HAL status 3)
Newsgroups: gmane.linux.drivers.madwifi.user
Date: 2008-07-30 14:31:42 GMT (23 weeks, 1 day, 17 hours and 58 minutes ago)
[Please CC: I don't subscribe to the list]

Hello,

I try to use madwifi driver for a miniPCI 802.11abg board with an
Atheros AR5414A chipset.

Atheros modules are correctly loaded but ath_pci fails to «attach
hardware». In dmeg output, I get::

     ath_pci: 0.9.4
     PCI: enabling device 0000:00:11.0 (0000 -> 0002)
     wifi%d: unable to attach hardware: 'Hardware didn't respond as 
expected' (HAL status 3)

Hardware infos
==============

Target is a cm-x270 board from Compulab::

       http://www.compulab.co.il/x270cm/html/x270-cm-datasheet.htm

Processor is XScale-PXA270 ::

     root <at> cm-x270:~# cat /proc/cpuinfo
     Processor	        : XScale-PXA270 rev 7 (v5l)
     BogoMIPS	        : 517.73
     Features	        : swp half thumb fastmult edsp iwmmxt
     CPU implementer	: 0x69
     CPU architecture    : 5TE
     CPU variant	        : 0x0
     CPU part	        : 0x411
     CPU revision        : 7
     (../..)

Wifi board is cm10 from Unex (http://www.unex.com.tw/product/cm10).
According to http://madwifi.org/wiki/Compatibility/Unex#CM10, this board
is fully supported by madwifi driver.

Since cm-x270 board is at PC-104plus format, an additional adapter is 
used to connect the miniPCI wifi board to the cm-x270 board::

     http://www.lippert-at.com/index.php?id=399

Cross-compilation infos
=======================

Poky-3.1.1 (see: http://www.pokylinux.org/) is used as build system,

* A «BitBake recipe» for madwifi-0.9.4 was created. It was adapted from
   OpenEmbedded dev tree::

 
http://git.openembedded.net/?p=org.openembedded.dev.git;a=tree;f=packages/madwifi;h=3318f40c3492745825f5ae3599b5e5539b995bd9;hb=78f1d79f91f582645fa3780d8172a4ba69f59342

* Linux-2.6.23 kernel from Poky-3.1.1 was replaced by Linux-2.6.24 with
   additional patches from Compulab (see: 
http://www.compulab.co.il/mediawiki/index.php5?title=CM-X270_Linux)

* TARGET=xscale-le-elf

* Since ARM EABI is used, option «CONFIG_OABI_COMPAT=y» was
   set in kernel configuration and ''--no-warn-mismatch'' was added to 
LDFLAGS
   (see: http://madwifi.org/ticket/1384)

* In order to compile with arm-poky-linux-gnueabi-gcc-4.1.2, COPTS was
   changed as follows::

       --- madwifi-0.9.4.orig/hal/public/xscale-le-elf.inc	2008-07-23 
15:49:09.000000000 +0200
      +++ madwifi-0.9.4/hal/public/xscale-le-elf.inc	2008-07-23 
15:50:23.000000000 +0200
      @@ -78,5 +78,5 @@

       LDOPTS=	-EL
       COPTS+=	-DAH_BYTE_ORDER=AH_LITTLE_ENDIAN
      -COPTS+= -march=armv4 -mlittle-endian -fno-strict-aliasing 
-fno-common \
      -	-mapcs-32 -mtune=xscale  -mshort-load-bytes
      +COPTS+= -march=armv5te -mtune=xscale -mlittle-endian \
      +	-fno-strict-aliasing -fno-common

Additional infos
================

Kernel
------

root <at> cm-x270:~# uname -a
Linux cm-x270 2.6.24-cm-x270 #1 Mon Jul 28 11:31:40 CEST 2008 armv5tel 
unknown

root <at> cm-x270:~# zcat /proc/config.gz | grep "[EO]ABI"
CONFIG_AEABI=y
CONFIG_OABI_COMPAT=y

root <at> cm-x270:~# zcat /proc/config.gz | grep "SYSCT"
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_SYSCTL=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_PROC_SYSCTL=y

root <at> cm-x270:~# zcat /proc/config.gz | grep "WIRELESS"
CONFIG_WIRELESS_EXT=y

root <at> cm-x270:~# zcat /proc/config.gz | grep KMOD
CONFIG_KMOD=y

root <at> cm-x270:~# lsmod
Module                  Size  Used by
rfcomm                 35252  0
hidp                   14688  0
l2cap                  19716  10 rfcomm,hidp
ath_pci                92224  0
hci_usb                13084  2
wlan                  191212  1 ath_pci
bluetooth              52544  8 rfcomm,hidp,l2cap,hci_usb
8139too                19456  0
ath_hal               210808  1 ath_pci

root <at> cm-x270:~# dmesg |egrep -i "(pci|wlan|wifi)"
Initializing CM-X270 PCI subsystem
PCI Bridge found.
PCI: bus0: Fast back to back transfers disabled
dmabounce: registered device 0000:00:01.0 on pci bus
dmabounce: registered device 0000:00:01.2 on pci bus
dmabounce: registered device 0000:00:01.4 on pci bus
dmabounce: registered device 0000:00:10.0 on pci bus
dmabounce: registered device 0000:00:11.0 on pci bus
PCI: enabling device 0000:00:10.0 (0000 -> 0003)
PCI: Setting latency timer of device 0000:00:10.0 to 64
wlan: 0.9.4
ath_pci: 0.9.4
PCI: enabling device 0000:00:11.0 (0000 -> 0002)
wifi%d: unable to attach hardware: 'Hardware didn't respond as expected' 
(HAL status 3)

Atheros modules infos
---------------------

root <at> cm-x270:~# modinfo ath_hal
filename:       /lib/modules/2.6.24-cm-x270/net/ath_hal.ko
license:        Proprietary
version:        0.9.18.0
description:    Atheros Hardware Access Layer (HAL)
author:         Errno Consulting, Sam Leffler
srcversion:     37DDE079A88844C323AE724
depends:
vermagic:       2.6.24-cm-x270 mod_unload ARMv5

root <at> cm-x270:~# modinfo ath_pci
filename:       /lib/modules/2.6.24-cm-x270/net/ath_hal.ko
license:        Proprietary
version:        0.9.18.0
description:    Atheros Hardware Access Layer (HAL)
author:         Errno Consulting, Sam Leffler
srcversion:     37DDE079A88844C323AE724
depends:
vermagic:       2.6.24-cm-x270 mod_unload ARMv5
root <at> cm-x270:~# modinfo ath_pci
filename:       /lib/modules/2.6.24-cm-x270/net/ath_pci.ko
license:        Dual BSD/GPL
version:        0.9.4
description:    Support for Atheros 802.11 wireless LAN cards.
author:         Errno Consulting, Sam Leffler
srcversion:     78B3B33DB7A60B18ED2F434
(.../...)

root <at> cm-x270:~# modinfo wlan | grep version
version:        0.9.4
srcversion:     FE186501F5B510C26DF717C

PCI infos
=========

root <at> cm-x270:~# lspci -tv
-[0000:00]-+-01.0  Integrated Technology Express, Inc. IT8152F/G 
Advanced RISC-to-PCI Companion Chip
            +-01.2  Integrated Technology Express, Inc. IT8152F/G 
Advanced RISC-to-PCI Companion Chip
            +-01.4  Integrated Technology Express, Inc. IT8152F/G 
Advanced RISC-to-PCI Companion Chip
            +-10.0  Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
            \-11.0  Atheros Communications Inc. AR5413 802.11abg NIC

lspci says the chipset is AR413 (pci.ids of June, 22 2008), but actually 
it is AR5414A (see: http://madwifi.org/wiki/Compatibility/Unex#CM10).

root <at> cm-x270:~# lspci -tvn
-[0000:00]-+-01.0  1283:8152
            +-01.2  1283:8152
            +-01.4  1283:8152
            +-10.0  10ec:8139
            \-11.0  168c:001b

root <at> cm-x270:~# lspci -tvn
(.../...)

00:11.0 Ethernet controller: Atheros Communications Inc. AR5413 
802.11abg NIC (rev 01)
	Subsystem: Wistron NeWeb Corp. Unknown device 1600
	Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
	Interrupt: pin A routed to IRQ 281
	Region 0: [virtual] Memory at 10000000 (32-bit, non-prefetchable) 
[size=64K]
	Capabilities: [44] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA 
PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=2 PME-

Notes
=====

* Same problem using madwifi svn-r3823 (20080725).

* Is this issue related
to
http://madwifi.org/wiki/UserDocs/Troubleshooting#WhenIloadtheath_pcimoduleIgetunabletoattachhardware:HardwaredidntrespondasexpectedHALstatus3 
?
In this case, which parameters should I pass to setpci?

Thanks for your help.
Best regards,
-- 
Cyril

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/