summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2010-09-17 13:10:37 +0200
committerWolfgang Denk <wd@denx.de>2010-09-19 19:29:52 +0200
commit1724fe9adfed43c92605b139d4a71f2f4a52c734 (patch)
tree26beb413c1df572207770f1f8c43a211a819203e /drivers
parent23090dacd2806b71fe536a5f618f37afb23d5407 (diff)
downloadu-boot-imx-1724fe9adfed43c92605b139d4a71f2f4a52c734.zip
u-boot-imx-1724fe9adfed43c92605b139d4a71f2f4a52c734.tar.gz
u-boot-imx-1724fe9adfed43c92605b139d4a71f2f4a52c734.tar.bz2
i2c, omap24xx: set bus_initialized only after relocation.
Portions of this work were supported by funding from the CE Linux Forum. Signed-off-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/omap24xx_i2c.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index a7c4e69..3febd1f 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -40,6 +40,7 @@ static unsigned int current_bus;
void i2c_init (int speed, int slaveadd)
{
+ DECLARE_GLOBAL_DATA_PTR;
int psc, fsscll, fssclh;
int hsscll = 0, hssclh = 0;
u32 scll, sclh;
@@ -139,7 +140,8 @@ void i2c_init (int speed, int slaveadd)
writew (0xFFFF, &i2c_base->stat);
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)