linux/drivers/net/phy/mscc/mscc_ptp.h

/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
/*
 * Driver for Microsemi VSC85xx PHYs
 *
 * Copyright (c) 2020 Microsemi Corporation
 */

#ifndef _MSCC_PHY_PTP_H_
#define _MSCC_PHY_PTP_H_

/* 1588 page Registers */
#define MSCC_PHY_TS_BIU_ADDR_CNTL
#define BIU_ADDR_EXE
#define BIU_ADDR_READ
#define BIU_ADDR_WRITE
#define BIU_BLK_ID(x)
#define BIU_CSR_ADDR(x)
#define BIU_ADDR_CNT_MAX

#define MSCC_PHY_TS_CSR_DATA_LSB
#define MSCC_PHY_TS_CSR_DATA_MSB

#define MSCC_PHY_1588_INGR_VSC85XX_INT_STATUS
#define MSCC_PHY_1588_VSC85XX_INT_STATUS
#define VSC85XX_1588_INT_FIFO_ADD
#define VSC85XX_1588_INT_FIFO_OVERFLOW

#define MSCC_PHY_1588_INGR_VSC85XX_INT_MASK
#define MSCC_PHY_1588_VSC85XX_INT_MASK
#define VSC85XX_1588_INT_MASK_MASK

/* TS CSR addresses */
#define MSCC_PHY_ANA_ETH1_NTX_PROT
#define ANA_ETH1_NTX_PROT_SIG_OFF_MASK
#define ANA_ETH1_NTX_PROT_SIG_OFF(x)
#define ANA_ETH1_NTX_PROT_COMPARATOR_MASK
#define ANA_ETH1_NTX_PROT_PTP_OAM
#define ANA_ETH1_NTX_PROT_MPLS
#define ANA_ETH1_NTX_PROT_IP_UDP_ACH_2
#define ANA_ETH1_NTX_PROT_IP_UDP_ACH_1
#define ANA_ETH1_NTX_PROT_ETH2

#define MSCC_PHY_PTP_IFACE_CTRL
#define PTP_IFACE_CTRL_CLK_ENA
#define PTP_IFACE_CTRL_INGR_BYPASS
#define PTP_IFACE_CTRL_EGR_BYPASS
#define PTP_IFACE_CTRL_MII_PROT
#define PTP_IFACE_CTRL_GMII_PROT
#define PTP_IFACE_CTRL_XGMII_64_PROT

#define MSCC_PHY_ANA_ETH1_NTX_PROT_VLAN_TPID
#define ANA_ETH1_NTX_PROT_VLAN_TPID_MASK
#define ANA_ETH1_NTX_PROT_VLAN_TPID(x)

#define MSCC_PHY_PTP_ANALYZER_MODE
#define PTP_ANA_SPLIT_ENCAP_FLOW
#define PTP_ANA_EGR_ENCAP_FLOW_MODE_MASK
#define PTP_ANA_EGR_ENCAP_FLOW_MODE(x)
#define PTP_ANA_INGR_ENCAP_FLOW_MODE_MASK
#define PTP_ANA_INGR_ENCAP_FLOW_MODE(x)
#define PTP_ANALYZER_MODE_EGR_ENA_MASK
#define PTP_ANALYZER_MODE_EGR_ENA(x)
#define PTP_ANALYZER_MODE_INGR_ENA_MASK
#define PTP_ANALYZER_MODE_INGR_ENA(x)

#define MSCC_PHY_ANA_ETH1_NXT_PROT_TAG
#define ANA_ETH1_NXT_PROT_TAG_ENA

#define MSCC_PHY_PTP_MODE_CTRL
#define PTP_MODE_CTRL_MODE_MASK
#define PTP_MODE_CTRL_PKT_MODE

#define MSCC_PHY_ANA_ETH1_NXT_PROT_ETYPE_MATCH
#define ANA_ETH1_NXT_PROT_ETYPE_MATCH_ENA
#define ANA_ETH1_NXT_PROT_ETYPE_MATCH_MASK
#define ANA_ETH1_NXT_PROT_ETYPE_MATCH(x)

#define MSCC_PHY_PTP_VERSION_CODE
#define PTP_IP_VERSION_MASK
#define PTP_IP_VERSION_2_1

#define MSCC_ANA_ETH1_FLOW_ENA(x)
#define ETH1_FLOW_ENA_CHANNEL_MASK_MASK
#define ETH1_FLOW_ENA_CHANNEL_MASK(x)
#define ETH1_FLOW_VALID_CH1
#define ETH1_FLOW_VALID_CH0
#define ETH1_FLOW_ENA

#define MSCC_ANA_ETH1_FLOW_MATCH_MODE(x)
#define ANA_ETH1_FLOW_MATCH_VLAN_TAG_MASK
#define ANA_ETH1_FLOW_MATCH_VLAN_TAG(x)
#define ANA_ETH1_FLOW_MATCH_VLAN_TAG2
#define ANA_ETH1_FLOW_MATCH_VLAN_VERIFY

#define MSCC_ANA_ETH1_FLOW_ADDR_MATCH1(x)

#define MSCC_ANA_ETH1_FLOW_ADDR_MATCH2(x)
#define ANA_ETH1_FLOW_ADDR_MATCH2_MASK_MASK
#define ANA_ETH1_FLOW_ADDR_MATCH2_ANY_MULTICAST
#define ANA_ETH1_FLOW_ADDR_MATCH2_FULL_ADDR
#define ANA_ETH1_FLOW_ADDR_MATCH2_SRC_DEST_MASK
#define ANA_ETH1_FLOW_ADDR_MATCH2_SRC_DEST
#define ANA_ETH1_FLOW_ADDR_MATCH2_SRC
#define ANA_ETH1_FLOW_ADDR_MATCH2_DEST

#define MSCC_ANA_ETH1_FLOW_VLAN_RANGE_I_TAG(x)
#define MSCC_ANA_ETH1_FLOW_VLAN_TAG1(x)
#define MSCC_ANA_ETH1_FLOW_VLAN_TAG2_I_TAG(x)

#define MSCC_PHY_PTP_LTC_CTRL
#define PTP_LTC_CTRL_CLK_SEL_MASK
#define PTP_LTC_CTRL_CLK_SEL(x)
#define PTP_LTC_CTRL_CLK_SEL_INTERNAL_250
#define PTP_LTC_CTRL_AUTO_ADJ_UPDATE
#define PTP_LTC_CTRL_ADD_SUB_1NS_REQ
#define PTP_LTC_CTRL_ADD_1NS
#define PTP_LTC_CTRL_SAVE_ENA
#define PTP_LTC_CTRL_LOAD_ENA

#define MSCC_PHY_PTP_LTC_LOAD_SEC_MSB
#define PTP_LTC_LOAD_SEC_MSB(x)

#define MSCC_PHY_PTP_LTC_LOAD_SEC_LSB
#define PTP_LTC_LOAD_SEC_LSB(x)

#define MSCC_PHY_PTP_LTC_LOAD_NS
#define PTP_LTC_LOAD_NS(x)

#define MSCC_PHY_PTP_LTC_SAVED_SEC_MSB
#define MSCC_PHY_PTP_LTC_SAVED_SEC_LSB
#define MSCC_PHY_PTP_LTC_SAVED_NS

#define MSCC_PHY_PTP_LTC_SEQUENCE
#define PTP_LTC_SEQUENCE_A_MASK
#define PTP_LTC_SEQUENCE_A(x)

#define MSCC_PHY_PTP_LTC_SEQ
#define PTP_LTC_SEQ_ADD_SUB
#define PTP_LTC_SEQ_ERR_MASK
#define PTP_LTC_SEQ_ERR(x)

#define MSCC_PHY_PTP_LTC_AUTO_ADJ
#define PTP_AUTO_ADJ_NS_ROLLOVER(x)
#define PTP_AUTO_ADJ_ADD_SUB_1NS_MASK
#define PTP_AUTO_ADJ_SUB_1NS
#define PTP_AUTO_ADJ_ADD_1NS

#define MSCC_PHY_PTP_LTC_1PPS_WIDTH_ADJ
#define PTP_LTC_1PPS_WIDTH_ADJ_MASK

#define MSCC_PHY_PTP_TSTAMP_FIFO_SI
#define PTP_TSTAMP_FIFO_SI_EN

