Commit 4cc339ce authored by Yao Zi's avatar Yao Zi Committed by Paolo Abeni
Browse files

net: stmmac: thead: Get and enable APB clock on initialization



It's necessary to adjust the MAC TX clock when the linkspeed changes,
but it's noted such adjustment always fails on TH1520 SoC, and reading
back from APB glue registers that control clock generation results in
garbage, causing broken link.

With some testing, it's found a clock must be ungated for access to APB
glue registers. Without any consumer, the clock is automatically
disabled during late kernel startup. Let's get and enable it if it's
described in devicetree.

For backward compatibility with older devicetrees, probing won't fail if
the APB clock isn't found. In this case, we emit a warning since the
link will break if the speed changes.

Fixes: 33a1a01e ("net: stmmac: Add glue layer for T-HEAD TH1520 SoC")
Signed-off-by: default avatarYao Zi <ziyao@disroot.org>
Tested-by: default avatarDrew Fustini <fustini@kernel.org>
Reviewed-by: default avatarDrew Fustini <fustini@kernel.org>
Link: https://patch.msgid.link/20250808093655.48074-4-ziyao@disroot.org


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent c8a9a619
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment