]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
bcma: move bus struct setup into early part of host specific code
authorRafał Miłecki <zajec5@gmail.com>
Mon, 1 Sep 2014 21:11:06 +0000 (23:11 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 9 Sep 2014 19:27:18 +0000 (15:27 -0400)
This change is important for SoC host. In future we will want to know
chip ID (needed for early MIPS boot) before doing cores scanning.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/bcma/host_pci.c
drivers/bcma/host_soc.c
drivers/bcma/main.c
drivers/bcma/scan.c
include/linux/bcma/bcma.h

index f032ed6dd459564ece3a6cf119070c72ca2991cc..1e5ac0a796968b61e3de79a4ae2a82f9c2339916 100644 (file)
@@ -208,6 +208,9 @@ static int bcma_host_pci_probe(struct pci_dev *dev,
        bus->boardinfo.vendor = bus->host_pci->subsystem_vendor;
        bus->boardinfo.type = bus->host_pci->subsystem_device;
 
+       /* Initialize struct, detect chip */
+       bcma_init_bus(bus);
+
        /* Register */
        err = bcma_bus_register(bus);
        if (err)
index 1edd7e06462135f4ecc2192b67f12852e2a5a77d..379e0d4ebe720f9534c2dd495fc84c1ced942ed6 100644 (file)
@@ -178,6 +178,9 @@ int __init bcma_host_soc_register(struct bcma_soc *soc)
        bus->hosttype = BCMA_HOSTTYPE_SOC;
        bus->ops = &bcma_host_soc_ops;
 
+       /* Initialize struct, detect chip */
+       bcma_init_bus(bus);
+
        /* Register */
        err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips);
        if (err)
index 0ff8d58831ef30fcbe7a5452baa8b00e3fdababa..9f6b0cb9a12c8c0aeabac92156a7c93e96837867 100644 (file)
@@ -334,8 +334,6 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
        struct bcma_device *core;
        struct bcma_device_id match;
 
-       bcma_init_bus(bus);
-
        match.manuf = BCMA_MANUF_BCM;
        match.id = bcma_cc_core_id(bus);
        match.class = BCMA_CL_SIM;
index e9bd77249a4c91f329c163c647b20299d1f4a530..e2b99030304270d328f499c23dceebe7875c7f60 100644 (file)
@@ -438,9 +438,6 @@ void bcma_init_bus(struct bcma_bus *bus)
        s32 tmp;
        struct bcma_chipinfo *chipinfo = &(bus->chipinfo);
 
-       if (bus->init_done)
-               return;
-
        INIT_LIST_HEAD(&bus->cores);
        bus->nr_cores = 0;
 
@@ -452,8 +449,6 @@ void bcma_init_bus(struct bcma_bus *bus)
        chipinfo->pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT;
        bcma_info(bus, "Found chip with id 0x%04X, rev 0x%02X and package 0x%02X\n",
                  chipinfo->id, chipinfo->rev, chipinfo->pkg);
-
-       bus->init_done = true;
 }
 
 int bcma_bus_scan(struct bcma_bus *bus)
@@ -463,8 +458,6 @@ int bcma_bus_scan(struct bcma_bus *bus)
 
        int err, core_num = 0;
 
-       bcma_init_bus(bus);
-
        erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM);
        if (bus->hosttype == BCMA_HOSTTYPE_SOC) {
                eromptr = ioremap_nocache(erombase, BCMA_CORE_SIZE);
index 0272e49135d0cf0521a62c619185eadf2b418666..c1ba87d1548ecd91694f9966c9b13d920d456525 100644 (file)
@@ -332,7 +332,6 @@ struct bcma_bus {
        struct bcma_device *mapped_core;
        struct list_head cores;
        u8 nr_cores;
-       u8 init_done:1;
        u8 num;
 
        struct bcma_drv_cc drv_cc;