From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Mon, 22 Oct 2007 10:57:27 -0400 Subject: [U-Boot-Users] I2C scanning In-Reply-To: References: Message-ID: <471CBA57.7060005@qstreams.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Yasothabalan, Yasothabalan Ramaswamy-TLS,Chennai wrote: > > Hi all, > > > > I am using MPC5200B CPU. > > > > I am using both the I2C buses present as defined below, > > > > #define MPC5XXX_I2C1 (CFG_MBAR + 0x3D00) > > #define MPC5XXX_I2C2 (CFG_MBAR + 0x3D40) > > > > Is it possible to scan both the buses in the run time and do > read/write operation? > > > > I am here able to scan only one bus. > > > > How can I fix this issue? > > > I don't know anything about this CPU, but the following code in cpu/mpc5xxx/i2c.c makes me think you can't use both I2C buses on this chip: #if (CFG_I2C_MODULE == 2) #define I2C_BASE MPC5XXX_I2C2 #elif (CFG_I2C_MODULE == 1) #define I2C_BASE MPC5XXX_I2C1 #else #error CFG_I2C_MODULE is not properly configured #endif If, however, this chip shares the same I2C controller as the MPC8xxx chips (I have no idea if it does or doesn't), with a little Makefile magic you could use the fsl_i2c.c driver, which supports multiple buses. regards, Ben