[U-Boot] [PATCH] 9/12 Multiadapter/multibus I2C, configs part 2, fixed

ksi at koi8.net ksi at koi8.net
Fri Feb 13 22:54:51 CET 2009


Initial multiadapter/multibus I2C support.

Signed-off-by: Sergey Kubushyn <ksi at koi8.net>
---
diff -purN u-boot-i2c.orig/include/configs/MHPC.h u-boot-i2c/include/configs/MHPC.h
--- u-boot-i2c.orig/include/configs/MHPC.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MHPC.h	2009-02-12 10:46:00.000000000 -0800
@@ -72,7 +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_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
  */
@@ -89,8 +94,6 @@
 			else	immr->im_cpm.cp_pbdat &= ~PB_SCL
 #define I2C_DELAY	udelay(5)	/* 1/4 I2C clock duration */
 
-#define CONFIG_SYS_I2C_SPEED			50000
-#define CONFIG_SYS_I2C_SLAVE			0xFE
 #define CONFIG_SYS_I2C_EEPROM_ADDR		0x50	/* EEPROM X24C04		*/
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		1	/* bytes of address		*/
 /* mask of address bits that overflow into the "EEPROM chip address"	*/
diff -purN u-boot-i2c.orig/include/configs/MPC8313ERDB.h u-boot-i2c/include/configs/MPC8313ERDB.h
--- u-boot-i2c.orig/include/configs/MPC8313ERDB.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8313ERDB.h	2009-02-12 10:46:00.000000000 -0800
@@ -318,15 +318,17 @@
 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
 
 /* I2C */
-#define CONFIG_HARD_I2C			/* I2C with hardware support*/
+#define CONFIG_NEW_I2C
+#define CONFIG_SYS_NUM_I2C_ADAPTERS	2
 #define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{{0,0x69}} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
-#define CONFIG_SYS_I2C2_OFFSET		0x3100
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C2_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET	0x3100
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0], &fsl_i2c_adap[1]}
+#define CONFIG_SYS_I2C_NOPROBES		{{0,0x69}} /* Don't probe these addrs */
 
 /*
  * General PCI
diff -purN u-boot-i2c.orig/include/configs/MPC8315ERDB.h u-boot-i2c/include/configs/MPC8315ERDB.h
--- u-boot-i2c.orig/include/configs/MPC8315ERDB.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8315ERDB.h	2009-02-12 10:46:00.000000000 -0800
@@ -272,13 +272,13 @@
 #define CONFIG_OF_STDOUT_VIA_ALIAS	1
 
 /* I2C */
-#define CONFIG_HARD_I2C		/* I2C with hardware support */
+#define CONFIG_NEW_I2C
 #define CONFIG_FSL_I2C
-#define CONFIG_SYS_I2C_SPEED		400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{0x51} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
-#define CONFIG_SYS_I2C2_OFFSET		0x3100
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x51}	/* Don't probe these addrs */
 
 /*
  * Board info - revision and where boot from
diff -purN u-boot-i2c.orig/include/configs/MPC8323ERDB.h u-boot-i2c/include/configs/MPC8323ERDB.h
--- u-boot-i2c.orig/include/configs/MPC8323ERDB.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8323ERDB.h	2009-02-12 10:46:00.000000000 -0800
@@ -313,13 +313,13 @@
 #define CONFIG_OF_STDOUT_VIA_ALIAS	1
 
 /* I2C */
-#define CONFIG_HARD_I2C		/* I2C with hardware support */
-#undef CONFIG_SOFT_I2C		/* I2C bit-banged */
+#define CONFIG_NEW_I2C
 #define CONFIG_FSL_I2C
-#define CONFIG_SYS_I2C_SPEED	400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE	0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{0x51}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET	0x3000
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x51}	/* Don't probe these addrs */
 
 /*
  * Config on-board EEPROM
diff -purN u-boot-i2c.orig/include/configs/MPC832XEMDS.h u-boot-i2c/include/configs/MPC832XEMDS.h
--- u-boot-i2c.orig/include/configs/MPC832XEMDS.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC832XEMDS.h	2009-02-12 10:46:00.000000000 -0800
@@ -323,13 +323,13 @@
 #define CONFIG_OF_STDOUT_VIA_ALIAS	1
 
 /* I2C */
-#define CONFIG_HARD_I2C		/* I2C with hardware support */
-#undef CONFIG_SOFT_I2C		/* I2C bit-banged */
+#define CONFIG_NEW_I2C
 #define CONFIG_FSL_I2C
