From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Subject: Re: [PATCH] i2c: mxs: Rework the PIO mode operation Date: Wed, 17 Jul 2013 18:23:12 +0200 Message-ID: <201307171823.12411.marex@denx.de> References: <201307150405.53110.marex@denx.de> <1UzQet-1Vf4pE0@fwd17.aul.t-online.de> Mime-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1UzQet-1Vf4pE0-VM4m3MaA7PGi2rA4ip7KQzlaCuRwF3y+@public.gmane.org> Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "to-fleischer-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org" Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Alexandre Belloni , Fabio Estevam , Lucas Stach , Shawn Guo , Wolfram Sang List-Id: linux-i2c@vger.kernel.org Hi Torsten, > Hi, > > > > Analyze and rework the PIO mode operation. The PIO mode operation > > > was unreliable on MX28, by analyzing the bus with LA, the checks for > > > when data were available or were to be sent were wrong. > > > > > > The PIO WRITE has to be completely reworked as it multiple problems. > > > The MX23 datasheet helped here, see comments in the code for > > > details. > > > The problems boil down to: > > > - RUN bit in CTRL0 must be set after DATA register was written - The > > > PIO transfer must be 4 bytes long tops, otherwise use > > > clock stretching. > > > Both of these fixes are implemented. > > > > > > The PIO READ operation can only be done for up to four bytes as we > > > are unable to read out the data from the DATA register fast enough. > > > > > > This patch also tries to document the investigation within the code. > > > > > > Signed-off-by: Marek Vasut > > > Cc: Alexandre Belloni > > > Cc: Fabio Estevam > > > Cc: Lucas Stach > > > Cc: Shawn Guo > > > Cc: Wolfram Sang > > > Cc: > > > > I so far got confirmation from ALexandre this patch works. Can someone > > else test it please? I'd like to roll out a final version to close > > this issue. > > sorry, I couldn't test the patch until today on my iMX283 board. No problem, I was busy too. > It works when reading the registers from the temperature sensor TCN75A. OK > But it fails when writing less than 7 bytes to the EEPROM (24LC32). Then > I always get a 'Connection timed out' error in the user space. This works just fine for me, even the LA shows no weird stuff on the I2C, would you be able to trace where this comes from please? > Best regards > Torsten Fleischer Best regards, Marek Vasut