i2c: Move PPC4xx I2C driver into drivers/i2c directory
authorStefan Roese <sr@denx.de>
Thu, 1 Apr 2010 12:37:24 +0000 (14:37 +0200)
committerHeiko Schocher <hs@denx.de>
Tue, 6 Apr 2010 06:10:41 +0000 (08:10 +0200)
This patch moves the PPC4xx specific I2C device driver into the I2C
drivers directory. All 4xx config headers are updated to include this
driver.

Signed-off-by: Stefan Roese <sr@denx.de>
53 files changed:
cpu/ppc4xx/Makefile
cpu/ppc4xx/i2c.c [deleted file]
drivers/i2c/Makefile
drivers/i2c/ppc4xx_i2c.c [new file with mode: 0644]
include/configs/ASH405.h
include/configs/CANBT.h
include/configs/CMS700.h
include/configs/CPCI2DP.h
include/configs/CPCI405.h
include/configs/CPCI4052.h
include/configs/CPCI405AB.h
include/configs/CPCI405DT.h
include/configs/CPCIISER4.h
include/configs/CRAYL1.h
include/configs/DP405.h
include/configs/DU405.h
include/configs/DU440.h
include/configs/ERIC.h
include/configs/G2000.h
include/configs/HH405.h
include/configs/HUB405.h
include/configs/JSE.h
include/configs/KAREF.h
include/configs/METROBOX.h
include/configs/MIP405.h
include/configs/OCRTC.h
include/configs/ORSG.h
include/configs/PCI405.h
include/configs/PIP405.h
include/configs/PLU405.h
include/configs/PMC405.h
include/configs/PMC405DE.h
include/configs/PMC440.h
include/configs/PPChameleonEVB.h
include/configs/VOH405.h
include/configs/VOM405.h
include/configs/W7OLMC.h
include/configs/W7OLMG.h
include/configs/WUH405.h
include/configs/XPEDITE1000.h
include/configs/alpr.h
include/configs/amcc-common.h
include/configs/csb272.h
include/configs/csb472.h
include/configs/korat.h
include/configs/lwmon5.h
include/configs/netstal-common.h
include/configs/p3p440.h
include/configs/pcs440ep.h
include/configs/quad100hd.h
include/configs/sbc405.h
include/configs/sc3.h
include/configs/zeus.h

index 365f966fed9427ff2397e03567402f79f113f754..88d53fbb1a964fb1e727a4ad9ae0dd17d2fa4622 100644 (file)
@@ -52,7 +52,6 @@ COBJS += denali_data_eye.o
 COBJS  += denali_spd_ddr2.o
 COBJS  += ecc.o
 COBJS  += fdt.o
-COBJS  += i2c.o
 COBJS  += interrupts.o
 COBJS  += iop480_uart.o
 ifdef CONFIG_CMD_REGINFO
