nvethernetrm: add PTP support

This takes care of implementing the PTP support
which includes PTP V1/V2 over IPV4,IPV6,Ethernet,gPTP.

Bug 200524751

Change-Id: Ieb680d818be81c1a1a8349ddd9ff02bba1896b08
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2127117
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Narayan Reddy
2019-05-29 13:33:51 +05:30
committed by mobile promotions
parent 366e95758c
commit efb739e01c
10 changed files with 1084 additions and 47 deletions

View File

@@ -23,6 +23,15 @@
#ifndef OSI_COMMON_H
#define OSI_COMMON_H
#define TEN_POWER_9 0x3B9ACA00U
#define TWO_POWER_32 0x100000000ULL
#define TWO_POWER_31 0x80000000U
#define OSI_NSEC_PER_SEC 1000000000ULL
#define OSI_INVALID_VALUE 0xFFFFFFFFU
/* System clock is 62.5MHz */
#define OSI_ETHER_SYSCLOCK 62500000ULL
#define OSI_PAUSE_FRAMES_ENABLE 0U
#define OSI_PAUSE_FRAMES_DISABLE 1U
#define OSI_FLOW_CTRL_TX OSI_BIT(0)
@@ -36,6 +45,25 @@
#ifndef ULONG_MAX
#define ULONG_MAX (~0UL)
#endif
#ifndef UNIT_MAX
#define UINT_MAX (~0U)
#endif
/* MAC Time stamp contorl reg bit fields */
#define OSI_MAC_TCR_TSENA OSI_BIT(0)
#define OSI_MAC_TCR_TSCFUPDT OSI_BIT(1)
#define OSI_MAC_TCR_TSENALL OSI_BIT(8)
#define OSI_MAC_TCR_TSCTRLSSR OSI_BIT(9)
#define OSI_MAC_TCR_TSVER2ENA OSI_BIT(10)
#define OSI_MAC_TCR_TSIPENA OSI_BIT(11)
#define OSI_MAC_TCR_TSIPV6ENA OSI_BIT(12)
#define OSI_MAC_TCR_TSIPV4ENA OSI_BIT(13)
#define OSI_MAC_TCR_TSEVENTENA OSI_BIT(14)
#define OSI_MAC_TCR_TSMASTERENA OSI_BIT(15)
#define OSI_MAC_TCR_SNAPTYPSEL_1 OSI_BIT(16)
#define OSI_MAC_TCR_SNAPTYPSEL_2 OSI_BIT(17)
#define OSI_MAC_TCR_SNAPTYPSEL_3 (OSI_BIT(16) | OSI_BIT(17))
#define OSI_MAC_TCR_AV8021ASMEN OSI_BIT(28)
/* Default maximum Gaint Packet Size Limit */
#define OSI_MAX_MTU_SIZE 9000U