regtable.c 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. #if defined(QCA8074_HEADERS_DEF)
  103. case TARGET_TYPE_QCA8074:
  104. scn->targetdef = QCA8074_TARGETdef;
  105. scn->target_ce_def = QCA8074_CE_TARGETdef;
  106. break;
  107. #endif
  108. #endif
  109. default:
  110. break;
  111. }
  112. }
  113. void hif_register_tbl_attach(struct hif_softc *scn, u32 hif_type)
  114. {
  115. switch (hif_type) {
  116. case HIF_TYPE_AR6320V2:
  117. scn->hostdef = &ar6320v2_hostdef;
  118. break;
  119. case HIF_TYPE_ADRASTEA:
  120. scn->hostdef = &adrastea_hostdef;
  121. scn->host_shadow_regs = &adrastea_host_shadow_regs;
  122. break;
  123. #if defined(AR6002_HEADERS_DEF)
  124. case HIF_TYPE_AR6002:
  125. scn->hostdef = AR6002_HOSTdef;
  126. break;
  127. #endif
  128. #if defined(AR6003_HEADERS_DEF)
  129. case HIF_TYPE_AR6003:
  130. scn->hostdef = AR6003_HOSTdef;
  131. break;
  132. #endif
  133. #if defined(AR6004_HEADERS_DEF)
  134. case HIF_TYPE_AR6004:
  135. scn->hostdef = AR6004_HOSTdef;
  136. break;
  137. #endif
  138. #if defined(AR9888_HEADERS_DEF)
  139. case HIF_TYPE_AR9888:
  140. scn->hostdef = AR9888_HOSTdef;
  141. break;
  142. #endif
  143. #if defined(AR9888V2_HEADERS_DEF)
  144. case HIF_TYPE_AR9888V2:
  145. scn->hostdef = AR9888V2_HOSTdef;
  146. break;
  147. #endif
  148. #if defined(AR900B_HEADERS_DEF)
  149. case HIF_TYPE_AR900B:
  150. scn->hostdef = AR900B_HOSTdef;
  151. break;
  152. #endif
  153. #if defined(QCA9984_HEADERS_DEF)
  154. case HIF_TYPE_QCA9984:
  155. scn->hostdef = QCA9984_HOSTdef;
  156. break;
  157. #endif
  158. #if defined(QCA9888_HEADERS_DEF)
  159. case HIF_TYPE_QCA9888:
  160. scn->hostdef = QCA9888_HOSTdef;
  161. break;
  162. #endif
  163. #ifdef ATH_AHB
  164. #if defined(IPQ4019_HEADERS_DEF)
  165. case HIF_TYPE_IPQ4019:
  166. scn->hostdef = IPQ4019_HOSTdef;
  167. break;
  168. #endif
  169. #if defined(QCA8074_HEADERS_DEF)
  170. case HIF_TYPE_QCA8074:
  171. scn->hostdef = QCA8074_HOSTdef;
  172. break;
  173. #endif
  174. #endif
  175. default:
  176. break;
  177. }
  178. }