From: Wenzhuo Lu Date: Fri, 31 Jul 2015 01:20:30 +0000 (+0800) Subject: igb: fix ieee1588 timestamping X-Git-Tag: spdx-start~8573 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cff4a985ef79423c6bde124d30770d7be0f17bad;p=dpdk.git igb: fix ieee1588 timestamping Ieee1588 reads system time to set its timestamp. On 1G NICs, for example, i350, system time is disabled by default. It means the ieee1588 timestamp will always be 0. This patch enables system time when ieee1588 is enabled. Signed-off-by: Wenzhuo Lu Acked-by: John McNamara --- diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 9fd41f566f..c7e6d55692 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -82,6 +82,7 @@ #define E1000_TIMINCA_INCVALUE 16000000 #define E1000_TIMINCA_INIT ((0x02 << E1000_TIMINCA_16NS_SHIFT) \ | E1000_TIMINCA_INCVALUE) +#define E1000_TSAUXC_DISABLE_SYSTIME 0x80000000 static int eth_igb_configure(struct rte_eth_dev *dev); static int eth_igb_start(struct rte_eth_dev *dev); @@ -3904,6 +3905,12 @@ igb_timesync_enable(struct rte_eth_dev *dev) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); uint32_t tsync_ctl; + uint32_t tsauxc; + + /* Enable system time for it isn't on by default. */ + tsauxc = E1000_READ_REG(hw, E1000_TSAUXC); + tsauxc &= ~E1000_TSAUXC_DISABLE_SYSTIME; + E1000_WRITE_REG(hw, E1000_TSAUXC, tsauxc); /* Start incrementing the register used to timestamp PTP packets. */ E1000_WRITE_REG(hw, E1000_TIMINCA, E1000_TIMINCA_INIT);