#define MSCC_PHY_PTP_INGR_PREDICTOR
#define PTP_INGR_PREDICTOR_EN

#define MSCC_PHY_PTP_EGR_PREDICTOR
#define PTP_EGR_PREDICTOR_EN

#define MSCC_PHY_PTP_INGR_TSP_CTRL
#define PHY_PTP_INGR_TSP_CTRL_FRACT_NS
#define PHY_PTP_INGR_TSP_CTRL_LOAD_DELAYS

#define MSCC_PHY_PTP_INGR_LOCAL_LATENCY
#define PTP_INGR_LOCAL_LATENCY_MASK
#define PTP_INGR_LOCAL_LATENCY(x)

#define MSCC_PHY_PTP_INGR_DELAY_FIFO
#define PTP_INGR_DELAY_FIFO_DEPTH_MACSEC
#define PTP_INGR_DELAY_FIFO_DEPTH_DEFAULT

#define MSCC_PHY_PTP_INGR_TS_FIFO(x)
#define PTP_INGR_TS_FIFO_EMPTY

#define MSCC_PHY_PTP_INGR_REWRITER_CTRL
#define PTP_INGR_REWRITER_REDUCE_PREAMBLE
#define PTP_INGR_REWRITER_FLAG_VAL
#define PTP_INGR_REWRITER_FLAG_BIT_OFF_M
#define PTP_INGR_REWRITER_FLAG_BIT_OFF(x)

#define MSCC_PHY_PTP_EGR_STALL_LATENCY

#define MSCC_PHY_PTP_EGR_TSP_CTRL
#define PHY_PTP_EGR_TSP_CTRL_FRACT_NS
#define PHY_PTP_EGR_TSP_CTRL_LOAD_DELAYS

#define MSCC_PHY_PTP_EGR_LOCAL_LATENCY
#define PTP_EGR_LOCAL_LATENCY_MASK
#define PTP_EGR_LOCAL_LATENCY(x)

#define MSCC_PHY_PTP_EGR_DELAY_FIFO
#define PTP_EGR_DELAY_FIFO_DEPTH_MACSEC
#define PTP_EGR_DELAY_FIFO_DEPTH_DEFAULT

#define MSCC_PHY_PTP_EGR_TS_FIFO_CTRL
#define PTP_EGR_TS_FIFO_RESET
#define PTP_EGR_FIFO_LEVEL_LAST_READ_MASK
#define PTP_EGR_FIFO_LEVEL_LAST_READ(x)
#define PTP_EGR_TS_FIFO_THRESH_MASK
#define PTP_EGR_TS_FIFO_THRESH(x)
#define PTP_EGR_TS_FIFO_SIG_BYTES_MASK
#define PTP_EGR_TS_FIFO_SIG_BYTES(x)

#define MSCC_PHY_PTP_EGR_TS_FIFO(x)
#define PTP_EGR_TS_FIFO_EMPTY
#define PTP_EGR_TS_FIFO_0_MASK

#define MSCC_PHY_PTP_EGR_REWRITER_CTRL
#define PTP_EGR_REWRITER_REDUCE_PREAMBLE
#define PTP_EGR_REWRITER_FLAG_VAL
#define PTP_EGR_REWRITER_FLAG_BIT_OFF_M
#define PTP_EGR_REWRITER_FLAG_BIT_OFF(x)

#define MSCC_PHY_PTP_SERIAL_TOD_IFACE
#define PTP_SERIAL_TOD_IFACE_LS_AUTO_CLR

#define MSCC_PHY_PTP_LTC_OFFSET
#define PTP_LTC_OFFSET_ADJ
#define PTP_LTC_OFFSET_ADD
#define PTP_LTC_OFFSET_VAL(x)

