aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-04-28 20:04:08 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-05-16 12:45:21 -0400
commit0a2fcaa70ce96be6e663234072984fd2b0ffa36e (patch)
tree1f57022ce2c1f24975ce1ab4a81b3dc36d54df08
parenta9bba182a1f3f33ba11abde8226ab2a4c39ce4e7 (diff)
bcma: add boardinfo struct
This struct contains information about the board, the chip is running on. The struct is filled for PCIe devices and SoCs. This information is used by b43 and will be used by brcmsmac soon. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Tested-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--arch/mips/bcm47xx/setup.c2
-rw-r--r--arch/mips/bcm47xx/sprom.c12
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/bcm47xx.h4
-rw-r--r--drivers/bcma/host_pci.c3
-rw-r--r--drivers/net/wireless/b43/bus.c4
-rw-r--r--include/linux/bcma/bcma.h7
6 files changed, 29 insertions, 3 deletions
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index 53cdb7244244..9ef46d2a5110 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -190,6 +190,8 @@ static void __init bcm47xx_register_bcma(void)
190 err = bcma_host_soc_register(&bcm47xx_bus.bcma); 190 err = bcma_host_soc_register(&bcm47xx_bus.bcma);
191 if (err) 191 if (err)
192 panic("Failed to initialize BCMA bus (err %d)", err); 192 panic("Failed to initialize BCMA bus (err %d)", err);
193
194 bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
193} 195}
194#endif 196#endif
195 197
diff --git a/arch/mips/bcm47xx/sprom.c b/arch/mips/bcm47xx/sprom.c
index 279991a3583b..a29d20743039 100644
--- a/arch/mips/bcm47xx/sprom.c
+++ b/arch/mips/bcm47xx/sprom.c
@@ -630,3 +630,15 @@ void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
630 nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0); 630 nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0);
631} 631}
632#endif 632#endif
633
634#ifdef CONFIG_BCM47XX_BCMA
635void bcm47xx_fill_bcma_boardinfo(struct bcma_boardinfo *boardinfo,
636 const char *prefix)
637{
638 nvram_read_u16(prefix, NULL, "boardvendor", &boardinfo->vendor, 0);
639 if (!boardinfo->vendor)
640 boardinfo->vendor = SSB_BOARDVENDOR_BCM;
641
642 nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0);
643}
644#endif
diff --git a/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h b/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
index 42887c66ade2..26fdaf40b930 100644
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
@@ -51,5 +51,9 @@ void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom, const char *prefix);
51void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo, 51void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
52 const char *prefix); 52 const char *prefix);
53#endif 53#endif
54#ifdef CONFIG_BCM47XX_BCMA
55void bcm47xx_fill_bcma_boardinfo(struct bcma_boardinfo *boardinfo,
56 const char *prefix);
57#endif
54 58
55#endif /* __ASM_BCM47XX_H */ 59#endif /* __ASM_BCM47XX_H */
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index e3928d68802b..3a93563b4f7a 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -201,6 +201,9 @@ static int __devinit bcma_host_pci_probe(struct pci_dev *dev,
201 bus->hosttype = BCMA_HOSTTYPE_PCI; 201 bus->hosttype = BCMA_HOSTTYPE_PCI;
202 bus->ops = &bcma_host_pci_ops; 202 bus->ops = &bcma_host_pci_ops;
203 203
204 bus->boardinfo.vendor = bus->host_pci->subsystem_vendor;
205 bus->boardinfo.type = bus->host_pci->subsystem_device;
206
204 /* Register */ 207 /* Register */
205 err = bcma_bus_register(bus); 208 err = bcma_bus_register(bus);
206 if (err) 209 if (err)
diff --git a/drivers/net/wireless/b43/bus.c b/drivers/net/wireless/b43/bus.c
index 8f3c0a889a4e..565fdbdd6915 100644
--- a/drivers/net/wireless/b43/bus.c
+++ b/drivers/net/wireless/b43/bus.c
@@ -107,11 +107,9 @@ struct b43_bus_dev *b43_bus_dev_bcma_init(struct bcma_device *core)
107 dev->dma_dev = core->dma_dev; 107 dev->dma_dev = core->dma_dev;
108 dev->irq = core->irq; 108 dev->irq = core->irq;
109 109
110 /*
111 dev->board_vendor = core->bus->boardinfo.vendor; 110 dev->board_vendor = core->bus->boardinfo.vendor;
112 dev->board_type = core->bus->boardinfo.type; 111 dev->board_type = core->bus->boardinfo.type;
113 dev->board_rev = core->bus->boardinfo.rev; 112 dev->board_rev = core->bus->sprom.board_rev;
114 */
115 113
116 dev->chip_id = core->bus->chipinfo.id; 114 dev->chip_id = core->bus->chipinfo.id;
117 dev->chip_rev = core->bus->chipinfo.rev; 115 dev->chip_rev = core->bus->chipinfo.rev;
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 5af9a075498f..747f2ca6f04e 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -26,6 +26,11 @@ struct bcma_chipinfo {
26 u8 pkg; 26 u8 pkg;
27}; 27};
28 28
29struct bcma_boardinfo {
30 u16 vendor;
31 u16 type;
32};
33
29enum bcma_clkmode { 34enum bcma_clkmode {
30 BCMA_CLKMODE_FAST, 35 BCMA_CLKMODE_FAST,
31 BCMA_CLKMODE_DYNAMIC, 36 BCMA_CLKMODE_DYNAMIC,
@@ -198,6 +203,8 @@ struct bcma_bus {
198 203
199 struct bcma_chipinfo chipinfo; 204 struct bcma_chipinfo chipinfo;
200 205
206 struct bcma_boardinfo boardinfo;
207
201 struct bcma_device *mapped_core; 208 struct bcma_device *mapped_core;
202 struct list_head cores; 209 struct list_head cores;
203 u8 nr_cores; 210 u8 nr_cores;