aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkishore kadiyala <kishore.kadiyala@ti.com>2010-10-01 19:35:28 -0400
committerTony Lindgren <tony@atomide.com>2010-10-01 19:35:28 -0400
commit91a0b089f8358aec866bc9c69da8b84c77beaaf3 (patch)
tree7f6f3cf2565a618c4a718dc3f6e43da8025440e5
parent531c21ba1a298422ace28efbcdf94d5579a1b702 (diff)
omap4 hsmmc: Register offset handling
In OMAP4, as per new PM programming model, the legacy registers which were there in OMAP3 are all shifted by 0x100 while new one's are added from offset 0 to 0x10. For OMAP4, the register offset appending of 0x100 done in devices.c currently, is moved to driver file.This change fits in for current implementation as well as once the driver undergoes hwmod adaptation. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Madhusudhan Chikkature <madhu.cr@ti.com> Cc: Adrian Hunter <adrian.hunter@nokia.com> Cc: Benoit Cousson <b-cousson@ti.com> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/devices.c8
-rw-r--r--arch/arm/mach-omap2/hsmmc.c4
-rw-r--r--arch/arm/plat-omap/include/plat/mmc.h3
-rw-r--r--drivers/mmc/host/omap_hsmmc.c2
4 files changed, 12 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 9e5d51bee94a..9bd4b3452453 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -817,13 +817,13 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
817 case 3: 817 case 3:
818 if (!cpu_is_omap44xx()) 818 if (!cpu_is_omap44xx())
819 return; 819 return;
820 base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET; 820 base = OMAP4_MMC4_BASE;
821 irq = OMAP44XX_IRQ_MMC4; 821 irq = OMAP44XX_IRQ_MMC4;
822 break; 822 break;
823 case 4: 823 case 4:
824 if (!cpu_is_omap44xx()) 824 if (!cpu_is_omap44xx())
825 return; 825 return;
826 base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET; 826 base = OMAP4_MMC5_BASE;
827 irq = OMAP44XX_IRQ_MMC5; 827 irq = OMAP44XX_IRQ_MMC5;
828 break; 828 break;
829 default: 829 default:
@@ -834,10 +834,8 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
834 size = OMAP2420_MMC_SIZE; 834 size = OMAP2420_MMC_SIZE;
835 name = "mmci-omap"; 835 name = "mmci-omap";
836 } else if (cpu_is_omap44xx()) { 836 } else if (cpu_is_omap44xx()) {
837 if (i < 3) { 837 if (i < 3)
838 base += OMAP4_MMC_REG_OFFSET;
839 irq += OMAP44XX_IRQ_GIC_START; 838 irq += OMAP44XX_IRQ_GIC_START;
840 }
841 size = OMAP4_HSMMC_SIZE; 839 size = OMAP4_HSMMC_SIZE;
842 name = "mmci-omap-hs"; 840 name = "mmci-omap-hs";
843 } else { 841 } else {
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index df1311d93eba..ab78a5a8d9b0 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -266,6 +266,10 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
266 mmc->slots[0].caps = c->caps; 266 mmc->slots[0].caps = c->caps;
267 mmc->slots[0].internal_clock = !c->ext_clock; 267 mmc->slots[0].internal_clock = !c->ext_clock;
268 mmc->dma_mask = 0xffffffff; 268 mmc->dma_mask = 0xffffffff;
269 if (cpu_is_omap44xx())
270 mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
271 else
272 mmc->reg_offset = 0;
269 273
270 mmc->get_context_loss_count = hsmmc_get_context_loss; 274 mmc->get_context_loss_count = hsmmc_get_context_loss;
271 275
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index 2c4629a8d9f2..0ce3099b1eb0 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -71,6 +71,9 @@ struct omap_mmc_platform_data {
71 71
72 u64 dma_mask; 72 u64 dma_mask;
73 73
74 /* Register offset deviation */
75 u16 reg_offset;
76
74 struct omap_mmc_slot_data { 77 struct omap_mmc_slot_data {
75 78
76 /* 4/8 wires and any additional host capabilities 79 /* 4/8 wires and any additional host capabilities
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 69858e750203..dc95756fd95c 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2014,6 +2014,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
2014 if (res == NULL || irq < 0) 2014 if (res == NULL || irq < 0)
2015 return -ENXIO; 2015 return -ENXIO;
2016 2016
2017 res->start += pdata->reg_offset;
2018 res->end += pdata->reg_offset;
2017 res = request_mem_region(res->start, res->end - res->start + 1, 2019 res = request_mem_region(res->start, res->end - res->start + 1,
2018 pdev->name); 2020 pdev->name);
2019 if (res == NULL) 2021 if (res == NULL)