From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 8 15:26:24 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3259E37B401; Fri, 8 Aug 2003 15:26:24 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA1CA43FAF; Fri, 8 Aug 2003 15:26:22 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h78MQ0aK039833 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 9 Aug 2003 00:26:03 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.9/8.12.9) with ESMTP id h78MPxA4027119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Aug 2003 00:25:59 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.9/8.12.9) with ESMTP id h78MPwNS048543; Sat, 9 Aug 2003 00:25:58 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h78MPwnD048542; Sat, 9 Aug 2003 00:25:58 +0200 (CEST) Date: Sat, 9 Aug 2003 00:25:57 +0200 From: Bernd Walter To: John Baldwin Message-ID: <20030808222557.GE46866@cicely12.cicely.de> References: <20030808195511.GD46866@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: ticso@cicely12.cicely.de cc: Poul-Henning Kamp cc: freebsd-hackers@FreeBSD.org cc: ticso@cicely.de Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2003 22:26:24 -0000 On Fri, Aug 08, 2003 at 04:32:43PM -0400, John Baldwin wrote: > On 08-Aug-2003 Bernd Walter wrote: > > On Fri, Aug 08, 2003 at 03:48:22PM -0400, John Baldwin wrote: > >> On 08-Aug-2003 Bernd Walter wrote: > >> > However - I would still like to know why > >> > device_add_child(nexus, "elanbb", -1); > >> > results in an elanbb instance numer 1 connected to pci0. > >> > And why I don't get any iicbb childs. > >> > >> I would have to see your code changes in order to try to tell you that. > > > > http://www.cosmo-project.de/~bernd/elanbb.diff > > First off, the iicbb driver does not know have an elanbb attachment. > You need a set of driver methods and corresponding > > DRIVER_MODULE(iicbb, elanbb, ...) I really should have known, because I made the same mistake in one of my first versions for ehci and hunted for the usb bus not coming up... > For the iicbb child of elanbb to get a driver that probes it and attaches > to it. OK. > Hmm, what you want to do is not hijack the legacy/pcib identify > routine I think, but add an identify routine to your elanbb driver > and have elanbb live off the nexus (so DRIVER_MODULE(elan, nexus)) > and have its identify routine use pci_cfgreg() to get the devid for > device 0 and if it is the right one call init_AMD_Elan_sc520() and > add it's probe routine. Or rather. I've fixed all this and you can Agreed - it was just the quick and dirty - get it running way. I also might want new files for a new driver as well... > get the changes (whcih should fix bogus elanbb0 and make iicbb0 show > up) at http://www.freebsd.org/~jhb/patches/elan.patch It includes > your patch above but fixes a few things. One other bug I fixed is > that since yout elan was hung off of pci and had an empty probe > routine, any unclaimed PCI device got "claimed" by your elanbb driver, > hence your bogus elanbb0. Note that the version of elanbb in OK - I still don't now the exact bug, but I got an idea. The elanbb part was build with viapm as sample. > elan.patch uses a private identify routine that calls > init_AMD_Elan_sc250(), so it will work both with and without ACPI. Thank you for the work. Well elanbb is the wrong driver for calling init_AMD_Elan_sc250. It is just one of many possible users of elan mmcr extensions. > However, the warning printf about CPU_ELAN won't show up with ACPI. > I left the printf in pci_bus.c for now. A better place to put it would > be in the hostb driver itself. Well, I went ahead and did that too, > so now the warning will show up both for ACPI and non-ACPI systems. :) -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de