ice: add low level PTP clock access functions
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 9 Jun 2021 16:39:49 +0000 (09:39 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 11 Jun 2021 14:38:00 +0000 (07:38 -0700)
commit03cb4473be92a4207a3d1df25186dafd1a5add4d
tree51bef75e70f1321515cee3b8ceb2eb7a9ab89ae7
parent7f9ab54d314456884209f088aeaaf24e14d9ddf4
ice: add low level PTP clock access functions

Add the ice_ptp_hw.c file and some associated definitions to the ice
driver folder. This file contains basic low level definitions for
functions that interact with the device hardware.

For now, only E810-based devices are supported. The ice hardware
supports 2 major variants which have different PHYs with different
procedures necessary for interacting with the device clock.

Because the device captures timestamps in the PHY, each PHY has its own
internal timer. The timers are synchronized in hardware by first
preparing the source timer and the PHY timer shadow registers, and then
issuing a synchronization command. This ensures that both the source
timer and PHY timers are programmed simultaneously. The timers
themselves are all driven from the same oscillator source.

The functions in ice_ptp_hw.c abstract over the differences between how
the PHYs in E810 are programmed vs how the PHYs in E822 devices are
programmed. This series only implements E810 support, but E822 support
will be added in a future change.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_hw_autogen.h
drivers/net/ethernet/intel/ice/ice_ptp_hw.c [new file with mode: 0644]
drivers/net/ethernet/intel/ice/ice_ptp_hw.h [new file with mode: 0644]
drivers/net/ethernet/intel/ice/ice_type.h
include/linux/kernel.h