From: Reinhard Meyer (-VC) Date: Wed, 02 Jun 2010 14:37:07 +0200 Subject: [U-Boot] AVR32 AP700x - I2C somewhere? In-Reply-To: <4C0601ED.8060402@googlemail.com> References: <4C051361.8070300@emk-elektronik.de> <4C0601ED.8060402@googlemail.com> Message-ID: <4C065073.7050706@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Andreas Bie?mann schrieb: > Am 01.06.2010 16:04, schrieb Reinhard Meyer (-VC): > >> Hi, >> > Dear Reinhard Meyer, > > >> has anyone started or completed work on an I2C driver for AP7000x? >> > No ... > >> If not, I am at least going to make SOFT I2C defines to read VPD from an >> At24C64 EEPROM. >> > But I've working soft-i2c here. There are still some other examples in > u-boot how to interface a at24xx eeprom. > Thank you. That worked to verify my setup. I was fooled by the AtTiny on the NGW100 which does try to slow I2C Transfers by pulling SCL low. That feature however is NOT honored by the SOFT_I2C driver. So accesses to my At24C64 had to fail. After removing the AtTiny it works fine :) > custom board config file: > ---8<--- > /* i2c definitions */ > #define CONFIG_SOFT_I2C > #if defined(CONFIG_SOFT_I2C) > #define DEBUG_I2C > #ifndef __ASSEMBLY__ > #include > #define MEDUCORE_SDA_PIN 6 > #define MEDUCORE_SCL_PIN 7 > > #define I2C_ACTIVE portmux_select_gpio(PORTMUX_PORT_A, > (1< #define I2C_TRISTATE portmux_select_gpio(PORTMUX_PORT_A, > (1< The functions ACTIVE and TRISTATE are not required when the Pins are initialized OUTPUT and OPENDRAIN as follows: int board_early_init_f(void) { ... #ifdef CONFIG_CMD_I2C // first select SCL and SDA gpio portmux_select_gpio(PORTMUX_PORT_A,(1<