net: fec: fix MAC internal delay doesn't work
authorJoakim Zhang <qiangqing.zhang@nxp.com>
Tue, 3 Aug 2021 05:24:24 +0000 (13:24 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Aug 2021 21:34:32 +0000 (14:34 -0700)
commitb820c114eba7e105556429031656918ebdd50ab1
tree30e7499b5604eaee8e22ffa6f30c0b63595ab1cb
parent421297efe63f328c872e6aec059463c37d7bcdd8
net: fec: fix MAC internal delay doesn't work

This patch intends to fix MAC internal delay doesn't work, due to use
of_property_read_u32() incorrectly, and improve this feature a bit:
1) check the delay value if valid, only program register when it's 2000ps.
2) only enable "enet_2x_txclk" clock when require MAC internal delay.

Fixes: fc539459e900 ("net: fec: add MAC internal delayed clock feature support")
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Link: https://lore.kernel.org/r/20210803052424.19008-1-qiangqing.zhang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/fec_main.c