-#define CONFIG_SYS_I2C_SPEED	400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE	0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{0x51}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET	0x3000
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x51}	/* Don't probe these addrs */
 
 /*
  * Config on-board RTC
diff -purN u-boot-i2c.orig/include/configs/MPC8349EMDS.h u-boot-i2c/include/configs/MPC8349EMDS.h
--- u-boot-i2c.orig/include/configs/MPC8349EMDS.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8349EMDS.h	2009-02-12 10:46:00.000000000 -0800
@@ -347,16 +347,17 @@
 #define CONFIG_OF_STDOUT_VIA_ALIAS	1
 
 /* I2C */
-#define CONFIG_HARD_I2C			/* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C			/* I2C bit-banged */
+#define CONFIG_NEW_I2C
+#define CONFIG_SYS_NUM_I2C_ADAPTERS	2
 #define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{{0,0x69}}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
-#define CONFIG_SYS_I2C2_OFFSET		0x3100
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C2_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET	0x3100
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0], &fsl_i2c_adap[1]}
+#define CONFIG_SYS_I2C_NOPROBES		{{0,0x69}} /* Don't probe these addrs */
 
 /* SPI */
 #define CONFIG_MPC8XXX_SPI
diff -purN u-boot-i2c.orig/include/configs/MPC8349ITX.h u-boot-i2c/include/configs/MPC8349ITX.h
--- u-boot-i2c.orig/include/configs/MPC8349ITX.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8349ITX.h	2009-02-12 10:46:00.000000000 -0800
@@ -90,31 +90,29 @@
  */
 
 /* I2C */
-#ifdef CONFIG_HARD_I2C
-
+#define CONFIG_NEW_I2C
+#define CONFIG_SYS_NUM_I2C_ADAPTERS	2
 #define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_OFFSET		0x3000
-#define CONFIG_SYS_I2C2_OFFSET		0x3100
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C2_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET	0x3100
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0], &fsl_i2c_adap[1]}
+/* Don't probe these addresses: */
+#define CONFIG_SYS_I2C_NOPROBES		{{1, CONFIG_SYS_I2C_8574_ADDR1}, \
+					 {1, CONFIG_SYS_I2C_8574_ADDR2}, \
+					 {1, CONFIG_SYS_I2C_8574A_ADDR1}, \
+					 {1, CONFIG_SYS_I2C_8574A_ADDR2}}
 #define CONFIG_SYS_SPD_BUS_NUM		1	/* The I2C bus for SPD */
-
 #define CONFIG_SYS_I2C_8574_ADDR1	0x20	/* I2C1, PCF8574 */
 #define CONFIG_SYS_I2C_8574_ADDR2	0x21	/* I2C1, PCF8574 */
 #define CONFIG_SYS_I2C_8574A_ADDR1	0x38	/* I2C1, PCF8574A */
 #define CONFIG_SYS_I2C_8574A_ADDR2	0x39	/* I2C1, PCF8574A */
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50	/* I2C0, Board EEPROM */
-#define CONFIG_SYS_I2C_RTC_ADDR	0x68	/* I2C1, DS1339 RTC*/
-#define SPD_EEPROM_ADDRESS	0x51	/* I2C1, DDR */
-
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-
-/* Don't probe these addresses: */
-#define CONFIG_SYS_I2C_NOPROBES	{{1, CONFIG_SYS_I2C_8574_ADDR1}, \
-				 {1, CONFIG_SYS_I2C_8574_ADDR2}, \
-				 {1, CONFIG_SYS_I2C_8574A_ADDR1}, \
-				 {1, CONFIG_SYS_I2C_8574A_ADDR2}}
+#define CONFIG_SYS_I2C_RTC_ADDR		0x68	/* I2C1, DS1339 RTC*/
+#define SPD_EEPROM_ADDRESS		0x51	/* I2C1, DDR */
 /* Bit definitions for the 8574[A] I2C expander */
 #define I2C_8574_REVISION	0x03	/* Board revision, 00=0.0, 01=0.1, 10=1.0 */
 #define I2C_8574_CF		0x08	/* 1=Compact flash absent, 0=present */
@@ -122,10 +120,6 @@
 #define I2C_8574_PCI66		0x20	/* 0=33MHz PCI, 1=66MHz PCI */
 #define I2C_8574_FLASHSIDE	0x40	/* 0=Reset vector from U4, 1=from U7*/
 
