• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 ******************************************************************************/
15 
16 
17 #include "odm_precomp.h"
18 
CheckPositive(PDM_ODM_T pDM_Odm,const u32 Condition1,const u32 Condition2)19 static bool CheckPositive(
20 	PDM_ODM_T pDM_Odm, const u32 Condition1, const u32 Condition2
21 )
22 {
23 	u8 _BoardType =
24 		((pDM_Odm->BoardType & BIT4) >> 4) << 0 | /*  _GLNA */
25 		((pDM_Odm->BoardType & BIT3) >> 3) << 1 | /*  _GPA */
26 		((pDM_Odm->BoardType & BIT7) >> 7) << 2 | /*  _ALNA */
27 		((pDM_Odm->BoardType & BIT6) >> 6) << 3 | /*  _APA */
28 		((pDM_Odm->BoardType & BIT2) >> 2) << 4;  /*  _BT */
29 
30 	u32 cond1 = Condition1, cond2 = Condition2;
31 	u32 driver1 =
32 		pDM_Odm->CutVersion << 24 |
33 		pDM_Odm->SupportPlatform << 16 |
34 		pDM_Odm->PackageType << 12 |
35 		pDM_Odm->SupportInterface << 8  |
36 		_BoardType;
37 
38 	u32 driver2 =
39 		pDM_Odm->TypeGLNA << 0 |
40 		pDM_Odm->TypeGPA << 8 |
41 		pDM_Odm->TypeALNA << 16 |
42 		pDM_Odm->TypeAPA << 24;
43 
44 	ODM_RT_TRACE(
45 		pDM_Odm,
46 		ODM_COMP_INIT,
47 		ODM_DBG_TRACE,
48 		(
49 			"===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n",
50 			cond1,
51 			cond2
52 		)
53 	);
54 	ODM_RT_TRACE(
55 		pDM_Odm,
56 		ODM_COMP_INIT,
57 		ODM_DBG_TRACE,
58 		(
59 			"===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n",
60 			driver1,
61 			driver2
62 		)
63 	);
64 
65 	ODM_RT_TRACE(
66 		pDM_Odm,
67 		ODM_COMP_INIT,
68 		ODM_DBG_TRACE,
69 		("	(Platform, Interface) = (0x%X, 0x%X)\n",
70 			pDM_Odm->SupportPlatform,
71 			pDM_Odm->SupportInterface
72 		)
73 	);
74 	ODM_RT_TRACE(
75 		pDM_Odm,
76 		ODM_COMP_INIT,
77 		ODM_DBG_TRACE,
78 		(
79 			"	(Board, Package) = (0x%X, 0x%X)\n",
80 			pDM_Odm->BoardType,
81 			pDM_Odm->PackageType
82 		)
83 	);
84 
85 
86 	/*  Value Defined Check =============== */
87 	/* QFN Type [15:12] and Cut Version [27:24] need to do value check */
88 
89 	if (((cond1 & 0x0000F000) != 0) && ((cond1 & 0x0000F000) != (driver1 & 0x0000F000)))
90 		return false;
91 	if (((cond1 & 0x0F000000) != 0) && ((cond1 & 0x0F000000) != (driver1 & 0x0F000000)))
92 		return false;
93 
94 	/*  Bit Defined Check ================ */
95 	/*  We don't care [31:28] and [23:20] */
96 	/*  */
97 	cond1   &= 0x000F0FFF;
98 	driver1 &= 0x000F0FFF;
99 
100 	if ((cond1 & driver1) == cond1) {
101 		u32 bitMask = 0;
102 
103 		if ((cond1 & 0x0F) == 0) /*  BoardType is DONTCARE */
104 			return true;
105 
106 		if ((cond1 & BIT0) != 0) /* GLNA */
107 			bitMask |= 0x000000FF;
108 		if ((cond1 & BIT1) != 0) /* GPA */
109 			bitMask |= 0x0000FF00;
110 		if ((cond1 & BIT2) != 0) /* ALNA */
111 			bitMask |= 0x00FF0000;
112 		if ((cond1 & BIT3) != 0) /* APA */
113 			bitMask |= 0xFF000000;
114 
115 		/*  BoardType of each RF path is matched */
116 		if ((cond2 & bitMask) == (driver2 & bitMask))
117 			return true;
118 	}
119 	return false;
120 }
121 
CheckNegative(PDM_ODM_T pDM_Odm,const u32 Condition1,const u32 Condition2)122 static bool CheckNegative(
123 	PDM_ODM_T pDM_Odm, const u32  Condition1, const u32 Condition2
124 )
125 {
126 	return true;
127 }
128 
129 /******************************************************************************
130 *                           AGC_TAB.TXT
131 ******************************************************************************/
132 
133 static u32 Array_MP_8723B_AGC_TAB[] = {
134 		0xC78, 0xFD000001,
135 		0xC78, 0xFC010001,
136 		0xC78, 0xFB020001,
137 		0xC78, 0xFA030001,
138 		0xC78, 0xF9040001,
139 		0xC78, 0xF8050001,
140 		0xC78, 0xF7060001,
141 		0xC78, 0xF6070001,
142 		0xC78, 0xF5080001,
143 		0xC78, 0xF4090001,
144 		0xC78, 0xF30A0001,
145 		0xC78, 0xF20B0001,
146 		0xC78, 0xF10C0001,
147 		0xC78, 0xF00D0001,
148 		0xC78, 0xEF0E0001,
149 		0xC78, 0xEE0F0001,
150 		0xC78, 0xED100001,
151 		0xC78, 0xEC110001,
152 		0xC78, 0xEB120001,
153 		0xC78, 0xEA130001,
154 		0xC78, 0xE9140001,
155 		0xC78, 0xE8150001,
156 		0xC78, 0xE7160001,
157 		0xC78, 0xE6170001,
158 		0xC78, 0xE5180001,
159 		0xC78, 0xE4190001,
160 		0xC78, 0xE31A0001,
161 		0xC78, 0xA51B0001,
162 		0xC78, 0xA41C0001,
163 		0xC78, 0xA31D0001,
164 		0xC78, 0x671E0001,
165 		0xC78, 0x661F0001,
166 		0xC78, 0x65200001,
167 		0xC78, 0x64210001,
168 		0xC78, 0x63220001,
169 		0xC78, 0x4A230001,
170 		0xC78, 0x49240001,
171 		0xC78, 0x48250001,
172 		0xC78, 0x47260001,
173 		0xC78, 0x46270001,
174 		0xC78, 0x45280001,
175 		0xC78, 0x44290001,
176 		0xC78, 0x432A0001,
177 		0xC78, 0x422B0001,
178 		0xC78, 0x292C0001,
179 		0xC78, 0x282D0001,
180 		0xC78, 0x272E0001,
181 		0xC78, 0x262F0001,
182 		0xC78, 0x0A300001,
183 		0xC78, 0x09310001,
184 		0xC78, 0x08320001,
185 		0xC78, 0x07330001,
186 		0xC78, 0x06340001,
187 		0xC78, 0x05350001,
188 		0xC78, 0x04360001,
189 		0xC78, 0x03370001,
190 		0xC78, 0x02380001,
191 		0xC78, 0x01390001,
192 		0xC78, 0x013A0001,
193 		0xC78, 0x013B0001,
194 		0xC78, 0x013C0001,
195 		0xC78, 0x013D0001,
196 		0xC78, 0x013E0001,
197 		0xC78, 0x013F0001,
198 		0xC78, 0xFC400001,
199 		0xC78, 0xFB410001,
200 		0xC78, 0xFA420001,
201 		0xC78, 0xF9430001,
202 		0xC78, 0xF8440001,
203 		0xC78, 0xF7450001,
204 		0xC78, 0xF6460001,
205 		0xC78, 0xF5470001,
206 		0xC78, 0xF4480001,
207 		0xC78, 0xF3490001,
208 		0xC78, 0xF24A0001,
209 		0xC78, 0xF14B0001,
210 		0xC78, 0xF04C0001,
211 		0xC78, 0xEF4D0001,
212 		0xC78, 0xEE4E0001,
213 		0xC78, 0xED4F0001,
214 		0xC78, 0xEC500001,
215 		0xC78, 0xEB510001,
216 		0xC78, 0xEA520001,
217 		0xC78, 0xE9530001,
218 		0xC78, 0xE8540001,
219 		0xC78, 0xE7550001,
220 		0xC78, 0xE6560001,
221 		0xC78, 0xE5570001,
222 		0xC78, 0xE4580001,
223 		0xC78, 0xE3590001,
224 		0xC78, 0xA65A0001,
225 		0xC78, 0xA55B0001,
226 		0xC78, 0xA45C0001,
227 		0xC78, 0xA35D0001,
228 		0xC78, 0x675E0001,
229 		0xC78, 0x665F0001,
230 		0xC78, 0x65600001,
231 		0xC78, 0x64610001,
232 		0xC78, 0x63620001,
233 		0xC78, 0x62630001,
234 		0xC78, 0x61640001,
235 		0xC78, 0x48650001,
236 		0xC78, 0x47660001,
237 		0xC78, 0x46670001,
238 		0xC78, 0x45680001,
239 		0xC78, 0x44690001,
240 		0xC78, 0x436A0001,
241 		0xC78, 0x426B0001,
242 		0xC78, 0x286C0001,
243 		0xC78, 0x276D0001,
244 		0xC78, 0x266E0001,
245 		0xC78, 0x256F0001,
246 		0xC78, 0x24700001,
247 		0xC78, 0x09710001,
248 		0xC78, 0x08720001,
249 		0xC78, 0x07730001,
250 		0xC78, 0x06740001,
251 		0xC78, 0x05750001,
252 		0xC78, 0x04760001,
253 		0xC78, 0x03770001,
254 		0xC78, 0x02780001,
255 		0xC78, 0x01790001,
256 		0xC78, 0x017A0001,
257 		0xC78, 0x017B0001,
258 		0xC78, 0x017C0001,
259 		0xC78, 0x017D0001,
260 		0xC78, 0x017E0001,
261 		0xC78, 0x017F0001,
262 		0xC50, 0x69553422,
263 		0xC50, 0x69553420,
264 		0x824, 0x00390204,
265 
266 };
267 
ODM_ReadAndConfig_MP_8723B_AGC_TAB(PDM_ODM_T pDM_Odm)268 void ODM_ReadAndConfig_MP_8723B_AGC_TAB(PDM_ODM_T pDM_Odm)
269 {
270 	u32 i = 0;
271 	u32 ArrayLen = sizeof(Array_MP_8723B_AGC_TAB)/sizeof(u32);
272 	u32 *Array = Array_MP_8723B_AGC_TAB;
273 
274 	ODM_RT_TRACE(
275 		pDM_Odm,
276 		ODM_COMP_INIT,
277 		ODM_DBG_LOUD,
278 		("===> ODM_ReadAndConfig_MP_8723B_AGC_TAB\n")
279 	);
280 
281 	for (i = 0; i < ArrayLen; i += 2) {
282 		u32 v1 = Array[i];
283 		u32 v2 = Array[i+1];
284 
285 		/*  This (offset, data) pair doesn't care the condition. */
286 		if (v1 < 0x40000000) {
287 			odm_ConfigBB_AGC_8723B(pDM_Odm, v1, bMaskDWord, v2);
288 			continue;
289 		} else {
290 			/*  This line is the beginning of branch. */
291 			bool bMatched = true;
292 			u8  cCond  = (u8)((v1 & (BIT29|BIT28)) >> 28);
293 
294 			if (cCond == COND_ELSE) { /*  ELSE, ENDIF */
295 				bMatched = true;
296 				READ_NEXT_PAIR(v1, v2, i);
297 			} else if (!CheckPositive(pDM_Odm, v1, v2)) {
298 				bMatched = false;
299 				READ_NEXT_PAIR(v1, v2, i);
300 				READ_NEXT_PAIR(v1, v2, i);
301 			} else {
302 				READ_NEXT_PAIR(v1, v2, i);
303 				if (!CheckNegative(pDM_Odm, v1, v2))
304 					bMatched = false;
305 				else
306 					bMatched = true;
307 				READ_NEXT_PAIR(v1, v2, i);
308 			}
309 
310 			if (bMatched == false) {
311 				/*  Condition isn't matched.
312 				*   Discard the following (offset, data) pairs.
313 				*/
314 				while (v1 < 0x40000000 && i < ArrayLen-2)
315 					READ_NEXT_PAIR(v1, v2, i);
316 
317 				i -= 2; /*  prevent from for-loop += 2 */
318 			} else {
319 				/*  Configure matched pairs and skip to end of if-else. */
320 				while (v1 < 0x40000000 && i < ArrayLen-2) {
321 					odm_ConfigBB_AGC_8723B(pDM_Odm, v1, bMaskDWord, v2);
322 					READ_NEXT_PAIR(v1, v2, i);
323 				}
324 
325 				/*  Keeps reading until ENDIF. */
326 				cCond = (u8)((v1 & (BIT29|BIT28)) >> 28);
327 				while (cCond != COND_ENDIF && i < ArrayLen-2) {
328 					READ_NEXT_PAIR(v1, v2, i);
329 					cCond = (u8)((v1 & (BIT29|BIT28)) >> 28);
330 				}
331 			}
332 		}
333 	}
334 }
335 
336 /******************************************************************************
337 *                           PHY_REG.TXT
338 ******************************************************************************/
339 
340 static u32 Array_MP_8723B_PHY_REG[] = {
341 		0x800, 0x80040000,
342 		0x804, 0x00000003,
343 		0x808, 0x0000FC00,
344 		0x80C, 0x0000000A,
345 		0x810, 0x10001331,
346 		0x814, 0x020C3D10,
347 		0x818, 0x02200385,
348 		0x81C, 0x00000000,
349 		0x820, 0x01000100,
350 		0x824, 0x00190204,
351 		0x828, 0x00000000,
352 		0x82C, 0x00000000,
353 		0x830, 0x00000000,
354 		0x834, 0x00000000,
355 		0x838, 0x00000000,
356 		0x83C, 0x00000000,
357 		0x840, 0x00010000,
358 		0x844, 0x00000000,
359 		0x848, 0x00000000,
360 		0x84C, 0x00000000,
361 		0x850, 0x00000000,
362 		0x854, 0x00000000,
363 		0x858, 0x569A11A9,
364 		0x85C, 0x01000014,
365 		0x860, 0x66F60110,
366 		0x864, 0x061F0649,
367 		0x868, 0x00000000,
368 		0x86C, 0x27272700,
369 		0x870, 0x07000760,
370 		0x874, 0x25004000,
371 		0x878, 0x00000808,
372 		0x87C, 0x00000000,
373 		0x880, 0xB0000C1C,
374 		0x884, 0x00000001,
375 		0x888, 0x00000000,
376 		0x88C, 0xCCC000C0,
377 		0x890, 0x00000800,
378 		0x894, 0xFFFFFFFE,
379 		0x898, 0x40302010,
380 		0x89C, 0x00706050,
381 		0x900, 0x00000000,
382 		0x904, 0x00000023,
383 		0x908, 0x00000000,
384 		0x90C, 0x81121111,
385 		0x910, 0x00000002,
386 		0x914, 0x00000201,
387 		0xA00, 0x00D047C8,
388 		0xA04, 0x80FF800C,
389 		0xA08, 0x8C838300,
390 		0xA0C, 0x2E7F120F,
391 		0xA10, 0x9500BB78,
392 		0xA14, 0x1114D028,
393 		0xA18, 0x00881117,
394 		0xA1C, 0x89140F00,
395 		0xA20, 0x1A1B0000,
396 		0xA24, 0x090E1317,
397 		0xA28, 0x00000204,
398 		0xA2C, 0x00D30000,
399 		0xA70, 0x101FBF00,
400 		0xA74, 0x00000007,
401 		0xA78, 0x00000900,
402 		0xA7C, 0x225B0606,
403 		0xA80, 0x21806490,
404 		0xB2C, 0x00000000,
405 		0xC00, 0x48071D40,
406 		0xC04, 0x03A05611,
407 		0xC08, 0x000000E4,
408 		0xC0C, 0x6C6C6C6C,
409 		0xC10, 0x08800000,
410 		0xC14, 0x40000100,
411 		0xC18, 0x08800000,
412 		0xC1C, 0x40000100,
413 		0xC20, 0x00000000,
414 		0xC24, 0x00000000,
415 		0xC28, 0x00000000,
416 		0xC2C, 0x00000000,
417 		0xC30, 0x69E9AC44,
418 		0xC34, 0x469652AF,
419 		0xC38, 0x49795994,
420 		0xC3C, 0x0A97971C,
421 		0xC40, 0x1F7C403F,
422 		0xC44, 0x000100B7,
423 		0xC48, 0xEC020107,
424 		0xC4C, 0x007F037F,
425 		0xC50, 0x69553420,
426 		0xC54, 0x43BC0094,
427 		0xC58, 0x00013149,
428 		0xC5C, 0x00250492,
429 		0xC60, 0x00000000,
430 		0xC64, 0x7112848B,
431 		0xC68, 0x47C00BFF,
432 		0xC6C, 0x00000036,
433 		0xC70, 0x2C7F000D,
434 		0xC74, 0x020610DB,
435 		0xC78, 0x0000001F,
436 		0xC7C, 0x00B91612,
437 		0xC80, 0x390000E4,
438 		0xC84, 0x20F60000,
439 		0xC88, 0x40000100,
440 		0xC8C, 0x20200000,
441 		0xC90, 0x00020E1A,
442 		0xC94, 0x00000000,
443 		0xC98, 0x00020E1A,
444 		0xC9C, 0x00007F7F,
445 		0xCA0, 0x00000000,
446 		0xCA4, 0x000300A0,
447 		0xCA8, 0x00000000,
448 		0xCAC, 0x00000000,
449 		0xCB0, 0x00000000,
450 		0xCB4, 0x00000000,
451 		0xCB8, 0x00000000,
452 		0xCBC, 0x28000000,
453 		0xCC0, 0x00000000,
454 		0xCC4, 0x00000000,
455 		0xCC8, 0x00000000,
456 		0xCCC, 0x00000000,
457 		0xCD0, 0x00000000,
458 		0xCD4, 0x00000000,
459 		0xCD8, 0x64B22427,
460 		0xCDC, 0x00766932,
461 		0xCE0, 0x00222222,
462 		0xCE4, 0x00000000,
463 		0xCE8, 0x37644302,
464 		0xCEC, 0x2F97D40C,
465 		0xD00, 0x00000740,
466 		0xD04, 0x40020401,
467 		0xD08, 0x0000907F,
468 		0xD0C, 0x20010201,
469 		0xD10, 0xA0633333,
470 		0xD14, 0x3333BC53,
471 		0xD18, 0x7A8F5B6F,
472 		0xD2C, 0xCC979975,
473 		0xD30, 0x00000000,
474 		0xD34, 0x80608000,
475 		0xD38, 0x00000000,
476 		0xD3C, 0x00127353,
477 		0xD40, 0x00000000,
478 		0xD44, 0x00000000,
479 		0xD48, 0x00000000,
480 		0xD4C, 0x00000000,
481 		0xD50, 0x6437140A,
482 		0xD54, 0x00000000,
483 		0xD58, 0x00000282,
484 		0xD5C, 0x30032064,
485 		0xD60, 0x4653DE68,
486 		0xD64, 0x04518A3C,
487 		0xD68, 0x00002101,
488 		0xD6C, 0x2A201C16,
489 		0xD70, 0x1812362E,
490 		0xD74, 0x322C2220,
491 		0xD78, 0x000E3C24,
492 		0xE00, 0x2D2D2D2D,
493 		0xE04, 0x2D2D2D2D,
494 		0xE08, 0x0390272D,
495 		0xE10, 0x2D2D2D2D,
496 		0xE14, 0x2D2D2D2D,
497 		0xE18, 0x2D2D2D2D,
498 		0xE1C, 0x2D2D2D2D,
499 		0xE28, 0x00000000,
500 		0xE30, 0x1000DC1F,
501 		0xE34, 0x10008C1F,
502 		0xE38, 0x02140102,
503 		0xE3C, 0x681604C2,
504 		0xE40, 0x01007C00,
505 		0xE44, 0x01004800,
506 		0xE48, 0xFB000000,
507 		0xE4C, 0x000028D1,
508 		0xE50, 0x1000DC1F,
509 		0xE54, 0x10008C1F,
510 		0xE58, 0x02140102,
511 		0xE5C, 0x28160D05,
512 		0xE60, 0x00000008,
513 		0xE68, 0x001B2556,
514 		0xE6C, 0x00C00096,
515 		0xE70, 0x00C00096,
516 		0xE74, 0x01000056,
517 		0xE78, 0x01000014,
518 		0xE7C, 0x01000056,
519 		0xE80, 0x01000014,
520 		0xE84, 0x00C00096,
521 		0xE88, 0x01000056,
522 		0xE8C, 0x00C00096,
523 		0xED0, 0x00C00096,
524 		0xED4, 0x00C00096,
525 		0xED8, 0x00C00096,
526 		0xEDC, 0x000000D6,
527 		0xEE0, 0x000000D6,
528 		0xEEC, 0x01C00016,
529 		0xF14, 0x00000003,
530 		0xF4C, 0x00000000,
531 		0xF00, 0x00000300,
532 		0x820, 0x01000100,
533 		0x800, 0x83040000,
534 
535 };
536 
ODM_ReadAndConfig_MP_8723B_PHY_REG(PDM_ODM_T pDM_Odm)537 void ODM_ReadAndConfig_MP_8723B_PHY_REG(PDM_ODM_T pDM_Odm)
538 {
539 	u32 i = 0;
540 	u32 ArrayLen = sizeof(Array_MP_8723B_PHY_REG)/sizeof(u32);
541 	u32 *Array = Array_MP_8723B_PHY_REG;
542 
543 	ODM_RT_TRACE(
544 		pDM_Odm,
545 		ODM_COMP_INIT,
546 		ODM_DBG_LOUD,
547 		("===> ODM_ReadAndConfig_MP_8723B_PHY_REG\n")
548 	);
549 
550 	for (i = 0; i < ArrayLen; i += 2) {
551 		u32 v1 = Array[i];
552 		u32 v2 = Array[i+1];
553 
554 		/*  This (offset, data) pair doesn't care the condition. */
555 		if (v1 < 0x40000000) {
556 			odm_ConfigBB_PHY_8723B(pDM_Odm, v1, bMaskDWord, v2);
557 			continue;
558 		} else {
559 			/*  This line is the beginning of branch. */
560 			bool bMatched = true;
561 			u8  cCond  = (u8)((v1 & (BIT29|BIT28)) >> 28);
562 
563 			if (cCond == COND_ELSE) { /*  ELSE, ENDIF */
564 				bMatched = true;
565 				READ_NEXT_PAIR(v1, v2, i);
566 			} else if (!CheckPositive(pDM_Odm, v1, v2)) {
567 				bMatched = false;
568 				READ_NEXT_PAIR(v1, v2, i);
569 				READ_NEXT_PAIR(v1, v2, i);
570 			} else {
571 				READ_NEXT_PAIR(v1, v2, i);
572 				if (!CheckNegative(pDM_Odm, v1, v2))
573 					bMatched = false;
574 				else
575 					bMatched = true;
576 				READ_NEXT_PAIR(v1, v2, i);
577 			}
578 
579 			if (bMatched == false) {
580 				/*  Condition isn't matched.
581 				*   Discard the following (offset, data) pairs.
582 				*/
583 				while (v1 < 0x40000000 && i < ArrayLen-2)
584 					READ_NEXT_PAIR(v1, v2, i);
585 
586 				i -= 2; /*  prevent from for-loop += 2 */
587 			} else { /*  Configure matched pairs and skip to end of if-else. */
588 				while (v1 < 0x40000000 && i < ArrayLen-2) {
589 					odm_ConfigBB_PHY_8723B(pDM_Odm, v1, bMaskDWord, v2);
590 					READ_NEXT_PAIR(v1, v2, i);
591 				}
592 
593 				/*  Keeps reading until ENDIF. */
594 				cCond = (u8)((v1 & (BIT29|BIT28)) >> 28);
595 				while (cCond != COND_ENDIF && i < ArrayLen-2) {
596 					READ_NEXT_PAIR(v1, v2, i);
597 					cCond = (u8)((v1 & (BIT29|BIT28)) >> 28);
598 				}
599 			}
600 		}
601 	}
602 }
603 
604 /******************************************************************************
605 *                           PHY_REG_PG.TXT
606 ******************************************************************************/
607 
608 static u32 Array_MP_8723B_PHY_REG_PG[] = {
609 	0, 0, 0, 0x00000e08, 0x0000ff00, 0x00003800,
610 	0, 0, 0, 0x0000086c, 0xffffff00, 0x32343600,
611 	0, 0, 0, 0x00000e00, 0xffffffff, 0x40424444,
612 	0, 0, 0, 0x00000e04, 0xffffffff, 0x28323638,
613 	0, 0, 0, 0x00000e10, 0xffffffff, 0x38404244,
614 	0, 0, 0, 0x00000e14, 0xffffffff, 0x26303436
615 };
616 
ODM_ReadAndConfig_MP_8723B_PHY_REG_PG(PDM_ODM_T pDM_Odm)617 void ODM_ReadAndConfig_MP_8723B_PHY_REG_PG(PDM_ODM_T pDM_Odm)
618 {
619 	u32 i = 0;
620 	u32 ArrayLen = sizeof(Array_MP_8723B_PHY_REG_PG)/sizeof(u32);
621 	u32 *Array = Array_MP_8723B_PHY_REG_PG;
622 
623 	ODM_RT_TRACE(
624 		pDM_Odm,
625 		ODM_COMP_INIT,
626 		ODM_DBG_LOUD,
627 		("===> ODM_ReadAndConfig_MP_8723B_PHY_REG_PG\n")
628 	);
629 
630 	pDM_Odm->PhyRegPgVersion = 1;
631 	pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE;
632 
633 	for (i = 0; i < ArrayLen; i += 6) {
634 		u32 v1 = Array[i];
635 		u32 v2 = Array[i+1];
636 		u32 v3 = Array[i+2];
637 		u32 v4 = Array[i+3];
638 		u32 v5 = Array[i+4];
639 		u32 v6 = Array[i+5];
640 
641 		odm_ConfigBB_PHY_REG_PG_8723B(pDM_Odm, v1, v2, v3, v4, v5, v6);
642 	}
643 }
644