Skip to content

Commit 0a2fcaa

Browse files
haukelinvjw
authored andcommitted
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>
1 parent a9bba18 commit 0a2fcaa

6 files changed

Lines changed: 29 additions & 3 deletions

File tree

‎arch/mips/bcm47xx/setup.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ static void __init bcm47xx_register_bcma(void)
190190
err = bcma_host_soc_register(&bcm47xx_bus.bcma);
191191
if (err)
192192
panic("Failed to initialize BCMA bus (err %d)", err);
193+
194+
bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
193195
}
194196
#endif
195197

‎arch/mips/bcm47xx/sprom.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,3 +630,15 @@ void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
630630
nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0);
631631
}
632632
#endif
633+
634+
#ifdef CONFIG_BCM47XX_BCMA
635+
void 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

‎arch/mips/include/asm/mach-bcm47xx/bcm47xx.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,9 @@ void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom, const char *prefix);
5151
void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
5252
const char *prefix);
5353
#endif
54+
#ifdef CONFIG_BCM47XX_BCMA
55+
void bcm47xx_fill_bcma_boardinfo(struct bcma_boardinfo *boardinfo,
56+
const char *prefix);
57+
#endif
5458

5559
#endif /* __ASM_BCM47XX_H */

‎drivers/bcma/host_pci.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ static int __devinit bcma_host_pci_probe(struct pci_dev *dev,
201201
bus->hosttype = BCMA_HOSTTYPE_PCI;
202202
bus->ops = &bcma_host_pci_ops;
203203

204+
bus->boardinfo.vendor = bus->host_pci->subsystem_vendor;
205+
bus->boardinfo.type = bus->host_pci->subsystem_device;
206+
204207
/* Register */
205208
err = bcma_bus_register(bus);
206209
if (err)

‎drivers/net/wireless/b43/bus.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,9 @@ struct b43_bus_dev *b43_bus_dev_bcma_init(struct bcma_device *core)
107107
dev->dma_dev = core->dma_dev;
108108
dev->irq = core->irq;
109109

110-
/*
111110
dev->board_vendor = core->bus->boardinfo.vendor;
112111
dev->board_type = core->bus->boardinfo.type;
113-
dev->board_rev = core->bus->boardinfo.rev;
114-
*/
112+
dev->board_rev = core->bus->sprom.board_rev;
115113

116114
dev->chip_id = core->bus->chipinfo.id;
117115
dev->chip_rev = core->bus->chipinfo.rev;

‎include/linux/bcma/bcma.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ struct bcma_chipinfo {
2626
u8 pkg;
2727
};
2828

29+
struct bcma_boardinfo {
30+
u16 vendor;
31+
u16 type;
32+
};
33+
2934
enum bcma_clkmode {
3035
BCMA_CLKMODE_FAST,
3136
BCMA_CLKMODE_DYNAMIC,
@@ -198,6 +203,8 @@ struct bcma_bus {
198203

199204
struct bcma_chipinfo chipinfo;
200205

206+
struct bcma_boardinfo boardinfo;
207+
201208
struct bcma_device *mapped_core;
202209
struct list_head cores;
203210
u8 nr_cores;

0 commit comments

Comments
 (0)