i2c, soft-i2c: switch to new multibus/multiadapter support

- added to soft_i2c driver new multibus/multiadpater support
- adapted all config files, which uses this driver

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
master
Heiko Schocher 11 years ago
parent 3f4978c713
commit ea818dbbcd
  1. 45
      README
  2. 2
      arch/arm/include/asm/arch-kirkwood/config.h
  3. 5
      arch/arm/lib/board.c
  4. 8
      arch/m68k/lib/board.c
  5. 9
      arch/powerpc/lib/board.c
  6. 2
      board/BuS/eb_cpux9k2/cpux9k2.c
  7. 2
      board/BuS/vl_ma2sc/vl_ma2sc.c
  8. 2
      board/atc/atc.c
  9. 2
      board/bluewater/snapper9260/snapper9260.c
  10. 4
      board/cm5200/cm5200.c
  11. 2
      board/cpu86/cpu86.c
  12. 2
      board/cpu87/cpu87.c
  13. 8
      board/emk/top9000/top9000.c
  14. 2
      board/eukrea/cpuat91/cpuat91.c
  15. 2
      board/freescale/m52277evb/README
  16. 2
      board/freescale/m53017evb/README
  17. 2
      board/freescale/m5373evb/README
  18. 2
      board/freescale/m54455evb/README
  19. 2
      board/freescale/m547xevb/README
  20. 2
      board/ids8247/ids8247.c
  21. 6
      board/keymile/common/ivm.c
  22. 8
      board/keymile/km_arm/km_arm.c
  23. 2
      board/lwmon/lwmon.c
  24. 4
      board/lwmon/pcmcia.c
  25. 2
      board/pm826/pm826.c
  26. 2
      board/pm828/pm828.c
  27. 2
      board/sacsng/ioconfig.h
  28. 1
      board/sandburst/karef/karef.c
  29. 2
      board/tqc/tqm8260/tqm8260.c
  30. 2
      board/tqc/tqm8272/tqm8272.c
  31. 2
      board/tqc/tqm8272/tqm8272.h
  32. 6
      common/board_f.c
  33. 3
      common/cmd_eeprom.c
  34. 8
      common/stdio.c
  35. 2
      drivers/i2c/Makefile
  36. 104
      drivers/i2c/soft_i2c.c
  37. 4
      include/configs/A3000.h
  38. 1
      include/configs/BSC9131RDB.h
  39. 1
      include/configs/CANBT.h
  40. 7
      include/configs/CPU86.h
  41. 7
      include/configs/CPU87.h
  42. 1
      include/configs/DU440.h
  43. 39
      include/configs/GEN860T.h
  44. 9
      include/configs/HIDDEN_DRAGON.h
  45. 13
      include/configs/ICU862.h
  46. 9
      include/configs/IDS8247.h
  47. 9
      include/configs/IP860.h
  48. 11
      include/configs/IPHASE4539.h
  49. 1
      include/configs/JSE.h
  50. 1
      include/configs/KAREF.h
  51. 11
      include/configs/KUP4K.h
  52. 12
      include/configs/KUP4X.h
  53. 1
      include/configs/M5208EVBE.h
  54. 1
      include/configs/M52277EVB.h
  55. 1
      include/configs/M5235EVB.h
  56. 1
      include/configs/M5271EVB.h
  57. 1
      include/configs/M5275EVB.h
  58. 1
      include/configs/M53017EVB.h
  59. 1
      include/configs/M5329EVB.h
  60. 1
      include/configs/M5373EVB.h
  61. 2
      include/configs/M54418TWR.h
  62. 1
      include/configs/M54451EVB.h
  63. 1
      include/configs/M54455EVB.h
  64. 1
      include/configs/M5475EVB.h
  65. 1
      include/configs/M5485EVB.h
  66. 1
      include/configs/METROBOX.h
  67. 8
      include/configs/MHPC.h
  68. 1
      include/configs/MPC8323ERDB.h
  69. 1
      include/configs/MPC832XEMDS.h
  70. 1
      include/configs/MPC8349EMDS.h
  71. 2
      include/configs/MPC8349ITX.h
  72. 1
      include/configs/MPC8360EMDS.h
  73. 1
      include/configs/MPC8360ERDK.h
  74. 1
      include/configs/MPC837XEMDS.h
  75. 1
      include/configs/MPC837XERDB.h
  76. 1
      include/configs/MPC8536DS.h
  77. 1
      include/configs/MPC8540ADS.h
  78. 1
      include/configs/MPC8541CDS.h
  79. 1
      include/configs/MPC8544DS.h
  80. 3
      include/configs/MPC8548CDS.h
  81. 1
      include/configs/MPC8555CDS.h
  82. 1
      include/configs/MPC8560ADS.h
  83. 1
      include/configs/MPC8568MDS.h
  84. 1
      include/configs/MPC8569MDS.h
  85. 1
      include/configs/MPC8572DS.h
  86. 1
      include/configs/MPC8610HPCD.h
  87. 1
      include/configs/MPC8641HPCN.h
  88. 1
      include/configs/P1010RDB.h
  89. 1
      include/configs/P1023RDS.h
  90. 1
      include/configs/P1_P2_RDB.h
  91. 1
      include/configs/P2020COME.h
  92. 8
      include/configs/PM826.h
  93. 8
      include/configs/PM828.h
  94. 1
      include/configs/PMC440.h
  95. 6
      include/configs/R360MPI.h
  96. 16
      include/configs/RPXClassic.h
  97. 30
      include/configs/RPXlite.h
  98. 12
      include/configs/RRvision.h
  99. 7
      include/configs/SXNI855T.h
  100. 15
      include/configs/Sandpoint8240.h
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1954,6 +1954,19 @@ CBFS (Coreboot Filesystem) support
interface. interface.
ported i2c driver to the new framework: ported i2c driver to the new framework:
- drivers/i2c/soft_i2c.c:
- activate first bus with CONFIG_SYS_I2C_SOFT define
CONFIG_SYS_I2C_SOFT_SPEED and CONFIG_SYS_I2C_SOFT_SLAVE
for defining speed and slave address
- activate second bus with I2C_SOFT_DECLARATIONS2 define
CONFIG_SYS_I2C_SOFT_SPEED_2 and CONFIG_SYS_I2C_SOFT_SLAVE_2
for defining speed and slave address
- activate third bus with I2C_SOFT_DECLARATIONS3 define
CONFIG_SYS_I2C_SOFT_SPEED_3 and CONFIG_SYS_I2C_SOFT_SLAVE_3
for defining speed and slave address
- activate fourth bus with I2C_SOFT_DECLARATIONS4 define
CONFIG_SYS_I2C_SOFT_SPEED_4 and CONFIG_SYS_I2C_SOFT_SLAVE_4
for defining speed and slave address
additional defines: additional defines:
@ -1992,18 +2005,18 @@ CBFS (Coreboot Filesystem) support
which defines which defines
bus 0 on adapter 0 without a mux bus 0 on adapter 0 without a mux
bus 1 on adapter 0 without a PCA9547 on address 0x70 port 1 bus 1 on adapter 0 with a PCA9547 on address 0x70 port 1
bus 2 on adapter 0 without a PCA9547 on address 0x70 port 2 bus 2 on adapter 0 with a PCA9547 on address 0x70 port 2
bus 3 on adapter 0 without a PCA9547 on address 0x70 port 3 bus 3 on adapter 0 with a PCA9547 on address 0x70 port 3
bus 4 on adapter 0 without a PCA9547 on address 0x70 port 4 bus 4 on adapter 0 with a PCA9547 on address 0x70 port 4
bus 5 on adapter 0 without a PCA9547 on address 0x70 port 5 bus 5 on adapter 0 with a PCA9547 on address 0x70 port 5
bus 6 on adapter 1 without a mux bus 6 on adapter 1 without a mux
bus 7 on adapter 1 without a PCA9544 on address 0x72 port 1 bus 7 on adapter 1 with a PCA9544 on address 0x72 port 1
bus 8 on adapter 1 without a PCA9544 on address 0x72 port 2 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. If you do not have i2c muxes on your board, omit this define.
- Legacy I2C Support: CONFIG_HARD_I2C | CONFIG_SOFT_I2C - Legacy I2C Support: CONFIG_HARD_I2C
NOTE: It is intended to move drivers to CONFIG_SYS_I2C which NOTE: It is intended to move drivers to CONFIG_SYS_I2C which
provides the following compelling advantages: provides the following compelling advantages:
@ -2014,9 +2027,9 @@ CBFS (Coreboot Filesystem) support
** Please consider updating your I2C driver now. ** ** Please consider updating your I2C driver now. **
These enable legacy I2C serial bus commands. Defining either of These enable legacy I2C serial bus commands. Defining
(but not both of) CONFIG_HARD_I2C or CONFIG_SOFT_I2C will CONFIG_HARD_I2C will include the appropriate I2C driver
include the appropriate I2C driver for the selected CPU. for the selected CPU.
This will allow you to use i2c commands at the u-boot This will allow you to use i2c commands at the u-boot
command line (as long as you set CONFIG_CMD_I2C in command line (as long as you set CONFIG_CMD_I2C in
@ -2026,12 +2039,8 @@ CBFS (Coreboot Filesystem) support
CONFIG_HARD_I2C selects a hardware I2C controller. CONFIG_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 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 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 to be the frequency (in Hz) at which you wish your i2c bus
@ -2053,7 +2062,7 @@ CBFS (Coreboot Filesystem) support
That's all that's required for CONFIG_HARD_I2C. 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 then the following macros need to be defined (examples are
from include/configs/lwmon.h): from include/configs/lwmon.h):
@ -3672,7 +3681,7 @@ to save the current settings.
I2C muxes, you can define here, how to reach this I2C muxes, you can define here, how to reach this
EEPROM. For example: 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 EEPROM which holds the environment, is reached over
a pca9547 i2c mux with address 0x70, channel 3. a pca9547 i2c mux with address 0x70, channel 3.

@ -144,7 +144,7 @@
* I2C related stuff * I2C related stuff
*/ */
#ifdef CONFIG_CMD_I2C #ifdef CONFIG_CMD_I2C
#ifndef CONFIG_SOFT_I2C #ifndef CONFIG_SYS_I2C_SOFT
#define CONFIG_I2C_MVTWSI #define CONFIG_I2C_MVTWSI
#endif #endif
#define CONFIG_SYS_I2C_SLAVE 0x0 #define CONFIG_SYS_I2C_SLAVE 0x0

@ -69,7 +69,6 @@ extern void dataflash_print_info(void);
#endif #endif
#if defined(CONFIG_HARD_I2C) || \ #if defined(CONFIG_HARD_I2C) || \
defined(CONFIG_SOFT_I2C) || \
defined(CONFIG_SYS_I2C) defined(CONFIG_SYS_I2C)
#include <i2c.h> #include <i2c.h>
#endif #endif
@ -166,7 +165,7 @@ static int display_dram_config(void)
return (0); 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) static int init_func_i2c(void)
{ {
puts("I2C: "); puts("I2C: ");
@ -273,7 +272,7 @@ init_fnc_t *init_sequence[] = {
#if defined(CONFIG_DISPLAY_BOARDINFO) #if defined(CONFIG_DISPLAY_BOARDINFO)
checkboard, /* display board info */ checkboard, /* display board info */
#endif #endif
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
init_func_i2c, init_func_i2c,
#endif #endif
dram_init, /* configure available RAM banks */ dram_init, /* configure available RAM banks */

@ -56,7 +56,7 @@
#include <version.h> #include <version.h>
#if defined(CONFIG_HARD_I2C) || \ #if defined(CONFIG_HARD_I2C) || \
defined(CONFIG_SOFT_I2C) defined(CONFIG_SYS_I2C)
#include <i2c.h> #include <i2c.h>
#endif #endif
@ -142,8 +142,7 @@ static int init_func_ram (void)
/***********************************************************************/ /***********************************************************************/
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
defined(CONFIG_SYS_I2C)
static int init_func_i2c (void) static int init_func_i2c (void)
{ {
puts ("I2C: "); puts ("I2C: ");
@ -183,8 +182,7 @@ init_fnc_t *init_sequence[] = {
display_options, display_options,
checkcpu, checkcpu,
checkboard, checkboard,
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
defined(CONFIG_SYS_I2C)
init_func_i2c, init_func_i2c,
#endif #endif
#if defined(CONFIG_HARD_SPI) #if defined(CONFIG_HARD_SPI)

@ -98,8 +98,7 @@ extern void sc3_read_eeprom(void);
#if defined(CONFIG_CMD_DOC) #if defined(CONFIG_CMD_DOC)
void doc_init(void); void doc_init(void);
#endif #endif
#if defined(CONFIG_HARD_I2C) || \ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
defined(CONFIG_SOFT_I2C)
#include <i2c.h> #include <i2c.h>
#endif #endif
#include <spi.h> #include <spi.h>
@ -214,8 +213,7 @@ static int init_func_ram(void)
/***********************************************************************/ /***********************************************************************/
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
defined(CONFIG_SYS_I2C)
static int init_func_i2c(void) static int init_func_i2c(void)
{ {
puts("I2C: "); puts("I2C: ");
@ -312,8 +310,7 @@ static init_fnc_t *init_sequence[] = {
misc_init_f, misc_init_f,
#endif #endif
INIT_FUNC_WATCHDOG_RESET INIT_FUNC_WATCHDOG_RESET
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
defined(CONFIG_SYS_I2C)
init_func_i2c, init_func_i2c,
#endif #endif
#if defined(CONFIG_HARD_SPI) #if defined(CONFIG_HARD_SPI)

@ -288,7 +288,7 @@ int drv_video_init(void)
} }
#endif #endif
#ifdef CONFIG_SOFT_I2C #ifdef CONFIG_SYS_I2C_SOFT
void i2c_init_board(void) void i2c_init_board(void)
{ {

@ -323,7 +323,7 @@ int board_eth_init(bd_t *bis)
return rc; return rc;
} }
#ifdef CONFIG_SOFT_I2C #ifdef CONFIG_SYS_I2C_SOFT
void i2c_init_board(void) void i2c_init_board(void)
{ {
u32 pin; u32 pin;

@ -170,7 +170,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD18 */ { 0, 0, 0, 0, 0, 0 }, /* PD18 */ /* PD18 */ { 0, 0, 0, 0, 0, 0 }, /* PD18 */
/* PD17 */ { 0, 0, 0, 0, 0, 0 }, /* PD17 */ /* PD17 */ { 0, 0, 0, 0, 0, 0 }, /* PD17 */
/* PD16 */ { 0, 0, 0, 0, 0, 0 }, /* PD16 */ /* 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 */ /* PD15 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SDA */
/* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */ /* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */
#else #else

@ -145,7 +145,7 @@ int board_init(void)
/* Initialise peripherals */ /* Initialise peripherals */
at91_seriald_hw_init(); at91_seriald_hw_init();
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); i2c_set_bus_num(0);
nand_hw_init(); nand_hw_init();
macb_hw_init(); macb_hw_init();

@ -325,7 +325,7 @@ int board_early_init_r(void)
#ifdef CONFIG_MISC_INIT_R #ifdef CONFIG_MISC_INIT_R
int misc_init_r(void) 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]; uchar buf[6];
char str[18]; char str[18];
char hostname[MODULE_NAME_MAXLEN]; char hostname[MODULE_NAME_MAXLEN];
@ -348,7 +348,7 @@ int misc_init_r(void)
" device at address %02X:%04X\n", CONFIG_SYS_I2C_EEPROM, " device at address %02X:%04X\n", CONFIG_SYS_I2C_EEPROM,
CONFIG_MAC_OFFSET); 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")) if (!getenv("ethaddr"))
printf(LOG_PREFIX "MAC address not set, networking is not " printf(LOG_PREFIX "MAC address not set, networking is not "
"operational\n"); "operational\n");

@ -161,7 +161,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD18 */ { 0, 0, 0, 0, 0, 0 }, /* PD18 */ /* PD18 */ { 0, 0, 0, 0, 0, 0 }, /* PD18 */
/* PD17 */ { 0, 0, 0, 0, 0, 0 }, /* PD17 */ /* PD17 */ { 0, 0, 0, 0, 0, 0 }, /* PD17 */
/* PD16 */ { 0, 0, 0, 0, 0, 0 }, /* PD16 */ /* 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 */ /* PD15 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SDA */
/* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */ /* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */
#else #else

@ -163,7 +163,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD18 */ { 0, 0, 0, 0, 0, 0 }, /* PD18 */ /* PD18 */ { 0, 0, 0, 0, 0, 0 }, /* PD18 */
/* PD17 */ { 0, 0, 0, 0, 0, 0 }, /* PD17 */ /* PD17 */ { 0, 0, 0, 0, 0, 0 }, /* PD17 */
/* PD16 */ { 0, 0, 0, 0, 0, 0 }, /* PD16 */ /* 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 */ /* PD15 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SDA */
/* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */ /* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */
#else #else

@ -245,7 +245,7 @@ int board_eth_init(bd_t *bis)
* However i2c_get_bus_num() cannot be called before * However i2c_get_bus_num() cannot be called before
* relocation. * relocation.
*/ */
#ifdef CONFIG_SOFT_I2C #ifdef CONFIG_SYS_I2C_SOFT
void iic_init(void) void iic_init(void)
{ {
/* ports are now initialized in board_early_init_f() */ /* ports are now initialized in board_early_init_f() */
@ -253,7 +253,7 @@ void iic_init(void)
int iic_read(void) int iic_read(void)
{ {
switch ((gd->flags & GD_FLG_RELOC) ? i2c_get_bus_num() : 0) { switch (I2C_ADAP_HWNR) {
case 0: case 0:
return at91_get_pio_value(I2C0_PORT, SDA0_PIN); return at91_get_pio_value(I2C0_PORT, SDA0_PIN);
case 1: case 1:
@ -264,7 +264,7 @@ int iic_read(void)
void iic_sda(int bit) void iic_sda(int bit)
{ {
switch ((gd->flags & GD_FLG_RELOC) ? i2c_get_bus_num() : 0) { switch (I2C_ADAP_HWNR) {
case 0: case 0:
at91_set_pio_value(I2C0_PORT, SDA0_PIN, bit); at91_set_pio_value(I2C0_PORT, SDA0_PIN, bit);
break; break;
@ -276,7 +276,7 @@ void iic_sda(int bit)
void iic_scl(int bit) void iic_scl(int bit)
{ {
switch ((gd->flags & GD_FLG_RELOC) ? i2c_get_bus_num() : 0) { switch (I2C_ADAP_HWNR) {
case 0: case 0:
at91_set_pio_value(I2C0_PORT, SCL0_PIN, bit); at91_set_pio_value(I2C0_PORT, SCL0_PIN, bit);
break; break;

@ -73,7 +73,7 @@ int board_eth_init(bd_t *bis)
} }
#endif #endif
#ifdef CONFIG_SOFT_I2C #ifdef CONFIG_SYS_I2C_SOFT
void i2c_init_board(void) void i2c_init_board(void)
{ {
u32 pin; u32 pin;

@ -84,7 +84,7 @@ CONFIG_MCFPIT -- define to use PIT timer
CONFIG_FSL_I2C -- define to use FSL common I2C driver CONFIG_FSL_I2C -- define to use FSL common I2C driver
CONFIG_HARD_I2C -- define for I2C hardware support 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_SPEED -- define for I2C speed
CONFIG_SYS_I2C_SLAVE -- define for I2C slave address CONFIG_SYS_I2C_SLAVE -- define for I2C slave address
CONFIG_SYS_I2C_OFFSET -- define for I2C base address offset CONFIG_SYS_I2C_OFFSET -- define for I2C base address offset

@ -92,7 +92,7 @@ CONFIG_MCFPIT -- define to use PIT timer
CONFIG_FSL_I2C -- define to use FSL common I2C driver CONFIG_FSL_I2C -- define to use FSL common I2C driver
CONFIG_HARD_I2C -- define for I2C hardware support 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_SPEED -- define for I2C speed
CONFIG_SYS_I2C_SLAVE -- define for I2C slave address CONFIG_SYS_I2C_SLAVE -- define for I2C slave address
CONFIG_SYS_I2C_OFFSET -- define for I2C base address offset CONFIG_SYS_I2C_OFFSET -- define for I2C base address offset

@ -91,7 +91,7 @@ CONFIG_MCFPIT -- define to use PIT timer
CONFIG_FSL_I2C -- define to use FSL common I2C driver CONFIG_FSL_I2C -- define to use FSL common I2C driver
CONFIG_HARD_I2C -- define for I2C hardware support 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_SPEED -- define for I2C speed
CONFIG_SYS_I2C_SLAVE -- define for I2C slave address CONFIG_SYS_I2C_SLAVE -- define for I2C slave address
CONFIG_SYS_I2C_OFFSET -- define for I2C base address offset CONFIG_SYS_I2C_OFFSET -- define for I2C base address offset

@ -114,7 +114,7 @@ CONFIG_MCFPIT -- define to use PIT timer
CONFIG_FSL_I2C -- define to use FSL common I2C driver CONFIG_FSL_I2C -- define to use FSL common I2C driver
CONFIG_HARD_I2C -- define for I2C hardware support 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_SPEED -- define for I2C speed
CONFIG_SYS_I2C_SLAVE -- define for I2C slave address CONFIG_SYS_I2C_SLAVE -- define for I2C slave address
CONFIG_SYS_I2C_OFFSET -- define for I2C base address offset CONFIG_SYS_I2C_OFFSET -- define for I2C base address offset

@ -99,7 +99,7 @@ CONFIG_SLTTMR -- define to use SLT timer
CONFIG_FSL_I2C -- define to use FSL common I2C driver CONFIG_FSL_I2C -- define to use FSL common I2C driver
CONFIG_HARD_I2C -- define for I2C hardware support 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_SPEED -- define for I2C speed
CONFIG_SYS_I2C_SLAVE -- define for I2C slave address CONFIG_SYS_I2C_SLAVE -- define for I2C slave address
CONFIG_SYS_I2C_OFFSET -- define for I2C base address offset CONFIG_SYS_I2C_OFFSET -- define for I2C base address offset

@ -51,7 +51,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PA27 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 RXDV */ /* PA27 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 RXDV */
/* PA26 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 RXER */ /* PA26 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 RXER */
/* PA25 */ { 0, 0, 0, 0, 1, 0 }, /* 8247_P0 */ /* 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 */ /* PA24 */ { 1, 0, 0, 0, 1, 1 }, /* I2C_SDA2 */
/* PA23 */ { 1, 0, 0, 1, 1, 1 }, /* I2C_SCL2 */ /* PA23 */ { 1, 0, 0, 1, 1, 1 }, /* I2C_SCL2 */
#else /* normal I/O port pins */ #else /* normal I/O port pins */

@ -318,10 +318,14 @@ int ivm_read_eeprom(void)
I2C_MUX_DEVICE *dev = NULL; I2C_MUX_DEVICE *dev = NULL;
#endif #endif
uchar i2c_buffer[CONFIG_SYS_IVM_EEPROM_MAX_LEN]; uchar i2c_buffer[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
uchar *buf; char *buf;
unsigned long dev_addr = CONFIG_SYS_IVM_EEPROM_ADR; unsigned long dev_addr = CONFIG_SYS_IVM_EEPROM_ADR;
int ret; int ret;
#if defined(CONFIG_SYS_I2C)
buf = getenv("EEprom_ivm");
i2c_set_bus_num(buf ? (int)simple_strtol(buf, NULL, 10) : 0);
#else
#if defined(CONFIG_I2C_MUX) #if defined(CONFIG_I2C_MUX)
/* First init the Bus, select the Bus */ /* First init the Bus, select the Bus */
buf = (unsigned char *) getenv("EEprom_ivm"); buf = (unsigned char *) getenv("EEprom_ivm");

@ -63,7 +63,7 @@ static const u32 kwmpp_config[] = {
MPP5_NF_IO7, MPP5_NF_IO7,
MPP6_SYSRST_OUTn, MPP6_SYSRST_OUTn,
MPP7_PEX_RST_OUTn, MPP7_PEX_RST_OUTn,
#if defined(CONFIG_SOFT_I2C) #if defined(CONFIG_SYS_I2C_SOFT)
MPP8_GPIO, /* SDA */ MPP8_GPIO, /* SDA */
MPP9_GPIO, /* SCL */ MPP9_GPIO, /* SCL */
#endif #endif
@ -234,7 +234,7 @@ int misc_init_r(void)
int board_early_init_f(void) int board_early_init_f(void)
{ {
#if defined(CONFIG_SOFT_I2C) #if defined(CONFIG_SYS_I2C_SOFT)
u32 tmp; u32 tmp;
/* set the 2 bitbang i2c pins as output gpios */ /* set the 2 bitbang i2c pins as output gpios */
@ -260,7 +260,7 @@ int board_init(void)
kw_gpio_set_valid(KM_FLASH_GPIO_PIN, 1); kw_gpio_set_valid(KM_FLASH_GPIO_PIN, 1);
kw_gpio_direction_output(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 * Reinit the GPIO for I2C Bitbang driver so that the now
* available gpio framework is consistent. The calls to * available gpio framework is consistent. The calls to
@ -440,7 +440,7 @@ int hush_init_var(void)
} }
#endif #endif
#if defined(CONFIG_SOFT_I2C) #if defined(CONFIG_SYS_I2C_SOFT)
void set_sda(int state) void set_sda(int state)
{ {
I2C_ACTIVE; I2C_ACTIVE;

@ -480,7 +480,7 @@ static void kbd_init (void)
uchar val, errcd; uchar val, errcd;
int i; int i;
i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); i2c_set_bus_num(0);
gd->arch.kbd_status = 0; gd->arch.kbd_status = 0;

@ -104,7 +104,7 @@ int pcmcia_hardware_enable(int slot)
/* switch VCC on */ /* switch VCC on */
val |= MAX1604_OP_SUS | MAX1604_VCCBON; 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); i2c_write (CONFIG_SYS_I2C_POWER_A_ADDR, 0, 0, &val, 1);
udelay(500000); udelay(500000);
@ -193,7 +193,7 @@ int pcmcia_voltage_set(int slot, int vcc, int vpp)
*/ */
debug ("PCMCIA power OFF\n"); debug ("PCMCIA power OFF\n");
val = MAX1604_VCCBHIZ | MAX1604_VPPBHIZ; 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); i2c_write (CONFIG_SYS_I2C_POWER_A_ADDR, 0, 0, &val, 1);
val = 0; val = 0;

@ -169,7 +169,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD18 */ /* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD18 */
/* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* PD17 */ /* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* PD17 */
/* PD16 */ { 0, 1, 0, 1, 0, 0 }, /* PD16 */ /* 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 */ /* PD15 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SDA */
/* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */ /* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */
#else #else

@ -169,7 +169,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD18 */ /* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD18 */
/* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* PD17 */ /* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* PD17 */
/* PD16 */ { 0, 1, 0, 1, 0, 0 }, /* PD16 */ /* 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 */ /* PD15 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SDA */
/* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */ /* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */
#else #else

@ -187,7 +187,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD17 */ { CONF, SPEC, 1, DOUT, ACTV, 0 }, /* SPI_MOSI */ /* PD17 */ { CONF, SPEC, 1, DOUT, ACTV, 0 }, /* SPI_MOSI */
/* PD16 */ { CONF, SPEC, 1, DIN, ACTV, 0 }, /* SPI_MISO */ /* PD16 */ { CONF, SPEC, 1, DIN, ACTV, 0 }, /* SPI_MISO */
#endif #endif
#if defined(CONFIG_SOFT_I2C) #if defined(CONFIG_SYS_I2C_SOFT)
/* PD15 */ { CONF, GPIO, 0, DOUT, OPEN, 1 }, /* I2C_SDA */ /* PD15 */ { CONF, GPIO, 0, DOUT, OPEN, 1 }, /* I2C_SDA */
/* PD14 */ { CONF, GPIO, 0, DOUT, ACTV, 1 }, /* I2C_SCL */ /* PD14 */ { CONF, GPIO, 0, DOUT, ACTV, 1 }, /* I2C_SCL */
#else #else

@ -32,7 +32,6 @@
#include <spd_sdram.h> #include <spd_sdram.h>
#include <i2c.h> #include <i2c.h>
#include "../common/sb_common.h" #include "../common/sb_common.h"
#include "../common/ppc440gx_i2c.h"
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) || \ #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) || \
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3) defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
#include <net.h> #include <net.h>

@ -160,7 +160,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD19 */ /* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD19 */
/* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXPRTY */ /* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXPRTY */
/* PD16 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXPRTY */ /* 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 */ /* PD15 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SDA */
/* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */ /* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */
#else #else

@ -180,7 +180,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD19 */ /* PD18 */ { 0, 0, 0, 1, 0, 0 }, /* PD19 */
/* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXPRTY */ /* PD17 */ { 0, 1, 0, 0, 0, 0 }, /* FCC1 ATMRXPRTY */
/* PD16 */ { 0, 1, 0, 1, 0, 0 }, /* FCC1 ATMTXPRTY */ /* 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 */ /* PD15 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SDA */
/* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */ /* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* I2C SCL */
#else #else

@ -50,4 +50,4 @@ typedef struct{
static HWIB_INFO hwinf = {0, 0, 1, 0, 1, 0, 0, 0, 0, 8272, 0 ,0, static HWIB_INFO hwinf = {0, 0, 1, 0, 1, 0, 0, 0, 0, 8272, 0 ,0,
0, 0, 0, 0, 0, 0}; 0, 0, 0, 0, 0, 0};
#endif #endif /* __CONFIG_H */

@ -261,8 +261,7 @@ void __dram_init_banksize(void)
void dram_init_banksize(void) void dram_init_banksize(void)
__attribute__((weak, alias("__dram_init_banksize"))); __attribute__((weak, alias("__dram_init_banksize")));
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
defined(CONFIG_SYS_I2C)
static int init_func_i2c(void) static int init_func_i2c(void)
{ {
puts("I2C: "); puts("I2C: ");
@ -920,8 +919,7 @@ static init_fnc_t init_sequence_f[] = {
misc_init_f, misc_init_f,
#endif #endif
INIT_FUNC_WATCHDOG_RESET INIT_FUNC_WATCHDOG_RESET
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
defined(CONFIG_SYS_I2C)
init_func_i2c, init_func_i2c,
#endif #endif
#if defined(CONFIG_HARD_SPI) #if defined(CONFIG_HARD_SPI)

@ -406,8 +406,7 @@ void eeprom_init (void)
#if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) #if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
spi_init_f (); spi_init_f ();
#endif #endif
#if defined(CONFIG_HARD_I2C) || \ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT)
defined(CONFIG_SOFT_I2C)
i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
#endif #endif
} }

@ -34,8 +34,8 @@
#ifdef CONFIG_LOGBUFFER #ifdef CONFIG_LOGBUFFER
#include <logbuff.h> #include <logbuff.h>
#endif #endif
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \
defined(CONFIG_SYS_I2C_ADAPTERS) #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
#include <i2c.h> #include <i2c.h>
#endif #endif
@ -216,11 +216,9 @@ int stdio_init (void)
drv_arm_dcc_init (); drv_arm_dcc_init ();
#endif #endif
#ifdef CONFIG_SYS_I2C #ifdef CONFIG_SYS_I2C
#ifdef CONFIG_SYS_I2C_ADAPTERS
i2c_init_all(); i2c_init_all();
#endif
#else #else
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) #if defined(CONFIG_HARD_I2C)
i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
#endif #endif
#endif #endif

@ -40,13 +40,13 @@ COBJS-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o
COBJS-$(CONFIG_PPC4XX_I2C) += ppc4xx_i2c.o COBJS-$(CONFIG_PPC4XX_I2C) += ppc4xx_i2c.o
COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_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_TEGRA_I2C) += tegra_i2c.o
COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o
COBJS-$(CONFIG_SH_I2C) += sh_i2c.o COBJS-$(CONFIG_SH_I2C) += sh_i2c.o
COBJS-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o COBJS-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o
COBJS-$(CONFIG_SYS_I2C) += i2c_core.o COBJS-$(CONFIG_SYS_I2C) += i2c_core.o
COBJS-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o
COBJS-$(CONFIG_ZYNQ_I2C) += zynq_i2c.o COBJS-$(CONFIG_ZYNQ_I2C) += zynq_i2c.o
COBJS := $(COBJS-y) COBJS := $(COBJS-y)

@ -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 * (C) Copyright 2001, 2002
* Wolfgang Denk, DENX Software Engineering, wd@denx.de. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
* *
@ -103,14 +107,30 @@
/* #define DEBUG_I2C */ /* #define DEBUG_I2C */
#ifdef DEBUG_I2C
DECLARE_GLOBAL_DATA_PTR; 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 #endif
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* Definitions * Definitions
*/ */
#define RETRIES 0 #define RETRIES 0
#define I2C_ACK 0 /* PD_SDA level to ack a byte */ #define I2C_ACK 0 /* PD_SDA level to ack a byte */
@ -125,10 +145,6 @@ DECLARE_GLOBAL_DATA_PTR;
#define PRINTD(fmt,args...) #define PRINTD(fmt,args...)
#endif #endif
#if defined(CONFIG_I2C_MULTI_BUS)
static unsigned int i2c_bus_num __attribute__ ((section (".data"))) = 0;
#endif /* CONFIG_I2C_MULTI_BUS */
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* Local functions * Local functions
*/ */
@ -267,39 +283,6 @@ static int write_byte(uchar data)
return(nack); /* not a nack is an ack */ 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 * if ack == I2C_ACK, ACK the byte so can continue reading, else
* send I2C_NOACK to end the read. * send I2C_NOACK to end the read.
@ -330,14 +313,10 @@ static uchar read_byte(int ack)
return(data); return(data);
} }
/*=====================================================================*/
/* Public Functions */
/*=====================================================================*/
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* Initialization * 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) #if defined(CONFIG_SYS_I2C_INIT_BOARD)
/* call board specific i2c bus reset routine before accessing the */ /* call board specific i2c bus reset routine before accessing the */
@ -360,7 +339,7 @@ void i2c_init (int speed, int slaveaddr)
* completion of EEPROM writes since the chip stops responding until * completion of EEPROM writes since the chip stops responding until
* the write completes (typically 10mSec). * the write completes (typically 10mSec).
*/ */
int i2c_probe(uchar addr) static int soft_i2c_probe(struct i2c_adapter *adap, uint8_t addr)
{ {
int rc; int rc;
@ -378,7 +357,8 @@ int i2c_probe(uchar addr)
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* Read bytes * 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; int shift;
PRINTD("i2c_read: chip %02X addr %02X alen %d buffer %p len %d\n", PRINTD("i2c_read: chip %02X addr %02X alen %d buffer %p len %d\n",
@ -452,7 +432,8 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* Write bytes * 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; int shift, failures = 0;
@ -482,3 +463,32 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
send_stop(); send_stop();
return(failures); 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

@ -86,8 +86,8 @@
* PCI stuff * PCI stuff
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
*/ */
#define CONFIG_HARD_I2C 1 /* To enable I2C support */ #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_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -277,7 +277,6 @@ extern unsigned long get_sdram_size(void);
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_I2C_CMD_TREE #define CONFIG_I2C_CMD_TREE
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address*/ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address*/

@ -180,6 +180,7 @@
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* I2C EEPROM (CAT24WC08) for environment * I2C EEPROM (CAT24WC08) for environment
*/ */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#define CONFIG_PPC4XX_I2C /* use PPC4xx driver */ #define CONFIG_PPC4XX_I2C /* use PPC4xx driver */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */

@ -129,10 +129,11 @@
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* I2C/EEPROM/RTC configuration * 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 * Software (bit-bang) I2C driver configuration
*/ */

@ -133,10 +133,11 @@
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* I2C/EEPROM/RTC configuration * 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 * Software (bit-bang) I2C driver configuration
*/ */

@ -171,7 +171,6 @@
* I2C * I2C
*/ */
#define CONFIG_HARD_I2C 1 /* I2C with hardware support */ #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_PPC4XX_I2C /* use PPC4xx driver */
#define CONFIG_SYS_I2C_SPEED 100000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 100000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -158,26 +158,33 @@
/* /*
* Enable I2C and select the hardware/software driver * Enable I2C and select the hardware/software driver
*/ */
#define CONFIG_HARD_I2C 1 /* CPM based I2C */ #define CONFIG_HARD_I2C 1 /* CPM based I2C */
#undef CONFIG_SOFT_I2C /* Bit-banged I2C */ #undef CONFIG_SYS_I2C_SOFT /* Bit-banged I2C */
#ifdef CONFIG_HARD_I2C #ifdef CONFIG_HARD_I2C
#define CONFIG_SYS_I2C_SPEED 100000 /* clock speed in Hz */ #define CONFIG_SYS_I2C_SPEED 100000 /* clock speed in Hz */
#define CONFIG_SYS_I2C_SLAVE 0xFE /* I2C slave address */ #define CONFIG_SYS_I2C_SLAVE 0xFE /* I2C slave address */
#endif #endif
#ifdef CONFIG_SOFT_I2C #ifdef CONFIG_SYS_I2C_SOFT
#define PB_SCL 0x00000020 /* PB 26 */ #define CONFIG_SYS_I2C
#define PB_SDA 0x00000010 /* PB 27 */ #define CONFIG_SYS_I2C_SOFT_SPEED 50000
#define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL) #define CONFIG_SYS_I2C_SOFT_SLAVE 0xFE
#define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA) #define PB_SCL 0x00000020 /* PB 26 */
#define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA) #define PB_SDA 0x00000010 /* PB 27 */
#define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0) #define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL)
#define I2C_SDA(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \ #define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA)
else immr->im_cpm.cp_pbdat &= ~PB_SDA #define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA)
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \ #define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
else immr->im_cpm.cp_pbdat &= ~PB_SCL #define I2C_SDA(bit) if (bit) \
#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */ 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 #endif
/* /*

@ -169,12 +169,15 @@
* configuration items that the driver uses to drive the port pins. * configuration items that the driver uses to drive the port pins.
*/ */
#define CONFIG_HARD_I2C 1 /* To enable I2C support */ #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_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#ifdef CONFIG_SOFT_I2C #ifdef CONFIG_SYS_I2C_SOFT
#error "Soft I2C is not configured properly. Please review!" #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_PORT 3 /* Port A=0, B=1, C=2, D=3 */
#define I2C_ACTIVE (iop->pdir |= 0x00010000) #define I2C_ACTIVE (iop->pdir |= 0x00010000)
#define I2C_TRISTATE (iop->pdir &= ~0x00010000) #define I2C_TRISTATE (iop->pdir &= ~0x00010000)
@ -184,7 +187,7 @@
#define I2C_SCL(bit) if(bit) iop->pdat |= 0x00020000; \ #define I2C_SCL(bit) if(bit) iop->pdat |= 0x00020000; \
else iop->pdat &= ~0x00020000 else iop->pdat &= ~0x00020000
#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */ #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 0x57 /* EEPROM IS24C02 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */ #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */

@ -106,12 +106,10 @@
#define CONFIG_DOS_PARTITION #define CONFIG_DOS_PARTITION
/* enable I2C and select the hardware/software driver */ /* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_SYS_I2C
#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */ #define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */
# define CONFIG_SYS_I2C_SPEED 50000 #define CONFIG_SYS_I2C_SOFT_SPEED 50000
# define CONFIG_SYS_I2C_SLAVE 0xFE #define CONFIG_SYS_I2C_SOFT_SLAVE 0xFE
# define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
/* /*
* Software (bit-bang) I2C driver configuration * Software (bit-bang) I2C driver configuration
*/ */
@ -133,6 +131,9 @@
#define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */ #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. * Command line configuration.

@ -73,11 +73,10 @@
#define CONFIG_MISC_INIT_R 1 #define CONFIG_MISC_INIT_R 1
/* enable I2C and select the hardware/software driver */ /* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_SYS_I2C
#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_SOFT_SPEED 400000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SOFT_SLAVE 0x7F
/* /*
* Software (bit-bang) I2C driver configuration * Software (bit-bang) I2C driver configuration
*/ */

@ -62,8 +62,10 @@
/* enable I2C and select the hardware/software driver */ /* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_SYS_I2C
#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */ #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 * Software (bit-bang) I2C driver configuration
*/ */
@ -80,9 +82,6 @@
else 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 */ #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 0x50 /* EEPROM X24C16 */
# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* bytes of address */ # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* bytes of address */
/* mask of address bits that overflow into the "EEPROM chip address" */ /* mask of address bits that overflow into the "EEPROM chip address" */

@ -110,15 +110,13 @@
* If the software driver is chosen, there are some additional * If the software driver is chosen, there are some additional
* configuration items that the driver uses to drive the port pins. * configuration items that the driver uses to drive the port pins.
*/ */
#undef CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_SYS_I2C
#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_SOFT_SPEED 400000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SOFT_SLAVE 0x7F
/* /*
* Software (bit-bang) I2C driver configuration * 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_PORT 3 /* Port A=0, B=1, C=2, D=3 */
#define I2C_ACTIVE (iop->pdir |= 0x00010000) #define I2C_ACTIVE (iop->pdir |= 0x00010000)
#define I2C_TRISTATE (iop->pdir &= ~0x00010000) #define I2C_TRISTATE (iop->pdir &= ~0x00010000)
@ -128,7 +126,6 @@
#define I2C_SCL(bit) if(bit) iop->pdat |= 0x00020000; \ #define I2C_SCL(bit) if(bit) iop->pdat |= 0x00020000; \
else iop->pdat &= ~0x00020000 else iop->pdat &= ~0x00020000
#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */ #define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
#endif /* CONFIG_SOFT_I2C */
/* /*

@ -211,7 +211,6 @@
#define CONFIG_SYS_HZ 1000 /* decrementer freq: 1 ms ticks */ #define CONFIG_SYS_HZ 1000 /* decrementer freq: 1 ms ticks */
#define CONFIG_HARD_I2C 1 /* I2C with hardware support */ #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_PPC4XX_I2C /* use PPC4xx driver */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -134,7 +134,6 @@
* I2C * I2C
*----------------------------------------------------------------------*/ *----------------------------------------------------------------------*/
#define CONFIG_HARD_I2C 1 /* I2C hardware support */ #define CONFIG_HARD_I2C 1 /* I2C hardware support */
#undef CONFIG_SOFT_I2C /* I2C !bit-banged */
#define CONFIG_PPC4XX_I2C /* use PPC4xx driver */ #define CONFIG_PPC4XX_I2C /* use PPC4xx driver */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed 400kHz */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed 400kHz */
#define CONFIG_SYS_I2C_SLAVE 0x7F /* I2C slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F /* I2C slave address */

@ -106,13 +106,11 @@
/* /*
* enable I2C and select the hardware/software driver * enable I2C and select the hardware/software driver
*/ */
#undef CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_SYS_I2C
#define CONFIG_SOFT_I2C /* I2C bit-banged */ #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 * Software (bit-bang) I2C driver configuration
*/ */
@ -128,7 +126,6 @@
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \ #define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
else 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 */ #define I2C_DELAY udelay(2) /* 1/4 I2C clock duration */
#endif /* CONFIG_SOFT_I2C */
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* I2C Configuration * I2C Configuration

@ -114,13 +114,13 @@
/* /*
* enable I2C and select the hardware/software driver * enable I2C and select the hardware/software driver
*/ */
#undef CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_SYS_I2C
#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */ #define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */
#define CONFIG_SYS_I2C_SPEED 93000 /* 93 kHz is supposed to work */ #ifdef CONFIG_SYS_I2C_SOFT
#define CONFIG_SYS_I2C_SLAVE 0xFE #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 * Software (bit-bang) I2C driver configuration
*/ */
@ -136,7 +136,7 @@
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \ #define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
else 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 */ #define I2C_DELAY udelay(2) /* 1/4 I2C clock duration */
#endif /* CONFIG_SOFT_I2C */ #endif /* CONFIG_SYS_I2C_SOFT */
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------

@ -84,7 +84,6 @@
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hw support */ #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_SPEED 80000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x58000 #define CONFIG_SYS_I2C_OFFSET 0x58000

@ -147,7 +147,6 @@
/* I2c */ /* I2c */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hardware support */ #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_SPEED 80000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x58000 #define CONFIG_SYS_I2C_OFFSET 0x58000

@ -101,7 +101,6 @@
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hw support */ #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_SPEED 80000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x00000300 #define CONFIG_SYS_I2C_OFFSET 0x00000300

@ -111,7 +111,6 @@
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hw support */ #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_SPEED 80000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x00000300 #define CONFIG_SYS_I2C_OFFSET 0x00000300

@ -111,7 +111,6 @@
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hw support */ #define CONFIG_HARD_I2C /* I2C with hw support */
#undef CONFIG_SOFT_I2C
#define CONFIG_SYS_I2C_SPEED 80000 #define CONFIG_SYS_I2C_SPEED 80000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x00000300 #define CONFIG_SYS_I2C_OFFSET 0x00000300

@ -103,7 +103,6 @@
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hw support */ #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_SPEED 80000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x58000 #define CONFIG_SYS_I2C_OFFSET 0x58000

@ -97,7 +97,6 @@
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hw support */ #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_SPEED 80000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x58000 #define CONFIG_SYS_I2C_OFFSET 0x58000

@ -97,7 +97,6 @@
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hw support */ #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_SPEED 80000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x58000 #define CONFIG_SYS_I2C_OFFSET 0x58000

@ -215,7 +215,7 @@
/* I2c */ /* I2c */
#undef CONFIG_FSL_I2C #undef CONFIG_FSL_I2C
#undef CONFIG_HARD_I2C /* I2C with hardware support */ #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 */ /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SPEED 80000 #define CONFIG_SYS_I2C_SPEED 80000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -158,7 +158,6 @@
/* I2c */ /* I2c */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hardware support */ #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_SPEED 80000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x58000 #define CONFIG_SYS_I2C_OFFSET 0x58000

@ -191,7 +191,6 @@
/* I2c */ /* I2c */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hardware support */ #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_SPEED 80000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x58000 #define CONFIG_SYS_I2C_OFFSET 0x58000

@ -122,7 +122,6 @@
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hw support */ #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_SPEED 80000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x00008F00 #define CONFIG_SYS_I2C_OFFSET 0x00008F00

@ -119,7 +119,6 @@
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_HARD_I2C /* I2C with hw support */ #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_SPEED 80000
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_OFFSET 0x00008F00 #define CONFIG_SYS_I2C_OFFSET 0x00008F00

@ -196,7 +196,6 @@
* I2C * I2C
*----------------------------------------------------------------------*/ *----------------------------------------------------------------------*/
#define CONFIG_HARD_I2C 1 /* I2C hardware support */ #define CONFIG_HARD_I2C 1 /* I2C hardware support */
#undef CONFIG_SOFT_I2C /* I2C !bit-banged */
#define CONFIG_PPC4XX_I2C /* use PPC4xx driver */ #define CONFIG_PPC4XX_I2C /* use PPC4xx driver */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed 400kHz */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed 400kHz */
#define CONFIG_SYS_I2C_SLAVE 0x7F /* I2C slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F /* I2C slave address */

@ -73,8 +73,10 @@
#undef CONFIG_UCODE_PATCH #undef CONFIG_UCODE_PATCH
/* enable I2C and select the hardware/software driver */ /* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_SYS_I2C
#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */ #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 * Software (bit-bang) I2C driver configuration
*/ */
@ -91,8 +93,6 @@
else 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 */ #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 0x50 /* EEPROM X24C04 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* bytes of address */ #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* bytes of address */
/* mask of address bits that overflow into the "EEPROM chip address" */ /* mask of address bits that overflow into the "EEPROM chip address" */

@ -234,7 +234,6 @@
/* I2C */ /* I2C */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -327,7 +327,6 @@
/* I2C */ /* I2C */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -355,7 +355,6 @@
/* I2C */ /* I2C */
#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_HARD_I2C /* I2C with hardware support*/
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */

@ -131,8 +131,6 @@
#define I2C_8574_PCI66 0x20 /* 0=33MHz PCI, 1=66MHz PCI */ #define I2C_8574_PCI66 0x20 /* 0=33MHz PCI, 1=66MHz PCI */
#define I2C_8574_FLASHSIDE 0x40 /* 0=Reset vector from U4, 1=from U7*/ #define I2C_8574_FLASHSIDE 0x40 /* 0=Reset vector from U4, 1=from U7*/
#undef CONFIG_SOFT_I2C
#endif #endif
/* Compact Flash */ /* Compact Flash */

@ -424,7 +424,6 @@
/* I2C */ /* I2C */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -288,7 +288,6 @@
/* I2C */ /* I2C */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */

@ -342,7 +342,6 @@
/* I2C */ /* I2C */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -368,7 +368,6 @@
/* I2C */ /* I2C */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_FSL_I2C #define CONFIG_FSL_I2C
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -436,7 +436,6 @@
*/ */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -262,7 +262,6 @@
*/ */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_HARD_I2C /* I2C with hardware support*/
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */ #define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */

@ -285,7 +285,6 @@ extern unsigned long get_clock_freq(void);
*/ */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_HARD_I2C /* I2C with hardware support*/
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */ #define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */

@ -234,7 +234,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x57 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x57
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -360,8 +360,7 @@ extern unsigned long get_clock_freq(void);
*/ */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_HARD_I2C /* I2C with hardware support*/
#undef CONFIG_SOFT_I2C /* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */ #define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */
#define CONFIG_SYS_I2C_OFFSET 0x3000 #define CONFIG_SYS_I2C_OFFSET 0x3000

@ -283,7 +283,6 @@ extern unsigned long get_clock_freq(void);
*/ */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_HARD_I2C /* I2C with hardware support*/
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */ #define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */

@ -256,7 +256,6 @@
*/ */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_HARD_I2C /* I2C with hardware support*/
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */ #define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */

@ -268,7 +268,6 @@ extern unsigned long get_clock_freq(void);
*/ */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_HARD_I2C /* I2C with hardware support*/
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x52 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x52

@ -304,7 +304,6 @@ extern unsigned long get_clock_freq(void);
*/ */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_HARD_I2C /* I2C with hardware support*/
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -433,7 +433,6 @@
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x57 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x57

@ -254,7 +254,6 @@
*/ */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_HARD_I2C /* I2C with hardware support*/
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */ #define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */

@ -300,7 +300,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
*/ */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_HARD_I2C /* I2C with hardware support*/
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */ #define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */

@ -491,7 +491,6 @@ extern unsigned long get_sdram_size(void);
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_I2C_CMD_TREE #define CONFIG_I2C_CMD_TREE
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address*/ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address*/

@ -315,7 +315,6 @@ extern unsigned long get_clock_freq(void);
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x51 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x51

@ -369,7 +369,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_I2C_CMD_TREE #define CONFIG_I2C_CMD_TREE
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address*/ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address*/

@ -227,7 +227,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
/* I2C */ /* I2C */
#define CONFIG_FSL_I2C /* Use FSL common I2C driver */ #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
#define CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_HARD_I2C /* I2C with hardware support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */
#define CONFIG_I2C_MULTI_BUS #define CONFIG_I2C_MULTI_BUS
#define CONFIG_I2C_CMD_TREE #define CONFIG_I2C_CMD_TREE
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address*/ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address*/

@ -57,10 +57,10 @@
"bootm" "bootm"
/* enable I2C and select the hardware/software driver */ /* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C #define CONFIG_SYS_I2C
#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */ #define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */
# define CONFIG_SYS_I2C_SPEED 50000 #define CONFIG_SYS_I2C_SOFT_SPEED 50000
# define CONFIG_SYS_I2C_SLAVE 0xFE #define CONFIG_SYS_I2C_SOFT_SLAVE 0xFE
/* /*
* Software (bit-bang) I2C driver configuration * Software (bit-bang) I2C driver configuration
*/ */

@ -57,10 +57,10 @@
"bootm" "bootm"
/* enable I2C and select the hardware/software driver */ /* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C #define CONFIG_SYS_I2C
#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */ #define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */
# define CONFIG_SYS_I2C_SPEED 50000 #define CONFIG_SYS_I2C_SOFT_SPEED 50000
# define CONFIG_SYS_I2C_SLAVE 0xFE #define CONFIG_SYS_I2C_SOFT_SLAVE 0xFE
/* /*
* Software (bit-bang) I2C driver configuration * Software (bit-bang) I2C driver configuration
*/ */

@ -226,7 +226,6 @@
* I2C * I2C
*----------------------------------------------------------------------*/ *----------------------------------------------------------------------*/
#define CONFIG_HARD_I2C 1 /* I2C with hardware support */ #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_PPC4XX_I2C /* use PPC4xx driver */
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #define CONFIG_SYS_I2C_SLAVE 0x7F

@ -97,10 +97,13 @@
#define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */ #define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */
#define CONFIG_HARD_I2C 1 /* To I2C with hardware support */ #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_SPEED 4700 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F #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 * Software (bit-bang) I2C driver configuration
*/ */
@ -116,6 +119,7 @@
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \ #define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
else immr->im_cpm.cp_pbdat &= ~PB_SCL else immr->im_cpm.cp_pbdat &= ~PB_SCL
#define I2C_DELAY udelay(50) #define I2C_DELAY udelay(50)
#endif /* #define(CONFIG_SYS_I2C_SOFT) */
#define CONFIG_SYS_I2C_LCD_ADDR 0x8 /* LCD Control */ #define CONFIG_SYS_I2C_LCD_ADDR 0x8 /* LCD Control */
#define CONFIG_SYS_I2C_KEY_ADDR 0x9 /* Keyboard coprocessor */ #define CONFIG_SYS_I2C_KEY_ADDR 0x9 /* Keyboard coprocessor */

@ -148,14 +148,16 @@
* I2C Configuration * I2C Configuration
*----------------------------------------------------------------------------- *-----------------------------------------------------------------------------
*/ */
#define CONFIG_I2C 1 #define CONFIG_SYS_I2C_SPEED 50000
#define CONFIG_SYS_I2C_SPEED 50000 #define CONFIG_SYS_I2C_SLAVE 0x34
#define CONFIG_SYS_I2C_SLAVE 0x34
/* enable I2C and select the hardware/software driver */ /* enable I2C and select the hardware/software driver */
#define CONFIG_HARD_I2C 1 /* I2C with hardware support */ #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 * Software (bit-bang) I2C driver configuration
*/ */
@ -170,8 +172,10 @@
#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */ #define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
# define CONFIG_SYS_I2C_SPEED 50000 #define CONFIG_SYS_I2C_SOFT_SPEED 50000
# define CONFIG_SYS_I2C_SLAVE 0x34 #define CONFIG_SYS_I2C_SOFT_SLAVE 0x34
#endif
# define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM X24C16 */ # define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM X24C16 */
# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* bytes of address */ # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* bytes of address */
/* mask of address bits that overflow into the "EEPROM chip address" */ /* mask of address bits that overflow into the "EEPROM chip address" */

@ -62,6 +62,36 @@
#undef CONFIG_SYS_LOADS_BAUD_CHANGE /* don't allow baudrate change */ #undef CONFIG_SYS_LOADS_BAUD_CHANGE /* don't allow baudrate change */
#define CONFIG_BZIP2 /* Include support for bzip2 compressed images */ #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 */ #undef CONFIG_WATCHDOG /* watchdog disabled */
/* /*

@ -122,13 +122,10 @@
#endif #endif
/* enable I2C and select the hardware/software driver */ /* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C /* I2C with hardware support */ #define CONFIG_SYS_I2C
#define CONFIG_SOFT_I2C /* I2C bit-banged */ #define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */
#define CONFIG_SYS_I2C_SOFT_SPEED 50000
# define CONFIG_SYS_I2C_SPEED 50000 /* 50 kHz is supposed to work */ #define CONFIG_SYS_I2C_SOFT_SLAVE 0xFE
# define CONFIG_SYS_I2C_SLAVE 0xFE
#ifdef CONFIG_SOFT_I2C
/* /*
* Software (bit-bang) I2C driver configuration * Software (bit-bang) I2C driver configuration
*/ */
@ -144,7 +141,6 @@
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \ #define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
else 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 */ #define I2C_DELAY udelay(1) /* 1/4 I2C clock duration */
#endif /* CONFIG_SOFT_I2C */
/* /*

@ -121,7 +121,10 @@
#define CONFIG_RTC_DS1306 /* Dallas 1306 real time clock */ #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 * Software (bit-bang) I2C driver configuration
*/ */
@ -138,8 +141,6 @@
else 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 */ #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 0x50 /* Atmel 24C64 */
# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* two byte address */ # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* two byte address */

@ -202,13 +202,16 @@
* If the software driver is chosen, there are some additional * If the software driver is chosen, there are some additional
* configuration items that the driver uses to drive the port pins. * configuration items that the driver uses to drive the port pins.
*/ */
#define CONFIG_HARD_I2C 1 /* To enable I2C support */ #define CONFIG_HARD_I2C 1 /* To enable I2C support */
#undef CONFIG_SOFT_I2C /* I2C bit-banged */ #undef CONFIG_SYS_I2C_SOFT
#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F
#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!" #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_PORT 3 /* Port A=0, B=1, C=2, D=3 */
#define I2C_ACTIVE (iop->pdir |= 0x00010000) #define I2C_ACTIVE (iop->pdir |= 0x00010000)
#define I2C_TRISTATE (iop->pdir &= ~0x00010000) #define I2C_TRISTATE (iop->pdir &= ~0x00010000)
@ -218,7 +221,7 @@
#define I2C_SCL(bit) if(bit) iop->pdat |= 0x00020000; \ #define I2C_SCL(bit) if(bit) iop->pdat |= 0x00020000; \
else iop->pdat &= ~0x00020000 else iop->pdat &= ~0x00020000
#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */ #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 0x57 /* EEPROM IS24C02 */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save