u-boot-brain/drivers/i2c
Marek Vasut d22643e7e8 i2c: i2c-mxs: Wait for I2C to empty queue
Make sure the I2C write queue is empty before leaving the mxs_i2c_write().
If we start and I2C write and only wait for ACK, the MXS I2C IP block may
enter next operation while still processing the write aftermath internally.
This will in turn disrupt one or more subsequent transfer(s).

A testcase for this issue is as such. This testcase is also interesting because
the first I2C_WRITE which becomes disruptive happens in the 'i2c read' command.
The 'i2c read' command first uses I2C_WRITE to send I2C address of the chip and
then uses I2C_READ to read data from the chip. After this command completes, the
'i2c probe' will use sequence of I2C_WRITE commands to probe the I2C bus. The
problem is that the first I2C_WRITE disrupted the I2C IP block operation and
this sideeffect propagates all the way to this next I2C_WRITE used by the 'i2c
probe' call. The result is the 'i2c probe' receives an ACK on I2C address 0x00,
even if this ACK was owned by the previous I2C_WRITE operation. Note that the
'i2c read' command must read from a valid I2C chip address.

Wrong:
> i2c probe
Valid chip addresses: 50 51
> i2c read 0x50 0x0.2 0x10 0x42000000
> i2c probe
Valid chip addresses: 00 50 51

With this patch
> i2c probe
Valid chip addresses: 50 51
> i2c read 0x50 0x0.2 0x10 0x42000000
> i2c probe
Valid chip addresses: 50 51

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
2014-02-20 06:46:57 +01:00
..
adi_i2c.c blackfin: make i2c driver blackfin independant 2014-02-20 06:46:56 +01:00
bfin-twi_i2c.c blackfin: add spi and i2c specific get clock functions 2014-02-20 06:46:56 +01:00
davinci_i2c.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
designware_i2c.c designware_i2c: Enhance DesignWare I2C driver address support 2014-02-20 06:46:56 +01:00
designware_i2c.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
fsl_i2c.c fsl_i2c: add workaround for the erratum I2C A004447 2013-08-20 11:15:31 +02:00
fti2c010.c i2c: fti2c010: fix compiler warning on paddr[] 2014-01-13 08:18:38 +01:00
fti2c010.h drivers/i2c: Update fti2c010.[ch], i2c_core.c to use SPDX identifiers 2013-07-25 08:51:42 -04:00
i2c_core.c i2c: Fix i2c speed command 2014-01-13 08:17:51 +01:00
Makefile driver:i2c:s3c24x0: adapt driver to new i2c 2013-12-05 07:39:38 +01:00
mv_i2c.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
mv_i2c.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
mvtwsi.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
mxc_i2c.c i2c: mxc: move to new subsystem 2013-10-17 07:20:24 +02:00
mxs_i2c.c i2c: i2c-mxs: Wait for I2C to empty queue 2014-02-20 06:46:57 +01:00
omap24xx_i2c.c arm: omap: i2c: don't zero cnt in i2c_write 2013-12-05 12:25:02 +01:00
omap24xx_i2c.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pca9564_i2c.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
ppc4xx_i2c.c Merge branch 'master' of git://git.denx.de/u-boot-i2c 2013-07-24 09:50:24 -04:00
rcar_i2c.c rcar_i2c: Clear status before start master receive 2014-01-13 08:16:48 +01:00
s3c24x0_i2c.c i2c: samsung: register i2c busses for Exynso5420 and Exynos5250 2013-12-06 07:46:23 +01:00
s3c24x0_i2c.h i2c: s3c24xx: add hsi2c controller support 2013-10-17 07:20:26 +02:00
sh_i2c.c i2c: sh_i2c: Update to new CONFIG_SYS_I2C framework 2013-11-13 06:08:26 +01:00
sh_sh7734_i2c.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
soft_i2c.c i2c: switch from AT91 legacy to ATMEL legacy 2013-11-13 22:13:22 +01:00
tegra_i2c.c i2c: tegra: Add the fifth bus on SoC with more than 4 buses 2013-12-18 10:19:49 -07:00
tsi108_i2c.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
u8500_i2c.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
u8500_i2c.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
zynq_i2c.c i2c: zynq: Add support for the second i2c controller 2014-02-20 06:46:55 +01:00