-#undef CONFIG_SOFT_I2C
-
-#endif
-
 /* Compact Flash */
 #ifdef CONFIG_COMPACT_FLASH
 
diff -purN u-boot-i2c.orig/include/configs/MPC8360EMDS.h u-boot-i2c/include/configs/MPC8360EMDS.h
--- u-boot-i2c.orig/include/configs/MPC8360EMDS.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8360EMDS.h	2009-02-12 10:46:00.000000000 -0800
@@ -348,14 +348,13 @@
 #define CONFIG_OF_STDOUT_VIA_ALIAS	1
 
 /* I2C */
-#define CONFIG_HARD_I2C		/* I2C with hardware support */
-#undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
+#define CONFIG_NEW_I2C
 #define CONFIG_FSL_I2C
-#define CONFIG_SYS_I2C_SPEED	400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE	0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{0x52} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET	0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x52}	/* Don't probe these addrs */
 
 /*
  * Config on-board RTC
diff -purN u-boot-i2c.orig/include/configs/MPC8360ERDK.h u-boot-i2c/include/configs/MPC8360ERDK.h
--- u-boot-i2c.orig/include/configs/MPC8360ERDK.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8360ERDK.h	2009-02-12 10:46:00.000000000 -0800
@@ -261,16 +261,17 @@
 #define CONFIG_OF_STDOUT_VIA_ALIAS
 
 /* I2C */
-#define CONFIG_HARD_I2C		/* I2C with hardware support */
-#undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
+#define CONFIG_NEW_I2C
+#define CONFIG_SYS_NUM_I2C_ADAPTERS	2
 #define CONFIG_FSL_I2C
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_SPEED	400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE	0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{{0x52}} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET	0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C2_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET	0x3100
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0], &fsl_i2c_adap[1]}
+#define CONFIG_SYS_I2C_NOPROBES		{{0,0x52}} /* Don't probe these addrs */
 
 /*
  * General PCI
diff -purN u-boot-i2c.orig/include/configs/MPC837XEMDS.h u-boot-i2c/include/configs/MPC837XEMDS.h
--- u-boot-i2c.orig/include/configs/MPC837XEMDS.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC837XEMDS.h	2009-02-12 10:46:00.000000000 -0800
@@ -320,14 +320,13 @@
 #define CONFIG_OF_STDOUT_VIA_ALIAS	1
 
 /* I2C */
-#define CONFIG_HARD_I2C		/* I2C with hardware support */
-#undef CONFIG_SOFT_I2C		/* I2C bit-banged */
+#define CONFIG_NEW_I2C
 #define CONFIG_FSL_I2C
-#define CONFIG_SYS_I2C_SPEED		400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{0x51} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
-#define CONFIG_SYS_I2C2_OFFSET		0x3100
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x51}	/* Don't probe these addrs */
 
 /*
  * Config on-board RTC
diff -purN u-boot-i2c.orig/include/configs/MPC837XERDB.h u-boot-i2c/include/configs/MPC837XERDB.h
--- u-boot-i2c.orig/include/configs/MPC837XERDB.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC837XERDB.h	2009-02-12 10:46:00.000000000 -0800
@@ -342,14 +342,13 @@
 #define CONFIG_OF_STDOUT_VIA_ALIAS 1
 
 /* I2C */
-#define CONFIG_HARD_I2C		/* I2C with hardware support */
-#undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
+#define CONFIG_NEW_I2C
 #define CONFIG_FSL_I2C
-#define CONFIG_SYS_I2C_SPEED		400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{0x51} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
-#define CONFIG_SYS_I2C2_OFFSET		0x3100
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x51}	/* Don't probe these addrs */
 
 /*
  * Config on-board RTC
diff -purN u-boot-i2c.orig/include/configs/MPC8536DS.h u-boot-i2c/include/configs/MPC8536DS.h
--- u-boot-i2c.orig/include/configs/MPC8536DS.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8536DS.h	2009-02-12 10:46:00.000000000 -0800
@@ -331,16 +331,17 @@ extern unsigned long get_board_ddr_clk(u
 /*
  * I2C
  */
