mbox series

[0/6] arm64: add ethernet to orange pi 3

Message ID 20220509074857.195302-1-clabbe@baylibre.com (mailing list archive)
Headers show
Series arm64: add ethernet to orange pi 3 | expand

Message

Corentin LABBE May 9, 2022, 7:48 a.m. UTC
Hello

2 sunxi board still does not have ethernet working, orangepi 1+ and
orangepi 3.
This is due to the fact thoses boards have a PHY which need 2 regulators.

A first attempt was made to support them was made by adding support in
stmmac driver:
https://lore.kernel.org/lkml/20190820145343.29108-6-megous@megous.com/
Proposal rejected, since regulators need to be handled by the PHY core.

This serie try to handle this.

This serie was tested on whole range of board and PHY architecture:
- internal PHY
  * sun8i-h3-orangepi-pc
- external PHY
  * sun50i-h6-pine-h64
  * sun8i-r40-bananapi-m2-ultra
  * sun8i-a83t-bananapi-m3
  * sun50i-a64-bananapi-m64
  * sun50i-h6-orangepi-3
  * sun50i-h5-nanopi-neo-plus2

The resume/suspend of PHY was tested.

Regards

Corentin Labbe (5):
  phy: handle optional regulator for PHY
  net: stmmac: dwmac-sun8i: remove regulator
  dt-bindings: net: Add documentation for phy-supply
  ARM: dts: sunxi: move phy regulator in PHY node
  arm64: dts: allwinner: move phy regulator in PHY node

Ondřej Jirman (1):
  arm64: dts: allwinner: orange-pi-3: Enable ethernet

 .../devicetree/bindings/net/ethernet-phy.yaml | 10 +++++
 arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts  |  2 +-
 .../boot/dts/sun8i-a83t-cubietruck-plus.dts   |  2 +-
 arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts |  2 +-
 arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts      |  2 +-
 arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts  |  2 +-
 .../arm/boot/dts/sun8i-h3-orangepi-plus2e.dts |  2 +-
 arch/arm/boot/dts/sun8i-h3-zeropi.dts         |  2 +-
 .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts  |  2 +-
 arch/arm/boot/dts/sun8i-r40-oka40i-c.dts      |  2 +-
 .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  |  2 +-
 arch/arm/boot/dts/sun9i-a80-cubieboard4.dts   |  2 +-
 arch/arm/boot/dts/sun9i-a80-optimus.dts       |  2 +-
 arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi |  2 +-
 .../dts/allwinner/sun50i-a64-bananapi-m64.dts |  2 +-
 .../dts/allwinner/sun50i-a64-nanopi-a64.dts   |  2 +-
 .../sun50i-a64-oceanic-5205-5inmfd.dts        |  2 +-
 .../dts/allwinner/sun50i-a64-olinuxino.dts    |  2 +-
 .../dts/allwinner/sun50i-a64-orangepi-win.dts |  2 +-
 .../boot/dts/allwinner/sun50i-a64-pine64.dts  |  2 +-
 .../allwinner/sun50i-a64-sopine-baseboard.dts |  2 +-
 .../sun50i-h5-libretech-all-h5-cc.dts         |  2 +-
 .../allwinner/sun50i-h5-nanopi-neo-plus2.dts  |  2 +-
 .../dts/allwinner/sun50i-h5-nanopi-neo2.dts   |  2 +-
 .../dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts |  2 +-
 .../dts/allwinner/sun50i-h5-orangepi-pc2.dts  |  2 +-
 .../allwinner/sun50i-h5-orangepi-prime.dts    |  2 +-
 .../sun50i-h5-orangepi-zero-plus.dts          |  2 +-
 .../dts/allwinner/sun50i-h6-beelink-gs1.dts   |  2 +-
 .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 38 +++++++++++++++++++
 .../allwinner/sun50i-h6-pine-h64-model-b.dts  |  8 ++--
 .../boot/dts/allwinner/sun50i-h6-pine-h64.dts |  2 +-
 .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 37 +-----------------
 drivers/net/mdio/fwnode_mdio.c                | 32 ++++++++++++++++
 drivers/net/phy/phy_device.c                  | 20 ++++++++++
 include/linux/phy.h                           |  3 ++
 36 files changed, 138 insertions(+), 68 deletions(-)

