tegra124: i2c: Reset the controller when there's an error.

This is the only way to clear the error bits in the controller. Without
clearing them, every future transaction will look like it failed.

BUG=chrome-os-partner:27220
TEST=Built and booted on nyan with the TPM frequency turned up to 400 KHz.
BRANCH=None

Original-Change-Id: Ib654e60ec3039ad9f5f96aa7288d3d877e5c843a
Original-Signed-off-by: Gabe Black <gabeblack@google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/191811
Original-Reviewed-by: Tom Warren <twarren@nvidia.com>
Original-Reviewed-by: Gabe Black <gabeblack@chromium.org>
Original-Commit-Queue: Gabe Black <gabeblack@chromium.org>
Original-Tested-by: Gabe Black <gabeblack@chromium.org>
(cherry picked from commit 7b19a095652f1561590dcca922b9f8c308d7de9d)
Signed-off-by: Marc Jones <marc.jones@se-eng.com>

Change-Id: I301b6694cc521601b618973de891e4ed44c6a97d
Reviewed-on: http://review.coreboot.org/7460
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
This commit is contained in:
Gabe Black
2014-03-26 21:43:53 -07:00
committed by Marc Jones
parent 8253bd912a
commit 6541b283b0
3 changed files with 48 additions and 9 deletions

View File

@@ -18,10 +18,38 @@
*/
#include <soc/addressmap.h>
#include <soc/clock.h>
#include <soc/nvidia/tegra/i2c.h>
void * const tegra_i2c_bases[TEGRA_I2C_BASE_COUNT] = {
(void *)TEGRA_I2C_BASE, (void *)TEGRA_I2C2_BASE,
(void *)TEGRA_I2C3_BASE, (void *)TEGRA_I2C4_BASE,
(void *)TEGRA_I2C5_BASE, (void *)TEGRA_I2C6_BASE
struct tegra_i2c_bus_info tegra_i2c_info[] = {
{
.base = (void *)TEGRA_I2C_BASE,
.reset_bit = CLK_L_I2C1,
.reset_func = &clock_reset_l
},
{
.base = (void *)TEGRA_I2C2_BASE,
.reset_bit = CLK_H_I2C2,
.reset_func = &clock_reset_h
},
{
.base = (void *)TEGRA_I2C3_BASE,
.reset_bit = CLK_U_I2C3,
.reset_func = &clock_reset_u
},
{
.base = (void *)TEGRA_I2C4_BASE,
.reset_bit = CLK_V_I2C4,
.reset_func = &clock_reset_v
},
{
.base = (void *)TEGRA_I2C5_BASE,
.reset_bit = CLK_H_I2C5,
.reset_func = &clock_reset_h
},
{
.base = (void *)TEGRA_I2C6_BASE,
.reset_bit = CLK_X_I2C6,
.reset_func = &clock_reset_x
}
};