rfbuffer.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. /*
  2. * RF Buffer handling functions
  3. *
  4. * Copyright (c) 2009 Nick Kossifidis <mickflemm@gmail.com>
  5. *
  6. * Permission to use, copy, modify, and distribute this software for any
  7. * purpose with or without fee is hereby granted, provided that the above
  8. * copyright notice and this permission notice appear in all copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  11. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  13. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17. *
  18. */
  19. /**
  20. * DOC: RF Buffer registers
  21. *
  22. * There are some special registers on the RF chip
  23. * that control various operation settings related mostly to
  24. * the analog parts (channel, gain adjustment etc).
  25. *
  26. * We don't write on those registers directly but
  27. * we send a data packet on the chip, using a special register,
  28. * that holds all the settings we need. After we've sent the
  29. * data packet, we write on another special register to notify hw
  30. * to apply the settings. This is done so that control registers
  31. * can be dynamically programmed during operation and the settings
  32. * are applied faster on the hw.
  33. *
  34. * We call each data packet an "RF Bank" and all the data we write
  35. * (all RF Banks) "RF Buffer". This file holds initial RF Buffer
  36. * data for the different RF chips, and various info to match RF
  37. * Buffer offsets with specific RF registers so that we can access
  38. * them. We tweak these settings on rfregs_init function.
  39. *
  40. * Also check out reg.h and U.S. Patent 6677779 B1 (about buffer
  41. * registers and control registers):
  42. *
  43. * http://www.google.com/patents?id=qNURAAAAEBAJ
  44. */
  45. /**
  46. * struct ath5k_ini_rfbuffer - Initial RF Buffer settings
  47. * @rfb_bank: RF Bank number
  48. * @rfb_ctrl_register: RF Buffer control register
  49. * @rfb_mode_data: RF Buffer data for each mode
  50. *
  51. * Struct to hold default mode specific RF
  52. * register values (RF Banks) for each chip.
  53. */
  54. struct ath5k_ini_rfbuffer {
  55. u8 rfb_bank;
  56. u16 rfb_ctrl_register;
  57. u32 rfb_mode_data[3];
  58. };
  59. /**
  60. * struct ath5k_rfb_field - An RF Buffer field (register/value)
  61. * @len: Field length
  62. * @pos: Offset on the raw packet
  63. * @col: Used for shifting
  64. *
  65. * Struct to hold RF Buffer field
  66. * infos used to access certain RF
  67. * analog registers
  68. */
  69. struct ath5k_rfb_field {
  70. u8 len;
  71. u16 pos;
  72. u8 col;
  73. };
  74. /**
  75. * struct ath5k_rf_reg - RF analog register definition
  76. * @bank: RF Buffer Bank number
  77. * @index: Register's index on ath5k_rf_regx_idx
  78. * @field: The &struct ath5k_rfb_field
  79. *
  80. * We use this struct to define the set of RF registers
  81. * on each chip that we want to tweak. Some RF registers
  82. * are common between different chip versions so this saves
  83. * us space and complexity because we can refer to an rf
  84. * register by it's index no matter what chip we work with
  85. * as long as it has that register.
  86. */
  87. struct ath5k_rf_reg {
  88. u8 bank;
  89. u8 index;
  90. struct ath5k_rfb_field field;
  91. };
  92. /**
  93. * enum ath5k_rf_regs_idx - Map RF registers to indexes
  94. *
  95. * We do this to handle common bits and make our
  96. * life easier by using an index for each register
  97. * instead of a full rfb_field
  98. */
  99. enum ath5k_rf_regs_idx {
  100. /* BANK 2 */
  101. AR5K_RF_TURBO = 0,
  102. /* BANK 6 */
  103. AR5K_RF_OB_2GHZ,
  104. AR5K_RF_OB_5GHZ,
  105. AR5K_RF_DB_2GHZ,
  106. AR5K_RF_DB_5GHZ,
  107. AR5K_RF_FIXED_BIAS_A,
  108. AR5K_RF_FIXED_BIAS_B,
  109. AR5K_RF_PWD_XPD,
  110. AR5K_RF_XPD_SEL,
  111. AR5K_RF_XPD_GAIN,
  112. AR5K_RF_PD_GAIN_LO,
  113. AR5K_RF_PD_GAIN_HI,
  114. AR5K_RF_HIGH_VC_CP,
  115. AR5K_RF_MID_VC_CP,
  116. AR5K_RF_LOW_VC_CP,
  117. AR5K_RF_PUSH_UP,
  118. AR5K_RF_PAD2GND,
  119. AR5K_RF_XB2_LVL,
  120. AR5K_RF_XB5_LVL,
  121. AR5K_RF_PWD_ICLOBUF_2G,
  122. AR5K_RF_PWD_84,
  123. AR5K_RF_PWD_90,
  124. AR5K_RF_PWD_130,
  125. AR5K_RF_PWD_131,
  126. AR5K_RF_PWD_132,
  127. AR5K_RF_PWD_136,
  128. AR5K_RF_PWD_137,
  129. AR5K_RF_PWD_138,
  130. AR5K_RF_PWD_166,
  131. AR5K_RF_PWD_167,
  132. AR5K_RF_DERBY_CHAN_SEL_MODE,
  133. /* BANK 7 */
  134. AR5K_RF_GAIN_I,
  135. AR5K_RF_PLO_SEL,
  136. AR5K_RF_RFGAIN_SEL,
  137. AR5K_RF_RFGAIN_STEP,
  138. AR5K_RF_WAIT_S,
  139. AR5K_RF_WAIT_I,
  140. AR5K_RF_MAX_TIME,
  141. AR5K_RF_MIXVGA_OVR,
  142. AR5K_RF_MIXGAIN_OVR,
  143. AR5K_RF_MIXGAIN_STEP,
  144. AR5K_RF_PD_DELAY_A,
  145. AR5K_RF_PD_DELAY_B,
  146. AR5K_RF_PD_DELAY_XR,
  147. AR5K_RF_PD_PERIOD_A,
  148. AR5K_RF_PD_PERIOD_B,
  149. AR5K_RF_PD_PERIOD_XR,
  150. };
  151. /*******************\
  152. * RF5111 (Sombrero) *
  153. \*******************/
  154. /* BANK 2 len pos col */
  155. #define AR5K_RF5111_RF_TURBO { 1, 3, 0 }
  156. /* BANK 6 len pos col */
  157. #define AR5K_RF5111_OB_2GHZ { 3, 119, 0 }
  158. #define AR5K_RF5111_DB_2GHZ { 3, 122, 0 }
  159. #define AR5K_RF5111_OB_5GHZ { 3, 104, 0 }
  160. #define AR5K_RF5111_DB_5GHZ { 3, 107, 0 }
  161. #define AR5K_RF5111_PWD_XPD { 1, 95, 0 }
  162. #define AR5K_RF5111_XPD_GAIN { 4, 96, 0 }
  163. /* Access to PWD registers */
  164. #define AR5K_RF5111_PWD(_n) { 1, (135 - _n), 3 }
  165. /* BANK 7 len pos col */
  166. #define AR5K_RF5111_GAIN_I { 6, 29, 0 }
  167. #define AR5K_RF5111_PLO_SEL { 1, 4, 0 }
  168. #define AR5K_RF5111_RFGAIN_SEL { 1, 36, 0 }
  169. #define AR5K_RF5111_RFGAIN_STEP { 6, 37, 0 }
  170. /* Only on AR5212 BaseBand and up */
  171. #define AR5K_RF5111_WAIT_S { 5, 19, 0 }
  172. #define AR5K_RF5111_WAIT_I { 5, 24, 0 }
  173. #define AR5K_RF5111_MAX_TIME { 2, 49, 0 }
  174. static const struct ath5k_rf_reg rf_regs_5111[] = {
  175. {2, AR5K_RF_TURBO, AR5K_RF5111_RF_TURBO},
  176. {6, AR5K_RF_OB_2GHZ, AR5K_RF5111_OB_2GHZ},
  177. {6, AR5K_RF_DB_2GHZ, AR5K_RF5111_DB_2GHZ},
  178. {6, AR5K_RF_OB_5GHZ, AR5K_RF5111_OB_5GHZ},
  179. {6, AR5K_RF_DB_5GHZ, AR5K_RF5111_DB_5GHZ},
  180. {6, AR5K_RF_PWD_XPD, AR5K_RF5111_PWD_XPD},
  181. {6, AR5K_RF_XPD_GAIN, AR5K_RF5111_XPD_GAIN},
  182. {6, AR5K_RF_PWD_84, AR5K_RF5111_PWD(84)},
  183. {6, AR5K_RF_PWD_90, AR5K_RF5111_PWD(90)},
  184. {7, AR5K_RF_GAIN_I, AR5K_RF5111_GAIN_I},
  185. {7, AR5K_RF_PLO_SEL, AR5K_RF5111_PLO_SEL},
  186. {7, AR5K_RF_RFGAIN_SEL, AR5K_RF5111_RFGAIN_SEL},
  187. {7, AR5K_RF_RFGAIN_STEP, AR5K_RF5111_RFGAIN_STEP},
  188. {7, AR5K_RF_WAIT_S, AR5K_RF5111_WAIT_S},
  189. {7, AR5K_RF_WAIT_I, AR5K_RF5111_WAIT_I},
  190. {7, AR5K_RF_MAX_TIME, AR5K_RF5111_MAX_TIME}
  191. };
  192. /* Default mode specific settings */
  193. static const struct ath5k_ini_rfbuffer rfb_5111[] = {
  194. /* BANK / C.R. A/XR B G */
  195. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  196. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  197. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  198. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  199. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  200. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  201. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  202. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  203. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  204. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  205. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  206. { 0, 0x989c, { 0x00380000, 0x00380000, 0x00380000 } },
  207. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  208. { 0, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  209. { 0, 0x989c, { 0x00000000, 0x000000c0, 0x00000080 } },
  210. { 0, 0x989c, { 0x000400f9, 0x000400ff, 0x000400fd } },
  211. { 0, 0x98d4, { 0x00000000, 0x00000004, 0x00000004 } },
  212. { 1, 0x98d4, { 0x00000020, 0x00000020, 0x00000020 } },
  213. { 2, 0x98d4, { 0x00000010, 0x00000010, 0x00000010 } },
  214. { 3, 0x98d8, { 0x00601068, 0x00601068, 0x00601068 } },
  215. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  216. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  217. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  218. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  219. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  220. { 6, 0x989c, { 0x10000000, 0x10000000, 0x10000000 } },
  221. { 6, 0x989c, { 0x04000000, 0x04000000, 0x04000000 } },
  222. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  223. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  224. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  225. { 6, 0x989c, { 0x00000000, 0x0a000000, 0x00000000 } },
  226. { 6, 0x989c, { 0x003800c0, 0x023800c0, 0x003800c0 } },
  227. { 6, 0x989c, { 0x00020006, 0x00000006, 0x00020006 } },
  228. { 6, 0x989c, { 0x00000089, 0x00000089, 0x00000089 } },
  229. { 6, 0x989c, { 0x000000a0, 0x000000a0, 0x000000a0 } },
  230. { 6, 0x989c, { 0x00040007, 0x00040007, 0x00040007 } },
  231. { 6, 0x98d4, { 0x0000001a, 0x0000001a, 0x0000001a } },
  232. { 7, 0x989c, { 0x00000040, 0x00000040, 0x00000040 } },
  233. { 7, 0x989c, { 0x00000010, 0x00000010, 0x00000010 } },
  234. { 7, 0x989c, { 0x00000008, 0x00000008, 0x00000008 } },
  235. { 7, 0x989c, { 0x0000004f, 0x0000004f, 0x0000004f } },
  236. { 7, 0x989c, { 0x000000f1, 0x00000061, 0x000000f1 } },
  237. { 7, 0x989c, { 0x0000904f, 0x0000904c, 0x0000904f } },
  238. { 7, 0x989c, { 0x0000125a, 0x0000129a, 0x0000125a } },
  239. { 7, 0x98cc, { 0x0000000e, 0x0000000f, 0x0000000e } },
  240. };
  241. /***********************\
  242. * RF5112/RF2112 (Derby) *
  243. \***********************/
  244. /* BANK 2 (Common) len pos col */
  245. #define AR5K_RF5112X_RF_TURBO { 1, 1, 2 }
  246. /* BANK 7 (Common) len pos col */
  247. #define AR5K_RF5112X_GAIN_I { 6, 14, 0 }
  248. #define AR5K_RF5112X_MIXVGA_OVR { 1, 36, 0 }
  249. #define AR5K_RF5112X_MIXGAIN_OVR { 2, 37, 0 }
  250. #define AR5K_RF5112X_MIXGAIN_STEP { 4, 32, 0 }
  251. #define AR5K_RF5112X_PD_DELAY_A { 4, 58, 0 }
  252. #define AR5K_RF5112X_PD_DELAY_B { 4, 62, 0 }
  253. #define AR5K_RF5112X_PD_DELAY_XR { 4, 66, 0 }
  254. #define AR5K_RF5112X_PD_PERIOD_A { 4, 70, 0 }
  255. #define AR5K_RF5112X_PD_PERIOD_B { 4, 74, 0 }
  256. #define AR5K_RF5112X_PD_PERIOD_XR { 4, 78, 0 }
  257. /* RFX112 (Derby 1) */
  258. /* BANK 6 len pos col */
  259. #define AR5K_RF5112_OB_2GHZ { 3, 269, 0 }
  260. #define AR5K_RF5112_DB_2GHZ { 3, 272, 0 }
  261. #define AR5K_RF5112_OB_5GHZ { 3, 261, 0 }
  262. #define AR5K_RF5112_DB_5GHZ { 3, 264, 0 }
  263. #define AR5K_RF5112_FIXED_BIAS_A { 1, 260, 0 }
  264. #define AR5K_RF5112_FIXED_BIAS_B { 1, 259, 0 }
  265. #define AR5K_RF5112_XPD_SEL { 1, 284, 0 }
  266. #define AR5K_RF5112_XPD_GAIN { 2, 252, 0 }
  267. /* Access to PWD registers */
  268. #define AR5K_RF5112_PWD(_n) { 1, (302 - _n), 3 }
  269. static const struct ath5k_rf_reg rf_regs_5112[] = {
  270. {2, AR5K_RF_TURBO, AR5K_RF5112X_RF_TURBO},
  271. {6, AR5K_RF_OB_2GHZ, AR5K_RF5112_OB_2GHZ},
  272. {6, AR5K_RF_DB_2GHZ, AR5K_RF5112_DB_2GHZ},
  273. {6, AR5K_RF_OB_5GHZ, AR5K_RF5112_OB_5GHZ},
  274. {6, AR5K_RF_DB_5GHZ, AR5K_RF5112_DB_5GHZ},
  275. {6, AR5K_RF_FIXED_BIAS_A, AR5K_RF5112_FIXED_BIAS_A},
  276. {6, AR5K_RF_FIXED_BIAS_B, AR5K_RF5112_FIXED_BIAS_B},
  277. {6, AR5K_RF_XPD_SEL, AR5K_RF5112_XPD_SEL},
  278. {6, AR5K_RF_XPD_GAIN, AR5K_RF5112_XPD_GAIN},
  279. {6, AR5K_RF_PWD_130, AR5K_RF5112_PWD(130)},
  280. {6, AR5K_RF_PWD_131, AR5K_RF5112_PWD(131)},
  281. {6, AR5K_RF_PWD_132, AR5K_RF5112_PWD(132)},
  282. {6, AR5K_RF_PWD_136, AR5K_RF5112_PWD(136)},
  283. {6, AR5K_RF_PWD_137, AR5K_RF5112_PWD(137)},
  284. {6, AR5K_RF_PWD_138, AR5K_RF5112_PWD(138)},
  285. {7, AR5K_RF_GAIN_I, AR5K_RF5112X_GAIN_I},
  286. {7, AR5K_RF_MIXVGA_OVR, AR5K_RF5112X_MIXVGA_OVR},
  287. {7, AR5K_RF_MIXGAIN_OVR, AR5K_RF5112X_MIXGAIN_OVR},
  288. {7, AR5K_RF_MIXGAIN_STEP, AR5K_RF5112X_MIXGAIN_STEP},
  289. {7, AR5K_RF_PD_DELAY_A, AR5K_RF5112X_PD_DELAY_A},
  290. {7, AR5K_RF_PD_DELAY_B, AR5K_RF5112X_PD_DELAY_B},
  291. {7, AR5K_RF_PD_DELAY_XR, AR5K_RF5112X_PD_DELAY_XR},
  292. {7, AR5K_RF_PD_PERIOD_A, AR5K_RF5112X_PD_PERIOD_A},
  293. {7, AR5K_RF_PD_PERIOD_B, AR5K_RF5112X_PD_PERIOD_B},
  294. {7, AR5K_RF_PD_PERIOD_XR, AR5K_RF5112X_PD_PERIOD_XR},
  295. };
  296. /* Default mode specific settings */
  297. static const struct ath5k_ini_rfbuffer rfb_5112[] = {
  298. /* BANK / C.R. A/XR B G */
  299. { 1, 0x98d4, { 0x00000020, 0x00000020, 0x00000020 } },
  300. { 2, 0x98d0, { 0x03060408, 0x03060408, 0x03060408 } },
  301. { 3, 0x98dc, { 0x00a0c0c0, 0x00e0c0c0, 0x00e0c0c0 } },
  302. { 6, 0x989c, { 0x00a00000, 0x00a00000, 0x00a00000 } },
  303. { 6, 0x989c, { 0x000a0000, 0x000a0000, 0x000a0000 } },
  304. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  305. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  306. { 6, 0x989c, { 0x00660000, 0x00660000, 0x00660000 } },
  307. { 6, 0x989c, { 0x00db0000, 0x00db0000, 0x00db0000 } },
  308. { 6, 0x989c, { 0x00f10000, 0x00f10000, 0x00f10000 } },
  309. { 6, 0x989c, { 0x00120000, 0x00120000, 0x00120000 } },
  310. { 6, 0x989c, { 0x00120000, 0x00120000, 0x00120000 } },
  311. { 6, 0x989c, { 0x00730000, 0x00730000, 0x00730000 } },
  312. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  313. { 6, 0x989c, { 0x000c0000, 0x000c0000, 0x000c0000 } },
  314. { 6, 0x989c, { 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
  315. { 6, 0x989c, { 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
  316. { 6, 0x989c, { 0x008b0000, 0x008b0000, 0x008b0000 } },
  317. { 6, 0x989c, { 0x00600000, 0x00600000, 0x00600000 } },
  318. { 6, 0x989c, { 0x000c0000, 0x000c0000, 0x000c0000 } },
  319. { 6, 0x989c, { 0x00840000, 0x00840000, 0x00840000 } },
  320. { 6, 0x989c, { 0x00640000, 0x00640000, 0x00640000 } },
  321. { 6, 0x989c, { 0x00200000, 0x00200000, 0x00200000 } },
  322. { 6, 0x989c, { 0x00240000, 0x00240000, 0x00240000 } },
  323. { 6, 0x989c, { 0x00250000, 0x00250000, 0x00250000 } },
  324. { 6, 0x989c, { 0x00110000, 0x00110000, 0x00110000 } },
  325. { 6, 0x989c, { 0x00110000, 0x00110000, 0x00110000 } },
  326. { 6, 0x989c, { 0x00510000, 0x00510000, 0x00510000 } },
  327. { 6, 0x989c, { 0x1c040000, 0x1c040000, 0x1c040000 } },
  328. { 6, 0x989c, { 0x000a0000, 0x000a0000, 0x000a0000 } },
  329. { 6, 0x989c, { 0x00a10000, 0x00a10000, 0x00a10000 } },
  330. { 6, 0x989c, { 0x00400000, 0x00400000, 0x00400000 } },
  331. { 6, 0x989c, { 0x03090000, 0x03090000, 0x03090000 } },
  332. { 6, 0x989c, { 0x06000000, 0x06000000, 0x06000000 } },
  333. { 6, 0x989c, { 0x000000b0, 0x000000a8, 0x000000a8 } },
  334. { 6, 0x989c, { 0x0000002e, 0x0000002e, 0x0000002e } },
  335. { 6, 0x989c, { 0x006c4a41, 0x006c4af1, 0x006c4a61 } },
  336. { 6, 0x989c, { 0x0050892a, 0x0050892b, 0x0050892b } },
  337. { 6, 0x989c, { 0x00842400, 0x00842400, 0x00842400 } },
  338. { 6, 0x989c, { 0x00c69200, 0x00c69200, 0x00c69200 } },
  339. { 6, 0x98d0, { 0x0002000c, 0x0002000c, 0x0002000c } },
  340. { 7, 0x989c, { 0x00000094, 0x00000094, 0x00000094 } },
  341. { 7, 0x989c, { 0x00000091, 0x00000091, 0x00000091 } },
  342. { 7, 0x989c, { 0x0000000a, 0x00000012, 0x00000012 } },
  343. { 7, 0x989c, { 0x00000080, 0x00000080, 0x00000080 } },
  344. { 7, 0x989c, { 0x000000c1, 0x000000c1, 0x000000c1 } },
  345. { 7, 0x989c, { 0x00000060, 0x00000060, 0x00000060 } },
  346. { 7, 0x989c, { 0x000000f0, 0x000000f0, 0x000000f0 } },
  347. { 7, 0x989c, { 0x00000022, 0x00000022, 0x00000022 } },
  348. { 7, 0x989c, { 0x00000092, 0x00000092, 0x00000092 } },
  349. { 7, 0x989c, { 0x000000d4, 0x000000d4, 0x000000d4 } },
  350. { 7, 0x989c, { 0x000014cc, 0x000014cc, 0x000014cc } },
  351. { 7, 0x989c, { 0x0000048c, 0x0000048c, 0x0000048c } },
  352. { 7, 0x98c4, { 0x00000003, 0x00000003, 0x00000003 } },
  353. };
  354. /* RFX112A (Derby 2) */
  355. /* BANK 6 len pos col */
  356. #define AR5K_RF5112A_OB_2GHZ { 3, 287, 0 }
  357. #define AR5K_RF5112A_DB_2GHZ { 3, 290, 0 }
  358. #define AR5K_RF5112A_OB_5GHZ { 3, 279, 0 }
  359. #define AR5K_RF5112A_DB_5GHZ { 3, 282, 0 }
  360. #define AR5K_RF5112A_FIXED_BIAS_A { 1, 278, 0 }
  361. #define AR5K_RF5112A_FIXED_BIAS_B { 1, 277, 0 }
  362. #define AR5K_RF5112A_XPD_SEL { 1, 302, 0 }
  363. #define AR5K_RF5112A_PDGAINLO { 2, 270, 0 }
  364. #define AR5K_RF5112A_PDGAINHI { 2, 257, 0 }
  365. /* Access to PWD registers */
  366. #define AR5K_RF5112A_PWD(_n) { 1, (306 - _n), 3 }
  367. /* Voltage regulators */
  368. #define AR5K_RF5112A_HIGH_VC_CP { 2, 90, 2 }
  369. #define AR5K_RF5112A_MID_VC_CP { 2, 92, 2 }
  370. #define AR5K_RF5112A_LOW_VC_CP { 2, 94, 2 }
  371. #define AR5K_RF5112A_PUSH_UP { 1, 254, 2 }
  372. /* Power consumption */
  373. #define AR5K_RF5112A_PAD2GND { 1, 281, 1 }
  374. #define AR5K_RF5112A_XB2_LVL { 2, 1, 3 }
  375. #define AR5K_RF5112A_XB5_LVL { 2, 3, 3 }
  376. static const struct ath5k_rf_reg rf_regs_5112a[] = {
  377. {2, AR5K_RF_TURBO, AR5K_RF5112X_RF_TURBO},
  378. {6, AR5K_RF_OB_2GHZ, AR5K_RF5112A_OB_2GHZ},
  379. {6, AR5K_RF_DB_2GHZ, AR5K_RF5112A_DB_2GHZ},
  380. {6, AR5K_RF_OB_5GHZ, AR5K_RF5112A_OB_5GHZ},
  381. {6, AR5K_RF_DB_5GHZ, AR5K_RF5112A_DB_5GHZ},
  382. {6, AR5K_RF_FIXED_BIAS_A, AR5K_RF5112A_FIXED_BIAS_A},
  383. {6, AR5K_RF_FIXED_BIAS_B, AR5K_RF5112A_FIXED_BIAS_B},
  384. {6, AR5K_RF_XPD_SEL, AR5K_RF5112A_XPD_SEL},
  385. {6, AR5K_RF_PD_GAIN_LO, AR5K_RF5112A_PDGAINLO},
  386. {6, AR5K_RF_PD_GAIN_HI, AR5K_RF5112A_PDGAINHI},
  387. {6, AR5K_RF_PWD_130, AR5K_RF5112A_PWD(130)},
  388. {6, AR5K_RF_PWD_131, AR5K_RF5112A_PWD(131)},
  389. {6, AR5K_RF_PWD_132, AR5K_RF5112A_PWD(132)},
  390. {6, AR5K_RF_PWD_136, AR5K_RF5112A_PWD(136)},
  391. {6, AR5K_RF_PWD_137, AR5K_RF5112A_PWD(137)},
  392. {6, AR5K_RF_PWD_138, AR5K_RF5112A_PWD(138)},
  393. {6, AR5K_RF_PWD_166, AR5K_RF5112A_PWD(166)},
  394. {6, AR5K_RF_PWD_167, AR5K_RF5112A_PWD(167)},
  395. {6, AR5K_RF_HIGH_VC_CP, AR5K_RF5112A_HIGH_VC_CP},
  396. {6, AR5K_RF_MID_VC_CP, AR5K_RF5112A_MID_VC_CP},
  397. {6, AR5K_RF_LOW_VC_CP, AR5K_RF5112A_LOW_VC_CP},
  398. {6, AR5K_RF_PUSH_UP, AR5K_RF5112A_PUSH_UP},
  399. {6, AR5K_RF_PAD2GND, AR5K_RF5112A_PAD2GND},
  400. {6, AR5K_RF_XB2_LVL, AR5K_RF5112A_XB2_LVL},
  401. {6, AR5K_RF_XB5_LVL, AR5K_RF5112A_XB5_LVL},
  402. {7, AR5K_RF_GAIN_I, AR5K_RF5112X_GAIN_I},
  403. {7, AR5K_RF_MIXVGA_OVR, AR5K_RF5112X_MIXVGA_OVR},
  404. {7, AR5K_RF_MIXGAIN_OVR, AR5K_RF5112X_MIXGAIN_OVR},
  405. {7, AR5K_RF_MIXGAIN_STEP, AR5K_RF5112X_MIXGAIN_STEP},
  406. {7, AR5K_RF_PD_DELAY_A, AR5K_RF5112X_PD_DELAY_A},
  407. {7, AR5K_RF_PD_DELAY_B, AR5K_RF5112X_PD_DELAY_B},
  408. {7, AR5K_RF_PD_DELAY_XR, AR5K_RF5112X_PD_DELAY_XR},
  409. {7, AR5K_RF_PD_PERIOD_A, AR5K_RF5112X_PD_PERIOD_A},
  410. {7, AR5K_RF_PD_PERIOD_B, AR5K_RF5112X_PD_PERIOD_B},
  411. {7, AR5K_RF_PD_PERIOD_XR, AR5K_RF5112X_PD_PERIOD_XR},
  412. };
  413. /* Default mode specific settings */
  414. static const struct ath5k_ini_rfbuffer rfb_5112a[] = {
  415. /* BANK / C.R. A/XR B G */
  416. { 1, 0x98d4, { 0x00000020, 0x00000020, 0x00000020 } },
  417. { 2, 0x98d0, { 0x03060408, 0x03060408, 0x03060408 } },
  418. { 3, 0x98dc, { 0x00a020c0, 0x00e020c0, 0x00e020c0 } },
  419. { 6, 0x989c, { 0x0f000000, 0x0f000000, 0x0f000000 } },
  420. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  421. { 6, 0x989c, { 0x00800000, 0x00800000, 0x00800000 } },
  422. { 6, 0x989c, { 0x002a0000, 0x002a0000, 0x002a0000 } },
  423. { 6, 0x989c, { 0x00010000, 0x00010000, 0x00010000 } },
  424. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  425. { 6, 0x989c, { 0x00180000, 0x00180000, 0x00180000 } },
  426. { 6, 0x989c, { 0x00600000, 0x006e0000, 0x006e0000 } },
  427. { 6, 0x989c, { 0x00c70000, 0x00c70000, 0x00c70000 } },
  428. { 6, 0x989c, { 0x004b0000, 0x004b0000, 0x004b0000 } },
  429. { 6, 0x989c, { 0x04480000, 0x04480000, 0x04480000 } },
  430. { 6, 0x989c, { 0x004c0000, 0x004c0000, 0x004c0000 } },
  431. { 6, 0x989c, { 0x00e40000, 0x00e40000, 0x00e40000 } },
  432. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  433. { 6, 0x989c, { 0x00fc0000, 0x00fc0000, 0x00fc0000 } },
  434. { 6, 0x989c, { 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
  435. { 6, 0x989c, { 0x043f0000, 0x043f0000, 0x043f0000 } },
  436. { 6, 0x989c, { 0x000c0000, 0x000c0000, 0x000c0000 } },
  437. { 6, 0x989c, { 0x02190000, 0x02190000, 0x02190000 } },
  438. { 6, 0x989c, { 0x00240000, 0x00240000, 0x00240000 } },
  439. { 6, 0x989c, { 0x00b40000, 0x00b40000, 0x00b40000 } },
  440. { 6, 0x989c, { 0x00990000, 0x00990000, 0x00990000 } },
  441. { 6, 0x989c, { 0x00500000, 0x00500000, 0x00500000 } },
  442. { 6, 0x989c, { 0x002a0000, 0x002a0000, 0x002a0000 } },
  443. { 6, 0x989c, { 0x00120000, 0x00120000, 0x00120000 } },
  444. { 6, 0x989c, { 0xc0320000, 0xc0320000, 0xc0320000 } },
  445. { 6, 0x989c, { 0x01740000, 0x01740000, 0x01740000 } },
  446. { 6, 0x989c, { 0x00110000, 0x00110000, 0x00110000 } },
  447. { 6, 0x989c, { 0x86280000, 0x86280000, 0x86280000 } },
  448. { 6, 0x989c, { 0x31840000, 0x31840000, 0x31840000 } },
  449. { 6, 0x989c, { 0x00f20080, 0x00f20080, 0x00f20080 } },
  450. { 6, 0x989c, { 0x00270019, 0x00270019, 0x00270019 } },
  451. { 6, 0x989c, { 0x00000003, 0x00000003, 0x00000003 } },
  452. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  453. { 6, 0x989c, { 0x000000b2, 0x000000b2, 0x000000b2 } },
  454. { 6, 0x989c, { 0x00b02084, 0x00b02084, 0x00b02084 } },
  455. { 6, 0x989c, { 0x004125a4, 0x004125a4, 0x004125a4 } },
  456. { 6, 0x989c, { 0x00119220, 0x00119220, 0x00119220 } },
  457. { 6, 0x989c, { 0x001a4800, 0x001a4800, 0x001a4800 } },
  458. { 6, 0x98d8, { 0x000b0230, 0x000b0230, 0x000b0230 } },
  459. { 7, 0x989c, { 0x00000094, 0x00000094, 0x00000094 } },
  460. { 7, 0x989c, { 0x00000091, 0x00000091, 0x00000091 } },
  461. { 7, 0x989c, { 0x00000012, 0x00000012, 0x00000012 } },
  462. { 7, 0x989c, { 0x00000080, 0x00000080, 0x00000080 } },
  463. { 7, 0x989c, { 0x000000d9, 0x000000d9, 0x000000d9 } },
  464. { 7, 0x989c, { 0x00000060, 0x00000060, 0x00000060 } },
  465. { 7, 0x989c, { 0x000000f0, 0x000000f0, 0x000000f0 } },
  466. { 7, 0x989c, { 0x000000a2, 0x000000a2, 0x000000a2 } },
  467. { 7, 0x989c, { 0x00000052, 0x00000052, 0x00000052 } },
  468. { 7, 0x989c, { 0x000000d4, 0x000000d4, 0x000000d4 } },
  469. { 7, 0x989c, { 0x000014cc, 0x000014cc, 0x000014cc } },
  470. { 7, 0x989c, { 0x0000048c, 0x0000048c, 0x0000048c } },
  471. { 7, 0x98c4, { 0x00000003, 0x00000003, 0x00000003 } },
  472. };
  473. /******************\
  474. * RF2413 (Griffin) *
  475. \******************/
  476. /* BANK 2 len pos col */
  477. #define AR5K_RF2413_RF_TURBO { 1, 1, 2 }
  478. /* BANK 6 len pos col */
  479. #define AR5K_RF2413_OB_2GHZ { 3, 168, 0 }
  480. #define AR5K_RF2413_DB_2GHZ { 3, 165, 0 }
  481. static const struct ath5k_rf_reg rf_regs_2413[] = {
  482. {2, AR5K_RF_TURBO, AR5K_RF2413_RF_TURBO},
  483. {6, AR5K_RF_OB_2GHZ, AR5K_RF2413_OB_2GHZ},
  484. {6, AR5K_RF_DB_2GHZ, AR5K_RF2413_DB_2GHZ},
  485. };
  486. /* Default mode specific settings
  487. * XXX: a/aTurbo ???
  488. */
  489. static const struct ath5k_ini_rfbuffer rfb_2413[] = {
  490. /* BANK / C.R. A/XR B G */
  491. { 1, 0x98d4, { 0x00000020, 0x00000020, 0x00000020 } },
  492. { 2, 0x98d0, { 0x02001408, 0x02001408, 0x02001408 } },
  493. { 3, 0x98dc, { 0x00a020c0, 0x00e020c0, 0x00e020c0 } },
  494. { 6, 0x989c, { 0xf0000000, 0xf0000000, 0xf0000000 } },
  495. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  496. { 6, 0x989c, { 0x03000000, 0x03000000, 0x03000000 } },
  497. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  498. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  499. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  500. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  501. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  502. { 6, 0x989c, { 0x40400000, 0x40400000, 0x40400000 } },
  503. { 6, 0x989c, { 0x65050000, 0x65050000, 0x65050000 } },
  504. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  505. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  506. { 6, 0x989c, { 0x00420000, 0x00420000, 0x00420000 } },
  507. { 6, 0x989c, { 0x00b50000, 0x00b50000, 0x00b50000 } },
  508. { 6, 0x989c, { 0x00030000, 0x00030000, 0x00030000 } },
  509. { 6, 0x989c, { 0x00f70000, 0x00f70000, 0x00f70000 } },
  510. { 6, 0x989c, { 0x009d0000, 0x009d0000, 0x009d0000 } },
  511. { 6, 0x989c, { 0x00220000, 0x00220000, 0x00220000 } },
  512. { 6, 0x989c, { 0x04220000, 0x04220000, 0x04220000 } },
  513. { 6, 0x989c, { 0x00230018, 0x00230018, 0x00230018 } },
  514. { 6, 0x989c, { 0x00280000, 0x00280060, 0x00280060 } },
  515. { 6, 0x989c, { 0x005000c0, 0x005000c3, 0x005000c3 } },
  516. { 6, 0x989c, { 0x0004007f, 0x0004007f, 0x0004007f } },
  517. { 6, 0x989c, { 0x00000458, 0x00000458, 0x00000458 } },
  518. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  519. { 6, 0x989c, { 0x0000c000, 0x0000c000, 0x0000c000 } },
  520. { 6, 0x98d8, { 0x00400230, 0x00400230, 0x00400230 } },
  521. { 7, 0x989c, { 0x00006400, 0x00006400, 0x00006400 } },
  522. { 7, 0x989c, { 0x00000800, 0x00000800, 0x00000800 } },
  523. { 7, 0x98cc, { 0x0000000e, 0x0000000e, 0x0000000e } },
  524. };
  525. /***************************\
  526. * RF2315/RF2316 (Cobra SoC) *
  527. \***************************/
  528. /* BANK 2 len pos col */
  529. #define AR5K_RF2316_RF_TURBO { 1, 1, 2 }
  530. /* BANK 6 len pos col */
  531. #define AR5K_RF2316_OB_2GHZ { 3, 178, 0 }
  532. #define AR5K_RF2316_DB_2GHZ { 3, 175, 0 }
  533. static const struct ath5k_rf_reg rf_regs_2316[] = {
  534. {2, AR5K_RF_TURBO, AR5K_RF2316_RF_TURBO},
  535. {6, AR5K_RF_OB_2GHZ, AR5K_RF2316_OB_2GHZ},
  536. {6, AR5K_RF_DB_2GHZ, AR5K_RF2316_DB_2GHZ},
  537. };
  538. /* Default mode specific settings */
  539. static const struct ath5k_ini_rfbuffer rfb_2316[] = {
  540. /* BANK / C.R. A/XR B G */
  541. { 1, 0x98d4, { 0x00000020, 0x00000020, 0x00000020 } },
  542. { 2, 0x98d0, { 0x02001408, 0x02001408, 0x02001408 } },
  543. { 3, 0x98dc, { 0x00a020c0, 0x00e020c0, 0x00e020c0 } },
  544. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  545. { 6, 0x989c, { 0xc0000000, 0xc0000000, 0xc0000000 } },
  546. { 6, 0x989c, { 0x0f000000, 0x0f000000, 0x0f000000 } },
  547. { 6, 0x989c, { 0x02000000, 0x02000000, 0x02000000 } },
  548. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  549. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  550. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  551. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  552. { 6, 0x989c, { 0xf8000000, 0xf8000000, 0xf8000000 } },
  553. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  554. { 6, 0x989c, { 0x95150000, 0x95150000, 0x95150000 } },
  555. { 6, 0x989c, { 0xc1000000, 0xc1000000, 0xc1000000 } },
  556. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  557. { 6, 0x989c, { 0x00080000, 0x00080000, 0x00080000 } },
  558. { 6, 0x989c, { 0x00d50000, 0x00d50000, 0x00d50000 } },
  559. { 6, 0x989c, { 0x000e0000, 0x000e0000, 0x000e0000 } },
  560. { 6, 0x989c, { 0x00dc0000, 0x00dc0000, 0x00dc0000 } },
  561. { 6, 0x989c, { 0x00770000, 0x00770000, 0x00770000 } },
  562. { 6, 0x989c, { 0x008a0000, 0x008a0000, 0x008a0000 } },
  563. { 6, 0x989c, { 0x10880000, 0x10880000, 0x10880000 } },
  564. { 6, 0x989c, { 0x008c0060, 0x008c0060, 0x008c0060 } },
  565. { 6, 0x989c, { 0x00a00000, 0x00a00080, 0x00a00080 } },
  566. { 6, 0x989c, { 0x00400000, 0x0040000d, 0x0040000d } },
  567. { 6, 0x989c, { 0x00110400, 0x00110400, 0x00110400 } },
  568. { 6, 0x989c, { 0x00000060, 0x00000060, 0x00000060 } },
  569. { 6, 0x989c, { 0x00000001, 0x00000001, 0x00000001 } },
  570. { 6, 0x989c, { 0x00000b00, 0x00000b00, 0x00000b00 } },
  571. { 6, 0x989c, { 0x00000be8, 0x00000be8, 0x00000be8 } },
  572. { 6, 0x98c0, { 0x00010000, 0x00010000, 0x00010000 } },
  573. { 7, 0x989c, { 0x00006400, 0x00006400, 0x00006400 } },
  574. { 7, 0x989c, { 0x00000800, 0x00000800, 0x00000800 } },
  575. { 7, 0x98cc, { 0x0000000e, 0x0000000e, 0x0000000e } },
  576. };
  577. /******************************\
  578. * RF5413/RF5424 (Eagle/Condor) *
  579. \******************************/
  580. /* BANK 6 len pos col */
  581. #define AR5K_RF5413_OB_2GHZ { 3, 241, 0 }
  582. #define AR5K_RF5413_DB_2GHZ { 3, 238, 0 }
  583. #define AR5K_RF5413_OB_5GHZ { 3, 247, 0 }
  584. #define AR5K_RF5413_DB_5GHZ { 3, 244, 0 }
  585. #define AR5K_RF5413_PWD_ICLOBUF2G { 3, 131, 3 }
  586. #define AR5K_RF5413_DERBY_CHAN_SEL_MODE { 1, 291, 2 }
  587. static const struct ath5k_rf_reg rf_regs_5413[] = {
  588. {6, AR5K_RF_OB_2GHZ, AR5K_RF5413_OB_2GHZ},
  589. {6, AR5K_RF_DB_2GHZ, AR5K_RF5413_DB_2GHZ},
  590. {6, AR5K_RF_OB_5GHZ, AR5K_RF5413_OB_5GHZ},
  591. {6, AR5K_RF_DB_5GHZ, AR5K_RF5413_DB_5GHZ},
  592. {6, AR5K_RF_PWD_ICLOBUF_2G, AR5K_RF5413_PWD_ICLOBUF2G},
  593. {6, AR5K_RF_DERBY_CHAN_SEL_MODE, AR5K_RF5413_DERBY_CHAN_SEL_MODE},
  594. };
  595. /* Default mode specific settings */
  596. static const struct ath5k_ini_rfbuffer rfb_5413[] = {
  597. /* BANK / C.R. A/XR B G */
  598. { 1, 0x98d4, { 0x00000020, 0x00000020, 0x00000020 } },
  599. { 2, 0x98d0, { 0x00000008, 0x00000008, 0x00000008 } },
  600. { 3, 0x98dc, { 0x00a000c0, 0x00e000c0, 0x00e000c0 } },
  601. { 6, 0x989c, { 0x33000000, 0x33000000, 0x33000000 } },
  602. { 6, 0x989c, { 0x01000000, 0x01000000, 0x01000000 } },
  603. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  604. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  605. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  606. { 6, 0x989c, { 0x1f000000, 0x1f000000, 0x1f000000 } },
  607. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  608. { 6, 0x989c, { 0x00b80000, 0x00b80000, 0x00b80000 } },
  609. { 6, 0x989c, { 0x00b70000, 0x00b70000, 0x00b70000 } },
  610. { 6, 0x989c, { 0x00840000, 0x00840000, 0x00840000 } },
  611. { 6, 0x989c, { 0x00980000, 0x00980000, 0x00980000 } },
  612. { 6, 0x989c, { 0x00c00000, 0x00c00000, 0x00c00000 } },
  613. { 6, 0x989c, { 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
  614. { 6, 0x989c, { 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
  615. { 6, 0x989c, { 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
  616. { 6, 0x989c, { 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
  617. { 6, 0x989c, { 0x00d70000, 0x00d70000, 0x00d70000 } },
  618. { 6, 0x989c, { 0x00610000, 0x00610000, 0x00610000 } },
  619. { 6, 0x989c, { 0x00fe0000, 0x00fe0000, 0x00fe0000 } },
  620. { 6, 0x989c, { 0x00de0000, 0x00de0000, 0x00de0000 } },
  621. { 6, 0x989c, { 0x007f0000, 0x007f0000, 0x007f0000 } },
  622. { 6, 0x989c, { 0x043d0000, 0x043d0000, 0x043d0000 } },
  623. { 6, 0x989c, { 0x00770000, 0x00770000, 0x00770000 } },
  624. { 6, 0x989c, { 0x00440000, 0x00440000, 0x00440000 } },
  625. { 6, 0x989c, { 0x00980000, 0x00980000, 0x00980000 } },
  626. { 6, 0x989c, { 0x00100080, 0x00100080, 0x00100080 } },
  627. { 6, 0x989c, { 0x0005c034, 0x0005c034, 0x0005c034 } },
  628. { 6, 0x989c, { 0x003100f0, 0x003100f0, 0x003100f0 } },
  629. { 6, 0x989c, { 0x000c011f, 0x000c011f, 0x000c011f } },
  630. { 6, 0x989c, { 0x00510040, 0x00510040, 0x00510040 } },
  631. { 6, 0x989c, { 0x005000da, 0x005000da, 0x005000da } },
  632. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  633. { 6, 0x989c, { 0x00004044, 0x00004044, 0x00004044 } },
  634. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  635. { 6, 0x989c, { 0x000060c0, 0x000060c0, 0x000060c0 } },
  636. { 6, 0x989c, { 0x00002c00, 0x00003600, 0x00003600 } },
  637. { 6, 0x98c8, { 0x00000403, 0x00040403, 0x00040403 } },
  638. { 7, 0x989c, { 0x00006400, 0x00006400, 0x00006400 } },
  639. { 7, 0x989c, { 0x00000800, 0x00000800, 0x00000800 } },
  640. { 7, 0x98cc, { 0x0000000e, 0x0000000e, 0x0000000e } },
  641. };
  642. /***************************\
  643. * RF2425/RF2417 (Swan/Nala) *
  644. * AR2317 (Spider SoC) *
  645. \***************************/
  646. /* BANK 2 len pos col */
  647. #define AR5K_RF2425_RF_TURBO { 1, 1, 2 }
  648. /* BANK 6 len pos col */
  649. #define AR5K_RF2425_OB_2GHZ { 3, 193, 0 }
  650. #define AR5K_RF2425_DB_2GHZ { 3, 190, 0 }
  651. static const struct ath5k_rf_reg rf_regs_2425[] = {
  652. {2, AR5K_RF_TURBO, AR5K_RF2425_RF_TURBO},
  653. {6, AR5K_RF_OB_2GHZ, AR5K_RF2425_OB_2GHZ},
  654. {6, AR5K_RF_DB_2GHZ, AR5K_RF2425_DB_2GHZ},
  655. };
  656. /* Default mode specific settings
  657. */
  658. static const struct ath5k_ini_rfbuffer rfb_2425[] = {
  659. /* BANK / C.R. A/XR B G */
  660. { 1, 0x98d4, { 0x00000020, 0x00000020, 0x00000020 } },
  661. { 2, 0x98d0, { 0x02001408, 0x02001408, 0x02001408 } },
  662. { 3, 0x98dc, { 0x00a020c0, 0x00e020c0, 0x00e020c0 } },
  663. { 6, 0x989c, { 0x10000000, 0x10000000, 0x10000000 } },
  664. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  665. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  666. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  667. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  668. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  669. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  670. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  671. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  672. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  673. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  674. { 6, 0x989c, { 0x002a0000, 0x002a0000, 0x002a0000 } },
  675. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  676. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  677. { 6, 0x989c, { 0x00100000, 0x00100000, 0x00100000 } },
  678. { 6, 0x989c, { 0x00020000, 0x00020000, 0x00020000 } },
  679. { 6, 0x989c, { 0x00730000, 0x00730000, 0x00730000 } },
  680. { 6, 0x989c, { 0x00f80000, 0x00f80000, 0x00f80000 } },
  681. { 6, 0x989c, { 0x00e70000, 0x00e70000, 0x00e70000 } },
  682. { 6, 0x989c, { 0x00140000, 0x00140000, 0x00140000 } },
  683. { 6, 0x989c, { 0x00910040, 0x00910040, 0x00910040 } },
  684. { 6, 0x989c, { 0x0007001a, 0x0007001a, 0x0007001a } },
  685. { 6, 0x989c, { 0x00410000, 0x00410000, 0x00410000 } },
  686. { 6, 0x989c, { 0x00810000, 0x00810060, 0x00810060 } },
  687. { 6, 0x989c, { 0x00020800, 0x00020803, 0x00020803 } },
  688. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  689. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  690. { 6, 0x989c, { 0x00001660, 0x00001660, 0x00001660 } },
  691. { 6, 0x989c, { 0x00001688, 0x00001688, 0x00001688 } },
  692. { 6, 0x98c4, { 0x00000001, 0x00000001, 0x00000001 } },
  693. { 7, 0x989c, { 0x00006400, 0x00006400, 0x00006400 } },
  694. { 7, 0x989c, { 0x00000800, 0x00000800, 0x00000800 } },
  695. { 7, 0x98cc, { 0x0000000e, 0x0000000e, 0x0000000e } },
  696. };
  697. /*
  698. * TODO: Handle the few differences with swan during
  699. * bank modification and get rid of this
  700. */
  701. static const struct ath5k_ini_rfbuffer rfb_2317[] = {
  702. /* BANK / C.R. A/XR B G */
  703. { 1, 0x98d4, { 0x00000020, 0x00000020, 0x00000020 } },
  704. { 2, 0x98d0, { 0x02001408, 0x02001408, 0x02001408 } },
  705. { 3, 0x98dc, { 0x00a020c0, 0x00e020c0, 0x00e020c0 } },
  706. { 6, 0x989c, { 0x10000000, 0x10000000, 0x10000000 } },
  707. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  708. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  709. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  710. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  711. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  712. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  713. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  714. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  715. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  716. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  717. { 6, 0x989c, { 0x002a0000, 0x002a0000, 0x002a0000 } },
  718. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  719. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  720. { 6, 0x989c, { 0x00100000, 0x00100000, 0x00100000 } },
  721. { 6, 0x989c, { 0x00020000, 0x00020000, 0x00020000 } },
  722. { 6, 0x989c, { 0x00730000, 0x00730000, 0x00730000 } },
  723. { 6, 0x989c, { 0x00f80000, 0x00f80000, 0x00f80000 } },
  724. { 6, 0x989c, { 0x00e70000, 0x00e70000, 0x00e70000 } },
  725. { 6, 0x989c, { 0x00140100, 0x00140100, 0x00140100 } },
  726. { 6, 0x989c, { 0x00910040, 0x00910040, 0x00910040 } },
  727. { 6, 0x989c, { 0x0007001a, 0x0007001a, 0x0007001a } },
  728. { 6, 0x989c, { 0x00410000, 0x00410000, 0x00410000 } },
  729. { 6, 0x989c, { 0x00810000, 0x00810060, 0x00810060 } },
  730. { 6, 0x989c, { 0x00020800, 0x00020803, 0x00020803 } },
  731. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  732. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  733. { 6, 0x989c, { 0x00001660, 0x00001660, 0x00001660 } },
  734. { 6, 0x989c, { 0x00009688, 0x00009688, 0x00009688 } },
  735. { 6, 0x98c4, { 0x00000001, 0x00000001, 0x00000001 } },
  736. { 7, 0x989c, { 0x00006400, 0x00006400, 0x00006400 } },
  737. { 7, 0x989c, { 0x00000800, 0x00000800, 0x00000800 } },
  738. { 7, 0x98cc, { 0x0000000e, 0x0000000e, 0x0000000e } },
  739. };
  740. /*
  741. * TODO: Handle the few differences with swan during
  742. * bank modification and get rid of this
  743. */
  744. static const struct ath5k_ini_rfbuffer rfb_2417[] = {
  745. /* BANK / C.R. A/XR B G */
  746. { 1, 0x98d4, { 0x00000020, 0x00000020, 0x00000020 } },
  747. { 2, 0x98d0, { 0x02001408, 0x02001408, 0x02001408 } },
  748. { 3, 0x98dc, { 0x00a020c0, 0x00e020c0, 0x00e020c0 } },
  749. { 6, 0x989c, { 0x10000000, 0x10000000, 0x10000000 } },
  750. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  751. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  752. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  753. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  754. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  755. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  756. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  757. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  758. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  759. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  760. { 6, 0x989c, { 0x002a0000, 0x002a0000, 0x002a0000 } },
  761. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  762. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  763. { 6, 0x989c, { 0x00100000, 0x00100000, 0x00100000 } },
  764. { 6, 0x989c, { 0x00020000, 0x00020000, 0x00020000 } },
  765. { 6, 0x989c, { 0x00730000, 0x00730000, 0x00730000 } },
  766. { 6, 0x989c, { 0x00f80000, 0x00f80000, 0x00f80000 } },
  767. { 6, 0x989c, { 0x00e70000, 0x80e70000, 0x80e70000 } },
  768. { 6, 0x989c, { 0x00140000, 0x00140000, 0x00140000 } },
  769. { 6, 0x989c, { 0x00910040, 0x00910040, 0x00910040 } },
  770. { 6, 0x989c, { 0x0007001a, 0x0207001a, 0x0207001a } },
  771. { 6, 0x989c, { 0x00410000, 0x00410000, 0x00410000 } },
  772. { 6, 0x989c, { 0x00810000, 0x00810060, 0x00810060 } },
  773. { 6, 0x989c, { 0x00020800, 0x00020803, 0x00020803 } },
  774. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  775. { 6, 0x989c, { 0x00000000, 0x00000000, 0x00000000 } },
  776. { 6, 0x989c, { 0x00001660, 0x00001660, 0x00001660 } },
  777. { 6, 0x989c, { 0x00001688, 0x00001688, 0x00001688 } },
  778. { 6, 0x98c4, { 0x00000001, 0x00000001, 0x00000001 } },
  779. { 7, 0x989c, { 0x00006400, 0x00006400, 0x00006400 } },
  780. { 7, 0x989c, { 0x00000800, 0x00000800, 0x00000800 } },
  781. { 7, 0x98cc, { 0x0000000e, 0x0000000e, 0x0000000e } },
  782. };