diff options
-rw-r--r-- | drivers/mmc/host/Kconfig | 10 | ||||
-rw-r--r-- | drivers/mmc/host/mxcmmc.c | 133 |
2 files changed, 94 insertions, 49 deletions
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index f83f2454e33b..9ab8f8dee942 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig | |||
@@ -320,12 +320,12 @@ config MMC_MSM | |||
320 | support for SDIO devices. | 320 | support for SDIO devices. |
321 | 321 | ||
322 | config MMC_MXC | 322 | config MMC_MXC |
323 | tristate "Freescale i.MX21/27/31 Multimedia Card Interface support" | 323 | tristate "Freescale i.MX21/27/31 or MPC512x Multimedia Card support" |
324 | depends on ARCH_MXC | 324 | depends on ARCH_MXC || PPC_MPC512x |
325 | help | 325 | help |
326 | This selects the Freescale i.MX21, i.MX27 and i.MX31 Multimedia card | 326 | This selects the Freescale i.MX21, i.MX27, i.MX31 or MPC512x |
327 | Interface. If you have a i.MX platform with a Multimedia Card slot, | 327 | Multimedia Card Interface. If you have an i.MX or MPC512x platform |
328 | say Y or M here. | 328 | with a Multimedia Card slot, say Y or M here. |
329 | 329 | ||
330 | If unsure, say N. | 330 | If unsure, say N. |
331 | 331 | ||
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index b82e37af3162..3f8d3394197c 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c | |||
@@ -41,7 +41,6 @@ | |||
41 | 41 | ||
42 | #include <asm/dma.h> | 42 | #include <asm/dma.h> |
43 | #include <asm/irq.h> | 43 | #include <asm/irq.h> |
44 | #include <asm/sizes.h> | ||
45 | #include <linux/platform_data/mmc-mxcmmc.h> | 44 | #include <linux/platform_data/mmc-mxcmmc.h> |
46 | 45 | ||
47 | #include <linux/platform_data/dma-imx.h> | 46 | #include <linux/platform_data/dma-imx.h> |
@@ -119,6 +118,7 @@ | |||
119 | enum mxcmci_type { | 118 | enum mxcmci_type { |
120 | IMX21_MMC, | 119 | IMX21_MMC, |
121 | IMX31_MMC, | 120 | IMX31_MMC, |
121 | MPC512X_MMC, | ||
122 | }; | 122 | }; |
123 | 123 | ||
124 | struct mxcmci_host { | 124 | struct mxcmci_host { |
@@ -172,6 +172,9 @@ static struct platform_device_id mxcmci_devtype[] = { | |||
172 | .name = "imx31-mmc", | 172 | .name = "imx31-mmc", |
173 | .driver_data = IMX31_MMC, | 173 | .driver_data = IMX31_MMC, |
174 | }, { | 174 | }, { |
175 | .name = "mpc512x-sdhc", | ||
176 | .driver_data = MPC512X_MMC, | ||
177 | }, { | ||
175 | /* sentinel */ | 178 | /* sentinel */ |
176 | } | 179 | } |
177 | }; | 180 | }; |
@@ -185,6 +188,9 @@ static const struct of_device_id mxcmci_of_match[] = { | |||
185 | .compatible = "fsl,imx31-mmc", | 188 | .compatible = "fsl,imx31-mmc", |
186 | .data = &mxcmci_devtype[IMX31_MMC], | 189 | .data = &mxcmci_devtype[IMX31_MMC], |
187 | }, { | 190 | }, { |
191 | .compatible = "fsl,mpc5121-sdhc", | ||
192 | .data = &mxcmci_devtype[MPC512X_MMC], | ||
193 | }, { | ||
188 | /* sentinel */ | 194 | /* sentinel */ |
189 | } | 195 | } |
190 | }; | 196 | }; |
@@ -195,6 +201,43 @@ static inline int is_imx31_mmc(struct mxcmci_host *host) | |||
195 | return host->devtype == IMX31_MMC; | 201 | return host->devtype == IMX31_MMC; |
196 | } | 202 | } |
197 | 203 | ||
204 | static inline int is_mpc512x_mmc(struct mxcmci_host *host) | ||
205 | { | ||
206 | return host->devtype == MPC512X_MMC; | ||
207 | } | ||
208 | |||
209 | static inline u32 mxcmci_readl(struct mxcmci_host *host, int reg) | ||
210 | { | ||
211 | if (IS_ENABLED(CONFIG_PPC_MPC512x)) | ||
212 | return ioread32be(host->base + reg); | ||
213 | else | ||
214 | return readl(host->base + reg); | ||
215 | } | ||
216 | |||
217 | static inline void mxcmci_writel(struct mxcmci_host *host, u32 val, int reg) | ||
218 | { | ||
219 | if (IS_ENABLED(CONFIG_PPC_MPC512x)) | ||
220 | iowrite32be(val, host->base + reg); | ||
221 | else | ||
222 | writel(val, host->base + reg); | ||
223 | } | ||
224 | |||
225 | static inline u16 mxcmci_readw(struct mxcmci_host *host, int reg) | ||
226 | { | ||
227 | if (IS_ENABLED(CONFIG_PPC_MPC512x)) | ||
228 | return ioread32be(host->base + reg); | ||
229 | else | ||
230 | return readw(host->base + reg); | ||
231 | } | ||
232 | |||
233 | static inline void mxcmci_writew(struct mxcmci_host *host, u16 val, int reg) | ||
234 | { | ||
235 | if (IS_ENABLED(CONFIG_PPC_MPC512x)) | ||
236 | iowrite32be(val, host->base + reg); | ||
237 | else | ||
238 | writew(val, host->base + reg); | ||
239 | } | ||
240 | |||
198 | static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios); | 241 | static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios); |
199 | 242 | ||
200 | static inline void mxcmci_init_ocr(struct mxcmci_host *host) | 243 | static inline void mxcmci_init_ocr(struct mxcmci_host *host) |
@@ -246,14 +289,14 @@ static void mxcmci_softreset(struct mxcmci_host *host) | |||
246 | dev_dbg(mmc_dev(host->mmc), "mxcmci_softreset\n"); | 289 | dev_dbg(mmc_dev(host->mmc), "mxcmci_softreset\n"); |
247 | 290 | ||
248 | /* reset sequence */ | 291 | /* reset sequence */ |
249 | writew(STR_STP_CLK_RESET, host->base + MMC_REG_STR_STP_CLK); | 292 | mxcmci_writew(host, STR_STP_CLK_RESET, MMC_REG_STR_STP_CLK); |
250 | writew(STR_STP_CLK_RESET | STR_STP_CLK_START_CLK, | 293 | mxcmci_writew(host, STR_STP_CLK_RESET | STR_STP_CLK_START_CLK, |
251 | host->base + MMC_REG_STR_STP_CLK); | 294 | MMC_REG_STR_STP_CLK); |
252 | 295 | ||
253 | for (i = 0; i < 8; i++) | 296 | for (i = 0; i < 8; i++) |
254 | writew(STR_STP_CLK_START_CLK, host->base + MMC_REG_STR_STP_CLK); | 297 | mxcmci_writew(host, STR_STP_CLK_START_CLK, MMC_REG_STR_STP_CLK); |
255 | 298 | ||
256 | writew(0xff, host->base + MMC_REG_RES_TO); | 299 | mxcmci_writew(host, 0xff, MMC_REG_RES_TO); |
257 | } | 300 | } |
258 | static int mxcmci_setup_dma(struct mmc_host *mmc); | 301 | static int mxcmci_setup_dma(struct mmc_host *mmc); |
259 | 302 | ||
@@ -272,8 +315,8 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data) | |||
272 | host->data = data; | 315 | host->data = data; |
273 | data->bytes_xfered = 0; | 316 | data->bytes_xfered = 0; |
274 | 317 | ||
275 | writew(nob, host->base + MMC_REG_NOB); | 318 | mxcmci_writew(host, nob, MMC_REG_NOB); |
276 | writew(blksz, host->base + MMC_REG_BLK_LEN); | 319 | mxcmci_writew(host, blksz, MMC_REG_BLK_LEN); |
277 | host->datasize = datasize; | 320 | host->datasize = datasize; |
278 | 321 | ||
279 | if (!mxcmci_use_dma(host)) | 322 | if (!mxcmci_use_dma(host)) |
@@ -329,13 +372,13 @@ static void mxcmci_dma_callback(void *data) | |||
329 | 372 | ||
330 | del_timer(&host->watchdog); | 373 | del_timer(&host->watchdog); |
331 | 374 | ||
332 | stat = readl(host->base + MMC_REG_STATUS); | 375 | stat = mxcmci_readl(host, MMC_REG_STATUS); |
333 | writel(stat & ~STATUS_DATA_TRANS_DONE, host->base + MMC_REG_STATUS); | 376 | mxcmci_writel(host, stat & ~STATUS_DATA_TRANS_DONE, MMC_REG_STATUS); |
334 | 377 | ||
335 | dev_dbg(mmc_dev(host->mmc), "%s: 0x%08x\n", __func__, stat); | 378 | dev_dbg(mmc_dev(host->mmc), "%s: 0x%08x\n", __func__, stat); |
336 | 379 | ||
337 | if (stat & STATUS_READ_OP_DONE) | 380 | if (stat & STATUS_READ_OP_DONE) |
338 | writel(STATUS_READ_OP_DONE, host->base + MMC_REG_STATUS); | 381 | mxcmci_writel(host, STATUS_READ_OP_DONE, MMC_REG_STATUS); |
339 | 382 | ||
340 | mxcmci_data_done(host, stat); | 383 | mxcmci_data_done(host, stat); |
341 | } | 384 | } |
@@ -383,12 +426,12 @@ static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd, | |||
383 | spin_lock_irqsave(&host->lock, flags); | 426 | spin_lock_irqsave(&host->lock, flags); |
384 | if (host->use_sdio) | 427 | if (host->use_sdio) |
385 | int_cntr |= INT_SDIO_IRQ_EN; | 428 | int_cntr |= INT_SDIO_IRQ_EN; |
386 | writel(int_cntr, host->base + MMC_REG_INT_CNTR); | 429 | mxcmci_writel(host, int_cntr, MMC_REG_INT_CNTR); |
387 | spin_unlock_irqrestore(&host->lock, flags); | 430 | spin_unlock_irqrestore(&host->lock, flags); |
388 | 431 | ||
389 | writew(cmd->opcode, host->base + MMC_REG_CMD); | 432 | mxcmci_writew(host, cmd->opcode, MMC_REG_CMD); |
390 | writel(cmd->arg, host->base + MMC_REG_ARG); | 433 | mxcmci_writel(host, cmd->arg, MMC_REG_ARG); |
391 | writew(cmdat, host->base + MMC_REG_CMD_DAT_CONT); | 434 | mxcmci_writew(host, cmdat, MMC_REG_CMD_DAT_CONT); |
392 | 435 | ||
393 | return 0; | 436 | return 0; |
394 | } | 437 | } |
@@ -402,7 +445,7 @@ static void mxcmci_finish_request(struct mxcmci_host *host, | |||
402 | spin_lock_irqsave(&host->lock, flags); | 445 | spin_lock_irqsave(&host->lock, flags); |
403 | if (host->use_sdio) | 446 | if (host->use_sdio) |
404 | int_cntr |= INT_SDIO_IRQ_EN; | 447 | int_cntr |= INT_SDIO_IRQ_EN; |
405 | writel(int_cntr, host->base + MMC_REG_INT_CNTR); | 448 | mxcmci_writel(host, int_cntr, MMC_REG_INT_CNTR); |
406 | spin_unlock_irqrestore(&host->lock, flags); | 449 | spin_unlock_irqrestore(&host->lock, flags); |
407 | 450 | ||
408 | host->req = NULL; | 451 | host->req = NULL; |
@@ -477,14 +520,14 @@ static void mxcmci_read_response(struct mxcmci_host *host, unsigned int stat) | |||
477 | if (cmd->flags & MMC_RSP_PRESENT) { | 520 | if (cmd->flags & MMC_RSP_PRESENT) { |
478 | if (cmd->flags & MMC_RSP_136) { | 521 | if (cmd->flags & MMC_RSP_136) { |
479 | for (i = 0; i < 4; i++) { | 522 | for (i = 0; i < 4; i++) { |
480 | a = readw(host->base + MMC_REG_RES_FIFO); | 523 | a = mxcmci_readw(host, MMC_REG_RES_FIFO); |
481 | b = readw(host->base + MMC_REG_RES_FIFO); | 524 | b = mxcmci_readw(host, MMC_REG_RES_FIFO); |
482 | cmd->resp[i] = a << 16 | b; | 525 | cmd->resp[i] = a << 16 | b; |
483 | } | 526 | } |
484 | } else { | 527 | } else { |
485 | a = readw(host->base + MMC_REG_RES_FIFO); | 528 | a = mxcmci_readw(host, MMC_REG_RES_FIFO); |
486 | b = readw(host->base + MMC_REG_RES_FIFO); | 529 | b = mxcmci_readw(host, MMC_REG_RES_FIFO); |
487 | c = readw(host->base + MMC_REG_RES_FIFO); | 530 | c = mxcmci_readw(host, MMC_REG_RES_FIFO); |
488 | cmd->resp[0] = a << 24 | b << 8 | c >> 8; | 531 | cmd->resp[0] = a << 24 | b << 8 | c >> 8; |
489 | } | 532 | } |
490 | } | 533 | } |
@@ -496,7 +539,7 @@ static int mxcmci_poll_status(struct mxcmci_host *host, u32 mask) | |||
496 | unsigned long timeout = jiffies + HZ; | 539 | unsigned long timeout = jiffies + HZ; |
497 | 540 | ||
498 | do { | 541 | do { |
499 | stat = readl(host->base + MMC_REG_STATUS); | 542 | stat = mxcmci_readl(host, MMC_REG_STATUS); |
500 | if (stat & STATUS_ERR_MASK) | 543 | if (stat & STATUS_ERR_MASK) |
501 | return stat; | 544 | return stat; |
502 | if (time_after(jiffies, timeout)) { | 545 | if (time_after(jiffies, timeout)) { |
@@ -520,7 +563,7 @@ static int mxcmci_pull(struct mxcmci_host *host, void *_buf, int bytes) | |||
520 | STATUS_BUF_READ_RDY | STATUS_READ_OP_DONE); | 563 | STATUS_BUF_READ_RDY | STATUS_READ_OP_DONE); |
521 | if (stat) | 564 | if (stat) |
522 | return stat; | 565 | return stat; |
523 | *buf++ = readl(host->base + MMC_REG_BUFFER_ACCESS); | 566 | *buf++ = cpu_to_le32(mxcmci_readl(host, MMC_REG_BUFFER_ACCESS)); |
524 | bytes -= 4; | 567 | bytes -= 4; |
525 | } | 568 | } |
526 | 569 | ||
@@ -532,7 +575,7 @@ static int mxcmci_pull(struct mxcmci_host *host, void *_buf, int bytes) | |||
532 | STATUS_BUF_READ_RDY | STATUS_READ_OP_DONE); | 575 | STATUS_BUF_READ_RDY | STATUS_READ_OP_DONE); |
533 | if (stat) | 576 | if (stat) |
534 | return stat; | 577 | return stat; |
535 | tmp = readl(host->base + MMC_REG_BUFFER_ACCESS); | 578 | tmp = cpu_to_le32(mxcmci_readl(host, MMC_REG_BUFFER_ACCESS)); |
536 | memcpy(b, &tmp, bytes); | 579 | memcpy(b, &tmp, bytes); |
537 | } | 580 | } |
538 | 581 | ||
@@ -548,7 +591,7 @@ static int mxcmci_push(struct mxcmci_host *host, void *_buf, int bytes) | |||
548 | stat = mxcmci_poll_status(host, STATUS_BUF_WRITE_RDY); | 591 | stat = mxcmci_poll_status(host, STATUS_BUF_WRITE_RDY); |
549 | if (stat) | 592 | if (stat) |
550 | return stat; | 593 | return stat; |
551 | writel(*buf++, host->base + MMC_REG_BUFFER_ACCESS); | 594 | mxcmci_writel(host, cpu_to_le32(*buf++), MMC_REG_BUFFER_ACCESS); |
552 | bytes -= 4; | 595 | bytes -= 4; |
553 | } | 596 | } |
554 | 597 | ||
@@ -561,7 +604,7 @@ static int mxcmci_push(struct mxcmci_host *host, void *_buf, int bytes) | |||
561 | return stat; | 604 | return stat; |
562 | 605 | ||
563 | memcpy(&tmp, b, bytes); | 606 | memcpy(&tmp, b, bytes); |
564 | writel(tmp, host->base + MMC_REG_BUFFER_ACCESS); | 607 | mxcmci_writel(host, cpu_to_le32(tmp), MMC_REG_BUFFER_ACCESS); |
565 | } | 608 | } |
566 | 609 | ||
567 | stat = mxcmci_poll_status(host, STATUS_BUF_WRITE_RDY); | 610 | stat = mxcmci_poll_status(host, STATUS_BUF_WRITE_RDY); |
@@ -607,8 +650,8 @@ static void mxcmci_datawork(struct work_struct *work) | |||
607 | datawork); | 650 | datawork); |
608 | int datastat = mxcmci_transfer_data(host); | 651 | int datastat = mxcmci_transfer_data(host); |
609 | 652 | ||
610 | writel(STATUS_READ_OP_DONE | STATUS_WRITE_OP_DONE, | 653 | mxcmci_writel(host, STATUS_READ_OP_DONE | STATUS_WRITE_OP_DONE, |
611 | host->base + MMC_REG_STATUS); | 654 | MMC_REG_STATUS); |
612 | mxcmci_finish_data(host, datastat); | 655 | mxcmci_finish_data(host, datastat); |
613 | 656 | ||
614 | if (host->req->stop) { | 657 | if (host->req->stop) { |
@@ -686,9 +729,11 @@ static irqreturn_t mxcmci_irq(int irq, void *devid) | |||
686 | bool sdio_irq; | 729 | bool sdio_irq; |
687 | u32 stat; | 730 | u32 stat; |
688 | 731 | ||
689 | stat = readl(host->base + MMC_REG_STATUS); | 732 | stat = mxcmci_readl(host, MMC_REG_STATUS); |
690 | writel(stat & ~(STATUS_SDIO_INT_ACTIVE | STATUS_DATA_TRANS_DONE | | 733 | mxcmci_writel(host, |
691 | STATUS_WRITE_OP_DONE), host->base + MMC_REG_STATUS); | 734 | stat & ~(STATUS_SDIO_INT_ACTIVE | STATUS_DATA_TRANS_DONE | |
735 | STATUS_WRITE_OP_DONE), | ||
736 | MMC_REG_STATUS); | ||
692 | 737 | ||
693 | dev_dbg(mmc_dev(host->mmc), "%s: 0x%08x\n", __func__, stat); | 738 | dev_dbg(mmc_dev(host->mmc), "%s: 0x%08x\n", __func__, stat); |
694 | 739 | ||
@@ -698,11 +743,11 @@ static irqreturn_t mxcmci_irq(int irq, void *devid) | |||
698 | 743 | ||
699 | if (mxcmci_use_dma(host) && | 744 | if (mxcmci_use_dma(host) && |
700 | (stat & (STATUS_READ_OP_DONE | STATUS_WRITE_OP_DONE))) | 745 | (stat & (STATUS_READ_OP_DONE | STATUS_WRITE_OP_DONE))) |
701 | writel(STATUS_READ_OP_DONE | STATUS_WRITE_OP_DONE, | 746 | mxcmci_writel(host, STATUS_READ_OP_DONE | STATUS_WRITE_OP_DONE, |
702 | host->base + MMC_REG_STATUS); | 747 | MMC_REG_STATUS); |
703 | 748 | ||
704 | if (sdio_irq) { | 749 | if (sdio_irq) { |
705 | writel(STATUS_SDIO_INT_ACTIVE, host->base + MMC_REG_STATUS); | 750 | mxcmci_writel(host, STATUS_SDIO_INT_ACTIVE, MMC_REG_STATUS); |
706 | mmc_signal_sdio_irq(host->mmc); | 751 | mmc_signal_sdio_irq(host->mmc); |
707 | } | 752 | } |
708 | 753 | ||
@@ -784,7 +829,7 @@ static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios) | |||
784 | prescaler <<= 1; | 829 | prescaler <<= 1; |
785 | } | 830 | } |
786 | 831 | ||
787 | writew((prescaler << 4) | divider, host->base + MMC_REG_CLK_RATE); | 832 | mxcmci_writew(host, (prescaler << 4) | divider, MMC_REG_CLK_RATE); |
788 | 833 | ||
789 | dev_dbg(mmc_dev(host->mmc), "scaler: %d divider: %d in: %d out: %d\n", | 834 | dev_dbg(mmc_dev(host->mmc), "scaler: %d divider: %d in: %d out: %d\n", |
790 | prescaler, divider, clk_in, clk_ios); | 835 | prescaler, divider, clk_in, clk_ios); |
@@ -847,9 +892,9 @@ static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
847 | 892 | ||
848 | if (ios->clock) { | 893 | if (ios->clock) { |
849 | mxcmci_set_clk_rate(host, ios->clock); | 894 | mxcmci_set_clk_rate(host, ios->clock); |
850 | writew(STR_STP_CLK_START_CLK, host->base + MMC_REG_STR_STP_CLK); | 895 | mxcmci_writew(host, STR_STP_CLK_START_CLK, MMC_REG_STR_STP_CLK); |
851 | } else { | 896 | } else { |
852 | writew(STR_STP_CLK_STOP_CLK, host->base + MMC_REG_STR_STP_CLK); | 897 | mxcmci_writew(host, STR_STP_CLK_STOP_CLK, MMC_REG_STR_STP_CLK); |
853 | } | 898 | } |
854 | 899 | ||
855 | host->clock = ios->clock; | 900 | host->clock = ios->clock; |
@@ -886,14 +931,14 @@ static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable) | |||
886 | 931 | ||
887 | spin_lock_irqsave(&host->lock, flags); | 932 | spin_lock_irqsave(&host->lock, flags); |
888 | host->use_sdio = enable; | 933 | host->use_sdio = enable; |
889 | int_cntr = readl(host->base + MMC_REG_INT_CNTR); | 934 | int_cntr = mxcmci_readl(host, MMC_REG_INT_CNTR); |
890 | 935 | ||
891 | if (enable) | 936 | if (enable) |
892 | int_cntr |= INT_SDIO_IRQ_EN; | 937 | int_cntr |= INT_SDIO_IRQ_EN; |
893 | else | 938 | else |
894 | int_cntr &= ~INT_SDIO_IRQ_EN; | 939 | int_cntr &= ~INT_SDIO_IRQ_EN; |
895 | 940 | ||
896 | writel(int_cntr, host->base + MMC_REG_INT_CNTR); | 941 | mxcmci_writel(host, int_cntr, MMC_REG_INT_CNTR); |
897 | spin_unlock_irqrestore(&host->lock, flags); | 942 | spin_unlock_irqrestore(&host->lock, flags); |
898 | } | 943 | } |
899 | 944 | ||
@@ -931,7 +976,7 @@ static void mxcmci_watchdog(unsigned long data) | |||
931 | struct mmc_host *mmc = (struct mmc_host *)data; | 976 | struct mmc_host *mmc = (struct mmc_host *)data; |
932 | struct mxcmci_host *host = mmc_priv(mmc); | 977 | struct mxcmci_host *host = mmc_priv(mmc); |
933 | struct mmc_request *req = host->req; | 978 | struct mmc_request *req = host->req; |
934 | unsigned int stat = readl(host->base + MMC_REG_STATUS); | 979 | unsigned int stat = mxcmci_readl(host, MMC_REG_STATUS); |
935 | 980 | ||
936 | if (host->dma_dir == DMA_FROM_DEVICE) { | 981 | if (host->dma_dir == DMA_FROM_DEVICE) { |
937 | dmaengine_terminate_all(host->dma); | 982 | dmaengine_terminate_all(host->dma); |
@@ -974,7 +1019,7 @@ static int mxcmci_probe(struct platform_device *pdev) | |||
974 | const struct of_device_id *of_id; | 1019 | const struct of_device_id *of_id; |
975 | struct imxmmc_platform_data *pdata = pdev->dev.platform_data; | 1020 | struct imxmmc_platform_data *pdata = pdev->dev.platform_data; |
976 | 1021 | ||
977 | pr_info("i.MX SDHC driver\n"); | 1022 | pr_info("i.MX/MPC512x SDHC driver\n"); |
978 | 1023 | ||
979 | of_id = of_match_device(mxcmci_of_match, &pdev->dev); | 1024 | of_id = of_match_device(mxcmci_of_match, &pdev->dev); |
980 | 1025 | ||
@@ -1060,7 +1105,7 @@ static int mxcmci_probe(struct platform_device *pdev) | |||
1060 | 1105 | ||
1061 | mxcmci_softreset(host); | 1106 | mxcmci_softreset(host); |
1062 | 1107 | ||
1063 | host->rev_no = readw(host->base + MMC_REG_REV_NO); | 1108 | host->rev_no = mxcmci_readw(host, MMC_REG_REV_NO); |
1064 | if (host->rev_no != 0x400) { | 1109 | if (host->rev_no != 0x400) { |
1065 | ret = -ENODEV; | 1110 | ret = -ENODEV; |
1066 | dev_err(mmc_dev(host->mmc), "wrong rev.no. 0x%08x. aborting.\n", | 1111 | dev_err(mmc_dev(host->mmc), "wrong rev.no. 0x%08x. aborting.\n", |
@@ -1072,9 +1117,9 @@ static int mxcmci_probe(struct platform_device *pdev) | |||
1072 | mmc->f_max = clk_get_rate(host->clk_per) >> 1; | 1117 | mmc->f_max = clk_get_rate(host->clk_per) >> 1; |
1073 | 1118 | ||
1074 | /* recommended in data sheet */ | 1119 | /* recommended in data sheet */ |
1075 | writew(0x2db4, host->base + MMC_REG_READ_TO); | 1120 | mxcmci_writew(host, 0x2db4, MMC_REG_READ_TO); |
1076 | 1121 | ||
1077 | writel(host->default_irq_mask, host->base + MMC_REG_INT_CNTR); | 1122 | mxcmci_writel(host, host->default_irq_mask, MMC_REG_INT_CNTR); |
1078 | 1123 | ||
1079 | if (!host->pdata) { | 1124 | if (!host->pdata) { |
1080 | host->dma = dma_request_slave_channel(&pdev->dev, "rx-tx"); | 1125 | host->dma = dma_request_slave_channel(&pdev->dev, "rx-tx"); |