[U-Boot-Users] I2C Initialization, important Update!!

Joakim Tjernlund
2003-03-14T14:29:35Z

> Can you please provide a patch that can be applied to existing
> sources? This would make testing much easier.

Compiles, but not tested in u-boot as I am still in ppcboot.

Jocke
Index: common/soft_i2c.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/common/soft_i2c.c,v
retrieving revision 1.2
diff -u -u -r1.2 soft_i2c.c
--- common/soft_i2c.c 17 Dec 2002 01:51:08 -0000 1.2
+++ common/soft_i2c.c 14 Mar 2003 14:28:10 -0000
@@ -83,8 +83,12 @@
#endif
int j;

- I2C_ACTIVE;
+ I2C_SCL(1);
I2C_SDA(1);
+#ifdef I2C_INIT
+ I2C_INIT;
+#endif
+ I2C_TRISTATE;
for(j = 0; j < 9; j++) {
I2C_SCL(0);
I2C_DELAY;
@@ -266,9 +270,6 @@
volatile immap_t *immr = (immap_t *)CFG_IMMR;
#endif

-#ifdef I2C_INIT
- I2C_INIT;
-#endif
/*
* WARNING: Do NOT save speed in a static variable: if the
* I2C routines are called before RAM is initialized (to read