lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 12 Nov 2021 02:50:07 +0000
From:   Wells Lu 呂芳騰 <wells.lu@...plus.com>
To:     Andrew Lunn <andrew@...n.ch>, Wells Lu <wellslutw@...il.com>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
        Vincent Shih 施錕鴻 <vincent.shih@...plus.com>
Subject: RE: [PATCH v2 1/2] devicetree: bindings: net: Add bindings doc for
 Sunplus SP7021.

Hi,

> > +examples:
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    emac: emac@...08000 {
> > +        compatible = "sunplus,sp7021-emac";
> > +        reg = <0x9c108000 0x400>, <0x9c000280 0x80>;
> > +        reg-names = "emac", "moon5";
> > +        interrupt-parent = <&intc>;
> > +        interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
> > +        clocks = <&clkc 0xa7>;
> > +        resets = <&rstc 0x97>;
> > +        phy-handle1 = <&eth_phy0>;
> > +        phy-handle2 = <&eth_phy1>;
> > +        pinctrl-0 = <&emac_demo_board_v3_pins>;
> > +        pinctrl-names = "default";
> > +        nvmem-cells = <&mac_addr0>, <&mac_addr1>;
> > +        nvmem-cell-names = "mac_addr0", "mac_addr1";
> > +
> > +        mdio {
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +            eth_phy0: ethernet-phy@0 {
> > +                reg = <0>;
> > +                phy-mode = "rmii";
> 
> This is in the wrong place. It is a MAC property. You usually put it next to phy-handle.

Yes, I'll move phy-mode to Ethernet-port next patch.


> > +            };
> > +            eth_phy1: ethernet-phy@1 {
> > +                reg = <1>;
> > +                phy-mode = "rmii";
> > +            };
> > +        };
> 
> I would suggest you structure this differently to make it clear it is a two port switch:
> 
> 	ethernet-ports {
> 		#address-cells = <1>;
>                 #size-cells = <0>;
> 
>                 port@0 {
>                     reg = <0>;
> 		    phy-handle = <&eth_phy0>;
> 		    phy-mode = "rmii";
> 		}
> 
> 		port@1 {
>                     reg = <1>;
> 		    phy-handle = <&eth_phy1>;
> 		    phy-mode = "rmii";
> 		}
> 	}
> 
> 	Andrew

Yes, refer to new example:

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    emac: emac@...08000 {
        compatible = "sunplus,sp7021-emac";
        reg = <0x9c108000 0x400>, <0x9c000280 0x80>;
        reg-names = "emac", "moon5";
        interrupt-parent = <&intc>;
        interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&clkc 0xa7>;
        resets = <&rstc 0x97>;
        pinctrl-0 = <&emac_demo_board_v3_pins>;
        pinctrl-names = "default";
        nvmem-cells = <&mac_addr0>, <&mac_addr1>;
        nvmem-cell-names = "mac_addr0", "mac_addr1";

        ethernet-ports {
            #address-cells = <1>;
            #size-cells = <0>;

            port@0 {
                reg = <0>;
                phy-handle = <&eth_phy0>;
                phy-mode = "rmii";
            };

            port@1 {
                reg = <1>;
                phy-handle = <&eth_phy1>;
                phy-mode = "rmii";
            };
        };

        mdio {
            #address-cells = <1>;
            #size-cells = <0>;

            eth_phy0: ethernet-phy@0 {
                reg = <0>;
            };

            eth_phy1: ethernet-phy@1 {
                reg = <1>;
            };
        };
    };

Is it correct?

Thank you very much for your review.

Powered by blists - more mailing lists