ipa_reg.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef __IPA_REG_H__
  13. #define __IPA_REG_H__
  14. /*
  15. * IPA's BAM specific registers
  16. * Used for IPA HW 1.0 only
  17. */
  18. #define IPA_BAM_REG_BASE_OFST 0x00004000
  19. #define IPA_BAM_CNFG_BITS_OFST 0x7c
  20. #define IPA_BAM_REMAP_SIZE (0x1000)
  21. #define IPA_FILTER_FILTER_EN_BMSK 0x1
  22. #define IPA_FILTER_FILTER_EN_SHFT 0x0
  23. #define IPA_AGGREGATION_SPARE_REG_2_OFST 0x00002094
  24. #define IPA_AGGREGATION_QCNCM_SIG0_SHFT 16
  25. #define IPA_AGGREGATION_QCNCM_SIG1_SHFT 8
  26. #define IPA_AGGREGATION_SPARE_REG_1_OFST 0x00002090
  27. #define IPA_AGGREGATION_SPARE_REG_2_OFST 0x00002094
  28. #define IPA_AGGREGATION_SINGLE_NDP_MSK 0x1
  29. #define IPA_AGGREGATION_SINGLE_NDP_BMSK 0xfffffffe
  30. #define IPA_AGGREGATION_MODE_MSK 0x1
  31. #define IPA_AGGREGATION_MODE_SHFT 31
  32. #define IPA_AGGREGATION_MODE_BMSK 0x7fffffff
  33. #define IPA_AGGREGATION_QCNCM_SIG_BMSK 0xff000000
  34. #define IPA_FILTER_FILTER_EN_BMSK 0x1
  35. #define IPA_FILTER_FILTER_EN_SHFT 0x0
  36. #define IPA_AGGREGATION_HW_TIMER_FIX_MBIM_AGGR_SHFT 2
  37. #define IPA_AGGREGATION_HW_TIMER_FIX_MBIM_AGGR_BMSK 0x4
  38. #define IPA_HEAD_OF_LINE_BLOCK_EN_OFST 0x00000044
  39. /*
  40. * End of IPA 1.0 Registers
  41. */
  42. /*
  43. Common Registers
  44. */
  45. #define IPA_REG_BASE_OFST 0x00020000
  46. #define IPA_COMP_SW_RESET_OFST 0x0000003c
  47. #define IPA_SHARED_MEM_SIZE_OFST_v1 0x00000058
  48. #define IPA_SHARED_MEM_SIZE_OFST_v2 0x00000050
  49. #define IPA_VERSION_OFST 0x00000034
  50. #define IPA_COMP_HW_VERSION_OFST 0x00000030
  51. #define IPA_ROUTE_OFST_v1 0x0000004c
  52. #define IPA_ROUTE_OFST_v2 0x00000044
  53. #define IPA_FILTER_OFST_v1 0x00000050
  54. #define IPA_FILTER_OFST_v2 0x00000048
  55. #define IPA_SHARED_MEM_SIZE_OFST_v1 0x00000058
  56. #define IPA_SHARED_MEM_SIZE_OFST_v2 0x00000050
  57. #define IPA_ENDP_INIT_NAT_n_OFST_v1(n) (0x00000080 + 0x4 * (n))
  58. #define IPA_ENDP_INIT_NAT_n_OFST_v2(n) (0x000000c0 + 0x4 * (n))
  59. #define IPA_ENDP_INIT_HDR_n_OFST_v1(n) (0x000000e0 + 0x4 * (n))
  60. #define IPA_ENDP_INIT_HDR_n_OFST_v2(n) (0x00000120 + 0x4 * (n))
  61. #define IPA_ENDP_INIT_MODE_n_OFST_v1(n) (0x00000140 + 0x4 * (n))
  62. #define IPA_ENDP_INIT_MODE_n_OFST_v2(n) (0x00000170 + 0x4 * (n))
  63. #define IPA_ENDP_INIT_AGGR_n_OFST_v1(n) (0x000001a0 + 0x4 * (n))
  64. #define IPA_ENDP_INIT_AGGR_n_OFST_v2(n) (0x000001c0 + 0x4 * (n))
  65. #define IPA_ENDP_INIT_ROUTE_n_OFST_v1(n) (0x00000200 + 0x4 * (n))
  66. #define IPA_ENDP_INIT_ROUTE_n_OFST_v2(n) (0x00000220 + 0x4 * (n))
  67. #define IPA_ENDP_INIT_ROUTE_n_ROUTE_TABLE_INDEX_BMSK 0x1f
  68. #define IPA_ENDP_INIT_ROUTE_n_ROUTE_TABLE_INDEX_SHFT 0x0
  69. #define IPA_ROUTE_OFST_v1 0x0000004c
  70. #define IPA_ROUTE_OFST_v2 0x00000044
  71. #define IPA_ROUTE_ROUTE_DIS_SHFT 0x0
  72. #define IPA_ROUTE_ROUTE_DIS_BMSK 0x1
  73. #define IPA_ROUTE_ROUTE_DEF_PIPE_SHFT 0x1
  74. #define IPA_ROUTE_ROUTE_DEF_PIPE_BMSK 0x3e
  75. #define IPA_ROUTE_ROUTE_DEF_HDR_TABLE_SHFT 0x6
  76. #define IPA_ROUTE_ROUTE_DEF_HDR_OFST_SHFT 0x7
  77. #define IPA_ROUTE_ROUTE_DEF_HDR_OFST_BMSK 0x1ff80
  78. #define IPA_FILTER_OFST_v1 0x00000050
  79. #define IPA_FILTER_OFST_v2 0x00000048
  80. #define IPA_SRAM_DIRECT_ACCESS_n_OFST(n) (0x00004000 + 0x4 * (n))
  81. #define IPA_ROUTE_ROUTE_DEF_HDR_TABLE_BMSK 0x40
  82. #define IPA_ENDP_INIT_NAT_n_NAT_EN_SHFT 0x0
  83. #define IPA_COMP_CFG_OFST 0x00000038
  84. #define IPA_ENDP_INIT_AGGR_n_AGGR_TIME_LIMIT_BMSK 0x7c00
  85. #define IPA_ENDP_INIT_AGGR_n_AGGR_TIME_LIMIT_SHFT 0xa
  86. #define IPA_ENDP_INIT_AGGR_n_AGGR_BYTE_LIMIT_BMSK 0x3e0
  87. #define IPA_ENDP_INIT_AGGR_n_AGGR_BYTE_LIMIT_SHFT 0x5
  88. #define IPA_ENDP_INIT_AGGR_n_AGGR_TYPE_BMSK 0x1c
  89. #define IPA_ENDP_INIT_AGGR_n_AGGR_TYPE_SHFT 0x2
  90. #define IPA_ENDP_INIT_AGGR_n_AGGR_EN_BMSK 0x3
  91. #define IPA_ENDP_INIT_AGGR_n_AGGR_EN_SHFT 0x0
  92. #define IPA_ENDP_INIT_MODE_n_OFST_v1(n) (0x00000140 + 0x4 * (n))
  93. #define IPA_ENDP_INIT_MODE_n_OFST_v2(n) (0x00000170 + 0x4 * (n))
  94. #define IPA_ENDP_INIT_MODE_n_RMSK 0x7f
  95. #define IPA_ENDP_INIT_MODE_n_MAXn 19
  96. #define IPA_ENDP_INIT_MODE_n_DEST_PIPE_INDEX_BMSK 0x7c
  97. #define IPA_ENDP_INIT_MODE_n_DEST_PIPE_INDEX_SHFT 0x2
  98. #define IPA_ENDP_INIT_MODE_n_MODE_BMSK 0x3
  99. #define IPA_ENDP_INIT_MODE_n_MODE_SHFT 0x0
  100. #define IPA_ENDP_INIT_HDR_n_OFST_v1(n) (0x000000e0 + 0x4 * (n))
  101. #define IPA_ENDP_INIT_HDR_n_OFST_v2(n) (0x00000120 + 0x4 * (n))
  102. #define IPA_ENDP_INIT_HDR_n_HDR_LEN_BMSK 0x3f
  103. #define IPA_ENDP_INIT_HDR_n_HDR_LEN_SHFT 0x0
  104. #define IPA_ENDP_INIT_HDR_n_HDR_ADDITIONAL_CONST_LEN_BMSK 0x7e000
  105. #define IPA_ENDP_INIT_HDR_n_HDR_ADDITIONAL_CONST_LEN_SHFT 0xd
  106. #define IPA_ENDP_INIT_HDR_n_HDR_OFST_PKT_SIZE_BMSK 0x3f00000
  107. #define IPA_ENDP_INIT_HDR_n_HDR_OFST_PKT_SIZE_SHFT 0x14
  108. #define IPA_ENDP_INIT_HDR_n_HDR_OFST_PKT_SIZE_VALID_BMSK 0x80000
  109. #define IPA_ENDP_INIT_HDR_n_HDR_OFST_PKT_SIZE_VALID_SHFT 0x13
  110. #define IPA_ENDP_INIT_HDR_n_HDR_A5_MUX_BMSK 0x4000000
  111. #define IPA_ENDP_INIT_HDR_n_HDR_A5_MUX_SHFT 0x1a
  112. #define IPA_ENDP_INIT_HDR_n_HDR_OFST_METADATA_VALID_BMSK 0x40
  113. #define IPA_ENDP_INIT_HDR_n_HDR_OFST_METADATA_VALID_SHFT 0x6
  114. #define IPA_ENDP_INIT_HDR_n_HDR_OFST_METADATA_BMSK 0x1f80
  115. #define IPA_ENDP_INIT_HDR_n_HDR_OFST_METADATA_SHFT 0x7
  116. #define IPA_ENDP_INIT_NAT_n_OFST_v1(n) (0x00000080 + 0x4 * (n))
  117. #define IPA_ENDP_INIT_NAT_n_OFST_v2(n) (0x000000c0 + 0x4 * (n))
  118. #define IPA_ENDP_INIT_NAT_n_NAT_EN_BMSK 0x3
  119. #define IPA_ENDP_INIT_NAT_n_NAT_EN_SHFT 0x0
  120. /*
  121. IPA HW 1.1 specific Registers
  122. */
  123. #define IPA_FILTER_FILTER_DIS_BMSK 0x1
  124. #define IPA_FILTER_FILTER_DIS_SHFT 0x0
  125. #define IPA_SINGLE_NDP_MODE_OFST 0x00000064
  126. #define IPA_QCNCM_OFST 0x00000060
  127. #define IPA_SPARE_REG_1_OFST 0x00002090
  128. #define IPA_ENDP_INIT_CTRL_n_OFST(n) (0x00000070 + 0x4 * (n))
  129. #define IPA_ENDP_INIT_CTRL_n_RMSK 0x1
  130. #define IPA_ENDP_INIT_CTRL_n_MAXn 19
  131. #define IPA_ENDP_INIT_CTRL_n_ENDP_SUSPEND_BMSK 0x1
  132. #define IPA_ENDP_INIT_CTRL_n_ENDP_SUSPEND_SHFT 0x0
  133. #define IPA_ENDP_INIT_HOL_BLOCK_EN_n_OFST(n) (0x00000270 + 0x4 * (n))
  134. #define IPA_ENDP_INIT_HOL_BLOCK_EN_n_RMSK 0x1
  135. #define IPA_ENDP_INIT_HOL_BLOCK_EN_n_MAXn 19
  136. #define IPA_ENDP_INIT_HOL_BLOCK_EN_n_EN_BMSK 0x1
  137. #define IPA_ENDP_INIT_HOL_BLOCK_EN_n_EN_SHFT 0x0
  138. #define IPA_ENDP_INIT_HOL_BLOCK_TIMER_n_OFST(n) (0x000002c0 + 0x4 * (n))
  139. #define IPA_ENDP_INIT_HOL_BLOCK_TIMER_n_RMSK 0x1ff
  140. #define IPA_ENDP_INIT_HOL_BLOCK_TIMER_n_MAXn 19
  141. #define IPA_ENDP_INIT_HOL_BLOCK_TIMER_n_TIMER_BMSK 0x1ff
  142. #define IPA_ENDP_INIT_HOL_BLOCK_TIMER_n_TIMER_SHFT 0x0
  143. #define IPA_DEBUG_CNT_REG_n_OFST(n) (0x00000340 + 0x4 * (n))
  144. #define IPA_DEBUG_CNT_REG_n_RMSK 0xffffffff
  145. #define IPA_DEBUG_CNT_REG_n_MAXn 15
  146. #define IPA_DEBUG_CNT_REG_n_DBG_CNT_REG_BMSK 0xffffffff
  147. #define IPA_DEBUG_CNT_REG_n_DBG_CNT_REG_SHFT 0x0
  148. #define IPA_DEBUG_CNT_CTRL_n_OFST(n) (0x00000380 + 0x4 * (n))
  149. #define IPA_DEBUG_CNT_CTRL_n_RMSK 0x1ff1f171
  150. #define IPA_DEBUG_CNT_CTRL_n_MAXn 15
  151. #define IPA_DEBUG_CNT_CTRL_n_DBG_CNT_RULE_INDEX_BMSK 0x1ff00000
  152. #define IPA_DEBUG_CNT_CTRL_n_DBG_CNT_RULE_INDEX_SHFT 0x14
  153. #define IPA_DEBUG_CNT_CTRL_n_DBG_CNT_SOURCE_PIPE_BMSK 0x1f000
  154. #define IPA_DEBUG_CNT_CTRL_n_DBG_CNT_SOURCE_PIPE_SHFT 0xc
  155. #define IPA_DEBUG_CNT_CTRL_n_DBG_CNT_PRODUCT_BMSK 0x100
  156. #define IPA_DEBUG_CNT_CTRL_n_DBG_CNT_PRODUCT_SHFT 0x8
  157. #define IPA_DEBUG_CNT_CTRL_n_DBG_CNT_TYPE_BMSK 0x70
  158. #define IPA_DEBUG_CNT_CTRL_n_DBG_CNT_TYPE_SHFT 0x4
  159. #define IPA_DEBUG_CNT_CTRL_n_DBG_CNT_EN_BMSK 0x1
  160. #define IPA_DEBUG_CNT_CTRL_n_DBG_CNT_EN_SHFT 0x0
  161. #endif