@@ -390,12 +390,20 @@ config MTD_NAND_GPMI_NAND
the GPMI.
config MTD_NAND_BCM47XXNFLASH
- tristate "Support for NAND flash on BCM4706 BCMA bus"
- depends on BCMA_NFLASH
+ tristate "Support for NAND flash memories on BCMA bus"
+ depends on BCMA
help
- BCMA bus can have various flash memories attached, they are
- registered by bcma as platform devices. This enables driver for
- NAND flash memories. For now only BCM4706 is supported.
+ BCMA bus can have various flash memories attached including
+ NAND type. Depending on SoC version they can be attached to
+ the ChipCommon core or available as separated device.
+
+config MTD_NAND_BCM47XXNFLASH_PLATFORM
+ bool "NAND attached to the ChipCommon core"
+ depends on MTD_NAND_BCM47XXNFLASH && BCMA_NFLASH
+ help
+ Such flashes were probably used on MIPS based SoCs only. The
+ most common was BCM4706, but it rarely could be also found on
+ BCM5357.
config MTD_NAND_PLATFORM
tristate "Support for generic platform NAND driver"
@@ -1,4 +1,4 @@
bcm47xxnflash-y += main.o
-bcm47xxnflash-y += ops_bcm4706.o
+bcm47xxnflash-$(CONFIG_MTD_NAND_BCM47XXNFLASH_PLATFORM) += ops_bcm4706.o
obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH) += bcm47xxnflash.o
@@ -21,6 +21,7 @@ MODULE_DESCRIPTION("NAND flash driver for BCMA bus");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Rafał Miłecki");
+#if IS_ENABLED(CONFIG_MTD_NAND_BCM47XXNFLASH_PLATFORM)
static const char *probes[] = { "bcm47xxpart", NULL };
static int bcm47xxnflash_probe(struct platform_device *pdev)
@@ -76,22 +77,31 @@ static struct platform_driver bcm47xxnflash_driver = {
.owner = THIS_MODULE,
},
};
+#endif
+
+/**************************************************
+ * Init & exit
+ **************************************************/
static int __init bcm47xxnflash_init(void)
{
- int err;
+ int err = 0;
+#if IS_ENABLED(CONFIG_MTD_NAND_BCM47XXNFLASH_PLATFORM)
err = platform_driver_register(&bcm47xxnflash_driver);
if (err)
pr_err("Failed to register bcm47xx nand flash driver: %d\n",
err);
+#endif
return err;
}
static void __exit bcm47xxnflash_exit(void)
{
+#if IS_ENABLED(CONFIG_MTD_NAND_BCM47XXNFLASH_PLATFORM)
platform_driver_unregister(&bcm47xxnflash_driver);
+#endif
}
module_init(bcm47xxnflash_init);