#define MSCC_PHY_PTP_ACCUR_CFG_STATUS
#define PTP_ACCUR_PPS_OUT_CALIB_ERR
#define PTP_ACCUR_PPS_OUT_CALIB_DONE
#define PTP_ACCUR_PPS_IN_CALIB_ERR
#define PTP_ACCUR_PPS_IN_CALIB_DONE
#define PTP_ACCUR_EGR_SOF_CALIB_ERR
#define PTP_ACCUR_EGR_SOF_CALIB_DONE
#define PTP_ACCUR_INGR_SOF_CALIB_ERR
#define PTP_ACCUR_INGR_SOF_CALIB_DONE
#define PTP_ACCUR_LOAD_SAVE_CALIB_ERR
#define PTP_ACCUR_LOAD_SAVE_CALIB_DONE
#define PTP_ACCUR_CALIB_TRIGG
#define PTP_ACCUR_PPS_OUT_BYPASS
#define PTP_ACCUR_PPS_IN_BYPASS
#define PTP_ACCUR_EGR_SOF_BYPASS
#define PTP_ACCUR_INGR_SOF_BYPASS
#define PTP_ACCUR_LOAD_SAVE_BYPASS

#define MSCC_PHY_ANA_ETH2_NTX_PROT
#define ANA_ETH2_NTX_PROT_COMPARATOR_MASK
#define ANA_ETH2_NTX_PROT_PTP_OAM
#define ANA_ETH2_NTX_PROT_MPLS
#define ANA_ETH2_NTX_PROT_IP_UDP_ACH_2
#define ANA_ETH2_NTX_PROT_IP_UDP_ACH_1
#define ANA_ETH2_NTX_PROT_ETH2

#define MSCC_PHY_ANA_ETH2_NXT_PROT_ETYPE_MATCH
#define ANA_ETH2_NXT_PROT_ETYPE_MATCH_ENA
#define ANA_ETH2_NXT_PROT_ETYPE_MATCH_MASK
#define ANA_ETH2_NXT_PROT_ETYPE_MATCH(x)

#define MSCC_ANA_ETH2_FLOW_ENA(x)
#define ETH2_FLOW_ENA_CHANNEL_MASK_MASK
#define ETH2_FLOW_ENA_CHANNEL_MASK(x)
#define ETH2_FLOW_VALID_CH1
#define ETH2_FLOW_VALID_CH0

#define MSCC_PHY_ANA_MPLS_COMP_NXT_COMP
#define ANA_MPLS_NTX_PROT_COMPARATOR_MASK
#define ANA_MPLS_NTX_PROT_PTP_OAM
#define ANA_MPLS_NTX_PROT_MPLS
#define ANA_MPLS_NTX_PROT_IP_UDP_ACH_2
#define ANA_MPLS_NTX_PROT_IP_UDP_ACH_1
#define ANA_MPLS_NTX_PROT_ETH2

#define MSCC_ANA_MPLS_FLOW_CTRL(x)
#define MPLS_FLOW_CTRL_CHANNEL_MASK_MASK
#define MPLS_FLOW_CTRL_CHANNEL_MASK(x)
#define MPLS_FLOW_VALID_CH1
#define MPLS_FLOW_VALID_CH0

#define MSCC_ANA_IP1_NXT_PROT_NXT_COMP
#define ANA_IP1_NXT_PROT_NXT_COMP_BYTES_HDR_MASK
#define ANA_IP1_NXT_PROT_NXT_COMP_BYTES_HDR(x)
#define ANA_IP1_NXT_PROT_NXT_COMP_PTP_OAM
#define ANA_IP1_NXT_PROT_NXT_COMP_IP_UDP_ACH2

#define MSCC_ANA_IP1_NXT_PROT_IP1_MODE
#define ANA_IP1_NXT_PROT_FLOW_OFFSET_IPV4
#define ANA_IP1_NXT_PROT_FLOW_OFFSET_IPV6
#define ANA_IP1_NXT_PROT_IPV6
#define ANA_IP1_NXT_PROT_IPV4

#define MSCC_ANA_IP1_NXT_PROT_IP_MATCH1
#define ANA_IP1_NXT_PROT_IP_MATCH1_PROT_OFF_MASK
#define ANA_IP1_NXT_PROT_IP_MATCH1_PROT_OFF(x)
#define ANA_IP1_NXT_PROT_IP_MATCH1_PROT_MASK_MASK
#define ANA_IP1_NXT_PROT_IP_MATCH1_PROT_MASK(x)
#define ANA_IP1_NXT_PROT_IP_MATCH1_PROT_MATCH_MASK
#define ANA_IP1_NXT_PROT_IP_MATCH1_PROT_MATCH(x)

