aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/mxcmmc.c16
-rw-r--r--drivers/mtd/nand/mxc_nand.c33
-rw-r--r--drivers/usb/gadget/fsl_mxc_udc.c2
-rw-r--r--drivers/usb/host/ehci-mxc.c2
4 files changed, 22 insertions, 31 deletions
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index d9d4a72e0ec7..fdf33e837a73 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -119,6 +119,7 @@ struct mxcmci_host {
119 int detect_irq; 119 int detect_irq;
120 int dma; 120 int dma;
121 int do_dma; 121 int do_dma;
122 int default_irq_mask;
122 int use_sdio; 123 int use_sdio;
123 unsigned int power_mode; 124 unsigned int power_mode;
124 struct imxmmc_platform_data *pdata; 125 struct imxmmc_platform_data *pdata;
@@ -228,7 +229,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
228static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd, 229static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd,
229 unsigned int cmdat) 230 unsigned int cmdat)
230{ 231{
231 u32 int_cntr; 232 u32 int_cntr = host->default_irq_mask;
232 unsigned long flags; 233 unsigned long flags;
233 234
234 WARN_ON(host->cmd != NULL); 235 WARN_ON(host->cmd != NULL);
@@ -275,7 +276,7 @@ static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd,
275static void mxcmci_finish_request(struct mxcmci_host *host, 276static void mxcmci_finish_request(struct mxcmci_host *host,
276 struct mmc_request *req) 277 struct mmc_request *req)
277{ 278{
278 u32 int_cntr = 0; 279 u32 int_cntr = host->default_irq_mask;
279 unsigned long flags; 280 unsigned long flags;
280 281
281 spin_lock_irqsave(&host->lock, flags); 282 spin_lock_irqsave(&host->lock, flags);
@@ -585,6 +586,9 @@ static irqreturn_t mxcmci_irq(int irq, void *devid)
585 (stat & (STATUS_DATA_TRANS_DONE | STATUS_WRITE_OP_DONE))) 586 (stat & (STATUS_DATA_TRANS_DONE | STATUS_WRITE_OP_DONE)))
586 mxcmci_data_done(host, stat); 587 mxcmci_data_done(host, stat);
587#endif 588#endif
589 if (host->default_irq_mask &&
590 (stat & (STATUS_CARD_INSERTION | STATUS_CARD_REMOVAL)))
591 mmc_detect_change(host->mmc, msecs_to_jiffies(200));
588 return IRQ_HANDLED; 592 return IRQ_HANDLED;
589} 593}
590 594
@@ -809,6 +813,12 @@ static int mxcmci_probe(struct platform_device *pdev)
809 else 813 else
810 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; 814 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
811 815
816 if (host->pdata && host->pdata->dat3_card_detect)
817 host->default_irq_mask =
818 INT_CARD_INSERTION_EN | INT_CARD_REMOVAL_EN;
819 else
820 host->default_irq_mask = 0;
821
812 host->res = r; 822 host->res = r;
813 host->irq = irq; 823 host->irq = irq;
814 824
@@ -835,7 +845,7 @@ static int mxcmci_probe(struct platform_device *pdev)
835 /* recommended in data sheet */ 845 /* recommended in data sheet */
836 writew(0x2db4, host->base + MMC_REG_READ_TO); 846 writew(0x2db4, host->base + MMC_REG_READ_TO);
837 847
838 writel(0, host->base + MMC_REG_INT_CNTR); 848 writel(host->default_irq_mask, host->base + MMC_REG_INT_CNTR);
839 849
840#ifdef HAS_DMA 850#ifdef HAS_DMA
841 host->dma = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_LOW); 851 host->dma = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_LOW);
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 {
diff --git a/drivers/usb/gadget/fsl_mxc_udc.c b/drivers/usb/gadget/fsl_mxc_udc.c
index d0b8bde59e59..eafa6d2c5ed7 100644
--- a/drivers/usb/gadget/fsl_mxc_udc.c
+++ b/drivers/usb/gadget/fsl_mxc_udc.c
@@ -30,7 +30,7 @@ int fsl_udc_clk_init(struct platform_device *pdev)
30 30
31 pdata = pdev->dev.platform_data; 31 pdata = pdev->dev.platform_data;
32 32
33 if (!cpu_is_mx35()) { 33 if (!cpu_is_mx35() && !cpu_is_mx25()) {
34 mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb"); 34 mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb");
35 if (IS_ERR(mxc_ahb_clk)) 35 if (IS_ERR(mxc_ahb_clk))
36 return PTR_ERR(mxc_ahb_clk); 36 return PTR_ERR(mxc_ahb_clk);
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
index 544ccfd7056e..56f275097e0e 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -182,7 +182,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
182 } 182 }
183 clk_enable(priv->usbclk); 183 clk_enable(priv->usbclk);
184 184
185 if (!cpu_is_mx35()) { 185 if (!cpu_is_mx35() && !cpu_is_mx25()) {
186 priv->ahbclk = clk_get(dev, "usb_ahb"); 186 priv->ahbclk = clk_get(dev, "usb_ahb");
187 if (IS_ERR(priv->ahbclk)) { 187 if (IS_ERR(priv->ahbclk)) {
188 ret = PTR_ERR(priv->ahbclk); 188 ret = PTR_ERR(priv->ahbclk);