Date: Sun, 18 Dec 2005 10:20:02 +0200 From: Ruslan Ermilov <ru@freebsd.org> To: Artemiev Igor <ai@bmc.brk.ru> Cc: freebsd-current@freebsd.org Subject: Re: cvs commit: src/sys/pci amdpm.c Message-ID: <20051218082002.GR41326@ip.net.ua> In-Reply-To: <20051217084836.71eb86e6.ai@bmc.brk.ru> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051218082002.GR41326>