From patchwork Wed Aug 14 19:52:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 1147191 X-Patchwork-Delegate: van.freenix@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hyYfAG3i"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4680ck0QxXz9s00 for ; Thu, 15 Aug 2019 05:53:09 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9EB00C21E12; Wed, 14 Aug 2019 19:53:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 23494C21C3F; Wed, 14 Aug 2019 19:53:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E9AE6C21C3F; Wed, 14 Aug 2019 19:52:59 +0000 (UTC) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by lists.denx.de (Postfix) with ESMTPS id 43B4BC21C2F for ; Wed, 14 Aug 2019 19:52:59 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id m12so73363plt.5 for ; Wed, 14 Aug 2019 12:52:59 -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:mime-version :content-transfer-encoding; bh=CK0FmC7YAFmIDmLJZOyTsQeNkCVwpEa22u6LCbBkUNM=; b=hyYfAG3io5euEUpqs55QP8VekdGsnmy2u/ebmBsz5OjsqB5HOHjpQy0KTY1Rowp6M+ hifyhzaNOtQC2NE43jXiW6jS3cPm6X8H3/zPw6E325bQUyQAg2k4/p1q1Me2jm3KlMR6 VktwbvKKPjGX2ALR/x2R9uj0E58rU6U5ZMp47duyITaCD20DuhOpSMAmbZOs3byl2Iuo 3h2R0a/KebKbun4S1wr/c4UszdMNz99czalmLbjxpJ8IKXp0PggKUTK5BUjgpTH1ym8T goDe4G2zORn82UHvn4xHUNM6QGDnONib1o/UWfmlI92Bq8ecjtTlRr9fHg1jMg8kwuiq LZhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CK0FmC7YAFmIDmLJZOyTsQeNkCVwpEa22u6LCbBkUNM=; b=qv3H953os2xVS9CUr2XyHvhLM1tqMq/beMoTy6ka3DVOmNXlqyo0GyvgWx9WPEcBmF YVy6icKiN/j2XVewXLgBcWXVewT2qWXzOc6RbPteAqrxVFyq2GI75xrDu+F4KBBNb7nz bkxYyho9fj7Cukv3PKbwKnjl/e542H6dFOQ+qCGgQ5G3dFJhjPQzD2a+RgHI+kGqz4Ml 9ps5CFTsAOmd20OkfeXEEu1uY+4zcicGkyYAD7xfoCEjIrtbvMpjzXhV/ZDoCl1A+WFB N8eCNwlR7KGbVo40Ed2pNynlfB9WF401NAW9I89HxKMFCQNcs0TQTBBVn8TEjlCjVkxf ZOEw== X-Gm-Message-State: APjAAAW9Jx9+2rGLK8dM61CmgVLi7XQclrYm7uWBTmzVGSWGeAWGsZQt T+18owYXw27+YdRyB8O+7hUVcvOw9MyIig== X-Google-Smtp-Source: APXvYqxHIwTvickydR6IDd4zLPKiS2KHrwTkIiLpYEDcVmuG6z/O6HDxFaAKhmY0q0nXLljMtBFuOA== X-Received: by 2002:a17:902:4401:: with SMTP id k1mr974120pld.193.1565812377194; Wed, 14 Aug 2019 12:52:57 -0700 (PDT) Received: from localhost ([2001:67c:2e5c:2011:2e0:4cff:fe68:2882]) by smtp.gmail.com with ESMTPSA id b24sm683150pfd.91.2019.08.14.12.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2019 12:52:56 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Wed, 14 Aug 2019 22:52:50 +0300 Message-Id: <20190814195251.14208-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Tom Rini , Praneeth Bajjuri Subject: [U-Boot] [PATCH 1/2] mmc: Fix timeout values passed to mmc_wait_dat0() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" mmc_wait_dat0() expects timeout argument to be in usec units. But some overlying functions operate on timeout in msec units. Convert timeout from msec to usec when passing it to mmc_wait_dat0(). This fixes 'avb' commands on BeagleBoard X15, because next chain was failing: get_partition() -> mmc_switch_part() -> __mmc_switch() -> mmc_wait_dat0() when passing incorrect timeout from __mmc_switch() to mmc_wait_dat0(). Fixes: bb98b8c5c06a ("mmc: During a switch, poll on dat0 if available and check the final status") Signed-off-by: Sam Protsenko Reviewed-by: Eugeniu Rosca Tested-by: Eugeniu Rosca Reviewed-by: Peng Fan Tested-by: Igor Opaniuk Reviewed-by: Igor Opaniuk --- drivers/mmc/mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index eecc7d687e..e247730ff2 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -235,7 +235,7 @@ int mmc_poll_for_busy(struct mmc *mmc, int timeout) unsigned int status; int err; - err = mmc_wait_dat0(mmc, 1, timeout); + err = mmc_wait_dat0(mmc, 1, timeout * 1000); if (err != -ENOSYS) return err; @@ -778,7 +778,7 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value, start = get_timer(0); /* poll dat0 for rdy/buys status */ - ret = mmc_wait_dat0(mmc, 1, timeout); + ret = mmc_wait_dat0(mmc, 1, timeout * 1000); if (ret && ret != -ENOSYS) return ret; From patchwork Wed Aug 14 19:52:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 1147192 X-Patchwork-Delegate: van.freenix@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="kB+kMdHb"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4680dK5Bvjz9s00 for ; Thu, 15 Aug 2019 05:53:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 70824C21E50; Wed, 14 Aug 2019 19:53:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8D12CC21D9A; Wed, 14 Aug 2019 19:53:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CEE26C21D83; Wed, 14 Aug 2019 19:53:09 +0000 (UTC) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by lists.denx.de (Postfix) with ESMTPS id 344EFC21D72 for ; Wed, 14 Aug 2019 19:53:06 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id i18so88210pgl.11 for ; Wed, 14 Aug 2019 12:53:06 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=I968wJ9e1tBGCmCp5jaP/8birzngfWm+vfLNYk6S144=; b=kB+kMdHbjI81sKhbuQuyObvofk31wrumTX4klGP7ZPfUyp3DPNn2AO60FuVicyQXdP 74m13F3L/Wy0w6RcSpYl3ypNfoBRJkgH0JpnJv323/Y9uXDuoTDFkoBXZN6Zc4rKVOBT V/IpXXZnJLK2l31DoDQ4CYsqTrLZLU1z9lP8MYb1V3vIEDQ5RaU+CKCJz3bPQnkmMs1W gHu7Sp/ZwCIWrPB2sm8GysgrfKNm0+SeCaNX5AO2Y2mdKl5FV3/8xOhQhkgvL0B94Pyp n56TemmXUHmE+V9BTsIRXmoh90nJZomWMmqVB6iGb4CyoWoQNHhoJ2sqed6+5S0+sC8P S2vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I968wJ9e1tBGCmCp5jaP/8birzngfWm+vfLNYk6S144=; b=FIBpQsSnH8E9GrlSihlkHZpX2QvuhypZV4f1LKM6XP03q/ZCT29wRJx6jg+Ttz++p6 VgHSL+lgEhowuZ1e9cIceetJJ5T0pUuxNsuAj2i2ZqTinWO4vUvXCCV7SKH67FOkVsgs Xvf4tWZgCepZJ3lpXWvjyIcehKqjROMBulgXcaAYClq7BGKxlpgVL/0o153YO/TRZaUq BkSLUbEzOOMfGesXSgDZBkXbfuSLBDQsDOTQxidLCzOUqTWYnXjfUt9kFTufJHrlFZbU iMFjiFhx49Jfp0VoFWFdgeBtUBwQAdIdwyLgXut8G0G0ZpZtrofsE0+1g1eHFe/rK1DD kIOA== X-Gm-Message-State: APjAAAXTw6uA39F0akJ3QJISncnPbII5UzW2ALN1XQe9I2xLIWSL4DEh VOkwN6WaTurtUpgNU1BdjuiZhkcBfvttlg== X-Google-Smtp-Source: APXvYqzHWaHa6xUK5DyBsJsyxiJDhTpZSn55BZg5lYapWUamSmjGxPT7A3DnvkRbfQK5Knj+4jopyQ== X-Received: by 2002:a63:1f03:: with SMTP id f3mr656838pgf.249.1565812384012; Wed, 14 Aug 2019 12:53:04 -0700 (PDT) Received: from localhost ([2001:67c:2e5c:2011:2e0:4cff:fe68:2882]) by smtp.gmail.com with ESMTPSA id c5sm631844pfo.175.2019.08.14.12.53.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2019 12:53:03 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Wed, 14 Aug 2019 22:52:51 +0300 Message-Id: <20190814195251.14208-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190814195251.14208-1-semen.protsenko@linaro.org> References: <20190814195251.14208-1-semen.protsenko@linaro.org> MIME-Version: 1.0 Cc: Tom Rini , Praneeth Bajjuri Subject: [U-Boot] [PATCH 2/2] mmc: Rename timeout parameters for clarification X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" It's quite hard to figure out time units for various function that have timeout parameters. This leads to possible errors when one forgets to convert ms to us, for example. Let's rename those parameters correspondingly to 'timeout_us' and 'timeout_ms' to prevent such issues further. While at it, add time units info as comments to struct mmc fields. This commit doesn't change the behavior, only renames parameters names. Buildman should report no changes at all. Signed-off-by: Sam Protsenko Reviewed-by: Peng Fan Reviewed-by: Igor Opaniuk --- drivers/mmc/mmc-uclass.c | 8 ++++---- drivers/mmc/mmc.c | 24 ++++++++++++------------ drivers/mmc/mmc_write.c | 8 ++++---- drivers/mmc/omap_hsmmc.c | 6 +++--- drivers/mmc/renesas-sdhi.c | 7 ++++--- include/mmc.h | 12 ++++++------ 6 files changed, 33 insertions(+), 32 deletions(-) diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index 551007905c..f740bae3c7 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -47,18 +47,18 @@ int mmc_set_ios(struct mmc *mmc) return dm_mmc_set_ios(mmc->dev); } -int dm_mmc_wait_dat0(struct udevice *dev, int state, int timeout) +int dm_mmc_wait_dat0(struct udevice *dev, int state, int timeout_us) { struct dm_mmc_ops *ops = mmc_get_ops(dev); if (!ops->wait_dat0) return -ENOSYS; - return ops->wait_dat0(dev, state, timeout); + return ops->wait_dat0(dev, state, timeout_us); } -int mmc_wait_dat0(struct mmc *mmc, int state, int timeout) +int mmc_wait_dat0(struct mmc *mmc, int state, int timeout_us) { - return dm_mmc_wait_dat0(mmc->dev, state, timeout); + return dm_mmc_wait_dat0(mmc->dev, state, timeout_us); } int dm_mmc_get_wp(struct udevice *dev) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index e247730ff2..c8f71cd0c1 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -31,7 +31,7 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps); #if !CONFIG_IS_ENABLED(DM_MMC) -static int mmc_wait_dat0(struct mmc *mmc, int state, int timeout) +static int mmc_wait_dat0(struct mmc *mmc, int state, int timeout_us) { return -ENOSYS; } @@ -230,12 +230,12 @@ int mmc_send_status(struct mmc *mmc, unsigned int *status) return -ECOMM; } -int mmc_poll_for_busy(struct mmc *mmc, int timeout) +int mmc_poll_for_busy(struct mmc *mmc, int timeout_ms) { unsigned int status; int err; - err = mmc_wait_dat0(mmc, 1, timeout * 1000); + err = mmc_wait_dat0(mmc, 1, timeout_ms * 1000); if (err != -ENOSYS) return err; @@ -256,13 +256,13 @@ int mmc_poll_for_busy(struct mmc *mmc, int timeout) return -ECOMM; } - if (timeout-- <= 0) + if (timeout_ms-- <= 0) break; udelay(1000); } - if (timeout <= 0) { + if (timeout_ms <= 0) { #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT) pr_err("Timeout waiting card ready\n"); #endif @@ -750,17 +750,17 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value, { unsigned int status, start; struct mmc_cmd cmd; - int timeout = DEFAULT_CMD6_TIMEOUT_MS; + int timeout_ms = DEFAULT_CMD6_TIMEOUT_MS; bool is_part_switch = (set == EXT_CSD_CMD_SET_NORMAL) && (index == EXT_CSD_PART_CONF); int retries = 3; int ret; if (mmc->gen_cmd6_time) - timeout = mmc->gen_cmd6_time * 10; + timeout_ms = mmc->gen_cmd6_time * 10; if (is_part_switch && mmc->part_switch_time) - timeout = mmc->part_switch_time * 10; + timeout_ms = mmc->part_switch_time * 10; cmd.cmdidx = MMC_CMD_SWITCH; cmd.resp_type = MMC_RSP_R1b; @@ -778,7 +778,7 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value, start = get_timer(0); /* poll dat0 for rdy/buys status */ - ret = mmc_wait_dat0(mmc, 1, timeout * 1000); + ret = mmc_wait_dat0(mmc, 1, timeout_ms * 1000); if (ret && ret != -ENOSYS) return ret; @@ -788,11 +788,11 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value, * stated timeout to be sufficient. */ if (ret == -ENOSYS && !send_status) - mdelay(timeout); + mdelay(timeout_ms); /* Finally wait until the card is ready or indicates a failure * to switch. It doesn't hurt to use CMD13 here even if send_status - * is false, because by now (after 'timeout' ms) the bus should be + * is false, because by now (after 'timeout_ms' ms) the bus should be * reliable. */ do { @@ -806,7 +806,7 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value, if (!ret && (status & MMC_STATUS_RDY_FOR_DATA)) return 0; udelay(100); - } while (get_timer(start) < timeout); + } while (get_timer(start) < timeout_ms); return -ETIMEDOUT; } diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c index 02648b0f50..b52ff9f3bc 100644 --- a/drivers/mmc/mmc_write.c +++ b/drivers/mmc/mmc_write.c @@ -79,7 +79,7 @@ ulong mmc_berase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt) u32 start_rem, blkcnt_rem; struct mmc *mmc = find_mmc_device(dev_num); lbaint_t blk = 0, blk_r = 0; - int timeout = 1000; + int timeout_ms = 1000; if (!mmc) return -1; @@ -119,7 +119,7 @@ ulong mmc_berase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt) blk += blk_r; /* Waiting for the ready status */ - if (mmc_poll_for_busy(mmc, timeout)) + if (mmc_poll_for_busy(mmc, timeout_ms)) return 0; } @@ -131,7 +131,7 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start, { struct mmc_cmd cmd; struct mmc_data data; - int timeout = 1000; + int timeout_ms = 1000; if ((start + blkcnt) > mmc_get_blk_desc(mmc)->lba) { printf("MMC: block number 0x" LBAF " exceeds max(0x" LBAF ")\n", @@ -177,7 +177,7 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start, } /* Waiting for the ready status */ - if (mmc_poll_for_busy(mmc, timeout)) + if (mmc_poll_for_busy(mmc, timeout_ms)) return 0; return blkcnt; diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 3ea7f4e173..bade129aea 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -430,7 +430,7 @@ static void omap_hsmmc_conf_bus_power(struct mmc *mmc, uint signal_voltage) writel(ac12, &mmc_base->ac12); } -static int omap_hsmmc_wait_dat0(struct udevice *dev, int state, int timeout) +static int omap_hsmmc_wait_dat0(struct udevice *dev, int state, int timeout_us) { int ret = -ETIMEDOUT; u32 con; @@ -442,8 +442,8 @@ static int omap_hsmmc_wait_dat0(struct udevice *dev, int state, int timeout) con = readl(&mmc_base->con); writel(con | CON_CLKEXTFREE | CON_PADEN, &mmc_base->con); - timeout = DIV_ROUND_UP(timeout, 10); /* check every 10 us. */ - while (timeout--) { + timeout_us = DIV_ROUND_UP(timeout_us, 10); /* check every 10 us. */ + while (timeout_us--) { dat0_high = !!(readl(&mmc_base->pstate) & PSTATE_DLEV_DAT0); if (dat0_high == target_dat0_high) { ret = 0; diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c index 7c53aa221e..0cb65b480d 100644 --- a/drivers/mmc/renesas-sdhi.c +++ b/drivers/mmc/renesas-sdhi.c @@ -499,15 +499,16 @@ static int renesas_sdhi_set_ios(struct udevice *dev) } #if CONFIG_IS_ENABLED(MMC_UHS_SUPPORT) -static int renesas_sdhi_wait_dat0(struct udevice *dev, int state, int timeout) +static int renesas_sdhi_wait_dat0(struct udevice *dev, int state, + int timeout_us) { int ret = -ETIMEDOUT; bool dat0_high; bool target_dat0_high = !!state; struct tmio_sd_priv *priv = dev_get_priv(dev); - timeout = DIV_ROUND_UP(timeout, 10); /* check every 10 us. */ - while (timeout--) { + timeout_us = DIV_ROUND_UP(timeout_us, 10); /* check every 10 us. */ + while (timeout_us--) { dat0_high = !!(tmio_sd_readl(priv, TMIO_SD_INFO2) & TMIO_SD_INFO2_DAT0); if (dat0_high == target_dat0_high) { ret = 0; diff --git a/include/mmc.h b/include/mmc.h index 46422f41a4..686ba00656 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -457,10 +457,10 @@ struct dm_mmc_ops { * * @dev: Device to check * @state: target state - * @timeout: timeout in us + * @timeout_us: timeout in us * @return 0 if dat0 is in the target state, -ve on error */ - int (*wait_dat0)(struct udevice *dev, int state, int timeout); + int (*wait_dat0)(struct udevice *dev, int state, int timeout_us); #if CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT) /* set_enhanced_strobe() - set HS400 enhanced strobe */ @@ -476,14 +476,14 @@ int dm_mmc_set_ios(struct udevice *dev); int dm_mmc_get_cd(struct udevice *dev); int dm_mmc_get_wp(struct udevice *dev); int dm_mmc_execute_tuning(struct udevice *dev, uint opcode); -int dm_mmc_wait_dat0(struct udevice *dev, int state, int timeout); +int dm_mmc_wait_dat0(struct udevice *dev, int state, int timeout_us); /* Transition functions for compatibility */ int mmc_set_ios(struct mmc *mmc); int mmc_getcd(struct mmc *mmc); int mmc_getwp(struct mmc *mmc); int mmc_execute_tuning(struct mmc *mmc, uint opcode); -int mmc_wait_dat0(struct mmc *mmc, int state, int timeout); +int mmc_wait_dat0(struct mmc *mmc, int state, int timeout_us); int mmc_set_enhanced_strobe(struct mmc *mmc); #else @@ -602,8 +602,8 @@ struct mmc { u8 part_attr; u8 wr_rel_set; u8 part_config; - u8 gen_cmd6_time; - u8 part_switch_time; + u8 gen_cmd6_time; /* units: 10 ms */ + u8 part_switch_time; /* units: 10 ms */ uint tran_speed; uint legacy_speed; /* speed for the legacy mode provided by the card */ uint read_bl_len;