]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
i2c, soft-i2c: switch to new multibus/multiadapter support
authorHeiko Schocher <hs@denx.de>
Tue, 29 Jan 2013 07:53:15 +0000 (08:53 +0100)
committerHeiko Schocher <hs@denx.de>
Tue, 23 Jul 2013 03:54:29 +0000 (05:54 +0200)
- added to soft_i2c driver new multibus/multiadpater support
- adapted all config files, which uses this driver

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
168 files changed:
README
arch/arm/include/asm/arch-kirkwood/config.h
arch/arm/lib/board.c
arch/m68k/lib/board.c
arch/powerpc/lib/board.c
board/BuS/eb_cpux9k2/cpux9k2.c
board/BuS/vl_ma2sc/vl_ma2sc.c
board/atc/atc.c
board/bluewater/snapper9260/snapper9260.c
board/cm5200/cm5200.c
board/cpu86/cpu86.c
board/cpu87/cpu87.c
board/emk/top9000/top9000.c
board/eukrea/cpuat91/cpuat91.c
board/freescale/m52277evb/README
board/freescale/m53017evb/README
board/freescale/m5373evb/README
board/freescale/m54455evb/README
board/freescale/m547xevb/README
board/ids8247/ids8247.c
board/keymile/common/ivm.c
board/keymile/km_arm/km_arm.c
board/lwmon/lwmon.c
board/lwmon/pcmcia.c
board/pm826/pm826.c
board/pm828/pm828.c
board/sacsng/ioconfig.h
board/sandburst/karef/karef.c
board/tqc/tqm8260/tqm8260.c
board/tqc/tqm8272/tqm8272.c
board/tqc/tqm8272/tqm8272.h
common/board_f.c
common/cmd_eeprom.c
common/stdio.c
drivers/i2c/Makefile
drivers/i2c/soft_i2c.c
include/configs/A3000.h
include/configs/BSC9131RDB.h
include/configs/CANBT.h
include/configs/CPU86.h
include/configs/CPU87.h
include/configs/DU440.h
include/configs/GEN860T.h
include/configs/HIDDEN_DRAGON.h
include/configs/ICU862.h
include/configs/IDS8247.h
include/configs/IP860.h
include/configs/IPHASE4539.h
include/configs/JSE.h
include/configs/KAREF.h
include/configs/KUP4K.h
include/configs/KUP4X.h
include/configs/M5208EVBE.h
include/configs/M52277EVB.h
include/configs/M5235EVB.h
include/configs/M5271EVB.h
include/configs/M5275EVB.h
include/configs/M53017EVB.h
include/configs/M5329EVB.h
include/configs/M5373EVB.h
include/configs/M54418TWR.h
include/configs/M54451EVB.h
include/configs/M54455EVB.h
include/configs/M5475EVB.h
include/configs/M5485EVB.h
include/configs/METROBOX.h
include/configs/MHPC.h
include/configs/MPC8323ERDB.h
include/configs/MPC832XEMDS.h
include/configs/MPC8349EMDS.h
include/configs/MPC8349ITX.h
include/configs/MPC8360EMDS.h
include/configs/MPC8360ERDK.h
include/configs/MPC837XEMDS.h
include/configs/MPC837XERDB.h
include/configs/MPC8536DS.h
include/configs/MPC8540ADS.h
include/configs/MPC8541CDS.h
include/configs/MPC8544DS.h
include/configs/MPC8548CDS.h
include/configs/MPC8555CDS.h
include/configs/MPC8560ADS.h
include/configs/MPC8568MDS.h
include/configs/MPC8569MDS.h
include/configs/MPC8572DS.h
include/configs/MPC8610HPCD.h
include/configs/MPC8641HPCN.h
include/configs/P1010RDB.h
include/configs/P1023RDS.h
include/configs/P1_P2_RDB.h
include/configs/P2020COME.h
include/configs/PM826.h
include/configs/PM828.h
include/configs/PMC440.h
include/configs/R360MPI.h
include/configs/RPXClassic.h
include/configs/RPXlite.h
include/configs/RRvision.h
include/configs/SXNI855T.h
include/configs/Sandpoint8240.h
include/configs/Sandpoint8245.h
include/configs/TASREG.h
include/configs/TK885D.h
include/configs/TOP5200.h
include/configs/TOP860.h
include/configs/TQM8260.h
include/configs/TQM8272.h
include/configs/TQM834x.h
include/configs/TQM855M.h
include/configs/TQM866M.h
include/configs/TQM885D.h
include/configs/alpr.h
include/configs/aria.h
include/configs/astro_mcf5373l.h
include/configs/bf533-ezkit.h
include/configs/bf533-stamp.h
include/configs/bf561-ezkit.h
include/configs/bfin_adi_common.h
include/configs/blackstamp.h
include/configs/blackvme.h
include/configs/cpuat91.h
include/configs/debris.h
include/configs/eXalion.h
include/configs/eb_cpux9k2.h
include/configs/ep8260.h
include/configs/ethernut5.h
include/configs/ibf-dsp561.h
include/configs/iocon.h
include/configs/km/keymile-common.h
include/configs/km/km83xx-common.h
include/configs/km/km_arm.h
include/configs/km82xx.h
include/configs/km_kirkwood.h
include/configs/korat.h
include/configs/lwmon.h
include/configs/lwmon5.h
include/configs/mecp5123.h
include/configs/mpc5121ads.h
include/configs/nhk8815.h
include/configs/otc570.h
include/configs/p1_p2_rdb_pc.h
include/configs/p3p440.h
include/configs/pcs440ep.h
include/configs/pdnb3.h
include/configs/quad100hd.h
include/configs/s5p_goni.h
include/configs/s5pc210_universal.h
include/configs/sacsng.h
include/configs/sbc405.h
include/configs/sbc8349.h
include/configs/sbc8548.h
include/configs/sbc8641d.h
include/configs/sc3.h
include/configs/snapper9260.h
include/configs/socrates.h
include/configs/spc1920.h
include/configs/stxgp3.h
include/configs/stxssa.h
include/configs/top9000.h
include/configs/trats.h
include/configs/u8500_href.h
include/configs/uc100.h
include/configs/utx8245.h
include/configs/vct.h
include/configs/vl_ma2sc.h
include/configs/vme8349.h
include/configs/zeus.h
include/i2c.h

diff --git a/README b/README
index 2fe3f08f4b773d29fa72bd39ccc9402a17213fe7..e2ca76e7aedd6cb721bd4540e91e5cf9da0f6971 100644 (file)
--- a/README
+++ b/README
@@ -1954,6 +1954,19 @@ CBFS (Coreboot Filesystem) support
                interface.
 
                ported i2c driver to the new framework:
+               - drivers/i2c/soft_i2c.c:
+                 - activate first bus with CONFIG_SYS_I2C_SOFT define
+                   CONFIG_SYS_I2C_SOFT_SPEED and CONFIG_SYS_I2C_SOFT_SLAVE
+                   for defining speed and slave address
+                 - activate second bus with I2C_SOFT_DECLARATIONS2 define
+                   CONFIG_SYS_I2C_SOFT_SPEED_2 and CONFIG_SYS_I2C_SOFT_SLAVE_2
+                   for defining speed and slave address
+                 - activate third bus with I2C_SOFT_DECLARATIONS3 define
+                   CONFIG_SYS_I2C_SOFT_SPEED_3 and CONFIG_SYS_I2C_SOFT_SLAVE_3
+                   for defining speed and slave address
+                 - activate fourth bus with I2C_SOFT_DECLARATIONS4 define
+                   CONFIG_SYS_I2C_SOFT_SPEED_4 and CONFIG_SYS_I2C_SOFT_SLAVE_4
+                   for defining speed and slave address
 
                additional defines:
 
@@ -1992,18 +2005,18 @@ CBFS (Coreboot Filesystem) support
 
                which defines
                        bus 0 on adapter 0 without a mux
-                       bus 1 on adapter 0 without a PCA9547 on address 0x70 port 1
-                       bus 2 on adapter 0 without a PCA9547 on address 0x70 port 2
-                       bus 3 on adapter 0 without a PCA9547 on address 0x70 port 3
-                       bus 4 on adapter 0 without a PCA9547 on address 0x70 port 4
-                       bus 5 on adapter 0 without a PCA9547 on address 0x70 port 5
+                       bus 1 on adapter 0 with a PCA9547 on address 0x70 port 1
+                       bus 2 on adapter 0 with a PCA9547 on address 0x70 port 2
+                       bus 3 on adapter 0 with a PCA9547 on address 0x70 port 3
+                       bus 4 on adapter 0 with a PCA9547 on address 0x70 port 4
+                       bus 5 on adapter 0 with a PCA9547 on address 0x70 port 5
                        bus 6 on adapter 1 without a mux
-                       bus 7 on adapter 1 without a PCA9544 on address 0x72 port 1
-                       bus 8 on adapter 1 without a PCA9544 on address 0x72 port 2
+                       bus 7 on adapter 1 with a PCA9544 on address 0x72 port 1
+                       bus 8 on adapter 1 with a PCA9544 on address 0x72 port 2
 
                If you do not have i2c muxes on your board, omit this define.
 
-- Legacy I2C Support:  CONFIG_HARD_I2C | CONFIG_SOFT_I2C
+- Legacy I2C Support:  CONFIG_HARD_I2C
 
                NOTE: It is intended to move drivers to CONFIG_SYS_I2C which
                provides the following compelling advantages:
@@ -2014,9 +2027,9 @@ CBFS (Coreboot Filesystem) support
 
                ** Please consider updating your I2C driver now. **
 
-               These enable legacy I2C serial bus commands. Defining either of
-               (but not both of) CONFIG_HARD_I2C or CONFIG_SOFT_I2C will
-               include the appropriate I2C driver for the selected CPU.
+               These enable legacy I2C serial bus commands. Defining
+               CONFIG_HARD_I2C will include the appropriate I2C driver
+               for the selected CPU.
 
                This will allow you to use i2c commands at the u-boot
                command line (as long as you set CONFIG_CMD_I2C in
@@ -2026,12 +2039,8 @@ CBFS (Coreboot Filesystem) support
 
                CONFIG_HARD_I2C selects a hardware I2C controller.
 
-               CONFIG_SOFT_I2C configures u-boot to use a software (aka
-               bit-banging) driver instead of CPM or similar hardware
-               support for I2C.
-
                There are several other quantities that must also be
-               defined when you define CONFIG_HARD_I2C or CONFIG_SOFT_I2C.
+               defined when you define CONFIG_HARD_I2C.
 
                In both cases you will need to define CONFIG_SYS_I2C_SPEED
                to be the frequency (in Hz) at which you wish your i2c bus
@@ -2053,7 +2062,7 @@ CBFS (Coreboot Filesystem) support
 
                That's all that's required for CONFIG_HARD_I2C.
 
-               If you use the software i2c interface (CONFIG_SOFT_I2C)
+               If you use the software i2c interface (CONFIG_SYS_I2C_SOFT)
                then the following macros need to be defined (examples are
                from include/configs/lwmon.h):
 
@@ -3672,7 +3681,7 @@ to save the current settings.
          I2C muxes, you can define here, how to reach this
          EEPROM. For example:
 
-         #define CONFIG_I2C_ENV_EEPROM_BUS       "pca9547:70:d\0"
+         #define CONFIG_I2C_ENV_EEPROM_BUS       1
 
          EEPROM which holds the environment, is reached over
          a pca9547 i2c mux with address 0x70, channel 3.
index a9499b70cd37421d922dab4714d3c1c8b24eb55e..f0e84e62b028f9acf64c8bd45d606fcd61c33f3a 100644 (file)
  * I2C related stuff
  */
 #ifdef CONFIG_CMD_I2C
-#ifndef CONFIG_SOFT_I2C
+#ifndef CONFIG_SYS_I2C_SOFT
 #define CONFIG_I2C_MVTWSI
 #endif
 #define CONFIG_SYS_I2C_SLAVE           0x0
index 5302a1369c45f8b554d4d6f5c92e89c275896e38..5360883db7dc1df94c69270215d39666daab76e7 100644 (file)
@@ -69,7 +69,6 @@ extern void dataflash_print_info(void);
 #endif
 
 #if defined(CONFIG_HARD_I2C) || \
-       defined(CONFIG_SOFT_I2C) || \
        defined(CONFIG_SYS_I2C)
 #include <i2c.h>
 #endif
@@ -166,7 +165,7 @@ static int display_dram_config(void)
        return (0);
 }
 
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
 static int init_func_i2c(void)
 {
        puts("I2C:   ");
@@ -273,7 +272,7 @@ init_fnc_t *init_sequence[] = {
 #if defined(CONFIG_DISPLAY_BOARDINFO)
        checkboard,             /* display board info */
 #endif
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
        init_func_i2c,
 #endif
        dram_init,              /* configure available RAM banks */
index 582f47b50e5450286e172fd5f48eb981b9e5b4cf..2baafa5df3e9147fdc6dc1bc6e5c29a99b505e39 100644 (file)
@@ -56,7 +56,7 @@
 #include <version.h>
 
 #if defined(CONFIG_HARD_I2C) || \
-       defined(CONFIG_SOFT_I2C)
+       defined(CONFIG_SYS_I2C)
 #include <i2c.h>
 #endif
 
@@ -142,8 +142,7 @@ static int init_func_ram (void)
 
 /***********************************************************************/
 
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \
-               defined(CONFIG_SYS_I2C)
+#if defined(CONFIG_HARD_I2C) ||        defined(CONFIG_SYS_I2C)
 static int init_func_i2c (void)
 {
        puts ("I2C:   ");
@@ -183,8 +182,7 @@ init_fnc_t *init_sequence[] = {
        display_options,
        checkcpu,
        checkboard,
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \
-               defined(CONFIG_SYS_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
        init_func_i2c,
 #endif
 #if defined(CONFIG_HARD_SPI)
index 0c2e008e00d18b2e2a701ce65d4bd7cce3e9f72c..bc7c362cf28fae1c051adf353c35ab3e8e1b0b48 100644 (file)
@@ -98,8 +98,7 @@ extern void sc3_read_eeprom(void);
 #if defined(CONFIG_CMD_DOC)
 void doc_init(void);
 #endif
-#if defined(CONFIG_HARD_I2C) || \
-       defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
 #include <i2c.h>
 #endif
 #include <spi.h>
@@ -214,8 +213,7 @@ static int init_func_ram(void)
 
 /***********************************************************************/
 
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \
-               defined(CONFIG_SYS_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
 static int init_func_i2c(void)
 {
        puts("I2C:   ");
@@ -312,8 +310,7 @@ static init_fnc_t *init_sequence[] = {
        misc_init_f,
 #endif
        INIT_FUNC_WATCHDOG_RESET
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \
-               defined(CONFIG_SYS_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
        init_func_i2c,
 #endif
 #if defined(CONFIG_HARD_SPI)
index e98244b5ed508cae79d5ac97a205b8c2e40bfd89..01b4382c61878accff4fb62f57a197b80f4a5439 100644 (file)
@@ -288,7 +288,7 @@ int drv_video_init(void)
 }
 #endif
 
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 
 void i2c_init_board(void)
 {
index 84b2060aedbb914ba19e270ce8c8a442f1b4912c..7e086eeab425d1390490d96629cd6dd57b852241 100644 (file)
@@ -323,7 +323,7 @@ int board_eth_init(bd_t *bis)
        return rc;
 }
 
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 void i2c_init_board(void)
 {
        u32 pin;
index 936c031c6750664de0c34320a5fb73c39d2b8666..c2b5a1f65cc17a54de8454c69739da7dc391eaff 100644 (file)
@@ -170,7 +170,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
        /* PD18 */ {   0,   0,   0,   0,   0,   0   }, /* PD18 */
        /* PD17 */ {   0,   0,   0,   0,   0,   0   }, /* PD17 */
        /* PD16 */ {   0,   0,   0,   0,   0,   0   }, /* PD16 */
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /* PD15 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SDA */
        /* PD14 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SCL */
 #else
index 60c55e9be84d56c14699efde8b7e24b5bf82bbcd..b4378db18c97d82f1f4e3982f3ec81ffa572711a 100644 (file)
@@ -145,7 +145,7 @@ int board_init(void)
 
        /* Initialise peripherals */
        at91_seriald_hw_init();
-       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(0);
        nand_hw_init();
        macb_hw_init();
 
index c0ea1c62290ad879ae5e78d5a2084d09bd6df6ab..ad50452b053eea3218af1be806024b91bcc34b38 100644 (file)
@@ -325,7 +325,7 @@ int board_early_init_r(void)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT)
        uchar buf[6];
        char str[18];
        char hostname[MODULE_NAME_MAXLEN];
@@ -348,7 +348,7 @@ int misc_init_r(void)
                        " device at address %02X:%04X\n", CONFIG_SYS_I2C_EEPROM,
                        CONFIG_MAC_OFFSET);
        }
-#endif /* defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) */
+#endif /* defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT) */
        if (!getenv("ethaddr"))
                printf(LOG_PREFIX "MAC address not set, networking is not "
                                        "operational\n");
index bc7ebfea183c2ead3001babd497c4cdbaed97349..1d4f90cdd12000ba2ad58ea187d723c3d667eb3c 100644 (file)
@@ -161,7 +161,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
        /* PD18 */ {   0,   0,   0,   0,   0,   0   }, /* PD18 */
        /* PD17 */ {   0,   0,   0,   0,   0,   0   }, /* PD17 */
        /* PD16 */ {   0,   0,   0,   0,   0,   0   }, /* PD16 */
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /* PD15 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SDA */
        /* PD14 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SCL */
 #else
index 057a34c2c325310d333ca5009bffe7bbf86e70ee..7c591be8705be2e246b34071538896b0b76d6629 100644 (file)
@@ -163,7 +163,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
        /* PD18 */ {   0,   0,   0,   0,   0,   0   }, /* PD18 */
        /* PD17 */ {   0,   0,   0,   0,   0,   0   }, /* PD17 */
        /* PD16 */ {   0,   0,   0,   0,   0,   0   }, /* PD16 */
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /* PD15 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SDA */
        /* PD14 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SCL */
 #else
index 86a8d0b5660cf16aa5f586149e8f2e79dd715e70..c0609f0775a0822f2b40ff196ab253afa209a3bf 100644 (file)
@@ -245,7 +245,7 @@ int board_eth_init(bd_t *bis)
  * However i2c_get_bus_num() cannot be called before
  * relocation.
  */
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 void iic_init(void)
 {
        /* ports are now initialized in board_early_init_f() */
@@ -253,7 +253,7 @@ void iic_init(void)
 
 int iic_read(void)
 {
-       switch ((gd->flags & GD_FLG_RELOC) ? i2c_get_bus_num() : 0) {
+       switch (I2C_ADAP_HWNR) {
        case 0:
                return at91_get_pio_value(I2C0_PORT, SDA0_PIN);
        case 1:
@@ -264,7 +264,7 @@ int iic_read(void)
 
 void iic_sda(int bit)
 {
-       switch ((gd->flags & GD_FLG_RELOC) ? i2c_get_bus_num() : 0) {
+       switch (I2C_ADAP_HWNR) {
        case 0:
                at91_set_pio_value(I2C0_PORT, SDA0_PIN, bit);
                break;
@@ -276,7 +276,7 @@ void iic_sda(int bit)
 
 void iic_scl(int bit)
 {
-       switch ((gd->flags & GD_FLG_RELOC) ? i2c_get_bus_num() : 0) {
+       switch (I2C_ADAP_HWNR) {
        case 0:
                at91_set_pio_value(I2C0_PORT, SCL0_PIN, bit);
                break;
index c74c3fc567068bfdf08035d10e075aa89e9f0640..5dde2741ea1531f481ec40926f2ea50622b7367b 100644 (file)
@@ -73,7 +73,7 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 void i2c_init_board(void)
 {
        u32 pin;
index b6e955bcadb57c93801a0a41452aedac683d4395..d5e7b0565075b400e15ff4b9ddf6581cc06cd544 100644 (file)
@@ -84,7 +84,7 @@ CONFIG_MCFPIT         -- define to use PIT timer
 
 CONFIG_FSL_I2C         -- define to use FSL common I2C driver
 CONFIG_HARD_I2C                -- define for I2C hardware support
-CONFIG_SOFT_I2C                -- define for I2C bit-banged
+CONFIG_SYS_I2C_SOFT    -- define for I2C bit-banged
 CONFIG_SYS_I2C_SPEED           -- define for I2C speed
 CONFIG_SYS_I2C_SLAVE           -- define for I2C slave address
 CONFIG_SYS_I2C_OFFSET          -- define for I2C base address offset
index 64a3d42f0ce31c4b875e7c38b42754a9bcf8bf9c..855bbd14e5697a55b9fa6592cb00584b557a85e3 100644 (file)
@@ -92,7 +92,7 @@ CONFIG_MCFPIT                 -- define to use PIT timer
 
 CONFIG_FSL_I2C                 -- define to use FSL common I2C driver
 CONFIG_HARD_I2C                        -- define for I2C hardware support
-CONFIG_SOFT_I2C                        -- define for I2C bit-banged
+CONFIG_SYS_I2C_SOFT            -- define for I2C bit-banged
 CONFIG_SYS_I2C_SPEED           -- define for I2C speed
 CONFIG_SYS_I2C_SLAVE           -- define for I2C slave address
 CONFIG_SYS_I2C_OFFSET          -- define for I2C base address offset
index 419d4d6d1ec38942cf64f75890e95b8c9a59943c..61e6d97b6d774b041d92df593f63553800a523ff 100644 (file)
@@ -91,7 +91,7 @@ CONFIG_MCFPIT         -- define to use PIT timer
 
 CONFIG_FSL_I2C         -- define to use FSL common I2C driver
 CONFIG_HARD_I2C                -- define for I2C hardware support
-CONFIG_SOFT_I2C                -- define for I2C bit-banged
+CONFIG_SYS_I2C_SOFT    -- define for I2C bit-banged
 CONFIG_SYS_I2C_SPEED           -- define for I2C speed
 CONFIG_SYS_I2C_SLAVE           -- define for I2C slave address
 CONFIG_SYS_I2C_OFFSET          -- define for I2C base address offset
index 2bc6ce4bf3777bb41bf53b2ab77eb4be3f809b3b..2b25952398bd4ad6beed74d7f92f23105b0ecdbf 100644 (file)
@@ -114,7 +114,7 @@ CONFIG_MCFPIT               -- define to use PIT timer
 
 CONFIG_FSL_I2C         -- define to use FSL common I2C driver
 CONFIG_HARD_I2C                -- define for I2C hardware support
-CONFIG_SOFT_I2C                -- define for I2C bit-banged
+CONFIG_SYS_I2C_SOFT    -- define for I2C bit-banged
 CONFIG_SYS_I2C_SPEED           -- define for I2C speed
 CONFIG_SYS_I2C_SLAVE           -- define for I2C slave address
 CONFIG_SYS_I2C_OFFSET          -- define for I2C base address offset
index d3aec20e4f15c64c3780829d0974f9baf3c17da9..1a8cbce91d023231c5ed09e36c467165140b31d4 100644 (file)
@@ -99,7 +99,7 @@ CONFIG_SLTTMR         -- define to use SLT timer
 
 CONFIG_FSL_I2C         -- define to use FSL common I2C driver
 CONFIG_HARD_I2C                -- define for I2C hardware support
-CONFIG_SOFT_I2C                -- define for I2C bit-banged
+CONFIG_SYS_I2C_SOFT    -- define for I2C bit-banged
 CONFIG_SYS_I2C_SPEED           -- define for I2C speed
 CONFIG_SYS_I2C_SLAVE           -- define for I2C slave address
 CONFIG_SYS_I2C_OFFSET          -- define for I2C base address offset
index 02db07f1dbbf95367a39d26b7000dd58764515d3..541d7d65dfdee3bf959805f9060898308e00aed3 100644 (file)
@@ -51,7 +51,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
        /* PA27 */ {   1,   1,   1,   0,   0,   0   }, /* FCC1 RXDV */
        /* PA26 */ {   1,   1,   1,   0,   0,   0   }, /* FCC1 RXER */
        /* PA25 */ {   0,   0,   0,   0,   1,   0   }, /* 8247_P0 */
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /* PA24 */ {   1,   0,   0,   0,   1,   1   }, /* I2C_SDA2 */
        /* PA23 */ {   1,   0,   0,   1,   1,   1   }, /* I2C_SCL2 */
 #else /* normal I/O port pins */
index 22d525602a96bc2e1e09da2612cfbb426d235f67..918a6ab6398ff23c9fa501cee0f18ea397c96378 100644 (file)
@@ -318,10 +318,14 @@ int ivm_read_eeprom(void)
        I2C_MUX_DEVICE *dev = NULL;
 #endif
        uchar i2c_buffer[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
-       uchar   *buf;
+       char    *buf;
        unsigned long dev_addr = CONFIG_SYS_IVM_EEPROM_ADR;
        int ret;
 
+#if defined(CONFIG_SYS_I2C)
+       buf = getenv("EEprom_ivm");
+       i2c_set_bus_num(buf ? (int)simple_strtol(buf, NULL, 10) : 0);
+#else
 #if defined(CONFIG_I2C_MUX)
        /* First init the Bus, select the Bus */
        buf = (unsigned char *) getenv("EEprom_ivm");
index b9448873c8c263d3f5cb157aaaca80d21a01f3f0..26551f8c44288727759da736e3b3b304ad573835 100644 (file)
@@ -63,7 +63,7 @@ static const u32 kwmpp_config[] = {
        MPP5_NF_IO7,
        MPP6_SYSRST_OUTn,
        MPP7_PEX_RST_OUTn,
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        MPP8_GPIO,              /* SDA */
        MPP9_GPIO,              /* SCL */
 #endif
@@ -234,7 +234,7 @@ int misc_init_r(void)
 
 int board_early_init_f(void)
 {
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        u32 tmp;
 
        /* set the 2 bitbang i2c pins as output gpios */
@@ -260,7 +260,7 @@ int board_init(void)
        kw_gpio_set_valid(KM_FLASH_GPIO_PIN, 1);
        kw_gpio_direction_output(KM_FLASH_GPIO_PIN, 1);
 
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /*
         * Reinit the GPIO for I2C Bitbang driver so that the now
         * available gpio framework is consistent. The calls to
@@ -440,7 +440,7 @@ int hush_init_var(void)
 }
 #endif
 
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
 void set_sda(int state)
 {
        I2C_ACTIVE;
index 34c6675fd8a13243f98681f325c492190e0cd875..85e09958bbd889df6c0345372fa63f683dd03bd3 100644 (file)
@@ -480,7 +480,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;
 
index acbb9d54d21d1626d1c32da98d68b29acfe971d9..b9894cf01198b1df2f429f9a2d3ffea1834f27be 100644 (file)
@@ -104,7 +104,7 @@ int pcmcia_hardware_enable(int slot)
 
        /*  switch VCC on */
        val |= MAX1604_OP_SUS | MAX1604_VCCBON;
-       i2c_init  (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(0);
        i2c_write (CONFIG_SYS_I2C_POWER_A_ADDR, 0, 0, &val, 1);
 
        udelay(500000);
@@ -193,7 +193,7 @@ int pcmcia_voltage_set(int slot, int vcc, int vpp)
         */
        debug ("PCMCIA power OFF\n");
        val  = MAX1604_VCCBHIZ | MAX1604_VPPBHIZ;
-       i2c_init  (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(0);
        i2c_write (CONFIG_SYS_I2C_POWER_A_ADDR, 0, 0, &val, 1);
 
        val = 0;
index 19e7a000283ea716f2420b54c85cf66876792aa6..17b4ac9ec73557697113b8e9f3db5f86417f7797 100644 (file)
@@ -169,7 +169,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
        /* PD18 */ {   0,   0,   0,   1,   0,   0   }, /* PD18 */
        /* PD17 */ {   0,   1,   0,   0,   0,   0   }, /* PD17 */
        /* PD16 */ {   0,   1,   0,   1,   0,   0   }, /* PD16 */
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /* PD15 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SDA */
        /* PD14 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SCL */
 #else
index 4a3b2fd89b3b2bacee4994a4210280eb5ddbdae0..5e68d4d39b2c62a5e210b29fe095a2603ddecafc 100644 (file)
@@ -169,7 +169,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
        /* PD18 */ {   0,   0,   0,   1,   0,   0   }, /* PD18 */
        /* PD17 */ {   0,   1,   0,   0,   0,   0   }, /* PD17 */
        /* PD16 */ {   0,   1,   0,   1,   0,   0   }, /* PD16 */
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /* PD15 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SDA */
        /* PD14 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SCL */
 #else
index be1ce7c835826c9e3ccc226e376a2edc289f0400..ac8f152e1f895613c631fad7f06a1f86742049d1 100644 (file)
@@ -187,7 +187,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
        /* PD17 */ { CONF, SPEC,   1,  DOUT, ACTV,   0   }, /* SPI_MOSI       */
        /* PD16 */ { CONF, SPEC,   1,  DIN,  ACTV,   0   }, /* SPI_MISO       */
 #endif
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /* PD15 */ { CONF, GPIO,   0,  DOUT, OPEN,   1   }, /* I2C_SDA        */
        /* PD14 */ { CONF, GPIO,   0,  DOUT, ACTV,   1   }, /* I2C_SCL        */
 #else
index 6457f9b1f8c33ec52543532fc99a79278d26ab32..186998d1dfc3eb819590f55fe0f6b61f009c1069 100644 (file)
@@ -32,7 +32,6 @@
 #include <spd_sdram.h>
 #include <i2c.h>
 #include "../common/sb_common.h"
-#include "../common/ppc440gx_i2c.h"
 #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) || \
     defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
 #include <net.h>
index 65a3174ec681cd268856589208a7f5481bc71aa2..867b9694e9523ab9ee13fe5e139c4525f8beca5e 100644 (file)
@@ -160,7 +160,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
        /* PD18 */ {   0,   0,   0,   1,   0,   0   }, /* PD19 */
        /* PD17 */ {   0,   1,   0,   0,   0,   0   }, /* FCC1 ATMRXPRTY */
        /* PD16 */ {   0,   1,   0,   1,   0,   0   }, /* FCC1 ATMTXPRTY */
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /* PD15 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SDA */
        /* PD14 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SCL */
 #else
index 5aca227789bb564c4a6d42918faa7f53cae7d335..c874a7df8d1945c37600289742ccc1caf7049403 100644 (file)
@@ -180,7 +180,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
        /* PD18 */ {   0,   0,   0,   1,   0,   0   }, /* PD19 */
        /* PD17 */ {   0,   1,   0,   0,   0,   0   }, /* FCC1 ATMRXPRTY */
        /* PD16 */ {   0,   1,   0,   1,   0,   0   }, /* FCC1 ATMTXPRTY */
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /* PD15 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SDA */
        /* PD14 */ {   1,   0,   0,   1,   1,   1   }, /* I2C SCL */
 #else
index 6d558ec5969907d301b3624bb98998decfd7cf43..91b86c99d47108d54394b2390e13f51e1356f1ee 100644 (file)
@@ -50,4 +50,4 @@ typedef struct{
 
 static HWIB_INFO       hwinf = {0, 0, 1, 0, 1, 0, 0, 0, 0, 8272, 0 ,0,
                         0, 0, 0, 0, 0, 0};
-#endif
+#endif /* __CONFIG_H */
index ca9a7603eddb25d2b8d11cf045bc38ca0e1f9bea..ddac2dfe096d848544397d0cec766571278485b6 100644 (file)
@@ -261,8 +261,7 @@ void __dram_init_banksize(void)
 void dram_init_banksize(void)
        __attribute__((weak, alias("__dram_init_banksize")));
 
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \
-       defined(CONFIG_SYS_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
 static int init_func_i2c(void)
 {
        puts("I2C:   ");
@@ -920,8 +919,7 @@ static init_fnc_t init_sequence_f[] = {
        misc_init_f,
 #endif
        INIT_FUNC_WATCHDOG_RESET
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \
-       defined(CONFIG_SYS_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
        init_func_i2c,
 #endif
 #if defined(CONFIG_HARD_SPI)
index 4a43116e92562cc766cd3a3fbeb577b53bd673b3..511d8b6022337ea3bf8e3c6b3a21f5b0c6ac5c35 100644 (file)
@@ -406,8 +406,7 @@ void eeprom_init  (void)
 #if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
        spi_init_f ();
 #endif
-#if defined(CONFIG_HARD_I2C) || \
-    defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT)
        i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
 }
index 201188054994d9b02810d60b0a0b371517b7890a..39eef5aa2ebdf8ad864ddf921145ac1803a58510 100644 (file)
@@ -34,8 +34,8 @@
 #ifdef CONFIG_LOGBUFFER
 #include <logbuff.h>
 #endif
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \
-               defined(CONFIG_SYS_I2C_ADAPTERS)
+
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
 #include <i2c.h>
 #endif
 
@@ -216,11 +216,9 @@ int stdio_init (void)
        drv_arm_dcc_init ();
 #endif
 #ifdef CONFIG_SYS_I2C
-#ifdef CONFIG_SYS_I2C_ADAPTERS
        i2c_init_all();
-#endif
 #else
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C)
        i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
 #endif
index 06b211d4a27452d5d49b003e8b7a7e0eeaf6b279..a885e26ce9f5c4f9dc075af79e9a6220a51ca881 100644 (file)
@@ -40,13 +40,13 @@ COBJS-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o
 COBJS-$(CONFIG_PPC4XX_I2C) += ppc4xx_i2c.o
 COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
 COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o
-COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_TEGRA_I2C) += tegra_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o
 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_SOFT) += soft_i2c.o
 COBJS-$(CONFIG_ZYNQ_I2C) += zynq_i2c.o
 
 COBJS  := $(COBJS-y)
index ae3c57392b8d011bcd36d862e3c062b751920b0f..12693041d7fe6d0f86fe718a1dcb8b156043b535 100644 (file)
@@ -1,4 +1,8 @@
 /*
+ * (C) Copyright 2009
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ * Changes for multibus/multiadapter I2C support.
+ *
  * (C) Copyright 2001, 2002
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
 
 /* #define     DEBUG_I2C       */
 
-#ifdef DEBUG_I2C
 DECLARE_GLOBAL_DATA_PTR;
+
+#ifndef        I2C_SOFT_DECLARATIONS
+# if defined(CONFIG_MPC8260)
+#  define I2C_SOFT_DECLARATIONS volatile ioport_t *iop = \
+               ioport_addr((immap_t *)CONFIG_SYS_IMMR, I2C_PORT);
+# elif defined(CONFIG_8xx)
+#  define I2C_SOFT_DECLARATIONS        volatile immap_t *immr = \
+               (immap_t *)CONFIG_SYS_IMMR;
+# else
+#  define I2C_SOFT_DECLARATIONS
+# endif
+#endif
+
+#if !defined(CONFIG_SYS_SOFT_I2C_SPEED)
+#define CONFIG_SYS_SOFT_I2C_SPEED CONFIG_SYS_I2C_SPEED
+#endif
+#if !defined(CONFIG_SYS_SOFT_I2C_SLAVE)
+#define CONFIG_SYS_SOFT_I2C_SLAVE CONFIG_SYS_I2C_SLAVE
 #endif
 
 /*-----------------------------------------------------------------------
  * Definitions
  */
-
 #define RETRIES                0
 
 #define I2C_ACK                0               /* PD_SDA level to ack a byte */
@@ -125,10 +145,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define PRINTD(fmt,args...)
 #endif
 
-#if defined(CONFIG_I2C_MULTI_BUS)
-static unsigned int i2c_bus_num __attribute__ ((section (".data"))) = 0;
-#endif /* CONFIG_I2C_MULTI_BUS */
-
 /*-----------------------------------------------------------------------
  * Local functions
  */
@@ -267,39 +283,6 @@ static int write_byte(uchar data)
        return(nack);   /* not a nack is an ack */
 }
 
-#if defined(CONFIG_I2C_MULTI_BUS)
-/*
- * Functions for multiple I2C bus handling
- */
-unsigned int i2c_get_bus_num(void)
-{
-       return i2c_bus_num;
-}
-
-int i2c_set_bus_num(unsigned int bus)
-{
-#if defined(CONFIG_I2C_MUX)
-       if (bus < CONFIG_SYS_MAX_I2C_BUS) {
-               i2c_bus_num = bus;
-       } else {
-               int     ret;
-
-               ret = i2x_mux_select_mux(bus);
-               i2c_init_board();
-               if (ret == 0)
-                       i2c_bus_num = bus;
-               else
-                       return ret;
-       }
-#else
-       if (bus >= CONFIG_SYS_MAX_I2C_BUS)
-               return -1;
-       i2c_bus_num = bus;
-#endif
-       return 0;
-}
-#endif
-
 /*-----------------------------------------------------------------------
  * if ack == I2C_ACK, ACK the byte so can continue reading, else
  * send I2C_NOACK to end the read.
@@ -330,14 +313,10 @@ static uchar read_byte(int ack)
        return(data);
 }
 
-/*=====================================================================*/
-/*                         Public Functions                            */
-/*=====================================================================*/
-
 /*-----------------------------------------------------------------------
  * Initialization
  */
-void i2c_init (int speed, int slaveaddr)
+static void soft_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
 {
 #if defined(CONFIG_SYS_I2C_INIT_BOARD)
        /* call board specific i2c bus reset routine before accessing the   */
@@ -360,7 +339,7 @@ void i2c_init (int speed, int slaveaddr)
  * completion of EEPROM writes since the chip stops responding until
  * the write completes (typically 10mSec).
  */
-int i2c_probe(uchar addr)
+static int soft_i2c_probe(struct i2c_adapter *adap, uint8_t addr)
 {
        int rc;
 
@@ -378,7 +357,8 @@ int i2c_probe(uchar addr)
 /*-----------------------------------------------------------------------
  * Read bytes
  */
-int  i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
+static int  soft_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
+                       int alen, uchar *buffer, int len)
 {
        int shift;
        PRINTD("i2c_read: chip %02X addr %02X alen %d buffer %p len %d\n",
@@ -452,7 +432,8 @@ int  i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
 /*-----------------------------------------------------------------------
  * Write bytes
  */
-int  i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
+static int  soft_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
+                       int alen, uchar *buffer, int len)
 {
        int shift, failures = 0;
 
@@ -482,3 +463,32 @@ int  i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
        send_stop();
        return(failures);
 }
+
+/*
+ * Register soft i2c adapters
+ */
+U_BOOT_I2C_ADAP_COMPLETE(soft0, soft_i2c_init, soft_i2c_probe,
+                        soft_i2c_read, soft_i2c_write, NULL,
+                        CONFIG_SYS_I2C_SOFT_SPEED, CONFIG_SYS_I2C_SOFT_SLAVE,
+                        0)
+#if defined(I2C_SOFT_DECLARATIONS2)
+U_BOOT_I2C_ADAP_COMPLETE(soft1, soft_i2c_init, soft_i2c_probe,
+                        soft_i2c_read, soft_i2c_write, NULL,
+                        CONFIG_SYS_I2C_SOFT_SPEED_2,
+                        CONFIG_SYS_I2C_SOFT_SLAVE_2,
+                        1)
+#endif
+#if defined(I2C_SOFT_DECLARATIONS3)
+U_BOOT_I2C_ADAP_COMPLETE(soft2, soft_i2c_init, soft_i2c_probe,
+                        soft_i2c_read, soft_i2c_write, NULL,
+                        CONFIG_SYS_I2C_SOFT_SPEED_3,
+                        CONFIG_SYS_I2C_SOFT_SLAVE_3,
+                        2)
+#endif
+#if defined(I2C_SOFT_DECLARATIONS4)
+U_BOOT_I2C_ADAP_COMPLETE(soft3, soft_i2c_init, soft_i2c_probe,
+                        soft_i2c_read, soft_i2c_write, NULL,
+                        CONFIG_SYS_I2C_SOFT_SPEED_4,
+                        CONFIG_SYS_I2C_SOFT_SLAVE_4,
+                        3)
+#endif
index d506a558c0339b0c391000093fe014caaf95f7a5..340c6851f9a1a7df7836e7884f231126f5fa0d37 100644 (file)
@@ -86,8 +86,8 @@
  * PCI stuff
  *-----------------------------------------------------------------------
  */
-#define CONFIG_HARD_I2C                1               /* To enable I2C support        */
-#undef CONFIG_SOFT_I2C                         /* I2C bit-banged               */
+#define CONFIG_HARD_I2C                1               /* To enable I2C support */
+#undef CONFIG_SYS_I2C_SOFT                     /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index b5911c69450be70c082f88ccb2d1dff65bbd39f7..a3f64408deccf8462660aeea0152d262dbb18649 100644 (file)
@@ -277,7 +277,6 @@ extern unsigned long get_sdram_size(void);
 
 #define CONFIG_FSL_I2C                 /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_I2C_CMD_TREE
 #define CONFIG_SYS_I2C_SPEED           400000 /* I2C speed and slave address*/
index be9238e5201ad4c32678b3fc0c624487ecd8d947..fd3eff0c1f49172a2d4d39bbc64a274d479b8d4c 100644 (file)
 /*-----------------------------------------------------------------------
  * 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 */
index 7ac182f0f044966ce114b420c114f1e2bd48f8cd..43b07cf46b243cfe0b2b40484d861d19b0b9274a 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C/EEPROM/RTC configuration
  */
-#define        CONFIG_SOFT_I2C                 /* Software I2C support enabled */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT                    /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 
-# define CONFIG_SYS_I2C_SPEED          50000
-# define CONFIG_SYS_I2C_SLAVE          0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
index 3e9c21cc9ddd0d6b646444df2e70ff5ea7968ab0..9c3b3d5b40a07d94167564590fcaaebf052e1e91 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C/EEPROM/RTC configuration
  */
-#define CONFIG_SOFT_I2C                        /* Software I2C support enabled */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 
-# define CONFIG_SYS_I2C_SPEED          50000
-# define CONFIG_SYS_I2C_SLAVE          0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
index 4970ea657b7e73e1322e900e101eeefb3748377b..152821f56766474eb8246e5565b6dacffb839ab8 100644 (file)
  * I2C
  */
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 9a649ca125fec2ca3682c93aa18ab1d35075ce00..cc03d397d3ae98c429af6d90a023f90714976482 100644 (file)
 /*
  * Enable I2C and select the hardware/software driver
  */
-#define CONFIG_HARD_I2C                1                               /* CPM based I2C                        */
-#undef CONFIG_SOFT_I2C                                         /* Bit-banged I2C                       */
+#define CONFIG_HARD_I2C                1               /* CPM based I2C */
+#undef CONFIG_SYS_I2C_SOFT                     /* Bit-banged I2C */
 
 #ifdef CONFIG_HARD_I2C
-#define        CONFIG_SYS_I2C_SPEED            100000                  /* clock speed in Hz            */
-#define CONFIG_SYS_I2C_SLAVE           0xFE                    /* I2C slave address            */
+#define        CONFIG_SYS_I2C_SPEED            100000  /* clock speed in Hz */
+#define CONFIG_SYS_I2C_SLAVE           0xFE    /* I2C slave address */
 #endif
 
-#ifdef CONFIG_SOFT_I2C
-#define PB_SCL                         0x00000020              /* PB 26                                        */
-#define PB_SDA                         0x00000010              /* PB 27                                        */
-#define I2C_INIT                       (immr->im_cpm.cp_pbdir |=  PB_SCL)
-#define I2C_ACTIVE                     (immr->im_cpm.cp_pbdir |=  PB_SDA)
-#define I2C_TRISTATE           (immr->im_cpm.cp_pbdir &= ~PB_SDA)
-#define I2C_READ                       ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
-#define I2C_SDA(bit)           if(bit) immr->im_cpm.cp_pbdat |=  PB_SDA; \
-                                                               else    immr->im_cpm.cp_pbdat &= ~PB_SDA
-#define I2C_SCL(bit)           if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
-                                                               else    immr->im_cpm.cp_pbdat &= ~PB_SCL
-#define I2C_DELAY                      udelay(5)               /* 1/4 I2C clock duration       */
+#ifdef CONFIG_SYS_I2C_SOFT
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
+#define PB_SCL         0x00000020              /* PB 26 */
+#define PB_SDA         0x00000010              /* PB 27 */
+#define I2C_INIT       (immr->im_cpm.cp_pbdir |=  PB_SCL)
+#define I2C_ACTIVE     (immr->im_cpm.cp_pbdir |=  PB_SDA)
+#define I2C_TRISTATE   (immr->im_cpm.cp_pbdir &= ~PB_SDA)
+#define I2C_READ       ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
+#define I2C_SDA(bit)   if (bit) \
+                               immr->im_cpm.cp_pbdat |=  PB_SDA; \
+                       else \
+                               immr->im_cpm.cp_pbdat &= ~PB_SDA
+#define I2C_SCL(bit)   if (bit) \
+                               immr->im_cpm.cp_pbdat |=  PB_SCL; \
+                       else \
+                               immr->im_cpm.cp_pbdat &= ~PB_SCL
+#define I2C_DELAY      udelay(5) /* 1/4 I2C clock duration */
 #endif
 
 /*
index dbad1fd6afab4edd71491118cf1a3ffa4a2d1083..071b4be737ef0e6c96e452270b8daf0906186700 100644 (file)
  * configuration items that the driver uses to drive the port pins.
  */
 #define CONFIG_HARD_I2C                1               /* To enable I2C support        */
-#undef CONFIG_SOFT_I2C                         /* I2C bit-banged               */
+#undef CONFIG_SYS_I2C_SOFT                     /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 #error "Soft I2C is not configured properly.  Please review!"
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 #define I2C_PORT               3               /* Port A=0, B=1, C=2, D=3 */
 #define I2C_ACTIVE             (iop->pdir |=  0x00010000)
 #define I2C_TRISTATE           (iop->pdir &= ~0x00010000)
 #define I2C_SCL(bit)           if(bit) iop->pdat |=  0x00020000; \
                                else    iop->pdat &= ~0x00020000
 #define I2C_DELAY              udelay(5)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
+#endif /* CONFIG_SYS_I2C_SOFT */
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x57            /* EEPROM IS24C02               */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1               /* Bytes of address             */
index b58b6f638c0832c76ac8d8ae9c4bb62eabfd119c..ca8138bf058a7cb5e074f30f82b93336846a58ad 100644 (file)
 #define CONFIG_DOS_PARTITION
 
 /* enable I2C and select the hardware/software driver */
-#undef  CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-# define CONFIG_SYS_I2C_SPEED          50000
-# define CONFIG_SYS_I2C_SLAVE          0xFE
-# define CONFIG_SYS_I2C_EEPROM_ADDR    0x50
-# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1      /* Bytes of address             */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
+#define CONFIG_SYS_I2C_EEPROM_ADDR     0x50
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address */
+
 
 /*
  * Command line configuration.
index 6d0937fb3459c9740f9d1a4d3f6919d5a712aa08..b5a8d37e715a1d1991123474ddaf2a1247e28568 100644 (file)
 #define CONFIG_MISC_INIT_R     1
 
 /* enable I2C and select the hardware/software driver */
-#undef  CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-#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_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      400000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 /*
  * Software (bit-bang) I2C driver configuration
  */
index 2379718565310f2f1ef6e0ff7c90a0dec3df3a5c..e5cc4e389bebd1cbed16a10b6e7e22b59d06e418 100644 (file)
 
 
 /* enable I2C and select the hardware/software driver */
-#undef  CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
@@ -80,9 +82,6 @@
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
 
-
-# define CONFIG_SYS_I2C_SPEED          50000
-# define CONFIG_SYS_I2C_SLAVE          0xFE
 # define CONFIG_SYS_I2C_EEPROM_ADDR    0x50    /* EEPROM X24C16                */
 # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1      /* bytes of address             */
 /* mask of address bits that overflow into the "EEPROM chip address"    */
index 6dd98128d46dd80d6bf889a5610c7b3ba0489aa8..b1fec10b22096d345e23b5fa33060ba1826b73d9 100644 (file)
  * If the software driver is chosen, there are some additional
  * configuration items that the driver uses to drive the port pins.
  */
-#undef  CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-#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_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      400000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 /*
  * Software (bit-bang) I2C driver configuration
  */
-#ifdef CONFIG_SOFT_I2C
 #define I2C_PORT       3               /* Port A=0, B=1, C=2, D=3 */
 #define I2C_ACTIVE     (iop->pdir |=  0x00010000)
 #define I2C_TRISTATE   (iop->pdir &= ~0x00010000)
 #define I2C_SCL(bit)   if(bit) iop->pdat |=  0x00020000; \
                        else    iop->pdat &= ~0x00020000
 #define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 
 
 /*
index 6ce789d7faba2843c74cf6916201ce72d3d40f2b..76509be0485bce874a5a639cfa0eef4bc388c9b6 100644 (file)
 #define CONFIG_SYS_HZ          1000            /* decrementer freq: 1 ms ticks */
 
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 8d5e8ff653f64f209010f800e6adbbdd00ba7e48..5736fcfa10227a3d0cc535a91e2e6753c4fb80cc 100644 (file)
  * I2C
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C              1              /* I2C hardware support    */
-#undef CONFIG_SOFT_I2C                      /* I2C !bit-banged         */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED         400000         /* I2C speed 400kHz        */
 #define CONFIG_SYS_I2C_SLAVE         0x7F           /* I2C slave address       */
index dae9b8c07902582c5d6c974777be2d8aac4ed152..d6f3a628ef586dfb31ad5086eda5daeb848ea515 100644 (file)
 /*
  * enable I2C and select the hardware/software driver
  */
-#undef CONFIG_HARD_I2C         /* I2C with hardware support    */
-#define        CONFIG_SOFT_I2C         /* I2C bit-banged               */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      93000   /* 93 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 
-#define CONFIG_SYS_I2C_SPEED   93000   /* 93 kHz is supposed to work */
-#define CONFIG_SYS_I2C_SLAVE   0xFE
-
-#ifdef CONFIG_SOFT_I2C
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)   if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(2)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 
 /*-----------------------------------------------------------------------
  * I2C Configuration
index cceee9674261b39d58eb548787000e18ea3871e2..247374922d8662271b1ebf6c2885718d5da415b5 100644 (file)
 /*
  * enable I2C and select the hardware/software driver
  */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define        CONFIG_SOFT_I2C         1       /* I2C bit-banged               */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
 
-#define CONFIG_SYS_I2C_SPEED           93000   /* 93 kHz is supposed to work   */
-#define CONFIG_SYS_I2C_SLAVE           0xFE
+#ifdef CONFIG_SYS_I2C_SOFT
+#define CONFIG_SYS_I2C_SOFT_SPEED      93000   /* 93 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 
-#ifdef CONFIG_SOFT_I2C
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)   if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(2)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
+#endif /* CONFIG_SYS_I2C_SOFT */
 
 
 /*-----------------------------------------------------------------------
index a1eaeff80e060fdb2865e6abbc7076c7ae46784b..209c1223f4511bdb1b4eac395fb0035fe04ac08a 100644 (file)
@@ -84,7 +84,6 @@
 /* I2C */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                        /* I2C with hw support */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x58000
index e4dea05ea7da59a731a6f55a711724d76db1a6ed..b1bdac2d7b6cf7c18a6794b023494279433be57a 100644 (file)
 /* I2c */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged               */
 #define CONFIG_SYS_I2C_SPEED           80000   /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x58000
index 733aece767bda443da05f3983622fe8ad27957d6..dfc2ddf35d5171fa5dfd2d7ec4da96aa3d6ca6c9 100644 (file)
 /* I2C */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                /* I2C with hw support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x00000300
index a5913df2cbcd535bcc8e14104dcc1dd77f68d0ff..e8a8998fcc056693b10bbfad7d67d656d8ddac43 100644 (file)
 /* I2C */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                /* I2C with hw support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x00000300
index 9c2a3bbb91552fe765a47a7a849d23945b8e9067..fbf0c9d9acf9d2c270fa1e455b41ae2652f777c9 100644 (file)
 /* I2C */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                /* I2C with hw support */
-#undef CONFIG_SOFT_I2C
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x00000300
index 896d0d8536756f479b2c626df447eaa5796bddca..bedba2b2904c33b2d0efce462be259f5bfac993e 100644 (file)
 /* I2C */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                        /* I2C with hw support */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x58000
index 64f83026c4aebdcb39bc229f250668402fc97b62..06fa57cc02c701b3ed32e1f11c853b5628286c79 100644 (file)
@@ -97,7 +97,6 @@
 /* I2C */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                        /* I2C with hw support */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x58000
index 4437bbae865fabbfc1dd250474dad947b3a0264a..faa4f86e43795fe565c2fdaa975dcc0dd1696ce1 100644 (file)
@@ -97,7 +97,6 @@
 /* I2C */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                /* I2C with hw support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x58000
index 3be2f8ef33c77edf735297112559d9ca0d9091ff..627c1ae005cf7ffe221b99f9cf2f6eaa59578a8c 100644 (file)
 /* I2c */
 #undef CONFIG_FSL_I2C
 #undef CONFIG_HARD_I2C         /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
+#undef CONFIG_SYS_I2C_SOFT     /* I2C bit-banged */
 /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 6552f69cc85a1cb6a862642b78180c10312a5627..5dbe0b47c1931a53148917c83e042b8115f3fe83 100644 (file)
 /* I2c */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged               */
 #define CONFIG_SYS_I2C_SPEED           80000   /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x58000
index 536b7556fabb35eded2f7fbf874b8a0e12b9a538..8246e68e46f0e01a64a13f151c78fb576b5627d8 100644 (file)
 /* I2c */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged               */
 #define CONFIG_SYS_I2C_SPEED           80000   /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x58000
index 3bdb8673c64b1566244703dd1790929c0742d59c..6e9cba00a7200af531c2992897d0ace4b05aab4e 100644 (file)
 /* I2C */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                /* I2C with hw support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x00008F00
index 3487e49a1c36c510590751576ee91f54e183e881..24f28e0ff5cb0d6dfd9ac913ac310a8c652a0c32 100644 (file)
 /* I2C */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                /* I2C with hw support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x00008F00
index d1ef559cf4701e1a47448c6c11b092be667242b4..66c4798b5f76499c9b5004461112388e9d7b08bd 100644 (file)
  * I2C
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C              1              /* I2C hardware support    */
-#undef CONFIG_SOFT_I2C                      /* I2C !bit-banged         */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED         400000         /* I2C speed 400kHz        */
 #define CONFIG_SYS_I2C_SLAVE         0x7F           /* I2C slave address       */
index 3ff36ad2a6542887ee9d235223a23a8183786dcb..fdd811d77f829903151bfbf800163ed2f444f54d 100644 (file)
 #undef CONFIG_UCODE_PATCH
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
@@ -91,8 +93,6 @@
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
 
-#define CONFIG_SYS_I2C_SPEED                   50000
-#define CONFIG_SYS_I2C_SLAVE                   0xFE
 #define CONFIG_SYS_I2C_EEPROM_ADDR             0x50    /* EEPROM X24C04                */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         1       /* bytes of address             */
 /* mask of address bits that overflow into the "EEPROM chip address"   */
index ac4c253968d3cc5994324cfcd5798d047acbad66..d32b14a105590429c4d564c0bce4b5f18d6948e2 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_FSL_I2C
 #define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE   0x7F
index 7c31f47953bd0c05497df7f37aa8be65cb6b6db8..a35c6b6d841bbbc5060d5efeb84686da1fa0c715 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_FSL_I2C
 #define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE   0x7F
index 212089c238e991e295fcbcc3c9f6b0287c66f1d9..7c3f35c3af45c7f034b713b4c252ec6cc4422f6d 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_FSL_I2C
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
index 1130b59a217ac2f967bbe84a7d6850add5d21101..c67ffdba0fddefadf6f3d18fb3c9a09b63ed1db5 100644 (file)
 #define I2C_8574_PCI66         0x20    /* 0=33MHz PCI, 1=66MHz PCI */
 #define I2C_8574_FLASHSIDE     0x40    /* 0=Reset vector from U4, 1=from U7*/
 
-#undef CONFIG_SOFT_I2C
-
 #endif
 
 /* Compact Flash */
index a71ac2bd359ee903c51ac6a216e61a314b80e484..4d6486bb3031cfbed5f99d00431bcbef78327ce4 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_FSL_I2C
 #define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE   0x7F
index fcca5424e385a0595a4a332b702f4f9965daafb0..29e77195deadcb9beca0a5228ee1217e51eb4654 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_FSL_I2C
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
index 480468f2d7cdb47ed80240e6548b675d9d790e64..91c8a34859dd4879e3b2fd9ac49e4e3dac08e328 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_FSL_I2C
 #define CONFIG_SYS_I2C_SPEED   400000 /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE   0x7F
index d5c9d059ebdf9b2ec24c322376995cc14aee6e0e..3279e3cf6fd717a505f38e379a843766cbe9f2b1 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_FSL_I2C
 #define CONFIG_SYS_I2C_SPEED   400000 /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE   0x7F
index cc2b7c332b780849667188c9b9e6b3f3529b7e14..f560b56d46928096a26257e9dd8de33122edf735 100644 (file)
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 6cb00ee664689e3b123c289869508e0491acd499..a42dec4ed81eae44feb0cf755baf75024f386c2f 100644 (file)
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
index d0e6ca65bfcd42bffbd1f3c38ea73706cb23c8b6..13011b5a87225704548bef2cf44d3cddb61f4cf3 100644 (file)
@@ -285,7 +285,6 @@ extern unsigned long get_clock_freq(void);
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
index 09d0835c619c2e357c0a2b92550d2d731e82f10d..b00468eb8b83ac9d0733a8d0e29b3c3b9c9009bc 100644 (file)
@@ -234,7 +234,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 /* I2C */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x57
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index d070f6adc3e176844bd2fb292b1ba87df6f86f3b..50e318c5d6e21635abc45cd7002b87ce0d672395 100644 (file)
@@ -360,8 +360,7 @@ extern unsigned long get_clock_freq(void);
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_SPEED           400000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
 #define CONFIG_SYS_I2C_OFFSET          0x3000
index 483556b31b1ed448f721fdc7607d48c0b72ec8cb..388ba9ba1ed05d52daed32b2ac5078b52077a0c0 100644 (file)
@@ -283,7 +283,6 @@ extern unsigned long get_clock_freq(void);
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
index 525e88fa1b684a4f9458ccc333865fbe163a63af..04f6a656e62e53923310a9a43da70266659abd8b 100644 (file)
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
index f1bfdcbd2cfbcceb6555fca27f4535074a384378..05a69af6ae2f6e8de44edf52021802424ee79f24 100644 (file)
@@ -268,7 +268,6 @@ extern unsigned long get_clock_freq(void);
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x52
index c54755fab8da4e6826fc37f46e135d1abb17b1e4..23bd90880a8208dbd28ad7e32e255b667baa77f6 100644 (file)
@@ -304,7 +304,6 @@ extern unsigned long get_clock_freq(void);
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE   0x7F
index 25303c4f65df8fdcbafa7abe35c1f2186499378b..45abcf61dea7ef0b9d704be5b31630daa96218bb 100644 (file)
 /* I2C */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x57
index f791e7682e4a7e9661c70a8dd9267ee210a0afb1..0a2e39b118f9ffb66db8afad4f6e01f29a3a35b4 100644 (file)
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
index 4a3ca017e8377f653e5fa8d7d0b55889257d1017..3ac5b2beb193b824348789e3c49e3cb784c1e380 100644 (file)
@@ -300,7 +300,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
index 7b28a27bc07619b8b5e4a5b366464ef1c063ad61..ed1a42916d431db20ecc3ad3e16704ae7adc4caa 100644 (file)
@@ -491,7 +491,6 @@ extern unsigned long get_sdram_size(void);
 
 #define CONFIG_FSL_I2C                 /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_I2C_CMD_TREE
 #define CONFIG_SYS_I2C_SPEED           400000 /* I2C speed and slave address*/
index 4943d7c8fe95e8d372c0a3cf06d17d86bc906b8e..f6ee2515a33f0c61ae97c951b6a33521f3c67397 100644 (file)
@@ -315,7 +315,6 @@ extern unsigned long get_clock_freq(void);
 /* I2C */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x51
index 6ce4cbef9c5b4631b14224c8e3272fd51e769bd8..699e9ebcda15ba16301840c6735fa712255da7f1 100644 (file)
@@ -369,7 +369,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 /* I2C */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_I2C_CMD_TREE
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address*/
index 05a75d8a7633841b2a876c7c7f5e50e2a4e0acac..c8f5a85ded4fa55d429a5ef42b575887c30c001a 100644 (file)
@@ -227,7 +227,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 /* I2C */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
-#undef  CONFIG_SOFT_I2C                /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_I2C_CMD_TREE
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address*/
index faadfe43c155d2d98fe0fe7cba915886b77c3ae7..5508313cec67ff4fc948c4e0a2375c327555ef6d 100644 (file)
        "bootm"
 
 /* enable I2C and select the hardware/software driver */
-#undef  CONFIG_HARD_I2C
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-# define CONFIG_SYS_I2C_SPEED          50000
-# define CONFIG_SYS_I2C_SLAVE          0xFE
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
index f563fbe3357c09b0595556d977d438ae10cbb284..3842f57c0e04b18ace0a2496fc4d825b1ab61f31 100644 (file)
        "bootm"
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-# define CONFIG_SYS_I2C_SPEED          50000
-# define CONFIG_SYS_I2C_SLAVE          0xFE
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
index 40c18274f9d61e6a45c9c9c29879794a06750384..4b531828f589e626685b1f3d13e822e717cbe6d6 100644 (file)
  * I2C
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 60cccffc4589a77c2365e17d7fc278b139743f36..df16598e3c2e89a441f5811c353bb6b934d7e3d2 100644 (file)
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
 #define CONFIG_HARD_I2C                1       /* To I2C with hardware support */
-#undef CONFIG_SORT_I2C                 /* To I2C with software support */
+#undef CONFIG_SYS_I2C_SOFT             /* To I2C with software support */
 #define CONFIG_SYS_I2C_SPEED           4700    /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
+#if defined(CONFIG_SYS_I2C_SOFT)
+#define CONFIG_SYS_SYS_I2C_SOFT_SPEED  4700 /* I2C speed and slave address */
+#define CONFIG_SYS_SYS_I2C_SOFT_SLAVE  0x7F
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)           if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                                else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY              udelay(50)
+#endif /* #define(CONFIG_SYS_I2C_SOFT) */
 
 #define CONFIG_SYS_I2C_LCD_ADDR        0x8     /* LCD Control */
 #define CONFIG_SYS_I2C_KEY_ADDR        0x9     /* Keyboard coprocessor */
index 3595200c45ba59de1afa0502f57b04c7b0a0c839..8130ee6e0ad4ffd683af7844e4ce7d486183b293 100644 (file)
  * I2C Configuration
  *-----------------------------------------------------------------------------
  */
-#define CONFIG_I2C              1
-#define CONFIG_SYS_I2C_SPEED           50000
-#define CONFIG_SYS_I2C_SLAVE           0x34
+#define CONFIG_SYS_I2C_SPEED           50000
+#define CONFIG_SYS_I2C_SLAVE           0x34
 
 
 /* enable I2C and select the hardware/software driver */
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
-#undef  CONFIG_SOFT_I2C                        /* I2C bit-banged               */
+#undef  CONFIG_SYS_I2C_SOFT            /* I2C bit-banged               */
+
+#if defined(CONFIG_SYS_I2C_SOFT)
+#define CONFIG_SYS_I2C                 1
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
 
 
-# define CONFIG_SYS_I2C_SPEED          50000
-# define CONFIG_SYS_I2C_SLAVE          0x34
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x34
+#endif
+
 # define CONFIG_SYS_I2C_EEPROM_ADDR    0x50    /* EEPROM X24C16                */
 # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1      /* bytes of address             */
 /* mask of address bits that overflow into the "EEPROM chip address"    */
index 563abea95e7c85eb21ef14867b4c754af268330c..9a385a48b611efe1027f456e85b13278b6f50925 100644 (file)
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE            /* don't allow baudrate change  */
 
 #define CONFIG_BZIP2           /* Include support for bzip2 compressed images  */
+
+/* enable I2C and select the hardware/software driver */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      40000   /* 40 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
+/* Software (bit-bang) I2C driver configuration */
+#define PB_SCL         0x00000020      /* PB 26 */
+#define PB_SDA         0x00000010      /* PB 27 */
+
+#define I2C_INIT       (immr->im_cpm.cp_pbdir |=  PB_SCL)
+#define I2C_ACTIVE     (immr->im_cpm.cp_pbdir |=  PB_SDA)
+#define I2C_TRISTATE   (immr->im_cpm.cp_pbdir &= ~PB_SDA)
+#define I2C_READ       ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
+#define I2C_SDA(bit)   if (bit) \
+                               immr->im_cpm.cp_pbdat |=  PB_SDA; \
+                       else \
+                               immr->im_cpm.cp_pbdat &= ~PB_SDA
+#define I2C_SCL(bit)   if (bit) \
+                               immr->im_cpm.cp_pbdat |=  PB_SCL; \
+                       else \
+                               immr->im_cpm.cp_pbdat &= ~PB_SCL
+#define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
+
+/* M41T11 Serial Access Timekeeper(R) SRAM */
+#define CONFIG_RTC_M41T11 1
+#define CONFIG_SYS_I2C_RTC_ADDR 0x68
+/* play along with the linux driver */
+#define CONFIG_SYS_M41T11_BASE_YEAR 1900
+
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 /*
index e2ea016387cfad7fc70176c9ba167a8f3036c226..b14136df13ca024ac27b629b960cee91ef59594e 100644 (file)
 #endif
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define        CONFIG_SOFT_I2C                 /* I2C bit-banged               */
-
-# define CONFIG_SYS_I2C_SPEED          50000   /* 50 kHz is supposed to work   */
-# define CONFIG_SYS_I2C_SLAVE          0xFE
-
-#ifdef CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)   if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(1)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 
 
 /*
index b7fbe5e153a011d6f7f0b7b75d71b6fcec1082e8..f0ce2828c2d732f0b9219a2b7b10a16cb5784571 100644 (file)
 
 #define        CONFIG_RTC_DS1306               /* Dallas 1306 real time clock  */
 
-#define        CONFIG_SOFT_I2C                 /* I2C bit-banged               */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
 
-# define CONFIG_SYS_I2C_SPEED          50000
-# define CONFIG_SYS_I2C_SLAVE          0xFE
 # define CONFIG_SYS_I2C_EEPROM_ADDR    0x50    /* Atmel 24C64                  */
 # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2      /* two byte address             */
 
index fa456ed79f98693d75f33d8a6f733970888c946d..65ca4259d8bd4fe9ab8f51778d4c875c49e0ac75 100644 (file)
  * If the software driver is chosen, there are some additional
  * configuration items that the driver uses to drive the port pins.
  */
-#define CONFIG_HARD_I2C                1               /* To enable I2C support        */
-#undef  CONFIG_SOFT_I2C                                /* I2C bit-banged               */
-#define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_HARD_I2C                1               /* To enable I2C support */
+#undef  CONFIG_SYS_I2C_SOFT
+#define CONFIG_SYS_I2C_SLAVE   0x7F
+#define CONFIG_SYS_I2C_SPEED   400000
 
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 #error "Soft I2C is not configured properly.  Please review!"
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 #define I2C_PORT               3               /* Port A=0, B=1, C=2, D=3 */
 #define I2C_ACTIVE             (iop->pdir |=  0x00010000)
 #define I2C_TRISTATE           (iop->pdir &= ~0x00010000)
 #define I2C_SCL(bit)           if(bit) iop->pdat |=  0x00020000; \
                                else    iop->pdat &= ~0x00020000
 #define I2C_DELAY              udelay(5)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
+#endif /* CONFIG_SYS_I2C_SOFT */
 
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x57            /* EEPROM IS24C02               */
index cdc51a501669fc33ad35d6af47fc2dd0ad062552..9a69374221af3c177533c1fc92db98a61aa49556 100644 (file)
  * If the software driver is chosen, there are some additional
  * configuration items that the driver uses to drive the port pins.
  */
-#define CONFIG_HARD_I2C                1               /* To enable I2C support        */
-#undef  CONFIG_SOFT_I2C                                /* I2C bit-banged               */
-#define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_HARD_I2C                1               /* To enable I2C support */
+#undef  CONFIG_SYS_I2C_SOFT
+#define CONFIG_SYS_I2C_SPEED   400000
+#define CONFIG_SYS_I2C_SLAVE   0x7F
 
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 #error "Soft I2C is not configured properly.  Please review!"
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 #define I2C_PORT               3               /* Port A=0, B=1, C=2, D=3 */
 #define I2C_ACTIVE             (iop->pdir |=  0x00010000)
 #define I2C_TRISTATE           (iop->pdir &= ~0x00010000)
 #define I2C_SCL(bit)           if(bit) iop->pdat |=  0x00020000; \
                                else    iop->pdat &= ~0x00020000
 #define I2C_DELAY              udelay(5)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
+#endif /* CONFIG_SYS_I2C_SOFT */
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x57            /* EEPROM IS24C02               */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1               /* Bytes of address             */
index d95a22611dac495db5b06b10110ad19f7ba2680e..059fb362f8784c7d7b0ed9e29ee1689cc498ca2a 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  */
-#define        CONFIG_SOFT_I2C
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC32             */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2       /* Bytes of address             */
-/* mask of address bits that overflow into the "EEPROM chip address"   */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW    0x01
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 5    /* The Catalyst CAT24WC32 has   */
-                                       /* 32 byte page write mode using*/
-                                       /* last 5 bits of the address   */
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10   /* and takes up to 10 msec */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      100000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 
-#if defined (CONFIG_SOFT_I2C)
 #if 0 /* push-pull */
 #define        SDA             0x00800000
 #define        SCL             0x00000008
 #define        I2C_ACTIVE      {DIR1|=SDA;}
 #define        I2C_TRISTATE    {DIR1&=~SDA;}
 #endif
-#endif
+
+#define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC32     */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2       /* Bytes of address     */
+/* mask of address bits that overflow into the "EEPROM chip address"   */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW    0x01
+/*
+ * The Catalyst CAT24WC32 has 32 byte page write mode using
+ * last 5 bits of the address
+ */
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 5
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 /* and takes up to 10 msec */
 
 /*-----------------------------------------------------------------------
  * Definitions for initial stack pointer and data area (in DPRAM)
index 623cb6636b365e3c4a770b9f5fcfbee52fc0d62f..af8877373d534ffa487909d7c58b29a645263095 100644 (file)
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-
-#define CONFIG_SYS_I2C_SPEED           93000   /* 93 kHz is supposed to work   */
-#define CONFIG_SYS_I2C_SLAVE           0xFE
-
-#ifdef CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT                    /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      93000   /* 93 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)   if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(2)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50            /* EEPROM AT24C??       */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2               /* two byte address     */
index 2267d59d750000596defa8695b0fce49ae25df35..e9dcefc7895cdf01146f67969ea2641b44bd1ff5 100644 (file)
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_MISC_INIT_R
 
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support */
-#define        CONFIG_SOFT_I2C         1       /* I2C with softwate support */
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
 
-#if defined (CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
+#  define CONFIG_SYS_I2C
+#  define CONFIG_SYS_I2C_SOFT_SPEED    100000
+#  define CONFIG_SYS_I2C_SOFT_SLAVE    0x7F
+/**/
 #  define SDA0                 0x40
 #  define SCL0                 0x80
 #  define GPIOE0               *((volatile uchar*)(CONFIG_SYS_MBAR+0x0c00))
 #  define I2C_DELAY            {udelay(5);}
 #  define I2C_ACTIVE   {DDR0|=SDA0;}
 #  define I2C_TRISTATE {DDR0&=~SDA0;}
-#  define CONFIG_SYS_I2C_SPEED         100000
-#  define CONFIG_SYS_I2C_SLAVE         0x7F
+
 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x57
 #define CONFIG_SYS_I2C_FACT_ADDR       0x57
 #endif
index 4849f94c99184e1b1c200baf220f3f9796950403..1f728e3d4a9c6515cf40f97a4f02cb625fa20c22 100644 (file)
  * Environment handler
  * only the first 6k in EEPROM are available for user. Of that we use 256b
  */
-#define        CONFIG_SOFT_I2C
 #define CONFIG_ENV_IS_IN_EEPROM        1       /* turn on EEPROM env feature */
 #define CONFIG_ENV_OFFSET              0x1000
 #define CONFIG_ENV_SIZE                0x0700
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
 #define CONFIG_SYS_EEPROM_SIZE 0x2000
-#define        CONFIG_SYS_I2C_SPEED    100000
-#define        CONFIG_SYS_I2C_SLAVE    0xFE
 #define        CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 12
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_MISC_INIT_R
 
-#if defined (CONFIG_SOFT_I2C)
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      100000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
+/**/
 #define        SDA     0x00010
 #define        SCL     0x00020
 #define __I2C_DIR      immr->im_cpm.cp_pbdir
 #define        I2C_DELAY       { udelay(5); }
 #define        I2C_ACTIVE      { __I2C_DIR |= SDA; }
 #define        I2C_TRISTATE    { __I2C_DIR &= ~SDA; }
-#endif
 
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
 
index 7e241317960c4a3f865644cee82953735c2201cf..5fbfd1c9702f987cb9fcbe75f7443c1cb1e44baf 100644 (file)
 #define CONFIG_BOOTCOMMAND     "run flash_self"
 
 /* enable I2C and select the hardware/software driver */
-#undef  CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-#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_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      400000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 
 /*
  * Software (bit-bang) I2C driver configuration
index 3b3f9e63026ac355984a989d8fe1ff5d62e1fdfe..c27e4ef1d05e890afec9fd8acbae511c73194e32 100644 (file)
 
 #if CONFIG_I2C
 /* enable I2C and select the hardware/software driver */
-#undef  CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-#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_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      400000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define CONFIG_SYS_DTT_HYSTERESIS      3
 
 #else
+#undef CONFIG_SYS_I2C
 #undef CONFIG_HARD_I2C
-#undef CONFIG_SOFT_I2C
+#undef CONFIG_SYS_I2C_SOFT
 #endif
 
 /*
index 966a6e3da9970b863574f2041748959992ea3bb4..f22eb35c2f3f131b519dca41a0421dbdea64b31d 100644 (file)
  * I2C
  */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_FSL_I2C
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed: 400KHz */
 #define CONFIG_SYS_I2C_SLAVE           0x7F    /* slave address */
index e7fd2db28eeabba7d9d5c7c7326679c333ea2964..1b558fc4d3497aafb581de8422451094a4df11a5 100644 (file)
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define        CONFIG_SOFT_I2C         1       /* I2C bit-banged               */
-
-#define CONFIG_SYS_I2C_SPEED           93000   /* 93 kHz is supposed to work   */
-#define CONFIG_SYS_I2C_SLAVE           0xFE
-
-#ifdef CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      93000   /* 93 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)   if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(2)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50            /* EEPROM AT24C64       */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2               /* two byte address     */
index 7d0ae99cb1f47926d43cb774ce7858f5fb67de20..910497126fb39b59464eec10b99f17be7077a534 100644 (file)
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT                    /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      93000   /* 93 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 
-#define CONFIG_SYS_I2C_SPEED           93000   /* 93 kHz is supposed to work   */
-#define CONFIG_SYS_I2C_SLAVE           0xFE
-
-#ifdef CONFIG_SOFT_I2C
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)   if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(2)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50            /* EEPROM AT24C256      */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2               /* two byte address     */
index 7941631b510e4ebe38a1a0dd9178c389233f1b45..65d7c58189410bb636be59b7be32a1bbbd6c0081 100644 (file)
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-
-#define CONFIG_SYS_I2C_SPEED           93000   /* 93 kHz is supposed to work   */
-#define CONFIG_SYS_I2C_SLAVE           0xFE
-
-#ifdef CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT                    /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      93000   /* 93 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)   if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(2)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50            /* EEPROM AT24C??       */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2               /* two byte address     */
index d93d5e204f1155aa9b53824e88f74c794c945c1a..9f32a608c0b775f1ea760d588ee54d807c238f95 100644 (file)
  * I2C
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index bd810538750b03df7524f76bcb0c1763e8798689..261dc695c63bffc8ef7c1dfd53ea12bc9f76382d 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C                 /* so disable bit-banged I2C */
 #define CONFIG_I2C_MULTI_BUS
 
 /* I2C speed and slave address */
index a0ed8f18f5a9c30c9c77bc28512a60fd445e4623..6dabe57e7c2fd5bc65097e8a08e68a63c76fff8f 100644 (file)
 /* I2C */
 #define CONFIG_FSL_I2C
 #define CONFIG_HARD_I2C                        /* I2C with hw support */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           80000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x58000
index c1a5ecda7ed5ece2c59b1e35f0d45bace1841526..beab1271a493880870da7d6760c3555665f83d15 100644 (file)
 /*
  * I2C Settings
  */
-#define CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C_SOFT
+#ifdef CONFIG_SYS_I2C_SOFT
+#define CONFIG_SYS_I2C
 #define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF0
 #define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF1
-
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0
+#define I2C_DELAY              udelay(5)       /* 1/4 I2C clock duration */
+#endif
 
 /*
  * Misc Settings
index e3344e9e85166e52b9be5f5d3e2a47c609f33b87..7144c6319fe9909a6b929d22d91b39dfcb30461d 100644 (file)
@@ -14,7 +14,6 @@
 #define CONFIG_BFIN_CPU             bf533-0.3
 #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_BYPASS
 
-
 /*
  * Clock Settings
  *     CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
@@ -38,7 +37,6 @@
 /* Values can range from 1-15                                          */
 #define CONFIG_SCLK_DIV                        6 /* note: 1.2 boards can go faster */
 
-
 /*
  * Memory Settings
  */
 /* #define CONFIG_ETHADDR      02:80:ad:20:31:b8 */
 
 
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0
+/*
+ * Software (bit-bang) I2C driver configuration
+ */
+#define PF_SCL                 PF3
+#define PF_SDA                 PF2
+#define I2C_INIT               (*pFIO_DIR |=  PF_SCL); asm("ssync;")
+#define I2C_ACTIVE             (*pFIO_DIR |=  PF_SDA); \
+                               *pFIO_INEN &= ~PF_SDA; asm("ssync;")
+#define I2C_TRISTATE           (*pFIO_DIR &= ~PF_SDA); \
+                               *pFIO_INEN |= PF_SDA; asm("ssync;")
+#define I2C_READ               ((volatile)(*pFIO_FLAG_D & PF_SDA) != 0); \
+                               asm("ssync;")
+#define I2C_SDA(bit)   if (bit) { \
+                               *pFIO_FLAG_S = PF_SDA; \
+                               asm("ssync;"); \
+                               } \
+                       else    { \
+                               *pFIO_FLAG_C = PF_SDA; \
+                               asm("ssync;"); \
+                               }
+#define I2C_SCL(bit)   if (bit) { \
+                               *pFIO_FLAG_S = PF_SCL; \
+                               asm("ssync;"); \
+                               } \
+                       else    { \
+                               *pFIO_FLAG_C = PF_SCL; \
+                               asm("ssync;"); \
+                               }
+#define I2C_DELAY              udelay(5)       /* 1/4 I2C clock duration */
+
+
 /*
  * Flash Settings
  */
 #define CONFIG_SYS_MAX_FLASH_BANKS     1
 #define CONFIG_SYS_MAX_FLASH_SECT      67
 
-
 /*
  * SPI Settings
  */
 /*
  * I2C Settings
  */
-#define CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C_SOFT
+#ifdef CONFIG_SYS_I2C_SOFT
+#define CONFIG_SYS_I2C
 #define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF3
 #define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF2
-
+#define I2C_DELAY              udelay(5)       /* 1/4 I2C clock duration */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0
+#endif
 
 /*
  * Compact Flash / IDE / ATA Settings
index 6ee1e4c869d945118e9c01cfc430abdfd763f4a5..404039ac230479804992c4ec51ef28d7492a05c8 100644 (file)
 /*
  * I2C Settings
  */
-#define CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C_SOFT
+#ifdef CONFIG_SYS_I2C_SOFT
 #define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF0
 #define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF1
-
+#define I2C_DELAY              udelay(5)       /* 1/4 I2C clock duration */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0
+#endif
 
 /*
  * Misc Settings
index e1a6fe3056cf439f4e85f5e16cedd11792f8f938..08ccce0b9aa1d8fdc0843b18599f3f0eb562a7c4 100644 (file)
@@ -71,7 +71,7 @@
 # ifdef CONFIG_SPI_FLASH
 #  define CONFIG_CMD_SF
 # endif
-# if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+# if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT)
 #  define CONFIG_CMD_I2C
 #  define CONFIG_SOFT_I2C_READ_REPEATED_START
 # endif
 /*
  * I2C Settings
  */
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT)
 # ifndef CONFIG_SYS_I2C_SPEED
 #  define CONFIG_SYS_I2C_SPEED 50000
 # endif
index 83ad659cdfa49772e614613a1853f0f51fd96f2c..7d8227503a8f11a417aa0af70b481d3f15e3921d 100644 (file)
@@ -40,7 +40,6 @@
 #define SHARED_RESOURCES       1
 
 /* Is I2C bit-banged? */
-#undef CONFIG_SOFT_I2
 
 /*
  * Clock Settings
 # undef CONFIG_CMD_NET
 #endif
 
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 # define CONFIG_CMD_I2C
 #endif
 
  * Note these pins are arbitrarily chosen because we aren't using
  * them yet. You can (and probably should) change these values!
  */
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 #define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF9
 #define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF8
-#define CONFIG_SYS_I2C_SPEED           50000
-#define CONFIG_SYS_I2C_SLAVE           0xFE
+#define CONFIG_SYS_SOFT_I2C_SPEED      50000
+#define CONFIG_SYS_SOFT_I2C_SLAVE      0xFE
 #endif
 
 /*
index 523c4e409a51c86a45b80cbc4c11f89d106ecb19..cd37f9adb9beb0af9caca69927f656951fb6d0ff 100644 (file)
  * Soft I2C settings (BF561 does not have hard I2C)
  * PF12,13 on SPI connector 0.
  */
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 # define CONFIG_CMD_I2C
 # define CONFIG_SOFT_I2C_GPIO_SCL      GPIO_PF12
 # define CONFIG_SOFT_I2C_GPIO_SDA      GPIO_PF13
index 15d56c346d05123fea5f2b52e2dd5baac9fa9479..d9b006ab7b0bf4310a260cdcac779193033fc828 100644 (file)
@@ -92,7 +92,6 @@
 #define CONFIG_USART_ID                0/* ignored in arm */
 
 #undef CONFIG_HARD_I2C
-#undef CONFIG_SOFT_I2C
 #define AT91_PIN_SDA                   (1<<25)
 #define AT91_PIN_SCL                   (1<<26)
 
 #undef CONFIG_CMD_NFS
 #undef CONFIG_CMD_DHCP
 
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 #define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_I2C
 #endif
index c40fbd9f8d330ea7bd285cd6d929b4018f1a9cfd..0d3a4fa290e3dc8e587158ed94f12381de45558b 100644 (file)
  * configuration items that the driver uses to drive the port pins.
  */
 #define CONFIG_HARD_I2C                1               /* To enable I2C support        */
-#undef  CONFIG_SOFT_I2C                                /* I2C bit-banged               */
+#undef  CONFIG_SYS_I2C_SOFT                    /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 #error "Soft I2C is not configured properly.  Please review!"
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 #define I2C_PORT               3               /* Port A=0, B=1, C=2, D=3 */
 #define I2C_ACTIVE             (iop->pdir |=  0x00010000)
 #define I2C_TRISTATE           (iop->pdir &= ~0x00010000)
 #define I2C_SCL(bit)           if(bit) iop->pdat |=  0x00020000; \
                                else    iop->pdat &= ~0x00020000
 #define I2C_DELAY              udelay(5)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
+#endif /* CONFIG_SYS_I2C_SOFT */
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x57            /* EEPROM IS24C02               */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1               /* Bytes of address             */
index a6a0f8bb58053c0244ca028eb92f32d273b65288..b80ab3fcf09bb74e2a15df18add3642f8d201b1d 100644 (file)
  * configuration items that the driver uses to drive the port pins.
  */
 #define CONFIG_HARD_I2C                1       /* To enable I2C support        */
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged               */
+#undef CONFIG_SYS_I2C_SOFT             /* I2C bit-banged               */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 
index 3be4929fc2c85e488430839a5217852340e587a8..efb50e37786c263c4b4ccd6b9b2e2c0f8ef87221 100644 (file)
  * I2C-Bus
  */
 
-#define CONFIG_SYS_I2C_SPEED           50000
-#define CONFIG_SYS_I2C_SLAVE           0               /* not used */
-
-#ifndef CONFIG_HARD_I2C
-#define CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0
 
 /* Software  I2C driver configuration */
 
        else                                                    \
                writel(ATMEL_PMX_AA_TWCK, &pio->pioa.codr);
 
-#define I2C_DELAY      udelay(2500000/CONFIG_SYS_I2C_SPEED)
-
-#endif /* CONFIG_HARD_I2C */
+#define I2C_DELAY      udelay(2500000/CONFIG_SYS_I2C_SOFT_SPEED)
 
 /* I2C-RTC */
 
index 5a87cc5d3d6c627f26d9f8518122e125fa08531b..2e675bce61c7d0bc4e18a8248dfc83a664a2279a 100644 (file)
  * If the software driver is chosen, there are some additional
  * configuration items that the driver uses to drive the port pins.
  */
-#undef  CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C_SLAVE           0x7F    /* This is for HARD, must go */
 
 /*
  * Software (bit-bang) I2C driver configuration
  */
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 #define I2C_PORT       3               /* Port A=0, B=1, C=2, D=3 */
 #define I2C_ACTIVE     (iop->pdir |=  0x00010000)
 #define I2C_TRISTATE   (iop->pdir &= ~0x00010000)
 #define I2C_SCL(bit)   if(bit) iop->pdat |=  0x00020000; \
                        else    iop->pdat &= ~0x00020000
 #define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
+#endif /* CONFIG_SYS_I2C_SOFT */
 
 /* #define CONFIG_RTC_DS174x */
 
index 14a0f02c5e57c0c768863a638039566b175780c7..5bf8c22498c0eef30908257258372d2742246d76 100644 (file)
 
 /* I2C */
 #define CONFIG_SYS_MAX_I2C_BUS 1
-#define CONFIG_SYS_I2C_SLAVE   0
-#define CONFIG_SYS_I2C_SPEED   100000
 
-#define CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT                    /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      100000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0
+
 #define I2C_SOFT_DECLARATIONS
 
 #define GPIO_I2C_SCL           AT91_PIO_PORTA, 24
index 294af735d6ec34aa5e631954d71eb96e17b61293..52917551212a493461cf57212fd08d5558fafc0c 100644 (file)
 /*
  * I2C Settings
  */
-#define CONFIG_SOFT_I2C                1
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
 #define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF0
 #define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF1
 
-
 /*
  * Misc Settings
  */
index 7f8825bed1cfb939e69a2d2945f01c51a19707be..695aa5c85ab8075aafbd3ba395ddd706b1c44a02 100644 (file)
 /*
  * I2C stuff
  */
-#define CONFIG_SYS_I2C_SPEED           400000
-
-/* enable I2C and select the hardware/software driver */
-#undef  CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
+#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
 
 /*
  * Software (bit-bang) I2C driver configuration
index 3b15c4e6910010197a6fa9c7952e47a8caa4b690..6182e81a684d19677c041c8689cef20d5be5e190 100644 (file)
 #define CONFIG_LOADS_ECHO
 #define CONFIG_SYS_LOADS_BAUD_CHANGE
 
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_MAX_I2C_BUS         1
 #define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_I2C_MUX
 
 /* Support the IVM EEprom */
 #define        CONFIG_SYS_IVM_EEPROM_ADR       0x50
index eb0e5b6f326a2dc46e3be58d71ceab230700d64e..5a430edbc3d67ec86d280f4d44b07c78f294e869 100644 (file)
 #define CONFIG_SYS_I2C_SPEED   200000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE   0x7F
 #define CONFIG_SYS_I2C_OFFSET  0x3000
+#define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_MAX_I2C_BUS         1
+#define CONFIG_I2C_MUX
 
 /* I2C SYSMON (LM75, AD7414 is almost compatible) */
 #define CONFIG_DTT_LM75                /* ON Semi's LM75 */
index 766d76e188e4279a416b10e7cd2aab1e1d5a95cf..c2c67c15823dd137b793b2a5da808143a877c0c4 100644 (file)
@@ -58,7 +58,6 @@
 
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_SF
-#define CONFIG_SOFT_I2C                /* I2C bit-banged       */
 
 /* SPI NOR Flash default params, used by sf commands */
 #define CONFIG_SF_DEFAULT_SPEED                8100000
 /*
  * I2C related stuff
  */
+#undef CONFIG_I2C_MVTWSI
+#define CONFIG_SYS_I2C
+#define        CONFIG_SYS_I2C_SOFT     /* I2C bit-banged       */
+
 #define        CONFIG_KIRKWOOD_GPIO            /* Enable GPIO Support */
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
+
+#define CONFIG_SYS_NUM_I2C_BUSES       6
+#define CONFIG_SYS_I2C_MAX_HOPS                1
+#define CONFIG_SYS_I2C_BUSES   {       {0, {I2C_NULL_HOP} }, \
+                                       {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+                                       {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+                                       {0, {{I2C_MUX_PCA9547, 0x70, 3} } }, \
+                                       {0, {{I2C_MUX_PCA9547, 0x70, 4} } }, \
+                                       {0, {{I2C_MUX_PCA9547, 0x70, 5} } }, \
+                               }
+
 #ifndef __ASSEMBLY__
 #include <asm/arch-kirkwood/gpio.h>
 extern void __set_direction(unsigned pin, int high);
@@ -211,6 +225,8 @@ int get_scl(void);
 #define I2C_DELAY      udelay(1)
 #define I2C_SOFT_DECLARATIONS
 
+#define        CONFIG_SYS_I2C_SOFT_SLAVE       0x0
+#define        CONFIG_SYS_I2C_SOFT_SPEED       100000
 #endif
 
 /* EEprom support 24C128, 24C256 valid for environment eeprom */
@@ -240,7 +256,7 @@ int get_scl(void);
 #define CONFIG_SYS_EEPROM_WREN
 #define CONFIG_ENV_OFFSET              0x0 /* no bracets! */
 #define CONFIG_ENV_SIZE                        (0x2000 - CONFIG_ENV_OFFSET)
-#define CONFIG_I2C_ENV_EEPROM_BUS      KM_ENV_BUS "\0"
+#define CONFIG_I2C_ENV_EEPROM_BUS      KM_ENV_BUS
 #define CONFIG_ENV_OFFSET_REDUND       0x2000 /* no bracets! */
 #define CONFIG_ENV_SIZE_REDUND         (CONFIG_ENV_SIZE)
 #endif
@@ -293,7 +309,7 @@ int get_scl(void);
        CONFIG_KM_DEF_ENV                                               \
        CONFIG_KM_NEW_ENV                                               \
        "arch=arm\0"                                                    \
-       "EEprom_ivm=" KM_IVM_BUS "\0"                                   \
+       "EEprom_ivm=" __stringify(KM_IVM_BUS) "\0"                      \
        ""
 
 #if defined(CONFIG_SYS_NO_FLASH)
index 3c2117fc39ec7ac91efb8794c72a776f2e563b95..54041f357441f3a5bc83c173126c653150d8f4a7 100644 (file)
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
        CONFIG_KM_BOARD_EXTRA_ENV                                       \
        CONFIG_KM_DEF_ENV                                               \
-       "EEprom_ivm=pca9544a:70:4 \0"                                   \
+       "EEprom_ivm=1\0"                                                \
        "unlock=yes\0"                                                  \
        "newenv="                                                       \
                "prot off 0xFE0C0000 +0x40000 && "                      \
 #endif /* CONFIG_ENV_IS_IN_FLASH */
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define        CONFIG_SOFT_I2C                 /* I2C bit-banged               */
-#define CONFIG_SYS_I2C_SPEED           50000   /* I2C speed */
-#define CONFIG_SYS_I2C_SLAVE           0x7F    /* I2C slave address */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_NUM_I2C_BUSES       3
+#define CONFIG_SYS_I2C_MAX_HOPS                1
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SPEED           CONFIG_SYS_I2C_SOFT_SPEED
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
+#define CONFIG_SYS_I2C_BUSES   {{0, {I2C_NULL_HOP} }, \
+                       {0, {{I2C_MUX_PCA9542, 0x70, 0} } }, \
+                       {0, {{I2C_MUX_PCA9542, 0x70, 1} } } }
 
 /*
  * Software (bit-bang) I2C driver configuration
@@ -282,7 +288,7 @@ int get_scl(void);
 #define CONFIG_SYS_DTT_MAX_TEMP        70
 #define CONFIG_SYS_DTT_LOW_TEMP        -30
 #define CONFIG_SYS_DTT_HYSTERESIS      3
-#define CONFIG_SYS_DTT_BUS_NUM         (CONFIG_SYS_MAX_I2C_BUS)
+#define CONFIG_SYS_DTT_BUS_NUM         2
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
index 83bb7aad3d5b66a96694f56ae0c6811b919a7920..a0ad47e73a213026cbbecb030048e49dfeec2fcf 100644 (file)
 #define CONFIG_IDENT_STRING            "\nKeymile Kirkwood"
 #define CONFIG_HOSTNAME                        km_kirkwood
 #define CONFIG_KM_DISABLE_PCIE
-#define KM_IVM_BUS                     "pca9544a:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_IVM_BUS                     1       /* I2C2 (Mux-Port 1)*/
 
 /* KM_KIRKWOOD_PCI */
 #elif defined(CONFIG_KM_KIRKWOOD_PCI)
 #define CONFIG_IDENT_STRING            "\nKeymile Kirkwood PCI"
 #define CONFIG_HOSTNAME                        km_kirkwood_pci
-#define KM_IVM_BUS                     "pca9544a:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_IVM_BUS                     1       /* I2C2 (Mux-Port 1)*/
 #define CONFIG_KM_FPGA_CONFIG
 
 /* KM_NUSA */
 #elif defined(CONFIG_KM_NUSA)
-#define KM_IVM_BUS                     "pca9547:70:9"  /* I2C2 (Mux-Port 1)*/
+#define KM_IVM_BUS                     1       /* I2C2 (Mux-Port 1)*/
 #define CONFIG_IDENT_STRING            "\nKeymile NUSA"
 #define CONFIG_HOSTNAME                        kmnusa
 #undef CONFIG_SYS_KWD_CONFIG
@@ -69,7 +69,7 @@
 #elif defined(CONFIG_KM_MGCOGE3UN)
 #define CONFIG_IDENT_STRING            "\nKeymile COGE3UN"
 #define CONFIG_HOSTNAME                        mgcoge3un
-#define KM_IVM_BUS                     "pca9547:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_IVM_BUS                     1       /* I2C2 (Mux-Port 1)*/
 #undef CONFIG_SYS_KWD_CONFIG
 #define CONFIG_SYS_KWD_CONFIG \
                $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage-memphis.cfg
@@ -81,7 +81,7 @@
 /* KMCOGE5UN */
 #elif defined(CONFIG_KM_COGE5UN)
 #define CONFIG_IDENT_STRING            "\nKeymile COGE5UN"
-#define KM_IVM_BUS                     "pca9547:70:9"  /* I2C2 (Mux-Port 1)*/
+#define KM_IVM_BUS                     1       /* I2C2 (Mux-Port 1)*/
 #undef CONFIG_SYS_KWD_CONFIG
 #define CONFIG_SYS_KWD_CONFIG \
                $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage_256M8_1.cfg
 #elif defined(CONFIG_KM_PORTL2)
 #define CONFIG_IDENT_STRING            "\nKeymile Port-L2"
 #define CONFIG_HOSTNAME                        portl2
-#define KM_IVM_BUS                     "pca9544a:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_IVM_BUS                     1       /* I2C2 (Mux-Port 1)*/
 #define CONFIG_KM_PIGGY4_88E6061
 
 /* KM_SUV31 */
 #elif defined(CONFIG_KM_SUV31)
-#define KM_IVM_BUS                     "pca9547:70:9"  /* I2C2 (Mux-Port 1)*/
+#define CONFIG_KM_IVM_BUS              1       /* I2C2 (Mux-Port 1)*/
 #define CONFIG_IDENT_STRING            "\nKeymile SUV31"
 #define CONFIG_HOSTNAME                        kmsuv31
 #define CONFIG_KM_ENV_IS_IN_SPI_NOR
 #include "km/km_arm.h"
 
 #ifndef CONFIG_KM_ENV_IS_IN_SPI_NOR
-#define KM_ENV_BUS     "pca9544a:70:d" /* I2C2 (Mux-Port 5)*/
+#define KM_ENV_BUS     5       /* I2C2 (Mux-Port 5)*/
 #endif
 
 #if defined(CONFIG_KM_PIGGY4_88E6352)
index d7c1f8508b0b4b17a1924e4c7f5935f9c3f76c01..eea8c98b6add0888b62f8aa611891c98ec075a98 100644 (file)
  * I2C
  */
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 3c02b73d8b29988b5c665bf47dcbdc3af0f92380..dc0bd33e8de13d9697c172702498f27b7e620303 100644 (file)
 #undef CONFIG_STATUS_LED               /* Status LED disabled          */
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define        CONFIG_SOFT_I2C         1       /* I2C bit-banged               */
-
-#define CONFIG_SYS_I2C_SPEED           93000   /* 93 kHz is supposed to work   */
-#define CONFIG_SYS_I2C_SLAVE           0xFE
-
-#ifdef CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      93000   /* 93 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)   if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(2)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 
 
 #define CONFIG_RTC_PCF8563             /* use Philips PCF8563 RTC      */
index ba613e33cefd075de578903effeafbd4f07c2c2d..4dcb25a9669bcc5fb5277dd036ee4bcf1524f5d7 100644 (file)
  * I2C
  */
 #define CONFIG_HARD_I2C                                /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C                         /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000          /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index c4f245b985120f65e77a569222c2c178ec71672c..6f73e5d949b4d6aa0cad0e5790e6afd0283c562c 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C                 /* so disable bit-banged I2C */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed */
 #define CONFIG_SYS_I2C_SLAVE           0x7F    /* slave address */
index 6f003aa03f9eb5777542398abafa5aa803d77e70..65ca62fa315520eb467a0d480e58186701f5e3ad 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C                 /* so disable bit-banged I2C */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index d438efdae68bf4785507a20016be41f09f23afe6..09073e9489bc78fcd07501d3e23c531834ca4402 100644 (file)
 #ifndef __ASSEMBLY__
 #include <asm/arch/gpio.h>
 #define CONFIG_CMD_I2C
-#define CONFIG_SOFT_I2C
-#define CONFIG_SYS_I2C_SPEED   400000
+#define CONFIG_SYS_I2C
+#define        CONFIG_SYS_I2C_SOFT     1       /* I2C bit-banged       */
+#define I2C_SOFT_DEFS
+#define CONFIG_SYS_I2C_SOFT_SPEED      400000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 #define __SDA                  63
 #define __SCL                  62
 #define I2C_SDA(x)             nmk_gpio_set(__SDA, x)
index fe4f3c0fa3694ae5edb3e8e306d89036a402ca5c..010e1b940544c21d76de93b624f0cfd17a61c9ad 100644 (file)
 /* RTC and I2C stuff */
 #define CONFIG_RTC_DS1338
 #define CONFIG_SYS_I2C_RTC_ADDR                0x68
-#undef CONFIG_HARD_I2C
-#define CONFIG_SOFT_I2C
-#define CONFIG_SYS_I2C_SPEED           100000
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-
-#ifdef CONFIG_SOFT_I2C
-# define CONFIG_I2C_CMD_TREE
-# define CONFIG_I2C_MULTI_BUS
+
+#define CONFIG_SYS_I2C
+#define        CONFIG_SYS_I2C_SOFT     /* I2C bit-banged       */
+#ifdef CONFIG_SYS_I2C_SOFT
+#define CONFIG_SYS_I2C_SOFT_SPEED      100000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
+
 /* Configure data and clock pins for pio */
 # define I2C_INIT { \
        at91_set_pio_output(AT91_PIO_PORTB, 4, 0); \
 /* Set clock pin */
 # define I2C_SCL(bit)          at91_set_pio_value(AT91_PIO_PORTB, 5, bit)
 # define I2C_DELAY             udelay(2) /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
+#endif /* CONFIG_SYS_I2C_SOFT */
 
 /*
  * BOOTP options
index 2fa537291b2bb0aceb3032f30740215e211df0b0..d0a6b1757fee8e9c6533986205733330510e95c8 100644 (file)
 /* I2C */
 #define CONFIG_FSL_I2C                 /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_I2C_CMD_TREE
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C spd and slave address */
index a19de079b6e2c6d439ee363914b96006695af15b..3c33da73bb86e26433716bafa9c0c9905125ec66 100644 (file)
@@ -98,7 +98,6 @@
  * I2C
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 1897619058ecb8106655154c5a9ae9ad1bb4a40a..6358104c1ab828c6ff89fff7ac9868029d0d6c42 100644 (file)
  * I2C
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1           /* I2C with hardware support        */
-#undef CONFIG_SOFT_I2C                     /* I2C bit-banged           */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 1e073177ed837853078c7e38bfdd43284b229942..9aa112a261412f2f204e4867927b01543d708b43 100644 (file)
  */
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define        CONFIG_SOFT_I2C         1       /* I2C bit-banged               */
-
-#define CONFIG_SYS_I2C_SPEED           83000   /* 83 kHz is supposed to work   */
-#define CONFIG_SYS_I2C_SLAVE           0xFE
-
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      83000   /* 83 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
index 5f1bb581ff6b63de751f0f1ceb3dc71c021c089c..30a8c5519f4b9e6ee955d9259a6c6aee6d59e86a 100644 (file)
  * I2C
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1               /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C                         /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 56e83478f8e857fe975e42f610758c0c3a8d2ee8..89ae32b215ae2e3694debacc26cf53ae69e9b4f4 100644 (file)
 #define CONFIG_SOFT_I2C_GPIO_SCL s5pc110_gpio_get_nr(j4, 3)
 #define CONFIG_SOFT_I2C_GPIO_SDA s5pc110_gpio_get_nr(j4, 0)
 
-#define CONFIG_SOFT_I2C        1
-#define CONFIG_SYS_I2C_SPEED   50000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_MAX_I2C_BUS 7
 #define CONFIG_USB_GADGET
index eb13bb3a671c0461419880ca291e95191d18b64c..f7266aa3a1a50f2966396ce3df62e2667cdb2985 100644 (file)
 #define CONFIG_SOFT_I2C_GPIO_SCL exynos4_gpio_part1_get_nr(b, 7)
 #define CONFIG_SOFT_I2C_GPIO_SDA exynos4_gpio_part1_get_nr(b, 6)
 
-#define CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0
 #define CONFIG_SOFT_I2C_READ_REPEATED_START
-#define CONFIG_SYS_I2C_SPEED   50000
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_MAX_I2C_BUS 7
 
index 54d55a0a1e425f7030755b731bbf133fd915bfa3..efbf6b69f0cdaaabf53e6711410fb8c9687e8d64 100644 (file)
  * If the software driver is chosen, there are some additional
  * configuration items that the driver uses to drive the port pins.
  */
-#undef  CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-#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_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      400000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 /*
  * Software (bit-bang) I2C driver configuration
  */
-#ifdef CONFIG_SOFT_I2C
 #define I2C_PORT       3               /* Port A=0, B=1, C=2, D=3 */
 #define I2C_ACTIVE     (iop->pdir |=  0x00010000)
 #define I2C_TRISTATE   (iop->pdir &= ~0x00010000)
 #define I2C_SCL(bit)   if(bit) iop->pdat |=  0x00020000; \
                        else    iop->pdat &= ~0x00020000
 #define I2C_DELAY      udelay(20)      /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 
 /* Define this to reserve an entire FLASH sector for
  * environment variables. Otherwise, the environment will be
index 6e53bc2ee2eb420d8ee6b5793ad8efb843842d8a..4120cf4d2a96e067130af863e58f7c63ccfe1d5a 100644 (file)
 #define CONFIG_SYS_RX_ETH_BUFFER       16      /* use 16 rx buffer on 405 emac */
 
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
-#undef  CONFIG_SOFT_I2C                        /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index fdc1b95e230034d6c680b101c2cbcf77a6b10717..7a79e8c212d4d3f8791d06ed613833645f9b941f 100644 (file)
 
 /* I2C */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_FSL_I2C
 #define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE   0x7F
index 148ade35685934e108c9506e85eecc69a04de246..354691a364ae44043cfa491aa03ad1ad5734a93e 100644 (file)
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 0e2d17deb508b21b19c6ff875e1b144a1421d5af..147e0ae83a03106b7dec230ce3db479146078b75 100644 (file)
  */
 #define        CONFIG_FSL_I2C          /* Use FSL common I2C driver */
 #define        CONFIG_HARD_I2C         /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
index 9dec21de6ea136b56d0d93250a34b9995f28365f..59636f7f77fdf0cba392fd5113472cb00a7b410f 100644 (file)
  *-----------------------------------------------------------------------
  */
 #define  CONFIG_HARD_I2C               /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 
 #define I2C_INIT
index 218ca546bbc8b436cdd6cf96d780affdd9b2ac09..c683fab004867871136a3ed9ba1585474bf98540 100644 (file)
 #define CONFIG_SYS_PROMPT              "Snapper> "
 
 /* I2C - Bit-bashed */
-#define CONFIG_SOFT_I2C
-#define CONFIG_SYS_I2C_SPEED           100000
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      100000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 #define CONFIG_SOFT_I2C_READ_REPEATED_START
-#define CONFIG_I2C_MULTI_BUS
 #define I2C_INIT do {                                                  \
                at91_set_gpio_output(AT91_PIN_PA23, 1);                 \
                at91_set_gpio_output(AT91_PIN_PA24, 1);                 \
index 7a0b4819316d4668d48921acdf3577237296c3ae..19869e613aae1e482eb25055aedc562b1b96a270 100644 (file)
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged               */
 #define CONFIG_SYS_I2C_SPEED           102124  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #define CONFIG_SYS_I2C_OFFSET          0x3000
index 87878d50c3907fd75e0d2d11e4c11e833db6ffb6..2a9b00c4ec50f12ed16582a7811f22940a47e1d8 100644 (file)
  */
 #if defined(CONFIG_CMD_I2C)
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-
-#define CONFIG_SYS_I2C_SPEED          93000   /* 93 kHz is supposed to work   */
-#define CONFIG_SYS_I2C_SLAVE          0xFE
-
-#ifdef CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      93000   /* 93 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)   if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                       else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(2)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 #endif
 
 /*-----------------------------------------------------------------------
index 939a964e7f94ab29470f43e22e875aa4a2edfd8e..b688b457d6bd836c076195334c413f5a8d638961 100644 (file)
  */
 #define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #if 0
index 96d7128d0afe68ef0e56df31be243b56f7839402..4c3c08622a0cd631e3f8743460a97b80bddde553 100644 (file)
  */
 #define CONFIG_FSL_I2C                 /* Use FSL common I2C driver */
 #define  CONFIG_HARD_I2C               /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #undef CONFIG_SYS_I2C_NOPROBES
index 7cc65773b4928ceb4a2e8a71dfc252ac5eda4258..884670da25ae41f409e142f367eb0e992ec43d8a 100644 (file)
 #define CONFIG_CMD_USB
 
 /* I2C support must always be enabled */
-#define CONFIG_SOFT_I2C
 #define CONFIG_CMD_I2C
-#define CONFIG_SYS_I2C_SPEED           400000
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_I2C_MULTI_BUS
+#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      0x7F
+
 #define I2C0_PORT                      AT91_PIO_PORTA
 #define SDA0_PIN                       23
 #define SCL0_PIN                       24
index 356d87bcab01b5093194cf3d4f989f88b9868822..926b209c0448637085ca00ca040a8fd560a38cd3 100644 (file)
 #define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE)
 #define CONFIG_SYS_CACHELINE_SIZE       32
 
-#define CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 #define CONFIG_SOFT_I2C_READ_REPEATED_START
 #define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_SYS_I2C_SPEED   50000
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SOFT_I2C_MULTI_BUS
 #define CONFIG_SYS_MAX_I2C_BUS 15
index 1bb612826ebb53f0c7220340136e52bbe14705c7..218feeb232fd9ff60cd3edaf6bd87c1e00136c95 100644 (file)
  */
 #define CONFIG_U8500_I2C
 #undef CONFIG_HARD_I2C                 /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_SPEED           100000
 #define CONFIG_SYS_I2C_SLAVE           0       /* slave addr of controller */
index 450c98bd3a2209cfffbf04469e485dbf7248dc6e..ce122b46eca9bee1045026483db68f116f654b01 100644 (file)
  */
 
 /* enable I2C and select the hardware/software driver */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define        CONFIG_SOFT_I2C         1       /* I2C bit-banged               */
-
-#define CONFIG_SYS_I2C_SPEED           93000   /* 93 kHz is supposed to work   */
-#define CONFIG_SYS_I2C_SLAVE           0xFE
-
-#ifdef CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      93000 /* 93 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
 /*
  * Software (bit-bang) I2C driver configuration
  */
 #define I2C_SCL(bit)   if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY      udelay(2)       /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
 
 /*-----------------------------------------------------------------------
  * I2C EEPROM (24C164)
index 60d1503bc3190bdda62ab8f8a1cccefd270cd9d0..4815664ab9b49092fe57743ff6b99551f68e23f4 100644 (file)
@@ -235,8 +235,7 @@ protect on ${u-boot_startaddr} ${u-boot_endaddr}"
  *------------------------------------------------------------------*/
 #if 1
 #define CONFIG_HARD_I2C                1               /* To enable I2C support        */
-#undef  CONFIG_SOFT_I2C                                /* I2C bit-banged               */
-#define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_SPEED           400000
 #define CONFIG_SYS_I2C_SLAVE           0x7F
 #endif
 
index 7aeb66801eeef1877b01ebc4b1ade5f339696ac2..fbdb728498f43875b6e8965e8de20be5114c0e88 100644 (file)
 /*
  * I2C/EEPROM
  */
-#undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
-#define        CONFIG_SOFT_I2C                 /* I2C bit-banged               */
-
-#define CONFIG_SYS_I2C_SPEED           83000   /* 83 kHz is supposed to work   */
-#define CONFIG_SYS_I2C_SLAVE           0x7f
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      83000   /* 83 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7f
 
 /*
  * Software (bit-bang) I2C driver configuration
@@ -337,7 +336,7 @@ int vct_gpio_get(int pin);
 #undef CONFIG_CMD_USB
 
 #undef CONFIG_SMC911X
-#undef CONFIG_SOFT_I2C
+#undef CONFIG_SYS_I2C_SOFT
 #undef CONFIG_SOURCE
 #undef CONFIG_SYS_LONGHELP
 #undef CONFIG_TIMESTAMP
index e2cf4f005e235ae6fb0fc971ac917e59ef91bf2d..5c43c1bea3b1072f98dbfe8fc6987c34e717c175 100644 (file)
 #define CONFIG_SYS_I2C_SLAVE                   0               /* not used */
 
 #ifndef CONFIG_HARD_I2C
-#define CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT                    /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      CONFIG_SYS_I2C_SPEED
+#define CONFIG_SYS_I2C_SOFT_SLAVE      CONFIG_SYS_I2C_SLAVE
 
 /* Software  I2C driver configuration */
-
 #define I2C_DELAY      udelay(2500000/CONFIG_SYS_I2C_SPEED)
 
 #define AT91_PIN_SDA   (1<<4)          /* AT91C_PIO_PB4 */
index f97de5490bb6b4e74d0e089b210d5144aa413e96..54fbe8bdad5699b14df29fe6c33b116650b1b07c 100644 (file)
 /* I2C */
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C         /* I2C bit-banged */
 #define CONFIG_FSL_I2C
 #define CONFIG_I2C_CMD_TREE
 #define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
index b0c3bd5f9b9a48410375f03b8df4a11768e02867..75195bc742cf65a121bf88db7529c3b17290d0a1 100644 (file)
  * I2C
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C                1               /* I2C with hardware support    */
-#undef CONFIG_SOFT_I2C                         /* I2C bit-banged               */
 #define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
 #define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
 #define CONFIG_SYS_I2C_SLAVE           0x7F
index 3e09af9141b0d28be6bb1fad497bca82884e1de4..f532a1443134fdc492b11c8ddfedc6bbe48df84b 100644 (file)
@@ -305,6 +305,15 @@ unsigned int i2c_get_bus_speed(void);
  * Adjusts I2C pointers after U-Boot is relocated to DRAM
  */
 void i2c_reloc_fixup(void);
+#if defined(CONFIG_SYS_I2C_SOFT)
+void i2c_soft_init(void);
+void i2c_soft_active(void);
+void i2c_soft_tristate(void);
+int i2c_soft_read(void);
+void i2c_soft_sda(int bit);
+void i2c_soft_scl(int bit);
+void i2c_soft_delay(void);
+#endif
 #else
 
 /*