[U-Boot] [PATCH 2/2] Powerpc/i2c: Force i2c to become bus master out of reset

Heiko Schocher hs at denx.de
Thu Oct 27 08:36:34 CEST 2011


Hello Chang-Ming,

Chang-Ming.Huang at freescale.com wrote:
> From: Jerry Huang <Chang-Ming.Huang at freescale.com>
> 
> It is sometimes necessary to force the I2C module to become the I2C bus master
> out of reset and drive SCL(even though SDA may already be driven,
> which indicates that the bus is busy). This can occur when a system reset
> does not cause all I2C devices to be reset. Thus, SDA can be driven low
> by another I2C device while this I2C module is coming out of reset
> and stays low indefinitely. The following procedure can be used to
> force this I2C module to generate SCL so that the device driving SDA
> can finish its transaction.
> 
> Signed-off-by: Jerry Huang <Chang-Ming.Huang at freescale.com>
> ---
>  drivers/i2c/fsl_i2c.c |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
> index 258be0a..007db70 100644
> --- a/drivers/i2c/fsl_i2c.c
> +++ b/drivers/i2c/fsl_i2c.c
> @@ -252,6 +252,24 @@ i2c_init(int speed, int slaveadd)
>  		writeb(slaveadd << 1, &dev->adr);/* write slave address */
>  		writeb(0x0, &dev->sr);		/* clear status register */
>  		writeb(I2C_CR_MEN, &dev->cr);	/* start I2C controller */
> +
> +		/* Force I2C module to become bus master which can occure when
> +		 * a system reset does not cause all I2C devices to be reset */

Checkpatch doesn't warn, but wrong comment style here, please
change.

[...]

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list