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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2E35C433EF for ; Mon, 1 Nov 2021 09:08:40 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 46EDF61027 for ; Mon, 1 Nov 2021 09:08:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 46EDF61027 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0A5E983383; Mon, 1 Nov 2021 10:08: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=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="ilkKCpr8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AC2468352D; Mon, 1 Nov 2021 10:08:28 +0100 (CET) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 59A3F815A8 for ; Mon, 1 Nov 2021 10:08:23 +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-x52e.google.com with SMTP id z20so62422980edc.13 for ; Mon, 01 Nov 2021 02:08:23 -0700 (PDT) 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=LD6bWHsvpIW6JLyYP0adz+bmbXf3SYhsL00bBAldSnI=; b=ilkKCpr81ges1U2pNURyN8+wc2Wa5P1hKTsRtuxoInNof/UJWsMaPvmXJ3kSbcvsyH 2zdVtOYkHzTlqxaeNhoa8RyTZtYF7dlOm8rrRdC0uDlp6FwEUZXzDfU9xR4C1xdQL/TX oziThfI6R4Hwu6biM+J93vMhW38IJ7qQRxyTKO+/eDvha/ZOFjedHReuhj2uj9DczV3c ysIqyYBLBfUlYI1eEU7LW0TZWF/o4t77qFJr83Yeg5VONlK5W2Lv8ljTt4v+SVKOzmHu i187N47LrD3tOucjFBLMPHW3/61uOo0pOBPYW/+bdTGXtk7br9Ongl1zP1xOAsE5nx1M 7pNw== 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=LD6bWHsvpIW6JLyYP0adz+bmbXf3SYhsL00bBAldSnI=; b=wweytRLnQNKxTnUbhKu7UZEyl7LL5a8Oo8zC4r0/Ka29cBtxN0ZMxlDfsiVacqp6mc qYq3TvzmLJUH+gpRs1LCGvqvb8CRSE07eLXKQXrrVGLeMMu9xHZViedcHsxbXPtE85M4 iYNlrfCyS7iLA2yRFxoRKV2RKmOTx26BCLn8A0QDg6yynIfmQw7qAK5ZxGctTU+DzzG1 gYJhr6n4QNIlgUZffWm6oI4wZ1VCFzSa2/dieE5KeyMmf3ynWlQbMprgmj3TwbJqLw3r EiWzwvgO6v3IAMmQc8wQwX/+Xx96uv9gFq7GOzM8UJ2Yy06mGMOkfOx5TC2jH1MfvZWG MDSw== X-Gm-Message-State: AOAM532JCb8oSNGDoJpdFvOqXFX5eK1PGwE7NXGwJObzmAwx1coxG0I3 bUjSzfJDhfQF/nxg3Kgh/fRpg5I7B1CLvl1L X-Google-Smtp-Source: ABdhPJzroEmuY3ICM1+Yfr4r5Ru61NsQtwDMEysJLrYupMEmWQDtYncx4OC7dt6YWY/+ENjMJ6pEsw== X-Received: by 2002:aa7:cd99:: with SMTP id x25mr38841926edv.266.1635757702942; Mon, 01 Nov 2021 02:08:22 -0700 (PDT) Received: from localhost.localdomain ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id m1sm6745680ejn.121.2021.11.01.02.08.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 02:08:22 -0700 (PDT) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Aswath Govindraju , Michal Simek , Philipp Tomsich , Jaehoon Chung , Stephen Carlson , Kever Yang , Faiz Abbas , Yifeng Zhao , Simon Glass , Philipp Tomsich , Peng Fan , Ashok Reddy Soma , Alper Nebi Yasak Subject: [PATCH 1/3] mmc: sdhci: Add HS400 Enhanced Strobe support Date: Mon, 1 Nov 2021 12:07:52 +0300 Message-Id: <20211101090755.23762-2-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211101090755.23762-1-alpernebiyasak@gmail.com> References: <20211101090755.23762-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 --- 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.33.1