linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-mmc@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	Simon Horman <horms@verge.net.au>,
	Dirk Behme <dirk.behme@gmail.com>
Subject: Re: [PATCH v2 4/6] mmc: tmio: add eMMC support
Date: Mon, 19 Sep 2016 20:31:55 +0300	[thread overview]
Message-ID: <ddb477a7-4b3c-e67a-22fc-93432c4c75cb@cogentembedded.com> (raw)
In-Reply-To: <20160919124921.8172-5-wsa+renesas@sang-engineering.com>

Hello.

On 09/19/2016 03:49 PM, 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@sang-engineering.com>
> ---
>  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)
> +
>  #define TMIO_BBS		512		/* Boot block size */
>
>  /* Definitions for values the CTRL_SDIO_STATUS register can take. */
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index 46b5a456243b84..a0f05eb4f34490 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
[...]
> @@ -922,14 +925,16 @@ static void tmio_mmc_power_off(struct tmio_mmc_host *host)
>  static void tmio_mmc_set_bus_width(struct tmio_mmc_host *host,
>  				unsigned char bus_width)
>  {
> -	switch (bus_width) {
> -	case MMC_BUS_WIDTH_1:
> -		sd_ctrl_write16(host, CTL_SD_MEM_CARD_OPT, 0x80e0);
> -		break;
> -	case MMC_BUS_WIDTH_4:
> -		sd_ctrl_write16(host, CTL_SD_MEM_CARD_OPT, 0x00e0);
> -		break;
> -	}
> +	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 */
> +	if (bus_width == MMC_BUS_WIDTH_1)
> +		reg |= CARD_OPT_WIDTH;
> +	else if (bus_width == MMC_BUS_WIDTH_8)
> +		reg |= CARD_OPT_WIDTH8;

    Why not *switch*?

[...]

MBR, Sergei

  reply	other threads:[~2016-09-19 17:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19 12:49 [PATCH v2 0/6] tmio: add support for eMMC with 8 bit bus width Wolfram Sang
2016-09-19 12:49 ` [PATCH v2 1/6] mmc: add define for R1 response without CRC Wolfram Sang
2016-09-19 12:49 ` [PATCH v2 2/6] mmc: rtsx_pci: use new macro for R1 " Wolfram Sang
2016-09-19 12:49 ` [PATCH v2 3/6] mmc: rtsx_usb: " Wolfram Sang
2016-09-19 12:49 ` [PATCH v2 4/6] mmc: tmio: add eMMC support Wolfram Sang
2016-09-19 17:31   ` Sergei Shtylyov [this message]
2016-09-19 20:26     ` Wolfram Sang
2016-09-19 12:49 ` [PATCH v2 5/6] arm64: dts: r8a7795: salvator: enable on-board eMMC Wolfram Sang
2016-09-19 17:25   ` Sergei Shtylyov
2016-09-19 20:29     ` Wolfram Sang
2016-09-19 12:49 ` [PATCH v2 6/6] arm64: dts: r8a7796: salvator: enable on board eMMC Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ddb477a7-4b3c-e67a-22fc-93432c4c75cb@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=dirk.behme@gmail.com \
    --cc=horms@verge.net.au \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).