aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-03-15net: sparx5: fix a couple warning messagesDan Carpenter1-2/+2
The WARN_ON() macro takes a condition, not a warning message. Fixes: 0933bd04047c ("net: sparx5: Add support for ptp clocks") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20220314140327.GB30883@kili Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2022-03-04net: sparx5: Fix initialization of variables on stackHoratiu Vultur1-2/+2
The variables 'res' inside the functions sparx5_ptp_get_1ppm and sparx5_ptp_get_nominal_value was not initialized. So in case of the default case of the switch after, it would return an uninitialized variable. This makes also the clang builds to failed. Fixes: 0933bd04047c3b ("net: sparx5: Add support for ptp clocks") Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Link: https://lore.kernel.org/r/20220304140918.3356873-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-03-04net: sparx5: Add support for ptp interruptsHoratiu Vultur1-0/+119
When doing 2-step timestamping the HW will generate an interrupt when it managed to timestamp a frame. It is the SW responsibility to read it from the FIFO. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-04net: sparx5: Update extraction/injection for timestampingHoratiu Vultur1-0/+166
Update both the extraction and injection to do timestamping of the frames. The extraction is always doing the timestamping while for injection is doing the timestamping only if it is configured. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-04net: sparx5: Implement SIOCSHWTSTAMP and SIOCGHWTSTAMPHoratiu Vultur1-0/+74
Implement the ioctl callbacks SIOCSHWTSTAMP and SIOCGHWTSTAMP to allow to configure the ports to enable/disable timestamping for TX. The RX timestamping is always enabled. The HW is capable to run both 1-step timestamping and 2-step timestamping. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-04net: sparx5: Add support for ptp clocksHoratiu Vultur1-0/+326
The sparx5 has 3 PHC. Enable each of them, for now all the timestamping is happening on the first PHC. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>