Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1724575

Re: [PATCH v4 4/5] net: stmmac: dwmac-sun8i: choose internal PHY via phy-is-integrated

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH v4 4/5] net: stmmac: dwmac-sun8i: choose internal PHY via phy-is-integrated
Date 2017-08-31 23:00 +0200
Message-ID <ukEJb-2c8-1@gated-at.bofh.it> (permalink)
References <uiDRf-6Ku-3@gated-at.bofh.it> <uiDRf-6Ku-5@gated-at.bofh.it> <uiQOu-6ua-13@gated-at.bofh.it> <ukE6v-1Vj-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 31, 2017 at 03:18:03PM -0500, Rob Herring wrote:
> On Sat, Aug 26, 2017 at 11:20:51PM +0200, Andrew Lunn wrote:
> > Hi Corentin
> > 
> > I think we have now all agreed this is an mdio-mux, plus it is also an
> > MII mux. We should represent that in device tree. This patchset does
> > this. However, as it is now, the mux structure in DT is ignored. All
> > it does is search for the phy-is-integrated flags and goes on that.
> > 
> > I made the comment that the device tree representation cannot be
> > implemented using an MDIO mux driver, because of driver loading
> > issues.  However, the core of the MDIO mux code is just a library,
> > symbols exported as GPL, free for anything to use.
> > 
> > What i think should happen is the mdio-mux is implemented inside the
> > MAC driver, using the mux-core as a library. The device tree structure
> > of a mix is then reflected within Linux. The mux switch callback is
> > implemented within the MAC driver. So it can reset the MAC when the
> > mux is switched. The 'phy-is-integrated' property is then no longer
> > needed.
> > 
> > I would suggest a binding something like:
> 
> This is looks better to me, but...
>  
> > emac: ethernet@1c0b000 {
> >         compatible = "allwinner,sun8i-h3-emac";
> >         syscon = <&syscon>;
> >         reg = <0x01c0b000 0x104>;
> >         interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
> >         interrupt-names = "macirq";
> >         resets = <&ccu RST_BUS_EMAC>;
> >         reset-names = "stmmaceth";
> >         clocks = <&ccu CLK_BUS_EMAC>;
> >         clock-names = "stmmaceth";
> >         #address-cells = <1>;
> >         #size-cells = <0>;
> > 
> >         phy-handle = <&int_mii_phy>;
> >         phy-mode = "mii";
> >         allwinner,leds-active-low;
> > 
> >         mdio: mdio {
> >                 #address-cells = <1>;
> >                 #size-cells = <0>;
> > 	}
> 
> Why do you need this node still?

Hi Rob
 
It might not be needed, depending on how it is implemented. But:

Documentation/devicetree/bindings/net/mdio-mux.txt

It is normal for an mdio bus mux to have a phandle back to the parent
mdio bus.  Also, i think the stmmac driver will only instantiate the
mdio bus if there is a node for it in the device tree.

     Andrew

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 4/5] net: stmmac: dwmac-sun8i: choose internal PHY via phy-is-integrated Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-08-26 09:40 +0200
  Re: [PATCH v4 4/5] net: stmmac: dwmac-sun8i: choose internal PHY via  phy-is-integrated Andrew Lunn <andrew@lunn.ch> - 2017-08-26 23:30 +0200
    Re: [PATCH v4 4/5] net: stmmac: dwmac-sun8i: choose internal PHY via  phy-is-integrated Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-08-29 10:40 +0200
      Re: [PATCH v4 4/5] net: stmmac: dwmac-sun8i: choose internal PHY via  phy-is-integrated Andrew Lunn <andrew@lunn.ch> - 2017-08-29 16:10 +0200
    Re: [PATCH v4 4/5] net: stmmac: dwmac-sun8i: choose internal PHY via  phy-is-integrated Rob Herring <robh@kernel.org> - 2017-08-31 22:20 +0200
      Re: [PATCH v4 4/5] net: stmmac: dwmac-sun8i: choose internal PHY via  phy-is-integrated Andrew Lunn <andrew@lunn.ch> - 2017-08-31 23:00 +0200
        Re: [PATCH v4 4/5] net: stmmac: dwmac-sun8i: choose internal PHY via phy-is-integrated Rob Herring <robh@kernel.org> - 2017-09-01 16:10 +0200

csiph-web