Thread (23 messages) 23 messages, 6 authors, 2023-10-06

Re: [PATCH v3 08/12] net: ethernet: stmmac: stm32: support the phy-supply regulator binding

From: Alexandre TORGUE <alexandre.torgue@foss.st.com>
Date: 2023-10-06 11:53:56
Also in: linux-arm-kernel, linux-devicetree, lkml

On 10/5/23 13:27, Christophe ROULLIER wrote:
On 9/28/23 17:45, Ben Wolsieffer wrote:
quoted
Hello,

On Thu, Sep 28, 2023 at 05:15:08PM +0200, Christophe Roullier wrote:
quoted
From: Christophe Roullier <redacted>

Configure the phy regulator if defined by the "phy-supply" DT phandle.

Signed-off-by: Christophe Roullier <redacted>
---
  .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 51 ++++++++++++++++++-
  1 file changed, 50 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c 
b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
index 72dda71850d75..31e3abd2caeaa 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
... snip ...
quoted
  static int stm32mp1_suspend(struct stm32_dwmac *dwmac)
@@ -455,12 +496,20 @@ static int stm32mp1_suspend(struct stm32_dwmac 
*dwmac)
      if (dwmac->enable_eth_ck)
          clk_disable_unprepare(dwmac->clk_eth_ck);
+    /* Keep the PHY up if we use Wake-on-Lan. */
+    if (!device_may_wakeup(dwmac->dev))
+        phy_power_on(dwmac, false);
+
      return ret;
  }
  static void stm32mp1_resume(struct stm32_dwmac *dwmac)
  {
      clk_disable_unprepare(dwmac->clk_ethstp);
+
+    /* The PHY was up for Wake-on-Lan. */
+    if (!device_may_wakeup(dwmac->dev))
+        phy_power_on(dwmac, true);
  }
  static int stm32mcu_suspend(struct stm32_dwmac *dwmac)
Why only turn off the regulator in suspend on the STM32MP1 and not STM32
MCUs? It seems like this could just go in stm32_dwmac_suspend/resume().

Selfishly, I have a use case for this on an STM32F746 platform, so I
would like to see support for it and would test an updated version.
Hi,

I'm working on MPU boards, I do not have MCU board, so feel free to 
contribute on MCU part ;-)
Christophe,

The point here is to manage regulator for MPU and MCU. If you don't have 
MCU board it doesn't seem to be an issue as Ben proposed to test the 
patch for you.
Thanks

Christophe
quoted
quoted
-- 
2.25.1
Thanks, Ben
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help