6056bdf71b0b926a74d11bb5d5d01ed1e8952097
[openwrt/staging/florian.git] /
1 From e754dfcfe37f49c9249152e2e98e58887a4d87c8 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Thu, 2 Apr 2015 12:30:24 +0200
4 Subject: [PATCH] MIPS: BCM47xx: Move filling most of SPROM to the generic
5 function
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 This simplifies code a lot by dropping many per-revision-group
11 functions. There are still some paths left that use uncommon NVRAM read
12 helpers or fill arrays. They will need to be handled in separated patch.
13
14 I've tested this (by printing SPROM content) for regressions on:
15 1) BCM4704 (SPROM revision 2)
16 2) BCM4706 (SPROM revision 8 plus 11 & 9 on extra WiFi cards)
17 The only difference is not reading board_type from SPROM rev 11 which is
18 unsupported and treated as rev 1. This change for rev 1 is expected.
19
20 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
21 Cc: linux-mips@linux-mips.org
22 Cc: Hauke Mehrtens <hauke@hauke-m.de>
23 Cc: Jonas Gorski <jonas.gorski@gmail.com>
24 Patchwork: https://patchwork.linux-mips.org/patch/9660/
25 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
26 ---
27 arch/mips/bcm47xx/sprom.c | 605 ++++++++++++++++------------------------------
28 1 file changed, 204 insertions(+), 401 deletions(-)
29
30 diff --git a/arch/mips/bcm47xx/sprom.c b/arch/mips/bcm47xx/sprom.c
31 index 77790c9..68ebf23 100644
32 --- a/arch/mips/bcm47xx/sprom.c
33 +++ b/arch/mips/bcm47xx/sprom.c
34 @@ -201,9 +201,211 @@ static void bcm47xx_sprom_fill_auto(struct ssb_sprom *sprom,
35 bool fb = fallback;
36
37 ENTRY(0xfffffffe, u16, pre, "boardrev", board_rev, 0, true);
38 + ENTRY(0x00000002, u16, pre, "boardflags", boardflags_lo, 0, fb);
39 + ENTRY(0xfffffffc, u16, pre, "boardtype", board_type, 0, true);
40 ENTRY(0xfffffffe, u16, pre, "boardnum", board_num, 0, fb);
41 -
42 - /* TODO: Move more mappings here */
43 + ENTRY(0x00000002, u8, pre, "cc", country_code, 0, fb);
44 + ENTRY(0xfffffff8, u8, pre, "regrev", regrev, 0, fb);
45 +
46 + ENTRY(0xfffffffe, u8, pre, "ledbh0", gpio0, 0xff, fb);
47 + ENTRY(0xfffffffe, u8, pre, "ledbh1", gpio1, 0xff, fb);
48 + ENTRY(0xfffffffe, u8, pre, "ledbh2", gpio2, 0xff, fb);
49 + ENTRY(0xfffffffe, u8, pre, "ledbh3", gpio3, 0xff, fb);
50 +
51 + ENTRY(0x0000070e, u16, pre, "pa0b0", pa0b0, 0, fb);
52 + ENTRY(0x0000070e, u16, pre, "pa0b1", pa0b1, 0, fb);
53 + ENTRY(0x0000070e, u16, pre, "pa0b2", pa0b2, 0, fb);
54 + ENTRY(0x0000070e, u8, pre, "pa0itssit", itssi_bg, 0, fb);
55 + ENTRY(0x0000070e, u8, pre, "pa0maxpwr", maxpwr_bg, 0, fb);
56 +
57 + ENTRY(0x0000070c, u8, pre, "opo", opo, 0, fb);
58 + ENTRY(0xfffffffe, u8, pre, "aa2g", ant_available_bg, 0, fb);
59 + ENTRY(0xfffffffe, u8, pre, "aa5g", ant_available_a, 0, fb);
60 + ENTRY(0x000007fe, s8, pre, "ag0", antenna_gain.a0, 0, fb);
61 + ENTRY(0x000007fe, s8, pre, "ag1", antenna_gain.a1, 0, fb);
62 + ENTRY(0x000007f0, s8, pre, "ag2", antenna_gain.a2, 0, fb);
63 + ENTRY(0x000007f0, s8, pre, "ag3", antenna_gain.a3, 0, fb);
64 +
65 + ENTRY(0x0000070e, u16, pre, "pa1b0", pa1b0, 0, fb);
66 + ENTRY(0x0000070e, u16, pre, "pa1b1", pa1b1, 0, fb);
67 + ENTRY(0x0000070e, u16, pre, "pa1b2", pa1b2, 0, fb);
68 + ENTRY(0x0000070c, u16, pre, "pa1lob0", pa1lob0, 0, fb);
69 + ENTRY(0x0000070c, u16, pre, "pa1lob1", pa1lob1, 0, fb);
70 + ENTRY(0x0000070c, u16, pre, "pa1lob2", pa1lob2, 0, fb);
71 + ENTRY(0x0000070c, u16, pre, "pa1hib0", pa1hib0, 0, fb);
72 + ENTRY(0x0000070c, u16, pre, "pa1hib1", pa1hib1, 0, fb);
73 + ENTRY(0x0000070c, u16, pre, "pa1hib2", pa1hib2, 0, fb);
74 + ENTRY(0x0000070e, u8, pre, "pa1itssit", itssi_a, 0, fb);
75 + ENTRY(0x0000070e, u8, pre, "pa1maxpwr", maxpwr_a, 0, fb);
76 + ENTRY(0x0000070c, u8, pre, "pa1lomaxpwr", maxpwr_al, 0, fb);
77 + ENTRY(0x0000070c, u8, pre, "pa1himaxpwr", maxpwr_ah, 0, fb);
78 +
79 + ENTRY(0x00000708, u8, pre, "bxa2g", bxa2g, 0, fb);
80 + ENTRY(0x00000708, u8, pre, "rssisav2g", rssisav2g, 0, fb);
81 + ENTRY(0x00000708, u8, pre, "rssismc2g", rssismc2g, 0, fb);
82 + ENTRY(0x00000708, u8, pre, "rssismf2g", rssismf2g, 0, fb);
83 + ENTRY(0x00000708, u8, pre, "bxa5g", bxa5g, 0, fb);
84 + ENTRY(0x00000708, u8, pre, "rssisav5g", rssisav5g, 0, fb);
85 + ENTRY(0x00000708, u8, pre, "rssismc5g", rssismc5g, 0, fb);
86 + ENTRY(0x00000708, u8, pre, "rssismf5g", rssismf5g, 0, fb);
87 + ENTRY(0x00000708, u8, pre, "tri2g", tri2g, 0, fb);
88 + ENTRY(0x00000708, u8, pre, "tri5g", tri5g, 0, fb);
89 + ENTRY(0x00000708, u8, pre, "tri5gl", tri5gl, 0, fb);
90 + ENTRY(0x00000708, u8, pre, "tri5gh", tri5gh, 0, fb);
91 + ENTRY(0x00000708, s8, pre, "rxpo2g", rxpo2g, 0, fb);
92 + ENTRY(0x00000708, s8, pre, "rxpo5g", rxpo5g, 0, fb);
93 + ENTRY(0xfffffff0, u8, pre, "txchain", txchain, 0xf, fb);
94 + ENTRY(0xfffffff0, u8, pre, "rxchain", rxchain, 0xf, fb);
95 + ENTRY(0xfffffff0, u8, pre, "antswitch", antswitch, 0xff, fb);
96 + ENTRY(0x00000700, u8, pre, "tssipos2g", fem.ghz2.tssipos, 0, fb);
97 + ENTRY(0x00000700, u8, pre, "extpagain2g", fem.ghz2.extpa_gain, 0, fb);
98 + ENTRY(0x00000700, u8, pre, "pdetrange2g", fem.ghz2.pdet_range, 0, fb);
99 + ENTRY(0x00000700, u8, pre, "triso2g", fem.ghz2.tr_iso, 0, fb);
100 + ENTRY(0x00000700, u8, pre, "antswctl2g", fem.ghz2.antswlut, 0, fb);
101 + ENTRY(0x00000700, u8, pre, "tssipos5g", fem.ghz5.tssipos, 0, fb);
102 + ENTRY(0x00000700, u8, pre, "extpagain5g", fem.ghz5.extpa_gain, 0, fb);
103 + ENTRY(0x00000700, u8, pre, "pdetrange5g", fem.ghz5.pdet_range, 0, fb);
104 + ENTRY(0x00000700, u8, pre, "triso5g", fem.ghz5.tr_iso, 0, fb);
105 + ENTRY(0x00000700, u8, pre, "antswctl5g", fem.ghz5.antswlut, 0, fb);
106 + ENTRY(0x000000f0, u8, pre, "txpid2ga0", txpid2g[0], 0, fb);
107 + ENTRY(0x000000f0, u8, pre, "txpid2ga1", txpid2g[1], 0, fb);
108 + ENTRY(0x000000f0, u8, pre, "txpid2ga2", txpid2g[2], 0, fb);
109 + ENTRY(0x000000f0, u8, pre, "txpid2ga3", txpid2g[3], 0, fb);
110 + ENTRY(0x000000f0, u8, pre, "txpid5ga0", txpid5g[0], 0, fb);
111 + ENTRY(0x000000f0, u8, pre, "txpid5ga1", txpid5g[1], 0, fb);
112 + ENTRY(0x000000f0, u8, pre, "txpid5ga2", txpid5g[2], 0, fb);
113 + ENTRY(0x000000f0, u8, pre, "txpid5ga3", txpid5g[3], 0, fb);
114 + ENTRY(0x000000f0, u8, pre, "txpid5gla0", txpid5gl[0], 0, fb);
115 + ENTRY(0x000000f0, u8, pre, "txpid5gla1", txpid5gl[1], 0, fb);
116 + ENTRY(0x000000f0, u8, pre, "txpid5gla2", txpid5gl[2], 0, fb);
117 + ENTRY(0x000000f0, u8, pre, "txpid5gla3", txpid5gl[3], 0, fb);
118 + ENTRY(0x000000f0, u8, pre, "txpid5gha0", txpid5gh[0], 0, fb);
119 + ENTRY(0x000000f0, u8, pre, "txpid5gha1", txpid5gh[1], 0, fb);
120 + ENTRY(0x000000f0, u8, pre, "txpid5gha2", txpid5gh[2], 0, fb);
121 + ENTRY(0x000000f0, u8, pre, "txpid5gha3", txpid5gh[3], 0, fb);
122 +
123 + ENTRY(0xffffff00, u8, pre, "tempthresh", tempthresh, 0, fb);
124 + ENTRY(0xffffff00, u8, pre, "tempoffset", tempoffset, 0, fb);
125 + ENTRY(0xffffff00, u16, pre, "rawtempsense", rawtempsense, 0, fb);
126 + ENTRY(0xffffff00, u8, pre, "measpower", measpower, 0, fb);
127 + ENTRY(0xffffff00, u8, pre, "tempsense_slope", tempsense_slope, 0, fb);
128 + ENTRY(0xffffff00, u8, pre, "tempcorrx", tempcorrx, 0, fb);
129 + ENTRY(0xffffff00, u8, pre, "tempsense_option", tempsense_option, 0, fb);
130 + ENTRY(0x00000700, u8, pre, "freqoffset_corr", freqoffset_corr, 0, fb);
131 + ENTRY(0x00000700, u8, pre, "iqcal_swp_dis", iqcal_swp_dis, 0, fb);
132 + ENTRY(0x00000700, u8, pre, "hw_iqcal_en", hw_iqcal_en, 0, fb);
133 + ENTRY(0x00000700, u8, pre, "elna2g", elna2g, 0, fb);
134 + ENTRY(0x00000700, u8, pre, "elna5g", elna5g, 0, fb);
135 + ENTRY(0xffffff00, u8, pre, "phycal_tempdelta", phycal_tempdelta, 0, fb);
136 + ENTRY(0xffffff00, u8, pre, "temps_period", temps_period, 0, fb);
137 + ENTRY(0xffffff00, u8, pre, "temps_hysteresis", temps_hysteresis, 0, fb);
138 + ENTRY(0xffffff00, u8, pre, "measpower1", measpower1, 0, fb);
139 + ENTRY(0xffffff00, u8, pre, "measpower2", measpower2, 0, fb);
140 +
141 + ENTRY(0x000001f0, u16, pre, "cck2gpo", cck2gpo, 0, fb);
142 + ENTRY(0x000001f0, u32, pre, "ofdm2gpo", ofdm2gpo, 0, fb);
143 + ENTRY(0x000001f0, u32, pre, "ofdm5gpo", ofdm5gpo, 0, fb);
144 + ENTRY(0x000001f0, u32, pre, "ofdm5glpo", ofdm5glpo, 0, fb);
145 + ENTRY(0x000001f0, u32, pre, "ofdm5ghpo", ofdm5ghpo, 0, fb);
146 + ENTRY(0x000001f0, u16, pre, "mcs2gpo0", mcs2gpo[0], 0, fb);
147 + ENTRY(0x000001f0, u16, pre, "mcs2gpo1", mcs2gpo[1], 0, fb);
148 + ENTRY(0x000001f0, u16, pre, "mcs2gpo2", mcs2gpo[2], 0, fb);
149 + ENTRY(0x000001f0, u16, pre, "mcs2gpo3", mcs2gpo[3], 0, fb);
150 + ENTRY(0x000001f0, u16, pre, "mcs2gpo4", mcs2gpo[4], 0, fb);
151 + ENTRY(0x000001f0, u16, pre, "mcs2gpo5", mcs2gpo[5], 0, fb);
152 + ENTRY(0x000001f0, u16, pre, "mcs2gpo6", mcs2gpo[6], 0, fb);
153 + ENTRY(0x000001f0, u16, pre, "mcs2gpo7", mcs2gpo[7], 0, fb);
154 + ENTRY(0x000001f0, u16, pre, "mcs5gpo0", mcs5gpo[0], 0, fb);
155 + ENTRY(0x000001f0, u16, pre, "mcs5gpo1", mcs5gpo[1], 0, fb);
156 + ENTRY(0x000001f0, u16, pre, "mcs5gpo2", mcs5gpo[2], 0, fb);
157 + ENTRY(0x000001f0, u16, pre, "mcs5gpo3", mcs5gpo[3], 0, fb);
158 + ENTRY(0x000001f0, u16, pre, "mcs5gpo4", mcs5gpo[4], 0, fb);
159 + ENTRY(0x000001f0, u16, pre, "mcs5gpo5", mcs5gpo[5], 0, fb);
160 + ENTRY(0x000001f0, u16, pre, "mcs5gpo6", mcs5gpo[6], 0, fb);
161 + ENTRY(0x000001f0, u16, pre, "mcs5gpo7", mcs5gpo[7], 0, fb);
162 + ENTRY(0x000001f0, u16, pre, "mcs5glpo0", mcs5glpo[0], 0, fb);
163 + ENTRY(0x000001f0, u16, pre, "mcs5glpo1", mcs5glpo[1], 0, fb);
164 + ENTRY(0x000001f0, u16, pre, "mcs5glpo2", mcs5glpo[2], 0, fb);
165 + ENTRY(0x000001f0, u16, pre, "mcs5glpo3", mcs5glpo[3], 0, fb);
166 + ENTRY(0x000001f0, u16, pre, "mcs5glpo4", mcs5glpo[4], 0, fb);
167 + ENTRY(0x000001f0, u16, pre, "mcs5glpo5", mcs5glpo[5], 0, fb);
168 + ENTRY(0x000001f0, u16, pre, "mcs5glpo6", mcs5glpo[6], 0, fb);
169 + ENTRY(0x000001f0, u16, pre, "mcs5glpo7", mcs5glpo[7], 0, fb);
170 + ENTRY(0x000001f0, u16, pre, "mcs5ghpo0", mcs5ghpo[0], 0, fb);
171 + ENTRY(0x000001f0, u16, pre, "mcs5ghpo1", mcs5ghpo[1], 0, fb);
172 + ENTRY(0x000001f0, u16, pre, "mcs5ghpo2", mcs5ghpo[2], 0, fb);
173 + ENTRY(0x000001f0, u16, pre, "mcs5ghpo3", mcs5ghpo[3], 0, fb);
174 + ENTRY(0x000001f0, u16, pre, "mcs5ghpo4", mcs5ghpo[4], 0, fb);
175 + ENTRY(0x000001f0, u16, pre, "mcs5ghpo5", mcs5ghpo[5], 0, fb);
176 + ENTRY(0x000001f0, u16, pre, "mcs5ghpo6", mcs5ghpo[6], 0, fb);
177 + ENTRY(0x000001f0, u16, pre, "mcs5ghpo7", mcs5ghpo[7], 0, fb);
178 + ENTRY(0x000001f0, u16, pre, "cddpo", cddpo, 0, fb);
179 + ENTRY(0x000001f0, u16, pre, "stbcpo", stbcpo, 0, fb);
180 + ENTRY(0x000001f0, u16, pre, "bw40po", bw40po, 0, fb);
181 + ENTRY(0x000001f0, u16, pre, "bwduppo", bwduppo, 0, fb);
182 +
183 + ENTRY(0xfffffe00, u16, pre, "cckbw202gpo", cckbw202gpo, 0, fb);
184 + ENTRY(0xfffffe00, u16, pre, "cckbw20ul2gpo", cckbw20ul2gpo, 0, fb);
185 + ENTRY(0x00000600, u32, pre, "legofdmbw202gpo", legofdmbw202gpo, 0, fb);
186 + ENTRY(0x00000600, u32, pre, "legofdmbw20ul2gpo", legofdmbw20ul2gpo, 0, fb);
187 + ENTRY(0x00000600, u32, pre, "legofdmbw205glpo", legofdmbw205glpo, 0, fb);
188 + ENTRY(0x00000600, u32, pre, "legofdmbw20ul5glpo", legofdmbw20ul5glpo, 0, fb);
189 + ENTRY(0x00000600, u32, pre, "legofdmbw205gmpo", legofdmbw205gmpo, 0, fb);
190 + ENTRY(0x00000600, u32, pre, "legofdmbw20ul5gmpo", legofdmbw20ul5gmpo, 0, fb);
191 + ENTRY(0x00000600, u32, pre, "legofdmbw205ghpo", legofdmbw205ghpo, 0, fb);
192 + ENTRY(0x00000600, u32, pre, "legofdmbw20ul5ghpo", legofdmbw20ul5ghpo, 0, fb);
193 + ENTRY(0xfffffe00, u32, pre, "mcsbw202gpo", mcsbw202gpo, 0, fb);
194 + ENTRY(0x00000600, u32, pre, "mcsbw20ul2gpo", mcsbw20ul2gpo, 0, fb);
195 + ENTRY(0xfffffe00, u32, pre, "mcsbw402gpo", mcsbw402gpo, 0, fb);
196 + ENTRY(0xfffffe00, u32, pre, "mcsbw205glpo", mcsbw205glpo, 0, fb);
197 + ENTRY(0x00000600, u32, pre, "mcsbw20ul5glpo", mcsbw20ul5glpo, 0, fb);
198 + ENTRY(0xfffffe00, u32, pre, "mcsbw405glpo", mcsbw405glpo, 0, fb);
199 + ENTRY(0xfffffe00, u32, pre, "mcsbw205gmpo", mcsbw205gmpo, 0, fb);
200 + ENTRY(0x00000600, u32, pre, "mcsbw20ul5gmpo", mcsbw20ul5gmpo, 0, fb);
201 + ENTRY(0xfffffe00, u32, pre, "mcsbw405gmpo", mcsbw405gmpo, 0, fb);
202 + ENTRY(0xfffffe00, u32, pre, "mcsbw205ghpo", mcsbw205ghpo, 0, fb);
203 + ENTRY(0x00000600, u32, pre, "mcsbw20ul5ghpo", mcsbw20ul5ghpo, 0, fb);
204 + ENTRY(0xfffffe00, u32, pre, "mcsbw405ghpo", mcsbw405ghpo, 0, fb);
205 + ENTRY(0x00000600, u16, pre, "mcs32po", mcs32po, 0, fb);
206 + ENTRY(0x00000600, u16, pre, "legofdm40duppo", legofdm40duppo, 0, fb);
207 + ENTRY(0x00000700, u8, pre, "pcieingress_war", pcieingress_war, 0, fb);
208 +
209 + /* TODO: rev 11 support */
210 + ENTRY(0x00000700, u8, pre, "rxgainerr2ga0", rxgainerr2ga[0], 0, fb);
211 + ENTRY(0x00000700, u8, pre, "rxgainerr2ga1", rxgainerr2ga[1], 0, fb);
212 + ENTRY(0x00000700, u8, pre, "rxgainerr2ga2", rxgainerr2ga[2], 0, fb);
213 + ENTRY(0x00000700, u8, pre, "rxgainerr5gla0", rxgainerr5gla[0], 0, fb);
214 + ENTRY(0x00000700, u8, pre, "rxgainerr5gla1", rxgainerr5gla[1], 0, fb);
215 + ENTRY(0x00000700, u8, pre, "rxgainerr5gla2", rxgainerr5gla[2], 0, fb);
216 + ENTRY(0x00000700, u8, pre, "rxgainerr5gma0", rxgainerr5gma[0], 0, fb);
217 + ENTRY(0x00000700, u8, pre, "rxgainerr5gma1", rxgainerr5gma[1], 0, fb);
218 + ENTRY(0x00000700, u8, pre, "rxgainerr5gma2", rxgainerr5gma[2], 0, fb);
219 + ENTRY(0x00000700, u8, pre, "rxgainerr5gha0", rxgainerr5gha[0], 0, fb);
220 + ENTRY(0x00000700, u8, pre, "rxgainerr5gha1", rxgainerr5gha[1], 0, fb);
221 + ENTRY(0x00000700, u8, pre, "rxgainerr5gha2", rxgainerr5gha[2], 0, fb);
222 + ENTRY(0x00000700, u8, pre, "rxgainerr5gua0", rxgainerr5gua[0], 0, fb);
223 + ENTRY(0x00000700, u8, pre, "rxgainerr5gua1", rxgainerr5gua[1], 0, fb);
224 + ENTRY(0x00000700, u8, pre, "rxgainerr5gua2", rxgainerr5gua[2], 0, fb);
225 +
226 + ENTRY(0xfffffe00, u8, pre, "sar2g", sar2g, 0, fb);
227 + ENTRY(0xfffffe00, u8, pre, "sar5g", sar5g, 0, fb);
228 +
229 + /* TODO: rev 11 support */
230 + ENTRY(0x00000700, u8, pre, "noiselvl2ga0", noiselvl2ga[0], 0, fb);
231 + ENTRY(0x00000700, u8, pre, "noiselvl2ga1", noiselvl2ga[1], 0, fb);
232 + ENTRY(0x00000700, u8, pre, "noiselvl2ga2", noiselvl2ga[2], 0, fb);
233 + ENTRY(0x00000700, u8, pre, "noiselvl5gla0", noiselvl5gla[0], 0, fb);
234 + ENTRY(0x00000700, u8, pre, "noiselvl5gla1", noiselvl5gla[1], 0, fb);
235 + ENTRY(0x00000700, u8, pre, "noiselvl5gla2", noiselvl5gla[2], 0, fb);
236 + ENTRY(0x00000700, u8, pre, "noiselvl5gma0", noiselvl5gma[0], 0, fb);
237 + ENTRY(0x00000700, u8, pre, "noiselvl5gma1", noiselvl5gma[1], 0, fb);
238 + ENTRY(0x00000700, u8, pre, "noiselvl5gma2", noiselvl5gma[2], 0, fb);
239 + ENTRY(0x00000700, u8, pre, "noiselvl5gha0", noiselvl5gha[0], 0, fb);
240 + ENTRY(0x00000700, u8, pre, "noiselvl5gha1", noiselvl5gha[1], 0, fb);
241 + ENTRY(0x00000700, u8, pre, "noiselvl5gha2", noiselvl5gha[2], 0, fb);
242 + ENTRY(0x00000700, u8, pre, "noiselvl5gua0", noiselvl5gua[0], 0, fb);
243 + ENTRY(0x00000700, u8, pre, "noiselvl5gua1", noiselvl5gua[1], 0, fb);
244 + ENTRY(0x00000700, u8, pre, "noiselvl5gua2", noiselvl5gua[2], 0, fb);
245 }
246 #undef ENTRY /* It's specififc, uses local variable, don't use it (again). */
247
248 @@ -211,90 +413,12 @@ static void bcm47xx_fill_sprom_r1234589(struct ssb_sprom *sprom,
249 const char *prefix, bool fallback)
250 {
251 nvram_read_u16(prefix, NULL, "devid", &sprom->dev_id, 0, fallback);
252 - nvram_read_u8(prefix, NULL, "ledbh0", &sprom->gpio0, 0xff, fallback);
253 - nvram_read_u8(prefix, NULL, "ledbh1", &sprom->gpio1, 0xff, fallback);
254 - nvram_read_u8(prefix, NULL, "ledbh2", &sprom->gpio2, 0xff, fallback);
255 - nvram_read_u8(prefix, NULL, "ledbh3", &sprom->gpio3, 0xff, fallback);
256 - nvram_read_u8(prefix, NULL, "aa2g", &sprom->ant_available_bg, 0,
257 - fallback);
258 - nvram_read_u8(prefix, NULL, "aa5g", &sprom->ant_available_a, 0,
259 - fallback);
260 - nvram_read_s8(prefix, NULL, "ag0", &sprom->antenna_gain.a0, 0,
261 - fallback);
262 - nvram_read_s8(prefix, NULL, "ag1", &sprom->antenna_gain.a1, 0,
263 - fallback);
264 nvram_read_alpha2(prefix, "ccode", sprom->alpha2, fallback);
265 }
266
267 -static void bcm47xx_fill_sprom_r12389(struct ssb_sprom *sprom,
268 - const char *prefix, bool fallback)
269 -{
270 - nvram_read_u16(prefix, NULL, "pa0b0", &sprom->pa0b0, 0, fallback);
271 - nvram_read_u16(prefix, NULL, "pa0b1", &sprom->pa0b1, 0, fallback);
272 - nvram_read_u16(prefix, NULL, "pa0b2", &sprom->pa0b2, 0, fallback);
273 - nvram_read_u8(prefix, NULL, "pa0itssit", &sprom->itssi_bg, 0, fallback);
274 - nvram_read_u8(prefix, NULL, "pa0maxpwr", &sprom->maxpwr_bg, 0,
275 - fallback);
276 - nvram_read_u16(prefix, NULL, "pa1b0", &sprom->pa1b0, 0, fallback);
277 - nvram_read_u16(prefix, NULL, "pa1b1", &sprom->pa1b1, 0, fallback);
278 - nvram_read_u16(prefix, NULL, "pa1b2", &sprom->pa1b2, 0, fallback);
279 - nvram_read_u8(prefix, NULL, "pa1itssit", &sprom->itssi_a, 0, fallback);
280 - nvram_read_u8(prefix, NULL, "pa1maxpwr", &sprom->maxpwr_a, 0, fallback);
281 -}
282 -
283 -static void bcm47xx_fill_sprom_r1(struct ssb_sprom *sprom, const char *prefix,
284 - bool fallback)
285 -{
286 - nvram_read_u16(prefix, NULL, "boardflags", &sprom->boardflags_lo, 0,
287 - fallback);
288 - nvram_read_u8(prefix, NULL, "cc", &sprom->country_code, 0, fallback);
289 -}
290 -
291 -static void bcm47xx_fill_sprom_r2389(struct ssb_sprom *sprom,
292 - const char *prefix, bool fallback)
293 -{
294 - nvram_read_u8(prefix, NULL, "opo", &sprom->opo, 0, fallback);
295 - nvram_read_u16(prefix, NULL, "pa1lob0", &sprom->pa1lob0, 0, fallback);
296 - nvram_read_u16(prefix, NULL, "pa1lob1", &sprom->pa1lob1, 0, fallback);
297 - nvram_read_u16(prefix, NULL, "pa1lob2", &sprom->pa1lob2, 0, fallback);
298 - nvram_read_u16(prefix, NULL, "pa1hib0", &sprom->pa1hib0, 0, fallback);
299 - nvram_read_u16(prefix, NULL, "pa1hib1", &sprom->pa1hib1, 0, fallback);
300 - nvram_read_u16(prefix, NULL, "pa1hib2", &sprom->pa1hib2, 0, fallback);
301 - nvram_read_u8(prefix, NULL, "pa1lomaxpwr", &sprom->maxpwr_al, 0,
302 - fallback);
303 - nvram_read_u8(prefix, NULL, "pa1himaxpwr", &sprom->maxpwr_ah, 0,
304 - fallback);
305 -}
306 -
307 -static void bcm47xx_fill_sprom_r389(struct ssb_sprom *sprom, const char *prefix,
308 - bool fallback)
309 -{
310 - nvram_read_u8(prefix, NULL, "bxa2g", &sprom->bxa2g, 0, fallback);
311 - nvram_read_u8(prefix, NULL, "rssisav2g", &sprom->rssisav2g, 0,
312 - fallback);
313 - nvram_read_u8(prefix, NULL, "rssismc2g", &sprom->rssismc2g, 0,
314 - fallback);
315 - nvram_read_u8(prefix, NULL, "rssismf2g", &sprom->rssismf2g, 0,
316 - fallback);
317 - nvram_read_u8(prefix, NULL, "bxa5g", &sprom->bxa5g, 0, fallback);
318 - nvram_read_u8(prefix, NULL, "rssisav5g", &sprom->rssisav5g, 0,
319 - fallback);
320 - nvram_read_u8(prefix, NULL, "rssismc5g", &sprom->rssismc5g, 0,
321 - fallback);
322 - nvram_read_u8(prefix, NULL, "rssismf5g", &sprom->rssismf5g, 0,
323 - fallback);
324 - nvram_read_u8(prefix, NULL, "tri2g", &sprom->tri2g, 0, fallback);
325 - nvram_read_u8(prefix, NULL, "tri5g", &sprom->tri5g, 0, fallback);
326 - nvram_read_u8(prefix, NULL, "tri5gl", &sprom->tri5gl, 0, fallback);
327 - nvram_read_u8(prefix, NULL, "tri5gh", &sprom->tri5gh, 0, fallback);
328 - nvram_read_s8(prefix, NULL, "rxpo2g", &sprom->rxpo2g, 0, fallback);
329 - nvram_read_s8(prefix, NULL, "rxpo5g", &sprom->rxpo5g, 0, fallback);
330 -}
331 -
332 static void bcm47xx_fill_sprom_r3(struct ssb_sprom *sprom, const char *prefix,
333 bool fallback)
334 {
335 - nvram_read_u8(prefix, NULL, "regrev", &sprom->regrev, 0, fallback);
336 nvram_read_leddc(prefix, "leddc", &sprom->leddc_on_time,
337 &sprom->leddc_off_time, fallback);
338 }
339 @@ -302,309 +426,10 @@ static void bcm47xx_fill_sprom_r3(struct ssb_sprom *sprom, const char *prefix,
340 static void bcm47xx_fill_sprom_r4589(struct ssb_sprom *sprom,
341 const char *prefix, bool fallback)
342 {
343 - nvram_read_u8(prefix, NULL, "regrev", &sprom->regrev, 0, fallback);
344 - nvram_read_s8(prefix, NULL, "ag2", &sprom->antenna_gain.a2, 0,
345 - fallback);
346 - nvram_read_s8(prefix, NULL, "ag3", &sprom->antenna_gain.a3, 0,
347 - fallback);
348 - nvram_read_u8(prefix, NULL, "txchain", &sprom->txchain, 0xf, fallback);
349 - nvram_read_u8(prefix, NULL, "rxchain", &sprom->rxchain, 0xf, fallback);
350 - nvram_read_u8(prefix, NULL, "antswitch", &sprom->antswitch, 0xff,
351 - fallback);
352 nvram_read_leddc(prefix, "leddc", &sprom->leddc_on_time,
353 &sprom->leddc_off_time, fallback);
354 }
355
356 -static void bcm47xx_fill_sprom_r458(struct ssb_sprom *sprom, const char *prefix,
357 - bool fallback)
358 -{
359 - nvram_read_u16(prefix, NULL, "cck2gpo", &sprom->cck2gpo, 0, fallback);
360 - nvram_read_u32(prefix, NULL, "ofdm2gpo", &sprom->ofdm2gpo, 0, fallback);
361 - nvram_read_u32(prefix, NULL, "ofdm5gpo", &sprom->ofdm5gpo, 0, fallback);
362 - nvram_read_u32(prefix, NULL, "ofdm5glpo", &sprom->ofdm5glpo, 0,
363 - fallback);
364 - nvram_read_u32(prefix, NULL, "ofdm5ghpo", &sprom->ofdm5ghpo, 0,
365 - fallback);
366 - nvram_read_u16(prefix, NULL, "cddpo", &sprom->cddpo, 0, fallback);
367 - nvram_read_u16(prefix, NULL, "stbcpo", &sprom->stbcpo, 0, fallback);
368 - nvram_read_u16(prefix, NULL, "bw40po", &sprom->bw40po, 0, fallback);
369 - nvram_read_u16(prefix, NULL, "bwduppo", &sprom->bwduppo, 0, fallback);
370 - nvram_read_u16(prefix, NULL, "mcs2gpo0", &sprom->mcs2gpo[0], 0,
371 - fallback);
372 - nvram_read_u16(prefix, NULL, "mcs2gpo1", &sprom->mcs2gpo[1], 0,
373 - fallback);
374 - nvram_read_u16(prefix, NULL, "mcs2gpo2", &sprom->mcs2gpo[2], 0,
375 - fallback);
376 - nvram_read_u16(prefix, NULL, "mcs2gpo3", &sprom->mcs2gpo[3], 0,
377 - fallback);
378 - nvram_read_u16(prefix, NULL, "mcs2gpo4", &sprom->mcs2gpo[4], 0,
379 - fallback);
380 - nvram_read_u16(prefix, NULL, "mcs2gpo5", &sprom->mcs2gpo[5], 0,
381 - fallback);
382 - nvram_read_u16(prefix, NULL, "mcs2gpo6", &sprom->mcs2gpo[6], 0,
383 - fallback);
384 - nvram_read_u16(prefix, NULL, "mcs2gpo7", &sprom->mcs2gpo[7], 0,
385 - fallback);
386 - nvram_read_u16(prefix, NULL, "mcs5gpo0", &sprom->mcs5gpo[0], 0,
387 - fallback);
388 - nvram_read_u16(prefix, NULL, "mcs5gpo1", &sprom->mcs5gpo[1], 0,
389 - fallback);
390 - nvram_read_u16(prefix, NULL, "mcs5gpo2", &sprom->mcs5gpo[2], 0,
391 - fallback);
392 - nvram_read_u16(prefix, NULL, "mcs5gpo3", &sprom->mcs5gpo[3], 0,
393 - fallback);
394 - nvram_read_u16(prefix, NULL, "mcs5gpo4", &sprom->mcs5gpo[4], 0,
395 - fallback);
396 - nvram_read_u16(prefix, NULL, "mcs5gpo5", &sprom->mcs5gpo[5], 0,
397 - fallback);
398 - nvram_read_u16(prefix, NULL, "mcs5gpo6", &sprom->mcs5gpo[6], 0,
399 - fallback);
400 - nvram_read_u16(prefix, NULL, "mcs5gpo7", &sprom->mcs5gpo[7], 0,
401 - fallback);
402 - nvram_read_u16(prefix, NULL, "mcs5glpo0", &sprom->mcs5glpo[0], 0,
403 - fallback);
404 - nvram_read_u16(prefix, NULL, "mcs5glpo1", &sprom->mcs5glpo[1], 0,
405 - fallback);
406 - nvram_read_u16(prefix, NULL, "mcs5glpo2", &sprom->mcs5glpo[2], 0,
407 - fallback);
408 - nvram_read_u16(prefix, NULL, "mcs5glpo3", &sprom->mcs5glpo[3], 0,
409 - fallback);
410 - nvram_read_u16(prefix, NULL, "mcs5glpo4", &sprom->mcs5glpo[4], 0,
411 - fallback);
412 - nvram_read_u16(prefix, NULL, "mcs5glpo5", &sprom->mcs5glpo[5], 0,
413 - fallback);
414 - nvram_read_u16(prefix, NULL, "mcs5glpo6", &sprom->mcs5glpo[6], 0,
415 - fallback);
416 - nvram_read_u16(prefix, NULL, "mcs5glpo7", &sprom->mcs5glpo[7], 0,
417 - fallback);
418 - nvram_read_u16(prefix, NULL, "mcs5ghpo0", &sprom->mcs5ghpo[0], 0,
419 - fallback);
420 - nvram_read_u16(prefix, NULL, "mcs5ghpo1", &sprom->mcs5ghpo[1], 0,
421 - fallback);
422 - nvram_read_u16(prefix, NULL, "mcs5ghpo2", &sprom->mcs5ghpo[2], 0,
423 - fallback);
424 - nvram_read_u16(prefix, NULL, "mcs5ghpo3", &sprom->mcs5ghpo[3], 0,
425 - fallback);
426 - nvram_read_u16(prefix, NULL, "mcs5ghpo4", &sprom->mcs5ghpo[4], 0,
427 - fallback);
428 - nvram_read_u16(prefix, NULL, "mcs5ghpo5", &sprom->mcs5ghpo[5], 0,
429 - fallback);
430 - nvram_read_u16(prefix, NULL, "mcs5ghpo6", &sprom->mcs5ghpo[6], 0,
431 - fallback);
432 - nvram_read_u16(prefix, NULL, "mcs5ghpo7", &sprom->mcs5ghpo[7], 0,
433 - fallback);
434 -}
435 -
436 -static void bcm47xx_fill_sprom_r45(struct ssb_sprom *sprom, const char *prefix,
437 - bool fallback)
438 -{
439 - nvram_read_u8(prefix, NULL, "txpid2ga0", &sprom->txpid2g[0], 0,
440 - fallback);
441 - nvram_read_u8(prefix, NULL, "txpid2ga1", &sprom->txpid2g[1], 0,
442 - fallback);
443 - nvram_read_u8(prefix, NULL, "txpid2ga2", &sprom->txpid2g[2], 0,
444 - fallback);
445 - nvram_read_u8(prefix, NULL, "txpid2ga3", &sprom->txpid2g[3], 0,
446 - fallback);
447 - nvram_read_u8(prefix, NULL, "txpid5ga0", &sprom->txpid5g[0], 0,
448 - fallback);
449 - nvram_read_u8(prefix, NULL, "txpid5ga1", &sprom->txpid5g[1], 0,
450 - fallback);
451 - nvram_read_u8(prefix, NULL, "txpid5ga2", &sprom->txpid5g[2], 0,
452 - fallback);
453 - nvram_read_u8(prefix, NULL, "txpid5ga3", &sprom->txpid5g[3], 0,
454 - fallback);
455 - nvram_read_u8(prefix, NULL, "txpid5gla0", &sprom->txpid5gl[0], 0,
456 - fallback);
457 - nvram_read_u8(prefix, NULL, "txpid5gla1", &sprom->txpid5gl[1], 0,
458 - fallback);
459 - nvram_read_u8(prefix, NULL, "txpid5gla2", &sprom->txpid5gl[2], 0,
460 - fallback);
461 - nvram_read_u8(prefix, NULL, "txpid5gla3", &sprom->txpid5gl[3], 0,
462 - fallback);
463 - nvram_read_u8(prefix, NULL, "txpid5gha0", &sprom->txpid5gh[0], 0,
464 - fallback);
465 - nvram_read_u8(prefix, NULL, "txpid5gha1", &sprom->txpid5gh[1], 0,
466 - fallback);
467 - nvram_read_u8(prefix, NULL, "txpid5gha2", &sprom->txpid5gh[2], 0,
468 - fallback);
469 - nvram_read_u8(prefix, NULL, "txpid5gha3", &sprom->txpid5gh[3], 0,
470 - fallback);
471 -}
472 -
473 -static void bcm47xx_fill_sprom_r89(struct ssb_sprom *sprom, const char *prefix,
474 - bool fallback)
475 -{
476 - nvram_read_u8(prefix, NULL, "tssipos2g", &sprom->fem.ghz2.tssipos, 0,
477 - fallback);
478 - nvram_read_u8(prefix, NULL, "extpagain2g",
479 - &sprom->fem.ghz2.extpa_gain, 0, fallback);
480 - nvram_read_u8(prefix, NULL, "pdetrange2g",
481 - &sprom->fem.ghz2.pdet_range, 0, fallback);
482 - nvram_read_u8(prefix, NULL, "triso2g", &sprom->fem.ghz2.tr_iso, 0,
483 - fallback);
484 - nvram_read_u8(prefix, NULL, "antswctl2g", &sprom->fem.ghz2.antswlut, 0,
485 - fallback);
486 - nvram_read_u8(prefix, NULL, "tssipos5g", &sprom->fem.ghz5.tssipos, 0,
487 - fallback);
488 - nvram_read_u8(prefix, NULL, "extpagain5g",
489 - &sprom->fem.ghz5.extpa_gain, 0, fallback);
490 - nvram_read_u8(prefix, NULL, "pdetrange5g",
491 - &sprom->fem.ghz5.pdet_range, 0, fallback);
492 - nvram_read_u8(prefix, NULL, "triso5g", &sprom->fem.ghz5.tr_iso, 0,
493 - fallback);
494 - nvram_read_u8(prefix, NULL, "antswctl5g", &sprom->fem.ghz5.antswlut, 0,
495 - fallback);
496 - nvram_read_u8(prefix, NULL, "tempthresh", &sprom->tempthresh, 0,
497 - fallback);
498 - nvram_read_u8(prefix, NULL, "tempoffset", &sprom->tempoffset, 0,
499 - fallback);
500 - nvram_read_u16(prefix, NULL, "rawtempsense", &sprom->rawtempsense, 0,
501 - fallback);
502 - nvram_read_u8(prefix, NULL, "measpower", &sprom->measpower, 0,
503 - fallback);
504 - nvram_read_u8(prefix, NULL, "tempsense_slope",
505 - &sprom->tempsense_slope, 0, fallback);
506 - nvram_read_u8(prefix, NULL, "tempcorrx", &sprom->tempcorrx, 0,
507 - fallback);
508 - nvram_read_u8(prefix, NULL, "tempsense_option",
509 - &sprom->tempsense_option, 0, fallback);
510 - nvram_read_u8(prefix, NULL, "freqoffset_corr",
511 - &sprom->freqoffset_corr, 0, fallback);
512 - nvram_read_u8(prefix, NULL, "iqcal_swp_dis", &sprom->iqcal_swp_dis, 0,
513 - fallback);
514 - nvram_read_u8(prefix, NULL, "hw_iqcal_en", &sprom->hw_iqcal_en, 0,
515 - fallback);
516 - nvram_read_u8(prefix, NULL, "elna2g", &sprom->elna2g, 0, fallback);
517 - nvram_read_u8(prefix, NULL, "elna5g", &sprom->elna5g, 0, fallback);
518 - nvram_read_u8(prefix, NULL, "phycal_tempdelta",
519 - &sprom->phycal_tempdelta, 0, fallback);
520 - nvram_read_u8(prefix, NULL, "temps_period", &sprom->temps_period, 0,
521 - fallback);
522 - nvram_read_u8(prefix, NULL, "temps_hysteresis",
523 - &sprom->temps_hysteresis, 0, fallback);
524 - nvram_read_u8(prefix, NULL, "measpower1", &sprom->measpower1, 0,
525 - fallback);
526 - nvram_read_u8(prefix, NULL, "measpower2", &sprom->measpower2, 0,
527 - fallback);
528 - nvram_read_u8(prefix, NULL, "rxgainerr2ga0",
529 - &sprom->rxgainerr2ga[0], 0, fallback);
530 - nvram_read_u8(prefix, NULL, "rxgainerr2ga1",
531 - &sprom->rxgainerr2ga[1], 0, fallback);
532 - nvram_read_u8(prefix, NULL, "rxgainerr2ga2",
533 - &sprom->rxgainerr2ga[2], 0, fallback);
534 - nvram_read_u8(prefix, NULL, "rxgainerr5gla0",
535 - &sprom->rxgainerr5gla[0], 0, fallback);
536 - nvram_read_u8(prefix, NULL, "rxgainerr5gla1",
537 - &sprom->rxgainerr5gla[1], 0, fallback);
538 - nvram_read_u8(prefix, NULL, "rxgainerr5gla2",
539 - &sprom->rxgainerr5gla[2], 0, fallback);
540 - nvram_read_u8(prefix, NULL, "rxgainerr5gma0",
541 - &sprom->rxgainerr5gma[0], 0, fallback);
542 - nvram_read_u8(prefix, NULL, "rxgainerr5gma1",
543 - &sprom->rxgainerr5gma[1], 0, fallback);
544 - nvram_read_u8(prefix, NULL, "rxgainerr5gma2",
545 - &sprom->rxgainerr5gma[2], 0, fallback);
546 - nvram_read_u8(prefix, NULL, "rxgainerr5gha0",
547 - &sprom->rxgainerr5gha[0], 0, fallback);
548 - nvram_read_u8(prefix, NULL, "rxgainerr5gha1",
549 - &sprom->rxgainerr5gha[1], 0, fallback);
550 - nvram_read_u8(prefix, NULL, "rxgainerr5gha2",
551 - &sprom->rxgainerr5gha[2], 0, fallback);
552 - nvram_read_u8(prefix, NULL, "rxgainerr5gua0",
553 - &sprom->rxgainerr5gua[0], 0, fallback);
554 - nvram_read_u8(prefix, NULL, "rxgainerr5gua1",
555 - &sprom->rxgainerr5gua[1], 0, fallback);
556 - nvram_read_u8(prefix, NULL, "rxgainerr5gua2",
557 - &sprom->rxgainerr5gua[2], 0, fallback);
558 - nvram_read_u8(prefix, NULL, "noiselvl2ga0", &sprom->noiselvl2ga[0], 0,
559 - fallback);
560 - nvram_read_u8(prefix, NULL, "noiselvl2ga1", &sprom->noiselvl2ga[1], 0,
561 - fallback);
562 - nvram_read_u8(prefix, NULL, "noiselvl2ga2", &sprom->noiselvl2ga[2], 0,
563 - fallback);
564 - nvram_read_u8(prefix, NULL, "noiselvl5gla0",
565 - &sprom->noiselvl5gla[0], 0, fallback);
566 - nvram_read_u8(prefix, NULL, "noiselvl5gla1",
567 - &sprom->noiselvl5gla[1], 0, fallback);
568 - nvram_read_u8(prefix, NULL, "noiselvl5gla2",
569 - &sprom->noiselvl5gla[2], 0, fallback);
570 - nvram_read_u8(prefix, NULL, "noiselvl5gma0",
571 - &sprom->noiselvl5gma[0], 0, fallback);
572 - nvram_read_u8(prefix, NULL, "noiselvl5gma1",
573 - &sprom->noiselvl5gma[1], 0, fallback);
574 - nvram_read_u8(prefix, NULL, "noiselvl5gma2",
575 - &sprom->noiselvl5gma[2], 0, fallback);
576 - nvram_read_u8(prefix, NULL, "noiselvl5gha0",
577 - &sprom->noiselvl5gha[0], 0, fallback);
578 - nvram_read_u8(prefix, NULL, "noiselvl5gha1",
579 - &sprom->noiselvl5gha[1], 0, fallback);
580 - nvram_read_u8(prefix, NULL, "noiselvl5gha2",
581 - &sprom->noiselvl5gha[2], 0, fallback);
582 - nvram_read_u8(prefix, NULL, "noiselvl5gua0",
583 - &sprom->noiselvl5gua[0], 0, fallback);
584 - nvram_read_u8(prefix, NULL, "noiselvl5gua1",
585 - &sprom->noiselvl5gua[1], 0, fallback);
586 - nvram_read_u8(prefix, NULL, "noiselvl5gua2",
587 - &sprom->noiselvl5gua[2], 0, fallback);
588 - nvram_read_u8(prefix, NULL, "pcieingress_war",
589 - &sprom->pcieingress_war, 0, fallback);
590 -}
591 -
592 -static void bcm47xx_fill_sprom_r9(struct ssb_sprom *sprom, const char *prefix,
593 - bool fallback)
594 -{
595 - nvram_read_u16(prefix, NULL, "cckbw202gpo", &sprom->cckbw202gpo, 0,
596 - fallback);
597 - nvram_read_u16(prefix, NULL, "cckbw20ul2gpo", &sprom->cckbw20ul2gpo, 0,
598 - fallback);
599 - nvram_read_u32(prefix, NULL, "legofdmbw202gpo",
600 - &sprom->legofdmbw202gpo, 0, fallback);
601 - nvram_read_u32(prefix, NULL, "legofdmbw20ul2gpo",
602 - &sprom->legofdmbw20ul2gpo, 0, fallback);
603 - nvram_read_u32(prefix, NULL, "legofdmbw205glpo",
604 - &sprom->legofdmbw205glpo, 0, fallback);
605 - nvram_read_u32(prefix, NULL, "legofdmbw20ul5glpo",
606 - &sprom->legofdmbw20ul5glpo, 0, fallback);
607 - nvram_read_u32(prefix, NULL, "legofdmbw205gmpo",
608 - &sprom->legofdmbw205gmpo, 0, fallback);
609 - nvram_read_u32(prefix, NULL, "legofdmbw20ul5gmpo",
610 - &sprom->legofdmbw20ul5gmpo, 0, fallback);
611 - nvram_read_u32(prefix, NULL, "legofdmbw205ghpo",
612 - &sprom->legofdmbw205ghpo, 0, fallback);
613 - nvram_read_u32(prefix, NULL, "legofdmbw20ul5ghpo",
614 - &sprom->legofdmbw20ul5ghpo, 0, fallback);
615 - nvram_read_u32(prefix, NULL, "mcsbw202gpo", &sprom->mcsbw202gpo, 0,
616 - fallback);
617 - nvram_read_u32(prefix, NULL, "mcsbw20ul2gpo", &sprom->mcsbw20ul2gpo, 0,
618 - fallback);
619 - nvram_read_u32(prefix, NULL, "mcsbw402gpo", &sprom->mcsbw402gpo, 0,
620 - fallback);
621 - nvram_read_u32(prefix, NULL, "mcsbw205glpo", &sprom->mcsbw205glpo, 0,
622 - fallback);
623 - nvram_read_u32(prefix, NULL, "mcsbw20ul5glpo",
624 - &sprom->mcsbw20ul5glpo, 0, fallback);
625 - nvram_read_u32(prefix, NULL, "mcsbw405glpo", &sprom->mcsbw405glpo, 0,
626 - fallback);
627 - nvram_read_u32(prefix, NULL, "mcsbw205gmpo", &sprom->mcsbw205gmpo, 0,
628 - fallback);
629 - nvram_read_u32(prefix, NULL, "mcsbw20ul5gmpo",
630 - &sprom->mcsbw20ul5gmpo, 0, fallback);
631 - nvram_read_u32(prefix, NULL, "mcsbw405gmpo", &sprom->mcsbw405gmpo, 0,
632 - fallback);
633 - nvram_read_u32(prefix, NULL, "mcsbw205ghpo", &sprom->mcsbw205ghpo, 0,
634 - fallback);
635 - nvram_read_u32(prefix, NULL, "mcsbw20ul5ghpo",
636 - &sprom->mcsbw20ul5ghpo, 0, fallback);
637 - nvram_read_u32(prefix, NULL, "mcsbw405ghpo", &sprom->mcsbw405ghpo, 0,
638 - fallback);
639 - nvram_read_u16(prefix, NULL, "mcs32po", &sprom->mcs32po, 0, fallback);
640 - nvram_read_u16(prefix, NULL, "legofdm40duppo",
641 - &sprom->legofdm40duppo, 0, fallback);
642 - nvram_read_u8(prefix, NULL, "sar2g", &sprom->sar2g, 0, fallback);
643 - nvram_read_u8(prefix, NULL, "sar5g", &sprom->sar5g, 0, fallback);
644 -}
645 -
646 static void bcm47xx_fill_sprom_path_r4589(struct ssb_sprom *sprom,
647 const char *prefix, bool fallback)
648 {
649 @@ -741,7 +566,6 @@ static void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom,
650 static void bcm47xx_fill_board_data(struct ssb_sprom *sprom, const char *prefix,
651 bool fallback)
652 {
653 - nvram_read_u16(prefix, NULL, "boardtype", &sprom->board_type, 0, true);
654 nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo,
655 &sprom->boardflags_hi, fallback);
656 nvram_read_u32_2(prefix, "boardflags2", &sprom->boardflags2_lo,
657 @@ -759,48 +583,29 @@ void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix,
658 switch (sprom->revision) {
659 case 1:
660 bcm47xx_fill_sprom_r1234589(sprom, prefix, fallback);
661 - bcm47xx_fill_sprom_r12389(sprom, prefix, fallback);
662 - bcm47xx_fill_sprom_r1(sprom, prefix, fallback);
663 break;
664 case 2:
665 bcm47xx_fill_sprom_r1234589(sprom, prefix, fallback);
666 - bcm47xx_fill_sprom_r12389(sprom, prefix, fallback);
667 - bcm47xx_fill_sprom_r2389(sprom, prefix, fallback);
668 break;
669 case 3:
670 bcm47xx_fill_sprom_r1234589(sprom, prefix, fallback);
671 - bcm47xx_fill_sprom_r12389(sprom, prefix, fallback);
672 - bcm47xx_fill_sprom_r2389(sprom, prefix, fallback);
673 - bcm47xx_fill_sprom_r389(sprom, prefix, fallback);
674 bcm47xx_fill_sprom_r3(sprom, prefix, fallback);
675 break;
676 case 4:
677 case 5:
678 bcm47xx_fill_sprom_r1234589(sprom, prefix, fallback);
679 bcm47xx_fill_sprom_r4589(sprom, prefix, fallback);
680 - bcm47xx_fill_sprom_r458(sprom, prefix, fallback);
681 - bcm47xx_fill_sprom_r45(sprom, prefix, fallback);
682 bcm47xx_fill_sprom_path_r4589(sprom, prefix, fallback);
683 bcm47xx_fill_sprom_path_r45(sprom, prefix, fallback);
684 break;
685 case 8:
686 bcm47xx_fill_sprom_r1234589(sprom, prefix, fallback);
687 - bcm47xx_fill_sprom_r12389(sprom, prefix, fallback);
688 - bcm47xx_fill_sprom_r2389(sprom, prefix, fallback);
689 - bcm47xx_fill_sprom_r389(sprom, prefix, fallback);
690 bcm47xx_fill_sprom_r4589(sprom, prefix, fallback);
691 - bcm47xx_fill_sprom_r458(sprom, prefix, fallback);
692 - bcm47xx_fill_sprom_r89(sprom, prefix, fallback);
693 bcm47xx_fill_sprom_path_r4589(sprom, prefix, fallback);
694 break;
695 case 9:
696 bcm47xx_fill_sprom_r1234589(sprom, prefix, fallback);
697 - bcm47xx_fill_sprom_r12389(sprom, prefix, fallback);
698 - bcm47xx_fill_sprom_r2389(sprom, prefix, fallback);
699 - bcm47xx_fill_sprom_r389(sprom, prefix, fallback);
700 bcm47xx_fill_sprom_r4589(sprom, prefix, fallback);
701 - bcm47xx_fill_sprom_r89(sprom, prefix, fallback);
702 - bcm47xx_fill_sprom_r9(sprom, prefix, fallback);
703 bcm47xx_fill_sprom_path_r4589(sprom, prefix, fallback);
704 break;
705 default:
706 @@ -808,8 +613,6 @@ void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix,
707 sprom->revision);
708 sprom->revision = 1;
709 bcm47xx_fill_sprom_r1234589(sprom, prefix, fallback);
710 - bcm47xx_fill_sprom_r12389(sprom, prefix, fallback);
711 - bcm47xx_fill_sprom_r1(sprom, prefix, fallback);
712 }
713
714 bcm47xx_sprom_fill_auto(sprom, prefix, fallback);
715 --
716 1.8.4.5
717