csl_mdio_def.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /**
  2. * @file csl_mdio.h
  3. *
  4. * @brief
  5. * Header file for functional layer of CSL MDIO.
  6. *
  7. * It contains the various enumerations, structure definitions and function
  8. * declarations
  9. *
  10. * \par
  11. * ============================================================================
  12. * @n (C) Copyright 2009-2013, Texas Instruments, Inc.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions
  16. * are met:
  17. *
  18. * Redistributions of source code must retain the above copyright
  19. * notice, this list of conditions and the following disclaimer.
  20. *
  21. * Redistributions in binary form must reproduce the above copyright
  22. * notice, this list of conditions and the following disclaimer in the
  23. * documentation and/or other materials provided with the
  24. * distribution.
  25. *
  26. * Neither the name of Texas Instruments Incorporated nor the names of
  27. * its contributors may be used to endorse or promote products derived
  28. * from this software without specific prior written permission.
  29. *
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  35. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  36. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  37. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  38. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  39. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  40. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  41. *
  42. */
  43. #ifndef CSL_MDIO_DEF_H
  44. #define CSL_MDIO_DEF_H
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. #include <ti/csl/soc.h>
  49. #include <ti/csl/csl.h>
  50. #include <ti/csl/cslr_mdio.h>
  51. /**
  52. @defgroup CSL_MDIO_SYMBOL MDIO Symbols Defined
  53. @ingroup CSL_MDIO_API
  54. */
  55. /**
  56. @defgroup CSL_MDIO_DATASTRUCT MDIO Data Structures
  57. @ingroup CSL_MDIO_API
  58. */
  59. /**
  60. @defgroup CSL_MDIO_FUNCTION MDIO Functions
  61. @ingroup CSL_MDIO_API
  62. */
  63. /**
  64. @defgroup CSL_MDIO_ENUM MDIO Enumerated Data Types
  65. @ingroup CSL_MDIO_API
  66. */
  67. /**
  68. @addtogroup CSL_MDIO_SYMBOL
  69. @{
  70. */
  71. /**
  72. @}
  73. */
  74. /** @addtogroup CSL_MDIO_DATASTRUCT
  75. @{ */
  76. /** @brief
  77. *
  78. * Holds the MDIO peripheral's version info.
  79. */
  80. typedef struct {
  81. /** Minor revision value */
  82. Uint32 revMin;
  83. /** Major revision value */
  84. Uint32 revMaj;
  85. /** Identifies the type of peripheral */
  86. Uint32 modId;
  87. }CSL_MDIO_VERSION;
  88. /** @brief
  89. *
  90. * Holds the MDIO User Access Register
  91. * contents.
  92. */
  93. typedef struct {
  94. /** Data bits */
  95. Uint16 data;
  96. /** Phy Device Address */
  97. Uint32 phyAddr;
  98. /** Register Address */
  99. Uint32 regAddr;
  100. /** Write bit */
  101. Uint32 write;
  102. /** Acknowledgment bit */
  103. Uint32 ack;
  104. /** GO bit */
  105. Uint32 go;
  106. }CSL_MDIO_USERACCESS;
  107. /** @brief
  108. *
  109. * Holds the MDIO User Phy Select Register
  110. * contents.
  111. */
  112. typedef struct {
  113. /** Link Status determination select bit. Always reads '0' */
  114. Uint16 linkSel;
  115. /** Link Status Change Interrupt Enable bit */
  116. Uint32 bLinkIntEnable;
  117. /** Phy Device Address */
  118. Uint32 phyAddr;
  119. }CSL_MDIO_USERPHYSEL;
  120. #ifdef __cplusplus
  121. }
  122. #endif
  123. #endif /* CSL_MDIO_DEF_H */