From owner-freebsd-current@FreeBSD.ORG Thu Dec 13 21:11:07 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DBDCF3A for ; Thu, 13 Dec 2012 21:11:07 +0000 (UTC) (envelope-from husyh@hush.com) Received: from smtp1.hushmail.com (smtp1.hushmail.com [65.39.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 662F48FC1B for ; Thu, 13 Dec 2012 21:11:07 +0000 (UTC) Received: from smtp1.hushmail.com (localhost.localdomain [127.0.0.1]) by smtp1.hushmail.com (Postfix) with SMTP id A1D282FE84 for ; Thu, 13 Dec 2012 21:11:00 +0000 (UTC) Received: from smtp.hushmail.com (w4.hushmail.com [65.39.178.50]) by smtp1.hushmail.com (Postfix) with ESMTP; Thu, 13 Dec 2012 21:11:00 +0000 (UTC) Received: by smtp.hushmail.com (Postfix, from userid 99) id 5395F10E2C8; Thu, 13 Dec 2012 21:11:00 +0000 (UTC) MIME-Version: 1.0 Date: Thu, 13 Dec 2012 22:11:00 +0100 To: "Adrian Chadd" , "John Baldwin" Subject: Re: ath0: unable to attach hardware From: husyh@hush.com In-Reply-To: References: <20121123213551.C2CB9E6739@smtp.hushmail.com> <201212101437.54825.jhb@freebsd.org> <201212111549.49942.jhb@freebsd.org> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="UTF-8" Message-Id: <20121213211100.5395F10E2C8@smtp.hushmail.com> Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 21:11:07 -0000 Hello everyone, I'm afraid I still don't know what exactly BAR is, or how I get its value that I'm supposed to plug into the line John provided: dd if=/dev/mem bs=4 iseek=((start of bar + reg offset)/4) count=1 | hd I assumed that "start of bar" is 0xfdee0000 in my case, since dmesg reports ath0: mem 0xfdee0000-0xfdeeffff irq 16 at device 4.0 on pci2 This is what I get: # dd if=/dev/mem bs=4 iseek=`echo "ibase=16; (FDEE0000+4004)/4" | bc` count=1 | hd 00 00 01 00 # dd if=/dev/mem bs=4 iseek=`echo "ibase=16; (FDEE0000+4010)/4" | bc` count=1 | hd 14 00 01 00 Please correct me if my assumption about "start of bar" was wrong and/or I made some other mistake. Also, please don't hesitate to ask me to do anything else that might help you during debugging. Thank you very much for the effort. > >On 11 December 2012 12:49, John Baldwin wrote: > > >> Look, it's up to you to look at more registers if you want to >debug this >> further. PCI says everything is ok, so the ball is in your >court. > >Right, that's why I've asked for those two above registers. > >There are other things that could be wrong - eg, the device may >actually not have reset correctly. > >This isn't the first time that someone's come to me with a "linux >works, freebsd doesn't" for an AR5212 era NIC. ath5k and FreeBSD do >the same thing at probe/attach time. I believe they do the same >thing >during device power-on time too. There's some corner cases where >the >chip doesn't reset right because the BIOS PCI bus reset code does >things in a brain dead manner (eg doing two PCI bus resets back to >back with not enough time in between for the MAC to settle.) > >There may be PCI code differences in how Linux and FreeBSD does >things >like "reset the PCI bus." > > > >Adrian