Date: Wed, 30 Nov 2011 21:16:51 +0100 From: Stefan Bethke <stb@lassitu.de> To: Warner Losh <imp@bsdimp.com> Cc: freebsd-embedded@freebsd.org Subject: Re: TL-WR1043: switch Message-ID: <2ED0CD2A-7D7B-438D-AE00-B9DF947D01B3@lassitu.de> In-Reply-To: <2B8826C7-00C7-4117-B424-4A86F1346DFF@bsdimp.com> References: <68ABED76-CB1F-405A-8036-EC254F7511FA@lassitu.de> <3B3DB17D-BF87-40EE-B1C1-445F178E8844@lassitu.de> <86030CEE-6839-4B96-ACDC-2BA9AC1E4AE4@lassitu.de> <2D625CC9-A0E3-47AA-A504-CE8FB2F90245@lassitu.de> <203BF1C8-D528-40C9-8611-9C7AC7E43BAB@lassitu.de> <3C0E9CA3-E130-4E9A-ABCC-1782E28999D1@lassitu.de> <2B8826C7-00C7-4117-B424-4A86F1346DFF@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Am 30.11.2011 um 20:58 schrieb Warner Losh: > On Nov 30, 2011, at 12:43 PM, Stefan Bethke wrote: >=20 >> The I2C framework makes a faulty assumption that the read/not-write = bit of the first byte (the address) indicates whether reads or writes = are to follow. While many simple I2C devices usually will follow this = rule, it's not prescribed by the protocol (AFAICT), and is incompatible = with the way the RTL8366 familiy uses the bus: after sending the = address+read/not-write byte, two register address bytes are sent, then = the 16-bit register value is sent or received. While the register write = access can be performed as a 4-byte write, the read access requires the = read bit to be set, but the first two bytes for the register address = then need to be transmitted. >=20 > I thought that was spelled out in the i2c spec fairly clearly=85 You are of course correct. > Do you have the data sheet showing this timing? I don't have one for the 8366RB, but the 8366 and 8366S chips appear to = follow the same timing. See=20 http://realtek.info/pdf/rtl8366_8369_datasheet_1-1.pdf (9.2, page 44) http://realtek.info/pdf/rtl8366s_8366sr_datasheet_vpre-1.4_20071022.pdf = (9.2, page 66) I think it would be beneficial to either remove this constraint in = iicconf.c entirely, or make it optional, so that we can use the = infrastructure for devices that "almost" speak I2C. Stefan --=20 Stefan Bethke <stb@lassitu.de> Fon +49 151 14070811
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2ED0CD2A-7D7B-438D-AE00-B9DF947D01B3>