2010-07-13 16:55:57 +00:00
|
|
|
--- a/driver/bcmsrom.c
|
|
|
|
+++ b/driver/bcmsrom.c
|
2011-05-01 20:28:35 +00:00
|
|
|
@@ -39,6 +39,11 @@
|
2010-07-13 16:55:57 +00:00
|
|
|
#include <sbsdpcmdev.h>
|
|
|
|
#endif
|
|
|
|
|
2011-05-01 20:28:35 +00:00
|
|
|
+#if defined(CONFIG_SSB_PCIHOST) && defined(CONFIG_BOARD_BCM963XX)
|
2010-07-13 16:55:57 +00:00
|
|
|
+#include <linux/ssb/ssb.h>
|
2014-10-02 12:24:05 +00:00
|
|
|
+extern int bcm63xx_get_fallback_sprom(uint pci_bus, uint pci_slot, struct ssb_sprom *out);
|
2010-07-13 16:55:57 +00:00
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#ifdef WLTEST
|
|
|
|
#include <sbsprom.h>
|
|
|
|
#endif /* WLTEST */
|
2014-10-02 12:24:05 +00:00
|
|
|
@@ -2120,6 +2125,63 @@ BCMATTACHFN(initvars_srom_pci)(si_t *sih
|
2010-07-13 16:55:57 +00:00
|
|
|
goto varscont;
|
|
|
|
}
|
|
|
|
|
2011-05-01 20:28:35 +00:00
|
|
|
+#if defined(CONFIG_SSB_PCIHOST) && defined(CONFIG_BOARD_BCM963XX)
|
2010-07-13 16:55:57 +00:00
|
|
|
+ base = vp = MALLOC(osh, MAXSZ_NVRAM_VARS);
|
|
|
|
+
|
|
|
|
+ if( base != NULL )
|
|
|
|
+ {
|
2014-10-02 12:24:05 +00:00
|
|
|
+ char eabuf[18];
|
|
|
|
+ struct ssb_sprom bcm63xx_sprom;
|
|
|
|
+ uint pci_bus = osl_pci_bus(osh), pci_slot = osl_pci_slot(osh);
|
|
|
|
+
|
|
|
|
+ bcm63xx_get_fallback_sprom(pci_bus, pci_slot, &bcm63xx_sprom);
|
|
|
|
+ printk("BCM%X(%02x:%02x) using sprom version %i\n", sih->chip, pci_bus, pci_slot, bcm63xx_sprom.revision);
|
2010-07-13 16:55:57 +00:00
|
|
|
+
|
2014-10-02 12:24:05 +00:00
|
|
|
+ varbuf_init(&b, base, MAXSZ_NVRAM_VARS);
|
2010-07-13 16:55:57 +00:00
|
|
|
+
|
2011-05-01 20:28:35 +00:00
|
|
|
+ varbuf_append(&b, vstr_sromrev, bcm63xx_sprom.revision);
|
|
|
|
+ varbuf_append(&b, vstr_boardrev, bcm63xx_sprom.board_rev);
|
2010-07-13 16:55:57 +00:00
|
|
|
+
|
2011-05-01 20:28:35 +00:00
|
|
|
+ /* ToDo: map bcm63xx_sprom.country_code */
|
|
|
|
+ varbuf_append(&b, vstr_noccode);
|
2010-07-13 16:55:57 +00:00
|
|
|
+
|
2011-05-01 20:28:35 +00:00
|
|
|
+ varbuf_append(&b, vstr_aa2g, bcm63xx_sprom.ant_available_bg);
|
2010-07-13 16:55:57 +00:00
|
|
|
+
|
2011-05-01 20:28:35 +00:00
|
|
|
+ varbuf_append(&b, vstr_pa0b[0], bcm63xx_sprom.pa0b0);
|
|
|
|
+ varbuf_append(&b, vstr_pa1b[0], bcm63xx_sprom.pa1b0);
|
|
|
|
+ varbuf_append(&b, vstr_pa0b[1], bcm63xx_sprom.pa0b1);
|
|
|
|
+ varbuf_append(&b, vstr_pa1b[1], bcm63xx_sprom.pa1b1);
|
|
|
|
+ varbuf_append(&b, vstr_pa0b[2], bcm63xx_sprom.pa0b2);
|
|
|
|
+ varbuf_append(&b, vstr_pa1b[2], bcm63xx_sprom.pa1b2);
|
2010-07-13 16:55:57 +00:00
|
|
|
+
|
2011-05-01 20:28:35 +00:00
|
|
|
+ varbuf_append(&b, vstr_pa0maxpwr, bcm63xx_sprom.maxpwr_bg);
|
|
|
|
+ varbuf_append(&b, vstr_pa0itssit, bcm63xx_sprom.itssi_bg);
|
2010-07-13 16:55:57 +00:00
|
|
|
+
|
2011-05-01 20:28:35 +00:00
|
|
|
+ varbuf_append(&b, vstr_boardflags, (bcm63xx_sprom.boardflags_hi << 16) | bcm63xx_sprom.boardflags_lo);
|
|
|
|
+ varbuf_append(&b, vstr_boardflags2, (bcm63xx_sprom.boardflags2_hi << 16) | bcm63xx_sprom.boardflags2_lo);
|
2010-07-13 16:55:57 +00:00
|
|
|
+
|
2011-05-01 20:28:35 +00:00
|
|
|
+ snprintf(eabuf, sizeof(eabuf), "%02x:%02x:%02x:%02x:%02x:%02x",
|
|
|
|
+ bcm63xx_sprom.il0mac[0], bcm63xx_sprom.il0mac[1], bcm63xx_sprom.il0mac[2],
|
|
|
|
+ bcm63xx_sprom.il0mac[3], bcm63xx_sprom.il0mac[4], bcm63xx_sprom.il0mac[5]
|
|
|
|
+ );
|
2010-07-13 16:55:57 +00:00
|
|
|
+
|
2011-05-01 20:28:35 +00:00
|
|
|
+ varbuf_append(&b, vstr_macaddr, eabuf);
|
2010-07-13 16:55:57 +00:00
|
|
|
+
|
|
|
|
+ /* final nullbyte terminator */
|
|
|
|
+ ASSERT(b.size >= 1);
|
|
|
|
+ vp = b.buf;
|
|
|
|
+ *vp++ = '\0';
|
|
|
|
+
|
|
|
|
+ ASSERT((vp - base) <= MAXSZ_NVRAM_VARS);
|
|
|
|
+ goto varsdone;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ err = -2;
|
|
|
|
+ goto errout;
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
BS_ERROR(("SROM CRC Error\n"));
|
|
|
|
|
|
|
|
#if defined(WLTEST)
|