Skip to contentSkip to conversation

8/12 Multiadapter/multibus I2C, configs part 1

PATCH New ksi at koi8.net 2 participants 3 messages Feb 12, 2009 – Feb 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 8/12 Multiadapter/multibus I2C, configs part 1

---

include/configs/ATUM8548.h +8 -8
diff -purN u-boot-i2c.orig/include/configs/ATUM8548.h u-boot-i2c/include/configs/ATUM8548.h
@@ -229,14 +229,14 @@
 /*
  * I2C
  */
-#define CONFIG_FSL_I2C		/* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C		/* I2C with hardware support*/
-#undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_EEPROM_ADDR	0x57
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{0x69}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
+#define CONFIG_NEW_I2C			/* New I2C code */
+#define CONFIG_FSL_I2C			/* Use FSL common I2C driver */
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_EEPROM_ADDR	0x57
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_I2C_NOPROBES		{0x69}	/* Don't probe these addrs */
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 
 /*
  * General PCI
include/configs/CPU86.h +6 -4
diff -purN u-boot-i2c.orig/include/configs/CPU86.h u-boot-i2c/include/configs/CPU86.h
@@ -123,10 +123,12 @@
 /*-----------------------------------------------------------------------
  * I2C/EEPROM/RTC configuration
  */
-#define	CONFIG_SOFT_I2C			/* Software I2C support enabled	*/
-
-# define CONFIG_SYS_I2C_SPEED		50000
-# define CONFIG_SYS_I2C_SLAVE		0xFE
+#define CONFIG_NEW_I2C
+#define CONFIG_SOFT_I2C			/* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	50000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0xFE
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 /*
  * Software (bit-bang) I2C driver configuration
  */
include/configs/CPU87.h +6 -4
diff -purN u-boot-i2c.orig/include/configs/CPU87.h u-boot-i2c/include/configs/CPU87.h
@@ -127,10 +127,12 @@
 /*-----------------------------------------------------------------------
  * I2C/EEPROM/RTC configuration
  */
-#define CONFIG_SOFT_I2C			/* Software I2C support enabled */
-
-# define CONFIG_SYS_I2C_SPEED		50000
-# define CONFIG_SYS_I2C_SLAVE		0xFE
+#define CONFIG_NEW_I2C
+#define CONFIG_SOFT_I2C			/* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	50000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0xFE
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 /*
  * Software (bit-bang) I2C driver configuration
  */
include/configs/GEN860T.h +5 -0
diff -purN u-boot-i2c.orig/include/configs/GEN860T.h u-boot-i2c/include/configs/GEN860T.h
@@ -180,6 +180,11 @@
 #endif
 
 #ifdef CONFIG_SOFT_I2C
+#define CONFIG_NEW_I2C
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	50000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0xFE
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 #define PB_SCL				0x00000020		/* PB 26					*/
 #define PB_SDA				0x00000010		/* PB 27					*/
 #define I2C_INIT			(immr->im_cpm.cp_pbdir |=  PB_SCL)
include/configs/HIDDEN_DRAGON.h +5 -0
diff -purN u-boot-i2c.orig/include/configs/HIDDEN_DRAGON.h u-boot-i2c/include/configs/HIDDEN_DRAGON.h
@@ -177,6 +177,11 @@
 
 #ifdef CONFIG_SOFT_I2C
 #error "Soft I2C is not configured properly.  Please review!"
+#define CONFIG_NEW_I2C
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	50000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0xFE
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 #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)
include/configs/HMI10.h +6 -6
diff -purN u-boot-i2c.orig/include/configs/HMI10.h u-boot-i2c/include/configs/HMI10.h
@@ -91,12 +91,12 @@
 #undef	CONFIG_SYS_LOADS_BAUD_CHANGE		/* don't allow baudrate change	*/
 
 /* 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		40000	/* 40 kHz is supposed to work	*/