-#define CONFIG_FSL_I2C		/* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C		/* I2C with hardware support */
-#undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{{0, 0x29}}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
-#define CONFIG_SYS_I2C2_OFFSET		0x3100
+#define CONFIG_NEW_I2C
+#define CONFIG_SYS_NUM_I2C_ADAPTERS	2
+#define CONFIG_FSL_I2C
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C2_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET	0x3100
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0], &fsl_i2c_adap[1]}
+#define CONFIG_SYS_I2C_NOPROBES		{{0,0x29}} /* Don't probe these addrs */
 
 /*
  * I2C2 EEPROM
diff -purN u-boot-i2c.orig/include/configs/MPC8540ADS.h u-boot-i2c/include/configs/MPC8540ADS.h
--- u-boot-i2c.orig/include/configs/MPC8540ADS.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8540ADS.h	2009-02-12 10:46:00.000000000 -0800
@@ -299,13 +299,13 @@
 /*
  * I2C
  */
-#define CONFIG_FSL_I2C		/* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C		/* I2C with hardware support*/
-#undef	CONFIG_SOFT_I2C			/* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {0x69}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
+#define CONFIG_NEW_I2C
+#define CONFIG_FSL_I2C
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x69}	/* Don't probe these addrs */
 
 /* RapidIO MMU */
 #define CONFIG_SYS_RIO_MEM_VIRT	0xc0000000	/* base address */
diff -purN u-boot-i2c.orig/include/configs/MPC8540EVAL.h u-boot-i2c/include/configs/MPC8540EVAL.h
--- u-boot-i2c.orig/include/configs/MPC8540EVAL.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8540EVAL.h	2009-02-12 10:46:00.000000000 -0800
@@ -195,13 +195,13 @@
 /*
  * I2C
  */
-#define CONFIG_FSL_I2C		/* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C		/* I2C with hardware support*/
-#undef	CONFIG_SOFT_I2C			/* I2C bit-banged		*/
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address	*/
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {0x69}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
+#define CONFIG_NEW_I2C
+#define CONFIG_FSL_I2C
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x69}	/* Don't probe these addrs */
 
 /* General PCI */
 #define CONFIG_SYS_PCI_MEM_BASE	0x80000000
diff -purN u-boot-i2c.orig/include/configs/MPC8541CDS.h u-boot-i2c/include/configs/MPC8541CDS.h
--- u-boot-i2c.orig/include/configs/MPC8541CDS.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8541CDS.h	2009-02-12 10:46:00.000000000 -0800
@@ -322,13 +322,13 @@ extern unsigned long get_clock_freq(void
 /*
  * I2C
  */
-#define CONFIG_FSL_I2C		/* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C		/* I2C with hardware support*/
-#undef	CONFIG_SOFT_I2C			/* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES        {0x69}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
+#define CONFIG_NEW_I2C
+#define CONFIG_FSL_I2C
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x69}	/* Don't probe these addrs */
 
 /* EEPROM */
 #define CONFIG_ID_EEPROM
diff -purN u-boot-i2c.orig/include/configs/MPC8544DS.h u-boot-i2c/include/configs/MPC8544DS.h
--- u-boot-i2c.orig/include/configs/MPC8544DS.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8544DS.h	2009-02-12 10:46:00.000000000 -0800
@@ -250,14 +250,14 @@ extern unsigned long get_board_sys_clk(u
 #define CONFIG_SYS_64BIT_VSPRINTF		1
 
 /* I2C */
-#define CONFIG_FSL_I2C		/* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C		/* I2C with hardware support */
-#undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
+#define CONFIG_NEW_I2C
+#define CONFIG_FSL_I2C
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x69}	/* Don't probe these addrs */
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x57
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{0x69}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3100
 
 /*
  * General PCI
diff -purN u-boot-i2c.orig/include/configs/MPC8548CDS.h u-boot-i2c/include/configs/MPC8548CDS.h
--- u-boot-i2c.orig/include/configs/MPC8548CDS.h	2009-02-12 10:43:41.000000000 -0800
+++ u-boot-i2c/include/configs/MPC8548CDS.h	2009-02-12 10:46:00.000000000 -0800
@@ -343,16 +343,88 @@ extern unsigned long get_clock_freq(void
 #define CONFIG_SYS_64BIT_VSPRINTF	1
 #define CONFIG_SYS_64BIT_STRTOUL	1
 
+
+#define CONFIG_NEW_I2C
+#if 1
+#define CONFIG_FSL_I2C
+#define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES		{0x69}	/* Don't probe these addrs */
+#else
 /*
- * I2C
+ * Illustrative example with 5 I2C adapters and 7 I2C busses.
+ *
+ * Adapters: 2x FSL_I2C (0 and 1,) SM502 adapter (2,) 2x SOFT_I2C (3 and 4)
+ *
+ * Busses:
+ *
+ *	0:	Direct off of FSL_I2C[0]
+ *	1:	FSL_I2C[1]->PCA9542(0)->PCA9542(0)
+ *	2:	FSL_I2C[1]->PCA9542(0)->PCA9542(1)
+ *	3:	FSL_I2C[1]->PCA9542(1)
+ *	4:	Direct off of SM502_I2C
+ *	5:	Direct off of SOFT_I2C[0]
+ *	6:	Direct off of SOFT_I2C[1]
+ *
+ * This might not have sense (it is much more logical to use a single
+ * PCA9544 for 3 busses off of FSL_I2C[1]) but it is just an illustrative
+ * example. SOFT_I2C declarations are totally bogus.
  */
