Merge branch 'mm-pkeys-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[deliverable/linux.git] / drivers / bcma / driver_chipcommon.c
index b0f44a2937b9cb03d3ae8bbbebfc7035fe134ab2..921ce1834673231e597d2b85e48bb5e4307bf3b1 100644 (file)
@@ -115,6 +115,33 @@ int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc)
        return 0;
 }
 
+static void bcma_core_chipcommon_flash_detect(struct bcma_drv_cc *cc)
+{
+       struct bcma_bus *bus = cc->core->bus;
+
+       switch (cc->capabilities & BCMA_CC_CAP_FLASHT) {
+       case BCMA_CC_FLASHT_STSER:
+       case BCMA_CC_FLASHT_ATSER:
+               bcma_debug(bus, "Found serial flash\n");
+               bcma_sflash_init(cc);
+               break;
+       case BCMA_CC_FLASHT_PARA:
+               bcma_debug(bus, "Found parallel flash\n");
+               bcma_pflash_init(cc);
+               break;
+       default:
+               bcma_err(bus, "Flash type not supported\n");
+       }
+
+       if (cc->core->id.rev == 38 ||
+           bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) {
+               if (cc->capabilities & BCMA_CC_CAP_NFLASH) {
+                       bcma_debug(bus, "Found NAND flash\n");
+                       bcma_nflash_init(cc);
+               }
+       }
+}
+
 void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
 {
        struct bcma_bus *bus = cc->core->bus;
@@ -136,6 +163,9 @@ void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
        if (IS_BUILTIN(CONFIG_BCM47XX) && bus->hosttype == BCMA_HOSTTYPE_SOC)
                bcma_chipco_serial_init(cc);
 
+       if (bus->hosttype == BCMA_HOSTTYPE_SOC)
+               bcma_core_chipcommon_flash_detect(cc);
+
        cc->early_setup_done = true;
 }
 
This page took 0.02609 seconds and 5 git commands to generate.