-#define CONFIG_SYS_I2C_SLAVE		0xFE
-
+#define CONFIG_NEW_I2C
+#define CONFIG_SOFT_I2C			/* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	40000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0xFE
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 /* Software (bit-bang) I2C driver configuration */
 #define PB_SCL		0x00000020	/* PB 26 */
 #define PB_SDA		0x00000010	/* PB 27 */
include/configs/IAD210.h +8 -4
diff -purN u-boot-i2c.orig/include/configs/IAD210.h u-boot-i2c/include/configs/IAD210.h
@@ -109,10 +109,12 @@
 
 /* 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		0xDD
-# define CONFIG_SYS_I2C_EEPROM_ADDR	0x50
+#define CONFIG_NEW_I2C
+#define CONFIG_SOFT_I2C			/* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	50000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0xDD
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 /*
  * Software (bit-bang) I2C driver configuration
  */
@@ -131,6 +133,8 @@
 
 #define	CONFIG_RTC_MPC8xx		/* use internal RTC of MPC8xx	*/
 
+#define CONFIG_SYS_I2C_EEPROM_ADDR	0x50
+
 
 /*
  * Command line configuration.
include/configs/ICU862.h +9 -5
diff -purN u-boot-i2c.orig/include/configs/ICU862.h u-boot-i2c/include/configs/ICU862.h
@@ -105,11 +105,12 @@
 
 /* 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_NEW_I2C
+#define CONFIG_SOFT_I2C			/* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	50000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0xFE
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 /*
  * Software (bit-bang) I2C driver configuration
  */
@@ -131,6 +132,9 @@
 
 #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.
include/configs/IDS8247.h +6 -4
diff -purN u-boot-i2c.orig/include/configs/IDS8247.h u-boot-i2c/include/configs/IDS8247.h
@@ -72,10 +72,12 @@
 
 /* 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_NEW_I2C
+#define CONFIG_SOFT_I2C			/* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	400000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0x7F
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 /*
  * Software (bit-bang) I2C driver configuration
  */
include/configs/IP860.h +6 -4
diff -purN u-boot-i2c.orig/include/configs/IP860.h u-boot-i2c/include/configs/IP860.h
@@ -59,7 +59,12 @@
 
 /* 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_NEW_I2C
+#define CONFIG_SOFT_I2C			/* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	50000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0xFE
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 /*
  * Software (bit-bang) I2C driver configuration
  */
@@ -76,9 +81,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"    */
include/configs/IPHASE4539.h +6 -6
diff -purN u-boot-i2c.orig/include/configs/IPHASE4539.h u-boot-i2c/include/configs/IPHASE4539.h
@@ -109,14 +109,15 @@
  * 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_NEW_I2C
+#define CONFIG_SOFT_I2C			/* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	400000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0x7F
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 /*
  * 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)
@@ -126,7 +127,6 @@
 #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 */
 
 
 /*
include/configs/KUP4K.h +6 -7
diff -purN u-boot-i2c.orig/include/configs/KUP4K.h u-boot-i2c/include/configs/KUP4K.h
@@ -107,12 +107,12 @@
  * 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_NEW_I2C
+#define CONFIG_SOFT_I2C			/* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED	93000	/* 93 kHz is supposed to work */
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0xFE
+#define CONFIG_SYS_I2C_ADAPTERS		{&soft_i2c_adap[0]}
 /*
  * Software (bit-bang) I2C driver configuration
  */
@@ -128,7 +128,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 */
 
 
 /*-----------------------------------------------------------------------
include/configs/M52277EVB.h +6 -6
diff -purN u-boot-i2c.orig/include/configs/M52277EVB.h u-boot-i2c/include/configs/M52277EVB.h
@@ -144,13 +144,13 @@
 #define CONFIG_MCFTMR
 #undef CONFIG_MCFPIT
 
-/* I2c */
+/* I2C */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000	/* I2C speed and slave address  */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x58000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #define CONFIG_SYS_IMMR			CONFIG_SYS_MBAR
 
 /* DSPI and Serial Flash */
