All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Ryan Chen <ryan_chen@aspeedtech.com>,
	Jeremy Kerr <jk@codeconstruct.com.au>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 1/2] dt-bindings: i2c: Add support for ASPEED i2Cv2
Date: Tue, 21 Feb 2023 10:43:54 +0100	[thread overview]
Message-ID: <6fd971de-19f6-84e4-154f-bd3117483881@linaro.org> (raw)
In-Reply-To: <TYZPR06MB527469EBE6A18B897D2C1F6CF2A59@TYZPR06MB5274.apcprd06.prod.outlook.com>

On 21/02/2023 04:32, Ryan Chen wrote:
> Hello Jeremy,
> 
>> -----Original Message-----
>> From: Jeremy Kerr <jk@codeconstruct.com.au>
>> Sent: Monday, February 20, 2023 7:24 PM
>> To: Ryan Chen <ryan_chen@aspeedtech.com>; Rob Herring
>> <robh+dt@kernel.org>; Krzysztof Kozlowski
>> <krzysztof.kozlowski+dt@linaro.org>; Joel Stanley <joel@jms.id.au>; Andrew
>> Jeffery <andrew@aj.id.au>; Philipp Zabel <p.zabel@pengutronix.de>;
>> openbmc@lists.ozlabs.org; linux-arm-kernel@lists.infradead.org;
>> linux-aspeed@lists.ozlabs.org; linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH v5 1/2] dt-bindings: i2c: Add support for ASPEED i2Cv2
>>
>> Hi Ryan,
>>
>>>>> +  clock-frequency:
>>>>> +    description:
>>>>> +      Desired I2C bus clock frequency in Hz. default 100khz.
>>>>> +
>>>>> +  multi-master:
>>>>> +    type: boolean
>>>>> +    description:
>>>>> +      states that there is another master active on this bus
>>>>
>>>> These are common to all i2c controllers, but I see that
>>>> i2c-controller.yaml doesn't include them (while i2c.text does).
>>>>
>>>> I assume we're OK to include these in the device bindings in the meantime.
>>>> But in that case, you may also want to include the common "smbus-alert"
>>>> property, which you consume in your driver.
>>>>
>>> Since i2c.text have multi-master, smbus-alert. I don't need those two right?
>>
>> Depends whether the maintainers consider i2c.text as part of the schema, I
>> figure. Might be best to get their input on this.
> 
> 
> Yes, I will drop this, also integrate into aspeed,i2c.yaml file.
> 
>>>>> +  timeout:
>>>>> +    type: boolean
>>>>> +    description: Enable i2c bus timeout for master/slave (35ms)
>>>>> +
>>>>> +  byte-mode:
>>>>> +    type: boolean
>>>>> +    description: Force i2c driver use byte mode transmit
>>>>> +
>>>>> +  buff-mode:
>>>>> +    type: boolean
>>>>> +    description: Force i2c driver use buffer mode transmit
>>>>
>>>> These three aren't really a property of the hardware, more of the
>>>> intended driver configuration. Do they really belong in the DT?
>>>>
>>> Sorry, I am confused.
>>> This is hardware controller mode setting for each i2c transfer.
>>> So I add it in property for change different i2c transfer mode.
>>> Is my mis-understand the property setting?
>>
>> It depends what this is configuration is for.
>>
>> Would you set the transfer mode based on the design of the board? Is there
>> something about the physical i2c bus wiring (or some other hardware design
>> choice) that would mean you use one setting over another?
>>
> No, it not depend on board design. It is only for register control for controller transfer behave.

Then DT does not look like suitable place for it. Drop the property.


> The controller support 3 different trigger mode for transfer.
> Byte mode: it means step by step to issue transfer.
> Example i2c read, each step will issue interrupt then driver need trigger for next step.
> Sr (start read) | D | D | D | P
> Buffer mode: it means, the data can prepare into buffer register, then Trigger transfer. So Sr D D D P, only have only 1 interrupt handling. 
> The DMA mode most like with buffer mode, The differ is data prepare in DRAM, than trigger transfer. 
> 
> 
>> On the other hand, if it's just because of OS behaviour, then this doesn't belong
>> in the DT.
>>
>> Maybe to help us understand: why would you ever *not* want DMA mode?
>> Isn't that always preferable?
> In AST SOC i2c design is 16 i2c bus share one dma engine. 
> It can be switch setting by dts setting. Otherwise driver by default probe is DMA mode.

DMA mode is chosen by existence (or lack) of dmas property, isn't it?
Why do you need separate property instead of using the standard one?

Best regards,
Krzysztof


WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Ryan Chen <ryan_chen@aspeedtech.com>,
	Jeremy Kerr <jk@codeconstruct.com.au>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 1/2] dt-bindings: i2c: Add support for ASPEED i2Cv2
Date: Tue, 21 Feb 2023 10:43:54 +0100	[thread overview]
Message-ID: <6fd971de-19f6-84e4-154f-bd3117483881@linaro.org> (raw)
In-Reply-To: <TYZPR06MB527469EBE6A18B897D2C1F6CF2A59@TYZPR06MB5274.apcprd06.prod.outlook.com>

On 21/02/2023 04:32, Ryan Chen wrote:
> Hello Jeremy,
> 
>> -----Original Message-----
>> From: Jeremy Kerr <jk@codeconstruct.com.au>
>> Sent: Monday, February 20, 2023 7:24 PM
>> To: Ryan Chen <ryan_chen@aspeedtech.com>; Rob Herring
>> <robh+dt@kernel.org>; Krzysztof Kozlowski
>> <krzysztof.kozlowski+dt@linaro.org>; Joel Stanley <joel@jms.id.au>; Andrew
>> Jeffery <andrew@aj.id.au>; Philipp Zabel <p.zabel@pengutronix.de>;
>> openbmc@lists.ozlabs.org; linux-arm-kernel@lists.infradead.org;
>> linux-aspeed@lists.ozlabs.org; linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH v5 1/2] dt-bindings: i2c: Add support for ASPEED i2Cv2
>>
>> Hi Ryan,
>>
>>>>> +  clock-frequency:
>>>>> +    description:
>>>>> +      Desired I2C bus clock frequency in Hz. default 100khz.
>>>>> +
>>>>> +  multi-master:
>>>>> +    type: boolean
>>>>> +    description:
>>>>> +      states that there is another master active on this bus
>>>>
>>>> These are common to all i2c controllers, but I see that
>>>> i2c-controller.yaml doesn't include them (while i2c.text does).
>>>>
>>>> I assume we're OK to include these in the device bindings in the meantime.
>>>> But in that case, you may also want to include the common "smbus-alert"
>>>> property, which you consume in your driver.
>>>>
>>> Since i2c.text have multi-master, smbus-alert. I don't need those two right?
>>
>> Depends whether the maintainers consider i2c.text as part of the schema, I
>> figure. Might be best to get their input on this.
> 
> 
> Yes, I will drop this, also integrate into aspeed,i2c.yaml file.
> 
>>>>> +  timeout:
>>>>> +    type: boolean
>>>>> +    description: Enable i2c bus timeout for master/slave (35ms)
>>>>> +
>>>>> +  byte-mode:
>>>>> +    type: boolean
>>>>> +    description: Force i2c driver use byte mode transmit
>>>>> +
>>>>> +  buff-mode:
>>>>> +    type: boolean
>>>>> +    description: Force i2c driver use buffer mode transmit
>>>>
>>>> These three aren't really a property of the hardware, more of the
>>>> intended driver configuration. Do they really belong in the DT?
>>>>
>>> Sorry, I am confused.
>>> This is hardware controller mode setting for each i2c transfer.
>>> So I add it in property for change different i2c transfer mode.
>>> Is my mis-understand the property setting?
>>
>> It depends what this is configuration is for.
>>
>> Would you set the transfer mode based on the design of the board? Is there
>> something about the physical i2c bus wiring (or some other hardware design
>> choice) that would mean you use one setting over another?
>>
> No, it not depend on board design. It is only for register control for controller transfer behave.

Then DT does not look like suitable place for it. Drop the property.


> The controller support 3 different trigger mode for transfer.
> Byte mode: it means step by step to issue transfer.
> Example i2c read, each step will issue interrupt then driver need trigger for next step.
> Sr (start read) | D | D | D | P
> Buffer mode: it means, the data can prepare into buffer register, then Trigger transfer. So Sr D D D P, only have only 1 interrupt handling. 
> The DMA mode most like with buffer mode, The differ is data prepare in DRAM, than trigger transfer. 
> 
> 
>> On the other hand, if it's just because of OS behaviour, then this doesn't belong
>> in the DT.
>>
>> Maybe to help us understand: why would you ever *not* want DMA mode?
>> Isn't that always preferable?
> In AST SOC i2c design is 16 i2c bus share one dma engine. 
> It can be switch setting by dts setting. Otherwise driver by default probe is DMA mode.

