HalHWImg8821A_BB.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. //#include "Mp_Precomp.h"
  21. #include "../odm_precomp.h"
  22. #if (RTL8821A_SUPPORT == 1)
  23. static BOOLEAN
  24. CheckCondition(
  25. const u4Byte Condition,
  26. const u4Byte Hex
  27. )
  28. {
  29. u4Byte _board = (Hex & 0x000000FF);
  30. u4Byte _interface = (Hex & 0x0000FF00) >> 8;
  31. u4Byte _platform = (Hex & 0x00FF0000) >> 16;
  32. u4Byte cond = Condition;
  33. if ( Condition == 0xCDCDCDCD )
  34. return TRUE;
  35. cond = Condition & 0x000000FF;
  36. if ( (_board != cond) && (cond != 0xFF) )
  37. return FALSE;
  38. cond = Condition & 0x0000FF00;
  39. cond = cond >> 8;
  40. if ( ((_interface & cond) == 0) && (cond != 0x07) )
  41. return FALSE;
  42. cond = Condition & 0x00FF0000;
  43. cond = cond >> 16;
  44. if ( ((_platform & cond) == 0) && (cond != 0x0F) )
  45. return FALSE;
  46. return TRUE;
  47. }
  48. /******************************************************************************
  49. * AGC_TAB.TXT
  50. ******************************************************************************/
  51. u4Byte Array_MP_8821A_AGC_TAB[] = {
  52. 0x81C, 0xBF000001,
  53. 0x81C, 0xBF020001,
  54. 0x81C, 0xBF040001,
  55. 0x81C, 0xBF060001,
  56. 0x81C, 0xBE080001,
  57. 0x81C, 0xBD0A0001,
  58. 0x81C, 0xBC0C0001,
  59. 0x81C, 0xBA0E0001,
  60. 0x81C, 0xB9100001,
  61. 0x81C, 0xB8120001,
  62. 0x81C, 0xB7140001,
  63. 0x81C, 0xB6160001,
  64. 0x81C, 0xB5180001,
  65. 0x81C, 0xB41A0001,
  66. 0x81C, 0xB31C0001,
  67. 0x81C, 0xB21E0001,
  68. 0x81C, 0xB1200001,
  69. 0x81C, 0xB0220001,
  70. 0x81C, 0xAF240001,
  71. 0x81C, 0xAE260001,
  72. 0x81C, 0xAD280001,
  73. 0x81C, 0xAC2A0001,
  74. 0x81C, 0xAB2C0001,
  75. 0x81C, 0xAA2E0001,
  76. 0x81C, 0xA9300001,
  77. 0x81C, 0xA8320001,
  78. 0x81C, 0xA7340001,
  79. 0x81C, 0xA6360001,
  80. 0x81C, 0xA5380001,
  81. 0x81C, 0xA43A0001,
  82. 0x81C, 0xA33C0001,
  83. 0x81C, 0x673E0001,
  84. 0x81C, 0x66400001,
  85. 0x81C, 0x65420001,
  86. 0x81C, 0x64440001,
  87. 0x81C, 0x63460001,
  88. 0x81C, 0x62480001,
  89. 0x81C, 0x614A0001,
  90. 0x81C, 0x474C0001,
  91. 0x81C, 0x464E0001,
  92. 0x81C, 0x45500001,
  93. 0x81C, 0x44520001,
  94. 0x81C, 0x43540001,
  95. 0x81C, 0x42560001,
  96. 0x81C, 0x41580001,
  97. 0x81C, 0x285A0001,
  98. 0x81C, 0x275C0001,
  99. 0x81C, 0x265E0001,
  100. 0x81C, 0x25600001,
  101. 0x81C, 0x24620001,
  102. 0x81C, 0x0A640001,
  103. 0x81C, 0x09660001,
  104. 0x81C, 0x08680001,
  105. 0x81C, 0x076A0001,
  106. 0x81C, 0x066C0001,
  107. 0x81C, 0x056E0001,
  108. 0x81C, 0x04700001,
  109. 0x81C, 0x03720001,
  110. 0x81C, 0x02740001,
  111. 0x81C, 0x01760001,
  112. 0x81C, 0x01780001,
  113. 0x81C, 0x017A0001,
  114. 0x81C, 0x017C0001,
  115. 0x81C, 0x017E0001,
  116. 0xFF0F02C0, 0xABCD,
  117. 0x81C, 0xFB000101,
  118. 0x81C, 0xFA020101,
  119. 0x81C, 0xF9040101,
  120. 0x81C, 0xF8060101,
  121. 0x81C, 0xF7080101,
  122. 0x81C, 0xF60A0101,
  123. 0x81C, 0xF50C0101,
  124. 0x81C, 0xF40E0101,
  125. 0x81C, 0xF3100101,
  126. 0x81C, 0xF2120101,
  127. 0x81C, 0xF1140101,
  128. 0x81C, 0xF0160101,
  129. 0x81C, 0xEF180101,
  130. 0x81C, 0xEE1A0101,
  131. 0x81C, 0xED1C0101,
  132. 0x81C, 0xEC1E0101,
  133. 0x81C, 0xEB200101,
  134. 0x81C, 0xEA220101,
  135. 0x81C, 0xE9240101,
  136. 0x81C, 0xE8260101,
  137. 0x81C, 0xE7280101,
  138. 0x81C, 0xE62A0101,
  139. 0x81C, 0xE52C0101,
  140. 0x81C, 0xE42E0101,
  141. 0x81C, 0xE3300101,
  142. 0x81C, 0xA5320101,
  143. 0x81C, 0xA4340101,
  144. 0x81C, 0xA3360101,
  145. 0x81C, 0x87380101,
  146. 0x81C, 0x863A0101,
  147. 0x81C, 0x853C0101,
  148. 0x81C, 0x843E0101,
  149. 0x81C, 0x69400101,
  150. 0x81C, 0x68420101,
  151. 0x81C, 0x67440101,
  152. 0x81C, 0x66460101,
  153. 0x81C, 0x49480101,
  154. 0x81C, 0x484A0101,
  155. 0x81C, 0x474C0101,
  156. 0x81C, 0x2A4E0101,
  157. 0x81C, 0x29500101,
  158. 0x81C, 0x28520101,
  159. 0x81C, 0x27540101,
  160. 0x81C, 0x26560101,
  161. 0x81C, 0x25580101,
  162. 0x81C, 0x245A0101,
  163. 0x81C, 0x235C0101,
  164. 0x81C, 0x055E0101,
  165. 0x81C, 0x04600101,
  166. 0x81C, 0x03620101,
  167. 0x81C, 0x02640101,
  168. 0x81C, 0x01660101,
  169. 0x81C, 0x01680101,
  170. 0x81C, 0x016A0101,
  171. 0x81C, 0x016C0101,
  172. 0x81C, 0x016E0101,
  173. 0x81C, 0x01700101,
  174. 0x81C, 0x01720101,
  175. 0xCDCDCDCD, 0xCDCD,
  176. 0x81C, 0xFF000101,
  177. 0x81C, 0xFF020101,
  178. 0x81C, 0xFE040101,
  179. 0x81C, 0xFD060101,
  180. 0x81C, 0xFC080101,
  181. 0x81C, 0xFD0A0101,
  182. 0x81C, 0xFC0C0101,
  183. 0x81C, 0xFB0E0101,
  184. 0x81C, 0xFA100101,
  185. 0x81C, 0xF9120101,
  186. 0x81C, 0xF8140101,
  187. 0x81C, 0xF7160101,
  188. 0x81C, 0xF6180101,
  189. 0x81C, 0xF51A0101,
  190. 0x81C, 0xF41C0101,
  191. 0x81C, 0xF31E0101,
  192. 0x81C, 0xF2200101,
  193. 0x81C, 0xF1220101,
  194. 0x81C, 0xF0240101,
  195. 0x81C, 0xEF260101,
  196. 0x81C, 0xEE280101,
  197. 0x81C, 0xED2A0101,
  198. 0x81C, 0xEC2C0101,
  199. 0x81C, 0xEB2E0101,
  200. 0x81C, 0xEA300101,
  201. 0x81C, 0xE9320101,
  202. 0x81C, 0xE8340101,
  203. 0x81C, 0xE7360101,
  204. 0x81C, 0xE6380101,
  205. 0x81C, 0xE53A0101,
  206. 0x81C, 0xE43C0101,
  207. 0x81C, 0xE33E0101,
  208. 0x81C, 0xA5400101,
  209. 0x81C, 0xA4420101,
  210. 0x81C, 0xA3440101,
  211. 0x81C, 0x87460101,
  212. 0x81C, 0x86480101,
  213. 0x81C, 0x854A0101,
  214. 0x81C, 0x844C0101,
  215. 0x81C, 0x694E0101,
  216. 0x81C, 0x68500101,
  217. 0x81C, 0x67520101,
  218. 0x81C, 0x66540101,
  219. 0x81C, 0x49560101,
  220. 0x81C, 0x48580101,
  221. 0x81C, 0x475A0101,
  222. 0x81C, 0x2A5C0101,
  223. 0x81C, 0x295E0101,
  224. 0x81C, 0x28600101,
  225. 0x81C, 0x27620101,
  226. 0x81C, 0x26640101,
  227. 0x81C, 0x25660101,
  228. 0x81C, 0x24680101,
  229. 0x81C, 0x236A0101,
  230. 0x81C, 0x056C0101,
  231. 0x81C, 0x046E0101,
  232. 0x81C, 0x03700101,
  233. 0x81C, 0x02720101,
  234. 0xFF0F02C0, 0xDEAD,
  235. 0x81C, 0x01740101,
  236. 0x81C, 0x01760101,
  237. 0x81C, 0x01780101,
  238. 0x81C, 0x017A0101,
  239. 0x81C, 0x017C0101,
  240. 0x81C, 0x017E0101,
  241. 0xC50, 0x00000022,
  242. 0xC50, 0x00000020,
  243. };
  244. void
  245. ODM_ReadAndConfig_MP_8821A_AGC_TAB(
  246. IN PDM_ODM_T pDM_Odm
  247. )
  248. {
  249. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  250. u4Byte hex = 0;
  251. u4Byte i = 0;
  252. u2Byte count = 0;
  253. pu4Byte ptr_array = NULL;
  254. u1Byte platform = pDM_Odm->SupportPlatform;
  255. u1Byte _interface = pDM_Odm->SupportInterface;
  256. u1Byte board = pDM_Odm->BoardType;
  257. u4Byte ArrayLen = sizeof(Array_MP_8821A_AGC_TAB)/sizeof(u4Byte);
  258. pu4Byte Array = Array_MP_8821A_AGC_TAB;
  259. hex += board;
  260. hex += _interface << 8;
  261. hex += platform << 16;
  262. hex += 0xFF000000;
  263. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8821A_AGC_TAB, hex = 0x%X\n", hex));
  264. for (i = 0; i < ArrayLen; i += 2 )
  265. {
  266. u4Byte v1 = Array[i];
  267. u4Byte v2 = Array[i+1];
  268. // This (offset, data) pair meets the condition.
  269. if ( v1 < 0xCDCDCDCD )
  270. {
  271. odm_ConfigBB_AGC_8821A(pDM_Odm, v1, bMaskDWord, v2);
  272. continue;
  273. }
  274. else
  275. { // This line is the start line of branch.
  276. if ( !CheckCondition(Array[i], hex) )
  277. { // Discard the following (offset, data) pairs.
  278. READ_NEXT_PAIR(v1, v2, i);
  279. while (v2 != 0xDEAD &&
  280. v2 != 0xCDEF &&
  281. v2 != 0xCDCD && i < ArrayLen -2)
  282. {
  283. READ_NEXT_PAIR(v1, v2, i);
  284. }
  285. i -= 2; // prevent from for-loop += 2
  286. }
  287. else // Configure matched pairs and skip to end of if-else.
  288. {
  289. READ_NEXT_PAIR(v1, v2, i);
  290. while (v2 != 0xDEAD &&
  291. v2 != 0xCDEF &&
  292. v2 != 0xCDCD && i < ArrayLen -2)
  293. {
  294. odm_ConfigBB_AGC_8821A(pDM_Odm, v1, bMaskDWord, v2);
  295. READ_NEXT_PAIR(v1, v2, i);
  296. }
  297. while (v2 != 0xDEAD && i < ArrayLen -2)
  298. {
  299. READ_NEXT_PAIR(v1, v2, i);
  300. }
  301. }
  302. }
  303. }
  304. }
  305. /******************************************************************************
  306. * PHY_REG.TXT
  307. ******************************************************************************/
  308. u4Byte Array_MP_8821A_PHY_REG[] = {
  309. 0x800, 0x0020D090,
  310. 0x804, 0x080112E0,
  311. 0x808, 0x0E028211,
  312. 0x80C, 0x92131111,
  313. 0x810, 0x20101261,
  314. 0x814, 0x020C3D10,
  315. 0x818, 0x03A00385,
  316. 0x820, 0x00000000,
  317. 0x824, 0x00030FE0,
  318. 0x828, 0x00000000,
  319. 0x82C, 0x002081DD,
  320. 0x830, 0x2AAA8E24,
  321. 0x834, 0x0037A706,
  322. 0x838, 0x06489B44,
  323. 0x83C, 0x0000095B,
  324. 0x840, 0xC0000001,
  325. 0x844, 0x40003CDE,
  326. 0x848, 0x62103F8B,
  327. 0x84C, 0x6CFDFFB8,
  328. 0x850, 0x28874706,
  329. 0x854, 0x0001520C,
  330. 0x858, 0x8060E000,
  331. 0x85C, 0x74210168,
  332. 0x860, 0x6929C321,
  333. 0x864, 0x79727432,
  334. 0x868, 0x8CA7A314,
  335. 0x86C, 0x888C2878,
  336. 0x870, 0x08888888,
  337. 0x874, 0x31612C2E,
  338. 0x878, 0x00000152,
  339. 0x87C, 0x000FD000,
  340. 0x8A0, 0x00000013,
  341. 0x8A4, 0x7F7F7F7F,
  342. 0x8A8, 0xA2000338,
  343. 0x8AC, 0x0FF0FA0A,
  344. 0x8B4, 0x000FC080,
  345. 0x8B8, 0x7C0057FF,
  346. 0x8BC, 0x0CA52090,
  347. 0x8C0, 0x1BF00020,
  348. 0x8C4, 0x00000000,
  349. 0x8C8, 0x00013169,
  350. 0x8CC, 0x08248492,
  351. 0x8D4, 0x940008A0,
  352. 0x8D8, 0x290B5612,
  353. 0x8F8, 0x400002C0,
  354. 0x8FC, 0x00000000,
  355. 0x900, 0x00000700,
  356. 0x90C, 0x00000000,
  357. 0x910, 0x0000FC00,
  358. 0x914, 0x00000404,
  359. 0x918, 0x1C1028C0,
  360. 0x91C, 0x64B11A1C,
  361. 0x920, 0xE0767233,
  362. 0x924, 0x055AA500,
  363. 0x928, 0x00000004,
  364. 0x92C, 0xFFFE0000,
  365. 0x930, 0xFFFFFFFE,
  366. 0x934, 0x001FFFFF,
  367. 0x960, 0x00000000,
  368. 0x964, 0x00000000,
  369. 0x968, 0x00000000,
  370. 0x96C, 0x00000000,
  371. 0x970, 0x801FFFFF,
  372. 0x974, 0x000003FF,
  373. 0x978, 0x00000000,
  374. 0x97C, 0x00000000,
  375. 0x980, 0x00000000,
  376. 0x984, 0x00000000,
  377. 0x988, 0x00000000,
  378. 0x9A4, 0x00480080,
  379. 0x9A8, 0x00000000,
  380. 0x9AC, 0x00000000,
  381. 0x9B0, 0x81081008,
  382. 0x9B4, 0x01081008,
  383. 0x9B8, 0x01081008,
  384. 0x9BC, 0x01081008,
  385. 0x9D0, 0x00000000,
  386. 0x9D4, 0x00000000,
  387. 0x9D8, 0x00000000,
  388. 0x9DC, 0x00000000,
  389. 0x9E0, 0x00005D00,
  390. 0x9E4, 0x00000002,
  391. 0x9E8, 0x00000000,
  392. 0xA00, 0x00D047C8,
  393. 0xA04, 0x01FF000C,
  394. 0xA08, 0x8C8A8300,
  395. 0xA0C, 0x2E68000F,
  396. 0xA10, 0x9500BB78,
  397. 0xA14, 0x11144028,
  398. 0xA18, 0x00881117,
  399. 0xA1C, 0x89140F00,
  400. 0xA20, 0x1A1B0000,
  401. 0xA24, 0x090E1317,
  402. 0xA28, 0x00000204,
  403. 0xA2C, 0x00900000,
  404. 0xA70, 0x101FFF00,
  405. 0xA74, 0x00000008,
  406. 0xA78, 0x00000900,
  407. 0xA7C, 0x225B0606,
  408. 0xA80, 0x21805490,
  409. 0xA84, 0x001F0000,
  410. 0xB00, 0x03100040,
  411. 0xB04, 0x0000B000,
  412. 0xB08, 0xAE0201EB,
  413. 0xB0C, 0x01003207,
  414. 0xB10, 0x00009807,
  415. 0xB14, 0x01000000,
  416. 0xB18, 0x00000002,
  417. 0xB1C, 0x00000002,
  418. 0xB20, 0x0000001F,
  419. 0xB24, 0x03020100,
  420. 0xB28, 0x07060504,
  421. 0xB2C, 0x0B0A0908,
  422. 0xB30, 0x0F0E0D0C,
  423. 0xB34, 0x13121110,
  424. 0xB38, 0x17161514,
  425. 0xB3C, 0x0000003A,
  426. 0xB40, 0x00000000,
  427. 0xB44, 0x00000000,
  428. 0xB48, 0x13000032,
  429. 0xB4C, 0x48080000,
  430. 0xB50, 0x00000000,
  431. 0xB54, 0x00000000,
  432. 0xB58, 0x00000000,
  433. 0xB5C, 0x00000000,
  434. 0xC00, 0x00000007,
  435. 0xC04, 0x00042020,
  436. 0xC08, 0x80410231,
  437. 0xC0C, 0x00000000,
  438. 0xC10, 0x00000100,
  439. 0xC14, 0x01000000,
  440. 0xC1C, 0x40000003,
  441. 0xC20, 0x2C2C2C2C,
  442. 0xC24, 0x30303030,
  443. 0xC28, 0x30303030,
  444. 0xC2C, 0x2C2C2C2C,
  445. 0xC30, 0x2C2C2C2C,
  446. 0xC34, 0x2C2C2C2C,
  447. 0xC38, 0x2C2C2C2C,
  448. 0xC3C, 0x2A2A2A2A,
  449. 0xC40, 0x2A2A2A2A,
  450. 0xC44, 0x2A2A2A2A,
  451. 0xC48, 0x2A2A2A2A,
  452. 0xC4C, 0x2A2A2A2A,
  453. 0xC50, 0x00000020,
  454. 0xC54, 0x001C1208,
  455. 0xC58, 0x30000C1C,
  456. 0xC5C, 0x00000058,
  457. 0xC60, 0x34344443,
  458. 0xC64, 0x07003333,
  459. 0xC68, 0x19791979,
  460. 0xC6C, 0x19791979,
  461. 0xC70, 0x19791979,
  462. 0xC74, 0x19791979,
  463. 0xC78, 0x19791979,
  464. 0xC7C, 0x19791979,
  465. 0xC80, 0x19791979,
  466. 0xC84, 0x19791979,
  467. 0xC94, 0x0100005C,
  468. 0xC98, 0x00000000,
  469. 0xC9C, 0x00000000,
  470. 0xCA0, 0x00000029,
  471. 0xCA4, 0x08040201,
  472. 0xCA8, 0x80402010,
  473. 0xCB0, 0x77775747,
  474. 0xCB4, 0x10000077,
  475. 0xCB8, 0x00508240,
  476. };
  477. void
  478. ODM_ReadAndConfig_MP_8821A_PHY_REG(
  479. IN PDM_ODM_T pDM_Odm
  480. )
  481. {
  482. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  483. u4Byte hex = 0;
  484. u4Byte i = 0;
  485. u2Byte count = 0;
  486. pu4Byte ptr_array = NULL;
  487. u1Byte platform = pDM_Odm->SupportPlatform;
  488. u1Byte _interface = pDM_Odm->SupportInterface;
  489. u1Byte board = pDM_Odm->BoardType;
  490. u4Byte ArrayLen = sizeof(Array_MP_8821A_PHY_REG)/sizeof(u4Byte);
  491. pu4Byte Array = Array_MP_8821A_PHY_REG;
  492. hex += board;
  493. hex += _interface << 8;
  494. hex += platform << 16;
  495. hex += 0xFF000000;
  496. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8821A_PHY_REG, hex = 0x%X\n", hex));
  497. for (i = 0; i < ArrayLen; i += 2 )
  498. {
  499. u4Byte v1 = Array[i];
  500. u4Byte v2 = Array[i+1];
  501. // This (offset, data) pair meets the condition.
  502. if ( v1 < 0xCDCDCDCD )
  503. {
  504. odm_ConfigBB_PHY_8821A(pDM_Odm, v1, bMaskDWord, v2);
  505. continue;
  506. }
  507. else
  508. { // This line is the start line of branch.
  509. if ( !CheckCondition(Array[i], hex) )
  510. { // Discard the following (offset, data) pairs.
  511. READ_NEXT_PAIR(v1, v2, i);
  512. while (v2 != 0xDEAD &&
  513. v2 != 0xCDEF &&
  514. v2 != 0xCDCD && i < ArrayLen -2)
  515. {
  516. READ_NEXT_PAIR(v1, v2, i);
  517. }
  518. i -= 2; // prevent from for-loop += 2
  519. }
  520. else // Configure matched pairs and skip to end of if-else.
  521. {
  522. READ_NEXT_PAIR(v1, v2, i);
  523. while (v2 != 0xDEAD &&
  524. v2 != 0xCDEF &&
  525. v2 != 0xCDCD && i < ArrayLen -2)
  526. {
  527. odm_ConfigBB_PHY_8821A(pDM_Odm, v1, bMaskDWord, v2);
  528. READ_NEXT_PAIR(v1, v2, i);
  529. }
  530. while (v2 != 0xDEAD && i < ArrayLen -2)
  531. {
  532. READ_NEXT_PAIR(v1, v2, i);
  533. }
  534. }
  535. }
  536. }
  537. }
  538. /******************************************************************************
  539. * PHY_REG_PG.TXT
  540. ******************************************************************************/
  541. u4Byte Array_MP_8821A_PHY_REG_PG[] = {
  542. 0xC20, 0x00000000, 0x32343638,
  543. 0xC24, 0x00000000, 0x36363838,
  544. 0xC28, 0x00000000, 0x28303234,
  545. 0xC2C, 0x00000000, 0x34363838,
  546. 0xC30, 0x00000000, 0x26283032,
  547. 0xC34, 0x00000000, 0x34363838,
  548. 0xC38, 0x00000000, 0x26283032,
  549. 0xE20, 0x00000000, 0x32343638,
  550. 0xE24, 0x00000000, 0x36363838,
  551. 0xE28, 0x00000000, 0x28303234,
  552. 0xE2C, 0x00000000, 0x34363838,
  553. 0xE30, 0x00000000, 0x26283032,
  554. 0xE34, 0x00000000, 0x34363838,
  555. 0xE38, 0x00000000, 0x26283032,
  556. 0xC24, 0x00000000, 0x34343636,
  557. 0xC28, 0x00000000, 0x26283032,
  558. 0xC2C, 0x00000000, 0x32343636,
  559. 0xC30, 0x00000000, 0x24262830,
  560. 0xC34, 0x00000000, 0x32343636,
  561. 0xC38, 0x00000000, 0x24262830,
  562. 0xC3C, 0x00000000, 0x32343636,
  563. 0xC40, 0x00000000, 0x24262830,
  564. 0xC44, 0x00000000, 0x36362022,
  565. 0xC48, 0x00000000, 0x28303234,
  566. 0xC4C, 0x00000000, 0x20222426,
  567. 0xE24, 0x00000000, 0x34343636,
  568. 0xE28, 0x00000000, 0x26283032,
  569. 0xE2C, 0x00000000, 0x32343636,
  570. 0xE30, 0x00000000, 0x24262830,
  571. 0xE34, 0x00000000, 0x32343636,
  572. 0xE38, 0x00000000, 0x24262830,
  573. 0xE3C, 0x00000000, 0x32343636,
  574. 0xE40, 0x00000000, 0x24262830,
  575. 0xE44, 0x00000000, 0x36362022,
  576. 0xE48, 0x00000000, 0x28303234,
  577. 0xE4C, 0x00000000, 0x20222426,
  578. };
  579. void
  580. ODM_ReadAndConfig_MP_8821A_PHY_REG_PG(
  581. IN PDM_ODM_T pDM_Odm
  582. )
  583. {
  584. u4Byte hex = 0;
  585. u4Byte i = 0;
  586. u2Byte count = 0;
  587. pu4Byte ptr_array = NULL;
  588. u1Byte platform = pDM_Odm->SupportPlatform;
  589. u1Byte _interface = pDM_Odm->SupportInterface;
  590. u1Byte board = pDM_Odm->BoardType;
  591. u4Byte ArrayLen = sizeof(Array_MP_8821A_PHY_REG_PG)/sizeof(u4Byte);
  592. pu4Byte Array = Array_MP_8821A_PHY_REG_PG;
  593. pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE;
  594. hex += board;
  595. hex += _interface << 8;
  596. hex += platform << 16;
  597. hex += 0xFF000000;
  598. for (i = 0; i < ArrayLen; i += 3 )
  599. {
  600. u4Byte v1 = Array[i];
  601. u4Byte v2 = Array[i+1];
  602. u4Byte v3 = Array[i+2];
  603. // this line is a line of pure_body
  604. if ( v1 < 0xCDCDCDCD )
  605. {
  606. odm_ConfigBB_PHY_REG_PG_8821A(pDM_Odm, v1, v2, v3);
  607. continue;
  608. }
  609. else
  610. { // this line is the start of branch
  611. if ( !CheckCondition(Array[i], hex) )
  612. { // don't need the hw_body
  613. i += 2; // skip the pair of expression
  614. v1 = Array[i];
  615. v2 = Array[i+1];
  616. v3 = Array[i+2];
  617. while (v2 != 0xDEAD)
  618. {
  619. i += 3;
  620. v1 = Array[i];
  621. v2 = Array[i+1];
  622. v3 = Array[i+1];
  623. }
  624. }
  625. }
  626. }
  627. }
  628. #endif // end of HWIMG_SUPPORT