regtable.c 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. /*
  2. * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #include "targaddrs.h"
  27. #include "cepci.h"
  28. #include "regtable.h"
  29. #include "ar6320def.h"
  30. #include "ar6320v2def.h"
  31. #include "hif_main.h"
  32. #include "adrastea_reg_def.h"
  33. #include "targetdef.h"
  34. #include "hostdef.h"
  35. void hif_target_register_tbl_attach(struct hif_softc *scn, u32 target_type)
  36. {
  37. switch (target_type) {
  38. case TARGET_TYPE_AR6320:
  39. scn->targetdef = &ar6320_targetdef;
  40. scn->target_ce_def = &ar6320_ce_targetdef;
  41. break;
  42. case TARGET_TYPE_AR6320V2:
  43. scn->targetdef = &ar6320v2_targetdef;
  44. scn->target_ce_def = &ar6320v2_ce_targetdef;
  45. break;
  46. case TARGET_TYPE_ADRASTEA:
  47. scn->targetdef = &adrastea_targetdef;
  48. scn->target_ce_def = &adrastea_ce_targetdef;
  49. break;
  50. #if defined(AR6002_HEADERS_DEF)
  51. case TARGET_TYPE_AR6002:
  52. scn->targetdef = AR6002_TARGETdef;
  53. break;
  54. #endif
  55. #if defined(AR6003_HEADERS_DEF)
  56. case TARGET_TYPE_AR6003:
  57. scn->targetdef = AR6003_TARGETdef;
  58. break;
  59. #endif
  60. #if defined(AR6004_HEADERS_DEF)
  61. case TARGET_TYPE_AR6004:
  62. scn->targetdef = AR6004_TARGETdef;
  63. break;
  64. #endif
  65. #if defined(AR9888_HEADERS_DEF)
  66. case TARGET_TYPE_AR9888:
  67. scn->targetdef = AR9888_TARGETdef;
  68. scn->target_ce_def = AR9888_CE_TARGETdef;
  69. break;
  70. #endif
  71. #if defined(AR9888V2_HEADERS_DEF)
  72. case TARGET_TYPE_AR9888V2:
  73. scn->targetdef = AR9888V2_TARGETdef;
  74. scn->target_ce_def = AR9888_CE_TARGETdef;
  75. break;
  76. #endif
  77. #if defined(AR900B_HEADERS_DEF)
  78. case TARGET_TYPE_AR900B:
  79. scn->targetdef = AR900B_TARGETdef;
  80. scn->target_ce_def = AR900B_CE_TARGETdef;
  81. break;
  82. #endif
  83. #if defined(QCA9984_HEADERS_DEF)
  84. case TARGET_TYPE_QCA9984:
  85. scn->targetdef = QCA9984_TARGETdef;
  86. scn->target_ce_def = QCA9984_CE_TARGETdef;
  87. break;
  88. #endif
  89. #if defined(QCA9888_HEADERS_DEF)
  90. case TARGET_TYPE_QCA9888:
  91. scn->targetdef = QCA9888_TARGETdef;
  92. scn->target_ce_def = QCA9888_CE_TARGETdef;
  93. break;
  94. #endif
  95. #ifdef ATH_AHB
  96. #if defined(IPQ4019_HEADERS_DEF)
  97. case TARGET_TYPE_IPQ4019:
  98. scn->targetdef = IPQ4019_TARGETdef;
  99. scn->target_ce_def = IPQ4019_CE_TARGETdef;
  100. break;
  101. #endif
  102. #endif
  103. #if defined(QCA8074_HEADERS_DEF)
  104. case TARGET_TYPE_QCA8074:
  105. scn->targetdef = QCA8074_TARGETdef;
  106. scn->target_ce_def = QCA8074_CE_TARGETdef;
  107. break;
  108. #endif
  109. #if defined(QCA6290_HEADERS_DEF)
  110. /* use the same defs for HAWKEYE & NAPIER */
  111. case TARGET_TYPE_QCA6290:
  112. scn->targetdef = QCA6290_TARGETdef;
  113. scn->target_ce_def = QCA6290_CE_TARGETdef;
  114. break;
  115. #endif
  116. default:
  117. break;
  118. }
  119. }
  120. void hif_register_tbl_attach(struct hif_softc *scn, u32 hif_type)
  121. {
  122. switch (hif_type) {
  123. case HIF_TYPE_AR6320V2:
  124. scn->hostdef = &ar6320v2_hostdef;
  125. break;
  126. case HIF_TYPE_ADRASTEA:
  127. scn->hostdef = &adrastea_hostdef;
  128. scn->host_shadow_regs = &adrastea_host_shadow_regs;
  129. break;
  130. #if defined(AR6002_HEADERS_DEF)
  131. case HIF_TYPE_AR6002:
  132. scn->hostdef = AR6002_HOSTdef;
  133. break;
  134. #endif
  135. #if defined(AR6003_HEADERS_DEF)
  136. case HIF_TYPE_AR6003:
  137. scn->hostdef = AR6003_HOSTdef;
  138. break;
  139. #endif
  140. #if defined(AR6004_HEADERS_DEF)
  141. case HIF_TYPE_AR6004:
  142. scn->hostdef = AR6004_HOSTdef;
  143. break;
  144. #endif
  145. #if defined(AR9888_HEADERS_DEF)
  146. case HIF_TYPE_AR9888:
  147. scn->hostdef = AR9888_HOSTdef;
  148. break;
  149. #endif
  150. #if defined(AR9888V2_HEADERS_DEF)
  151. case HIF_TYPE_AR9888V2:
  152. scn->hostdef = AR9888V2_HOSTdef;
  153. break;
  154. #endif
  155. #if defined(AR900B_HEADERS_DEF)
  156. case HIF_TYPE_AR900B:
  157. scn->hostdef = AR900B_HOSTdef;
  158. break;
  159. #endif
  160. #if defined(QCA9984_HEADERS_DEF)
  161. case HIF_TYPE_QCA9984:
  162. scn->hostdef = QCA9984_HOSTdef;
  163. break;
  164. #endif
  165. #if defined(QCA9888_HEADERS_DEF)
  166. case HIF_TYPE_QCA9888:
  167. scn->hostdef = QCA9888_HOSTdef;
  168. break;
  169. #endif
  170. #ifdef ATH_AHB
  171. #if defined(IPQ4019_HEADERS_DEF)
  172. case HIF_TYPE_IPQ4019:
  173. scn->hostdef = IPQ4019_HOSTdef;
  174. break;
  175. #endif
  176. #endif
  177. #if defined(QCA8074_HEADERS_DEF)
  178. case HIF_TYPE_QCA8074:
  179. scn->hostdef = QCA8074_HOSTdef;
  180. break;
  181. #endif
  182. #if defined(QCA6290_HEADERS_DEF)
  183. case HIF_TYPE_QCA6290:
  184. scn->hostdef = QCA6290_HOSTdef;
  185. break;
  186. #endif
  187. default:
  188. break;
  189. }
  190. }