* OMAP MMC multiport support @ 2008-03-18 12:47 Remith Ravi 2008-03-18 11:52 ` Tony Lindgren 2008-03-18 13:07 ` iqbal 0 siblings, 2 replies; 11+ messages in thread From: Remith Ravi @ 2008-03-18 12:47 UTC (permalink / raw) To: linux-omap Hi, Is there any OMAP MMC driver implementation exist which support multi port implementation? I am working on OMAP-2530 EVM and want to have support for both MMC port 1 and port 2. Please let me know if you have any input. Regards, Remith ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: OMAP MMC multiport support 2008-03-18 12:47 OMAP MMC multiport support Remith Ravi @ 2008-03-18 11:52 ` Tony Lindgren 2008-03-18 13:20 ` Syed Mohammed, Khasim 2008-03-18 13:07 ` iqbal 1 sibling, 1 reply; 11+ messages in thread From: Tony Lindgren @ 2008-03-18 11:52 UTC (permalink / raw) To: Remith Ravi; +Cc: linux-omap * Remith Ravi <remithmailinglist@gmail.com> [080318 14:47]: > Hi, > > Is there any OMAP MMC driver implementation exist which support multi > port implementation? > I am working on OMAP-2530 EVM and want to have support for both MMC > port 1 and port 2. > > Please let me know if you have any input. Well if 2530 has same controller as 2420, then yes, it should be supported by configuring it in board-*.c files. Tony ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: OMAP MMC multiport support 2008-03-18 11:52 ` Tony Lindgren @ 2008-03-18 13:20 ` Syed Mohammed, Khasim 2008-03-18 13:46 ` Seth Forshee 0 siblings, 1 reply; 11+ messages in thread From: Syed Mohammed, Khasim @ 2008-03-18 13:20 UTC (permalink / raw) To: Tony Lindgren, Remith Ravi; +Cc: linux-omap > -----Original Message----- > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- > owner@vger.kernel.org] On Behalf Of Tony Lindgren > Sent: Tuesday, March 18, 2008 5:23 PM > To: Remith Ravi > Cc: linux-omap@vger.kernel.org > Subject: Re: OMAP MMC multiport support > > * Remith Ravi <remithmailinglist@gmail.com> [080318 14:47]: > > Hi, > > > > Is there any OMAP MMC driver implementation exist which support multi > > port implementation? > > I am working on OMAP-2530 EVM and want to have support for both MMC > > port 1 and port 2. > > > > Please let me know if you have any input. > > Well if 2530 has same controller as 2420, then yes, it should be > supported by configuring it in board-*.c files. > 2530 is same as 2430, and the 3430 MMC driver is best fit for that and it supports Multi MMC controllers (and not slots). One controller can be connected to only one slot on 2530/2430/3530/3430. But I don't see a MMC second slot on EVM, have you customized this board now? Regards, Khasim ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: OMAP MMC multiport support 2008-03-18 13:20 ` Syed Mohammed, Khasim @ 2008-03-18 13:46 ` Seth Forshee 2008-03-18 13:57 ` Syed Mohammed, Khasim 0 siblings, 1 reply; 11+ messages in thread From: Seth Forshee @ 2008-03-18 13:46 UTC (permalink / raw) To: Syed Mohammed, Khasim, Remith Ravi; +Cc: Tony Lindgren, linux-omap On Tue, Mar 18, 2008 at 06:50:39PM +0530, Syed Mohammed, Khasim wrote: > > > > -----Original Message----- > > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- > > owner@vger.kernel.org] On Behalf Of Tony Lindgren > > Sent: Tuesday, March 18, 2008 5:23 PM > > To: Remith Ravi > > Cc: linux-omap@vger.kernel.org > > Subject: Re: OMAP MMC multiport support > > > > * Remith Ravi <remithmailinglist@gmail.com> [080318 14:47]: > > > Hi, > > > > > > Is there any OMAP MMC driver implementation exist which support multi > > > port implementation? > > > I am working on OMAP-2530 EVM and want to have support for both MMC > > > port 1 and port 2. > > > > > > Please let me know if you have any input. > > > > Well if 2530 has same controller as 2420, then yes, it should be > > supported by configuring it in board-*.c files. > > > > 2530 is same as 2430, and the 3430 MMC driver is best fit for that and it supports Multi MMC controllers (and not slots). One controller can be connected to only one slot on 2530/2430/3530/3430. The current code needs a little bit of updating to support the second MMC controller on the 2430. Below is a rough patch with the changes that get it working for me (on a custom board), but it is not based off of the git repo so it's not likely to apply directly. Hopefully it will be helpful as a reference though. Cheers, Seth diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c @@ -230,7 +230,17 @@ static inline void omap_init_kp(void) {} #define OMAP_MMC1_BASE 0xfffb7800 #define OMAP_MMC1_INT INT_MMC #endif + +#if defined(CONFIG_ARCH_OMAP16XX) #define OMAP_MMC2_BASE 0xfffb7c00 /* omap16xx only */ +#define OMAP_MMC2_INT INT_1610_MMC2 +#elif defined CONFIG_ARCH_OMAP2430 +#define OMAP_MMC2_BASE 0x480b4000 +#define OMAP_MMC2_INT INT_24XX_MMC2_IRQ +#endif + +#define OMAP_MMC2_SUPPORT \ + (defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2430)) #if defined(CONFIG_ARCH_OMAP2430) static struct omap_mmc_platform_data mmc1_conf; @@ -263,9 +273,13 @@ static struct platform_device mmc_omap_d .resource = mmc1_resources, }; -#ifdef CONFIG_ARCH_OMAP16XX - +#if OMAP_MMC2_SUPPORT + +#if defined(CONFIG_ARCH_OMAP2430) +static struct omap_mmc_platform_data mmc2_conf; +#else static struct omap_mmc_conf mmc2_conf; +#endif static u64 mmc2_dmamask = 0xffffffff; @@ -277,7 +291,7 @@ static struct resource mmc2_resources[] .flags = IORESOURCE_MEM, }, { - .start = INT_1610_MMC2, + .start = OMAP_MMC2_INT, .flags = IORESOURCE_IRQ, }, }; @@ -304,6 +318,9 @@ static void __init omap_init_mmc(void) if (cpu_is_omap243x()) { if (mmc1_conf.enabled){ (void) platform_device_register(&mmc_omap_device1); + } + if (mmc2_conf.enabled){ + (void) platform_device_register(&mmc_omap_device2); } return; } @@ -405,7 +422,7 @@ void omap_set_mmc_info(int host, const s case 1: mmc1_conf = *info; break; -#ifdef CONFIG_ARCH_OMAP16XX +#ifdef OMAP_MMC2_SUPPORT case 2: mmc2_conf = *info; break; diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -409,7 +409,10 @@ static int omap_mmc_switch_opcond(struct OMAP_HSMMC_READ(host->base, HCTL) & SDVSCLR); reg_val = OMAP_HSMMC_READ(host->base, HCTL); - if (((1 << vdd) == MMC_VDD_33_34) || ((1 << vdd) == MMC_VDD_33_34)) { + /* Only MMC1 supports 3.0V */ + if (host->id == OMAP_MMC1_DEVID && + (((1 << vdd) == MMC_VDD_33_34) || + ((1 << vdd) == MMC_VDD_33_34))) { host->initstr = 0; reg_val |= SDVS30; } @@ -713,6 +716,7 @@ static int omap_mmc_probe(struct platfor struct mmc_omap_host *host = NULL; struct resource *res; int ret = 0, irq; + u32 hctl, capa; printk("\n MMC probe entered \n"); if (pdata == NULL) { @@ -800,11 +804,20 @@ static int omap_mmc_probe(struct platfor if (pdata->wire4) mmc->caps |= MMC_CAP_4_BIT_DATA; + /* Only MMC1 supports 3.0V */ + if (host->id == OMAP_MMC1_DEVID) { + hctl = SDVS30; + capa = VS30 | VS18; + } else { + hctl = SDVS18; + capa = VS18; + } + OMAP_HSMMC_WRITE(host->base, HCTL, - OMAP_HSMMC_READ(host->base, HCTL) | SDVS30); - - OMAP_HSMMC_WRITE(host->base, CAPA,OMAP_HSMMC_READ(host->base, - CAPA) | VS30 | VS18); + OMAP_HSMMC_READ(host->base, HCTL) | hctl); + + OMAP_HSMMC_WRITE(host->base, CAPA, + OMAP_HSMMC_READ(host->base, CAPA) | capa); /* Set the controller to AUTO IDLE mode */ OMAP_HSMMC_WRITE(host->base, SYSCONFIG, ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: OMAP MMC multiport support 2008-03-18 13:46 ` Seth Forshee @ 2008-03-18 13:57 ` Syed Mohammed, Khasim 2008-03-18 14:34 ` Seth Forshee 2008-03-19 18:53 ` Keppler Alecrim 0 siblings, 2 replies; 11+ messages in thread From: Syed Mohammed, Khasim @ 2008-03-18 13:57 UTC (permalink / raw) To: Seth Forshee, Remith Ravi; +Cc: Tony Lindgren, linux-omap > -----Original Message----- > From: Seth Forshee [mailto:seth.forshee@gmail.com] > Sent: Tuesday, March 18, 2008 7:17 PM > To: Syed Mohammed, Khasim; Remith Ravi > Cc: Tony Lindgren; linux-omap@vger.kernel.org > Subject: Re: OMAP MMC multiport support > > The current code needs a little bit of updating to support the second > MMC controller on the 2430. Below is a rough patch with the changes > that get it working for me (on a custom board), but it is not based > off of the git repo so it's not likely to apply directly. Hopefully > it will be helpful as a reference though. > > Cheers, > Seth > Seth, This looks ok to me, can you please do some cleanups and submit this patch to Tony for getting it onto tree? Thanks for the patch. Regards, Khasim ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: OMAP MMC multiport support 2008-03-18 13:57 ` Syed Mohammed, Khasim @ 2008-03-18 14:34 ` Seth Forshee 2008-03-19 5:20 ` Remith Ravi 2008-03-19 18:53 ` Keppler Alecrim 1 sibling, 1 reply; 11+ messages in thread From: Seth Forshee @ 2008-03-18 14:34 UTC (permalink / raw) To: Syed Mohammed, Khasim; +Cc: Remith Ravi, Tony Lindgren, linux-omap On Tue, Mar 18, 2008 at 07:27:00PM +0530, Syed Mohammed, Khasim wrote: > This looks ok to me, can you please do some cleanups and submit this patch to Tony for getting it onto tree? Sure, I'll try to look into it later today. I won't be able to test it against the current git repo beyond ensuring it builds though because my organization is back a little bit on kernel versions, and I can't take the time right now to port my board support to the latest stuff. Cheers, Seth ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: OMAP MMC multiport support 2008-03-18 14:34 ` Seth Forshee @ 2008-03-19 5:20 ` Remith Ravi 0 siblings, 0 replies; 11+ messages in thread From: Remith Ravi @ 2008-03-19 5:20 UTC (permalink / raw) To: Syed Mohammed, Khasim, Remith Ravi, Tony Lindgren, linux-omap On Tue, Mar 18, 2008 at 8:04 PM, Seth Forshee <seth.forshee@gmail.com> wrote: > On Tue, Mar 18, 2008 at 07:27:00PM +0530, Syed Mohammed, Khasim wrote: > > This looks ok to me, can you please do some cleanups and submit this patch to Tony for getting it onto tree? > > Sure, I'll try to look into it later today. I won't be able to test > it against the current git repo beyond ensuring it builds though > because my organization is back a little bit on kernel versions, and I > can't take the time right now to port my board support to the latest > stuff. > > Cheers, > Seth > Thank you Seth. Thank you all. Regards, Remith Mistral Solutions. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: OMAP MMC multiport support 2008-03-18 13:57 ` Syed Mohammed, Khasim 2008-03-18 14:34 ` Seth Forshee @ 2008-03-19 18:53 ` Keppler Alecrim 2008-03-19 21:11 ` Seth Forshee 1 sibling, 1 reply; 11+ messages in thread From: Keppler Alecrim @ 2008-03-19 18:53 UTC (permalink / raw) To: Syed Mohammed, Khasim Cc: Seth Forshee, Remith Ravi, Tony Lindgren, linux-omap What about DMA channel? Isn't it necessary? diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 3d4a7d1..262d846 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -514,10 +514,18 @@ mmc_omap_start_dma_transfer(struct mmc_omap_host *host, struct mmc_request *req) if (!(data->flags & MMC_DATA_WRITE)) { host->dma_dir = DMA_FROM_DEVICE; - sync_dev = OMAP24XX_DMA_MMC1_RX; + if (host->id == OMAP_MMC1_DEVID) + sync_dev = OMAP24XX_DMA_MMC1_RX; + else + sync_dev = OMAP24XX_DMA_MMC2_RX; + } else { host->dma_dir = DMA_TO_DEVICE; - sync_dev = OMAP24XX_DMA_MMC1_TX; + if (host->id == OMAP_MMC1_DEVID) + sync_dev = OMAP24XX_DMA_MMC1_TX; + else + sync_dev = OMAP24XX_DMA_MMC2_TX; + } On Tue, Mar 18, 2008 at 3:57 PM, Syed Mohammed, Khasim <khasim@ti.com> wrote: > > > > -----Original Message----- > > From: Seth Forshee [mailto:seth.forshee@gmail.com] > > Sent: Tuesday, March 18, 2008 7:17 PM > > To: Syed Mohammed, Khasim; Remith Ravi > > Cc: Tony Lindgren; linux-omap@vger.kernel.org > > Subject: Re: OMAP MMC multiport support > > > > > The current code needs a little bit of updating to support the second > > MMC controller on the 2430. Below is a rough patch with the changes > > that get it working for me (on a custom board), but it is not based > > off of the git repo so it's not likely to apply directly. Hopefully > > it will be helpful as a reference though. > > > > Cheers, > > Seth > > > Seth, > > This looks ok to me, can you please do some cleanups and submit this patch to Tony for getting it onto tree? > > Thanks for the patch. > > Regards, > Khasim > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- -- Francisco Keppler Silva Alecrim OSMRC - INdT - Manaus http://franciscoalecrim.com/ ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: OMAP MMC multiport support 2008-03-19 18:53 ` Keppler Alecrim @ 2008-03-19 21:11 ` Seth Forshee 0 siblings, 0 replies; 11+ messages in thread From: Seth Forshee @ 2008-03-19 21:11 UTC (permalink / raw) To: Keppler Alecrim Cc: Syed Mohammed, Khasim, Remith Ravi, Tony Lindgren, linux-omap On Wed, Mar 19, 2008 at 08:53:48PM +0200, Keppler Alecrim wrote: > What about DMA channel? Isn't it necessary? > > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c > index 3d4a7d1..262d846 100644 > --- a/drivers/mmc/host/omap_hsmmc.c > +++ b/drivers/mmc/host/omap_hsmmc.c > @@ -514,10 +514,18 @@ mmc_omap_start_dma_transfer(struct mmc_omap_host > *host, struct mmc_request *req) > > if (!(data->flags & MMC_DATA_WRITE)) { > host->dma_dir = DMA_FROM_DEVICE; > - sync_dev = OMAP24XX_DMA_MMC1_RX; > + if (host->id == OMAP_MMC1_DEVID) > + sync_dev = OMAP24XX_DMA_MMC1_RX; > + else > + sync_dev = OMAP24XX_DMA_MMC2_RX; > + > } else { > host->dma_dir = DMA_TO_DEVICE; > - sync_dev = OMAP24XX_DMA_MMC1_TX; > + if (host->id == OMAP_MMC1_DEVID) > + sync_dev = OMAP24XX_DMA_MMC1_TX; > + else > + sync_dev = OMAP24XX_DMA_MMC2_TX; > + > } Indeed. The kernel I'm working with already had this though. Okay, I checked other differences between in the omap_hsmmc.c that I'm working with and didn't find anything necessary for MMC2. I've incorporated this into the patch below, which I think is everything needed to get MMC2 working. This should emphasize the point that someone needs to test with this patch, as I am unable to test it myself. I would also like someone familiar with both OMAP 2430 and 2420 to look at the pin-muxing changes in the patch. I found that some pins were being set up in the MMC1 configuration with the same configuration register offsets as those for MMC2. I assumed that those were for the 2420 and modified the MMC1 initialization accordingly. If these changes are correct I will break them out into a separate patch before I submit. Cheers, Seth diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index fb639f5..48704b2 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -210,6 +210,14 @@ MUX_CFG_24XX("AC10_2430_MCBSP2_FSX_OFF",0x012E, 0, 0, 0, 1) MUX_CFG_24XX("AD16_2430_MCBSP2_CLX_OFF",0x012F, 0, 0, 0, 1) MUX_CFG_24XX("AE13_2430_MCBSP2_DX_OFF", 0x0130, 0, 0, 0, 1) MUX_CFG_24XX("AD13_2430_MCBSP2_DR_OFF", 0x0131, 0, 0, 0, 1) + +/* MMC2 */ +MUX_CFG_24XX("V26_2430_MMC2_CLKO", 0x0f9, 0, 0, 0, 1) +MUX_CFG_24XX("V24_2430_MMC2_DAT3", 0x0fa, 0, 0, 0, 1) +MUX_CFG_24XX("W20_2430_MMC2_CMD", 0x0fb, 0, 0, 0, 1) +MUX_CFG_24XX("V23_2430_MMC2_DAT0", 0x0fc, 0, 0, 0, 1) +MUX_CFG_24XX("V25_2430_MMC2_DAT2", 0x0fd, 0, 0, 0, 1) +MUX_CFG_24XX("Y24_2430_MMC2_DAT1", 0x0fe, 0, 0, 0, 1) }; #define OMAP24XX_PINS_SZ ARRAY_SIZE(omap24xx_pins) diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index ec9a999..1859ed4 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c @@ -161,7 +161,17 @@ static inline void omap_init_kp(void) {} #define OMAP_MMC1_BASE 0xfffb7800 #define OMAP_MMC1_INT INT_MMC #endif -#define OMAP_MMC2_BASE 0xfffb7c00 /* omap16xx only */ + +#if defined(CONFIG_ARCH_OMAP16XX) +#define OMAP_MMC2_BASE 0xfffb7c00 +#define OMAP_MMC2_INT INT_1610_MMC2 +#elif defined(CONFIG_ARCH_OMAP2430) +#define OMAP_MMC2_BASE 0x480b4000 +#define OMAP_MMC2_INT INT_24XX_MMC2_IRQ +#endif + +#define OMAP_MMC2_SUPPORT \ + (defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2430)) static struct omap_mmc_platform_data mmc1_data; @@ -190,7 +200,7 @@ static struct platform_device mmc_omap_device1 = { .resource = mmc1_resources, }; -#ifdef CONFIG_ARCH_OMAP16XX +#if OMAP_MMC2_SUPPORT static struct omap_mmc_platform_data mmc2_data; @@ -204,7 +214,7 @@ static struct resource mmc2_resources[] = { .flags = IORESOURCE_MEM, }, { - .start = INT_1610_MMC2, + .start = OMAP_MMC2_INT, .flags = IORESOURCE_IRQ, }, }; @@ -243,11 +253,13 @@ static void __init omap_init_mmc(void) if (mmc->enabled) { if (cpu_is_omap24xx()) { omap_cfg_reg(H18_24XX_MMC_CMD); - omap_cfg_reg(H15_24XX_MMC_CLKI); omap_cfg_reg(G19_24XX_MMC_CLKO); omap_cfg_reg(F20_24XX_MMC_DAT0); - omap_cfg_reg(F19_24XX_MMC_DAT_DIR0); - omap_cfg_reg(G18_24XX_MMC_CMD_DIR); + if (cpu_is_omap242x()) { + omap_cfg_reg(H15_24XX_MMC_CLKI); + omap_cfg_reg(F19_24XX_MMC_DAT_DIR0); + omap_cfg_reg(G18_24XX_MMC_CMD_DIR); + } } else { omap_cfg_reg(MMC_CMD); omap_cfg_reg(MMC_CLK); @@ -263,9 +275,11 @@ static void __init omap_init_mmc(void) omap_cfg_reg(H14_24XX_MMC_DAT1); omap_cfg_reg(E19_24XX_MMC_DAT2); omap_cfg_reg(D19_24XX_MMC_DAT3); - omap_cfg_reg(E20_24XX_MMC_DAT_DIR1); - omap_cfg_reg(F18_24XX_MMC_DAT_DIR2); - omap_cfg_reg(E18_24XX_MMC_DAT_DIR3); + if (cpu_is_omap242x()) { + omap_cfg_reg(E20_24XX_MMC_DAT_DIR1); + omap_cfg_reg(F18_24XX_MMC_DAT_DIR2); + omap_cfg_reg(E18_24XX_MMC_DAT_DIR3); + } } else { omap_cfg_reg(MMC_DAT1); /* NOTE: DAT2 can be on W10 (here) or M15 */ @@ -291,25 +305,39 @@ static void __init omap_init_mmc(void) (void) platform_device_register(&mmc_omap_device1); } -#ifdef CONFIG_ARCH_OMAP16XX +#if OMAP_MMC2_SUPPORT /* block 2 is on newer chips, and has many pinout options */ mmc = &mmc_conf->mmc[1]; if (mmc->enabled) { if (!mmc->nomux) { - omap_cfg_reg(Y8_1610_MMC2_CMD); - omap_cfg_reg(Y10_1610_MMC2_CLK); - omap_cfg_reg(R18_1610_MMC2_CLKIN); - omap_cfg_reg(W8_1610_MMC2_DAT0); + if (cpu_is_omap243x()) { + omap_cfg_reg(V26_2430_MMC2_CLKO); + omap_cfg_reg(W20_2430_MMC2_CMD); + omap_cfg_reg(V23_2430_MMC2_DAT0); + } else { + omap_cfg_reg(Y8_1610_MMC2_CMD); + omap_cfg_reg(Y10_1610_MMC2_CLK); + omap_cfg_reg(R18_1610_MMC2_CLKIN); + omap_cfg_reg(W8_1610_MMC2_DAT0); + } if (mmc->wire4) { - omap_cfg_reg(V8_1610_MMC2_DAT1); - omap_cfg_reg(W15_1610_MMC2_DAT2); - omap_cfg_reg(R10_1610_MMC2_DAT3); + if (cpu_is_omap243x()) { + omap_cfg_reg(Y24_2430_MMC2_DAT1); + omap_cfg_reg(V25_2430_MMC2_DAT2); + omap_cfg_reg(V24_2430_MMC2_DAT3); + } else { + omap_cfg_reg(V8_1610_MMC2_DAT1); + omap_cfg_reg(W15_1610_MMC2_DAT2); + omap_cfg_reg(R10_1610_MMC2_DAT3); + } } /* These are needed for the level shifter */ - omap_cfg_reg(V9_1610_MMC2_CMDDIR); - omap_cfg_reg(V5_1610_MMC2_DATDIR0); - omap_cfg_reg(W19_1610_MMC2_DATDIR1); + if (cpu_is_omap16xx()) { + omap_cfg_reg(V9_1610_MMC2_CMDDIR); + omap_cfg_reg(V5_1610_MMC2_DATDIR0); + omap_cfg_reg(W19_1610_MMC2_DATDIR1); + } } /* Feedback clock must be set on OMAP-1710 MMC2 */ diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 3d4a7d1..0f1bb9c 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -388,8 +388,12 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd) * If a MMC dual voltage card is detected, the set_ios fn calls * this fn with VDD bit set for 1.8V. Upon card removal from the * slot, mmc_omap_detect fn sets the VDD back to 3V. + * + * Only MMC1 supports 3.0V. MMC2 will not function if SDVS30 is + * set in HCTL. */ - if (((1 << vdd) == MMC_VDD_32_33) || ((1 << vdd) == MMC_VDD_33_34)) + if (host->id == OMAP_MMC1_DEVID && (((1 << vdd) == MMC_VDD_32_33) || + ((1 << vdd) == MMC_VDD_33_34))) reg_val |= SDVS30; if ((1 << vdd) == MMC_VDD_165_195) reg_val |= SDVS18; @@ -514,10 +518,16 @@ mmc_omap_start_dma_transfer(struct mmc_omap_host *host, struct mmc_request *req) if (!(data->flags & MMC_DATA_WRITE)) { host->dma_dir = DMA_FROM_DEVICE; - sync_dev = OMAP24XX_DMA_MMC1_RX; + if (host->id == OMAP_MMC1_DEVID) + sync_dev = OMAP24XX_DMA_MMC1_RX; + else + sync_dev = OMAP24XX_DMA_MMC2_RX; } else { host->dma_dir = DMA_TO_DEVICE; - sync_dev = OMAP24XX_DMA_MMC1_TX; + if (host->id == OMAP_MMC1_DEVID) + sync_dev = OMAP24XX_DMA_MMC1_TX; + else + sync_dev = OMAP24XX_DMA_MMC2_TX; } ret = omap_request_dma(sync_dev, "MMC/SD", mmc_omap_dma_cb, @@ -689,6 +699,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev) struct mmc_omap_host *host = NULL; struct resource *res; int ret = 0, irq; + u32 hctl, capa; if (pdata == NULL) { dev_err(&pdev->dev, "Platform Data is missing\n"); @@ -775,11 +786,20 @@ static int __init omap_mmc_probe(struct platform_device *pdev) if (pdata->conf.wire4) mmc->caps |= MMC_CAP_4_BIT_DATA; + /* Only MMC1 supports 3.0V */ + if (host->id == OMAP_MMC1_DEVID) { + hctl = SDVS30; + capa = VS30 | VS18; + } else { + hctl = SDVS18; + capa = VS18; + } + OMAP_HSMMC_WRITE(host->base, HCTL, - OMAP_HSMMC_READ(host->base, HCTL) | SDVS30); + OMAP_HSMMC_READ(host->base, HCTL) | hctl); - OMAP_HSMMC_WRITE(host->base, CAPA, OMAP_HSMMC_READ(host->base, - CAPA) | VS30 | VS18); + OMAP_HSMMC_WRITE(host->base, CAPA, + OMAP_HSMMC_READ(host->base, CAPA) | capa); /* Set the controller to AUTO IDLE mode */ OMAP_HSMMC_WRITE(host->base, SYSCONFIG, diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h index f216b4d..c58db03 100644 --- a/include/asm-arm/arch-omap/mux.h +++ b/include/asm-arm/arch-omap/mux.h @@ -641,6 +641,14 @@ enum omap24xx_index { AE13_2430_MCBSP2_DX_OFF, AD13_2430_MCBSP2_DR_OFF, + /* 2430 MMC2 */ + V26_2430_MMC2_CLKO, + V24_2430_MMC2_DAT3, + W20_2430_MMC2_CMD, + V23_2430_MMC2_DAT0, + V25_2430_MMC2_DAT2, + Y24_2430_MMC2_DAT1, + }; enum omap34xx_index { ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: OMAP MMC multiport support 2008-03-18 12:47 OMAP MMC multiport support Remith Ravi 2008-03-18 11:52 ` Tony Lindgren @ 2008-03-18 13:07 ` iqbal 2008-03-18 13:12 ` Keppler Alecrim 1 sibling, 1 reply; 11+ messages in thread From: iqbal @ 2008-03-18 13:07 UTC (permalink / raw) To: Remith Ravi; +Cc: linux-omap > Hi, > > Is there any OMAP MMC driver implementation exist which support multi > port implementation? > I am working on OMAP-2530 EVM and want to have support for both MMC > port 1 and port 2. Just go through the archives, recently many platforms migrated to MMC multislot support. Regards Iqbal ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: OMAP MMC multiport support 2008-03-18 13:07 ` iqbal @ 2008-03-18 13:12 ` Keppler Alecrim 0 siblings, 0 replies; 11+ messages in thread From: Keppler Alecrim @ 2008-03-18 13:12 UTC (permalink / raw) To: iqbal; +Cc: Remith Ravi, linux-omap OMAP-2530? Can you send me any reference/document about it? Regards, Alecrim. On Tue, Mar 18, 2008 at 3:07 PM, iqbal <iqbal@ti.com> wrote: > > > > Hi, > > > > Is there any OMAP MMC driver implementation exist which support multi > > port implementation? > > I am working on OMAP-2530 EVM and want to have support for both MMC > > port 1 and port 2. > > Just go through the archives, recently many platforms migrated to MMC multislot > support. > > Regards > Iqbal > > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- -- Francisco Keppler Silva Alecrim OSMRC - INdT - Manaus http://franciscoalecrim.com/ ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-03-19 21:12 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-03-18 12:47 OMAP MMC multiport support Remith Ravi 2008-03-18 11:52 ` Tony Lindgren 2008-03-18 13:20 ` Syed Mohammed, Khasim 2008-03-18 13:46 ` Seth Forshee 2008-03-18 13:57 ` Syed Mohammed, Khasim 2008-03-18 14:34 ` Seth Forshee 2008-03-19 5:20 ` Remith Ravi 2008-03-19 18:53 ` Keppler Alecrim 2008-03-19 21:11 ` Seth Forshee 2008-03-18 13:07 ` iqbal 2008-03-18 13:12 ` Keppler Alecrim
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.