]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/dev/bhnd/nvram/nvram_map
Update the device tree source files to a Linux 4.7-RC.
[FreeBSD/FreeBSD.git] / sys / dev / bhnd / nvram / nvram_map
1 #-
2 # Copyright (c) 2015-2016 Landon Fuller <landon@landonf.org>
3 # Copyright (C) 2008-2015, Broadcom Corporation.
4 # All Rights Reserved.
5
6 # The contents of this file (variable names, descriptions, and offsets) were
7 # extracted or derived from Broadcom's ISC-licensed sources.
8 #
9 # Permission to use, copy, modify, and/or distribute this software for any
10 # purpose with or without fee is hereby granted, provided that the above
11 # copyright notice and this permission notice appear in all copies.
12
13 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
16 # SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
18 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
19 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #
21 # $FreeBSD$
22
23 #
24 # NVRAM variable definitions and revision-specific SPROM offsets.
25 #
26 # Processed by nvram_map_gen.awk to produce bhnd_nvram_map.h
27 #
28 # NOTE: file was originally generated automatically by using libclang
29 # to analyze and extract format information and descriptions from Broadcom's
30 # available ISC-licensed CIS and SROM code and associated headers.
31 #
32
33 # Board Info
34 #
35
36 u16 boardvendor {}                      # PCI vendor ID (SoC NVRAM-only)
37 u16 subvid      { srom >= 2     0x6 }   # PCI subvendor ID
38 u16 devid       { srom >= 8     0x60 }  # PCI device ID 
39
40 u32 boardflags {
41         srom 1          u16 0x72
42         srom 2          u16 0x72 | u16 0x38 (<<16)
43         srom 3          u16 0x72 | u16 0x7A (<<16)
44         srom 4          0x44
45         srom 5-7        0x4A
46         srom >= 8       0x84
47 }
48 u32 boardflags2 {
49         srom 4          0x48
50         srom 5-7        0x4E
51         srom >= 8       0x88
52 }
53 u32 boardflags3 {
54         srom >= 11      0x8C
55 }
56
57 # Board serial number, independent of mac addr
58 u16 boardnum {
59         srom 1-2        0x4C
60         srom 3          0x4E
61         srom 4          0x50
62         srom 5-7        0x56
63         srom 8-10       0x90
64         srom >= 11      0x94
65 }
66
67 # Board revision
68 u16 boardrev {
69         srom 1-3        u8 0x5D
70         srom 4-7        0x42
71         srom >= 8       0x82
72 }
73
74 # Board type
75 u16 boardtype {
76         srom >= 2       0x4
77 }
78
79 # SROM revision
80 u8 sromrev {
81         srom 1-3        0x74
82         srom 4-9        0x1B6
83         srom 10         0x1CA
84         srom 11         0x1D2
85 }
86
87
88 # PMU Info
89 #
90
91 # PMU min resource mask (embedded-only).
92 u32 rmin {
93         sfmt    decimal
94 }
95
96 # PMU min resource max (embedded-only).
97 u32 rmax {
98         sfmt    decimal
99 }
100
101
102 # Antennas available
103 u8 aa2g {
104         srom 1-3        0x5C (&0x30, >>4)
105         srom 4-7        0x5D
106         srom 8-10       0x9D
107         srom >= 11      0xA1
108 }
109 u8 aa5g {
110         srom 1-3        0x5C (&0xC0, >>6)
111         srom 4-7        0x5C
112         srom 8-10       0x9C
113         srom >= 11      0xA0
114 }
115
116 # ACPHY PA trimming parameters: 40
117 u16[12] pa5gbw40a0 {
118         srom >= 11      0x110
119 }
120
121 # ACPHY PA trimming parameters: 80
122 u16[12] pa5gbw80a0 {
123         srom >= 11      0x138
124 }
125
126 # ACPHY PA trimming parameters: 40/80
127 u16[12] pa5gbw4080a0 {
128         srom >= 11      0x138
129 }
130 u16[12] pa5gbw4080a1 {
131         srom >= 11      u16 0xB6, u16 0xBC, u16 0xCE, u16 0xD4, u16[8] 0x128
132 }
133
134 # ACPHY PA trimming parameters: CCK
135 u16[3] pa2gccka0 {
136         srom >= 11      0x102
137 }
138
139 # ACPHY Power-per-rate 2gpo
140 u16 dot11agofdmhrbw202gpo {
141         srom >= 11      0x15C
142 }
143 u16 ofdmlrbw202gpo {
144         srom >= 11      0x15E
145 }
146
147 # ACPHY Power-per-rate 5gpo
148 u32 mcsbw805glpo {
149         srom >= 11      0x168
150 }
151 u32 mcsbw805gmpo {
152         srom >= 11      0x178
153 }
154 u32 mcsbw805ghpo {
155         srom >= 11      0x188
156 }
157 u16 mcslr5glpo {
158         srom >= 11      0x190 (&0xFFF)
159 }
160 u16 mcslr5gmpo {
161         srom >= 11      0x192
162 }
163 u16 mcslr5ghpo {
164         srom >= 11      0x194
165 }
166
167 # ACPHY Power-per-rate sbpo
168 u16 sb20in40hrpo {
169         srom >= 11      0x196
170 }
171 u16 sb20in80and160hr5glpo {
172         srom >= 11      0x198
173 }
174 u16 sb40and80hr5glpo {
175         srom >= 11      0x19A
176 }
177 u16 sb20in80and160hr5gmpo {
178         srom >= 11      0x19C
179 }
180 u16 sb40and80hr5gmpo {
181         srom >= 11      0x19E
182 }
183 u16 sb20in80and160hr5ghpo {
184         srom >= 11      0x1A0
185 }
186 u16 sb40and80hr5ghpo {
187         srom >= 11      0x1A2
188 }
189 u16 sb20in40lrpo {
190         srom >= 11      0x1A4
191 }
192 u16 sb20in80and160lr5glpo {
193         srom >= 11      0x1A6
194 }
195 u16 sb40and80lr5glpo {
196         srom >= 11      0x1A8
197 }
198 u16 sb20in80and160lr5gmpo {
199         srom >= 11      0x1AA
200 }
201 u16 sb40and80lr5gmpo {
202         srom >= 11      0x1AC
203 }
204 u16 sb20in80and160lr5ghpo {
205         srom >= 11      0x1AE
206 }
207 u16 sb40and80lr5ghpo {
208         srom >= 11      0x1B0
209 }
210 u16 dot11agduphrpo {
211         srom >= 11      0x1B2
212 }
213 u16 dot11agduplrpo {
214         srom >= 11      0x1B4
215 }
216
217 # Antenna gain
218 u8 ag0 {
219         srom 1-3        0x75
220         srom 4-7        0x5F
221         srom 8-10       0x9F
222 }
223 u8 ag1 {
224         srom 1-3        0x74
225         srom 4-7        0x5E
226         srom 8-10       0x9E
227 }
228 u8 ag2 {
229         srom 4-7        0x61
230         srom 8-10       0xA1
231 }
232 u8 ag3 {
233         srom 4-7        0x60
234         srom 8-10       0xA0
235 }
236
237 u8 agbg0 {
238         srom >= 11      0xA2
239 }
240 u8 agbg1 {
241         srom >= 11      0xA3
242 }
243 u8 agbg2 {
244         srom >= 11      0xA4
245 }
246 u8 aga0 {
247         srom >= 11      0xA5
248 }
249 u8 aga1 {
250         srom >= 11      0xA6
251 }
252 u8 aga2 {
253         srom >= 11      0xA7
254 }
255
256 # Default country code (sromrev == 1)
257 u8 cc {
258         srom 1          0x5C (&0xF)
259 }
260
261 # 2 bytes each
262 # CCK Power offsets for 20 MHz rates (11, 5.5, 2, 1Mbps)
263 # cckbw202gpo cckbw20ul2gpo
264
265 u16 cckbw202gpo {
266         srom 9-10       0x140
267         srom >= 11      0x150
268 }
269 u16 cckbw20ul2gpo {
270         srom 9-10       0x142
271         srom >= 11      0x152
272 }
273
274 # Country code (2 bytes ascii + 1 byte cctl)
275 # in rev 2
276
277 char[2] ccode {
278         sfmt    ccode
279         srom 0-3        0x76
280         srom 4          0x52
281         srom 5-7        0x44
282         srom 8-10       0x92
283         srom >= 11      0x96
284 }
285
286 # 2 byte; txchain, rxchain
287 u8 txchain {
288         all1    ignore
289         srom 4-7        0x7B (&0xF)
290         srom 8-10       0xA3 (&0xF)
291         srom >= 11      0xA9 (&0xF)
292 }
293 u8 rxchain {
294         all1    ignore
295         srom 4-7        0x7B (&0xF0, >>4)
296         srom 8-10       0xA3 (&0xF0, >>4)
297         srom >= 11      0xA9 (&0xF0, >>4)
298 }
299 u16 antswitch {
300         all1    ignore
301         srom 4-7        u8 0x7A
302         srom 8-10       u8 0xA2
303         srom >= 11      u8 0xA8
304 }
305
306 u8 elna2g {
307         srom 8-10       0xBB
308 }
309
310 u8 elna5g {
311         srom 8-10       0xBA
312 }
313
314 # 11n front-end specification
315 u8 antswctl2g {
316         srom 8-10       0xAE (&0xF8, >>3)
317 }
318 u8 triso2g {
319         srom 8-10       0xAE (&0x7)
320 }
321 u8 pdetrange2g {
322         srom 8-10       0xAF (&0xF8, >>3)
323 }
324 u8 extpagain2g {
325         srom 8-10       0xAF (&0x6, >>1)
326 }
327 u8 tssipos2g {
328         srom 8-10       0xAF (&0x1)
329 }
330 u8 antswctl5g {
331         srom 8-10       0xB0 (&0xF8, >>3)
332 }
333 u8 triso5g {
334         srom 8-10       0xB0 (&0x7)
335 }
336 u8 pdetrange5g {
337         srom 8-10       0xB1 (&0xF8, >>3)
338 }
339 u8 extpagain5g {
340         srom 8-10       0xB1 (&0x6, >>1)
341 }
342 u8 tssipos5g {
343         srom 8-10       0xB1 (&0x1)
344 }
345
346 # FEM config
347 u8 femctrl {
348         sfmt    decimal
349         srom >= 11      0xAA (&0xF8, >>3)
350 }
351 u8 papdcap2g {
352         sfmt    decimal
353         srom >= 11      0xAA (&0x4, >>2)
354 }
355 u8 tworangetssi2g {
356         sfmt    decimal
357         srom >= 11      0xAA (&0x2, >>1)
358 }
359 u8 pdgain2g {
360         sfmt    decimal
361         srom >= 11      u16 0xAA (&0x1F0, >>4)
362 }
363 u8 epagain2g {
364         sfmt    decimal
365         srom >= 11      0xAB (&0xE, >>1)
366 }
367 u8 tssiposslope2g {
368         sfmt    decimal
369         srom >= 11      0xAB (&0x1)
370 }
371 u8 gainctrlsph {
372         sfmt    decimal
373         srom >= 11      0xAC (&0xF8, >>3)
374 }
375 u8 papdcap5g {
376         sfmt    decimal
377         srom >= 11      0xAC (&0x4, >>2)
378 }
379 u8 tworangetssi5g {
380         sfmt    decimal
381         srom >= 11      0xAC (&0x2, >>1)
382 }
383 u8 pdgain5g {
384         sfmt    decimal
385         srom >= 11      u16 0xAC (&0x1F0, >>4)
386 }
387 u8 epagain5g {
388         sfmt    decimal
389         srom >= 11      0xAD (&0xE, >>1)
390 }
391 u8 tssiposslope5g {
392         sfmt    decimal
393         srom >= 11      0xAD (&0x1)
394 }
395
396 # LED duty cycle
397 u8[2] leddc {
398         sfmt    led_dc
399         all1    ignore
400         srom 3          0x7C
401         srom 4          0x5A
402         srom 5-7        0x5A
403         srom 8-10       0x9A
404         srom >= 11      0x9E
405 }
406
407 # LED set
408 u8 ledbh0 {
409         all1    ignore
410         srom 1-3        0x65
411         srom 4          0x57
412         srom 5-7        0x77
413         srom 8-10       0x97
414         srom >= 11      0x9B
415 }
416 u8 ledbh1 {
417         all1    ignore
418         srom 1-3        0x64
419         srom 4          0x56
420         srom 5-7        0x76
421         srom 8-10       0x96
422         srom >= 11      0x9A
423 }
424 u8 ledbh2 {
425         all1    ignore
426         srom 1-3        0x67
427         srom 4          0x59
428         srom 5-7        0x79
429         srom 8-10       0x99
430         srom >= 11      0x9D
431 }
432 u8 ledbh3 {
433         all1    ignore
434         srom 1-3        0x66
435         srom 4          0x58
436         srom 5-7        0x78
437         srom 8-10       0x98
438         srom >= 11      0x9C
439 }
440
441 # 2 bytes total
442 # Additional power offset for Legacy Dup40 transmissions.
443 # Applied in addition to legofdmbw20ulXpo, X=2g, 5gl, 5gm, or 5gh.
444 # LSB nibble: 2G band, MSB nibble: 5G band high subband.
445 # leg40dup5ghpo, leg40dup5gmpo, leg40dup5glpo, leg40dup2gpo
446
447 u16 legofdm40duppo {
448         srom 9-10       0x196
449 }
450
451 # 4 bytes each
452 # OFDM power offsets for 20 MHz Legacy rates
453 # (54, 48, 36, 24, 18, 12, 9, 6 Mbps)
454 # legofdmbw202gpo  legofdmbw20ul2gpo
455
456 u32 legofdmbw202gpo {
457         srom 9-10       0x144
458 }
459 u32 legofdmbw20ul2gpo {
460         srom 9-10       0x148
461 }
462
463 # 4 bytes each
464 # 5G band: OFDM power offsets for 20 MHz Legacy rates
465 # (54, 48, 36, 24, 18, 12, 9, 6 Mbps)
466 # low subband : legofdmbw205glpo  legofdmbw20ul2glpo
467 # mid subband :legofdmbw205gmpo  legofdmbw20ul2gmpo
468 # high subband :legofdmbw205ghpo  legofdmbw20ul2ghpo
469
470 u32 legofdmbw205glpo {
471         srom 9-10       0x14C
472 }
473 u32 legofdmbw20ul5glpo {
474         srom 9-10       0x150
475 }
476 u32 legofdmbw205gmpo {
477         srom 9-10       0x154
478 }
479 u32 legofdmbw20ul5gmpo {
480         srom 9-10       0x158
481 }
482 u32 legofdmbw205ghpo {
483         srom 9-10       0x15C
484 }
485 u32 legofdmbw20ul5ghpo {
486         srom 9-10       0x160
487 }
488
489 # mac addr override for the standard CIS LAN_NID
490 u8[6] macaddr {
491         sfmt    macaddr
492         srom 3          u8 0x4B, u8 0x4A, u8 0x4D, u8 0x4C, u8 0x4F, u8 0x4E
493         srom 4          u8 0x4D, u8 0x4C, u8 0x4F, u8 0x4E, u8 0x51, u8 0x50
494         srom 5-7        u8 0x53, u8 0x52, u8 0x55, u8 0x54, u8 0x57, u8 0x56
495         srom 8-10       u8 0x8D, u8 0x8C, u8 0x8F, u8 0x8E, u8 0x91, u8 0x90
496         srom >= 11      u8 0x91, u8 0x90, u8 0x93, u8 0x92, u8 0x95, u8 0x94
497 }
498
499 # 4 bytes each
500 # mcs 0-7  power-offset. LSB nibble: m0, MSB nibble: m7
501 # mcsbw202gpo  mcsbw20ul2gpo mcsbw402gpo
502
503 u32 mcsbw202gpo {
504         srom 9-10       0x164
505         srom >= 11      0x154
506 }
507 u32 mcsbw20ul2gpo {
508         srom 9-10       0x168
509 }
510 u32 mcsbw402gpo {
511         srom 9-10       0x16C
512         srom >= 11      0x158
513 }
514
515 # 4 bytes each
516 # 5G high subband mcs 0-7 power-offset.
517 # LSB nibble: m0, MSB nibble: m7
518 # mcsbw205ghpo  mcsbw20ul5ghpo mcsbw405ghpo
519
520 u32 mcsbw205ghpo {
521         srom 9-10       0x188
522         srom >= 11      0x180
523 }
524 u32 mcsbw20ul5ghpo {
525         srom 9-10       0x18C
526 }
527 u32 mcsbw405ghpo {
528         srom 9-10       0x190
529         srom >= 11      0x184
530 }
531
532 # 4 bytes each
533 # 5G low subband mcs 0-7 power-offset.
534 # LSB nibble: m0, MSB nibble: m7
535 # mcsbw205glpo  mcsbw20ul5glpo mcsbw405glpo
536
537 u32 mcsbw205glpo {
538         srom 9-10       0x170
539         srom >= 11      0x160
540 }
541 u32 mcsbw20ul5glpo {
542         srom 9-10       0x174
543 }
544 u32 mcsbw405glpo {
545         srom 9-10       0x178
546         srom >= 11      0x164
547 }
548
549 # 4 bytes each
550 # 5G mid subband mcs 0-7 power-offset.
551 # LSB nibble: m0, MSB nibble: m7
552 # mcsbw205gmpo  mcsbw20ul5gmpo mcsbw405gmpo
553
554 u32 mcsbw205gmpo {
555         srom 9-10       0x17C
556         srom >= 11      0x170
557 }
558 u32 mcsbw20ul5gmpo {
559         srom 9-10       0x180
560 }
561 u32 mcsbw405gmpo {
562         srom 9-10       0x184
563         srom >= 11      0x174
564 }
565
566 # 2 bytes total
567 # mcs-32 power offset for each band/subband.
568 # LSB nibble: 2G band, MSB nibble:
569 # mcs322ghpo, mcs325gmpo, mcs325glpo, mcs322gpo
570
571 u16 mcs32po {
572         srom 9-10       0x194
573 }
574
575 u8 measpower {
576         srom 8-10       0xB4 (&0xFE, >>1)
577         srom >= 11      0xB0 (&0xFE, >>1)
578 }
579 u8 measpower1 {
580         srom 8-10       0xBF (&0x7F)
581         srom >= 11      0xBB (&0x7F)
582 }
583 u8 measpower2 {
584         srom 8-10       u16 0xBE (&0x3F80, >>7)
585         srom >= 11      u16 0xBA (&0x3F80, >>7)
586 }
587 u16 rawtempsense {
588         srom 8-10       0xB4 (&0x1FF)
589         srom >= 11      0xB0 (&0x1FF)
590 }
591
592 u8 noiselvl2ga0 {
593         sfmt    decimal
594         srom 8-10       0x1AB (&0x1F)
595         srom >= 11      0x1BD (&0x1F)
596 }
597 u8 noiselvl2ga1 {
598         sfmt    decimal
599         srom 8-10       u16 0x1AA (&0x3E0, >>5)
600         srom >= 11      u16 0x1BC (&0x3E0, >>5)
601 }
602 u8 noiselvl2ga2 {
603         sfmt    decimal
604         srom 8-10       0x1AA (&0x7C, >>2)
605         srom >= 11      0x1BC (&0x7C, >>2)
606 }
607 u8[4] noiselvl5ga0 {
608         sfmt    decimal
609         srom >= 11      u8 0x1BF (&0x1F), u8 0x1C1 (&0x1F), u8 0x1C3 (&0x1F), u8 0x1C5 (&0x1F)
610 }
611 u8[4] noiselvl5ga1 {
612         sfmt    decimal
613         srom >= 11      u16[4] 0x1BE (&0x3E0, >>5)
614 }
615 u8[4] noiselvl5ga2 {
616         sfmt    decimal
617         srom >= 11      u8 0x1BE (&0x7C, >>2), u8 0x1C0 (&0x7C, >>2), u8 0x1C2 (&0x7C, >>2), u8 0x1C4 (&0x7C, >>2)
618 }
619
620 # paparambwver
621 u8 paparambwver {
622         sfmt    decimal
623         srom >= 11      0x190 (&0xF0, >>4)
624 }
625
626 # PA parameters: 8 (sromrev == 1)
627 # or 9 (sromrev > 1) bytes
628
629 u16 pa0b0 {
630         sfmt    decimal
631         srom 1-3        0x5E
632         srom 8-10       0xC2
633 }
634 u16 pa0b1 {
635         sfmt    decimal
636         srom 1-3        0x60
637         srom 8-10       0xC4
638 }
639 u16 pa0b2 {
640         sfmt    decimal
641         srom 1-3        0x62
642         srom 8-10       0xC6
643 }
644 u8 pa0itssit {
645         sfmt    decimal
646         srom 1-3        0x71
647         srom 8-10       0xC0
648 }
649 u8 pa0maxpwr {
650         sfmt    decimal
651         srom 1-3        0x69
652         srom 8-10       0xC1
653 }
654 u8 opo {
655         srom 2-3        0x79
656         srom 8-10       0x143
657 }
658
659 # 5G PA params
660 u16 pa1b0 {
661         sfmt    decimal
662         srom 1-3        0x6A
663         srom 8-10       0xCC
664 }
665 u16 pa1b1 {
666         sfmt    decimal
667         srom 1-3        0x6C
668         srom 8-10       0xCE
669 }
670 u16 pa1b2 {
671         sfmt    decimal
672         srom 1-3        0x6E
673         srom 8-10       0xD0
674 }
675 u16 pa1lob0 {
676         sfmt    decimal
677         srom 2-3        0x3C
678         srom 8-10       0xD2
679 }
680 u16 pa1lob1 {
681         sfmt    decimal
682         srom 2-3        0x3E
683         srom 8-10       0xD4
684 }
685 u16 pa1lob2 {
686         sfmt    decimal
687         srom 2-3        0x40
688         srom 8-10       0xD6
689 }
690 u16 pa1hib0 {
691         sfmt    decimal
692         srom 2-3        0x42
693         srom 8-10       0xD8
694 }
695 u16 pa1hib1 {
696         sfmt    decimal
697         srom 2-3        0x44
698         srom 8-10       0xDA
699 }
700 u16 pa1hib2 {
701         sfmt    decimal
702         srom 2-3        0x46
703         srom 8-10       0xDC
704 }
705 u8 pa1itssit {
706         sfmt    decimal
707         srom 1-3        0x70
708         srom 8-10       0xC8
709 }
710 u8 pa1maxpwr {
711         sfmt    decimal
712         srom 1-3        0x68
713         srom 8-10       0xC9
714 }
715 u8 pa1lomaxpwr {
716         sfmt    decimal
717         srom 2-3        0x3A
718         srom 8-10       0xCA
719 }
720 u8 pa1himaxpwr {
721         sfmt    decimal
722         srom 2-3        0x3B
723         srom 8-10       0xCB
724 }
725
726 u16 pdoffset40ma0 {
727         srom >= 11      0xCA
728 }
729 u16 pdoffset40ma1 {
730         srom >= 11      0xCC
731 }
732 u16 pdoffset40ma2 {
733         srom >= 11      0xCE
734 }
735 u16 pdoffset80ma0 {
736         srom >= 11      0xD0
737 }
738 u16 pdoffset80ma1 {
739         srom >= 11      0xD2
740 }
741 u16 pdoffset80ma2 {
742         srom >= 11      0xD4
743 }
744
745 u8 pdoffset2g40ma0 {
746         srom >= 11      0xC9 (&0xF)
747 }
748 u8 pdoffset2g40ma1 {
749         srom >= 11      0xC9 (&0xF0, >>4)
750 }
751 u8 pdoffset2g40ma2 {
752         srom >= 11      0xC8 (&0xF)
753 }
754 u8 pdoffset2g40mvalid {
755         srom >= 11      0xC8 (&0x80, >>7)
756 }
757
758 # 40Mhz channel 2g/5g power offset
759 u16 bw40po {
760         srom 4-7        0x18E
761         srom 8  0x196
762 }
763
764 # 40Mhz channel dup 2g/5g power offset
765 u16 bwduppo {
766         srom 4-7        0x190
767         srom 8  0x198
768 }
769
770 # cck2g/ofdm2g/ofdm5g power offset
771 u16 cck2gpo {
772         srom 4-7        0x138
773         srom 8          0x140
774 }
775 u32 ofdm2gpo {
776         srom 4-7        0x13A
777         srom 8          0x142
778 }
779 u32 ofdm5gpo {
780         srom 4-7        0x13E
781         srom 8          0x146
782 }
783 u32 ofdm5glpo {
784         srom 4-7        0x142
785         srom 8          0x14A
786 }
787 u32 ofdm5ghpo {
788         srom 4-7        0x146
789         srom 8          0x14E
790 }
791
792 # cdd2g/5g power offset
793 u16 cddpo {
794         srom 4-7        0x18A
795         srom 8          0x192
796 }
797
798 # mcs2g power offset
799 u16 mcs2gpo0 {
800         srom 4-7        0x14A
801         srom 8          0x152
802 }
803 u16 mcs2gpo1 {
804         srom 4-7        0x14C
805         srom 8          0x154
806 }
807 u16 mcs2gpo2 {
808         srom 4-7        0x14E
809         srom 8          0x156
810 }
811 u16 mcs2gpo3 {
812         srom 4-7        0x150
813         srom 8          0x158
814 }
815 u16 mcs2gpo4 {
816         srom 4-7        0x152
817         srom 8          0x15A
818 }
819 u16 mcs2gpo5 {
820         srom 4-7        0x154
821         srom 8          0x15C
822 }
823 u16 mcs2gpo6 {
824         srom 4-7        0x156
825         srom 8          0x15E
826 }
827 u16 mcs2gpo7 {
828         srom 4-7        0x158
829         srom 8          0x160
830 }
831
832 # mcs5g low-high band power offset
833 u16 mcs5glpo0 {
834         srom 4-7        0x16A
835         srom 8          0x172
836 }
837 u16 mcs5glpo1 {
838         srom 4-7        0x16C
839         srom 8          0x174
840 }
841 u16 mcs5glpo2 {
842         srom 4-7        0x16E
843         srom 8          0x176
844 }
845 u16 mcs5glpo3 {
846         srom 4-7        0x170
847         srom 8          0x178
848 }
849 u16 mcs5glpo4 {
850         srom 4-7        0x172
851         srom 8          0x17A
852 }
853 u16 mcs5glpo5 {
854         srom 4-7        0x174
855         srom 8          0x17C
856 }
857 u16 mcs5glpo6 {
858         srom 4-7        0x176
859         srom 8          0x17E
860 }
861 u16 mcs5glpo7 {
862         srom 4-7        0x178
863         srom 8          0x180
864 }
865 u16 mcs5ghpo0 {
866         srom 4-7        0x17A
867         srom 8          0x182
868 }
869 u16 mcs5ghpo1 {
870         srom 4-7        0x17C
871         srom 8          0x184
872 }
873 u16 mcs5ghpo2 {
874         srom 4-7        0x17E
875         srom 8          0x186
876 }
877 u16 mcs5ghpo3 {
878         srom 4-7        0x180
879         srom 8          0x188
880 }
881 u16 mcs5ghpo4 {
882         srom 4-7        0x182
883         srom 8          0x18A
884 }
885 u16 mcs5ghpo5 {
886         srom 4-7        0x184
887         srom 8          0x18C
888 }
889 u16 mcs5ghpo6 {
890         srom 4-7        0x186
891         srom 8          0x18E
892 }
893 u16 mcs5ghpo7 {
894         srom 4-7        0x188
895         srom 8          0x190
896 }
897
898 # mcs5g mid band power offset
899 u16 mcs5gpo0 {
900         srom 4-7        0x15A
901         srom 8          0x162
902 }
903 u16 mcs5gpo1 {
904         srom 4-7        0x15C
905         srom 8          0x164
906 }
907 u16 mcs5gpo2 {
908         srom 4-7        0x15E
909         srom 8          0x166
910 }
911 u16 mcs5gpo3 {
912         srom 4-7        0x160
913         srom 8          0x168
914 }
915 u16 mcs5gpo4 {
916         srom 4-7        0x162
917         srom 8          0x16A
918 }
919 u16 mcs5gpo5 {
920         srom 4-7        0x164
921         srom 8          0x16C
922 }
923 u16 mcs5gpo6 {
924         srom 4-7        0x166
925         srom 8          0x16E
926 }
927 u16 mcs5gpo7 {
928         srom 4-7        0x168
929         srom 8          0x170
930 }
931
932 # stbc2g/5g power offset
933 u16 stbcpo {
934         srom 4-7        0x18C
935         srom 8          0x194
936 }
937
938 u8 regrev {
939         srom 3          0x78
940         srom 4          0x55
941         srom 5-7        0x47
942         srom 8-10       0x95
943         srom >= 11      0x99
944 }
945
946 # 4328 2G RSSI mid pt sel & board switch arch,
947 # 2 bytes, rev 3.
948
949 u8 rssismf2g {
950         srom 3          0x51 (&0xF)
951         srom 8-10       0xA5 (&0xF)
952 }
953 u8 rssismc2g {
954         srom 3          0x51 (&0xF0, >>4)
955         srom 8-10       0xA5 (&0xF0, >>4)
956 }
957 u8 rssisav2g {
958         srom 3          0x50 (&0x7)
959         srom 8-10       0xA4 (&0x7)
960 }
961 u8 bxa2g {
962         srom 3          0x50 (&0x18, >>3)
963         srom 8-10       0xA4 (&0x18, >>3)
964 }
965
966 # 4328 5G RSSI mid pt sel & board switch arch,
967 # 2 bytes, rev 3.
968
969 u8 rssismf5g {
970         srom 3          0x53 (&0xF)
971         srom 8-10       0xA7 (&0xF)
972 }
973 u8 rssismc5g {
974         srom 3          0x53 (&0xF0, >>4)
975         srom 8-10       0xA7 (&0xF0, >>4)
976 }
977 u8 rssisav5g {
978         srom 3          0x52 (&0x7)
979         srom 8-10       0xA6 (&0x7)
980 }
981 u8 bxa5g {
982         srom 3          0x52 (&0x18, >>3)
983         srom 8-10       0xA6 (&0x18, >>3)
984 }
985
986 u8 rxgainerr2ga0 {
987         srom 8-10       0x19B (&0x3F)
988         srom >= 11      0x1C7 (&0x3F)
989 }
990 u8 rxgainerr2ga1 {
991         srom 8-10       u16 0x19A (&0x7C0, >>6)
992         srom >= 11      u16 0x1C6 (&0x7C0, >>6)
993 }
994 u8 rxgainerr2ga2 {
995         srom 8-10       0x19A (&0xF8, >>3)
996         srom >= 11      0x1C6 (&0xF8, >>3)
997 }
998 u8[4] rxgainerr5ga0 {
999         srom >= 11      u8 0x1C9 (&0x3F), u8 0x1CB (&0x3F), u8 0x1CD (&0x3F), u8 0x1CF (&0x3F)
1000 }
1001 u8[4] rxgainerr5ga1 {
1002         srom >= 11      u16[4] 0x1C8 (&0x7C0, >>6)
1003 }
1004 u8[4] rxgainerr5ga2 {
1005         srom >= 11      u8 0x1C8 (&0xF8, >>3), u8 0x1CA (&0xF8, >>3), u8 0x1CC (&0xF8, >>3), u8 0x1CE (&0xF8, >>3)
1006 }
1007 u8 rxgainerr5gha0 {
1008         srom 8-10       0x1A1 (&0x3F)
1009 }
1010 u8 rxgainerr5gha1 {
1011         srom 8-10       u16 0x1A0 (&0x7C0, >>6)
1012 }
1013 u8 rxgainerr5gha2 {
1014         srom 8-10       0x1A0 (&0xF8, >>3)
1015 }
1016 u8 rxgainerr5gla0 {
1017         srom 8-10       0x19D (&0x3F)
1018 }
1019 u8 rxgainerr5gla1 {
1020         srom 8-10       u16 0x19C (&0x7C0, >>6)
1021 }
1022 u8 rxgainerr5gla2 {
1023         srom 8-10       0x19C (&0xF8, >>3)
1024 }
1025 u8 rxgainerr5gma0 {
1026         srom 8-10       0x19F (&0x3F)
1027 }
1028 u8 rxgainerr5gma1 {
1029         srom 8-10       u16 0x19E (&0x7C0, >>6)
1030 }
1031 u8 rxgainerr5gma2 {
1032         srom 8-10       0x19E (&0xF8, >>3)
1033 }
1034 u8 rxgainerr5gua0 {
1035         srom 8-10       0x1A3 (&0x3F)
1036 }
1037 u8 rxgainerr5gua1 {
1038         srom 8-10       u16 0x1A2 (&0x7C0, >>6)
1039 }
1040 u8 rxgainerr5gua2 {
1041         srom 8-10       0x1A2 (&0xF8, >>3)
1042 }
1043
1044 # 4328 2G RX power offset
1045 i8 rxpo2g {
1046         sfmt    decimal
1047         srom 3          0x5B
1048         srom 8-10       0xAD
1049 }
1050
1051 # 4328 5G RX power offset
1052 i8 rxpo5g {
1053         sfmt    decimal
1054         srom 3          0x5A
1055         srom 8-10       0xAC
1056 }
1057
1058 u16 subband5gver {
1059         srom 8-10       u8 0x1A5 (&0x7)
1060         srom >= 11      0xD6
1061 }
1062
1063 # 2 bytes
1064 # byte1 tempthresh
1065 # byte2 period(msb 4 bits) | hysterisis(lsb 4 bits)
1066
1067 u8 tempthresh {
1068         srom 8-10       0xB2
1069         srom >= 11      0xAE
1070 }
1071 u8 temps_period {
1072         sfmt    decimal
1073         srom 8-10       0xBC (&0xF)
1074         srom >= 11      0xB8 (&0xF)
1075 }
1076 u8 temps_hysteresis {
1077         sfmt    decimal
1078         srom 8-10       0xBC (&0xF0, >>4)
1079         srom >= 11      0xB8 (&0xF0, >>4)
1080 }
1081 u8 tempoffset {
1082         sfmt    decimal
1083         srom 8-10       0xB3
1084         srom >= 11      0xAF
1085 }
1086 u8 tempsense_slope {
1087         srom 8-10       0xB7
1088         srom >= 11      0xB3
1089 }
1090 u8 tempcorrx {
1091         srom 8-10       0xB6 (&0xFC, >>2)
1092         srom >= 11      0xB2 (&0xFC, >>2)
1093 }
1094 u8 tempsense_option {
1095         srom 8-10       0xB6 (&0x3)
1096         srom >= 11      0xB2 (&0x3)
1097 }
1098 u8 phycal_tempdelta {
1099         sfmt    decimal
1100         srom 8-10       0xBD
1101         srom >= 11      0xB9
1102 }
1103
1104 # 4328 2G TR isolation, 1 byte
1105 u8 tri2g {
1106         srom 3          0x55
1107         srom 8-10       0xA9
1108 }
1109
1110 # 4328 5G TR isolation, 3 bytes
1111 u8 tri5gl {
1112         srom 3          0x57
1113         srom 8-10       0xAB
1114 }
1115 u8 tri5g {
1116         srom 3          0x54
1117         srom 8-10       0xA8
1118 }
1119 u8 tri5gh {
1120         srom 3          0x56
1121         srom 8-10       0xAA
1122 }
1123
1124 # phy txbf rpcalvars
1125 u16 rpcal2g {
1126         srom >= 11      0x16C
1127 }
1128 u16 rpcal5gb0 {
1129         srom >= 11      0x16E
1130 }
1131 u16 rpcal5gb1 {
1132         srom >= 11      0x17C
1133 }
1134 u16 rpcal5gb2 {
1135         srom >= 11      0x17E
1136 }
1137 u16 rpcal5gb3 {
1138         srom >= 11      0x18C
1139 }
1140
1141 # Crystal frequency in kilohertz
1142 u32 xtalfreq {
1143         sfmt    decimal
1144         srom >= 11      u16 0xB4
1145 }
1146
1147 # N-PHY tx power workaround
1148 u8 txpid2ga0 {
1149         srom 4-7        0x63
1150 }
1151 u8 txpid2ga1 {
1152         srom 4-7        0x62
1153 }
1154 u8 txpid2ga2 {
1155         srom 4-7        0x65
1156 }
1157 u8 txpid2ga3 {
1158         srom 4-7        0x64
1159 }
1160 u8 txpid5ga0 {
1161         srom 4-7        0x67
1162 }
1163 u8 txpid5ga1 {
1164         srom 4-7        0x66
1165 }
1166 u8 txpid5ga2 {
1167         srom 4-7        0x69
1168 }
1169 u8 txpid5ga3 {
1170         srom 4-7        0x68
1171 }
1172 u8 txpid5gha0 {
1173         srom 4-7        0x6F
1174 }
1175 u8 txpid5gha1 {
1176         srom 4-7        0x6E
1177 }
1178 u8 txpid5gha2 {
1179         srom 4-7        0x71
1180 }
1181 u8 txpid5gha3 {
1182         srom 4-7        0x70
1183 }
1184 u8 txpid5gla0 {
1185         srom 4-7        0x6B
1186 }
1187 u8 txpid5gla1 {
1188         srom 4-7        0x6A
1189 }
1190 u8 txpid5gla2 {
1191         srom 4-7        0x6D
1192 }
1193 u8 txpid5gla3 {
1194         srom 4-7        0x6C
1195 }
1196
1197 u16 cckPwrOffset {
1198         srom 10 0x1B4
1199 }
1200 u8[6] et1macaddr {
1201         sfmt    macaddr
1202         srom 0-2        u8 0x55, u8 0x54, u8 0x57, u8 0x56, u8 0x59, u8 0x58
1203 }
1204 u8 eu_edthresh2g {
1205         srom 8          0x1A9
1206         srom 9          0x199
1207         srom 10         0x199
1208         srom 11         0x1D1
1209 }
1210 u8 eu_edthresh5g {
1211         srom 8          0x1A8
1212         srom 9          0x198
1213         srom 10         0x198
1214         srom 11         0x1D0
1215 }
1216 u8 freqoffset_corr {
1217         srom 8-10       0xB9 (&0xF)
1218 }
1219 u8 hw_iqcal_en {
1220         srom 8-10       0xB9 (&0x20, >>5)
1221 }
1222 u8[6] il0macaddr {
1223         sfmt    macaddr
1224         srom 0-2        u8 0x49, u8 0x48, u8 0x51, u8 0x50, u8 0x53, u8 0x52
1225 }
1226 u8 iqcal_swp_dis {
1227         srom 8-10       0xB9 (&0x10, >>4)
1228 }
1229
1230 u8 noisecaloffset {
1231         srom 8-9        0x1B5
1232 }
1233 u8 noisecaloffset5g {
1234         srom 8-9        0x1B4
1235 }
1236 u8 noiselvl5gha0 {
1237         srom 8-10       0x1B1 (&0x1F)
1238 }
1239 u8 noiselvl5gha1 {
1240         srom 8-10       u16 0x1B0 (&0x3E0, >>5)
1241 }
1242 u8 noiselvl5gha2 {
1243         srom 8-10       0x1B0 (&0x7C, >>2)
1244 }
1245 u8 noiselvl5gla0 {
1246         srom 8-10       0x1AD (&0x1F)
1247 }
1248 u8 noiselvl5gla1 {
1249         srom 8-10       u16 0x1AC (&0x3E0, >>5)
1250 }
1251 u8 noiselvl5gla2 {
1252         srom 8-10       0x1AC (&0x7C, >>2)
1253 }
1254 u8 noiselvl5gma0 {
1255         srom 8-10       0x1AF (&0x1F)
1256 }
1257 u8 noiselvl5gma1 {
1258         srom 8-10       u16 0x1AE (&0x3E0, >>5)
1259 }
1260 u8 noiselvl5gma2 {
1261         srom 8-10       0x1AE (&0x7C, >>2)
1262 }
1263 u8 noiselvl5gua0 {
1264         srom 8-10       0x1B3 (&0x1F)
1265 }
1266 u8 noiselvl5gua1 {
1267         srom 8-10       u16 0x1B2 (&0x3E0, >>5)
1268 }
1269 u8 noiselvl5gua2 {
1270         srom 8-10       0x1B2 (&0x7C, >>2)
1271 }
1272
1273 u8 pcieingress_war {
1274         srom 8-10       0x1A7 (&0xF)
1275 }
1276
1277 u8 pdoffsetcckma0 {
1278         srom >= 11      0x18F (&0xF)
1279 }
1280 u8 pdoffsetcckma1 {
1281         srom >= 11      0x18F (&0xF0, >>4)
1282 }
1283 u8 pdoffsetcckma2 {
1284         srom >= 11      0x18E (&0xF)
1285 }
1286
1287 u8 sar2g {
1288         srom 9-10       0x1A9
1289         srom >= 11      0x1BB
1290 }
1291 u8 sar5g {
1292         srom 9-10       0x1A8
1293         srom >= 11      0x1BA
1294 }
1295
1296 u32[5] swctrlmap_2g {
1297         srom 10 u32[4] 0x1B8, u16 0x1C8
1298 }
1299
1300 u16 tssifloor2g {
1301         srom >= 11      0xBE (&0x3FF)
1302 }
1303 u16[4] tssifloor5g {
1304         srom >= 11      0xC0 (&0x3FF)
1305 }
1306
1307 u8 txidxcap2g {
1308         srom >= 11      u16 0x1A8 (&0xFF0, >>4)
1309 }
1310 u8 txidxcap5g {
1311         srom >= 11      u16 0x1AC (&0xFF0, >>4)
1312 }
1313
1314 #
1315 # Any variables defined within a `struct` block will be interpreted relative to
1316 # the provided array of SPROM base addresses; this is used to define
1317 # a common layout defined at the given base addresses.
1318 #
1319 # To produce SPROM variable names matching those used in the Broadcom HND
1320 # ASCII 'key=value\0' NVRAM, the index number of the variable's
1321 # struct instance will be appended (e.g., given a variable of noiselvl5ga, the
1322 # generated variable instances will be named noiselvl5ga0, noiselvl5ga1,
1323 # noiselvl5ga2, noiselvl5ga3 ...)
1324 #
1325
1326 # PHY chain[0-4] parameters
1327 struct phy_chains[] {
1328         srom 4-7        [0x080, 0x0AE, 0x0DC, 0x10A]
1329         srom 8-10       [0x0C0, 0x0E0, 0x100, 0x120]
1330         srom >= 11      [0x0D8, 0x100, 0x128]
1331
1332         # AC-PHY PA parameters
1333         u8[4] maxp5ga {
1334                 srom 4-7        u8 0xB
1335                 srom 8-10       u8 0x9
1336                 srom >= 11      u8 0xD, u8 0xC, u8 0xF, u8 0xE
1337         }
1338         u16[3] pa2ga {
1339                 srom >= 11      0x2
1340         }
1341         u8 maxp2ga {
1342                 srom 4-7        0x1
1343                 srom 8-10       0x1
1344                 srom >= 11      0x1
1345         }
1346         u16[12] pa5ga {
1347                 srom >= 11      0x10
1348         }       
1349
1350         # AC-PHY rxgains
1351         u8 rxgains5ghtrelnabypa {
1352                 srom >= 11      0x8 (&0x80, >>7)
1353         }
1354         u8 rxgains5ghelnagaina {
1355                 srom >= 11      0x8 (&0x7)
1356         }
1357         u8 rxgains5gelnagaina {
1358                 srom >= 11      0xA (&0x7)
1359         }
1360         u8 rxgains5gmtrelnabypa {
1361                 srom >= 11      0x9 (&0x80, >>7)
1362         }
1363         u8 rxgains2gtrelnabypa {
1364                 srom >= 11      0xB (&0x80, >>7)
1365         }
1366         u8 rxgains5gmtrisoa {
1367                 srom >= 11      0x9 (&0x78, >>3)
1368         }
1369         u8 rxgains5gmelnagaina {
1370                 srom >= 11      0x9 (&0x7)
1371         }
1372         u8 rxgains2gelnagaina {
1373                 srom >= 11      0xB (&0x7)
1374         }
1375         u8 rxgains5gtrisoa {
1376                 srom >= 11      0xA (&0x78, >>3)
1377         }
1378         u8 rxgains5gtrelnabypa {
1379                 srom >= 11      0xA (&0x80, >>7)
1380         }
1381         u8 rxgains2gtrisoa {
1382                 srom >= 11      0xB (&0x78, >>3)
1383         }
1384         u8 rxgains5ghtrisoa {
1385                 srom >= 11      0x8 (&0x78, >>3)
1386         }
1387
1388         # 11n PA parameters
1389         u16 pa5gw2a {
1390                 srom 4-7        0x12
1391                 srom 8-10       0x10
1392         }
1393         u16 pa5ghw1a {
1394                 srom 4-7        0x20
1395                 srom 8-10       0x1A
1396         }
1397         u16 pa5glw3a {
1398                 srom 4-7        0x1C
1399         }
1400         u16 pa5glw1a {
1401                 srom 4-7        0x18
1402                 srom 8-10       0x14
1403         }
1404         u16 pa5gw1a {
1405                 srom 4-7        0x10
1406                 srom 8-10       0xE
1407         }
1408         u16 pa5glw0a {
1409                 srom 4-7        0x16
1410                 srom 8-10       0x12
1411         }
1412         u16 pa5gw3a {
1413                 srom 4-7        0x14
1414         }
1415         u16 pa5glw2a {
1416                 srom 4-7        0x1A
1417                 srom 8-10       0x16
1418         }
1419         u16 pa5ghw3a {
1420                 srom 4-7        0x24
1421         }
1422         u16 pa5gw0a {
1423                 srom 4-7        0xE
1424                 srom 8-10       0xC
1425         }
1426         u8 maxp5gha {
1427                 srom 4-7        0xD
1428                 srom 8-10       0xB
1429         }
1430         u16 pa5ghw2a {
1431                 srom 4-7        0x22
1432                 srom 8-10       0x1C
1433         }
1434         u16 pa5ghw0a {
1435                 srom 4-7        0x1E
1436                 srom 8-10       0x18
1437         }
1438         u16 pa2gw3a {
1439                 srom 4-7        0x8
1440         }
1441         u16 pa2gw2a {
1442                 srom 4-7        0x6
1443                 srom 8-10       0x6
1444         }
1445         u16 pa2gw1a {
1446                 srom 4-7        0x4
1447                 srom 8-10       0x4
1448         }
1449         u16 pa2gw0a {
1450                 srom 4-7        0x2
1451                 srom 8-10       0x2
1452         }
1453         u8 maxp5gla {
1454                 srom 4-7        0xC
1455                 srom 8-10       0xA
1456         }
1457         u8 itt5ga {
1458                 srom 4-7        0xA
1459                 srom 8-10       0x8
1460         }
1461         u8 itt2ga {
1462                 srom 4-7        0x0
1463                 srom 8-10       0x0
1464         }
1465 }