From: Jaehoon Chung <jh80.chung@gmail.com>
To: Ashok Reddy Soma <ashok.reddy.soma@amd.com>, u-boot@lists.denx.de
Cc: peng.fan@nxp.com, jh80.chung@samsung.com,
kever.yang@rock-chips.com, hayashi.kunihiko@socionext.com,
alpernebiyasak@gmail.com, xypron.glpk@gmx.de, git@amd.com,
michal.simek@amd.com
Subject: Re: [2/4] mmc: sdhci: Check and call config_dll callback functions
Date: Tue, 31 Jan 2023 21:40:34 +0900 [thread overview]
Message-ID: <0b1efa1d-70ff-3ac4-ab09-6ceb10dca600@gmail.com> (raw)
In-Reply-To: <20230110113124.1434-3-ashok.reddy.soma@amd.com>
On 1/10/23 20:31, Ashok Reddy Soma wrote:
> Check if the low level driver supports config_dll callback function and
> call it if it does. Call with dll disable before calling set_clock and
> with dll enable after it.
>
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Best Regards,
Jaehoon Chung
> ---
> drivers/mmc/sdhci.c | 16 ++++++++++++++++
> include/sdhci.h | 2 ++
> 2 files changed, 18 insertions(+)
>
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index a80ad8329a..181ab9b7cb 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -396,6 +396,14 @@ int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
> }
> }
>
> + if (host->ops && host->ops->config_dll) {
> + ret = host->ops->config_dll(host, clock, false);
> + if (ret) {
> + printf("%s: Error while configuring dll\n", __func__);
> + return ret;
> + }
> + }
> +
> if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
> /*
> * Check if the Host Controller supports Programmable Clock
> @@ -439,6 +447,14 @@ int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
> if (host->ops && host->ops->set_clock)
> host->ops->set_clock(host, div);
>
> + if (host->ops && host->ops->config_dll) {
> + ret = host->ops->config_dll(host, clock, true);
> + if (ret) {
> + printf("%s: Error while configuring dll\n", __func__);
> + return ret;
> + }
> + }
> +
> clk |= (div & SDHCI_DIV_MASK) << SDHCI_DIVIDER_SHIFT;
> clk |= ((div & SDHCI_DIV_HI_MASK) >> SDHCI_DIV_MASK_LEN)
> << SDHCI_DIVIDER_HI_SHIFT;
> diff --git a/include/sdhci.h b/include/sdhci.h
> index 24b4599b85..64a3d309da 100644
> --- a/include/sdhci.h
> +++ b/include/sdhci.h
> @@ -272,6 +272,8 @@ struct sdhci_ops {
> void (*set_clock)(struct sdhci_host *host, u32 div);
> int (*platform_execute_tuning)(struct mmc *host, u8 opcode);
> int (*set_delay)(struct sdhci_host *host);
> + /* Callback function to set DLL clock configuration */
> + int (*config_dll)(struct sdhci_host *host, u32 clock, bool enable);> int (*deferred_probe)(struct sdhci_host *host);
>
> /**
next prev parent reply other threads:[~2023-01-31 12:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-10 11:31 [0/4] Add eMMC 5.1 support for Versal NET Ashok Reddy Soma
2023-01-10 11:31 ` [1/4] mmc: zynq_sdhci: Add support for eMMC5.1 for Versal NET platform Ashok Reddy Soma
2023-01-31 12:40 ` Jaehoon Chung
2023-01-10 11:31 ` [2/4] mmc: sdhci: Check and call config_dll callback functions Ashok Reddy Soma
2023-01-31 12:40 ` Jaehoon Chung [this message]
2023-01-10 11:31 ` [3/4] mmc: sdhci: Enable HS400 support if available in caps Ashok Reddy Soma
2023-01-31 12:40 ` Jaehoon Chung
2023-01-10 11:31 ` [4/4] mmc: zynq_sdhci: Add support and quirk for HS400 Ashok Reddy Soma
2023-01-31 12:40 ` Jaehoon Chung
2023-01-24 13:01 ` [0/4] Add eMMC 5.1 support for Versal NET Michal Simek
2023-01-26 2:29 ` Jaehoon Chung
2023-01-31 13:07 ` Michal Simek
2023-01-31 23:11 ` Jaehoon Chung
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=0b1efa1d-70ff-3ac4-ab09-6ceb10dca600@gmail.com \
--to=jh80.chung@gmail.com \
--cc=alpernebiyasak@gmail.com \
--cc=ashok.reddy.soma@amd.com \
--cc=git@amd.com \
--cc=hayashi.kunihiko@socionext.com \
--cc=jh80.chung@samsung.com \
--cc=kever.yang@rock-chips.com \
--cc=michal.simek@amd.com \
--cc=peng.fan@nxp.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.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