]> git.sur5r.net Git - u-boot/blobdiff - common/soft_i2c.c
esd WUH405 and DU405 board updated
[u-boot] / common / soft_i2c.c
index 63574044ad0de900897c6d7d02a3a277a3f0886f..f7ca49840a08173e8e037e99310076bbfe59ffc1 100644 (file)
 #ifdef CONFIG_MPC8260                  /* only valid for MPC8260 */
 #include <ioports.h>
 #endif
+#ifdef CONFIG_AT91RM9200DK             /* need this for the at91rm9200dk */
+#include <asm/io.h>
+#include <asm/arch/hardware.h>
+#endif
 #include <i2c.h>
 
 #if defined(CONFIG_SOFT_I2C)
@@ -83,8 +87,12 @@ static void send_reset(void)
 #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;
@@ -262,18 +270,11 @@ static uchar read_byte(int ack)
  */
 void i2c_init (int speed, int slaveaddr)
 {
-#ifdef CONFIG_8xx
-       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
-         * the DIMM SPD, for instance), RAM won't be usable and your
-         * system will crash.
+        * WARNING: Do NOT save speed in a static variable: if the
+        * I2C routines are called before RAM is initialized (to read
+        * the DIMM SPD, for instance), RAM won't be usable and your
+        * system will crash.
         */
        send_reset ();
 }