summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Warren <twarren@nvidia.com>2014-07-02 09:25:35 -0700
committerMarc Jones <marc.jones@se-eng.com>2015-01-09 16:50:37 +0100
commit4a810ba2d66376d78cdcab8fe58af1ac0745caef (patch)
tree008d4dc64982673ad795f04a7b95ca3eb6d64ec5
parent749559b1fbee31395c93fa25f9db708d414d3a79 (diff)
nyan*: I2C: Fix bus clear BC_TERMINATE naming.
In the original fix for the 'Lost arb' we were seeing on Nyan* during reboot stress testing, I had the name of BC_TERMINATE's bit setting wrong. Fix this to use the IMMEDIATE (1) setting. The setting didn't change, just the name. According to Julius this is the optimal setting for bus clear in this instance. Also widened the SCLK_THRESHOLD mask to 8 bits as per spec. BUG=chrome-os-partner:28323 BRANCH=nyan TEST=Tested on nyan. Built for nyan and nyan_big. Original-Change-Id: I19588690924b83431d9f4d3d2eb64f4947849a33 Original-Signed-off-by: Tom Warren <twarren@nvidia.com> Original-Reviewed-on: https://chromium-review.googlesource.com/206409 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> (cherry picked from commit 76e08d0cb0fb87e2c75d3086930f272b645ecf4e) Signed-off-by: Marc Jones <marc.jones@se-eng.com> Change-Id: If187ddf53660feaceab96efe44a3aadad60c43ff Reviewed-on: http://review.coreboot.org/8152 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
-rw-r--r--src/soc/nvidia/tegra/i2c.c4
-rw-r--r--src/soc/nvidia/tegra/i2c.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/soc/nvidia/tegra/i2c.c b/src/soc/nvidia/tegra/i2c.c
index 542d4f0fab..6f9142ca6d 100644
--- a/src/soc/nvidia/tegra/i2c.c
+++ b/src/soc/nvidia/tegra/i2c.c
@@ -37,9 +37,9 @@ static void do_bus_clear(int bus)
// 1. Reset the I2C controller (already done)
// 2. Set the # of clock pulses required (using default of 9)
// 3. Select STOP condition (using default of 1 = STOP)
- // 4. Set TERMINATE condition (1 = THRESHOLD)
+ // 4. Set TERMINATE condition (1 = IMMEDIATE)
bc = read32(&regs->bus_clear_config);
- bc |= I2C_BUS_CLEAR_CONFIG_BC_TERMINATE_THRESHOLD;
+ bc |= I2C_BUS_CLEAR_CONFIG_BC_TERMINATE_IMMEDIATE;
write32(bc, &regs->bus_clear_config);
// 4.1 Set MSTR_CONFIG_LOAD and wait for clear
write32(I2C_CONFIG_LOAD_MSTR_CONFIG_LOAD_ENABLE, &regs->config_load);
diff --git a/src/soc/nvidia/tegra/i2c.h b/src/soc/nvidia/tegra/i2c.h
index 4b1bddd2af..9d7de14a1e 100644
--- a/src/soc/nvidia/tegra/i2c.h
+++ b/src/soc/nvidia/tegra/i2c.h
@@ -115,9 +115,9 @@ enum {
enum {
I2C_BUS_CLEAR_CONFIG_BC_SCLK_THRESHOLD_SHIFT = 16,
I2C_BUS_CLEAR_CONFIG_BC_SCLK_THRESHOLD_MASK =
- 0x7f << I2C_BUS_CLEAR_CONFIG_BC_SCLK_THRESHOLD_SHIFT,
+ 0xff << I2C_BUS_CLEAR_CONFIG_BC_SCLK_THRESHOLD_SHIFT,
I2C_BUS_CLEAR_CONFIG_BC_STOP_COND_STOP = 0x1 << 2,
- I2C_BUS_CLEAR_CONFIG_BC_TERMINATE_THRESHOLD = 0x1 << 1,
+ I2C_BUS_CLEAR_CONFIG_BC_TERMINATE_IMMEDIATE = 0x1 << 1,
I2C_BUS_CLEAR_CONFIG_BC_ENABLE = 0x1 << 0,
I2C_BUS_CLEAR_STATUS_CLEARED = 0x1 << 0,