Skip to contentSkip to conversation

mtd: msm_nand: Add initial msm nand driver support.

PATCH New Murali Nalajala 5 participants 8 messages Dec 31, 2010 – Jan 6, 2011

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

PATCH 1/1 mtd: msm_nand: Add initial msm nand driver support.

From: Arve Hjønnevåg <[email protected]>

Add initial msm nand driver support for Qualcomm MSM and QSD platforms. This driver is currently capable of handling 2K page nand devices.

This driver is originally
developed by Google and its source is available at
http://android.git.kernel.org/?p=kernel/experimental.git

---
 drivers/mtd/devices/Kconfig    |   10 +
 drivers/mtd/devices/Makefile   |    1 +
 drivers/mtd/devices/msm_nand.c | 1281 ++++++++++++++++++++++++++++++++++++++++
 drivers/mtd/devices/msm_nand.h |   75 +++
 4 files changed, 1367 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/devices/msm_nand.c
 create mode 100644 drivers/mtd/devices/msm_nand.h
drivers/mtd/devices/Kconfig +10 -0
index 35081ce..bcf851f 100644
@@ -49,6 +49,16 @@ config MTD_MS02NV
 	  say M here and read <file:Documentation/kbuild/modules.txt>.
 	  The module will be called ms02-nv.
 
+config MTD_MSM_NAND
+	tristate "MSM on-chip NAND Flash Controller driver"
+	depends on MTD && ARCH_MSM
+	help
+	  This enables the on-chip NAND flash controller driver on Qualcomm's
+	  MSM and QSD platforms.
+
+	  MSM NAND controller is capable of interface to all leading nand
+	  flash vendor devices ie Samsung, Micron, Hynix etc.
+
 config MTD_DATAFLASH
 	tristate "Support for AT45xxx DataFlash"
 	depends on SPI_MASTER && EXPERIMENTAL
drivers/mtd/devices/Makefile +1 -0
index f3226b1..fe959e8 100644
@@ -11,6 +11,7 @@ obj-$(CONFIG_MTD_SLRAM)		+= slram.o
 obj-$(CONFIG_MTD_PHRAM)		+= phram.o
 obj-$(CONFIG_MTD_PMC551)	+= pmc551.o
 obj-$(CONFIG_MTD_MS02NV)	+= ms02-nv.o
+obj-$(CONFIG_MTD_MSM_NAND)	+= msm_nand.o
 obj-$(CONFIG_MTD_MTDRAM)	+= mtdram.o
 obj-$(CONFIG_MTD_LART)		+= lart.o
 obj-$(CONFIG_MTD_BLOCK2MTD)	+= block2mtd.o
drivers/mtd/devices/msm_nand.c new file +1281 -0

1,281 lines not on this page · raw message

drivers/mtd/devices/msm_nand.h new file +75 -0

75 lines not on this page · raw message

--
1.7.3.4

--
Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

#1 lore raw

PATCH 1/1 mtd: msm_nand: Add initial msm nand driver support.

Quoted 5 lines · Murali Nalajala

From: Arve Hj?nnev?g <[email protected]>

Add initial msm nand driver support for Qualcomm MSM and QSD platforms. This driver is currently capable of handling 2K page nand devices.

Quoted 7 lines

This driver is originally
developed by Google and its source is available at
http://android.git.kernel.org/?p=kernel/experimental.git

Pushed to l2-mtd-2.6.git.

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

PATCH 1/1 mtd: msm_nand: Add initial msm nand driver support.

Quoted 10 lines · Artem Bityutskiy
Quoted 9 lines · Murali Nalajala

From: Arve Hj?nnev?g <[email protected]>

Add initial msm nand driver support for Qualcomm MSM and QSD platforms. This driver is currently capable of handling 2K page nand devices.

This driver is originally
developed by Google and its source is available at
http://android.git.kernel.org/?p=kernel/experimental.git

Quoted 5 lines
Quoted 3 lines

Pushed to l2-mtd-2.6.git.

This patch had incorrect authorship .. Can you replace it with the second one that was sent ?

Daniel

Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#3 lore raw

PATCH 1/1 mtd: msm_nand: Add initial msm nand driver support.

Quoted 11 lines · Daniel Walker
Quoted 10 lines · Artem Bityutskiy
Quoted 9 lines · Murali Nalajala

From: Arve Hj?nnev?g <[email protected]>

Add initial msm nand driver support for Qualcomm MSM and QSD platforms. This driver is currently capable of handling 2K page nand devices.

This driver is originally
developed by Google and its source is available at
http://android.git.kernel.org/?p=kernel/experimental.git

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Pushed to l2-mtd-2.6.git.

This patch had incorrect authorship .. Can you replace it with the second one that was sent ?

Yes, I did that actually, noticed the second one later.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (???????? ?????)
#4 lore raw

PATCH 1/1 mtd: msm_nand: Add initial msm nand driver support.

Quoted 16 lines · Artem Bityutskiy
Quoted 15 lines · Daniel Walker
Quoted 14 lines · Artem Bityutskiy
Quoted 12 lines · Murali Nalajala

From: Arve Hj?nnev?g <[email protected]>

Add initial msm nand driver support for Qualcomm MSM and QSD platforms. This driver is currently capable of handling 2K page nand devices.

This driver is originally
developed by Google and its source is available at
http://android.git.kernel.org/?p=kernel/experimental.git

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Pushed to l2-mtd-2.6.git.

