aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkishore kadiyala <kishore.kadiyala@ti.com>2009-09-22 19:45:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 10:39:37 -0400
commit82cf818d54f0a415a031eabd0949a81946445198 (patch)
tree947295f8136af85acd7e33b7ab01a8e8669c13b8
parentc99436fb7505ca2427780d7ae49ebb427bb6f374 (diff)
omap4: mmc driver support on OMAP4
Add basic support for all 5 MMC controllers on OMAP4. This patch doesn't include mmc-regulator support Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> Cc: Russell King <linux@arm.linux.org.uk> Acked-by: Tony Lindgren <tony@atomide.com> Cc: Hiroshi DOYU <Hiroshi.DOYU@nokia.com> Cc: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/arm/mach-omap2/devices.c42
-rw-r--r--arch/arm/plat-omap/include/mach/irqs.h2
-rw-r--r--arch/arm/plat-omap/include/mach/mmc.h9
-rw-r--r--drivers/mmc/host/Kconfig6
-rw-r--r--drivers/mmc/host/omap_hsmmc.c10
5 files changed, 60 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index a2e915639b72..92009a4c6c86 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -397,7 +397,7 @@ static inline void omap_init_sha1_md5(void) { }
397 397
398/*-------------------------------------------------------------------------*/ 398/*-------------------------------------------------------------------------*/
399 399
400#ifdef CONFIG_ARCH_OMAP3 400#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
401 401
402#define MMCHS_SYSCONFIG 0x0010 402#define MMCHS_SYSCONFIG 0x0010
403#define MMCHS_SYSCONFIG_SWRESET (1 << 1) 403#define MMCHS_SYSCONFIG_SWRESET (1 << 1)
@@ -424,8 +424,8 @@ static struct platform_device dummy_pdev = {
424 **/ 424 **/
425static void __init omap_hsmmc_reset(void) 425static void __init omap_hsmmc_reset(void)
426{ 426{
427 u32 i, nr_controllers = cpu_is_omap34xx() ? OMAP34XX_NR_MMC : 427 u32 i, nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC :
428 OMAP24XX_NR_MMC; 428 (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC);
429 429
430 for (i = 0; i < nr_controllers; i++) { 430 for (i = 0; i < nr_controllers; i++) {
431 u32 v, base = 0; 431 u32 v, base = 0;
@@ -442,8 +442,21 @@ static void __init omap_hsmmc_reset(void)
442 case 2: 442 case 2:
443 base = OMAP3_MMC3_BASE; 443 base = OMAP3_MMC3_BASE;
444 break; 444 break;
445 case 3:
446 if (!cpu_is_omap44xx())
447 return;
448 base = OMAP4_MMC4_BASE;
449 break;
450 case 4:
451 if (!cpu_is_omap44xx())
452 return;
453 base = OMAP4_MMC5_BASE;
454 break;
445 } 455 }
446 456
457 if (cpu_is_omap44xx())
458 base += OMAP4_MMC_REG_OFFSET;
459
447 dummy_pdev.id = i; 460 dummy_pdev.id = i;
448 dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i); 461 dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i);
449 iclk = clk_get(dev, "ick"); 462 iclk = clk_get(dev, "ick");
@@ -581,11 +594,23 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
581 irq = INT_24XX_MMC2_IRQ; 594 irq = INT_24XX_MMC2_IRQ;
582 break; 595 break;
583 case 2: 596 case 2:
584 if (!cpu_is_omap34xx()) 597 if (!cpu_is_omap44xx() && !cpu_is_omap34xx())
585 return; 598 return;
586 base = OMAP3_MMC3_BASE; 599 base = OMAP3_MMC3_BASE;
587 irq = INT_34XX_MMC3_IRQ; 600 irq = INT_34XX_MMC3_IRQ;
588 break; 601 break;
602 case 3:
603 if (!cpu_is_omap44xx())
604 return;
605 base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET;
606 irq = INT_44XX_MMC4_IRQ;
607 break;
608 case 4:
609 if (!cpu_is_omap44xx())
610 return;
611 base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET;
612 irq = INT_44XX_MMC5_IRQ;
613 break;
589 default: 614 default:
590 continue; 615 continue;
591 } 616 }
@@ -593,8 +618,15 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
593 if (cpu_is_omap2420()) { 618 if (cpu_is_omap2420()) {
594 size = OMAP2420_MMC_SIZE; 619 size = OMAP2420_MMC_SIZE;
595 name = "mmci-omap"; 620 name = "mmci-omap";
621 } else if (cpu_is_omap44xx()) {
622 if (i < 3) {
623 base += OMAP4_MMC_REG_OFFSET;
624 irq += IRQ_GIC_START;
625 }
626 size = OMAP4_HSMMC_SIZE;
627 name = "mmci-omap-hs";
596 } else { 628 } else {
597 size = HSMMC_SIZE; 629 size = OMAP3_HSMMC_SIZE;
598 name = "mmci-omap-hs"; 630 name = "mmci-omap-hs";
599 } 631 }
600 omap_mmc_add(name, i, base, size, irq, mmc_data[i]); 632 omap_mmc_add(name, i, base, size, irq, mmc_data[i]);
diff --git a/arch/arm/plat-omap/include/mach/irqs.h b/arch/arm/plat-omap/include/mach/irqs.h
index fb7cb7723990..28a165058b61 100644
--- a/arch/arm/plat-omap/include/mach/irqs.h
+++ b/arch/arm/plat-omap/include/mach/irqs.h
@@ -503,6 +503,7 @@
503#define INT_44XX_FPKA_READY_IRQ (50 + IRQ_GIC_START) 503#define INT_44XX_FPKA_READY_IRQ (50 + IRQ_GIC_START)
504#define INT_44XX_SHA1MD51_IRQ (51 + IRQ_GIC_START) 504#define INT_44XX_SHA1MD51_IRQ (51 + IRQ_GIC_START)
505#define INT_44XX_RNG_IRQ (52 + IRQ_GIC_START) 505#define INT_44XX_RNG_IRQ (52 + IRQ_GIC_START)
506#define INT_44XX_MMC5_IRQ (59 + IRQ_GIC_START)
506#define INT_44XX_I2C3_IRQ (61 + IRQ_GIC_START) 507#define INT_44XX_I2C3_IRQ (61 + IRQ_GIC_START)
507#define INT_44XX_FPKA_ERROR_IRQ (64 + IRQ_GIC_START) 508#define INT_44XX_FPKA_ERROR_IRQ (64 + IRQ_GIC_START)
508#define INT_44XX_PBIAS_IRQ (75 + IRQ_GIC_START) 509#define INT_44XX_PBIAS_IRQ (75 + IRQ_GIC_START)
@@ -511,6 +512,7 @@
511#define INT_44XX_TLL_IRQ (78 + IRQ_GIC_START) 512#define INT_44XX_TLL_IRQ (78 + IRQ_GIC_START)
512#define INT_44XX_PARTHASH_IRQ (79 + IRQ_GIC_START) 513#define INT_44XX_PARTHASH_IRQ (79 + IRQ_GIC_START)
513#define INT_44XX_MMC3_IRQ (94 + IRQ_GIC_START) 514#define INT_44XX_MMC3_IRQ (94 + IRQ_GIC_START)
515#define INT_44XX_MMC4_IRQ (96 + IRQ_GIC_START)
514 516
515 517
516/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and 518/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and
diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/mach/mmc.h
index 939029742758..7229b9593301 100644
--- a/arch/arm/plat-omap/include/mach/mmc.h
+++ b/arch/arm/plat-omap/include/mach/mmc.h
@@ -25,11 +25,18 @@
25 25
26#define OMAP24XX_NR_MMC 2 26#define OMAP24XX_NR_MMC 2
27#define OMAP34XX_NR_MMC 3 27#define OMAP34XX_NR_MMC 3
28#define OMAP44XX_NR_MMC 5
28#define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE 29#define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE
29#define HSMMC_SIZE 0x200 30#define OMAP3_HSMMC_SIZE 0x200
31#define OMAP4_HSMMC_SIZE 0x1000
30#define OMAP2_MMC1_BASE 0x4809c000 32#define OMAP2_MMC1_BASE 0x4809c000
31#define OMAP2_MMC2_BASE 0x480b4000 33#define OMAP2_MMC2_BASE 0x480b4000
32#define OMAP3_MMC3_BASE 0x480ad000 34#define OMAP3_MMC3_BASE 0x480ad000
35#define OMAP4_MMC4_BASE 0x480d1000
36#define OMAP4_MMC5_BASE 0x480d5000
37#define OMAP4_MMC_REG_OFFSET 0x100
38#define HSMMC5 (1 << 4)
39#define HSMMC4 (1 << 3)
33#define HSMMC3 (1 << 2) 40#define HSMMC3 (1 << 2)
34#define HSMMC2 (1 << 1) 41#define HSMMC2 (1 << 1)
35#define HSMMC1 (1 << 0) 42#define HSMMC1 (1 << 0)
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 6f20eb93554b..7cb057f3f883 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -132,11 +132,11 @@ config MMC_OMAP
132 132
133config MMC_OMAP_HS 133config MMC_OMAP_HS
134 tristate "TI OMAP High Speed Multimedia Card Interface support" 134 tristate "TI OMAP High Speed Multimedia Card Interface support"
135 depends on ARCH_OMAP2430 || ARCH_OMAP3 135 depends on ARCH_OMAP2430 || ARCH_OMAP3 || ARCH_OMAP4
136 help 136 help
137 This selects the TI OMAP High Speed Multimedia card Interface. 137 This selects the TI OMAP High Speed Multimedia card Interface.
138 If you have an OMAP2430 or OMAP3 board with a Multimedia Card slot, 138 If you have an OMAP2430 or OMAP3 board or OMAP4 board with a
139 say Y or M here. 139 Multimedia Card slot, say Y or M here.
140 140
141 If unsure, say N. 141 If unsure, say N.
142 142
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index a4dd43f117f0..4487cc097911 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -109,6 +109,8 @@
109#define OMAP_MMC1_DEVID 0 109#define OMAP_MMC1_DEVID 0
110#define OMAP_MMC2_DEVID 1 110#define OMAP_MMC2_DEVID 1
111#define OMAP_MMC3_DEVID 2 111#define OMAP_MMC3_DEVID 2
112#define OMAP_MMC4_DEVID 3
113#define OMAP_MMC5_DEVID 4
112 114
113#define MMC_TIMEOUT_MS 20 115#define MMC_TIMEOUT_MS 20
114#define OMAP_MMC_MASTER_CLOCK 96000000 116#define OMAP_MMC_MASTER_CLOCK 96000000
@@ -1758,6 +1760,14 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
1758 host->dma_line_tx = OMAP34XX_DMA_MMC3_TX; 1760 host->dma_line_tx = OMAP34XX_DMA_MMC3_TX;
1759 host->dma_line_rx = OMAP34XX_DMA_MMC3_RX; 1761 host->dma_line_rx = OMAP34XX_DMA_MMC3_RX;
1760 break; 1762 break;
1763 case OMAP_MMC4_DEVID:
1764 host->dma_line_tx = OMAP44XX_DMA_MMC4_TX;
1765 host->dma_line_rx = OMAP44XX_DMA_MMC4_RX;
1766 break;
1767 case OMAP_MMC5_DEVID:
1768 host->dma_line_tx = OMAP44XX_DMA_MMC5_TX;
1769 host->dma_line_rx = OMAP44XX_DMA_MMC5_RX;
1770 break;
1761 default: 1771 default:
1762 dev_err(mmc_dev(host->mmc), "Invalid MMC id\n"); 1772 dev_err(mmc_dev(host->mmc), "Invalid MMC id\n");
1763 goto err_irq; 1773 goto err_irq;