From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D691C433F5 for ; Wed, 16 Mar 2022 01:26:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C5DA483944; Wed, 16 Mar 2022 02:26:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3504083946; Wed, 16 Mar 2022 02:26:51 +0100 (CET) Received: from mail-m17662.qiye.163.com (mail-m17662.qiye.163.com [59.111.176.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7A360838C8 for ; Wed, 16 Mar 2022 02:26:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@rock-chips.com Received: from [172.16.12.93] (unknown [58.22.7.114]) by mail-m17662.qiye.163.com (Hmail) with ESMTPA id AEB411400B8; Wed, 16 Mar 2022 09:26:33 +0800 (CST) Message-ID: <2897c8bd-e849-88be-80c7-60ea2c859e35@rock-chips.com> Date: Wed, 16 Mar 2022 09:26:33 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v5 1/3] mmc: sdhci: Add HS400 Enhanced Strobe support Content-Language: en-US To: Alper Nebi Yasak , u-boot@lists.denx.de Cc: Faiz Abbas , Jaehoon Chung , Philipp Tomsich , Peter Robinson , Peng Fan , Peter Geis , Jagan Teki , Samuel Dionne-Riel , Simon Glass , Ashok Reddy Soma , Aswath Govindraju , Jack Mitchell , Heinrich Schuchardt , Yifeng Zhao , Michal Simek , Stephen Carlson References: <20220315174629.7467-1-alpernebiyasak@gmail.com> <20220315174629.7467-2-alpernebiyasak@gmail.com> From: Kever Yang In-Reply-To: <20220315174629.7467-2-alpernebiyasak@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZCBgUCR5ZQVlLVUtZV1 kWDxoPAgseWUFZKDYvK1lXWShZQUlKS0tKN1dZLVlBSVdZDwkaFQgSH1lBWUJOTkpWGh5MQkoYTk 5ISUMfVRMBExYaEhckFA4PWVdZFhoPEhUdFFlBWU9LSFVKSktITUpVS1kG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6OhQ6TTo6Aj5OHS4JQk81GBgq GSIaCS1VSlVKTU9MSEJIQkJPT0hDVTMWGhIXVRAeDR4JVQIaFRw7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlOQ1VJSVVMVUpKT1lXWQgBWUFOTEJJNwY+ X-HM-Tid: 0a7f905575bada2ckuwsaeb411400b8 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean HI Alper, On 2022/3/16 01:46, Alper Nebi Yasak wrote: > Delegate setting the Enhanced Strobe configuration to individual drivers > if they set a function for it. Return -ENOTSUPP if they do not, like > what the MMC uclass does. > > Signed-off-by: Alper Nebi Yasak > Reviewed-by: Jaehoon Chung Reviewed-by: Kever Yang Thanks, - Kever > --- > > (no changes since v4) > > Changes in v4: > - Add comment for SDHCI set_enhanced_strobe() operation > > Changes in v2: > - Add tag: "Reviewed-by: Jaehoon Chung " > > drivers/mmc/sdhci.c | 18 ++++++++++++++++++ > include/sdhci.h | 12 ++++++++++++ > 2 files changed, 30 insertions(+) > > diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c > index 766e4a6b0c5e..bf989a594f7e 100644 > --- a/drivers/mmc/sdhci.c > +++ b/drivers/mmc/sdhci.c > @@ -513,6 +513,7 @@ void sdhci_set_uhs_timing(struct sdhci_host *host) > reg |= SDHCI_CTRL_UHS_SDR104; > break; > case MMC_HS_400: > + case MMC_HS_400_ES: > reg |= SDHCI_CTRL_HS400; > break; > default: > @@ -666,6 +667,7 @@ static int sdhci_set_ios(struct mmc *mmc) > mmc->selected_mode == MMC_DDR_52 || > mmc->selected_mode == MMC_HS_200 || > mmc->selected_mode == MMC_HS_400 || > + mmc->selected_mode == MMC_HS_400_ES || > mmc->selected_mode == UHS_SDR25 || > mmc->selected_mode == UHS_SDR50 || > mmc->selected_mode == UHS_SDR104 || > @@ -799,6 +801,19 @@ static int sdhci_wait_dat0(struct udevice *dev, int state, > return -ETIMEDOUT; > } > > +#if CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT) > +static int sdhci_set_enhanced_strobe(struct udevice *dev) > +{ > + struct mmc *mmc = mmc_get_mmc_dev(dev); > + struct sdhci_host *host = mmc->priv; > + > + if (host->ops && host->ops->set_enhanced_strobe) > + return host->ops->set_enhanced_strobe(host); > + > + return -ENOTSUPP; > +} > +#endif > + > const struct dm_mmc_ops sdhci_ops = { > .send_cmd = sdhci_send_command, > .set_ios = sdhci_set_ios, > @@ -808,6 +823,9 @@ const struct dm_mmc_ops sdhci_ops = { > .execute_tuning = sdhci_execute_tuning, > #endif > .wait_dat0 = sdhci_wait_dat0, > +#if CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT) > + .set_enhanced_strobe = sdhci_set_enhanced_strobe, > +#endif > }; > #else > static const struct mmc_ops sdhci_ops = { > diff --git a/include/sdhci.h b/include/sdhci.h > index c8d69f5a63f7..88f1917480b6 100644 > --- a/include/sdhci.h > +++ b/include/sdhci.h > @@ -272,6 +272,18 @@ struct sdhci_ops { > int (*platform_execute_tuning)(struct mmc *host, u8 opcode); > int (*set_delay)(struct sdhci_host *host); > int (*deferred_probe)(struct sdhci_host *host); > + > + /** > + * set_enhanced_strobe() - Set HS400 Enhanced Strobe config > + * > + * This is called after setting the card speed and mode to > + * HS400 ES, and should set any host-specific configuration > + * necessary for it. > + * > + * @host: SDHCI host structure > + * Return: 0 if successful, -ve on error > + */ > + int (*set_enhanced_strobe)(struct sdhci_host *host); > }; > > #define ADMA_MAX_LEN 65532