-#define CONFIG_FSL_I2C		/* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C		/* I2C with hardware support*/
-#undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE		0x7F
-#define CONFIG_SYS_I2C_NOPROBES	{0x69}	/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET		0x3000
+#define CONFIG_SYS_NUM_I2C_ADAPTERS	5
+#define CONFIG_SYS_NUM_I2C_BUSSES	7
+#define CONFIG_SYS_I2C_MAX_HOPS		2
+
+#define CONFIG_SOFT_I2C
+#define I2C_SOFT_DECLARATIONS		I2C_SOFT_DEFS
+
+#define I2C_INIT	(printf("init"))
+#define I2C_ACTIVE	(printf("active"))
+#define I2C_TRISTATE	(printf("tristate"))
+#define I2C_READ	(1)
+#define I2C_SDA(bit)	(printf("sda: %d", bit))
+#define I2C_SCL(bit)	(printf("scl: %d", bit))
+#define I2C_DELAY	udelay(2)	/* 1/4 I2C clock duration */
+
+#define CONFIG_SYS_SOFT_I2C_SPEED	100000
+#define CONFIG_SYS_SOFT_I2C_SLAVE	0x7f
+
+#define I2C_SOFT_DECLARATIONS2		I2C_SOFT_DEFS
+
+#define I2C_INIT2	(printf("init1"))
+#define I2C_ACTIVE2	(printf("active1"))
+#define I2C_TRISTATE2	(printf("tristate1"))
+#define I2C_READ2	(1)
+#define I2C_SDA2(bit)	(printf("sda1: %d", bit))
+#define I2C_SCL2(bit)	(printf("scl1: %d", bit))
+#define I2C_DELAY2	udelay(2)	/* 1/4 I2C clock duration */
+
+#define CONFIG_SYS_SOFT_I2C2_SPEED	100000
+#define CONFIG_SYS_SOFT_I2C2_SLAVE	0x7f
+
+#define CONFIG_SM502_I2C			/* Use SM502 I2C driver */
+#define CONFIG_SYS_SM501_I2C_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_SM501_I2C_SLAVE	0x7F	/* Adapter #1 */
+#define CONFIG_SYS_SM501_BASEADDR	0x80000000	/* Bogus */
+
+#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_SLAVE	0x7F	/* Adapter #1 */
+#define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED	400000	/* I2C speed and slave address */
+#define CONFIG_SYS_FSL_I2C2_SLAVE	0x7F	/* Adapter #2 */
+#define CONFIG_SYS_FSL_I2C2_OFFSET	0x3100
+#define CONFIG_SYS_I2C_ADAPTERS		{&fsl_i2c_adap[0], &fsl_i2c_adap[1], &sm501_i2c_adap, &soft_i2c_adap[0], &soft_i2c_adap[1]}
+#define CONFIG_SYS_I2C_BUSSES	{	{0, {I2C_NULL_HOP, I2C_NULL_HOP}}, \
+		{1, {{I2C_MUX_PCA9542, 0x70, 0}, {I2C_MUX_PCA9542, 0x71, 0}}}, \
+		{1, {{I2C_MUX_PCA9542, 0x70, 0}, {I2C_MUX_PCA9542, 0x71, 1}}}, \
+		{1, {{I2C_MUX_PCA9542, 0x70, 1}, I2C_NULL_HOP}}, \
+		{2, {I2C_NULL_HOP, I2C_NULL_HOP}}, \
+		{3, {I2C_NULL_HOP, I2C_NULL_HOP}}, \
+		{4, {I2C_NULL_HOP, I2C_NULL_HOP}}}
+#define CONFIG_SYS_I2C_NOPROBES		{{0,0x69},{1,0x69}}	/* Don't probe these addrs */
+#endif
 
 /* EEPROM */
 #define CONFIG_ID_EEPROM
