Skip to contentSkip to conversation

Blackfin NFC Driver: remove pointless return value in bf5xx_nand_dma_rw

PATCH In review Mike Frysinger 3 participants 5 messages May 26, 2009 – Jun 2, 2009

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

PATCH 1/2 Blackfin NFC Driver: remove pointless return value in bf5xx_nand_dma_rw

---
 drivers/mtd/nand/bf5xx_nand.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/mtd/nand/bf5xx_nand.c +1 -3
index 4c2a67c..2ab42d2 100644
@@ -458,7 +458,7 @@ static irqreturn_t bf5xx_nand_dma_irq(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int bf5xx_nand_dma_rw(struct mtd_info *mtd,
+static void bf5xx_nand_dma_rw(struct mtd_info *mtd,
 				uint8_t *buf, int is_read)
 {
 	struct bf5xx_nand_info *info = mtd_to_nand_info(mtd);
@@ -512,8 +512,6 @@ static int bf5xx_nand_dma_rw(struct mtd_info *mtd,
 	else
 		bfin_write_NFC_PGCTL(0x2);
 	wait_for_completion(&info->dma_completion);
-
-	return 0;
 }
 
 static void bf5xx_nand_dma_read_buf(struct mtd_info *mtd,
Signature · 1 line
1.6.3.1
#1 lore raw

PATCH 2/2 Blackfin NFC Driver: fix hang when using NAND on BF527-EZKITs

From: Cliff Cai <[email protected]>

The DMAs have different bit sizes on BF52x and BF54x. From the PHRM:

"The 16-bit DMA Access Bus (DAB) connects the DMA controller to the on-chip peripherals, PPI, SPI, Ethernet MAC, the SPORTs, NFC, HOSTDP and the UARTs."

32-bit DMA won't work for BF52x.

---
 drivers/mtd/nand/bf5xx_nand.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
drivers/mtd/nand/bf5xx_nand.c +11 -2
index 2ab42d2..8506e7e 100644
@@ -496,11 +496,20 @@ static void bf5xx_nand_dma_rw(struct mtd_info *mtd,
 	/* setup DMA register with Blackfin DMA API */
 	set_dma_config(CH_NFC, 0x0);
 	set_dma_start_addr(CH_NFC, (unsigned long) buf);
+
+/* The DMAs have different size on BF52x and BF54x */
+#ifdef CONFIG_BF52x
+	set_dma_x_count(CH_NFC, (page_size >> 1));
+	set_dma_x_modify(CH_NFC, 2);
+	val = DI_EN | WDSIZE_16;
+#endif
+
+#ifdef CONFIG_BF54x
 	set_dma_x_count(CH_NFC, (page_size >> 2));
 	set_dma_x_modify(CH_NFC, 4);
-
-	/* setup write or read operation */
 	val = DI_EN | WDSIZE_32;
+#endif
+	/* setup write or read operation */
 	if (is_read)
 		val |= WNR;
 	set_dma_config(CH_NFC, val);
Signature · 1 line
1.6.3.1
#3 lore raw
Quoted 8 lines · Artem Bityutskiy
Quoted 5 lines · Mike Frysinger

---
 drivers/mtd/nand/bf5xx_nand.c |    4 +---

 1 files changed, 1 insertions(+), 3 deletions(-)

I've taken these 2 patches to my l2-mtd-2.6.git.

looks like a typo was made when you rewrote the subject line ?
http://git.infradead.org/users/dedekind/l2-mtd-2.6.git?a=commit;h=f6f3799ed7d93bbfef8fc96013a22121580ee233
"NFCr" rather than "NFC" ...
-mike

#4 lore raw
Quoted 8 lines · Mike Frysinger
Quoted 7 lines · Artem Bityutskiy
Quoted 5 lines · Mike Frysinger
---
 drivers/mtd/nand/bf5xx_nand.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
Quoted 5 lines
Quoted 1 line

I've taken these 2 patches to my l2-mtd-2.6.git.

looks like a typo was made when you rewrote the subject line ?
http://git.infradead.org/users/dedekind/l2-mtd-2.6.git?a=commit;h=f6f3799ed7d93bbfef8fc96013a22121580ee233
"NFCr" rather than "NFC" ...

Let me re-phrase it as "when you amended the subject line for unification purposes". I'll fix that. This tree is anyway throw-away. I'm just being an intelligent patchwork for dwmw2 in this case. :-)

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)