Patchwork [U-Boot,v3,03/10] i2c: sh_i2c.c: adjust for SH73A0

login
register
mail settings
Submitter Tetsuyuki Kobayashi
Date Sept. 14, 2012, 5:07 a.m.
Message ID <1347599285-11830-4-git-send-email-koba@kmckk.co.jp>
Download mbox | patch
Permalink /patch/183797/
State Accepted
Delegated to: Heiko Schocher
Headers show

Comments

Tetsuyuki Kobayashi - Sept. 14, 2012, 5:07 a.m.
Adjust i2c_raw_read() in sh_i2c.c to work for SH73A0.
After this patch, "i2c md" and "i2c mw" command on U-Boot work properly on KZM-A9-GT board.

Acked-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
---
Changes for v2:
 - none
Changes for v3:
 - none

 drivers/i2c/sh_i2c.c    |    4 ++++
 include/configs/kzm9g.h |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

Patch

diff --git a/drivers/i2c/sh_i2c.c b/drivers/i2c/sh_i2c.c
index 03dfa7a..6c6a141 100644
--- a/drivers/i2c/sh_i2c.c
+++ b/drivers/i2c/sh_i2c.c
@@ -151,8 +151,12 @@  static u8 i2c_raw_read(struct sh_i2c *base, u8 id, u8 reg)
 {
 	u8 ret;
 
+#if defined(CONFIG_SH73A0)
+	i2c_set_addr(base, id, reg, 0);
+#else
 	i2c_set_addr(base, id, reg, 1);
 	udelay(100);
+#endif
 
 	writeb((SH_I2C_ICCR_ICE|SH_I2C_ICCR_RTS|SH_I2C_ICCR_BUSY), &base->iccr);
 	irq_dte(base);
diff --git a/include/configs/kzm9g.h b/include/configs/kzm9g.h
index 8877516..abeab69 100644
--- a/include/configs/kzm9g.h
+++ b/include/configs/kzm9g.h
@@ -164,7 +164,7 @@ 
 #define CONFIG_SYS_I2C_SLAVE    (0x7F)
 #define CONFIG_SH_I2C_DATA_HIGH (4)
 #define CONFIG_SH_I2C_DATA_LOW  (5)
-#define CONFIG_SH_I2C_CLOCK     (41666666)
+#define CONFIG_SH_I2C_CLOCK     (104000000) /* 104 MHz */
 #define CONFIG_SH_I2C_BASE0     (0xE6820000)
 #define CONFIG_SH_I2C_BASE1     (0xE6822000)