public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Usama Arif <usama.arif@arm.com>, u-boot@lists.denx.de
Cc: nd@arm.com, peng.fan@nxp.com, anders.dellien@arm.com
Subject: Re: [PATCH v2] mmc: arm_pl180_mmci: Enable HWFC for specific versions of MCI
Date: Wed, 20 Oct 2021 07:28:10 +0900	[thread overview]
Message-ID: <cfee2d52-e25e-a877-ebbd-3bd28118df87@samsung.com> (raw)
In-Reply-To: <20211019144948.48955-1-usama.arif@arm.com>

On 10/19/21 11:49 PM, Usama Arif wrote:
> There are 4 registers (PERIPHID{0-3}) that contain the ID of MCI.
> For MMCs' with peripheral id 0x02041180 and 0x03041180, H/W flow control
> needs to be enabled for multi block writes (MMC CMD 18).
> 
> Signed-off-by: Usama Arif <usama.arif@arm.com>

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

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/arm_pl180_mmci.c | 14 ++++++++++++++
>  drivers/mmc/arm_pl180_mmci.h |  1 +
>  2 files changed, 15 insertions(+)
> 
> diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
> index f99b5f997e..9c5d48e90c 100644
> --- a/drivers/mmc/arm_pl180_mmci.c
> +++ b/drivers/mmc/arm_pl180_mmci.c
> @@ -282,6 +282,14 @@ static int host_request(struct mmc *dev,
>  	return result;
>  }
>  
> +static int check_peripheral_id(struct pl180_mmc_host *host, u32 periph_id)
> +{
> +	return readl(&host->base->periph_id0) == (periph_id & 0xFF) &&
> +		readl(&host->base->periph_id1) == ((periph_id >> 8) & 0xFF)  &&
> +		readl(&host->base->periph_id2) == ((periph_id >> 16) & 0xFF) &&
> +		readl(&host->base->periph_id3) == ((periph_id >> 24) & 0xFF);
> +}
> +
>  static int  host_set_ios(struct mmc *dev)
>  {
>  	struct pl180_mmc_host *host = dev->priv;
> @@ -337,6 +345,12 @@ static int  host_set_ios(struct mmc *dev)
>  		sdi_clkcr &= ~(SDI_CLKCR_WIDBUS_MASK);
>  		sdi_clkcr |= buswidth;
>  	}
> +	/* For MMCs' with peripheral id 0x02041180 and 0x03041180, H/W flow control
> +	 * needs to be enabled for multi block writes (MMC CMD 18).
> +	 */
> +	if (check_peripheral_id(host, 0x02041180) ||
> +		check_peripheral_id(host, 0x03041180))
> +		sdi_clkcr |= SDI_CLKCR_HWFCEN;
>  
>  	writel(sdi_clkcr, &host->base->clock);
>  	udelay(CLK_CHANGE_DELAY);
> diff --git a/drivers/mmc/arm_pl180_mmci.h b/drivers/mmc/arm_pl180_mmci.h
> index 15c29beadb..fca15910a8 100644
> --- a/drivers/mmc/arm_pl180_mmci.h
> +++ b/drivers/mmc/arm_pl180_mmci.h
> @@ -43,6 +43,7 @@
>  #define SDI_CLKCR_CLKEN		0x00000100
>  #define SDI_CLKCR_PWRSAV	0x00000200
>  #define SDI_CLKCR_BYPASS	0x00000400
> +#define SDI_CLKCR_HWFCEN	0x00001000
>  #define SDI_CLKCR_WIDBUS_MASK	0x00001800
>  #define SDI_CLKCR_WIDBUS_1	0x00000000
>  #define SDI_CLKCR_WIDBUS_4	0x00000800
> 


      reply	other threads:[~2021-10-19 22:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20211019144955epcas1p2838c1ec0ea51b2fd554e473ac2039960@epcas1p2.samsung.com>
2021-10-19 14:49 ` [PATCH v2] mmc: arm_pl180_mmci: Enable HWFC for specific versions of MCI Usama Arif
2021-10-19 22:28   ` Jaehoon Chung [this message]

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=cfee2d52-e25e-a877-ebbd-3bd28118df87@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=anders.dellien@arm.com \
    --cc=nd@arm.com \
    --cc=peng.fan@nxp.com \
    --cc=u-boot@lists.denx.de \
    --cc=usama.arif@arm.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