diff options
author | kishore kadiyala <kishore.kadiyala@ti.com> | 2009-09-22 19:45:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:37 -0400 |
commit | 82cf818d54f0a415a031eabd0949a81946445198 (patch) | |
tree | 947295f8136af85acd7e33b7ab01a8e8669c13b8 /arch/arm/mach-omap2/devices.c | |
parent | c99436fb7505ca2427780d7ae49ebb427bb6f374 (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>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 42 |
1 files changed, 37 insertions, 5 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 | **/ |
425 | static void __init omap_hsmmc_reset(void) | 425 | static 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]); |