u-boot/drivers/i2c
Sam Edwards 250454c59b i2c: mvtwsi: reset controller if stuck in "bus error" state
The MVTWSI controller can act either as a master or slave device. When
acting as a master, the FSM is driven by the CPU. As a slave, the FSM is
driven by the bus directly. In what is (apparently) a safety mechanism,
if the bus transitions our FSM in any improper way, the FSM goes to a
"bus error" state (0x00). I could find no documented or experimental way
to get the FSM out of this state, except for a controller reset.

Since U-Boot only uses the MVTWSI controller as a bus master, this
feature only gets in the way: we do not care what happened on the bus
previously as long as the bus is ready for a new transaction. So, when
trying to start a new transaction, check for this state and reset the
controller if necessary.

Note that this should not be confused with the "deblocking" technique
(used by the `i2c reset` command), which involves pulsing SCL repeatedly
if SDA is found to be held low, in an attempt to force the bus back to
an idle state. This patch only resets the controller in case something
else had previously upset it, and (in principle) results in no
externally-observable change in behavior.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
2023-08-15 06:52:04 +02:00
..
muxes
acpi_i2c.c
acpi_i2c.h
ast2600_i2c.c i2c:aspeed:support ast2600 i2c new register mode driver 2023-02-13 09:57:49 +01:00
ast2600_i2c.h i2c:aspeed:support ast2600 i2c new register mode driver 2023-02-13 09:57:49 +01:00
ast_i2c.c i2c: ast_i2c: Remove SCL direct drive mode 2022-07-19 13:46:28 +02:00
ast_i2c.h
at91_i2c.c
at91_i2c.h
cros_ec_ldo.c
cros_ec_tunnel.c
davinci_i2c.c global: Move remaining CONFIG_SYS_* to CFG_SYS_* 2022-12-05 16:06:08 -05:00
davinci_i2c.h
designware_i2c.c
designware_i2c.h
designware_i2c_pci.c i2c: designware_i2c: remove apparently redundant read of 'i2c, speeds' DT property 2023-04-11 06:43:33 +02:00
exynos_hs_i2c.c
fsl_i2c.c i2c: fsl_i2c: fix m68k transferts 2023-04-11 06:51:56 +02:00
i2c-cdns.c I2C: cdns: Fix broken retry mechanism on arbitration lost. 2023-06-05 06:54:25 +02:00
i2c-cortina.c
i2c-cortina.h
i2c-emul-uclass.c
i2c-gpio.c i2c: i2c-gpio: Correctly handle new {sda, scl}-gpios bindings 2023-07-31 13:50:57 +02:00
i2c-microchip.c i2c: microchip: fix erroneous late ack send 2022-11-14 07:21:58 +01:00
i2c-uclass.c i2c: correct I2C deblock logic 2023-04-11 06:44:39 +02:00
i2c-uniphier-f.c i2c: uniphier-f: correct error recovery 2023-01-06 08:14:19 -05:00
i2c-uniphier.c
i2c-versatile.c
i2c_core.c global: Migrate CONFIG_SYS_I2C_DIRECT_BUS to CFG 2022-12-23 10:15:12 -05:00
ihs_i2c.c
imx_lpi2c.c i2c: imx_lpi2c: Fix misuse the IS_ENABLED for DM clock 2023-04-11 06:45:29 +02:00
intel_i2c.c
iproc_i2c.c
iproc_i2c.h
Kconfig i2c: designware: Add Kconfig for designware_i2c_pci.c 2023-08-02 11:02:32 +08:00
lpc32xx_i2c.c global: Finish CONFIG -> CFG migration 2023-01-20 12:27:24 -05:00
Makefile i2c: designware: Add Kconfig for designware_i2c_pci.c 2023-08-02 11:02:32 +08:00
meson_i2c.c
mtk_i2c.c i2c: mediatek: fix I2C usability for MT7981 2023-08-03 09:40:49 -04:00
mv_i2c.c i2c: Remove CONFIG_I2C_MULTI_BUS 2022-12-22 10:31:48 -05:00
mv_i2c.h
mvtwsi.c i2c: mvtwsi: reset controller if stuck in "bus error" state 2023-08-15 06:52:04 +02:00
mxc_i2c.c i2c: mxc_i2c: Use hex notation for the base address 2023-02-13 09:57:30 +01:00
npcm_i2c.c i2c: nuvoton: renamed the NPCM i2c driver 2022-12-05 06:00:37 +01:00
nx_i2c.c
ocores_i2c.c
octeon_i2c.c global: Finish CONFIG -> CFG migration 2023-01-20 12:27:24 -05:00
omap24xx_i2c.c
omap24xx_i2c.h
qup_i2c.c i2c: Add support for Qualcomm I2C driver 2023-02-10 12:50:00 -05:00
rcar_i2c.c i2c: rcar_i2c: Add R-Car Gen4 support 2023-04-07 17:13:27 +02:00
rcar_iic.c
rk_i2c.c i2c: rockchip: De-initialize the bus after start bit failure 2023-06-05 06:52:46 +02:00
s3c24x0_i2c.c
s3c24x0_i2c.h
sandbox_i2c.c
sh_i2c.c rmobile: Drop CONFIG_SH73A0 and associated code 2023-02-07 14:33:49 -05:00
soft_i2c.c global: Remove unused CONFIG defines 2023-01-20 12:27:06 -05:00
stm32f7_i2c.c i2c: stm32: fix usage of rise/fall device tree properties 2022-09-15 14:59:29 +02:00
sun6i_p2wi.c
sun8i_rsb.c
synquacer_i2c.c
tegra186_bpmp_i2c.c
tegra_i2c.c drivers: use dev_read_addr_ptr when cast to pointer 2023-05-06 17:28:18 +08:00
xilinx_xiic.c