include/configs/M5235EVB.h +5 -5
diff -purN u-boot-i2c.orig/include/configs/M5235EVB.h u-boot-i2c/include/configs/M5235EVB.h
@@ -101,12 +101,12 @@
 #undef CONFIG_MCFPIT
 
 /* I2C */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x00000300
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #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)
include/configs/M5253DEMO.h +5 -4
diff -purN u-boot-i2c.orig/include/configs/M5253DEMO.h u-boot-i2c/include/configs/M5253DEMO.h
@@ -119,11 +119,12 @@
 #define CONFIG_HOSTNAME		M5253DEMO
 
 /* I2C */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x00000280
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #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)
include/configs/M5271EVB.h +5 -5
diff -purN u-boot-i2c.orig/include/configs/M5271EVB.h u-boot-i2c/include/configs/M5271EVB.h
@@ -111,12 +111,12 @@
 #endif
 
 /* I2C */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x00000300
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #define CONFIG_SYS_IMMR		CONFIG_SYS_MBAR
 
 #define CONFIG_BOOTDELAY	1	/* autoboot after 1 seconds */
include/configs/M5275EVB.h +5 -5
diff -purN u-boot-i2c.orig/include/configs/M5275EVB.h u-boot-i2c/include/configs/M5275EVB.h
@@ -111,12 +111,12 @@
 #endif
 
 /* I2C */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x00000300
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #define CONFIG_SYS_IMMR		CONFIG_SYS_MBAR
 #define CONFIG_SYS_I2C_PINMUX_REG	(gpio_reg->par_feci2c)
 #define CONFIG_SYS_I2C_PINMUX_CLR	(0xFFF0)
include/configs/M53017EVB.h +5 -5
diff -purN u-boot-i2c.orig/include/configs/M53017EVB.h u-boot-i2c/include/configs/M53017EVB.h
@@ -98,12 +98,12 @@
 #undef CONFIG_MCFPIT
 
 /* I2C */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x58000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #define CONFIG_SYS_IMMR			CONFIG_SYS_MBAR
 
 #define CONFIG_BOOTDELAY		1	/* autoboot after 5 seconds */
include/configs/M5329EVB.h +5 -5
diff -purN u-boot-i2c.orig/include/configs/M5329EVB.h u-boot-i2c/include/configs/M5329EVB.h
@@ -97,12 +97,12 @@
 #undef CONFIG_MCFPIT
 
 /* I2C */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x58000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #define CONFIG_SYS_IMMR		CONFIG_SYS_MBAR
 
 #define CONFIG_BOOTDELAY	1	/* autoboot after 5 seconds */
include/configs/M5373EVB.h +5 -5
diff -purN u-boot-i2c.orig/include/configs/M5373EVB.h u-boot-i2c/include/configs/M5373EVB.h
@@ -97,12 +97,12 @@
 #undef CONFIG_MCFPIT
 
 /* I2C */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x58000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #define CONFIG_SYS_IMMR		CONFIG_SYS_MBAR
 
 #define CONFIG_BOOTDELAY	1	/* autoboot after 5 seconds */
include/configs/M54451EVB.h +5 -5
diff -purN u-boot-i2c.orig/include/configs/M54451EVB.h u-boot-i2c/include/configs/M54451EVB.h
@@ -157,12 +157,12 @@
 #undef CONFIG_MCFPIT
 
 /* I2c */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000	/* I2C speed and slave address  */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x58000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #define CONFIG_SYS_IMMR		CONFIG_SYS_MBAR
 
 /* DSPI and Serial Flash */
include/configs/M54455EVB.h +5 -5
diff -purN u-boot-i2c.orig/include/configs/M54455EVB.h u-boot-i2c/include/configs/M54455EVB.h
@@ -192,12 +192,12 @@
 #undef CONFIG_MCFPIT
 
 /* I2c */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000	/* I2C speed and slave address  */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSLI2C_OFFSET	0x58000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #define CONFIG_SYS_IMMR		CONFIG_SYS_MBAR
 
 /* DSPI and Serial Flash */
