linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] arm64: add ethernet to orange pi 3
@ 2022-11-15  7:36 Corentin Labbe
  2022-11-15  7:36 ` [PATCH v4 1/3] regulator: Add of_regulator_bulk_get_all Corentin Labbe
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Corentin Labbe @ 2022-11-15  7:36 UTC (permalink / raw)
  To: andrew, broonie, calvin.johnson, davem, edumazet, hkallweit1,
	jernej.skrabec, krzysztof.kozlowski+dt, kuba, lgirdwood, linux,
	pabeni, robh+dt, samuel, wens
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-sunxi, netdev,
	linux-sunxi, Corentin Labbe

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 by Ondřej Jirman 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.

My first tentative was to just add handling of phy and phy-io in
phy-core:
https://lore.kernel.org/netdev/20220509074857.195302-7-clabbe@baylibre.com/T/
But having hard-coded phy names was rejected.

Second tentative tryed the same path than clocks and clock-names for
regulators.
https://lore.kernel.org/netdev/0518eef1-75a6-fbfe-96d8-bb1fc4e5178a@linaro.org/t/
But using this was rejected by DT maintainers.

So v3 use a new regulator_bulk_get_all() which grab all supplies
properties in a DT node.
But this way could have some problem, a netdev driver could handle
already its PHY (like dwmac-sun8i already do) and so both phy-core and
the netdev will use both.
It is why phy-supply was renamed in ephy-supply in patch #3.

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

changes since v1:
- Add regulator_bulk_get_all for ease handling of PHY regulators
- Removed all convertion patchs to keep DT compatibility.

Changes since v2:
- removed use of regulator-names and regulators list.

Changes since v3:
- fixes kbuild robot report

Corentin Labbe (2):
  regulator: Add of_regulator_bulk_get_all
  phy: handle optional regulator for PHY

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

 .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 38 ++++++++
 drivers/net/mdio/fwnode_mdio.c                | 31 ++++++-
 drivers/net/phy/phy_device.c                  | 10 ++
 drivers/regulator/of_regulator.c              | 92 +++++++++++++++++++
 include/linux/phy.h                           |  3 +
 include/linux/regulator/consumer.h            |  8 ++
 6 files changed, 181 insertions(+), 1 deletion(-)

-- 
2.37.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-11-18 16:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15  7:36 [PATCH v4 0/3] arm64: add ethernet to orange pi 3 Corentin Labbe
2022-11-15  7:36 ` [PATCH v4 1/3] regulator: Add of_regulator_bulk_get_all Corentin Labbe
2022-11-15 10:03   ` Mark Brown
2022-11-15 10:18     ` Corentin LABBE
2022-11-15 10:34       ` Mark Brown
2022-11-15 10:42         ` Russell King (Oracle)
2022-11-15 11:16           ` Mark Brown
2022-11-15 11:38             ` Russell King (Oracle)
2022-11-15 13:48             ` Andrew Lunn
2022-11-18 16:14   ` Mark Brown
2022-11-15  7:36 ` [PATCH v4 2/3] phy: handle optional regulator for PHY Corentin Labbe
2022-11-16  1:51   ` Andrew Lunn
2022-11-16  1:58   ` Andrew Lunn
2022-11-15  7:36 ` [PATCH v4 3/3] arm64: dts: allwinner: orange-pi-3: Enable ethernet Corentin Labbe
2022-11-16  1:39 ` [PATCH v4 0/3] arm64: add ethernet to orange pi 3 Andrew Lunn
2022-11-18 16:11 ` (subset) " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).