Skip to content
Commit 582ac134 authored by Marek Vasut's avatar Marek Vasut Committed by Paolo Abeni
Browse files

net: stmmac: dwmac-stm32: Separate out external clock rate validation



Pull the external clock frequency validation into a separate function,
to avoid conflating it with external clock DT property decoding and
clock mux register configuration. This should make the code easier to
read and understand.

This does change the code behavior slightly. The clock mux PMCR register
setting now depends solely on the DT properties which configure the clock
mux between external clock and internal RCC generated clock. The mux PMCR
register settings no longer depend on the supplied clock frequency, that
supplied clock frequency is now only validated, and if the clock frequency
is invalid for a mode, it is rejected.

Previously, the code would switch the PMCR register clock mux to internal
RCC generated clock if external clock couldn't provide suitable frequency,
without checking whether the RCC generated clock frequency is correct. Such
behavior is risky at best, user should have configured their clock correctly
in the first place, so this behavior is removed here.

Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarChristophe Roullier <christophe.roullier@foss.st.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 8a9044e5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment