openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
To: Joel Stanley <joel@jms.id.au>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Rob Herring <robh@kernel.org>,
	linux-aspeed <linux-aspeed@lists.ozlabs.org>,
	Wolfram Sang <wsa@the-dreams.de>,
	Andrew Jeffery <andrew@aj.id.au>,
	OpenBMC Maillist <openbmc@lists.ozlabs.org>,
	Brendan Higgins <brendanhiggins@google.com>,
	devicetree <devicetree@vger.kernel.org>,
	Cedric Le Goater <clg@kaod.org>, Tao Ren <taoren@fb.com>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH v2 1/4] dt-bindings: i2c: aspeed: add buffer and DMA mode transfer support
Date: Thu, 28 Jan 2021 11:36:53 -0800	[thread overview]
Message-ID: <1814b8d1-954c-0988-0745-e95129079708@linux.intel.com> (raw)
In-Reply-To: <CACPK8XcZTE=bnCP1-E9PTA09WnXG9Eduwx0dm-QqmQJUDa_OrQ@mail.gmail.com>

Hi Joel

On 1/27/2021 4:06 PM, Joel Stanley wrote:
> On Thu, 14 Jan 2021 at 20:05, Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> wrote:
>>
>> Hi Rob,
>>
>> On 1/14/2021 11:34 AM, Rob Herring wrote:
>>>> -- reg                       : address offset and range of bus
>>>> +- reg                       : Address offset and range of bus registers.
>>>> +
>>>> +                      An additional SRAM buffer address offset and range is
>>>> +                      optional in case of enabling I2C dedicated SRAM for
>>>> +                      buffer mode transfer support. If the optional range
>>>> +                      is defined, buffer mode will be enabled.
>>>> +                      - AST2400
>>>> +                        &i2c0 { reg = <0x40 0x40>, <0x800 0x80>; };
>>>> +                        &i2c1 { reg = <0x80 0x40>, <0x880 0x80>; };
>>>> +                        &i2c2 { reg = <0xc0 0x40>, <0x900 0x80>; };
>>>> +                        &i2c3 { reg = <0x100 0x40>, <0x980 0x80>; };
>>>> +                        &i2c4 { reg = <0x140 0x40>, <0xa00 0x80>; };
>>>> +                        &i2c5 { reg = <0x180 0x40>, <0xa80 0x80>; };
>>>> +                        &i2c6 { reg = <0x1c0 0x40>, <0xb00 0x80>; };
>>>> +                        &i2c7 { reg = <0x300 0x40>, <0xb80 0x80>; };
>>>> +                        &i2c8 { reg = <0x340 0x40>, <0xc00 0x80>; };
>>>> +                        &i2c9 { reg = <0x380 0x40>, <0xc80 0x80>; };
>>>> +                        &i2c10 { reg = <0x3c0 0x40>, <0xd00 0x80>; };
>>>> +                        &i2c11 { reg = <0x400 0x40>, <0xd80 0x80>; };
>>>> +                        &i2c12 { reg = <0x440 0x40>, <0xe00 0x80>; };
>>>> +                        &i2c13 { reg = <0x480 0x40>, <0xe80 0x80>; };
>>>
>>> All this information doesn't need to be in the binding.
>>>
>>> It's also an oddly structured dts file if this is what you are doing...
>>
>> I removed the default buffer mode settings that I added into
>> 'aspeed-g4.dtsi' and 'aspeed-g5.dtsi' in v1 to avoid touching of the
>> default transfer mode setting, but each bus should use its dedicated
>> SRAM buffer range for enabling buffer mode so I added this information
>> at here as overriding examples instead. I thought that binding document
>> is a right place for providing this information but looks like it's not.
>> Any recommended place for it? Is it good enough if I add it just into
>> the commit message?
> 
> I agree with Rob, we don't need this described in the device tree
> (binding or dts). We know what the layout is for a given aspeed
> family, so the driver can have this information hard coded.
> 
> (Correct me if I've misinterpted here Rob)
> 

Makes sense. Will add these settings into the driver module as hard
coded per each bus.

>>
>>>> @@ -17,6 +72,25 @@ Optional Properties:
>>>>    - bus-frequency    : frequency of the bus clock in Hz defaults to 100 kHz when not
>>>>                 specified
>>>>    - multi-master     : states that there is another master active on this bus.
>>>> +- aspeed,dma-buf-size       : size of DMA buffer.
>>>> +                        AST2400: N/A
>>>> +                        AST2500: 2 ~ 4095
>>>> +                        AST2600: 2 ~ 4096
>>>
>>> If based on the SoC, then all this can be implied from the compatible
>>> string.
>>>
>>
>> Please help me to clarify your comment. Should I remove it from here
>> with keeping the driver handling code for each SoC compatible string?
>> Or should I change it like below?
>> aspeed,ast2400-i2c-bus: N/A
>> aspeed,ast2500-i2c-bus: 2 ~ 4095
>> aspeed,ast2600-i2c-bus: 2 ~ 4096
> 
> As above, we know what the buffer size is for the specific soc family,
> so we can hard code the value to expect.
> 
> The downside of this hard coding is it takes away the option of using
> more buffer space for a given master in a system that only enables
> some of the masters. Is this a use case you were considering? If so,
> then we might revisit some of the advice in this thread.
> 

I added flexibility on this setting but it doesn't need to be. I'll add
hard coded setting for the maximum DMA length into the driver as you
suggested. If I add a xfer mode setting in device tree instead, enabling
of DMA can be configured as each bus basis so there would be no concern
I believe. Will submit v3 soon.

Thanks,
Jae

  reply	other threads:[~2021-01-28 19:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12  0:37 [PATCH v2 0/4] i2c: aspeed: Add buffer and DMA modes support Jae Hyun Yoo
2021-01-12  0:37 ` [PATCH v2 1/4] dt-bindings: i2c: aspeed: add buffer and DMA mode transfer support Jae Hyun Yoo
2021-01-14 19:34   ` Rob Herring
2021-01-14 20:05     ` Jae Hyun Yoo
2021-01-28  0:06       ` Joel Stanley
2021-01-28 19:36         ` Jae Hyun Yoo [this message]
2021-02-03 23:03           ` Jae Hyun Yoo
2021-02-09 12:10             ` Joel Stanley
2021-02-09 19:17               ` Jae Hyun Yoo
2021-01-12  0:37 ` [PATCH v2 2/4] ARM: dts: aspeed: modify I2C node to support buffer mode Jae Hyun Yoo
2021-01-12  0:37 ` [PATCH v2 3/4] i2c: aspeed: add buffer mode transfer support Jae Hyun Yoo
2021-01-12  0:37 ` [PATCH v2 4/4] i2c: aspeed: add DMA " Jae Hyun Yoo

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=1814b8d1-954c-0988-0745-e95129079708@linux.intel.com \
    --to=jae.hyun.yoo@linux.intel.com \
    --cc=andrew@aj.id.au \
    --cc=brendanhiggins@google.com \
    --cc=clg@kaod.org \
    --cc=devicetree@vger.kernel.org \
    --cc=joel@jms.id.au \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=robh@kernel.org \
    --cc=taoren@fb.com \
    --cc=wsa@the-dreams.de \
    /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).