public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@gmail.com>
To: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
	Peng Fan <peng.fan@nxp.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Jassi Brar <jaswinder.singh@linaro.org>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH 1/2] mmc: sdhci: Add new quirks for SUPPORT_SINGLE
Date: Thu, 8 Sep 2022 20:22:27 +0900	[thread overview]
Message-ID: <573a07bf-30ab-4ece-02c6-dfc30379a99d@gmail.com> (raw)
In-Reply-To: <20220906003913.8846-2-hayashi.kunihiko@socionext.com>

Hi,

On 9/6/22 09:39, Kunihiko Hayashi wrote:
> This patch defines a quirk to disable the block count
> for single block transactions.
> 
> This is similar to Linux kernel commit d3fc5d71ac4d
> ("mmc: sdhci: add a quirk for single block transactions").
> 
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/sdhci.c | 8 +++++---
>  include/sdhci.h     | 1 +
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index bf989a594f7e..a80ad8329a38 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -211,7 +211,7 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
>  	unsigned int stat = 0;
>  	int ret = 0;
>  	int trans_bytes = 0, is_aligned = 1;
> -	u32 mask, flags, mode;
> +	u32 mask, flags, mode = 0;
>  	unsigned int time = 0;
>  	int mmc_dev = mmc_get_blk_desc(mmc)->devnum;
>  	ulong start = get_timer(0);
> @@ -273,10 +273,12 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
>  	/* Set Transfer mode regarding to data flag */
>  	if (data) {
>  		sdhci_writeb(host, 0xe, SDHCI_TIMEOUT_CONTROL);
> -		mode = SDHCI_TRNS_BLK_CNT_EN;
> +
> +		if (!(host->quirks & SDHCI_QUIRK_SUPPORT_SINGLE))
> +			mode = SDHCI_TRNS_BLK_CNT_EN;
>  		trans_bytes = data->blocks * data->blocksize;
>  		if (data->blocks > 1)
> -			mode |= SDHCI_TRNS_MULTI;
> +			mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_BLK_CNT_EN;
>  
>  		if (data->flags == MMC_DATA_READ)
>  			mode |= SDHCI_TRNS_READ;
> diff --git a/include/sdhci.h b/include/sdhci.h
> index 88f1917480b6..24b4599b857d 100644
> --- a/include/sdhci.h
> +++ b/include/sdhci.h
> @@ -247,6 +247,7 @@
>  #define SDHCI_QUIRK_WAIT_SEND_CMD	(1 << 6)
>  #define SDHCI_QUIRK_USE_WIDE8		(1 << 8)
>  #define SDHCI_QUIRK_NO_1_8_V		(1 << 9)
> +#define SDHCI_QUIRK_SUPPORT_SINGLE	(1 << 10)
>  
>  /* to make gcc happy */
>  struct sdhci_host;

  reply	other threads:[~2022-09-08 11:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06  0:39 [PATCH 0/2] mmc: Add support for F_SDH30_E51 Kunihiko Hayashi
2022-09-06  0:39 ` [PATCH 1/2] mmc: sdhci: Add new quirks for SUPPORT_SINGLE Kunihiko Hayashi
2022-09-08 11:22   ` Jaehoon Chung [this message]
2022-09-06  0:39 ` [PATCH 2/2] mmc: f_sdh30: Add support for F_SDH30_E51 Kunihiko Hayashi
2022-09-08 11:35   ` Jaehoon Chung
2022-09-09  6:33     ` Kunihiko Hayashi

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=573a07bf-30ab-4ece-02c6-dfc30379a99d@gmail.com \
    --to=jh80.chung@gmail.com \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=jh80.chung@samsung.com \
    --cc=peng.fan@nxp.com \
    --cc=u-boot@lists.denx.de \
    /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