Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-25 Thread Andrew Lunn
> > Just tested. Yes the MDIO/MDC lines are also muxed and controlled through > > the same mux bit. > > Alright then the mdio-mux seems appropriate, thanks. Please add a comment that it muxes the MII lines as well. That is not normal for an mdio-mux, so we should document it in the dtsi file. T

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-24 Thread Florian Fainelli
On 08/24/2017 08:41 PM, Chen-Yu Tsai wrote: > On Fri, Aug 25, 2017 at 11:05 AM, Florian Fainelli > wrote: >> >> >> On 08/24/2017 07:54 PM, Chen-Yu Tsai wrote: >>> On Fri, Aug 25, 2017 at 3:59 AM, Florian Fainelli >>> wrote: On 08/24/2017 01:21 AM, Corentin Labbe wrote: > On Wed, Aug

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-24 Thread Chen-Yu Tsai
On Fri, Aug 25, 2017 at 11:05 AM, Florian Fainelli wrote: > > > On 08/24/2017 07:54 PM, Chen-Yu Tsai wrote: >> On Fri, Aug 25, 2017 at 3:59 AM, Florian Fainelli >> wrote: >>> On 08/24/2017 01:21 AM, Corentin Labbe wrote: On Wed, Aug 23, 2017 at 09:31:53AM -0700, Florian Fainelli wrote:

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-24 Thread Florian Fainelli
On 08/24/2017 07:54 PM, Chen-Yu Tsai wrote: > On Fri, Aug 25, 2017 at 3:59 AM, Florian Fainelli > wrote: >> On 08/24/2017 01:21 AM, Corentin Labbe wrote: >>> On Wed, Aug 23, 2017 at 09:31:53AM -0700, Florian Fainelli wrote: On 08/23/2017 12:49 AM, Maxime Ripard wrote: > Hi Florian, >>>

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-24 Thread Chen-Yu Tsai
On Fri, Aug 25, 2017 at 3:59 AM, Florian Fainelli wrote: > On 08/24/2017 01:21 AM, Corentin Labbe wrote: >> On Wed, Aug 23, 2017 at 09:31:53AM -0700, Florian Fainelli wrote: >>> On 08/23/2017 12:49 AM, Maxime Ripard wrote: Hi Florian, On Tue, Aug 22, 2017 at 11:35:01AM -0700, Floria

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-24 Thread Florian Fainelli
On 08/24/2017 01:21 AM, Corentin Labbe wrote: > On Wed, Aug 23, 2017 at 09:31:53AM -0700, Florian Fainelli wrote: >> On 08/23/2017 12:49 AM, Maxime Ripard wrote: >>> Hi Florian, >>> >>> On Tue, Aug 22, 2017 at 11:35:01AM -0700, Florian Fainelli wrote: >>> So I think what you are saying is eithe

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-24 Thread Corentin Labbe
On Thu, Aug 24, 2017 at 10:21:24AM +0200, Corentin Labbe wrote: > On Wed, Aug 23, 2017 at 09:31:53AM -0700, Florian Fainelli wrote: > > On 08/23/2017 12:49 AM, Maxime Ripard wrote: > > > Hi Florian, > > > > > > On Tue, Aug 22, 2017 at 11:35:01AM -0700, Florian Fainelli wrote: > > > So I think

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-24 Thread Corentin Labbe
On Wed, Aug 23, 2017 at 09:31:53AM -0700, Florian Fainelli wrote: > On 08/23/2017 12:49 AM, Maxime Ripard wrote: > > Hi Florian, > > > > On Tue, Aug 22, 2017 at 11:35:01AM -0700, Florian Fainelli wrote: > > So I think what you are saying is either impossible or engineering-wise > > a very

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-24 Thread Maxime Ripard
On Wed, Aug 23, 2017 at 09:31:53AM -0700, Florian Fainelli wrote: > On 08/23/2017 12:49 AM, Maxime Ripard wrote: > > Hi Florian, > > > > On Tue, Aug 22, 2017 at 11:35:01AM -0700, Florian Fainelli wrote: > > So I think what you are saying is either impossible or engineering-wise > > a very

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-23 Thread Florian Fainelli
On 08/23/2017 12:49 AM, Maxime Ripard wrote: > Hi Florian, > > On Tue, Aug 22, 2017 at 11:35:01AM -0700, Florian Fainelli wrote: > So I think what you are saying is either impossible or engineering-wise > a very stupid design, like using an external MAC with a discrete PHY > connected

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-23 Thread Maxime Ripard
Hi Florian, On Tue, Aug 22, 2017 at 11:35:01AM -0700, Florian Fainelli wrote: > >>> So I think what you are saying is either impossible or engineering-wise > >>> a very stupid design, like using an external MAC with a discrete PHY > >>> connected to the internal MAC's MDIO bus, while using the int

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-22 Thread Corentin Labbe
On Tue, Aug 22, 2017 at 11:35:01AM -0700, Florian Fainelli wrote: > On 08/22/2017 11:11 AM, Corentin Labbe wrote: > > On Tue, Aug 22, 2017 at 09:40:24AM -0700, Florian Fainelli wrote: > >> On 08/22/2017 08:39 AM, Chen-Yu Tsai wrote: > >>> On Mon, Aug 21, 2017 at 10:23 PM, Andrew Lunn wrote: >

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-22 Thread Florian Fainelli
On 08/22/2017 11:11 AM, Corentin Labbe wrote: > On Tue, Aug 22, 2017 at 09:40:24AM -0700, Florian Fainelli wrote: >> On 08/22/2017 08:39 AM, Chen-Yu Tsai wrote: >>> On Mon, Aug 21, 2017 at 10:23 PM, Andrew Lunn wrote: > All muxes are mostly always represented the same way afaik, or do you

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-22 Thread Corentin Labbe
On Tue, Aug 22, 2017 at 09:40:24AM -0700, Florian Fainelli wrote: > On 08/22/2017 08:39 AM, Chen-Yu Tsai wrote: > > On Mon, Aug 21, 2017 at 10:23 PM, Andrew Lunn wrote: > >>> All muxes are mostly always represented the same way afaik, or do you > >>> want to simply introduce a new compatible / pro

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-22 Thread Maxime Ripard
On Tue, Aug 22, 2017 at 11:39:22PM +0800, Chen-Yu Tsai wrote: > Now can we please decide on something? We're a week and a half from > the 4.13 release. If mdio-mux is wrong, then we could have two mdio > nodes (internal-mdio & external-mdio). I can only emphasize this. I'm afraid that if we don't

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-22 Thread Florian Fainelli
On 08/22/2017 08:39 AM, Chen-Yu Tsai wrote: > On Mon, Aug 21, 2017 at 10:23 PM, Andrew Lunn wrote: >>> All muxes are mostly always represented the same way afaik, or do you >>> want to simply introduce a new compatible / property? >> >> + mdio-mux { >> + compatible = "allwinn

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-22 Thread Chen-Yu Tsai
On Mon, Aug 21, 2017 at 10:23 PM, Andrew Lunn wrote: >> All muxes are mostly always represented the same way afaik, or do you >> want to simply introduce a new compatible / property? > > + mdio-mux { > + compatible = "allwinner,sun8i-h3-mdio-switch"; > + mdio-pa

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-22 Thread Corentin Labbe
On Mon, Aug 21, 2017 at 04:23:21PM +0200, Andrew Lunn wrote: > > All muxes are mostly always represented the same way afaik, or do you > > want to simply introduce a new compatible / property? > > + mdio-mux { > + compatible = "allwinner,sun8i-h3-mdio-switch"; > +

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-21 Thread Andrew Lunn
> All muxes are mostly always represented the same way afaik, or do you > want to simply introduce a new compatible / property? + mdio-mux { + compatible = "allwinner,sun8i-h3-mdio-switch"; + mdio-parent-bus = <&mdio_parent>; + #address-cells = <1>

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-21 Thread Maxime Ripard
Hi Andrew, On Mon, Aug 21, 2017 at 03:20:15PM +0200, Andrew Lunn wrote: > > With our hardware, and likely Rockchip's as well, the muxed connections > > include the MDIO and MII connections > > Ah, i did not realise the MII was muxed as well. Then i agree, an MDIO > mux is wrong. > > However, ple

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-21 Thread Andrew Lunn
> With our hardware, and likely Rockchip's as well, the muxed connections > include the MDIO and MII connections Ah, i did not realise the MII was muxed as well. Then i agree, an MDIO mux is wrong. However, please try to make the binding not look like an mdio mux. We don't want people misundersta

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-21 Thread Chen-Yu Tsai
On Sun, Aug 20, 2017 at 10:25 PM, Andrew Lunn wrote: >> I think we cannot use mdio-mux-mmioreg since the register for doing >> the switch is in middle of the "System Control" and shared with >> other functions. This is why we use a sycon/regmap for selecting >> the MDIO. > > You could add a mdio-

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-20 Thread Andrew Lunn
> I think we cannot use mdio-mux-mmioreg since the register for doing > the switch is in middle of the "System Control" and shared with > other functions. This is why we use a sycon/regmap for selecting > the MDIO. You could add a mdio-mux-regmap.c. However, it probably need restructuring of the

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-19 Thread Corentin Labbe
On Sat, Aug 19, 2017 at 10:38:36PM +0200, Andrew Lunn wrote: > On Sat, Aug 19, 2017 at 08:50:25PM +0200, Corentin Labbe wrote: > > On Sat, Aug 19, 2017 at 01:05:21AM +0800, Chen-Yu Tsai wrote: > > > On Fri, Aug 18, 2017 at 8:21 PM, Corentin Labbe > > > wrote: > > > > In case of a MDIO switch, the

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-19 Thread Andrew Lunn
On Sat, Aug 19, 2017 at 08:50:25PM +0200, Corentin Labbe wrote: > On Sat, Aug 19, 2017 at 01:05:21AM +0800, Chen-Yu Tsai wrote: > > On Fri, Aug 18, 2017 at 8:21 PM, Corentin Labbe > > wrote: > > > In case of a MDIO switch, the registered MDIO node should be > > > the parent of the PHY. Otherwise o

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-19 Thread Corentin Labbe
On Sat, Aug 19, 2017 at 01:05:21AM +0800, Chen-Yu Tsai wrote: > On Fri, Aug 18, 2017 at 8:21 PM, Corentin Labbe > wrote: > > In case of a MDIO switch, the registered MDIO node should be > > the parent of the PHY. Otherwise of_phy_connect will fail. > > > > Signed-off-by: Corentin Labbe > > --- >

Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-18 Thread Chen-Yu Tsai
On Fri, Aug 18, 2017 at 8:21 PM, Corentin Labbe wrote: > In case of a MDIO switch, the registered MDIO node should be > the parent of the PHY. Otherwise of_phy_connect will fail. > > Signed-off-by: Corentin Labbe > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 ++-- >

[PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac

2017-08-18 Thread Corentin Labbe
In case of a MDIO switch, the registered MDIO node should be the parent of the PHY. Otherwise of_phy_connect will fail. Signed-off-by: Corentin Labbe --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/driver