i2c_regs.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. /*
  2. * Copyright (c) 2016 - 2021, Broadcom
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef I2C_REGS
  7. #define I2C_REGS
  8. /* SMBUS Config register */
  9. #define SMB_CFG_REG 0x0U
  10. #define SMB_CFG_RST_MASK 0x80000000U
  11. #define SMB_CFG_RST_SHIFT 31U
  12. #define SMB_CFG_SMBEN_MASK 0x40000000U
  13. #define SMB_CFG_SMBEN_SHIFT 30U
  14. #define SMB_CFG_BITBANGEN_MASK 0x20000000U
  15. #define SMB_CFG_BITBANGEN_SHIFT 29U
  16. #define SMB_CFG_EN_NIC_SMBADDR0_MASK 0x10000000U
  17. #define SMB_CFG_EN_NIC_SMBADDR0_SHIFT 28U
  18. #define SMB_CFG_PROMISCMODE_MASK 0x08000000U
  19. #define SMB_CFG_PROMISCMODE_SHIFT 27U
  20. #define SMB_CFG_TSTMPCNTEN_MASK 0x04000000U
  21. #define SMB_CFG_TSTMPCNTEN_SHIFT 26U
  22. #define SMB_CFG_MSTRRTRYCNT_MASK 0x000F0000U
  23. #define SMB_CFG_MSTRRTRYCNT_SHIFT 16U
  24. /* SMBUS Timing config register */
  25. #define SMB_TIMGCFG_REG 0x4U
  26. #define SMB_TIMGCFG_MODE400_MASK 0x80000000U
  27. #define SMB_TIMGCFG_MODE400_SHIFT 31U
  28. #define SMB_TIMGCFG_RNDSLVSTR_MASK 0x7F000000U
  29. #define SMB_TIMGCFG_RNDSLVSTR_SHIFT 24U
  30. #define SMB_TIMGCFG_PERSLVSTR_MASK 0x00FF0000U
  31. #define SMB_TIMGCFG_PERSLVSTR_SHIFT 16U
  32. #define SMB_TIMGCFG_IDLTIME_MASK 0x0000FF00U
  33. #define SMB_TIMGCFG_IDLTIME_SHIFT 8U
  34. /* SMBUS Slave address register */
  35. #define SMB_ADDR_REG 0x8U
  36. #define SMB_EN_NIC_SMBADDR3_MASK 0x80000000U
  37. #define SMB_EN_NIC_SMBADDR3_SHIFT 31U
  38. #define SMB_NIC_SMBADDR3_MASK 0x7F000000U
  39. #define SMB_NIC_SMBADDR3_SHIFT 24U
  40. #define SMB_EN_NIC_SMBADDR2_MASK 0x00800000U
  41. #define SMB_EN_NIC_SMBADDR2_SHIFT 23U
  42. #define SMB_NIC_SMBADDR2_MASK 0x007F0000U
  43. #define SMB_NIC_SMBADDR2_SHIFT 16U
  44. #define SMB_EN_NIC_SMBADDR1_MASK 0x00008000U
  45. #define SMB_EN_NIC_SMBADDR1_SHIFT 15U
  46. #define SMB_NIC_SMBADDR1_MASK 0x00007F00U
  47. #define SMB_NIC_SMBADDR1_SHIFT 8U
  48. #define SMB_EN_NIC_SMBADDR0_MASK 0x00000080U
  49. #define SMB_EN_NIC_SMBADDR0_SHIFT 7U
  50. #define SMB_NIC_SMBADDR0_MASK 0x0000007FU
  51. #define SMB_NIC_SMBADDR0_SHIFT 0U
  52. /* SMBUS Master FIFO control register */
  53. #define SMB_MSTRFIFOCTL_REG 0xCU
  54. #define SMB_MSTRRXFIFOFLSH_MASK 0x80000000U
  55. #define SMB_MSTRRXFIFOFLSH_SHIFT 31U
  56. #define SMB_MSTRTXFIFOFLSH_MASK 0x40000000U
  57. #define SMB_MSTRTXFIFOFLSH_SHIFT 30U
  58. #define SMB_MSTRRXPKTCNT_MASK 0x007F0000U
  59. #define SMB_MSTRRXPKTCNT_SHIFT 16U
  60. #define SMB_MSTRRXFIFOTHR_MASK 0x00003F00U
  61. #define SMB_MSTRRXFIFOTHR_SHIFT 8U
  62. /* SMBUS Slave FIFO control register */
  63. #define SMB_SLVFIFOCTL_REG 0x10U
  64. #define SMB_SLVRXFIFOFLSH_MASK 0x80000000U
  65. #define SMB_SLVRXFIFOFLSH_SHIFT 31U
  66. #define SMB_SLVTXFIFOFLSH_MASK 0x40000000U
  67. #define SMB_SLVTXFIFOFLSH_SHIFT 30U
  68. #define SMB_SLVRXPKTCNT_MASK 0x007F0000U
  69. #define SMB_SLVRXPKTCNT_SHIFT 16U
  70. #define SMB_SLVRXFIFOTHR_MASK 0x00003F00U
  71. #define SMB_SLVRXFIFOTHR_SHIFT 8U
  72. /* SMBUS Bit-bang mode control register */
  73. #define SMB_BITBANGCTL_REG 0x14U
  74. #define SMB_SMBCLKIN_MASK 0x80000000U
  75. #define SMB_SMBCLKIN_SHIFT 31U
  76. #define SMB_SMBCLKOUTEN_MASK 0x40000000U
  77. #define SMB_SMBCLKOUTEN_SHIFT 30U
  78. #define SMB_SMBDATAIN_MASK 0x20000000U
  79. #define SMB_SMBDATAIN_SHIFT 29U
  80. #define SMB_SMBDATAOUTEN_MASK 0x10000000U
  81. #define SMB_SMBDATAOUTEN_SHIFT 28U
  82. /* SMBUS Master command register */
  83. #define SMB_MSTRCMD_REG 0x30U
  84. #define SMB_MSTRSTARTBUSYCMD_MASK 0x80000000U
  85. #define SMB_MSTRSTARTBUSYCMD_SHIFT 31U
  86. #define SMB_MSTRABORT_MASK 0x40000000U
  87. #define SMB_MSTRABORT_SHIFT 30U
  88. #define SMB_MSTRSTS_MASK 0x0E000000U
  89. #define SMB_MSTRSTS_SHIFT 25U
  90. #define SMB_MSTRSMBUSPROTO_MASK 0x00001E00U
  91. #define SMB_MSTRSMBUSPROTO_SHIFT 9U
  92. #define SMB_MSTRPEC_MASK 0x00000100U
  93. #define SMB_MSTRPEC_SHIFT 8U
  94. #define SMB_MSTRRDBYTECNT_MASK 0x000000FFU
  95. #define SMB_MSTRRDBYTECNT_SHIFT 0U
  96. /* SMBUS Slave command register */
  97. #define SMB_SLVCMD_REG 0x34U
  98. #define SMB_SLVSTARTBUSYCMD_MASK 0x80000000U
  99. #define SMB_SLVSTARTBUSYCMD_SHIFT 31U
  100. #define SMB_SLVABORT_MASK 0x40000000U
  101. #define SMB_SLVABORT_SHIFT 30U
  102. #define SMB_SLVSTS_MASK 0x03800000U
  103. #define SMB_SLVSTS_SHIFT 23U
  104. #define SMB_SLVPEC_MASK 0x00000100U
  105. #define SMB_SLVPEC_SHIFT 8U
  106. /* SMBUS Event enable register */
  107. #define SMB_EVTEN_REG 0x38U
  108. #define SMB_MSTRRXFIFOFULLEN_MASK 0x80000000U
  109. #define SMB_MSTRRXFIFOFULLEN_SHIFT 31U
  110. #define SMB_MSTRRXFIFOTHRHITEN_MASK 0x40000000U
  111. #define SMB_MSTRRXFIFOTHRHITEN_SHIFT 30U
  112. #define SMB_MSTRRXEVTEN_MASK 0x20000000U
  113. #define SMB_MSTRRXEVTEN_SHIFT 29U
  114. #define SMB_MSTRSTARTBUSYEN_MASK 0x10000000U
  115. #define SMB_MSTRSTARTBUSYEN_SHIFT 28U
  116. #define SMB_MSTRTXUNDEN_MASK 0x08000000U
  117. #define SMB_MSTRTXUNDEN_SHIFT 27U
  118. #define SMB_SLVRXFIFOFULLEN_MASK 0x04000000U
  119. #define SMB_SLVRXFIFOFULLEN_SHIFT 26U
  120. #define SMB_SLVRXFIFOTHRHITEN_MASK 0x02000000U
  121. #define SMB_SLVRXFIFOTHRHITEN_SHIFT 25U
  122. #define SMB_SLVRXEVTEN_MASK 0x01000000U
  123. #define SMB_SLVRXEVTEN_SHIFT 24U
  124. #define SMB_SLVSTARTBUSYEN_MASK 0x00800000U
  125. #define SMB_SLVSTARTBUSYEN_SHIFT 23U
  126. #define SMB_SLVTXUNDEN_MASK 0x00400000U
  127. #define SMB_SLVTXUNDEN_SHIFT 22U
  128. #define SMB_SLVRDEVTEN_MASK 0x00200000U
  129. #define SMB_SLVRDEVTEN_SHIFT 21U
  130. /* SMBUS Event status register */
  131. #define SMB_EVTSTS_REG 0x3CU
  132. #define SMB_MSTRRXFIFOFULLSTS_MASK 0x80000000U
  133. #define SMB_MSTRRXFIFOFULLSTS_SHIFT 31U
  134. #define SMB_MSTRRXFIFOTHRHITSTS_MASK 0x40000000U
  135. #define SMB_MSTRRXFIFOTHRHITSTS_SHIFT 30U
  136. #define SMB_MSTRRXEVTSTS_MASK 0x20000000U
  137. #define SMB_MSTRRXEVTSTS_SHIFT 29U
  138. #define SMB_MSTRSTARTBUSYSTS_MASK 0x10000000U
  139. #define SMB_MSTRSTARTBUSYSTS_SHIFT 28U
  140. #define SMB_MSTRTXUNDSTS_MASK 0x08000000U
  141. #define SMB_MSTRTXUNDSTS_SHIFT 27U
  142. #define SMB_SLVRXFIFOFULLSTS_MASK 0x04000000U
  143. #define SMB_SLVRXFIFOFULLSTS_SHIFT 26U
  144. #define SMB_SLVRXFIFOTHRHITSTS_MASK 0x02000000U
  145. #define SMB_SLVRXFIFOTHRHITSTS_SHIFT 25U
  146. #define SMB_SLVRXEVTSTS_MASK 0x01000000U
  147. #define SMB_SLVRXEVTSTS_SHIFT 24U
  148. #define SMB_SLVSTARTBUSYSTS_MASK 0x00800000U
  149. #define SMB_SLVSTARTBUSYSTS_SHIFT 23U
  150. #define SMB_SLVTXUNDSTS_MASK 0x00400000U
  151. #define SMB_SLVTXUNDSTS_SHIFT 22U
  152. #define SMB_SLVRDEVTSTS_MASK 0x00200000U
  153. #define SMB_SLVRDEVTSTS_SHIFT 21U
  154. /* SMBUS Master data write register */
  155. #define SMB_MSTRDATAWR_REG 0x40U
  156. #define SMB_MSTRWRSTS_MASK 0x80000000U
  157. #define SMB_MSTRWRSTS_SHIFT 31U
  158. #define SMB_MSTRWRDATA_MASK 0x000000FFU
  159. #define SMB_MSTRWRDATA_SHIFT 0U
  160. /* SMBUS Master data read register */
  161. #define SMB_MSTRDATARD_REG 0x44U
  162. #define SMB_MSTRRDSTS_MASK 0xC0000000U
  163. #define SMB_MSTRRDSTS_SHIFT 30U
  164. #define SMB_MSTRRDPECERR_MASK 0x20000000U
  165. #define SMB_MSTRRDPECERR_SHIFT 29U
  166. #define SMB_MSTRRDDATA_MASK 0x000000FFU
  167. #define SMB_MSTRRDDATA_SHIFT 0U
  168. /* SMBUS Slave data write register */
  169. #define SMB_SLVDATAWR_REG 0x48U
  170. #define SMB_SLVWRSTS_MASK 0x80000000U
  171. #define SMB_SLVWRSTS_SHIFT 31U
  172. #define SMB_SLVWRDATA_MASK 0x000000FFU
  173. #define SMB_SLVWRDATA_SHIFT 0U
  174. /* SMBUS Slave data read register */
  175. #define SMB_SLVDATARD_REG 0x4CU
  176. #define SMB_SLVRDSTS_MASK 0xC0000000U
  177. #define SMB_SLVRDSTS_SHIFT 30U
  178. #define SMB_SLVRDERRSTS_MASK 0x30000000U
  179. #define SMB_SLVRDERRSTS_SHIFT 28U
  180. #define SMB_SLVRDDATA_MASK 0x000000FFU
  181. #define SMB_SLVRDDATA_SHIFT 0U
  182. #endif /* I2C_REGS */