Marc Jones (marc.jones@se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8145
-gerrit
commit 286f811ba44ba20ededf835b37d25f4ae75532ec Author: Jimmy Zhang jimmzhang@nvidia.com Date: Thu Jun 5 15:20:56 2014 -0700
tegra: i2c: re-init i2c controller after reset
This serves as supplemental patch to chromium CL:197732. After clearing bus, we should also redo controller init (because controller has been reset before bus clear). On the upper layer, upon receiving error return status, it should just retry instead of simply call cpu_reset().
BUG=chrome-os-partner:28323 BRANCH=nyan TEST=Built and tested on nyan and nyan_big.
Original-Change-Id: Ib526bc730cb73ffef8696fc2a6a2769d6e71eb9e Original-Signed-off-by: Jimmy Zhang jimmzhang@nvidia.com Original-Reviewed-on: https://chromium-review.googlesource.com/202784 Original-Reviewed-by: Julius Werner jwerner@chromium.org (cherry picked from commit 06f8917c70ddca88c847d0f15ebe7f286a3f6338) Signed-off-by: Marc Jones marc.jones@se-eng.com
Change-Id: I1d8bc43d730b53fe7f2dad8713831311e96e3984 --- src/soc/nvidia/tegra/i2c.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/src/soc/nvidia/tegra/i2c.c b/src/soc/nvidia/tegra/i2c.c index 26c2559..542d4f0 100644 --- a/src/soc/nvidia/tegra/i2c.c +++ b/src/soc/nvidia/tegra/i2c.c @@ -112,12 +112,14 @@ static int tegra_i2c_send_recv(int bus, int read, "%s: The address was not acknowledged.\n", __func__); info->reset_func(info->reset_bit); + i2c_init(bus); return -1; } else if (transfer_status & I2C_PKT_STATUS_NOACK_DATA) { printk(BIOS_ERR, "%s: The data was not acknowledged.\n", __func__); info->reset_func(info->reset_bit); + i2c_init(bus); return -1; } else if (transfer_status & I2C_PKT_STATUS_ARB_LOST) { printk(BIOS_ERR, @@ -128,6 +130,9 @@ static int tegra_i2c_send_recv(int bus, int read, /* Use Tegra bus clear registers to unlock SDA */ do_bus_clear(bus);
+ /* re-init i2c controller */ + i2c_init(bus); + /* Return w/error, let caller decide what to do */ return -1; }