public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Jerry Ray <jerry.ray@microchip.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"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>,
	UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [net-next][PATCH v4] dt-bindings: dsa: Add lan9303 yaml
Date: Sun, 9 Oct 2022 01:56:28 +0300	[thread overview]
Message-ID: <20221008225628.pslsnwilrpvg3xdf@skbuf> (raw)
In-Reply-To: <20221003164624.4823-1-jerry.ray@microchip.com> <20221003164624.4823-1-jerry.ray@microchip.com>

On Mon, Oct 03, 2022 at 11:46:24AM -0500, Jerry Ray wrote:
> ---
> v3->v4:
>  - Addressed v3 community feedback

More specifically?

> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    // Ethernet switch connected via mdio to the host
> +    ethernet {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        phy-handle = <&lan9303switch>;
> +        phy-mode = "rmii";
> +        fixed-link {
> +            speed = <100>;
> +            full-duplex;
> +        };

I see the phy-handle to the switch is inherited from the .txt dt-binding,
but I don't understand it. The switch is an mdio_device, not a phy_device,
so what will this do?

Also, any reasonable host driver will error out if it finds a phy-handle
and a fixed-link in its OF node. So one of phy-handle or fixed-link must
be dropped, they are bogus.

Even better, just stick to the mdio node as root and drop the DSA master
OF node, like other DSA dt-binding examples do. You can have dangling
phandles, so "ethernet = <&ethernet>" below is not an issue.

> +        mdio {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            lan9303switch: switch@0 {
> +                compatible = "smsc,lan9303-mdio";
> +                reg = <0>;
> +                dsa,member = <0 0>;

Redundant, please remove.

> +                ethernet-ports {
> +                    #address-cells = <1>;
> +                    #size-cells = <0>;
> +                        port@0 {
> +                            reg = <0>;
> +                            phy-mode = "rmii";

FWIW, RMII has a MAC mode and a PHY mode. Two RMII interfaces connected
in MAC mode to one another don't work. You'll have problems if you also
have an RMII PHY connected to one of the xMII ports, and you describe
phy-mode = "rmii" for both. There exists a "rev-rmii" phy-mode to denote
an RMII interface working in PHY mode. Wonder if you should be using
that here.

> +                            ethernet = <&ethernet>;
> +                            fixed-link {
> +                                speed = <100>;
> +                                full-duplex;
> +                            };
> +                        };
> +                        port@1 {
> +                            reg = <1>;
> +                            max-speed = <100>;
> +                            label = "lan1";
> +                        };
> +                        port@2 {
> +                            reg = <2>;
> +                            max-speed = <100>;
> +                            label = "lan2";
> +                        };
> +                    };
> +                };
> +            };
> +        };
> +
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    // Ethernet switch connected via i2c to the host
> +    ethernet {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        phy-mode = "rmii";
> +            speed = <100>;
> +        fixed-link {
> +            full-duplex;
> +        };
> +    };

No need for this node.

> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        lan9303: switch@1a {
> +            compatible = "smsc,lan9303-i2c";
> +            reg = <0x1a>;
> +            ethernet-ports {
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +                port@0 {
> +                    reg = <0>;
> +                    phy-mode = "rmii";
> +                    ethernet = <&ethernet>;
> +                    fixed-link {
> +                        speed = <100>;
> +                        full-duplex;
> +                    };
> +                };
> +                port@1 {
> +                    reg = <1>;
> +                    max-speed = <100>;
> +                    label = "lan1";
> +                };
> +                port@2 {
> +                    reg = <2>;
> +                    max-speed = <100>;
> +                    label = "lan2";
> +                };
> +            };
> +        };
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 5d58b55c5ae5..89055ff2838a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -13386,6 +13386,14 @@ L:	netdev@vger.kernel.org
>  S:	Maintained
>  F:	drivers/net/ethernet/microchip/lan743x_*
>  
> +MICROCHIP LAN9303/LAN9354 ETHERNET SWITCH DRIVER
> +M:	Jerry Ray <jerry.ray@microchip.com>
> +M:	UNGLinuxDriver@microchip.com
> +L:	netdev@vger.kernel.org
> +S:	Maintained
> +F:	Documentation/devicetree/bindings/net/dsa/microchip,lan9303.yaml
> +F:	drivers/net/dsa/lan9303*
> +

Separate patch please? Changes to the MAINTAINERS file get applied to
the "net" tree.

>  MICROCHIP LAN966X ETHERNET DRIVER
>  M:	Horatiu Vultur <horatiu.vultur@microchip.com>
>  M:	UNGLinuxDriver@microchip.com
> -- 
> 2.25.1
> 


  parent reply	other threads:[~2022-10-08 22:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03 16:46 [net-next][PATCH v4] dt-bindings: dsa: Add lan9303 yaml Jerry Ray
2022-10-03 17:48 ` Krzysztof Kozlowski
2022-10-05  7:54   ` Krzysztof Kozlowski
2022-10-17 18:33   ` Jerry.Ray
2022-10-18 22:34     ` Krzysztof Kozlowski
2022-10-04 15:52 ` kernel test robot
2022-10-08 22:56 ` Vladimir Oltean [this message]
2022-10-09 15:20   ` Krzysztof Kozlowski
2022-10-09 22:22     ` Vladimir Oltean
2022-10-10 10:23       ` Krzysztof Kozlowski
2022-10-10 10:29         ` Vladimir Oltean
2022-10-17 18:51           ` Jerry.Ray
2022-10-17 19:13             ` Vladimir Oltean
2022-10-17 19:19               ` Jakub Kicinski
2022-10-17 20:00   ` Jerry.Ray
2022-10-17 21:02     ` Vladimir Oltean

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=20221008225628.pslsnwilrpvg3xdf@skbuf \
    --to=olteanv@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jerry.ray@microchip.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=vivien.didelot@gmail.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