Commit 0a2fcaa7 authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by John W. Linville
Browse files

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: default avatarHauke Mehrtens <hauke@hauke-m.de>
Tested-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a9bba182
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -190,6 +190,8 @@ static void __init bcm47xx_register_bcma(void)
	err = bcma_host_soc_register(&bcm47xx_bus.bcma);
	if (err)
		panic("Failed to initialize BCMA bus (err %d)", err);

	bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
}
#endif

+12 −0
Original line number Diff line number Diff line
@@ -630,3 +630,15 @@ void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
	nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0);
}
#endif

#ifdef CONFIG_BCM47XX_BCMA
void bcm47xx_fill_bcma_boardinfo(struct bcma_boardinfo *boardinfo,
				 const char *prefix)
{
	nvram_read_u16(prefix, NULL, "boardvendor", &boardinfo->vendor, 0);
	if (!boardinfo->vendor)
		boardinfo->vendor = SSB_BOARDVENDOR_BCM;

	nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0);
}
#endif
+4 −0
Original line number Diff line number Diff line
@@ -51,5 +51,9 @@ void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom, const char *prefix);
void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
				const char *prefix);
#endif
#ifdef CONFIG_BCM47XX_BCMA
void bcm47xx_fill_bcma_boardinfo(struct bcma_boardinfo *boardinfo,
				 const char *prefix);
#endif

#endif /* __ASM_BCM47XX_H */
+3 −0
Original line number Diff line number Diff line
@@ -201,6 +201,9 @@ static int __devinit bcma_host_pci_probe(struct pci_dev *dev,
	bus->hosttype = BCMA_HOSTTYPE_PCI;
	bus->ops = &bcma_host_pci_ops;

	bus->boardinfo.vendor = bus->host_pci->subsystem_vendor;
	bus->boardinfo.type = bus->host_pci->subsystem_device;

	/* Register */
	err = bcma_bus_register(bus);
	if (err)
+1 −3
Original line number Diff line number Diff line
@@ -107,11 +107,9 @@ struct b43_bus_dev *b43_bus_dev_bcma_init(struct bcma_device *core)
	dev->dma_dev = core->dma_dev;
	dev->irq = core->irq;

	/*
	dev->board_vendor = core->bus->boardinfo.vendor;
	dev->board_type = core->bus->boardinfo.type;
	dev->board_rev = core->bus->boardinfo.rev;
	*/
	dev->board_rev = core->bus->sprom.board_rev;

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