From: Anand Moon <linux.amoon@gmail.com>
To: Peter Geis <pgwipeout@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Heiko Stuebner <heiko@sntech.de>, Chukun Pan <amadeus@jmu.edu.cn>,
Michael Riesch <michael.riesch@wolfvision.net>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [linux-next-v2 1/5] arm64: dts: rockchip: Fix gmac phy mode to rgmii on Rock 3A SBC.
Date: Thu, 17 Nov 2022 20:14:16 +0530 [thread overview]
Message-ID: <CANAwSgQZ17j_B2T3+Ompkdb2Fjo9dpddKehZXxUo4GTeC6fvZA@mail.gmail.com> (raw)
In-Reply-To: <CAMdYzYrgtzeP2OL2Vw0pDHQuJDhRbUy3X4xq9+XchgTGB9dqpg@mail.gmail.com>
Hi Peter
On Thu, 17 Nov 2022 at 02:06, Peter Geis <pgwipeout@gmail.com> wrote:
>
> On Wed, Nov 16, 2022 at 3:02 PM Anand Moon <linux.amoon@gmail.com> wrote:
> >
> > On rk356x ethernet phy support reduced media independent interface (RMII)
> > and reduced gigabit media independent interface (RGMII).
> > So set the phy mode to rgmii to support clock delay, also
> > add TX and RX delay for phy-mode.
>
> Controller based clock delay, the various rgmii-id modes (rgmii-txid
> and rgmii-rxid are also valid) apply the delays in the phy. They are
> usually at a fixed amount, but some phys support variable delays.
>
> You want your commit message to accurately describe the problem, such
> as "In rgmii-id mode, the phy on the rock-3a is unreliable due to
> incorrect delays. Switch to rgmii mode in order to handle the delays
> in the controller."
>
> >
> > Fix following warning
> >
> > [ 7.365215] rk_gmac-dwmac fe010000.ethernet: Can not read property: tx_delay.
> > [ 7.365219] rk_gmac-dwmac fe010000.ethernet: set tx_delay to 0x30
> > [ 7.365224] rk_gmac-dwmac fe010000.ethernet: Can not read property: rx_delay.
> > [ 7.365228] rk_gmac-dwmac fe010000.ethernet: set rx_delay to 0x10
>
> I've been meaning to make this a dev_debug message, because in the
> various rgmii-id modes it is feasible for these to be non-existent in
> the device-tree. In rgmii-id mode these are disabled, no matter what
> they are set to in the dt.
As per the public datasheet share by Radxa below
[0] https://dl.radxa.com/rock3/docs/hw/datasheet/RTL8211F-CG-Datasheet.pdf
This Ethernet controller supports RGMII mode.
>
> >
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> > ---
> > V2: Fix commit message and added the RX and TX clock delay.
> > ---
> > arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
> > index ea74ba32fbbd..e1c75532dcee 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
> > +++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
> > @@ -253,13 +253,16 @@ &gmac1 {
> > assigned-clock-rates = <0>, <125000000>;
> > clock_in_out = "output";
> > phy-handle = <&rgmii_phy1>;
> > - phy-mode = "rgmii-id";
> > + phy-mode = "rgmii";
> > pinctrl-names = "default";
> > pinctrl-0 = <&gmac1m1_miim
> > &gmac1m1_tx_bus2
> > &gmac1m1_rx_bus2
> > &gmac1m1_rgmii_clk
> > &gmac1m1_rgmii_bus>;
> > +
> > + tx_delay = <0x4f>;
> > + rx_delay = <0x26>;
>
> These are pretty far off from the default, have you verified the upper
> and lower bounds for the rock-3a? These should be roughly in the
> middle of that range.
>
No I have not tested this way but as per the datasheet, it supports
TXDLY Add 2ns delay to RXC for RXD latching (via 4.7k-ohm to DVDD_RG)
RXDLY Add 2ns delay to RXC for RXD latching (via 4.7k-ohm to DVDD_RG)
I feel I should ignore the above warning and add it below.
rx-internal-delay-ps = <2000>;
tx-internal-delay-ps = <2000>;
Thanks
-Anand
> > status = "okay";
> > };
> >
> > --
> > 2.38.1
> >
next prev parent reply other threads:[~2022-11-17 14:45 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20221116200150.4657-1-linux.amoon@gmail.com>
2022-11-16 20:01 ` [linux-next-v2 1/5] arm64: dts: rockchip: Fix gmac phy mode to rgmii on Rock 3A SBC Anand Moon
2022-11-16 20:36 ` Peter Geis
2022-11-17 14:44 ` Anand Moon [this message]
2022-11-18 7:03 ` Michael Riesch
2022-11-18 9:34 ` Anand Moon
2022-11-18 18:13 ` Peter Geis
2022-11-22 14:19 ` Anand Moon
2022-11-22 22:34 ` (subset) " Heiko Stuebner
2022-11-16 20:01 ` [linux-next-v2 2/5] arm64: dts: rockchip: Add support of external clock to ethernet node " Anand Moon
2022-11-22 11:18 ` Michael Riesch
2022-11-23 13:00 ` Anand Moon
2022-11-23 13:47 ` Heiko Stuebner
2022-11-16 20:01 ` [linux-next-v2 3/5] arm64: dts: rockchip: Add support of regulator for " Anand Moon
2022-11-22 11:23 ` Michael Riesch
2022-11-16 20:01 ` [linux-next-v2 4/5] arm64: dts: rockchip: Add support of interrupt to " Anand Moon
2022-11-22 16:10 ` Michael Riesch
2022-11-23 13:00 ` Anand Moon
2022-11-16 20:01 ` Anand Moon
2022-11-16 20:01 ` [linux-next-v2 5/5] arm64: dts: rockchip: Add missing of ethernet-phy-id to reset the phy " Anand Moon
2022-11-16 20:46 ` Peter Geis
2022-11-17 5:57 ` Anand Moon
2022-11-17 10:54 ` Robin Murphy
2022-11-17 14:55 ` Anand Moon
2022-11-17 19:10 ` Peter Geis
2022-11-22 14:20 ` Anand Moon
2022-11-22 16:46 ` Michael Riesch
2022-12-07 4:29 ` Anand Moon
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=CANAwSgQZ17j_B2T3+Ompkdb2Fjo9dpddKehZXxUo4GTeC6fvZA@mail.gmail.com \
--to=linux.amoon@gmail.com \
--cc=amadeus@jmu.edu.cn \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=michael.riesch@wolfvision.net \
--cc=pgwipeout@gmail.com \
--cc=robh+dt@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).