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: Thu, 9 Jan 2025 08:25:28 -0600 [thread overview]
Message-ID: <c0b653ea-3fe0-4bdb-9681-bf4e3ef1364a@linux.ibm.com> (raw)
In-Reply-To: <8042c67c-04d3-41c0-9e88-8ce99839f70b@lunn.ch>
Hello Andrew,
On 1/9/25 07:21, Andrew Lunn wrote:
> On Thu, Jan 09, 2025 at 10:33:20AM +0000, Jacky Chou wrote:
>> Hi Andrew,
>>
>>>> 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".
>>> O.K, so we have to be careful how we fix this. But the fact they are all equally
>>> broken might help here.
>>>
>>>>> Humm, interesting. Looking at ftgmac100.c, i don't see where you
>>>>> configure the RGMII delays in the MAC?
>>> This is going to be important. How are delays configured if they are not in the
>>> MAC driver?
>> The RGMII delay is adjusted on clk-ast2600 driver. Please refer to the following link.
>> https://github.com/AspeedTech-BMC/linux/blob/f52a0cf7c475dc576482db46759e2d854c1f36e4/drivers/clk/clk-ast2600.c#L1008
> O.K. So in your vendor tree, you have additional DT properties
> mac1-clk-delay, mac2-clk-delay, mac3-clk-delay. Which is fine, you can
> do whatever you want in your vendor tree, it is all open source.
>
> But for mainline, this will not be accepted. We have standard
> properties defined for configuring MAC delays in picoseconds:
>
> rx-internal-delay-ps:
> description:
> RGMII Receive Clock Delay defined in pico seconds. This is used for
> controllers that have configurable RX internal delays. If this
> property is present then the MAC applies the RX delay.
> tx-internal-delay-ps:
> description:
> RGMII Transmit Clock Delay defined in pico seconds. This is used for
> controllers that have configurable TX internal delays. If this
> property is present then the MAC applies the TX delay.
>
>
> You need to use these, and in the MAC driver, not a clock driver. That
> is also part of the issue. Your MAC driver looks correct, it just
> silently passes phy-mode to the PHY just like every other MAC
> driver. But you have some code hidden away in the clock controller
> which adds the delays. If this was in the MAC driver, where it should
> be, this broken behaviour would of been found earlier.
>
> So, looking at mainline, i see where you create a gated clock. But
> what i do not see is where you set the delays.
>
> How does this work in mainline? Is there more hidden code somewhere
> setting the ASPEED_MAC12_CLK_DLY register?
I think the code already exist in the mainline:
https://github.com/torvalds/linux/blob/master/drivers/clk/clk-ast2600.c#L595
It is configuring SCU register in the ast2600 SOC to introduce delays.
The mac is part of the SOC.
Regards,
Ninad
>
> Andrew
next prev parent reply other threads:[~2025-01-09 14:26 UTC|newest]
Thread overview: 29+ 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
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 [this message]
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
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=c0b653ea-3fe0-4bdb-9681-bf4e3ef1364a@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).