All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] RFC: tegra: Avoid using I2C prior to relocation
@ 2013-08-07  5:52 Simon Glass
  2013-08-07 16:20 ` Stephen Warren
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Glass @ 2013-08-07  5:52 UTC (permalink / raw)
  To: u-boot

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.

note:

There are many ways to fix this. I believe this is one. It disables i2c_init()
until relocation is complete. I have been unable to test it so far due to
problems getting my Seaboard to work. I will try another Tegra board, but
send this for comment in the meantime.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 drivers/i2c/tegra_i2c.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c
index 9ac3969..9847cf1 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);
-- 
1.8.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-08-14 16:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-07  5:52 [U-Boot] [PATCH] RFC: tegra: Avoid using I2C prior to relocation Simon Glass
2013-08-07 16:20 ` Stephen Warren
2013-08-07 21:03   ` Simon Glass
2013-08-09 23:17   ` Stephen Warren
2013-08-10  4:03     ` Simon Glass
2013-08-11  1:21       ` Tom Warren
2013-08-13 19:34         ` Simon Glass
2013-08-13 19:42           ` Stephen Warren
2013-08-13 21:12   ` Tom Rini
2013-08-14 15:59     ` Stephen Warren
2013-08-14 16:02       ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.