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