From: Wolfram Sang <wsa@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michal Simek <michal.simek@amd.com>,
Shubhrajyoti Datta <Shubhrajyoti.datta@amd.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
linux-i2c@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 3/3] i2c: cadence: Detect maximum transfer size
Date: Wed, 29 Mar 2023 21:19:57 +0200 [thread overview]
Message-ID: <ZCSPXfbfN9/FmLA4@shikoro> (raw)
In-Reply-To: <20230317145441.156880-3-lars@metafoo.de>
[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]
On Fri, Mar 17, 2023 at 07:54:41AM -0700, Lars-Peter Clausen wrote:
> The maximum transfer length is a synthesis configuration parameters of the
> Cadence I2C IP. Different SoCs might use different values for these
> parameters.
>
> Currently the driver has the maximum transfer length hardcoded to 255.
> Trying to use the driver with an IP instance that uses smaller values for
> these will work for short transfers. But longer transfers will fail.
>
> The maximum transfer length can easily be detected at runtime since the
> unused MSBs of the transfer length register are hardwired to 0. Writing
> 0xff and then reading back the value will give the maximum transfer length.
>
> These changes have been tested with
> 1) The Xilinx MPSoC for which this driver was originally written which
> has the previous hardcoded settings of 16 and 255.
> 2) Another instance of the Cadence I2C IP with FIFO depth of 8 and
> maximum transfer length of 16.
>
> Without these changes the latter would fail for I2C transfers longer than
> 16. With the updated driver both work fine even for longer transfers.
>
> Note that the IP core and driver support chaining multiple transfers into a
> single longer transfer using the HOLD bit. So the maximum transfer size is
> not the limit for the length of the I2C transfer, but the limit for how
> much data can be transferred without having to reprogram the control
> registers.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-03-29 19:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-17 14:54 [PATCH v2 1/3] dt-bindings: i2c: cadence: Document `fifo-depth` property Lars-Peter Clausen
2023-03-17 14:54 ` [PATCH v2 2/3] i2c: cadence: Allow to specify the FIFO depth Lars-Peter Clausen
2023-03-20 10:11 ` Michal Simek
2023-03-29 19:19 ` Wolfram Sang
2023-03-17 14:54 ` [PATCH v2 3/3] i2c: cadence: Detect maximum transfer size Lars-Peter Clausen
2023-03-20 10:13 ` Michal Simek
2023-03-29 19:19 ` Wolfram Sang [this message]
2023-03-20 10:13 ` [PATCH v2 1/3] dt-bindings: i2c: cadence: Document `fifo-depth` property Michal Simek
2023-03-21 20:20 ` Rob Herring
2023-03-29 19:19 ` Wolfram Sang
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=ZCSPXfbfN9/FmLA4@shikoro \
--to=wsa@kernel.org \
--cc=Shubhrajyoti.datta@amd.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-i2c@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=robh+dt@kernel.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.