@@ -369,23 +441,23 @@ extern unsigned long get_clock_freq(void
 #define CONFIG_SYS_PCI_PHYS		0x80000000	/* 1G PCI TLB */
 
 #define CONFIG_SYS_PCI1_MEM_VIRT	0x80000000
-#define CONFIG_SYS_PCI1_MEM_BUS	0x80000000
+#define CONFIG_SYS_PCI1_MEM_BUS		0x80000000
 #define CONFIG_SYS_PCI1_MEM_PHYS	0x80000000
 #define CONFIG_SYS_PCI1_MEM_SIZE	0x20000000	/* 512M */
-#define CONFIG_SYS_PCI1_IO_VIRT	0xe2000000
-#define CONFIG_SYS_PCI1_IO_BUS	0x00000000
-#define CONFIG_SYS_PCI1_IO_PHYS	0xe2000000
-#define CONFIG_SYS_PCI1_IO_SIZE	0x00100000	/* 1M */
+#define CONFIG_SYS_PCI1_IO_VIRT		0xe2000000
+#define CONFIG_SYS_PCI1_IO_BUS		0x00000000
+#define CONFIG_SYS_PCI1_IO_PHYS		0xe2000000
+#define CONFIG_SYS_PCI1_IO_SIZE		0x00100000	/* 1M */
 
 #ifdef CONFIG_PCI2
 #define CONFIG_SYS_PCI2_MEM_VIRT	0xa0000000
-#define CONFIG_SYS_PCI2_MEM_BUS	0xa0000000
+#define CONFIG_SYS_PCI2_MEM_BUS		0xa0000000
 #define CONFIG_SYS_PCI2_MEM_PHYS	0xa0000000
 #define CONFIG_SYS_PCI2_MEM_SIZE	0x20000000	/* 512M */
-#define CONFIG_SYS_PCI2_IO_VIRT	0xe2800000
-#define CONFIG_SYS_PCI2_IO_BUS	0x00000000
-#define CONFIG_SYS_PCI2_IO_PHYS	0xe2800000
-#define CONFIG_SYS_PCI2_IO_SIZE	0x00100000	/* 1M */
+#define CONFIG_SYS_PCI2_IO_VIRT		0xe2800000
+#define CONFIG_SYS_PCI2_IO_BUS		0x00000000
+#define CONFIG_SYS_PCI2_IO_PHYS		0xe2800000
+#define CONFIG_SYS_PCI2_IO_SIZE		0x00100000	/* 1M */
 #endif
 
 #ifdef CONFIG_PCIE1
@@ -394,7 +466,7 @@ extern unsigned long get_clock_freq(void
 #define CONFIG_SYS_PCIE1_MEM_PHYS	0xa0000000
 #define CONFIG_SYS_PCIE1_MEM_SIZE	0x20000000	/* 512M */
 #define CONFIG_SYS_PCIE1_IO_VIRT	0xe3000000
-#define CONFIG_SYS_PCIE1_IO_BUS	0x00000000
+#define CONFIG_SYS_PCIE1_IO_BUS		0x00000000
 #define CONFIG_SYS_PCIE1_IO_PHYS	0xe3000000
 #define CONFIG_SYS_PCIE1_IO_SIZE	0x00100000	/*   1M */
 #endif
@@ -403,9 +475,9 @@ extern unsigned long get_clock_freq(void
 /*
  * RapidIO MMU
  */
-#define CONFIG_SYS_RIO_MEM_VIRT	0xC0000000
-#define CONFIG_SYS_RIO_MEM_BUS	0xC0000000
-#define CONFIG_SYS_RIO_MEM_SIZE	0x20000000	/* 512M */
+#define CONFIG_SYS_RIO_MEM_VIRT		0xC0000000
+#define CONFIG_SYS_RIO_MEM_BUS		0xC0000000
+#define CONFIG_SYS_RIO_MEM_SIZE		0x20000000	/* 512M */
 #endif
 
 #ifdef CONFIG_LEGACY
@@ -490,8 +562,11 @@ extern unsigned long get_clock_freq(void
  */
 #include <config_cmd_default.h>
 
+#define CONFIG_I2C_CMD_TREE
+
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
+#define CONFIG_CMD_SDRAM
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ


More information about the U-Boot mailing list