summaryrefslogtreecommitdiffstats
path: root/include/configs/bf533-stamp.h
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2013-01-29 08:53:15 +0100
committerHeiko Schocher <hs@denx.de>2013-07-23 05:54:29 +0200
commitea818dbbcd59300b56014ac2d67798a54994eb9b (patch)
treefbdedc80f785873f96e79893a1a813504af57580 /include/configs/bf533-stamp.h
parent3f4978c713255c8406875fbdf23ffed1129bc44b (diff)
downloadtalos-obmc-uboot-ea818dbbcd59300b56014ac2d67798a54994eb9b.tar.gz
talos-obmc-uboot-ea818dbbcd59300b56014ac2d67798a54994eb9b.zip
i2c, soft-i2c: switch to new multibus/multiadapter support
- added to soft_i2c driver new multibus/multiadpater support - adapted all config files, which uses this driver Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Stephen Warren <swarren@wwwdotorg.org>
Diffstat (limited to 'include/configs/bf533-stamp.h')
-rw-r--r--include/configs/bf533-stamp.h48
1 files changed, 43 insertions, 5 deletions
diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h
index e3344e9e85..7144c6319f 100644
--- a/include/configs/bf533-stamp.h
+++ b/include/configs/bf533-stamp.h
@@ -14,7 +14,6 @@
#define CONFIG_BFIN_CPU bf533-0.3
#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
-
/*
* Clock Settings
* CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
@@ -38,7 +37,6 @@
/* Values can range from 1-15 */
#define CONFIG_SCLK_DIV 6 /* note: 1.2 boards can go faster */
-
/*
* Memory Settings
*/
@@ -74,6 +72,42 @@
/* #define CONFIG_ETHADDR 02:80:ad:20:31:b8 */
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED 50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE 0
+/*
+ * Software (bit-bang) I2C driver configuration
+ */
+#define PF_SCL PF3
+#define PF_SDA PF2
+#define I2C_INIT (*pFIO_DIR |= PF_SCL); asm("ssync;")
+#define I2C_ACTIVE (*pFIO_DIR |= PF_SDA); \
+ *pFIO_INEN &= ~PF_SDA; asm("ssync;")
+#define I2C_TRISTATE (*pFIO_DIR &= ~PF_SDA); \
+ *pFIO_INEN |= PF_SDA; asm("ssync;")
+#define I2C_READ ((volatile)(*pFIO_FLAG_D & PF_SDA) != 0); \
+ asm("ssync;")
+#define I2C_SDA(bit) if (bit) { \
+ *pFIO_FLAG_S = PF_SDA; \
+ asm("ssync;"); \
+ } \
+ else { \
+ *pFIO_FLAG_C = PF_SDA; \
+ asm("ssync;"); \
+ }
+#define I2C_SCL(bit) if (bit) { \
+ *pFIO_FLAG_S = PF_SCL; \
+ asm("ssync;"); \
+ } \
+ else { \
+ *pFIO_FLAG_C = PF_SCL; \
+ asm("ssync;"); \
+ }
+#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
+
+
/*
* Flash Settings
*/
@@ -84,7 +118,6 @@
#define CONFIG_SYS_MAX_FLASH_BANKS 1
#define CONFIG_SYS_MAX_FLASH_SECT 67
-
/*
* SPI Settings
*/
@@ -132,10 +165,15 @@
/*
* I2C Settings
*/
-#define CONFIG_SOFT_I2C
+#define CONFIG_SYS_I2C_SOFT
+#ifdef CONFIG_SYS_I2C_SOFT
+#define CONFIG_SYS_I2C
#define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF3
#define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF2
-
+#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
+#define CONFIG_SYS_I2C_SOFT_SPEED 50000
+#define CONFIG_SYS_I2C_SOFT_SLAVE 0
+#endif
/*
* Compact Flash / IDE / ATA Settings
OpenPOWER on IntegriCloud