public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Guo Samin <samin.guo@starfivetech.com>
To: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Cc: <linux-riscv@lists.infradead.org>, <netdev@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"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>,
	Emil Renner Berthing <kernel@esmil.dk>,
	Richard Cochran <richardcochran@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Peter Geis <pgwipeout@gmail.com>,
	Yanhong Wang <yanhong.wang@starfivetech.com>
Subject: Re: [PATCH v5 11/12] riscv: dts: starfive: visionfive-2-v1.2a: Add gmac+phy's delay configuration
Date: Wed, 8 Mar 2023 11:01:18 +0800	[thread overview]
Message-ID: <aa404236-9845-3a3a-3327-b3a075b37a32@starfivetech.com> (raw)
In-Reply-To: <CAJM55Z8-65ENJHfSUOTd+FSNx2b-mYF1L64CKT+Gez2jK3Qr2Q@mail.gmail.com>



-------- 原始信息 --------
主题: Re: [PATCH v5 11/12] riscv: dts: starfive: visionfive-2-v1.2a: Add gmac+phy's delay configuration
From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
收件人: Guo Samin <samin.guo@starfivetech.com>
日期: 2023/3/7

> On Tue, 7 Mar 2023 at 02:43, Guo Samin <samin.guo@starfivetech.com> wrote:
>> 在 2023/3/6 21:00:19, Emil Renner Berthing 写道:
>>> On Fri, 3 Mar 2023 at 10:01, Samin Guo <samin.guo@starfivetech.com> wrote:
>>>> v1.2A gmac0 uses motorcomm YT8531(rgmii-id) PHY, and needs delay
>>>> configurations.
>>>>
>>>> v1.2A gmac1 uses motorcomm YT8512(rmii) PHY, and needs to
>>>> switch rx and rx to external clock sources.
>>>>
>>>> Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
>>>> ---
>>>>  .../starfive/jh7110-starfive-visionfive-2-v1.2a.dts | 13 +++++++++++++
>>>>  1 file changed, 13 insertions(+)
>>>>
>>>> diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-v1.2a.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-v1.2a.dts
>>>> index 4af3300f3cf3..205a13d8c8b1 100644
>>>> --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-v1.2a.dts
>>>> +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-v1.2a.dts
>>>> @@ -11,3 +11,16 @@
>>>>         model = "StarFive VisionFive 2 v1.2A";
>>>>         compatible = "starfive,visionfive-2-v1.2a", "starfive,jh7110";
>>>>  };
>>>> +
>>>> +&gmac1 {
>>>> +       phy-mode = "rmii";
>>>> +       assigned-clocks = <&syscrg JH7110_SYSCLK_GMAC1_TX>,
>>>> +                         <&syscrg JH7110_SYSCLK_GMAC1_RX>;
>>>> +       assigned-clock-parents = <&syscrg JH7110_SYSCLK_GMAC1_RMII_RTX>,
>>>> +                                <&syscrg JH7110_SYSCLK_GMAC1_RMII_RTX>;
>>>> +};
>>>> +
>>>> +&phy0 {
>>>> +       rx-internal-delay-ps = <1900>;
>>>> +       tx-internal-delay-ps = <1350>;
>>>> +};
>>>
>>> Here you're not specifying the internal delays for phy1 which means it
>>> defaults to 1950ps for both rx and tx. Is that right or did you mean
>>> to set them to 0 like the v1.3b phy1?
>>
>> Hi, emil, usually, only 1000M (rgmii) needs to configure the delay, and 100M(rmii) does not.
> 
> Ah, I see.
> 
>>> Also your u-boot seems to set what the linux phy driver calls
>>> motorcomm,keep-pll-enabled and motorcomm,auto-sleep-disabled for all
>>> the phys. Did you leave those out on purpose?
>>
>> Hi, Emil, We did configure motorcomm,auto-sleep-disabled for yt8512 in uboot,
>> but Yutai upstream's Linux driver only yt8521/yt8531 supports this property.
> 
> I'm confused. Is Yutai also Frank Sae? Because he is the one who added
> support for the yt8531 upstream.

My fault , Frank Sae is from Motorcomm, also known as Yutai. 
yt8531 ==> Yutai 8531
> 
>> Yt8512 is a Generic PHY driver and does not support the configuration of
>> motorcomm,auto-sleep-disabled and motorcomm,keep-pll-enabled.
> 
> Right phy1 of the 1.2a might use a different phy, but I'm also talking
> about phy0 and the v1.3b which does use the yt8531 right?
Right:
v1.3b: gmac0:yt8531   gmac1:yt8531
v1.2a: gmac0:yt8531   gmac1:yt8512
> 
>> And without configuring these two attributes, vf2-1.2a gmac1 also works normally.
> 
> Yes, but what I'm worried about is that it only works because u-boot
> initialises the PHYs and ethernet may stop working if you're using a
> different bootloader or Linux gains support for resetting the PHYs
> before use.
> 
I have tested that in uboot, use the sd card to start Linux, do not run network programs (do not use uboot to initialize phy and gmac),
and the network works normally in Linux.

