bcma: add boardinfo struct
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 29 Apr 2012 00:04:08 +0000 (02:04 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 May 2012 16:45:21 +0000 (12:45 -0400)
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>
arch/mips/bcm47xx/setup.c
arch/mips/bcm47xx/sprom.c
arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
drivers/bcma/host_pci.c
drivers/net/wireless/b43/bus.c
include/linux/bcma/bcma.h

index 53cdb72442447de41c5610a45747629fee01748d..9ef46d2a51105cdd56ea7161109d49ba35bbe407 100644 (file)
@@ -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
 
index 279991a3583b1dc717dacee2ebc41a8fdb81a6ee..a29d20743039e6270cb7ea1a847b47312fa07415 100644 (file)
@@ -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
index 42887c66ade22c3d3022b1de854465e634a27ab7..26fdaf40b930fa468e8bfb48656d08a2eeccd3ec 100644 (file)
@@ -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 */
index e3928d68802b2ba0c283a1eca2fe0bc86bea40be..3a93563b4f7a1db24871220190df5ffcec676003 100644 (file)
@@ -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)
index 8f3c0a889a4ee5d6f2ee95502a51df5d1e87fcd3..565fdbdd6915f33e36cdbea616db209cf633bc4e 100644 (file)
@@ -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;
index 5af9a075498f144fa3c6ea6d86744201a65428b7..747f2ca6f04e90516f4e07b8e9cac0e7f7c02490 100644 (file)
@@ -26,6 +26,11 @@ struct bcma_chipinfo {
        u8 pkg;
 };
 
+struct bcma_boardinfo {
+       u16 vendor;
+       u16 type;
+};
+
 enum bcma_clkmode {
        BCMA_CLKMODE_FAST,
        BCMA_CLKMODE_DYNAMIC,
@@ -198,6 +203,8 @@ struct bcma_bus {
 
        struct bcma_chipinfo chipinfo;
 
+       struct bcma_boardinfo boardinfo;
+
        struct bcma_device *mapped_core;
        struct list_head cores;
        u8 nr_cores;