]> git.baikalelectronics.ru Git - kernel.git/commit
net: axienet: Use clock framework to get device clock rate
authorRobert Hancock <hancock@sedsystems.ca>
Thu, 6 Jun 2019 22:28:09 +0000 (16:28 -0600)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Jun 2019 23:24:29 +0000 (16:24 -0700)
commitfa2da9a0414fc48fbbe760f23c9f5afb43cc907a
treeddfbbda4246b0c43a1428e929b4bfe2c9db08b95
parent5316c3a937bfbf2e4024ff95338dfbd31c22ff18
net: axienet: Use clock framework to get device clock rate

This driver was previously always calculating the MDIO clock divisor
(from AXI bus clock to MDIO bus clock) based on the CPU clock frequency,
assuming that it is the same as the AXI bus frequency, but that
simplistic method only works on the MicroBlaze platform.

Add support for specifying the clock used for the device in the device
tree using the clock framework. If the clock is specified then it will
be used when calculating the clock divisor. The previous CPU clock
detection method is left for backward compatibility if no clock is
specified.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/devicetree/bindings/net/xilinx_axienet.txt
drivers/net/ethernet/xilinx/xilinx_axienet.h
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c