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