devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Lars-Peter Clausen <lars@metafoo.de>, Wolfram Sang <wsa@kernel.org>
Cc: 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 1/2] i2c: cadence: Allow to specify the FIFO depth and maximum transfer length
Date: Fri, 17 Feb 2023 10:34:39 +0100	[thread overview]
Message-ID: <08839e77-5b0f-db13-ac7f-c9addc73b7a3@amd.com> (raw)
In-Reply-To: <c26a994e-a004-8706-eb82-ce89b6cbbeb0@metafoo.de>



On 2/16/23 15:12, Lars-Peter Clausen wrote:
> On 2/6/23 00:02, Michal Simek wrote:
>>
>>
>> On 2/6/23 00:02, Lars-Peter Clausen wrote:
>>> The FIFO depth and maximum transfer length are Synthesis configuration
>>> parameters of the Cadence I2C IP. Different SoCs will use different values
>>> for these parameters.
>>>
>>> Currently the driver has the FIFO depth hardcoded to 16 and the maximum
>>> transfer length 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.
>>
>> I think that these are pretty much two patches in one.
>> The first should target transfer length part and second fifo depth part.
> Hm, I'm not sure it is worth separating this out. These two are very tightly 
> related, but I can split it.

thanks

>>
>>>   /**
>>>    * cdns_i2c_probe - Platform registration call
>>>    * @pdev:    Handle to the platform device structure
>>> @@ -1242,6 +1274,7 @@ static int cdns_i2c_probe(struct platform_device *pdev)
>>>       struct cdns_i2c *id;
>>>       int ret, irq;
>>>       const struct of_device_id *match;
>>> +    u32 val;
>>>         id = devm_kzalloc(&pdev->dev, sizeof(*id), GFP_KERNEL);
>>>       if (!id)
>>> @@ -1317,6 +1350,12 @@ static int cdns_i2c_probe(struct platform_device *pdev)
>>>   #endif
>>>       id->ctrl_reg = CDNS_I2C_CR_ACK_EN | CDNS_I2C_CR_NEA | CDNS_I2C_CR_MS;
>>>   +    val = CDNS_I2C_FIFO_DEPTH_DEFAULT;
>>
>> you can remove val completely.
>> id->fifo_depth = CDNS_I2C_FIFO_DEPTH_DEFAULT;
> But only if I make fifo_depth a u32.

No problem for me.

M

      reply	other threads:[~2023-02-17  9:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-05 23:02 [PATCH 1/2] i2c: cadence: Allow to specify the FIFO depth and maximum transfer length Lars-Peter Clausen
2023-02-05 23:02 ` [PATCH 2/2] dt-bindings: i2c: cadence: Document `cdns,fifo-depth` property Lars-Peter Clausen
2023-02-06  7:32   ` Michal Simek
2023-02-06  7:41   ` Krzysztof Kozlowski
2023-02-06 15:20     ` Lars-Peter Clausen
2023-02-06 16:58   ` Rob Herring
2023-02-06  8:02 ` [PATCH 1/2] i2c: cadence: Allow to specify the FIFO depth and maximum transfer length Michal Simek
2023-02-16 14:12   ` Lars-Peter Clausen
2023-02-17  9:34     ` Michal Simek [this message]

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=08839e77-5b0f-db13-ac7f-c9addc73b7a3@amd.com \
    --to=michal.simek@amd.com \
    --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=robh+dt@kernel.org \
    --cc=wsa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).