From: sbabic@denx.de
To: Adam Ford <aford173@gmail.com>,u-boot@lists.denx.de
Subject: [PATCH 2/2] mmc: fsl_esdhc_imx: Use esdhc_soc_data flags to set host caps
Date: Sat, 19 Feb 2022 14:07:50 +0100 (CET) [thread overview]
Message-ID: <20220219130754.8BC4E83C19@phobos.denx.de> (raw)
In-Reply-To: <20220112135356.322069-3-aford173@gmail.com>
> The Linux driver automatically can detect and enable UHS, HS200, HS400
> and HS400_ES automatically without extra flags being placed into the
> device tree.
> Right now, for U-Boot to use UHS, HS200 or HS400, the extra flags are
> needed in the device tree. Instead, go through the esdhc_soc_data
> flags and enable the host caps where applicable to automatically
> enable higher speeds.
> Suggested-by: Fabio Estevam <festevam@gmail.com>
> Signed-off-by: Adam Ford <aford173@gmail.com>
> diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
> index e5814232a2..5088e78bb6 100644
> --- a/drivers/mmc/fsl_esdhc_imx.c
> +++ b/drivers/mmc/fsl_esdhc_imx.c
> @@ -1305,8 +1305,29 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
> val |= ESDHC_TUNING_CMD_CRC_CHECK_DISABLE;
> esdhc_write32(®s->tuning_ctrl, val);
> }
> - }
>
> + /*
> + * UHS doesn't have explicit ESDHC flags, so if it's
> + * not supported, disable it in config.
> + */
> + if (CONFIG_IS_ENABLED(MMC_UHS_SUPPORT))
> + cfg->host_caps |= UHS_CAPS;
> +
> + if (CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)) {
> + if (priv->flags & ESDHC_FLAG_HS200)
> + cfg->host_caps |= MMC_CAP(MMC_HS_200);
> + }
> +
> + if (CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)) {
> + if (priv->flags & ESDHC_FLAG_HS400)
> + cfg->host_caps |= MMC_CAP(MMC_HS_400);
> + }
> +
> + if (CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT)) {
> + if (priv->flags & ESDHC_FLAG_HS400_ES)
> + cfg->host_caps |= MMC_CAP(MMC_HS_400_ES);
> + }
> + }
> return 0;
> }
>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================
prev parent reply other threads:[~2022-02-19 13:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 13:53 [PATCH 0/2] mmc: fsl_esdhc_imx: Auto-detect higher speeds Adam Ford
2022-01-12 13:53 ` [PATCH 1/2] mmc: fsl_esdhc_imx: Fix fsl_esdhc_wait_dat0 Adam Ford
2022-01-14 3:18 ` Bough Chen
2022-02-19 13:08 ` sbabic
2022-02-19 13:27 ` Fabio Estevam
2022-02-19 13:43 ` Stefano Babic
2022-01-12 13:53 ` [PATCH 2/2] mmc: fsl_esdhc_imx: Use esdhc_soc_data flags to set host caps Adam Ford
2022-02-19 13:07 ` sbabic [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=20220219130754.8BC4E83C19@phobos.denx.de \
--to=sbabic@denx.de \
--cc=aford173@gmail.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