[U-Boot] [PATCH] powerpc/esdhc: force the bus width to 4bit

Huang Changming-R66093 r66093 at freescale.com
Tue Oct 23 11:23:30 CEST 2012



Best Regards
Jerry Huang


> -----Original Message-----
> From: Marek Vasut [mailto:marex at denx.de]
> Sent: Tuesday, October 23, 2012 3:24 PM
> To: Huang Changming-R66093
> Cc: u-boot at lists.denx.de; Andy Fleming
> Subject: Re: [PATCH] powerpc/esdhc: force the bus width to 4bit
> 
> Dear Chang-Ming.Huang at freescale.com,
> 
> > From: Jerry Huang <Chang-Ming.Huang at freescale.com>
> >
> > For the current u-boot codes, only 4bit/1bit SD/SDHC bus width is
> support.
> > So for MMC card, we also support 4bit bus width, otherwiase, we will
> > get the 12bit bus width, which is not correct:
> 
> Andy ... can you please explain? I don't quite understand the problem, I
> thought we had no problem supporting 8bit mmc (esp. if the controller
> handles that for us mostly).


Yes, the controller support 8bit MMC.

FSL ESDHC driver set the host_caps = MMC_MODE_4BIT | MMC_MODE_8BIT;
But, the current codes for MMC card has been changed to:

} else {
	width = ((mmc->host_caps & MMC_MODE_MASK_WIDTH_BITS) >>
                         MMC_MODE_WIDTH_BITS_SHIFT);
	for (; width >= 0; width--) {
	....

So for FSL ESDHC, the width = 3, after implement mmc_switch successfully, will set the bus to 4 * width.
Therefore, I will get the 12bit (4 x 3) bus width.

Below is the old codes (width = 2):
} else {
                for (width = EXT_CSD_BUS_WIDTH_8; width >= 0; width--) {

> > => mmcinfo
> > Device: FSL_SDHC
> > Manufacturer ID: 1e
> > OEM: ffff
> > Name: MMC
> > Tran Speed: 52000000
> > Rd Block Len: 512
> > MMC version 4.0
> > High Capacity: No
> > Capacity: 1.9 GiB
> > Bus Width: 12-bit
> >
> > Signed-off-by: Jerry Huang <Chang-Ming.Huang at freescalecom>
> > CC: Andy Fleming <afleming at gmail.com>
> > CC: Marek Vasut <marex at denx.de>
> > ---
> >  drivers/mmc/fsl_esdhc.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index
> > 3f8d30d..7b83dd2 100644
> > --- a/drivers/mmc/fsl_esdhc.c
> > +++ b/drivers/mmc/fsl_esdhc.c
> > @@ -577,7 +577,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct
> > fsl_esdhc_cfg *cfg) return -1;
> >  	}
> >
> > -	mmc->host_caps = MMC_MODE_4BIT | MMC_MODE_8BIT;
> > +	mmc->host_caps = MMC_MODE_4BIT;
> >
> >  	if (caps & ESDHC_HOSTCAPBLT_HSS)
> >  		mmc->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
> 
> Best regards,
> Marek Vasut




More information about the U-Boot mailing list