stmmac_ptp.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /******************************************************************************
  2. PTP Header file
  3. Copyright (C) 2013 Vayavya Labs Pvt Ltd
  4. This program is free software; you can redistribute it and/or modify it
  5. under the terms and conditions of the GNU General Public License,
  6. version 2, as published by the Free Software Foundation.
  7. This program is distributed in the hope it will be useful, but WITHOUT
  8. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  10. more details.
  11. You should have received a copy of the GNU General Public License along with
  12. this program; if not, write to the Free Software Foundation, Inc.,
  13. 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  14. The full GNU General Public License is included in this distribution in
  15. the file called "COPYING".
  16. Author: Rayagond Kokatanur <rayagond@vayavyalabs.com>
  17. ******************************************************************************/
  18. #ifndef __STMMAC_PTP_H__
  19. #define __STMMAC_PTP_H__
  20. /* IEEE 1588 PTP register offsets */
  21. #define PTP_TCR 0x0700 /* Timestamp Control Reg */
  22. #define PTP_SSIR 0x0704 /* Sub-Second Increment Reg */
  23. #define PTP_STSR 0x0708 /* System Time – Seconds Regr */
  24. #define PTP_STNSR 0x070C /* System Time – Nanoseconds Reg */
  25. #define PTP_STSUR 0x0710 /* System Time – Seconds Update Reg */
  26. #define PTP_STNSUR 0x0714 /* System Time – Nanoseconds Update Reg */
  27. #define PTP_TAR 0x0718 /* Timestamp Addend Reg */
  28. #define PTP_TTSR 0x071C /* Target Time Seconds Reg */
  29. #define PTP_TTNSR 0x0720 /* Target Time Nanoseconds Reg */
  30. #define PTP_STHWSR 0x0724 /* System Time - Higher Word Seconds Reg */
  31. #define PTP_TSR 0x0728 /* Timestamp Status */
  32. #define PTP_STNSUR_ADDSUB_SHIFT 31
  33. /* PTP TCR defines */
  34. #define PTP_TCR_TSENA 0x00000001 /* Timestamp Enable */
  35. #define PTP_TCR_TSCFUPDT 0x00000002 /* Timestamp Fine/Coarse Update */
  36. #define PTP_TCR_TSINIT 0x00000004 /* Timestamp Initialize */
  37. #define PTP_TCR_TSUPDT 0x00000008 /* Timestamp Update */
  38. /* Timestamp Interrupt Trigger Enable */
  39. #define PTP_TCR_TSTRIG 0x00000010
  40. #define PTP_TCR_TSADDREG 0x00000020 /* Addend Reg Update */
  41. #define PTP_TCR_TSENALL 0x00000100 /* Enable Timestamp for All Frames */
  42. /* Timestamp Digital or Binary Rollover Control */
  43. #define PTP_TCR_TSCTRLSSR 0x00000200
  44. /* Enable PTP packet Processing for Version 2 Format */
  45. #define PTP_TCR_TSVER2ENA 0x00000400
  46. /* Enable Processing of PTP over Ethernet Frames */
  47. #define PTP_TCR_TSIPENA 0x00000800
  48. /* Enable Processing of PTP Frames Sent over IPv6-UDP */
  49. #define PTP_TCR_TSIPV6ENA 0x00001000
  50. /* Enable Processing of PTP Frames Sent over IPv4-UDP */
  51. #define PTP_TCR_TSIPV4ENA 0x00002000
  52. /* Enable Timestamp Snapshot for Event Messages */
  53. #define PTP_TCR_TSEVNTENA 0x00004000
  54. /* Enable Snapshot for Messages Relevant to Master */
  55. #define PTP_TCR_TSMSTRENA 0x00008000
  56. /* Select PTP packets for Taking Snapshots */
  57. #define PTP_TCR_SNAPTYPSEL_1 0x00010000
  58. /* Enable MAC address for PTP Frame Filtering */
  59. #define PTP_TCR_TSENMACADDR 0x00040000
  60. #endif /* __STMMAC_PTP_H__ */