From owner-freebsd-current@FreeBSD.ORG Mon Dec 19 16:21:35 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6086516A41F; Mon, 19 Dec 2005 16:21:35 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A78E43D60; Mon, 19 Dec 2005 16:21:34 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 4140433 for multiple; Mon, 19 Dec 2005 11:19:39 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id jBJGLUsZ067406; Mon, 19 Dec 2005 11:21:30 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Mon, 19 Dec 2005 11:12:47 -0500 User-Agent: KMail/1.8.2 References: <200512141749.jBEHnjRV081112@repoman.freebsd.org> <20051217084836.71eb86e6.ai@bmc.brk.ru> <20051218082002.GR41326@ip.net.ua> In-Reply-To: <20051218082002.GR41326@ip.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200512191112.48905.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1213/Mon Dec 19 09:48:34 2005 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Artemiev Igor Subject: Re: cvs commit: src/sys/pci amdpm.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 19 Dec 2005 16:21:35 -0000 On Sunday 18 December 2005 03:20 am, Ruslan Ermilov wrote: > On Sat, Dec 17, 2005 at 08:48:36AM +0300, Artemiev Igor wrote: > > > i2c-amd8111.c and i2c-nforce2.c are indeed very similar, because they > > > both use SMBus 2.0 API. :-) > > > > ... > > > > > See how the offset 0x2 register means completely different things. > > > > Yep. Sorry for this little diversion :-(( > > I wrote new driver, nfpm, which completely based on linux`s i2c- > > nforce2 driver. Can you review it? > > http://stalker.bmc.brk.ru/~ai/patches/nfpm.c > > You took lm_sensors sources too literally, without accounting for > FreeBSD details. In FreeBSD (dumb, but it's too late to change > that now), the slave 6-bit addresses are expected by smbus(4) > methods already shifted, (addr << 1). My incomplete (but enough > for xmbmon to work) version is attached and appears to work, > according to the debugging output from the driver, but I eihter > don't have any recognizable sensors on either of SMBusses I have > available for testing, or something is very odd about it. It also > supports AMD-8111 SMBus 2.0 controller. > > Note that I don't call bus_set_resource() in my driver. In my > case (nVidia nForce3 Pro150 and AMD-8111 SMBus 2.0), the I/O port > resources have already been allocated, > > nfpm0 pnpinfo vendor=0x10de device=0x00d4 subvendor=0x1043 subdevice=0x80c5 > class=0x0c0500 at slot=1 function=1 handle=\_SB_.PCI0.SMBS I/O ports: > 0x5000-0x503f > 0x5040-0x507f > > so bus_set_resource() were effectively trying to add 0x5000-... > and 0x5040-... ranges again, and that causes problems for > bus_alloc_resource_any() later. Yes, that one part uses PCIR_BAR(1) (please use that rather than 0x14 for the rid) and that already works. The bus_set_resource() hacks need to go away I think, either that or the pci bus should implement bus-set_resourc() by treating the RID as a congig register offset of an extra BAR whcih would simplify amdpm -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org