[lkml]   [2019]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH net-next v2 0/1] stmmac: honor the GPIO flags for the PHY reset GPIO
Recent Amlogic SoCs (G12A which includes S905X2 and S905D2 as well as
G12B which includes S922X) use GPIOZ_14 or GPIOZ_15 for the PHY reset
line. These GPIOs are special because they are marked as "3.3V input
tolerant open drain (OD) pins" which means they can only drive the pin
output LOW (to reset the PHY) or to switch to input mode (to take the
PHY out of reset).
The GPIO subsystem already supports this with the GPIO_OPEN_DRAIN and
GPIO_OPEN_SOURCE flags in the devicetree bindings.

The goal of this series to add support for these special GPIOs in
stmmac (even though the "snps,reset-gpio" binding is deprecated).

My test-cases were:
- X96 Max: snps,reset-gpio = <&gpio GPIOZ_15 0> with and without
snps,reset-active-low before these patches. The PHY was
not detected.
- X96 Max: snps,reset-gpio = <&gpio GPIOZ_15
The PHY is now detected correctly
- Meson8b EC100: snps,reset-gpio = <&gpio GPIOH_4 0> with
snps,reset-active-low. Before and after these
patches the PHY is detected correctly.
- Meson8b EC100: snps,reset-gpio = <&gpio GPIOH_4 0> without
snps,reset-active-low. Before and after these
patches the PHY is not detected (this is expected
because we need to set the output LOW to take the
PHY out of reset).
- Meson8b EC100: snps,reset-gpio = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>
but without snps,reset-active-low. Before these
patches the PHY was not detected. With these patches
the PHY is now detected correctly.

Changes since RFC v1 at [0]:
- dropped all patches except the main patch which changes
stmmac_mdio_reset to use GPIO descriptors (I will send the cleanup
patches in a separate series once this patch is merged)
- drop the active_low field from struct stmmac_mdio_bus_data
- added Linus Walleij's Reviewed-by (thank you!)

This has a runtime dependency on the preparation patch [0] from
Linus W.'s GPIO tree. Without that dependency the
snps,reset-active-low property (which quite a few .dts files use)
will be ignored.
Linus created an immutable branch which can be pulled into net-next:
gitweb for this immutable branch: [2]


Martin Blumenstingl (1):
net: stmmac: use GPIO descriptors in stmmac_mdio_reset

.../net/ethernet/stmicro/stmmac/stmmac_mdio.c | 27 +++++++++----------
include/linux/stmmac.h | 2 +-
2 files changed, 14 insertions(+), 15 deletions(-)


 \ /
  Last update: 2019-06-12 21:32    [W:0.030 / U:12.108 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site