diff options
Diffstat (limited to 'drivers/mtd/nand/bf5xx_nand.c')
-rw-r--r-- | drivers/mtd/nand/bf5xx_nand.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c index 4c2a67ca801e..8506e7e606fd 100644 --- a/drivers/mtd/nand/bf5xx_nand.c +++ b/drivers/mtd/nand/bf5xx_nand.c | |||
@@ -458,7 +458,7 @@ static irqreturn_t bf5xx_nand_dma_irq(int irq, void *dev_id) | |||
458 | return IRQ_HANDLED; | 458 | return IRQ_HANDLED; |
459 | } | 459 | } |
460 | 460 | ||
461 | static int bf5xx_nand_dma_rw(struct mtd_info *mtd, | 461 | static void bf5xx_nand_dma_rw(struct mtd_info *mtd, |
462 | uint8_t *buf, int is_read) | 462 | uint8_t *buf, int is_read) |
463 | { | 463 | { |
464 | struct bf5xx_nand_info *info = mtd_to_nand_info(mtd); | 464 | struct bf5xx_nand_info *info = mtd_to_nand_info(mtd); |
@@ -496,11 +496,20 @@ static int bf5xx_nand_dma_rw(struct mtd_info *mtd, | |||
496 | /* setup DMA register with Blackfin DMA API */ | 496 | /* setup DMA register with Blackfin DMA API */ |
497 | set_dma_config(CH_NFC, 0x0); | 497 | set_dma_config(CH_NFC, 0x0); |
498 | set_dma_start_addr(CH_NFC, (unsigned long) buf); | 498 | set_dma_start_addr(CH_NFC, (unsigned long) buf); |
499 | |||
500 | /* The DMAs have different size on BF52x and BF54x */ | ||
501 | #ifdef CONFIG_BF52x | ||
502 | set_dma_x_count(CH_NFC, (page_size >> 1)); | ||
503 | set_dma_x_modify(CH_NFC, 2); | ||
504 | val = DI_EN | WDSIZE_16; | ||
505 | #endif | ||
506 | |||
507 | #ifdef CONFIG_BF54x | ||
499 | set_dma_x_count(CH_NFC, (page_size >> 2)); | 508 | set_dma_x_count(CH_NFC, (page_size >> 2)); |
500 | set_dma_x_modify(CH_NFC, 4); | 509 | set_dma_x_modify(CH_NFC, 4); |
501 | |||
502 | /* setup write or read operation */ | ||
503 | val = DI_EN | WDSIZE_32; | 510 | val = DI_EN | WDSIZE_32; |
511 | #endif | ||
512 | /* setup write or read operation */ | ||
504 | if (is_read) | 513 | if (is_read) |
505 | val |= WNR; | 514 | val |= WNR; |
506 | set_dma_config(CH_NFC, val); | 515 | set_dma_config(CH_NFC, val); |
@@ -512,8 +521,6 @@ static int bf5xx_nand_dma_rw(struct mtd_info *mtd, | |||
512 | else | 521 | else |
513 | bfin_write_NFC_PGCTL(0x2); | 522 | bfin_write_NFC_PGCTL(0x2); |
514 | wait_for_completion(&info->dma_completion); | 523 | wait_for_completion(&info->dma_completion); |
515 | |||
516 | return 0; | ||
517 | } | 524 | } |
518 | 525 | ||
519 | static void bf5xx_nand_dma_read_buf(struct mtd_info *mtd, | 526 | static void bf5xx_nand_dma_read_buf(struct mtd_info *mtd, |