Patchwork [U-Boot,3/3] Tegra30: I2C: Enable I2C driver on Cardhu

login
register
mail settings
Submitter Tom Warren
Date Dec. 22, 2012, 12:16 a.m.
Message ID <1356135399-28339-4-git-send-email-twarren@nvidia.com>
Download mbox | patch
Permalink /patch/207901/
State Accepted
Delegated to: Tom Warren
Headers show

Comments

Tom Warren - Dec. 22, 2012, 12:16 a.m.
Tested all 5 'buses', i2c probe enumerates device addresses on all
but dev 4 (I2C4) [no devices on that bus on my Cardhu].

Note that this uses the extant tegra_i2c.c driver w/o modification.

Signed-off-by: Tom Warren <twarren@nvidia.com>
---
 include/configs/cardhu.h         |    9 +++++++++
 include/configs/tegra30-common.h |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)
Stephen Warren - Jan. 2, 2013, 8:42 p.m.
On 12/21/2012 05:16 PM, Tom Warren wrote:
> Tested all 5 'buses', i2c probe enumerates device addresses on all
> but dev 4 (I2C4) [no devices on that bus on my Cardhu].
> 
> Note that this uses the extant tegra_i2c.c driver w/o modification.

Aside from previous comments,
Reviewed-by: Stephen Warren <swarren@nvidia.com>

Patch

diff --git a/include/configs/cardhu.h b/include/configs/cardhu.h
index 471df6e..aa725ba 100644
--- a/include/configs/cardhu.h
+++ b/include/configs/cardhu.h
@@ -38,6 +38,15 @@ 
 #define CONFIG_MACH_TYPE		MACH_TYPE_CARDHU
 
 #define CONFIG_BOARD_EARLY_INIT_F
+
+/* I2C */
+#define CONFIG_TEGRA_I2C
+#define CONFIG_SYS_I2C_INIT_BOARD
+#define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_MAX_I2C_BUS		TEGRA_I2C_NUM_CONTROLLERS
+#define CONFIG_SYS_I2C_SPEED		100000
+#define CONFIG_CMD_I2C
+
 #define CONFIG_ENV_IS_NOWHERE
 
 #include "tegra-common-post.h"
diff --git a/include/configs/tegra30-common.h b/include/configs/tegra30-common.h
index 282caec..04517e1 100644
--- a/include/configs/tegra30-common.h
+++ b/include/configs/tegra30-common.h
@@ -83,4 +83,7 @@ 
 
 #define CONFIG_SPL_LDSCRIPT		"$(CPUDIR)/tegra30/u-boot-spl.lds"
 
+/* Total I2C ports on Tegra30 */
+#define TEGRA_I2C_NUM_CONTROLLERS	5
+
 #endif /* _TEGRA30_COMMON_H_ */