HalHWImg8821A_TestChip_BB.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  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_TC_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, 0xB41C0001,
  67. 0x81C, 0xB31E0001,
  68. 0x81C, 0xB2200001,
  69. 0x81C, 0xB1220001,
  70. 0x81C, 0xB0240001,
  71. 0x81C, 0xAF260001,
  72. 0x81C, 0xAE280001,
  73. 0x81C, 0xAD2A0001,
  74. 0x81C, 0xAC2C0001,
  75. 0x81C, 0xAB2E0001,
  76. 0x81C, 0xAA300001,
  77. 0x81C, 0xA9320001,
  78. 0x81C, 0xA8340001,
  79. 0x81C, 0xA7360001,
  80. 0x81C, 0xA6380001,
  81. 0x81C, 0xA53A0001,
  82. 0x81C, 0xA43C0001,
  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, 0xFD800001,
  118. 0x81C, 0xFC820001,
  119. 0x81C, 0xFB840001,
  120. 0x81C, 0xFA860001,
  121. 0x81C, 0xF9880001,
  122. 0x81C, 0xF88A0001,
  123. 0x81C, 0xF78C0001,
  124. 0x81C, 0xF68E0001,
  125. 0x81C, 0xF5900001,
  126. 0x81C, 0xF4920001,
  127. 0x81C, 0xF3940001,
  128. 0x81C, 0xF2960001,
  129. 0x81C, 0xF1980001,
  130. 0x81C, 0xF09A0001,
  131. 0x81C, 0xEF9C0001,
  132. 0x81C, 0xEE9E0001,
  133. 0x81C, 0xEDA00001,
  134. 0x81C, 0xECA20001,
  135. 0x81C, 0xEBA40001,
  136. 0x81C, 0xEAA60001,
  137. 0x81C, 0xE9A80001,
  138. 0x81C, 0xE8AA0001,
  139. 0x81C, 0xE7AC0001,
  140. 0x81C, 0xE6AE0001,
  141. 0x81C, 0xC6B00001,
  142. 0x81C, 0xC5B20001,
  143. 0x81C, 0xA5B40001,
  144. 0x81C, 0xA4B60001,
  145. 0x81C, 0xA3B80001,
  146. 0x81C, 0xA2BA0001,
  147. 0x81C, 0xA1BC0001,
  148. 0x81C, 0x65BE0001,
  149. 0x81C, 0x64C00001,
  150. 0x81C, 0x63C20001,
  151. 0x81C, 0x62C40001,
  152. 0x81C, 0x61C60001,
  153. 0x81C, 0x60C80001,
  154. 0x81C, 0x60CA0001,
  155. 0x81C, 0x60CC0001,
  156. 0x81C, 0x60CE0001,
  157. 0x81C, 0x60D00001,
  158. 0x81C, 0x60D20001,
  159. 0x81C, 0x60D40001,
  160. 0xCDCDCDCD, 0xCDCD,
  161. 0x81C, 0xFF800001,
  162. 0x81C, 0xFF820001,
  163. 0x81C, 0xFF840001,
  164. 0x81C, 0xFF860001,
  165. 0x81C, 0xFF880001,
  166. 0x81C, 0xFF8A0001,
  167. 0x81C, 0xFE8C0001,
  168. 0x81C, 0xFD8E0001,
  169. 0x81C, 0xFC900001,
  170. 0x81C, 0xFB920001,
  171. 0x81C, 0xFA940001,
  172. 0x81C, 0xF9960001,
  173. 0x81C, 0xF8980001,
  174. 0x81C, 0xF79A0001,
  175. 0x81C, 0xF69C0001,
  176. 0x81C, 0xF59E0001,
  177. 0x81C, 0xF4A00001,
  178. 0x81C, 0xF3A20001,
  179. 0x81C, 0xF2A40001,
  180. 0x81C, 0xF1A60001,
  181. 0x81C, 0xF0A80001,
  182. 0x81C, 0xEFAA0001,
  183. 0x81C, 0xEEAC0001,
  184. 0x81C, 0xEDAE0001,
  185. 0x81C, 0xECB00001,
  186. 0x81C, 0xEBB20001,
  187. 0x81C, 0xEAB40001,
  188. 0x81C, 0xE9B60001,
  189. 0x81C, 0xE8B80001,
  190. 0x81C, 0xE7BA0001,
  191. 0x81C, 0xE6BC0001,
  192. 0x81C, 0xC6BE0001,
  193. 0x81C, 0xC5C00001,
  194. 0x81C, 0xA5C20001,
  195. 0x81C, 0xA4C40001,
  196. 0x81C, 0xA3C60001,
  197. 0x81C, 0xA2C80001,
  198. 0x81C, 0xA1CA0001,
  199. 0x81C, 0x65CC0001,
  200. 0x81C, 0x64CE0001,
  201. 0x81C, 0x63D00001,
  202. 0x81C, 0x62D20001,
  203. 0x81C, 0x61D40001,
  204. 0xFF0F02C0, 0xDEAD,
  205. 0x81C, 0x60D60001,
  206. 0x81C, 0x60D80001,
  207. 0x81C, 0x60DA0001,
  208. 0x81C, 0x60DC0001,
  209. 0x81C, 0x60DE0001,
  210. 0x81C, 0x60E00001,
  211. 0x81C, 0x60E20001,
  212. 0x81C, 0x60E40001,
  213. 0x81C, 0x60E60001,
  214. 0x81C, 0x60E80001,
  215. 0x81C, 0x60EA0001,
  216. 0x81C, 0x60EC0001,
  217. 0x81C, 0x60EE0001,
  218. 0x81C, 0x60F00001,
  219. 0x81C, 0x60F20001,
  220. 0x81C, 0x60F40001,
  221. 0x81C, 0x60F60001,
  222. 0x81C, 0x60F80001,
  223. 0x81C, 0x60FA0001,
  224. 0x81C, 0x60FC0001,
  225. 0x81C, 0x60FE0001,
  226. };
  227. void
  228. ODM_ReadAndConfig_TC_8821A_AGC_TAB(
  229. IN PDM_ODM_T pDM_Odm
  230. )
  231. {
  232. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  233. u4Byte hex = 0;
  234. u4Byte i = 0;
  235. u2Byte count = 0;
  236. pu4Byte ptr_array = NULL;
  237. u1Byte platform = pDM_Odm->SupportPlatform;
  238. u1Byte _interface = pDM_Odm->SupportInterface;
  239. u1Byte board = pDM_Odm->BoardType;
  240. u4Byte ArrayLen = sizeof(Array_TC_8821A_AGC_TAB)/sizeof(u4Byte);
  241. pu4Byte Array = Array_TC_8821A_AGC_TAB;
  242. hex += board;
  243. hex += _interface << 8;
  244. hex += platform << 16;
  245. hex += 0xFF000000;
  246. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8821A_AGC_TAB, hex = 0x%X\n", hex));
  247. for (i = 0; i < ArrayLen; i += 2 )
  248. {
  249. u4Byte v1 = Array[i];
  250. u4Byte v2 = Array[i+1];
  251. // This (offset, data) pair meets the condition.
  252. if ( v1 < 0xCDCDCDCD )
  253. {
  254. odm_ConfigBB_AGC_8821A(pDM_Odm, v1, bMaskDWord, v2);
  255. continue;
  256. }
  257. else
  258. { // This line is the start line of branch.
  259. if ( !CheckCondition(Array[i], hex) )
  260. { // Discard the following (offset, data) pairs.
  261. READ_NEXT_PAIR(v1, v2, i);
  262. while (v2 != 0xDEAD &&
  263. v2 != 0xCDEF &&
  264. v2 != 0xCDCD && i < ArrayLen -2)
  265. {
  266. READ_NEXT_PAIR(v1, v2, i);
  267. }
  268. i -= 2; // prevent from for-loop += 2
  269. }
  270. else // Configure matched pairs and skip to end of if-else.
  271. {
  272. READ_NEXT_PAIR(v1, v2, i);
  273. while (v2 != 0xDEAD &&
  274. v2 != 0xCDEF &&
  275. v2 != 0xCDCD && i < ArrayLen -2)
  276. {
  277. odm_ConfigBB_AGC_8821A(pDM_Odm, v1, bMaskDWord, v2);
  278. READ_NEXT_PAIR(v1, v2, i);
  279. }
  280. while (v2 != 0xDEAD && i < ArrayLen -2)
  281. {
  282. READ_NEXT_PAIR(v1, v2, i);
  283. }
  284. }
  285. }
  286. }
  287. }
  288. /******************************************************************************
  289. * PHY_REG.TXT
  290. ******************************************************************************/
  291. u4Byte Array_TC_8821A_PHY_REG[] = {
  292. 0x800, 0x0020D410,
  293. 0x804, 0x080112E0,
  294. 0x808, 0x0E028211,
  295. 0x80C, 0x12131111,
  296. 0x810, 0x20101261,
  297. 0x814, 0x020C3D10,
  298. 0x818, 0x03A00385,
  299. 0x820, 0x00000000,
  300. 0x824, 0x00030FE0,
  301. 0x828, 0x00000000,
  302. 0x82C, 0x002083DD,
  303. 0x830, 0x2AAA8E24,
  304. 0x834, 0x0037A705,
  305. 0x838, 0x06489B45,
  306. 0x83C, 0x0000095B,
  307. 0x840, 0xC0000001,
  308. 0x844, 0x40003CDE,
  309. 0x848, 0x62103F8B,
  310. 0x84C, 0x6CFDFFB8,
  311. 0x850, 0x28874706,
  312. 0x854, 0x0001520C,
  313. 0x858, 0x8060E000,
  314. 0x85C, 0x74210168,
  315. 0x860, 0x6929C321,
  316. 0x864, 0x79727432,
  317. 0x868, 0x8CA7A314,
  318. 0x86C, 0x338C2878,
  319. 0x870, 0x03333333,
  320. 0x874, 0x31612C2E,
  321. 0x878, 0x00000152,
  322. 0x87C, 0x000FC000,
  323. 0x8A0, 0x00000013,
  324. 0x8A4, 0x7F7F7F7F,
  325. 0x8A8, 0xA0000338,
  326. 0x8AC, 0x0FF0FA0A,
  327. 0x8B4, 0x000FC080,
  328. 0x8B8, 0x7C005FFF,
  329. 0x8BC, 0x8CA520A0,
  330. 0x8C0, 0x01F00020,
  331. 0x8C4, 0x00000000,
  332. 0x8C8, 0x00013169,
  333. 0x8CC, 0x08248492,
  334. 0x8D4, 0x940008A0,
  335. 0x8D8, 0x290B5612,
  336. 0x8F8, 0x400002C0,
  337. 0x8FC, 0x00000000,
  338. 0x900, 0x00000700,
  339. 0x90C, 0x00000000,
  340. 0x910, 0x0000FC00,
  341. 0x914, 0x00000404,
  342. 0x918, 0x1C1028C0,
  343. 0x91C, 0x64B11A1C,
  344. 0x920, 0xE0767233,
  345. 0x924, 0x055AA500,
  346. 0x928, 0x00000004,
  347. 0x92C, 0xFFFE0000,
  348. 0x930, 0xFFFFFFFE,
  349. 0x934, 0x001FFFFF,
  350. 0x960, 0x00000000,
  351. 0x964, 0x00000000,
  352. 0x968, 0x00000000,
  353. 0x96C, 0x00000000,
  354. 0x970, 0x801FFFFF,
  355. 0x974, 0x000003FF,
  356. 0x978, 0x00000000,
  357. 0x97C, 0x00000000,
  358. 0x980, 0x00000000,
  359. 0x984, 0x00000000,
  360. 0x988, 0x00000000,
  361. 0x9A4, 0x00000080,
  362. 0x9A8, 0x00000000,
  363. 0x9AC, 0x00000000,
  364. 0x9B0, 0x01081008,
  365. 0x9B4, 0x01081008,
  366. 0x9B8, 0x01081008,
  367. 0x9BC, 0x01081008,
  368. 0x9D0, 0x00000000,
  369. 0x9D4, 0x00000000,
  370. 0x9D8, 0x00000000,
  371. 0x9DC, 0x00000000,
  372. 0x9E4, 0x00000002,
  373. 0x9E8, 0x00000000,
  374. 0xA00, 0x00D047C8,
  375. 0xA04, 0x01FF000C,
  376. 0xA08, 0x8C8A8300,
  377. 0xA0C, 0x2E68000F,
  378. 0xA10, 0x9500BB78,
  379. 0xA14, 0x11144028,
  380. 0xA18, 0x00881117,
  381. 0xA1C, 0x89140F00,
  382. 0xA20, 0x1A1B0000,
  383. 0xA24, 0x090E1317,
  384. 0xA28, 0x00000204,
  385. 0xA2C, 0x00910000,
  386. 0xA70, 0x101FFF00,
  387. 0xA74, 0x00000008,
  388. 0xA78, 0x00000900,
  389. 0xA7C, 0x225B0606,
  390. 0xA80, 0x21805490,
  391. 0xA84, 0x001F0000,
  392. 0xB00, 0x03100000,
  393. 0xB04, 0x0000B000,
  394. 0xB08, 0xAE0201EB,
  395. 0xB0C, 0x01003207,
  396. 0xB10, 0x00009807,
  397. 0xB14, 0x01000000,
  398. 0xB18, 0x00000002,
  399. 0xB1C, 0x00000002,
  400. 0xB20, 0x0000001F,
  401. 0xB24, 0x03020100,
  402. 0xB28, 0x07060504,
  403. 0xB2C, 0x0B0A0908,
  404. 0xB30, 0x0F0E0D0C,
  405. 0xB34, 0x13121110,
  406. 0xB38, 0x17161514,
  407. 0xB3C, 0x0000003A,
  408. 0xB40, 0x00000000,
  409. 0xB44, 0x00000000,
  410. 0xB48, 0x13000032,
  411. 0xB4C, 0x48080000,
  412. 0xB50, 0x00000000,
  413. 0xB54, 0x00000000,
  414. 0xB58, 0x00000000,
  415. 0xB5C, 0x00000000,
  416. 0xC00, 0x00000007,
  417. 0xC04, 0x00042020,
  418. 0xC08, 0x80410231,
  419. 0xC0C, 0x00000000,
  420. 0xC10, 0x00000100,
  421. 0xC14, 0x01000000,
  422. 0xC1C, 0x40000003,
  423. 0xC20, 0x2C2C2C2C,
  424. 0xC24, 0x30303030,
  425. 0xC28, 0x30303030,
  426. 0xC2C, 0x2C2C2C2C,
  427. 0xC30, 0x2C2C2C2C,
  428. 0xC34, 0x2C2C2C2C,
  429. 0xC38, 0x2C2C2C2C,
  430. 0xC3C, 0x2A2A2A2A,
  431. 0xC40, 0x2A2A2A2A,
  432. 0xC44, 0x2A2A2A2A,
  433. 0xC48, 0x2A2A2A2A,
  434. 0xC4C, 0x2A2A2A2A,
  435. 0xC50, 0x00000020,
  436. 0xC54, 0x001C1208,
  437. 0xC58, 0x30000C1C,
  438. 0xC5C, 0x00000058,
  439. 0xC60, 0x34344443,
  440. 0xC64, 0x07003333,
  441. 0xC68, 0x19791979,
  442. 0xC6C, 0x19791979,
  443. 0xC70, 0x19791979,
  444. 0xC74, 0x19791979,
  445. 0xC78, 0x19791979,
  446. 0xC7C, 0x19791979,
  447. 0xC80, 0x19791979,
  448. 0xC84, 0x19791979,
  449. 0xC94, 0x00000000,
  450. 0xC98, 0x00000000,
  451. 0xC9C, 0x00000000,
  452. 0xCA0, 0x00000029,
  453. 0xCA4, 0x08040201,
  454. 0xCA8, 0x80402010,
  455. 0xCB0, 0x77775745,
  456. 0xCB4, 0x10000077,
  457. 0xCB8, 0x00508240,
  458. };
  459. void
  460. ODM_ReadAndConfig_TC_8821A_PHY_REG(
  461. IN PDM_ODM_T pDM_Odm
  462. )
  463. {
  464. #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
  465. u4Byte hex = 0;
  466. u4Byte i = 0;
  467. u2Byte count = 0;
  468. pu4Byte ptr_array = NULL;
  469. u1Byte platform = pDM_Odm->SupportPlatform;
  470. u1Byte _interface = pDM_Odm->SupportInterface;
  471. u1Byte board = pDM_Odm->BoardType;
  472. u4Byte ArrayLen = sizeof(Array_TC_8821A_PHY_REG)/sizeof(u4Byte);
  473. pu4Byte Array = Array_TC_8821A_PHY_REG;
  474. hex += board;
  475. hex += _interface << 8;
  476. hex += platform << 16;
  477. hex += 0xFF000000;
  478. ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_TC_8821A_PHY_REG, hex = 0x%X\n", hex));
  479. for (i = 0; i < ArrayLen; i += 2 )
  480. {
  481. u4Byte v1 = Array[i];
  482. u4Byte v2 = Array[i+1];
  483. // This (offset, data) pair meets the condition.
  484. if ( v1 < 0xCDCDCDCD )
  485. {
  486. odm_ConfigBB_PHY_8821A(pDM_Odm, v1, bMaskDWord, v2);
  487. continue;
  488. }
  489. else
  490. { // This line is the start line of branch.
  491. if ( !CheckCondition(Array[i], hex) )
  492. { // Discard the following (offset, data) pairs.
  493. READ_NEXT_PAIR(v1, v2, i);
  494. while (v2 != 0xDEAD &&
  495. v2 != 0xCDEF &&
  496. v2 != 0xCDCD && i < ArrayLen -2)
  497. {
  498. READ_NEXT_PAIR(v1, v2, i);
  499. }
  500. i -= 2; // prevent from for-loop += 2
  501. }
  502. else // Configure matched pairs and skip to end of if-else.
  503. {
  504. READ_NEXT_PAIR(v1, v2, i);
  505. while (v2 != 0xDEAD &&
  506. v2 != 0xCDEF &&
  507. v2 != 0xCDCD && i < ArrayLen -2)
  508. {
  509. odm_ConfigBB_PHY_8821A(pDM_Odm, v1, bMaskDWord, v2);
  510. READ_NEXT_PAIR(v1, v2, i);
  511. }
  512. while (v2 != 0xDEAD && i < ArrayLen -2)
  513. {
  514. READ_NEXT_PAIR(v1, v2, i);
  515. }
  516. }
  517. }
  518. }
  519. }
  520. /******************************************************************************
  521. * PHY_REG_PG.TXT
  522. ******************************************************************************/
  523. u4Byte Array_TC_8821A_PHY_REG_PG[] = {
  524. 0xC20, 0x00000000, 0x34343434,
  525. 0xC24, 0x00000000, 0x34343434,
  526. 0xC28, 0x00000000, 0x30323234,
  527. 0xC2C, 0x00000000, 0x34343434,
  528. 0xC30, 0x00000000, 0x26283032,
  529. 0xC34, 0x00000000, 0x34343434,
  530. 0xC38, 0x00000000, 0x26283032,
  531. 0xE20, 0x00000000, 0x34343434,
  532. 0xE24, 0x00000000, 0x34343434,
  533. 0xE28, 0x00000000, 0x30323234,
  534. 0xE2C, 0x00000000, 0x34343434,
  535. 0xE30, 0x00000000, 0x26283032,
  536. 0xE34, 0x00000000, 0x34343434,
  537. 0xE38, 0x00000000, 0x26283032,
  538. 0xC24, 0x00000000, 0x32323434,
  539. 0xC28, 0x00000000, 0x30303032,
  540. 0xC2C, 0x00000000, 0x32323434,
  541. 0xC30, 0x00000000, 0x30303032,
  542. 0xC34, 0x00000000, 0x32323434,
  543. 0xC38, 0x00000000, 0x30303032,
  544. 0xC3C, 0x00000000, 0x32323434,
  545. 0xC40, 0x00000000, 0x30303032,
  546. 0xC44, 0x00000000, 0x34342828,
  547. 0xC48, 0x00000000, 0x30323232,
  548. 0xC4C, 0x00000000, 0x28283030,
  549. 0xE24, 0x00000000, 0x32323434,
  550. 0xE28, 0x00000000, 0x30303032,
  551. 0xE2C, 0x00000000, 0x32323434,
  552. 0xE30, 0x00000000, 0x28303032,
  553. 0xE34, 0x00000000, 0x32323434,
  554. 0xE38, 0x00000000, 0x30303032,
  555. 0xE3C, 0x00000000, 0x32323434,
  556. 0xE40, 0x00000000, 0x30303032,
  557. 0xE44, 0x00000000, 0x34342828,
  558. 0xE48, 0x00000000, 0x30323232,
  559. 0xE4C, 0x00000000, 0x28283030,
  560. };
  561. void
  562. ODM_ReadAndConfig_TC_8821A_PHY_REG_PG(
  563. IN PDM_ODM_T pDM_Odm
  564. )
  565. {
  566. u4Byte hex = 0;
  567. u4Byte i = 0;
  568. u2Byte count = 0;
  569. pu4Byte ptr_array = NULL;
  570. u1Byte platform = pDM_Odm->SupportPlatform;
  571. u1Byte _interface = pDM_Odm->SupportInterface;
  572. u1Byte board = pDM_Odm->BoardType;
  573. u4Byte ArrayLen = sizeof(Array_TC_8821A_PHY_REG_PG)/sizeof(u4Byte);
  574. pu4Byte Array = Array_TC_8821A_PHY_REG_PG;
  575. pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE;
  576. hex += board;
  577. hex += _interface << 8;
  578. hex += platform << 16;
  579. hex += 0xFF000000;
  580. for (i = 0; i < ArrayLen; i += 3 )
  581. {
  582. u4Byte v1 = Array[i];
  583. u4Byte v2 = Array[i+1];
  584. u4Byte v3 = Array[i+2];
  585. // this line is a line of pure_body
  586. if ( v1 < 0xCDCDCDCD )
  587. {
  588. odm_ConfigBB_PHY_REG_PG_8821A(pDM_Odm, v1, v2, v3);
  589. continue;
  590. }
  591. else
  592. { // this line is the start of branch
  593. if ( !CheckCondition(Array[i], hex) )
  594. { // don't need the hw_body
  595. i += 2; // skip the pair of expression
  596. v1 = Array[i];
  597. v2 = Array[i+1];
  598. v3 = Array[i+2];
  599. while (v2 != 0xDEAD)
  600. {
  601. i += 3;
  602. v1 = Array[i];
  603. v2 = Array[i+1];
  604. v3 = Array[i+1];
  605. }
  606. }
  607. }
  608. }
  609. }
  610. #endif // end of HWIMG_SUPPORT