summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2006-10-31 21:23:16 -0600
committerKim Phillips <kim.phillips@freescale.com>2006-11-03 19:42:22 -0600
commit9ca880a250870a7d55754291b5591d2b5fe89b54 (patch)
treebfef7c3013d3423222e2af4522b3341f42398f8e /include
parentac4b5622ce050b5ee1e154b98df630d778661632 (diff)
downloadblackbird-obmc-uboot-9ca880a250870a7d55754291b5591d2b5fe89b54.tar.gz
blackbird-obmc-uboot-9ca880a250870a7d55754291b5591d2b5fe89b54.zip
mpc83xx: Fix dual I2C support for the MPC8349ITX, MPC8349EMDS, TQM834x, and MPC8360EMDS
This patch also adds an improved I2C set_speed(), which handles all clock frequencies. Signed-off-by: Timur Tabi <timur@freescale.com>
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc/i2c.h10
-rw-r--r--include/configs/MPC8349ITX.h2
-rw-r--r--include/configs/TQM834x.h2
-rw-r--r--include/i2c.h8
4 files changed, 8 insertions, 14 deletions
diff --git a/include/asm-ppc/i2c.h b/include/asm-ppc/i2c.h
index baf9d9a262..8afdda2ce2 100644
--- a/include/asm-ppc/i2c.h
+++ b/include/asm-ppc/i2c.h
@@ -79,12 +79,6 @@ typedef struct i2c
#endif
#define I2C_TIMEOUT (CFG_HZ/4)
-enum I2C_BUS_NUM
-{
- I2C_BUS_1 = 0,
- I2C_BUS_2,
-};
-
#ifndef CFG_IMMRBAR
#error CFG_IMMRBAR is not defined in /include/configs/${BOARD}.h
#endif
@@ -96,9 +90,9 @@ enum I2C_BUS_NUM
#define I2C_1 ((i2c_t*)(CFG_IMMRBAR + CFG_I2C_OFFSET))
/* Optional support for second I2C bus */
-#ifdef CFG_I2C2_OFFSET
+#ifdef CFG_I2C2_OFFSET
#define I2C_2 ((i2c_t*)(CFG_IMMRBAR + CFG_I2C2_OFFSET))
-#endif /* CFG_I2C2_OFFSET */
+#endif /* CFG_I2C2_OFFSET */
#define I2C_READ 1
#define I2C_WRITE 0
diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h
index 20f3c6d399..2fbc736182 100644
--- a/include/configs/MPC8349ITX.h
+++ b/include/configs/MPC8349ITX.h
@@ -81,7 +81,7 @@
#define CONFIG_I2C_CMD_TREE
#define CFG_I2C_OFFSET 0x3000
#define CFG_I2C2_OFFSET 0x3100
-#define CFG_SPD_BUS_NUM I2C_2
+#define CFG_SPD_BUS_NUM 2
#define CFG_I2C_8574_ADDR1 0x20 /* I2C2, PCF8574 */
#define CFG_I2C_8574_ADDR2 0x21 /* I2C2, PCF8574 */
diff --git a/include/configs/TQM834x.h b/include/configs/TQM834x.h
index f0e49007d0..727094b203 100644
--- a/include/configs/TQM834x.h
+++ b/include/configs/TQM834x.h
@@ -36,8 +36,8 @@
*/
#define CONFIG_E300 1 /* E300 Family */
#define CONFIG_MPC83XX 1 /* MPC83XX family */
-#define CONFIG_MPC8349 1 /* MPC8349 specific */
#define CONFIG_MPC834X 1 /* MPC834X specific */
+#define CONFIG_MPC8349 1 /* MPC8349 specific */
#define CONFIG_TQM834X 1 /* TQM834X board specific */
/* IMMR Base Addres Register, use Freescale default: 0xff400000 */
diff --git a/include/i2c.h b/include/i2c.h
index 97e006163a..a8f729afe0 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -97,7 +97,7 @@ void i2c_reg_write(uchar chip, uchar reg, uchar val);
* Returns: 0 on success, not 0 on failure
*
*/
-int i2c_set_bus_num(uchar bus);
+int i2c_set_bus_num(unsigned int bus);
/*
* i2c_get_bus_num:
@@ -105,7 +105,7 @@ int i2c_set_bus_num(uchar bus);
* Returns index of currently active I2C bus. Zero-based.
*/
-uchar i2c_get_bus_num(void);
+unsigned int i2c_get_bus_num(void);
/*
* i2c_set_bus_speed:
@@ -117,7 +117,7 @@ uchar i2c_get_bus_num(void);
* Returns: 0 on success, not 0 on failure
*
*/
-int i2c_set_bus_speed(int);
+int i2c_set_bus_speed(unsigned int);
/*
* i2c_get_bus_speed:
@@ -125,6 +125,6 @@ int i2c_set_bus_speed(int);
* Returns speed of currently active I2C bus in Hz
*/
-int i2c_get_bus_speed(void);
+unsigned int i2c_get_bus_speed(void);
#endif /* _I2C_H_ */
OpenPOWER on IntegriCloud