[U-Boot] [PATCH 4/4 V4] I2C: mxc_i2c rework

Jason Hui
2011-09-22T02:45:20Z

Hi, Marek,

On Tue, Sep 20, 2011 at 10:35 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> Rewrite the mxc_i2c driver.
> ?* This version is much closer to Linux implementation.
> ?* Fixes IPG_PERCLK being incorrectly used as clock source
> ?* Fixes behaviour of the driver on iMX51
> ?* Clean up coding style a bit ;-)
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Jason Hui <jason.hui@linaro.org>
> ---
> ?drivers/i2c/mxc_i2c.c | ?422 +++++++++++++++++++++++++++++++++----------------
> ?1 files changed, 289 insertions(+), 133 deletions(-)
>
> V2: Use PERCLK as a source.
>
> V3: Remove forgotten unused variables.
>
> V4: Add missing Cc field to commit message
>

Test result on i.mx53evk, it shows that this patch does not work well,
here is the log:

MX53EVK U-Boot > pmic dump 10
PMIC ID: 0x0000ffff [Rev: unknown]

0x00: 0001ffff 00ffffff 0039ffff 0000ffff 00ffffff 0000ffff 0000ffff 0000ffff
0x08: 0000ffff 0000ffff 0000ffff 0000ffff 0000ffff 0000ffff 0000ffff 0040ffff

Without the patch, i2c work well, here is the log:

MX53EVK U-Boot > pmic dump 10
PMIC ID: 0x000045d0 [Rev: 2.0]

0x00: 00015088 00ffffff 00395208 00004081 00fff7ff 0000401c 00000418 000045d0
0x08: 00000000 00000000 00000001 00000000 00000000 00000040 00000000 00400000

The source code is based on top of the latest master and then apply
your v4 patch on top of it.

commit 6dcee21ee3a809d4d99ab168593c0d15ea8d6df3
Author: Marek Vasut <marek.vasut@gmail.com>
Date: Tue Sep 20 04:35:38 2011 +0200

I2C: mxc_i2c rework

Rewrite the mxc_i2c driver.
* This version is much closer to Linux implementation.
* Fixes IPG_PERCLK being incorrectly used as clock source
* Fixes behaviour of the driver on iMX51
* Clean up coding style a bit ;-)

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Jason Hui <jason.hui@linaro.org>

commit 6478021f12db3e248b8b495dde02c51d05a38054
Author: Holger Brunck <holger.brunck@keymile.com>
Date: Tue Sep 20 05:05:55 2011 +0000

km/common: fix bug in IVM mac address access

The MAC address stored in the inventory eeprom begins at offset 1.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Wolfgang Denk <wd@denx.de>

Did I missed something?

Jason