]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge branch 'master' of git://git.denx.de/u-boot-i2c
authorTom Rini <trini@ti.com>
Wed, 24 Jul 2013 13:22:28 +0000 (09:22 -0400)
committerTom Rini <trini@ti.com>
Wed, 24 Jul 2013 13:50:24 +0000 (09:50 -0400)
The sandburst-specific i2c drivers have been deleted, conflict was just
over the SPDX conversion.

Conflicts:
board/sandburst/common/ppc440gx_i2c.c
board/sandburst/common/ppc440gx_i2c.h

Signed-off-by: Tom Rini <trini@ti.com>
321 files changed:
README
arch/arm/cpu/armv7/vf610/generic.c
arch/arm/include/asm/arch-kirkwood/config.h
arch/arm/include/asm/arch-vf610/clock.h
arch/arm/include/asm/arch-vf610/crm_regs.h
arch/arm/include/asm/arch-vf610/imx-regs.h
arch/arm/include/asm/arch-vf610/iomux-vf610.h
arch/arm/lib/board.c
arch/blackfin/lib/board.c
arch/m68k/cpu/mcf5227x/cpu_init.c
arch/m68k/cpu/mcf5227x/speed.c
arch/m68k/cpu/mcf523x/cpu_init.c
arch/m68k/cpu/mcf523x/speed.c
arch/m68k/cpu/mcf52x2/cpu_init.c
arch/m68k/cpu/mcf52x2/speed.c
arch/m68k/cpu/mcf532x/cpu_init.c
arch/m68k/cpu/mcf532x/speed.c
arch/m68k/cpu/mcf5445x/cpu_init.c
arch/m68k/cpu/mcf5445x/speed.c
arch/m68k/cpu/mcf547x_8x/cpu_init.c
arch/m68k/cpu/mcf547x_8x/speed.c
arch/m68k/include/asm/global_data.h
arch/m68k/lib/board.c
arch/nds32/lib/board.c
arch/powerpc/cpu/mpc8260/i2c.c
arch/powerpc/cpu/mpc8xx/video.c
arch/powerpc/cpu/ppc4xx/40x_spd_sdram.c
arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c
arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
arch/powerpc/cpu/ppc4xx/cmd_chip_config.c
arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c
arch/powerpc/include/asm/ppc4xx-i2c.h
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/csb272/csb272.c
board/emk/top9000/top9000.c
board/esd/du440/du440.c
board/esd/vme8349/vme8349.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/freescale/mpc8349itx/mpc8349itx.c
board/freescale/mpc8349itx/pci.c
board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
board/freescale/vf610twr/vf610twr.c
board/ids8247/ids8247.c
board/keymile/common/ivm.c
board/keymile/km83xx/km83xx.c
board/keymile/km_arm/km_arm.c
board/lwmon/lwmon.c
board/lwmon/pcmcia.c
board/lwmon5/kbd.c
board/mpl/pip405/pip405.c
board/nvidia/common/board.c
board/pm826/pm826.c
board/pm828/pm828.c
board/sacsng/ioconfig.h
board/sandburst/common/ppc440gx_i2c.c [deleted file]
board/sandburst/common/ppc440gx_i2c.h [deleted file]
board/sandburst/common/sb_common.c
board/sandburst/common/sb_common.h
board/sandburst/karef/Makefile
board/sandburst/karef/karef.c
board/sandburst/metrobox/Makefile
board/sandburst/metrobox/metrobox.c
board/tqc/tqm8260/tqm8260.c
board/tqc/tqm8272/tqm8272.c
board/tqc/tqm8272/tqm8272.h
common/board_f.c
common/cmd_date.c
common/cmd_dtt.c
common/cmd_eeprom.c
common/cmd_i2c.c
common/env_eeprom.c
common/stdio.c
drivers/i2c/Makefile
drivers/i2c/fsl_i2c.c
drivers/i2c/fti2c010.c [new file with mode: 0644]
drivers/i2c/fti2c010.h [new file with mode: 0644]
drivers/i2c/i2c_core.c [new file with mode: 0644]
drivers/i2c/mxc_i2c.c
drivers/i2c/ppc4xx_i2c.c
drivers/i2c/soft_i2c.c
drivers/i2c/tegra_i2c.c
include/asm-generic/global_data.h
include/configs/A3000.h
include/configs/APC405.h
include/configs/ASH405.h
include/configs/B4860QDS.h
include/configs/BSC9131RDB.h
include/configs/BSC9132QDS.h
include/configs/CANBT.h
include/configs/CATcenter.h
include/configs/CMS700.h
include/configs/CPCI2DP.h
include/configs/CPCI405.h
include/configs/CPCI4052.h
include/configs/CPCI405AB.h
include/configs/CPCI405DT.h
include/configs/CPCIISER4.h
include/configs/CPU86.h
include/configs/CPU87.h
include/configs/CRAYL1.h
include/configs/DP405.h
include/configs/DU405.h
include/configs/DU440.h
include/configs/G2000.h
include/configs/GEN860T.h
include/configs/HH405.h
include/configs/HIDDEN_DRAGON.h
include/configs/HUB405.h
include/configs/HWW1U1A.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/M5253DEMO.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/MERGERBOX.h
include/configs/METROBOX.h
include/configs/MHPC.h
include/configs/MIP405.h
include/configs/MPC8308RDB.h
include/configs/MPC8313ERDB.h
include/configs/MPC8315ERDB.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/MVBLM7.h
include/configs/OCRTC.h
include/configs/ORSG.h
include/configs/P1010RDB.h
include/configs/P1022DS.h
include/configs/P1023RDB.h
include/configs/P1023RDS.h
include/configs/P1_P2_RDB.h
include/configs/P2020COME.h
include/configs/P2020DS.h
include/configs/P2041RDB.h
include/configs/PCI405.h
include/configs/PIP405.h
include/configs/PLU405.h
include/configs/PM826.h
include/configs/PM828.h
include/configs/PMC405.h
include/configs/PMC405DE.h
include/configs/PMC440.h
include/configs/PPChameleonEVB.h
include/configs/R360MPI.h
include/configs/RPXClassic.h
include/configs/RPXlite.h
include/configs/RRvision.h
include/configs/SIMPC8313.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/VOH405.h
include/configs/VOM405.h
include/configs/W7OLMC.h
include/configs/W7OLMG.h
include/configs/WUH405.h
include/configs/acadia.h
include/configs/alpr.h
include/configs/amcc-common.h
include/configs/aria.h
include/configs/astro_mcf5373l.h
include/configs/bamboo.h
include/configs/beaver.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/bluestone.h
include/configs/bubinga.h
include/configs/canyonlands.h
include/configs/cardhu.h
include/configs/controlcenterd.h
include/configs/corenet_ds.h
include/configs/cpuat91.h
include/configs/csb272.h
include/configs/csb472.h
include/configs/dalmore.h
include/configs/debris.h
include/configs/dlvision-10g.h
include/configs/dlvision.h
include/configs/eXalion.h
include/configs/eb_cpu5282.h
include/configs/eb_cpux9k2.h
include/configs/ebony.h
include/configs/ep8260.h
include/configs/ethernut5.h
include/configs/gdppc440etx.h
include/configs/ibf-dsp561.h
include/configs/icon.h
include/configs/intip.h
include/configs/io.h
include/configs/io64.h
include/configs/iocon.h
include/configs/katmai.h
include/configs/kilauea.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/luan.h
include/configs/lwmon.h
include/configs/lwmon5.h
include/configs/makalu.h
include/configs/mecp5123.h
include/configs/mpc5121ads.h
include/configs/mpc8308_p1m.h
include/configs/mpq101.h
include/configs/neo.h
include/configs/nhk8815.h
include/configs/ocotea.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/redwood.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/seaboard.h
include/configs/sequoia.h
include/configs/snapper9260.h
include/configs/socrates.h
include/configs/spc1920.h
include/configs/stxgp3.h
include/configs/stxssa.h
include/configs/t3corp.h
include/configs/t4qds.h
include/configs/taihu.h
include/configs/taishan.h
include/configs/tegra-common-post.h
include/configs/top9000.h
include/configs/trats.h
include/configs/trimslice.h
include/configs/u8500_href.h
include/configs/uc100.h
include/configs/utx8245.h
include/configs/vct.h
include/configs/vf610twr.h
include/configs/vl_ma2sc.h
include/configs/vme8349.h
include/configs/walnut.h
include/configs/whistler.h
include/configs/xpedite1000.h
include/configs/xpedite517x.h
include/configs/xpedite520x.h
include/configs/xpedite537x.h
include/configs/xpedite550x.h
include/configs/yosemite.h
include/configs/yucca.h
include/configs/zeus.h
include/fdtdec.h
include/i2c.h
lib/fdtdec.c

diff --git a/README b/README
index ba9be2be57c285e142684e1eb9f5fb794cefe54f..a5c3e8dcf7f349badd7295f261ea3dcf7a51c748 100644 (file)
--- a/README
+++ b/README
@@ -1928,11 +1928,114 @@ CBFS (Coreboot Filesystem) support
                on those systems that support this (optional)
                feature, like the TQM8xxL modules.
 
-- I2C Support: CONFIG_HARD_I2C | CONFIG_SOFT_I2C
-
-               These enable 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.
+- I2C Support: CONFIG_SYS_I2C
+
+               This enable the NEW i2c subsystem, and will allow you to use
+               i2c commands at the u-boot command line (as long as you set
+               CONFIG_CMD_I2C in CONFIG_COMMANDS) and communicate with i2c
+               based realtime clock chips or other i2c devices. See
+               common/cmd_i2c.c for a description of the command line
+               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
+
+               - drivers/i2c/fsl_i2c.c:
+                 - activate i2c driver with CONFIG_SYS_I2C_FSL
+                   define CONFIG_SYS_FSL_I2C_OFFSET for setting the register
+                   offset CONFIG_SYS_FSL_I2C_SPEED for the i2c speed and
+                   CONFIG_SYS_FSL_I2C_SLAVE for the slave addr of the first
+                   bus.
+                  - If your board supports a second fsl i2c bus, define
+                   CONFIG_SYS_FSL_I2C2_OFFSET for the register offset
+                   CONFIG_SYS_FSL_I2C2_SPEED for the speed and
+                   CONFIG_SYS_FSL_I2C2_SLAVE for the slave address of the
+                   second bus.
+
+               - drivers/i2c/tegra_i2c.c:
+                - activate this driver with CONFIG_SYS_I2C_TEGRA
+                - This driver adds 4 i2c buses with a fix speed from
+                  100000 and the slave addr 0!
+
+               - drivers/i2c/ppc4xx_i2c.c
+                 - activate this driver with CONFIG_SYS_I2C_PPC4XX
+                 - CONFIG_SYS_I2C_PPC4XX_CH0 activate hardware channel 0
+                 - CONFIG_SYS_I2C_PPC4XX_CH1 activate hardware channel 1
+
+               additional defines:
+
+               CONFIG_SYS_NUM_I2C_BUSES
+               Hold the number of i2c busses you want to use. If you
+               don't use/have i2c muxes on your i2c bus, this
+               is equal to CONFIG_SYS_NUM_I2C_ADAPTERS, and you can
+               omit this define.
+
+               CONFIG_SYS_I2C_DIRECT_BUS
+               define this, if you don't use i2c muxes on your hardware.
+               if CONFIG_SYS_I2C_MAX_HOPS is not defined or == 0 you can
+               omit this define.
+
+               CONFIG_SYS_I2C_MAX_HOPS
+               define how many muxes are maximal consecutively connected
+               on one i2c bus. If you not use i2c muxes, omit this
+               define.
+
+               CONFIG_SYS_I2C_BUSES
+               hold a list of busses you want to use, only used if
+               CONFIG_SYS_I2C_DIRECT_BUS is not defined, for example
+               a board with CONFIG_SYS_I2C_MAX_HOPS = 1 and
+               CONFIG_SYS_NUM_I2C_BUSES = 9:
+
+                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}}}, \
+                                       {1, {I2C_NULL_HOP}}, \
+                                       {1, {{I2C_MUX_PCA9544, 0x72, 1}}}, \
+                                       {1, {{I2C_MUX_PCA9544, 0x72, 2}}}, \
+                                       }
+
+               which defines
+                       bus 0 on adapter 0 without a mux
+                       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 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
+
+               NOTE: It is intended to move drivers to CONFIG_SYS_I2C which
+               provides the following compelling advantages:
+
+               - more than one i2c adapter is usable
+               - approved multibus support
+               - better i2c mux support
+
+               ** Please consider updating your I2C driver now. **
+
+               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
@@ -1942,12 +2045,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
@@ -1969,7 +2068,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):
 
@@ -2120,58 +2219,6 @@ CBFS (Coreboot Filesystem) support
                If not defined, then U-Boot uses predefined value for
                specified DTT device.
 
-               CONFIG_FSL_I2C
-
-               Define this option if you want to use Freescale's I2C driver in
-               drivers/i2c/fsl_i2c.c.
-
-               CONFIG_I2C_MUX
-
-               Define this option if you have I2C devices reached over 1 .. n
-               I2C Muxes like the pca9544a. This option addes a new I2C
-               Command "i2c bus [muxtype:muxaddr:muxchannel]" which adds a
-               new I2C Bus to the existing I2C Busses. If you select the
-               new Bus with "i2c dev", u-bbot sends first the commandos for
-               the muxes to activate this new "bus".
-
-               CONFIG_I2C_MULTI_BUS must be also defined, to use this
-               feature!
-
-               Example:
-               Adding a new I2C Bus reached over 2 pca9544a muxes
-                       The First mux with address 70 and channel 6
-                       The Second mux with address 71 and channel 4
-
-               => i2c bus pca9544a:70:6:pca9544a:71:4
-
-               Use the "i2c bus" command without parameter, to get a list
-               of I2C Busses with muxes:
-
-               => i2c bus
-               Busses reached over muxes:
-               Bus ID: 2
-                 reached over Mux(es):
-                   pca9544a@70 ch: 4
-               Bus ID: 3
-                 reached over Mux(es):
-                   pca9544a@70 ch: 6
-                   pca9544a@71 ch: 4
-               =>
-
-               If you now switch to the new I2C Bus 3 with "i2c dev 3"
-               u-boot first sends the command to the mux@70 to enable
-               channel 6, and then the command to the mux@71 to enable
-               the channel 4.
-
-               After that, you can use the "normal" i2c commands as
-               usual to communicate with your I2C devices behind
-               the 2 muxes.
-
-               This option is actually implemented for the bitbanging
-               algorithm in common/soft_i2c.c and for the Hardware I2C
-               Bus on the MPC8260. But it should be not so difficult
-               to add this option to other architectures.
-
                CONFIG_SOFT_I2C_READ_REPEATED_START
 
                defining this will force the i2c_read() function in
@@ -3588,7 +3635,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 48dd60aa696e070e551a836aed83d807b7499c94..a26d63ebe0135fca6def324bac919d839fda0a2c 100644 (file)
@@ -191,6 +191,11 @@ u32 get_fec_clk(void)
        return freq;
 }
 
+static u32 get_i2c_clk(void)
+{
+       return get_ipg_clk();
+}
+
 unsigned int mxc_get_clock(enum mxc_clock clk)
 {
        switch (clk) {
@@ -206,6 +211,8 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
                return get_sdhc_clk();
        case MXC_FEC_CLK:
                return get_fec_clk();
+       case MXC_I2C_CLK:
+               return get_i2c_clk();
        default:
                break;
        }
index 78d144184a83468e6cd5cc84b9f763807fdea7e9..197703b838427a09a9381b90e159f5c457fc3cd4 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 9b2e2b06dd8c26284e3d0bee30c24186be0c7ac4..535adadd79068cb9563c0d86c979c989e22f273d 100644 (file)
@@ -16,6 +16,7 @@ enum mxc_clock {
        MXC_UART_CLK,
        MXC_ESDHC_CLK,
        MXC_FEC_CLK,
+       MXC_I2C_CLK,
 };
 
 void enable_ocotp_clk(unsigned char enable);
index 8532ead23781315c0a3b6e2d8bf344a416041a3e..85f1fda9f5ea22a39da34bb523b74593c70f4664 100644 (file)
@@ -177,6 +177,7 @@ struct anadig_reg {
 #define CCM_CCGR4_WKUP_CTRL_MASK               (0x3 << 20)
 #define CCM_CCGR4_CCM_CTRL_MASK                        (0x3 << 22)
 #define CCM_CCGR4_GPC_CTRL_MASK                        (0x3 << 24)
+#define CCM_CCGR4_I2C0_CTRL_MASK               (0x3 << 12)
 #define CCM_CCGR6_OCOTP_CTRL_MASK              (0x3 << 10)
 #define CCM_CCGR6_DDRMC_CTRL_MASK              (0x3 << 28)
 #define CCM_CCGR7_SDHC1_CTRL_MASK              (0x3 << 4)
index 9e42be9756785b24f98f813b491c64a9eb6d32e8..b8c877f939b8a0e60b28e7bbc8ae190a51346d3b 100644 (file)
@@ -90,6 +90,7 @@
 #define CONFIG_IOMUX_SHARE_CONF_REG
 
 #define FEC_QUIRK_ENET_MAC
+#define I2C_QUIRK_REG
 
 /* MSCM interrupt rounter */
 #define MSCM_IRSPRC_CP0_EN                             1
index 385a23effe0eba278b3ddcb8e3c95fe01410a663..4a39eb0d60f8dc5a8dcce9592a6cd556ad2fa4ba 100644 (file)
@@ -17,6 +17,8 @@
 #define VF610_ENET_PAD_CTRL    (PAD_CTL_PUS_47K_UP | PAD_CTL_DSE_50ohm | \
                                PAD_CTL_OBE_IBE_ENABLE)
 #define VF610_DDR_PAD_CTRL     PAD_CTL_DSE_25ohm
+#define VF610_I2C_PAD_CTRL     (PAD_CTL_PUS_47K_UP | PAD_CTL_DSE_50ohm | \
+                               PAD_CTL_SPEED_HIGH | PAD_CTL_OBE_IBE_ENABLE)
 
 enum {
        VF610_PAD_PTA6__RMII0_CLKIN             = IOMUX_PAD(0x0000, 0x0000, 2, __NA_, 0, VF610_ENET_PAD_CTRL),
@@ -37,6 +39,8 @@ enum {
        VF610_PAD_PTA27__ESDHC1_DAT1            = IOMUX_PAD(0x0044, 0x0044, 5, __NA_, 0, VF610_SDHC_PAD_CTRL),
        VF610_PAD_PTA28__ESDHC1_DAT2            = IOMUX_PAD(0x0048, 0x0048, 5, __NA_, 0, VF610_SDHC_PAD_CTRL),
        VF610_PAD_PTA29__ESDHC1_DAT3            = IOMUX_PAD(0x004c, 0x004c, 5, __NA_, 0, VF610_SDHC_PAD_CTRL),
+       VF610_PAD_PTB14__I2C0_SCL               = IOMUX_PAD(0x0090, 0x0090, 2, 0x033c, 1, VF610_I2C_PAD_CTRL),
+       VF610_PAD_PTB15__I2C0_SDA               = IOMUX_PAD(0x0094, 0x0094, 2, 0x0340, 1, VF610_I2C_PAD_CTRL),
        VF610_PAD_DDR_A15__DDR_A_15             = IOMUX_PAD(0x0220, 0x0220, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
        VF610_PAD_DDR_A14__DDR_A_14             = IOMUX_PAD(0x0224, 0x0224, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
        VF610_PAD_DDR_A13__DDR_A_13             = IOMUX_PAD(0x0228, 0x0228, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
index 7c1b02148858ff9e0016d3e932d961a6aae36340..9c72a5353fe2cdd865f9896e915a45a89ecec5fb 100644 (file)
@@ -53,7 +53,7 @@ extern void dataflash_print_info(void);
 #endif
 
 #if defined(CONFIG_HARD_I2C) || \
-    defined(CONFIG_SOFT_I2C)
+       defined(CONFIG_SYS_I2C)
 #include <i2c.h>
 #endif
 
@@ -149,11 +149,15 @@ 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:   ");
+#ifdef CONFIG_SYS_I2C
+       i2c_init_all();
+#else
        i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
        puts("ready\n");
        return (0);
 }
@@ -252,7 +256,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 f1d55470e869965db43b612f3c50e3be3005f677..10223bdb791dfe7bd1ca55244f28577a16e6beeb 100644 (file)
 int post_flag;
 #endif
 
+#if defined(CONFIG_SYS_I2C)
+#include <i2c.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 __attribute__((always_inline))
@@ -387,6 +391,9 @@ void board_init_r(gd_t * id, ulong dest_addr)
        mmc_initialize(bd);
 #endif
 
+#if defined(CONFIG_SYS_I2C)
+       i2c_reloc_fixup();
+#endif
        /* relocate environment function pointers etc. */
        env_relocate();
 
index 7e8f832fede3ecb1c905c7d6b93f37398f343d83..91b5fadc8809493d3a97b232d8cea9247fdf7139 100644 (file)
@@ -89,7 +89,7 @@ void cpu_init_f(void)
        out_be32(&fbcs->csmr5, CONFIG_SYS_CS5_MASK);
 #endif
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        out_8(&gpio->par_i2c, GPIO_PAR_I2C_SCL_SCL | GPIO_PAR_I2C_SDA_SDA);
 #endif
 
index 08e49906f52ec51332395dea1a778019ddf7d826..44de4a6701ac4ce6700218623338c8582af9be2b 100644 (file)
@@ -118,7 +118,7 @@ int get_clocks(void)
                gd->bus_clk = gd->arch.flb_clk;
        }
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        gd->arch.i2c1_clk = gd->bus_clk;
 #endif
 
index 494c5495a5c2dd40f692b47d1f29c8818796b0d8..5a789540fc93bb4aaf069f2a55fa7689e827f7d1 100644 (file)
@@ -99,7 +99,7 @@ void cpu_init_f(void)
        out_be32(&fbcs->csmr7, CONFIG_SYS_CS7_MASK);
 #endif
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        CONFIG_SYS_I2C_PINMUX_REG &= CONFIG_SYS_I2C_PINMUX_CLR;
        CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET;
 #endif
index 5abd77149f4cebb97ace9ffb0170a810f271b60d..a4aa05b3fa8a4846ff5a8d98e92dd1e0b2e214ef 100644 (file)
@@ -31,7 +31,7 @@ int get_clocks(void)
        gd->bus_clk = CONFIG_SYS_CLK;
        gd->cpu_clk = (gd->bus_clk * 2);
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        gd->arch.i2c1_clk = gd->bus_clk;
 #endif
 
index dc703695d8effcf87bbd4c9ff1f477d15a939bde..0882c3b8e5b2e0f21fa4f79fde65022beb3ee40c 100644 (file)
@@ -212,7 +212,7 @@ void cpu_init_f(void)
        /* FlexBus Chipselect */
        init_fbcs();
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        CONFIG_SYS_I2C_PINMUX_REG =
            CONFIG_SYS_I2C_PINMUX_REG & CONFIG_SYS_I2C_PINMUX_CLR;
        CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET;
@@ -482,7 +482,7 @@ void cpu_init_f(void)
        init_fbcs();
 #endif                         /* #ifndef CONFIG_MONITOR_IS_IN_RAM */
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        CONFIG_SYS_I2C_PINMUX_REG &= CONFIG_SYS_I2C_PINMUX_CLR;
        CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET;
 #endif
index d0f9762d0b56c8040e1db4959554a878fc071ecf..c5961d45ecade055f6a6c41ed390883f7306cd57 100644 (file)
@@ -74,9 +74,9 @@ int get_clocks (void)
        gd->bus_clk = gd->cpu_clk;
 #endif
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        gd->arch.i2c1_clk = gd->bus_clk;
-#ifdef CONFIG_SYS_I2C2_OFFSET
+#ifdef CONFIG_SYS_I2C2_FSL_OFFSET
        gd->arch.i2c2_clk = gd->bus_clk;
 #endif
 #endif
index f7101fd6d26499d10080845100279bc2bd9247e0..db7ded4782b5daeb279d517268b739e93b9a0333 100644 (file)
@@ -82,7 +82,7 @@ void cpu_init_f(void)
        out_be32(&fbcs->csmr5, CONFIG_SYS_CS5_MASK);
 #endif
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        out_8(&gpio->par_feci2c,
                GPIO_PAR_FECI2C_SDA_SDA | GPIO_PAR_FECI2C_SCL_SCL);
 #endif
@@ -276,7 +276,7 @@ void cpu_init_f(void)
        out_be32(&fbcs->csmr5, CONFIG_SYS_CS5_MASK);
 #endif
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        out_8(&gpio->par_feci2c,
                GPIO_PAR_FECI2C_SCL_SCL | GPIO_PAR_FECI2C_SDA_SDA);
 #endif
index b412abe7d11c91a29fe8480f3c42c7e6f838055f..a440bbb3b648ed6c29833572a5e928201383580e 100644 (file)
@@ -254,7 +254,7 @@ int get_clocks(void)
        gd->bus_clk = clock_pll(CONFIG_SYS_CLK / 1000, 0) * 1000;
        gd->cpu_clk = (gd->bus_clk * 3);
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        gd->arch.i2c1_clk = gd->bus_clk;
 #endif
 
index 955968c0dbb295bf780a7a1f71555041174f4434..9c324dc968dfb3e24ca404349442618216c6a176 100644 (file)
@@ -196,7 +196,7 @@ void cpu_init_f(void)
                GPIO_PAR_FBCTL_OE | GPIO_PAR_FBCTL_TA_TA |
                GPIO_PAR_FBCTL_RW_RW | GPIO_PAR_FBCTL_TS_TS);
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_FSL_I2C
        out_be16(&gpio->par_feci2c,
                GPIO_PAR_FECI2C_SCL_SCL | GPIO_PAR_FECI2C_SDA_SDA);
 #endif
index 594716b6cae768378dd591bfd7751585e09a79a8..07a9b359b5f9f76bd014a86ebf88e54ed9c68b37 100644 (file)
@@ -257,7 +257,7 @@ void setup_5445x_clocks(void)
 #endif
        }
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        gd->arch.i2c1_clk = gd->bus_clk;
 #endif
 }
@@ -273,7 +273,7 @@ int get_clocks(void)
        setup_5445x_clocks();
 #endif
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_FSL_I2C
        gd->arch.i2c1_clk = gd->bus_clk;
 #endif
 
index a9e3b4392fff2077a4b11942504e86b023b1de01..c3df831f14774a904df2c7c35f210c57e5c6ee27 100644 (file)
@@ -79,7 +79,7 @@ void cpu_init_f(void)
        out_be32(&fbcs->csmr5, CONFIG_SYS_CS5_MASK);
 #endif
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        out_be16(&gpio->par_feci2cirq,
                GPIO_PAR_FECI2CIRQ_SCL | GPIO_PAR_FECI2CIRQ_SDA);
 #endif
index f516b10a1322739c54f64518cb6f325f5043bd3d..2bc4c44247f7618dc63cd4b49677aee6f6ef5707 100644 (file)
@@ -24,7 +24,7 @@ int get_clocks(void)
        gd->bus_clk = CONFIG_SYS_CLK;
        gd->cpu_clk = (gd->bus_clk * 2);
 
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        gd->arch.i2c1_clk = gd->bus_clk;
 #endif
 
index 0903644cdddf574bc2e5997975bb7f44b51c4de2..b55c91e613abac55f4d9d0cb2ba0c18a27b8aa2d 100644 (file)
@@ -10,7 +10,7 @@
 
 /* Architecture-specific global data */
 struct arch_global_data {
-#ifdef CONFIG_FSL_I2C
+#ifdef CONFIG_SYS_I2C_FSL
        unsigned long   i2c1_clk;
        unsigned long   i2c2_clk;
 #endif
index 020dc2456ea6ad328445886f037d66cb89f5adcd..e75b6a98dd5cb615d8d592504574b275ed2899a2 100644 (file)
@@ -40,7 +40,7 @@
 #include <version.h>
 
 #if defined(CONFIG_HARD_I2C) || \
-    defined(CONFIG_SOFT_I2C)
+       defined(CONFIG_SYS_I2C)
 #include <i2c.h>
 #endif
 
@@ -126,11 +126,15 @@ static int init_func_ram (void)
 
 /***********************************************************************/
 
-#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:   ");
+#ifdef CONFIG_SYS_I2C
+       i2c_init_all();
+#else
        i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
        puts ("ready\n");
        return (0);
 }
@@ -162,7 +166,7 @@ init_fnc_t *init_sequence[] = {
        display_options,
        checkcpu,
        checkboard,
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
        init_func_i2c,
 #endif
 #if defined(CONFIG_HARD_SPI)
@@ -485,6 +489,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
        spi_init_r ();
 #endif
 
+#if defined(CONFIG_SYS_I2C)
+       /* Adjust I2C subsystem pointers after relocation */
+       i2c_reloc_fixup();
+#endif
+
        /* relocate environment function pointers etc. */
        env_relocate ();
 
index 7a25522b4adb8f67757943db4df78d9b23c92ba4..2d4c6231a3774114366bed986631bb7a59e98587 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if defined(CONFIG_SYS_I2C)
+#include <i2c.h>
+#endif
+
 ulong monitor_flash_len;
 
 /*
@@ -157,7 +161,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 */
@@ -331,6 +335,10 @@ void board_init_r(gd_t *id, ulong dest_addr)
        mmc_initialize(gd->bd);
 #endif
 
+#if defined(CONFIG_SYS_I2C_ADAPTERS)
+       i2c_reloc_fixup();
+#endif
+
        /* initialize environment */
        env_relocate();
 
index fc8d2ef82c5950972fe4cb54fc59b3a45ed99ddc..8658ebdadd6a9afa2576b5063428481716cab08a 100644 (file)
@@ -730,23 +730,9 @@ unsigned int i2c_get_bus_num(void)
 
 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);
-               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;
 }
 
index 8d790b4e88880c171656012bbcb6060cd227c3c0..02cd0debc2831cce3f330382148a76cfd4c381e3 100644 (file)
@@ -793,7 +793,11 @@ static void video_encoder_init (void)
 
        /* Initialize the I2C */
        debug ("[VIDEO ENCODER] Initializing I2C bus...\n");
+#ifdef CONFIG_SYS_I2C
+       i2c_init_all();
+#else
        i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
 
 #ifdef CONFIG_FADS
        /* Reset ADV7176 chip */
index 55a58f6b185d61d94075da73d1b9a94d419c563b..4417646f83789bbf391eebdfe65f365dc6f8c992 100644 (file)
 /*
  * Set default values
  */
-#ifndef CONFIG_SYS_I2C_SPEED
-#define CONFIG_SYS_I2C_SPEED   50000
-#endif
-
 #define ONE_BILLION    1000000000
 
 #define         SDRAM0_CFG_DCE         0x80000000
@@ -142,7 +138,7 @@ long int spd_sdram(int(read_spd)(uint addr))
                 * Make sure I2C controller is initialized
                 * before continuing.
                 */
-               i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+               i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
        }
 
        /* Make shure we are using SDRAM */
index 9d23e7653ff5f389cd05c9e5cbeaea5ae1e3a5cf..52340f209d397a8b6c7ba6b3d16ea0942d9a2473 100644 (file)
 /*
  * Set default values
  */
-#ifndef CONFIG_SYS_I2C_SPEED
-#define CONFIG_SYS_I2C_SPEED   50000
-#endif
-
 #define ONE_BILLION    1000000000
 
 /*
@@ -152,7 +148,7 @@ long int spd_sdram(void) {
         * Make sure I2C controller is initialized
         * before continuing.
         */
-       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
 
        /*
         * Read the SPD information using I2C interface. Check to see if the
index d30f442eb387cb765f4006eddaccd4c890fc50a8..fe928db039ccb5effd4c88490211b16c9fe09731 100644 (file)
@@ -442,8 +442,7 @@ phys_size_t initdram(int board_type)
         */
 
        /* switch to correct I2C bus */
