U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
February 2009
- 181 participants
- 548 discussions
Hi list,
I use readl() or writel() to access the hardware but i found a compiler flag
that bypass the cache for all volatile variables, it uses io versions of
load/store functions. So, what should i do, make use of write/read functions
or insert this flag in the makefile?.
It's a nios2 platform. Thank you in advance.
Ivan Llopard.
3
6
Hi,
How to add LCD SUPPORT (CONFIG_LCD) to opma3evm bootcode(u-boot).if i add
CONFIG_LCD in the omap3evm.h it gives error.
Because the display variables and funtions are not defined for omap.
I wanted to display a bmp logo on u-boot up
3
2
Hi,
I had downloaded U-Boot source code from AMCC website to build a u-boot image for NAND Flash.
Inside the u-boot directory I executed the following commands:
make distclean
make canyonlands_nand_config
But I get the following error :
: invalid option
make: *** [canyonlands_nand_config] Error 1
These same commands executed inside the u-boot downloaded from the DENX site, does not give any errors.
Has anybody else such a problem?
Regards,
Afzal Nadirshah
________________________________
http://www.mindtree.com/email/disclaimer.html
3
3
Signed-off-by: Sergey Kubushyn <ksi(a)koi8.net>
---
diff --git a/include/configs/pdnb3.h b/include/configs/pdnb3.h
index 4da401f..9ba0147 100644
--- a/include/configs/pdnb3.h
+++ b/include/configs/pdnb3.h
@@ -296,11 +296,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 83000 /* 83 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 83000 /* 83 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
*/
diff --git a/include/configs/rmu.h b/include/configs/rmu.h
index d88ae81..15bf356 100644
--- a/include/configs/rmu.h
+++ b/include/configs/rmu.h
@@ -61,11 +61,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 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 /* 40 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 */
#define PB_SCL 0x00000020 /* PB 26 */
#define PB_SDA 0x00000010 /* PB 27 */
diff --git a/include/configs/sacsng.h b/include/configs/sacsng.h
index f4e08c6..1cab474 100644
--- a/include/configs/sacsng.h
+++ b/include/configs/sacsng.h
@@ -292,14 +292,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)
@@ -309,7 +310,6 @@
#define I2C_SCL(bit) if(bit) iop->pdat |= 0x00020000; \
else iop->pdat &= ~0x00020000
#define I2C_DELAY udelay(20) /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
/* Define this to reserve an entire FLASH sector for
* environment variables. Otherwise, the environment will be
diff --git a/include/configs/sbc8260.h b/include/configs/sbc8260.h
index 26ed557..ec85929 100644
--- a/include/configs/sbc8260.h
+++ b/include/configs/sbc8260.h
@@ -250,14 +250,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)
@@ -267,7 +268,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 */
/* Define this to reserve an entire FLASH sector (256 KB) for
diff --git a/include/configs/sbc8349.h b/include/configs/sbc8349.h
index 0603e3c..5316df7 100644
--- a/include/configs/sbc8349.h
+++ b/include/configs/sbc8349.h
@@ -312,17 +312,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_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 {0x69} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C1_OFFSET 0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
-#define CONFIG_SYS_I2C_OFFSET CONFIG_SYS_I2C2_OFFSET
-/* could also use CONFIG_I2C_MULTI_BUS and CONFIG_SPD_BUS_NUM... */
+#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 0x3100
+#define CONFIG_SYS_I2C_ADAPTERS {&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */
/* TSEC */
#define CONFIG_SYS_TSEC1_OFFSET 0x24000
diff --git a/include/configs/sbc8548.h b/include/configs/sbc8548.h
index 8141a46..6826903 100644
--- a/include/configs/sbc8548.h
+++ b/include/configs/sbc8548.h
@@ -320,13 +320,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_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_EEPROM_ADDR 0x50
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-#define CONFIG_SYS_I2C_OFFSET 0x3000
/*
* General PCI
diff --git a/include/configs/sbc8560.h b/include/configs/sbc8560.h
index d4e9d74..3a0303a 100644
--- a/include/configs/sbc8560.h
+++ b/include/configs/sbc8560.h
@@ -222,13 +222,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 */
#define CONFIG_SYS_PCI_MEM_BASE 0xC0000000
#define CONFIG_SYS_PCI_MEM_PHYS 0xC0000000
diff --git a/include/configs/sbc8641d.h b/include/configs/sbc8641d.h
index 1008812..aafdbf8 100644
--- a/include/configs/sbc8641d.h
+++ b/include/configs/sbc8641d.h
@@ -292,13 +292,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 0x3100
+#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 0x3100
+#define CONFIG_SYS_I2C_ADAPTERS {&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */
/*
* RapidIO MMU
diff --git a/include/configs/socrates.h b/include/configs/socrates.h
index becd13e..33aee21 100644
--- a/include/configs/socrates.h
+++ b/include/configs/socrates.h
@@ -235,16 +235,16 @@
/*
* I2C
*/
-#define CONFIG_FSL_I2C /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C /* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED 102124 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-#define CONFIG_SYS_I2C_OFFSET 0x3000
-
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#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 102124 /* 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 102124 /* 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]}
/* I2C RTC */
#define CONFIG_RTC_RX8025 /* Use Epson rx8025 rtc via i2c */
diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h
index 1fe2a04..75f364b 100644
--- a/include/configs/spc1920.h
+++ b/include/configs/spc1920.h
@@ -208,12 +208,12 @@
#if defined(CONFIG_CMD_I2C)
/* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C /* I2C with hardware support */
-#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */
-
-#define CONFIG_SYS_I2C_SPEED 93000 /* 93 kHz is supposed to work */
-#define CONFIG_SYS_I2C_SLAVE 0xFE
-
-#ifdef CONFIG_SOFT_I2C
+#define CONFIG_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
*/
@@ -229,7 +229,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 */
#endif
/*-----------------------------------------------------------------------
diff --git a/include/configs/stxgp3.h b/include/configs/stxgp3.h
index ae6f45a..bb9b773 100644
--- a/include/configs/stxgp3.h
+++ b/include/configs/stxgp3.h
@@ -180,18 +180,12 @@
/*
* 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
-#if 0
-#define CONFIG_SYS_I2C_NOPROBES {0x00} /* Don't probe these addrs */
-#else
-/* I did the 'if 0' so we could keep the syntax above if ever needed. */
-#undef CONFIG_SYS_I2C_NOPROBES
-#endif
-#define CONFIG_SYS_I2C_OFFSET 0x3000
+#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]}
/* RapdIO Map configuration, mapped 1:1.
*/
diff --git a/include/configs/stxssa.h b/include/configs/stxssa.h
index c312f1a..e59e1e0 100644
--- a/include/configs/stxssa.h
+++ b/include/configs/stxssa.h
@@ -197,13 +197,12 @@
/*
* 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
-#undef CONFIG_SYS_I2C_NOPROBES
-#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]}
/* I2C RTC */
#define CONFIG_RTC_DS1337 /* This is really a DS1339 RTC */
diff --git a/include/configs/uc100.h b/include/configs/uc100.h
index 23f4c82..4019a80 100644
--- a/include/configs/uc100.h
+++ b/include/configs/uc100.h
@@ -468,12 +468,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
*/
@@ -489,7 +489,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 */
/*-----------------------------------------------------------------------
* I2C EEPROM (24C164)
diff --git a/include/configs/vct.h b/include/configs/vct.h
index 391535e..173095a 100644
--- a/include/configs/vct.h
+++ b/include/configs/vct.h
@@ -235,11 +235,14 @@
* I2C/EEPROM
*/
#undef CONFIG_HARD_I2C /* I2C with hardware support */
-#define CONFIG_SOFT_I2C /* I2C bit-banged */
-
-#define CONFIG_SYS_I2C_SPEED 83000 /* 83 kHz is supposed to work */
-#define CONFIG_SYS_I2C_SLAVE 0x7f
+#define CONFIG_NEW_I2C
+#define CONFIG_SOFT_I2C /* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED 83000 /* 83 kHz is supposed to work */
+#define CONFIG_SYS_SOFT_I2C_SLAVE 0x7f
+#define CONFIG_SYS_I2C_ADAPTERS {&soft_i2c_adap[0]}
+#define CONFIG_SOFT_I2C /* I2C bit-banged */
/*
* Software (bit-bang) I2C driver configuration
*/
diff --git a/include/i2c.h b/include/i2c.h
index fad2d57..6d33388 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -1,4 +1,7 @@
/*
+ * Copyright (C) 2009 Sergey Kubushyn <ksi(a)koi8.net>
+ * Changes for multibus/multiadapter I2C support.
+ *
* (C) Copyright 2001
* Gerald Van Baren, Custom IDEAS, vanbaren(a)cideas.com.
*
@@ -46,14 +49,20 @@
*/
#define I2C_RXTX_LEN 128 /* maximum tx/rx buffer length */
-#if defined(CONFIG_I2C_MULTI_BUS)
-#define CONFIG_SYS_MAX_I2C_BUS 2
-#define I2C_GET_BUS() i2c_get_bus_num()
-#define I2C_SET_BUS(a) i2c_set_bus_num(a)
+#ifndef CONFIG_SYS_NUM_I2C_ADAPTERS
+#define CONFIG_SYS_NUM_I2C_ADAPTERS 1
+#endif
+
+#if !defined(CONFIG_SYS_I2C_MAX_HOPS) || (CONFIG_SYS_I2C_MAX_HOPS == 0)
+#define CONFIG_SYS_I2C_DIRECT_BUS 1
+#if !defined(CONFIG_SYS_NUM_I2C_BUSSES) || (CONFIG_SYS_NUM_I2C_BUSSES != CONFIG_SYS_NUM_I2C_ADAPTERS)
+#define CONFIG_SYS_NUM_I2C_BUSSES CONFIG_SYS_NUM_I2C_ADAPTERS
+#endif
#else
-#define CONFIG_SYS_MAX_I2C_BUS 1
-#define I2C_GET_BUS() 0
-#define I2C_SET_BUS(a)
+#undef CONFIG_SYS_I2C_DIRECT_BUS
+#ifndef CONFIG_SYS_NUM_I2C_BUSSES
+#define CONFIG_SYS_NUM_I2C_BUSSES 1
+#endif
#endif
/* define the I2C bus number for RTC and DTT if not already done */
@@ -67,66 +76,111 @@
#define CONFIG_SYS_SPD_BUS_NUM 0
#endif
-#ifndef I2C_SOFT_DECLARATIONS
-# if defined(CONFIG_MPC8260)
-# define I2C_SOFT_DECLARATIONS volatile ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, I2C_PORT);
-# elif defined(CONFIG_8xx)
-# define I2C_SOFT_DECLARATIONS volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
-# else
-# define I2C_SOFT_DECLARATIONS
-# endif
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#define ADAP(bus) i2c_adap[i2c_bus[(bus)].adapter]
+#else
+#define ADAP(bus) i2c_adap[(bus)]
#endif
-#ifdef CONFIG_8xx
-/* Set default values for the I2C bus speed and slave address on 8xx. In the
- * future, we'll define these in all 8xx board config files.
- */
-#ifndef CONFIG_SYS_I2C_SPEED
-#define CONFIG_SYS_I2C_SPEED 50000
+typedef struct i2c_adapter {
+ void (*init)(int speed, int slaveaddr);
+ int (*probe)(u_int8_t chip);
+ int (*read)(u_int8_t chip, uint addr, int alen,
+ u_int8_t *buffer, int len);
+ int (*write)(u_int8_t chip, uint addr, int alen,
+ u_int8_t *buffer, int len);
+ uint (*set_bus_speed)(uint speed);
+ uint (*get_bus_speed)(void);
+
+ int speed;
+ int slaveaddr;
+ int init_done;
+ char *name;
+} i2c_adap_t;
+
+
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#define I2C_MUX_PCA9540_ID 1
+#define I2C_MUX_PCA9540 {I2C_MUX_PCA9540_ID, "PCA9540B"}
+#define I2C_MUX_PCA9542_ID 2
+#define I2C_MUX_PCA9542 {I2C_MUX_PCA9542_ID, "PCA9542A"}
+#define I2C_MUX_PCA9544_ID 3
+#define I2C_MUX_PCA9544 {I2C_MUX_PCA9544_ID, "PCA9544A"}
+#define I2C_MUX_PCA9547_ID 4
+#define I2C_MUX_PCA9547 {I2C_MUX_PCA9547_ID, "PCA9547A"}
+
+typedef struct i2c_mux {
+ int id;
+ char name[16];
+} i2c_mux_t;
+
+typedef struct i2c_next_hop {
+ i2c_mux_t mux;
+ u_int8_t chip;
+ u_int8_t channel;
+} i2c_next_hop_t;
+
+
+typedef struct i2c_bus_hose {
+ int adapter;
+ i2c_next_hop_t next_hop[CONFIG_SYS_I2C_MAX_HOPS];
+} i2c_bus_t;
+
+#define I2C_NULL_HOP {{-1, ""}, 0, 0}
+
+extern i2c_bus_t i2c_bus[];
#endif
-#ifndef CONFIG_SYS_I2C_SLAVE
-#define CONFIG_SYS_I2C_SLAVE 0xFE
-#endif
-#endif
+extern i2c_adap_t *i2c_adap[];
/*
- * Initialization, must be called once on start up, may be called
- * repeatedly to change the speed and slave addresses.
+ * i2c_get_bus_num:
+ *
+ * Returns index of currently active I2C bus. Zero-based.
*/
-void i2c_init(int speed, int slaveaddr);
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-void i2c_init_board(void);
-#endif
+unsigned int i2c_get_bus_num(void);
-#if defined(CONFIG_I2C_MUX)
-typedef struct _mux {
- uchar chip;
- uchar channel;
- char *name;
- struct _mux *next;
-} I2C_MUX;
+/*
+ * i2c_set_bus_num:
+ *
+ * Change the active I2C bus. Subsequent read/write calls will
+ * go to this one.
+ *
+ * bus - bus index, zero based
+ *
+ * Returns: 0 on success, not 0 on failure
+ *
+ */
+int i2c_set_bus_num(unsigned int bus);
-typedef struct _mux_device {
- int busid;
- I2C_MUX *mux; /* List of muxes, to reach the device */
- struct _mux_device *next;
-} I2C_MUX_DEVICE;
-int i2c_mux_add_device(I2C_MUX_DEVICE *dev);
+/*
+ * i2c_init_bus()
+ *
+ * Initialization, must be called once on start up, may be called
+ * repeatedly to change the speed and slave addresses. This initializes
+ * a single current i2c bus.
+ */
+/* void i2c_init_bus(int speed, int slaveaddr); */
+
+
+/*
+ * i2c_init_all():
+ *
+ * Initializes all I2C adapters in the system. All i2c_adap structures must
+ * be initialized beforehead with function pointers and data, including
+ * speed and slaveaddr. Returns 0 on success, non-0 on failure.
+ */
+void i2c_init_all(void);
-I2C_MUX_DEVICE *i2c_mux_search_device(int id);
-I2C_MUX_DEVICE *i2c_mux_ident_muxstring (uchar *buf);
-int i2x_mux_select_mux(int bus);
-int i2c_mux_ident_muxstring_f (uchar *buf);
-#endif
/*
* Probe the given I2C chip address. Returns 0 if a chip responded,
* not 0 on failure.
*/
-int i2c_probe(uchar chip);
+int i2c_probe(u_int8_t chip);
+
/*
* Read/Write interface:
@@ -140,83 +194,25 @@ int i2c_probe(uchar chip);
*
* Returns: 0 on success, not 0 on failure
*/
-int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len);
-int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len);
+int i2c_read(u_int8_t chip, unsigned int addr, int alen,
+ u_int8_t *buffer, int len);
+
+int i2c_write(u_int8_t chip, unsigned int addr, int alen,
+ u_int8_t *buffer, int len);
+
/*
* Utility routines to read/write registers.
*/
-static inline u8 i2c_reg_read(u8 addr, u8 reg)
-{
- u8 buf;
-
-#ifdef CONFIG_8xx
- /* MPC8xx needs this. Maybe one day we can get rid of it. */
- i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-#endif
-
-#ifdef DEBUG
- printf("%s: addr=0x%02x, reg=0x%02x\n", __func__, addr, reg);
-#endif
-
-#ifdef CONFIG_BLACKFIN
- /* This ifdef will become unneccessary in a future version of the
- * blackfin I2C driver.
- */
- i2c_read(addr, reg, 0, &buf, 1);
-#else
- i2c_read(addr, reg, 1, &buf, 1);
-#endif
-
- return buf;
-}
+u_int8_t i2c_reg_read(u_int8_t addr, u_int8_t reg);
-static inline void i2c_reg_write(u8 addr, u8 reg, u8 val)
-{
-#ifdef CONFIG_8xx
- /* MPC8xx needs this. Maybe one day we can get rid of it. */
- i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-#endif
+void i2c_reg_write(u_int8_t addr, u_int8_t reg, u_int8_t val);
-#ifdef DEBUG
- printf("%s: addr=0x%02x, reg=0x%02x, val=0x%02x\n",
- __func__, addr, reg, val);
-#endif
-
-#ifdef CONFIG_BLACKFIN
- /* This ifdef will become unneccessary in a future version of the
- * blackfin I2C driver.
- */
- i2c_write(addr, reg, 0, &val, 1);
-#else
- i2c_write(addr, reg, 1, &val, 1);
-#endif
-}
/*
* Functions for setting the current I2C bus and its speed
*/
-/*
- * i2c_set_bus_num:
- *
- * Change the active I2C bus. Subsequent read/write calls will
- * go to this one.
- *
- * bus - bus index, zero based
- *
- * Returns: 0 on success, not 0 on failure
- *
- */
-int i2c_set_bus_num(unsigned int bus);
-
-/*
- * i2c_get_bus_num:
- *
- * Returns index of currently active I2C bus. Zero-based.
- */
-
-unsigned int i2c_get_bus_num(void);
/*
* i2c_set_bus_speed:
@@ -225,10 +221,10 @@ unsigned int i2c_get_bus_num(void);
*
* speed - bus speed in Hz
*
- * Returns: 0 on success, not 0 on failure
+ * Returns: new bus speed
*
*/
-int i2c_set_bus_speed(unsigned int);
+unsigned int i2c_set_bus_speed(unsigned int speed);
/*
* i2c_get_bus_speed:
@@ -238,4 +234,45 @@ int i2c_set_bus_speed(unsigned int);
unsigned int i2c_get_bus_speed(void);
+/*
+ * i2c_reloc_fixup:
+ *
+ * Adjusts I2C pointers after U-Boot is relocated to DRAM
+ */
+void i2c_reloc_fixup(void);
+
+#ifndef I2C_SOFT_DEFS
+# if defined(CONFIG_MPC8260)
+# define I2C_SOFT_DEFS volatile ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, I2C_PORT);
+# elif defined(CONFIG_8xx)
+# define I2C_SOFT_DEFS volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+# else
+# define I2C_SOFT_DEFS
+# endif
+
+#if 0
+# ifdef CONFIG_8xx
+/* Set default values for the I2C bus speed and slave address on 8xx. In the
+ * future, we'll define these in all 8xx board config files.
+ */
+# ifndef CONFIG_SYS_I2C_SPEED
+# define CONFIG_SYS_I2C_SPEED 50000
+# endif
+
+# ifndef CONFIG_SYS_I2C_SLAVE
+# define CONFIG_SYS_I2C_SLAVE 0xFE
+# endif
+# endif
+#endif
+#endif
+
+/*
+ * Initialization, must be called once on start up, may be called
+ * repeatedly to change the speed and slave addresses.
+ */
+void i2c_init(unsigned int speed, int slaveaddr);
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+void i2c_init_board(void);
+#endif
+
#endif /* _I2C_H_ */
diff --git a/lib_arm/board.c b/lib_arm/board.c
index 964f5cc..2cd7334 100644
--- a/lib_arm/board.c
+++ b/lib_arm/board.c
@@ -81,7 +81,8 @@ extern void rtl8019_get_enetaddr (uchar * addr);
#endif
#if defined(CONFIG_HARD_I2C) || \
- defined(CONFIG_SOFT_I2C)
+ defined(CONFIG_SOFT_I2C) || \
+ defined(CONFIG_SYS_I2C_ADAPTERS)
#include <i2c.h>
#endif
@@ -211,11 +212,15 @@ static void display_flash_config (ulong size)
}
#endif /* CONFIG_SYS_NO_FLASH */
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || defined(CONFIG_SYS_I2C_ADAPTERS)
static int init_func_i2c (void)
{
puts ("I2C: ");
+#ifdef CONFIG_NEW_I2C
+ i2c_init_all();
+#else
i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
puts ("ready\n");
return (0);
}
@@ -272,7 +277,7 @@ init_fnc_t *init_sequence[] = {
#if defined(CONFIG_DISPLAY_BOARDINFO)
checkboard, /* display board info */
#endif
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || defined(CONFIG_SYS_I2C_ADAPTERS)
init_func_i2c,
#endif
dram_init, /* configure available RAM banks */
@@ -368,6 +373,10 @@ void start_armboot (void)
/* initialize environment */
env_relocate ();
+#if defined(CONFIG_NEW_I2C) && defined(CONFIG_SYS_I2C_ADAPTERS)
+ i2c_reloc_fixup();
+#endif
+
#ifdef CONFIG_VFD
/* must do this after the framebuffer is allocated */
drv_vfd_init();
diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c
index c223711..d0e7120 100644
--- a/lib_blackfin/board.c
+++ b/lib_blackfin/board.c
@@ -31,6 +31,10 @@
int post_flag;
#endif
+#if defined(CONFIG_SYS_I2C_ADAPTERS)
+#include <i2c.h>
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
@@ -338,6 +342,10 @@ void board_init_r(gd_t * id, ulong dest_addr)
/* relocate environment function pointers etc. */
env_relocate();
+#if defined(CONFIG_SYS_I2C_ADAPTERS)
+ i2c_reloc_fixup();
+#endif
+
#ifdef CONFIG_CMD_NET
/* board MAC address */
s = getenv("ethaddr");
diff --git a/lib_m68k/board.c b/lib_m68k/board.c
index 583ce10..23f01a4 100644
--- a/lib_m68k/board.c
+++ b/lib_m68k/board.c
@@ -55,7 +55,8 @@
#include <version.h>
#if defined(CONFIG_HARD_I2C) || \
- defined(CONFIG_SOFT_I2C)
+ defined(CONFIG_SOFT_I2C) || \
+ defined(CONFIG_SYS_I2C_ADAPTERS)
#include <i2c.h>
#endif
@@ -191,11 +192,15 @@ static int init_func_ram (void)
/***********************************************************************/
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || defined(CONFIG_SYS_I2C_ADAPTERS)
static int init_func_i2c (void)
{
puts ("I2C: ");
+#ifdef CONFIG_NEW_I2C
+ i2c_init_all();
+#else
i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
puts ("ready\n");
return (0);
}
@@ -227,7 +232,7 @@ init_fnc_t *init_sequence[] = {
display_options,
checkcpu,
checkboard,
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || defined(CONFIG_SYS_I2C_ADAPTERS)
init_func_i2c,
#endif
#if defined(CONFIG_HARD_SPI)
@@ -577,6 +582,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
/* relocate environment function pointers etc. */
env_relocate ();
+#if defined(CONFIG_NEW_I2C) && defined(CONFIG_SYS_I2C_ADAPTERS)
+ /* Adjust I2C subsystem pointers after relocation */
+ i2c_reloc_fixup();
+#endif
+
/*
* Fill in missing fields of bd_info.
* We do this here, where we have "normal" access to the
diff --git a/lib_mips/board.c b/lib_mips/board.c
index dfe6831..60ebaa9 100644
--- a/lib_mips/board.c
+++ b/lib_mips/board.c
@@ -33,6 +33,10 @@
#include <onenand_uboot.h>
#include <spi.h>
+#if defined(CONFIG_SYS_I2C_ADAPTERS)
+#include <i2c.h>
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
#if ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \
@@ -401,6 +405,10 @@ void board_init_r (gd_t *id, ulong dest_addr)
/* relocate environment function pointers etc. */
env_relocate();
+#if defined(CONFIG_SYS_I2C_ADAPTERS)
+ i2c_reloc_fixup();
+#endif
+
/* board MAC address */
s = getenv ("ethaddr");
for (i = 0; i < 6; ++i) {
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index df1cf13..02aff5e 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -88,7 +88,8 @@ extern void sc3_read_eeprom(void);
void doc_init (void);
#endif
#if defined(CONFIG_HARD_I2C) || \
- defined(CONFIG_SOFT_I2C)
+ defined(CONFIG_SOFT_I2C) || \
+ defined(CONFIG_SYS_I2C_ADAPTERS)
#include <i2c.h>
#endif
#include <spi.h>
@@ -231,11 +232,15 @@ static int init_func_ram (void)
/***********************************************************************/
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || defined(CONFIG_SYS_I2C_ADAPTERS)
static int init_func_i2c (void)
{
puts ("I2C: ");
+#ifdef CONFIG_NEW_I2C
+ i2c_init_all();
+#else
i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
puts ("ready\n");
return (0);
}
@@ -330,7 +335,7 @@ init_fnc_t *init_sequence[] = {
misc_init_f,
#endif
INIT_FUNC_WATCHDOG_RESET
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || defined(CONFIG_SYS_I2C_ADAPTERS)
init_func_i2c,
#endif
#if defined(CONFIG_HARD_SPI)
@@ -850,6 +855,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
* the environment is in EEPROM.
*/
+#if defined(CONFIG_NEW_I2C) && defined(CONFIG_SYS_I2C_ADAPTERS)
+ /* Adjust I2C subsystem pointers after relocation */
+ i2c_reloc_fixup();
+#endif
+
#if defined(CONFIG_SYS_EXTBDINFO)
#if defined(CONFIG_405GP) || defined(CONFIG_405EP)
#if defined(CONFIG_I2CFAST)
1
0
Signed-off-by: Sergey Kubushyn <ksi(a)koi8.net>
---
diff --git a/include/configs/TK885D.h b/include/configs/TK885D.h
index 14ff62c..cd45b95 100644
--- a/include/configs/TK885D.h
+++ b/include/configs/TK885D.h
@@ -102,12 +102,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
*/
@@ -123,7 +123,6 @@
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
else immr->im_cpm.cp_pbdat &= ~PB_SCL
#define I2C_DELAY udelay(2) /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C?? */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* two byte address */
diff --git a/include/configs/TOP5200.h b/include/configs/TOP5200.h
index 046948e..0e605df 100644
--- a/include/configs/TOP5200.h
+++ b/include/configs/TOP5200.h
@@ -196,9 +196,15 @@
#define CONFIG_MISC_INIT_R
#undef CONFIG_HARD_I2C /* I2C with hardware support */
-#define CONFIG_SOFT_I2C 1 /* I2C with softwate support */
+#define CONFIG_SOFT_I2C /* I2C bit-banged */
#if defined (CONFIG_SOFT_I2C)
+# define CONFIG_NEW_I2C
+# define I2C_SOFT_DECLARATIONS I2C_SOFT_DEFS
+# define CONFIG_SYS_SOFT_I2C_SPEED 100000
+# define CONFIG_SYS_SOFT_I2C_SLAVE 0x7F
+# define CONFIG_SYS_I2C_ADAPTERS {&soft_i2c_adap[0]}
+/**/
# define SDA0 0x40
# define SCL0 0x80
# define GPIOE0 *((volatile uchar*)(CONFIG_SYS_MBAR+0x0c00))
@@ -213,8 +219,7 @@
# define I2C_DELAY {udelay(5);}
# define I2C_ACTIVE {DDR0|=SDA0;}
# define I2C_TRISTATE {DDR0&=~SDA0;}
-# define CONFIG_SYS_I2C_SPEED 100000
-# define CONFIG_SYS_I2C_SLAVE 0x7F
+
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x57
#define CONFIG_SYS_I2C_FACT_ADDR 0x57
#endif
diff --git a/include/configs/TOP860.h b/include/configs/TOP860.h
index 8c2befb..ec75431 100644
--- a/include/configs/TOP860.h
+++ b/include/configs/TOP860.h
@@ -159,7 +159,6 @@
* Environment handler
* only the first 6k in EEPROM are available for user. Of that we use 256b
*/
-#define CONFIG_SOFT_I2C
#define CONFIG_ENV_IS_IN_EEPROM 1 /* turn on EEPROM env feature */
#define CONFIG_ENV_OFFSET 0x1000
#define CONFIG_ENV_SIZE 0x0700
@@ -170,13 +169,17 @@
#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
#define CONFIG_SYS_EEPROM_SIZE 0x2000
-#define CONFIG_SYS_I2C_SPEED 100000
-#define CONFIG_SYS_I2C_SLAVE 0xFE
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 12
#define CONFIG_ENV_OVERWRITE
#define CONFIG_MISC_INIT_R
-#if defined (CONFIG_SOFT_I2C)
+#define CONFIG_NEW_I2C
+#define CONFIG_SOFT_I2C /* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED 100000
+#define CONFIG_SYS_SOFT_I2C_SLAVE 0xFE
+#define CONFIG_SYS_I2C_ADAPTERS {&soft_i2c_adap[0]}
+/**/
#define SDA 0x00010
#define SCL 0x00020
#define __I2C_DIR immr->im_cpm.cp_pbdir
@@ -193,7 +196,6 @@
#define I2C_DELAY { udelay(5); }
#define I2C_ACTIVE { __I2C_DIR |= SDA; }
#define I2C_TRISTATE { __I2C_DIR &= ~SDA; }
-#endif
#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
diff --git a/include/configs/TQM8260.h b/include/configs/TQM8260.h
index ac9c94e..03ca4ba 100644
--- a/include/configs/TQM8260.h
+++ b/include/configs/TQM8260.h
@@ -88,9 +88,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
diff --git a/include/configs/TQM8272.h b/include/configs/TQM8272.h
index 9cac696..75b023f 100644
--- a/include/configs/TQM8272.h
+++ b/include/configs/TQM8272.h
@@ -96,10 +96,12 @@
#if CONFIG_I2C
/* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C /* I2C with hardware support */
-#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-
+#define CONFIG_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
*/
diff --git a/include/configs/TQM834x.h b/include/configs/TQM834x.h
index 796030d..2526a01 100644
--- a/include/configs/TQM834x.h
+++ b/include/configs/TQM834x.h
@@ -201,12 +201,12 @@ extern int tqm834x_num_flash_banks;
/*
* 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: 400KHz */
-#define CONFIG_SYS_I2C_SLAVE 0x7F /* slave address */
-#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]}
/* I2C EEPROM, configuration for onboard EEPROMs 24C256 and 24C32 */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* 1010000x */
diff --git a/include/configs/TQM855M.h b/include/configs/TQM855M.h
index 84889ea..20a1e20 100644
--- a/include/configs/TQM855M.h
+++ b/include/configs/TQM855M.h
@@ -93,12 +93,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
*/
@@ -114,7 +114,6 @@
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
else immr->im_cpm.cp_pbdat &= ~PB_SCL
#define I2C_DELAY udelay(2) /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* two byte address */
diff --git a/include/configs/TQM85xx.h b/include/configs/TQM85xx.h
index f5831eb..23e758c 100644
--- a/include/configs/TQM85xx.h
+++ b/include/configs/TQM85xx.h
@@ -302,13 +302,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 {0x48} /* 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 {0x48} /* Don't probe these addrs */
/* I2C RTC */
#define CONFIG_RTC_DS1337 /* Use ds1337 rtc via i2c */
diff --git a/include/configs/TQM866M.h b/include/configs/TQM866M.h
index 87dc264..6223728 100644
--- a/include/configs/TQM866M.h
+++ b/include/configs/TQM866M.h
@@ -105,12 +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 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
*/
@@ -126,7 +126,6 @@
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
else immr->im_cpm.cp_pbdat &= ~PB_SCL
#define I2C_DELAY udelay(2) /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C256 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* two byte address */
diff --git a/include/configs/TQM885D.h b/include/configs/TQM885D.h
index 942bbf6..3350eb6 100644
--- a/include/configs/TQM885D.h
+++ b/include/configs/TQM885D.h
@@ -99,12 +99,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
*/
@@ -120,7 +120,6 @@
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
else immr->im_cpm.cp_pbdat &= ~PB_SCL
#define I2C_DELAY udelay(2) /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C?? */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* two byte address */
diff --git a/include/configs/XPEDITE5200.h b/include/configs/XPEDITE5200.h
index 1df6855..652fc4f 100644
--- a/include/configs/XPEDITE5200.h
+++ b/include/configs/XPEDITE5200.h
@@ -219,14 +219,16 @@
/*
* I2C
*/
-#define CONFIG_FSL_I2C /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C /* I2C with hardware support */
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-#define CONFIG_SYS_I2C_OFFSET 0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
+#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]}
/* I2C EEPROM */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
diff --git a/include/configs/XPEDITE5370.h b/include/configs/XPEDITE5370.h
index 3bc0fe8..ab7efaf 100644
--- a/include/configs/XPEDITE5370.h
+++ b/include/configs/XPEDITE5370.h
@@ -237,14 +237,16 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
/*
* I2C
*/
-#define CONFIG_FSL_I2C /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C /* I2C with hardware support */
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-#define CONFIG_SYS_I2C_OFFSET 0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
+#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]}
/* PEX8518 slave I2C interface */
#define CONFIG_SYS_I2C_PEX8518_ADDR 0x70
diff --git a/include/configs/barco.h b/include/configs/barco.h
index e00f84a..be9dcbc 100644
--- a/include/configs/barco.h
+++ b/include/configs/barco.h
@@ -197,6 +197,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)
diff --git a/include/configs/bf533-ezkit.h b/include/configs/bf533-ezkit.h
index 48c0252..89b6036 100644
--- a/include/configs/bf533-ezkit.h
+++ b/include/configs/bf533-ezkit.h
@@ -168,7 +168,12 @@
* I2C settings
* By default PF1 is used as SDA and PF0 as SCL on the Stamp board
*/
-#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 0
+#define CONFIG_SYS_I2C_ADAPTERS {&soft_i2c_adap[0]}
/*
* Software (bit-bang) I2C driver configuration
*/
@@ -197,9 +202,6 @@
}
#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
-#define CONFIG_SYS_I2C_SPEED 50000
-#define CONFIG_SYS_I2C_SLAVE 0
-
#define CONFIG_SYS_BOOTM_LEN 0x4000000 /* Large Image Length, set to 64 Meg */
#define CONFIG_EBIU_SDRRC_VAL 0x398
diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h
index ee41c7e..98b84b5 100644
--- a/include/configs/bf533-stamp.h
+++ b/include/configs/bf533-stamp.h
@@ -27,14 +27,6 @@
/* FLASH/ETHERNET uses the same address range */
#define SHARED_RESOURCES 1
-/* Is I2C bit-banged? */
-#define CONFIG_SOFT_I2C 1
-
-/*
- * Software (bit-bang) I2C driver configuration
- */
-#define PF_SCL PF3
-#define PF_SDA PF2
/*
* Video splash screen support
@@ -178,6 +170,41 @@
#define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
#endif
+/* 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 50000
+#define CONFIG_SYS_SOFT_I2C_SLAVE 0
+#define CONFIG_SYS_I2C_ADAPTERS {&soft_i2c_adap[0]}
+/*
+ * Software (bit-bang) I2C driver configuration
+ */
+#define PF_SCL PF3
+#define PF_SDA PF2
+#define I2C_INIT (*pFIO_DIR |= PF_SCL); asm("ssync;")
+#define I2C_ACTIVE (*pFIO_DIR |= PF_SDA); *pFIO_INEN &= ~PF_SDA; asm("ssync;")
+#define I2C_TRISTATE (*pFIO_DIR &= ~PF_SDA); *pFIO_INEN |= PF_SDA; asm("ssync;")
+#define I2C_READ ((volatile)(*pFIO_FLAG_D & PF_SDA) != 0); asm("ssync;")
+#define I2C_SDA(bit) if(bit) { \
+ *pFIO_FLAG_S = PF_SDA; \
+ asm("ssync;"); \
+ } \
+ else { \
+ *pFIO_FLAG_C = PF_SDA; \
+ asm("ssync;"); \
+ }
+#define I2C_SCL(bit) if(bit) { \
+ *pFIO_FLAG_S = PF_SCL; \
+ asm("ssync;"); \
+ } \
+ else { \
+ *pFIO_FLAG_C = PF_SCL; \
+ asm("ssync;"); \
+ }
+#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
+
+
/*
* Command settings
*/
@@ -213,13 +240,6 @@
"cp.b $(loadaddr) 0x20000000 $(filesize)\0" \
""
-#ifdef CONFIG_SOFT_I2C
-#if (!CONFIG_SOFT_I2C)
-#undef CONFIG_SOFT_I2C
-#endif
-#endif
-
-
/*
* BOOTP options
*/
@@ -244,7 +264,7 @@
#define CONFIG_CMD_PING
#endif
-#if (CONFIG_SOFT_I2C)
+#if defined(CONFIG_SOFT_I2C)
#define CONFIG_CMD_I2C
#endif
@@ -271,37 +291,6 @@
#define CONFIG_LOADS_ECHO 1
-/*
- * I2C settings
- * By default PF2 is used as SDA and PF3 as SCL on the Stamp board
- */
-#if (CONFIG_SOFT_I2C)
-
-#define I2C_INIT (*pFIO_DIR |= PF_SCL); asm("ssync;")
-#define I2C_ACTIVE (*pFIO_DIR |= PF_SDA); *pFIO_INEN &= ~PF_SDA; asm("ssync;")
-#define I2C_TRISTATE (*pFIO_DIR &= ~PF_SDA); *pFIO_INEN |= PF_SDA; asm("ssync;")
-#define I2C_READ ((volatile)(*pFIO_FLAG_D & PF_SDA) != 0); asm("ssync;")
-#define I2C_SDA(bit) if(bit) { \
- *pFIO_FLAG_S = PF_SDA; \
- asm("ssync;"); \
- } \
- else { \
- *pFIO_FLAG_C = PF_SDA; \
- asm("ssync;"); \
- }
-#define I2C_SCL(bit) if(bit) { \
- *pFIO_FLAG_S = PF_SCL; \
- asm("ssync;"); \
- } \
- else { \
- *pFIO_FLAG_C = PF_SCL; \
- asm("ssync;"); \
- }
-#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
-
-#define CONFIG_SYS_I2C_SPEED 50000
-#define CONFIG_SYS_I2C_SLAVE 0
-#endif /* CONFIG_SOFT_I2C */
/*
* Compact Flash settings
diff --git a/include/configs/debris.h b/include/configs/debris.h
index 4d65f6a..9a80a45 100644
--- a/include/configs/debris.h
+++ b/include/configs/debris.h
@@ -280,6 +280,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 0x7F
+#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)
diff --git a/include/configs/ep8260.h b/include/configs/ep8260.h
index d49d02f..0316f31 100644
--- a/include/configs/ep8260.h
+++ b/include/configs/ep8260.h
@@ -226,14 +226,20 @@
* 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_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_SLAVE 0x7F /* This is for HARD, must go */
/*
* Software (bit-bang) I2C driver configuration
*/
#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 I2C_PORT 3 /* Port A=0, B=1, C=2, D=3 */
#define I2C_ACTIVE (iop->pdir |= 0x00010000)
#define I2C_TRISTATE (iop->pdir &= ~0x00010000)
diff --git a/include/configs/lwmon.h b/include/configs/lwmon.h
index d52a5e0..c80f43b 100644
--- a/include/configs/lwmon.h
+++ b/include/configs/lwmon.h
@@ -144,12 +144,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
*/
@@ -165,7 +165,6 @@
#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
else immr->im_cpm.cp_pbdat &= ~PB_SCL
#define I2C_DELAY udelay(2) /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
#define CONFIG_RTC_PCF8563 /* use Philips PCF8563 RTC */
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 233bee0..8d74ac2 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -62,6 +62,7 @@
* must be unset.
*/
#define CONFIG_ETHER_ON_SCC /* Ethernet is on SCC */
+#define CONFIG_NET_MULTI /* ether_scc.c won't compile otherwise */
#undef CONFIG_ETHER_ON_FCC /* Ethernet is not on FCC */
#undef CONFIG_ETHER_NONE /* No external Ethernet */
@@ -142,14 +143,21 @@
/* 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 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-
+#define CONFIG_NEW_I2C
+#define CONFIG_SYS_NUM_I2C_ADAPTERS 1
+#define CONFIG_SYS_NUM_I2C_BUSSES 3
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#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 0x7F
+#define CONFIG_SYS_I2C_ADAPTERS {&soft_i2c_adap[0]}
+#define CONFIG_SYS_I2C_BUSSES { {0, {I2C_NULL_HOP}}, \
+ {0, {{I2C_MUX_PCA9542, 0x70, 0}}}, \
+ {0, {{I2C_MUX_PCA9542, 0x70, 1}}}}
/*
* Software (bit-bang) I2C driver configuration
*/
-
#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)
@@ -160,11 +168,10 @@
else iop->pdat &= ~0x00020000
#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
-#define CONFIG_I2C_MULTI_BUS 1
-#define CONFIG_I2C_CMD_TREE 1
-#define CONFIG_SYS_MAX_I2C_BUS 2
+/* I2C_INIT_BOARD specific... */
#define CONFIG_SYS_I2C_INIT_BOARD 1
-#define CONFIG_I2C_MUX 1
+#define SOFT_I2C_INIT_BOARD i2c_init_board()
+#define CONFIG_SYS_I2C_SPEED CONFIG_SYS_SOFT_I2C_SPEED
/* EEprom support */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
@@ -174,6 +181,7 @@
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
/* Support the IVM EEprom */
+#define CONFIG_SYS_IVM_EEPROM_BUS_NUM 1
#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
@@ -184,7 +192,7 @@
#define CONFIG_SYS_DTT_MAX_TEMP 70
#define CONFIG_SYS_DTT_LOW_TEMP -30
#define CONFIG_SYS_DTT_HYSTERESIS 3
-#define CONFIG_SYS_DTT_BUS_NUM (CONFIG_SYS_MAX_I2C_BUS)
+#define CONFIG_SYS_DTT_BUS_NUM 2
#define CONFIG_SYS_IMMR 0xF0000000
diff --git a/include/configs/mgsuvd.h b/include/configs/mgsuvd.h
index f53b6d3..3ea0725 100644
--- a/include/configs/mgsuvd.h
+++ b/include/configs/mgsuvd.h
@@ -265,11 +265,18 @@
/* 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 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-#define I2C_SOFT_DECLARATIONS
-
+#define CONFIG_NEW_I2C
+#define CONFIG_SYS_NUM_I2C_ADAPTERS 1
+#define CONFIG_SYS_NUM_I2C_BUSSES 3
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#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 0x7F
+#define CONFIG_SYS_I2C_ADAPTERS {&soft_i2c_adap[0]}
+#define CONFIG_SYS_I2C_BUSSES { {0, {I2C_NULL_HOP}}, \
+ {0, {{I2C_MUX_PCA9542, 0x70, 0}}}, \
+ {0, {{I2C_MUX_PCA9542, 0x70, 1}}}}
/*
* Software (bit-bang) I2C driver configuration
*/
@@ -298,11 +305,10 @@
}
#define I2C_DELAY udelay(50) /* 1/4 I2C clock duration */
-#define CONFIG_I2C_MULTI_BUS 1
-#define CONFIG_I2C_CMD_TREE 1
-#define CONFIG_SYS_MAX_I2C_BUS 2
+/* I2C_INIT_BOARD specific... */
#define CONFIG_SYS_I2C_INIT_BOARD 1
-#define CONFIG_I2C_MUX 1
+#define SOFT_I2C_INIT_BOARD i2c_init_board()
+#define CONFIG_SYS_I2C_SPEED CONFIG_SYS_SOFT_I2C_SPEED
/* EEprom support */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
@@ -312,6 +318,7 @@
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
/* Support the IVM EEprom */
+#define CONFIG_SYS_IVM_EEPROM_BUS_NUM 1
#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
@@ -322,6 +329,6 @@
#define CONFIG_SYS_DTT_MAX_TEMP 70
#define CONFIG_SYS_DTT_LOW_TEMP -30
#define CONFIG_SYS_DTT_HYSTERESIS 3
-#define CONFIG_SYS_DTT_BUS_NUM (CONFIG_SYS_MAX_I2C_BUS)
+#define CONFIG_SYS_DTT_BUS_NUM 2
#endif /* __CONFIG_H */
1
0
Signed-off-by: Sergey Kubushyn <ksi(a)koi8.net>
---
diff --git a/include/configs/MPC8540ADS.h b/include/configs/MPC8540ADS.h
index 0d03b0b..98e3f27 100644
--- a/include/configs/MPC8540ADS.h
+++ b/include/configs/MPC8540ADS.h
@@ -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 --git a/include/configs/MPC8540EVAL.h b/include/configs/MPC8540EVAL.h
index 5ac1916..15a6688 100644
--- a/include/configs/MPC8540EVAL.h
+++ b/include/configs/MPC8540EVAL.h
@@ -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 --git a/include/configs/MPC8541CDS.h b/include/configs/MPC8541CDS.h
index fa82fbc..4c1bae6 100644
--- a/include/configs/MPC8541CDS.h
+++ b/include/configs/MPC8541CDS.h
@@ -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 --git a/include/configs/MPC8544DS.h b/include/configs/MPC8544DS.h
index 59cfde6..815cb98 100644
--- a/include/configs/MPC8544DS.h
+++ b/include/configs/MPC8544DS.h
@@ -250,14 +250,14 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
#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 --git a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h
index 95bce95..4303a0e 100644
--- a/include/configs/MPC8548CDS.h
+++ b/include/configs/MPC8548CDS.h
@@ -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_DECLARATIONS1 I2C_SOFT_DEFS
+
+#define I2C_INIT1 (printf("init1"))
+#define I2C_ACTIVE1 (printf("active1"))
+#define I2C_TRISTATE1 (printf("tristate1"))
+#define I2C_READ1 (1)
+#define I2C_SDA1(bit) (printf("sda1: %d", bit))
+#define I2C_SCL1(bit) (printf("scl1: %d", bit))
+#define I2C_DELAY1 udelay(2) /* 1/4 I2C clock duration */
+
+#define CONFIG_SYS_SOFT_I2C1_SPEED 100000
+#define CONFIG_SYS_SOFT_I2C1_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
diff --git a/include/configs/MPC8555CDS.h b/include/configs/MPC8555CDS.h
index 6bf0961..741db9a 100644
--- a/include/configs/MPC8555CDS.h
+++ b/include/configs/MPC8555CDS.h
@@ -320,13 +320,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 --git a/include/configs/MPC8560ADS.h b/include/configs/MPC8560ADS.h
index 3f78a6e..f01a79d 100644
--- a/include/configs/MPC8560ADS.h
+++ b/include/configs/MPC8560ADS.h
@@ -291,13 +291,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 --git a/include/configs/MPC8568MDS.h b/include/configs/MPC8568MDS.h
index 58ff52b..832420b 100644
--- a/include/configs/MPC8568MDS.h
+++ b/include/configs/MPC8568MDS.h
@@ -306,17 +306,18 @@ extern unsigned long get_clock_freq(void);
/*
* I2C
*/
-#define CONFIG_FSL_I2C /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C /* I2C bit-banged */
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#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,0x69}} /* Don't probe these addrs */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x52
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-#define CONFIG_SYS_I2C_NOPROBES {{0,0x69}} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET 0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
/*
* General PCI
diff --git a/include/configs/MPC8572DS.h b/include/configs/MPC8572DS.h
index ac0a464..f07b4d5 100644
--- a/include/configs/MPC8572DS.h
+++ b/include/configs/MPC8572DS.h
@@ -373,17 +373,18 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
#define CONFIG_FIT_VERBOSE 1 /* enable fit_format_{error,warning}() */
/* I2C */
-#define CONFIG_FSL_I2C /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C /* I2C with hardware support */
-#undef CONFIG_SOFT_I2C /* I2C bit-banged */
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_I2C_CMD_TREE
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
+#define CONFIG_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 */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x57
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-#define CONFIG_SYS_I2C_NOPROBES {{0,0x29}}/* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET 0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
/*
* I2C2 EEPROM
diff --git a/include/configs/MPC8610HPCD.h b/include/configs/MPC8610HPCD.h
index 4bd3e0b..6932839 100644
--- a/include/configs/MPC8610HPCD.h
+++ b/include/configs/MPC8610HPCD.h
@@ -261,13 +261,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
diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
index 5a83296..d139f17 100644
--- a/include/configs/MPC8641HPCN.h
+++ b/include/configs/MPC8641HPCN.h
@@ -308,13 +308,13 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
/*
* I2C
*/
-#define CONFIG_FSL_I2C /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C /* I2C with hardware support*/
-#undef CONFIG_SOFT_I2C /* I2C bit-banged */
-#define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */
-#define CONFIG_SYS_I2C_OFFSET 0x3100
+#define CONFIG_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 0x3100
+#define CONFIG_SYS_I2C_ADAPTERS {&fsl_i2c_adap[0]}
+#define CONFIG_SYS_I2C_NOPROBES {0x69} /* Don't probe these addrs */
/*
* RapidIO MMU
diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h
index 4ecf806..70b68ff 100644
--- a/include/configs/MVBLM7.h
+++ b/include/configs/MVBLM7.h
@@ -42,23 +42,22 @@
#define CONFIG_PCI
#define CONFIG_83XX_GENERIC_PCI
#define CONFIG_PCI_SKIP_HOST_BRIDGE
-#define CONFIG_HARD_I2C
#define CONFIG_TSEC_ENET
#define CONFIG_MPC8XXX_SPI
#define CONFIG_HARD_SPI
#define MVBLM7_MMC_CS 0x04000000
/* I2C */
-#undef CONFIG_SOFT_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_I2C_SPEED 100000
-#define CONFIG_SYS_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_SPEED 100000 /* 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 100000 /* 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]}
/*
* DDR Setup
diff --git a/include/configs/NC650.h b/include/configs/NC650.h
index 0b97f0c..c4d0473 100644
--- a/include/configs/NC650.h
+++ b/include/configs/NC650.h
@@ -104,10 +104,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 100000 /* 100 kHz */
-#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 100000
+#define CONFIG_SYS_SOFT_I2C_SLAVE 0x7f
+#define CONFIG_SYS_I2C_ADAPTERS {&soft_i2c_adap[0]}
/*
* Software (bit-bang) I2C driver configuration
*/
diff --git a/include/configs/PM826.h b/include/configs/PM826.h
index b58f529..58307e6 100644
--- a/include/configs/PM826.h
+++ b/include/configs/PM826.h
@@ -54,9 +54,12 @@
/* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C
-#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */
-# define CONFIG_SYS_I2C_SPEED 50000
-# define CONFIG_SYS_I2C_SLAVE 0xFE
+#define CONFIG_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
*/
diff --git a/include/configs/PM828.h b/include/configs/PM828.h
index 96c86f7..5d876e6 100644
--- a/include/configs/PM828.h
+++ b/include/configs/PM828.h
@@ -54,9 +54,12 @@
/* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C
-#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */
-# define CONFIG_SYS_I2C_SPEED 50000
-# define CONFIG_SYS_I2C_SLAVE 0xFE
+#define CONFIG_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
*/
diff --git a/include/configs/PM854.h b/include/configs/PM854.h
index 41e290d..33d8957 100644
--- a/include/configs/PM854.h
+++ b/include/configs/PM854.h
@@ -194,13 +194,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 */
/*
* EEPROM configuration
diff --git a/include/configs/PM856.h b/include/configs/PM856.h
index 6b4e2dd..68748a6 100644
--- a/include/configs/PM856.h
+++ b/include/configs/PM856.h
@@ -191,13 +191,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 */
/*
* EEPROM configuration
diff --git a/include/configs/RRvision.h b/include/configs/RRvision.h
index 6ec5be0..4490323 100644
--- a/include/configs/RRvision.h
+++ b/include/configs/RRvision.h
@@ -119,12 +119,12 @@
/* enable I2C and select the hardware/software driver */
#undef CONFIG_HARD_I2C /* I2C with hardware support */
-#define CONFIG_SOFT_I2C /* I2C bit-banged */
-
-# define CONFIG_SYS_I2C_SPEED 50000 /* 50 kHz is supposed to work */
-# define CONFIG_SYS_I2C_SLAVE 0xFE
-
-#ifdef CONFIG_SOFT_I2C
+#define CONFIG_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
*/
@@ -140,7 +140,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(1) /* 1/4 I2C clock duration */
-#endif /* CONFIG_SOFT_I2C */
/*
diff --git a/include/configs/SBC8540.h b/include/configs/SBC8540.h
index 3419631..3bab4be 100644
--- a/include/configs/SBC8540.h
+++ b/include/configs/SBC8540.h
@@ -234,13 +234,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 */
#define CONFIG_SYS_PCI_MEM_BASE 0xC0000000
#define CONFIG_SYS_PCI_MEM_PHYS 0xC0000000
diff --git a/include/configs/SCM.h b/include/configs/SCM.h
index c6fb074..f70340e 100644
--- a/include/configs/SCM.h
+++ b/include/configs/SCM.h
@@ -74,14 +74,15 @@
/* 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
*/
-
#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)
diff --git a/include/configs/SIMPC8313.h b/include/configs/SIMPC8313.h
index a616236..c531ffa 100644
--- a/include/configs/SIMPC8313.h
+++ b/include/configs/SIMPC8313.h
@@ -217,15 +217,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_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 */
-#define CONFIG_SYS_I2C_OFFSET 0x3000
-#define CONFIG_SYS_I2C2_OFFSET 0x3100
/*
* General PCI
diff --git a/include/configs/SMN42.h b/include/configs/SMN42.h
index 45e6a58..f70d3ac 100644
--- a/include/configs/SMN42.h
+++ b/include/configs/SMN42.h
@@ -78,17 +78,13 @@
/* 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 10000
/* this would be 0xAE if E0, E1 and E2 were pulled high */
-#define CONFIG_SYS_I2C_SLAVE 0xA0
-#define CONFIG_SYS_I2C_EEPROM_ADDR (0xA0 >> 1)
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* 16 bit address */
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 6 /* 64 bytes per write */
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 20
-/* not used but required by devices.c */
-#define CONFIG_SYS_I2C_SPEED 10000
-
-#ifdef CONFIG_SOFT_I2C
+#define CONFIG_SYS_SOFT_I2C_SLAVE 0xA0
+#define CONFIG_SYS_I2C_ADAPTERS {&soft_i2c_adap[0]}
/*
* Software (bit-bang) I2C driver configuration
*/
@@ -107,7 +103,11 @@
i2ctmp = GET32(IO0DIR); \
i2ctmp &= ~SDA; \
PUT32(IO0DIR, i2ctmp); }
-#endif /* CONFIG_SOFT_I2C */
+
+#define CONFIG_SYS_I2C_EEPROM_ADDR (0xA0 >> 1)
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* 16 bit address */
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 6 /* 64 bytes per write */
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 20
/*
diff --git a/include/configs/SXNI855T.h b/include/configs/SXNI855T.h
index 9857bf6..6e1cd4a 100644
--- a/include/configs/SXNI855T.h
+++ b/include/configs/SXNI855T.h
@@ -119,7 +119,12 @@
#define CONFIG_RTC_DS1306 /* Dallas 1306 real time clock */
-#define CONFIG_SOFT_I2C /* 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
*/
@@ -136,8 +141,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 /* Atmel 24C64 */
# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* two byte address */
diff --git a/include/configs/Sandpoint8240.h b/include/configs/Sandpoint8240.h
index 125b9a2..ef518f6 100644
--- a/include/configs/Sandpoint8240.h
+++ b/include/configs/Sandpoint8240.h
@@ -209,6 +209,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)
diff --git a/include/configs/Sandpoint8245.h b/include/configs/Sandpoint8245.h
index 8cb920e..06ac357 100644
--- a/include/configs/Sandpoint8245.h
+++ b/include/configs/Sandpoint8245.h
@@ -179,6 +179,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)
diff --git a/include/configs/TASREG.h b/include/configs/TASREG.h
index 25f3a26..8d14f6f 100644
--- a/include/configs/TASREG.h
+++ b/include/configs/TASREG.h
@@ -137,19 +137,13 @@
/*-----------------------------------------------------------------------
* I2C
*/
-#define CONFIG_SOFT_I2C
-#define CONFIG_SYS_I2C_SPEED 100000 /* I2C speed and slave address */
-#define CONFIG_SYS_I2C_SLAVE 0x7F
-#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC32 */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* Bytes of address */
-/* mask of address bits that overflow into the "EEPROM chip address" */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 0x01
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 5 /* The Catalyst CAT24WC32 has */
- /* 32 byte page write mode using*/
- /* last 5 bits of the address */
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 /* and takes up to 10 msec */
+#define CONFIG_NEW_I2C
+#define CONFIG_SOFT_I2C /* I2C bit-banged */
+#define I2C_SOFT_DECLARATIONS I2C_SOFT_DEFS
+#define CONFIG_SYS_SOFT_I2C_SPEED 100000
+#define CONFIG_SYS_SOFT_I2C_SLAVE 0x7F
+#define CONFIG_SYS_I2C_ADAPTERS {&soft_i2c_adap[0]}
-#if defined (CONFIG_SOFT_I2C)
#if 0 /* push-pull */
#define SDA 0x00800000
#define SCL 0x00000008
@@ -183,7 +177,15 @@
#define I2C_ACTIVE {DIR1|=SDA;}
#define I2C_TRISTATE {DIR1&=~SDA;}
#endif
-#endif
+
+#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM CAT28WC32 */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* Bytes of address */
+/* mask of address bits that overflow into the "EEPROM chip address" */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 0x01
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 5 /* The Catalyst CAT24WC32 has */
+ /* 32 byte page write mode using*/
+ /* last 5 bits of the address */
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 /* and takes up to 10 msec */
/*-----------------------------------------------------------------------
* Definitions for initial stack pointer and data area (in DPRAM)
1
0
Signed-off-by: Sergey Kubushyn <ksi(a)koi8.net>
---
diff --git a/include/configs/IDS8247.h b/include/configs/IDS8247.h
index fbcbddb..407a162 100644
--- a/include/configs/IDS8247.h
+++ b/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
*/
diff --git a/include/configs/IP860.h b/include/configs/IP860.h
index b9c5713..88b9fad 100644
--- a/include/configs/IP860.h
+++ b/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" */
diff --git a/include/configs/IPHASE4539.h b/include/configs/IPHASE4539.h
index 3cb6cf7..9d24695 100644
--- a/include/configs/IPHASE4539.h
+++ b/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 */
/*
diff --git a/include/configs/KUP4K.h b/include/configs/KUP4K.h
index a829984..08f99eb 100644
--- a/include/configs/KUP4K.h
+++ b/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 */
/*-----------------------------------------------------------------------
diff --git a/include/configs/M52277EVB.h b/include/configs/M52277EVB.h
index 5d5966f..9bb3978 100644
--- a/include/configs/M52277EVB.h
+++ b/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 */
diff --git a/include/configs/M5235EVB.h b/include/configs/M5235EVB.h
index 8c66f87..c5779fb 100644
--- a/include/configs/M5235EVB.h
+++ b/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)
diff --git a/include/configs/M5253DEMO.h b/include/configs/M5253DEMO.h
index 378e45a..6e8c06f 100644
--- a/include/configs/M5253DEMO.h
+++ b/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)
diff --git a/include/configs/M5271EVB.h b/include/configs/M5271EVB.h
index 7ddeb55..bb4a212 100644
--- a/include/configs/M5271EVB.h
+++ b/include/configs/M5271EVB.h
@@ -108,12 +108,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 5 seconds */
diff --git a/include/configs/M5275EVB.h b/include/configs/M5275EVB.h
index db48d76..a77ccd0 100644
--- a/include/configs/M5275EVB.h
+++ b/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)
diff --git a/include/configs/M53017EVB.h b/include/configs/M53017EVB.h
index df54c60..8c2eadf 100644
--- a/include/configs/M53017EVB.h
+++ b/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 */
diff --git a/include/configs/M5329EVB.h b/include/configs/M5329EVB.h
index 1f1586a..afc834b 100644
--- a/include/configs/M5329EVB.h
+++ b/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 */
diff --git a/include/configs/M5373EVB.h b/include/configs/M5373EVB.h
index 1991687..ac1aa45 100644
--- a/include/configs/M5373EVB.h
+++ b/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 */
diff --git a/include/configs/M54451EVB.h b/include/configs/M54451EVB.h
index 45f7016..f478be8 100644
--- a/include/configs/M54451EVB.h
+++ b/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 */
diff --git a/include/configs/M54455EVB.h b/include/configs/M54455EVB.h
index 101dced..d507988 100644
--- a/include/configs/M54455EVB.h
+++ b/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 */
diff --git a/include/configs/M5475EVB.h b/include/configs/M5475EVB.h
index e48de15..e9a9c74 100644
--- a/include/configs/M5475EVB.h
+++ b/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 */
diff --git a/include/configs/M5485EVB.h b/include/configs/M5485EVB.h
index 28bf0ad..42b5373 100644
--- a/include/configs/M5485EVB.h
+++ b/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 */
diff --git a/include/configs/MHPC.h b/include/configs/MHPC.h
index 8e7f9cd..fb95677 100644
--- a/include/configs/MHPC.h
+++ b/include/configs/MHPC.h
@@ -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 --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index 58a26e1..3abed49 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -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 --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index a04868e..33c540a 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -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 --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h
index c6ac91a..49270bb 100644
--- a/include/configs/MPC8323ERDB.h
+++ b/include/configs/MPC8323ERDB.h
@@ -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 --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h
index bc56e68..0918858 100644
--- a/include/configs/MPC832XEMDS.h
+++ b/include/configs/MPC832XEMDS.h
@@ -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 --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h
index 8e82aac..8a6b155 100644
--- a/include/configs/MPC8349EMDS.h
+++ b/include/configs/MPC8349EMDS.h
@@ -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 --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h
index 14cbc45..9073383 100644
--- a/include/configs/MPC8349ITX.h
+++ b/include/configs/MPC8349ITX.h
@@ -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 --git a/include/configs/MPC8360EMDS.h b/include/configs/MPC8360EMDS.h
index fbd2457..c8c86cb 100644
--- a/include/configs/MPC8360EMDS.h
+++ b/include/configs/MPC8360EMDS.h
@@ -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 --git a/include/configs/MPC8360ERDK.h b/include/configs/MPC8360ERDK.h
index c20f86a..0a51454 100644
--- a/include/configs/MPC8360ERDK.h
+++ b/include/configs/MPC8360ERDK.h
@@ -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 --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h
index 0dd6ef5..1c99d28 100644
--- a/include/configs/MPC837XEMDS.h
+++ b/include/configs/MPC837XEMDS.h
@@ -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 --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h
index f281c59..f3d48f7 100644
--- a/include/configs/MPC837XERDB.h
+++ b/include/configs/MPC837XERDB.h
@@ -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 --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h
index e379d53..5caf20a 100644
--- a/include/configs/MPC8536DS.h
+++ b/include/configs/MPC8536DS.h
@@ -331,16 +331,17 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
/*
* I2C
*/
-#define CONFIG_FSL_I2C /* Use FSL common I2C driver */
-#define CONFIG_HARD_I2C /* I2C with hardware support */
-#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
1
0
Signed-off-by: Sergey Kubushyn <ksi(a)koi8.net>
---
board/keymile/common/common.c | 40 ++-
board/keymile/mgcoge/mgcoge.c | 4 -
board/keymile/mgsuvd/mgsuvd.c | 11 -
board/lwmon/lwmon.c | 2 +-
board/lwmon/pcmcia.c | 4 +-
common/cmd_date.c | 9 +
common/cmd_dtt.c | 9 +
common/cmd_i2c.c | 340 ++++--------------
common/devices.c | 12 +-
cpu/mpc8xx/video.c | 4 +
drivers/hwmon/adm1021.c | 4 +
drivers/hwmon/lm75.c | 9 +
drivers/i2c/Makefile | 2 +
drivers/i2c/fsl_i2c.c | 266 +++++++++------
drivers/i2c/soft_i2c.c | 736 +++++++++++++++++++++++----------------
include/configs/ATUM8548.h | 16 +-
include/configs/CPU86.h | 10 +-
include/configs/CPU87.h | 10 +-
include/configs/GEN860T.h | 5 +
include/configs/HIDDEN_DRAGON.h | 5 +
include/configs/HMI10.h | 12 +-
include/configs/IAD210.h | 12 +-
include/configs/ICU862.h | 14 +-
include/configs/IDS8247.h | 10 +-
include/configs/IP860.h | 10 +-
include/configs/IPHASE4539.h | 12 +-
include/configs/KUP4K.h | 13 +-
include/configs/M52277EVB.h | 12 +-
include/configs/M5235EVB.h | 10 +-
include/configs/M5253DEMO.h | 9 +-
include/configs/M5271EVB.h | 10 +-
include/configs/M5275EVB.h | 10 +-
include/configs/M53017EVB.h | 10 +-
include/configs/M5329EVB.h | 10 +-
include/configs/M5373EVB.h | 10 +-
include/configs/M54451EVB.h | 10 +-
include/configs/M54455EVB.h | 10 +-
include/configs/M5475EVB.h | 10 +-
include/configs/M5485EVB.h | 10 +-
include/configs/MHPC.h | 9 +-
include/configs/MPC8313ERDB.h | 18 +-
include/configs/MPC8315ERDB.h | 12 +-
include/configs/MPC8323ERDB.h | 12 +-
include/configs/MPC832XEMDS.h | 12 +-
include/configs/MPC8349EMDS.h | 19 +-
include/configs/MPC8349ITX.h | 38 +--
include/configs/MPC8360EMDS.h | 13 +-
include/configs/MPC8360ERDK.h | 19 +-
include/configs/MPC837XEMDS.h | 13 +-
include/configs/MPC837XERDB.h | 13 +-
include/configs/MPC8536DS.h | 21 +-
include/configs/MPC8540ADS.h | 14 +-
include/configs/MPC8540EVAL.h | 14 +-
include/configs/MPC8541CDS.h | 14 +-
include/configs/MPC8544DS.h | 14 +-
include/configs/MPC8548CDS.h | 119 +++++--
include/configs/MPC8555CDS.h | 14 +-
include/configs/MPC8560ADS.h | 14 +-
include/configs/MPC8568MDS.h | 21 +-
include/configs/MPC8572DS.h | 21 +-
include/configs/MPC8610HPCD.h | 14 +-
include/configs/MPC8641HPCN.h | 14 +-
include/configs/MVBLM7.h | 19 +-
include/configs/NC650.h | 10 +-
include/configs/PM826.h | 9 +-
include/configs/PM828.h | 9 +-
include/configs/PM854.h | 14 +-
include/configs/PM856.h | 14 +-
include/configs/RRvision.h | 13 +-
include/configs/SBC8540.h | 14 +-
include/configs/SCM.h | 11 +-
include/configs/SIMPC8313.h | 16 +-
include/configs/SMN42.h | 22 +-
include/configs/SXNI855T.h | 9 +-
include/configs/Sandpoint8240.h | 5 +
include/configs/Sandpoint8245.h | 5 +
include/configs/TASREG.h | 28 +-
include/configs/TK885D.h | 13 +-
include/configs/TOP5200.h | 11 +-
include/configs/TOP860.h | 12 +-
include/configs/TQM8260.h | 9 +-
include/configs/TQM8272.h | 10 +-
include/configs/TQM834x.h | 10 +-
include/configs/TQM855M.h | 13 +-
include/configs/TQM85xx.h | 14 +-
include/configs/TQM866M.h | 13 +-
include/configs/TQM885D.h | 13 +-
include/configs/XPEDITE5200.h | 18 +-
include/configs/XPEDITE5370.h | 18 +-
include/configs/barco.h | 5 +
include/configs/bf533-ezkit.h | 10 +-
include/configs/bf533-stamp.h | 83 ++---
include/configs/debris.h | 5 +
include/configs/ep8260.h | 10 +-
include/configs/lwmon.h | 13 +-
include/configs/mgcoge.h | 28 +-
include/configs/mgsuvd.h | 27 +-
include/configs/pdnb3.h | 11 +-
include/configs/rmu.h | 11 +-
include/configs/sacsng.h | 12 +-
include/configs/sbc8260.h | 12 +-
include/configs/sbc8349.h | 16 +-
include/configs/sbc8548.h | 12 +-
include/configs/sbc8560.h | 14 +-
include/configs/sbc8641d.h | 14 +-
include/configs/socrates.h | 20 +-
include/configs/spc1920.h | 13 +-
include/configs/stxgp3.h | 18 +-
include/configs/stxssa.h | 13 +-
include/configs/uc100.h | 13 +-
include/configs/vct.h | 11 +-
include/i2c.h | 273 ++++++++-------
lib_arm/board.c | 15 +-
lib_blackfin/board.c | 8 +
lib_m68k/board.c | 16 +-
lib_mips/board.c | 8 +
lib_ppc/board.c | 16 +-
117 files changed, 1737 insertions(+), 1496 deletions(-)
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 1338950..501d168 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -35,11 +35,9 @@
#include <libfdt.h>
#endif
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_ADAPTERS)
#include <i2c.h>
-extern int i2c_soft_read_pin (void);
-
int ivm_calc_crc (unsigned char *buf, int len)
{
const unsigned short crc_tab[16] = {
@@ -295,32 +293,36 @@ int ivm_analyze_eeprom (unsigned char *buf, int len)
int ivm_read_eeprom (void)
{
- I2C_MUX_DEVICE *dev = NULL;
uchar i2c_buffer[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
+ uint tmp = 0xffff;
+#if !defined(CONFIG_SYS_IVM_EEPROM_BUS_NUM) || !defined(CONFIG_SYS_IVM_EEPROM_ADR)
uchar *buf;
- unsigned dev_addr = CONFIG_SYS_IVM_EEPROM_ADR;
+#endif
/* First init the Bus, select the Bus */
-#if defined(CONFIG_SYS_I2C_IVM_BUS)
- dev = i2c_mux_ident_muxstring ((uchar *)CONFIG_SYS_I2C_IVM_BUS);
+#if defined(CONFIG_SYS_IVM_EEPROM_BUS_NUM)
+ tmp = CONFIG_SYS_IVM_EEPROM_BUS_NUM;
#else
- buf = (unsigned char *) getenv ("EEprom_ivm");
+ buf = (unsigned char *) getenv ("EEprom_ivm_bus");
if (buf != NULL)
- dev = i2c_mux_ident_muxstring (buf);
+ tmp = (uint)simple_strtoul((char *)buf, NULL, 16);
#endif
- if (dev == NULL) {
- printf ("Error couldnt add Bus for IVM\n");
- return -1;
+ if (i2c_set_bus_num(tmp)) {
+ printf ("Error couldnt set Bus (%x) for IVM\n", tmp);
+ return(-1);
}
- i2c_set_bus_num (dev->busid);
- buf = (unsigned char *) getenv ("EEprom_ivm_addr");
- if (buf != NULL)
- dev_addr = simple_strtoul ((char *)buf, NULL, 16);
+#if defined(CONFIG_SYS_IVM_EEPROM_ADR)
+ tmp = CONFIG_SYS_IVM_EEPROM_ADR;
+#else
+ buf = (unsigned char *) getenv ("EEprom_ivm_addr");
+ if (buf != NULL)
+ tmp = (uint)simple_strtoul((char *)buf, NULL, 16);
+#endif
- if (eeprom_read (dev_addr, 0, i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN) != 0) {
- printf ("Error reading EEprom\n");
- return -2;
+ if (eeprom_read (tmp, 0, i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN) != 0) {
+ printf("Error reading EEprom\n");
+ return(-2);
}
return ivm_analyze_eeprom (i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index 5c50739..2150cd8 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -32,10 +32,6 @@
#include <libfdt.h>
#endif
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
-#include <i2c.h>
-#endif
-
#include "../common/common.h"
/*
diff --git a/board/keymile/mgsuvd/mgsuvd.c b/board/keymile/mgsuvd/mgsuvd.c
index 02baf62..232c3e5 100644
--- a/board/keymile/mgsuvd/mgsuvd.c
+++ b/board/keymile/mgsuvd/mgsuvd.c
@@ -195,14 +195,3 @@ void ft_board_setup(void *blob, bd_t *bd)
ft_blob_update (blob, bd);
}
#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
-
-int i2c_soft_read_pin (void)
-{
- int val;
-
- *(unsigned short *)(I2C_BASE_DIR) &= ~SDA_CONF;
- udelay(1);
- val = *(unsigned char *)(I2C_BASE_PORT);
-
- return ((val & SDA_BIT) == SDA_BIT);
-}
diff --git a/board/lwmon/lwmon.c b/board/lwmon/lwmon.c
index 1b665a9..421009c 100644
--- a/board/lwmon/lwmon.c
+++ b/board/lwmon/lwmon.c
@@ -481,7 +481,7 @@ static void kbd_init (void)
uchar val, errcd;
int i;
- i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_init_all();
gd->kbd_status = 0;
diff --git a/board/lwmon/pcmcia.c b/board/lwmon/pcmcia.c
index ad2e60d..3268426 100644
--- a/board/lwmon/pcmcia.c
+++ b/board/lwmon/pcmcia.c
@@ -108,7 +108,7 @@ int pcmcia_hardware_enable(int slot)
/* switch VCC on */
val |= MAX1604_OP_SUS | MAX1604_VCCBON;
- i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_init_all();
i2c_write (CONFIG_SYS_I2C_POWER_A_ADDR, 0, 0, &val, 1);
udelay(500000);
@@ -199,7 +199,7 @@ int pcmcia_voltage_set(int slot, int vcc, int vpp)
*/
debug ("PCMCIA power OFF\n");
val = MAX1604_VCCBHIZ | MAX1604_VPPBHIZ;
- i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_init_all();
i2c_write (CONFIG_SYS_I2C_POWER_A_ADDR, 0, 0, &val, 1);
val = 0;
diff --git a/common/cmd_date.c b/common/cmd_date.c
index 3d78be2..847ec27 100644
--- a/common/cmd_date.c
+++ b/common/cmd_date.c
@@ -46,8 +46,13 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int old_bus;
/* switch to correct I2C bus */
+#ifdef CONFIG_NEW_I2C
+ old_bus = i2c_get_bus_num();
+ i2c_set_bus_num(CONFIG_SYS_RTC_BUS_NUM);
+#else
old_bus = I2C_GET_BUS();
I2C_SET_BUS(CONFIG_SYS_RTC_BUS_NUM);
+#endif
switch (argc) {
case 2: /* set date & time */
@@ -94,7 +99,11 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
/* switch back to original I2C bus */
+#ifdef CONFIG_NEW_I2C
+ i2c_set_bus_num(old_bus);
+#else
I2C_SET_BUS(old_bus);
+#endif
return rcode;
}
diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c
index 7783c88..00f091e 100644
--- a/common/cmd_dtt.c
+++ b/common/cmd_dtt.c
@@ -35,8 +35,13 @@ int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
int old_bus;
/* switch to correct I2C bus */
+#ifdef CONFIG_NEW_I2C
+ old_bus = i2c_get_bus_num();
+ i2c_set_bus_num(CONFIG_SYS_DTT_BUS_NUM);
+#else
old_bus = I2C_GET_BUS();
I2C_SET_BUS(CONFIG_SYS_DTT_BUS_NUM);
+#endif
/*
* Loop through sensors, read
@@ -46,7 +51,11 @@ int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
printf ("DTT%d: %i C\n", i + 1, dtt_get_temp (sensors[i]));
/* switch back to original I2C bus */
+#ifdef CONFIG_NEW_I2C
+ i2c_set_bus_num(old_bus);
+#else
I2C_SET_BUS(old_bus);
+#endif
return 0;
} /* do_dtt() */
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 16439ac..1a5f79f 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1,4 +1,9 @@
/*
+ * (C) Copyright 2009
+ * Sergey Kubushyn, himself, ksi(a)koi8.net
+ *
+ * Changes for unified multibus/multiadapter I2C support.
+ *
* (C) Copyright 2001
* Gerald Van Baren, Custom IDEAS, vanbaren(a)cideas.com.
*
@@ -106,7 +111,7 @@ static uint i2c_mm_last_alen;
* pairs. The following macros take care of this */
#if defined(CONFIG_SYS_I2C_NOPROBES)
-#if defined(CONFIG_I2C_MULTI_BUS)
+#if CONFIG_SYS_NUM_I2C_BUSSES > 1
static struct
{
uchar bus;
@@ -122,19 +127,11 @@ static uchar i2c_no_probes[] = CONFIG_SYS_I2C_NOPROBES;
#define COMPARE_BUS(b,i) ((b) == 0) /* Make compiler happy */
#define COMPARE_ADDR(a,i) (i2c_no_probes[(i)] == (a))
#define NO_PROBE_ADDR(i) i2c_no_probes[(i)]
-#endif /* CONFIG_MULTI_BUS */
+#endif /* CONFIG_SYS_NUM_I2C_BUSSES > 1 */
#define NUM_ELEMENTS_NOPROBE (sizeof(i2c_no_probes)/sizeof(i2c_no_probes[0]))
#endif
-#if defined(CONFIG_I2C_MUX)
-static I2C_MUX_DEVICE *i2c_mux_devices = NULL;
-static int i2c_mux_busid = CONFIG_SYS_MAX_I2C_BUS;
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#endif
-
static int
mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]);
@@ -548,10 +545,10 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
*/
int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
- int j;
+ int j;
#if defined(CONFIG_SYS_I2C_NOPROBES)
- int k, skip;
- uchar bus = GET_BUS_NUM;
+ int k, skip;
+ unsigned int bus = GET_BUS_NUM;
#endif /* NOPROBES */
puts ("Valid chip addresses:");
@@ -1189,59 +1186,79 @@ int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
#if defined(CONFIG_I2C_CMD_TREE)
int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
- i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_init (ADAP(i2c_get_bus_num())->speed, ADAP(i2c_get_bus_num())->slaveaddr);
return 0;
}
-#if defined(CONFIG_I2C_MUX)
-int do_i2c_add_bus(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_i2c_show_bus(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
- int ret=0;
+ int i;
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+ int j;
+#endif
if (argc == 1) {
/* show all busses */
- I2C_MUX *mux;
- I2C_MUX_DEVICE *device = i2c_mux_devices;
-
- printf ("Busses reached over muxes:\n");
- while (device != NULL) {
- printf ("Bus ID: %x\n", device->busid);
- printf (" reached over Mux(es):\n");
- mux = device->mux;
- while (mux != NULL) {
- printf (" %s@%x ch: %x\n", mux->name, mux->chip, mux->channel);
- mux = mux->next;
+ for (i = 0; i < CONFIG_SYS_NUM_I2C_BUSSES; i++) {
+ printf("Bus %d:\t%s", i, ADAP(i)->name);
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+ for (j = 0; j < CONFIG_SYS_I2C_MAX_HOPS; j++) {
+ if (i2c_bus[i].next_hop[j].chip == 0) break;
+ printf("->%s@0x%2x:%d",
+ i2c_bus[i].next_hop[j].mux.name,
+ i2c_bus[i].next_hop[j].chip,
+ i2c_bus[i].next_hop[j].channel);
}
- device = device->next;
+#endif
+ printf("\n");
}
- } else {
- I2C_MUX_DEVICE *dev;
- dev = i2c_mux_ident_muxstring ((uchar *)argv[1]);
- ret = 0;
+ } else {
+ /* show specific bus */
+ i = simple_strtoul(argv[1], NULL, 10);
+ if (i >= CONFIG_SYS_NUM_I2C_BUSSES) {
+ printf("Invalid bus %d\n", i);
+ return(-1);
+ }
+ printf("Bus %d:\t%s", i, ADAP(i)->name);
+#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+ for (j = 0; j < CONFIG_SYS_I2C_MAX_HOPS; j++) {
+ if (i2c_bus[i].next_hop[j].chip == 0) break;
+ printf("->%s@0x%2x:%d",
+ i2c_bus[i].next_hop[j].mux.name,
+ i2c_bus[i].next_hop[j].chip,
+ i2c_bus[i].next_hop[j].channel);
+ }
+#endif
+ printf("\n");
}
- return ret;
+
+ return(0);
}
-#endif /* CONFIG_I2C_MUX */
-#if defined(CONFIG_I2C_MULTI_BUS)
+#if CONFIG_SYS_NUM_I2C_BUSSES > 1
int do_i2c_bus_num(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
- int bus_idx, ret=0;
+ int ret=0;
+ unsigned int bus_no;
if (argc == 1)
/* querying current setting */
printf("Current bus is %d\n", i2c_get_bus_num());
else {
- bus_idx = simple_strtoul(argv[1], NULL, 10);
- printf("Setting bus to %d\n", bus_idx);
- ret = i2c_set_bus_num(bus_idx);
+ bus_no = simple_strtoul(argv[1], NULL, 10);
+ if (bus_no >= CONFIG_SYS_NUM_I2C_BUSSES) {
+ printf("Invalid bus %d\n", bus_no);
+ return(-1);
+ }
+ printf("Setting bus to %d\n", bus_no);
+ ret = i2c_set_bus_num(bus_no);
if (ret)
printf("Failure changing bus number (%d)\n", ret);
}
return ret;
}
-#endif /* CONFIG_I2C_MULTI_BUS */
+#endif /* CONFIG_SYS_NUM_I2C_BUSSES > 1 */
int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
@@ -1262,16 +1279,16 @@ int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
-#if defined(CONFIG_I2C_MUX)
+#if CONFIG_SYS_NUM_I2C_BUSSES > 1
if (!strncmp(argv[1], "bu", 2))
- return do_i2c_add_bus(cmdtp, flag, --argc, ++argv);
-#endif /* CONFIG_I2C_MUX */
+ return do_i2c_show_bus(cmdtp, flag, --argc, ++argv);
+#endif /* CONFIG_SYS_NUM_I2C_BUSSES > 1 */
if (!strncmp(argv[1], "sp", 2))
return do_i2c_bus_speed(cmdtp, flag, --argc, ++argv);
-#if defined(CONFIG_I2C_MULTI_BUS)
+#if CONFIG_SYS_NUM_I2C_BUSSES > 1
if (!strncmp(argv[1], "de", 2))
return do_i2c_bus_num(cmdtp, flag, --argc, ++argv);
-#endif /* CONFIG_I2C_MULTI_BUS */
+#endif /* CONFIG_SYS_NUM_I2C_BUSSES > 1 */
if (!strncmp(argv[1], "md", 2))
return do_i2c_md(cmdtp, flag, --argc, ++argv);
if (!strncmp(argv[1], "mm", 2))
@@ -1304,13 +1321,11 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
i2c, 6, 1, do_i2c,
"I2C sub-system",
-#if defined(CONFIG_I2C_MUX)
- "bus [muxtype:muxaddr:muxchannel] - add a new bus reached over muxes.\n"
-#endif /* CONFIG_I2C_MUX */
- "speed [speed] - show or set I2C bus speed\n"
-#if defined(CONFIG_I2C_MULTI_BUS)
+#if CONFIG_SYS_NUM_I2C_BUSSES > 1
+ "bus [bus_no] - show I2C bus info.\n"
"i2c dev [dev] - show or set current I2C bus\n"
-#endif /* CONFIG_I2C_MULTI_BUS */
+#endif /* CONFIG_SYS_NUM_I2C_BUSSES > 1 */
+ "i2c speed [speed] - show or set I2C bus speed\n"
"i2c md chip address[.0, .1, .2] [# of objects] - read from I2C device\n"
"i2c mm chip address[.0, .1, .2] - write to I2C device (auto-incrementing)\n"
"i2c mw chip address[.0, .1, .2] value [count] - write to I2C device (fill)\n"
@@ -1323,7 +1338,7 @@ U_BOOT_CMD(
"i2c sdram chip - print SDRAM configuration information\n"
#endif
);
-#endif /* CONFIG_I2C_CMD_TREE */
+#else /* CONFIG_I2C_CMD_TREE */
U_BOOT_CMD(
imd, 4, 1, do_i2c_md, \
"i2c memory display", \
@@ -1378,221 +1393,4 @@ U_BOOT_CMD(
" (valid chip values 50..57)\n"
);
#endif
-
-#if defined(CONFIG_I2C_MUX)
-
-int i2c_mux_add_device(I2C_MUX_DEVICE *dev)
-{
- I2C_MUX_DEVICE *devtmp = i2c_mux_devices;
-
- if (i2c_mux_devices == NULL) {
- i2c_mux_devices = dev;
- return 0;
- }
- while (devtmp->next != NULL)
- devtmp = devtmp->next;
-
- devtmp->next = dev;
- return 0;
-}
-
-I2C_MUX_DEVICE *i2c_mux_search_device(int id)
-{
- I2C_MUX_DEVICE *device = i2c_mux_devices;
-
- while (device != NULL) {
- if (device->busid == id)
- return device;
- device = device->next;
- }
- return NULL;
-}
-
-/* searches in the buf from *pos the next ':'.
- * returns:
- * 0 if found (with *pos = where)
- * < 0 if an error occured
- * > 0 if the end of buf is reached
- */
-static int i2c_mux_search_next (int *pos, uchar *buf, int len)
-{
- while ((buf[*pos] != ':') && (*pos < len)) {
- *pos += 1;
- }
- if (*pos >= len)
- return 1;
- if (buf[*pos] != ':')
- return -1;
- return 0;
-}
-
-static int i2c_mux_get_busid (void)
-{
- int tmp = i2c_mux_busid;
-
- i2c_mux_busid ++;
- return tmp;
-}
-
-/* Analyses a Muxstring and sends immediately the
- Commands to the Muxes. Runs from Flash.
- */
-int i2c_mux_ident_muxstring_f (uchar *buf)
-{
- int pos = 0;
- int oldpos;
- int ret = 0;
- int len = strlen((char *)buf);
- int chip;
- uchar channel;
- int was = 0;
-
- while (ret == 0) {
- oldpos = pos;
- /* search name */
- ret = i2c_mux_search_next(&pos, buf, len);
- if (ret != 0)
- printf ("ERROR\n");
- /* search address */
- pos ++;
- oldpos = pos;
- ret = i2c_mux_search_next(&pos, buf, len);
- if (ret != 0)
- printf ("ERROR\n");
- buf[pos] = 0;
- chip = simple_strtoul((char *)&buf[oldpos], NULL, 16);
- buf[pos] = ':';
- /* search channel */
- pos ++;
- oldpos = pos;
- ret = i2c_mux_search_next(&pos, buf, len);
- if (ret < 0)
- printf ("ERROR\n");
- was = 0;
- if (buf[pos] != 0) {
- buf[pos] = 0;
- was = 1;
- }
- channel = simple_strtoul((char *)&buf[oldpos], NULL, 16);
- if (was)
- buf[pos] = ':';
- if (i2c_write(chip, 0, 0, &channel, 1) != 0) {
- printf ("Error setting Mux: chip:%x channel: \
- %x\n", chip, channel);
- return -1;
- }
- pos ++;
- oldpos = pos;
-
- }
-
- return 0;
-}
-
-/* Analyses a Muxstring and if this String is correct
- * adds a new I2C Bus.
- */
-I2C_MUX_DEVICE *i2c_mux_ident_muxstring (uchar *buf)
-{
- I2C_MUX_DEVICE *device;
- I2C_MUX *mux;
- int pos = 0;
- int oldpos;
- int ret = 0;
- int len = strlen((char *)buf);
- int was = 0;
-
- device = (I2C_MUX_DEVICE *)malloc (sizeof(I2C_MUX_DEVICE));
- device->mux = NULL;
- device->busid = i2c_mux_get_busid ();
- device->next = NULL;
- while (ret == 0) {
- mux = (I2C_MUX *)malloc (sizeof(I2C_MUX));
- mux->next = NULL;
- /* search name of mux */
- oldpos = pos;
- ret = i2c_mux_search_next(&pos, buf, len);
- if (ret != 0)
- printf ("%s no name.\n", __FUNCTION__);
- mux->name = (char *)malloc (pos - oldpos + 1);
- memcpy (mux->name, &buf[oldpos], pos - oldpos);
- mux->name[pos - oldpos] = 0;
- /* search address */
- pos ++;
- oldpos = pos;
- ret = i2c_mux_search_next(&pos, buf, len);
- if (ret != 0)
- printf ("%s no mux address.\n", __FUNCTION__);
- buf[pos] = 0;
- mux->chip = simple_strtoul((char *)&buf[oldpos], NULL, 16);
- buf[pos] = ':';
- /* search channel */
- pos ++;
- oldpos = pos;
- ret = i2c_mux_search_next(&pos, buf, len);
- if (ret < 0)
- printf ("%s no mux channel.\n", __FUNCTION__);
- was = 0;
- if (buf[pos] != 0) {
- buf[pos] = 0;
- was = 1;
- }
- mux->channel = simple_strtoul((char *)&buf[oldpos], NULL, 16);
- if (was)
- buf[pos] = ':';
- if (device->mux == NULL)
- device->mux = mux;
- else {
- I2C_MUX *muxtmp = device->mux;
- while (muxtmp->next != NULL) {
- muxtmp = muxtmp->next;
- }
- muxtmp->next = mux;
- }
- pos ++;
- oldpos = pos;
- }
- if (ret > 0) {
- /* Add Device */
- i2c_mux_add_device (device);
- return device;
- }
-
- return NULL;
-}
-
-int i2x_mux_select_mux(int bus)
-{
- I2C_MUX_DEVICE *dev;
- I2C_MUX *mux;
-
- if ((gd->flags & GD_FLG_RELOC) != GD_FLG_RELOC) {
- /* select Default Mux Bus */
-#if defined(CONFIG_SYS_I2C_IVM_BUS)
- i2c_mux_ident_muxstring_f ((uchar *)CONFIG_SYS_I2C_IVM_BUS);
-#else
- {
- unsigned char *buf;
- buf = (unsigned char *) getenv("EEprom_ivm");
- if (buf != NULL)
- i2c_mux_ident_muxstring_f (buf);
- }
-#endif
- return 0;
- }
- dev = i2c_mux_search_device(bus);
- if (dev == NULL)
- return -1;
-
- mux = dev->mux;
- while (mux != NULL) {
- if (i2c_write(mux->chip, 0, 0, &mux->channel, 1) != 0) {
- printf ("Error setting Mux: chip:%x channel: \
- %x\n", mux->chip, mux->channel);
- return -1;
- }
- mux = mux->next;
- }
- return 0;
-}
-#endif /* CONFIG_I2C_MUX */
+#endif /* CONFIG_I2C_CMD_TREE */
1
0
Without the timeout present an infinite loop can occur if the
NAND device is broken or not present.
Signed-off-by: Peter Tyser <ptyser(a)xes-inc.com>
---
drivers/mtd/nand/nand_base.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index bfa7874..a2656eb 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -75,6 +75,17 @@
#include <jffs2/jffs2.h>
#endif
+/*
+ * CONFIG_SYS_NAND_RESET_CNT is used as a timeout mechanism when resetting
+ * a flash. NAND flash is initialized prior to interrupts so standard timers
+ * can't be used. CONFIG_SYS_NAND_RESET_CNT should be set to a value
+ * which is greater than (max NAND reset time / NAND status read time).
+ * A conservative default of 200000 (500 us / 25 ns) is used as a default.
+ */
+#ifndef CONFIG_SYS_NAND_RESET_CNT
+#define CONFIG_SYS_NAND_RESET_CNT 200000
+#endif
+
/* Define default oob placement schemes for large and small page devices */
static struct nand_ecclayout nand_oob_8 = {
.eccbytes = 3,
@@ -524,6 +535,7 @@ static void nand_command(struct mtd_info *mtd, unsigned int command,
{
register struct nand_chip *chip = mtd->priv;
int ctrl = NAND_CTRL_CLE | NAND_CTRL_CHANGE;
+ uint32_t rst_sts_cnt = CONFIG_SYS_NAND_RESET_CNT;
/*
* Write out the command to the device.
@@ -590,7 +602,8 @@ static void nand_command(struct mtd_info *mtd, unsigned int command,
NAND_CTRL_CLE | NAND_CTRL_CHANGE);
chip->cmd_ctrl(mtd,
NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
- while (!(chip->read_byte(mtd) & NAND_STATUS_READY)) ;
+ while (!(chip->read_byte(mtd) & NAND_STATUS_READY) &&
+ (rst_sts_cnt--));
return;
/* This applies to read commands */
@@ -626,6 +639,7 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
int column, int page_addr)
{
register struct nand_chip *chip = mtd->priv;
+ uint32_t rst_sts_cnt = CONFIG_SYS_NAND_RESET_CNT;
/* Emulate NAND_CMD_READOOB */
if (command == NAND_CMD_READOOB) {
@@ -696,7 +710,8 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE);
chip->cmd_ctrl(mtd, NAND_CMD_NONE,
NAND_NCE | NAND_CTRL_CHANGE);
- while (!(chip->read_byte(mtd) & NAND_STATUS_READY)) ;
+ while (!(chip->read_byte(mtd) & NAND_STATUS_READY) &&
+ (rst_sts_cnt--));
return;
case NAND_CMD_RNDOUT:
--
1.6.0.2.GIT
3
11

[U-Boot] [PATCH] nand_base: Silence warning when CONFIG_SYS_NAND_QUIET_TEST
by Peter Tyser 07 Feb '09
by Peter Tyser 07 Feb '09
07 Feb '09
Commit 0e8cc8bd92257da2e1df88cbc985e166e472ce61 removed support
for disabling the "No NAND device found!!!" warning when
CONFIG_SYS_NAND_QUIET_TEST was defined. This re-adds support
for silencing the warning.
Signed-off-by: Peter Tyser <ptyser(a)xes-inc.com>
---
drivers/mtd/nand/nand_base.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ef37f97..bfa7874 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2618,7 +2618,9 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips)
type = nand_get_flash_type(mtd, chip, busw, &nand_maf_id);
if (IS_ERR(type)) {
+#ifndef CONFIG_SYS_NAND_QUIET_TEST
printk(KERN_WARNING "No NAND device found!!!\n");
+#endif
chip->select_chip(mtd, -1);
return PTR_ERR(type);
}
--
1.6.0.2.GIT
2
1