linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jérémie Dautheribes" <jeremie.dautheribes@bootlin.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Andrew Davis" <afd@ti.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Miquèl Raynal" <miquel.raynal@bootlin.com>,
	"Yen-Mei Goh" <yen-mei.goh@keysight.com>,
	"Maxime Chevallier" <maxime.chevallier@bootlin.com>
Subject: Re: [PATCH net-next 1/3] dt-bindings: net: dp83822: support configuring RMII master/slave mode
Date: Thu, 29 Feb 2024 21:46:12 +0100	[thread overview]
Message-ID: <860648fa-11f5-4e0d-ac4e-e81ea111ef31@bootlin.com> (raw)
In-Reply-To: <d14ba685-dc7e-4f99-a21e-bae9f3e6bc79@lunn.ch>

Hi Andrew,

On 26/02/2024 16:28, Andrew Lunn wrote:
> On Thu, Feb 22, 2024 at 11:31:15AM +0100, Jérémie Dautheribes wrote:
>> Add property ti,rmii-mode to support selecting the RMII operation mode
>> between:
>> 	- master mode (PHY operates from a 25MHz clock reference)
>> 	- slave mode (PHY operates from a 50MHz clock reference)
>>
>> If not set, the operation mode is configured by hardware straps.
>>
>> Signed-off-by: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
>> ---
>>   .../devicetree/bindings/net/ti,dp83822.yaml      | 16 ++++++++++++++++
>>   1 file changed, 16 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/net/ti,dp83822.yaml b/Documentation/devicetree/bindings/net/ti,dp83822.yaml
>> index 8f4350be689c..8f23254c0458 100644
>> --- a/Documentation/devicetree/bindings/net/ti,dp83822.yaml
>> +++ b/Documentation/devicetree/bindings/net/ti,dp83822.yaml
>> @@ -80,6 +80,22 @@ properties:
>>              10625, 11250, 11875, 12500, 13125, 13750, 14375, 15000]
>>       default: 10000
>>   
>> +  ti,rmii-mode:
>> +    description: |
>> +       If present, select the RMII operation mode. Two modes are
>> +       available:
>> +         - RMII master, where the PHY operates from a 25MHz clock reference,
>> +         provided by a crystal or a CMOS-level oscillator
>> +         - RMII slave, where the PHY operates from a 50MHz clock reference,
>> +         provided by a CMOS-level oscillator
> 
> What has master and slave got to do with this?
> 
> Sometimes, the MAC provides a clock to the PHY, and all data transfer
> over the RMII bus is timed by that.
> 
> Sometimes, the PHY provides a clock to the MAC, and all data transfer
> over the RMII bus is timed by that.
> 
> Here there is a clear master/slave relationship, who is providing the
> clock, who is consuming the clock. However, what you describe does not
> fit that. Maybe look at other PHY bindings, and copy what they do for
> clocks.

In fact, I hesitated a lot before choosing this master/slave designation 
because of the same reasoning as you. But the TI DP83826 datasheet [1] 
uses this name for two orthogonal yet connected meanings, here's a copy 
of the corresponding § (in section 9.3.10):

"The DP83826 offers two types of RMII operations: RMII Slave and RMII 
Master. In RMII Master operation, the DP83826 operates from either a 
25-MHz CMOS-level oscillator connected to XI pin, a 25-MHz crystal 
connected across XI and XO pins. A 50-MHz output clock referenced from 
DP83826 can be connected to the MAC. In RMII Slave operation, the 
DP83826 operates from a 50-MHz CMOS-level oscillator connected to the XI 
pin and shares the same clock as the MAC. Alternatively, in RMII slave 
mode, the PHY can operate from a 50-MHz clock provided by the Host MAC."

So it seems that in some cases this also fits the master/slave 
relationship you describe.

That said, would you like me to include this description (or some parts) 
in the binding in addition to what I've already written? Or would you 
prefer me to use a more meaningful property name?

BTW, this series has already been merged into the net-next tree, I'm not 
sure what procedure to follow in such cases.


Best regards,

Jérémie

[1] 
https://www.ti.com/lit/ds/symlink/dp83826i.pdf?ts=1708075771406&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FDP83826I

  reply	other threads:[~2024-02-29 20:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 10:31 [PATCH net-next 0/3] Add support for TI DP83826 configuration Jérémie Dautheribes
2024-02-22 10:31 ` [PATCH net-next 1/3] dt-bindings: net: dp83822: support configuring RMII master/slave mode Jérémie Dautheribes
2024-02-22 15:09   ` Krzysztof Kozlowski
2024-02-26 15:28   ` Andrew Lunn
2024-02-29 20:46     ` Jérémie Dautheribes [this message]
2024-02-29 21:23       ` Andrew Lunn
2024-03-04 15:12         ` Jérémie Dautheribes
2024-03-04 16:06           ` Andrew Lunn
2024-03-04 16:31             ` Jérémie Dautheribes
2024-02-22 10:31 ` [PATCH net-next 2/3] net: phy: dp83826: Add support for phy-mode configuration Jérémie Dautheribes
2024-02-23 11:16   ` Maxime Chevallier
2024-02-26 15:34   ` Andrew Lunn
2024-02-22 10:31 ` [PATCH net-next 3/3] net: phy: dp83826: support configuring RMII master/slave operation mode Jérémie Dautheribes
2024-02-26 11:40 ` [PATCH net-next 0/3] Add support for TI DP83826 configuration patchwork-bot+netdevbpf

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=860648fa-11f5-4e0d-ac4e-e81ea111ef31@bootlin.com \
    --to=jeremie.dautheribes@bootlin.com \
    --cc=afd@ti.com \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yen-mei.goh@keysight.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 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).