aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm47xx/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/bcm47xx/setup.c')
-rw-r--r--arch/mips/bcm47xx/setup.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index 19780aa91708..95bf4d7bac21 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -90,6 +90,7 @@ static int bcm47xx_get_sprom_ssb(struct ssb_bus *bus, struct ssb_sprom *out)
90 char prefix[10]; 90 char prefix[10];
91 91
92 if (bus->bustype == SSB_BUSTYPE_PCI) { 92 if (bus->bustype == SSB_BUSTYPE_PCI) {
93 memset(out, 0, sizeof(struct ssb_sprom));
93 snprintf(prefix, sizeof(prefix), "pci/%u/%u/", 94 snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
94 bus->host_pci->bus->number + 1, 95 bus->host_pci->bus->number + 1,
95 PCI_SLOT(bus->host_pci->devfn)); 96 PCI_SLOT(bus->host_pci->devfn));
@@ -109,15 +110,9 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
109 /* Fill boardinfo structure */ 110 /* Fill boardinfo structure */
110 memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo)); 111 memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
111 112
112 if (nvram_getenv("boardvendor", buf, sizeof(buf)) >= 0) 113 bcm47xx_fill_ssb_boardinfo(&iv->boardinfo, NULL);
113 iv->boardinfo.vendor = (u16)simple_strtoul(buf, NULL, 0);
114 else
115 iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM;
116 if (nvram_getenv("boardtype", buf, sizeof(buf)) >= 0)
117 iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
118 if (nvram_getenv("boardrev", buf, sizeof(buf)) >= 0)
119 iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0);
120 114
115 memset(&iv->sprom, 0, sizeof(struct ssb_sprom));
121 bcm47xx_fill_sprom(&iv->sprom, NULL); 116 bcm47xx_fill_sprom(&iv->sprom, NULL);
122 117
123 if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0) 118 if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0)
@@ -166,12 +161,14 @@ static int bcm47xx_get_sprom_bcma(struct bcma_bus *bus, struct ssb_sprom *out)
166 161
167 switch (bus->hosttype) { 162 switch (bus->hosttype) {
168 case BCMA_HOSTTYPE_PCI: 163 case BCMA_HOSTTYPE_PCI:
164 memset(out, 0, sizeof(struct ssb_sprom));
169 snprintf(prefix, sizeof(prefix), "pci/%u/%u/", 165 snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
170 bus->host_pci->bus->number + 1, 166 bus->host_pci->bus->number + 1,
171 PCI_SLOT(bus->host_pci->devfn)); 167 PCI_SLOT(bus->host_pci->devfn));
172 bcm47xx_fill_sprom(out, prefix); 168 bcm47xx_fill_sprom(out, prefix);
173 return 0; 169 return 0;
174 case BCMA_HOSTTYPE_SOC: 170 case BCMA_HOSTTYPE_SOC:
171 memset(out, 0, sizeof(struct ssb_sprom));
175 bcm47xx_fill_sprom_ethernet(out, NULL); 172 bcm47xx_fill_sprom_ethernet(out, NULL);
176 core = bcma_find_core(bus, BCMA_CORE_80211); 173 core = bcma_find_core(bus, BCMA_CORE_80211);
177 if (core) { 174 if (core) {
@@ -197,6 +194,8 @@ static void __init bcm47xx_register_bcma(void)
197 err = bcma_host_soc_register(&bcm47xx_bus.bcma); 194 err = bcma_host_soc_register(&bcm47xx_bus.bcma);
198 if (err) 195 if (err)
199 panic("Failed to initialize BCMA bus (err %d)", err); 196 panic("Failed to initialize BCMA bus (err %d)", err);
197
198 bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
200} 199}
201#endif 200#endif
202 201