From owner-freebsd-mobile@FreeBSD.ORG Tue Oct 10 13:22:18 2006 Return-Path: X-Original-To: freebsd-mobile@freebsd.org Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E68A16A4C2 for ; Tue, 10 Oct 2006 13:22:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 925F343D69 for ; Tue, 10 Oct 2006 13:22:12 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k9ADLtL7087145; Tue, 10 Oct 2006 09:22:01 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Bruno Ducrot Date: Tue, 10 Oct 2006 09:21:53 -0400 User-Agent: KMail/1.9.1 References: <20060930001213.a59d721c.torfinn.ingolfsen@broadpark.no> <200610091611.46706.jhb@freebsd.org> <20061010095205.GS4945@poupinou.org> In-Reply-To: <20061010095205.GS4945@poupinou.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610100921.54233.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Tue, 10 Oct 2006 09:22:01 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/2018/Tue Oct 10 08:04:40 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-mobile@freebsd.org Subject: Re: Acer Aspire 5672 and FreeBSD 6.2-beta1 X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2006 13:22:18 -0000 On Tuesday 10 October 2006 05:52, Bruno Ducrot wrote: > On Mon, Oct 09, 2006 at 04:11:46PM -0400, John Baldwin wrote: > > On Saturday 07 October 2006 15:03, Bruno Ducrot wrote: > > > On Sat, Oct 07, 2006 at 06:46:42PM +0200, Torfinn Ingolfsen wrote: > > > > On Sat, 07 Oct 2006 17:01:03 +0200 > > > > Bruno Ducrot wrote: > > > > > > > > > Thanks. The device do not have a BAR when acpi is enabled. We > > > > > therefore have to enable one. I think just by poking aroud some pci > > > > > config registers onto the pci bridge will do the trick. Your > > > > > > > > Ok. I'm wondering; will output from lspci under Linux help you get at > > > > the info more easily? I have Xubuntu installed on a partition on this > > > > machine, so it is easy for me to do that, if you wish. > > > > > > Well, I don't know if that will be helpful. Humm, maybe a dmesg? > > > > > > > > Looking at this datasheet I think we have to look more carrefully to > > > > > register 0x04 (halfword), 0x20h, 0x24, 0x28 and 0x2c. > > > > > Looking them both with and without acpi and comparing them will allows > > > > > us to know hopefully how to enable the first BAR to the correct adress > > > > > for your ethernet card. In short, if you can first boot without ACPI, > > > > > then perform > > > > > pciconf -r -h pci0:28:2 4 > > > > > pciconf -r pci0:28:2 0x20 > > > > > pciconf -r pci0:28:2 0x24 > > > > > pciconf -r pci0:28:2 0x28 > > > > > pciconf -r pci0:28:2 0x2c > > > > > > > > > > Also do a dump in order to check if something else might be needed: > > > > > pciconf -r -b pci0:28:2 0:256 > > > > > > > > > > Boot with ACPI enabled: > > > > > do the same pciconf stuff, then send me the output. > > > > > > > > Done. I've sent you the files via email, and also uploaded them to the > > > > web page, in case anyone else wants them for some reason. Webpage: > > > > http://tingox.googlepages.com/aceraspireas5672andfreebsd > > > > > > > > > After that, we should be able to correct your problem, either by > > > > > 1- hacking the DSDT, > > > > > OR > > > > > 2- hacking pcib.c. > > > > > (at your option). > > > > > > > > I think hacking the DSDT is the more politically correct option, but > > > > either one will work for me. > > > > > > Ok. First remove device bge in your kernel config. For example create a > > > config file with: > > > > > > >>> BEGIN > > > include GENERIC > > > ident MYKERNEL (or what you like) > > > nodevice bge > > > <<< END > > > > > > After rebuilding and installing your kernel, > > > you can do something like that: > > > > > > pciconf -w pci0:28:2 0xd8 0x04110008 > > > > > > pciconf -w -h pci0:28:2 0x58 0x0000 > > > > > > pciconf -w pci0:28:2 0x24 0x0001fff1 > > > pciconf -w pci0:28:2 0x20 0xc830c830 > > > > > > pciconf -w -h pci0:28:2 0x04 0x0007 > > > > > > > > > After that, you should be able to kldload if_bge and report back if > > > this work. In that case I will modify the DSDT so that you won't to > > > worry about all of those pciconf stuff. > > > > You really shouldn't change BAR registers directly. First of all, the PCI > > bus driver already knows how to allocate resources for a BAR if it is set > > to 0 and when doing so will make sure to not allocate an address that > > conflicts with another device. Secondly, a lot of PCI config registers are > > cached in the ivars by the PCI bus, so it may not even read the values you > > write into it (though writing those values will turn on the address decode > > for the device, and if another device is using that address things will go > > downhill quick). > > You are indeed right. The issue therefore seems to be, when ACPI is enabled, > then the PCI bus driver doesn't set up correctly a BAR. > FYI the bridge is one of the four PCIe embedded to an ICH-7. The PCI bus driver does the same thing regardless of ACPI. When the NIC driver does its bus_alloc_resource() the PCI bus should then go allocate resources for it. At this point you will probably want to get a boot -v so you can see what the bus prints out when it first looks at the device first. If the BAR is listed (but with a base of 0), then you will want to look at the stuff in pci_alloc_resource(). -- John Baldwin