DMA mode is chosen by existence (or lack) of dmas property, isn't it?
Why do you need separate property instead of using the standard one?

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-02-21  9:44 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20  6:17 [PATCH v5 0/2] Add ASPEED AST2600 I2Cv2 controller driver Ryan Chen
2023-02-20  6:17 ` Ryan Chen
2023-02-20  6:17 ` [PATCH v5 1/2] dt-bindings: i2c: Add support for ASPEED i2Cv2 Ryan Chen
2023-02-20  6:17   ` Ryan Chen
2023-02-20  8:28   ` Jeremy Kerr
2023-02-20  8:28     ` Jeremy Kerr
2023-02-20  9:50     ` Ryan Chen
2023-02-20  9:50       ` Ryan Chen
2023-02-20 10:43       ` Krzysztof Kozlowski
2023-02-20 10:43         ` Krzysztof Kozlowski
2023-02-20 11:24       ` Jeremy Kerr
2023-02-20 11:24         ` Jeremy Kerr
2023-02-21  3:32         ` Ryan Chen
2023-02-21  3:32           ` Ryan Chen
2023-02-21  9:43           ` Krzysztof Kozlowski [this message]
2023-02-21  9:43             ` Krzysztof Kozlowski
2023-02-22  1:14           ` Dhananjay Phadke
2023-02-22  1:14             ` Dhananjay Phadke
2023-02-22  1:30           ` Jeremy Kerr
2023-02-22  1:30             ` Jeremy Kerr
2023-02-20  8:35   ` Krzysztof Kozlowski
2023-02-20  8:35     ` Krzysztof Kozlowski
2023-02-21  2:43     ` Ryan Chen
2023-02-21  2:43       ` Ryan Chen
2023-02-21  9:40       ` Krzysztof Kozlowski
2023-02-21  9:40         ` Krzysztof Kozlowski
2023-02-21 10:42         ` Ryan Chen
2023-02-21 10:42           ` Ryan Chen
2023-02-21 11:04           ` Krzysztof Kozlowski
2023-02-21 11:04             ` Krzysztof Kozlowski
2023-02-22  2:59             ` Ryan Chen
2023-02-22  2:59               ` Ryan Chen
2023-02-22  8:25               ` Krzysztof Kozlowski
2023-02-22  8:25                 ` Krzysztof Kozlowski
2023-02-22 10:31                 ` Ryan Chen
2023-02-22 10:31                   ` Ryan Chen
2023-02-22 10:35                   ` Krzysztof Kozlowski
2023-02-22 10:35                     ` Krzysztof Kozlowski
2023-02-22 10:47                     ` Ryan Chen
2023-02-22 10:47                       ` Ryan Chen
2023-02-23  9:28                       ` Krzysztof Kozlowski
2023-02-23  9:28                         ` Krzysztof Kozlowski
2023-02-23 10:25                         ` Ryan Chen
2023-02-23 10:25                           ` Ryan Chen
2023-02-20  6:17 ` [PATCH v5 2/2] i2c: aspeed: support ast2600 i2cv2 new register mode driver Ryan Chen
2023-02-20  6:17   ` Ryan Chen
2023-02-20  8:43   ` Krzysztof Kozlowski
2023-02-20  8:43     ` Krzysztof Kozlowski
2023-02-20 10:44     ` Krzysztof Kozlowski
2023-02-20 10:44       ` Krzysztof Kozlowski
2023-02-22  3:36     ` Ryan Chen
2023-02-22  3:36       ` Ryan Chen
2023-02-22  8:28       ` Krzysztof Kozlowski
2023-02-22  8:28         ` Krzysztof Kozlowski
2023-02-23  0:58         ` Ryan Chen
2023-02-23  0:58           ` Ryan Chen
2023-02-23  9:30           ` Krzysztof Kozlowski
2023-02-23  9:30             ` Krzysztof Kozlowski
2023-02-20  8:30 ` [PATCH v5 0/2] Add ASPEED AST2600 I2Cv2 controller driver Krzysztof Kozlowski
2023-02-20  8:30   ` Krzysztof Kozlowski
2023-02-20  9:56   ` Ryan Chen
2023-02-20  9:56     ` Ryan Chen
2023-02-20 10:35     ` Krzysztof Kozlowski
2023-02-20 10:35       ` Krzysztof Kozlowski
2023-02-21  1:12       ` Ryan Chen
2023-02-21  1:12         ` Ryan Chen
2023-02-21  9:38         ` Krzysztof Kozlowski
2023-02-21  9:38           ` Krzysztof Kozlowski

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=6fd971de-19f6-84e4-154f-bd3117483881@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=andrew@aj.id.au \
    --cc=jk@codeconstruct.com.au \
    --cc=joel@jms.id.au \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=ryan_chen@aspeedtech.com \
    /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.