xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8723ds/hal/efuse/rtl8723d/HalEfuseMask8723D_PCIE.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 Realtek Corporation.
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 /*#include "Mp_Precomp.h"*/
17 #include <drv_types.h>
18 
19 #include "HalEfuseMask8723D_PCIE.h"
20 
21 /******************************************************************************
22 *                           MPCIE.TXT
23 ******************************************************************************/
24 
25 u8 Array_MP_8723D_MPCIE[] = {
26 	0xFF,
27 	0xF3,
28 	0x00,
29 	0x0E,
30 	0x70,
31 	0x00,
32 	0x00,
33 	0x00,
34 	0x00,
35 	0x00,
36 	0x00,
37 	0x07,
38 	0xF3,
39 	0xFF,
40 	0xFF,
41 	0x7C,
42 	0x30,
43 	0x00,
44 	0x00,
45 	0x00,
46 	0x00,
47 	0x00,
48 	0x00,
49 	0x00,
50 	0x00,
51 	0x00,
52 	0x00,
53 	0x00,
54 	0x00,
55 	0x00,
56 	0x00,
57 	0x00,
58 };
59 
60 u16
EFUSE_GetArrayLen_MP_8723D_MPCIE(void)61 EFUSE_GetArrayLen_MP_8723D_MPCIE(void)
62 {
63 	return sizeof(Array_MP_8723D_MPCIE) / sizeof(u8);
64 }
65 
66 void
EFUSE_GetMaskArray_MP_8723D_MPCIE(u8 * Array)67 EFUSE_GetMaskArray_MP_8723D_MPCIE(
68 		u8 *Array
69 )
70 {
71 	u16 len = EFUSE_GetArrayLen_MP_8723D_MPCIE(), i = 0;
72 
73 	for (i = 0; i < len; ++i)
74 		Array[i] = Array_MP_8723D_MPCIE[i];
75 }
76 BOOLEAN
EFUSE_IsAddressMasked_MP_8723D_MPCIE(u16 Offset)77 EFUSE_IsAddressMasked_MP_8723D_MPCIE(
78 		u16 Offset
79 )
80 {
81 	int r = Offset / 16;
82 	int c = (Offset % 16) / 2;
83 	int result = 0;
84 
85 	if (c < 4) /* Upper double word */
86 		result = (Array_MP_8723D_MPCIE[r] & (0x10 << c));
87 	else
88 		result = (Array_MP_8723D_MPCIE[r] & (0x01 << (c - 4)));
89 
90 	return (result > 0) ? 0 : 1;
91 }
92