OMAP: HSMMC: Fixes for 1.8V MMC2 interface
Subsystems (2)
This patch contains some fixes for the 1.8V MMC2 interface on the OMAP 2430/3430 that I had submitted for comment in a previous patch, this time leaving out the device configuration in deference to the other patch submitted for this purpose (once it has been resubmitted). These fixes were necessary for me to use MMC2 with an OMAP2430. I don't know about applicability to the 3430 however, thus I am sending again for comment.
Cheers,
Seth
drivers/mmc/host/omap_hsmmc.c +26 -6
@@ -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 ;
@@ -517,10 +521,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,
@@ -692,6 +702,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" );
@@ -778,11 +789,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,
Francisco Alecrim
Acked-byHello Seth,
It's fine and work for 3430! Maybe you should resend changing the
commit message. It's too big.
Remove "RFC" from subject.
What do you think?
if(changes)
Quoted 7 lines · ext Seth Forshee
This patch contains some fixes for the 1.8V MMC2 interface on the OMAP 2430/3430 that I had submitted for comment in a previous patch, this time leaving out the device configuration in deference to the other patch submitted for this purpose (once it has been resubmitted). These fixes were necessary for me to use MMC2 with an OMAP2430. I don't know about applicability to the 3430 however, thus I am sending again for comment.
^^^
Suggestion: "Fix for the 1.8V MMC2 on the OMAP 2430/3430."
Quoted 79 lines
Cheers,
Sethdrivers/mmc/host/omap_hsmmc.c +26
-7@@ -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 ;@@ -517,10 +521,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,@@ -692,6 +702,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" );@@ -778,11 +789,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, --To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
Francisco Keppler Silva Alecrim - INdT Phone: +55 92 2126-1017 Mobile: +55 92 9152-7000
Quoted 10 lines · Francisco Alecrim
Hello Seth,
It's fine and work for 3430! Maybe you should resend changing the
commit message. It's too big.Remove "RFC" from subject.
What do you think?
if(changes)
Thank you for reviewing/testing. I wanted to get verification for OMAP3430 before I officially submitted the patch, and since you have done that I will submit it now.
Hi,
I did not see any board level code to power up the second slot along with this patch. Where is the code that enables 1.8V to the second slot?
Regards,
Madhu
Quoted 32 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Seth Forshee
Sent: Tuesday, April 01, 2008 6:22 AM
To: Francisco Alecrim
Cc: [email protected]
Subject: Re: [RFC/PATH] OMAP: HSMMC: Fixes for 1.8V MMC2 interfaceQuoted 2 lines · Francisco Alecrim
Hello Seth,
It's fine and work for 3430! Maybe you should resendchanging the
Quoted 8 lines
commit message. It's too big.
Remove "RFC" from subject.
What do you think?
if(changes)
Thank you for reviewing/testing. I wanted to get verification for OMAP3430
before I officially submitted the patch, and since you have done that I will
submit it now.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Madhusudhan Chikkature Rajashekar
Hi,
I did not see any board level code to power up the second slot along with this patch. Where is the code that enables 1.8V to the second slot?
I am working with a custom board that isn't supported in the git repo, and I don't have access to any other board that I could test such changes with. These are just the chages I found were necessary to support the 1.8V-only host, regardless of whatever board support is needed.
Quoted 4 lines · ext Seth Forshee
Quoted 2 lines · Madhusudhan Chikkature Rajashekar
Hi,
Quoted 8 lines
Quoted 3 lines
I did not see any board level code to power up the second slot along with this patch. Where is the code that enables 1.8V to the second slot?
I am working with a custom board that isn't supported in the git repo, and I don't have access to any other board that I could test such changes with. These are just the chages I found were necessary to support the 1.8V-only host, regardless of whatever board support is needed.
That's the same problem here!! I have a custom board too!! However, pushing patches [1] and [2] we will be able to enable the second controller with some modifications in board-sdp-mmc.c.
[1] - OMAP: HSMMC: Fixes for 1.8V MMC2 interface
[2] - [PATCH 1/1] PLAT: OMAP: Add device configuration to support second HSMMC slot on OMAP 2430 and 3430 boards.
Signature · 3 lines
Francisco Keppler Silva Alecrim - INdT Phone: +55 92 2126-1017 Mobile: +55 92 9152-7000
Quoted 22 lines
-----Original Message-----
From: Francisco Alecrim [mailto:[email protected]]
Sent: Wednesday, April 02, 2008 6:17 AM
To: Madhusudhan Chikkature Rajashekar; [email protected]
Subject: Re: [RFC/PATH] OMAP: HSMMC: Fixes for 1.8V MMC2 interfaceQuoted 1 line · ext Seth Forshee
On Tue, Apr 01, 2008 at 08:44:47PM +0530, Madhusudhan
Quoted 4 lines · Chikkature Rajashekar
Quoted 4 lines
Hi,
I did not see any board level code to power up the second
slot along with this patch.
Quoted 4 lines
Quoted 2 lines
Where is the code that enables 1.8V to the second slot?
I am working with a custom board that isn't supported in
the git repo, and I
Quoted 1 line
don't have access to any other board that I could test such
Quoted 8 lines
changes with.
Quoted 1 line
These are just the chages I found were necessary to support
the 1.8V-only
Quoted 1 line
host, regardless of whatever board support is needed.
That's the same problem here!! I have a custom board too!! However, pushing patches [1] and [2] we will be able to enable the second controller with some modifications in
board-sdp-mmc.c.
Yes. That’s what I meant. Some changes in the sdp board file would be required to Enable power to slot2 through triton LDOs. Currently I am tied up with some work, I will patch that when I get some time unless someone else sends a patch by then.
Quoted 12 lines
[1] - OMAP: HSMMC: Fixes for 1.8V MMC2 interface
[2] - [PATCH 1/1] PLAT: OMAP: Add device configuration to support second
HSMMC slot on OMAP 2430 and 3430 boards.Signature · 3 lines
Francisco Keppler Silva Alecrim - INdT Phone: +55 92 2126-1017 Mobile: +55 92 9152-7000
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html