提交 1724fe9a 编写于 作者: H Heiko Schocher 提交者: Wolfgang Denk

i2c, omap24xx: set bus_initialized only after relocation.

Portions of this work were supported by funding from
the CE Linux Forum.
Signed-off-by: NHeiko Schocher <hs@denx.de>
上级 23090dac
...@@ -40,6 +40,7 @@ static unsigned int current_bus; ...@@ -40,6 +40,7 @@ static unsigned int current_bus;
void i2c_init (int speed, int slaveadd) void i2c_init (int speed, int slaveadd)
{ {
DECLARE_GLOBAL_DATA_PTR;
int psc, fsscll, fssclh; int psc, fsscll, fssclh;
int hsscll = 0, hssclh = 0; int hsscll = 0, hssclh = 0;
u32 scll, sclh; u32 scll, sclh;
...@@ -139,7 +140,8 @@ void i2c_init (int speed, int slaveadd) ...@@ -139,7 +140,8 @@ void i2c_init (int speed, int slaveadd)
writew (0xFFFF, &i2c_base->stat); writew (0xFFFF, &i2c_base->stat);
writew (0, &i2c_base->cnt); writew (0, &i2c_base->cnt);
bus_initialized[current_bus] = 1; if (gd->flags & GD_FLG_RELOC)
bus_initialized[current_bus] = 1;
} }
static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value) static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册