]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
i2c: sh_i2c.c: adjust for SH73A0
authorTetsuyuki Kobayashi <koba@kmckk.co.jp>
Thu, 13 Sep 2012 19:07:58 +0000 (19:07 +0000)
committerHeiko Schocher <hs@denx.de>
Tue, 16 Oct 2012 03:47:20 +0000 (05:47 +0200)
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>
drivers/i2c/sh_i2c.c
include/configs/kzm9g.h

index eced61de0b723ef876ea76f784280b3a65b17e3f..c667a1bdf06de6dc0b1173a7a57c5a091f2fe440 100644 (file)
@@ -135,8 +135,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);
index 0132e9d0df9ccd5862d110bbcc92df5ae4af5052..75b9257e1da90fb168d2a4b4edeaa901be08fed7 100644 (file)
 #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)