From: Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
To: Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Naveen Krishna Chatradhi
<ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
Yuvaraj Kumar
<yuvaraj.cd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Ben Dooks <ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>,
u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
Mark Brown
<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
Girish Shivananjappa
<girish.shivananjappa-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
bhushan.r-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
sreekumar.c-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
Prashanth G <prashanth.g-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Daniel Kurtz <djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Grant Grundler <grundler-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Rob Landley <rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org>,
"Ben Dooks (embedded platforms)"
<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
Peter Korsgaard
<peter.korsgaard-ob4gmnvZ1/cAvxtiuMwx3w@public.gmane.org>,
Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
Guenter Roeck
<guenter.roeck-IzeFyvvaP7pWk0Htik3J/w@public.gmane.org>,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-doc@v
Subject: Re: [PATCH v1 1/4] i2c: mux: Add i2c-arbitrator 'mux' driver
Date: Wed, 13 Feb 2013 10:45:59 -0800 [thread overview]
Message-ID: <20130213184559.GA29145@quad.lixom.net> (raw)
In-Reply-To: <1360778532-7480-1-git-send-email-dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Hi,
The driver pieces have been reviewed a bit already, but I have a question on
the bindings below.
On Wed, Feb 13, 2013 at 10:02:09AM -0800, Doug Anderson wrote:
> The i2c-arbitrator driver implements the arbitration scheme that the
> Embedded Controller (EC) on the ARM Chromebook expects to use for bus
> multimastering. This i2c-arbitrator driver could also be used in
> other places where standard i2c bus arbitration can't be used and two
> extra GPIOs are available for arbitration.
>
> This driver is based on code that Simon Glass added to the i2c-s3c2410
> driver in the Chrome OS kernel 3.4 tree. The current incarnation as a
> mux driver is as suggested by Grant Likely. See
> <https://patchwork.kernel.org/patch/1877311/> for some history.
>
> Signed-off-by: Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
> Changes in v1: None
>
> .../devicetree/bindings/i2c/i2c-arbitrator.txt | 76 +++++++
> drivers/i2c/muxes/Kconfig | 11 +
> drivers/i2c/muxes/Makefile | 1 +
> drivers/i2c/muxes/i2c-arbitrator.c | 242 +++++++++++++++++++++
> 4 files changed, 330 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/i2c/i2c-arbitrator.txt
> create mode 100644 drivers/i2c/muxes/i2c-arbitrator.c
>
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-arbitrator.txt b/Documentation/devicetree/bindings/i2c/i2c-arbitrator.txt
> new file mode 100644
> index 0000000..bb9cca7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/i2c-arbitrator.txt
> @@ -0,0 +1,76 @@
> +GPIO-based Arbitration
> +======================
> +This uses GPIO lines between the AP (Application Processor) and an attached
> +EC (Embedded Controller) which both want to talk on the same I2C bus as master.
> +
> +The AP and EC each have a 'bus claim' line, which is an output that the
> +other can see. These are both active low, with pull-ups enabled.
> +
> +- AP_CLAIM: output from AP, signalling to the EC that the AP wants the bus
> +- EC_CLAIM: output from EC, signalling to the AP that the EC wants the bus
> +
> +
> +This mechanism is used instead of standard i2c multimaster to avoid some of the
> +subtle driver and silicon bugs that are often present with i2c multimaster.
> +
> +
> +Algorithm:
> +
> +The basic algorithm is to assert your line when you want the bus, then make
> +sure that the other side doesn't want it also. A detailed explanation is best
> +done with an example.
> +
> +Let's say the AP wants to claim the bus. It:
> +1. Asserts AP_CLAIM.
> +2. Waits a little bit for the other side to notice (slew time, say 10
> + microseconds).
> +3. Checks EC_CLAIM. If this is not asserted then the AP has the bus and we are
> + done.
> +4. Otherwise, wait for a few milliseconds and see if EC_CLAIM is released.
> +5. If not, back off, release the claim and wait for a few more milliseconds.
> +6. Go back to 1 (until retry time has expired).
> +
> +
> +Required properties:
> +- compatible: i2c-arbitrator
> +- bus-arbitration-gpios: Two GPIOs to use with the GPIO-based bus
> + arbitration protocol. The first should be an output, and is used to
> + claim the I2C bus for us (AP_CLAIM). The second should be an input and
> + signals that the other side wants to claim the bus (EC_CLAIM).
> +- bus-arbitration-slew-delay-us: microseconds to wait for a GPIO to go high.
> +- bus-arbitration-wait-retry-us: we'll attempt another claim after this many
> + microseconds.
> +- bus-arbitration-wait-free-us: we'll give up after this many microseconds.
> +- Standard I2C mux properties. See mux.txt in this directory.
> +- Single I2C child bus node at reg 0. See mux.txt in this directory.
> +
> +
> +Example:
> + i2c@12CA0000 {
> + compatible = "acme,some-i2c-device";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + };
> +
> + i2c-arbitrator {
> + compatible = "i2c-arbitrator";
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + i2c-parent = <&{/i2c@12CA0000}>;
Why use this custom i2c-parent property? The arbitrator should just be
under the i2c controller in the device tree, and thus parent would be
derived from the topology there.
-Olof
WARNING: multiple messages have this Message-ID (diff)
From: Olof Johansson <olof@lixom.net>
To: Doug Anderson <dianders@chromium.org>
Cc: Wolfram Sang <w.sang@pengutronix.de>,
Simon Glass <sjg@chromium.org>,
Naveen Krishna Chatradhi <ch.naveen@samsung.com>,
Grant Likely <grant.likely@secretlab.ca>,
Yuvaraj Kumar <yuvaraj.cd@gmail.com>,
Ben Dooks <ben.dooks@codethink.co.uk>,
u.kleine-koenig@pengutronix.de,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Girish Shivananjappa <girish.shivananjappa@linaro.org>,
bhushan.r@samsung.com, sreekumar.c@samsung.com,
Prashanth G <prashanth.g@samsung.com>,
Daniel Kurtz <djkurtz@chromium.org>,
Grant Grundler <grundler@chromium.org>,
Rob Herring <rob.herring@calxeda.com>,
Rob Landley <rob@landley.net>,
"Ben Dooks (embedded platforms)" <ben-linux@fluff.org>,
Jean Delvare <khali@linux-fr.org>,
Peter Korsgaard <peter.korsgaard@barco.com>,
Stephen Warren <swarren@nvidia.com>,
Guenter Roeck <guenter.roeck@ericsson.com>,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH v1 1/4] i2c: mux: Add i2c-arbitrator 'mux' driver
Date: Wed, 13 Feb 2013 10:45:59 -0800 [thread overview]
Message-ID: <20130213184559.GA29145@quad.lixom.net> (raw)
In-Reply-To: <1360778532-7480-1-git-send-email-dianders@chromium.org>
Hi,
The driver pieces have been reviewed a bit already, but I have a question on
the bindings below.
On Wed, Feb 13, 2013 at 10:02:09AM -0800, Doug Anderson wrote:
> The i2c-arbitrator driver implements the arbitration scheme that the
> Embedded Controller (EC) on the ARM Chromebook expects to use for bus
> multimastering. This i2c-arbitrator driver could also be used in
> other places where standard i2c bus arbitration can't be used and two
> extra GPIOs are available for arbitration.
>
> This driver is based on code that Simon Glass added to the i2c-s3c2410
> driver in the Chrome OS kernel 3.4 tree. The current incarnation as a
> mux driver is as suggested by Grant Likely. See
> <https://patchwork.kernel.org/patch/1877311/> for some history.
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> ---
> Changes in v1: None
>
> .../devicetree/bindings/i2c/i2c-arbitrator.txt | 76 +++++++
> drivers/i2c/muxes/Kconfig | 11 +
> drivers/i2c/muxes/Makefile | 1 +
> drivers/i2c/muxes/i2c-arbitrator.c | 242 +++++++++++++++++++++
> 4 files changed, 330 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/i2c/i2c-arbitrator.txt
> create mode 100644 drivers/i2c/muxes/i2c-arbitrator.c
>
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-arbitrator.txt b/Documentation/devicetree/bindings/i2c/i2c-arbitrator.txt
> new file mode 100644
> index 0000000..bb9cca7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/i2c-arbitrator.txt
> @@ -0,0 +1,76 @@
> +GPIO-based Arbitration
> +======================
> +This uses GPIO lines between the AP (Application Processor) and an attached
> +EC (Embedded Controller) which both want to talk on the same I2C bus as master.
> +
> +The AP and EC each have a 'bus claim' line, which is an output that the
> +other can see. These are both active low, with pull-ups enabled.
> +
> +- AP_CLAIM: output from AP, signalling to the EC that the AP wants the bus
> +- EC_CLAIM: output from EC, signalling to the AP that the EC wants the bus
> +
> +
> +This mechanism is used instead of standard i2c multimaster to avoid some of the
> +subtle driver and silicon bugs that are often present with i2c multimaster.
> +
> +
> +Algorithm:
> +
> +The basic algorithm is to assert your line when you want the bus, then make
> +sure that the other side doesn't want it also. A detailed explanation is best
> +done with an example.
> +
> +Let's say the AP wants to claim the bus. It:
> +1. Asserts AP_CLAIM.
> +2. Waits a little bit for the other side to notice (slew time, say 10
> + microseconds).
> +3. Checks EC_CLAIM. If this is not asserted then the AP has the bus and we are
> + done.
> +4. Otherwise, wait for a few milliseconds and see if EC_CLAIM is released.
> +5. If not, back off, release the claim and wait for a few more milliseconds.
> +6. Go back to 1 (until retry time has expired).
> +
> +
> +Required properties:
> +- compatible: i2c-arbitrator
> +- bus-arbitration-gpios: Two GPIOs to use with the GPIO-based bus
> + arbitration protocol. The first should be an output, and is used to
> + claim the I2C bus for us (AP_CLAIM). The second should be an input and
> + signals that the other side wants to claim the bus (EC_CLAIM).
> +- bus-arbitration-slew-delay-us: microseconds to wait for a GPIO to go high.
> +- bus-arbitration-wait-retry-us: we'll attempt another claim after this many
> + microseconds.
> +- bus-arbitration-wait-free-us: we'll give up after this many microseconds.
> +- Standard I2C mux properties. See mux.txt in this directory.
> +- Single I2C child bus node at reg 0. See mux.txt in this directory.
> +
> +
> +Example:
> + i2c@12CA0000 {
> + compatible = "acme,some-i2c-device";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + };
> +
> + i2c-arbitrator {
> + compatible = "i2c-arbitrator";
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + i2c-parent = <&{/i2c@12CA0000}>;
Why use this custom i2c-parent property? The arbitrator should just be
under the i2c controller in the device tree, and thus parent would be
derived from the topology there.
-Olof
next prev parent reply other threads:[~2013-02-13 18:45 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-13 18:02 [PATCH v1 1/4] i2c: mux: Add i2c-arbitrator 'mux' driver Doug Anderson
2013-02-13 18:02 ` Doug Anderson
2013-02-13 18:02 ` [PATCH v1 2/4] ARM: dts: Add i2c-arbitrator bus for exynos5250-snow Doug Anderson
2013-02-13 18:02 ` Doug Anderson
2013-02-13 21:04 ` Stephen Warren
2013-02-13 21:04 ` Stephen Warren
2013-02-14 0:38 ` Doug Anderson
2013-02-14 0:38 ` Doug Anderson
2013-02-14 4:42 ` Stephen Warren
2013-02-14 4:42 ` Stephen Warren
2013-02-13 18:02 ` [PATCH v1 3/4] ARM: dts: Add sbs-battery " Doug Anderson
2013-02-13 18:02 ` Doug Anderson
2013-02-13 18:02 ` [PATCH v1 4/4] i2c-mux: i2c_add_mux_adapter() should use -1 for auto bus num Doug Anderson
2013-02-13 18:02 ` Doug Anderson
[not found] ` <1360778532-7480-4-git-send-email-dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-02-13 20:34 ` Guenter Roeck
2013-02-13 20:34 ` Guenter Roeck
2013-02-13 21:09 ` Stephen Warren
2013-02-13 21:09 ` Stephen Warren
[not found] ` <511C00F4.4080708-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-14 7:15 ` Jean Delvare
2013-02-14 7:15 ` Jean Delvare
[not found] ` <1360778532-7480-1-git-send-email-dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-02-13 18:45 ` Olof Johansson [this message]
2013-02-13 18:45 ` [PATCH v1 1/4] i2c: mux: Add i2c-arbitrator 'mux' driver Olof Johansson
2013-02-13 18:49 ` Olof Johansson
2013-02-13 18:49 ` Olof Johansson
2013-02-13 21:02 ` Stephen Warren
2013-02-13 21:02 ` Stephen Warren
[not found] ` <511BFF77.2090202-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-14 0:34 ` Doug Anderson
[not found] ` <CAD=FV=XUEcUx3NGCm+KijRGujECVTSJ9X5fY=arq-4U_RUdxCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-14 0:41 ` Stephen Warren
[not found] ` <511C32B5.20600-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-14 0:54 ` Doug Anderson
[not found] ` <CAD=FV=X=BPQo245kAtPvNUgKjypOYnheYJWcBkq6AA19z99V0w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-14 21:40 ` Doug Anderson
[not found] ` <CAD=FV=UYEqreNbUAxHydmWH+66pOORMB_uFokivLitsavzTcsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-14 23:35 ` Stephen Warren
[not found] ` <511D74DD.9070600-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-14 23:59 ` Doug Anderson
[not found] ` <CAD=FV=Uri9O=iuuUKB9nPKW+6C+A_WsqW0sXB2nS5i7+=NtFKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-15 0:16 ` Stephen Warren
[not found] ` <511D7E5D.1030003-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-15 1:14 ` Doug Anderson
[not found] ` <CAD=FV=USf_YSzW1ZN2NWZKnLk_LPpnFpxRy=AGVyn_YHjRpKyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-15 10:26 ` Mark Brown
2013-02-15 10:24 ` Mark Brown
[not found] ` <20130215102420.GA22283-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2013-02-15 19:56 ` Linus Walleij
[not found] ` <CACRpkdav8WO5yOSLPLtpUCeM41nttrbspRb7YrsqGXJ01ebMhw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-17 16:03 ` Mark Brown
2013-02-15 21:05 ` Doug Anderson
2013-02-14 10:01 ` Linus Walleij
[not found] ` <CACRpkdaUtOe9g7+T=cWPepeGae6RcJ1nTeGc9opTijcYzfMedQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-14 17:37 ` Stephen Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130213184559.GA29145@quad.lixom.net \
--to=olof-nzht3qvonbneowh0uzbu5w@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org \
--cc=bhushan.r-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=girish.shivananjappa-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=grundler-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=guenter.roeck-IzeFyvvaP7pWk0Htik3J/w@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-doc@v \
--cc=peter.korsgaard-ob4gmnvZ1/cAvxtiuMwx3w@public.gmane.org \
--cc=prashanth.g-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=sreekumar.c-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=yuvaraj.cd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.