This patch had incorrect authorship .. Can you replace it with the second one that was sent ?

Yes, I did that actually, noticed the second one later.

Is it too late for you to drop this ? It's got some additional issues that we need some time to address ..

Daniel

Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#5 lore raw

PATCH 1/1 mtd: msm_nand: Add initial msm nand driver support.

Quoted 19 lines · Daniel Walker
Quoted 18 lines · Artem Bityutskiy
Quoted 17 lines · Daniel Walker
Quoted 15 lines · Artem Bityutskiy
Quoted 5 lines · Murali Nalajala

From: Arve Hj?nnev?g <[email protected]>

Add initial msm nand driver support for Qualcomm MSM and QSD platforms. This driver is currently capable of handling 2K page nand devices.

Quoted 7 lines

This driver is originally
developed by Google and its source is available at
http://android.git.kernel.org/?p=kernel/experimental.git

Pushed to l2-mtd-2.6.git.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

This patch had incorrect authorship .. Can you replace it with the second one that was sent ?

Yes, I did that actually, noticed the second one later.

Is it too late for you to drop this ? It's got some additional issues that we need some time to address ..

Sure, I do not merge stuff to upstream, I barely take it to my tree to make sure David Woodhouse does not miss it. Everything he does not merge to mtd tree is automatically dropped from my l2-mtd then.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (???????? ?????)
#6 lore raw

PATCH 1/1 mtd: msm_nand: Add initial msm nand driver support.

In reply to Murali Nalajala

drivers/mtd/devices/msm_nand.h line 67

Quoted 3 lines · Murali Nalajala
drivers/mtd/devices/msm_nand.h new file +2 -0
+#define NAND_CMD_STATUS             0x0C
+#define NAND_CMD_RESET              0x0D 

Er, what?

Signature · 2 lines
David Woodhouse                            Open Source Technology Centre
David.Woodhouse at intel.com                              Intel Corporation
#7 lore raw

PATCH 1/1 mtd: msm_nand: Add initial msm nand driver support.

In reply to Murali Nalajala

drivers/mtd/devices/msm_nand.c line 1192

Quoted 9 lines · Murali Nalajala
drivers/mtd/devices/msm_nand.c new file +9 -0
+	info->msm_nand.dev = &pdev->dev;
+
+	init_waitqueue_head(&info->msm_nand.wait_queue);
+
+	info->msm_nand.dma_channel = res->start;
+	pr_debug("dma channel 0x%x\n", info->msm_nand.dma_channel);
+	info->msm_nand.dma_buffer =
+		dma_alloc_coherent(NULL, MSM_NAND_DMA_BUFFER_SIZE,
+				   &info->msm_nand.dma_addr, GFP_KERNEL);

Haven't you got a struct device for this (&pdev->dev) ?

Quoted 27 lines
drivers/mtd/devices/msm_nand.c new file +27 -0
+	if (info->msm_nand.dma_buffer == NULL) {
+		err = -ENOMEM;
+		goto out_free_info;
+	}
+
+	pr_debug("allocated dma buffer at %p, dma_addr %x\n",
+		info->msm_nand.dma_buffer, info->msm_nand.dma_addr);
+
+	info->mtd.name = dev_name(&pdev->dev);
+	info->mtd.priv = &info->msm_nand;
+	info->mtd.owner = THIS_MODULE;
+
+	if (msm_nand_scan(&info->mtd, 1)) {
+		err = -ENXIO;
+		goto out_free_dma_buffer;
+	}
+
+#ifdef CONFIG_MTD_PARTITIONS
+	err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0);
+	if (err > 0)
+		err = add_mtd_partitions(&info->mtd, info->parts, err);
+	else if (err <= 0 && pdata && pdata->parts)
+		err = add_mtd_partitions(&info->mtd, pdata->parts,
+					 pdata->nr_parts);
+	else
+#endif
+		err = add_mtd_device(&info->mtd);

drivers/mtd/devices/msm_nand.c line 1229

Quoted 10 lines
drivers/mtd/devices/msm_nand.c new file +10 -0
+
+	if (err != 0)
+		goto out_free_dma_buffer;
+
+	platform_set_drvdata(pdev, info);
+
+	return 0;
+
+out_free_dma_buffer:
+	dma_free_coherent(NULL, MSM_NAND_DMA_BUFFER_SIZE,

Ditto.

Quoted 12 lines
drivers/mtd/devices/msm_nand.c new file +12 -0
+			  info->msm_nand.dma_buffer, info->msm_nand.dma_addr);
+out_free_info:
+	kfree(info);
+
+	return err;
+}
+
+static int __devexit msm_nand_remove(struct platform_device *pdev)
+{
+	struct msm_nand_info *info = platform_get_drvdata(pdev);
+
+	platform_set_drvdata(pdev, NULL);

drivers/mtd/devices/msm_nand.c line 1251

Quoted 10 lines
drivers/mtd/devices/msm_nand.c new file +10 -0
+
+#ifdef CONFIG_MTD_PARTITIONS
+	if (info->parts)
+		del_mtd_partitions(&info->mtd);
+	else
+#endif
+		del_mtd_device(&info->mtd);
+
+	msm_nand_release(&info->mtd);
+	dma_free_coherent(NULL, MSM_NAND_DMA_BUFFER_SIZE,

Ditto.