1/* 2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 3 * Copyright (c) 2002-2006 Atheros Communications, Inc. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * 17 * $FreeBSD$ 18 */ 19/* Auto Generated PCI Register Writes. Created: 09/12/02 */ 20 21static const uint32_t ar5211Modes[][5] = { 22 { 0x00000030, 0x00000015, 0x00000015, 0x0000001d, 0x00000015 }, 23 { 0x00001040, 0x002ffc0f, 0x002ffc0f, 0x002ffc1f, 0x002ffc0f }, 24 { 0x00001044, 0x002ffc0f, 0x002ffc0f, 0x002ffc1f, 0x002ffc0f }, 25 { 0x00001048, 0x002ffc0f, 0x002ffc0f, 0x002ffc1f, 0x002ffc0f }, 26 { 0x0000104c, 0x002ffc0f, 0x002ffc0f, 0x002ffc1f, 0x002ffc0f }, 27 { 0x00001050, 0x002ffc0f, 0x002ffc0f, 0x002ffc1f, 0x002ffc0f }, 28 { 0x00001054, 0x002ffc0f, 0x002ffc0f, 0x002ffc1f, 0x002ffc0f }, 29 { 0x00001058, 0x002ffc0f, 0x002ffc0f, 0x002ffc1f, 0x002ffc0f }, 30 { 0x0000105c, 0x002ffc0f, 0x002ffc0f, 0x002ffc1f, 0x002ffc0f }, 31 { 0x00001060, 0x002ffc0f, 0x002ffc0f, 0x002ffc1f, 0x002ffc0f }, 32 { 0x00001064, 0x002ffc0f, 0x002ffc0f, 0x002ffc1f, 0x002ffc0f }, 33 { 0x00001070, 0x00000168, 0x000001e0, 0x000001b8, 0x00000168 }, 34 { 0x00001030, 0x00000230, 0x000001e0, 0x000000b0, 0x00000230 }, 35 { 0x000010b0, 0x00000d98, 0x00001180, 0x00001f48, 0x00000d98 }, 36 { 0x000010f0, 0x0000a0e0, 0x00014068, 0x00005880, 0x0000a0e0 }, 37 { 0x00008014, 0x04000400, 0x08000800, 0x20003000, 0x04000400 }, 38 { 0x0000801c, 0x0e8d8fa7, 0x0e8d8fcf, 0x01608f95, 0x0e8d8fa7 }, 39 { 0x00009804, 0x00000000, 0x00000003, 0x00000000, 0x00000000 }, 40 { 0x00009820, 0x02020200, 0x02020200, 0x02010200, 0x02020200 }, 41 { 0x00009824, 0x00000e0e, 0x00000e0e, 0x00000707, 0x00000e0e }, 42 { 0x00009828, 0x0a020001, 0x0a020001, 0x05010000, 0x0a020001 }, 43 { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e }, 44 { 0x00009838, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b }, 45 { 0x00009844, 0x1372169c, 0x137216a5, 0x137216a8, 0x1372169c }, 46 { 0x00009848, 0x0018ba67, 0x0018ba67, 0x0018ba69, 0x0018ba69 }, 47 { 0x00009850, 0x0c28b4e0, 0x0c28b4e0, 0x0c28b4e0, 0x0c28b4e0 }, 48 { 0x00009858, 0x7e800d2e, 0x7e800d2e, 0x7ec00d2e, 0x7e800d2e }, 49 { 0x0000985c, 0x31375d5e, 0x31375d5e, 0x313a5d5e, 0x31375d5e }, 50 { 0x00009860, 0x0000bd10, 0x0000bd10, 0x0000bd38, 0x0000bd10 }, 51 { 0x00009864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 }, 52 { 0x00009914, 0x00002710, 0x00002710, 0x0000157c, 0x00002710 }, 53 { 0x00009918, 0x00000190, 0x00000190, 0x00000084, 0x00000190 }, 54 { 0x00009944, 0x6fe01020, 0x6fe01020, 0x6fe00920, 0x6fe01020 }, 55 { 0x0000a180, 0x05ff14ff, 0x05ff14ff, 0x05ff14ff, 0x05ff19ff }, 56 { 0x000098d4, 0x00000010, 0x00000014, 0x00000010, 0x00000010 }, 57}; 58 59static const uint32_t ar5211Common[][2] = { 60 { 0x0000000c, 0x00000000 }, 61 { 0x00000028, 0x84849c9c }, 62 { 0x0000002c, 0x7c7c7c7c }, 63 { 0x00000034, 0x00000005 }, 64 { 0x00000040, 0x00000000 }, 65 { 0x00000044, 0x00000008 }, 66 { 0x00000048, 0x00000008 }, 67 { 0x0000004c, 0x00000010 }, 68 { 0x00000050, 0x00000000 }, 69 { 0x00000054, 0x0000001f }, 70 { 0x00000800, 0x00000000 }, 71 { 0x00000804, 0x00000000 }, 72 { 0x00000808, 0x00000000 }, 73 { 0x0000080c, 0x00000000 }, 74 { 0x00000810, 0x00000000 }, 75 { 0x00000814, 0x00000000 }, 76 { 0x00000818, 0x00000000 }, 77 { 0x0000081c, 0x00000000 }, 78 { 0x00000820, 0x00000000 }, 79 { 0x00000824, 0x00000000 }, 80 { 0x00001230, 0x00000000 }, 81 { 0x00008004, 0x00000000 }, 82 { 0x00008008, 0x00000000 }, 83 { 0x0000800c, 0x00000000 }, 84 { 0x00008018, 0x00000000 }, 85 { 0x00008024, 0x00000000 }, 86 { 0x00008028, 0x00000030 }, 87 { 0x0000802c, 0x0007ffff }, 88 { 0x00008030, 0x01ffffff }, 89 { 0x00008034, 0x00000031 }, 90 { 0x00008038, 0x00000000 }, 91 { 0x0000803c, 0x00000000 }, 92 { 0x00008040, 0x00000000 }, 93 { 0x00008044, 0x00000002 }, 94 { 0x00008048, 0x00000000 }, 95 { 0x00008054, 0x00000000 }, 96 { 0x00008058, 0x00000000 }, 97 { 0x00009808, 0x00000000 }, 98 { 0x0000980c, 0x2d849093 }, 99 { 0x00009810, 0x7d32e000 }, 100 { 0x00009814, 0x00000f6b }, 101 { 0x0000981c, 0x00000000 }, 102 { 0x0000982c, 0x00026ffe }, 103 { 0x00009830, 0x00000000 }, 104 { 0x0000983c, 0x00020100 }, 105 { 0x00009840, 0x206a017a }, 106 { 0x0000984c, 0x1284613c }, 107 { 0x00009854, 0x00000859 }, 108 { 0x00009868, 0x409a4190 }, 109 { 0x0000986c, 0x050cb081 }, 110 { 0x00009870, 0x0000000f }, 111 { 0x00009874, 0x00000080 }, 112 { 0x00009878, 0x0000000c }, 113 { 0x00009900, 0x00000000 }, 114 { 0x00009904, 0x00000000 }, 115 { 0x00009908, 0x00000000 }, 116 { 0x0000990c, 0x00800000 }, 117 { 0x00009910, 0x00000001 }, 118 { 0x0000991c, 0x0000092a }, 119 { 0x00009920, 0x00000000 }, 120 { 0x00009924, 0x00058a05 }, 121 { 0x00009928, 0x00000001 }, 122 { 0x0000992c, 0x00000000 }, 123 { 0x00009930, 0x00000000 }, 124 { 0x00009934, 0x00000000 }, 125 { 0x00009938, 0x00000000 }, 126 { 0x0000993c, 0x0000003f }, 127 { 0x00009940, 0x00000004 }, 128 { 0x00009948, 0x00000000 }, 129 { 0x0000994c, 0x00000000 }, 130 { 0x00009950, 0x00000000 }, 131 { 0x00009954, 0x5d50f14c }, 132 { 0x00009958, 0x00000018 }, 133 { 0x0000995c, 0x004b6a8e }, 134 { 0x0000a184, 0x06ff05ff }, 135 { 0x0000a188, 0x07ff07ff }, 136 { 0x0000a18c, 0x08ff08ff }, 137 { 0x0000a190, 0x09ff09ff }, 138 { 0x0000a194, 0x0aff0aff }, 139 { 0x0000a198, 0x0bff0bff }, 140 { 0x0000a19c, 0x0cff0cff }, 141 { 0x0000a1a0, 0x0dff0dff }, 142 { 0x0000a1a4, 0x0fff0eff }, 143 { 0x0000a1a8, 0x12ff12ff }, 144 { 0x0000a1ac, 0x14ff13ff }, 145 { 0x0000a1b0, 0x16ff15ff }, 146 { 0x0000a1b4, 0x19ff17ff }, 147 { 0x0000a1b8, 0x1bff1aff }, 148 { 0x0000a1bc, 0x1eff1dff }, 149 { 0x0000a1c0, 0x23ff20ff }, 150 { 0x0000a1c4, 0x27ff25ff }, 151 { 0x0000a1c8, 0x2cff29ff }, 152 { 0x0000a1cc, 0x31ff2fff }, 153 { 0x0000a1d0, 0x37ff34ff }, 154 { 0x0000a1d4, 0x3aff3aff }, 155 { 0x0000a1d8, 0x3aff3aff }, 156 { 0x0000a1dc, 0x3aff3aff }, 157 { 0x0000a1e0, 0x3aff3aff }, 158 { 0x0000a1e4, 0x3aff3aff }, 159 { 0x0000a1e8, 0x3aff3aff }, 160 { 0x0000a1ec, 0x3aff3aff }, 161 { 0x0000a1f0, 0x3aff3aff }, 162 { 0x0000a1f4, 0x3aff3aff }, 163 { 0x0000a1f8, 0x3aff3aff }, 164 { 0x0000a1fc, 0x3aff3aff }, 165 { 0x00009b00, 0x00000000 }, 166 { 0x00009b04, 0x00000020 }, 167 { 0x00009b08, 0x00000010 }, 168 { 0x00009b0c, 0x00000030 }, 169 { 0x00009b10, 0x00000008 }, 170 { 0x00009b14, 0x00000028 }, 171 { 0x00009b18, 0x00000004 }, 172 { 0x00009b1c, 0x00000024 }, 173 { 0x00009b20, 0x00000014 }, 174 { 0x00009b24, 0x00000034 }, 175 { 0x00009b28, 0x0000000c }, 176 { 0x00009b2c, 0x0000002c }, 177 { 0x00009b30, 0x00000002 }, 178 { 0x00009b34, 0x00000022 }, 179 { 0x00009b38, 0x00000012 }, 180 { 0x00009b3c, 0x00000032 }, 181 { 0x00009b40, 0x0000000a }, 182 { 0x00009b44, 0x0000002a }, 183 { 0x00009b48, 0x00000006 }, 184 { 0x00009b4c, 0x00000026 }, 185 { 0x00009b50, 0x00000016 }, 186 { 0x00009b54, 0x00000036 }, 187 { 0x00009b58, 0x0000000e }, 188 { 0x00009b5c, 0x0000002e }, 189 { 0x00009b60, 0x00000001 }, 190 { 0x00009b64, 0x00000021 }, 191 { 0x00009b68, 0x00000011 }, 192 { 0x00009b6c, 0x00000031 }, 193 { 0x00009b70, 0x00000009 }, 194 { 0x00009b74, 0x00000029 }, 195 { 0x00009b78, 0x00000005 }, 196 { 0x00009b7c, 0x00000025 }, 197 { 0x00009b80, 0x00000015 }, 198 { 0x00009b84, 0x00000035 }, 199 { 0x00009b88, 0x0000000d }, 200 { 0x00009b8c, 0x0000002d }, 201 { 0x00009b90, 0x00000003 }, 202 { 0x00009b94, 0x00000023 }, 203 { 0x00009b98, 0x00000013 }, 204 { 0x00009b9c, 0x00000033 }, 205 { 0x00009ba0, 0x0000000b }, 206 { 0x00009ba4, 0x0000002b }, 207 { 0x00009ba8, 0x0000002b }, 208 { 0x00009bac, 0x0000002b }, 209 { 0x00009bb0, 0x0000002b }, 210 { 0x00009bb4, 0x0000002b }, 211 { 0x00009bb8, 0x0000002b }, 212 { 0x00009bbc, 0x0000002b }, 213 { 0x00009bc0, 0x0000002b }, 214 { 0x00009bc4, 0x0000002b }, 215 { 0x00009bc8, 0x0000002b }, 216 { 0x00009bcc, 0x0000002b }, 217 { 0x00009bd0, 0x0000002b }, 218 { 0x00009bd4, 0x0000002b }, 219 { 0x00009bd8, 0x0000002b }, 220 { 0x00009bdc, 0x0000002b }, 221 { 0x00009be0, 0x0000002b }, 222 { 0x00009be4, 0x0000002b }, 223 { 0x00009be8, 0x0000002b }, 224 { 0x00009bec, 0x0000002b }, 225 { 0x00009bf0, 0x0000002b }, 226 { 0x00009bf4, 0x0000002b }, 227 { 0x00009bf8, 0x00000002 }, 228 { 0x00009bfc, 0x00000016 }, 229 { 0x000098d4, 0x00000020 }, 230 { 0x000098d8, 0x00601068 }, 231}; 232 233static uint32_t ar5211Mode2_4[][3] = { 234 { 0x0000a204, 0x00000000, 0x00000000 }, 235 { 0x0000a208, 0x503e4646, 0x503e4646 }, 236 { 0x0000a20c, 0x6480416c, 0x6480416c }, 237 { 0x0000a210, 0x0199a003, 0x0199a003 }, 238 { 0x0000a214, 0x044cd610, 0x044cd610 }, 239 { 0x0000a218, 0x13800040, 0x13800040 }, 240 { 0x0000a21c, 0x1be00060, 0x1be00060 }, 241 { 0x0000a220, 0x0c53800a, 0x0c53800a }, 242 { 0x0000a224, 0x0014df3b, 0x0014df3b }, 243 { 0x0000a228, 0x000001b5, 0x000001b5 }, 244 { 0x0000a22c, 0x00000020, 0x00000020 }, 245 { 0x0000989c, 0x00000000, 0x00000000 }, 246 { 0x0000989c, 0x00000000, 0x00000000 }, 247 { 0x0000989c, 0x00000000, 0x00000000 }, 248 { 0x0000989c, 0x00000000, 0x00000000 }, 249 { 0x0000989c, 0x00000000, 0x00000000 }, 250 { 0x0000989c, 0x00000000, 0x00000000 }, 251 { 0x0000989c, 0x00000000, 0x00000000 }, 252 { 0x0000989c, 0x00000000, 0x00000000 }, 253 { 0x0000989c, 0x00000000, 0x00000000 }, 254 { 0x0000989c, 0x00000000, 0x00000000 }, 255 { 0x0000989c, 0x00000000, 0x00000000 }, 256 { 0x0000989c, 0x00380000, 0x00380000 }, 257 { 0x0000989c, 0x00000000, 0x00000000 }, 258 { 0x0000989c, 0x00000000, 0x00000000 }, 259 { 0x0000989c, 0x00000000, 0x00000000 }, 260 { 0x0000989c, 0x000400f9, 0x000400f9 }, 261 { 0x000098d4, 0x00000000, 0x00000004 }, 262}; 263 264static const uint32_t ar5211BB_RfGain[][3] = { 265 { 0x00009a00, 0x000001a9, 0x00000000 }, 266 { 0x00009a04, 0x000001e9, 0x00000040 }, 267 { 0x00009a08, 0x00000029, 0x00000080 }, 268 { 0x00009a0c, 0x00000069, 0x00000150 }, 269 { 0x00009a10, 0x00000199, 0x00000190 }, 270 { 0x00009a14, 0x000001d9, 0x000001d0 }, 271 { 0x00009a18, 0x00000019, 0x00000010 }, 272 { 0x00009a1c, 0x00000059, 0x00000044 }, 273 { 0x00009a20, 0x00000099, 0x00000084 }, 274 { 0x00009a24, 0x000001a5, 0x00000148 }, 275 { 0x00009a28, 0x000001e5, 0x00000188 }, 276 { 0x00009a2c, 0x00000025, 0x000001c8 }, 277 { 0x00009a30, 0x000001c8, 0x00000014 }, 278 { 0x00009a34, 0x00000008, 0x00000042 }, 279 { 0x00009a38, 0x00000048, 0x00000082 }, 280 { 0x00009a3c, 0x00000088, 0x00000178 }, 281 { 0x00009a40, 0x00000198, 0x000001b8 }, 282 { 0x00009a44, 0x000001d8, 0x000001f8 }, 283 { 0x00009a48, 0x00000018, 0x00000012 }, 284 { 0x00009a4c, 0x00000058, 0x00000052 }, 285 { 0x00009a50, 0x00000098, 0x00000092 }, 286 { 0x00009a54, 0x000001a4, 0x0000017c }, 287 { 0x00009a58, 0x000001e4, 0x000001bc }, 288 { 0x00009a5c, 0x00000024, 0x000001fc }, 289 { 0x00009a60, 0x00000064, 0x0000000a }, 290 { 0x00009a64, 0x000000a4, 0x0000004a }, 291 { 0x00009a68, 0x000000e4, 0x0000008a }, 292 { 0x00009a6c, 0x0000010a, 0x0000015a }, 293 { 0x00009a70, 0x0000014a, 0x0000019a }, 294 { 0x00009a74, 0x0000018a, 0x000001da }, 295 { 0x00009a78, 0x000001ca, 0x0000000e }, 296 { 0x00009a7c, 0x0000000a, 0x0000004e }, 297 { 0x00009a80, 0x0000004a, 0x0000008e }, 298 { 0x00009a84, 0x0000008a, 0x0000015e }, 299 { 0x00009a88, 0x000001ba, 0x0000019e }, 300 { 0x00009a8c, 0x000001fa, 0x000001de }, 301 { 0x00009a90, 0x0000003a, 0x00000009 }, 302 { 0x00009a94, 0x0000007a, 0x00000049 }, 303 { 0x00009a98, 0x00000186, 0x00000089 }, 304 { 0x00009a9c, 0x000001c6, 0x00000179 }, 305 { 0x00009aa0, 0x00000006, 0x000001b9 }, 306 { 0x00009aa4, 0x00000046, 0x000001f9 }, 307 { 0x00009aa8, 0x00000086, 0x00000039 }, 308 { 0x00009aac, 0x000000c6, 0x00000079 }, 309 { 0x00009ab0, 0x000000c6, 0x000000b9 }, 310 { 0x00009ab4, 0x000000c6, 0x000001bd }, 311 { 0x00009ab8, 0x000000c6, 0x000001fd }, 312 { 0x00009abc, 0x000000c6, 0x0000003d }, 313 { 0x00009ac0, 0x000000c6, 0x0000007d }, 314 { 0x00009ac4, 0x000000c6, 0x000000bd }, 315 { 0x00009ac8, 0x000000c6, 0x000000fd }, 316 { 0x00009acc, 0x000000c6, 0x000000fd }, 317 { 0x00009ad0, 0x000000c6, 0x000000fd }, 318 { 0x00009ad4, 0x000000c6, 0x000000fd }, 319 { 0x00009ad8, 0x000000c6, 0x000000fd }, 320 { 0x00009adc, 0x000000c6, 0x000000fd }, 321 { 0x00009ae0, 0x000000c6, 0x000000fd }, 322 { 0x00009ae4, 0x000000c6, 0x000000fd }, 323 { 0x00009ae8, 0x000000c6, 0x000000fd }, 324 { 0x00009aec, 0x000000c6, 0x000000fd }, 325 { 0x00009af0, 0x000000c6, 0x000000fd }, 326 { 0x00009af4, 0x000000c6, 0x000000fd }, 327 { 0x00009af8, 0x000000c6, 0x000000fd }, 328 { 0x00009afc, 0x000000c6, 0x000000fd }, 329}; 330 331static uint32_t ar5211Rf6n7[][3] = { 332 { 0x0000989c, 0x00000000, 0x00000000 }, 333 { 0x0000989c, 0x00000000, 0x00000000 }, 334 { 0x0000989c, 0x00000000, 0x00000000 }, 335 { 0x0000989c, 0x00000000, 0x00000000 }, 336 { 0x0000989c, 0x00000000, 0x00000000 }, 337 { 0x0000989c, 0x10000000, 0x10000000 }, 338 { 0x0000989c, 0x04000000, 0x04000000 }, 339 { 0x0000989c, 0x00000000, 0x00000000 }, 340 { 0x0000989c, 0x00000000, 0x00000000 }, 341 { 0x0000989c, 0x00000000, 0x00000000 }, 342 { 0x0000989c, 0x00000000, 0x0a000000 }, 343 { 0x0000989c, 0x00380080, 0x02380080 }, 344 { 0x0000989c, 0x00020006, 0x00000006 }, 345 { 0x0000989c, 0x00000092, 0x00000092 }, 346 { 0x0000989c, 0x000000a0, 0x000000a0 }, 347 { 0x0000989c, 0x00040007, 0x00040007 }, 348 { 0x000098d4, 0x0000001a, 0x0000001a }, 349 { 0x0000989c, 0x00000048, 0x00000048 }, 350 { 0x0000989c, 0x00000010, 0x00000010 }, 351 { 0x0000989c, 0x00000008, 0x00000008 }, 352 { 0x0000989c, 0x0000000f, 0x0000000f }, 353 { 0x0000989c, 0x000000f2, 0x00000062 }, 354 { 0x0000989c, 0x0000904f, 0x0000904c }, 355 { 0x0000989c, 0x0000125a, 0x0000129a }, 356 { 0x000098cc, 0x0000000e, 0x0000000f }, 357}; 358 359