2022-05-02 23:13:41

by Heiko Stübner

[permalink] [raw]
Subject: Re: [RFC v2 4/4] arm64: dts: rockchip: Add mt7531 dsa node to BPI-R2-Pro board

Am Samstag, 30. April 2022, 15:03:47 CEST schrieb Frank Wunderlich:
> From: Frank Wunderlich <[email protected]>
>
> Add Device Tree node for mt7531 switch connected to gmac0.
>
> Signed-off-by: Frank Wunderlich <[email protected]>
> ---
> v2:
> - drop status=disabled
> ---
> .../boot/dts/rockchip/rk3568-bpi-r2-pro.dts | 48 +++++++++++++++++++
> 1 file changed, 48 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts b/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts
> index ed2f2bd9a016..f0ffbe818170 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts
> @@ -437,6 +437,54 @@ &i2c5 {
> status = "disabled";
> };
>
> +&mdio0 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + switch@0 {
> + compatible = "mediatek,mt7531";
> + reg = <0>;
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@1 {
> + reg = <1>;
> + label = "lan0";
> + };
> +
> + port@2 {
> + reg = <2>;
> + label = "lan1";
> + };
> +
> + port@3 {
> + reg = <3>;
> + label = "lan2";
> + };
> +
> + port@4 {
> + reg = <4>;
> + label = "lan3";
> + };
> +
> + port@5 {
> + reg = <5>;
> + label = "cpu";
> + ethernet = <&gmac0>;
> + phy-mode = "rgmii";
- phy-mode: String, the following values are acceptable for port labeled
"cpu":
If compatible mediatek,mt7530 or mediatek,mt7621 is set,
must be either "trgmii" or "rgmii"
If compatible mediatek,mt7531 is set,
must be either "sgmii", "1000base-x" or "2500base-x"

So I guess the phy-mode needs to change?


Heiko

> +
> + fixed-link {
> + speed = <1000>;
> + full-duplex;
> + pause;
> + };
> + };
> + };
> + };
> +};
> +
> &mdio1 {
> rgmii_phy1: ethernet-phy@0 {
> compatible = "ethernet-phy-ieee802.3-c22";
>





2022-05-03 00:37:53

by Frank Wunderlich

[permalink] [raw]
Subject: Re: [RFC v2 4/4] arm64: dts: rockchip: Add mt7531 dsa node to BPI-R2-Pro board

Am 30. April 2022 16:05:06 MESZ schrieb Heiko Stuebner <[email protected]>:
>Am Samstag, 30. April 2022, 15:03:47 CEST schrieb Frank Wunderlich:

>> --- a/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts
>> +++ b/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts
>> @@ -437,6 +437,54 @@ &i2c5 {
>> status = "disabled";
>> };
>>

>> + port@5 {
>> + reg = <5>;
>> + label = "cpu";
>> + ethernet = <&gmac0>;
>> + phy-mode = "rgmii";
>- phy-mode: String, the following values are acceptable for port
>labeled
> "cpu":
> If compatible mediatek,mt7530 or mediatek,mt7621 is set,
> must be either "trgmii" or "rgmii"
> If compatible mediatek,mt7531 is set,
> must be either "sgmii", "1000base-x" or "2500base-x"
>
>So I guess the phy-mode needs to change?

This results from current (before my cpu-port patches) implementation in driver where cpu-port is fixed to port 6.

On Mt7530 port 6 supports rgmii and trgmii. On mt7531 port6 only supports sgmii (which is basicly 2500base-x). Afaik it does not support 1G. Port 5 on mt7531 supports rgmii or sgmii (dual sgmii mode) but seems not reflected yet in txt.

On thing more to change when converting txt to yaml.

regards Frank