From owner-freebsd-current@FreeBSD.ORG Sun Dec 18 08:23:04 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 B561016A41F for ; Sun, 18 Dec 2005 08:23:04 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id B28A043D5F for ; Sun, 18 Dec 2005 08:23:03 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id jBI8MpgF061135; Sun, 18 Dec 2005 10:22:51 +0200 (EET) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 09462-01-7; Sun, 18 Dec 2005 10:22:50 +0200 (EET) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id jBI8Jttd060974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Dec 2005 10:19:55 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.4/8.13.4) id jBI8K3Rd098216; Sun, 18 Dec 2005 10:20:03 +0200 (EET) (envelope-from ru) Date: Sun, 18 Dec 2005 10:20:02 +0200 From: Ruslan Ermilov To: Artemiev Igor Message-ID: <20051218082002.GR41326@ip.net.ua> References: <200512141749.jBEHnjRV081112@repoman.freebsd.org> <20051214183345.GE51686@ip.net.ua> <20051215093643.694e995b.ai@bmc.brk.ru> <200512151306.57961.jhb@freebsd.org> <20051216083657.GA41326@ip.net.ua> <20051216134225.09aa93a3.ai@bmc.brk.ru> <20051216111813.GE41326@ip.net.ua> <20051217084836.71eb86e6.ai@bmc.brk.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="15k5Fuw+yLfT1d9X" Content-Disposition: inline In-Reply-To: <20051217084836.71eb86e6.ai@bmc.brk.ru> User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at ip.net.ua X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-current@freebsd.org 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: Sun, 18 Dec 2005 08:23:04 -0000 --15k5Fuw+yLfT1d9X Content-Type: multipart/mixed; boundary="96icqjDFsSi85SgI" Content-Disposition: inline --96icqjDFsSi85SgI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 >=20 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=3D0x10de device=3D0x00d4 subvendor=3D0x1043 subdevice= =3D0x80c5 class=3D0x0c0500 at slot=3D1 function=3D1 handle=3D\_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. There's also an accompanying one-line patch for dev/smbus/smbus.c that adds: DRIVER_MODULE(smbus, nfpm, smbus_driver, smbus_devclass, 0, 0); Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --96icqjDFsSi85SgI-- --15k5Fuw+yLfT1d9X Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDpRuxqRfpzJluFF4RAuOYAJ0XSr8rLLeNgVjdpJUpTODz2TF1ogCgnOuD GWngt1TYo3jiO1NMJo2K34w= =CA0T -----END PGP SIGNATURE----- --15k5Fuw+yLfT1d9X--