#define AQ_HW_MAC_COUNTER_HZ 312500000ll
#define AQ_HW_PHY_COUNTER_HZ 160000000ll
+#define AQ_HW_TXD_CTL_TS_EN 0x40000000U
+#define AQ_HW_TXD_CTL_TS_TSG0 0x80000000U
+
enum aq_tc_mode {
AQ_TC_MODE_INVALID = -1,
AQ_TC_MODE_8TCS,
#define AQ_FRAC_PER_NS 0x100000000LL
+#define AQ2_HW_PTP_COUNTER_HZ 156250000ll
+
/* Used for rate to Mbps conversion */
#define AQ_MBPS_DIVISOR 125000 /* 1000000 / 8 */
#define AQ_HW_IRQ_MSIX 3U
#define AQ_HW_SERVICE_IRQS 1U
+#define AQ_HW_PTP_IRQS 1U
#define AQ_HW_POWER_STATE_D0 0U
#define AQ_HW_POWER_STATE_D3 3U
AQ_HW_LOOPBACK_PHYEXT_SYS,
};
+enum {
+ AQ_HW_PTP_DISABLE = 0,
+ AQ_HW_PTP_L2_ENABLE = BIT(1),
+ AQ_HW_PTP_L4_ENABLE = BIT(2),
+};
+
+#define ATL_TSG_CLOCK_SEL_0 0
+#define ATL_TSG_CLOCK_SEL_1 1
+
#define AQ_HW_LOOPBACK_MASK (BIT(AQ_HW_LOOPBACK_DMA_SYS) |\
BIT(AQ_HW_LOOPBACK_PKT_SYS) |\
BIT(AQ_HW_LOOPBACK_DMA_NET) |\
u32 rpc_tid;
struct hw_atl_utils_fw_rpc rpc;
s64 ptp_clk_offset;
+ s8 clk_select;
u16 phy_id;
void *priv;
};
int (*hw_ts_to_sys_clock)(struct aq_hw_s *self, u64 ts, u64 *time);
- int (*hw_gpio_pulse)(struct aq_hw_s *self, u32 index, u64 start,
- u32 period);
+ int (*hw_gpio_pulse)(struct aq_hw_s *self, u32 index,
+ u32 clk_sel, u64 start,
+ u32 period, u32 hightime);
int (*hw_extts_gpio_enable)(struct aq_hw_s *self, u32 index,
- u32 enable);
+ u32 channel, int enable);
+
+ void (*enable_ptp)(struct aq_hw_s *self, unsigned int param,
+ int enable);
int (*hw_get_sync_ts)(struct aq_hw_s *self, u64 *ts);
int (*extract_hwts)(struct aq_hw_s *self, u8 *p, unsigned int len,
u64 *timestamp);
+ u64 (*hw_ring_tx_ptp_get_ts)(struct aq_ring_s *ring);
+
+ int (*hw_tx_ptp_ring_init)(struct aq_hw_s *self,
+ struct aq_ring_s *aq_ring);
+ int (*hw_rx_ptp_ring_init)(struct aq_hw_s *self,
+ struct aq_ring_s *aq_ring);
+ u32 (*hw_get_clk_sel)(struct aq_hw_s *self);
+
int (*hw_set_fc)(struct aq_hw_s *self, u32 fc, u32 tc);
int (*hw_set_loopback)(struct aq_hw_s *self, u32 mode, bool enable);
txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_WB;
is_gso = false;
is_vlan = false;
+
+ if (ATL_HW_IS_CHIP_FEATURE(self, ANTIGUA) &&
+ unlikely(buff->request_ts)) {
+ txd->ctl |= AQ_HW_TXD_CTL_TS_EN;
+ if (buff->clk_sel != ATL_TSG_CLOCK_SEL_1)
+ txd->ctl |= AQ_HW_TXD_CTL_TS_TSG0;
+ /* The only DD+TS is required */
+ txd->ctl &= ~HW_ATL_B0_TXD_CTL_CMD_WB;
+ }
}
}
ring->sw_tail = aq_ring_next_dx(ring, ring->sw_tail);
return self->aq_fw_ops->send_fw_request(self, &fwreq, size);
}
-static int hw_atl_b0_gpio_pulse(struct aq_hw_s *self, u32 index,
- u64 start, u32 period)
+static int hw_atl_b0_gpio_pulse(struct aq_hw_s *self, u32 index, u32 clk_sel,
+ u64 start, u32 period, u32 hightime)
{
struct hw_fw_request_iface fwreq;
size_t size;
}
static int hw_atl_b0_extts_gpio_enable(struct aq_hw_s *self, u32 index,
- u32 enable)
+ u32 channel, int enable)
{
/* Enable/disable Sync1588 GPIO Timestamping */
aq_phy_write_reg(self, MDIO_MMD_PCS, 0xc611, enable ? 0x71 : 0);