2023-12-25 09:39:04

by Mengqi Zhang

[permalink] [raw]
Subject: [PATCH v3 0/1] mmc: core: Add HS400 tuning in HS400es initialization

change v3
1. remove mmc_retune_disable() and mmc_retune_enable() from
hs400es initialization.

change v2
1. remove hs400 tuning from mmc_retune.
2. remove mmc_retune_enable() from hs400es initialization.

Mengqi Zhang (1):
mmc: core: Add HS400 tuning in HS400es initialization

drivers/mmc/core/mmc.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

--
2.25.1



2023-12-25 09:40:02

by Mengqi Zhang

[permalink] [raw]
Subject: [PATCH v3 1/1] mmc: core: Add HS400 tuning in HS400es initialization

During the initialization to HS400es stage, add hs400 tuning flow as an
optional process. For Mediatek IP, HS00es mode requires a specific
tuning to ensure the correct HS400 timing setting.

Signed-off-by: Mengqi Zhang <[email protected]>
---
v1 https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
v2 https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
---
drivers/mmc/core/mmc.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 705942edacc6..d5173a9bb4b0 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1822,8 +1822,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,

if (err)
goto free_card;
-
- } else if (!mmc_card_hs400es(card)) {
+ } else if (mmc_card_hs400es(card)) {
+ if (host->ops->execute_hs400_tuning) {
+ err = host->ops->execute_hs400_tuning(host, card);
+ if (err)
+ goto free_card;
+ }
+ } else {
/* Select the desired bus width optionally */
err = mmc_select_bus_width(card);
if (err > 0 && mmc_card_hs(card)) {
--
2.25.1


2024-01-02 16:59:14

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH v3 1/1] mmc: core: Add HS400 tuning in HS400es initialization

On Mon, 25 Dec 2023 at 10:39, Mengqi Zhang <[email protected]> wrote:
>
> During the initialization to HS400es stage, add hs400 tuning flow as an
> optional process. For Mediatek IP, HS00es mode requires a specific
> tuning to ensure the correct HS400 timing setting.
>
> Signed-off-by: Mengqi Zhang <[email protected]>

Applied for next, thanks!

Kind regards
Uffe


> ---
> v1 https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
> v2 https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
> ---
> drivers/mmc/core/mmc.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 705942edacc6..d5173a9bb4b0 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1822,8 +1822,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
>
> if (err)
> goto free_card;
> -
> - } else if (!mmc_card_hs400es(card)) {
> + } else if (mmc_card_hs400es(card)) {
> + if (host->ops->execute_hs400_tuning) {
> + err = host->ops->execute_hs400_tuning(host, card);
> + if (err)
> + goto free_card;
> + }
> + } else {
> /* Select the desired bus width optionally */
> err = mmc_select_bus_width(card);
> if (err > 0 && mmc_card_hs(card)) {
> --
> 2.25.1
>