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 D84E3C433F5 for ; Sun, 16 Jan 2022 20:18:46 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D991283565; Sun, 16 Jan 2022 21:18:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pxD8XcKe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CB61A81982; Sun, 16 Jan 2022 21:18:35 +0100 (CET) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8194981982 for ; Sun, 16 Jan 2022 21:18:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ed1-x533.google.com with SMTP id k15so56808471edk.13 for ; Sun, 16 Jan 2022 12:18:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2C0Kn8ndmd1VI8hsfzZOWxonEJzD8EOw5DdhJ4lo2Cw=; b=pxD8XcKexp3/3nZwWQc5Fzf8tr56kzXcBfjFBGpyPyY5uOW7lgPMG35P/hAmmRqjCt Wtkc7/Iwv4kYPcSNyLGu1XSCz61QT5ebe5fvZSVoi89r0MxT//3PmMKSegvvCcgR3LHQ Eq7BJanYguLYi+TH9A6f/9mNy1880LS0y+HZqtPP57t/IN5HTqLigVCpgY+Tip5Fbp2L XCiQBcfUhgZgWvNK3TpbSl5c4BF2Zae8CwnjJ2KQnXgYre9P8VvDpqlZ/UvMNumtcgzE vq855OrixSKXI3i8JvYTq2iYxfjbjvQ+wyYZJJRwMWvl2G684TOipwO/PiUIPzW7HVkR lJ3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2C0Kn8ndmd1VI8hsfzZOWxonEJzD8EOw5DdhJ4lo2Cw=; b=bkPYLiQAsc0W1z75zWZXWUMi6jkBfbRbj38s6luxcKEaCYdcW7uHy7LBDhgGbJkkcw rRj95NVmrOlWy3I3LMN9HfFmiJRFAnRe0uWJQDDD/sDbbqTmXmpDZiR53sTdgOa5k/j5 tykGRmAGRkuBBGVbSIN2Nx6lJNwqt7uQqQyC/2ZbV948EIQF79a3wY2h9Ew7oLkE1fcY /5gB5GyZwH8AY9AuZl3oDIbI/zF7TFLE1rtkdyu5ut+r7Ns0t6LtMhtVUE5lJjCM2a7x t/2c8DZ0Uicru+023yCnJyZIPRZ/w3G7e9K63mPJicdC3Ll2rPOVs0RZRIkA2UWiZ/hU 9jTQ== X-Gm-Message-State: AOAM530luCJvhPko2ejkD4MYe5YCCei3IQEUB0wAY4sz1ivzDFjKKlxy v5M3nRdE4CFho2gC9F+l94uXfIZDnkQ= X-Google-Smtp-Source: ABdhPJx7y2/xLhbXxtzNtA2IFc/vo0kYP+2vbcwmSXb9Px8ofd4eyrBeCLlf/8uTj/A90mdA9GAqFA== X-Received: by 2002:a17:907:9618:: with SMTP id gb24mr14601890ejc.385.1642364312173; Sun, 16 Jan 2022 12:18:32 -0800 (PST) Received: from localhost.localdomain ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id b10sm4872469edu.42.2022.01.16.12.18.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jan 2022 12:18:31 -0800 (PST) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Aswath Govindraju , Kever Yang , Philipp Tomsich , Samuel Dionne-Riel , Stephen Carlson , Peter Robinson , Faiz Abbas , Jack Mitchell , Simon Glass , Jaehoon Chung , Ashok Reddy Soma , Michal Simek , Peng Fan , Yifeng Zhao , Jagan Teki , Alper Nebi Yasak Subject: [PATCH v3 1/4] mmc: sdhci: Add HS400 Enhanced Strobe support Date: Sun, 16 Jan 2022 23:18:10 +0300 Message-Id: <20220116201814.11672-2-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220116201814.11672-1-alpernebiyasak@gmail.com> References: <20220116201814.11672-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.2 at phobos.denx.de X-Virus-Status: Clean 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 --- (no changes since v2) Changes in v2: - Add tag: "Reviewed-by: Jaehoon Chung " drivers/mmc/sdhci.c | 18 ++++++++++++++++++ include/sdhci.h | 1 + 2 files changed, 19 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 c718dd7206c1..7a65fdf95d30 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -272,6 +272,7 @@ 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); + int (*set_enhanced_strobe)(struct sdhci_host *host); }; #define ADMA_MAX_LEN 65532 -- 2.34.1