From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergey Lapin Date: Fri, 30 May 2008 01:56:30 +0400 Subject: [U-Boot-Users] [AT91] Problems configuring bit-banged I2C In-Reply-To: <20080524172400.4f4518e0@hskinnemo-gx745.norway.atmel.com> References: <20080523233604.GA10231@fan.ossfans.org> <20080524172400.4f4518e0@hskinnemo-gx745.norway.atmel.com> Message-ID: <20080529215626.GA22362@fan.ossfans.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, May 24, 2008 at 05:24:00PM +0200, Haavard Skinnemoen wrote: > Sergey Lapin wrote: > > But I'm unable to read proper values from lines - they always > > return 0s. Any ideas on fixing? > > Linux i2c-gpio driver works perfectly. > > Please try this patch: > > http://www.nabble.com/-PATCH--soft_i2c%3A-Pull-SDA-high-before-reading-p17270563.html > > You shouldn't need to do anything in the I2C_ACTIVE and I2C_TRISTATE > hooks since the PIO is properly configured in open drain mode. Alas, I was unable to make bit-banged I2C to work even with this patch applied. As I mentioned above, it works in Linux, but I'd like to be able to set time to my RTC from u-boot. I have checked that pins are configured properly from status registers (pull-ups are enabled, multi-drive mode is enabled (open drain), etc.). I could read only zeroes from SDA line in u-boot, and using oscilloscope, I see data on line. I can't find differencies in setup with i2c-gpio from Linux. Any ideas? Thanks a lot, S.