netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 0/3] Fix broken link with TH1520 GMAC when linkspeed changes
@ 2025-08-01  9:12 Yao Zi
  2025-08-01  9:12 ` [PATCH net v2 1/3] dt-bindings: net: thead,th1520-gmac: Describe APB interface clock Yao Zi
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Yao Zi @ 2025-08-01  9:12 UTC (permalink / raw)
  To: Drew Fustini, Guo Ren, Fu Wei, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Emil Renner Berthing, Jisheng Zhang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, Yao Zi

It's noted that on TH1520 SoC, the GMAC's link becomes broken after
the link speed is changed (for example, running ethtool -s eth0 speed
100 on the peer when negotiated to 1Gbps), but the GMAC could function
normally if the speed is brought back to the initial.

Just like many other SoCs utilizing STMMAC IP, we need to adjust the TX
clock supplying TH1520's GMAC through some SoC-specific glue registers
when linkspeed changes. But it's found that after the full kernel
startup, reading from them results in garbage and writing to them makes
no effect, which is the cause of broken link.

Further testing shows perisys-apb4-hclk must be ungated for normal
access to Th1520 GMAC APB glue registers, which is neither described in
dt-binding nor acquired by the driver.

This series expands the dt-binding of TH1520's GMAC to allow an extra
"APB glue registers interface clock", instructs the driver to acquire
and enable the clock, and finally supplies CLK_PERISYS_APB4_HCLK for
TH1520's GMACs in SoC devicetree.

Changed from v1
- Make apb clock essential in dt-binding
- Collect review tags
- Link to v1: https://lore.kernel.org/all/20250729093734.40132-1-ziyao@disroot.org/

Yao Zi (3):
  dt-bindings: net: thead,th1520-gmac: Describe APB interface clock
  net: stmmac: thead: Get and enable APB clock on initialization
  riscv: dts: thead: Add APB clocks for TH1520 GMACs

 .../devicetree/bindings/net/thead,th1520-gmac.yaml     |  6 ++++--
 arch/riscv/boot/dts/thead/th1520.dtsi                  | 10 ++++++----
 drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c      |  6 ++++++
 3 files changed, 16 insertions(+), 6 deletions(-)

-- 
2.50.1


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

end of thread, other threads:[~2025-08-06  3:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01  9:12 [PATCH net v2 0/3] Fix broken link with TH1520 GMAC when linkspeed changes Yao Zi
2025-08-01  9:12 ` [PATCH net v2 1/3] dt-bindings: net: thead,th1520-gmac: Describe APB interface clock Yao Zi
2025-08-03 18:41   ` Drew Fustini
2025-08-05  6:39   ` Krzysztof Kozlowski
2025-08-05 16:59     ` Drew Fustini
2025-08-06  3:05       ` Yao Zi
2025-08-01  9:12 ` [PATCH net v2 2/3] net: stmmac: thead: Get and enable APB clock on initialization Yao Zi
2025-08-03 17:02   ` Rob Herring
2025-08-03 18:46     ` Drew Fustini
2025-08-04  5:12     ` Yao Zi
2025-08-04 16:23       ` Drew Fustini
2025-08-05 18:05         ` Drew Fustini
2025-08-06  3:02           ` Yao Zi
2025-08-01  9:12 ` [PATCH net v2 3/3] riscv: dts: thead: Add APB clocks for TH1520 GMACs Yao Zi

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).