net: phy: mscc: sync rx/tx delay settings with Linux on vsc85xx
authorHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
Tue, 9 Jun 2020 13:37:40 +0000 (15:37 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 30 Sep 2020 20:48:18 +0000 (16:48 -0400)
commitd63c14cc3f24f56139bd385b0c35c9b264f0e83b
tree59f53dd00e9fc3f9c8b6f09cd3ae0a6571bc54ab
parent9a499b2bfa684abe77033c76740a597da8f09f11
net: phy: mscc: sync rx/tx delay settings with Linux on vsc85xx

The Linux kernel does set the clock delays to
- 0.2 ns (their default, and lowest, hardware value) if delays should
  not be enabled
- 2.0 ns (which causes the data to be sampled at exactly half way between
  clock transitions at 1000 Mbps) if delays should be enabled
depending on the interface mode

See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/mscc/mscc_main.c#n523

So instead of using arbitrary delay values like now, mimic this behaviour.

The behaviour is the same for all of vsc8530/8531/8540/8541 so move that
to a shared function while at it.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
drivers/net/phy/mscc.c