Re: drivers/of/of_mdio.c needs a small modification

2020-08-30 Thread Adam Rudziński
W dniu 2020-08-30 o 01:16, Andrew Lunn pisze: I meant that with the split description of the mdio node the mdio bus for use in the system would be selected almost automatically. Suppose that I can do the device tree "my way": &fec2 { ...     mdio { phy2 ... }; ... }; &fec1 { ...     mdio { phy1

Re: drivers/of/of_mdio.c needs a small modification

2020-08-29 Thread Andrew Lunn
> I meant that with the split description of the mdio node the mdio bus for > use in the system would be selected almost automatically. Suppose that I can > do the device tree "my way": > &fec2 { > ... >     mdio { phy2 ... }; > ... > }; > &fec1 { > ... >     mdio { phy1 ... }; > ... > }; > This em

Re: drivers/of/of_mdio.c needs a small modification

2020-08-29 Thread Adam Rudziński
W dniu 2020-08-29 o 18:00, Andrew Lunn pisze: This is true assuming that the PHYs are always and forever connected to one specific MDIO bus. This is probably reasonable. Although, in i.MX the MDIO bus of FEC1 and FEC2 shares the pins. In general, they do not. In fact, i don't see how that can wo

Re: drivers/of/of_mdio.c needs a small modification

2020-08-29 Thread Andrew Lunn
> This is true assuming that the PHYs are always and forever connected to one > specific MDIO bus. This is probably reasonable. Although, in i.MX the MDIO > bus of FEC1 and FEC2 shares the pins. In general, they do not. In fact, i don't see how that can work. The FEC drive provides no mutual exclu

Re: drivers/of/of_mdio.c needs a small modification

2020-08-29 Thread Adam Rudziński
W dniu 2020-08-29 o 17:15, Andrew Lunn pisze: The driver would be able to add the new PHYs to the shared MDIO bus by calling of_mdiobus_register_children. Then the device tree looks like this, which is more reasonable in my opinion: &fec2 { (...)     mdio {         (phy for fec2 here)     };

Re: drivers/of/of_mdio.c needs a small modification

2020-08-29 Thread Andrew Lunn
> The driver would be able to add the new PHYs to the shared MDIO bus by > calling of_mdiobus_register_children. Then the device tree looks like this, > which is more reasonable in my opinion: > > &fec2 { > (...) >     mdio { >         (phy for fec2 here) >     }; > (...) > }; > > &fec1 { > (...)

Re: drivers/of/of_mdio.c needs a small modification

2020-08-29 Thread Adam Rudziński
W dniu 2020-08-29 o 05:29, Florian Fainelli pisze: On 8/28/2020 4:14 PM, Adam Rudziński wrote: W dniu 2020-08-29 o 00:53, Andrew Lunn pisze: On Sat, Aug 29, 2020 at 12:34:05AM +0200, Adam Rudziński wrote: Hi Andrew. W dniu 2020-08-29 o 00:28, Andrew Lunn pisze: Hi Adam If kernel has to bri

Re: drivers/of/of_mdio.c needs a small modification

2020-08-28 Thread Florian Fainelli
On 8/28/2020 4:14 PM, Adam Rudziński wrote: W dniu 2020-08-29 o 00:53, Andrew Lunn pisze: On Sat, Aug 29, 2020 at 12:34:05AM +0200, Adam Rudziński wrote: Hi Andrew. W dniu 2020-08-29 o 00:28, Andrew Lunn pisze: Hi Adam If kernel has to bring up two Ethernet interfaces, the processor has

Re: drivers/of/of_mdio.c needs a small modification

2020-08-28 Thread Adam Rudziński
W dniu 2020-08-29 o 00:53, Andrew Lunn pisze: On Sat, Aug 29, 2020 at 12:34:05AM +0200, Adam Rudziński wrote: Hi Andrew. W dniu 2020-08-29 o 00:28, Andrew Lunn pisze: Hi Adam If kernel has to bring up two Ethernet interfaces, the processor has two peripherals with functionality of MACs (in i

Re: drivers/of/of_mdio.c needs a small modification

2020-08-28 Thread Andrew Lunn
On Sat, Aug 29, 2020 at 12:34:05AM +0200, Adam Rudziński wrote: > Hi Andrew. > > W dniu 2020-08-29 o 00:28, Andrew Lunn pisze: > > Hi Adam > > > > > If kernel has to bring up two Ethernet interfaces, the processor has two > > > peripherals with functionality of MACs (in i.MX6ULL these are Fast >

Re: drivers/of/of_mdio.c needs a small modification

2020-08-28 Thread Adam Rudziński
Hi Andrew. W dniu 2020-08-29 o 00:28, Andrew Lunn pisze: Hi Adam If kernel has to bring up two Ethernet interfaces, the processor has two peripherals with functionality of MACs (in i.MX6ULL these are Fast Ethernet Controllers, FECs), but uses a shared MDIO bus, then the kernel first probes one

Re: drivers/of/of_mdio.c needs a small modification

2020-08-28 Thread Andrew Lunn
Hi Adam > If kernel has to bring up two Ethernet interfaces, the processor has two > peripherals with functionality of MACs (in i.MX6ULL these are Fast Ethernet > Controllers, FECs), but uses a shared MDIO bus, then the kernel first probes > one MAC, enables clock for its PHY, probes MDIO bus tryn