Lines Matching refs:p_ptt

42 static int qed_ptp_res_lock(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)  in qed_ptp_res_lock()  argument
54 rc = qed_mcp_resc_lock(p_hwfn, p_ptt, &params); in qed_ptp_res_lock()
74 static int qed_ptp_res_unlock(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) in qed_ptp_res_unlock() argument
86 rc = qed_mcp_resc_unlock(p_hwfn, p_ptt, &params); in qed_ptp_res_unlock()
106 struct qed_ptt *p_ptt = p_hwfn->p_ptp_ptt; in qed_ptp_hw_read_rx_ts() local
110 val = qed_rd(p_hwfn, p_ptt, NIG_REG_LLH_PTP_HOST_BUF_SEQID); in qed_ptp_hw_read_rx_ts()
116 val = qed_rd(p_hwfn, p_ptt, NIG_REG_LLH_PTP_HOST_BUF_TS_LSB); in qed_ptp_hw_read_rx_ts()
117 *timestamp = qed_rd(p_hwfn, p_ptt, NIG_REG_LLH_PTP_HOST_BUF_TS_MSB); in qed_ptp_hw_read_rx_ts()
122 qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_HOST_BUF_SEQID, in qed_ptp_hw_read_rx_ts()
132 struct qed_ptt *p_ptt = p_hwfn->p_ptp_ptt; in qed_ptp_hw_read_tx_ts() local
136 val = qed_rd(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_BUF_SEQID); in qed_ptp_hw_read_tx_ts()
143 val = qed_rd(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_BUF_TS_LSB); in qed_ptp_hw_read_tx_ts()
144 *timestamp = qed_rd(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_BUF_TS_MSB); in qed_ptp_hw_read_tx_ts()
149 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_BUF_SEQID, QED_TIMESTAMP_MASK); in qed_ptp_hw_read_tx_ts()
158 struct qed_ptt *p_ptt = p_hwfn->p_ptp_ptt; in qed_ptp_hw_read_cc() local
161 temp = qed_rd(p_hwfn, p_ptt, NIG_REG_TSGEN_SYNC_TIME_LSB); in qed_ptp_hw_read_cc()
162 *phc_cycles = qed_rd(p_hwfn, p_ptt, NIG_REG_TSGEN_SYNC_TIME_MSB); in qed_ptp_hw_read_cc()
175 struct qed_ptt *p_ptt = p_hwfn->p_ptp_ptt; in qed_ptp_hw_cfg_filters() local
224 qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_PARAM_MASK, in qed_ptp_hw_cfg_filters()
226 qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_RULE_MASK, rule_mask); in qed_ptp_hw_cfg_filters()
227 qed_wr(p_hwfn, p_ptt, NIG_REG_RX_PTP_EN, enable_cfg); in qed_ptp_hw_cfg_filters()
230 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_PTP_EN, 0x0); in qed_ptp_hw_cfg_filters()
231 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_PARAM_MASK, 0x7FF); in qed_ptp_hw_cfg_filters()
232 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_RULE_MASK, 0x3FFF); in qed_ptp_hw_cfg_filters()
234 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_PTP_EN, enable_cfg); in qed_ptp_hw_cfg_filters()
235 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_PARAM_MASK, in qed_ptp_hw_cfg_filters()
237 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_RULE_MASK, rule_mask); in qed_ptp_hw_cfg_filters()
241 qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_HOST_BUF_SEQID, in qed_ptp_hw_cfg_filters()
258 struct qed_ptt *p_ptt = p_hwfn->p_ptp_ptt; in qed_ptp_hw_adjfreq() local
323 qed_wr(p_hwfn, p_ptt, NIG_REG_TSGEN_RST_DRIFT_CNTR, 0x1); in qed_ptp_hw_adjfreq()
325 drift_state = qed_rd(p_hwfn, p_ptt, NIG_REG_TSGEN_RST_DRIFT_CNTR); in qed_ptp_hw_adjfreq()
327 qed_wr(p_hwfn, p_ptt, NIG_REG_TSGEN_DRIFT_CNTR_CONF, in qed_ptp_hw_adjfreq()
334 qed_wr(p_hwfn, p_ptt, NIG_REG_TSGEN_RST_DRIFT_CNTR, 0x0); in qed_ptp_hw_adjfreq()
342 struct qed_ptt *p_ptt; in qed_ptp_hw_enable() local
345 p_ptt = qed_ptt_acquire(p_hwfn); in qed_ptp_hw_enable()
346 if (!p_ptt) { in qed_ptp_hw_enable()
351 p_hwfn->p_ptp_ptt = p_ptt; in qed_ptp_hw_enable()
353 rc = qed_ptp_res_lock(p_hwfn, p_ptt); in qed_ptp_hw_enable()
357 qed_ptt_release(p_hwfn, p_ptt); in qed_ptp_hw_enable()
363 qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_PARAM_MASK, 0x7FF); in qed_ptp_hw_enable()
364 qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_RULE_MASK, 0x3FFF); in qed_ptp_hw_enable()
365 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_PARAM_MASK, 0x7FF); in qed_ptp_hw_enable()
366 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_RULE_MASK, 0x3FFF); in qed_ptp_hw_enable()
368 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_PTP_EN, 7); in qed_ptp_hw_enable()
369 qed_wr(p_hwfn, p_ptt, NIG_REG_RX_PTP_EN, 7); in qed_ptp_hw_enable()
371 qed_wr(p_hwfn, p_ptt, NIG_REG_TS_OUTPUT_ENABLE_PDA, 0x1); in qed_ptp_hw_enable()
375 qed_wr(p_hwfn, p_ptt, NIG_REG_TIMESYNC_GEN_REG_BB, 2); in qed_ptp_hw_enable()
377 qed_wr(p_hwfn, p_ptt, NIG_REG_TSGEN_FREECNT_UPDATE_K2, 2); in qed_ptp_hw_enable()
379 qed_wr(p_hwfn, p_ptt, NIG_REG_TSGEN_FREE_CNT_VALUE_LSB, 0); in qed_ptp_hw_enable()
380 qed_wr(p_hwfn, p_ptt, NIG_REG_TSGEN_FREE_CNT_VALUE_MSB, 0); in qed_ptp_hw_enable()
383 qed_wr(p_hwfn, p_ptt, NIG_REG_TIMESYNC_GEN_REG_BB, 4); in qed_ptp_hw_enable()
385 qed_wr(p_hwfn, p_ptt, NIG_REG_TSGEN_FREECNT_UPDATE_K2, 4); in qed_ptp_hw_enable()
386 qed_wr(p_hwfn, p_ptt, NIG_REG_PTP_LATCH_OSTS_PKT_TIME, 1); in qed_ptp_hw_enable()
390 qed_wr(p_hwfn, p_ptt, NIG_REG_TSGEN_DRIFT_CNTR_CONF, 0x0); in qed_ptp_hw_enable()
391 qed_wr(p_hwfn, p_ptt, NIG_REG_TSGEN_RST_DRIFT_CNTR, 0x0); in qed_ptp_hw_enable()
394 qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_HOST_BUF_SEQID, in qed_ptp_hw_enable()
396 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_BUF_SEQID, QED_TIMESTAMP_MASK); in qed_ptp_hw_enable()
404 struct qed_ptt *p_ptt = p_hwfn->p_ptp_ptt; in qed_ptp_hw_disable() local
406 qed_ptp_res_unlock(p_hwfn, p_ptt); in qed_ptp_hw_disable()
409 qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_PARAM_MASK, 0x7FF); in qed_ptp_hw_disable()
410 qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_RULE_MASK, 0x3FFF); in qed_ptp_hw_disable()
412 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_PARAM_MASK, 0x7FF); in qed_ptp_hw_disable()
413 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_RULE_MASK, 0x3FFF); in qed_ptp_hw_disable()
416 qed_wr(p_hwfn, p_ptt, NIG_REG_RX_PTP_EN, 0x0); in qed_ptp_hw_disable()
417 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_PTP_EN, 0x0); in qed_ptp_hw_disable()
419 qed_ptt_release(p_hwfn, p_ptt); in qed_ptp_hw_disable()