#define MSCC_ANA_IP1_NXT_PROT_MATCH2_UPPER
#define MSCC_ANA_IP1_NXT_PROT_MATCH2_LOWER
#define MSCC_ANA_IP1_NXT_PROT_MASK2_UPPER
#define MSCC_ANA_IP1_NXT_PROT_MASK2_LOWER

#define MSCC_ANA_IP1_NXT_PROT_OFFSET2
#define ANA_IP1_NXT_PROT_OFFSET2_MASK
#define ANA_IP1_NXT_PROT_OFFSET2(x)

#define MSCC_ANA_IP1_NXT_PROT_UDP_CHKSUM
#define IP1_NXT_PROT_UDP_CHKSUM_OFF_MASK
#define IP1_NXT_PROT_UDP_CHKSUM_OFF(x)
#define IP1_NXT_PROT_UDP_CHKSUM_WIDTH_MASK
#define IP1_NXT_PROT_UDP_CHKSUM_WIDTH(x)
#define IP1_NXT_PROT_UDP_CHKSUM_UPDATE
#define IP1_NXT_PROT_UDP_CHKSUM_CLEAR

#define MSCC_ANA_IP1_FLOW_ENA(x)
#define IP1_FLOW_MATCH_ADDR_MASK
#define IP1_FLOW_MATCH_DEST_SRC_ADDR
#define IP1_FLOW_MATCH_DEST_ADDR
#define IP1_FLOW_MATCH_SRC_ADDR
#define IP1_FLOW_ENA_CHANNEL_MASK_MASK
#define IP1_FLOW_ENA_CHANNEL_MASK(x)
#define IP1_FLOW_VALID_CH1
#define IP1_FLOW_VALID_CH0
#define IP1_FLOW_ENA

#define MSCC_ANA_OAM_PTP_FLOW_ENA(x)
#define MSCC_ANA_OAM_PTP_FLOW_MATCH_LOWER(x)
#define MSCC_ANA_OAM_PTP_FLOW_MASK_LOWER(x)

#define MSCC_ANA_OAM_PTP_FLOW_PTP_0_FIELD(x)

#define MSCC_ANA_IP1_FLOW_MATCH_UPPER(x)
#define MSCC_ANA_IP1_FLOW_MATCH_UPPER_MID(x)
#define MSCC_ANA_IP1_FLOW_MATCH_LOWER_MID(x)
#define MSCC_ANA_IP1_FLOW_MATCH_LOWER(x)
#define MSCC_ANA_IP1_FLOW_MASK_UPPER(x)
#define MSCC_ANA_IP1_FLOW_MASK_UPPER_MID(x)
#define MSCC_ANA_IP1_FLOW_MASK_LOWER_MID(x)
#define MSCC_ANA_IP1_FLOW_MASK_LOWER(x)

#define MSCC_ANA_IP2_NXT_PROT_NXT_COMP
#define ANA_IP2_NXT_PROT_NXT_COMP_BYTES_HDR_MASK
#define ANA_IP2_NXT_PROT_NXT_COMP_BYTES_HDR(x)
#define ANA_IP2_NXT_PROT_NXT_COMP_PTP_OAM
#define ANA_IP2_NXT_PROT_NXT_COMP_IP_UDP_ACH2

#define MSCC_ANA_IP2_NXT_PROT_UDP_CHKSUM
#define IP2_NXT_PROT_UDP_CHKSUM_OFF_MASK
#define IP2_NXT_PROT_UDP_CHKSUM_OFF(x)
#define IP2_NXT_PROT_UDP_CHKSUM_WIDTH_MASK
#define IP2_NXT_PROT_UDP_CHKSUM_WIDTH(x)

#define MSCC_ANA_IP2_FLOW_ENA(x)
#define IP2_FLOW_ENA_CHANNEL_MASK_MASK
#define IP2_FLOW_ENA_CHANNEL_MASK(x)
#define IP2_FLOW_VALID_CH1
#define IP2_FLOW_VALID_CH0

#define MSCC_ANA_PTP_FLOW_ENA(x)
#define PTP_FLOW_ENA_CHANNEL_MASK_MASK
#define PTP_FLOW_ENA_CHANNEL_MASK(x)
#define PTP_FLOW_VALID_CH1
#define PTP_FLOW_VALID_CH0
#define PTP_FLOW_ENA

