1 /*- 2 * Copyright (c) 2016 Andriy Voskoboinyk <avos@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * $FreeBSD$ 27 */ 28 29 #ifndef R12A_PRIV_H 30 #define R12A_PRIV_H 31 32 /* 33 * MAC initialization values. 34 */ 35 #define RTL8812AU_MAC_PROG_START \ 36 { 0x010, 0x0c }, 37 38 #define RTL8812AU_MAC_PROG_END \ 39 { 0x025, 0x0f }, { 0x072, 0x00 }, { 0x420, 0x80 }, { 0x428, 0x0a }, \ 40 { 0x429, 0x10 }, { 0x430, 0x00 }, { 0x431, 0x00 }, { 0x432, 0x00 }, \ 41 { 0x433, 0x01 }, { 0x434, 0x04 }, { 0x435, 0x05 }, { 0x436, 0x07 }, \ 42 { 0x437, 0x08 }, { 0x43c, 0x04 }, { 0x43d, 0x05 }, { 0x43e, 0x07 }, \ 43 { 0x43f, 0x08 }, { 0x440, 0x5d }, { 0x441, 0x01 }, { 0x442, 0x00 }, \ 44 { 0x444, 0x10 }, { 0x445, 0x00 }, { 0x446, 0x00 }, { 0x447, 0x00 }, \ 45 { 0x448, 0x00 }, { 0x449, 0xf0 }, { 0x44a, 0x0f }, { 0x44b, 0x3e }, \ 46 { 0x44c, 0x10 }, { 0x44d, 0x00 }, { 0x44e, 0x00 }, { 0x44f, 0x00 }, \ 47 { 0x450, 0x00 }, { 0x451, 0xf0 }, { 0x452, 0x0f }, { 0x453, 0x00 }, \ 48 { 0x45b, 0x80 }, { 0x460, 0x66 }, { 0x461, 0x66 }, { 0x4c8, 0xff }, \ 49 { 0x4c9, 0x08 }, { 0x4cc, 0xff }, { 0x4cd, 0xff }, { 0x4ce, 0x01 }, \ 50 { 0x500, 0x26 }, { 0x501, 0xa2 }, { 0x502, 0x2f }, { 0x503, 0x00 }, \ 51 { 0x504, 0x28 }, { 0x505, 0xa3 }, { 0x506, 0x5e }, { 0x507, 0x00 }, \ 52 { 0x508, 0x2b }, { 0x509, 0xa4 }, { 0x50a, 0x5e }, { 0x50b, 0x00 }, \ 53 { 0x50c, 0x4f }, { 0x50d, 0xa4 }, { 0x50e, 0x00 }, { 0x50f, 0x00 }, \ 54 { 0x512, 0x1c }, { 0x514, 0x0a }, { 0x516, 0x0a }, { 0x525, 0x4f }, \ 55 { 0x550, 0x10 }, { 0x551, 0x10 }, { 0x559, 0x02 }, { 0x55c, 0x50 }, \ 56 { 0x55d, 0xff }, { 0x604, 0x09 }, { 0x605, 0x30 }, { 0x607, 0x03 }, \ 57 { 0x608, 0x0e }, { 0x609, 0x2a }, { 0x620, 0xff }, { 0x621, 0xff }, \ 58 { 0x622, 0xff }, { 0x623, 0xff }, { 0x624, 0xff }, { 0x625, 0xff }, \ 59 { 0x626, 0xff }, { 0x627, 0xff }, { 0x638, 0x50 }, { 0x63c, 0x0a }, \ 60 { 0x63d, 0x0a }, { 0x63e, 0x0e }, { 0x63f, 0x0e }, { 0x640, 0x80 }, \ 61 { 0x642, 0x40 }, { 0x643, 0x00 }, { 0x652, 0xc8 }, { 0x66e, 0x05 }, \ 62 { 0x700, 0x21 }, { 0x701, 0x43 }, { 0x702, 0x65 }, { 0x703, 0x87 }, \ 63 { 0x708, 0x21 }, { 0x709, 0x43 }, { 0x70a, 0x65 }, { 0x70b, 0x87 }, \ 64 { 0x718, 0x40 } 65 66 static const struct rtwn_mac_prog rtl8812au_mac_no_ext_pa_lna[] = { 67 RTL8812AU_MAC_PROG_START 68 { 0x11, 0x66 }, 69 RTL8812AU_MAC_PROG_END 70 }, rtl8812au_mac[] = { 71 RTL8812AU_MAC_PROG_START 72 { 0x11, 0x5a }, 73 RTL8812AU_MAC_PROG_END 74 }; 75 76 77 /* 78 * Baseband initialization values. 79 */ 80 #define R12A_COND_GPA 0x01 81 #define R12A_COND_APA 0x02 82 #define R12A_COND_GLNA 0x04 83 #define R12A_COND_ALNA 0x08 84 #define R12A_COND_TYPE(t) ((t) << 4) 85 86 static const uint16_t rtl8812au_bb_regs0[] = { 87 0x800, 0x804, 0x808, 0x80c, 0x810, 0x814, 0x818, 0x820, 0x824, 88 0x828, 0x82c, 0x830, 0x834, 0x838, 0x83c, 0x840, 0x844, 0x848, 89 0x84c, 0x850, 0x854, 0x858, 0x85c, 0x860, 0x864, 0x868, 0x86c, 90 0x870, 0x874, 0x878, 0x87c, 0x8a0, 0x8a4, 0x8a8, 0x8ac, 0x8b0, 91 0x8b4, 0x8b8, 0x8bc, 0x8c0, 0x8c4, 0x8c8, 0x8cc, 0x8d0, 0x8dc, 92 0x8d4, 0x8d8, 0x8f8, 0x8fc, 0x900, 0x90c, 0x910, 0x914, 0x918, 93 0x91c, 0x920, 0x924, 0x928, 0x92c, 0x930, 0x934, 0x960, 0x964, 94 0x968, 0x96c, 0x970, 0x978, 0x97c, 0x980, 0x984, 0x988, 0x990, 95 0x994, 0x998, 0x99c, 0x9a0, 0x9a4, 0x9a8, 0x9ac, 0x9b0, 0x9b4, 96 0x9b8, 0x9bc, 0x9d0, 0x9d4, 0x9d8, 0x9dc, 0x9e4, 0x9e8, 0xa00, 97 0xa04, 0xa08, 0xa0c, 0xa10, 0xa14, 0xa18, 0xa1c, 0xa20, 0xa24, 98 0xa28, 0xa2c, 0xa70, 0xa74, 0xa78, 0xa7c, 0xa80, 0xa84, 0xb00, 99 0xb04, 0xb08, 0xb0c, 0xb10, 0xb14, 0xb18, 0xb1c, 0xb20, 0xb24, 100 0xb28, 0xb2c, 0xb30, 0xb34, 0xb38, 0xb3c, 0xb40, 0xb44, 0xb48, 101 0xb4c, 0xb50, 0xb54, 0xb58, 0xb5c, 0xc00, 0xc04, 0xc08, 0xc0c, 102 0xc10, 0xc14, 0xc1c, 0xc20, 0xc24, 0xc28, 0xc2c, 0xc30, 0xc34, 103 0xc38, 0xc3c, 0xc40, 0xc44, 0xc48, 0xc4c, 0xc50, 0xc54, 0xc58, 104 0xc5c, 0xc60, 0xc64 105 }, rtl8812au_bb_regs1[] = { 106 0xc68 107 }, rtl8812au_bb_regs2[] = { 108 0xc6c, 0xc70, 0xc74, 0xc78, 0xc7c, 0xc80, 0xc84, 0xc94, 0xc98, 109 0xc9c, 0xca0, 0xca4, 0xca8, 0xcb0, 0xcb4, 0xcb8, 0xe00, 0xe04, 110 0xe08, 0xe0c, 0xe10, 0xe14, 0xe1c, 0xe20, 0xe24, 0xe28, 0xe2c, 111 0xe30, 0xe34, 0xe38, 0xe3c, 0xe40, 0xe44, 0xe48, 0xe4c, 0xe50, 112 0xe54, 0xe58, 0xe5c, 0xe60, 0xe64, 0xe68, 0xe6c, 0xe70, 0xe74, 113 0xe78, 0xe7c, 0xe80, 0xe84, 0xe94, 0xe98, 0xe9c, 0xea0, 0xea4, 114 0xea8, 0xeb0, 0xeb4, 0xeb8 115 }; 116 117 static const uint32_t rtl8812au_bb_vals0[] = { 118 0x8020d010, 0x080112e0, 0x0e028233, 0x12131113, 0x20101263, 119 0x020c3d10, 0x03a00385, 0x00000000, 0x00030fe0, 0x00000000, 120 0x002083dd, 0x2eaaeeb8, 0x0037a706, 0x06c89b44, 0x0000095b, 121 0xc0000001, 0x40003cde, 0x6210ff8b, 0x6cfdffb8, 0x28874706, 122 0x0001520c, 0x8060e000, 0x74210168, 0x6929c321, 0x79727432, 123 0x8ca7a314, 0x338c2878, 0x03333333, 0x31602c2e, 0x00003152, 124 0x000fc000, 0x00000013, 0x7f7f7f7f, 0xa202033e, 0x0ff0fa0a, 125 0x00000600, 0x000fc080, 0x6c0057ff, 0x4ca520a3, 0x27f00020, 126 0x00000000, 0x00012d69, 0x08248492, 0x0000b800, 0x00000000, 127 0x940008a0, 0x290b5612, 0x400002c0, 0x00000000, 0x00000701, 128 0x00000000, 0x0000fc00, 0x00000404, 0x1c1028c0, 0x64b11a1c, 129 0xe0767233, 0x055aa500, 0x00000004, 0xfffe0000, 0xfffffffe, 130 0x001fffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 131 0x801fffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 132 0x00000000, 0x27100000, 0xffff0100, 0xffffff5c, 0xffffffff, 133 0x000000ff, 0x00080080, 0x00000000, 0x00000000, 0x81081008, 134 0x00000000, 0x01081008, 0x01081008, 0x00000000, 0x00000000, 135 0x00000000, 0x00000000, 0x00000003, 0x000002d5, 0x00d047c8, 136 0x01ff000c, 0x8c838300, 0x2e7f000f, 0x9500bb78, 0x11144028, 137 0x00881117, 0x89140f00, 0x1a1b0000, 0x090e1217, 0x00000305, 138 0x00900000, 0x101fff00, 0x00000008, 0x00000900, 0x225b0606, 139 0x218075b2, 0x001f8c80, 0x03100000, 0x0000b000, 0xae0201eb, 140 0x01003207, 0x00009807, 0x01000000, 0x00000002, 0x00000002, 141 0x0000001f, 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c, 142 0x13121110, 0x17161514, 0x0000003a, 0x00000000, 0x00000000, 143 0x13000032, 0x48080000, 0x00000000, 0x00000000, 0x00000000, 144 0x00000000, 0x00000007, 0x00042020, 0x80410231, 0x00000000, 145 0x00000100, 0x01000000, 0x40000003, 0x12121212, 0x12121212, 146 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 147 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 148 0x00000020, 0x0008121c, 0x30000c1c, 0x00000058, 0x34344443, 149 0x07003333 150 }, rtl8812au_bb_vals1_ext_pa_lna[] = { 151 0x59791979 152 }, rtl8812au_bb_vals1[] = { 153 0x59799979 154 }, rtl8812au_bb_vals2[] = { 155 0x59795979, 0x19795979, 0x19795979, 0x19791979, 0x19791979, 156 0x19791979, 0x19791979, 0x0100005c, 0x00000000, 0x00000000, 157 0x00000029, 0x08040201, 0x80402010, 0x77547777, 0x00000077, 158 0x00508242, 0x00000007, 0x00042020, 0x80410231, 0x00000000, 159 0x00000100, 0x01000000, 0x40000003, 0x12121212, 0x12121212, 160 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 161 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 162 0x00000020, 0x0008121c, 0x30000c1c, 0x00000058, 0x34344443, 163 0x07003333, 0x59791979, 0x59795979, 0x19795979, 0x19795979, 164 0x19791979, 0x19791979, 0x19791979, 0x19791979, 0x0100005c, 165 0x00000000, 0x00000000, 0x00000029, 0x08040201, 0x80402010, 166 0x77547777, 0x00000077, 0x00508242 167 }; 168 169 static const struct rtwn_bb_prog rtl8812au_bb[] = { 170 { 171 nitems(rtl8812au_bb_regs0), 172 rtl8812au_bb_regs0, 173 rtl8812au_bb_vals0, 174 { 0 }, 175 NULL 176 }, 177 /* 178 * Devices with: 179 * * External 2GHz PA, type 0; 180 * * External 5GHz PA, type 0 or 5; 181 * * External 2GHz LNA, type 0 or 5; 182 * * External 5GHz LNA, type 0; 183 */ 184 { 185 nitems(rtl8812au_bb_regs1), 186 rtl8812au_bb_regs1, 187 rtl8812au_bb_vals1_ext_pa_lna, 188 { 189 R12A_COND_GPA | R12A_COND_GLNA | 190 R12A_COND_APA | R12A_COND_ALNA | 191 R12A_COND_TYPE(0x0), 192 R12A_COND_APA | R12A_COND_GLNA | 193 R12A_COND_TYPE(0x5), 0 194 }, 195 /* 196 * Others. 197 */ 198 &(const struct rtwn_bb_prog){ 199 nitems(rtl8812au_bb_regs1), 200 rtl8812au_bb_regs1, 201 rtl8812au_bb_vals1, 202 { 0 }, 203 NULL 204 } 205 }, 206 { 207 nitems(rtl8812au_bb_regs2), 208 rtl8812au_bb_regs2, 209 rtl8812au_bb_vals2, 210 { 0 }, 211 NULL 212 } 213 }; 214 215 216 static const uint32_t rtl8812au_agc_vals0_lna_g0[] = { 217 0xfc000001, 0xfb020001, 0xfa040001, 0xf9060001, 0xf8080001, 218 0xf70a0001, 0xf60c0001, 0xf50e0001, 0xf4100001, 0xf3120001, 219 0xf2140001, 0xf1160001, 0xf0180001, 0xef1a0001, 0xee1c0001, 220 0xed1e0001, 0xec200001, 0xeb220001, 0xea240001, 0xcd260001, 221 0xcc280001, 0xcb2a0001, 0xca2c0001, 0xc92e0001, 0xc8300001, 222 0xa6320001, 0xa5340001, 0xa4360001, 0xa3380001, 0xa23a0001, 223 0x883c0001, 0x873e0001, 0x86400001, 0x85420001, 0x84440001, 224 0x83460001, 0x82480001, 0x814a0001, 0x484c0001, 0x474e0001, 225 0x46500001, 0x45520001, 0x44540001, 0x43560001, 0x42580001, 226 0x415a0001, 0x255c0001, 0x245e0001, 0x23600001, 0x22620001, 227 0x21640001, 0x21660001, 0x21680001, 0x216a0001, 0x216c0001, 228 0x216e0001, 0x21700001, 0x21720001, 0x21740001, 0x21760001, 229 0x21780001, 0x217a0001, 0x217c0001, 0x217e0001 230 }, rtl8812au_agc_vals0_lna_g5[] = { 231 0xf9000001, 0xf8020001, 0xf7040001, 0xf6060001, 0xf5080001, 232 0xf40a0001, 0xf30c0001, 0xf20e0001, 0xf1100001, 0xf0120001, 233 0xef140001, 0xee160001, 0xed180001, 0xec1a0001, 0xeb1c0001, 234 0xea1e0001, 0xcd200001, 0xcc220001, 0xcb240001, 0xca260001, 235 0xc9280001, 0xc82a0001, 0xc72c0001, 0xc62e0001, 0xa5300001, 236 0xa4320001, 0xa3340001, 0xa2360001, 0x88380001, 0x873a0001, 237 0x863c0001, 0x853e0001, 0x84400001, 0x83420001, 0x82440001, 238 0x81460001, 0x48480001, 0x474a0001, 0x464c0001, 0x454e0001, 239 0x44500001, 0x43520001, 0x42540001, 0x41560001, 0x25580001, 240 0x245a0001, 0x235c0001, 0x225e0001, 0x21600001, 0x21620001, 241 0x21640001, 0x21660001, 0x21680001, 0x216a0001, 0x236c0001, 242 0x226e0001, 0x21700001, 0x21720001, 0x21740001, 0x21760001, 243 0x21780001, 0x217a0001, 0x217c0001, 0x217e0001 244 }, rtl8812au_agc_vals0[] = { 245 0xff000001, 0xff020001, 0xff040001, 0xff060001, 0xff080001, 246 0xfe0a0001, 0xfd0c0001, 0xfc0e0001, 0xfb100001, 0xfa120001, 247 0xf9140001, 0xf8160001, 0xf7180001, 0xf61a0001, 0xf51c0001, 248 0xf41e0001, 0xf3200001, 0xf2220001, 0xf1240001, 0xf0260001, 249 0xef280001, 0xee2a0001, 0xed2c0001, 0xec2e0001, 0xeb300001, 250 0xea320001, 0xe9340001, 0xe8360001, 0xe7380001, 0xe63a0001, 251 0xe53c0001, 0xc73e0001, 0xc6400001, 0xc5420001, 0xc4440001, 252 0xc3460001, 0xc2480001, 0xc14a0001, 0xa74c0001, 0xa64e0001, 253 0xa5500001, 0xa4520001, 0xa3540001, 0xa2560001, 0xa1580001, 254 0x675a0001, 0x665c0001, 0x655e0001, 0x64600001, 0x63620001, 255 0x48640001, 0x47660001, 0x46680001, 0x456a0001, 0x446c0001, 256 0x436e0001, 0x42700001, 0x41720001, 0x41740001, 0x41760001, 257 0x41780001, 0x417a0001, 0x417c0001, 0x417e0001 258 }, rtl8812au_agc_vals1_lna_a0[] = { 259 0xfc800001, 0xfb820001, 0xfa840001, 0xf9860001, 0xf8880001, 260 0xf78a0001, 0xf68c0001, 0xf58e0001, 0xf4900001, 0xf3920001, 261 0xf2940001, 0xf1960001, 0xf0980001, 0xef9a0001, 0xee9c0001, 262 0xed9e0001, 0xeca00001, 0xeba20001, 0xeaa40001, 0xe9a60001, 263 0xe8a80001, 0xe7aa0001, 0xe6ac0001, 0xe5ae0001, 0xe4b00001, 264 0xe3b20001, 0xa8b40001, 0xa7b60001, 0xa6b80001, 0xa5ba0001, 265 0xa4bc0001, 0xa3be0001, 0xa2c00001, 0xa1c20001, 0x68c40001, 266 0x67c60001, 0x66c80001, 0x65ca0001, 0x64cc0001, 0x47ce0001, 267 0x46d00001, 0x45d20001, 0x44d40001, 0x43d60001, 0x42d80001, 268 0x08da0001, 0x07dc0001, 0x06de0001, 0x05e00001, 0x04e20001, 269 0x03e40001, 0x02e60001, 0x01e80001, 0x01ea0001, 0x01ec0001, 270 0x01ee0001, 0x01f00001, 0x01f20001, 0x01f40001, 0x01f60001, 271 0x01f80001, 0x01fa0001, 0x01fc0001, 0x01fe0001 272 }, rtl8812au_agc_vals1[] = { 273 0xff800001, 0xff820001, 0xff840001, 0xfe860001, 0xfd880001, 274 0xfc8a0001, 0xfb8c0001, 0xfa8e0001, 0xf9900001, 0xf8920001, 275 0xf7940001, 0xf6960001, 0xf5980001, 0xf49a0001, 0xf39c0001, 276 0xf29e0001, 0xf1a00001, 0xf0a20001, 0xefa40001, 0xeea60001, 277 0xeda80001, 0xecaa0001, 0xebac0001, 0xeaae0001, 0xe9b00001, 278 0xe8b20001, 0xe7b40001, 0xe6b60001, 0xe5b80001, 0xe4ba0001, 279 0xe3bc0001, 0xa8be0001, 0xa7c00001, 0xa6c20001, 0xa5c40001, 280 0xa4c60001, 0xa3c80001, 0xa2ca0001, 0xa1cc0001, 0x68ce0001, 281 0x67d00001, 0x66d20001, 0x65d40001, 0x64d60001, 0x47d80001, 282 0x46da0001, 0x45dc0001, 0x44de0001, 0x43e00001, 0x42e20001, 283 0x08e40001, 0x07e60001, 0x06e80001, 0x05ea0001, 0x04ec0001, 284 0x03ee0001, 0x02f00001, 0x01f20001, 0x01f40001, 0x01f60001, 285 0x01f80001, 0x01fa0001, 0x01fc0001, 0x01fe0001 286 }; 287 288 static const struct rtwn_agc_prog rtl8812au_agc[] = { 289 /* 290 * External 2GHz LNA (type 0). 291 */ 292 { 293 nitems(rtl8812au_agc_vals0_lna_g0), 294 rtl8812au_agc_vals0_lna_g0, 295 { R12A_COND_GLNA | R12A_COND_TYPE(0x0), 0 }, 296 /* 297 * External 2GHz LNA (type 5). 298 */ 299 &(const struct rtwn_agc_prog){ 300 nitems(rtl8812au_agc_vals0_lna_g5), 301 rtl8812au_agc_vals0_lna_g5, 302 { R12A_COND_GLNA | R12A_COND_TYPE(0x5), 0 }, 303 /* 304 * Others. 305 */ 306 &(const struct rtwn_agc_prog){ 307 nitems(rtl8812au_agc_vals0), 308 rtl8812au_agc_vals0, 309 { 0 }, 310 NULL 311 } 312 } 313 }, 314 /* 315 * External 5GHz LNA (type 0). 316 */ 317 { 318 nitems(rtl8812au_agc_vals1_lna_a0), 319 rtl8812au_agc_vals1_lna_a0, 320 { R12A_COND_ALNA | R12A_COND_TYPE(0x0), 0 }, 321 /* 322 * Others. 323 */ 324 &(const struct rtwn_agc_prog){ 325 nitems(rtl8812au_agc_vals1), 326 rtl8812au_agc_vals1, 327 { 0 }, 328 NULL 329 } 330 } 331 }; 332 333 /* 334 * RF initialization values. 335 */ 336 static const uint8_t rtl8812au_rf0_regs0[] = { 337 0x00, 0x18, 0x56, 0x66, 0x1e, 0x89 338 }, rtl8812au_rf0_regs1[] = { 339 0x86 340 }, rtl8812au_rf0_regs2[] = { 341 0x8b 342 }, rtl8812au_rf0_regs3[] = { 343 0xb1, 0xb3, 0xb4, 0xba, 0x18, 0xef 344 }, rtl8812au_rf0_regs4[] = { 345 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b 346 }, rtl8812au_rf0_regs5[] = { 347 0xef, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 348 0x34 349 }, rtl8812au_rf0_regs6[] = { 350 0xef, 0xef, 0xdf, 0x35, 0x35, 0x35, 0x36, 0x36, 0x36, 0x36, 0xef, 351 0x51, 0x52, 0x53, 0x54, 0xef, 0x08, 0x18, 0xef, 0x3a, 0x3b, 0x3c, 352 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 353 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 354 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 355 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 356 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 357 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 0x3a, 0x3b, 0x3c, 358 0x3a, 0x3b, 0x3c, 0xef 359 }, rtl8812au_rf0_regs7[] = { 360 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 361 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 362 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 363 }, rtl8812au_rf0_regs8[] = { 364 0xef, 0x18, 0xef, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 365 0x35, 0xef, 0x18, 0xef, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 366 0x36, 0x36, 0x36, 0x36, 0x36, 0xef, 0xef, 0x3c, 0x3c, 0x3c, 367 }, rtl8812au_rf0_regs9[] = { 368 0xef, 0x18, 0xef, 0xdf, 0x1f 369 }, rtl8812au_rf0_regs10[] = { 370 0x61, 0x62, 0x63, 0x64, 0x65 371 }, rtl8812au_rf0_regs11[] = { 372 0x08, 0x1c, 0xb4, 0x18, 0xfe, 0xfe, 0xfe, 0xfe, 0xb4, 0x18 373 }, rtl8812au_rf1_regs0[] = { 374 0x56, 0x66, 0x89 375 }, rtl8812au_rf1_regs3[] = { 376 0xb1, 0xb3, 0xb4, 0xba, 0x18, 0xef 377 }; 378 379 static const uint32_t rtl8812au_rf0_vals0[] = { 380 0x10000, 0x1712a, 0x51cf2, 0x40000, 0x80000, 0x00080 381 }, rtl8812au_rf0_vals1_lna_g0_g5[] = { 382 0x14b3a 383 }, rtl8812au_rf0_vals1[] = { 384 0x14b38 385 }, rtl8812au_rf0_vals2_lna_a0[] = { 386 0x80180 387 }, rtl8812au_rf0_vals2[] = { 388 0x87180 389 }, rtl8812au_rf0_vals3[] = { 390 0x1fc1a, 0xf0810, 0x1a78d, 0x86180, 0x00006, 0x02000 391 }, rtl8812au_rf0_vals4_lna_g0_g5[] = { 392 0x3f218, 0x30a58, 0x2fa58, 0x22590, 0x1fa50, 0x10248, 0x08240 393 }, rtl8812au_rf0_vals4[] = { 394 0x38a58, 0x37a58, 0x2a590, 0x27a50, 0x18248, 0x10240, 0x08240 395 }, rtl8812au_rf0_vals5_pa_g0[] = { 396 0x00100, 0x0a4ee, 0x09076, 0x08073, 0x07070, 0x0606d, 0x0506a, 397 0x04049, 0x03046, 0x02028, 0x01025, 0x00022 398 }, rtl8812au_rf0_vals5[] = { 399 0x00100, 0x0adf4, 0x09df1, 0x08dee, 0x07deb, 0x06de8, 0x05de5, 400 0x04de2, 0x03ce6, 0x024e7, 0x014e4, 0x004e1 401 }, rtl8812au_rf0_vals6[] = { 402 0x00000, 0x020a2, 0x00080, 0x00192, 0x08192, 0x10192, 0x00024, 403 0x08024, 0x10024, 0x18024, 0x00000, 0x00c21, 0x006d9, 0xfc649, 404 0x0017e, 0x00002, 0x08400, 0x1712a, 0x01000, 0x00080, 0x3a02c, 405 0x04000, 0x00400, 0x3202c, 0x10000, 0x000a0, 0x2b064, 0x04000, 406 0x000d8, 0x23070, 0x04000, 0x00468, 0x1b870, 0x10000, 0x00098, 407 0x12085, 0xe4000, 0x00418, 0x0a080, 0xf0000, 0x00418, 0x02080, 408 0x10000, 0x00080, 0x7a02c, 0x04000, 0x00400, 0x7202c, 0x10000, 409 0x000a0, 0x6b064, 0x04000, 0x000d8, 0x63070, 0x04000, 0x00468, 410 0x5b870, 0x10000, 0x00098, 0x52085, 0xe4000, 0x00418, 0x4a080, 411 0xf0000, 0x00418, 0x42080, 0x10000, 0x00080, 0xba02c, 0x04000, 412 0x00400, 0xb202c, 0x10000, 0x000a0, 0xab064, 0x04000, 0x000d8, 413 0xa3070, 0x04000, 0x00468, 0x9b870, 0x10000, 0x00098, 0x92085, 414 0xe4000, 0x00418, 0x8a080, 0xf0000, 0x00418, 0x82080, 0x10000, 415 0x01100 416 }, rtl8812au_rf0_vals7_pa_a0[] = { 417 0x4a0b2, 0x490af, 0x48070, 0x4706d, 0x46050, 0x4504d, 0x4404a, 418 0x43047, 0x4200a, 0x41007, 0x40004, 0x2a0b2, 0x290af, 0x28070, 419 0x2706d, 0x26050, 0x2504d, 0x2404a, 0x23047, 0x2200a, 0x21007, 420 0x20004, 0x0a0b2, 0x090af, 0x08070, 0x0706d, 0x06050, 0x0504d, 421 0x0404a, 0x03047, 0x0200a, 0x01007, 0x00004 422 }, rtl8812au_rf0_vals7_pa_a5[] = { 423 0x4a0b2, 0x490af, 0x48070, 0x4706d, 0x4604d, 0x4504a, 0x44047, 424 0x43044, 0x42007, 0x41004, 0x40001, 0x2a0b4, 0x290b1, 0x28072, 425 0x2706f, 0x2604f, 0x2504c, 0x24049, 0x23046, 0x22009, 0x21006, 426 0x20003, 0x0a0b2, 0x090af, 0x08070, 0x0706d, 0x0604d, 0x0504a, 427 0x04047, 0x03044, 0x02007, 0x01004, 0x00001 428 }, rtl8812au_rf0_vals7[] = { 429 0x4adf5, 0x49df2, 0x48def, 0x47dec, 0x46de9, 0x45de6, 0x44de3, 430 0x438c8, 0x428c5, 0x418c2, 0x408c0, 0x2adf5, 0x29df2, 0x28def, 431 0x27dec, 0x26de9, 0x25de6, 0x24de3, 0x238c8, 0x228c5, 0x218c2, 432 0x208c0, 0x0aff7, 0x09df7, 0x08df4, 0x07df1, 0x06dee, 0x05deb, 433 0x04de8, 0x038cc, 0x028c9, 0x018c6, 0x008c3 434 }, rtl8812au_rf0_vals8_pa_a0_a5[] = { 435 0x00000, 0x1712a, 0x00040, 0x001d4, 0x081d4, 0x101d4, 0x201b4, 436 0x281b4, 0x301b4, 0x401b4, 0x481b4, 0x501b4, 0x00000, 0x1712a, 437 0x00010, 0x04bfb, 0x0cbfb, 0x14bfb, 0x1cbfb, 0x24f4b, 0x2cf4b, 438 0x34f4b, 0x3cf4b, 0x44f4b, 0x4cf4b, 0x54f4b, 0x5cf4b, 0x00000, 439 0x00008, 0x002cc, 0x00522, 0x00902 440 }, rtl8812au_rf0_vals8[] = { 441 0x00000, 0x1712a, 0x00040, 0x00188, 0x08147, 0x10147, 0x201d7, 442 0x281d7, 0x301d7, 0x401d8, 0x481d8, 0x501d8, 0x00000, 0x1712a, 443 0x00010, 0x84eb4, 0x8cc35, 0x94c35, 0x9cc35, 0xa4c35, 0xacc35, 444 0xb4c35, 0xbcc35, 0xc4c34, 0xccc35, 0xd4c35, 0xdcc35, 0x00000, 445 0x00008, 0x002a8, 0x005a2, 0x00880 446 }, rtl8812au_rf0_vals9[] = { 447 0x00000, 0x1712a, 0x00002, 0x00080, 0x00064 448 }, rtl8812au_rf0_vals10_pa_a0[] = { 449 0xfdd43, 0x38f4b, 0x32117, 0x194ac, 0x931d1 450 }, rtl8812au_rf0_vals10_pa_a5[] = { 451 0xfdd43, 0x38f4b, 0x32117, 0x194ac, 0x931d2 452 }, rtl8812au_rf0_vals10[] = { 453 0xe5d53, 0x38fcd, 0x114eb, 0x196ac, 0x911d7 454 }, rtl8812au_rf0_vals11[] = { 455 0x08400, 0x739d2, 0x1e78d, 0x1f12a, 0x0c350, 0x0c350, 0x0c350, 456 0x0c350, 0x1a78d, 0x1712a 457 }, rtl8812au_rf1_vals0[] = { 458 0x51cf2, 0x40000, 0x00080 459 }, rtl8812au_rf1_vals3[] = { 460 0x1fc1a, 0xf0810, 0x1a78d, 0x86180, 0x00006, 0x02000 461 }, rtl8812au_rf1_vals6[] = { 462 0x00000, 0x020a2, 0x00080, 0x00192, 0x08192, 0x10192, 0x00024, 463 0x08024, 0x10024, 0x18024, 0x00000, 0x00c21, 0x006d9, 0xfc649, 464 0x0017e, 0x00002, 0x08400, 0x1712a, 0x01000, 0x00080, 0x3a02c, 465 0x04000, 0x00400, 0x3202c, 0x10000, 0x000a0, 0x2b064, 0x04000, 466 0x000d8, 0x23070, 0x04000, 0x00468, 0x1b870, 0x10000, 0x00098, 467 0x12085, 0xe4000, 0x00418, 0x0a080, 0xf0000, 0x00418, 0x02080, 468 0x10000, 0x00080, 0x7a02c, 0x04000, 0x00400, 0x7202c, 0x10000, 469 0x000a0, 0x6b064, 0x04000, 0x000d8, 0x63070, 0x04000, 0x00468, 470 0x5b870, 0x10000, 0x00098, 0x52085, 0xe4000, 0x00418, 0x4a080, 471 0xf0000, 0x00418, 0x42080, 0x10000, 0x00080, 0xba02c, 0x04000, 472 0x00400, 0xb202c, 0x10000, 0x000a0, 0xab064, 0x04000, 0x000d8, 473 0xa3070, 0x04000, 0x00468, 0x9b870, 0x10000, 0x00098, 0x92085, 474 0xe4000, 0x00418, 0x8a080, 0xf0000, 0x00418, 0x82080, 0x10000, 475 0x01100 476 }, rtl8812au_rf1_vals7_pa_a5[] = { 477 0x4a0b1, 0x490ae, 0x4806f, 0x4706c, 0x4604c, 0x45049, 0x44046, 478 0x43043, 0x42006, 0x41003, 0x40000, 0x2a0b3, 0x290b0, 0x28071, 479 0x2706e, 0x2604e, 0x2504b, 0x24048, 0x23045, 0x22008, 0x21005, 480 0x20002, 0x0a0b3, 0x090b0, 0x08070, 0x0706d, 0x0604d, 0x0504a, 481 0x04047, 0x03044, 0x02007, 0x01004, 0x00001 482 }, rtl8812au_rf1_vals8_pa_a0_a5[] = { 483 0x00000, 0x1712a, 0x00040, 0x001c5, 0x081c5, 0x101c5, 0x20174, 484 0x28174, 0x30174, 0x40185, 0x48185, 0x50185, 0x00000, 0x1712a, 485 0x00010, 0x05b8b, 0x0db8b, 0x15b8b, 0x1db8b, 0x262db, 0x2e2db, 486 0x362db, 0x3e2db, 0x4553b, 0x4d53b, 0x5553b, 0x5d53b, 0x00000, 487 0x00008, 0x002dc, 0x00524, 0x00902 488 }, rtl8812au_rf1_vals10_pa_g0_a0[] = { 489 0xeac43, 0x38f47, 0x31157, 0x1c4ac, 0x931d1 490 }, rtl8812au_rf1_vals10_pa_a5[] = { 491 0xeac43, 0x38f47, 0x31157, 0x1c4ac, 0x931d2 492 }; 493 494 static const struct rtwn_rf_prog rtl8812au_rf[] = { 495 /* RF chain 0. */ 496 { 497 nitems(rtl8812au_rf0_regs0), 498 rtl8812au_rf0_regs0, 499 rtl8812au_rf0_vals0, 500 { 0 }, 501 NULL 502 }, 503 /* External 2GHz LNA, type 0 or 5. */ 504 { 505 nitems(rtl8812au_rf0_regs1), 506 rtl8812au_rf0_regs1, 507 rtl8812au_rf0_vals1_lna_g0_g5, 508 { 509 R12A_COND_GLNA | R12A_COND_TYPE(0x0), 510 R12A_COND_GLNA | R12A_COND_TYPE(0x5), 0 511 }, 512 /* Others. */ 513 &(const struct rtwn_rf_prog){ 514 nitems(rtl8812au_rf0_regs1), 515 rtl8812au_rf0_regs1, 516 rtl8812au_rf0_vals1, 517 { 0 }, 518 NULL 519 } 520 }, 521 /* External 5GHz LNA, type 0. */ 522 { 523 nitems(rtl8812au_rf0_regs2), 524 rtl8812au_rf0_regs2, 525 rtl8812au_rf0_vals2_lna_a0, 526 { R12A_COND_ALNA | R12A_COND_TYPE(0x0), 0 }, 527 /* Others. */ 528 &(const struct rtwn_rf_prog){ 529 nitems(rtl8812au_rf0_regs2), 530 rtl8812au_rf0_regs2, 531 rtl8812au_rf0_vals2, 532 { 0 }, 533 NULL 534 } 535 }, 536 { 537 nitems(rtl8812au_rf0_regs3), 538 rtl8812au_rf0_regs3, 539 rtl8812au_rf0_vals3, 540 { 0 }, 541 NULL 542 }, 543 /* External 2GHz LNA, type 0 or 5. */ 544 { 545 nitems(rtl8812au_rf0_regs4), 546 rtl8812au_rf0_regs4, 547 rtl8812au_rf0_vals4_lna_g0_g5, 548 { 549 R12A_COND_GLNA | R12A_COND_TYPE(0x0), 550 R12A_COND_GLNA | R12A_COND_TYPE(0x5), 0 551 }, 552 /* Others */ 553 &(const struct rtwn_rf_prog){ 554 nitems(rtl8812au_rf0_regs4), 555 rtl8812au_rf0_regs4, 556 rtl8812au_rf0_vals4, 557 { 0 }, 558 NULL 559 } 560 }, 561 /* External 2GHz PA, type 0. */ 562 { 563 nitems(rtl8812au_rf0_regs5), 564 rtl8812au_rf0_regs5, 565 rtl8812au_rf0_vals5_pa_g0, 566 { R12A_COND_GPA | R12A_COND_TYPE(0x0), 0 }, 567 /* Others. */ 568 &(const struct rtwn_rf_prog){ 569 nitems(rtl8812au_rf0_regs5), 570 rtl8812au_rf0_regs5, 571 rtl8812au_rf0_vals5, 572 { 0 }, 573 NULL 574 } 575 }, 576 { 577 nitems(rtl8812au_rf0_regs6), 578 rtl8812au_rf0_regs6, 579 rtl8812au_rf0_vals6, 580 { 0 }, 581 NULL 582 }, 583 /* External 5GHz PA, type 0. */ 584 { 585 nitems(rtl8812au_rf0_regs7), 586 rtl8812au_rf0_regs7, 587 rtl8812au_rf0_vals7_pa_a0, 588 { R12A_COND_APA | R12A_COND_TYPE(0x0), 0 }, 589 /* External 5GHz PA, type 5. */ 590 &(const struct rtwn_rf_prog){ 591 nitems(rtl8812au_rf0_regs7), 592 rtl8812au_rf0_regs7, 593 rtl8812au_rf0_vals7_pa_a5, 594 { R12A_COND_APA | R12A_COND_TYPE(0x5), 0 }, 595 /* Others. */ 596 &(const struct rtwn_rf_prog){ 597 nitems(rtl8812au_rf0_regs7), 598 rtl8812au_rf0_regs7, 599 rtl8812au_rf0_vals7, 600 { 0 }, 601 NULL 602 } 603 } 604 }, 605 /* External 5GHz PA, type 0 or 5. */ 606 { 607 nitems(rtl8812au_rf0_regs8), 608 rtl8812au_rf0_regs8, 609 rtl8812au_rf0_vals8_pa_a0_a5, 610 { 611 R12A_COND_APA | R12A_COND_TYPE(0x0), 612 R12A_COND_APA | R12A_COND_TYPE(0x5), 0 613 }, 614 /* Others. */ 615 &(const struct rtwn_rf_prog){ 616 nitems(rtl8812au_rf0_regs8), 617 rtl8812au_rf0_regs8, 618 rtl8812au_rf0_vals8, 619 { 0 }, 620 NULL 621 } 622 }, 623 { 624 nitems(rtl8812au_rf0_regs9), 625 rtl8812au_rf0_regs9, 626 rtl8812au_rf0_vals9, 627 { 0 }, 628 NULL 629 }, 630 /* External 5GHz PA, type 0. */ 631 { 632 nitems(rtl8812au_rf0_regs10), 633 rtl8812au_rf0_regs10, 634 rtl8812au_rf0_vals10_pa_a0, 635 { R12A_COND_APA | R12A_COND_TYPE(0x0), 0 }, 636 /* External 5GHz PA, type 5. */ 637 &(const struct rtwn_rf_prog){ 638 nitems(rtl8812au_rf0_regs10), 639 rtl8812au_rf0_regs10, 640 rtl8812au_rf0_vals10_pa_a5, 641 { R12A_COND_APA | R12A_COND_TYPE(0x5), 0 }, 642 /* Others. */ 643 &(const struct rtwn_rf_prog){ 644 nitems(rtl8812au_rf0_regs10), 645 rtl8812au_rf0_regs10, 646 rtl8812au_rf0_vals10, 647 { 0 }, 648 NULL 649 } 650 } 651 }, 652 { 653 nitems(rtl8812au_rf0_regs11), 654 rtl8812au_rf0_regs11, 655 rtl8812au_rf0_vals11, 656 { 0 }, 657 NULL 658 }, 659 { 0, NULL, NULL, { 0 }, NULL }, 660 /* RF chain 1. */ 661 { 662 nitems(rtl8812au_rf1_regs0), 663 rtl8812au_rf1_regs0, 664 rtl8812au_rf1_vals0, 665 { 0 }, 666 NULL 667 }, 668 /* rtl8812au_rf[1] */ 669 /* External 2GHz LNA, type 0 or 5. */ 670 { 671 nitems(rtl8812au_rf0_regs1), 672 rtl8812au_rf0_regs1, 673 rtl8812au_rf0_vals1_lna_g0_g5, 674 { 675 R12A_COND_GLNA | R12A_COND_TYPE(0x0), 676 R12A_COND_GLNA | R12A_COND_TYPE(0x5), 0 677 }, 678 /* Others. */ 679 &(const struct rtwn_rf_prog){ 680 nitems(rtl8812au_rf0_regs1), 681 rtl8812au_rf0_regs1, 682 rtl8812au_rf0_vals1, 683 { 0 }, 684 NULL 685 } 686 }, 687 /* rtl8812au_rf[2] */ 688 /* External 5GHz LNA, type 0. */ 689 { 690 nitems(rtl8812au_rf0_regs2), 691 rtl8812au_rf0_regs2, 692 rtl8812au_rf0_vals2_lna_a0, 693 { R12A_COND_ALNA | R12A_COND_TYPE(0x0), 0 }, 694 /* Others. */ 695 &(const struct rtwn_rf_prog){ 696 nitems(rtl8812au_rf0_regs2), 697 rtl8812au_rf0_regs2, 698 rtl8812au_rf0_vals2, 699 { 0 }, 700 NULL 701 } 702 }, 703 { 704 nitems(rtl8812au_rf1_regs3), 705 rtl8812au_rf1_regs3, 706 rtl8812au_rf1_vals3, 707 { 0 }, 708 NULL 709 }, 710 /* rtl8812au_rf[4] */ 711 /* External 2GHz LNA, type 0 or 5. */ 712 { 713 nitems(rtl8812au_rf0_regs4), 714 rtl8812au_rf0_regs4, 715 rtl8812au_rf0_vals4_lna_g0_g5, 716 { 717 R12A_COND_GLNA | R12A_COND_TYPE(0x0), 718 R12A_COND_GLNA | R12A_COND_TYPE(0x5), 0 719 }, 720 /* Others */ 721 &(const struct rtwn_rf_prog){ 722 nitems(rtl8812au_rf0_regs4), 723 rtl8812au_rf0_regs4, 724 rtl8812au_rf0_vals4, 725 { 0 }, 726 NULL 727 } 728 }, 729 /* rtl8812au_rf[5] */ 730 /* External 2GHz PA, type 0. */ 731 { 732 nitems(rtl8812au_rf0_regs5), 733 rtl8812au_rf0_regs5, 734 rtl8812au_rf0_vals5_pa_g0, 735 { R12A_COND_GPA | R12A_COND_TYPE(0x0), 0 }, 736 /* Others. */ 737 &(const struct rtwn_rf_prog){ 738 nitems(rtl8812au_rf0_regs5), 739 rtl8812au_rf0_regs5, 740 rtl8812au_rf0_vals5, 741 { 0 }, 742 NULL 743 } 744 }, 745 { 746 nitems(rtl8812au_rf0_regs6), 747 rtl8812au_rf0_regs6, 748 rtl8812au_rf1_vals6, 749 { 0 }, 750 NULL 751 }, 752 /* External 5GHz PA, type 0. */ 753 { 754 nitems(rtl8812au_rf0_regs7), 755 rtl8812au_rf0_regs7, 756 rtl8812au_rf0_vals7_pa_a0, 757 { R12A_COND_APA | R12A_COND_TYPE(0x0), 0 }, 758 /* External 5GHz PA, type 5. */ 759 &(const struct rtwn_rf_prog){ 760 nitems(rtl8812au_rf0_regs7), 761 rtl8812au_rf0_regs7, 762 rtl8812au_rf1_vals7_pa_a5, 763 { R12A_COND_APA | R12A_COND_TYPE(0x5), 0 }, 764 /* Others. */ 765 &(const struct rtwn_rf_prog){ 766 nitems(rtl8812au_rf0_regs7), 767 rtl8812au_rf0_regs7, 768 rtl8812au_rf0_vals7, 769 { 0 }, 770 NULL 771 } 772 } 773 }, 774 /* External 5GHz PA, type 0 or 5. */ 775 { 776 nitems(rtl8812au_rf0_regs8), 777 rtl8812au_rf0_regs8, 778 rtl8812au_rf1_vals8_pa_a0_a5, 779 { 780 R12A_COND_APA | R12A_COND_TYPE(0x0), 781 R12A_COND_APA | R12A_COND_TYPE(0x5), 0 782 }, 783 /* Others. */ 784 &(const struct rtwn_rf_prog){ 785 nitems(rtl8812au_rf0_regs8), 786 rtl8812au_rf0_regs8, 787 rtl8812au_rf0_vals8, 788 { 0 }, 789 NULL 790 } 791 }, 792 { 793 nitems(rtl8812au_rf0_regs9) - 1, 794 rtl8812au_rf0_regs9, 795 rtl8812au_rf0_vals9, 796 { 0 }, 797 NULL 798 }, 799 800 /* External 2GHz or 5GHz PA, type 0. */ 801 { 802 nitems(rtl8812au_rf0_regs10), 803 rtl8812au_rf0_regs10, 804 rtl8812au_rf1_vals10_pa_g0_a0, 805 { 806 R12A_COND_GPA | R12A_COND_TYPE(0x0), 807 R12A_COND_APA | R12A_COND_TYPE(0x0), 0 808 }, 809 /* External 5GHz PA, type 5. */ 810 &(const struct rtwn_rf_prog){ 811 nitems(rtl8812au_rf0_regs10), 812 rtl8812au_rf0_regs10, 813 rtl8812au_rf1_vals10_pa_a5, 814 { R12A_COND_APA | R12A_COND_TYPE(0x5), 0 }, 815 /* Others. */ 816 &(const struct rtwn_rf_prog){ 817 nitems(rtl8812au_rf0_regs10), 818 rtl8812au_rf0_regs10, 819 rtl8812au_rf0_vals10, 820 { 0 }, 821 NULL 822 } 823 } 824 }, 825 { 826 1, 827 rtl8812au_rf0_regs11, 828 rtl8812au_rf0_vals11, 829 { 0 }, 830 NULL 831 }, 832 { 0, NULL, NULL, { 0 }, NULL } 833 }; 834 835 836 /* 837 * Registers to save before IQ calibration. 838 */ 839 static const uint16_t r12a_iq_bb_regs[] = { 840 0x520, 0x550, 0x808, 0xa04, 0x90c, 0xc00, 0xe00, 0x838, 0x82c 841 }; 842 843 static const uint16_t r12a_iq_afe_regs[] = { 844 0xc5c, 0xc60, 0xc64, 0xc68, 0xcb0, 0xcb4, 0xe5c, 0xe60, 0xe64, 845 0xe68, 0xeb0, 0xeb4 846 }; 847 848 static const uint8_t r12a_iq_rf_regs[] = { 849 0x65, 0x8f, 0x0 850 }; 851 852 #endif /* R12A_PRIV_H */ 853