diff options
Diffstat (limited to 'drivers/mtd/nand/mxc_nand.c')
-rw-r--r-- | drivers/mtd/nand/mxc_nand.c | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 82e94389824e..0d76b169482f 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -623,8 +623,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, | |||
623 | else | 623 | else |
624 | host->buf_start = column + mtd->writesize; | 624 | host->buf_start = column + mtd->writesize; |
625 | 625 | ||
626 | if (mtd->writesize > 512) | 626 | command = NAND_CMD_READ0; /* only READ0 is valid */ |
627 | command = NAND_CMD_READ0; /* only READ0 is valid */ | ||
628 | 627 | ||
629 | send_cmd(host, command, false); | 628 | send_cmd(host, command, false); |
630 | mxc_do_addr_cycle(mtd, column, page_addr); | 629 | mxc_do_addr_cycle(mtd, column, page_addr); |
@@ -639,31 +638,11 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, | |||
639 | break; | 638 | break; |
640 | 639 | ||
641 | case NAND_CMD_SEQIN: | 640 | case NAND_CMD_SEQIN: |
642 | if (column >= mtd->writesize) { | 641 | if (column >= mtd->writesize) |
643 | /* | 642 | /* call ourself to read a page */ |
644 | * FIXME: before send SEQIN command for write OOB, | 643 | mxc_nand_command(mtd, NAND_CMD_READ0, 0, page_addr); |
645 | * We must read one page out. | ||
646 | * For K9F1GXX has no READ1 command to set current HW | ||
647 | * pointer to spare area, we must write the whole page | ||
648 | * including OOB together. | ||
649 | */ | ||
650 | if (mtd->writesize > 512) | ||
651 | /* call ourself to read a page */ | ||
652 | mxc_nand_command(mtd, NAND_CMD_READ0, 0, | ||
653 | page_addr); | ||
654 | |||
655 | host->buf_start = column; | ||
656 | |||
657 | /* Set program pointer to spare region */ | ||
658 | if (mtd->writesize == 512) | ||
659 | send_cmd(host, NAND_CMD_READOOB, false); | ||
660 | } else { | ||
661 | host->buf_start = column; | ||
662 | 644 | ||
663 | /* Set program pointer to page start */ | 645 | host->buf_start = column; |
664 | if (mtd->writesize == 512) | ||
665 | send_cmd(host, NAND_CMD_READ0, false); | ||
666 | } | ||
667 | 646 | ||
668 | send_cmd(host, command, false); | 647 | send_cmd(host, command, false); |
669 | mxc_do_addr_cycle(mtd, column, page_addr); | 648 | mxc_do_addr_cycle(mtd, column, page_addr); |
@@ -853,6 +832,8 @@ static int __init mxcnd_probe(struct platform_device *pdev) | |||
853 | parse_mtd_partitions(mtd, part_probes, &host->parts, 0); | 832 | parse_mtd_partitions(mtd, part_probes, &host->parts, 0); |
854 | if (nr_parts > 0) | 833 | if (nr_parts > 0) |
855 | add_mtd_partitions(mtd, host->parts, nr_parts); | 834 | add_mtd_partitions(mtd, host->parts, nr_parts); |
835 | else if (pdata->parts) | ||
836 | add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts); | ||
856 | else | 837 | else |
857 | #endif | 838 | #endif |
858 | { | 839 | { |