#define MSCC_ANA_PTP_FLOW_MATCH_UPPER(x)
#define PTP_FLOW_MSG_TYPE_MASK
#define PTP_FLOW_MSG_PDELAY_RESP
#define PTP_FLOW_MSG_PDELAY_REQ
#define PTP_FLOW_MSG_DELAY_REQ
#define PTP_FLOW_MSG_SYNC

#define MSCC_ANA_PTP_FLOW_MATCH_LOWER(x)
#define MSCC_ANA_PTP_FLOW_MASK_UPPER(x)
#define MSCC_ANA_PTP_FLOW_MASK_LOWER(x)

#define MSCC_ANA_PTP_FLOW_DOMAIN_RANGE(x)
#define PTP_FLOW_DOMAIN_RANGE_ENA

#define MSCC_ANA_PTP_FLOW_PTP_ACTION(x)
#define PTP_FLOW_PTP_ACTION_MOD_FRAME_STATUS_UPDATE
#define PTP_FLOW_PTP_ACTION_MOD_FRAME_STATUS_BYTE_OFFSET_MASK
#define PTP_FLOW_PTP_ACTION_MOD_FRAME_STATUS_BYTE_OFFSET(x)
#define PTP_FLOW_PTP_ACTION_PTP_CMD_MASK
#define PTP_FLOW_PTP_ACTION_PTP_CMD(x)
#define PTP_FLOW_PTP_ACTION_SUB_DELAY_ASYM
#define PTP_FLOW_PTP_ACTION_ADD_DELAY_ASYM
#define PTP_FLOW_PTP_ACTION_TIME_OFFSET_MASK
#define PTP_FLOW_PTP_ACTION_TIME_OFFSET(x)
#define PTP_FLOW_PTP_ACTION_CORR_OFFSET_MASK
#define PTP_FLOW_PTP_ACTION_CORR_OFFSET(x)
#define PTP_FLOW_PTP_ACTION_SAVE_LOCAL_TIME

#define MSCC_ANA_PTP_FLOW_PTP_ACTION2(x)
#define PTP_FLOW_PTP_ACTION2_REWRITE_OFFSET_MASK
#define PTP_FLOW_PTP_ACTION2_REWRITE_OFFSET(x)
#define PTP_FLOW_PTP_ACTION2_REWRITE_BYTES_MASK
#define PTP_FLOW_PTP_ACTION2_REWRITE_BYTES(x)

#define MSCC_ANA_PTP_FLOW_PTP_0_FIELD(x)
#define PTP_FLOW_PTP_0_FIELD_PTP_FRAME
#define PTP_FLOW_PTP_0_FIELD_RSVRD_CHECK
#define PTP_FLOW_PTP_0_FIELD_OFFSET_MASK
#define PTP_FLOW_PTP_0_FIELD_OFFSET(x)
#define PTP_FLOW_PTP_0_FIELD_BYTES_MASK
#define PTP_FLOW_PTP_0_FIELD_BYTES(x)

#define MSCC_ANA_PTP_IP_CHKSUM_SEL
#define ANA_PTP_IP_CHKSUM_SEL_IP_COMP_2
#define ANA_PTP_IP_CHKSUM_SEL_IP_COMP_1

#define MSCC_PHY_ANA_FSB_CFG
#define ANA_FSB_ADDR_FROM_BLOCK_SEL_MASK
#define ANA_FSB_ADDR_FROM_IP2
#define ANA_FSB_ADDR_FROM_IP1
#define ANA_FSB_ADDR_FROM_ETH2
#define ANA_FSB_ADDR_FROM_ETH1

#define MSCC_PHY_ANA_FSB_REG(x)

#define COMP_MAX_FLOWS
#define PTP_COMP_MAX_FLOWS

#define PPS_WIDTH_ADJ
#define STALL_EGR_LATENCY(x)

/* PHC clock available frequencies. */
enum {};

enum ptp_cmd {};

struct vsc85xx_ptphdr {} __attribute__((packed));

/* Represents an entry in the timestamping FIFO */
struct vsc85xx_ts_fifo {} __attribute__((packed));

struct vsc85xx_ptp {};

#endif /* _MSCC_PHY_PTP_H_ */