ipq4019def.c 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. /*
  2. * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #if defined(IPQ4019_HEADERS_DEF)
  19. #define AR900B 1
  20. #define WLAN_HEADERS 1
  21. #include "common_drv.h"
  22. #include "IPQ4019/soc_addrs.h"
  23. #include "IPQ4019/extra/hw/apb_map.h"
  24. #ifdef WLAN_HEADERS
  25. #include "IPQ4019/extra/hw/wifi_top_reg_map.h"
  26. #include "IPQ4019/hw/rtc_soc_reg.h"
  27. #endif
  28. #include "IPQ4019/hw/ce_wrapper_reg_csr.h"
  29. #include "IPQ4019/extra/hw/soc_core_reg.h"
  30. #include "IPQ4019/extra/hw/ce_reg_csr.h"
  31. #include <IPQ4019/hw/interface/rx_location_info.h>
  32. #include <IPQ4019/hw/interface/rx_pkt_end.h>
  33. #include <IPQ4019/hw/interface/rx_phy_ppdu_end.h>
  34. #include <IPQ4019/hw/interface/rx_timing_offset.h>
  35. #include <IPQ4019/hw/interface/rx_location_info.h>
  36. #include <IPQ4019/hw/tlv/rx_ppdu_start.h>
  37. #include <IPQ4019/hw/tlv/rx_ppdu_end.h>
  38. #include <IPQ4019/hw/tlv/rx_mpdu_start.h>
  39. #include <IPQ4019/hw/tlv/rx_mpdu_end.h>
  40. #include <IPQ4019/hw/tlv/rx_msdu_start.h>
  41. #include <IPQ4019/hw/tlv/rx_msdu_end.h>
  42. #include <IPQ4019/hw/tlv/rx_attention.h>
  43. #include <IPQ4019/hw/tlv/rx_frag_info.h>
  44. #include <IPQ4019/hw/datastruct/msdu_link_ext.h>
  45. /* Base address is defined in pcie_local_reg.h. Macros which access the
  46. * registers include the base address in their definition.
  47. */
  48. #define FW_EVENT_PENDING_ADDRESS (WIFICMN_SCRATCH_3_ADDRESS)
  49. #define DRAM_BASE_ADDRESS TARG_DRAM_START
  50. /* Backwards compatibility -- TBDXXX */
  51. #define MISSING 0
  52. #define WLAN_SYSTEM_SLEEP_DISABLE_LSB WIFI_SYSTEM_SLEEP_DISABLE_LSB
  53. #define WLAN_SYSTEM_SLEEP_DISABLE_MASK WIFI_SYSTEM_SLEEP_DISABLE_MASK
  54. #define WLAN_RESET_CONTROL_COLD_RST_MASK WIFI_RESET_CONTROL_MAC_COLD_RST_MASK
  55. #define WLAN_RESET_CONTROL_WARM_RST_MASK WIFI_RESET_CONTROL_MAC_WARM_RST_MASK
  56. #define SOC_CLOCK_CONTROL_OFFSET SOC_CLOCK_CONTROL_ADDRESS
  57. #define SOC_RESET_CONTROL_OFFSET SOC_RESET_CONTROL_ADDRESS
  58. #define CPU_CLOCK_OFFSET SOC_CPU_CLOCK_ADDRESS
  59. #define SOC_LPO_CAL_OFFSET SOC_LPO_CAL_ADDRESS
  60. #define SOC_RESET_CONTROL_CE_RST_MASK WIFI_RESET_CONTROL_CE_RESET_MASK
  61. #define WLAN_SYSTEM_SLEEP_OFFSET WIFI_SYSTEM_SLEEP_ADDRESS
  62. #define WLAN_RESET_CONTROL_OFFSET WIFI_RESET_CONTROL_ADDRESS
  63. #define CLOCK_CONTROL_OFFSET SOC_CLOCK_CONTROL_OFFSET
  64. #define CLOCK_CONTROL_SI0_CLK_MASK SOC_CLOCK_CONTROL_SI0_CLK_MASK
  65. #define RESET_CONTROL_SI0_RST_MASK SOC_RESET_CONTROL_SI0_RST_MASK
  66. #define GPIO_BASE_ADDRESS WLAN_GPIO_BASE_ADDRESS
  67. #define GPIO_PIN0_OFFSET MISSING
  68. #define GPIO_PIN1_OFFSET MISSING
  69. #define GPIO_PIN0_CONFIG_MASK MISSING
  70. #define GPIO_PIN1_CONFIG_MASK MISSING
  71. #define SCRATCH_BASE_ADDRESS SOC_CORE_BASE_ADDRESS
  72. #define LOCAL_SCRATCH_OFFSET 0x18
  73. #define GPIO_PIN10_OFFSET WLAN_GPIO_PIN10_ADDRESS
  74. #define GPIO_PIN11_OFFSET WLAN_GPIO_PIN11_ADDRESS
  75. #define GPIO_PIN12_OFFSET WLAN_GPIO_PIN12_ADDRESS
  76. #define GPIO_PIN13_OFFSET WLAN_GPIO_PIN13_ADDRESS
  77. /*TBD:dakota Check if these can be removed for dakota */
  78. #define CPU_CLOCK_STANDARD_LSB SOC_CPU_CLOCK_STANDARD_LSB
  79. #define CPU_CLOCK_STANDARD_MASK SOC_CPU_CLOCK_STANDARD_MASK
  80. #define LPO_CAL_ENABLE_LSB SOC_LPO_CAL_ENABLE_LSB
  81. #define LPO_CAL_ENABLE_MASK SOC_LPO_CAL_ENABLE_MASK
  82. #define ANALOG_INTF_BASE_ADDRESS WLAN_ANALOG_INTF_BASE_ADDRESS
  83. #define MBOX_BASE_ADDRESS MISSING
  84. #define INT_STATUS_ENABLE_ERROR_LSB MISSING
  85. #define INT_STATUS_ENABLE_ERROR_MASK MISSING
  86. #define INT_STATUS_ENABLE_CPU_LSB MISSING
  87. #define INT_STATUS_ENABLE_CPU_MASK MISSING
  88. #define INT_STATUS_ENABLE_COUNTER_LSB MISSING
  89. #define INT_STATUS_ENABLE_COUNTER_MASK MISSING
  90. #define INT_STATUS_ENABLE_MBOX_DATA_LSB MISSING
  91. #define INT_STATUS_ENABLE_MBOX_DATA_MASK MISSING
  92. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB MISSING
  93. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK MISSING
  94. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB MISSING
  95. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK MISSING
  96. #define COUNTER_INT_STATUS_ENABLE_BIT_LSB MISSING
  97. #define COUNTER_INT_STATUS_ENABLE_BIT_MASK MISSING
  98. #define INT_STATUS_ENABLE_ADDRESS MISSING
  99. #define CPU_INT_STATUS_ENABLE_BIT_LSB MISSING
  100. #define CPU_INT_STATUS_ENABLE_BIT_MASK MISSING
  101. #define HOST_INT_STATUS_ADDRESS MISSING
  102. #define CPU_INT_STATUS_ADDRESS MISSING
  103. #define ERROR_INT_STATUS_ADDRESS MISSING
  104. #define ERROR_INT_STATUS_WAKEUP_MASK MISSING
  105. #define ERROR_INT_STATUS_WAKEUP_LSB MISSING
  106. #define ERROR_INT_STATUS_RX_UNDERFLOW_MASK MISSING
  107. #define ERROR_INT_STATUS_RX_UNDERFLOW_LSB MISSING
  108. #define ERROR_INT_STATUS_TX_OVERFLOW_MASK MISSING
  109. #define ERROR_INT_STATUS_TX_OVERFLOW_LSB MISSING
  110. #define COUNT_DEC_ADDRESS MISSING
  111. #define HOST_INT_STATUS_CPU_MASK MISSING
  112. #define HOST_INT_STATUS_CPU_LSB MISSING
  113. #define HOST_INT_STATUS_ERROR_MASK MISSING
  114. #define HOST_INT_STATUS_ERROR_LSB MISSING
  115. #define HOST_INT_STATUS_COUNTER_MASK MISSING
  116. #define HOST_INT_STATUS_COUNTER_LSB MISSING
  117. #define RX_LOOKAHEAD_VALID_ADDRESS MISSING
  118. #define WINDOW_DATA_ADDRESS MISSING
  119. #define WINDOW_READ_ADDR_ADDRESS MISSING
  120. #define WINDOW_WRITE_ADDR_ADDRESS MISSING
  121. /* MAC Descriptor */
  122. #define RX_PPDU_END_ANTENNA_OFFSET_DWORD (RX_PPDU_END_25_RX_ANTENNA_OFFSET >> 2)
  123. /* GPIO Register */
  124. #define GPIO_ENABLE_W1TS_LOW_ADDRESS MISSING
  125. #define GPIO_PIN0_CONFIG_LSB MISSING
  126. #define GPIO_PIN0_PAD_PULL_LSB MISSING
  127. #define GPIO_PIN0_PAD_PULL_MASK MISSING
  128. /* SI reg */
  129. #define SI_CONFIG_ERR_INT_MASK MISSING
  130. #define SI_CONFIG_ERR_INT_LSB MISSING
  131. /* CE descriptor */
  132. #define CE_SRC_DESC_SIZE_DWORD 2
  133. #define CE_DEST_DESC_SIZE_DWORD 2
  134. #define CE_SRC_DESC_SRC_PTR_OFFSET_DWORD 0
  135. #define CE_SRC_DESC_INFO_OFFSET_DWORD 1
  136. #define CE_DEST_DESC_DEST_PTR_OFFSET_DWORD 0
  137. #define CE_DEST_DESC_INFO_OFFSET_DWORD 1
  138. #if _BYTE_ORDER == _BIG_ENDIAN
  139. #define CE_SRC_DESC_INFO_NBYTES_MASK 0xFFFF0000
  140. #define CE_SRC_DESC_INFO_NBYTES_SHIFT 16
  141. #define CE_SRC_DESC_INFO_GATHER_MASK 0x00008000
  142. #define CE_SRC_DESC_INFO_GATHER_SHIFT 15
  143. #define CE_SRC_DESC_INFO_BYTE_SWAP_MASK 0x00004000
  144. #define CE_SRC_DESC_INFO_BYTE_SWAP_SHIFT 14
  145. #define CE_SRC_DESC_INFO_HOST_INT_DISABLE_MASK 0x00002000
  146. #define CE_SRC_DESC_INFO_HOST_INT_DISABLE_SHIFT 13
  147. #define CE_SRC_DESC_INFO_TARGET_INT_DISABLE_MASK 0x00001000
  148. #define CE_SRC_DESC_INFO_TARGET_INT_DISABLE_SHIFT 12
  149. #define CE_SRC_DESC_INFO_META_DATA_MASK 0x00000FFF
  150. #define CE_SRC_DESC_INFO_META_DATA_SHIFT 0
  151. #else
  152. #define CE_SRC_DESC_INFO_NBYTES_MASK 0x0000FFFF
  153. #define CE_SRC_DESC_INFO_NBYTES_SHIFT 0
  154. #define CE_SRC_DESC_INFO_GATHER_MASK 0x00010000
  155. #define CE_SRC_DESC_INFO_GATHER_SHIFT 16
  156. #define CE_SRC_DESC_INFO_BYTE_SWAP_MASK 0x00020000
  157. #define CE_SRC_DESC_INFO_BYTE_SWAP_SHIFT 17
  158. #define CE_SRC_DESC_INFO_HOST_INT_DISABLE_MASK 0x00040000
  159. #define CE_SRC_DESC_INFO_HOST_INT_DISABLE_SHIFT 18
  160. #define CE_SRC_DESC_INFO_TARGET_INT_DISABLE_MASK 0x00080000
  161. #define CE_SRC_DESC_INFO_TARGET_INT_DISABLE_SHIFT 19
  162. #define CE_SRC_DESC_INFO_META_DATA_MASK 0xFFF00000
  163. #define CE_SRC_DESC_INFO_META_DATA_SHIFT 20
  164. #endif
  165. #if _BYTE_ORDER == _BIG_ENDIAN
  166. #define CE_DEST_DESC_INFO_NBYTES_MASK 0xFFFF0000
  167. #define CE_DEST_DESC_INFO_NBYTES_SHIFT 16
  168. #define CE_DEST_DESC_INFO_GATHER_MASK 0x00008000
  169. #define CE_DEST_DESC_INFO_GATHER_SHIFT 15
  170. #define CE_DEST_DESC_INFO_BYTE_SWAP_MASK 0x00004000
  171. #define CE_DEST_DESC_INFO_BYTE_SWAP_SHIFT 14
  172. #define CE_DEST_DESC_INFO_HOST_INT_DISABLE_MASK 0x00002000
  173. #define CE_DEST_DESC_INFO_HOST_INT_DISABLE_SHIFT 13
  174. #define CE_DEST_DESC_INFO_TARGET_INT_DISABLE_MASK 0x00001000
  175. #define CE_DEST_DESC_INFO_TARGET_INT_DISABLE_SHIFT 12
  176. #define CE_DEST_DESC_INFO_META_DATA_MASK 0x00000FFF
  177. #define CE_DEST_DESC_INFO_META_DATA_SHIFT 0
  178. #else
  179. #define CE_DEST_DESC_INFO_NBYTES_MASK 0x0000FFFF
  180. #define CE_DEST_DESC_INFO_NBYTES_SHIFT 0
  181. #define CE_DEST_DESC_INFO_GATHER_MASK 0x00010000
  182. #define CE_DEST_DESC_INFO_GATHER_SHIFT 16
  183. #define CE_DEST_DESC_INFO_BYTE_SWAP_MASK 0x00020000
  184. #define CE_DEST_DESC_INFO_BYTE_SWAP_SHIFT 17
  185. #define CE_DEST_DESC_INFO_HOST_INT_DISABLE_MASK 0x00040000
  186. #define CE_DEST_DESC_INFO_HOST_INT_DISABLE_SHIFT 18
  187. #define CE_DEST_DESC_INFO_TARGET_INT_DISABLE_MASK 0x00080000
  188. #define CE_DEST_DESC_INFO_TARGET_INT_DISABLE_SHIFT 19
  189. #define CE_DEST_DESC_INFO_META_DATA_MASK 0xFFF00000
  190. #define CE_DEST_DESC_INFO_META_DATA_SHIFT 20
  191. #endif
  192. #define MY_TARGET_DEF IPQ4019_TARGETdef
  193. #define MY_HOST_DEF IPQ4019_HOSTdef
  194. #define MY_CEREG_DEF IPQ4019_CE_TARGETdef
  195. #define MY_TARGET_BOARD_DATA_SZ IPQ4019_BOARD_DATA_SZ
  196. #define MY_TARGET_BOARD_EXT_DATA_SZ IPQ4019_BOARD_EXT_DATA_SZ
  197. #include "targetdef.h"
  198. #include "hostdef.h"
  199. #else
  200. #include "common_drv.h"
  201. #include "targetdef.h"
  202. #include "hostdef.h"
  203. struct targetdef_s *IPQ4019_TARGETdef;
  204. struct hostdef_s *IPQ4019_HOSTdef;
  205. #endif /* IPQ4019_HEADERS_DEF */