From patchwork Thu May 26 14:37:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 576242 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:c603:0:0:0:0 with SMTP id jv3csp634149mab; Thu, 26 May 2022 07:37:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc+tlLQh92bz5kLIxtqJa0hREwfp3cDySzEGwpQiQgxqMT8kWT0j0M2p40w/83hcwP0+oK X-Received: by 2002:a02:b693:0:b0:32d:adc7:ad17 with SMTP id i19-20020a02b693000000b0032dadc7ad17mr20139689jam.266.1653575871853; Thu, 26 May 2022 07:37:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653575871; cv=none; d=google.com; s=arc-20160816; b=uMp+rAjIuRRiKluGc5hE3vlQRViQ8Q2z4HtiGl7mV9j5kfllXH7KmSXiW/sr2WJlst 2KAx6ZgX6IR/mFkJw3qy9Ok93kPRLmGvmDmnafd3rbKcHlYzStc9b55yiO8ZzD2L0aei IaI672UJnKJxd714lb3O/euPuU8i+FwSizPtbn4+Lp+UumzXOirCq63zGHj5qpb6npQB kdwcz0QXrlwwA4cVIp8CagWfD+XYWAy+3Zxj3yFhRwy3v2bXI7UaNJGRwupbPK/exg2M BXr0aoShKmK+6/853kXbn0dWU7pMNsEqp2cQOg5SYuVOn+2BxrGpFOvDw9ClgwwNjS+3 o5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=OfZ5fBRDZA5efIh6BrDzevS0MFsRAEArcTqtmPJa5nQ=; b=muIEYs1rHNDEzpsK9STz6xz0nr5VGQTZDhCrdL77lmiwwcXqeC1F+62noNpeWjW9FC Ofal3wVzeABbMHTWid7kWf3kP80/4xZXZpYlZRIumWbH4sdrm5+hcLxWmzG/zeDIOEue 3P8PiDFpHBXySrMGYcmlKlhHGhR5iADCvVAk1e5p78VCfQNxggIw3gxH39lYB525u79L 2nW/aGQOtbALKRkvK0+l8dLVkbAQBt7IEDXbQpwWg+fwRpnkAGLZIHh/gMFr8GNnBRlX JgHGFhmvBageq0P+ZLPIeg7HgbH+7BKjZEYWcTmhD6DrXhDHpQ6ycBiMl0tXbN0nOvwv aOfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sxx8axtb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id k20-20020a056638141400b0032ef79bd1bdsi2108501jad.161.2022.05.26.07.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 07:37:51 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sxx8axtb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C7A798434D; Thu, 26 May 2022 16:37:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="sxx8axtb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6F03B83E1B; Thu, 26 May 2022 16:37:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 40597842C4 for ; Thu, 26 May 2022 16:37:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=loic.poulain@linaro.org Received: by mail-wm1-x329.google.com with SMTP id r6-20020a1c2b06000000b00396fee5ebc9so1204019wmr.1 for ; Thu, 26 May 2022 07:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=OfZ5fBRDZA5efIh6BrDzevS0MFsRAEArcTqtmPJa5nQ=; b=sxx8axtbtzUKj9Gd8Wn71vvXwjrNupPsFrMsAjCIBk240sFhqQBVxdEU0TReUxhuoY 5HsmQWCCVMeMqFfQUCI5nvKLNBinSkwQx+0w8UztJ3WweHYaWGGPIKKFH8/9F8dWRmGJ 1ejFgcf/RZdgRWwqYwKomqRpYF8MqxgDSttD31gSuqDoa/rKfJndMR21aPnKkTZbclLC eMNMEMoa1hd2rrb9ybnyv+6qsMyrNgafXmEUMbf0kc4Jdd9i2L7Te8XtGipKjMeXc9Qo c/RjurZ5K4ygI6J/GArZFDOFsmyxjKuexlQvO0Kz7hf4Flwkx/HnwNqPY1Km8lvAb8zZ Avwg== 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; bh=OfZ5fBRDZA5efIh6BrDzevS0MFsRAEArcTqtmPJa5nQ=; b=bSLHlWDJhgqZaRdVYfwCtHseBxSi6oUF/uinKzZ3GOqDPFsi3hZfmS2VNJ14Nwaxtl geWcmtjiBUKwZV+cW2RYQlTXFWx96ob+7cHqkoadHuoUklx33zn9Eqi5HsH72nkgbD8f SnRzEI06XSmgNAhP8MOn/eL8xiSl16bHX7XSF5lEqu1WaKXBUh9d6CUq2lSzXpEYjeIX zBmggsFFwT2M/8O79ao+6SQplnCcx9p/uLP+a0aHyN9vvMArScCEt4rwcZPb1SUcNP8b HG7ptkSayijmBKuzNkFOFE+RagGpg68CMjRcZffJN2FXDu53W/EnTcrsH5sZI9nl6VMK uvlg== X-Gm-Message-State: AOAM533nUS5H3VcQhb1LrkP7pPq8XQuq4rJyg+PBaTopZ0HZ9/omD4e5 5N74UV8ADtim/7Yi3Dy99pb48g== X-Received: by 2002:a05:600c:1c19:b0:397:682d:aaf2 with SMTP id j25-20020a05600c1c1900b00397682daaf2mr2613448wms.198.1653575846704; Thu, 26 May 2022 07:37:26 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:58:ccc3:729d:30c2]) by smtp.gmail.com with ESMTPSA id d17-20020adffbd1000000b0020d09f0b766sm1927898wrs.71.2022.05.26.07.37.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 May 2022 07:37:26 -0700 (PDT) From: Loic Poulain To: peng.fan@nxp.com, jh80.chung@samsung.com Cc: u-boot@lists.denx.de, Loic Poulain Subject: [PATCH 1/2] mmc: Add support for wait_dat0 callback Date: Thu, 26 May 2022 16:37:21 +0200 Message-Id: <1653575842-14986-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 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 There is no wait_dat0 mmc ops, causing operations waiting for data line state change (e.g mmc_switch_voltage) to fallback to a 250ms active delay. mmc_ops still used when DM_MMC is not enabled, which is often the case for SPL. The result can be unexpectly long SPL boot time. This change adds support for wait_dat0() mmc operation. Signed-off-by: Loic Poulain Reviewed-by: Jaehoon Chung --- drivers/mmc/mmc.c | 3 +++ include/mmc.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index f6ccd83..109f340 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -34,6 +34,9 @@ static int mmc_set_signal_voltage(struct mmc *mmc, uint signal_voltage); static int mmc_wait_dat0(struct mmc *mmc, int state, int timeout_us) { + if (mmc->cfg->ops->wait_dat0) + return mmc->cfg->ops->wait_dat0(mmc, state, timeout_us); + return -ENOSYS; } diff --git a/include/mmc.h b/include/mmc.h index 6bdcce8..b7e94e8 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -561,6 +561,7 @@ struct mmc_ops { int (*getwp)(struct mmc *mmc); int (*host_power_cycle)(struct mmc *mmc); int (*get_b_max)(struct mmc *mmc, void *dst, lbaint_t blkcnt); + int (*wait_dat0)(struct mmc *mmc, int state, int timeout_us); }; static inline int mmc_hs400_prepare_ddr(struct mmc *mmc)