[U-Boot] OMAP3 i2c issues on IGEP, u-boot 2013.10

Tom Rini trini at ti.com
Wed Nov 27 15:45:55 CET 2013


On Wed, Nov 27, 2013 at 01:19:29PM +0100, Thomas Petazzoni wrote:

> Hello,
> 
> We've recently updated from u-boot 2013.04 to u-boot 2013.10 on our
> IGEP boards (OMAP3 based, U-Boot shows "OMAP36XX/37XX-GP ES1.2"), and
> we're seeing random I2C communication problems at startup.
> 
> Most of the time it's just:
> 
> """
> Out:   serial
> Err:   serial
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> Could not write grp_sel to reg 96 (2)
> Die ID #500400029ff800000168300f0701b011
> """
> 
> and the boot goes on fine.
> 
> But sometimes it's something like the below (which goes on
> indefinitely, preventing the platform from booting):
> 
> """
> NAND:  512 MiB
> MMC:   OMAP SD/MMC: 0
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> i2c_read (addr phase): pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Read[0xfd] Error 2
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Write[0xfd] Error 2
> i2c_read (addr phase): pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Read[0xfe] Error 2
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Write[0xfe] Error 2
> i2c_read (addr phase): pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Read[0xfe] Error 2
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Write[0xfe] Error 2
> i2c_read (addr phase): pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Read[0xff] Error 2
> i2c_read (addr phase): pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Read[0xff] Error 2
> i2c_read (addr phase): pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Read[0xff] Error 2
> i2c_read (addr phase): pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Read[0xff] Error 2
> i2c_read (addr phase): pads on bus 0 probably not configured (status=0x10)
> [... more of these indefinitely ...]
> """
> 
> or it can be *some* error messages, but the boot goes on:
> 
> """
> NAND:  512 MiB
> MMC:   OMAP SD/MMC: 0
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Write[0x6] Error 2
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Write[0x6] Error 2
> i2c_read (addr phase): pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Read[0xfe] Error 2
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> TWL4030:USB:Write[0xfe] Error 2
> In:    serial
> Out:   serial
> Err:   serial
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> Could not write vsel to reg 7d (2)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> Could not write vsel to reg 91 (2)
> i2c_write: pads on bus 0 probably not configured (status=0x10)
> Could not write vsel to reg 99 (2)
> Die ID #500400029ff800000168300f0701b011
> Net:   smc911x-0
> Hit any key to stop autoboot:  0 
> U-Boot # 
> """
> 
> I see that 960187ffa125b3938fec4b827bd9e8c04a204af8 ("ARM: OMAP: I2C:
> New read, write and probe functions") has changed significantly the
> OMAP I2C driver. And it turns out that reverting this commit actually
> fixes the problem. No more error messages, no more hang at boot. The
> commit message says that it was tested on OMAP4, OMAP5 and AM335x, but
> apparently OMAP3 isn't working all that well with this commit.

I don't see this problem on my omap3_beagle, but I don't have that in
heavy rotation either.  Looking things over, can you try the following
patch, which just drops the extra sanity check for unconfigured pads.
The kernel doesn't have any logic like this and I suspect that while
it's reliable enough of a check on some platforms, it's only true for
the OMAP4+ variant of the block.

diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index 3d38c03..c870550 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -304,13 +304,6 @@ static int omap24_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
 		/* Send register offset */
 		while (1) {
 			status = wait_for_event(adap);
-			/* Try to identify bus that is not padconf'd for I2C */
-			if (status == I2C_STAT_XRDY) {
-				i2c_error = 2;
-				printf("i2c_read (addr phase): pads on bus %d probably not configured (status=0x%x)\n",
-				       adap->hwadapnr, status);
-				goto rd_exit;
-			}
 			if (status == 0 || status & I2C_STAT_NACK) {
 				i2c_error = 1;
 				printf("i2c_read: error waiting for addr ACK (status=0x%x)\n",
@@ -344,17 +337,6 @@ static int omap24_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
 	/* Receive data */
 	while (1) {
 		status = wait_for_event(adap);
-		/*
-		 * Try to identify bus that is not padconf'd for I2C. This
-		 * state could be left over from previous transactions if
-		 * the address phase is skipped due to alen=0.
-		 */
-		if (status == I2C_STAT_XRDY) {
-			i2c_error = 2;
-			printf("i2c_read (data phase): pads on bus %d probably not configured (status=0x%x)\n",
-			       adap->hwadapnr, status);
-			goto rd_exit;
-		}
 		if (status == 0 || status & I2C_STAT_NACK) {
 			i2c_error = 1;
 			goto rd_exit;
@@ -426,13 +408,6 @@ static int omap24_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
 	while (alen) {
 		/* Must write reg offset (one or two bytes) */
 		status = wait_for_event(adap);
-		/* Try to identify bus that is not padconf'd for I2C */
-		if (status == I2C_STAT_XRDY) {
-			i2c_error = 2;
-			printf("i2c_write: pads on bus %d probably not configured (status=0x%x)\n",
-			       adap->hwadapnr, status);
-			goto wr_exit;
-		}
 		if (status == 0 || status & I2C_STAT_NACK) {
 			i2c_error = 1;
 			printf("i2c_write: error waiting for addr ACK (status=0x%x)\n",

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131127/903e8ccc/attachment.pgp>


More information about the U-Boot mailing list