diff options
author | Simon Glass <sjg@chromium.org> | 2013-08-06 22:52:25 -0700 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-08-13 17:11:25 -0400 |
commit | cdce889959c611876690a9f0a3c7ed9aa46189c4 (patch) | |
tree | 9a4d839f17eee43ecab1523b0e9f4bd0985138d8 /drivers/i2c | |
parent | df785a7ffb7197330ec9b281cd149cbf6cec2d37 (diff) |
tegra: Avoid using I2C prior to relocation
Tegra recently moved to the new I2C framework, which sets up I2C prior to
relocation, and prior to calling i2c_init_board(). This causes a crash on
Tegra boards.
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/tegra_i2c.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c index 9ac3969a07..9847cf126b 100644 --- a/drivers/i2c/tegra_i2c.c +++ b/drivers/i2c/tegra_i2c.c @@ -453,6 +453,10 @@ void i2c_init_board(void) static void tegra_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr) { + /* No i2c support prior to relocation */ + if (!(gd->flags & GD_FLG_RELOC)) + return; + /* This will override the speed selected in the fdt for that port */ debug("i2c_init(speed=%u, slaveaddr=0x%x)\n", speed, slaveaddr); i2c_set_bus_speed(speed); |