Re: [PATCH 3/3] arm64: dts: rockchip: add dts for Ariaboard Photonicat RK3568

Junhao Xie
2024-09-05T18:00:18Z

On 2024/9/5 20:53, Andrew Lunn wrote:
> On Thu, Sep 05, 2024 at 07:17:03PM +0800, Junhao Xie wrote:
>> On 2024/9/5 01:25, Andrew Lunn wrote:
>>>> +&gmac1 {
>> [...]
>>> This has been discussed a few times. You should be using phy-mode
>>> rgmii-id.
>>
>> After I changed phy-mode to rgmii-id, it seemed to work,
>> but it didn't transmit any data.
>> Maybe I made a mistake or should I continue to use phy-mode rgmii?
>
> How did you change the rx_delay and tx_delay?
>
> In general, we want the PHY to add the delay, not the MAC. Most boards
> in Linux do that. But boards using the motocomm PHY have got into a
> cargo cult copy/paste of using the MAC to add the delays.

I have tried rgmii-id with tx_delay/rx_delay 0x38/0x15, or 0x0/0x0,
or directly removed tx_delay/rx_delay, they all didn't transmit data.

I saw in dwmac-rk.c that when using rgmii-id, the tx_delay/rx_delay
properties in dt are ignored?

arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts also
uses YT8521. I added rx-internal-delay-ps and tx-internal-delay-ps
to rgmii_phy1 of mdio1 according to the prompts, and it now works
well using rgmii-id!

&mdio1 {
rgmii_phy1: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0x0>;
rx-internal-delay-ps = <1500>;
tx-internal-delay-ps = <1500>;
};
};

&gmac1 {
[...]
phy-mode = "rgmii-id";
[...]
tx_delay = <0x0>;
rx_delay = <0x0>;
status = "okay";
/* Motorcomm YT8521SC WAN port */
};

Best regards,
Junhao