Best regards,
Samin

>>
>> Best regards,
>> Samin
>>>
>>>> --
>>>> 2.17.1
>>>>
>>>>
>>>> _______________________________________________
>>>> linux-riscv mailing list
>>>> linux-riscv@lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/linux-riscv
>>
>> --
>> Best regards,
>> Samin

-- 
Best regards,
Samin

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

  reply	other threads:[~2023-03-08  3:02 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03  8:59 [PATCH v5 00/12] Add Ethernet driver for StarFive JH7110 SoC Samin Guo
2023-03-03  8:59 ` [PATCH v5 01/12] dt-bindings: net: snps,dwmac: Add dwmac-5.20 version Samin Guo
2023-03-03  8:59 ` [PATCH v5 02/12] net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string Samin Guo
2023-03-03  8:59 ` [PATCH v5 03/12] dt-bindings: net: snps,dwmac: Add an optional resets single 'ahb' Samin Guo
2023-03-08 21:57   ` Rob Herring
2023-03-09  3:10     ` Guo Samin
2023-03-03  8:59 ` [PATCH v5 04/12] dt-bindings: net: Add support StarFive dwmac Samin Guo
2023-03-08 21:59   ` Rob Herring
2023-03-09  1:26     ` Guo Samin
2023-03-03  8:59 ` [PATCH v5 05/12] riscv: dts: starfive: jh7110: Add ethernet device nodes Samin Guo
2023-03-03 13:45   ` Andrew Lunn
2023-03-06  2:19     ` Guo Samin
2023-03-04 22:57   ` Emil Renner Berthing
2023-03-07  7:50     ` Guo Samin
2023-03-03  8:59 ` [PATCH v5 06/12] net: stmmac: Add glue layer for StarFive JH7110 SoC Samin Guo
2023-03-03 16:18   ` Emil Renner Berthing
2023-03-06  7:15     ` Guo Samin
2023-03-06 12:21       ` Emil Renner Berthing
2023-03-07  7:57         ` Guo Samin
2023-03-10  0:02   ` Emil Renner Berthing
2023-03-10  0:39     ` Emil Renner Berthing
2023-03-10  1:55       ` Guo Samin
2023-03-10  9:03         ` Emil Renner Berthing
2023-03-10 11:13           ` Guo Samin
2023-03-03  8:59 ` [PATCH v5 07/12] dt-bindings: net: starfive,jh7110-dwmac: Add starfive,syscon Samin Guo
2023-03-08 22:03   ` Rob Herring
2023-03-09  1:16     ` Guo Samin
2023-03-03  8:59 ` [PATCH v5 08/12] net: stmmac: starfive_dmac: Add phy interface settings Samin Guo
2023-03-03 13:36   ` Andrew Lunn
2023-03-03 16:50   ` Emil Renner Berthing
2023-03-06  3:06     ` Guo Samin
2023-03-06 12:49       ` Emil Renner Berthing
2023-03-06 13:06         ` Andrew Lunn
2023-03-07  1:50           ` Guo Samin
2023-03-07  2:16         ` Guo Samin
2023-03-03  8:59 ` [PATCH v5 09/12] riscv: dts: starfive: jh7110: Add syscon to support " Samin Guo
2023-03-03  8:59 ` [PATCH v5 10/12] riscv: dts: starfive: visionfive-2-v1.3b: Add gmac+phy's delay configuration Samin Guo
2023-03-03  8:59 ` [PATCH v5 11/12] riscv: dts: starfive: visionfive-2-v1.2a: " Samin Guo
2023-03-06 13:00   ` Emil Renner Berthing
2023-03-07  1:43     ` Guo Samin
2023-03-07 12:40       ` Emil Renner Berthing
2023-03-08  3:01         ` Guo Samin [this message]
2023-03-03  8:59 ` [PATCH v5 12/12] riscv: dts: starfive: visionfive 2: Enable gmac device tree node Samin Guo
2023-03-06 13:04   ` Emil Renner Berthing
2023-03-07  1:21     ` Guo Samin
2023-03-07 12:23       ` Emil Renner Berthing
2023-03-10  8:09 ` [PATCH v5 00/12] Add Ethernet driver for StarFive JH7110 SoC Tommaso Merciai

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=aa404236-9845-3a3a-3327-b3a075b37a32@starfivetech.com \
    --to=samin.guo@starfivetech.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=emil.renner.berthing@canonical.com \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@esmil.dk \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pgwipeout@gmail.com \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=yanhong.wang@starfivetech.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