include/configs/M5475EVB.h +5 -5
diff -purN u-boot-i2c.orig/include/configs/M5475EVB.h u-boot-i2c/include/configs/M5475EVB.h
@@ -122,12 +122,12 @@
 #endif
 
 /* I2C */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x00008F00
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #define CONFIG_SYS_IMMR		CONFIG_SYS_MBAR
 
 /* PCI */
include/configs/M5485EVB.h +5 -5
diff -purN u-boot-i2c.orig/include/configs/M5485EVB.h u-boot-i2c/include/configs/M5485EVB.h
@@ -119,12 +119,12 @@
 #endif
 
 /* I2C */
+#define CONFIG_NEW_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_FSL_I2C_SPEED	80000
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x00008F00
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
 #define CONFIG_SYS_IMMR		CONFIG_SYS_MBAR
 
 /* PCI */
#1 lore raw

PATCH 1/1 8/12 Multiadapter/multibus I2C, configs part 1

Dear ksi at koi8.net,

Quoted 6 lines · In message <[email protected]> you wrote:
include/configs/ATUM8548.h +0 -5
-#define CONFIG_HARD_I2C		/* I2C with hardware support*/
-#undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_EEPROM_ADDR	0x57
-#define CONFIG_SYS_I2C_SLAVE		0x7F

include/configs/ATUM8548.h line 239

Quoted 10 lines
include/configs/ATUM8548.h +8 -2
-#define CONFIG_SYS_I2C_NOPROBES	{0x69}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
+#define CONFIG_NEW_I2C			/* New I2C code */
+#define CONFIG_FSL_I2C			/* Use FSL common I2C driver */
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_EEPROM_ADDR	0x57
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_I2C_NOPROBES		{0x69}	/* Don't probe these addrs */
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}

Do we really need sucheven more unreadable names?

Why do you have to add the FSL_, SOFT_, ... everywhere?

I think this should be redundant. Omit it.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I used to think that the brain was the most wonderful  organ  in  my
body. Then I realized who was telling me this."        - Emo Phillips
#2 lore raw

PATCH 1/1 8/12 Multiadapter/multibus I2C, configs part 1

Quoted 22 lines · Wolfgang Denk

Dear ksi at koi8.net,

Quoted 6 lines · In message <[email protected]> you wrote:
include/configs/ATUM8548.h +0 -5
-#define CONFIG_HARD_I2C		/* I2C with hardware support*/
-#undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_EEPROM_ADDR	0x57
-#define CONFIG_SYS_I2C_SLAVE		0x7F

include/configs/ATUM8548.h line 239

Quoted 10 lines
include/configs/ATUM8548.h +8 -2
-#define CONFIG_SYS_I2C_NOPROBES	{0x69}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
+#define CONFIG_NEW_I2C			/* New I2C code */
+#define CONFIG_FSL_I2C			/* Use FSL common I2C driver */
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_EEPROM_ADDR	0x57
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_I2C_NOPROBES		{0x69}	/* Don't probe these addrs */
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}

Do we really need sucheven more unreadable names?

Quoted 3 lines

Why do you have to add the FSL_, SOFT_, ... everywhere?

I think this should be redundant. Omit it.

Because you can have several DIFFERENT adapters in the system. Each of those adapters should have its own set of configuration parameters. That's why adapter-specific prefixes are used. There are no prefixes on options common to the entire I2C sybsystem, e.g. CONFIG_SYS_I2C_ADAPTERS.

Once more - one can have both hardware adapter able to run at 400 kHz and a bitbanged one only capable of 20 kHz. If we used a generic CONFIG_SYS_I2C_SPEED, what should we put there? 20000? But why that slow bitbanged interface be a handicap on a fast hardware one? 400000? But bitbanged one can not run at that speed... The same is true for slaveaddr.

CONFIG_SYS_FSL_I2C_EEPROM_ADDR is an error, it should NOT have FSL_ prefix. That's a typo I will fix.

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************