Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hauke Mehrtens and committed by
John W. Linville
0a2fcaa7 a9bba182

+29 -3
+2
arch/mips/bcm47xx/setup.c
··· 190 190 err = bcma_host_soc_register(&bcm47xx_bus.bcma); 191 191 if (err) 192 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 196 #endif 195 197
+12
arch/mips/bcm47xx/sprom.c
··· 630 630 nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0); 631 631 } 632 632 #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
+4
arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
··· 51 51 void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo, 52 52 const char *prefix); 53 53 #endif 54 + #ifdef CONFIG_BCM47XX_BCMA 55 + void bcm47xx_fill_bcma_boardinfo(struct bcma_boardinfo *boardinfo, 56 + const char *prefix); 57 + #endif 54 58 55 59 #endif /* __ASM_BCM47XX_H */
+3
drivers/bcma/host_pci.c
··· 201 201 bus->hosttype = BCMA_HOSTTYPE_PCI; 202 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 207 /* Register */ 205 208 err = bcma_bus_register(bus); 206 209 if (err)
+1 -3
drivers/net/wireless/b43/bus.c
··· 107 107 dev->dma_dev = core->dma_dev; 108 108 dev->irq = core->irq; 109 109 110 - /* 111 110 dev->board_vendor = core->bus->boardinfo.vendor; 112 111 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; 115 113 116 114 dev->chip_id = core->bus->chipinfo.id; 117 115 dev->chip_rev = core->bus->chipinfo.rev;
+7
include/linux/bcma/bcma.h
··· 26 26 u8 pkg; 27 27 }; 28 28 29 + struct bcma_boardinfo { 30 + u16 vendor; 31 + u16 type; 32 + }; 33 + 29 34 enum bcma_clkmode { 30 35 BCMA_CLKMODE_FAST, 31 36 BCMA_CLKMODE_DYNAMIC, ··· 202 197 }; 203 198 204 199 struct bcma_chipinfo chipinfo; 200 + 201 + struct bcma_boardinfo boardinfo; 205 202 206 203 struct bcma_device *mapped_core; 207 204 struct list_head cores;