summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Eibach <dirk.eibach@gdsys.cc>2013-04-25 02:40:01 +0000
committerHeiko Schocher <hs@denx.de>2013-07-23 08:34:56 +0200
commit880540decfb855e96bc14ac84ac7784669e4b382 (patch)
tree771220f0de64d8cf1496ed9191f04793ec330804
parent1f2ba722ac06393d6abe6d4734824d3b98ea9108 (diff)
i2c, ppc4xx_i2c: switch to new multibus/multiadapter support
Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc> Cc: Heiko Schocher <hs@denx.de> Cc: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
-rw-r--r--README5
-rw-r--r--arch/powerpc/cpu/ppc4xx/40x_spd_sdram.c6
-rw-r--r--arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c6
-rw-r--r--arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c3
-rw-r--r--arch/powerpc/cpu/ppc4xx/cmd_chip_config.c2
-rw-r--r--arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c3
-rw-r--r--arch/powerpc/include/asm/ppc4xx-i2c.h18
-rw-r--r--board/csb272/csb272.c2
-rw-r--r--board/esd/du440/du440.c2
-rw-r--r--board/lwmon5/kbd.c2
-rw-r--r--board/mpl/pip405/pip405.c2
-rw-r--r--board/sandburst/common/ppc440gx_i2c.c510
-rw-r--r--board/sandburst/common/ppc440gx_i2c.h60
-rw-r--r--board/sandburst/common/sb_common.c103
-rw-r--r--board/sandburst/common/sb_common.h1
-rw-r--r--board/sandburst/karef/Makefile3
-rw-r--r--board/sandburst/karef/karef.c5
-rw-r--r--board/sandburst/metrobox/Makefile3
-rw-r--r--board/sandburst/metrobox/metrobox.c6
-rw-r--r--drivers/i2c/Makefile2
-rw-r--r--drivers/i2c/ppc4xx_i2c.c193
-rw-r--r--include/configs/APC405.h9
-rw-r--r--include/configs/ASH405.h9
-rw-r--r--include/configs/CANBT.h16
-rw-r--r--include/configs/CATcenter.h9
-rw-r--r--include/configs/CMS700.h9
-rw-r--r--include/configs/CPCI2DP.h9
-rw-r--r--include/configs/CPCI405.h9
-rw-r--r--include/configs/CPCI4052.h9
-rw-r--r--include/configs/CPCI405AB.h9
-rw-r--r--include/configs/CPCI405DT.h9
-rw-r--r--include/configs/CPCIISER4.h9
-rw-r--r--include/configs/CRAYL1.h9
-rw-r--r--include/configs/DP405.h9
-rw-r--r--include/configs/DU405.h9
-rw-r--r--include/configs/DU440.h18
-rw-r--r--include/configs/G2000.h9
-rw-r--r--include/configs/HH405.h11
-rw-r--r--include/configs/HUB405.h9
-rw-r--r--include/configs/JSE.h9
-rw-r--r--include/configs/KAREF.h16
-rw-r--r--include/configs/METROBOX.h16
-rw-r--r--include/configs/MIP405.h9
-rw-r--r--include/configs/OCRTC.h9
-rw-r--r--include/configs/ORSG.h9
-rw-r--r--include/configs/PCI405.h9
-rw-r--r--include/configs/PIP405.h9
-rw-r--r--include/configs/PLU405.h9
-rw-r--r--include/configs/PMC405.h9
-rw-r--r--include/configs/PMC405DE.h9
-rw-r--r--include/configs/PMC440.h14
-rw-r--r--include/configs/PPChameleonEVB.h9
-rw-r--r--include/configs/VOH405.h9
-rw-r--r--include/configs/VOM405.h9
-rw-r--r--include/configs/W7OLMC.h9
-rw-r--r--include/configs/W7OLMG.h9
-rw-r--r--include/configs/WUH405.h9
-rw-r--r--include/configs/acadia.h2
-rw-r--r--include/configs/alpr.h11
-rw-r--r--include/configs/amcc-common.h7
-rw-r--r--include/configs/bamboo.h2
-rw-r--r--include/configs/bluestone.h2
-rw-r--r--include/configs/bubinga.h4
-rw-r--r--include/configs/canyonlands.h2
-rw-r--r--include/configs/csb272.h9
-rw-r--r--include/configs/csb472.h9
-rw-r--r--include/configs/dlvision-10g.h2
-rw-r--r--include/configs/dlvision.h2
-rw-r--r--include/configs/ebony.h2
-rw-r--r--include/configs/gdppc440etx.h2
-rw-r--r--include/configs/icon.h3
-rw-r--r--include/configs/intip.h2
-rw-r--r--include/configs/io.h2
-rw-r--r--include/configs/io64.h2
-rw-r--r--include/configs/iocon.h8
-rw-r--r--include/configs/katmai.h3
-rw-r--r--include/configs/kilauea.h2
-rw-r--r--include/configs/korat.h9
-rw-r--r--include/configs/luan.h2
-rw-r--r--include/configs/lwmon5.h9
-rw-r--r--include/configs/makalu.h2
-rw-r--r--include/configs/neo.h2
-rw-r--r--include/configs/ocotea.h2
-rw-r--r--include/configs/p3p440.h11
-rw-r--r--include/configs/pcs440ep.h9
-rw-r--r--include/configs/quad100hd.h9
-rw-r--r--include/configs/redwood.h4
-rw-r--r--include/configs/sbc405.h9
-rw-r--r--include/configs/sc3.h9
-rw-r--r--include/configs/sequoia.h2
-rw-r--r--include/configs/t3corp.h2
-rw-r--r--include/configs/taihu.h4
-rw-r--r--include/configs/taishan.h2
-rw-r--r--include/configs/walnut.h2
-rw-r--r--include/configs/xpedite1000.h10
-rw-r--r--include/configs/yosemite.h2
-rw-r--r--include/configs/yucca.h4
-rw-r--r--include/configs/zeus.h9
98 files changed, 465 insertions, 1025 deletions
diff --git a/README b/README
index c67106d9ade..d0aeb526209 100644
--- a/README
+++ b/README
@@ -1985,6 +1985,11 @@ CBFS (Coreboot Filesystem) support
- This driver adds 4 i2c buses with a fix speed from
100000 and the slave addr 0!
+ - drivers/i2c/ppc4xx_i2c.c
+ - activate this driver with CONFIG_SYS_I2C_PPC4XX
+ - CONFIG_SYS_I2C_PPC4XX_CH0 activate hardware channel 0
+ - CONFIG_SYS_I2C_PPC4XX_CH1 activate hardware channel 1
+
additional defines:
CONFIG_SYS_NUM_I2C_BUSES
diff --git a/arch/powerpc/cpu/ppc4xx/40x_spd_sdram.c b/arch/powerpc/cpu/ppc4xx/40x_spd_sdram.c
index 48aa75391df..fd458fdc9fb 100644
--- a/arch/powerpc/cpu/ppc4xx/40x_spd_sdram.c
+++ b/arch/powerpc/cpu/ppc4xx/40x_spd_sdram.c
@@ -52,10 +52,6 @@
/*
* Set default values
*/
-#ifndef CONFIG_SYS_I2C_SPEED
-#define CONFIG_SYS_I2C_SPEED 50000
-#endif
-
#define ONE_BILLION 1000000000
#define SDRAM0_CFG_DCE 0x80000000
@@ -158,7 +154,7 @@ long int spd_sdram(int(read_spd)(uint addr))
* Make sure I2C controller is initialized
* before continuing.
*/
- i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
}
/* Make shure we are using SDRAM */
diff --git a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c
index 161d274dfff..9c566c19f80 100644
--- a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c
+++ b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c
@@ -62,10 +62,6 @@
/*
* Set default values
*/
-#ifndef CONFIG_SYS_I2C_SPEED
-#define CONFIG_SYS_I2C_SPEED 50000
-#endif
-
#define ONE_BILLION 1000000000
/*
@@ -168,7 +164,7 @@ long int spd_sdram(void) {
* Make sure I2C controller is initialized
* before continuing.
*/
- i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
/*
* Read the SPD information using I2C interface. Check to see if the
diff --git a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
index def7ebf7227..a66973ee77b 100644
--- a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
+++ b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
@@ -459,8 +459,7 @@ phys_size_t initdram(int board_type)
*/
/* switch to correct I2C bus */
- I2C_SET_BUS(CONFIG_SYS_SPD_BUS_NUM);
- i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
/*------------------------------------------------------------------
* Clear out the serial presence detect buffers.
diff --git a/arch/powerpc/cpu/ppc4xx/cmd_chip_config.c b/arch/powerpc/cpu/ppc4xx/cmd_chip_config.c
index 72c5aec7066..0eafe3e067e 100644
--- a/arch/powerpc/cpu/ppc4xx/cmd_chip_config.c
+++ b/arch/powerpc/cpu/ppc4xx/cmd_chip_config.c
@@ -56,7 +56,7 @@ static int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const arg
* First switch to correct I2C bus. This is I2C bus 0
* for all currently available 4xx derivats.
*/
- I2C_SET_BUS(0);
+ i2c_set_bus_num(0);
#ifdef CONFIG_CMD_EEPROM
ret = eeprom_read(CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR,
diff --git a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c
index 3ceab32e437..df9637504a9 100644
--- a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c
+++ b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c
@@ -1041,8 +1041,7 @@ phys_size_t initdram(int board_type)
* before continuing.
*/
/* switch to correct I2C bus */
- I2C_SET_BUS(CONFIG_SYS_SPD_BUS_NUM);
- i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
/*------------------------------------------------------------------
* Clear out the serial presence detect buffers.
diff --git a/arch/powerpc/include/asm/ppc4xx-i2c.h b/arch/powerpc/include/asm/ppc4xx-i2c.h
index 0c6c926f731..89de5086eb3 100644
--- a/arch/powerpc/include/asm/ppc4xx-i2c.h
+++ b/arch/powerpc/include/asm/ppc4xx-i2c.h
@@ -34,24 +34,6 @@
#define IIC_TIMEOUT 1 /* 1 second */
-#if defined(CONFIG_I2C_MULTI_BUS)
-#define I2C_BUS_OFFS (i2c_bus_num * 0x100)
-#else
-#define I2C_BUS_OFFS (0x000)
-#endif /* CONFIG_I2C_MULTI_BUS */
-
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
- defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
- defined(CONFIG_460EX) || defined(CONFIG_460GT)
-#define I2C_BASE_ADDR (CONFIG_SYS_PERIPHERAL_BASE + 0x00000700 + I2C_BUS_OFFS)
-#elif defined(CONFIG_440) || defined(CONFIG_405EX)
-/* all remaining 440 variants */
-#define I2C_BASE_ADDR (CONFIG_SYS_PERIPHERAL_BASE + 0x00000400 + I2C_BUS_OFFS)
-#else
-/* all 405 variants */
-#define I2C_BASE_ADDR (0xEF600500 + I2C_BUS_OFFS)
-#endif
-
struct ppc4xx_i2c {
u8 mdbuf;
u8 res1;
diff --git a/board/csb272/csb272.c b/board/csb272/csb272.c
index 8b36127e900..a53dac19e5d 100644
--- a/board/csb272/csb272.c
+++ b/board/csb272/csb272.c
@@ -51,7 +51,7 @@ uchar pll_fs6377_regs[16] = {
*/
int pll_init(void)
{
- i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(0);
return i2c_write(CONFIG_SYS_I2C_PLL_ADDR, 0, 1,
(uchar *) pll_fs6377_regs, sizeof(pll_fs6377_regs));
diff --git a/board/esd/du440/du440.c b/board/esd/du440/du440.c
index 1ada1bc9849..64d43c505d6 100644
--- a/board/esd/du440/du440.c
+++ b/board/esd/du440/du440.c
@@ -385,7 +385,6 @@ int last_stage_init(void)
return 0;
}
-#if defined(CONFIG_I2C_MULTI_BUS)
/*
* read field strength from I2C ADC
*/
@@ -500,7 +499,6 @@ U_BOOT_CMD(
"Initialize USB hub",
""
);
-#endif /* CONFIG_I2C_MULTI_BUS */
#define CONFIG_SYS_BOOT_EEPROM_PAGE_WRITE_BITS 3
int boot_eeprom_write (unsigned dev_addr,
diff --git a/board/lwmon5/kbd.c b/board/lwmon5/kbd.c
index b66f681eeb7..9834bfd1900 100644
--- a/board/lwmon5/kbd.c
+++ b/board/lwmon5/kbd.c
@@ -111,7 +111,7 @@ static void kbd_init (void)
uchar val, errcd;
int i;
- i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(0);
gd->arch.kbd_status = 0;
diff --git a/board/mpl/pip405/pip405.c b/board/mpl/pip405/pip405.c
index b203037cf99..655e129f94d 100644
--- a/board/mpl/pip405/pip405.c
+++ b/board/mpl/pip405/pip405.c
@@ -209,7 +209,7 @@ int board_early_init_f (void)
#endif
/* Read Serial Presence Detect Information */
- i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(0);
for (i = 0; i < 128; i++)
datain[i] = 127;
i2c_read(SPD_EEPROM_ADDRESS,0,1,datain,128);
diff --git a/board/sandburst/common/ppc440gx_i2c.c b/board/sandburst/common/ppc440gx_i2c.c
deleted file mode 100644
index 85b63fc558a..00000000000
--- a/board/sandburst/common/ppc440gx_i2c.c
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
- * Copyright (C) 2005 Sandburst Corporation
- *
- * 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
- */
-
-/*
- * Ported from arch/powerpc/cpu/ppc4xx/i2c.c by AS HARNOIS by
- * Travis B. Sawyer
- * Sandburst Corporation.
- */
-#include <common.h>
-#include <asm/ppc4xx.h>
-#include <asm/ppc4xx-i2c.h>
-#include <i2c.h>
-#include <command.h>
-#include "ppc440gx_i2c.h"
-#include <asm/io.h>
-
-#ifdef CONFIG_I2C_BUS1
-
-#define IIC_OK 0
-#define IIC_NOK 1
-#define IIC_NOK_LA 2 /* Lost arbitration */
-#define IIC_NOK_ICT 3 /* Incomplete transfer */
-#define IIC_NOK_XFRA 4 /* Transfer aborted */
-#define IIC_NOK_DATA 5 /* No data in buffer */
-#define IIC_NOK_TOUT 6 /* Transfer timeout */
-
-#define IIC_TIMEOUT 1 /* 1 second */
-#if defined(CONFIG_SYS_I2C_NOPROBES)
-static uchar i2c_no_probes[] = CONFIG_SYS_I2C_NOPROBES;
-#endif
-
-static struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_REGISTERS_BUS1_BASE_ADDRESS;
-
-static void _i2c_bus1_reset (void)
-{
- int i, status;
-
- /* Reset status register */
- /* write 1 in SCMP and IRQA to clear these fields */
- out_8 (IIC_STS1, 0x0A);
-
- /* write 1 in IRQP IRQD LA ICT XFRA to clear these fields */
- out_8 (IIC_EXTSTS1, 0x8F);
- __asm__ volatile ("eieio");
-
- /*
- * Get current state, reset bus
- * only if no transfers are pending.
- */
- i = 10;
- do {
- /* Get status */
- status = in_8 (IIC_STS1);
- udelay (500); /* 500us */
- i--;
- } while ((status & IIC_STS_PT) && (i > 0));
- /* Soft reset controller */
- status = in_8 (IIC_XTCNTLSS1);
- out_8 (IIC_XTCNTLSS1, (status | IIC_XTCNTLSS_SRST));
- __asm__ volatile ("eieio");
-
- /* make sure where in initial state, data hi, clock hi */
- out_8 (IIC_DIRECTCNTL1, 0xC);
- for (i = 0; i < 10; i++) {
- if ((in_8 (IIC_DIRECTCNTL1) & 0x3) != 0x3) {
- /* clock until we get to known state */
- out_8 (IIC_DIRECTCNTL1, 0x8); /* clock lo */
- udelay (100); /* 100us */
- out_8 (IIC_DIRECTCNTL1, 0xC); /* clock hi */
- udelay (100); /* 100us */
- } else {
- break;
- }
- }
- /* send start condition */
- out_8 (IIC_DIRECTCNTL1, 0x4);
- udelay (1000); /* 1ms */
- /* send stop condition */
- out_8 (IIC_DIRECTCNTL1, 0xC);
- udelay (1000); /* 1ms */
- /* Unreset controller */
- out_8 (IIC_XTCNTLSS1, (status & ~IIC_XTCNTLSS_SRST));
- udelay (1000); /* 1ms */
-}
-
-void i2c1_init (int speed, int slaveadd)
-{
- sys_info_t sysInfo;
- unsigned long freqOPB;
- int val, divisor;
-
-#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
-
- /* Handle possible failed I2C state */
- /* FIXME: put this into i2c_init_board()? */
- _i2c_bus1_reset ();
-
- /* clear lo master address */
- out_8 (IIC_LMADR1, 0);
-
- /* clear hi master address */
- out_8 (IIC_HMADR1, 0);
-
- /* clear lo slave address */
- out_8 (IIC_LSADR1, 0);
-
- /* clear hi slave address */
- out_8 (IIC_HSADR1, 0);
-
- /* Clock divide Register */
- /* get OPB frequency */
- get_sys_info (&sysInfo);
- freqOPB = sysInfo.freqPLB / sysInfo.pllOpbDiv;
- /* set divisor according to freqOPB */
- divisor = (freqOPB - 1) / 10000000;
- if (divisor == 0)
- divisor = 1;
- out_8 (IIC_CLKDIV1, divisor);
-
- /* no interrupts */
- out_8 (IIC_INTRMSK1, 0);
-
- /* clear transfer count */
- out_8 (IIC_XFRCNT1, 0);
-
- /* clear extended control & stat */
- /* write 1 in SRC SRS SWC SWS to clear these fields */
- out_8 (IIC_XTCNTLSS1, 0xF0);
-
- /* Mode Control Register
- Flush Slave/Master data buffer */
- out_8 (IIC_MDCNTL1, IIC_MDCNTL_FSDB | IIC_MDCNTL_FMDB);
- __asm__ volatile ("eieio");
-
-
- val = in_8(IIC_MDCNTL1);
- __asm__ volatile ("eieio");
-
- /* 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 (IIC_MDCNTL1, val);
-
- /* clear control reg */
- out_8 (IIC_CNTL1, 0x00);
- __asm__ volatile ("eieio");
-
-}
-
-/*
- 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(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_transfer1(unsigned char cmd_type,
- unsigned char chip,
- unsigned char addr[],
- unsigned char addr_len,
- unsigned char data[],
- unsigned short data_len )
-{
- unsigned char* ptr;
- int reading;
- int tran,cnt;
- int result;
- int status;
- int i;
- uchar 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(IIC_STS1,IIC_STS_SCMP);
- /* Check init */
- i=10;
- do {
- /* Get status */
- status = in_8(IIC_STS1);
- __asm__ volatile("eieio");
- 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(IIC_MDCNTL1, ((in_8(IIC_MDCNTL1))|IIC_MDCNTL_FMDB|IIC_MDCNTL_FSDB));
- /*need to wait 4 OPB clocks? code below should take that long*/
-
- /* 7-bit adressing */
- out_8(IIC_HMADR1,0);
- out_8(IIC_LMADR1, chip);
- __asm__ volatile("eieio");
-
- 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(IIC_MDBUF1,ptr[tran+j]);
- __asm__ volatile("eieio");
- }
- }
- out_8(IIC_CNTL1, creg );
- __asm__ volatile("eieio");
-
- /* 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(IIC_STS1);
- __asm__ volatile("eieio");
- 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 (IIC_EXTSTS1);
- /* 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(IIC_MDBUF1);
- __asm__ volatile("eieio");
- }
- } 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_probe1 (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_transfer1 (1, chip << 1, 0,0, buf, 1) != 0);
-}
-
-
-int i2c_read1 (uchar chip, uint addr, int alen, uchar * buffer, int len)
-{
- uchar xaddr[4];
- int ret;
-
- if ( alen > 4 ) {
- printf ("I2C read: 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_transfer1( 1, chip<<1, &xaddr[4-alen], alen, buffer, len )) != 0) {
- printf( "I2c read: failed %d\n", ret);
- return 1;
- }
- return 0;
-}
-
-int i2c_write1 (uchar chip, uint addr, int alen, uchar * buffer, int len)
-{
- uchar xaddr[4];
-
- if ( alen > 4 ) {
- printf ("I2C write: 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
-
- return (i2c_transfer1( 0, chip<<1, &xaddr[4-alen], alen, buffer, len ) != 0);
-}
-
-/*-----------------------------------------------------------------------
- * Read a register
- */
-uchar i2c_reg_read1(uchar i2c_addr, uchar reg)
-{
- uchar buf;
-
- i2c_read1(i2c_addr, reg, 1, &buf, (uchar)1);
-
- return(buf);
-}
-
-/*-----------------------------------------------------------------------
- * Write a register
- */
-void i2c_reg_write1(uchar i2c_addr, uchar reg, uchar val)
-{
- i2c_write1(i2c_addr, reg, 1, &val, 1);
-}
-
-
-int do_i2c1_probe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
- int j;
-#if defined(CONFIG_SYS_I2C_NOPROBES)
- int k, skip;
-#endif
-
- puts ("Valid chip addresses:");
- for(j = 0; j < 128; j++) {
-#if defined(CONFIG_SYS_I2C_NOPROBES)
- skip = 0;
- for (k = 0; k < sizeof(i2c_no_probes); k++){
- if (j == i2c_no_probes[k]){
- skip = 1;
- break;
- }
- }
- if (skip)
- continue;
-#endif
- if(i2c_probe1(j) == 0) {
- printf(" %02X", j);
- }
- }
- putc ('\n');
-
-#if defined(CONFIG_SYS_I2C_NOPROBES)
- puts ("Excluded chip addresses:");
- for( k = 0; k < sizeof(i2c_no_probes); k++ )
- printf(" %02X", i2c_no_probes[k] );
- putc ('\n');
-#endif
-
- return 0;
-}
-
-U_BOOT_CMD(
- iprobe1, 1, 1, do_i2c1_probe,
- "probe to discover valid I2C chip addresses",
- ""
-);
-
-#endif /* CONFIG_I2C_BUS1 */
diff --git a/board/sandburst/common/ppc440gx_i2c.h b/board/sandburst/common/ppc440gx_i2c.h
deleted file mode 100644
index 7496db48405..00000000000
--- a/board/sandburst/common/ppc440gx_i2c.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2005 Sandburst Corporation
- *
- * 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
- */
-
-/*
- * Ported from i2c driver for ppc4xx by AS HARNOIS by
- * Travis B. Sawyer
- * Sandburst Corporation
- */
-#include <common.h>
-#include <asm/ppc4xx.h>
-#include <asm/ppc4xx-i2c.h>
-#include <i2c.h>
-
-#ifdef CONFIG_HARD_I2C
-
-#define I2C_BUS1_BASE_ADDR (CONFIG_SYS_PERIPHERAL_BASE + 0x00000500)
-#define I2C_REGISTERS_BUS1_BASE_ADDRESS I2C_BUS1_BASE_ADDR
-#define IIC_MDBUF1 (&i2c->mdbuf)
-#define IIC_SDBUF1 (&i2c->sdbuf)
-#define IIC_LMADR1 (&i2c->lmadr)
-#define IIC_HMADR1 (&i2c->hmadr)
-#define IIC_CNTL1 (&i2c->cntl)
-#define IIC_MDCNTL1 (&i2c->mdcntl)
-#define IIC_STS1 (&i2c->sts)
-#define IIC_EXTSTS1 (&i2c->extsts)
-#define IIC_LSADR1 (&i2c->lsadr)
-#define IIC_HSADR1 (&i2c->hsadr)
-#define IIC_CLKDIV1 (&i2c->clkdiv)
-#define IIC_INTRMSK1 (&i2c->intrmsk)
-#define IIC_XFRCNT1 (&i2c->xfrcnt)
-#define IIC_XTCNTLSS1 (&i2c->xtcntlss)
-#define IIC_DIRECTCNTL1 (&i2c->directcntl)
-
-void i2c1_init (int speed, int slaveadd);
-int i2c_probe1 (uchar chip);
-int i2c_read1 (uchar chip, uint addr, int alen, uchar * buffer, int len);
-int i2c_write1 (uchar chip, uint addr, int alen, uchar * buffer, int len);
-uchar i2c_reg_read1(uchar i2c_addr, uchar reg);
-void i2c_reg_write1(uchar i2c_addr, uchar reg, uchar val);
-
-#endif /* CONFIG_HARD_I2C */
diff --git a/board/sandburst/common/sb_common.c b/board/sandburst/common/sb_common.c
index 6b910743d52..305e110b174 100644
--- a/board/sandburst/common/sb_common.c
+++ b/board/sandburst/common/sb_common.c
@@ -26,7 +26,6 @@
#include <asm/io.h>
#include <spd_sdram.h>
#include <i2c.h>
-#include "ppc440gx_i2c.h"
#include "sb_common.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -84,7 +83,7 @@ unsigned short sbcommon_get_serial_number(void)
/* Get the board serial number from eeprom */
/* Initialize I2C */
- i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(0);
/* Read 256 bytes in EEPROM */
i2c_read (0x50, 0, 1, buff, 0x100);
@@ -110,85 +109,87 @@ void sbcommon_fans(void)
* Attempt to turn on 2 of the fans...
* Need to go through the bridge
*/
+ i2c_set_bus_num(1);
puts ("FANS: ");
/* select fan4 through the bridge */
- i2c_reg_write1(0x73, /* addr */
- 0x00, /* reg */
- 0x08); /* val = bus 4 */
+ i2c_reg_write(0x73, /* addr */
+ 0x00, /* reg */
+ 0x08); /* val = bus 4 */
/* Turn on FAN 4 */
- i2c_reg_write1(0x2e,
- 1,
- 0x80);
+ i2c_reg_write(0x2e,
+ 1,
+ 0x80);
- i2c_reg_write1(0x2e,
- 0,
- 0x19);
+ i2c_reg_write(0x2e,
+ 0,
+ 0x19);
/* Deselect bus 4 on the bridge */
- i2c_reg_write1(0x73,
- 0x00,
- 0x00);
+ i2c_reg_write(0x73,
+ 0x00,
+ 0x00);
/* select fan3 through the bridge */
- i2c_reg_write1(0x73, /* addr */
- 0x00, /* reg */
- 0x04); /* val = bus 3 */
+ i2c_reg_write(0x73, /* addr */
+ 0x00, /* reg */
+ 0x04); /* val = bus 3 */
/* Turn on FAN 3 */
- i2c_reg_write1(0x2e,
- 1,
- 0x80);
+ i2c_reg_write(0x2e,
+ 1,
+ 0x80);
- i2c_reg_write1(0x2e,
- 0,
- 0x19);
+ i2c_reg_write(0x2e,
+ 0,
+ 0x19);
/* Deselect bus 3 on the bridge */
- i2c_reg_write1(0x73,
- 0x00,
- 0x00);
+ i2c_reg_write(0x73,
+ 0x00,
+ 0x00);
/* select fan2 through the bridge */
- i2c_reg_write1(0x73, /* addr */
- 0x00, /* reg */
- 0x02); /* val = bus 4 */
+ i2c_reg_write(0x73, /* addr */
+ 0x00, /* reg */
+ 0x02); /* val = bus 4 */
/* Turn on FAN 2 */
- i2c_reg_write1(0x2e,
- 1,
- 0x80);
+ i2c_reg_write(0x2e,
+ 1,
+ 0x80);
- i2c_reg_write1(0x2e,
- 0,
- 0x19);
+ i2c_reg_write(0x2e,
+ 0,
+ 0x19);
/* Deselect bus 2 on the bridge */
- i2c_reg_write1(0x73,
- 0x00,
- 0x00);
+ i2c_reg_write(0x73,
+ 0x00,
+ 0x00);
/* select fan1 through the bridge */
- i2c_reg_write1(0x73, /* addr */
- 0x00, /* reg */
- 0x01); /* val = bus 0 */
+ i2c_reg_write(0x73, /* addr */
+ 0x00, /* reg */
+ 0x01); /* val = bus 0 */
/* Turn on FAN 1 */
- i2c_reg_write1(0x2e,
- 1,
- 0x80);
+ i2c_reg_write(0x2e,
+ 1,
+ 0x80);
- i2c_reg_write1(0x2e,
- 0,
- 0x19);
+ i2c_reg_write(0x2e,
+ 0,
+ 0x19);
/* Deselect bus 1 on the bridge */
- i2c_reg_write1(0x73,
- 0x00,
- 0x00);
+ i2c_reg_write(0x73,
+ 0x00,
+ 0x00);
puts ("on\n");
+ i2c_set_bus_num(0);
return;
@@ -319,7 +320,7 @@ void board_get_enetaddr(int macaddr_idx, uchar *enet)
if (0 == macaddr_idx) {
/* Initialize I2C */
- i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(0);
/* Read 256 bytes in EEPROM */
i2c_read (0x50, 0, 1, buff, 0x100);
diff --git a/board/sandburst/common/sb_common.h b/board/sandburst/common/sb_common.h
index e652ba8ed83..5b28244440e 100644
--- a/board/sandburst/common/sb_common.h
+++ b/board/sandburst/common/sb_common.h
@@ -28,7 +28,6 @@
#include <asm/io.h>
#include <spd_sdram.h>
#include <i2c.h>
-#include "ppc440gx_i2c.h"
/*
* GPIO Settings
diff --git a/board/sandburst/karef/Makefile b/board/sandburst/karef/Makefile
index fe9b5147614..d9b317098d0 100644
--- a/board/sandburst/karef/Makefile
+++ b/board/sandburst/karef/Makefile
@@ -40,8 +40,7 @@ CFLAGS += -DBUILDUSER='"$(BUILDUSER)"'
LIB = $(obj)lib$(BOARD).o
-COBJS = $(BOARD).o ../common/flash.o ../common/ppc440gx_i2c.o \
- ../common/sb_common.o
+COBJS = $(BOARD).o ../common/flash.o ../common/sb_common.o
SOBJS = init.o
diff --git a/board/sandburst/karef/karef.c b/board/sandburst/karef/karef.c
index 186998d1dfc..d156844ea95 100644
--- a/board/sandburst/karef/karef.c
+++ b/board/sandburst/karef/karef.c
@@ -337,11 +337,6 @@ int checkboard (void)
************************************************************************/
int misc_init_f (void)
{
- /* Turn on i2c bus 1 */
- puts ("I2C1: ");
- i2c1_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
- puts ("ready\n");
-
/* Turn on fans 3 & 4 */
sbcommon_fans();
diff --git a/board/sandburst/metrobox/Makefile b/board/sandburst/metrobox/Makefile
index 6019d5963c6..3f19bf2bd69 100644
--- a/board/sandburst/metrobox/Makefile
+++ b/board/sandburst/metrobox/Makefile
@@ -39,8 +39,7 @@ CFLAGS += -DBUILDUSER='"$(BUILDUSER)"'
LIB = $(obj)lib$(BOARD).o
-COBJS = $(BOARD).o ../common/flash.o ../common/ppc440gx_i2c.o \
- ../common/sb_common.o
+COBJS = $(BOARD).o ../common/flash.o ../common/sb_common.o
SOBJS = init.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/board/sandburst/metrobox/metrobox.c b/board/sandburst/metrobox/metrobox.c
index 76d8293fd67..ce4a0296ec1 100644
--- a/board/sandburst/metrobox/metrobox.c
+++ b/board/sandburst/metrobox/metrobox.c
@@ -30,7 +30,6 @@
#include <asm/io.h>
#include <spd_sdram.h>
#include <i2c.h>
-#include "../common/ppc440gx_i2c.h"
#include "../common/sb_common.h"
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) || \
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
@@ -305,11 +304,6 @@ int checkboard (void)
************************************************************************/
int misc_init_f (void)
{
- /* Turn on i2c bus 1 */
- puts ("I2C1: ");
- i2c1_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
- puts ("ready\n");
-
/* Turn on fans */
sbcommon_fans();
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index e1da58d7bc1..360f93edf7d 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -36,7 +36,6 @@ 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_TSI108_I2C) += tsi108_i2c.o
@@ -45,6 +44,7 @@ COBJS-$(CONFIG_SH_I2C) += sh_i2c.o
COBJS-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o
COBJS-$(CONFIG_SYS_I2C) += i2c_core.o
COBJS-$(CONFIG_SYS_I2C_FSL) += fsl_i2c.o
+COBJS-$(CONFIG_SYS_I2C_PPC4XX) += ppc4xx_i2c.o
COBJS-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o
COBJS-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o
COBJS-$(CONFIG_ZYNQ_I2C) += zynq_i2c.o
diff --git a/drivers/i2c/ppc4xx_i2c.c b/drivers/i2c/ppc4xx_i2c.c
index 53fedd594cb..c924874b599 100644
--- a/drivers/i2c/ppc4xx_i2c.c
+++ b/drivers/i2c/ppc4xx_i2c.c
@@ -32,27 +32,29 @@
#include <i2c.h>
#include <asm/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
+static inline struct ppc4xx_i2c *ppc4xx_get_i2c(int hwadapnr)
+{
+ unsigned long base;
+
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+ defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+ defined(CONFIG_460EX) || defined(CONFIG_460GT)
+ base = CONFIG_SYS_PERIPHERAL_BASE + 0x00000700 + (hwadapnr * 0x100);
+#elif defined(CONFIG_440) || defined(CONFIG_405EX)
+/* all remaining 440 variants */
+ base = CONFIG_SYS_PERIPHERAL_BASE + 0x00000400 + (hwadapnr * 0x100);
+#else
+/* all 405 variants */
+ base = 0xEF600500 + (hwadapnr * 0x100);
#endif
-static unsigned int i2c_bus_num __attribute__ ((section (".data"))) =
- CONFIG_SYS_SPD_BUS_NUM;
-#endif /* CONFIG_I2C_MULTI_BUS */
+ return (struct ppc4xx_i2c *)base;
+}
-static void _i2c_bus_reset(void)
+static void _i2c_bus_reset(struct i2c_adapter *adap)
{
- struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+ struct ppc4xx_i2c *i2c = ppc4xx_get_i2c(adap->hwadapnr);
int i;
u8 dc;
@@ -91,11 +93,10 @@ static void _i2c_bus_reset(void)
out_8(&i2c->xtcntlss, 0);
}
-void i2c_init(int speed, int slaveaddr)
+static void ppc4xx_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
{
- struct ppc4xx_i2c *i2c;
+ struct ppc4xx_i2c *i2c = ppc4xx_get_i2c(adap->hwadapnr);
int val, divisor;
- int bus;
#ifdef CONFIG_SYS_I2C_INIT_BOARD
/*
@@ -106,67 +107,57 @@ void i2c_init(int speed, int slaveaddr)
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();
+ /* Handle possible failed I2C state */
+ /* FIXME: put this into i2c_init_board()? */
+ _i2c_bus_reset(adap);
- /* clear lo master address */
- out_8(&i2c->lmadr, 0);
+ /* 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 master address */
+ out_8(&i2c->hmadr, 0);
- /* clear hi slave address */
- out_8(&i2c->hsadr, 0);
+ /* clear lo slave address */
+ out_8(&i2c->lsadr, 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);
+ /* clear hi slave address */
+ out_8(&i2c->hsadr, 0);
- /* no interrupts */
- out_8(&i2c->intrmsk, 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);
- /* clear transfer count */
- out_8(&i2c->xfrcnt, 0);
+ /* no interrupts */
+ out_8(&i2c->intrmsk, 0);
- /* clear extended control & stat */
- /* write 1 in SRC SRS SWC SWS to clear these fields */
- out_8(&i2c->xtcntlss, 0xF0);
+ /* clear transfer count */
+ out_8(&i2c->xfrcnt, 0);
- /* Mode Control Register
- Flush Slave/Master data buffer */
- out_8(&i2c->mdcntl, IIC_MDCNTL_FSDB | IIC_MDCNTL_FMDB);
+ /* clear extended control & stat */
+ /* write 1 in SRC SRS SWC SWS to clear these fields */
+ out_8(&i2c->xtcntlss, 0xF0);
- val = in_8(&i2c->mdcntl);
+ /* Mode Control Register
+ Flush Slave/Master data buffer */
+ out_8(&i2c->mdcntl, IIC_MDCNTL_FSDB | IIC_MDCNTL_FMDB);
- /* 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 = in_8(&i2c->mdcntl);
- val |= IIC_MDCNTL_EUBS | IIC_MDCNTL_HSCL;
- if (speed >= 400000)
- val |= IIC_MDCNTL_FSM;
- out_8(&i2c->mdcntl, val);
+ /* Ignore General Call, slave transfers are ignored,
+ * disable interrupts, exit unknown bus state, enable hold
+ * SCL 100kHz normaly or FastMode for 400kHz and above
+ */
- /* clear control reg */
- out_8(&i2c->cntl, 0x00);
- }
+ val |= IIC_MDCNTL_EUBS | IIC_MDCNTL_HSCL;
+ if (speed >= 400000)
+ val |= IIC_MDCNTL_FSM;
+ out_8(&i2c->mdcntl, val);
- /* set to SPD bus as default bus upon powerup */
- I2C_SET_BUS(CONFIG_SYS_SPD_BUS_NUM);
+ /* clear control reg */
+ out_8(&i2c->cntl, 0x00);
}
/*
@@ -194,14 +185,15 @@ void i2c_init(int speed, int slaveaddr)
*
* It does not check XFRCNT.
*/
-static int i2c_transfer(unsigned char cmd_type,
+static int _i2c_transfer(struct i2c_adapter *adap,
+ 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;
+ struct ppc4xx_i2c *i2c = ppc4xx_get_i2c(adap->hwadapnr);
u8 *ptr;
int reading;
int tran, cnt;
@@ -345,7 +337,7 @@ static int i2c_transfer(unsigned char cmd_type,
return result;
}
-int i2c_probe(uchar chip)
+static int ppc4xx_i2c_probe(struct i2c_adapter *adap, uchar chip)
{
uchar buf[1];
@@ -356,11 +348,11 @@ int i2c_probe(uchar chip)
* 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);
+ return (_i2c_transfer(adap, 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)
+static int ppc4xx_i2c_transfer(struct i2c_adapter *adap, uchar chip, uint addr,
+ int alen, uchar *buffer, int len, int read)
{
uchar xaddr[4];
int ret;
@@ -394,43 +386,50 @@ static int ppc4xx_i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer,
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) {
+ ret = _i2c_transfer(adap, read, chip << 1, &xaddr[4 - alen], alen,
+ buffer, len);
+ if (ret) {
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)
+static int ppc4xx_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
+ int alen, uchar *buffer, int len)
{
- return ppc4xx_i2c_transfer(chip, addr, alen, buffer, len, 1);
+ return ppc4xx_i2c_transfer(adap, chip, addr, alen, buffer, len, 1);
}
-int i2c_write(uchar chip, uint addr, int alen, uchar * buffer, int len)
+static int ppc4xx_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
+ int alen, uchar *buffer, int len)
{
- return ppc4xx_i2c_transfer(chip, addr, alen, buffer, len, 0);
+ return ppc4xx_i2c_transfer(adap, 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)
+static unsigned int ppc4xx_i2c_set_bus_speed(struct i2c_adapter *adap,
+ unsigned int speed)
{
- return i2c_bus_num;
-}
-
-int i2c_set_bus_num(unsigned int bus)
-{
- if (bus >= CONFIG_SYS_MAX_I2C_BUS)
+ if (speed != adap->speed)
return -1;
-
- i2c_bus_num = bus;
-
- return 0;
+ return speed;
}
-#endif /* CONFIG_I2C_MULTI_BUS */
-#endif /* CONFIG_HARD_I2C */
+
+/*
+ * Register ppc4xx i2c adapters
+ */
+#ifdef CONFIG_SYS_I2C_PPC4XX_CH0
+U_BOOT_I2C_ADAP_COMPLETE(ppc4xx_0, ppc4xx_i2c_init, ppc4xx_i2c_probe,
+ ppc4xx_i2c_read, ppc4xx_i2c_write,
+ ppc4xx_i2c_set_bus_speed,
+ CONFIG_SYS_I2C_PPC4XX_SPEED_0,
+ CONFIG_SYS_I2C_PPC4XX_SLAVE_0, 0)
+#endif
+#ifdef CONFIG_SYS_I2C_PPC4XX_CH1
+U_BOOT_I2C_ADAP_COMPLETE(ppc4xx_1, ppc4xx_i2c_init, ppc4xx_i2c_probe,
+ ppc4xx_i2c_read, ppc4xx_i2c_write,
+ ppc4xx_i2c_set_bus_speed,
+ CONFIG_SYS_I2C_PPC4XX_SPEED_1,
+ CONFIG_SYS_I2C_PPC4XX_SLAVE_1, 1)
+#endif
diff --git a/include/configs/APC405.h b/include/configs/APC405.h
index 1e392290d70..8ba5d6315cf 100644
--- a/include/configs/APC405.h
+++ b/include/configs/APC405.h
@@ -306,10 +306,11 @@
/*
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/ASH405.h b/include/configs/ASH405.h
index 35c37731cbc..6d40748d0e6 100644
--- a/include/configs/ASH405.h
+++ b/include/configs/ASH405.h
@@ -247,10 +247,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/CANBT.h b/include/configs/CANBT.h
index fd3eff0c1f4..b805fbd58a5 100644
--- a/include/configs/CANBT.h
+++ b/include/configs/CANBT.h
@@ -180,14 +180,14 @@
/*-----------------------------------------------------------------------
* I2C EEPROM (CAT24WC08) for environment
*/
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
-#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
-
-#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* bytes of address */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
+
+#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* bytes of address */
/* mask of address bits that overflow into the "EEPROM chip address" */
#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 0x07
diff --git a/include/configs/CATcenter.h b/include/configs/CATcenter.h
index 7017f8c19b1..e56b2474aa0 100644
--- a/include/configs/CATcenter.h
+++ b/include/configs/CATcenter.h
@@ -402,10 +402,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/CMS700.h b/include/configs/CMS700.h
index 686d15883c7..ca258e6b29d 100644
--- a/include/configs/CMS700.h
+++ b/include/configs/CMS700.h
@@ -226,10 +226,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/CPCI2DP.h b/include/configs/CPCI2DP.h
index bbd93ac5020..bac51d10ec3 100644
--- a/include/configs/CPCI2DP.h
+++ b/include/configs/CPCI2DP.h
@@ -211,10 +211,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/CPCI405.h b/include/configs/CPCI405.h
index 36476e0135b..bb2e92f9fb7 100644
--- a/include/configs/CPCI405.h
+++ b/include/configs/CPCI405.h
@@ -260,10 +260,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/CPCI4052.h b/include/configs/CPCI4052.h
index 4c12c85c2b2..a442e365668 100644
--- a/include/configs/CPCI4052.h
+++ b/include/configs/CPCI4052.h
@@ -287,10 +287,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/CPCI405AB.h b/include/configs/CPCI405AB.h
index 96b6c0ab669..f2422c5925e 100644
--- a/include/configs/CPCI405AB.h
+++ b/include/configs/CPCI405AB.h
@@ -263,10 +263,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC32 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* Bytes of address */
diff --git a/include/configs/CPCI405DT.h b/include/configs/CPCI405DT.h
index c4cc5fd7375..3f072d34af2 100644
--- a/include/configs/CPCI405DT.h
+++ b/include/configs/CPCI405DT.h
@@ -282,10 +282,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/CPCIISER4.h b/include/configs/CPCIISER4.h
index 78c66c76a77..93854188392 100644
--- a/include/configs/CPCIISER4.h
+++ b/include/configs/CPCIISER4.h
@@ -196,10 +196,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/CRAYL1.h b/include/configs/CRAYL1.h
index 6bceccbc14b..37139edd660 100644
--- a/include/configs/CRAYL1.h
+++ b/include/configs/CRAYL1.h
@@ -76,11 +76,12 @@
#define CONFIG_SERVERIP 10.0.0.1
#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_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
#define CONFIG_SDRAM_BANK0 1
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE 0x7F
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x57
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
#define CONFIG_IDENT_STRING "Cray L1"
diff --git a/include/configs/DP405.h b/include/configs/DP405.h
index 6d67d6ee406..fa09797596a 100644
--- a/include/configs/DP405.h
+++ b/include/configs/DP405.h
@@ -178,10 +178,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/DU405.h b/include/configs/DU405.h
index 24df85a8854..26162d1a436 100644
--- a/include/configs/DU405.h
+++ b/include/configs/DU405.h
@@ -197,10 +197,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/DU440.h b/include/configs/DU440.h
index 152821f5676..72f6a310361 100644
--- a/include/configs/DU440.h
+++ b/include/configs/DU440.h
@@ -170,18 +170,20 @@
/*
* I2C
*/
-#define CONFIG_HARD_I2C 1 /* 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
-#define CONFIG_I2C_MULTI_BUS 1
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
+#define CONFIG_SYS_I2C_PPC4XX_CH1
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_1 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_1 0x7F
#define CONFIG_SYS_SPD_BUS_NUM 0
#define IIC1_MCP3021_ADDR 0x4d
#define IIC1_USB2507_ADDR 0x2c
-#ifdef CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_NOPROBES {{1, IIC1_USB2507_ADDR}}
-#endif
+#define CONFIG_SYS_I2C_NOPROBES { {1, IIC1_USB2507_ADDR} }
+
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x54
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
diff --git a/include/configs/G2000.h b/include/configs/G2000.h
index b6769ae68dc..93be37fe46e 100644
--- a/include/configs/G2000.h
+++ b/include/configs/G2000.h
@@ -298,10 +298,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT24WC08 */
/* CAT24WC08/16... */
diff --git a/include/configs/HH405.h b/include/configs/HH405.h
index d65377f5800..7ca4212526c 100644
--- a/include/configs/HH405.h
+++ b/include/configs/HH405.h
@@ -334,14 +334,15 @@
/*-----------------------------------------------------------------------
* I2C EEPROM (CAT24WC16) for environment
*/
-#define CONFIG_HARD_I2C /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C /* use PPC4xx driver */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
#if 0 /* test-only */
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#else
-#define CONFIG_SYS_I2C_SPEED 100000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
#endif
-#define CONFIG_SYS_I2C_SLAVE 0x7F
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT24WC08 */
#define CONFIG_SYS_EEPROM_WREN 1
diff --git a/include/configs/HUB405.h b/include/configs/HUB405.h
index e90782f56a9..ecfc4aa0a77 100644
--- a/include/configs/HUB405.h
+++ b/include/configs/HUB405.h
@@ -246,10 +246,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/JSE.h b/include/configs/JSE.h
index 76509be0485..271ebdacaf2 100644
--- a/include/configs/JSE.h
+++ b/include/configs/JSE.h
@@ -210,10 +210,11 @@
#define CONFIG_SYS_HZ 1000 /* decrementer freq: 1 ms ticks */
-#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_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
/*-----------------------------------------------------------------------
diff --git a/include/configs/KAREF.h b/include/configs/KAREF.h
index 5736fcfa102..43ecf5db498 100644
--- a/include/configs/KAREF.h
+++ b/include/configs/KAREF.h
@@ -133,13 +133,15 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_HARD_I2C 1 /* I2C hardware support */
-#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 */
-#define CONFIG_I2C_BUS1 1 /* Include i2c bus 1 supp */
-
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
+#define CONFIG_SYS_I2C_PPC4XX_CH1
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_1 400000 /* I2C speed 400kHz */
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_1 0x7F
+#define CONFIG_SYS_I2C_NOPROBES { { 0, 0x69} } /* Don't probe these addrs */
/*-----------------------------------------------------------------------
* Environment
diff --git a/include/configs/METROBOX.h b/include/configs/METROBOX.h
index 66c4798b5f7..074425110cb 100644
--- a/include/configs/METROBOX.h
+++ b/include/configs/METROBOX.h
@@ -195,13 +195,15 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_HARD_I2C 1 /* I2C hardware support */
-#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 */
-#define CONFIG_I2C_BUS1 1 /* Include i2c bus 1 supp */
-
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
+#define CONFIG_SYS_I2C_PPC4XX_CH1
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_1 400000 /* I2C speed 400kHz */
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_1 0x7F
+#define CONFIG_SYS_I2C_NOPROBES { { 0, 0x69} } /* Don't probe these addrs */
/*-----------------------------------------------------------------------
* Environment
diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h
index 0d023ab9fbe..7b4d275b80f 100644
--- a/include/configs/MIP405.h
+++ b/include/configs/MIP405.h
@@ -98,10 +98,11 @@
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 50000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x53 /* EEPROM 24C128/256 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* Bytes of address */
diff --git a/include/configs/OCRTC.h b/include/configs/OCRTC.h
index 4a934176550..1c1568702f1 100644
--- a/include/configs/OCRTC.h
+++ b/include/configs/OCRTC.h
@@ -217,10 +217,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/ORSG.h b/include/configs/ORSG.h
index cd1f4254ad5..eda8af287b0 100644
--- a/include/configs/ORSG.h
+++ b/include/configs/ORSG.h
@@ -213,10 +213,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/PCI405.h b/include/configs/PCI405.h
index c3cacefed8c..54c8bb23b00 100644
--- a/include/configs/PCI405.h
+++ b/include/configs/PCI405.h
@@ -209,10 +209,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/PIP405.h b/include/configs/PIP405.h
index 3757af07a00..148fb190cdc 100644
--- a/include/configs/PIP405.h
+++ b/include/configs/PIP405.h
@@ -87,10 +87,11 @@
* EEPROM of the SDRAM
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 50000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x53
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
diff --git a/include/configs/PLU405.h b/include/configs/PLU405.h
index 1745eb39fc8..74bd97d0426 100644
--- a/include/configs/PLU405.h
+++ b/include/configs/PLU405.h
@@ -281,10 +281,11 @@
/*
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM 24WC16 */
#define CONFIG_SYS_EEPROM_WREN 1
diff --git a/include/configs/PMC405.h b/include/configs/PMC405.h
index d97acecc441..19583b66b41 100644
--- a/include/configs/PMC405.h
+++ b/include/configs/PMC405.h
@@ -239,10 +239,11 @@
/*
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT24W16 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/PMC405DE.h b/include/configs/PMC405DE.h
index a4275512816..33c39f89181 100644
--- a/include/configs/PMC405DE.h
+++ b/include/configs/PMC405DE.h
@@ -217,10 +217,11 @@
/*
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM 24W16 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/PMC440.h b/include/configs/PMC440.h
index 4b531828f58..867f57866ff 100644
--- a/include/configs/PMC440.h
+++ b/include/configs/PMC440.h
@@ -225,12 +225,14 @@
/*-----------------------------------------------------------------------
* 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 1
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
+#define CONFIG_SYS_I2C_PPC4XX_CH1
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_1 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_1 0x7F
#define CONFIG_SYS_I2C_MULTI_EEPROMS
diff --git a/include/configs/PPChameleonEVB.h b/include/configs/PPChameleonEVB.h
index 210bc30ca89..a705f1c4e6d 100644
--- a/include/configs/PPChameleonEVB.h
+++ b/include/configs/PPChameleonEVB.h
@@ -419,10 +419,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/VOH405.h b/include/configs/VOH405.h
index 8f0c4b62417..98d975fbd26 100644
--- a/include/configs/VOH405.h
+++ b/include/configs/VOH405.h
@@ -280,10 +280,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT24WC08 */
#define CONFIG_SYS_EEPROM_WREN 1
diff --git a/include/configs/VOM405.h b/include/configs/VOM405.h
index 43d6bb31fd4..85722e408d6 100644
--- a/include/configs/VOM405.h
+++ b/include/configs/VOM405.h
@@ -205,10 +205,11 @@
/*
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/W7OLMC.h b/include/configs/W7OLMC.h
index 710812fc9f3..7c5be407699 100644
--- a/include/configs/W7OLMC.h
+++ b/include/configs/W7OLMC.h
@@ -279,10 +279,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/W7OLMG.h b/include/configs/W7OLMG.h
index f88dfe4cde6..41057d01c15 100644
--- a/include/configs/W7OLMG.h
+++ b/include/configs/W7OLMG.h
@@ -286,10 +286,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM ATMEL 24C04N */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/WUH405.h b/include/configs/WUH405.h
index 0c78acac806..2632db25bd6 100644
--- a/include/configs/WUH405.h
+++ b/include/configs/WUH405.h
@@ -244,10 +244,11 @@
/*-----------------------------------------------------------------------
* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/acadia.h b/include/configs/acadia.h
index 8c447ca951a..52a64bf4e70 100644
--- a/include/configs/acadia.h
+++ b/include/configs/acadia.h
@@ -206,7 +206,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/alpr.h b/include/configs/alpr.h
index 9f32a608c0b..13978be1de5 100644
--- a/include/configs/alpr.h
+++ b/include/configs/alpr.h
@@ -121,11 +121,12 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_HARD_I2C 1 /* 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
-#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
+#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } /* Don't probe these addrs */
/*-----------------------------------------------------------------------
* I2C EEPROM (PCF8594C)
diff --git a/include/configs/amcc-common.h b/include/configs/amcc-common.h
index 80e5735e76c..1dc44fc0b0f 100644
--- a/include/configs/amcc-common.h
+++ b/include/configs/amcc-common.h
@@ -42,9 +42,10 @@
/*
* I2C
*/
-#define CONFIG_HARD_I2C /* I2C with hardware support */
-#define CONFIG_PPC4XX_I2C /* use PPC4xx driver */
-#define CONFIG_SYS_I2C_SLAVE 0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
/*
* Ethernet/EMAC/PHY
diff --git a/include/configs/bamboo.h b/include/configs/bamboo.h
index d36984df2d6..03fa17bb8f8 100644
--- a/include/configs/bamboo.h
+++ b/include/configs/bamboo.h
@@ -222,7 +222,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/bluestone.h b/include/configs/bluestone.h
index 3e691fdcf41..934da8134b7 100644
--- a/include/configs/bluestone.h
+++ b/include/configs/bluestone.h
@@ -122,7 +122,7 @@
/*
* I2C
*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x54
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
diff --git a/include/configs/bubinga.h b/include/configs/bubinga.h
index 35a473a429d..43059a06f9b 100644
--- a/include/configs/bubinga.h
+++ b/include/configs/bubinga.h
@@ -134,9 +134,9 @@
* I2C stuff
*-----------------------------------------------------------------------
*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
-#define CONFIG_SYS_I2C_NOPROBES { 0x69 } /* avoid i2c probe hangup (why?) */
+#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } /* avoid i2c probe hangup (?) */
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 6 /* 24C02 requires 5ms delay */
#if defined(CONFIG_CMD_EEPROM)
diff --git a/include/configs/canyonlands.h b/include/configs/canyonlands.h
index 92106d762de..a3c04b65dcb 100644
--- a/include/configs/canyonlands.h
+++ b/include/configs/canyonlands.h
@@ -329,7 +329,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/csb272.h b/include/configs/csb272.h
index eec087c0dc3..c12c3a21005 100644
--- a/include/configs/csb272.h
+++ b/include/configs/csb272.h
@@ -175,10 +175,11 @@
* I2C configuration
*
*/
-#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 */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F /* I2C slave address */
/*
* MII PHY configuration
diff --git a/include/configs/csb472.h b/include/configs/csb472.h
index f6a456c18f1..663424b1966 100644
--- a/include/configs/csb472.h
+++ b/include/configs/csb472.h
@@ -174,10 +174,11 @@
* I2C configuration
*
*/
-#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 */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F /* I2C slave address */
/*
* MII PHY configuration
diff --git a/include/configs/dlvision-10g.h b/include/configs/dlvision-10g.h
index 2cd20279bec..5d6308fb186 100644
--- a/include/configs/dlvision-10g.h
+++ b/include/configs/dlvision-10g.h
@@ -114,7 +114,7 @@
/*
* I2C stuff
*/
-#define CONFIG_SYS_I2C_SPEED 100000
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
/* Temp sensor/hwmon/dtt */
#define CONFIG_DTT_LM63 1 /* National LM63 */
diff --git a/include/configs/dlvision.h b/include/configs/dlvision.h
index c490ff67da4..24c9fa42992 100644
--- a/include/configs/dlvision.h
+++ b/include/configs/dlvision.h
@@ -107,7 +107,7 @@
/*
* I2C stuff
*/
-#define CONFIG_SYS_I2C_SPEED 100000 /* I2C speed and slave address*/
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
/*
* FLASH organization
diff --git a/include/configs/ebony.h b/include/configs/ebony.h
index b05ba08afda..aabc898464e 100644
--- a/include/configs/ebony.h
+++ b/include/configs/ebony.h
@@ -138,7 +138,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/gdppc440etx.h b/include/configs/gdppc440etx.h
index 7b8bac48ec7..db1fd284351 100644
--- a/include/configs/gdppc440etx.h
+++ b/include/configs/gdppc440etx.h
@@ -145,7 +145,7 @@
/*
* I2C
*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed+slave address*/
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
/*
* Default environment variables
diff --git a/include/configs/icon.h b/include/configs/icon.h
index c2da4cec9a6..ba433550079 100644
--- a/include/configs/icon.h
+++ b/include/configs/icon.h
@@ -120,9 +120,8 @@
/*
* I2C
*/
-#define CONFIG_SYS_I2C_SPEED 100000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
-#define CONFIG_I2C_MULTI_BUS
#define CONFIG_SYS_SPD_BUS_NUM 0 /* The I2C bus for SPD */
#define CONFIG_SYS_I2C_MULTI_EEPROMS
diff --git a/include/configs/intip.h b/include/configs/intip.h
index ed96b1b3c44..917d214dd1c 100644
--- a/include/configs/intip.h
+++ b/include/configs/intip.h
@@ -228,7 +228,7 @@
/*
* I2C
*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/io.h b/include/configs/io.h
index 03661cce2dc..4950ad711d8 100644
--- a/include/configs/io.h
+++ b/include/configs/io.h
@@ -114,7 +114,7 @@
/*
* I2C stuff
*/
-#define CONFIG_SYS_I2C_SPEED 100000
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
/* Temp sensor/hwmon/dtt */
#define CONFIG_DTT_LM63 1 /* National LM63 */
diff --git a/include/configs/io64.h b/include/configs/io64.h
index 887aaefd395..bb29bedb2d2 100644
--- a/include/configs/io64.h
+++ b/include/configs/io64.h
@@ -340,7 +340,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_PCA9698 1 /* NXP PCA9698 */
diff --git a/include/configs/iocon.h b/include/configs/iocon.h
index 695aa5c85ab..5972711574b 100644
--- a/include/configs/iocon.h
+++ b/include/configs/iocon.h
@@ -110,11 +110,11 @@
/*
* I2C stuff
*/
-#undef CONFIG_HARD_I2C
#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */
-#define CONFIG_SYS_I2C_SOFT_SPEED 400000
-#define CONFIG_SYS_I2C_SOFT_SLAVE 0xFE
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
/*
* Software (bit-bang) I2C driver configuration
diff --git a/include/configs/katmai.h b/include/configs/katmai.h
index c6f712c9378..0bde3929da9 100644
--- a/include/configs/katmai.h
+++ b/include/configs/katmai.h
@@ -119,9 +119,8 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 100000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
-#define CONFIG_I2C_MULTI_BUS
#define CONFIG_SYS_SPD_BUS_NUM 0 /* The I2C bus for SPD */
#define IIC0_BOOTPROM_ADDR 0x50
diff --git a/include/configs/kilauea.h b/include/configs/kilauea.h
index aec4a584efb..fc34c24a62a 100644
--- a/include/configs/kilauea.h
+++ b/include/configs/kilauea.h
@@ -385,7 +385,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x52 /* I2C boot EEPROM (24C02BN) */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
diff --git a/include/configs/korat.h b/include/configs/korat.h
index eea8c98b6ad..c2e7118b1e5 100644
--- a/include/configs/korat.h
+++ b/include/configs/korat.h
@@ -155,10 +155,11 @@
/*
* 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_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/luan.h b/include/configs/luan.h
index f0e568af834..6219df70e40 100644
--- a/include/configs/luan.h
+++ b/include/configs/luan.h
@@ -134,7 +134,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/lwmon5.h b/include/configs/lwmon5.h
index 4dcb25a9669..7d9378ebbfe 100644
--- a/include/configs/lwmon5.h
+++ b/include/configs/lwmon5.h
@@ -298,10 +298,11 @@
/*
* I2C
*/
-#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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_RTC_ADDR 0x51 /* RTC */
#define CONFIG_SYS_I2C_EEPROM_CPU_ADDR 0x52 /* EEPROM (CPU Modul) */
diff --git a/include/configs/makalu.h b/include/configs/makalu.h
index f71f28bb873..66f35d7799f 100644
--- a/include/configs/makalu.h
+++ b/include/configs/makalu.h
@@ -201,7 +201,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 6 /* 24C02 requires 5ms delay */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x52 /* I2C boot EEPROM (24C02BN) */
diff --git a/include/configs/neo.h b/include/configs/neo.h
index 38b5becc2ed..be1c9ff5a6a 100644
--- a/include/configs/neo.h
+++ b/include/configs/neo.h
@@ -117,7 +117,7 @@
/*
* I2C stuff
*/
-#define CONFIG_SYS_I2C_SPEED 100000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
/* RTC */
#define CONFIG_RTC_DS1337
diff --git a/include/configs/ocotea.h b/include/configs/ocotea.h
index 3e64c7405bf..0bac61168b6 100644
--- a/include/configs/ocotea.h
+++ b/include/configs/ocotea.h
@@ -151,7 +151,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/p3p440.h b/include/configs/p3p440.h
index 3c33da73bb8..9f7642816ce 100644
--- a/include/configs/p3p440.h
+++ b/include/configs/p3p440.h
@@ -97,11 +97,12 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_HARD_I2C 1 /* 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
-#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
+#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } /* Don't probe these addrs */
/*-----------------------------------------------------------------------
* I2C RTC
diff --git a/include/configs/pcs440ep.h b/include/configs/pcs440ep.h
index 6358104c1ab..1104f92482d 100644
--- a/include/configs/pcs440ep.h
+++ b/include/configs/pcs440ep.h
@@ -139,10 +139,11 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_HARD_I2C 1 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa4>>1)
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
diff --git a/include/configs/quad100hd.h b/include/configs/quad100hd.h
index 30a8c5519f4..809d7643923 100644
--- a/include/configs/quad100hd.h
+++ b/include/configs/quad100hd.h
@@ -152,10 +152,11 @@
/*-----------------------------------------------------------------------
* 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_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* base address */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* bytes of address */
diff --git a/include/configs/redwood.h b/include/configs/redwood.h
index f75ab678182..355c330c336 100644
--- a/include/configs/redwood.h
+++ b/include/configs/redwood.h
@@ -110,13 +110,13 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define IIC0_BOOTPROM_ADDR 0x50
#define IIC0_ALT_BOOTPROM_ADDR 0x54
/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_NOPROBES {0x50, 0x52, 0x53, 0x54}
+#define CONFIG_SYS_I2C_NOPROBES { {0, 0x50}, {0, 0x52}, {0, 0x53}, {0, 0x54} }
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* Bytes of address */
diff --git a/include/configs/sbc405.h b/include/configs/sbc405.h
index 4120cf4d2a9..d5eb74563a3 100644
--- a/include/configs/sbc405.h
+++ b/include/configs/sbc405.h
@@ -168,10 +168,11 @@
#define CONFIG_SYS_RX_ETH_BUFFER 16 /* use 16 rx buffer on 405 emac */
-#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_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
/*-----------------------------------------------------------------------
* PCI stuff
diff --git a/include/configs/sc3.h b/include/configs/sc3.h
index 59636f7f77f..27859ee7db4 100644
--- a/include/configs/sc3.h
+++ b/include/configs/sc3.h
@@ -246,15 +246,16 @@
* IIC stuff
*-----------------------------------------------------------------------
*/
-#define CONFIG_HARD_I2C /* I2C with hardware support */
-#define CONFIG_PPC4XX_I2C /* use PPC4xx driver */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
#define I2C_INIT
#define I2C_ACTIVE 0
#define I2C_TRISTATE 0
-#define CONFIG_SYS_I2C_SPEED 100000 /* use the standard 100kHz speed */
-#define CONFIG_SYS_I2C_SLAVE 0x7F /* mask valid bits */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F /* mask valid bits */
#define CONFIG_RTC_DS1337
#define CONFIG_SYS_I2C_RTC_ADDR 0x68
diff --git a/include/configs/sequoia.h b/include/configs/sequoia.h
index 11fce53c025..e09069530c6 100644
--- a/include/configs/sequoia.h
+++ b/include/configs/sequoia.h
@@ -232,7 +232,7 @@
/*
* I2C
*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/t3corp.h b/include/configs/t3corp.h
index ff2189c2fbc..dfd8db4b1c8 100644
--- a/include/configs/t3corp.h
+++ b/include/configs/t3corp.h
@@ -319,7 +319,7 @@
/*
* I2C
*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/taihu.h b/include/configs/taihu.h
index a43c3da4a07..d43894c4dee 100644
--- a/include/configs/taihu.h
+++ b/include/configs/taihu.h
@@ -138,9 +138,9 @@
* I2C stuff
*-----------------------------------------------------------------------
*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
-#define CONFIG_SYS_I2C_NOPROBES { 0x69 } /* avoid i2c probe hangup (why?) */
+#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} } /* avoid i2c probe hangup (?) */
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 6 /* 24C02 requires 5ms delay */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* I2C boot EEPROM (24C02W) */
diff --git a/include/configs/taishan.h b/include/configs/taishan.h
index c9f1a9fa244..20989a7fdb2 100644
--- a/include/configs/taishan.h
+++ b/include/configs/taishan.h
@@ -133,7 +133,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#undef CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
diff --git a/include/configs/walnut.h b/include/configs/walnut.h
index 219f276a4c5..bb81b2b5872 100644
--- a/include/configs/walnut.h
+++ b/include/configs/walnut.h
@@ -95,7 +95,7 @@
* I2C stuff
*-----------------------------------------------------------------------
*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/xpedite1000.h b/include/configs/xpedite1000.h
index 1f48cc57724..dab7d39af7f 100644
--- a/include/configs/xpedite1000.h
+++ b/include/configs/xpedite1000.h
@@ -145,11 +145,11 @@ 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7f
/* I2C EEPROM */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
diff --git a/include/configs/yosemite.h b/include/configs/yosemite.h
index cde0df1a08f..e814cfd2623 100644
--- a/include/configs/yosemite.h
+++ b/include/configs/yosemite.h
@@ -137,7 +137,7 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define CONFIG_SYS_I2C_MULTI_EEPROMS
#define CONFIG_SYS_I2C_EEPROM_ADDR (0xa8>>1)
diff --git a/include/configs/yucca.h b/include/configs/yucca.h
index 3282d378d7d..33a82d9269c 100644
--- a/include/configs/yucca.h
+++ b/include/configs/yucca.h
@@ -120,13 +120,13 @@
/*-----------------------------------------------------------------------
* I2C
*----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
#define IIC0_BOOTPROM_ADDR 0x50
#define IIC0_ALT_BOOTPROM_ADDR 0x54
/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_NOPROBES {0x50, 0x52, 0x53, 0x54}
+#define CONFIG_SYS_I2C_NOPROBES { {0, 0x50}, {0, 0x52}, {0, 0x53}, {0, 0x54} }
/* #if defined(CONFIG_CMD_EEPROM) */
/* #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 */ /* I2C boot EEPROM */
diff --git a/include/configs/zeus.h b/include/configs/zeus.h
index 75195bc742c..b6539937003 100644
--- a/include/configs/zeus.h
+++ b/include/configs/zeus.h
@@ -168,10 +168,11 @@
/*-----------------------------------------------------------------------
* 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_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
/* these are for the ST M24C02 2kbit serial i2c eeprom */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* base address */