Comments

Andrew Lunn May 9, 2022, 12:20 p.m. UTC | #1
On Mon, May 09, 2022 at 07:48:51AM +0000, Corentin Labbe wrote:
> Hello
> 
> 2 sunxi board still does not have ethernet working, orangepi 1+ and
> orangepi 3.
> This is due to the fact thoses boards have a PHY which need 2 regulators.

Why PHY make/module is it which is causing problems?

    Andrew
Corentin LABBE May 9, 2022, 1:27 p.m. UTC | #2
Le Mon, May 09, 2022 at 02:20:07PM +0200, Andrew Lunn a écrit :
> On Mon, May 09, 2022 at 07:48:51AM +0000, Corentin Labbe wrote:
> > Hello
> > 
> > 2 sunxi board still does not have ethernet working, orangepi 1+ and
> > orangepi 3.
> > This is due to the fact thoses boards have a PHY which need 2 regulators.
> 
> Why PHY make/module is it which is causing problems?
> 

The problem was stmmac support only one regulator for PHY.
Andrew Lunn May 9, 2022, 3:19 p.m. UTC | #3
On Mon, May 09, 2022 at 03:27:30PM +0200, LABBE Corentin wrote:
> Le Mon, May 09, 2022 at 02:20:07PM +0200, Andrew Lunn a écrit :
> > On Mon, May 09, 2022 at 07:48:51AM +0000, Corentin Labbe wrote:
> > > Hello
> > > 
> > > 2 sunxi board still does not have ethernet working, orangepi 1+ and
> > > orangepi 3.
> > > This is due to the fact thoses boards have a PHY which need 2 regulators.
> > 
> > Why PHY make/module is it which is causing problems?
> > 
> 
> The problem was stmmac support only one regulator for PHY.

I'm trying to understand the differences between the two different
regulators. If you tell me what the PHY is, i might be able to find
the data sheet, and then understand why two regulators are needed and
if one needs to be controlled by the PHY driver, not the MDIO bus
driver.

	Andrew
Corentin LABBE May 9, 2022, 3:24 p.m. UTC | #4
Le Mon, May 09, 2022 at 05:19:16PM +0200, Andrew Lunn a écrit :
> On Mon, May 09, 2022 at 03:27:30PM +0200, LABBE Corentin wrote:
> > Le Mon, May 09, 2022 at 02:20:07PM +0200, Andrew Lunn a écrit :
> > > On Mon, May 09, 2022 at 07:48:51AM +0000, Corentin Labbe wrote:
> > > > Hello
> > > > 
> > > > 2 sunxi board still does not have ethernet working, orangepi 1+ and
> > > > orangepi 3.
> > > > This is due to the fact thoses boards have a PHY which need 2 regulators.
> > > 
> > > Why PHY make/module is it which is causing problems?
> > > 
> > 
> > The problem was stmmac support only one regulator for PHY.
> 
> I'm trying to understand the differences between the two different
> regulators. If you tell me what the PHY is, i might be able to find
> the data sheet, and then understand why two regulators are needed and
> if one needs to be controlled by the PHY driver, not the MDIO bus
> driver.

The schematic for the board is https://linux-sunxi.org/images/5/50/OrangePi_3_Schematics_v1.5.pdf
Which show a RTL8211E.
Mark Brown May 9, 2022, 3:56 p.m. UTC | #5
On Mon, May 09, 2022 at 05:24:26PM +0200, LABBE Corentin wrote:
> Le Mon, May 09, 2022 at 05:19:16PM +0200, Andrew Lunn a écrit :

> > I'm trying to understand the differences between the two different
> > regulators. If you tell me what the PHY is, i might be able to find
> > the data sheet, and then understand why two regulators are needed and
> > if one needs to be controlled by the PHY driver, not the MDIO bus
> > driver.

> The schematic for the board is https://linux-sunxi.org/images/5/50/OrangePi_3_Schematics_v1.5.pdf
> Which show a RTL8211E.

Most hardware will want all the regulators for the device turned on or
off en masse (possibly in a specific sequence) - it's rare for devices
to support only having some of their supplies enabled for extended
periods, I'd be surprised if something like a PHY did that.