]> git.karo-electronics.de Git - karo-tx-uboot.git/commit
i2c: Add a mux for GPIO-based I2C bus arbitration
authorSimon Glass <sjg@chromium.org>
Mon, 3 Aug 2015 14:19:22 +0000 (08:19 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 06:17:13 +0000 (08:17 +0200)
commit2eeea286bfed593099770d7b2813b13980c5fada
tree0cf8e14601aa7bc6af0e7848a4fdf4f20110dbd0
parentfb367f6a5c5afce0df14d18e1ef537320c30579d
i2c: Add a mux for GPIO-based I2C bus arbitration

While I2C supports multi-master buses this is difficult to get right.
The implementation on the master side in software is quite complex.
Clock-stretching and the arbitrary time that an I2C transaction can take
make it difficult to share the bus fairly in the face of high traffic.
When one or more masters can be reset independently part-way through a
transaction it is hard to know the state of the bus.

This driver provides a scheme based on two 'claim' GPIOs, one driven by the
AP (Application Processor, meaning the main CPU) and one driven by the EC
(Embedded Controller, a small CPU aimed at handling system tasks). With
these they can communicate and reliably share the bus. This scheme has
minimal overhead and involves very little code. It is used on snow to
permit the EC and the AP to share access to the main system PMIC and
battery. The scheme can survive reboots by either side without difficulty.
This scheme has been tested in the field with millions of devices.

Since U-Boot runs on the AP, the terminology used is 'our' claim GPIO,
meaning the AP's, and 'their' claim GPIO, meaning the EC's. This terminology
is used by the device tree bindings in Linux also.

Signed-off-by: Simon Glass <sjg@chromium.org>
doc/README.i2c [new file with mode: 0644]
drivers/i2c/muxes/Kconfig
drivers/i2c/muxes/Makefile
drivers/i2c/muxes/i2c-arb-gpio-challenge.c [new file with mode: 0644]