diff --git a/cpu/ppc4xx/i2c.c b/cpu/ppc4xx/i2c.c
deleted file mode 100644 (file)
index 9b86187..0000000
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * (C) Copyright 2007-2009
- * Stefan Roese, DENX Software Engineering, sr@denx.de.
- *
- * based on work by Anne Sophie Harnois <anne-sophie.harnois@nextream.fr>
- *
- * (C) Copyright 2001
- * Bill Hunter,  Wave 7 Optics, williamhunter@mediaone.net
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <ppc4xx.h>
-#include <4xx_i2c.h>
-#include <i2c.h>
-#include <asm-ppc/io.h>
-
-#ifdef CONFIG_HARD_I2C
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#if defined(CONFIG_I2C_MULTI_BUS)
-/*
- * Initialize the bus pointer to whatever one the SPD EEPROM is on.
- * Default is bus 0.  This is necessary because the DDR initialization
- * runs from ROM, and we can't switch buses because we can't modify
- * the global variables.
- */
-#ifndef CONFIG_SYS_SPD_BUS_NUM
-#define CONFIG_SYS_SPD_BUS_NUM 0
-#endif
-static unsigned int i2c_bus_num __attribute__ ((section (".data"))) =
-       CONFIG_SYS_SPD_BUS_NUM;
-#endif /* CONFIG_I2C_MULTI_BUS */
-
-static void _i2c_bus_reset(void)
-{
-       struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
-       int i;
-       u8 dc;
-
-       /* Reset status register */
-       /* write 1 in SCMP and IRQA to clear these fields */
-       out_8(&i2c->sts, 0x0A);
-
-       /* write 1 in IRQP IRQD LA ICT XFRA to clear these fields */
-       out_8(&i2c->extsts, 0x8F);
-
-       /* Place chip in the reset state */
-       out_8(&i2c->xtcntlss, IIC_XTCNTLSS_SRST);
-
-       /* Check if bus is free */
-       dc = in_8(&i2c->directcntl);
-       if (!DIRCTNL_FREE(dc)){
-               /* Try to set bus free state */
-               out_8(&i2c->directcntl, IIC_DIRCNTL_SDAC | IIC_DIRCNTL_SCC);
-
-               /* Wait until we regain bus control */
-               for (i = 0; i < 100; ++i) {
-                       dc = in_8(&i2c->directcntl);
-                       if (DIRCTNL_FREE(dc))
-                               break;
-
-                       /* Toggle SCL line */
-                       dc ^= IIC_DIRCNTL_SCC;
-                       out_8(&i2c->directcntl, dc);
-                       udelay(10);
-                       dc ^= IIC_DIRCNTL_SCC;
-                       out_8(&i2c->directcntl, dc);
-               }
-       }
-
-       /* Remove reset */
-       out_8(&i2c->xtcntlss, 0);
-}
-
-void i2c_init(int speed, int slaveaddr)
-{
-       struct ppc4xx_i2c *i2c;
-       int val, divisor;
-       int bus;
-
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-       /*
-        * Call board specific i2c bus reset routine before accessing the
-        * environment, which might be in a chip on that bus. For details
-        * about this problem see doc/I2C_Edge_Conditions.
-        */
-       i2c_init_board();
-#endif
-
-       for (bus = 0; bus < CONFIG_SYS_MAX_I2C_BUS; bus++) {
-               I2C_SET_BUS(bus);
-
-               /* Set i2c pointer after calling I2C_SET_BUS() */
-               i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
-
-               /* Handle possible failed I2C state */
-               /* FIXME: put this into i2c_init_board()? */
-               _i2c_bus_reset();
-
-               /* clear lo master address */
-               out_8(&i2c->lmadr, 0);
-
-               /* clear hi master address */
-               out_8(&i2c->hmadr, 0);
-
-               /* clear lo slave address */
-               out_8(&i2c->lsadr, 0);
-
-               /* clear hi slave address */
-               out_8(&i2c->hsadr, 0);
-
-               /* Clock divide Register */
-               /* set divisor according to freq_opb */
-               divisor = (get_OPB_freq() - 1) / 10000000;
-               if (divisor == 0)
-                       divisor = 1;
-               out_8(&i2c->clkdiv, divisor);
-
-               /* no interrupts */
-               out_8(&i2c->intrmsk, 0);
-
-               /* clear transfer count */
-               out_8(&i2c->xfrcnt, 0);
-
-               /* clear extended control & stat */
-               /* write 1 in SRC SRS SWC SWS to clear these fields */
-               out_8(&i2c->xtcntlss, 0xF0);
-
-               /* Mode Control Register
-                  Flush Slave/Master data buffer */
-               out_8(&i2c->mdcntl, IIC_MDCNTL_FSDB | IIC_MDCNTL_FMDB);
-
-               val = in_8(&i2c->mdcntl);
-
-               /* Ignore General Call, slave transfers are ignored,
-                * disable interrupts, exit unknown bus state, enable hold
-                * SCL 100kHz normaly or FastMode for 400kHz and above
-                */
-
-               val |= IIC_MDCNTL_EUBS | IIC_MDCNTL_HSCL;
-               if (speed >= 400000)
-                       val |= IIC_MDCNTL_FSM;
-               out_8(&i2c->mdcntl, val);
-
-               /* clear control reg */
-               out_8(&i2c->cntl, 0x00);
-       }
-
-       /* set to SPD bus as default bus upon powerup */
-       I2C_SET_BUS(CONFIG_SYS_SPD_BUS_NUM);
-}
-
-/*
- * This code tries to use the features of the 405GP i2c
- * controller. It will transfer up to 4 bytes in one pass
- * on the loop. It only does out_8((u8 *)lbz) to the buffer when it
- * is possible to do out16(lhz) transfers.
- *
- * cmd_type is 0 for write 1 for read.
- *
- * addr_len can take any value from 0-255, it is only limited
- * by the char, we could make it larger if needed. If it is
- * 0 we skip the address write cycle.
- *
- * Typical case is a Write of an addr followd by a Read. The
- * IBM FAQ does not cover this. On the last byte of the write
- * we don't set the creg CHT bit, and on the first bytes of the
- * read we set the RPST bit.
- *
- * It does not support address only transfers, there must be
- * a data part. If you want to write the address yourself, put
- * it in the data pointer.
- *
- * It does not support transfer to/from address 0.
- *
- * It does not check XFRCNT.
- */
-static int i2c_transfer(unsigned char cmd_type,
-                       unsigned char chip,
-                       unsigned char addr[],
-                       unsigned char addr_len,
-                       unsigned char data[],
-                       unsigned short data_len)
-{
-       struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
-       u8 *ptr;
-       int reading;
-       int tran, cnt;
-       int result;
-       int status;
-       int i;
-       u8 creg;
-
-       if (data == 0 || data_len == 0) {
-               /* Don't support data transfer of no length or to address 0 */
-               printf( "i2c_transfer: bad call\n" );
-               return IIC_NOK;
-       }
-       if (addr && addr_len) {
-               ptr = addr;
-               cnt = addr_len;
-               reading = 0;
-       } else {
-               ptr = data;
-               cnt = data_len;
-               reading = cmd_type;
-       }
-
-       /* Clear Stop Complete Bit */
-       out_8(&i2c->sts, IIC_STS_SCMP);
-
-       /* Check init */
-       i = 10;
-       do {
-               /* Get status */
-               status = in_8(&i2c->sts);
-               i--;
-       } while ((status & IIC_STS_PT) && (i > 0));
-
-       if (status & IIC_STS_PT) {
-               result = IIC_NOK_TOUT;
-               return(result);
-       }
-
-       /* flush the Master/Slave Databuffers */
-       out_8(&i2c->mdcntl, in_8(&i2c->mdcntl) |
-             IIC_MDCNTL_FMDB | IIC_MDCNTL_FSDB);
-
-       /* need to wait 4 OPB clocks? code below should take that long */
-
-       /* 7-bit adressing */
-       out_8(&i2c->hmadr, 0);
-       out_8(&i2c->lmadr, chip);
-
-       tran = 0;
-       result = IIC_OK;
-       creg = 0;
-
-       while (tran != cnt && (result == IIC_OK)) {
-               int  bc,j;
-
-               /*
-                * Control register =
-                * Normal transfer, 7-bits adressing, Transfer up to
-                * bc bytes, Normal start, Transfer is a sequence of transfers
-                */
-               creg |= IIC_CNTL_PT;
-
-               bc = (cnt - tran) > 4 ? 4 : cnt - tran;
-               creg |= (bc - 1) << 4;
-               /* if the real cmd type is write continue trans */
-               if ((!cmd_type && (ptr == addr)) || ((tran + bc) != cnt))
-                       creg |= IIC_CNTL_CHT;
-
-               if (reading) {
-                       creg |= IIC_CNTL_READ;
-               } else {
-                       for(j = 0; j < bc; j++) {
-                               /* Set buffer */
-                               out_8(&i2c->mdbuf, ptr[tran + j]);
-                       }
-               }
-               out_8(&i2c->cntl, creg);
-
-               /*
-                * Transfer is in progress
-                * we have to wait for upto 5 bytes of data
-                * 1 byte chip address+r/w bit then bc bytes
-                * of data.
-                * udelay(10) is 1 bit time at 100khz
-                * Doubled for slop. 20 is too small.
-                */
-               i = 2 * 5 * 8;
-               do {
-                       /* Get status */
-                       status = in_8(&i2c->sts);
-                       udelay(10);
-                       i--;
-               } while ((status & IIC_STS_PT) && !(status & IIC_STS_ERR) &&
-                        (i > 0));
-
-               if (status & IIC_STS_ERR) {
-                       result = IIC_NOK;
-                       status = in_8(&i2c->extsts);
-                       /* Lost arbitration? */
-                       if (status & IIC_EXTSTS_LA)
-                               result = IIC_NOK_LA;
-                       /* Incomplete transfer? */
-                       if (status & IIC_EXTSTS_ICT)
-                               result = IIC_NOK_ICT;
-                       /* Transfer aborted? */
-                       if (status & IIC_EXTSTS_XFRA)
-                               result = IIC_NOK_XFRA;
-               } else if ( status & IIC_STS_PT) {
-                       result = IIC_NOK_TOUT;
-               }
-
-               /* Command is reading => get buffer */
-               if ((reading) && (result == IIC_OK)) {
-                       /* Are there data in buffer */
-                       if (status & IIC_STS_MDBS) {
-                               /*
-                                * even if we have data we have to wait 4OPB
-                                * clocks for it to hit the front of the FIFO,
-                                * after that we can just read. We should check
-                                * XFCNT here and if the FIFO is full there is
-                                * no need to wait.
-                                */
-                               udelay(1);
-                               for (j = 0; j < bc; j++)
-                                       ptr[tran + j] = in_8(&i2c->mdbuf);
-                       } else
-                               result = IIC_NOK_DATA;
-               }
-               creg = 0;
-               tran += bc;
-               if (ptr == addr && tran == cnt) {
-                       ptr = data;
-                       cnt = data_len;
-                       tran = 0;
-                       reading = cmd_type;
-                       if (reading)
-                               creg = IIC_CNTL_RPST;
-               }
-       }
-       return result;
-}
-
-int i2c_probe(uchar chip)
-{
-       uchar buf[1];
-
-       buf[0] = 0;
-
-       /*
-        * What is needed is to send the chip address and verify that the
-        * address was <ACK>ed (i.e. there was a chip at that address which
-        * drove the data line low).
-        */
-       return (i2c_transfer(1, chip << 1, 0, 0, buf, 1) != 0);
-}
-
-static int ppc4xx_i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer,
-                              int len, int read)
-{
-       uchar xaddr[4];
-       int ret;
-
-       if (alen > 4) {
-               printf("I2C: addr len %d not supported\n", alen);
-               return 1;
-       }
-
-       if (alen > 0) {
-               xaddr[0] = (addr >> 24) & 0xFF;
-               xaddr[1] = (addr >> 16) & 0xFF;
-               xaddr[2] = (addr >> 8) & 0xFF;
-               xaddr[3] = addr & 0xFF;
-       }
-
-
-#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
-       /*
-        * EEPROM chips that implement "address overflow" are ones
-        * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
-        * address and the extra bits end up in the "chip address"
-        * bit slots. This makes a 24WC08 (1Kbyte) chip look like
-        * four 256 byte chips.
-        *
-        * Note that we consider the length of the address field to
-        * still be one byte because the extra address bits are
-        * hidden in the chip address.
-        */
-       if (alen > 0)
-               chip |= ((addr >> (alen * 8)) &
-                        CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
-#endif
-       if ((ret = i2c_transfer(read, chip << 1, &xaddr[4 - alen], alen,
-                               buffer, len)) != 0) {
-               if (gd->have_console) {
-                       printf("I2C %s: failed %d\n",
-                              read ? "read" : "write", ret);
-               }
-
-               return 1;
-       }
-
-       return 0;
-}
-
-int i2c_read(uchar chip, uint addr, int alen, uchar * buffer, int len)
-{
-       return ppc4xx_i2c_transfer(chip, addr, alen, buffer, len, 1);
-}
-
-int i2c_write(uchar chip, uint addr, int alen, uchar * buffer, int len)
-{
-       return ppc4xx_i2c_transfer(chip, addr, alen, buffer, len, 0);
-}
-
-#if defined(CONFIG_I2C_MULTI_BUS)
-/*
- * Functions for multiple I2C bus handling
- */
-unsigned int i2c_get_bus_num(void)
-{
-       return i2c_bus_num;
-}
-
-int i2c_set_bus_num(unsigned int bus)
-{
-       if (bus >= CONFIG_SYS_MAX_I2C_BUS)
-               return -1;
-
-       i2c_bus_num = bus;
-
-       return 0;
-}
-#endif /* CONFIG_I2C_MULTI_BUS */
-#endif /* CONFIG_HARD_I2C */
index 29bda85dbd53c4e3d64bed86066aa04dd62cca91..d2c251546a4cdd2968c799ac71bba0c0f545cd7b 100644 (file)
@@ -34,6 +34,7 @@ COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o
+COBJS-$(CONFIG_PPC4XX_I2C) += ppc4xx_i2c.o
 COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
 COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o
 COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
diff --git a/drivers/i2c/ppc4xx_i2c.c b/drivers/i2c/ppc4xx_i2c.c
new file mode 100644 (file)
index 0000000..9b86187
--- /dev/null
@@ -0,0 +1,439 @@
+/*
+ * (C) Copyright 2007-2009
+ * Stefan Roese, DENX Software Engineering, sr@denx.de.
+ *
+ * based on work by Anne Sophie Harnois <anne-sophie.harnois@nextream.fr>
+ *
+ * (C) Copyright 2001
+ * Bill Hunter,  Wave 7 Optics, williamhunter@mediaone.net
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <ppc4xx.h>
+#include <4xx_i2c.h>
+#include <i2c.h>
+#include <asm-ppc/io.h>
+
+#ifdef CONFIG_HARD_I2C
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#if defined(CONFIG_I2C_MULTI_BUS)
+/*
+ * Initialize the bus pointer to whatever one the SPD EEPROM is on.
+ * Default is bus 0.  This is necessary because the DDR initialization
+ * runs from ROM, and we can't switch buses because we can't modify
+ * the global variables.
+ */
+#ifndef CONFIG_SYS_SPD_BUS_NUM
+#define CONFIG_SYS_SPD_BUS_NUM 0
+#endif
+static unsigned int i2c_bus_num __attribute__ ((section (".data"))) =
+       CONFIG_SYS_SPD_BUS_NUM;
+#endif /* CONFIG_I2C_MULTI_BUS */
+
+static void _i2c_bus_reset(void)
+{
+       struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+       int i;
+       u8 dc;
+
+       /* Reset status register */
+       /* write 1 in SCMP and IRQA to clear these fields */
+       out_8(&i2c->sts, 0x0A);
+
+       /* write 1 in IRQP IRQD LA ICT XFRA to clear these fields */
+       out_8(&i2c->extsts, 0x8F);
+
+       /* Place chip in the reset state */
+       out_8(&i2c->xtcntlss, IIC_XTCNTLSS_SRST);
+
+       /* Check if bus is free */
+       dc = in_8(&i2c->directcntl);
+       if (!DIRCTNL_FREE(dc)){
+               /* Try to set bus free state */
+               out_8(&i2c->directcntl, IIC_DIRCNTL_SDAC | IIC_DIRCNTL_SCC);
+
+               /* Wait until we regain bus control */
+               for (i = 0; i < 100; ++i) {
+                       dc = in_8(&i2c->directcntl);
+                       if (DIRCTNL_FREE(dc))
+                               break;
+
+                       /* Toggle SCL line */
+                       dc ^= IIC_DIRCNTL_SCC;
+                       out_8(&i2c->directcntl, dc);
+                       udelay(10);
+                       dc ^= IIC_DIRCNTL_SCC;
+                       out_8(&i2c->directcntl, dc);
+               }
+       }
+
+       /* Remove reset */
+       out_8(&i2c->xtcntlss, 0);
+}
+
+void i2c_init(int speed, int slaveaddr)
+{
+       struct ppc4xx_i2c *i2c;
+       int val, divisor;
+       int bus;
+
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+       /*
+        * Call board specific i2c bus reset routine before accessing the
+        * environment, which might be in a chip on that bus. For details
+        * about this problem see doc/I2C_Edge_Conditions.
+        */
+       i2c_init_board();
+#endif
+
+       for (bus = 0; bus < CONFIG_SYS_MAX_I2C_BUS; bus++) {
+               I2C_SET_BUS(bus);
+
+               /* Set i2c pointer after calling I2C_SET_BUS() */
+               i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+
+               /* Handle possible failed I2C state */
+               /* FIXME: put this into i2c_init_board()? */
+               _i2c_bus_reset();
+
+               /* clear lo master address */
+               out_8(&i2c->lmadr, 0);
+
+               /* clear hi master address */
+               out_8(&i2c->hmadr, 0);
+
+               /* clear lo slave address */
+               out_8(&i2c->lsadr, 0);
+
+               /* clear hi slave address */
+               out_8(&i2c->hsadr, 0);
+
+               /* Clock divide Register */
+               /* set divisor according to freq_opb */
+               divisor = (get_OPB_freq() - 1) / 10000000;
+               if (divisor == 0)
+                       divisor = 1;
+               out_8(&i2c->clkdiv, divisor);
+
+               /* no interrupts */
+               out_8(&i2c->intrmsk, 0);
+
+               /* clear transfer count */
+               out_8(&i2c->xfrcnt, 0);
+
+               /* clear extended control & stat */
+               /* write 1 in SRC SRS SWC SWS to clear these fields */
+               out_8(&i2c->xtcntlss, 0xF0);
+
+               /* Mode Control Register
+                  Flush Slave/Master data buffer */
+               out_8(&i2c->mdcntl, IIC_MDCNTL_FSDB | IIC_MDCNTL_FMDB);
+
+               val = in_8(&i2c->mdcntl);
+
+               /* Ignore General Call, slave transfers are ignored,
+                * disable interrupts, exit unknown bus state, enable hold
+                * SCL 100kHz normaly or FastMode for 400kHz and above
+                */
+
+               val |= IIC_MDCNTL_EUBS | IIC_MDCNTL_HSCL;
+               if (speed >= 400000)
+                       val |= IIC_MDCNTL_FSM;
+               out_8(&i2c->mdcntl, val);
+
+               /* clear control reg */
+               out_8(&i2c->cntl, 0x00);
+       }
+
+       /* set to SPD bus as default bus upon powerup */
+       I2C_SET_BUS(CONFIG_SYS_SPD_BUS_NUM);
+}
+
+/*
+ * This code tries to use the features of the 405GP i2c
+ * controller. It will transfer up to 4 bytes in one pass
+ * on the loop. It only does out_8((u8 *)lbz) to the buffer when it
+ * is possible to do out16(lhz) transfers.
+ *
+ * cmd_type is 0 for write 1 for read.
+ *
+ * addr_len can take any value from 0-255, it is only limited
+ * by the char, we could make it larger if needed. If it is
+ * 0 we skip the address write cycle.
+ *
+ * Typical case is a Write of an addr followd by a Read. The
+ * IBM FAQ does not cover this. On the last byte of the write
+ * we don't set the creg CHT bit, and on the first bytes of the
+ * read we set the RPST bit.
+ *
+ * It does not support address only transfers, there must be
+ * a data part. If you want to write the address yourself, put
+ * it in the data pointer.
+ *
+ * It does not support transfer to/from address 0.
+ *
+ * It does not check XFRCNT.
+ */
+static int i2c_transfer(unsigned char cmd_type,
+                       unsigned char chip,
+                       unsigned char addr[],
+                       unsigned char addr_len,
+                       unsigned char data[],
+                       unsigned short data_len)
+{
+       struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+       u8 *ptr;
+       int reading;
+       int tran, cnt;
+       int result;
+       int status;
+       int i;
+       u8 creg;
+
+       if (data == 0 || data_len == 0) {
+               /* Don't support data transfer of no length or to address 0 */
+               printf( "i2c_transfer: bad call\n" );
+               return IIC_NOK;
+       }
+       if (addr && addr_len) {
+               ptr = addr;
+               cnt = addr_len;
+               reading = 0;
+       } else {
+               ptr = data;
+               cnt = data_len;
+               reading = cmd_type;
+       }
+
+       /* Clear Stop Complete Bit */
+       out_8(&i2c->sts, IIC_STS_SCMP);
+
+       /* Check init */
+       i = 10;
+       do {
+               /* Get status */
+               status = in_8(&i2c->sts);
+               i--;
+       } while ((status & IIC_STS_PT) && (i > 0));
+
+       if (status & IIC_STS_PT) {
+               result = IIC_NOK_TOUT;
+               return(result);
+       }
+
+       /* flush the Master/Slave Databuffers */
+       out_8(&i2c->mdcntl, in_8(&i2c->mdcntl) |
+             IIC_MDCNTL_FMDB | IIC_MDCNTL_FSDB);
+
+       /* need to wait 4 OPB clocks? code below should take that long */
+
+       /* 7-bit adressing */
+       out_8(&i2c->hmadr, 0);
+       out_8(&i2c->lmadr, chip);
+
+       tran = 0;
+       result = IIC_OK;
+       creg = 0;
+
+       while (tran != cnt && (result == IIC_OK)) {
+               int  bc,j;
+
+               /*
+                * Control register =
+                * Normal transfer, 7-bits adressing, Transfer up to
+                * bc bytes, Normal start, Transfer is a sequence of transfers
+                */
+               creg |= IIC_CNTL_PT;
+
+               bc = (cnt - tran) > 4 ? 4 : cnt - tran;
+               creg |= (bc - 1) << 4;
+               /* if the real cmd type is write continue trans */
+               if ((!cmd_type && (ptr == addr)) || ((tran + bc) != cnt))
+                       creg |= IIC_CNTL_CHT;
+
+               if (reading) {
+                       creg |= IIC_CNTL_READ;
+               } else {
+                       for(j = 0; j < bc; j++) {
+                               /* Set buffer */
+                               out_8(&i2c->mdbuf, ptr[tran + j]);
+                       }
+               }
+               out_8(&i2c->cntl, creg);
+
+               /*
+                * Transfer is in progress
+                * we have to wait for upto 5 bytes of data
+                * 1 byte chip address+r/w bit then bc bytes
+                * of data.
+                * udelay(10) is 1 bit time at 100khz
+                * Doubled for slop. 20 is too small.
+                */
+               i = 2 * 5 * 8;
+               do {
+                       /* Get status */
+                       status = in_8(&i2c->sts);
+                       udelay(10);
+                       i--;
+               } while ((status & IIC_STS_PT) && !(status & IIC_STS_ERR) &&
+                        (i > 0));
+
+               if (status & IIC_STS_ERR) {
+                       result = IIC_NOK;
+                       status = in_8(&i2c->extsts);
+                       /* Lost arbitration? */
+                       if (status & IIC_EXTSTS_LA)
+                               result = IIC_NOK_LA;
+                       /* Incomplete transfer? */
+                       if (status & IIC_EXTSTS_ICT)
+                               result = IIC_NOK_ICT;
+                       /* Transfer aborted? */
+                       if (status & IIC_EXTSTS_XFRA)
+                               result = IIC_NOK_XFRA;
+               } else if ( status & IIC_STS_PT) {
+                       result = IIC_NOK_TOUT;
+               }
+
+               /* Command is reading => get buffer */
+               if ((reading) && (result == IIC_OK)) {
+                       /* Are there data in buffer */
+                       if (status & IIC_STS_MDBS) {
+                               /*
+                                * even if we have data we have to wait 4OPB
+                                * clocks for it to hit the front of the FIFO,
+                                * after that we can just read. We should check
+                                * XFCNT here and if the FIFO is full there is
+                                * no need to wait.
+                                */
+                               udelay(1);
+                               for (j = 0; j < bc; j++)
+                                       ptr[tran + j] = in_8(&i2c->mdbuf);
+                       } else
+                               result = IIC_NOK_DATA;
+               }
+               creg = 0;
+               tran += bc;
+               if (ptr == addr && tran == cnt) {
+                       ptr = data;
+                       cnt = data_len;
+                       tran = 0;
+                       reading = cmd_type;
+                       if (reading)
+                               creg = IIC_CNTL_RPST;
+               }
+       }
+       return result;
+}
+
+int i2c_probe(uchar chip)
+{
+       uchar buf[1];
+
+       buf[0] = 0;
+
+       /*
+        * What is needed is to send the chip address and verify that the
+        * address was <ACK>ed (i.e. there was a chip at that address which
+        * drove the data line low).
+        */
+       return (i2c_transfer(1, chip << 1, 0, 0, buf, 1) != 0);
+}
+
+static int ppc4xx_i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer,
+                              int len, int read)
+{
+       uchar xaddr[4];
+       int ret;
+
+       if (alen > 4) {
+               printf("I2C: addr len %d not supported\n", alen);
+               return 1;
+       }
+
+       if (alen > 0) {
+               xaddr[0] = (addr >> 24) & 0xFF;
+               xaddr[1] = (addr >> 16) & 0xFF;
+               xaddr[2] = (addr >> 8) & 0xFF;
+               xaddr[3] = addr & 0xFF;
+       }
+
+
+#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
+       /*
+        * EEPROM chips that implement "address overflow" are ones
+        * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
+        * address and the extra bits end up in the "chip address"
+        * bit slots. This makes a 24WC08 (1Kbyte) chip look like
+        * four 256 byte chips.
+        *
+        * Note that we consider the length of the address field to
+        * still be one byte because the extra address bits are
+        * hidden in the chip address.
+        */
+       if (alen > 0)
+               chip |= ((addr >> (alen * 8)) &
+                        CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
+#endif
+       if ((ret = i2c_transfer(read, chip << 1, &xaddr[4 - alen], alen,
+                               buffer, len)) != 0) {
+               if (gd->have_console) {
+                       printf("I2C %s: failed %d\n",
+                              read ? "read" : "write", ret);
+               }
+
+               return 1;
+       }
+
+       return 0;
+}
+
+int i2c_read(uchar chip, uint addr, int alen, uchar * buffer, int len)
+{
+       return ppc4xx_i2c_transfer(chip, addr, alen, buffer, len, 1);
+}
+
+int i2c_write(uchar chip, uint addr, int alen, uchar * buffer, int len)
+{
+       return ppc4xx_i2c_transfer(chip, addr, alen, buffer, len, 0);
+}
+
+#if defined(CONFIG_I2C_MULTI_BUS)
+/*
+ * Functions for multiple I2C bus handling
+ */
+unsigned int i2c_get_bus_num(void)
+{
+       return i2c_bus_num;
+}
+
+int i2c_set_bus_num(unsigned int bus)
+{
+       if (bus >= CONFIG_SYS_MAX_I2C_BUS)
+               return -1;
+
+       i2c_bus_num = bus;
+
+       return 0;
+}
+#endif /* CONFIG_I2C_MULTI_BUS */
+#endif /* CONFIG_HARD_I2C */
index 5cb0f1e28cdf9bf42483db3bf4abf7f2317c66f6..4cb805223c3091b7277a3bb3bccddef792d24149 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index e3e6e75e8d0bbf0715c486b69509664cac761f9b..cdba81d3232ab486eecc9b0c58c1fb98ccf865e3 100644 (file)
  * I2C EEPROM (CAT24WC08) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index ae8494d577c6cf2a0cf3763ecbe54e0e0d65a101..2b6786b9dc5973669a24c7efa937c79adf03e71f 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 5c88c47b505de96d69265c36bf25228be9b7a0ac..922121173a21bdc071b917079a94f195b51708a1 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index d131aeaf43b23f6e1248a4d61e923b2f1e711065..3e7020df89dc06b4f6ddd4bcbadad8a8f68cc1f2 100644 (file)
  * I2C EEPROM (CAT24WC08) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 07c4e3599557e45e402dc972b927baa31c2d29bb..d3000f6578b99644fc4278597d6973c8d51ef1ed 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index c78552bbd420e03ce1a896de5c3886a5c1e3285e..d3763441ef9a1a5c4395c6dd9b038decceead9d4 100644 (file)
  * I2C EEPROM (CAT24WC32) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 59e0778f6a324c2b619bee081b5fdf8ec000d4a5..07acab0c2b6e20f051b7716858e945e16a774270 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index b2679e587865b221e8b117bb90673b1c617fb521..5b50bcf331be34864150a0520d3f630deda43e54 100644 (file)
  * I2C EEPROM (CAT24WC08) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 96bf161aa153b060f00e3223b74bfa4ab6a7db59..9ab30ecbaff2e95f692c5e10261aa1f72534107c 100644 (file)
@@ -65,6 +65,7 @@
  #define CONFIG_ETHADDR          00:40:a6:80:14:5
  */
 #define CONFIG_HARD_I2C         1              /* hardware support for i2c */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SDRAM_BANK0             1
 #define CONFIG_SYS_I2C_SPEED               400000      /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE               0x7F
index 49ecb6f36c88a697a8d537f9b4ba574d4c9c0635..4423f2ab62a0054d8758c22edff8758688856380 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index cfb30233185881d578a9547b0ec3b290c0dbd296..8f1fc78bce2fd6619c5095182e5b330646e12cb1 100644 (file)
  * I2C EEPROM (CAT24WC08) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 65dc2359d01b0a01405c647630a8a3ab58473a6b..830466f7a8dfd42a7901863bed915e19794f6b5b 100644 (file)
  */
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_I2C_MULTI_BUS    1
index 023f33e1ebd248407b38a89d92fd27854495adae..e07f9a1dc5a891998c7a8379b2c5c3e50f9c39f6 100644 (file)
@@ -54,6 +54,7 @@
 #endif                                 /* total size of a X1240 is 2048 bytes */
 
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 6819c3e3620988eab1abe81ba2e0ef12b9ccf188..d2883eb8d74cb1525d007150b8de23794ed8bfa2 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 92335239df2fe2e9c6e42c8d734411b3b6cb11e8..01e0bc65eccedf36c7370c89b4d76c75fb4db25d 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #if 0 /* test-only */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #else
index ea502d42cd0c135f9747a3da6be2480e811f6add..8c6d5edff7d206e755ac1c53ea5e9e70cf369f99 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 80c70e48869d6b2d617d2efe813397beb727ff8d..98f5661a09d285e773fe170b1bebe75b60ce2339 100644 (file)
 
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 4b67c9454b9e9a619b5920be70541de4511b175e..49a7378f272720e625e2ac10bbf5a9e6f825f00f 100644 (file)
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C              1              /* I2C hardware support    */
 #undef CONFIG_SOFT_I2C                      /* I2C !bit-banged         */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED         400000         /* I2C speed 400kHz        */
 #define CONFIG_SYS_I2C_SLAVE         0x7F           /* I2C slave address       */
 #define CONFIG_SYS_I2C_NOPROBES      {0x69}         /* Don't probe these addrs */
index 518173aa5d916f9bd2a16c0d9f43d1cec516525b..e7429dd1997df54604929588365e5e48a2776cdf 100644 (file)
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C              1              /* I2C hardware support    */
 #undef CONFIG_SOFT_I2C                      /* I2C !bit-banged         */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED         400000         /* I2C speed 400kHz        */
 #define CONFIG_SYS_I2C_SLAVE         0x7F           /* I2C slave address       */
 #define CONFIG_SYS_I2C_NOPROBES      {0x69}         /* Don't probe these addrs */
index 7ac934225191bd82eee64e564fdc11169170e84c..7e6484ee94e1f316ec8b7feefcb7bea5ca2b0b71 100644 (file)
@@ -97,6 +97,7 @@
  ***************************************************************/
 
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           50000   /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 860ec529216367d3b77f881e2fd83be3184d4ab2..55471af34a4f965a3752d7fe3963a57575408ee1 100644 (file)
  * I2C EEPROM (CAT24WC08) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index b2e2d41f2b03dac4819f4db1e1381f67ef38d3f1..142471362ffed32dab785dcade6c45fafa75ee18 100644 (file)
  * I2C EEPROM (CAT24WC08) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 4e397990ccbb4a05bf35c45a3df7dbda52a9a347..0d443ea2d41366571aa9639ee68f62b6b2be23e9 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 962b29e95b56b494f14d2525cb99cf391af8d2ff..3e57c0b92fe6ed0a59a969176343d06440d21312 100644 (file)
@@ -86,6 +86,7 @@
  * The Atmel EEPROM uses 16Bit addressing.
  ***************************************************************/
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           50000   /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 3d59454eb96709dccfd6d5e61a8ba9c075e8c261..f917eb5c258caffdba116277403306bae379f4d2 100644 (file)
  * I2C EEPROM (24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 87ea7b6d47e0e2b2fadbc50b5ba866de58917696..00a12fb83339b51971e136f653582fe7b2d71a57 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000 /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 7198632c36bb944e13eb0b19ca6e044ac64225bf..2c048dd0dd9774acb40f0ffe77d48548679cc73d 100644 (file)
  * I2C EEPROM (24W16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000 /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 89799af3f3191119f2045e970940079cade6f5f0..c2fb56c6f9abdb7858f8a737f7c53ea92c424873 100644 (file)
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C         /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 8e9d92872a88f03ae5f545e275ec6c0807450594..44f03dc3906eae9a1ad499df70bd488188d0d76b 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 38a1d0deca531e66e3230ad2d76ef9cf72ec27ea..9c91fccb11e3f73c13eb17e16453f6b24d0b0ced 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 4717869ddef01e177d13c7624f9e6464adaa2e1c..871e4c339e0ddd811f98e62aeff92668ec85e1d2 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index c0179150c2b6b38489de236efe73395ce9b614fc..f06bfe5521bc2c1ec21e1402bc5b79a9b894f9cf 100644 (file)
  * I2C EEPROM (CAT24WC08) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 1d4ad13ed3bee9027596382a794ac5a4a46838a7..be8c9f82ef2a0215727ec13986a5f61c157cf13b 100644 (file)
  * I2C EEPROM (ATMEL 24C04N)
  */
 #define CONFIG_HARD_I2C                1               /* Hardware assisted I2C        */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 5c281a1a6632a8ae3f00e0518fbc96c4477aab9a..be9ac6261c194d9d201254038e0ba3c32a735091 100644 (file)
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 658e9473bc2f2eb1aedd9bc09ed78babc782ca02..cf39aeaaf7b65273f1475d11e64053ebde9b5122 100644 (file)
@@ -141,6 +141,7 @@ extern void out32(unsigned int, unsigned long);
  * I2C
  */
 #define CONFIG_HARD_I2C                        1       /* I2C with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7f
 #define CONFIG_I2C_MULTI_BUS
index 0fed9ad68e045f00e2c900c4f61d9913348df176..f2392f648c88d2fb4d74a55fa2e6f262e1166e14 100644 (file)
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs      */
index 8cd97b86da13bb35744d2a35c77fb32e013c71ef..13a941ef635c8c677a80f29f4fe3680c6a8a4f39 100644 (file)
@@ -40,6 +40,7 @@
  * I2C
  */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support    */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
 /*
index aed6f50f983f96a01c634d7f5a493c8804ce3736..9ded33066448bc5def09f25be7ceb53205b4698b 100644 (file)
  *
  */
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed                    */
 #define CONFIG_SYS_I2C_SLAVE           0x7F    /* I2C slave address            */
 
index 24b961f3e1338abc08dfd8d19c17fc7fbff75d9f..71eb083e33b8cd68f75518a2ce0e9da31bb346fb 100644 (file)
  *
  */
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed                    */
 #define CONFIG_SYS_I2C_SLAVE           0x7F    /* I2C slave address            */
 
index 026dd0854aca4f01014eebd85c87c926ada044f9..f95df684ea868519d9cee210cf6d3fac0bab1bf1 100644 (file)
  */
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 011dd5c81abaaa19d248e934627186602d17eba7..6461124e56cf2e77a7279bd8987a8fe8360db1a6 100644 (file)
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1               /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C                         /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000          /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 4bed7ae2673039df02ee7d2d654eeb866b2c8faa..cb7efe7abca7ee867bc1ccd6091b63ec2687dad3 100644 (file)
@@ -42,6 +42,7 @@
  * I2C
  */
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 729ca6ac7dfe182e7e19ff64c548c81bb91d7a28..d6b92070a9111cf25bcdd229e2143930f1daaddc 100644 (file)
@@ -92,6 +92,7 @@
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs      */
index 000ae5cd7d48257af80111f7ca04db801a290f51..1f744b875d69cd58e95e6ae6349d31e2f5cc0bec 100644 (file)
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1           /* I2C with hardware support        */
 #undef CONFIG_SOFT_I2C                     /* I2C bit-banged           */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index b08dcd42dec76d1f38b7f063b84a456cdb008eae..403837e14b02dc00d18019664d43df09a0bc84c6 100644 (file)
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1               /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C                         /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 242f42fdc325536520f6ed174b585391472ebba3..429b11c1968b9b50cf8f368652a8ef0f11364f8d 100644 (file)
 
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
 #undef  CONFIG_SOFT_I2C                        /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index a5eca398907bf173e5b90419d35b31e131b91199..d00f2480cb6a256219771f73340278ca43ec4d4a 100644 (file)
  */
 #define  CONFIG_HARD_I2C               /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 
 #define I2C_INIT
 #define I2C_ACTIVE 0
index 1a77c719686e04eff0b53fb11a139829fda28404..3b2aede4fddd31633cfd3a26219788dfda9c3471 100644 (file)
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1               /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C                         /* I2C bit-banged               */
+#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F