Skip to contentSkip to conversation

mtd: prepare place for BCMA NAND flash driver(s)

PATCH In review Rafał Miłecki 2 participants 5 messages Sep 9, 2012 – Sep 11, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: prepare place for BCMA NAND flash driver(s)

BCMA bus can contain NAND flash memory, it's registered in system as platform device. This adds required hooks and place for controler specific drivers.
At this point it doesn't work yet, so it's marked as BROKEN.

---
 drivers/mtd/nand/Kconfig                       |    8 ++
 drivers/mtd/nand/Makefile                      |    1 +
 drivers/mtd/nand/bcm47xxnflash/Makefile        |    3 +
 drivers/mtd/nand/bcm47xxnflash/bcm47xxnflash.h |   20 +++++
 drivers/mtd/nand/bcm47xxnflash/main.c          |  106 ++++++++++++++++++++++++
 5 files changed, 138 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/nand/bcm47xxnflash/Makefile
 create mode 100644 drivers/mtd/nand/bcm47xxnflash/bcm47xxnflash.h
 create mode 100644 drivers/mtd/nand/bcm47xxnflash/main.c
drivers/mtd/nand/Kconfig +8 -0
index 8ca4176..7460ac2 100644
@@ -489,6 +489,14 @@ config MTD_NAND_GPMI_NAND
 	 block, such as SD card. So pay attention to it when you enable
 	 the GPMI.
 
+config MTD_NAND_BCM47XXNFLASH
+	tristate "Support for NAND flash on BCMA bus"
+	depends on BCMA_NFLASH && BROKEN
+	help
+	  BCMA bus can have various flash memories attached, they are
+	  registered by bcma as platform devices. This enables driver for
+	  NAND flash memories.
+
 config MTD_NAND_PLATFORM
 	tristate "Support for generic platform NAND driver"
 	depends on HAS_IOMEM
drivers/mtd/nand/Makefile +1 -0
index d4b4d87..8aa55d8 100644
@@ -51,5 +51,6 @@ obj-$(CONFIG_MTD_NAND_MPC5121_NFC)	+= mpc5121_nfc.o
 obj-$(CONFIG_MTD_NAND_RICOH)		+= r852.o
 obj-$(CONFIG_MTD_NAND_JZ4740)		+= jz4740_nand.o
 obj-$(CONFIG_MTD_NAND_GPMI_NAND)	+= gpmi-nand/
+obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH)	+= bcm47xxnflash/
 
 nand-objs := nand_base.o nand_bbt.o
drivers/mtd/nand/bcm47xxnflash/Makefile new file +3 -0
new file mode 100644
index 0000000..1d0693a
@@ -0,0 +1,3 @@
+bcm47xxnflash-y				+= main.o
+
+obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH)	+= bcm47xxnflash.o
drivers/mtd/nand/bcm47xxnflash/bcm47xxnflash.h new file +20 -0
new file mode 100644
index 0000000..692ea5f
@@ -0,0 +1,20 @@
+#ifndef __BCM47XXNFLASH_H
+#define __BCM47XXNFLASH_H
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+
+struct bcm47xxnflash {
+	struct bcma_drv_cc *cc;
+
+	struct nand_chip nand_chip;
+	struct mtd_info mtd;
+
+	unsigned curr_command;
+	int curr_page_addr;
+	int curr_column;
+};
+
+int bcm47xxnflash_nand_bcm4706_init(struct bcm47xxnflash *bcm47xxnflash);
+
+#endif /* BCM47XXNFLASH */
drivers/mtd/nand/bcm47xxnflash/main.c new file +106 -0

106 lines not on this page · raw message

Signature · 1 line
1.7.7
#1 lore raw
Quoted 6 lines · Rafał Miłecki

BCMA bus can contain NAND flash memory, it's registered in system as platform device. This adds required hooks and place for controler specific drivers.
At this point it doesn't work yet, so it's marked as BROKEN.

Why should it be merged upstream as BROKEN and without controller-specific drivers?

Signature · 2 lines
Best Regards,
Artem Bityutskiy
#2 lore raw

2012/9/11 Artem Bityutskiy <[email protected]>:

Quoted 10 lines · Rafał Miłecki
Quoted 6 lines

BCMA bus can contain NAND flash memory, it's registered in system as platform device. This adds required hooks and place for controler specific drivers.
At this point it doesn't work yet, so it's marked as BROKEN.

Why should it be merged upstream as BROKEN and without controller-specific drivers?

I'll resend this in a patchset proving some basic functionality.

Signature · 1 line
Rafał
#3 lore raw
In reply to Artem Bityutskiy

2012/9/11 Artem Bityutskiy <[email protected]>:

Quoted 10 lines · Rafał Miłecki
Quoted 6 lines

BCMA bus can contain NAND flash memory, it's registered in system as platform device. This adds required hooks and place for controler specific drivers.
At this point it doesn't work yet, so it's marked as BROKEN.

Why should it be merged upstream as BROKEN and without controller-specific drivers?

Regarding question about BROKEN: because they will start building after meeting changes coming from net tree during merge window. Right now that driver doesn't compile :(

Signature · 1 line
Rafał
#4 lore raw
Quoted 7 lines · Rafał Miłecki

2012/9/11 Artem Bityutskiy <[email protected]>:

Quoted 6 lines · Rafał Miłecki
Quoted 5 lines

BCMA bus can contain NAND flash memory, it's registered in system as platform device. This adds required hooks and place for controler specific drivers.
At this point it doesn't work yet, so it's marked as BROKEN.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Why should it be merged upstream as BROKEN and without controller-specific drivers?

Regarding question about BROKEN: because they will start building after meeting changes coming from net tree during merge window. Right now that driver doesn't compile :(

Usually it is solved by pulling the tree we depend on, but we need a permanent branch for this, which will not be re-based.

Signature · 2 lines
Best Regards,
Artem Bityutskiy