031-13-MIPS-BCM47xx-Move-filling-most-of-SPROM-to-the-gener.patch 34 KB

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