Re: [PATCH v3 4/6] mmc: tmio: add eMMC support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 20, 2016 at 06:35:00PM +0900, Jaehoon Chung wrote:
> On 09/20/2016 05:57 AM, Wolfram Sang wrote:
> > We need to add R1 without CRC support, refactor the bus width routine a
> > little and extend a quirk check. To support "non-removable;" we need a
> > workaround which will be hopefully removed when reworking PM soon.
> > 
> > Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> > ---
> >  drivers/mmc/host/tmio_mmc.h     |  3 +++
> >  drivers/mmc/host/tmio_mmc_pio.c | 38 ++++++++++++++++++++++++++------------
> >  2 files changed, 29 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
> > index 4b501f2d529f6e..637581faf756b1 100644
> > --- a/drivers/mmc/host/tmio_mmc.h
> > +++ b/drivers/mmc/host/tmio_mmc.h
> > @@ -79,6 +79,9 @@
> >  #define	CLK_CTL_DIV_MASK	0xff
> >  #define	CLK_CTL_SCLKEN		BIT(8)
> >  
> > +#define CARD_OPT_WIDTH8		BIT(13)
> > +#define CARD_OPT_WIDTH		BIT(15)
> 
> Just confusing whether CARD_OPT_WIDTH is 4bit or 1bit?

The HW is confusing. Setting the bit sets 1-bit mode. This is why I put
the comment below in the code:

> > +	u16 reg = sd_ctrl_read16(host, CTL_SD_MEM_CARD_OPT)
> > +				& ~(CARD_OPT_WIDTH | CARD_OPT_WIDTH8);
> > +
> > +	/* reg now applies to MMC_BUS_WIDTH_4 */

This comment I meant ^^^

> > +	if (bus_width == MMC_BUS_WIDTH_1)
> > +		reg |= CARD_OPT_WIDTH;

...

> >  	switch (mmc_resp_type(cmd)) {
> >  	case MMC_RSP_NONE: c |= RESP_NONE; break;
> > -	case MMC_RSP_R1:   c |= RESP_R1;   break;
> > +	case MMC_RSP_R1:
> > +	case MMC_RSP_R1_NO_CRC:
> > +			   c |= RESP_R1;   break;
> 
> Just wonder..It there case that hit "case MMC_RSP_R1_NO_CRC" ?

Yes, as described in my response to patch 1. It doesn't work without.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux