1 /****************************************************************************** 2 * 3 * Copyright(c) 2009-2014 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 * The full GNU General Public License is included in this distribution in the 15 * file called LICENSE. 16 * 17 * Contact Information: 18 * wlanfae <wlanfae@realtek.com> 19 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 * Hsinchu 300, Taiwan. 21 * 22 * Created on 2010/ 5/18, 1:41 23 * 24 * Larry Finger <Larry.Finger@lwfinger.net> 25 * 26 *****************************************************************************/ 27 28 #include <linux/kernel.h> 29 #include "table.h" 30 31 u32 RTL8723BEPHY_REG_1TARRAY[] = { 32 0x800, 0x80040000, 33 0x804, 0x00000003, 34 0x808, 0x0000FC00, 35 0x80C, 0x0000000A, 36 0x810, 0x10001331, 37 0x814, 0x020C3D10, 38 0x818, 0x02200385, 39 0x81C, 0x00000000, 40 0x820, 0x01000100, 41 0x824, 0x00190204, 42 0x828, 0x00000000, 43 0x82C, 0x00000000, 44 0x830, 0x00000000, 45 0x834, 0x00000000, 46 0x838, 0x00000000, 47 0x83C, 0x00000000, 48 0x840, 0x00010000, 49 0x844, 0x00000000, 50 0x848, 0x00000000, 51 0x84C, 0x00000000, 52 0x850, 0x00000000, 53 0x854, 0x00000000, 54 0x858, 0x569A11A9, 55 0x85C, 0x01000014, 56 0x860, 0x66F60110, 57 0x864, 0x061F0649, 58 0x868, 0x00000000, 59 0x86C, 0x27272700, 60 0x870, 0x07000760, 61 0x874, 0x25004000, 62 0x878, 0x00000808, 63 0x87C, 0x00000000, 64 0x880, 0xB0000C1C, 65 0x884, 0x00000001, 66 0x888, 0x00000000, 67 0x88C, 0xCCC000C0, 68 0x890, 0x00000800, 69 0x894, 0xFFFFFFFE, 70 0x898, 0x40302010, 71 0x89C, 0x00706050, 72 0x900, 0x00000000, 73 0x904, 0x00000023, 74 0x908, 0x00000000, 75 0x90C, 0x81121111, 76 0x910, 0x00000002, 77 0x914, 0x00000201, 78 0xA00, 0x00D047C8, 79 0xA04, 0x80FF800C, 80 0xA08, 0x8C838300, 81 0xA0C, 0x2E7F120F, 82 0xA10, 0x9500BB78, 83 0xA14, 0x1114D028, 84 0xA18, 0x00881117, 85 0xA1C, 0x89140F00, 86 0xA20, 0x1A1B0000, 87 0xA24, 0x090E1317, 88 0xA28, 0x00000204, 89 0xA2C, 0x00D30000, 90 0xA70, 0x101FBF00, 91 0xA74, 0x00000007, 92 0xA78, 0x00000900, 93 0xA7C, 0x225B0606, 94 0xA80, 0x21806490, 95 0xB2C, 0x00000000, 96 0xC00, 0x48071D40, 97 0xC04, 0x03A05611, 98 0xC08, 0x000000E4, 99 0xC0C, 0x6C6C6C6C, 100 0xC10, 0x08800000, 101 0xC14, 0x40000100, 102 0xC18, 0x08800000, 103 0xC1C, 0x40000100, 104 0xC20, 0x00000000, 105 0xC24, 0x00000000, 106 0xC28, 0x00000000, 107 0xC2C, 0x00000000, 108 0xC30, 0x69E9AC44, 109 0xC34, 0x469652AF, 110 0xC38, 0x49795994, 111 0xC3C, 0x0A97971C, 112 0xC40, 0x1F7C403F, 113 0xC44, 0x000100B7, 114 0xC48, 0xEC020107, 115 0xC4C, 0x007F037F, 116 0xC50, 0x69553420, 117 0xC54, 0x43BC0094, 118 0xC58, 0x00013147, 119 0xC5C, 0x00250492, 120 0xC60, 0x00000000, 121 0xC64, 0x7112848B, 122 0xC68, 0x47C00BFF, 123 0xC6C, 0x00000036, 124 0xC70, 0x2C7F000D, 125 0xC74, 0x020610DB, 126 0xC78, 0x0000001F, 127 0xC7C, 0x00B91612, 128 0xC80, 0x390000E4, 129 0xC84, 0x21F60000, 130 0xC88, 0x40000100, 131 0xC8C, 0x20200000, 132 0xC90, 0x00020E1A, 133 0xC94, 0x00000000, 134 0xC98, 0x00020E1A, 135 0xC9C, 0x00007F7F, 136 0xCA0, 0x00000000, 137 0xCA4, 0x000300A0, 138 0xCA8, 0x00000000, 139 0xCAC, 0x00000000, 140 0xCB0, 0x00000000, 141 0xCB4, 0x00000000, 142 0xCB8, 0x00000000, 143 0xCBC, 0x28000000, 144 0xCC0, 0x00000000, 145 0xCC4, 0x00000000, 146 0xCC8, 0x00000000, 147 0xCCC, 0x00000000, 148 0xCD0, 0x00000000, 149 0xCD4, 0x00000000, 150 0xCD8, 0x64B22427, 151 0xCDC, 0x00766932, 152 0xCE0, 0x00222222, 153 0xCE4, 0x00000000, 154 0xCE8, 0x37644302, 155 0xCEC, 0x2F97D40C, 156 0xD00, 0x00000740, 157 0xD04, 0x40020401, 158 0xD08, 0x0000907F, 159 0xD0C, 0x20010201, 160 0xD10, 0xA0633333, 161 0xD14, 0x3333BC53, 162 0xD18, 0x7A8F5B6F, 163 0xD2C, 0xCC979975, 164 0xD30, 0x00000000, 165 0xD34, 0x80608000, 166 0xD38, 0x00000000, 167 0xD3C, 0x00127353, 168 0xD40, 0x00000000, 169 0xD44, 0x00000000, 170 0xD48, 0x00000000, 171 0xD4C, 0x00000000, 172 0xD50, 0x6437140A, 173 0xD54, 0x00000000, 174 0xD58, 0x00000282, 175 0xD5C, 0x30032064, 176 0xD60, 0x4653DE68, 177 0xD64, 0x04518A3C, 178 0xD68, 0x00002101, 179 0xD6C, 0x2A201C16, 180 0xD70, 0x1812362E, 181 0xD74, 0x322C2220, 182 0xD78, 0x000E3C24, 183 0xE00, 0x2D2D2D2D, 184 0xE04, 0x2D2D2D2D, 185 0xE08, 0x0390272D, 186 0xE10, 0x2D2D2D2D, 187 0xE14, 0x2D2D2D2D, 188 0xE18, 0x2D2D2D2D, 189 0xE1C, 0x2D2D2D2D, 190 0xE28, 0x00000000, 191 0xE30, 0x1000DC1F, 192 0xE34, 0x10008C1F, 193 0xE38, 0x02140102, 194 0xE3C, 0x681604C2, 195 0xE40, 0x01007C00, 196 0xE44, 0x01004800, 197 0xE48, 0xFB000000, 198 0xE4C, 0x000028D1, 199 0xE50, 0x1000DC1F, 200 0xE54, 0x10008C1F, 201 0xE58, 0x02140102, 202 0xE5C, 0x28160D05, 203 0xE60, 0x00000008, 204 0xE68, 0x001B2556, 205 0xE6C, 0x00C00096, 206 0xE70, 0x00C00096, 207 0xE74, 0x01000056, 208 0xE78, 0x01000014, 209 0xE7C, 0x01000056, 210 0xE80, 0x01000014, 211 0xE84, 0x00C00096, 212 0xE88, 0x01000056, 213 0xE8C, 0x00C00096, 214 0xED0, 0x00C00096, 215 0xED4, 0x00C00096, 216 0xED8, 0x00C00096, 217 0xEDC, 0x000000D6, 218 0xEE0, 0x000000D6, 219 0xEEC, 0x01C00016, 220 0xF14, 0x00000003, 221 0xF4C, 0x00000000, 222 0xF00, 0x00000300, 223 0x820, 0x01000100, 224 0x800, 0x83040000, 225 226 }; 227 228 u32 RTL8723BEPHY_REG_1TARRAYLEN = ARRAY_SIZE(RTL8723BEPHY_REG_1TARRAY); 229 230 u32 RTL8723BEPHY_REG_ARRAY_PG[] = { 231 0, 0, 0, 0x00000e08, 0x0000ff00, 0x00003800, 232 0, 0, 0, 0x0000086c, 0xffffff00, 0x32343600, 233 0, 0, 0, 0x00000e00, 0xffffffff, 0x40424444, 234 0, 0, 0, 0x00000e04, 0xffffffff, 0x28323638, 235 0, 0, 0, 0x00000e10, 0xffffffff, 0x38404244, 236 0, 0, 0, 0x00000e14, 0xffffffff, 0x26303436 237 }; 238 239 u32 RTL8723BEPHY_REG_ARRAY_PGLEN = ARRAY_SIZE(RTL8723BEPHY_REG_ARRAY_PG); 240 241 u32 RTL8723BE_RADIOA_1TARRAY[] = { 242 0x000, 0x00010000, 243 0x0B0, 0x000DFFE0, 244 0x0FE, 0x00000000, 245 0x0FE, 0x00000000, 246 0x0FE, 0x00000000, 247 0x0B1, 0x00000018, 248 0x0FE, 0x00000000, 249 0x0FE, 0x00000000, 250 0x0FE, 0x00000000, 251 0x0B2, 0x00084C00, 252 0x0B5, 0x0000D2CC, 253 0x0B6, 0x000925AA, 254 0x0B7, 0x00000010, 255 0x0B8, 0x0000907F, 256 0x05C, 0x00000002, 257 0x07C, 0x00000002, 258 0x07E, 0x00000005, 259 0x08B, 0x0006FC00, 260 0x0B0, 0x000FF9F0, 261 0x01C, 0x000739D2, 262 0x01E, 0x00000000, 263 0x0DF, 0x00000780, 264 0x050, 0x00067435, 265 0x80002000, 0x00000000, 0x40000000, 0x00000000, 266 0x051, 0x0006F10E, 267 0x052, 0x000007D3, 268 0x90003000, 0x00000000, 0x40000000, 0x00000000, 269 0x051, 0x0006F10E, 270 0x052, 0x000007D3, 271 0x90004000, 0x00000000, 0x40000000, 0x00000000, 272 0x051, 0x0006F10E, 273 0x052, 0x000007D3, 274 0xA0000000, 0x00000000, 275 0x051, 0x0006B04E, 276 0x052, 0x000007D2, 277 0xB0000000, 0x00000000, 278 0x053, 0x00000000, 279 0x054, 0x00050400, 280 0x055, 0x0004026E, 281 0x0DD, 0x0000004C, 282 0x070, 0x00067435, 283 0x80002000, 0x00000000, 0x40000000, 0x00000000, 284 0x071, 0x0006F10E, 285 0x072, 0x000007D3, 286 0x90003000, 0x00000000, 0x40000000, 0x00000000, 287 0x071, 0x0006F10E, 288 0x072, 0x000007D3, 289 0x90004000, 0x00000000, 0x40000000, 0x00000000, 290 0x071, 0x0006F10E, 291 0x072, 0x000007D3, 292 0xA0000000, 0x00000000, 293 0x071, 0x0006B04E, 294 0x072, 0x000007D2, 295 0xB0000000, 0x00000000, 296 0x073, 0x00000000, 297 0x074, 0x00050400, 298 0x075, 0x0004026E, 299 0x0EF, 0x00000100, 300 0x034, 0x0000ADD7, 301 0x035, 0x00005C00, 302 0x034, 0x00009DD4, 303 0x035, 0x00005000, 304 0x034, 0x00008DD1, 305 0x035, 0x00004400, 306 0x034, 0x00007DCE, 307 0x035, 0x00003800, 308 0x034, 0x00006CD1, 309 0x035, 0x00004400, 310 0x034, 0x00005CCE, 311 0x035, 0x00003800, 312 0x034, 0x000048CE, 313 0x035, 0x00004400, 314 0x034, 0x000034CE, 315 0x035, 0x00003800, 316 0x034, 0x00002451, 317 0x035, 0x00004400, 318 0x034, 0x0000144E, 319 0x035, 0x00003800, 320 0x034, 0x00000051, 321 0x035, 0x00004400, 322 0x0EF, 0x00000000, 323 0x0EF, 0x00000100, 324 0x0ED, 0x00000010, 325 0x044, 0x0000ADD7, 326 0x044, 0x00009DD4, 327 0x044, 0x00008DD1, 328 0x044, 0x00007DCE, 329 0x044, 0x00006CC1, 330 0x044, 0x00005CCE, 331 0x044, 0x000044D1, 332 0x044, 0x000034CE, 333 0x044, 0x00002451, 334 0x044, 0x0000144E, 335 0x044, 0x00000051, 336 0x0EF, 0x00000000, 337 0x0ED, 0x00000000, 338 0x07F, 0x00020080, 339 0x0EF, 0x00002000, 340 0x03B, 0x000380EF, 341 0x03B, 0x000302FE, 342 0x03B, 0x00028CE6, 343 0x03B, 0x000200BC, 344 0x03B, 0x000188A5, 345 0x03B, 0x00010FBC, 346 0x03B, 0x00008F71, 347 0x03B, 0x00000900, 348 0x0EF, 0x00000000, 349 0x0ED, 0x00000001, 350 0x040, 0x000380EF, 351 0x040, 0x000302FE, 352 0x040, 0x00028CE6, 353 0x040, 0x000200BC, 354 0x040, 0x000188A5, 355 0x040, 0x00010FBC, 356 0x040, 0x00008F71, 357 0x040, 0x00000900, 358 0x0ED, 0x00000000, 359 0x082, 0x00080000, 360 0x083, 0x00008000, 361 0x084, 0x00048D80, 362 0x085, 0x00068000, 363 0x0A2, 0x00080000, 364 0x0A3, 0x00008000, 365 0x0A4, 0x00048D80, 366 0x0A5, 0x00068000, 367 0x0ED, 0x00000002, 368 0x0EF, 0x00000002, 369 0x056, 0x00000032, 370 0x076, 0x00000032, 371 0x001, 0x00000780, 372 373 }; 374 375 u32 RTL8723BE_RADIOA_1TARRAYLEN = ARRAY_SIZE(RTL8723BE_RADIOA_1TARRAY); 376 377 u32 RTL8723BEMAC_1T_ARRAY[] = { 378 0x02F, 0x00000030, 379 0x035, 0x00000000, 380 0x039, 0x00000008, 381 0x064, 0x00000000, 382 0x067, 0x00000020, 383 0x421, 0x0000000F, 384 0x428, 0x0000000A, 385 0x429, 0x00000010, 386 0x430, 0x00000000, 387 0x431, 0x00000000, 388 0x432, 0x00000000, 389 0x433, 0x00000001, 390 0x434, 0x00000004, 391 0x435, 0x00000005, 392 0x436, 0x00000007, 393 0x437, 0x00000008, 394 0x43C, 0x00000004, 395 0x43D, 0x00000005, 396 0x43E, 0x00000007, 397 0x43F, 0x00000008, 398 0x440, 0x0000005D, 399 0x441, 0x00000001, 400 0x442, 0x00000000, 401 0x444, 0x00000010, 402 0x445, 0x00000000, 403 0x446, 0x00000000, 404 0x447, 0x00000000, 405 0x448, 0x00000000, 406 0x449, 0x000000F0, 407 0x44A, 0x0000000F, 408 0x44B, 0x0000003E, 409 0x44C, 0x00000010, 410 0x44D, 0x00000000, 411 0x44E, 0x00000000, 412 0x44F, 0x00000000, 413 0x450, 0x00000000, 414 0x451, 0x000000F0, 415 0x452, 0x0000000F, 416 0x453, 0x00000000, 417 0x456, 0x0000005E, 418 0x460, 0x00000066, 419 0x461, 0x00000066, 420 0x4C8, 0x000000FF, 421 0x4C9, 0x00000008, 422 0x4CC, 0x000000FF, 423 0x4CD, 0x000000FF, 424 0x4CE, 0x00000001, 425 0x500, 0x00000026, 426 0x501, 0x000000A2, 427 0x502, 0x0000002F, 428 0x503, 0x00000000, 429 0x504, 0x00000028, 430 0x505, 0x000000A3, 431 0x506, 0x0000005E, 432 0x507, 0x00000000, 433 0x508, 0x0000002B, 434 0x509, 0x000000A4, 435 0x50A, 0x0000005E, 436 0x50B, 0x00000000, 437 0x50C, 0x0000004F, 438 0x50D, 0x000000A4, 439 0x50E, 0x00000000, 440 0x50F, 0x00000000, 441 0x512, 0x0000001C, 442 0x514, 0x0000000A, 443 0x516, 0x0000000A, 444 0x525, 0x0000004F, 445 0x550, 0x00000010, 446 0x551, 0x00000010, 447 0x559, 0x00000002, 448 0x55C, 0x00000050, 449 0x55D, 0x000000FF, 450 0x605, 0x00000030, 451 0x608, 0x0000000E, 452 0x609, 0x0000002A, 453 0x620, 0x000000FF, 454 0x621, 0x000000FF, 455 0x622, 0x000000FF, 456 0x623, 0x000000FF, 457 0x624, 0x000000FF, 458 0x625, 0x000000FF, 459 0x626, 0x000000FF, 460 0x627, 0x000000FF, 461 0x638, 0x00000050, 462 0x63C, 0x0000000A, 463 0x63D, 0x0000000A, 464 0x63E, 0x0000000E, 465 0x63F, 0x0000000E, 466 0x640, 0x00000040, 467 0x642, 0x00000040, 468 0x643, 0x00000000, 469 0x652, 0x000000C8, 470 0x66E, 0x00000005, 471 0x700, 0x00000021, 472 0x701, 0x00000043, 473 0x702, 0x00000065, 474 0x703, 0x00000087, 475 0x708, 0x00000021, 476 0x709, 0x00000043, 477 0x70A, 0x00000065, 478 0x70B, 0x00000087, 479 0x765, 0x00000018, 480 0x76E, 0x00000004, 481 482 }; 483 484 u32 RTL8723BEMAC_1T_ARRAYLEN = ARRAY_SIZE(RTL8723BEMAC_1T_ARRAY); 485 486 u32 RTL8723BEAGCTAB_1TARRAY[] = { 487 0xC78, 0xFD000001, 488 0xC78, 0xFC010001, 489 0xC78, 0xFB020001, 490 0xC78, 0xFA030001, 491 0xC78, 0xF9040001, 492 0xC78, 0xF8050001, 493 0xC78, 0xF7060001, 494 0xC78, 0xF6070001, 495 0xC78, 0xF5080001, 496 0xC78, 0xF4090001, 497 0xC78, 0xF30A0001, 498 0xC78, 0xF20B0001, 499 0xC78, 0xF10C0001, 500 0xC78, 0xF00D0001, 501 0xC78, 0xEF0E0001, 502 0xC78, 0xEE0F0001, 503 0xC78, 0xED100001, 504 0xC78, 0xEC110001, 505 0xC78, 0xEB120001, 506 0xC78, 0xEA130001, 507 0xC78, 0xE9140001, 508 0xC78, 0xE8150001, 509 0xC78, 0xE7160001, 510 0xC78, 0xE6170001, 511 0xC78, 0xE5180001, 512 0xC78, 0xE4190001, 513 0xC78, 0xE31A0001, 514 0xC78, 0xA51B0001, 515 0xC78, 0xA41C0001, 516 0xC78, 0xA31D0001, 517 0xC78, 0x671E0001, 518 0xC78, 0x661F0001, 519 0xC78, 0x65200001, 520 0xC78, 0x64210001, 521 0xC78, 0x63220001, 522 0xC78, 0x4A230001, 523 0xC78, 0x49240001, 524 0xC78, 0x48250001, 525 0xC78, 0x47260001, 526 0xC78, 0x46270001, 527 0xC78, 0x45280001, 528 0xC78, 0x44290001, 529 0xC78, 0x432A0001, 530 0xC78, 0x422B0001, 531 0xC78, 0x292C0001, 532 0xC78, 0x282D0001, 533 0xC78, 0x272E0001, 534 0xC78, 0x262F0001, 535 0xC78, 0x0A300001, 536 0xC78, 0x09310001, 537 0xC78, 0x08320001, 538 0xC78, 0x07330001, 539 0xC78, 0x06340001, 540 0xC78, 0x05350001, 541 0xC78, 0x04360001, 542 0xC78, 0x03370001, 543 0xC78, 0x02380001, 544 0xC78, 0x01390001, 545 0xC78, 0x013A0001, 546 0xC78, 0x013B0001, 547 0xC78, 0x013C0001, 548 0xC78, 0x013D0001, 549 0xC78, 0x013E0001, 550 0xC78, 0x013F0001, 551 0xC78, 0xFC400001, 552 0xC78, 0xFB410001, 553 0xC78, 0xFA420001, 554 0xC78, 0xF9430001, 555 0xC78, 0xF8440001, 556 0xC78, 0xF7450001, 557 0xC78, 0xF6460001, 558 0xC78, 0xF5470001, 559 0xC78, 0xF4480001, 560 0xC78, 0xF3490001, 561 0xC78, 0xF24A0001, 562 0xC78, 0xF14B0001, 563 0xC78, 0xF04C0001, 564 0xC78, 0xEF4D0001, 565 0xC78, 0xEE4E0001, 566 0xC78, 0xED4F0001, 567 0xC78, 0xEC500001, 568 0xC78, 0xEB510001, 569 0xC78, 0xEA520001, 570 0xC78, 0xE9530001, 571 0xC78, 0xE8540001, 572 0xC78, 0xE7550001, 573 0xC78, 0xE6560001, 574 0xC78, 0xE5570001, 575 0xC78, 0xE4580001, 576 0xC78, 0xE3590001, 577 0xC78, 0xA65A0001, 578 0xC78, 0xA55B0001, 579 0xC78, 0xA45C0001, 580 0xC78, 0xA35D0001, 581 0xC78, 0x675E0001, 582 0xC78, 0x665F0001, 583 0xC78, 0x65600001, 584 0xC78, 0x64610001, 585 0xC78, 0x63620001, 586 0xC78, 0x62630001, 587 0xC78, 0x61640001, 588 0xC78, 0x48650001, 589 0xC78, 0x47660001, 590 0xC78, 0x46670001, 591 0xC78, 0x45680001, 592 0xC78, 0x44690001, 593 0xC78, 0x436A0001, 594 0xC78, 0x426B0001, 595 0xC78, 0x286C0001, 596 0xC78, 0x276D0001, 597 0xC78, 0x266E0001, 598 0xC78, 0x256F0001, 599 0xC78, 0x24700001, 600 0xC78, 0x09710001, 601 0xC78, 0x08720001, 602 0xC78, 0x07730001, 603 0xC78, 0x06740001, 604 0xC78, 0x05750001, 605 0xC78, 0x04760001, 606 0xC78, 0x03770001, 607 0xC78, 0x02780001, 608 0xC78, 0x01790001, 609 0xC78, 0x017A0001, 610 0xC78, 0x017B0001, 611 0xC78, 0x017C0001, 612 0xC78, 0x017D0001, 613 0xC78, 0x017E0001, 614 0xC78, 0x017F0001, 615 0xC50, 0x69553422, 616 0xC50, 0x69553420, 617 0x824, 0x00390204, 618 619 }; 620 621 u32 RTL8723BEAGCTAB_1TARRAYLEN = ARRAY_SIZE(RTL8723BEAGCTAB_1TARRAY); 622