-       I2C_SET_BUS(CONFIG_SYS_SPD_BUS_NUM);
-       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
 
        /*------------------------------------------------------------------
         * Clear out the serial presence detect buffers.
index b777d7329519c1fd098adb54954a07601e42c5e9..4e9a40d5854104e53e2fea3c8e1d0e4952826c98 100644 (file)
@@ -39,7 +39,7 @@ static int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const arg
         * First switch to correct I2C bus. This is I2C bus 0
         * for all currently available 4xx derivats.
         */
-       I2C_SET_BUS(0);
+       i2c_set_bus_num(0);
 
 #ifdef CONFIG_CMD_EEPROM
        ret = eeprom_read(CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR,
index 55278b19bfc895fbd9c032309a68b3a9f1447c1a..916451a2b0c30bb9da22ce23a57e08f44b2fd4e6 100644 (file)
@@ -1024,8 +1024,7 @@ phys_size_t initdram(int board_type)
         * before continuing.
         */
        /* switch to correct I2C bus */
-       I2C_SET_BUS(CONFIG_SYS_SPD_BUS_NUM);
-       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
 
        /*------------------------------------------------------------------
         * Clear out the serial presence detect buffers.
index bbf7f355897e6a6a4082d33bdccfb4110fb8fdb1..09189cf19bc8f7470ee6f70dbfb764018886b4c9 100644 (file)
 
 #define IIC_TIMEOUT    1               /* 1 second */
 
-#if defined(CONFIG_I2C_MULTI_BUS)
-#define I2C_BUS_OFFS   (i2c_bus_num * 0x100)
-#else
-#define I2C_BUS_OFFS   (0x000)
-#endif /* CONFIG_I2C_MULTI_BUS */
-
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
-    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
-    defined(CONFIG_460EX) || defined(CONFIG_460GT)
-#define I2C_BASE_ADDR  (CONFIG_SYS_PERIPHERAL_BASE + 0x00000700 + I2C_BUS_OFFS)
-#elif defined(CONFIG_440) || defined(CONFIG_405EX)
-/* all remaining 440 variants */
-#define I2C_BASE_ADDR  (CONFIG_SYS_PERIPHERAL_BASE + 0x00000400 + I2C_BUS_OFFS)
-#else
-/* all 405 variants */
-#define I2C_BASE_ADDR  (0xEF600500 + I2C_BUS_OFFS)
-#endif
-
 struct ppc4xx_i2c {
        u8 mdbuf;
        u8 res1;
index bef3f76f0c534c877b179cd7ffbb7015c348c939..a101e036019c6bca271a55d8f553b75afb4a2f51 100644 (file)
@@ -82,8 +82,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>
@@ -198,11 +197,15 @@ static int init_func_ram(void)
 
 /***********************************************************************/
 
-#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:   ");
+#ifdef CONFIG_SYS_I2C
+       i2c_init_all();
+#else
        i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
        puts("ready\n");
        return 0;
 }
@@ -291,7 +294,7 @@ static init_fnc_t *init_sequence[] = {
        misc_init_f,
 #endif
        INIT_FUNC_WATCHDOG_RESET
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
        init_func_i2c,
 #endif
 #if defined(CONFIG_HARD_SPI)
index 9fd8e7acd166c04575d3e8c6b3e7bf0c7abb9382..5e4778e97881dd35f6793ae108c3e82019938108 100644 (file)
@@ -272,7 +272,7 @@ int drv_video_init(void)
 }
 #endif
 
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 
 void i2c_init_board(void)
 {
index 2dba146f10d7b60a248274b64c69c19dac922268..e2ae6fde6cbbd0f75bf0f3d2937e87ee1370b230 100644 (file)
@@ -307,7 +307,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 ee395d92bd1daa905c2081efa1d6d0552b031421..0038561b10e6f0a5c4e0cc73c8ff233f87fc1371 100644 (file)
@@ -154,7 +154,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 be03553384f44cae0d13d3a310d278b669c6853a..8a6919dbb1312c09a1f29f62f5ba57a666e3c54d 100644 (file)
@@ -132,7 +132,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 58f5a36f816ad712d6ae09d9620ad70ba3c2efbd..e391dfc9e1bd1ee6fe215d2738e3546aec0bad41 100644 (file)
@@ -309,7 +309,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];
@@ -332,7 +332,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 a1f25ba71e25efbc7a209754c4f606da80de8d00..929291052f2aafd7346438622fa1f546a4321d30 100644 (file)
@@ -145,7 +145,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 b6293073f6f45f0691974aee488fd12f51c469ca..01f90d2ebbe98c376301fed0e8da551692009dbd 100644 (file)
@@ -147,7 +147,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 bfc47e0b4e52f4657827c1e42be7eae4f74184b7..43a1aa0521188627ba052b1525e5a5d8de39c980 100644 (file)
@@ -35,7 +35,7 @@ uchar pll_fs6377_regs[16] = {
  */
 int pll_init(void)
 {
-       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(0);
 
        return  i2c_write(CONFIG_SYS_I2C_PLL_ADDR, 0, 1,
                (uchar *) pll_fs6377_regs, sizeof(pll_fs6377_regs));
index 083e5e8df62acdb0d609015dc7fea9d7ee291f00..6e2ffddb0a434ad570538924263d69bf4c803947 100644 (file)
@@ -229,7 +229,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() */
@@ -237,7 +237,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:
@@ -248,7 +248,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;
@@ -260,7 +260,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 dc35be4e2e37b34a15bbae7aaee01dabb5a7ac44..b168b247bd17cd4c8b728775af1058a3687240c1 100644 (file)
@@ -372,7 +372,6 @@ int last_stage_init(void)
        return 0;
 }
 
-#if defined(CONFIG_I2C_MULTI_BUS)
 /*
  * read field strength from I2C ADC
  */
@@ -487,7 +486,6 @@ U_BOOT_CMD(
        "Initialize USB hub",
        ""
 );
-#endif /* CONFIG_I2C_MULTI_BUS */
 
 #define CONFIG_SYS_BOOT_EEPROM_PAGE_WRITE_BITS 3
 int boot_eeprom_write (unsigned dev_addr,
index e9a25786cd148ff8bcb26b15d3a5a0b05ec12546..01365dcbd3aeddd59013340364aed70fa4b79027 100644 (file)
@@ -169,11 +169,11 @@ static spd_eeprom_t default_spd_eeprom = {
 
 int vme8349_read_spd(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
-       int old_bus = I2C_GET_BUS();
+       int old_bus = i2c_get_bus_num();
        unsigned int l, sum;
        int valid = 0;
 
-       I2C_SET_BUS(0);
+       i2c_set_bus_num(0);
 
        if (i2c_read(chip, addr, alen, buffer, len) == 0)
                if (memcmp(&buffer[64], &default_spd_eeprom.mid[0], 8) == 0) {
@@ -198,7 +198,7 @@ int vme8349_read_spd(uchar chip, uint addr, int alen, uchar *buffer, int len)
                buffer[63] = sum;
        }
 
-       I2C_SET_BUS(old_bus);
+       i2c_set_bus_num(old_bus);
 
        return 0;
 }
index f649dd0406d6745ed170c7960a51b05b0b74c7ca..ec0ce0b205c4c31bbd2ab2463f1c589346dbe2a5 100644 (file)
@@ -57,7 +57,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..3178d49d0a69857456530d8e74e741720b42b6d8 100644 (file)
@@ -82,9 +82,9 @@ CONFIG_CMD_DATE               -- enable to use date feature in u-boot
 CONFIG_MCFTMR          -- define to use DMA timer
 CONFIG_MCFPIT          -- define to use PIT timer
 
-CONFIG_FSL_I2C         -- define to use FSL common I2C driver
+CONFIG_SYS_I2C_FSL     -- 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..84fc1ecfb10aaab32160075e36ae0bbba9a7b33c 100644 (file)
@@ -90,9 +90,9 @@ MCFFEC_TOUT_LOOP              -- set FEC timeout loop
 CONFIG_MCFTMR                  -- define to use DMA timer
 CONFIG_MCFPIT                  -- define to use PIT timer
 
-CONFIG_FSL_I2C                 -- define to use FSL common I2C driver
+CONFIG_SYS_I2C_FSL             -- 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..52eac7b2ff323c188d2a5bb4021d25fa7d2db826 100644 (file)
@@ -89,9 +89,9 @@ MCFFEC_TOUT_LOOP      -- set FEC timeout loop
 CONFIG_MCFTMR          -- define to use DMA timer
 CONFIG_MCFPIT          -- define to use PIT timer
 
-CONFIG_FSL_I2C         -- define to use FSL common I2C driver
+CONFIG_SYS_I2C_FSL     -- 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..c70c4c5c250fdd172b6c5030d68a60a5fee86310 100644 (file)
@@ -112,9 +112,9 @@ _IO_BASE            -- define for IO base address
 CONFIG_MCFTMR          -- define to use DMA timer
 CONFIG_MCFPIT          -- define to use PIT timer
 
-CONFIG_FSL_I2C         -- define to use FSL common I2C driver
+CONFIG_SYS_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..ce497c0d2a0d7330f480f98563e67ac734f762a2 100644 (file)
@@ -97,9 +97,9 @@ CONFIG_DOS_PARTITION  -- enable DOS read/write
 
 CONFIG_SLTTMR          -- define to use SLT timer
 
-CONFIG_FSL_I2C         -- define to use FSL common I2C driver
+CONFIG_SYS_I2C_FSL     -- 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 510ef0453ccc9e16c3a29cf40c1537fdfe268222..803d722806046ab3fc296631b6094d0641e9895a 100644 (file)
@@ -247,8 +247,7 @@ int misc_init_r(void)
 {
        int rc = 0;
 
-#ifdef CONFIG_HARD_I2C
-
+#if defined(CONFIG_SYS_I2C)
        unsigned int orig_bus = i2c_get_bus_num();
        u8 i2c_data;
 
index 64259776c79414021f22f74e738d01d78f3b5949..afc9df0923b7d76ff97f874c64ef20c196ed62f1 100644 (file)
@@ -71,7 +71,7 @@ void pci_init_board(void)
 #endif
        u8 reg8;
 
-#ifdef CONFIG_HARD_I2C
+#if defined(CONFIG_SYS_I2C)
        i2c_set_bus_num(1);
        /* Read the PCI_M66EN jumper setting */
        if ((i2c_read(CONFIG_SYS_I2C_8574_ADDR2, 0, 0, &reg8, sizeof(reg8)) == 0) ||
index d8b1e41e392d38d839e46466c4518bb706cbc8d9..50553dacd957f984154db83353bd8924bc197936 100644 (file)
@@ -232,7 +232,7 @@ int checkboard(void)
                in_8(&cpld_data->pcba_rev) & 0x0F);
 
        /* Initialize i2c early for rom_loc and flash bank information */
-       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
 
        if (i2c_read(CONFIG_SYS_I2C_PCA9557_ADDR, 0, 1, &in, 1) < 0 ||
            i2c_read(CONFIG_SYS_I2C_PCA9557_ADDR, 1, 1, &out, 1) < 0 ||
index 7c6cb5be5694b930c6daa2f1432e9e5f0a7dbdae..699ea7f0100cd77f3349b417e4b465958f4e4fa7 100644 (file)
@@ -14,6 +14,7 @@
 #include <fsl_esdhc.h>
 #include <miiphy.h>
 #include <netdev.h>
+#include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -267,6 +268,16 @@ static void setup_iomux_enet(void)
        imx_iomux_v3_setup_multiple_pads(enet0_pads, ARRAY_SIZE(enet0_pads));
 }
 
+static void setup_iomux_i2c(void)
+{
+       static const iomux_v3_cfg_t i2c0_pads[] = {
+               VF610_PAD_PTB14__I2C0_SCL,
+               VF610_PAD_PTB15__I2C0_SDA,
+       };
+
+       imx_iomux_v3_setup_multiple_pads(i2c0_pads, ARRAY_SIZE(i2c0_pads));
+}
+
 #ifdef CONFIG_FSL_ESDHC
 struct fsl_esdhc_cfg esdhc_cfg[1] = {
        {ESDHC1_BASE_ADDR},
@@ -315,7 +326,7 @@ static void clock_init(void)
                CCM_CCGR3_ANADIG_CTRL_MASK);
        clrsetbits_le32(&ccm->ccgr4, CCM_REG_CTRL_MASK,
                CCM_CCGR4_WKUP_CTRL_MASK | CCM_CCGR4_CCM_CTRL_MASK |
-               CCM_CCGR4_GPC_CTRL_MASK);
+               CCM_CCGR4_GPC_CTRL_MASK | CCM_CCGR4_I2C0_CTRL_MASK);
        clrsetbits_le32(&ccm->ccgr6, CCM_REG_CTRL_MASK,
                CCM_CCGR6_OCOTP_CTRL_MASK | CCM_CCGR6_DDRMC_CTRL_MASK);
        clrsetbits_le32(&ccm->ccgr7, CCM_REG_CTRL_MASK,
@@ -374,6 +385,7 @@ int board_early_init_f(void)
 
        setup_iomux_uart();
        setup_iomux_enet();
+       setup_iomux_i2c();
 
        return 0;
 }
index a51af03d5d81a86d8e1adf0cd546ecec684cb768..de6b8fbd9b9a0215e108596e8ba09b4bbed6b7df 100644 (file)
@@ -35,7 +35,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 47c4450e3d5bb655e0f3f96df209ce77370bccc7..aabd3a85b72b56e96c506fca5f688da066377b4a 100644 (file)
@@ -298,29 +298,14 @@ int ivm_analyze_eeprom(unsigned char *buf, int len)
 
 int ivm_read_eeprom(void)
 {
-#if defined(CONFIG_I2C_MUX)
-       I2C_MUX_DEVICE *dev = NULL;
-#endif
        uchar i2c_buffer[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
-       uchar   *buf;
-       unsigned long dev_addr = CONFIG_SYS_IVM_EEPROM_ADR;
        int ret;
 
-#if defined(CONFIG_I2C_MUX)
-       /* First init the Bus, select the Bus */
-       buf = (unsigned char *) getenv("EEprom_ivm");
-       if (buf != NULL)
-               dev = i2c_mux_ident_muxstring(buf);
-       if (dev == NULL) {
-               printf("Error couldnt add Bus for IVM\n");
-               return -1;
-       }
-       i2c_set_bus_num(dev->busid);
-#endif
+       i2c_set_bus_num(CONFIG_KM_IVM_BUS);
        /* add deblocking here */
        i2c_make_abort();
 
-       ret = i2c_read(dev_addr, 0, 1, i2c_buffer,
+       ret = i2c_read(CONFIG_SYS_IVM_EEPROM_ADR, 0, 1, i2c_buffer,
                CONFIG_SYS_IVM_EEPROM_MAX_LEN);
        if (ret != 0) {
                printf("Error reading EEprom\n");
index b5ea7ae95b42effa2e12fdfd4cca193c42de9c53..cd861c9f12568e4db34af7852711a29ce0df7960 100644 (file)
@@ -92,19 +92,6 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
        {0,  0, 0, 0, QE_IOP_TAB_END},
 };
 
-static int board_init_i2c_busses(void)
-{
-       I2C_MUX_DEVICE *dev = NULL;
-       uchar *dtt_bus = (uchar *)"pca9547:70:a";
-
-       /* Set up the Bus for the DTTs */
-       dev = i2c_mux_ident_muxstring(dtt_bus);
-       if (dev == NULL)
-               printf("Error couldn't add Bus for DTT\n");
-
-       return 0;
-}
-
 #if defined(CONFIG_SUVD3)
 const uint upma_table[] = {
        0x1ffedc00, 0x0ffcdc80, 0x0ffcdc80, 0x0ffcdc04, /* Words 0 to 3 */
@@ -203,8 +190,6 @@ int board_early_init_r(void)
 
 int misc_init_r(void)
 {
-       /* add board specific i2c busses */
-       board_init_i2c_busses();
        return 0;
 }
 
index e76acc0dacac980e7628bd7c1a425507d5c38e11..481876b2ed8fb92d05ecd18c19c2c289a93a04f4 100644 (file)
@@ -47,7 +47,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
@@ -218,7 +218,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 */
@@ -244,7 +244,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
@@ -424,7 +424,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 fb7e54d5234d9953dcf8bb949a6f636ef2a3be28..225b1ef25827d16a834a34724a783a43e565da43 100644 (file)
@@ -464,7 +464,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 f3562b749bd6376b5290a5fa263f44064fad44f0..97962daf93948773db6b8edaddaf71512d3917e5 100644 (file)
@@ -98,7 +98,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 f39bb3572cf9b8beed26d6198e93446b51d1f0dd..7c7690ff555be6f0319d18ec4c7347fcf38eddff 100644 (file)
@@ -192,7 +192,7 @@ int board_early_init_f (void)
 #endif
 
        /* Read Serial Presence Detect Information */
-       i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(0);
        for (i = 0; i < 128; i++)
                datain[i] = 127;
        i2c_read(SPD_EEPROM_ADDRESS,0,1,datain,128);
index 5f72c02572571f9de61a494cdf35a6ce6f93758b..126e56e97afa6dbc04d879651e89cd28ecf344fe 100644 (file)
@@ -135,7 +135,7 @@ int board_init(void)
 
        power_det_init();
 
-#ifdef CONFIG_TEGRA_I2C
+#ifdef CONFIG_SYS_I2C_TEGRA
 #ifndef CONFIG_SYS_I2C_INIT_BOARD
 #error "You must define CONFIG_SYS_I2C_INIT_BOARD to use i2c on Nvidia boards"
 #endif
@@ -149,7 +149,7 @@ int board_init(void)
                debug("Memory controller init failed: %d\n", err);
 #  endif
 # endif /* CONFIG_TEGRA_PMU */
-#endif /* CONFIG_TEGRA_I2C */
+#endif /* CONFIG_SYS_I2C_TEGRA */
 
 #ifdef CONFIG_USB_EHCI_TEGRA
        pin_mux_usb();
index 109b20dec0c5520bcf8021aa1a3ee48b6fa29d1c..93bb1b46155e42f58c2e3dec0be91672e73677ac 100644 (file)
@@ -153,7 +153,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 26c3683ded17eeefb76416d755af171723510a32..f446543fed1bfd2f8650bb8e1d14d0c8394d9693 100644 (file)
@@ -153,7 +153,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
diff --git a/board/sandburst/common/ppc440gx_i2c.c b/board/sandburst/common/ppc440gx_i2c.c
deleted file mode 100644 (file)
index 1d7f17c..0000000
+++ /dev/null
@@ -1,494 +0,0 @@
-/*
- *  Copyright (C) 2005 Sandburst Corporation
- *
- * SPDX-License-Identifier:    GPL-2.0+ 
- */
-
-/*
- * Ported from arch/powerpc/cpu/ppc4xx/i2c.c by AS HARNOIS by
- * Travis B. Sawyer
- * Sandburst Corporation.
- */
-#include <common.h>
-#include <asm/ppc4xx.h>
-#include <asm/ppc4xx-i2c.h>
-#include <i2c.h>
-#include <command.h>
-#include "ppc440gx_i2c.h"
-#include <asm/io.h>
-
-#ifdef CONFIG_I2C_BUS1
-
-#define IIC_OK         0
-#define IIC_NOK                1
-#define IIC_NOK_LA     2               /* Lost arbitration */
-#define IIC_NOK_ICT    3               /* Incomplete transfer */
-#define IIC_NOK_XFRA   4               /* Transfer aborted */
-#define IIC_NOK_DATA   5               /* No data in buffer */
-#define IIC_NOK_TOUT   6               /* Transfer timeout */
-
-#define IIC_TIMEOUT 1                  /* 1 second */
-#if defined(CONFIG_SYS_I2C_NOPROBES)
-static uchar i2c_no_probes[] = CONFIG_SYS_I2C_NOPROBES;
-#endif
-
-static struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_REGISTERS_BUS1_BASE_ADDRESS;
-
-static void _i2c_bus1_reset (void)
-{
-       int i, status;
-
-       /* Reset status register */
-       /* write 1 in SCMP and IRQA to clear these fields */
-       out_8 (IIC_STS1, 0x0A);
-
-       /* write 1 in IRQP IRQD LA ICT XFRA to clear these fields */
-       out_8 (IIC_EXTSTS1, 0x8F);
-       __asm__ volatile ("eieio");
-
-       /*
-        * Get current state, reset bus
-        * only if no transfers are pending.
-        */
-       i = 10;
-       do {
-               /* Get status */
-               status = in_8 (IIC_STS1);
-               udelay (500);                   /* 500us */
-               i--;
-       } while ((status & IIC_STS_PT) && (i > 0));
-       /* Soft reset controller */
-       status = in_8 (IIC_XTCNTLSS1);
-       out_8 (IIC_XTCNTLSS1, (status | IIC_XTCNTLSS_SRST));
-       __asm__ volatile ("eieio");
-
-       /* make sure where in initial state, data hi, clock hi */
-       out_8 (IIC_DIRECTCNTL1, 0xC);
-       for (i = 0; i < 10; i++) {
-               if ((in_8 (IIC_DIRECTCNTL1) & 0x3) != 0x3) {
-                       /* clock until we get to known state */
-                       out_8 (IIC_DIRECTCNTL1, 0x8);   /* clock lo */
-                       udelay (100);           /* 100us */
-                       out_8 (IIC_DIRECTCNTL1, 0xC);   /* clock hi */
-                       udelay (100);           /* 100us */
-               } else {
-                       break;
-               }
-       }
-       /* send start condition */
-       out_8 (IIC_DIRECTCNTL1, 0x4);
-       udelay (1000);                          /* 1ms */
-       /* send stop condition */
-       out_8 (IIC_DIRECTCNTL1, 0xC);
-       udelay (1000);                          /* 1ms */
-       /* Unreset controller */
-       out_8 (IIC_XTCNTLSS1, (status & ~IIC_XTCNTLSS_SRST));
-       udelay (1000);                          /* 1ms */
-}
-
-void i2c1_init (int speed, int slaveadd)
-{
-       sys_info_t sysInfo;
-       unsigned long freqOPB;
-       int val, divisor;
-
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-       /* call board specific i2c bus reset routine before accessing the   */
-       /* environment, which might be in a chip on that bus. For details   */
-       /* about this problem see doc/I2C_Edge_Conditions.                  */
-       i2c_init_board();
-#endif
-
-       /* Handle possible failed I2C state */
-       /* FIXME: put this into i2c_init_board()? */
-       _i2c_bus1_reset ();
-
-       /* clear lo master address */
-       out_8 (IIC_LMADR1, 0);
-
-       /* clear hi master address */
-       out_8 (IIC_HMADR1, 0);
-
-       /* clear lo slave address */
-       out_8 (IIC_LSADR1, 0);
-
-       /* clear hi slave address */
-       out_8 (IIC_HSADR1, 0);
-
-       /* Clock divide Register */
-       /* get OPB frequency */
-       get_sys_info (&sysInfo);
-       freqOPB = sysInfo.freqPLB / sysInfo.pllOpbDiv;
-       /* set divisor according to freqOPB */
-       divisor = (freqOPB - 1) / 10000000;
-       if (divisor == 0)
-               divisor = 1;
-       out_8 (IIC_CLKDIV1, divisor);
-
-       /* no interrupts */
-       out_8 (IIC_INTRMSK1, 0);
-
-       /* clear transfer count */
-       out_8 (IIC_XFRCNT1, 0);
-
-       /* clear extended control & stat */
-       /* write 1 in SRC SRS SWC SWS to clear these fields */
-       out_8 (IIC_XTCNTLSS1, 0xF0);
-
-       /* Mode Control Register
-          Flush Slave/Master data buffer */
-       out_8 (IIC_MDCNTL1, IIC_MDCNTL_FSDB | IIC_MDCNTL_FMDB);
-       __asm__ volatile ("eieio");
-
-
-       val = in_8(IIC_MDCNTL1);
-       __asm__ volatile ("eieio");
-
-       /* Ignore General Call, slave transfers are ignored,
-          disable interrupts, exit unknown bus state, enable hold
-          SCL
-          100kHz normaly or FastMode for 400kHz and above
-       */
-
-       val |= IIC_MDCNTL_EUBS|IIC_MDCNTL_HSCL;
-       if( speed >= 400000 ){
-               val |= IIC_MDCNTL_FSM;
-       }
-       out_8 (IIC_MDCNTL1, val);
-
-       /* clear control reg */
-       out_8 (IIC_CNTL1, 0x00);
-       __asm__ volatile ("eieio");
-
-}
-
-/*
-  This code tries to use the features of the 405GP i2c
-  controller. It will transfer up to 4 bytes in one pass
-  on the loop. It only does out_8(lbz) to the buffer when it
-  is possible to do out16(lhz) transfers.
-
-  cmd_type is 0 for write 1 for read.
-
-  addr_len can take any value from 0-255, it is only limited
-  by the char, we could make it larger if needed. If it is
-  0 we skip the address write cycle.
-
-  Typical case is a Write of an addr followd by a Read. The
-  IBM FAQ does not cover this. On the last byte of the write
-  we don't set the creg CHT bit, and on the first bytes of the
-  read we set the RPST bit.
-
-  It does not support address only transfers, there must be
-  a data part. If you want to write the address yourself, put
-  it in the data pointer.
-
-  It does not support transfer to/from address 0.
-
-  It does not check XFRCNT.
-*/
-static
-int i2c_transfer1(unsigned char cmd_type,
-                 unsigned char chip,
-                 unsigned char addr[],
-                 unsigned char addr_len,
-                 unsigned char data[],
-                 unsigned short data_len )
-{
-       unsigned char* ptr;
-       int reading;
-       int tran,cnt;
-       int result;
-       int status;
-       int i;
-       uchar creg;
-
-       if( data == 0 || data_len == 0 ){
-               /*Don't support data transfer of no length or to address 0*/
-               printf( "i2c_transfer: bad call\n" );
-               return IIC_NOK;
-       }
-       if( addr && addr_len ){
-               ptr = addr;
-               cnt = addr_len;
-               reading = 0;
-       }else{
-               ptr = data;
-               cnt = data_len;
-               reading = cmd_type;
-       }
-
-       /*Clear Stop Complete Bit*/
-       out_8(IIC_STS1,IIC_STS_SCMP);
-       /* Check init */
-       i=10;
-       do {
-               /* Get status */
-               status = in_8(IIC_STS1);
-               __asm__ volatile("eieio");
-               i--;
-       } while ((status & IIC_STS_PT) && (i>0));
-
-       if (status & IIC_STS_PT) {
-               result = IIC_NOK_TOUT;
-               return(result);
-       }
-       /*flush the Master/Slave Databuffers*/
-       out_8(IIC_MDCNTL1, ((in_8(IIC_MDCNTL1))|IIC_MDCNTL_FMDB|IIC_MDCNTL_FSDB));
-       /*need to wait 4 OPB clocks? code below should take that long*/
-
-       /* 7-bit adressing */
-       out_8(IIC_HMADR1,0);
-       out_8(IIC_LMADR1, chip);
-       __asm__ volatile("eieio");
-
-       tran = 0;
-       result = IIC_OK;
-       creg = 0;
-
-       while ( tran != cnt && (result == IIC_OK)) {
-               int  bc,j;
-
-               /* Control register =
-                  Normal transfer, 7-bits adressing, Transfer up to bc bytes, Normal start,
-                  Transfer is a sequence of transfers
-               */
-               creg |= IIC_CNTL_PT;
-
-               bc = (cnt - tran) > 4 ? 4 :
-                       cnt - tran;
-               creg |= (bc-1)<<4;
-               /* if the real cmd type is write continue trans*/
-               if ( (!cmd_type && (ptr == addr)) || ((tran+bc) != cnt) )
-                       creg |= IIC_CNTL_CHT;
-
-               if (reading)
-                       creg |= IIC_CNTL_READ;
-               else {
-                       for(j=0; j<bc; j++) {
-                               /* Set buffer */
-                               out_8(IIC_MDBUF1,ptr[tran+j]);
-                               __asm__ volatile("eieio");
-                       }
-               }
-               out_8(IIC_CNTL1, creg );
-               __asm__ volatile("eieio");
-
-               /* Transfer is in progress
-                  we have to wait for upto 5 bytes of data
-                  1 byte chip address+r/w bit then bc bytes
-                  of data.
-                  udelay(10) is 1 bit time at 100khz
-                  Doubled for slop. 20 is too small.
-               */
-               i=2*5*8;
-               do {
-                       /* Get status */
-                       status = in_8(IIC_STS1);
-                       __asm__ volatile("eieio");
-                       udelay (10);
-                       i--;
-               } while ((status & IIC_STS_PT) && !(status & IIC_STS_ERR)
-                        && (i>0));
-
-               if (status & IIC_STS_ERR) {
-                       result = IIC_NOK;
-                       status = in_8 (IIC_EXTSTS1);
-                       /* Lost arbitration? */
-                       if (status & IIC_EXTSTS_LA)
-                               result = IIC_NOK_LA;
-                       /* Incomplete transfer? */
-                       if (status & IIC_EXTSTS_ICT)
-                               result = IIC_NOK_ICT;
-                       /* Transfer aborted? */
-                       if (status & IIC_EXTSTS_XFRA)
-                               result = IIC_NOK_XFRA;
-               } else if ( status & IIC_STS_PT) {
-                       result = IIC_NOK_TOUT;
-               }
-               /* Command is reading => get buffer */
-               if ((reading) && (result == IIC_OK)) {
-                       /* Are there data in buffer */
-                       if (status & IIC_STS_MDBS) {
-                               /*
-                                 even if we have data we have to wait 4OPB clocks
-                                 for it to hit the front of the FIFO, after that
-                                 we can just read. We should check XFCNT here and
-                                 if the FIFO is full there is no need to wait.
-                               */
-                               udelay (1);
-                               for(j=0;j<bc;j++) {
-                                       ptr[tran+j] = in_8(IIC_MDBUF1);
-                                       __asm__ volatile("eieio");
-                               }
-                       } else
-                               result = IIC_NOK_DATA;
-               }
-               creg = 0;
-               tran+=bc;
-               if( ptr == addr && tran == cnt ) {
-                       ptr = data;
-                       cnt = data_len;
-                       tran = 0;
-                       reading = cmd_type;
-                       if( reading )
-                               creg = IIC_CNTL_RPST;
-               }
-       }
-       return (result);
-}
-
-int i2c_probe1 (uchar chip)
-{
-       uchar buf[1];
-
-       buf[0] = 0;
-
-       /*
-        * What is needed is to send the chip address and verify that the
-        * address was <ACK>ed (i.e. there was a chip at that address which
-        * drove the data line low).
-        */
-       return(i2c_transfer1 (1, chip << 1, 0,0, buf, 1) != 0);
-}
-
-
-int i2c_read1 (uchar chip, uint addr, int alen, uchar * buffer, int len)
-{
-       uchar xaddr[4];
-       int ret;
-
-       if ( alen > 4 ) {
-               printf ("I2C read: addr len %d not supported\n", alen);
-               return 1;
-       }
-
-       if ( alen > 0 ) {
-               xaddr[0] = (addr >> 24) & 0xFF;
-               xaddr[1] = (addr >> 16) & 0xFF;
-               xaddr[2] = (addr >> 8) & 0xFF;
-               xaddr[3] = addr & 0xFF;
-       }
-
-
-#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
-       /*
-        * EEPROM chips that implement "address overflow" are ones
-        * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
-        * address and the extra bits end up in the "chip address"
-        * bit slots. This makes a 24WC08 (1Kbyte) chip look like
-        * four 256 byte chips.
-        *
-        * Note that we consider the length of the address field to
-        * still be one byte because the extra address bits are
-        * hidden in the chip address.
-        */
-       if( alen > 0 )
-               chip |= ((addr >> (alen * 8)) & CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
-#endif
-       if( (ret = i2c_transfer1( 1, chip<<1, &xaddr[4-alen], alen, buffer, len )) != 0) {
-               printf( "I2c read: failed %d\n", ret);
-               return 1;
-       }
-       return 0;
-}
-
-int i2c_write1 (uchar chip, uint addr, int alen, uchar * buffer, int len)
-{
-       uchar xaddr[4];
-
-       if ( alen > 4 ) {
-               printf ("I2C write: addr len %d not supported\n", alen);
-               return 1;
-
-       }
-       if ( alen > 0 ) {
-               xaddr[0] = (addr >> 24) & 0xFF;
-               xaddr[1] = (addr >> 16) & 0xFF;
-               xaddr[2] = (addr >> 8) & 0xFF;
-               xaddr[3] = addr & 0xFF;
-       }
-
-#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
-       /*
-        * EEPROM chips that implement "address overflow" are ones
-        * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
-        * address and the extra bits end up in the "chip address"
-        * bit slots. This makes a 24WC08 (1Kbyte) chip look like
-        * four 256 byte chips.
-        *
-        * Note that we consider the length of the address field to
-        * still be one byte because the extra address bits are
-        * hidden in the chip address.
-        */
-       if( alen > 0 )
-               chip |= ((addr >> (alen * 8)) & CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
-#endif
-
-       return (i2c_transfer1( 0, chip<<1, &xaddr[4-alen], alen, buffer, len ) != 0);
-}
-
-/*-----------------------------------------------------------------------
- * Read a register
- */
-uchar i2c_reg_read1(uchar i2c_addr, uchar reg)
-{
-       uchar buf;
-
-       i2c_read1(i2c_addr, reg, 1, &buf, (uchar)1);
-
-       return(buf);
-}
-
-/*-----------------------------------------------------------------------
- * Write a register
- */
-void i2c_reg_write1(uchar i2c_addr, uchar reg, uchar val)
-{
-       i2c_write1(i2c_addr, reg, 1, &val, 1);
-}
-
-
-int do_i2c1_probe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       int j;
-#if defined(CONFIG_SYS_I2C_NOPROBES)
-       int k, skip;
-#endif
-
-       puts ("Valid chip addresses:");
-       for(j = 0; j < 128; j++) {
-#if defined(CONFIG_SYS_I2C_NOPROBES)
-               skip = 0;
-               for (k = 0; k < sizeof(i2c_no_probes); k++){
-                       if (j == i2c_no_probes[k]){
-                               skip = 1;
-                               break;
-                       }
-               }
-               if (skip)
-                       continue;
-#endif
-               if(i2c_probe1(j) == 0) {
-                       printf(" %02X", j);
-               }
-       }
-       putc ('\n');
-
-#if defined(CONFIG_SYS_I2C_NOPROBES)
-       puts ("Excluded chip addresses:");
-       for( k = 0; k < sizeof(i2c_no_probes); k++ )
-               printf(" %02X", i2c_no_probes[k] );
-       putc ('\n');
-#endif
-
-       return 0;
-}
-
-U_BOOT_CMD(
-       iprobe1,        1,      1,      do_i2c1_probe,
-       "probe to discover valid I2C chip addresses",
-       ""
-);
-
-#endif /* CONFIG_I2C_BUS1 */
diff --git a/board/sandburst/common/ppc440gx_i2c.h b/board/sandburst/common/ppc440gx_i2c.h
deleted file mode 100644 (file)
index b1179bc..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *  Copyright (C) 2005 Sandburst Corporation
- *
- * SPDX-License-Identifier:    GPL-2.0+ 
- */
-
-/*
- * Ported from i2c driver for ppc4xx by AS HARNOIS by
- * Travis B. Sawyer
- * Sandburst Corporation
- */
-#include <common.h>
-#include <asm/ppc4xx.h>
-#include <asm/ppc4xx-i2c.h>
-#include <i2c.h>
-
-#ifdef CONFIG_HARD_I2C
-
-#define I2C_BUS1_BASE_ADDR (CONFIG_SYS_PERIPHERAL_BASE + 0x00000500)
-#define           I2C_REGISTERS_BUS1_BASE_ADDRESS I2C_BUS1_BASE_ADDR
-#define    IIC_MDBUF1  (&i2c->mdbuf)
-#define    IIC_SDBUF1  (&i2c->sdbuf)
-#define    IIC_LMADR1  (&i2c->lmadr)
-#define    IIC_HMADR1  (&i2c->hmadr)
-#define    IIC_CNTL1   (&i2c->cntl)
-#define    IIC_MDCNTL1 (&i2c->mdcntl)
-#define    IIC_STS1    (&i2c->sts)
-#define    IIC_EXTSTS1 (&i2c->extsts)
-#define    IIC_LSADR1  (&i2c->lsadr)
-#define    IIC_HSADR1  (&i2c->hsadr)
-#define    IIC_CLKDIV1 (&i2c->clkdiv)
-#define    IIC_INTRMSK1        (&i2c->intrmsk)
-#define    IIC_XFRCNT1 (&i2c->xfrcnt)
-#define    IIC_XTCNTLSS1       (&i2c->xtcntlss)
-#define    IIC_DIRECTCNTL1 (&i2c->directcntl)
-
-void i2c1_init (int speed, int slaveadd);
-int i2c_probe1 (uchar chip);
-int i2c_read1 (uchar chip, uint addr, int alen, uchar * buffer, int len);
-int i2c_write1 (uchar chip, uint addr, int alen, uchar * buffer, int len);
-uchar i2c_reg_read1(uchar i2c_addr, uchar reg);
-void i2c_reg_write1(uchar i2c_addr, uchar reg, uchar val);
-
-#endif /* CONFIG_HARD_I2C */
index 12334dfdd1755503c8940813295d2af007438b65..b579812ccf667aff7f223b979399727f350eba3f 100644 (file)
@@ -10,7 +10,6 @@
 #include <asm/io.h>
 #include <spd_sdram.h>
 #include <i2c.h>
-#include "ppc440gx_i2c.h"
 #include "sb_common.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -68,7 +67,7 @@ unsigned short sbcommon_get_serial_number(void)
 
        /* Get the board serial number from eeprom */
        /* Initialize I2C */
-       i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(0);
 
        /* Read 256 bytes in EEPROM */
        i2c_read (0x50, 0, 1, buff, 0x100);
@@ -94,85 +93,87 @@ void sbcommon_fans(void)
         * Attempt to turn on 2 of the fans...
         * Need to go through the bridge
         */
+       i2c_set_bus_num(1);
        puts ("FANS:  ");
 
        /* select fan4 through the bridge */
-       i2c_reg_write1(0x73, /* addr */
-                      0x00, /* reg */
-                      0x08); /* val = bus 4 */
+       i2c_reg_write(0x73, /* addr */
+                     0x00, /* reg */
+                     0x08); /* val = bus 4 */
 
        /* Turn on FAN 4 */
-       i2c_reg_write1(0x2e,
-                      1,
-                      0x80);
+       i2c_reg_write(0x2e,
+                     1,
+                     0x80);
 
-       i2c_reg_write1(0x2e,
-                      0,
-                      0x19);
+       i2c_reg_write(0x2e,
+                     0,
+                     0x19);
 
        /* Deselect bus 4 on the bridge */
-       i2c_reg_write1(0x73,
-                      0x00,
-                      0x00);
+       i2c_reg_write(0x73,
+                     0x00,
+                     0x00);
 
        /* select fan3 through the bridge */
-       i2c_reg_write1(0x73, /* addr */
-                      0x00, /* reg */
-                      0x04); /* val = bus 3 */
+       i2c_reg_write(0x73, /* addr */
+                     0x00, /* reg */
+                     0x04); /* val = bus 3 */
 
        /* Turn on FAN 3 */
-       i2c_reg_write1(0x2e,
-                      1,
-                      0x80);
+       i2c_reg_write(0x2e,
+                     1,
+                     0x80);
 
-       i2c_reg_write1(0x2e,
-                      0,
-                      0x19);
+       i2c_reg_write(0x2e,
+                     0,
+                     0x19);
 
        /* Deselect bus 3 on the bridge */
-       i2c_reg_write1(0x73,
-                      0x00,
-                      0x00);
+       i2c_reg_write(0x73,
+                     0x00,
+                     0x00);
 
        /* select fan2 through the bridge */
-       i2c_reg_write1(0x73, /* addr */
-                      0x00, /* reg */
-                      0x02); /* val = bus 4 */
+       i2c_reg_write(0x73, /* addr */
+                     0x00, /* reg */
+                     0x02); /* val = bus 4 */
 
        /* Turn on FAN 2 */
-       i2c_reg_write1(0x2e,
-                      1,
-                      0x80);
+       i2c_reg_write(0x2e,
+                     1,
+                     0x80);
 
-       i2c_reg_write1(0x2e,
-                      0,
-                      0x19);
+       i2c_reg_write(0x2e,
+                     0,
+                     0x19);
 
        /* Deselect bus 2 on the bridge */
-       i2c_reg_write1(0x73,
-                      0x00,
-                      0x00);
+       i2c_reg_write(0x73,
+                     0x00,
+                     0x00);
 
        /* select fan1 through the bridge */
-       i2c_reg_write1(0x73, /* addr */
-                      0x00, /* reg */
-                      0x01); /* val = bus 0 */
+       i2c_reg_write(0x73, /* addr */
+                     0x00, /* reg */
+                     0x01); /* val = bus 0 */
 
        /* Turn on FAN 1 */
-       i2c_reg_write1(0x2e,
-                      1,
-                      0x80);
+       i2c_reg_write(0x2e,
+                     1,
+                     0x80);
 
-       i2c_reg_write1(0x2e,
-                      0,
-                      0x19);
+       i2c_reg_write(0x2e,
+                     0,
+                     0x19);
 
        /* Deselect bus 1 on the bridge */
-       i2c_reg_write1(0x73,
-                      0x00,
-                      0x00);
+       i2c_reg_write(0x73,
+                     0x00,
+                     0x00);
 
        puts ("on\n");
+       i2c_set_bus_num(0);
 
        return;
 
@@ -303,7 +304,7 @@ void board_get_enetaddr(int macaddr_idx, uchar *enet)
        if (0 == macaddr_idx) {
 
                /* Initialize I2C */
-               i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+               i2c_set_bus_num(0);
 
                /* Read 256 bytes in EEPROM */
                i2c_read (0x50, 0, 1, buff, 0x100);
index c86061c41474150c3d4d43914fb541d94f5f2cba..8716eacd84ad00508d802b301b683b5c352dd9c4 100644 (file)
@@ -12,7 +12,6 @@
 #include <asm/io.h>
 #include <spd_sdram.h>
 #include <i2c.h>
-#include "ppc440gx_i2c.h"
 
 /*
  * GPIO Settings
index 9cceb47806160aec2abc17ff7721088d7d618b11..af758f947ef55c7dd7a9c660d7faeab650f099a6 100644 (file)
@@ -24,8 +24,7 @@ CFLAGS += -DBUILDUSER='"$(BUILDUSER)"'
 
 LIB    = $(obj)lib$(BOARD).o
 
-COBJS  = $(BOARD).o ../common/flash.o ../common/ppc440gx_i2c.o \
-       ../common/sb_common.o
+COBJS  = $(BOARD).o ../common/flash.o ../common/sb_common.o
 
 SOBJS  = init.o
 
index 93681c187136e7d72308689470450a44fd9208e5..683d68b9337c95aa8b5e2c58e37bae05380c1928 100644 (file)
@@ -16,7 +16,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>
@@ -322,11 +321,6 @@ int checkboard (void)
  ************************************************************************/
 int misc_init_f (void)
 {
-       /* Turn on i2c bus 1 */
-       puts ("I2C1:  ");
-       i2c1_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-       puts ("ready\n");
-
        /* Turn on fans 3 & 4 */
        sbcommon_fans();
 
index 4dbd6ed3142f31a679ea6c6d8140ac3e52d5e078..163f2b98da637a4b7c8d9f02a043ae5f501bd358 100644 (file)
@@ -23,8 +23,7 @@ CFLAGS += -DBUILDUSER='"$(BUILDUSER)"'
 
 LIB    = $(obj)lib$(BOARD).o
 
-COBJS  = $(BOARD).o ../common/flash.o ../common/ppc440gx_i2c.o \
-       ../common/sb_common.o
+COBJS  = $(BOARD).o ../common/flash.o ../common/sb_common.o
 SOBJS  = init.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
index 8d5079619ed5395a8f1e6e58e951349c99d90e0b..5bc7f2f4332819d88932fc6e9f557199c025a4f2 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/io.h>
 #include <spd_sdram.h>
 #include <i2c.h>
-#include "../common/ppc440gx_i2c.h"
 #include "../common/sb_common.h"
 #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) || \
     defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
@@ -289,11 +288,6 @@ int checkboard (void)
  ************************************************************************/
 int misc_init_f (void)
 {
-       /* Turn on i2c bus 1 */
-       puts ("I2C1:  ");
-       i2c1_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-       puts ("ready\n");
-
        /* Turn on fans */
        sbcommon_fans();
 
index 669e99ddde0709fd2390b9916d218b429a8d6a03..c361f188f79e55d027bb029ef9ea49315af9281a 100644 (file)
@@ -144,7 +144,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 b9dd4fa6b780f38e9e17c91598accdc9714dcb46..334fd6d74b3852b7f86d6d3f433b894e0779596c 100644 (file)
@@ -164,7 +164,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 fbdbff68de16b8d169438e8ef8ca0cf7e3e99fff..2205d51b06a093964a5237535a7518fe627c48d0 100644 (file)
@@ -34,4 +34,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 3f8766bd7234e8b2c914a62cf0738b8e375dcf42..0ada1afe16b220f1080146fa196120d4e7b3e8a3 100644 (file)
@@ -245,7 +245,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)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
 static int init_func_i2c(void)
 {
        puts("I2C:   ");
@@ -903,7 +903,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)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
        init_func_i2c,
 #endif
 #if defined(CONFIG_HARD_SPI)
index f0e66862ff887bf74d675d3f0756f5e96ea10fca..e3491662bc5819bc837545d9ed953ff21937ad0c 100644 (file)
@@ -34,8 +34,13 @@ static int do_date(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        int old_bus;
 
        /* switch to correct I2C bus */
+#ifdef CONFIG_SYS_I2C
+       old_bus = i2c_get_bus_num();
+       i2c_set_bus_num(CONFIG_SYS_RTC_BUS_NUM);
+#else
        old_bus = I2C_GET_BUS();
        I2C_SET_BUS(CONFIG_SYS_RTC_BUS_NUM);
+#endif
 
        switch (argc) {
        case 2:                 /* set date & time */
@@ -81,7 +86,11 @@ static int do_date(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 
        /* switch back to original I2C bus */
+#ifdef CONFIG_SYS_I2C
+       i2c_set_bus_num(old_bus);
+#else
        I2C_SET_BUS(old_bus);
+#endif
 
        return rcode;
 }
index dc57744f8981b82e41c0eaa161ce6584089c0717..7257f10fb17c61c116f400840a19dbb7c85c5779 100644 (file)
@@ -57,8 +57,13 @@ int dtt_i2c(void)
        /* Force a compilation error, if there are more then 32 sensors */
        BUILD_BUG_ON(sizeof(sensors) > 32);
        /* switch to correct I2C bus */
+#ifdef CONFIG_SYS_I2C
+       old_bus = i2c_get_bus_num();
+       i2c_set_bus_num(CONFIG_SYS_DTT_BUS_NUM);
+#else
        old_bus = I2C_GET_BUS();
        I2C_SET_BUS(CONFIG_SYS_DTT_BUS_NUM);
+#endif
 
        _initialize_dtt();
 
@@ -70,7 +75,11 @@ int dtt_i2c(void)
                printf("DTT%d: %i C\n", i + 1, dtt_get_temp(sensors[i]));
 
        /* switch back to original I2C bus */
+#ifdef CONFIG_SYS_I2C
+       i2c_set_bus_num(old_bus);
+#else
        I2C_SET_BUS(old_bus);
+#endif
 #endif
 
        return 0;
index 13976363514ed5a9795d0bec0c91527bf110409a..ef694d8f87e1fb8fe145f3f057ab1c9b9bdba628 100644 (file)
@@ -389,8 +389,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 1703ab41ac0cb7f98b189b4e596eb04406b0dc1e..29f5181baf8238aefa01c1df923d5e0dd5530b8e 100644 (file)
@@ -1,4 +1,9 @@
 /*
+ * (C) Copyright 2009
+ * Sergey Kubushyn, himself, ksi@koi8.net
+ *
+ * Changes for unified multibus/multiadapter I2C support.
+ *
  * (C) Copyright 2001
  * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com.
  *
@@ -69,6 +74,8 @@
 #include <asm/byteorder.h>
 #include <linux/compiler.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Display values from last command.
  * Memory modify remembered values are different from display memory.
  */
@@ -87,7 +94,7 @@ static uint   i2c_mm_last_alen;
  * pairs.  The following macros take care of this */
 
 #if defined(CONFIG_SYS_I2C_NOPROBES)
-#if defined(CONFIG_I2C_MULTI_BUS)
+#if defined(CONFIG_SYS_I2C) || defined(CONFIG_I2C_MULTI_BUS)
 static struct
 {
        uchar   bus;
@@ -103,17 +110,7 @@ static uchar i2c_no_probes[] = CONFIG_SYS_I2C_NOPROBES;
 #define COMPARE_BUS(b,i)       ((b) == 0)      /* Make compiler happy */
 #define COMPARE_ADDR(a,i)      (i2c_no_probes[(i)] == (a))
 #define NO_PROBE_ADDR(i)       i2c_no_probes[(i)]
-#endif /* CONFIG_MULTI_BUS */
-
-#define NUM_ELEMENTS_NOPROBE (sizeof(i2c_no_probes)/sizeof(i2c_no_probes[0]))
-#endif
-
-#if defined(CONFIG_I2C_MUX)
-static I2C_MUX_DEVICE  *i2c_mux_devices = NULL;
-static int     i2c_mux_busid = CONFIG_SYS_MAX_I2C_BUS;
-
-DECLARE_GLOBAL_DATA_PTR;
-
+#endif /* defined(CONFIG_SYS_I2C) */
 #endif
 
 #define DISP_LINE_LEN  16
@@ -128,7 +125,6 @@ DECLARE_GLOBAL_DATA_PTR;
 __weak
 void i2c_init_board(void)
 {
-       return;
 }
 
 /* TODO: Implement architecture-specific get/set functions */
@@ -145,6 +141,11 @@ void i2c_init_board(void)
  *
  * Returns I2C bus speed in Hz.
  */
+#if !defined(CONFIG_SYS_I2C)
+/*
+ * TODO: Implement architecture-specific get/set functions
+ * Should go away, if we switched completely to new multibus support
+ */
 __weak
 unsigned int i2c_get_bus_speed(void)
 {
@@ -172,6 +173,7 @@ int i2c_set_bus_speed(unsigned int speed)
 
        return 0;
 }
+#endif
 
 /**
  * get_alen() - Small parser helper function to get address length
@@ -684,7 +686,7 @@ static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
        int found = 0;
 #if defined(CONFIG_SYS_I2C_NOPROBES)
        int k, skip;
-       uchar bus = GET_BUS_NUM;
+       unsigned int bus = GET_BUS_NUM;
 #endif /* NOPROBES */
 
        if (argc == 2)
@@ -697,7 +699,7 @@ static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
 
 #if defined(CONFIG_SYS_I2C_NOPROBES)
                skip = 0;
-               for (k=0; k < NUM_ELEMENTS_NOPROBE; k++) {
+               for (k = 0; k < ARRAY_SIZE(i2c_no_probes); k++) {
                        if (COMPARE_BUS(bus, k) && COMPARE_ADDR(j, k)) {
                                skip = 1;
                                break;
@@ -715,7 +717,7 @@ static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
 
 #if defined(CONFIG_SYS_I2C_NOPROBES)
        puts ("Excluded chip addresses:");
-       for (k=0; k < NUM_ELEMENTS_NOPROBE; k++) {
+       for (k = 0; k < ARRAY_SIZE(i2c_no_probes); k++) {
                if (COMPARE_BUS(bus,k))
                        printf(" %02X", NO_PROBE_ADDR(k));
        }
@@ -1357,9 +1359,8 @@ int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 }
 #endif /* CONFIG_I2C_EDID */
 
-#if defined(CONFIG_I2C_MUX)
 /**
- * do_i2c_add_bus() - Handle the "i2c bus" command-line command
+ * do_i2c_show_bus() - Handle the "i2c bus" command-line command
  * @cmdtp:     Command data struct pointer
  * @flag:      Command flag
  * @argc:      Command-line argument count
@@ -1367,35 +1368,55 @@ int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
  *
  * Returns zero always.
  */
-static int do_i2c_add_bus(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+#if defined(CONFIG_SYS_I2C)
+int do_i2c_show_bus(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       int ret=0;
+       int     i;
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+       int     j;
+#endif
 
        if (argc == 1) {
                /* show all busses */
-               I2C_MUX         *mux;
-               I2C_MUX_DEVICE  *device = i2c_mux_devices;
-
-               printf ("Busses reached over muxes:\n");
-               while (device != NULL) {
-                       printf ("Bus ID: %x\n", device->busid);
-                       printf ("  reached over Mux(es):\n");
-                       mux = device->mux;
-                       while (mux != NULL) {
-                               printf ("    %s@%x ch: %x\n", mux->name, mux->chip, mux->channel);
-                               mux = mux->next;
+               for (i = 0; i < CONFIG_SYS_NUM_I2C_BUSES; i++) {
+                       printf("Bus %d:\t%s", i, I2C_ADAP_NR(i)->name);
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+                       for (j = 0; j < CONFIG_SYS_I2C_MAX_HOPS; j++) {
+                               if (i2c_bus[i].next_hop[j].chip == 0)
+                                       break;
+                               printf("->%s@0x%2x:%d",
+                                      i2c_bus[i].next_hop[j].mux.name,
+                                      i2c_bus[i].next_hop[j].chip,
+                                      i2c_bus[i].next_hop[j].channel);
                        }
-                       device = device->next;
+#endif
+                       printf("\n");
                }
        } else {
-               (void)i2c_mux_ident_muxstring ((uchar *)argv[1]);
-               ret = 0;
+               /* show specific bus */
+               i = simple_strtoul(argv[1], NULL, 10);
+               if (i >= CONFIG_SYS_NUM_I2C_BUSES) {
+                       printf("Invalid bus %d\n", i);
+                       return -1;
+               }
+               printf("Bus %d:\t%s", i, I2C_ADAP_NR(i)->name);
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+                       for (j = 0; j < CONFIG_SYS_I2C_MAX_HOPS; j++) {
+                               if (i2c_bus[i].next_hop[j].chip == 0)
+                                       break;
+                               printf("->%s@0x%2x:%d",
+                                      i2c_bus[i].next_hop[j].mux.name,
+                                      i2c_bus[i].next_hop[j].chip,
+                                      i2c_bus[i].next_hop[j].channel);
+                       }
+#endif
+               printf("\n");
        }
-       return ret;
+
+       return 0;
 }
-#endif  /* CONFIG_I2C_MUX */
+#endif
 
-#if defined(CONFIG_I2C_MULTI_BUS)
 /**
  * do_i2c_bus_num() - Handle the "i2c dev" command-line command
  * @cmdtp:     Command data struct pointer
@@ -1406,23 +1427,29 @@ static int do_i2c_add_bus(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
  * Returns zero on success, CMD_RET_USAGE in case of misuse and negative
  * on error.
  */
-static int do_i2c_bus_num(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+#if defined(CONFIG_SYS_I2C) || defined(CONFIG_I2C_MULTI_BUS)
+int do_i2c_bus_num(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       int bus_idx, ret=0;
+       int             ret = 0;
+       unsigned int    bus_no;
 
        if (argc == 1)
                /* querying current setting */
                printf("Current bus is %d\n", i2c_get_bus_num());
        else {
-               bus_idx = simple_strtoul(argv[1], NULL, 10);
-               printf("Setting bus to %d\n", bus_idx);
-               ret = i2c_set_bus_num(bus_idx);
+               bus_no = simple_strtoul(argv[1], NULL, 10);
+               if (bus_no >= CONFIG_SYS_NUM_I2C_BUSES) {
+                       printf("Invalid bus %d\n", bus_no);
+                       return -1;
+               }
+               printf("Setting bus to %d\n", bus_no);
+               ret = i2c_set_bus_num(bus_no);
                if (ret)
                        printf("Failure changing bus number (%d)\n", ret);
        }
        return ret;
 }
-#endif  /* CONFIG_I2C_MULTI_BUS */
+#endif  /* defined(CONFIG_SYS_I2C) */
 
 /**
  * do_i2c_bus_speed() - Handle the "i2c speed" command-line command
@@ -1492,16 +1519,21 @@ static int do_i2c_nm(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
  */
 static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
+#if defined(CONFIG_SYS_I2C)
+       i2c_init(I2C_ADAP->speed, I2C_ADAP->slaveaddr);
+#else
        i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
        return 0;
 }
 
 static cmd_tbl_t cmd_i2c_sub[] = {
-#if defined(CONFIG_I2C_MUX)
-       U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_add_bus, "", ""),
-#endif  /* CONFIG_I2C_MUX */
+#if defined(CONFIG_SYS_I2C)
+       U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_show_bus, "", ""),
+#endif
        U_BOOT_CMD_MKENT(crc32, 3, 1, do_i2c_crc, "", ""),
-#if defined(CONFIG_I2C_MULTI_BUS)
+#if defined(CONFIG_SYS_I2C) || \
+       defined(CONFIG_I2C_MULTI_BUS)
        U_BOOT_CMD_MKENT(dev, 1, 1, do_i2c_bus_num, "", ""),
 #endif  /* CONFIG_I2C_MULTI_BUS */
 #if defined(CONFIG_I2C_EDID)
@@ -1560,11 +1592,12 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 /***************************************************/
 #ifdef CONFIG_SYS_LONGHELP
 static char i2c_help_text[] =
-#if defined(CONFIG_I2C_MUX)
-       "bus [muxtype:muxaddr:muxchannel] - add a new bus reached over muxes\ni2c "
-#endif  /* CONFIG_I2C_MUX */
+#if defined(CONFIG_SYS_I2C)
+       "bus [muxtype:muxaddr:muxchannel] - show I2C bus info\n"
+#endif
        "crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n"
-#if defined(CONFIG_I2C_MULTI_BUS)
+#if defined(CONFIG_SYS_I2C) || \
+       defined(CONFIG_I2C_MULTI_BUS)
        "i2c dev [dev] - show or set current I2C bus\n"
 #endif  /* CONFIG_I2C_MULTI_BUS */
 #if defined(CONFIG_I2C_EDID)
@@ -1590,225 +1623,3 @@ U_BOOT_CMD(
        "I2C sub-system",
        i2c_help_text
 );
-
-#if defined(CONFIG_I2C_MUX)
-static int i2c_mux_add_device(I2C_MUX_DEVICE *dev)
-{
-       I2C_MUX_DEVICE  *devtmp = i2c_mux_devices;
-
-       if (i2c_mux_devices == NULL) {
-               i2c_mux_devices = dev;
-               return 0;
-       }
-       while (devtmp->next != NULL)
-               devtmp = devtmp->next;
-
-       devtmp->next = dev;
-       return 0;
-}
-
-I2C_MUX_DEVICE *i2c_mux_search_device(int id)
-{
-       I2C_MUX_DEVICE  *device = i2c_mux_devices;
-
-       while (device != NULL) {
-               if (device->busid == id)
-                       return device;
-               device = device->next;
-       }
-       return NULL;
-}
-
-/* searches in the buf from *pos the next ':'.
- * returns:
- *     0 if found (with *pos = where)
- *   < 0 if an error occured
- *   > 0 if the end of buf is reached
- */
-static int i2c_mux_search_next (int *pos, uchar        *buf, int len)
-{
-       while ((buf[*pos] != ':') && (*pos < len)) {
-               *pos += 1;
-       }
-       if (*pos >= len)
-               return 1;
-       if (buf[*pos] != ':')
-               return -1;
-       return 0;
-}
-
-static int i2c_mux_get_busid (void)
-{
-       int     tmp = i2c_mux_busid;
-
-       i2c_mux_busid ++;
-       return tmp;
-}
-
-/* Analyses a Muxstring and immediately sends the
-   commands to the muxes. Runs from flash.
- */
-int i2c_mux_ident_muxstring_f (uchar *buf)
-{
-       int     pos = 0;
-       int     oldpos;
-       int     ret = 0;
-       int     len = strlen((char *)buf);
-       int     chip;
-       uchar   channel;
-       int     was = 0;
-
-       while (ret == 0) {
-               oldpos = pos;
-               /* search name */
-               ret = i2c_mux_search_next(&pos, buf, len);
-               if (ret != 0)
-                       printf ("ERROR\n");
-               /* search address */
-               pos ++;
-               oldpos = pos;
-               ret = i2c_mux_search_next(&pos, buf, len);
-               if (ret != 0)
-                       printf ("ERROR\n");
-               buf[pos] = 0;
-               chip = simple_strtoul((char *)&buf[oldpos], NULL, 16);
-               buf[pos] = ':';
-               /* search channel */
-               pos ++;
-               oldpos = pos;
-               ret = i2c_mux_search_next(&pos, buf, len);
-               if (ret < 0)
-                       printf ("ERROR\n");
-               was = 0;
-               if (buf[pos] != 0) {
-                       buf[pos] = 0;
-                       was = 1;
-               }
-               channel = simple_strtoul((char *)&buf[oldpos], NULL, 16);
-               if (was)
-                       buf[pos] = ':';
-               if (i2c_write(chip, 0, 0, &channel, 1) != 0) {
-                       printf ("Error setting Mux: chip:%x channel: \
-                               %x\n", chip, channel);
-                       return -1;
-               }
-               pos ++;
-               oldpos = pos;
-
-       }
-       i2c_init_board();
-
-       return 0;
-}
-
-/* Analyses a Muxstring and if this String is correct
- * adds a new I2C Bus.
- */
-I2C_MUX_DEVICE *i2c_mux_ident_muxstring (uchar *buf)
-{
-       I2C_MUX_DEVICE  *device;
-       I2C_MUX         *mux;
-       int     pos = 0;
-       int     oldpos;
-       int     ret = 0;
-       int     len = strlen((char *)buf);
-       int     was = 0;
-
-       device = (I2C_MUX_DEVICE *)malloc (sizeof(I2C_MUX_DEVICE));
-       device->mux = NULL;
-       device->busid = i2c_mux_get_busid ();
-       device->next = NULL;
-       while (ret == 0) {
-               mux = (I2C_MUX *)malloc (sizeof(I2C_MUX));
-               mux->next = NULL;
-               /* search name of mux */
-               oldpos = pos;
-               ret = i2c_mux_search_next(&pos, buf, len);
-               if (ret != 0)
-                       printf ("%s no name.\n", __FUNCTION__);
-               mux->name = (char *)malloc (pos - oldpos + 1);
-               memcpy (mux->name, &buf[oldpos], pos - oldpos);
-               mux->name[pos - oldpos] = 0;
-               /* search address */
-               pos ++;
-               oldpos = pos;
-               ret = i2c_mux_search_next(&pos, buf, len);
-               if (ret != 0)
-                       printf ("%s no mux address.\n", __FUNCTION__);
-               buf[pos] = 0;
-               mux->chip = simple_strtoul((char *)&buf[oldpos], NULL, 16);
-               buf[pos] = ':';
-               /* search channel */
-               pos ++;
-               oldpos = pos;
-               ret = i2c_mux_search_next(&pos, buf, len);
-               if (ret < 0)
-                       printf ("%s no mux channel.\n", __FUNCTION__);
-               was = 0;
-               if (buf[pos] != 0) {
-                       buf[pos] = 0;
-                       was = 1;
-               }
-               mux->channel = simple_strtoul((char *)&buf[oldpos], NULL, 16);
-               if (was)
-                       buf[pos] = ':';
-               if (device->mux == NULL)
-                       device->mux = mux;
-               else {
-                       I2C_MUX         *muxtmp = device->mux;
-                       while (muxtmp->next != NULL) {
-                               muxtmp = muxtmp->next;
-                       }
-                       muxtmp->next = mux;
-               }
-               pos ++;
-               oldpos = pos;
-       }
-       if (ret > 0) {
-               /* Add Device */
-               i2c_mux_add_device (device);
-               return device;
-       }
-
-       return NULL;
-}
-
-int i2x_mux_select_mux(int bus)
-{
-       I2C_MUX_DEVICE  *dev;
-       I2C_MUX         *mux;
-
-       if ((gd->flags & GD_FLG_RELOC) != GD_FLG_RELOC) {
-               /* select Default Mux Bus */
-#if defined(CONFIG_SYS_I2C_IVM_BUS)
-               i2c_mux_ident_muxstring_f ((uchar *)CONFIG_SYS_I2C_IVM_BUS);
-#else
-               {
-               unsigned char *buf;
-               buf = (unsigned char *) getenv("EEprom_ivm");
-               if (buf != NULL)
-                       i2c_mux_ident_muxstring_f (buf);
-               }
-#endif
-               return 0;
-       }
-       dev = i2c_mux_search_device(bus);
-       if (dev == NULL)
-               return -1;
-
-       mux = dev->mux;
-       while (mux != NULL) {
-               /* do deblocking on each level of mux, before mux config */
-               i2c_init_board();
-               if (i2c_write(mux->chip, 0, 0, &mux->channel, 1) != 0) {
-                       printf ("Error setting Mux: chip:%x channel: \
-                               %x\n", mux->chip, mux->channel);
-                       return -1;
-               }
-               mux = mux->next;
-       }
-       /* do deblocking on each level of mux and after mux config */
-       i2c_init_board();
-       return 0;
-}
-#endif /* CONFIG_I2C_MUX */
index f5882bcfcf49c7f12e816ab35b276fb70d5eadb1..149370f8348046d2b87a305aa0af503a306c0123 100644 (file)
@@ -33,24 +33,8 @@ static int eeprom_bus_read(unsigned dev_addr, unsigned offset,
 #if defined(CONFIG_I2C_ENV_EEPROM_BUS)
        int old_bus = i2c_get_bus_num();
 
-       if (gd->flags & GD_FLG_RELOC) {
-               if (env_eeprom_bus == -1) {
-                       I2C_MUX_DEVICE *dev = NULL;
-                       dev = i2c_mux_ident_muxstring(
-                               (uchar *)CONFIG_I2C_ENV_EEPROM_BUS);
-                       if (dev != NULL)
-                               env_eeprom_bus = dev->busid;
-                       else
-                               printf("error adding env eeprom bus.\n");
-               }
-               if (old_bus != env_eeprom_bus) {
-                       i2c_set_bus_num(env_eeprom_bus);
-                       old_bus = env_eeprom_bus;
-               }
-       } else {
-               rcode = i2c_mux_ident_muxstring_f(
-                               (uchar *)CONFIG_I2C_ENV_EEPROM_BUS);
-       }
+       if (old_bus != CONFIG_I2C_ENV_EEPROM_BUS)
+               i2c_set_bus_num(CONFIG_I2C_ENV_EEPROM_BUS);
 #endif
 
        rcode = eeprom_read(dev_addr, offset, buffer, cnt);
@@ -59,6 +43,7 @@ static int eeprom_bus_read(unsigned dev_addr, unsigned offset,
        if (old_bus != env_eeprom_bus)
                i2c_set_bus_num(old_bus);
 #endif
+
        return rcode;
 }
 
@@ -69,9 +54,12 @@ static int eeprom_bus_write(unsigned dev_addr, unsigned offset,
 #if defined(CONFIG_I2C_ENV_EEPROM_BUS)
        int old_bus = i2c_get_bus_num();
 
-       rcode = i2c_mux_ident_muxstring_f((uchar *)CONFIG_I2C_ENV_EEPROM_BUS);
+       if (old_bus != CONFIG_I2C_ENV_EEPROM_BUS)
+               i2c_set_bus_num(CONFIG_I2C_ENV_EEPROM_BUS);
 #endif
+
        rcode = eeprom_write(dev_addr, offset, buffer, cnt);
+
 #if defined(CONFIG_I2C_ENV_EEPROM_BUS)
        i2c_set_bus_num(old_bus);
 #endif
index 4ea8c0cedf8285c1011dd9e35b371c0958ff03be..721e9a144495a4c37a62d70e457da5d9a6b544f7 100644 (file)
@@ -1,4 +1,8 @@
 /*
+ * Copyright (C) 2009 Sergey Kubushyn <ksi@koi8.net>
+ *
+ * Changes for multibus/multiadapter I2C support.
+ *
  * (C) Copyright 2000
  * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
  *
@@ -14,7 +18,8 @@
 #ifdef CONFIG_LOGBUFFER
 #include <logbuff.h>
 #endif
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
 #include <i2c.h>
 #endif
 
@@ -194,9 +199,13 @@ int stdio_init (void)
 #ifdef CONFIG_ARM_DCC
        drv_arm_dcc_init ();
 #endif
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#ifdef CONFIG_SYS_I2C
+       i2c_init_all();
+#else
+#if defined(CONFIG_HARD_I2C)
        i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
+#endif
 #ifdef CONFIG_LCD
        drv_lcd_init ();
 #endif
index 4ffbfdde3c1c410178c39c15a42cfd38f4439a59..37ccbd14234606b5f047777b60d0d61b1851214f 100644 (file)
@@ -12,7 +12,6 @@ LIB   := $(obj)libi2c.o
 COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
 COBJS-$(CONFIG_DRIVER_DAVINCI_I2C) += davinci_i2c.o
 COBJS-$(CONFIG_DW_I2C) += designware_i2c.o
-COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o
 COBJS-$(CONFIG_I2C_MV) += mv_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
@@ -21,15 +20,18 @@ COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o
-COBJS-$(CONFIG_PPC4XX_I2C) += ppc4xx_i2c.o
 COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
 COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o
-COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
-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_FSL) += fsl_i2c.o
+COBJS-$(CONFIG_SYS_I2C_FTI2C010) += fti2c010.o
+COBJS-$(CONFIG_SYS_I2C_PPC4XX) += ppc4xx_i2c.o
+COBJS-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o
+COBJS-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o
 COBJS-$(CONFIG_ZYNQ_I2C) += zynq_i2c.o
 
 COBJS  := $(COBJS-y)
index 5d7e010319729a2cb4cb96cccbfd5d742db4d467..38455e1c664ba0dcaaa6511f2afc65b5301e2180 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * Copyright 2006,2009 Freescale Semiconductor, Inc.
  *
+ * 2012, Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ * Changes for multibus/multiadapter I2C support.
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * Version 2 as published by the Free Software Foundation.
  */
 
 #include <common.h>
-
-#ifdef CONFIG_HARD_I2C
-
 #include <command.h>
 #include <i2c.h>               /* Functional interface */
-
 #include <asm/io.h>
 #include <asm/fsl_i2c.h>       /* HW definitions */
 
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* Initialize the bus pointer to whatever one the SPD EEPROM is on.
- * Default is bus 0.  This is necessary because the DDR initialization
- * runs from ROM, and we can't switch buses because we can't modify
- * the global variables.
- */
-#ifndef CONFIG_SYS_SPD_BUS_NUM
-#define CONFIG_SYS_SPD_BUS_NUM 0
-#endif
-static unsigned int i2c_bus_num __attribute__ ((section (".data"))) = CONFIG_SYS_SPD_BUS_NUM;
-#if defined(CONFIG_I2C_MUX)
-static unsigned int i2c_bus_num_mux __attribute__ ((section ("data"))) = 0;
-#endif
-
-static unsigned int i2c_bus_speed[2] = {CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SPEED};
-
 static const struct fsl_i2c *i2c_dev[2] = {
-       (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET),
-#ifdef CONFIG_SYS_I2C2_OFFSET
-       (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C2_OFFSET)
+       (struct fsl_i2c *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C_OFFSET),
+#ifdef CONFIG_SYS_FSL_I2C2_OFFSET
+       (struct fsl_i2c *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C2_OFFSET)
 #endif
 };
 
@@ -222,12 +206,9 @@ static unsigned int get_i2c_clock(int bus)
                return gd->arch.i2c1_clk;       /* I2C1 clock */
 }
 
-void
-i2c_init(int speed, int slaveadd)
+static void fsl_i2c_init(struct i2c_adapter *adap, int speed, int slaveadd)
 {
        const struct fsl_i2c *dev;
-       unsigned int temp;
-       int bus_num, i;
 
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
        /* Call board specific i2c bus reset routine before accessing the
@@ -236,23 +217,14 @@ i2c_init(int speed, int slaveadd)
        */
        i2c_init_board();
 #endif
-#ifdef CONFIG_SYS_I2C2_OFFSET
-       bus_num = 2;
-#else
-       bus_num = 1;
-#endif
-       for (i = 0; i < bus_num; i++) {
-               dev = i2c_dev[i];
-
-               writeb(0, &dev->cr);            /* stop I2C controller */
-               udelay(5);                      /* let it shutdown in peace */
-               temp = set_i2c_bus_speed(dev, get_i2c_clock(i), speed);
-               if (gd->flags & GD_FLG_RELOC)
-                       i2c_bus_speed[i] = temp;
-               writeb(slaveadd << 1, &dev->adr);/* write slave address */
-               writeb(0x0, &dev->sr);          /* clear status register */
-               writeb(I2C_CR_MEN, &dev->cr);   /* start I2C controller */
-       }
+       dev = (struct fsl_i2c *)i2c_dev[adap->hwadapnr];
+
+       writeb(0, &dev->cr);            /* stop I2C controller */
+       udelay(5);                      /* let it shutdown in peace */
+       set_i2c_bus_speed(dev, get_i2c_clock(adap->hwadapnr), speed);
+       writeb(slaveadd << 1, &dev->adr);/* write slave address */
+       writeb(0x0, &dev->sr);          /* clear status register */
+       writeb(I2C_CR_MEN, &dev->cr);   /* start I2C controller */
 
 #ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT
        /* Call board specific i2c bus reset routine AFTER the bus has been
@@ -265,12 +237,13 @@ i2c_init(int speed, int slaveadd)
 }
 
 static int
-i2c_wait4bus(void)
+i2c_wait4bus(struct i2c_adapter *adap)
 {
+       struct fsl_i2c *dev = (struct fsl_i2c *)i2c_dev[adap->hwadapnr];
        unsigned long long timeval = get_ticks();
        const unsigned long long timeout = usec2ticks(CONFIG_I2C_MBB_TIMEOUT);
 
-       while (readb(&i2c_dev[i2c_bus_num]->sr) & I2C_SR_MBB) {
+       while (readb(&dev->sr) & I2C_SR_MBB) {
                if ((get_ticks() - timeval) > timeout)
                        return -1;
        }
@@ -279,20 +252,21 @@ i2c_wait4bus(void)
 }
 
 static __inline__ int
-i2c_wait(int write)
+i2c_wait(struct i2c_adapter *adap, int write)
 {
        u32 csr;
        unsigned long long timeval = get_ticks();
        const unsigned long long timeout = usec2ticks(CONFIG_I2C_TIMEOUT);
+       struct fsl_i2c *dev = (struct fsl_i2c *)i2c_dev[adap->hwadapnr];
 
        do {
-               csr = readb(&i2c_dev[i2c_bus_num]->sr);
+               csr = readb(&dev->sr);
                if (!(csr & I2C_SR_MIF))
                        continue;
                /* Read again to allow register to stabilise */
-               csr = readb(&i2c_dev[i2c_bus_num]->sr);
+               csr = readb(&dev->sr);
 
-               writeb(0x0, &i2c_dev[i2c_bus_num]->sr);
+               writeb(0x0, &dev->sr);
 
                if (csr & I2C_SR_MAL) {
                        debug("i2c_wait: MAL\n");
@@ -317,29 +291,32 @@ i2c_wait(int write)
 }
 
 static __inline__ int
-i2c_write_addr (u8 dev, u8 dir, int rsta)
+i2c_write_addr(struct i2c_adapter *adap, u8 dev, u8 dir, int rsta)
 {
+       struct fsl_i2c *device = (struct fsl_i2c *)i2c_dev[adap->hwadapnr];
+
        writeb(I2C_CR_MEN | I2C_CR_MSTA | I2C_CR_MTX
               | (rsta ? I2C_CR_RSTA : 0),
-              &i2c_dev[i2c_bus_num]->cr);
+              &device->cr);
 
-       writeb((dev << 1) | dir, &i2c_dev[i2c_bus_num]->dr);
+       writeb((dev << 1) | dir, &device->dr);
 
-       if (i2c_wait(I2C_WRITE_BIT) < 0)
+       if (i2c_wait(adap, I2C_WRITE_BIT) < 0)
                return 0;
 
        return 1;
 }
 
 static __inline__ int
-__i2c_write(u8 *data, int length)
+__i2c_write(struct i2c_adapter *adap, u8 *data, int length)
 {
+       struct fsl_i2c *dev = (struct fsl_i2c *)i2c_dev[adap->hwadapnr];
        int i;
 
        for (i = 0; i < length; i++) {
-               writeb(data[i], &i2c_dev[i2c_bus_num]->dr);
+               writeb(data[i], &dev->dr);
 
-               if (i2c_wait(I2C_WRITE_BIT) < 0)
+               if (i2c_wait(adap, I2C_WRITE_BIT) < 0)
                        break;
        }
 
@@ -347,57 +324,60 @@ __i2c_write(u8 *data, int length)
 }
 
 static __inline__ int
-__i2c_read(u8 *data, int length)
+__i2c_read(struct i2c_adapter *adap, u8 *data, int length)
 {
+       struct fsl_i2c *dev = (struct fsl_i2c *)i2c_dev[adap->hwadapnr];
        int i;
 
        writeb(I2C_CR_MEN | I2C_CR_MSTA | ((length == 1) ? I2C_CR_TXAK : 0),
-              &i2c_dev[i2c_bus_num]->cr);
+              &dev->cr);
 
        /* dummy read */
-       readb(&i2c_dev[i2c_bus_num]->dr);
+       readb(&dev->dr);
 
        for (i = 0; i < length; i++) {
-               if (i2c_wait(I2C_READ_BIT) < 0)
+               if (i2c_wait(adap, I2C_READ_BIT) < 0)
                        break;
 
                /* Generate ack on last next to last byte */
                if (i == length - 2)
                        writeb(I2C_CR_MEN | I2C_CR_MSTA | I2C_CR_TXAK,
-                              &i2c_dev[i2c_bus_num]->cr);
+                              &dev->cr);
 
                /* Do not generate stop on last byte */
                if (i == length - 1)
                        writeb(I2C_CR_MEN | I2C_CR_MSTA | I2C_CR_MTX,
-                              &i2c_dev[i2c_bus_num]->cr);
+                              &dev->cr);
 
-               data[i] = readb(&i2c_dev[i2c_bus_num]->dr);
+               data[i] = readb(&dev->dr);
        }
 
        return i;
 }
 
-int
-i2c_read(u8 dev, uint addr, int alen, u8 *data, int length)
+static int
+fsl_i2c_read(struct i2c_adapter *adap, u8 dev, uint addr, int alen, u8 *data,
+            int length)
 {
+       struct fsl_i2c *device = (struct fsl_i2c *)i2c_dev[adap->hwadapnr];
        int i = -1; /* signal error */
        u8 *a = (u8*)&addr;
 
-       if (i2c_wait4bus() < 0)
+       if (i2c_wait4bus(adap) < 0)
                return -1;
 
        if ((!length || alen > 0)
-           && i2c_write_addr(dev, I2C_WRITE_BIT, 0) != 0
-           && __i2c_write(&a[4 - alen], alen) == alen)
+           && i2c_write_addr(adap, dev, I2C_WRITE_BIT, 0) != 0
+           && __i2c_write(adap, &a[4 - alen], alen) == alen)
                i = 0; /* No error so far */
 
        if (length &&
-           i2c_write_addr(dev, I2C_READ_BIT, alen ? 1 : 0) != 0)
-               i = __i2c_read(data, length);
+           i2c_write_addr(adap, dev, I2C_READ_BIT, alen ? 1 : 0) != 0)
+               i = __i2c_read(adap, data, length);
 
-       writeb(I2C_CR_MEN, &i2c_dev[i2c_bus_num]->cr);
+       writeb(I2C_CR_MEN, &device->cr);
 
-       if (i2c_wait4bus()) /* Wait until STOP */
+       if (i2c_wait4bus(adap)) /* Wait until STOP */
                debug("i2c_read: wait4bus timed out\n");
 
        if (i == length)
@@ -406,20 +386,22 @@ i2c_read(u8 dev, uint addr, int alen, u8 *data, int length)
        return -1;
 }
 
-int
-i2c_write(u8 dev, uint addr, int alen, u8 *data, int length)
+static int
+fsl_i2c_write(struct i2c_adapter *adap, u8 dev, uint addr, int alen,
+             u8 *data, int length)
 {
+       struct fsl_i2c *device = (struct fsl_i2c *)i2c_dev[adap->hwadapnr];
        int i = -1; /* signal error */
        u8 *a = (u8*)&addr;
 
-       if (i2c_wait4bus() >= 0
-           && i2c_write_addr(dev, I2C_WRITE_BIT, 0) != 0
-           && __i2c_write(&a[4 - alen], alen) == alen) {
-               i = __i2c_write(data, length);
+       if (i2c_wait4bus(adap) >= 0 &&
+           i2c_write_addr(adap, dev, I2C_WRITE_BIT, 0) != 0 &&
+           __i2c_write(adap, &a[4 - alen], alen) == alen) {
+               i = __i2c_write(adap, data, length);
        }
 
-       writeb(I2C_CR_MEN, &i2c_dev[i2c_bus_num]->cr);
-       if (i2c_wait4bus()) /* Wait until STOP */
+       writeb(I2C_CR_MEN, &device->cr);
+       if (i2c_wait4bus(adap)) /* Wait until STOP */
                debug("i2c_write: wait4bus timed out\n");
 
        if (i == length)
@@ -428,72 +410,42 @@ i2c_write(u8 dev, uint addr, int alen, u8 *data, int length)
        return -1;
 }
 
-int
-i2c_probe(uchar chip)
+static int
+fsl_i2c_probe(struct i2c_adapter *adap, uchar chip)
 {
+       struct fsl_i2c *dev = (struct fsl_i2c *)i2c_dev[adap->hwadapnr];
        /* For unknow reason the controller will ACK when
         * probing for a slave with the same address, so skip
         * it.
         */
-       if (chip == (readb(&i2c_dev[i2c_bus_num]->adr) >> 1))
-               return -1;
-
-       return i2c_read(chip, 0, 0, NULL, 0);
-}
-
-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);
-               if (ret)
-                       return ret;
-               i2c_bus_num = 0;
-       }
-       i2c_bus_num_mux = bus;
-#else
-#ifdef CONFIG_SYS_I2C2_OFFSET
-       if (bus > 1) {
-#else
-       if (bus > 0) {
-#endif
+       if (chip == (readb(&dev->adr) >> 1))
                return -1;
-       }
 
-       i2c_bus_num = bus;
-#endif
-       return 0;
+       return fsl_i2c_read(adap, chip, 0, 0, NULL, 0);
 }
 
-int i2c_set_bus_speed(unsigned int speed)
+static unsigned int fsl_i2c_set_bus_speed(struct i2c_adapter *adap,
+                       unsigned int speed)
 {
-       unsigned int i2c_clk = (i2c_bus_num == 1)
-                       ? gd->arch.i2c2_clk : gd->arch.i2c1_clk;
+       struct fsl_i2c *dev = (struct fsl_i2c *)i2c_dev[adap->hwadapnr];
 
-       writeb(0, &i2c_dev[i2c_bus_num]->cr);           /* stop controller */
-       i2c_bus_speed[i2c_bus_num] =
-               set_i2c_bus_speed(i2c_dev[i2c_bus_num], i2c_clk, speed);
-       writeb(I2C_CR_MEN, &i2c_dev[i2c_bus_num]->cr);  /* start controller */
+       writeb(0, &dev->cr);            /* stop controller */
+       set_i2c_bus_speed(dev, get_i2c_clock(adap->hwadapnr), speed);
+       writeb(I2C_CR_MEN, &dev->cr);   /* start controller */
 
        return 0;
 }
 
-unsigned int i2c_get_bus_num(void)
-{
-#if defined(CONFIG_I2C_MUX)
-       return i2c_bus_num_mux;
-#else
-       return i2c_bus_num;
+/*
+ * Register fsl i2c adapters
+ */
+U_BOOT_I2C_ADAP_COMPLETE(fsl_0, fsl_i2c_init, fsl_i2c_probe, fsl_i2c_read,
+                        fsl_i2c_write, fsl_i2c_set_bus_speed,
+                        CONFIG_SYS_FSL_I2C_SPEED, CONFIG_SYS_FSL_I2C_SLAVE,
+                        0)
+#ifdef CONFIG_SYS_FSL_I2C2_OFFSET
+U_BOOT_I2C_ADAP_COMPLETE(fsl_1, fsl_i2c_init, fsl_i2c_probe, fsl_i2c_read,
+                        fsl_i2c_write, fsl_i2c_set_bus_speed,
+                        CONFIG_SYS_FSL_I2C2_SPEED, CONFIG_SYS_FSL_I2C2_SLAVE,
+                        1)
 #endif
-}
-
-unsigned int i2c_get_bus_speed(void)
-{
-       return i2c_bus_speed[i2c_bus_num];
-}
-
-#endif /* CONFIG_HARD_I2C */
diff --git a/drivers/i2c/fti2c010.c b/drivers/i2c/fti2c010.c
new file mode 100644 (file)
index 0000000..24c4bb5
--- /dev/null
@@ -0,0 +1,369 @@
+/*
+ * Faraday I2C Controller
+ *
+ * (C) Copyright 2010 Faraday Technology
+ * Dante Su <dantesu@faraday-tech.com>
+ *
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <i2c.h>
+
+#include "fti2c010.h"
+
+#ifndef CONFIG_HARD_I2C
+#error "fti2c010: CONFIG_HARD_I2C is not defined"
+#endif
+
+#ifndef CONFIG_SYS_I2C_SPEED
+#define CONFIG_SYS_I2C_SPEED    50000
+#endif
+
+#ifndef CONFIG_FTI2C010_FREQ
+#define CONFIG_FTI2C010_FREQ    clk_get_rate("I2C")
+#endif
+
+/* command timeout */
+#define CFG_CMD_TIMEOUT         10 /* ms */
+
+/* 7-bit chip address + 1-bit read/write */
+#define I2C_RD(chip)            ((((chip) << 1) & 0xff) | 1)
+#define I2C_WR(chip)            (((chip) << 1) & 0xff)
+
+struct fti2c010_chip {
+       void __iomem *regs;
+       uint bus;
+       uint speed;
+};
+
+static struct fti2c010_chip chip_list[] = {
+       {
+               .bus  = 0,
+               .regs = (void __iomem *)CONFIG_FTI2C010_BASE,
+       },
+#ifdef CONFIG_I2C_MULTI_BUS
+# ifdef CONFIG_FTI2C010_BASE1
+       {
+               .bus  = 1,
+               .regs = (void __iomem *)CONFIG_FTI2C010_BASE1,
+       },
+# endif
+# ifdef CONFIG_FTI2C010_BASE2
+       {
+               .bus  = 2,
+               .regs = (void __iomem *)CONFIG_FTI2C010_BASE2,
+       },
+# endif
+# ifdef CONFIG_FTI2C010_BASE3
+       {
+               .bus  = 3,
+               .regs = (void __iomem *)CONFIG_FTI2C010_BASE3,
+       },
+# endif
+#endif  /* #ifdef CONFIG_I2C_MULTI_BUS */
+};
+
+static struct fti2c010_chip *curr = chip_list;
+
+static int fti2c010_wait(uint32_t mask)
+{
+       int ret = -1;
+       uint32_t stat, ts;
+       struct fti2c010_regs *regs = curr->regs;
+
+       for (ts = get_timer(0); get_timer(ts) < CFG_CMD_TIMEOUT; ) {
+               stat = readl(&regs->sr);
+               if ((stat & mask) == mask) {
+                       ret = 0;
+                       break;
+               }
+       }
+
+       return ret;
+}
+
+/*
+ * u-boot I2C API
+ */
+
+/*
+ * Initialization, must be called once on start up, may be called
+ * repeatedly to change the speed and slave addresses.
+ */
+void i2c_init(int speed, int slaveaddr)
+{
+       if (speed || !curr->speed)
+               i2c_set_bus_speed(speed);
+
+       /* if slave mode disabled */
+       if (!slaveaddr)
+               return;
+
+       /*
+        * TODO:
+        * Implement slave mode, but is it really necessary?
+        */
+}
+
+/*
+ * Probe the given I2C chip address.  Returns 0 if a chip responded,
+ * not 0 on failure.
+ */
+int i2c_probe(uchar chip)
+{
+       int ret;
+       struct fti2c010_regs *regs = curr->regs;
+
+       i2c_init(0, 0);
+
+       /* 1. Select slave device (7bits Address + 1bit R/W) */
+       writel(I2C_WR(chip), &regs->dr);
+       writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr);
+       ret = fti2c010_wait(SR_DT);
+       if (ret)
+               return ret;
+
+       /* 2. Select device register */
+       writel(0, &regs->dr);
+       writel(CR_ENABLE | CR_TBEN, &regs->cr);
+       ret = fti2c010_wait(SR_DT);
+
+       return ret;
+}
+
+/*
+ * Read/Write interface:
+ *   chip:    I2C chip address, range 0..127
+ *   addr:    Memory (register) address within the chip
+ *   alen:    Number of bytes to use for addr (typically 1, 2 for larger
+ *              memories, 0 for register type devices with only one
+ *              register)
+ *   buffer:  Where to read/write the data
+ *   len:     How many bytes to read/write
+ *
+ *   Returns: 0 on success, not 0 on failure
+ */
+int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
+{
+       int ret, pos;
+       uchar paddr[4];
+       struct fti2c010_regs *regs = curr->regs;
+
+       i2c_init(0, 0);
+
+       paddr[0] = (addr >> 0)  & 0xFF;
+       paddr[1] = (addr >> 8)  & 0xFF;
+       paddr[2] = (addr >> 16) & 0xFF;
+       paddr[3] = (addr >> 24) & 0xFF;
+
+       /*
+        * Phase A. Set register address
+        */
+
+       /* A.1 Select slave device (7bits Address + 1bit R/W) */
+       writel(I2C_WR(chip), &regs->dr);
+       writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr);
+       ret = fti2c010_wait(SR_DT);
+       if (ret)
+               return ret;
+
+       /* A.2 Select device register */
+       for (pos = 0; pos < alen; ++pos) {
+               uint32_t ctrl = CR_ENABLE | CR_TBEN;
+
+               writel(paddr[pos], &regs->dr);
+               writel(ctrl, &regs->cr);
+               ret = fti2c010_wait(SR_DT);
+               if (ret)
+                       return ret;
+       }
+
+       /*
+        * Phase B. Get register data
+        */
+
+       /* B.1 Select slave device (7bits Address + 1bit R/W) */
+       writel(I2C_RD(chip), &regs->dr);
+       writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr);
+       ret = fti2c010_wait(SR_DT);
+       if (ret)
+               return ret;
+
+       /* B.2 Get register data */
+       for (pos = 0; pos < len; ++pos) {
+               uint32_t ctrl = CR_ENABLE | CR_TBEN;
+               uint32_t stat = SR_DR;
+
+               if (pos == len - 1) {
+                       ctrl |= CR_NAK | CR_STOP;
+                       stat |= SR_ACK;
+               }
+               writel(ctrl, &regs->cr);
+               ret = fti2c010_wait(stat);
+               if (ret)
+                       break;
+               buf[pos] = (uchar)(readl(&regs->dr) & 0xFF);
+       }
+
+       return ret;
+}
+
+/*
+ * Read/Write interface:
+ *   chip:    I2C chip address, range 0..127
+ *   addr:    Memory (register) address within the chip
+ *   alen:    Number of bytes to use for addr (typically 1, 2 for larger
+ *              memories, 0 for register type devices with only one
+ *              register)
+ *   buffer:  Where to read/write the data
+ *   len:     How many bytes to read/write
+ *
+ *   Returns: 0 on success, not 0 on failure
+ */
+int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
+{
+       int ret, pos;
+       uchar paddr[4];
+       struct fti2c010_regs *regs = curr->regs;
+
+       i2c_init(0, 0);
+
+       paddr[0] = (addr >> 0)  & 0xFF;
+       paddr[1] = (addr >> 8)  & 0xFF;
+       paddr[2] = (addr >> 16) & 0xFF;
+       paddr[3] = (addr >> 24) & 0xFF;
+
+       /*
+        * Phase A. Set register address
+        *
+        * A.1 Select slave device (7bits Address + 1bit R/W)
+        */
+       writel(I2C_WR(chip), &regs->dr);
+       writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr);
+       ret = fti2c010_wait(SR_DT);
+       if (ret)
+               return ret;
+
+       /* A.2 Select device register */
+       for (pos = 0; pos < alen; ++pos) {
+               uint32_t ctrl = CR_ENABLE | CR_TBEN;
+
+               writel(paddr[pos], &regs->dr);
+               writel(ctrl, &regs->cr);
+               ret = fti2c010_wait(SR_DT);
+               if (ret)
+                       return ret;
+       }
+
+       /*
+        * Phase B. Set register data
+        */
+       for (pos = 0; pos < len; ++pos) {
+               uint32_t ctrl = CR_ENABLE | CR_TBEN;
+
+               if (pos == len - 1)
+                       ctrl |= CR_STOP;
+               writel(buf[pos], &regs->dr);
+               writel(ctrl, &regs->cr);
+               ret = fti2c010_wait(SR_DT);
+               if (ret)
+                       break;
+       }
+
+       return ret;
+}
+
+/*
+ * Functions for setting the current I2C bus and its speed
+ */
+#ifdef CONFIG_I2C_MULTI_BUS
+
+/*
+ * i2c_set_bus_num:
+ *
+ *  Change the active I2C bus.  Subsequent read/write calls will
+ *  go to this one.
+ *
+ *    bus - bus index, zero based
+ *
+ *    Returns: 0 on success, not 0 on failure
+ */
+int i2c_set_bus_num(uint bus)
+{
+       if (bus >= ARRAY_SIZE(chip_list))
+               return -1;
+       curr = chip_list + bus;
+       i2c_init(0, 0);
+       return 0;
+}
+
+/*
+ * i2c_get_bus_num:
+ *
+ *  Returns index of currently active I2C bus.  Zero-based.
+ */
+
+uint i2c_get_bus_num(void)
+{
+       return curr->bus;
+}
+
+#endif    /* #ifdef CONFIG_I2C_MULTI_BUS */
+
+/*
+ * i2c_set_bus_speed:
+ *
+ *  Change the speed of the active I2C bus
+ *
+ *    speed - bus speed in Hz
+ *
+ *    Returns: 0 on success, not 0 on failure
+ */
+int i2c_set_bus_speed(uint speed)
+{
+       struct fti2c010_regs *regs = curr->regs;
+       uint clk = CONFIG_FTI2C010_FREQ;
+       uint gsr = 0, tsr = 32;
+       uint spd, div;
+
+       if (!speed)
+               speed = CONFIG_SYS_I2C_SPEED;
+
+       for (div = 0; div < 0x3ffff; ++div) {
+               /* SCLout = PCLK/(2*(COUNT + 2) + GSR) */
+               spd = clk / (2 * (div + 2) + gsr);
+               if (spd <= speed)
+                       break;
+       }
+
+       if (curr->speed == spd)
+               return 0;
+
+       writel(CR_I2CRST, &regs->cr);
+       mdelay(100);
+       if (readl(&regs->cr) & CR_I2CRST) {
+               printf("fti2c010: reset timeout\n");
+               return -1;
+       }
+
+       curr->speed = spd;
+
+       writel(TGSR_GSR(gsr) | TGSR_TSR(tsr), &regs->tgsr);
+       writel(CDR_DIV(div), &regs->cdr);
+
+       return 0;
+}
+
+/*
+ * i2c_get_bus_speed:
+ *
+ *  Returns speed of currently active I2C bus in Hz
+ */
+
+uint i2c_get_bus_speed(void)
+{
+       return curr->speed;
+}
diff --git a/drivers/i2c/fti2c010.h b/drivers/i2c/fti2c010.h
new file mode 100644 (file)
index 0000000..18aec2c
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Faraday I2C Controller
+ *
+ * (C) Copyright 2010 Faraday Technology
+ * Dante Su <dantesu@faraday-tech.com>
+ *
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+ */
+
+#ifndef __FTI2C010_H
+#define __FTI2C010_H
+
+/*
+ * FTI2C010 registers
+ */
+struct fti2c010_regs {
+       uint32_t cr;  /* 0x00: control register */
+       uint32_t sr;  /* 0x04: status register */
+       uint32_t cdr; /* 0x08: clock division register */
+       uint32_t dr;  /* 0x0c: data register */
+       uint32_t sar; /* 0x10: slave address register */
+       uint32_t tgsr;/* 0x14: time & glitch suppression register */
+       uint32_t bmr; /* 0x18: bus monitor register */
+       uint32_t rsvd[5];
+       uint32_t revr;/* 0x30: revision register */
+};
+
+/*
+ * control register
+ */
+#define CR_ALIRQ      0x2000  /* arbitration lost interrupt (master) */
+#define CR_SAMIRQ     0x1000  /* slave address match interrupt (slave) */
+#define CR_STOPIRQ    0x800   /* stop condition interrupt (slave) */
+#define CR_NAKRIRQ    0x400   /* NACK response interrupt (master) */
+#define CR_DRIRQ      0x200   /* rx interrupt (both) */
+#define CR_DTIRQ      0x100   /* tx interrupt (both) */
+#define CR_TBEN       0x80    /* tx enable (both) */
+#define CR_NAK        0x40    /* NACK (both) */
+#define CR_STOP       0x20    /* stop (master) */
+#define CR_START      0x10    /* start (master) */
+#define CR_GCEN       0x8     /* general call support (slave) */
+#define CR_SCLEN      0x4     /* enable clock out (master) */
+#define CR_I2CEN      0x2     /* enable I2C (both) */
+#define CR_I2CRST     0x1     /* reset I2C (both) */
+#define CR_ENABLE     \
+       (CR_ALIRQ | CR_NAKRIRQ | CR_DRIRQ | CR_DTIRQ | CR_SCLEN | CR_I2CEN)
+
+/*
+ * status register
+ */
+#define SR_CLRAL      0x400    /* clear arbitration lost */
+#define SR_CLRGC      0x200    /* clear general call */
+#define SR_CLRSAM     0x100    /* clear slave address match */
+#define SR_CLRSTOP    0x80     /* clear stop */
+#define SR_CLRNAKR    0x40     /* clear NACK respond */
+#define SR_DR         0x20     /* rx ready */
+#define SR_DT         0x10     /* tx done */
+#define SR_BB         0x8      /* bus busy */
+#define SR_BUSY       0x4      /* chip busy */
+#define SR_ACK        0x2      /* ACK/NACK received */
+#define SR_RW         0x1      /* set when master-rx or slave-tx mode */
+
+/*
+ * clock division register
+ */
+#define CDR_DIV(n)    ((n) & 0x3ffff)
+
+/*
+ * time & glitch suppression register
+ */
+#define TGSR_GSR(n)   (((n) & 0x7) << 10)
+#define TGSR_TSR(n)   ((n) & 0x3ff)
+
+/*
+ * bus monitor register
+ */
+#define BMR_SCL       0x2      /* SCL is pull-up */
+#define BMR_SDA       0x1      /* SDA is pull-up */
+
+#endif /* __FTI2C010_H */
diff --git a/drivers/i2c/i2c_core.c b/drivers/i2c/i2c_core.c
new file mode 100644 (file)
index 0000000..3c01893
--- /dev/null
@@ -0,0 +1,414 @@
+/*
+ * Copyright (C) 2009 Sergey Kubushyn <ksi@koi8.net>
+ *
+ * (C) Copyright 2012
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ * Multibus/multiadapter I2C core functions (wrappers)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <common.h>
+#include <i2c.h>
+
+struct i2c_adapter *i2c_get_adapter(int index)
+{
+       struct i2c_adapter *i2c_adap_p = ll_entry_start(struct i2c_adapter,
+                                               i2c);
+       int max = ll_entry_count(struct i2c_adapter, i2c);
+       int i;
+
+       if (index >= max) {
+               printf("Error, wrong i2c adapter %d max %d possible\n",
+                      index, max);
+               return i2c_adap_p;
+       }
+       if (index == 0)
+               return i2c_adap_p;
+
+       for (i = 0; i < index; i++)
+               i2c_adap_p++;
+
+       return i2c_adap_p;
+}
+
+#if !defined(CONFIG_SYS_I2C_DIRECT_BUS)
+struct i2c_bus_hose i2c_bus[CONFIG_SYS_NUM_I2C_BUSES] =
+                       CONFIG_SYS_I2C_BUSES;
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void i2c_reloc_fixup(void)
+{
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
+       struct i2c_adapter *i2c_adap_p = ll_entry_start(struct i2c_adapter,
+                                               i2c);
+       struct i2c_adapter *tmp = i2c_adap_p;
+       int max = ll_entry_count(struct i2c_adapter, i2c);
+       int             i;
+       unsigned long   addr;
+
+       if (gd->reloc_off == 0)
+               return;
+
+       for (i = 0; i < max; i++) {
+               /* adapter itself */
+               addr = (unsigned long)i2c_adap_p;
+               addr += gd->reloc_off;
+               i2c_adap_p = (struct i2c_adapter *)addr;
+               /* i2c_init() */
+               addr = (unsigned long)i2c_adap_p->init;
+               addr += gd->reloc_off;
+               i2c_adap_p->init = (void (*)(int, int))addr;
+               /* i2c_probe() */
+               addr = (unsigned long)i2c_adap_p->probe;
+               addr += gd->reloc_off;
+               i2c_adap_p->probe = (int (*)(uint8_t))addr;
+               /* i2c_read() */
+               addr = (unsigned long)i2c_adap_p->read;
+               addr += gd->reloc_off;
+               i2c_adap_p->read = (int (*)(uint8_t, uint, int, uint8_t *,
+                                       int))addr;
+               /* i2c_write() */
+               addr = (unsigned long)i2c_adap_p->write;
+               addr += gd->reloc_off;
+               i2c_adap_p->write = (int (*)(uint8_t, uint, int, uint8_t *,
+                                       int))addr;
+               /* i2c_set_bus_speed() */
+               addr = (unsigned long)i2c_adap_p->set_bus_speed;
+               addr += gd->reloc_off;
+               i2c_adap_p->set_bus_speed = (uint (*)(uint))addr;
+               /* name */
+               addr = (unsigned long)i2c_adap_p->name;
+               addr += gd->reloc_off;
+               i2c_adap_p->name = (char *)addr;
+               tmp++;
+               i2c_adap_p = tmp;
+       }
+#endif
+}
+
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+/*
+ * i2c_mux_set()
+ * -------------
+ *
+ * This turns on the given channel on I2C multiplexer chip connected to
+ * a given I2C adapter directly or via other multiplexers. In the latter
+ * case the entire multiplexer chain must be initialized first starting
+ * with the one connected directly to the adapter. When disabling a chain
+ * muxes must be programmed in reverse order, starting with the one
+ * farthest from the adapter.
+ *
+ * mux_id is the multiplexer chip type from defined in i2c.h. So far only
+ * NXP (Philips) PCA954x multiplexers are supported. Switches are NOT
+ * supported (anybody uses them?)
+ */
+
+static int i2c_mux_set(struct i2c_adapter *adap, int mux_id, int chip,
+                       int channel)
+{
+       uint8_t buf;
+       int ret;
+
+       /* channel < 0 - turn off the mux */
+       if (channel < 0) {
+               buf = 0;
+               ret = adap->write(adap, chip, 0, 0, &buf, 1);
+               if (ret)
+                       printf("%s: Could not turn off the mux.\n", __func__);
+               return ret;
+       }
+
+       switch (mux_id) {
+       case I2C_MUX_PCA9540_ID:
+       case I2C_MUX_PCA9542_ID:
+               if (channel > 1)
+                       return -1;
+               buf = (uint8_t)((channel & 0x01) | (1 << 2));
+               break;
+       case I2C_MUX_PCA9544_ID:
+               if (channel > 3)
+                       return -1;
+               buf = (uint8_t)((channel & 0x03) | (1 << 2));
+               break;
+       case I2C_MUX_PCA9547_ID:
+               if (channel > 7)
+                       return -1;
+               buf = (uint8_t)((channel & 0x07) | (1 << 3));
+               break;
+       default:
+               printf("%s: wrong mux id: %d\n", __func__, mux_id);
+               return -1;
+       }
+
+       ret = adap->write(adap, chip, 0, 0, &buf, 1);
+       if (ret)
+               printf("%s: could not set mux: id: %d chip: %x channel: %d\n",
+                      __func__, mux_id, chip, channel);
+       return ret;
+}
+
+static int i2c_mux_set_all(void)
+{
+       struct i2c_bus_hose *i2c_bus_tmp = &i2c_bus[I2C_BUS];
+       int i;
+
+       /* Connect requested bus if behind muxes */
+       if (i2c_bus_tmp->next_hop[0].chip != 0) {
+               /* Set all muxes along the path to that bus */
+               for (i = 0; i < CONFIG_SYS_I2C_MAX_HOPS; i++) {
+                       int     ret;
+
+                       if (i2c_bus_tmp->next_hop[i].chip == 0)
+                               break;
+
+                       ret = i2c_mux_set(I2C_ADAP,
+                                       i2c_bus_tmp->next_hop[i].mux.id,
+                                       i2c_bus_tmp->next_hop[i].chip,
+                                       i2c_bus_tmp->next_hop[i].channel);
+                       if (ret != 0)
+                               return ret;
+               }
+       }
+       return 0;
+}
+
+static int i2c_mux_disconnet_all(void)
+{
+       struct  i2c_bus_hose *i2c_bus_tmp = &i2c_bus[I2C_BUS];
+       int     i;
+       uint8_t buf;
+
+       if (I2C_ADAP->init_done == 0)
+               return 0;
+
+       /* Disconnect current bus (turn off muxes if any) */
+       if ((i2c_bus_tmp->next_hop[0].chip != 0) &&
+           (I2C_ADAP->init_done != 0)) {
+               i = CONFIG_SYS_I2C_MAX_HOPS;
+               do {
+                       uint8_t chip;
+                       int ret;
+
+                       chip = i2c_bus_tmp->next_hop[--i].chip;
+                       if (chip == 0)
+                               continue;
+
+                       ret = I2C_ADAP->write(I2C_ADAP, chip, 0, 0, &buf, 1);
+                       if (ret != 0) {
+                               printf("i2c: mux diconnect error\n");
+                               return ret;
+                       }
+               } while (i > 0);
+       }
+
+       return 0;
+}
+#endif
+
+/*
+ * i2c_init_bus():
+ * ---------------
+ *
+ * Initializes one bus. Will initialize the parent adapter. No current bus
+ * changes, no mux (if any) setup.
+ */
+static void i2c_init_bus(unsigned int bus_no, int speed, int slaveaddr)
+{
+       if (bus_no >= CONFIG_SYS_NUM_I2C_BUSES)
+               return;
+
+       I2C_ADAP->init(I2C_ADAP, speed, slaveaddr);
+
+       if (gd->flags & GD_FLG_RELOC) {
+               I2C_ADAP->init_done = 1;
+               I2C_ADAP->speed = speed;
+               I2C_ADAP->slaveaddr = slaveaddr;
+       }
+}
+
+/* implement possible board specific board init */
+static void __def_i2c_init_board(void)
+{
+}
+void i2c_init_board(void)
+       __attribute__((weak, alias("__def_i2c_init_board")));
+
+/*
+ * i2c_init_all():
+ *
+ * not longer needed, will deleted. Actual init the SPD_BUS
+ * for compatibility.
+ * i2c_adap[] must be initialized beforehead with function pointers and
+ * data, including speed and slaveaddr.
+ */
+void i2c_init_all(void)
+{
+       i2c_init_board();
+       i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
+       return;
+}
+
+/*
+ * i2c_get_bus_num():
+ * ------------------
+ *
+ *  Returns index of currently active I2C bus.  Zero-based.
+ */
+unsigned int i2c_get_bus_num(void)
+{
+       return gd->cur_i2c_bus;
+}
+
+/*
+ * i2c_set_bus_num():
+ * ------------------
+ *
+ *  Change the active I2C bus. Subsequent read/write calls will
+ *  go to this one. Sets all of the muxes in a proper condition
+ *  if that bus is behind muxes.
+ *  If previously selected bus is behind the muxes turns off all the
+ *  muxes along the path to that bus.
+ *
+ *     bus - bus index, zero based
+ *
+ *     Returns: 0 on success, not 0 on failure
+ */
+int i2c_set_bus_num(unsigned int bus)
+{
+       int max = ll_entry_count(struct i2c_adapter, i2c);
+
+       if (I2C_ADAPTER(bus) >= max) {
+               printf("Error, wrong i2c adapter %d max %d possible\n",
+                      I2C_ADAPTER(bus), max);
+               return -2;
+       }
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+       if (bus >= CONFIG_SYS_NUM_I2C_BUSES)
+               return -1;
+#endif
+
+       if ((bus == I2C_BUS) && (I2C_ADAP->init_done > 0))
+               return 0;
+
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+       i2c_mux_disconnet_all();
+#endif
+
+       gd->cur_i2c_bus = bus;
+       if (I2C_ADAP->init_done == 0)
+               i2c_init_bus(bus, I2C_ADAP->speed, I2C_ADAP->slaveaddr);
+
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+       i2c_mux_set_all();
+#endif
+       return 0;
+}
+
+/*
+ * Probe the given I2C chip address.  Returns 0 if a chip responded,
+ * not 0 on failure.
+ */
+int i2c_probe(uint8_t chip)
+{
+       return I2C_ADAP->probe(I2C_ADAP, chip);
+}
+
+/*
+ * Read/Write interface:
+ *   chip:    I2C chip address, range 0..127
+ *   addr:    Memory (register) address within the chip
+ *   alen:    Number of bytes to use for addr (typically 1, 2 for larger
+ *              memories, 0 for register type devices with only one
+ *              register)
+ *   buffer:  Where to read/write the data
+ *   len:     How many bytes to read/write
+ *
+ *   Returns: 0 on success, not 0 on failure
+ */
+int i2c_read(uint8_t chip, unsigned int addr, int alen,
+                               uint8_t *buffer, int len)
+{
+       return I2C_ADAP->read(I2C_ADAP, chip, addr, alen, buffer, len);
+}
+
+int i2c_write(uint8_t chip, unsigned int addr, int alen,
+                               uint8_t *buffer, int len)
+{
+       return I2C_ADAP->write(I2C_ADAP, chip, addr, alen, buffer, len);
+}
+
+unsigned int i2c_set_bus_speed(unsigned int speed)
+{
+       unsigned int ret;
+
+       if (I2C_ADAP->set_bus_speed == NULL)
+               return 0;
+       ret = I2C_ADAP->set_bus_speed(I2C_ADAP, speed);
+       if (gd->flags & GD_FLG_RELOC)
+               I2C_ADAP->speed = ret;
+
+       return ret;
+}
+
+unsigned int i2c_get_bus_speed(void)
+{
+       struct i2c_adapter *cur = I2C_ADAP;
+       return cur->speed;
+}
+
+uint8_t i2c_reg_read(uint8_t addr, uint8_t reg)
+{
+       uint8_t buf;
+
+#ifdef CONFIG_8xx
+       /* MPC8xx needs this.  Maybe one day we can get rid of it. */
+       /* maybe it is now the time for it ... */
+       i2c_set_bus_num(i2c_get_bus_num());
+#endif
+       i2c_read(addr, reg, 1, &buf, 1);
+
+#ifdef DEBUG
+       printf("%s: bus=%d addr=0x%02x, reg=0x%02x, val=0x%02x\n",
+              __func__, i2c_get_bus_num(), addr, reg, buf);
+#endif
+
+       return buf;
+}
+
+void i2c_reg_write(uint8_t addr, uint8_t reg, uint8_t val)
+{
+#ifdef CONFIG_8xx
+       /* MPC8xx needs this.  Maybe one day we can get rid of it. */
+       /* maybe it is now the time for it ... */
+       i2c_set_bus_num(i2c_get_bus_num());
+#endif
+
+#ifdef DEBUG
+       printf("%s: bus=%d addr=0x%02x, reg=0x%02x, val=0x%02x\n",
+              __func__, i2c_get_bus_num(), addr, reg, val);
+#endif
+
+       i2c_write(addr, reg, 1, &val, 1);
+}
+
+void __i2c_init(int speed, int slaveaddr)
+{
+       i2c_init_bus(i2c_get_bus_num(), speed, slaveaddr);
+}
+void i2c_init(int speed, int slaveaddr)
+       __attribute__((weak, alias("__i2c_init")));
index 3eadbac0cd5542b6a68944238ab310deeeffe70f..06ba4e39f1f5ef40f3589e87f75dae3e98fc5481 100644 (file)
 #include <i2c.h>
 #include <watchdog.h>
 
+#ifdef I2C_QUIRK_REG
+struct mxc_i2c_regs {
+       uint8_t         iadr;
+       uint8_t         ifdr;
+       uint8_t         i2cr;
+       uint8_t         i2sr;
+       uint8_t         i2dr;
+};
+#else
 struct mxc_i2c_regs {
        uint32_t        iadr;
        uint32_t        ifdr;
@@ -29,8 +38,8 @@ struct mxc_i2c_regs {
        uint32_t        i2sr;
        uint32_t        i2dr;
 };
+#endif
 
-#define I2CR_IEN       (1 << 7)
 #define I2CR_IIEN      (1 << 6)
 #define I2CR_MSTA      (1 << 5)
 #define I2CR_MTX       (1 << 4)
@@ -43,10 +52,39 @@ struct mxc_i2c_regs {
 #define I2SR_IIF       (1 << 1)
 #define I2SR_RX_NO_AK  (1 << 0)
 
+#ifdef I2C_QUIRK_REG
+#define I2CR_IEN       (0 << 7)
+#define I2CR_IDIS      (1 << 7)
+#define I2SR_IIF_CLEAR (1 << 1)
+#else
+#define I2CR_IEN       (1 << 7)
+#define I2CR_IDIS      (0 << 7)
+#define I2SR_IIF_CLEAR (0 << 1)
+#endif
+
 #if defined(CONFIG_HARD_I2C) && !defined(CONFIG_SYS_I2C_BASE)
 #error "define CONFIG_SYS_I2C_BASE to use the mxc_i2c driver"
 #endif
 
+#ifdef I2C_QUIRK_REG
+static u16 i2c_clk_div[60][2] = {
+       { 20,   0x00 }, { 22,   0x01 }, { 24,   0x02 }, { 26,   0x03 },
+       { 28,   0x04 }, { 30,   0x05 }, { 32,   0x09 }, { 34,   0x06 },
+       { 36,   0x0A }, { 40,   0x07 }, { 44,   0x0C }, { 48,   0x0D },
+       { 52,   0x43 }, { 56,   0x0E }, { 60,   0x45 }, { 64,   0x12 },
+       { 68,   0x0F }, { 72,   0x13 }, { 80,   0x14 }, { 88,   0x15 },
+       { 96,   0x19 }, { 104,  0x16 }, { 112,  0x1A }, { 128,  0x17 },
+       { 136,  0x4F }, { 144,  0x1C }, { 160,  0x1D }, { 176,  0x55 },
+       { 192,  0x1E }, { 208,  0x56 }, { 224,  0x22 }, { 228,  0x24 },
+       { 240,  0x1F }, { 256,  0x23 }, { 288,  0x5C }, { 320,  0x25 },
+       { 384,  0x26 }, { 448,  0x2A }, { 480,  0x27 }, { 512,  0x2B },
+       { 576,  0x2C }, { 640,  0x2D }, { 768,  0x31 }, { 896,  0x32 },
+       { 960,  0x2F }, { 1024, 0x33 }, { 1152, 0x34 }, { 1280, 0x35 },
+       { 1536, 0x36 }, { 1792, 0x3A }, { 1920, 0x37 }, { 2048, 0x3B },
+       { 2304, 0x3C }, { 2560, 0x3D }, { 3072, 0x3E }, { 3584, 0x7A },
+       { 3840, 0x3F }, { 4096, 0x7B }, { 5120, 0x7D }, { 6144, 0x7E },
+};
+#else
 static u16 i2c_clk_div[50][2] = {
        { 22,   0x20 }, { 24,   0x21 }, { 26,   0x22 }, { 28,   0x23 },
        { 30,   0x00 }, { 32,   0x24 }, { 36,   0x25 }, { 40,   0x26 },
@@ -62,6 +100,7 @@ static u16 i2c_clk_div[50][2] = {
        { 1920, 0x1B }, { 2048, 0x3F }, { 2304, 0x1C }, { 2560, 0x1D },
        { 3072, 0x1E }, { 3840, 0x1F }
 };
+#endif
 
 /*
  * Calculate and set proper clock divider
@@ -109,7 +148,7 @@ static int bus_i2c_set_bus_speed(void *base, int speed)
        writeb(idx, &i2c_regs->ifdr);
 
        /* Reset module */
-       writeb(0, &i2c_regs->i2cr);
+       writeb(I2CR_IDIS, &i2c_regs->i2cr);
        writeb(0, &i2c_regs->i2sr);
        return 0;
 }
@@ -141,7 +180,11 @@ static int wait_for_sr_state(struct mxc_i2c_regs *i2c_regs, unsigned state)
        for (;;) {
                sr = readb(&i2c_regs->i2sr);
                if (sr & I2SR_IAL) {
+#ifdef I2C_QUIRK_REG
+                       writeb(sr | I2SR_IAL, &i2c_regs->i2sr);
+#else
                        writeb(sr & ~I2SR_IAL, &i2c_regs->i2sr);
+#endif
                        printf("%s: Arbitration lost sr=%x cr=%x state=%x\n",
                                __func__, sr, readb(&i2c_regs->i2cr), state);
                        return -ERESTART;
@@ -162,7 +205,7 @@ static int tx_byte(struct mxc_i2c_regs *i2c_regs, u8 byte)
 {
        int ret;
 
-       writeb(0, &i2c_regs->i2sr);
+       writeb(I2SR_IIF_CLEAR, &i2c_regs->i2sr);
        writeb(byte, &i2c_regs->i2dr);
        ret = wait_for_sr_state(i2c_regs, ST_IIF);
        if (ret < 0)
@@ -198,14 +241,18 @@ static int i2c_init_transfer_(struct mxc_i2c_regs *i2c_regs,
        int ret;
 
        /* Enable I2C controller */
+#ifdef I2C_QUIRK_REG
+       if (readb(&i2c_regs->i2cr) & I2CR_IDIS) {
+#else
        if (!(readb(&i2c_regs->i2cr) & I2CR_IEN)) {
+#endif
                writeb(I2CR_IEN, &i2c_regs->i2cr);
                /* Wait for controller to be stable */
                udelay(50);
        }
        if (readb(&i2c_regs->iadr) == (chip << 1))
                writeb((chip << 1) ^ 2, &i2c_regs->iadr);
-       writeb(0, &i2c_regs->i2sr);
+       writeb(I2SR_IIF_CLEAR, &i2c_regs->i2sr);
        ret = wait_for_sr_state(i2c_regs, ST_BUS_IDLE);
        if (ret < 0)
                return ret;
@@ -253,7 +300,8 @@ static int i2c_init_transfer(struct mxc_i2c_regs *i2c_regs,
                printf("%s: failed for chip 0x%x retry=%d\n", __func__, chip,
                                retry);
                if (ret != -ERESTART)
-                       writeb(0, &i2c_regs->i2cr);     /* Disable controller */
+                       /* Disable controller */
+                       writeb(I2CR_IDIS, &i2c_regs->i2cr);
                udelay(100);
                if (i2c_idle_bus(i2c_regs) < 0)
                        break;
@@ -293,7 +341,7 @@ int bus_i2c_read(void *base, uchar chip, uint addr, int alen, uchar *buf,
        if (len == 1)
                temp |= I2CR_TX_NO_AK;
        writeb(temp, &i2c_regs->i2cr);
-       writeb(0, &i2c_regs->i2sr);
+       writeb(I2SR_IIF_CLEAR, &i2c_regs->i2sr);
        readb(&i2c_regs->i2dr);         /* dummy read to clear ICF */
 
        /* read data */
@@ -315,7 +363,7 @@ int bus_i2c_read(void *base, uchar chip, uint addr, int alen, uchar *buf,
                        temp |= I2CR_TX_NO_AK;
                        writeb(temp, &i2c_regs->i2cr);
                }
-               writeb(0, &i2c_regs->i2sr);
+               writeb(I2SR_IIF_CLEAR, &i2c_regs->i2sr);
                buf[i] = readb(&i2c_regs->i2dr);
        }
        i2c_imx_stop(i2c_regs);
index 52929ebc4e660f5deef9c07b929e67d340e4eedf..e7a15ba6448a7600ac5f8a077840e2e98533d2e3 100644 (file)
 #include <i2c.h>
 #include <asm/io.h>
 
-#ifdef CONFIG_HARD_I2C
-
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_I2C_MULTI_BUS)
-/*
- * Initialize the bus pointer to whatever one the SPD EEPROM is on.
- * Default is bus 0.  This is necessary because the DDR initialization
- * runs from ROM, and we can't switch buses because we can't modify
- * the global variables.
- */
-#ifndef CONFIG_SYS_SPD_BUS_NUM
-#define CONFIG_SYS_SPD_BUS_NUM 0
+static inline struct ppc4xx_i2c *ppc4xx_get_i2c(int hwadapnr)
+{
+       unsigned long base;
+
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+       defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+       defined(CONFIG_460EX) || defined(CONFIG_460GT)
+       base = CONFIG_SYS_PERIPHERAL_BASE + 0x00000700 + (hwadapnr * 0x100);
+#elif defined(CONFIG_440) || defined(CONFIG_405EX)
+/* all remaining 440 variants */
+       base = CONFIG_SYS_PERIPHERAL_BASE + 0x00000400 + (hwadapnr * 0x100);
+#else
+/* all 405 variants */
+       base = 0xEF600500 + (hwadapnr * 0x100);
 #endif
-static unsigned int i2c_bus_num __attribute__ ((section (".data"))) =
-       CONFIG_SYS_SPD_BUS_NUM;
-#endif /* CONFIG_I2C_MULTI_BUS */
+       return (struct ppc4xx_i2c *)base;
+}
 
-static void _i2c_bus_reset(void)
+static void _i2c_bus_reset(struct i2c_adapter *adap)
 {
-       struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+       struct ppc4xx_i2c *i2c = ppc4xx_get_i2c(adap->hwadapnr);
        int i;
        u8 dc;
 
@@ -75,11 +77,10 @@ static void _i2c_bus_reset(void)
        out_8(&i2c->xtcntlss, 0);
 }
 
-void i2c_init(int speed, int slaveaddr)
+static void ppc4xx_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
 {
-       struct ppc4xx_i2c *i2c;
+       struct ppc4xx_i2c *i2c = ppc4xx_get_i2c(adap->hwadapnr);
        int val, divisor;
-       int bus;
 
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
        /*
@@ -90,67 +91,57 @@ void i2c_init(int speed, int slaveaddr)
        i2c_init_board();
 #endif
 
-       for (bus = 0; bus < CONFIG_SYS_MAX_I2C_BUS; bus++) {
-               I2C_SET_BUS(bus);
-
-               /* Set i2c pointer after calling I2C_SET_BUS() */
-               i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
-
-               /* Handle possible failed I2C state */
-               /* FIXME: put this into i2c_init_board()? */
-               _i2c_bus_reset();
+       /* Handle possible failed I2C state */
+       /* FIXME: put this into i2c_init_board()? */
+       _i2c_bus_reset(adap);
 
-               /* clear lo master address */
-               out_8(&i2c->lmadr, 0);
+       /* clear lo master address */
+       out_8(&i2c->lmadr, 0);
 
-               /* clear hi master address */
-               out_8(&i2c->hmadr, 0);
-
-               /* clear lo slave address */
-               out_8(&i2c->lsadr, 0);
+       /* clear hi master address */
+       out_8(&i2c->hmadr, 0);
 
-               /* clear hi slave address */
-               out_8(&i2c->hsadr, 0);
+       /* clear lo slave address */
+       out_8(&i2c->lsadr, 0);
 
-               /* Clock divide Register */
-               /* set divisor according to freq_opb */
-               divisor = (get_OPB_freq() - 1) / 10000000;
-               if (divisor == 0)
-                       divisor = 1;
-               out_8(&i2c->clkdiv, divisor);
+       /* clear hi slave address */
+       out_8(&i2c->hsadr, 0);
 
-               /* no interrupts */
-               out_8(&i2c->intrmsk, 0);
+       /* Clock divide Register */
+       /* set divisor according to freq_opb */
+       divisor = (get_OPB_freq() - 1) / 10000000;
+       if (divisor == 0)
+               divisor = 1;
+       out_8(&i2c->clkdiv, divisor);
 
-               /* clear transfer count */
-               out_8(&i2c->xfrcnt, 0);
+       /* no interrupts */
+       out_8(&i2c->intrmsk, 0);
 
-               /* clear extended control & stat */
-               /* write 1 in SRC SRS SWC SWS to clear these fields */
-               out_8(&i2c->xtcntlss, 0xF0);
+       /* clear transfer count */
+       out_8(&i2c->xfrcnt, 0);
 
-               /* Mode Control Register
-                  Flush Slave/Master data buffer */
-               out_8(&i2c->mdcntl, IIC_MDCNTL_FSDB | IIC_MDCNTL_FMDB);
+       /* clear extended control & stat */
+       /* write 1 in SRC SRS SWC SWS to clear these fields */
+       out_8(&i2c->xtcntlss, 0xF0);
 
-               val = in_8(&i2c->mdcntl);
+       /* Mode Control Register
+          Flush Slave/Master data buffer */
+       out_8(&i2c->mdcntl, IIC_MDCNTL_FSDB | IIC_MDCNTL_FMDB);
 
-               /* Ignore General Call, slave transfers are ignored,
-                * disable interrupts, exit unknown bus state, enable hold
-                * SCL 100kHz normaly or FastMode for 400kHz and above
-                */
+       val = in_8(&i2c->mdcntl);
 
-               val |= IIC_MDCNTL_EUBS | IIC_MDCNTL_HSCL;
-               if (speed >= 400000)
-                       val |= IIC_MDCNTL_FSM;
-               out_8(&i2c->mdcntl, val);
+       /* Ignore General Call, slave transfers are ignored,
+        * disable interrupts, exit unknown bus state, enable hold
+        * SCL 100kHz normaly or FastMode for 400kHz and above
+        */
 
-               /* clear control reg */
-               out_8(&i2c->cntl, 0x00);
-       }
+       val |= IIC_MDCNTL_EUBS | IIC_MDCNTL_HSCL;
+       if (speed >= 400000)
+               val |= IIC_MDCNTL_FSM;
+       out_8(&i2c->mdcntl, val);
 
-       /* set to SPD bus as default bus upon powerup */
-       I2C_SET_BUS(CONFIG_SYS_SPD_BUS_NUM);
+       /* clear control reg */
+       out_8(&i2c->cntl, 0x00);
 }
 
 /*
@@ -178,14 +169,15 @@ void i2c_init(int speed, int slaveaddr)
  *
  * It does not check XFRCNT.
  */
-static int i2c_transfer(unsigned char cmd_type,
+static int _i2c_transfer(struct i2c_adapter *adap,
+                       unsigned char cmd_type,
                        unsigned char chip,
                        unsigned char addr[],
                        unsigned char addr_len,
                        unsigned char data[],
                        unsigned short data_len)
 {
-       struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+       struct ppc4xx_i2c *i2c = ppc4xx_get_i2c(adap->hwadapnr);
        u8 *ptr;
        int reading;
        int tran, cnt;
@@ -329,7 +321,7 @@ static int i2c_transfer(unsigned char cmd_type,
        return result;
 }
 
-int i2c_probe(uchar chip)
+static int ppc4xx_i2c_probe(struct i2c_adapter *adap, uchar chip)
 {
        uchar buf[1];
 
@@ -340,11 +332,11 @@ int i2c_probe(uchar chip)
         * address was <ACK>ed (i.e. there was a chip at that address which
         * drove the data line low).
         */
-       return (i2c_transfer(1, chip << 1, 0, 0, buf, 1) != 0);
+       return (_i2c_transfer(adap, 1, chip << 1, 0, 0, buf, 1) != 0);
 }
 
-static int ppc4xx_i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer,
-                              int len, int read)
+static int ppc4xx_i2c_transfer(struct i2c_adapter *adap, uchar chip, uint addr,
+                              int alen, uchar *buffer, int len, int read)
 {
        uchar xaddr[4];
        int ret;
@@ -378,43 +370,50 @@ static int ppc4xx_i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer,
                chip |= ((addr >> (alen * 8)) &
                         CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
 #endif
-       if ((ret = i2c_transfer(read, chip << 1, &xaddr[4 - alen], alen,
-                               buffer, len)) != 0) {
+       ret = _i2c_transfer(adap, read, chip << 1, &xaddr[4 - alen], alen,
+                           buffer, len);
+       if (ret) {
                printf("I2C %s: failed %d\n", read ? "read" : "write", ret);
-
                return 1;
        }
 
        return 0;
 }
 
-int i2c_read(uchar chip, uint addr, int alen, uchar * buffer, int len)
+static int ppc4xx_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
+                          int alen, uchar *buffer, int len)
 {
-       return ppc4xx_i2c_transfer(chip, addr, alen, buffer, len, 1);
+       return ppc4xx_i2c_transfer(adap, chip, addr, alen, buffer, len, 1);
 }
 
-int i2c_write(uchar chip, uint addr, int alen, uchar * buffer, int len)
+static int ppc4xx_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
+                           int alen, uchar *buffer, int len)
 {
-       return ppc4xx_i2c_transfer(chip, addr, alen, buffer, len, 0);
+       return ppc4xx_i2c_transfer(adap, chip, addr, alen, buffer, len, 0);
 }
 
-#if defined(CONFIG_I2C_MULTI_BUS)
-/*
- * Functions for multiple I2C bus handling
- */
-unsigned int i2c_get_bus_num(void)
+static unsigned int ppc4xx_i2c_set_bus_speed(struct i2c_adapter *adap,
+                                            unsigned int speed)
 {
-       return i2c_bus_num;
-}
-
-int i2c_set_bus_num(unsigned int bus)
-{
-       if (bus >= CONFIG_SYS_MAX_I2C_BUS)
+       if (speed != adap->speed)
                return -1;
-
-       i2c_bus_num = bus;
-
-       return 0;
+       return speed;
 }
-#endif /* CONFIG_I2C_MULTI_BUS */
-#endif /* CONFIG_HARD_I2C */
+
+/*
+ * Register ppc4xx i2c adapters
+ */
+#ifdef CONFIG_SYS_I2C_PPC4XX_CH0
+U_BOOT_I2C_ADAP_COMPLETE(ppc4xx_0, ppc4xx_i2c_init, ppc4xx_i2c_probe,
+                        ppc4xx_i2c_read, ppc4xx_i2c_write,
+                        ppc4xx_i2c_set_bus_speed,
+                        CONFIG_SYS_I2C_PPC4XX_SPEED_0,
+                        CONFIG_SYS_I2C_PPC4XX_SLAVE_0, 0)
+#endif
+#ifdef CONFIG_SYS_I2C_PPC4XX_CH1
+U_BOOT_I2C_ADAP_COMPLETE(ppc4xx_1, ppc4xx_i2c_init, ppc4xx_i2c_probe,
+                        ppc4xx_i2c_read, ppc4xx_i2c_write,
+                        ppc4xx_i2c_set_bus_speed,
+                        CONFIG_SYS_I2C_PPC4XX_SPEED_1,
+                        CONFIG_SYS_I2C_PPC4XX_SLAVE_1, 1)
+#endif
index 0a1423016e90a2a13e327bde0ee6d650a528516e..a2baec0ace2054b7a6e4870a08435b5818675e81 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 */
@@ -109,10 +129,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
  */
@@ -251,39 +267,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.
@@ -314,14 +297,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   */
@@ -344,7 +323,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;
 
@@ -362,7 +341,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",
@@ -436,7 +416,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;
 
@@ -466,3 +447,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 e96d5d5d090423c71feb4fa7e683862219d2b1be..9ac3969a07cfe1d71df571b978e815ff95abbf03 100644 (file)
@@ -19,8 +19,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static unsigned int i2c_bus_num;
-
 /* Information about i2c controller */
 struct i2c_bus {
        int                     id;
@@ -268,7 +266,8 @@ exit:
        return error;
 }
 
-static int tegra_i2c_write_data(u32 addr, u8 *data, u32 len)
+static int tegra_i2c_write_data(struct i2c_bus *bus, u32 addr, u8 *data,
+                               u32 len)
 {
        int error;
        struct i2c_trans_info trans_info;
@@ -279,14 +278,15 @@ static int tegra_i2c_write_data(u32 addr, u8 *data, u32 len)
        trans_info.num_bytes = len;
        trans_info.is_10bit_address = 0;
 
-       error = send_recv_packets(&i2c_controllers[i2c_bus_num], &trans_info);
+       error = send_recv_packets(bus, &trans_info);
        if (error)
                debug("tegra_i2c_write_data: Error (%d) !!!\n", error);
 
        return error;
 }
 
-static int tegra_i2c_read_data(u32 addr, u8 *data, u32 len)
+static int tegra_i2c_read_data(struct i2c_bus *bus, u32 addr, u8 *data,
+                              u32 len)
 {
        int error;
        struct i2c_trans_info trans_info;
@@ -297,7 +297,7 @@ static int tegra_i2c_read_data(u32 addr, u8 *data, u32 len)
        trans_info.num_bytes = len;
        trans_info.is_10bit_address = 0;
 
-       error = send_recv_packets(&i2c_controllers[i2c_bus_num], &trans_info);
+       error = send_recv_packets(bus, &trans_info);
        if (error)
                debug("tegra_i2c_read_data: Error (%d) !!!\n", error);
 
@@ -308,18 +308,35 @@ static int tegra_i2c_read_data(u32 addr, u8 *data, u32 len)
 #error "Please enable device tree support to use this driver"
 #endif
 
-unsigned int i2c_get_bus_speed(void)
+/**
+ * Check that a bus number is valid and return a pointer to it
+ *
+ * @param bus_num      Bus number to check / return
+ * @return pointer to bus, if valid, else NULL
+ */
+static struct i2c_bus *tegra_i2c_get_bus(struct i2c_adapter *adap)
 {
-       return i2c_controllers[i2c_bus_num].speed;
+       struct i2c_bus *bus;
+
+       bus = &i2c_controllers[adap->hwadapnr];
+       if (!bus->inited) {
+               debug("%s: Bus %u not available\n", __func__, adap->hwadapnr);
+               return NULL;
+       }
+
+       return bus;
 }
 
-int i2c_set_bus_speed(unsigned int speed)
+static unsigned int tegra_i2c_set_bus_speed(struct i2c_adapter *adap,
+                       unsigned int speed)
 {
-       struct i2c_bus *i2c_bus;
+       struct i2c_bus *bus;
 
-       i2c_bus = &i2c_controllers[i2c_bus_num];
-       i2c_bus->speed = speed;
-       i2c_init_controller(i2c_bus);
+       bus = tegra_i2c_get_bus(adap);
+       if (!bus)
+               return 0;
+       bus->speed = speed;
+       i2c_init_controller(bus);
 
        return 0;
 }
@@ -434,7 +451,7 @@ void i2c_init_board(void)
                return;
 }
 
-void i2c_init(int speed, int slaveaddr)
+static void tegra_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
 {
        /* This will override the speed selected in the fdt for that port */
        debug("i2c_init(speed=%u, slaveaddr=0x%x)\n", speed, slaveaddr);
@@ -442,7 +459,7 @@ void i2c_init(int speed, int slaveaddr)
 }
 
 /* i2c write version without the register address */
-int i2c_write_data(uchar chip, uchar *buffer, int len)
+int i2c_write_data(struct i2c_bus *bus, uchar chip, uchar *buffer, int len)
 {
        int rc;
 
@@ -454,7 +471,7 @@ int i2c_write_data(uchar chip, uchar *buffer, int len)
        debug("\n");
 
        /* Shift 7-bit address over for lower-level i2c functions */
-       rc = tegra_i2c_write_data(chip << 1, buffer, len);
+       rc = tegra_i2c_write_data(bus, chip << 1, buffer, len);
        if (rc)
                debug("i2c_write_data(): rc=%d\n", rc);
 
@@ -462,13 +479,13 @@ int i2c_write_data(uchar chip, uchar *buffer, int len)
 }
 
 /* i2c read version without the register address */
-int i2c_read_data(uchar chip, uchar *buffer, int len)
+int i2c_read_data(struct i2c_bus *bus, uchar chip, uchar *buffer, int len)
 {
        int rc;
 
        debug("inside i2c_read_data():\n");
        /* Shift 7-bit address over for lower-level i2c functions */
-       rc = tegra_i2c_read_data(chip << 1, buffer, len);
+       rc = tegra_i2c_read_data(bus, chip << 1, buffer, len);
        if (rc) {
                debug("i2c_read_data(): rc=%d\n", rc);
                return rc;
@@ -484,14 +501,18 @@ int i2c_read_data(uchar chip, uchar *buffer, int len)
 }
 
 /* Probe to see if a chip is present. */
-int i2c_probe(uchar chip)
+static int tegra_i2c_probe(struct i2c_adapter *adap, uchar chip)
 {
+       struct i2c_bus *bus;
        int rc;
        uchar reg;
 
        debug("i2c_probe: addr=0x%x\n", chip);
+       bus = tegra_i2c_get_bus(adap);
+       if (!bus)
+               return 1;
        reg = 0;
-       rc = i2c_write_data(chip, &reg, 1);
+       rc = i2c_write_data(bus, chip, &reg, 1);
        if (rc) {
                debug("Error probing 0x%x.\n", chip);
                return 1;
@@ -506,13 +527,18 @@ static int i2c_addr_ok(const uint addr, const int alen)
 }
 
 /* Read bytes */
-int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
+static int tegra_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
+                       int alen, uchar *buffer, int len)
 {
+       struct i2c_bus *bus;
        uint offset;
        int i;
 
        debug("i2c_read: chip=0x%x, addr=0x%x, len=0x%x\n",
                                chip, addr, len);
+       bus = tegra_i2c_get_bus(adap);
+       if (!bus)
+               return 1;
        if (!i2c_addr_ok(addr, alen)) {
                debug("i2c_read: Bad address %x.%d.\n", addr, alen);
                return 1;
@@ -524,13 +550,13 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
                                data[alen - i - 1] =
                                        (addr + offset) >> (8 * i);
                        }
-                       if (i2c_write_data(chip, data, alen)) {
+                       if (i2c_write_data(bus, chip, data, alen)) {
                                debug("i2c_read: error sending (0x%x)\n",
                                        addr);
                                return 1;
                        }
                }
-               if (i2c_read_data(chip, buffer + offset, 1)) {
+               if (i2c_read_data(bus, chip, buffer + offset, 1)) {
                        debug("i2c_read: error reading (0x%x)\n", addr);
                        return 1;
                }
@@ -540,13 +566,18 @@ 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 tegra_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
+                       int alen, uchar *buffer, int len)
 {
+       struct i2c_bus *bus;
        uint offset;
        int i;
 
        debug("i2c_write: chip=0x%x, addr=0x%x, len=0x%x\n",
                                chip, addr, len);
+       bus = tegra_i2c_get_bus(adap);
+       if (!bus)
+               return 1;
        if (!i2c_addr_ok(addr, alen)) {
                debug("i2c_write: Bad address %x.%d.\n", addr, alen);
                return 1;
@@ -556,7 +587,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
                for (i = 0; i < alen; i++)
                        data[alen - i - 1] = (addr + offset) >> (8 * i);
                data[alen] = buffer[offset];
-               if (i2c_write_data(chip, data, alen + 1)) {
+               if (i2c_write_data(bus, chip, data, alen + 1)) {
                        debug("i2c_write: error sending (0x%x)\n", addr);
                        return 1;
                }
@@ -565,30 +596,11 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
        return 0;
 }
 
-#if defined(CONFIG_I2C_MULTI_BUS)
-/*
- * Functions for multiple I2C bus handling
- */
-unsigned int i2c_get_bus_num(void)
-{
-       return i2c_bus_num;
-}
-
-int i2c_set_bus_num(unsigned int bus)
-{
-       if (bus >= TEGRA_I2C_NUM_CONTROLLERS || !i2c_controllers[bus].inited)
-               return -1;
-       i2c_bus_num = bus;
-
-       return 0;
-}
-#endif
-
 int tegra_i2c_get_dvc_bus_num(void)
 {
        int i;
 
-       for (i = 0; i < CONFIG_SYS_MAX_I2C_BUS; i++) {
+       for (i = 0; i < TEGRA_I2C_NUM_CONTROLLERS; i++) {
                struct i2c_bus *bus = &i2c_controllers[i];
 
                if (bus->inited && bus->is_dvc)
@@ -597,3 +609,19 @@ int tegra_i2c_get_dvc_bus_num(void)
 
        return -1;
 }
+
+/*
+ * Register soft i2c adapters
+ */
+U_BOOT_I2C_ADAP_COMPLETE(tegra0, tegra_i2c_init, tegra_i2c_probe,
+                        tegra_i2c_read, tegra_i2c_write,
+                        tegra_i2c_set_bus_speed, 100000, 0, 0)
+U_BOOT_I2C_ADAP_COMPLETE(tegra1, tegra_i2c_init, tegra_i2c_probe,
+                        tegra_i2c_read, tegra_i2c_write,
+                        tegra_i2c_set_bus_speed, 100000, 0, 1)
+U_BOOT_I2C_ADAP_COMPLETE(tegra2, tegra_i2c_init, tegra_i2c_probe,
+                        tegra_i2c_read, tegra_i2c_write,
+                        tegra_i2c_set_bus_speed, 100000, 0, 2)
+U_BOOT_I2C_ADAP_COMPLETE(tegra3, tegra_i2c_init, tegra_i2c_probe,
+                        tegra_i2c_read, tegra_i2c_write,
+                        tegra_i2c_set_bus_speed, 100000, 0, 3)
index 77260a8d2069f07049578aaa44f0f82cadbaa870..77e06fb4fefc045226f286c5985e2fb8685eaea3 100644 (file)
@@ -68,6 +68,9 @@ typedef struct global_data {
        char env_buf[32];       /* buffer for getenv() before reloc. */
 #ifdef CONFIG_TRACE
        void            *trace_buff;    /* The trace buffer */
+#endif
+#if defined(CONFIG_SYS_I2C)
+       int             cur_i2c_bus;    /* current used i2c bus */
 #endif
        struct arch_global_data arch;   /* architecture-specific data */
 } gd_t;
index 6c204db0ab48c127c70bb2de34768c2b6be0961a..90a21768e92062327db59c2f216146215ea03342 100644 (file)
@@ -70,8 +70,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 82245c45862b65e5a9e884420601d3393482d32c..37bcac32c72fbb660a9ac696e3c0f554ab263aed 100644 (file)
 /*
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08 */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address */
index 233bc68ab8386d5023f2e70bb160512100c3b28a..54de966741549f5471bc68f4a818606e33f7a0ba 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index ad1bd7eb77b5cb0deb172c4b2e5649c63a5d138d..09043435b433d9a97fa55c7d6fcb4742a9bdd6ce 100644 (file)
@@ -443,14 +443,14 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_FIT_VERBOSE     /* enable fit_format_{error,warning}() */
 
 /* I2C */
-#define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed in Hz */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x118000
-#define CONFIG_SYS_I2C2_OFFSET         0x119000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL             /* Use FSL common I2C driver */
+#define CONFIG_SYS_FSL_I2C_SPEED       400000  /* I2C speed in Hz */
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000  /* I2C speed in Hz */
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x118000
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x119000
 
 /*
  * RTC configuration
index b6a879058e4f0e67c593884946a72b7a5bbe1c38..948394eddddbe7041c6da447e58449eb329d2fe2 100644 (file)
@@ -259,13 +259,11 @@ extern unsigned long get_sdram_size(void);
 #define CONFIG_FIT
 #define CONFIG_FIT_VERBOSE     /* enable fit_format_{error,warning}() */
 
-#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*/
-#define CONFIG_SYS_I2C_OFFSET          0x3000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
 
 /* I2C EEPROM */
 #define CONFIG_CMD_EEPROM
index e8e2c6f24d6ae1a8773c56dece33dc81f41c34fd..1ab68915859bfac3b8f15c2a2dbedd15f1bf05ed 100644 (file)
@@ -435,15 +435,14 @@ combinations. this should be removed later
 #define CONFIG_FIT
 #define CONFIG_FIT_VERBOSE     /* enable fit_format_{error,warning}() */
 
-#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           400800 /* I2C speed and slave address*/
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400800 /* I2C speed and slave address*/
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C2_SPEED      400800 /* I2C speed and slave address*/
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /* I2C EEPROM */
 #define CONFIG_ID_EEPROM
index 66e379078217768918dc7f984c86927c3166181e..40471b78a191c5d7f895c830b2ea1ed3658de217 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC08) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2C with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-
-#define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* bytes of address             */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
+
+#define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08     */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* bytes of address     */
 /* mask of address bits that overflow into the "EEPROM chip address"   */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW    0x07
 
index d6fca13a9f0e1d2ee5012d9f7985c239ff6be241..3906863f05b20388e5d250694b68833efbd42c77 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index e7609a75ebf667969e1fc8f4bd3e2baaf0bc5106..323eac3fb4b4a963aaf2734970ed54d410071d4f 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index 0f98274418a7b48c764ff44d1a9a4cc965686b5f..bd9fd6ee7bf4b58aef1a647e6ac3d58897d23bba 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index c6fa22a639fdb66983ca2c104478a40554ea0816..94ef16e06c3cece23eac75dc8a3ca3b65ba14c48 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC08) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index f43660ebe50c6b9ba857a72dcb02b6ccf97bef22..8383c1935997b8b627429f4f8d05266c236d08de 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index dbf0662b546d3bdd174a77c4e637186fbfd7cbbd..ec9f5aec4a871e8c05082b0c6121fa6fb48a330a 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC32) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC32             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2       /* Bytes of address             */
index e5a962ae2397bf7e79809659e08749302bac3b47..ba926abdc0329efe29ae3f1a9d6909cdecaf364a 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index 2a89efe190cbba575cf23a70e9a1e4f55a259709..dc4df29455b241ebb8c5d7a3d865e0fa9fd27378 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC08) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2C with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index b11262690f45b22f2a69099db953c57b20d0fdda..a85a418fb1d1e0d392bdd3e2a66e9d9bb8ef1b62 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 bbd0022f749bcb2bbc99cb9ef6664e58bebc314a..7bbcb77af7cfae8a030b706624e97ced426e49ca 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 a19b4318826f3f0a2bbe9d980691377afdaed8f4..fa3efabea4713c8024cb6bccdcae86d1c8a21710 100644 (file)
  #define CONFIG_SERVERIP         10.0.0.1
  #define CONFIG_ETHADDR          00:40:a6:80:14:5
  */
-#define CONFIG_HARD_I2C         1              /* hardware support for i2c */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
 #define CONFIG_SDRAM_BANK0             1
-#define CONFIG_SYS_I2C_SPEED               400000      /* I2C speed and slave address  */
-#define CONFIG_SYS_I2C_SLAVE               0x7F
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0              400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0              0x7F
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x57
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 #define CONFIG_IDENT_STRING     "Cray L1"
index 9254796cfb3434f203cb8e8d496217d5efd9ea27..872a2b4408b5ed774b903db2c398155b6d5801f0 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index b6825d5ad2657ff6ee1fb2cf8a93a97b87518027..5b9e0d2f41ca5ca13c7a531978cbc1726242b148 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC08) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index 9b338535d9fb21a49080ea503241c6d2a3ef3e18..08271132dc2e933a5704c4cefed57393683d83f2 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
-#define CONFIG_I2C_MULTI_BUS    1
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
+#define CONFIG_SYS_I2C_PPC4XX_CH1
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_1          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_1          0x7F
 
 #define CONFIG_SYS_SPD_BUS_NUM         0
 #define IIC1_MCP3021_ADDR      0x4d
 #define IIC1_USB2507_ADDR      0x2c
-#ifdef CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_NOPROBES        {{1, IIC1_USB2507_ADDR}}
-#endif
+#define CONFIG_SYS_I2C_NOPROBES                { {1, IIC1_USB2507_ADDR} }
+
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x54
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
index 1edd6df7c376d14580e2e413a9202f5d51eb34a9..5a74abcd4108453b2f3d8a2191e8dea0b64b95dd 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT24WC08             */
 /* CAT24WC08/16... */
index 2962c915aa0d548d0e002aa3c8ba7e38ca76b185..06c0e50c9665e6db2392e4a7842b53e5c3528488 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 943d6ddd98497e9e128404968abd47e9f2ee07e3..d20ca778709242032762c3dfbee8378b3e3f9192 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
 #if 0 /* test-only */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 #else
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
 #endif
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT24WC08             */
 #define CONFIG_SYS_EEPROM_WREN         1
index c1d3f10525111f2f87707c169bacc24fd86f9f22..ddeccb08686e0e197aaeab6b70bfb859bd994102 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 30effc3d722f8f8c20b2ea25a0c9ccc0fe762de5..cf796bf2d919dafe8feb182647852a977a8cfdd1 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index 8c217562a164d239fbf0db0edc3c3bae130f1c39..5aaa9767e97050cbe2dc4a08323c5701f6908f80 100644 (file)
 /* -------------------------------------------------------------------- */
 
 /* Generic FreeScale hardware I2C support */
-#define CONFIG_HARD_I2C
-#define CONFIG_FSL_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
 #define CONFIG_CMD_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
-
-/* I2C bus configuration */
-#define CONFIG_SYS_I2C_SPEED 400000
-#define CONFIG_SYS_I2C_SLAVE 0x7F
 
 /* DDR2 SO-RDIMM SPD EEPROM is at I2C0-0x51 */
 #define CONFIG_SYS_SPD_BUS_NUM 0
index 48a05d52ff815fc89b26b568cf368e2695af689a..40d0d7cab9381cb93eb26c2bb08ee5e81ff4d82e 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 c7409debe11be8a4e691c9853afcc95879514eab..590abc30dfc379f0d3f511204f16ccd53606adca 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 1247181b5443c82449d2e9ea564a345cc04d52bc..c852ca998b18e396ae0133b4884ce45a7c5a4241 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
  */
@@ -64,9 +66,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 bcc007c4d278f95595e3fce4ce0fa9018f246d0c..cbc8b5bbc155c474e30e8cc4b20d018051711015 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 c855c7f02f77f7d1261f269e9aa678ff878d27a1..6439d99bf87f899120f17ec4df72a77e4859b276 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 
 /*-----------------------------------------------------------------------
index d7377a8e910a25e34606beba189cb8938e6ee357..2cbb6eeb9c6ce60a87fab7b5904280426f6d0979 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       */
-#define CONFIG_SYS_I2C_NOPROBES      {0x69}         /* Don't probe these addrs */
-#define CONFIG_I2C_BUS1              1              /* Include i2c bus 1 supp  */
-
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
+#define CONFIG_SYS_I2C_PPC4XX_CH1
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_1 400000 /* I2C speed 400kHz */
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_1 0x7F
+#define CONFIG_SYS_I2C_NOPROBES { { 0, 0x69} } /* Don't probe these addrs */
 
 /*-----------------------------------------------------------------------
  * Environment
index 68451baf75f135f09faecefb33086e150d37098f..ef51e35df64bac85e49a044fc45a47359d6b7ecb 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 8af1269a456990eea74e2d8eeaba6b249553eaa0..6da07e7d06e2094e9c9b0ecf70a8f67c5b322f6e 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 df9ba5ea3c506569cc5120b2af56382324e2d656..fe901ce6c2902a93fcbc8e1c8841183c6872ac5f 100644 (file)
 #undef CONFIG_MCFPIT
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x58000
 #define CONFIG_SYS_IMMR                        CONFIG_SYS_MBAR
 
 #define CONFIG_BOOTDELAY               1       /* autoboot after 5 seconds */
index 4acac6c4421d8369c646e9ddcf7f6defb578b9ef..1d10f7f2a0c16b4bf42c9709c8c869ef18f05d8b 100644 (file)
 #undef CONFIG_MCFPIT
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x58000
 #define CONFIG_SYS_IMMR                        CONFIG_SYS_MBAR
 
 /* DSPI and Serial Flash */
index 1b80f829347ad1fb029c354ce384fbd0ce4e8ab9..aaaaa41a153e5d363a3fd40e889955f1bde32727 100644 (file)
 #undef CONFIG_MCFPIT
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_i2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x00000300
 #define CONFIG_SYS_IMMR                CONFIG_SYS_MBAR
 #define CONFIG_SYS_I2C_PINMUX_REG      (gpio->par_qspi)
 #define CONFIG_SYS_I2C_PINMUX_CLR      ~(GPIO_PAR_FECI2C_SCL_MASK | GPIO_PAR_FECI2C_SDA_MASK)
index bf37fdf14b024ca89031f9bf88cca1f00c54c43c..83122cf59f54d7f19eea7b2d19d7ef94dfb43b46 100644 (file)
@@ -97,11 +97,11 @@ TABILITY or FITNESS FO04-2007 Freescale Semiconductor, Inc.
 #define CONFIG_HOSTNAME                M5253DEMO
 
 /* I2C */
-#define CONFIG_FSL_I2C
-#define CONFIG_HARD_I2C                /* I2C with hw support */
-#define CONFIG_SYS_I2C_SPEED           80000
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x00000280
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x00000280
 #define CONFIG_SYS_IMMR                CONFIG_SYS_MBAR
 #define CONFIG_SYS_I2C_PINMUX_REG      (*(u32 *) (CONFIG_SYS_MBAR+0x19C))
 #define CONFIG_SYS_I2C_PINMUX_CLR      (0xFFFFE7FF)
index fa43231c49ead71a4d6623460c2c91ff6a07a85b..a77cb24975bb365c0e19d57882b9b93776358403 100644 (file)
 #endif
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x00000300
 #define CONFIG_SYS_IMMR                CONFIG_SYS_MBAR
 
 #define CONFIG_BOOTDELAY       1       /* autoboot after 1 seconds */
index 2b99ee9f1cfaaed3cf208004caf6b6fd5251bf91..bacee0a8fa6475bce104e0722a77c130257f2506 100644 (file)
 #endif
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x00000300
 #define CONFIG_SYS_IMMR                CONFIG_SYS_MBAR
 #define CONFIG_SYS_I2C_PINMUX_REG      (gpio_reg->par_feci2c)
 #define CONFIG_SYS_I2C_PINMUX_CLR      (0xFFF0)
index a98ded257077572b6fe710e82865740ccf3ec25d..0ced196489a3ac463dae0ef441581a5e935389b9 100644 (file)
 #undef CONFIG_MCFPIT
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x58000
 #define CONFIG_SYS_IMMR                        CONFIG_SYS_MBAR
 
 #define CONFIG_BOOTDELAY               1       /* autoboot after 5 seconds */
index d5d3bc48cddba18f18dffbe21b3482ea95d2a1b0..86b06f4f16338d7ecbd829068846102b0c933b77 100644 (file)
 #undef CONFIG_MCFPIT
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x58000
 #define CONFIG_SYS_IMMR                CONFIG_SYS_MBAR
 
 #define CONFIG_BOOTDELAY       1       /* autoboot after 5 seconds */
index 8657382c8ed41f736658946850a8c59bfa00a99d..cca76097dc034ad62b895b1547f2f1e2aa4edd5a 100644 (file)
 #undef CONFIG_MCFPIT
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x58000
 #define CONFIG_SYS_IMMR                CONFIG_SYS_MBAR
 
 #define CONFIG_BOOTDELAY       1       /* autoboot after 5 seconds */
index aa95de2a6729b0f6fec061ef86d861d52f55fb41..bc264276d4687a01942187efca325ae163c8d577 100644 (file)
 #undef CONFIG_MCFPIT
 
 /* I2c */
-#undef CONFIG_FSL_I2C
+#undef CONFIG_SYS_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 720e888f6f530209eda740222b7763f210627357..72ad8366fb0d9e040b0b9757aa2399ceb40c498e 100644 (file)
 #undef CONFIG_MCFPIT
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x58000
 #define CONFIG_SYS_IMMR                        CONFIG_SYS_MBAR
 
 /* DSPI and Serial Flash */
index 03dafd5440cf418b49aa77e678f429488b63b335..3dc87d6f61a08feb49514dec716c6f5bb473c6db 100644 (file)
 #undef CONFIG_MCFPIT
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSLI2C_OFFSET       0x58000
 #define CONFIG_SYS_IMMR                CONFIG_SYS_MBAR
 
 /* DSPI and Serial Flash */
index b5bf1c7f99928fcfe343295fed20fb596dd9ebfa..dc38219c1d5a0998e348d809beda10961b8ef7a6 100644 (file)
 #endif
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x00008F00
 #define CONFIG_SYS_IMMR                CONFIG_SYS_MBAR
 
 /* PCI */
index 3924936a5a652675af96a1bb8aa95d16bb27e651..0307f19ad2c43e488c4fd1c01a2cf1c3aecc2ee4 100644 (file)
 #endif
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x00008F00
 #define CONFIG_SYS_IMMR                CONFIG_SYS_MBAR
 
 /* PCI */
index 6119159e4af0e2bc503c6496058bc8b6bc7e9bd5..ad9c77e1c828e610f54ffb67ad91401a59620758 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS 1
 
 /* I2C */
-#define CONFIG_HARD_I2C
-#define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_SPEED           120000
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /*
  * General PCI
index b98a4c481e0f87013bb49f7e61e935fa5552e6d4..1e50032414bdfe8f037be99737a09b3f7dd11e2a 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       */
-#define CONFIG_SYS_I2C_NOPROBES      {0x69}         /* Don't probe these addrs */
-#define CONFIG_I2C_BUS1              1              /* Include i2c bus 1 supp  */
-
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
+#define CONFIG_SYS_I2C_PPC4XX_CH1
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_1 400000 /* I2C speed 400kHz */
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_1 0x7F
+#define CONFIG_SYS_I2C_NOPROBES { { 0, 0x69} } /* Don't probe these addrs */
 
 /*-----------------------------------------------------------------------
  * Environment
index 65efe78f33decd53dbe9beaddfb2849618b4b213..75eef20e589ba01715da52e31fea0fa500387bb6 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
  */
@@ -75,8 +77,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 9185e77ad1be5a13bd5d19e28f9babbdf2cfd98f..c535dbeaae1dfa5bf737daba8826f8502001874d 100644 (file)
  * The Atmel EEPROM uses 16Bit addressing.
  ***************************************************************/
 
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           50000   /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          50000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x53    /* EEPROM 24C128/256            */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2       /* Bytes of address             */
index 09961a4eb8b0601741d2a2214bb150ef03720e63..d315729b8b1089837a2a654bb2a2d3300bfe22b9 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* I2C */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_SPEED   400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE   0x7F
-#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x51} } /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x51} }
 
 /*
  * SPI on header J8
index 6740182045c07c9550ab86d6e3212e58844609f9..6c6ce58fb88709401393424363891a3d9bd3ba7a 100644 (file)
 #define CONFIG_SYS_HUSH_PARSER
 
 /* I2C */
-#define CONFIG_HARD_I2C                        /* I2C with hardware support*/
-#define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE   0x7F
-#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x69} } /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /*
  * General PCI
index 882ae73e057661fb5785f6ea12fd213b2b098a67..fef19d4b5fe840a403b607b5b9b54336be1ddb7c 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* I2C */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#define CONFIG_FSL_I2C
-#define CONFIG_SYS_I2C_SPEED           400000 /* I2C speed and slave addr */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_NOPROBES                {0x51} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x51} }
 
 /*
  * Board info - revision and where boot from
index ac4c253968d3cc5994324cfcd5798d047acbad66..d5db65df112872078962543df3ec4210e169d1c4 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* 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
-#define CONFIG_SYS_I2C_NOPROBES        {0x51}  /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x51} }
 
 /*
  * Config on-board EEPROM
index fa8e75250acba6134208b787611047c38eff6743..32e05af8ab7628906e2ac9ff8d76df6bcc79ae93 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* 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
-#define CONFIG_SYS_I2C_NOPROBES        {0x51}  /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x51} }
 
 /*
  * Config on-board RTC
index 9ec2f71921769c7885ab6dbd5d80cd54684f64d5..432db72daa803cb0fc6f6376cbd35045ad1aece7 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* 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 */
-#define CONFIG_SYS_I2C_SLAVE   0x7F
-#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x69} }   /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /* SPI */
 #define CONFIG_MPC8XXX_SPI
index f9949a8000328a45912d70775736a45bed905d39..c3a577f40a1cad07d9df7632de237f11bf88db7b 100644 (file)
@@ -74,7 +74,7 @@
 
 #define CONFIG_PCI
 #define CONFIG_RTC_DS1337
-#define CONFIG_HARD_I2C
+#define CONFIG_SYS_I2C
 #define CONFIG_TSEC_ENET               /* TSEC Ethernet support */
 
 /*
  */
 
 /* I2C */
-#ifdef CONFIG_HARD_I2C
+#ifdef CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
-#define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
 #define CONFIG_SYS_SPD_BUS_NUM         1       /* The I2C bus for SPD */
 #define CONFIG_SYS_RTC_BUS_NUM         1       /* The I2C bus for RTC */
 
 #define CONFIG_SYS_I2C_RTC_ADDR                0x68    /* I2C1, DS1339 RTC*/
 #define SPD_EEPROM_ADDRESS             0x51    /* I2C1, DDR */
 
-#define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE   0x7F
-
 /* Don't probe these addresses: */
 #define CONFIG_SYS_I2C_NOPROBES        { {1, CONFIG_SYS_I2C_8574_ADDR1}, \
                                 {1, CONFIG_SYS_I2C_8574_ADDR2}, \
 #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 */
 #define CONFIG_VERY_BIG_RAM
 #define CONFIG_MAX_MEM_MAPPED   ((phys_size_t)256 << 20)
 
-#ifdef CONFIG_HARD_I2C
+#ifdef CONFIG_SYS_I2C
 #define CONFIG_SPD_EEPROM              /* use SPD EEPROM for DDR setup*/
 #endif
 
@@ -529,7 +527,7 @@ boards, we say we have two, but don't display a message if we find only one. */
        #define CONFIG_CMD_PCI
 #endif
 
-#ifdef CONFIG_HARD_I2C
+#ifdef CONFIG_SYS_I2C
        #define CONFIG_CMD_I2C
 #endif
 
index dfd2a50c6db00dbf8094f527e039a225049acd4d..7c4f3ef8f1ef0cf5df92d823d602e55ff24cbc26 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* 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
-#define CONFIG_SYS_I2C_NOPROBES        {0x52} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x52} }
 
 /*
  * Config on-board RTC
index 2c194087a42fc11b37bf23521d633ca0c7201512..1973447a237c4e343f815287a73009dc4a1f60f0 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS
 
 /* 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 */
-#define CONFIG_SYS_I2C_SLAVE   0x7F
-#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x52} } /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x52} }
 
 /*
  * General PCI
index ab61d214d39a4bc061fe03d8be320606029d1ed8..51688a76bf274fc42bd31175aa9fc6eead467316 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* 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
-#define CONFIG_SYS_I2C_NOPROBES        {0x51} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x51} }
 
 /*
  * Config on-board RTC
index 1529a090edd2f70cfd1f3504a67010213a382875..a5fe220b14bbfc3d49342c79a208cc61578637b0 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS 1
 
 /* 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
-#define CONFIG_SYS_I2C_NOPROBES        {0x51} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x51} }
 
 /*
  * Config on-board RTC
index 5349857ebb6446e61473cd777a0e04ec87d377b8..8ff2c3a4fa175e347e263bd1be8d72c3ce4b3fa5 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_SLAVE           0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {{0, 0x29}}     /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
 
 /*
  * I2C2 EEPROM
index c80b6b2fdbf38c3860372196d4a0952fb29bacf7..acd37a01aa75ca4c5dbffbf64c8da34531f74d92 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_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 */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /* RapidIO MMU */
 #define CONFIG_SYS_RIO_MEM_VIRT        0xc0000000      /* base address */
index da7a3cbb46e336bf67c883fb0638157366217ef5..61775d2c2886b17722e2aaf35cc183fbd58b26be 100644 (file)
@@ -267,13 +267,12 @@ 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_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 */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /* EEPROM */
 #define CONFIG_ID_EEPROM
index ef8bf97f627ac8dda697bc2790c506706a3a2261..2a5e5d4ed9df39546ace24152f49dd3dc4fcc153 100644 (file)
@@ -216,14 +216,13 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* 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
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x57
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET          0x3100
 
 /*
  * General PCI
index 84bd3af1afd23fe2f7d69b5b91f307705de589e1..8deb241c39167537f91a6efb0c2a58dad0f8f38b 100644 (file)
@@ -342,13 +342,12 @@ 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_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 */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /* EEPROM */
 #define CONFIG_ID_EEPROM
index eb4e620d8b137d3510cf2584176655df3665998d..1ec3797e7c420d240c64af2d0ce9ef984c161cd7 100644 (file)
@@ -265,13 +265,12 @@ 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_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 */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /* EEPROM */
 #define CONFIG_ID_EEPROM
index d4a557b675a9007d8d8ccbf6fd8d285fe7a7c735..49f6a353326468e3a923e6358a673dd1a4c12a32 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_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 */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /* RapidIO MMU */
 #define CONFIG_SYS_RIO_MEM_VIRT        0xc0000000      /* base address */
index 21ce7b9125afe1c3b5ea199760e90c4f51d7fcea..2d5e8c0b7b11e72293417d6eae94500fb198edfb 100644 (file)
@@ -250,16 +250,16 @@ 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
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x52
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {{0,0x69}}      /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
 
 /*
  * General PCI
index 7f7cd20d7871fa6aa9f2b48d805057f5190dfd5d..c35fd2bdbce70d87cc462ba8de13619c7de11f6d 100644 (file)
@@ -286,15 +286,15 @@ 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_SLAVE   0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {{0,0x69}}      /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /*
  * I2C2 EEPROM
index e9da73632799e4d04567ae813de12159e4e2ca52..05d887050046eeb23f46c3fcda43837f44f29551 100644 (file)
 #define CONFIG_FIT_VERBOSE     1 /* enable fit_format_{error,warning}() */
 
 /* 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
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x57
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {{0,0x29}}/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
 
 /*
  * I2C2 EEPROM
index f791e7682e4a7e9661c70a8dd9267ee210a0afb1..1553a746c8a55b3d54ffb3fc20bbf81a476ead46 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_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 */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /*
  * General PCI
index 89049d0f6214532481c3b27590f715c8a7844314..6ca6f6b807e2e960959cf0808ba9d7ead0fd71a8 100644 (file)
@@ -282,13 +282,12 @@ 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_SLAVE           0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET          0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /*
  * RapidIO MMU
index bb5a4fc5e3fa2389f576c20cfc3c0e480ba825ec..044a1bc2c8f74d257638dfe3c7c0dc4630e8073b 100644 (file)
@@ -28,7 +28,6 @@
 #define CONFIG_PCI
 #define CONFIG_PCI_INDIRECT_BRIDGE
 #define CONFIG_PCI_SKIP_HOST_BRIDGE
-#define CONFIG_HARD_I2C
 #define CONFIG_TSEC_ENET
 #define CONFIG_MPC8XXX_SPI
 #define CONFIG_HARD_SPI
 #define CONFIG_MISC_INIT_R
 
 /* I2C */
-#define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
-
-#define CONFIG_SYS_I2C_SPEED           100000
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       100000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      100000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /*
  * DDR Setup
index be2ecf464035b980b6561e0fd7877749290e835e..c9196135197ea2d4b1e18aa92b905b477fa225c2 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC08) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index fb0b89db9e1ea0363127999ab18be09dcc86895f..56d251cea5f0c7d7e086a9b326c435a34851b802 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC08) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index 3fe4108219f7085986fd5958814568b65a220292..ba3f7c282196a174b9a4653b0a22627ef62b5513 100644 (file)
@@ -473,15 +473,15 @@ extern unsigned long get_sdram_size(void);
 #define CONFIG_FIT
 #define CONFIG_FIT_VERBOSE     /* enable fit_format_{error,warning}() */
 
-#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*/
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /* I2C EEPROM */
 #undef CONFIG_ID_EEPROM
index 0391a96a54abc33812dcc55a23f7ba6630322fa4..d1ce9fdc8d8436a327acea07adbfcaba6e8d7dfa 100644 (file)
 #define CONFIG_FIT_VERBOSE
 
 /* I2C */
-#define CONFIG_FSL_I2C
-#define CONFIG_HARD_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_SPEED           400000
-#define CONFIG_SYS_I2C_EEPROM_ADDR     0x57
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 #define CONFIG_SYS_I2C_NOPROBES                {{0, 0x29}}
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
 
 /*
  * I2C2 EEPROM
index 6b7579baf00f5ae9073562847564a2ca0db2bae3..cd6d20c7294331918cece483db3cc3e824ee7d85 100644 (file)
@@ -188,13 +188,14 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_FIT_VERBOSE     /* enable fit_format_{error,warning}() */
 
 /* I2C */
-#define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /*
  * I2C2 EEPROM
index 3ebec6b590d64b9251f20392389731493ca43e54..a8202c67fdb07b8d402addaf2e64f2143161a657 100644 (file)
@@ -297,15 +297,15 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_FIT_VERBOSE     /* enable fit_format_{error,warning}() */
 
 /* 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
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x51
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
 
 /*
  * I2C2 EEPROM
index 447cd98dafc4fc20d05cc72a01f1c2046236fc8d..adaed564f7d43d032ecf55ea7b6ae766b9a8914d 100644 (file)
@@ -351,16 +351,15 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_FIT_VERBOSE     1 /* enable fit_format_{error,warning}() */
 
 /* 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*/
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {{0,0x29}}      /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
 
 /*
  * I2C2 EEPROM
index d1c9b2481036ed6823e0c00a755efebb3797cc9b..08d1c2591460d7c41e387796686ec6295eb6801a 100644 (file)
@@ -209,16 +209,15 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_FIT_VERBOSE             1
 
 /* 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*/
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 #define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
 
 /*
  * I2C2 EEPROM
index 9df116e26bb37f999ffac0696d8abb3298e1dfdd..b5078cdb524e991c43715daa7f7c52132760b2e6 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* I2C */
-#define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x57
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {{0,0x29}}/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
 
 /*
  * I2C2 EEPROM
index 43387d7492e5d5e54c5b30bbecac753e168456ea..9814ca2012f5946641046422152074fe27af4f0b 100644 (file)
@@ -351,14 +351,14 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_FIT_VERBOSE     /* enable fit_format_{error,warning}() */
 
 /* I2C */
-#define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_SPEED           400000
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x118000
-#define CONFIG_SYS_I2C2_OFFSET         0x118100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /*
  * RapidIO
index 626a5463b63430c9bf524600981eed6c47430013..a71a5219cfbd480ba5fadc853e7278be1569c950 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index 036fec8cd894ef080e19f5c69211a92af57321aa..2251ca6116c2309d3b06e51e4497e08803d09f4c 100644 (file)
  * EEPROM of the SDRAM
  * The Atmel EEPROM uses 16Bit addressing.
  ***************************************************************/
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           50000   /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          50000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x53
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
index 75c0926853953d50723e69d64d718fb279de7c26..3c31cfb01af4074792fb6ecccdc7910433903f7c 100644 (file)
 /*
  * I2C EEPROM (24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM 24WC16 */
 #define CONFIG_SYS_EEPROM_WREN         1
index 2c4aa2fd611e22c484df44c0f05f2352c6506794..b466513ea3c84ab06ae31761d20017a7a5f66f10 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 dbf980126bb14869a7e10656738653debc26a56d..cb68c41babaee87cdf506862abe194abaab572fb 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 fbee0930d8dbc8ad3379c11a82d9d8197978a705..67a96d29d496614c19c8adb37ab2e7ea7558f6db 100644 (file)
 /*
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           100000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT24W16 */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address */
index 22b1177ace53c949fc2a34c54989ff8b20efedf2..531e95612a23f3f490582f8fc8e87ba66e92abb4 100644 (file)
 /*
  * I2C EEPROM (24W16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM 24W16 */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address */
index 1b81861ac703183dc82e52b0987527c93324d5aa..a54c099ce45e8cac190bb25c050f068ed996fa02 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
-
-#define CONFIG_I2C_MULTI_BUS   1
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
+#define CONFIG_SYS_I2C_PPC4XX_CH1
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_1          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_1          0x7F
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 
index 1aaa8b0ae8142820f5c8e04baf2a73c93d6df8f4..cd9eb4b10b5968c035374a350bbcc4095ef3648a 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index 9ab524f4bfb189dfefd88c39af6d8082122db278..efe699538ce95e214c1c69d4b8e07cacc03ae558 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 b0b0c91e4a0f537082572995264b749a62626f01..6ba8a02bcb096ce30129102a0c4e6a05a387350e 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 28132566df9479cb803beaf43c8fc6f55a3d3624..ada7e145c07fbe0dcbee8442f4cb85fdc2392b79 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 61ada9573d8bacfc0e63c5d4c18492650bbe4427..06273a2ae1a3bbc444b4b15a12b4002b09df70f7 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 f5d61358707e8ae62a329d2baa9a1d7c47ecbb05..3448ef35a8e51f5671737214b9d4c1eeda3a0ee8 100644 (file)
 #define CONFIG_SYS_HUSH_PARSER
 
 /* I2C */
-#define CONFIG_HARD_I2C                /* I2C with hardware support*/
-#define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE   0x7F
-#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x69} } /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /*
  * General PCI
index dfb1426751c351d0fa9e40234230d27287850057..e2b05de3810d8fd10a2f357d63cd1faa66f32aaa 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 c5e0339268e06f16ee3b68236644a3d9a532567b..ed8a32f7df3558b51280eae0b76c4632053c39ee 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 e1692dc0b2e79a8f5a21c89d13f3ce53a6f5c207..97e8968243a5606d5b4cb04528ad1cfcfdb3b362 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 494ed078f86ac81cdcca3ce5ca17eb7e643aa321..bce4176f9db6e45e7971ad323b169c9a1209e367 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 39c39ee8c92f08c88cac262cc5bfe1f272e28645..7f2b842993555bed99fc5faf01c68bae0f92f571 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 3c7addbb54273459abe99f9d0b2cb9b55109c3cd..00056a33d4d7072643a2c2b8625c5c7e56c55761 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 c2210503a0b1f297f4903d3e6a408cf1cae975f3..5c5ce84ff176184f1470a005ee3271f352aa3a27 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 006d53d345669617a6cbec0433c3b11a20e839a1..1b02cbbca7486b4083c990ac3e45afd90941ee56 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 c5b64b245a5f537e22febeeb8c907680e9da703a..3f586fbbc13f522eaee524b8d52c8101328604e5 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 8eb217c5d8e160bc8ed549cbd79aaf62aac6c2b0..07b5acb9770ae7b3e0f145d430604b3d96b87498 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 */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
 
 /* I2C EEPROM, configuration for onboard EEPROMs 24C256 and 24C32 */
 #define CONFIG_SYS_I2C_EEPROM_ADDR             0x50    /* 1010000x */
index a893316efc8ec731d19babe3856ff89203bc9823..37e3541d682ce6b2be303a3504e6c80510b43a64 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
  */
@@ -99,7 +96,6 @@
 #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 f28aa16c02b39d210f8ac50143a567e5b57ed6ac..9cf263cff60a60d4a33e6872af7dfd7a70b958d8 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 e6b1e35d5413c0b24fcc5e06d6f79cf5b0e1ab01..1f52efcf5bdf33ba11d2512d39e9cb32223a94fb 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 6316fb566a12e8f012a0c3ff6406f3198417d1dd..a1dad2b5bba47589206d0a04005c33c83ca4873e 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT24WC08             */
 #define CONFIG_SYS_EEPROM_WREN         1
index f3bd423b4689e5993a3a633fc95c75c2eb28d581..5daf1758635ae92281061dd874f5fefa4860e6a9 100644 (file)
 /*
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index f388047ee5756009f0e7950a545dda057c9256c8..51cfcf6e21821516569881294a4bcf25592cd87f 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC08) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index dba456108c1b372d52c0ad611a51e130e79e18bb..6769c0d80616dd90d8a796781d1a47416c94fe99 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (ATMEL 24C04N)
  */
-#define CONFIG_HARD_I2C                1               /* Hardware assisted I2C        */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50            /* EEPROM ATMEL 24C04N          */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1               /* Bytes of address             */
index df4652153ce22699ca86849ddfd3975d5f49af42..f38d90ee3f3d77e771b3d3b2711bd9b417502610 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C EEPROM (CAT24WC16) for environment
  */
-#define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index 88c4aee153471d01eeb1c852c8d7cf1a105383b2..f79706e1d2997539d01d88edecab4e08c793f7e9 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000          /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     (0xa8>>1)
index b9b4e9af994ce313ff9709cedf6df3bf2b4da73e..5431b098c5c388a555cc26ec8152c8ffbfba5b60 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
-#define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs      */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
+#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x69} }   /* Don't probe these addrs */
 
 /*-----------------------------------------------------------------------
  * I2C EEPROM (PCF8594C)
index 72f75aae663175e30b5b825972733f468c49e654..580d079ed1a8a34f3f519eaf5d747b98cb03ad76 100644 (file)
 /*
  * I2C
  */
-#define CONFIG_HARD_I2C                        /* I2C with hardware support    */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 /*
  * Ethernet/EMAC/PHY
index c9d090e000bdaafb384735d76bd9e1fb4f2e8207..68f25ea388cb8fd9fa0c2c3c1137197d5f0296ee 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 1124f0a29a73c2328923b387f795d09afbd74494..ed9400e4c0bd3c69a26375198528b837fb39498c 100644 (file)
 #undef CONFIG_MCFPIT
 
 /* 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       80000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x58000
 #define CONFIG_SYS_IMMR                        CONFIG_SYS_MBAR
 
 /*
index e585efe4d3cb0c6991e59b8b2bf0729ae5990844..5336f69103125cee5b4ceb2a06fd366db0094535 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     (0xa8>>1)
index 628d5d3db144bb00b889f1b2eb73de3d13cc4921..801caca24f129cd68c184eabc2dea57784d10252 100644 (file)
 #define CONFIG_BOARD_EARLY_INIT_F
 
 /* I2C */
-#define CONFIG_TEGRA_I2C
+#define CONFIG_SYS_I2C_TEGRA
 #define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_MAX_I2C_BUS         TEGRA_I2C_NUM_CONTROLLERS
 #define CONFIG_SYS_I2C_SPEED           100000
 #define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
 
 /* SD/MMC */
 #define CONFIG_MMC
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 5ea6f46bee9858760a31ae6e1987e23644c82452..33e04963e6782caa8e7aaef5d9491af379f57ff7 100644 (file)
 /*
  * I2C
  */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed            */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR             0x54
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         1
index b02f86207a5df00f36981fd2bc612ed7803d5016..9301fccbdc657b6b950ed9e20715f7b6f99d52b6 100644 (file)
  * I2C stuff
  *-----------------------------------------------------------------------
  */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
-#define CONFIG_SYS_I2C_NOPROBES        { 0x69 }        /* avoid i2c probe hangup (why?) */
+#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x69} }   /* avoid i2c probe hangup (?) */
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  6       /* 24C02 requires 5ms delay */
 
 #if defined(CONFIG_CMD_EEPROM)
index 4353a8cb2b9f722009b553112969d8dea435b09c..f6faeec06ce6395d83da600e0184548d2ecc7868 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed                    */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR             (0xa8>>1)
index 142d20b5c53b3655d5e9d6f57a2a1f44a2c1e74e..4abb03ea56dd76cdc1797bd08caa2e156a6c51ab 100644 (file)
 #define CONFIG_BOARD_EARLY_INIT_F
 
 /* I2C */
-#define CONFIG_TEGRA_I2C
+#define CONFIG_SYS_I2C_TEGRA
 #define CONFIG_SYS_I2C_INIT_BOARD
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_MAX_I2C_BUS         TEGRA_I2C_NUM_CONTROLLERS
 #define CONFIG_SYS_I2C_SPEED           100000
 #define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
 
 /* SD/MMC */
 #define CONFIG_MMC
index cdd79f0769e9f58f479ddad1ce2cd32dd802c2a6..c6aad01dba645da3a32afd98367d22d3d7831e89 100644 (file)
 /*
  * I2C
  */
-#define CONFIG_HARD_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_CMD_I2C
-
-#define CONFIG_FSL_I2C
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
-#define CONFIG_SYS_I2C_SPEED           400000
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 /* Probing DP501 I2C-Bridge will hang */
 #define CONFIG_SYS_I2C_NOPROBES                { {0, 0x30}, {0, 0x37}, {0, 0x3a}, \
                                          {0, 0x3b}, {0, 0x50} }
index a85680f10362a53f4965387dc6f2a5bab5b8e346..c0591c52770d9083b4291bfccea69271bbcb3649 100644 (file)
 #define CONFIG_FIT_VERBOSE     /* enable fit_format_{error,warning}() */
 
 /* I2C */
-#define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x118000
-#define CONFIG_SYS_I2C2_OFFSET         0x118100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x118000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x118100
 
 /*
  * RapidIO
index 4a7c4fc288af20baebe04d9bf589c0a678b5c1e3..c56fdd751719911103c8fcc42042e355ce053537 100644 (file)
@@ -76,7 +76,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 663b8cbd4425bfb7c7c2e75d9cd8318febba2346..49a144fd33f4c83f0773ba53a8e648d73b86eff6 100644 (file)
  * I2C configuration
  *
  */
-#define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed                    */
-#define CONFIG_SYS_I2C_SLAVE           0x7F    /* I2C slave address            */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F    /* I2C slave address */
 
 /*
  * MII PHY configuration
index 6f7dc1856746e3cfdddef1c8f88d5c63c7879f0f..7705a5dda89f952d6d7b3a6c1f2e315586406299 100644 (file)
  * I2C configuration
  *
  */
-#define CONFIG_HARD_I2C                1       /* I2C with hardware support    */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed                    */
-#define CONFIG_SYS_I2C_SLAVE           0x7F    /* I2C slave address            */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F    /* I2C slave address */
 
 /*
  * MII PHY configuration
index b6e01617c828ebb0adf4aff9170557084ba2140c..145e7ac926db17df54b818f3d0db7fd2bccd1e96 100644 (file)
 #define CONFIG_BOARD_EARLY_INIT_F
 
 /* I2C */
-#define CONFIG_TEGRA_I2C
+#define CONFIG_SYS_I2C_TEGRA
 #define CONFIG_SYS_I2C_INIT_BOARD
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_MAX_I2C_BUS         TEGRA_I2C_NUM_CONTROLLERS
 #define CONFIG_SYS_I2C_SPEED           100000
 #define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
 
 /* SD/MMC */
 #define CONFIG_MMC
index 660cceebd8418413db031f05710988b47c921b14..c9fb8d78cbe54102d50aa1965a91e6890fb6e9de 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 84af8957818b75f8084c1b96389ed01f91e5677f..17391cddc988529c2f1314125f61a443a4ea45b9 100644 (file)
@@ -98,7 +98,7 @@
 /*
  * I2C stuff
  */
-#define CONFIG_SYS_I2C_SPEED           100000
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
 
 /* Temp sensor/hwmon/dtt */
 #define CONFIG_DTT_LM63                1       /* National LM63        */
index d5bf73558184eec9cf683463eaaa9f72d90fd749..27471284ac6fa59d170b58e44d24d2d059a8d6a4 100644 (file)
@@ -91,7 +91,7 @@
 /*
  * I2C stuff
  */
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address*/
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
 
 /*
  * FLASH organization
index 6d9e2ad96a11a6e4e4035e91f044b2ec1fcb91c2..c2d04a21c7c9302758d037bc5429bc5ceca081a2 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 84cf9d74fc34e75db457892cd27b2310bbfb6c32..08ba883f4c4998257faf24a95a8e8f8310439c64 100644 (file)
  * I2C
  */
 
-#define CONFIG_HARD_I2C
-#define CONFIG_FSL_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
 
-#define CONFIG_SYS_I2C_OFFSET          0x00000300
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x00000300
 #define CONFIG_SYS_IMMR                        CONFIG_SYS_MBAR
 
-#define CONFIG_SYS_I2C_SPEED           100000
-#define CONFIG_SYS_I2C_SLAVE           0
+#define CONFIG_SYS_FSL_I2C_SPEED       100000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0
 
 #ifdef CONFIG_CMD_DATE
 #define CONFIG_RTC_DS1338
index a768ef3a32fba79085a4b4f308c519b45e954304..247e37b6dddaeec972465876ea6f2dcbde76a3b1 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 800af72766ef326c6f774ed9816b0e72f6773f0d..47014f9e30561ed46b7590a7b3be2ee6fae1dd09 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     (0xa8>>1)
index 5fdc46aa2deada3002af504599b45785a1ac4733..aba3392234d3123c982dd4368d7e5806bbbaca74 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 3cf27edcdc2da8c530455763d68490f092641276..adf14be3658d0de612370aa2503e72bdc5fd14c9 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 c95cb00e9e3f801c940ba6d8ca9c5fcc97805758..cfb2a72716127370564fa27ece236133d239ffa9 100644 (file)
 /*
  * I2C
  */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed+slave address*/
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 /*
  * Default environment variables
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 fd8d56fe46bace0bdb5962ad3dcee4b909461447..eafcf5aeaf7bf0f49f8635c9684ce1424b30d3b5 100644 (file)
 /*
  * I2C
  */
-#define CONFIG_SYS_I2C_SPEED   100000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0  100000
 
-#define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_SPD_BUS_NUM 0       /* The I2C bus for SPD          */
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
index fed0c3c23cae0d8cf4a593a4251b67d2a8d47764..d3d7a441b6b307c7a512ed18829c4b9019b27e9f 100644 (file)
 /*
  * I2C
  */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR             (0xa8>>1)
index af01ae25b374cceefe3f40a438ab50bcca0bab9a..33743e61ac0951b7e655d28daafcffa8dc463f7d 100644 (file)
@@ -98,7 +98,7 @@
 /*
  * I2C stuff
  */
-#define CONFIG_SYS_I2C_SPEED           100000
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
 
 /* Temp sensor/hwmon/dtt */
 #define CONFIG_DTT_LM63                1       /* National LM63        */
index 274625dbd4860f306d1ad07365c70f4cad767c84..dcd1b82e25f0ffd738049d33240a577b687de07c 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED   400000  /* I2C speed and slave address */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0  400000
 
 #define CONFIG_PCA9698         1       /* NXP PCA9698 */
 
index bae525026edfcf3e668ef1e6c486813db135584d..32d9050adb952f14838e96ba00ed4ac5ba00f28e 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               */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 /*
  * Software (bit-bang) I2C driver configuration
index 10871e8349727423439eba09c7d6fa4603d81b8f..ca0df2d0ce00f98937adfe2a23527cb33cf06480 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
 
-#define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_SPD_BUS_NUM         0       /* The I2C bus for SPD          */
 
 #define IIC0_BOOTPROM_ADDR     0x50
index 613654c511d944e8e27f42707eb270b1a66fcd1e..bd3bbb79a5d69059a76f6575be52d8423b0bf0d6 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x52    /* I2C boot EEPROM (24C02BN)    */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
index d0e4b3fd4789d998cb545e7e6f2444c455989b58..a82987d6a09f5a05e7c33c1efd6085fadd92982a 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 6b3a4cca30b81e6c25b98d73b0858d542878fd46..0ff866a8966ce3603978235a937961181f05fb2d 100644 (file)
 #endif /* CFG_SYS_RAMBOOT */
 
 /* I2C */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#define CONFIG_FSL_I2C
-#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_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES       4
+#define CONFIG_SYS_I2C_MAX_HOPS                1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       200000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_I2C_OFFSET          0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_BUSES   {{0, {I2C_NULL_HOP} }, \
+               {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+               {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+               {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS              2       /* I2C2 (Mux-Port 1)*/
 
 /* I2C SYSMON (LM75, AD7414 is almost compatible) */
 #define CONFIG_DTT_LM75                /* ON Semi's LM75 */
 #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         1
 
 #if defined(CONFIG_CMD_NAND)
 #define CONFIG_NAND_KMETER1
 #define CONFIG_EXTRA_ENV_SETTINGS \
        CONFIG_KM_DEF_ENV                                               \
        CONFIG_KM_DEF_ARCH                                              \
-       "EEprom_ivm=pca9547:70:9\0"                                     \
        "newenv="                                                       \
                "prot off 0xF00C0000 +0x40000 && "                      \
                "era 0xF00C0000 +0x40000\0"                             \
index 97bdeba15c603f22b1fd4b6aeb8501edcfea8fff..e0368cb894a3be098f598a3662e80b7c36aba2af 100644 (file)
@@ -42,7 +42,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);
@@ -195,6 +209,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 */
@@ -224,7 +240,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
@@ -263,7 +279,8 @@ int get_scl(void);
 #else
 #define CONFIG_KM_NEW_ENV                                              \
        "newenv=setenv addr 0x100000 && "                               \
-               "i2c dev 1; mw.b ${addr} 0 4 && "                       \
+               "i2c dev " __stringify(CONFIG_I2C_ENV_EEPROM_BUS) "; "  \
+               "mw.b ${addr} 0 4 && "                                  \
                "eeprom write " __stringify(CONFIG_SYS_DEF_EEPROM_ADDR) \
                " ${addr} " __stringify(CONFIG_ENV_OFFSET) " 4 && "     \
                "eeprom write " __stringify(CONFIG_SYS_DEF_EEPROM_ADDR) \
@@ -277,7 +294,6 @@ int get_scl(void);
        CONFIG_KM_DEF_ENV                                               \
        CONFIG_KM_NEW_ENV                                               \
        "arch=arm\0"                                                    \
-       "EEprom_ivm=" KM_IVM_BUS "\0"                                   \
        ""
 
 #if defined(CONFIG_SYS_NO_FLASH)
index b087cdb24045fd231c01d6986c6190e82cf21936..b23cb96274d3a8ec7aab0ab34e7683ba7ca77327 100644 (file)
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
        CONFIG_KM_BOARD_EXTRA_ENV                                       \
        CONFIG_KM_DEF_ENV                                               \
-       "EEprom_ivm=pca9544a:70:4 \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} } } }
+
+#define CONFIG_KM_IVM_BUS              1       /* I2C2 (Mux-Port 1)*/
 
 /*
  * Software (bit-bang) I2C driver configuration
@@ -266,7 +273,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 68d1bf6c66d584216ab58ba776e24eebf02869f1..0e6073c6425be323cc906794e35057a3656a01c5 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 CONFIG_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 CONFIG_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 CONFIG_KM_IVM_BUS              1       /* I2C2 (Mux-Port 1)*/
 #define CONFIG_IDENT_STRING            "\nKeymile NUSA"
 #define CONFIG_HOSTNAME                        kmnusa
 #undef CONFIG_SYS_KWD_CONFIG
@@ -53,7 +53,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 CONFIG_KM_IVM_BUS              1       /* I2C2 (Mux-Port 1)*/
 #undef CONFIG_SYS_KWD_CONFIG
 #define CONFIG_SYS_KWD_CONFIG \
                $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage-memphis.cfg
@@ -65,7 +65,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 CONFIG_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 CONFIG_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
@@ -98,7 +98,7 @@
 #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 3410733ed72907ca689c1812b501233df0b621cb..7c7a305175ebdf7196c697b0cf25cc5b652cc57e 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     (0xa8>>1)
index 37111acdfb7c3694e50dadc87d5eab9be9334ce7..8ecdf8049df0268abc9f18c60e4ef3732da6cfdf 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     (0xa8>>1)
index a1cee6832c4705f5619848530e49b7852ff911f8..459c047b71743872049e2d55857946a3ad359dcd 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 e2c436ff97918b34fe7aa118a683f0c28b0ae12a..8f5eb956aeb07f4b1162a6167ed77d8370439639 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_RTC_ADDR        0x51    /* RTC                          */
 #define CONFIG_SYS_I2C_EEPROM_CPU_ADDR 0x52    /* EEPROM          (CPU Modul)  */
index 520ab8c98cb16fa897715d692ca4b26c20445d5a..e7ed917f8480fd4959d1c63a0dfab000775f67cd 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  6       /* 24C02 requires 5ms delay */
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x52    /* I2C boot EEPROM (24C02BN)    */
index 9a483e74480ef0ecb0232d2b1018d86d232755c4..b48872b2678a89ad2f3b8cf61df1f71b7bd84d2e 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 1ad023b905e70ea701bc51da0382e0403ee3b19d..85ae3671f13fd580128f4af9f0cd997ad0210212 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 3927250ba0a6941e0852af4645b3a8a6380f7108..6875cf4c5b7c1229f170aa4a6446322c1a2756f9 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* I2C */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_SPEED   400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE   0x7F
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /*
  * General PCI
index 2ab2f8ff191b83c275de1fdc84a1472c69b1b059..55d93da5987afbaccd8c617e66176fe20ec2b1cf 100644 (file)
 /*
  * I2C buses and peripherals
  */
-#define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C        /* I2C with hardware support*/
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_I2C_SPEED   400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE   0x7f
-#define CONFIG_SYS_I2C_OFFSET  0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /* I2C RTC - M41T81 */
 #define CONFIG_RTC_M41T62
index fede8b8b647caf890218a16ba8c43a5d20a6ac91..5abb8b1a7521d822ecd87513f13ce29fc78af40b 100644 (file)
 /*
  * I2C stuff
  */
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
 
 /* RTC */
 #define CONFIG_RTC_DS1337
index 1453285f6cf66df67db2ba63bd0263a164e2ead5..0997f49859b44f62a656a7da782450d5f2424105 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 14d00abc62351e5b7226d86f3ecde92e6f82cabf..60ee8da5583a28a35af7131a72caafbb44d81598 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     (0xa8>>1)
index 76b078fa73b5aab7a4bda498d16f2f5ed0f014f4..543209cb9d79e53935003e80659c0461abb548a1 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 a061610ac9cc4c787c57d58ef319c6ad0814f6f4..1b0be23dd36d8710014dc53c16d59b4b8aadc60b 100644 (file)
 #define CONFIG_FIT_VERBOSE     /* enable fit_format_{error,warning}() */
 
 /* 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 */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x52
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_NOPROBES                {{0, 0x29}} /* Don't probe this addr */
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
 #define CONFIG_SYS_SPD_BUS_NUM         1 /* For rom_loc and flash bank */
 
 /*
index 09d0e2342fcc84af81f8f5802579c36486f733e5..c4c50932c3e2e3ee926673c397591953365d5f3e 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
-#define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs      */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
+#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x69} }   /* Don't probe these addrs */
 
 /*-----------------------------------------------------------------------
  * I2C RTC
index e4eaa66ebff0576694f893433112866dcb02c412..5de8e98aca3dc68bc93a9921ae7e21d4e124a12f 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     (0xa4>>1)
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
index 0a17abc499e356fe6d3bb735f99f4df3c392d27f..c6640100677c865b12abb4bac09b02bc4342a039 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 451a61dd34aba786d9263d40aef0b9820f49feb3..a51f2d4fafa318da752e140b07aa65e303c9119c 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50            /* base address */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2               /* bytes of address */
index 5ba47bf999ba08557986f5c8e2e40ea7201d193e..c8bd02e710b2deb1b6d6c3e5c18ebfb725f94241 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed                    */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define IIC0_BOOTPROM_ADDR     0x50
 #define IIC0_ALT_BOOTPROM_ADDR 0x54
 
 /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_NOPROBES        {0x50, 0x52, 0x53, 0x54}
+#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x50}, {0, 0x52}, {0, 0x53}, {0, 0x54} }
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2       /* Bytes of address             */
 
index b4c8e40d50e48f9d946f331aef3075519e99be43..d0fafd71361e22d4eec0a22a31095fd2f4755e73 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 eab81e7febbe2cbcedb313deab4ba2575b79f3b9..97a4008e367010fdd97b34aaf7e5ee9e081010f4 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 df20abb68d22b8db7fc4bab1f300835f49c7bca5..d63d0c4f54421d72cc9a3667fcb60c6671d2bdd1 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 7a20d4d84cf4a90622b788d0f84824790eb7544b..072f97e602b4af21aec6b6bc069dddcd86b8a832 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 /*-----------------------------------------------------------------------
  * PCI stuff
index afa587eeba3d2049505fa8a2210c5f067c6bbf13..6f912ed2c3afdc27c1f32e642f946b5bd041fb74 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS     1
 
 /* 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
-#define CONFIG_SYS_I2C_NOPROBES        {0x69}  /* Don't probe these addrs */
-#define CONFIG_SYS_I2C1_OFFSET 0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
-#define CONFIG_SYS_I2C_OFFSET  CONFIG_SYS_I2C2_OFFSET
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69}, {1, 0x69} }
 /* could also use CONFIG_I2C_MULTI_BUS and CONFIG_SYS_SPD_BUS_NUM... */
 
 /* TSEC */
index 3aae95e345099d40ab898127337462dc7787978b..84be5246b91c270bf0157a962089e986cb626443 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_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x3000
 
 /*
  * General PCI
index d740cfec8adee54f24a92e18dd30bd8325bdaa7d..cf97db94c81d4283e67d0acad35f3a1d69c2323a 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_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 */
-#define CONFIG_SYS_I2C_OFFSET          0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /*
  * RapidIO MMU
index 8508c22e034b9335038f5e70fd356683bcd91f96..a96ffbcec3251c74bb34f97486e9aeb59d35d738 100644 (file)
  * IIC stuff
  *-----------------------------------------------------------------------
  */
-#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
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
 
 #define I2C_INIT
 #define I2C_ACTIVE 0
 #define I2C_TRISTATE 0
 
-#define CONFIG_SYS_I2C_SPEED           100000  /* use the standard 100kHz speed */
-#define CONFIG_SYS_I2C_SLAVE           0x7F            /* mask valid bits */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          100000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F    /* mask valid bits */
 
 #define CONFIG_RTC_DS1337
 #define CONFIG_SYS_I2C_RTC_ADDR 0x68
index c7718579c011edc1fc53e354d329741793d7c538..2a24ef3c642b8ba77b691cea64f8563b0572c9fe 100644 (file)
 #define CONFIG_BOARD_LATE_INIT         /* Make sure LCD init is complete */
 
 /* I2C */
-#define CONFIG_TEGRA_I2C
+#define CONFIG_SYS_I2C_TEGRA
 #define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_MAX_I2C_BUS         4
 #define CONFIG_SYS_I2C_SPEED           100000
 #define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
 
 /* SD/MMC */
 #define CONFIG_MMC
index 44ed7556d4eaa5fb2b10fb1ab2b9e9f55f0b5e12..d2dedac4edd78917bf1ab7c9549a2fbc33e9335b 100644 (file)
 /*
  * I2C
  */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     (0xa8>>1)
index 383d1ce01367e0ab6d9b4c34357d12e5707d42ae..17eb5f24552b1ac1652a3828f1c7a9d96b8edeae 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 f5fe550a025f4492cf18081cbbdea6006c04301b..e73f9c174c3a63cc42709e06bef23b867a1e2f78 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_SYS_I2C_SPEED           102124  /* 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_I2C2_OFFSET         0x3100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       102124
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      102124
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /* I2C RTC */
 #define CONFIG_RTC_RX8025              /* Use Epson rx8025 rtc via i2c */
index 6d905dee267a9377a9431f11d17b76fd32170461..564f3645c9a52db0f908c1b1b78ff2244590c633 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 80b46a0033a56add2395c61d468e28d5b9e9c501..c7689a729045ba785961f579bffc3a9b98c3cca9 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_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+
 #if 0
 #define CONFIG_SYS_I2C_NOPROBES        {0x00}  /* Don't probe these addrs */
 #else
 /* I did the 'if 0' so we could keep the syntax above if ever needed. */
 #undef CONFIG_SYS_I2C_NOPROBES
 #endif
-#define CONFIG_SYS_I2C_OFFSET          0x3000
 
 /* RapdIO Map configuration, mapped 1:1.
 */
index fc0252339e8f530bf9d5b5b6b2eb5c651824ea81..f5f7f5434887dbd448654649d0941b60ea6736bc 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_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
 #undef CONFIG_SYS_I2C_NOPROBES
-#define CONFIG_SYS_I2C_OFFSET          0x3000
 
 /* I2C RTC */
 #define CONFIG_RTC_DS1337              /* This is really a DS1339 RTC  */
index ce65e39dafbb2c598765f0e66e7ca752a20dc24f..9ab99244cfdbb673165703ca73628fe93366fa5b 100644 (file)
 /*
  * I2C
  */
-#define CONFIG_SYS_I2C_SPEED                   400000  /* I2C speed */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0                  400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR             (0xa8>>1)
index 0344d0d973da2aab6cc55a1a0465de969f205928..1ed53dbbb1ee5a38283cf86b0f0712297844c1cf 100644 (file)
@@ -429,14 +429,15 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_FIT_VERBOSE     /* enable fit_format_{error,warning}() */
 
 /* I2C */
-#define CONFIG_FSL_I2C         /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C                /* I2C with hardware support */
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x118000
-#define CONFIG_SYS_I2C2_OFFSET         0x118100
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       100000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x118000
+#define CONFIG_SYS_FSL_I2C2_SPEED      100000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x118100
+
 #define I2C_MUX_PCA_ADDR_PRI           0x77 /* I2C bus multiplexer,primary */
 #define I2C_MUX_PCA_ADDR_SEC           0x76 /* I2C bus multiplexer,secondary */
 
index ac8e57a93e3475e59db82c5c560284aadc9576fb..e8d191e7f9b757f15f08b0a873bec6f0f3dee53b 100644 (file)
  * I2C stuff
  *-----------------------------------------------------------------------
  */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
-#define CONFIG_SYS_I2C_NOPROBES        { 0x69 } /* avoid i2c probe hangup (why?) */
+#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x69} } /* avoid i2c probe hangup (?) */
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  6 /* 24C02 requires 5ms delay */
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* I2C boot EEPROM (24C02W)     */
index 6dbed7d2d8b57e8eb4f9c795774df01753477883..3dbfc6ad1d53c5f5f01d92071efccf323a912808 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #undef CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50
index 21ca4bbd443cbb028f2b913b301c1096b0a5d705..a3242fe61299b2d34fb0d318fa04235cdf6c584c 100644 (file)
 #endif
 
 /* remove I2C support */
-#ifdef CONFIG_TEGRA_I2C
-#undef CONFIG_TEGRA_I2C
+#ifdef CONFIG_SYS_I2C_TEGRA
+#undef CONFIG_SYS_I2C_TEGRA
 #endif
 #ifdef CONFIG_CMD_I2C
 #undef CONFIG_CMD_I2C
index ba5b6071d20c8a71bd2410e71a1abf4615f47d33..65dabde54ff1a93545a91279ba1f8fe4af85e640 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 465ade6f0290f8fc661471483e5d1a9afa7704e1..9b6aac96e675f7c6a0c3f8939d3a4c4abe857f6d 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 9567cc6e961b15c7a8e62db63900dfcac5d5a6f7..8e03f6f4c4b76e9157bd5ef5fb5c47fcf8dc7f2d 100644 (file)
 #define CONFIG_CMD_SF
 
 /* I2C */
-#define CONFIG_TEGRA_I2C
+#define CONFIG_SYS_I2C_TEGRA
 #define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_MAX_I2C_BUS         4
 #define CONFIG_SYS_I2C_SPEED           100000
 #define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
 
 /* SD/MMC */
 #define CONFIG_MMC
index 8277f8d388ec598777505436ee09651881ca96ba..0c97ab1894eaa8b3ed2706f26d73c7125c1ab519 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 43acf26679d6c94f4ed4c142ddfa433ebf7bd33f..8bf7353bc1f3653f33e008c329acb127d3ed2189 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 3088409271a2dff2614011cbc9ae087fca3fc0a9..bf044456ce6631ef9ac9e262a237a2337fe06b5c 100644 (file)
@@ -219,8 +219,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 8258ccd8158567614b567e45403bc4c9e4aa8bbb..85a6c1113747423e6280d88649c9fcd44a013b6f 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
@@ -324,7 +323,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 223321c6d3d6c83a4bdf593d48515efdd768cd34..5a7a066377ee28e2e14c84a4cee95fa1fa3ee0dd 100644 (file)
 #define CONFIG_PHYLIB
 #define CONFIG_PHY_MICREL
 
+/* I2C Configs */
+#define CONFIG_CMD_I2C
+#define CONFIG_HARD_I2C
+#define CONFIG_I2C_MXC
+#define CONFIG_SYS_I2C_BASE            I2C0_BASE_ADDR
+#define CONFIG_SYS_I2C_SPEED           100000
+
 #define CONFIG_BOOTDELAY               3
 
 #define CONFIG_LOADADDR                        0x82000000
index 817d36f17e0e5be426c704a82fa9f754dd835f50..e171ae4c404b51db9bf16c8d5393da15f07c47f7 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 0cd838e192492904243d5ff11b323d6b806c7fb7..b450ab5e17423caad8daa142ddd31aa443ce1a63 100644 (file)
 #define CONFIG_OF_STDOUT_VIA_ALIAS
 
 /* 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 */
-#define CONFIG_SYS_I2C_SLAVE   0x7F
-#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x69} } /* Don't probe these addrs */
-#define CONFIG_SYS_I2C1_OFFSET 0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
-#define CONFIG_SYS_I2C_OFFSET  CONFIG_SYS_I2C1_OFFSET
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 /* could also use CONFIG_I2C_MULTI_BUS and CONFIG_SYS_SPD_BUS_NUM... */
 
 #define CONFIG_SYS_I2C_8574_ADDR2       0x20    /* I2C1, PCF8574 */
index e24295cf14a37684a95ab4d4bfb0bd2108cb1de5..b23824bd0abe2096d5803e2925403e56fc08c085 100644 (file)
@@ -79,7 +79,7 @@
  * I2C stuff
  *-----------------------------------------------------------------------
  */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     (0xa8>>1)
index ed3eda1f0f992c9144338e4951b1376f6fa02ac5..d5c7e3bbd6e0f8e01b8f3d4fa37501ab6a85b34f 100644 (file)
 #define CONFIG_BOARD_EARLY_INIT_F
 
 /* I2C */
-#define CONFIG_TEGRA_I2C
+#define CONFIG_SYS_I2C_TEGRA
 #define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SYS_MAX_I2C_BUS         4
 #define CONFIG_SYS_I2C_SPEED           100000
 #define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
 
 /* SD/MMC */
 #define CONFIG_MMC
index 28af3cba5add47c00b08af48a648837d53d29bdb..ea270509c1e405ab40faf3e207be098c88207946 100644 (file)
@@ -129,11 +129,11 @@ extern void out32(unsigned int, unsigned long);
 /*
  * I2C
  */
-#define CONFIG_HARD_I2C                        1       /* I2C with hardware support */
-#define CONFIG_PPC4XX_I2C              /* use PPC4xx driver            */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7f
-#define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7f
 
 /* I2C EEPROM */
 #define CONFIG_SYS_I2C_EEPROM_ADDR             0x50
index 51bdd095eb0acdeebd27555ce4b1d70af2e7c603..97ce3eb54276823470a8cd8bb8c18bcb909f495e 100644 (file)
@@ -242,13 +242,14 @@ 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 */
-#define CONFIG_SYS_I2C_SPEED           100000  /* M41T00 only supports 100 KHz */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
-#define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       100000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      100000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /* PEX8518 slave I2C interface */
 #define CONFIG_SYS_I2C_PEX8518_ADDR    0x70
index c20935dfcf382889027133df220cd0983357dc04..372135a89f9a65568c1987545189080740c53cdd 100644 (file)
 /*
  * I2C
  */
-#define CONFIG_FSL_I2C                         /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C                                /* I2C with hardware support */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
-#define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /* I2C EEPROM */
 #define CONFIG_SYS_I2C_EEPROM_ADDR             0x50
index 6cf35f31054003bee788d8e149cc820416cc6e4b..31330eaa30c6a2f8236be6505abd981d0c494566 100644 (file)
@@ -242,13 +242,15 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 /*
  * I2C
  */
-#define CONFIG_FSL_I2C                         /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C                                /* I2C with hardware support */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
-#define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
 
 /* PEX8518 slave I2C interface */
 #define CONFIG_SYS_I2C_PEX8518_ADDR    0x70
index 5a4125193a79ad6ec10316a58cd3fa010ea77c32..340d4be4c6f197344b75564065a1d3c0aa26a7c2 100644 (file)
@@ -234,13 +234,14 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 /*
  * I2C
  */
-#define CONFIG_FSL_I2C                         /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C                                /* I2C with hardware support */
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-#define CONFIG_SYS_I2C_OFFSET          0x3000
-#define CONFIG_SYS_I2C2_OFFSET         0x3100
-#define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED       400000
+#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED      400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 
 /* I2C DS7505 temperature sensor */
 #define CONFIG_DTT_LM75
index 2c1de321bb17ab98e65455d3c251442728dd4665..4d3abf08bd717bbf91e8a38f6bf9334ba4c60eb5 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_EEPROM_ADDR     (0xa8>>1)
index e3b0840ced24c33e6365a9fd460acb68bdc8216f..5d584fbad4827f4317eaad0efc802f576978eb4b 100644 (file)
 /*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
-#define CONFIG_SYS_I2C_SPEED           400000  /* I2C speed and slave address  */
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
 
 #define IIC0_BOOTPROM_ADDR     0x50
 #define IIC0_ALT_BOOTPROM_ADDR 0x54
 
 /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_NOPROBES        {0x50, 0x52, 0x53, 0x54}
+#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x50}, {0, 0x52}, {0, 0x53}, {0, 0x54} }
 
 /* #if defined(CONFIG_CMD_EEPROM) */
 /* #define CONFIG_SYS_I2C_EEPROM_ADDR  0x50 */ /* I2C boot EEPROM              */
index 04448d62619a9e83cfe91647d12df59441de9da8..386f9deb701f8dc50922c57e7ca15ec31b7ecbf9 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
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_PPC4XX
+#define CONFIG_SYS_I2C_PPC4XX_CH0
+#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
+#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
 
 /* these are for the ST M24C02 2kbit serial i2c eeprom */
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50            /* base address */
index f2ac13bee8fa2b7ed171318eaf001bffd3792f5a..6bf83bf7c1a5b25d4af43824973230452cec86b1 100644 (file)
@@ -84,6 +84,7 @@ enum fdt_compat_id {
        COMPAT_MAXIM_98095_CODEC,       /* MAX98095 Codec */
        COMPAT_INFINEON_SLB9635_TPM,    /* Infineon SLB9635 TPM */
        COMPAT_INFINEON_SLB9645_TPM,    /* Infineon SLB9645 TPM */
+       COMPAT_SAMSUNG_EXYNOS5_I2C,     /* Exynos5 High Speed I2C Controller */
 
        COMPAT_COUNT,
 };
index bbea29b47e3f30580c5fd758243cd00aa35803ac..d8674efe58b64a42daa31e00a7639982521c2890 100644 (file)
@@ -1,4 +1,8 @@
 /*
+ * Copyright (C) 2009 Sergey Kubushyn <ksi@koi8.net>
+ * Copyright (C) 2009 - 2013 Heiko Schocher <hs@denx.de>
+ * Changes for multibus/multiadapter I2C support.
+ *
  * (C) Copyright 2001
  * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com.
  *
  */
 #define I2C_RXTX_LEN   128     /* maximum tx/rx buffer length */
 
-#ifdef CONFIG_I2C_MULTI_BUS
-#define        MAX_I2C_BUS                     2
-#define        I2C_MULTI_BUS                   1
+#if !defined(CONFIG_SYS_I2C_MAX_HOPS)
+/* no muxes used bus = i2c adapters */
+#define CONFIG_SYS_I2C_DIRECT_BUS      1
+#define CONFIG_SYS_I2C_MAX_HOPS                0
+#define CONFIG_SYS_NUM_I2C_BUSES       ll_entry_count(struct i2c_adapter, i2c)
 #else
-#define        MAX_I2C_BUS                     1
-#define        I2C_MULTI_BUS                   0
-#endif
-
-#if !defined(CONFIG_SYS_MAX_I2C_BUS)
-#define CONFIG_SYS_MAX_I2C_BUS         MAX_I2C_BUS
+/* we use i2c muxes */
+#undef CONFIG_SYS_I2C_DIRECT_BUS
 #endif
 
 /* define the I2C bus number for RTC and DTT if not already done */
 #define CONFIG_SYS_SPD_BUS_NUM         0
 #endif
 
+struct i2c_adapter {
+       void            (*init)(struct i2c_adapter *adap, int speed,
+                               int slaveaddr);
+       int             (*probe)(struct i2c_adapter *adap, uint8_t chip);
+       int             (*read)(struct i2c_adapter *adap, uint8_t chip,
+                               uint addr, int alen, uint8_t *buffer,
+                               int len);
+       int             (*write)(struct i2c_adapter *adap, uint8_t chip,
+                               uint addr, int alen, uint8_t *buffer,
+                               int len);
+       uint            (*set_bus_speed)(struct i2c_adapter *adap,
+                               uint speed);
+       int             speed;
+       int             slaveaddr;
+       int             init_done;
+       int             hwadapnr;
+       char            *name;
+};
+
+#define U_BOOT_I2C_MKENT_COMPLETE(_init, _probe, _read, _write, \
+               _set_speed, _speed, _slaveaddr, _hwadapnr, _name) \
+       { \
+               .init           =       _init, \
+               .probe          =       _probe, \
+               .read           =       _read, \
+               .write          =       _write, \
+               .set_bus_speed  =       _set_speed, \
+               .speed          =       _speed, \
+               .slaveaddr      =       _slaveaddr, \
+               .init_done      =       0, \
+               .hwadapnr       =       _hwadapnr, \
+               .name           =       #_name \
+};
+
+#define U_BOOT_I2C_ADAP_COMPLETE(_name, _init, _probe, _read, _write, \
+                       _set_speed, _speed, _slaveaddr, _hwadapnr) \
+       ll_entry_declare(struct i2c_adapter, _name, i2c) = \
+       U_BOOT_I2C_MKENT_COMPLETE(_init, _probe, _read, _write, \
+                _set_speed, _speed, _slaveaddr, _hwadapnr, _name);
+
+struct i2c_adapter *i2c_get_adapter(int index);
+
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+struct i2c_mux {
+       int     id;
+       char    name[16];
+};
+
+struct i2c_next_hop {
+       struct i2c_mux          mux;
+       uint8_t         chip;
+       uint8_t         channel;
+};
+
+struct i2c_bus_hose {
+       int     adapter;
+       struct i2c_next_hop     next_hop[CONFIG_SYS_I2C_MAX_HOPS];
+};
+#define I2C_NULL_HOP   {{-1, ""}, 0, 0}
+extern struct i2c_bus_hose     i2c_bus[];
+
+#define I2C_ADAPTER(bus)       i2c_bus[bus].adapter
+#else
+#define I2C_ADAPTER(bus)       bus
+#endif
+#define        I2C_BUS                 gd->cur_i2c_bus
+
+#define        I2C_ADAP_NR(bus)        i2c_get_adapter(I2C_ADAPTER(bus))
+#define        I2C_ADAP                I2C_ADAP_NR(gd->cur_i2c_bus)
+#define I2C_ADAP_HWNR          (I2C_ADAP->hwadapnr)
+
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#define I2C_MUX_PCA9540_ID     1
+#define I2C_MUX_PCA9540                {I2C_MUX_PCA9540_ID, "PCA9540B"}
+#define I2C_MUX_PCA9542_ID     2
+#define I2C_MUX_PCA9542                {I2C_MUX_PCA9542_ID, "PCA9542A"}
+#define I2C_MUX_PCA9544_ID     3
+#define I2C_MUX_PCA9544                {I2C_MUX_PCA9544_ID, "PCA9544A"}
+#define I2C_MUX_PCA9547_ID     4
+#define I2C_MUX_PCA9547                {I2C_MUX_PCA9547_ID, "PCA9547A"}
+#endif
+
 #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);
@@ -97,26 +181,103 @@ void i2c_init_board(void);
 void i2c_board_late_init(void);
 #endif
 
-#if defined(CONFIG_I2C_MUX)
-
-typedef struct _mux {
-       uchar   chip;
-       uchar   channel;
-       char    *name;
-       struct _mux     *next;
-} I2C_MUX;
-
-typedef struct _mux_device {
-       int     busid;
-       I2C_MUX *mux;   /* List of muxes, to reach the device */
-       struct _mux_device      *next;
-} I2C_MUX_DEVICE;
-
-I2C_MUX_DEVICE *i2c_mux_search_device(int id);
-I2C_MUX_DEVICE *i2c_mux_ident_muxstring (uchar *buf);
-int i2x_mux_select_mux(int bus);
-int i2c_mux_ident_muxstring_f (uchar *buf);
+#ifdef CONFIG_SYS_I2C
+/*
+ * i2c_get_bus_num:
+ *
+ *  Returns index of currently active I2C bus.  Zero-based.
+ */
+unsigned int i2c_get_bus_num(void);
+
+/*
+ * i2c_set_bus_num:
+ *
+ *  Change the active I2C bus.  Subsequent read/write calls will
+ *  go to this one.
+ *
+ *     bus - bus index, zero based
+ *
+ *     Returns: 0 on success, not 0 on failure
+ *
+ */
+int i2c_set_bus_num(unsigned int bus);
+
+/*
+ * i2c_init_all():
+ *
+ * Initializes all I2C adapters in the system. All i2c_adap structures must
+ * be initialized beforehead with function pointers and data, including
+ * speed and slaveaddr. Returns 0 on success, non-0 on failure.
+ */
+void i2c_init_all(void);
+
+/*
+ * Probe the given I2C chip address.  Returns 0 if a chip responded,
+ * not 0 on failure.
+ */
+int i2c_probe(uint8_t chip);
+
+/*
+ * Read/Write interface:
+ *   chip:    I2C chip address, range 0..127
+ *   addr:    Memory (register) address within the chip
+ *   alen:    Number of bytes to use for addr (typically 1, 2 for larger
+ *              memories, 0 for register type devices with only one
+ *              register)
+ *   buffer:  Where to read/write the data
+ *   len:     How many bytes to read/write
+ *
+ *   Returns: 0 on success, not 0 on failure
+ */
+int i2c_read(uint8_t chip, unsigned int addr, int alen,
+                               uint8_t *buffer, int len);
+
+int i2c_write(uint8_t chip, unsigned int addr, int alen,
+                               uint8_t *buffer, int len);
+
+/*
+ * Utility routines to read/write registers.
+ */
+uint8_t i2c_reg_read(uint8_t addr, uint8_t reg);
+
+void i2c_reg_write(uint8_t addr, uint8_t reg, uint8_t val);
+
+/*
+ * i2c_set_bus_speed:
+ *
+ *  Change the speed of the active I2C bus
+ *
+ *     speed - bus speed in Hz
+ *
+ *     Returns: new bus speed
+ *
+ */
+unsigned int i2c_set_bus_speed(unsigned int speed);
+
+/*
+ * i2c_get_bus_speed:
+ *
+ *  Returns speed of currently active I2C bus in Hz
+ */
+
+unsigned int i2c_get_bus_speed(void);
+
+/*
+ * i2c_reloc_fixup:
+ *
+ * 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
 
 /*
  * Probe the given I2C chip address.  Returns 0 if a chip responded,
@@ -219,6 +380,21 @@ int i2c_set_bus_speed(unsigned int);
  */
 
 unsigned int i2c_get_bus_speed(void);
+#endif /* CONFIG_SYS_I2C */
+
+/*
+ * only for backwardcompatibility, should go away if we switched
+ * completely to new multibus support.
+ */
+#if defined(CONFIG_SYS_I2C) || defined(CONFIG_I2C_MULTI_BUS)
+# if !defined(CONFIG_SYS_MAX_I2C_BUS)
+#  define CONFIG_SYS_MAX_I2C_BUS               2
+# endif
+# define I2C_MULTI_BUS                         0
+#else
+# define CONFIG_SYS_MAX_I2C_BUS                1
+# define I2C_MULTI_BUS                         0
+#endif
 
 /* NOTE: These two functions MUST be always_inline to avoid code growth! */
 static inline unsigned int I2C_GET_BUS(void) __attribute__((always_inline));
index 5952450b965aec8dbaa7a15aaec524aa729e5171..dc358562d19fa25ee4c6c47c716a7584f41ad6cf 100644 (file)
@@ -57,6 +57,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(MAXIM_98095_CODEC, "maxim,max98095-codec"),
        COMPAT(INFINEON_SLB9635_TPM, "infineon,slb9635-tpm"),
        COMPAT(INFINEON_SLB9645_TPM, "infineon,slb9645-tpm"),
+       COMPAT(SAMSUNG_EXYNOS5_I2C, "samsung,exynos5-hsi2c"),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)