Skip to content

Commit 5b15b1f

Browse files
jacob-kelleranguy11
authored andcommitted
ice: rename TS_LL_READ* macros to REG_LL_PROXY_H_*
The TS_LL_READ macros are used as part of the low latency Tx timestamp interface. A future firmware extension will add support for performing PHY timer updates over this interface. Using TS_LL_READ as the prefix for these macros will be confusing once the interface is used for other purposes. Rename the macros, using the prefix REG_LL_PROXY_H, to better clarify that this is for the low latency interface. Additionally add macros for PF_SB_ATQBAH and PF_SB_ATQBAL registers to better clarify content of this registers as PF_SB_ATQBAH contain low part of Tx timestamp Co-developed-by: Karol Kolacinski <[email protected]> Signed-off-by: Karol Kolacinski <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Reviewed-by: Milena Olech <[email protected]> Signed-off-by: Anton Nadezhdin <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 95aca43 commit 5b15b1f

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

drivers/net/ethernet/intel/ice/ice_ptp.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,9 @@ void ice_ptp_req_tx_single_tstamp(struct ice_ptp_tx *tx, u8 idx)
490490
ice_trace(tx_tstamp_fw_req, tx->tstamps[idx].skb, idx);
491491

492492
/* Write TS index to read to the PF register so the FW can read it */
493-
wr32(&pf->hw, PF_SB_ATQBAL,
494-
TS_LL_READ_TS_INTR | FIELD_PREP(TS_LL_READ_TS_IDX, idx) |
495-
TS_LL_READ_TS);
493+
wr32(&pf->hw, REG_LL_PROXY_H,
494+
REG_LL_PROXY_H_TS_INTR_ENA | FIELD_PREP(REG_LL_PROXY_H_TS_IDX, idx) |
495+
REG_LL_PROXY_H_EXEC);
496496
tx->last_ll_ts_idx_read = idx;
497497
}
498498

@@ -519,20 +519,20 @@ void ice_ptp_complete_tx_single_tstamp(struct ice_ptp_tx *tx)
519519

520520
ice_trace(tx_tstamp_fw_done, tx->tstamps[idx].skb, idx);
521521

522-
val = rd32(&pf->hw, PF_SB_ATQBAL);
522+
val = rd32(&pf->hw, REG_LL_PROXY_H);
523523

524524
/* When the bit is cleared, the TS is ready in the register */
525-
if (val & TS_LL_READ_TS) {
525+
if (val & REG_LL_PROXY_H_EXEC) {
526526
dev_err(ice_pf_to_dev(pf), "Failed to get the Tx tstamp - FW not ready");
527527
return;
528528
}
529529

530530
/* High 8 bit value of the TS is on the bits 16:23 */
531-
raw_tstamp = FIELD_GET(TS_LL_READ_TS_HIGH, val);
531+
raw_tstamp = FIELD_GET(REG_LL_PROXY_H_TS_HIGH, val);
532532
raw_tstamp <<= 32;
533533

534534
/* Read the low 32 bit value */
535-
raw_tstamp |= (u64)rd32(&pf->hw, PF_SB_ATQBAH);
535+
raw_tstamp |= (u64)rd32(&pf->hw, REG_LL_PROXY_L);
536536

537537
/* Devices using this interface always verify the timestamp differs
538538
* relative to the last cached timestamp value.

drivers/net/ethernet/intel/ice/ice_ptp_hw.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4861,24 +4861,24 @@ ice_read_phy_tstamp_ll_e810(struct ice_hw *hw, u8 idx, u8 *hi, u32 *lo)
48614861
int err;
48624862

48634863
/* Write TS index to read to the PF register so the FW can read it */
4864-
val = FIELD_PREP(TS_LL_READ_TS_IDX, idx) | TS_LL_READ_TS;
4865-
wr32(hw, PF_SB_ATQBAL, val);
4864+
val = FIELD_PREP(REG_LL_PROXY_H_TS_IDX, idx) | REG_LL_PROXY_H_EXEC;
4865+
wr32(hw, REG_LL_PROXY_H, val);
48664866

48674867
/* Read the register repeatedly until the FW provides us the TS */
48684868
err = read_poll_timeout_atomic(rd32, val,
4869-
!FIELD_GET(TS_LL_READ_TS, val), 10,
4870-
TS_LL_READ_TIMEOUT, false, hw,
4871-
PF_SB_ATQBAL);
4869+
!FIELD_GET(REG_LL_PROXY_H_EXEC, val), 10,
4870+
REG_LL_PROXY_H_TIMEOUT_US, false, hw,
4871+
REG_LL_PROXY_H);
48724872
if (err) {
48734873
ice_debug(hw, ICE_DBG_PTP, "Failed to read PTP timestamp using low latency read\n");
48744874
return err;
48754875
}
48764876

48774877
/* High 8 bit value of the TS is on the bits 16:23 */
4878-
*hi = FIELD_GET(TS_LL_READ_TS_HIGH, val);
4878+
*hi = FIELD_GET(REG_LL_PROXY_H_TS_HIGH, val);
48794879

48804880
/* Read the low 32 bit value and set the TS valid bit */
4881-
*lo = rd32(hw, PF_SB_ATQBAH) | TS_VALID;
4881+
*lo = rd32(hw, REG_LL_PROXY_L) | TS_VALID;
48824882

48834883
return 0;
48844884
}

drivers/net/ethernet/intel/ice/ice_ptp_hw.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -689,11 +689,14 @@ static inline bool ice_is_dual(struct ice_hw *hw)
689689
#define BYTES_PER_IDX_ADDR_L 4
690690

691691
/* Tx timestamp low latency read definitions */
692-
#define TS_LL_READ_TIMEOUT 2000
693-
#define TS_LL_READ_TS_HIGH GENMASK(23, 16)
694-
#define TS_LL_READ_TS_IDX GENMASK(29, 24)
695-
#define TS_LL_READ_TS_INTR BIT(30)
696-
#define TS_LL_READ_TS BIT(31)
692+
#define REG_LL_PROXY_H_TIMEOUT_US 2000
693+
#define REG_LL_PROXY_H_TS_HIGH GENMASK(23, 16)
694+
#define REG_LL_PROXY_H_TS_IDX GENMASK(29, 24)
695+
#define REG_LL_PROXY_H_TS_INTR_ENA BIT(30)
696+
#define REG_LL_PROXY_H_EXEC BIT(31)
697+
698+
#define REG_LL_PROXY_L PF_SB_ATQBAH
699+
#define REG_LL_PROXY_H PF_SB_ATQBAL
697700

698701
/* Internal PHY timestamp address */
699702
#define TS_L(a, idx) ((a) + ((idx) * BYTES_PER_IDX_ADDR_L_U))

0 commit comments

Comments
 (0)