bcma: register NAND and QSPI cores early
authorRafał Miłecki <zajec5@gmail.com>
Thu, 4 Sep 2014 22:18:49 +0000 (00:18 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 9 Sep 2014 19:27:20 +0000 (15:27 -0400)
On Northstar (ARM arch) we will use MTD subsystem to access NVRAM and
SPROM. To get access to flash device we need to register these cores
first.

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/main.c

index 9a86352352bc6261b3fceff01089552ec82c0351..297a2d46985ae5bcfc702c006536a996cfbf647f 100644 (file)
@@ -120,6 +120,17 @@ static void bcma_release_core_dev(struct device *dev)
        kfree(core);
 }
 
+static bool bcma_is_core_needed_early(u16 core_id)
+{
+       switch (core_id) {
+       case BCMA_CORE_NS_NAND:
+       case BCMA_CORE_NS_QSPI:
+               return true;
+       }
+
+       return false;
+}
+
 static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
 {
        int err;
@@ -170,6 +181,10 @@ static int bcma_register_devices(struct bcma_bus *bus)
                        continue;
                }
 
+               /* Early cores were already registered */
+               if (bcma_is_core_needed_early(core->id.id))
+                       continue;
+
                /* Only first GMAC core on BCM4706 is connected and working */
                if (core->id.id == BCMA_CORE_4706_MAC_GBIT &&
                    core->core_unit > 0)
@@ -252,6 +267,12 @@ int bcma_bus_register(struct bcma_bus *bus)
                bcma_core_chipcommon_early_init(&bus->drv_cc);
        }
 
+       /* Cores providing flash access go before SPROM init */
+       list_for_each_entry(core, &bus->cores, list) {
+               if (bcma_is_core_needed_early(core->id.id))
+                       bcma_register_core(bus, core);
+       }
+
        /* Try to get SPROM */
        err = bcma_sprom_get(bus);
        if (err == -ENOENT) {
This page took 0.025187 seconds and 5 git commands to generate.