From: Yao Zi <ziyao@disroot.org>
To: Drew Fustini <fustini@kernel.org>, Guo Ren <guoren@kernel.org>,
Fu Wei <wefu@redhat.com>, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Emil Renner Berthing <emil.renner.berthing@canonical.com>,
Jisheng Zhang <jszhang@kernel.org>
Cc: linux-riscv@lists.infradead.org, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Yao Zi <ziyao@disroot.org>
Subject: [PATCH net 0/3] Fix broken link with TH1520 GMAC when linkspeed changes
Date: Tue, 29 Jul 2025 09:37:31 +0000 [thread overview]
Message-ID: <20250729093734.40132-1-ziyao@disroot.org> (raw)
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.
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 | 8 ++++++--
arch/riscv/boot/dts/thead/th1520.dtsi | 10 ++++++----
drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c | 6 ++++++
3 files changed, 18 insertions(+), 6 deletions(-)
--
2.50.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2025-07-29 9:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 9:37 Yao Zi [this message]
2025-07-29 9:37 ` [PATCH net 1/3] dt-bindings: net: thead,th1520-gmac: Describe APB interface clock Yao Zi
2025-07-29 17:43 ` Conor Dooley
2025-07-30 2:37 ` Yao Zi
2025-07-29 17:54 ` Drew Fustini
2025-07-29 9:37 ` [PATCH net 2/3] net: stmmac: thead: Get and enable APB clock on initialization Yao Zi
2025-07-29 22:51 ` Drew Fustini
2025-07-29 9:37 ` [PATCH net 3/3] riscv: dts: thead: Add APB clocks for TH1520 GMACs Yao Zi
2025-07-29 17:45 ` Drew Fustini
2025-07-29 17:34 ` [PATCH net 0/3] Fix broken link with TH1520 GMAC when linkspeed changes Drew Fustini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250729093734.40132-1-ziyao@disroot.org \
--to=ziyao@disroot.org \
--cc=alex@ghiti.fr \
--cc=andrew+netdev@lunn.ch \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=emil.renner.berthing@canonical.com \
--cc=fustini@kernel.org \
--cc=guoren@kernel.org \
--cc=jszhang@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=wefu@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox