projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mpc85xx: Add support for the MPC8536
[oweals/u-boot.git]
/
cpu
/
mpc8260
/
i2c.c
diff --git
a/cpu/mpc8260/i2c.c
b/cpu/mpc8260/i2c.c
index ea97ab85fbc091944b6c4a7707dfa253778751d5..c3af7b6d839ee6f9f21f137beff5c9775d222e95 100644
(file)
--- a/
cpu/mpc8260/i2c.c
+++ b/
cpu/mpc8260/i2c.c
@@
-34,6
+34,8
@@
/* define to enable debug messages */
#undef DEBUG_I2C
/* define to enable debug messages */
#undef DEBUG_I2C
+DECLARE_GLOBAL_DATA_PTR;
+
/* uSec to wait between polls of the i2c */
#define DELAY_US 100
/* uSec to wait for the CPM to start processing the buffer */
/* uSec to wait between polls of the i2c */
#define DELAY_US 100
/* uSec to wait for the CPM to start processing the buffer */
@@
-189,10
+191,10
@@
static int i2c_setrate(int hz, int speed)
if ((diff >= 0) && (diff < bestspeed_diff))
{
if ((diff >= 0) && (diff < bestspeed_diff))
{
- bestspeed_diff = diff ;
- bestspeed_modval = modval;
- bestspeed_brgval = brgval;
- bestspeed_filter = filter;
+ bestspeed_diff = diff ;
+ bestspeed_modval = modval;
+ bestspeed_brgval = brgval;
+ bestspeed_filter = filter;
}
}
}
}
}
}
@@
-213,8
+215,6
@@
static int i2c_setrate(int hz, int speed)
void i2c_init(int speed, int slaveadd)
{
void i2c_init(int speed, int slaveadd)
{
- DECLARE_GLOBAL_DATA_PTR;
-
volatile immap_t *immap = (immap_t *)CFG_IMMR ;
volatile cpm8260_t *cp = (cpm8260_t *)&immap->im_cpm;
volatile i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c;
volatile immap_t *immap = (immap_t *)CFG_IMMR ;
volatile cpm8260_t *cp = (cpm8260_t *)&immap->im_cpm;
volatile i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c;
@@
-242,7
+242,7
@@
void i2c_init(int speed, int slaveadd)
/*
* initialise data in dual port ram:
*
/*
* initialise data in dual port ram:
*
- * dpaddr -> parameter ram (64 bytes)
+ * dpaddr -> parameter ram (64 bytes)
* rbase -> rx BD (NUM_RX_BDS * sizeof(I2C_BD) bytes)
* tbase -> tx BD (NUM_TX_BDS * sizeof(I2C_BD) bytes)
* tx buffer (MAX_TX_SPACE bytes)
* rbase -> rx BD (NUM_RX_BDS * sizeof(I2C_BD) bytes)
* tbase -> tx BD (NUM_TX_BDS * sizeof(I2C_BD) bytes)
* tx buffer (MAX_TX_SPACE bytes)