From: Ninad Palsule <ninad@linux.ibm.com>
To: Andrew Lunn <andrew@lunn.ch>, Jacky Chou <jacky_chou@aspeedtech.com>
Cc: "andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
"andrew@codeconstruct.com.au" <andrew@codeconstruct.com.au>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"eajames@linux.ibm.com" <eajames@linux.ibm.com>,
"edumazet@google.com" <edumazet@google.com>,
"joel@jms.id.au" <joel@jms.id.au>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"kuba@kernel.org" <kuba@kernel.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>,
"minyard@acm.org" <minyard@acm.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"openipmi-developer@lists.sourceforge.net"
<openipmi-developer@lists.sourceforge.net>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"ratbert@faraday-tech.com" <ratbert@faraday-tech.com>,
"robh@kernel.org" <robh@kernel.org>
Subject: Re: [PATCH v2 05/10] ARM: dts: aspeed: system1: Add RGMII support
Date: Wed, 8 Jan 2025 16:31:28 -0600 [thread overview]
Message-ID: <b2aec97b-63bc-44ed-9f6b-5052896bf350@linux.ibm.com> (raw)
In-Reply-To: <0c42bbd8-c09d-407b-8400-d69a82f7b248@lunn.ch>
Hello Andrew & Jacky,
On 1/8/25 11:52, Andrew Lunn wrote:
>>> Does the mac0 TX clock have an extra long clock line on the PCB?
>>>
>>> Does the mac1 TX and RX clocks have extra long clock lines on the PCB?
>>>
>>> Anything but rgmii-id is in most cases wrong, so you need a really
>>> good explanation why you need to use something else. Something that
>>> shows you understand what is going on, and why what you have is
>>> correct.
>> Here I'll add some explanation.
>>
>> In our design, we hope the TX and RX RGMII delay are configured by our MAC side.
>> We can control the TX/RX RGMII delay on MAC step by step, it is not a setting to delay to 2 ns.
>> We are not sure the all target PHYs are support for RX internal delay.
>>
>> But ast2600 MAC1/2 delay cell cannot cover range to 2 ns, MAC 3/4 can do that.
>> Therefore, when using ast2600 MAC1/2, please enable the RX internal delay on the PHY side
>> to make up for the part we cannot cover.
>>
>> Summarize our design and we recommend.
>> AST2600 MAC1/2: rgmii-rxid
>> (RGMII with internal RX delay provided by the PHY, the MAC should not add an RX delay in this
>> case)
>> AST2600 MAC3/4: rgmii
>> (RX and TX delays are added by the MAC when required)
>>
>> rgmii and rgmii-rxid are referred from ethernet-controller.yaml file.
> O.K, so you have the meaning of phy-mode wrong. phy-mode effectively
> described the PCB. Does the PCB implement the 2ns delay via extra long
> clock lines or not. If the PCB has long clock lines, phy-mode is
> 'rgmii'. If the PCB does not have long clock lines, 'rgmii-id' is
> used, meaning either the MAC or the PHY needs to add the delays.
>
> The MAC driver is the one that reads the phy-mode from the DT, and
> then it decides what to do. 95% of linux MAC drivers simply pass it
> direct to the PHY. If the phy-mode is 'rgmii', the PHY does nothing,
> because the PCB has added the delays. If it is rgmii-id, it adds
> delays in both directions. This works, because nearly very RGMII PHY
> on the market does support RGMII delays.
>
> There is however a very small number of MAC drivers which do things
> differently. Renesas produced an RDK with a PHY which could not do
> delays in the PHY, and so were forced to do the delays in the
> MAC. Please look at how the ravb driver works. If the PCB does not add
> the delays, rmgii-id, the MAC driver adds the delays. It then masks
> the phy-mode it passes to of_phy_connect() back to 'rgmii', so that
> the PHY does not add any delays. If the PCB did add the delays,
> 'rgmii', the MAC driver does not add delays, and it passed rgmii to
> the PHY driver, and it also does not add delays.
>
> So, your MAC driver is broken. It is not correctly handling the
> phy-mode. First question is, how many boards are there in mainline
> which have broken phy-modes. If this is the first board, we can fix
> the MAC driver. If there are already boards in mainline we have to be
> much more careful when fixing this, so as not to regress boards which
> are already merged.
There are around 11 boards in Aspeed SOC with phy-mode set to "rgmii"
(some of them are mac0&1 and others are mac2&3). "rgmii-rxid" is only mine.
No one in aspeed SOC using "rgmii-id".
>
> Humm, interesting. Looking at ftgmac100.c, i don't see where you
> configure the RGMII delays in the MAC?
>
> Andrew
>
next prev parent reply other threads:[~2025-01-08 22:35 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-08 3:54 [PATCH v2 05/10] ARM: dts: aspeed: system1: Add RGMII support Jacky Chou
2025-01-08 17:52 ` Andrew Lunn
2025-01-08 19:14 ` Ninad Palsule
2025-01-08 20:17 ` Andrew Lunn
2025-01-08 22:31 ` Ninad Palsule [this message]
2025-01-08 23:08 ` Andrew Lunn
2025-01-09 10:33 ` 回覆: " Jacky Chou
2025-01-09 13:21 ` Andrew Lunn
2025-01-09 14:25 ` Ninad Palsule
2025-01-09 14:54 ` Andrew Lunn
2025-01-10 9:15 ` 回覆: " Jacky Chou
2025-01-10 14:04 ` Andrew Lunn
2025-01-10 14:54 ` Ninad Palsule
2025-01-10 15:38 ` Andrew Lunn
2025-01-22 13:07 ` Maxime Chevallier
2025-01-22 13:39 ` Andrew Lunn
2025-01-22 14:05 ` Maxime Chevallier
2025-01-13 6:18 ` 回覆: " Jacky Chou
2025-01-10 14:05 ` Ninad Palsule
2025-01-13 6:22 ` 回覆: " Jacky Chou
2025-01-13 14:26 ` Ninad Palsule
2025-01-13 14:38 ` Andrew Lunn
2025-01-15 2:57 ` 回覆: " Jacky Chou
2025-01-15 3:05 ` Andrew Lunn
2025-01-15 4:22 ` 回覆: " Jacky Chou
2025-01-15 13:30 ` Andrew Lunn
2025-01-20 6:59 ` 回覆: " Jacky Chou
2025-01-09 14:32 ` Ninad Palsule
2025-01-09 14:48 ` Andrew Lunn
-- strict thread matches above, loose matches on Subject: below --
2025-01-07 16:23 [PATCH v2 00/10] DTS updates for system1 BMC Ninad Palsule
2025-01-07 16:23 ` [PATCH v2 05/10] ARM: dts: aspeed: system1: Add RGMII support Ninad Palsule
2025-01-07 17:56 ` Andrew Lunn
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=b2aec97b-63bc-44ed-9f6b-5052896bf350@linux.ibm.com \
--to=ninad@linux.ibm.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@codeconstruct.com.au \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=eajames@linux.ibm.com \
--cc=edumazet@google.com \
--cc=jacky_chou@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minyard@acm.org \
--cc=netdev@vger.kernel.org \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=pabeni@redhat.com \
--cc=ratbert@faraday-tech.com \
--cc=robh@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).