From patchwork Wed Jul 14 14:37:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1505253 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=eIw3X7W5; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GQ0VM6MlHz9sXb for ; Thu, 15 Jul 2021 00:38:19 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DF67982000; Wed, 14 Jul 2021 16:38:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="eIw3X7W5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A18B981FC6; Wed, 14 Jul 2021 16:37:59 +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.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 240FD81F74 for ; Wed, 14 Jul 2021 16:37:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E644613C0; Wed, 14 Jul 2021 14:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626273470; bh=FccFS8zSG+YSZSKJyGToo4K2tjfUGVMrevT3mn3lUj4=; h=From:To:Cc:Subject:Date:From; b=eIw3X7W5PS2IO8o1km9LqECU7BNSGuYWjjMkwXRupCp0nEfwaFPxuyBGhq+5vs3ZM EaclInTivr0F9dD+TbnZT5F7QbClEkfEo1N8SsqK2kRc5pGyqW9Tdtg1R36wEf+xg0 A+Y8t8+TqiqJj4lvcBtipHQQSWZzyATsXXi5SWxSvfRJFJUfgqMv4ZS/GU1fYAXCAx BZXeW8lmAcrb0FS28LUw/KkW7RtHrkw0WRr4wzau4NPasWHQtj/ROi3MdhyAVvwKQp 1vyepTiJO6OXARI4fXKhQmXyV8CJyOtQS6wDM0AJCq8kXfSPQ3XQqxg3Jx+CDg4T74 yuBv9Z017kv6Q== Received: by pali.im (Postfix) id A8FE8723; Wed, 14 Jul 2021 16:37:47 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Stefan Roese , Andre Heider , =?utf-8?q?G=C3=A9rald_Kerma?= , Konstantin Porotchkin , Baruch Siach , Fabio Estevam , Peng Fan Cc: u-boot@lists.denx.de Subject: [PATCH 1/3] arm: mvebu: Espressobin: Fix setting $fdtfile env Date: Wed, 14 Jul 2021 16:37:27 +0200 Message-Id: <20210714143729.2396-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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 Ensure that 'env default -a' always set correct value to $fdtfile, even when custom user variable is already stored in non-volatile env storage (means that env_get("fdtfile") call returns non-NULL value). As default value is now correctly set like if specified at compile time in CONFIG_EXTRA_ENV_SETTINGS, there is no need to set $fdtfile explicitly via env_set("fdtfile", ...) call. So remove wrong skip based on env_get("fdtfile") and then also unneeded env_set("fdtfile", ...) call. Fixes: c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for $fdtfile env variable") Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- board/Marvell/mvebu_armada-37xx/board.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 6a0e2fc3cd8f..53408d37af9b 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -133,9 +133,6 @@ int board_late_init(void) device_unbind(dev); } - if (env_get("fdtfile")) - return 0; - /* Ensure that 'env default -a' set correct value to $fdtfile */ if (ddr4 && emmc) strcpy(ptr, "fdtfile=marvell/armada-3720-espressobin-v7-emmc.dtb"); @@ -146,10 +143,6 @@ int board_late_init(void) else strcpy(ptr, "fdtfile=marvell/armada-3720-espressobin.dtb"); - /* If $fdtfile was not set explicitly by user then set default value */ - if (!env_get("fdtfile")) - env_set("fdtfile", ptr + sizeof("fdtfile=")); - return 0; } #endif From patchwork Wed Jul 14 14:37:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1505252 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=CDhut/2R; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GQ0VB0vkTz9sXh for ; Thu, 15 Jul 2021 00:38:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F14FE81F74; Wed, 14 Jul 2021 16:38:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="CDhut/2R"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A538C81F74; Wed, 14 Jul 2021 16:37:59 +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.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 1D31281FA1 for ; Wed, 14 Jul 2021 16:37:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 6C5C261369; Wed, 14 Jul 2021 14:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626273470; bh=TNNOSZpCUMf/7ziJn7rQBPu2QQrMnlOEXeqjthf6AJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CDhut/2RyixkCdtUjxsczVW9goitJQR23HhPvWuAWT1neMDrLtZtK3b+KtvPSkHB3 7J9QH16YOFzPdwCeO3ex1/UrMXVzDvRmtXJzsoplqyzmA0d5xU2UDZAnvlbKWOW1mj p/zjzdwVo4ZY03JxzKPfQpKXRWcjV54HFpc0B2g2lpYJQC+MA5slAcsgi5xOZx23C1 LV/RnfQantvPqWa9+yeZdKiOImS9euakb3/Bv8TLtbrk/9SQJf1CK0E1Bgo32T+6uR k49kYw5J60QzH1BUIdtcCc5EVjyBYG1kBSI4Oh2UEtjGqSqJQSarnh6QU6gD7TtuSf iAXal7nSFQvhw== Received: by pali.im (Postfix) id 1B736C62; Wed, 14 Jul 2021 16:37:48 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Stefan Roese , Andre Heider , =?utf-8?q?G=C3=A9rald_Kerma?= , Konstantin Porotchkin , Baruch Siach , Fabio Estevam , Peng Fan Cc: u-boot@lists.denx.de Subject: [PATCH 2/3] arm: mvebu: Espressobin: Use function mmc_get_op_cond() for detecting eMMC Date: Wed, 14 Jul 2021 16:37:28 +0200 Message-Id: <20210714143729.2396-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210714143729.2396-1-pali@kernel.org> References: <20210714143729.2396-1-pali@kernel.org> MIME-Version: 1.0 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 Use function mmc_get_op_cond() instead of mmc_init() for detecting presence of eMMC. Documentation for this function says that it could be used to detect the presence of SD/eMMC when no card detect logic is available. This function is also used by mx6cuboxi board for detecting presence of eMMC. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- board/Marvell/mvebu_armada-37xx/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 53408d37af9b..6086996b8062 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -124,7 +124,7 @@ int board_late_init(void) /* eMMC is mmc dev num 1 */ mmc_dev = find_mmc_device(1); - emmc = (mmc_dev && mmc_init(mmc_dev) == 0); + emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0); /* if eMMC is not present then remove it from DM */ if (!emmc && mmc_dev) { From patchwork Wed Jul 14 14:37:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1505254 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Uv6Jdrl/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GQ0VY6vcQz9sRR for ; Thu, 15 Jul 2021 00:38:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EB92F8202B; Wed, 14 Jul 2021 16:38:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="Uv6Jdrl/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1498881FA1; Wed, 14 Jul 2021 16:38:00 +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.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 2CBD781FD5 for ; Wed, 14 Jul 2021 16:37:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 7052C613C5; Wed, 14 Jul 2021 14:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626273470; bh=F2A4gTVJQ1dzDrGSjc/IkFS1RDgDlq5yRU789emdV80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uv6Jdrl/3O3lWb6GticcWpYDwYmVzydx85eYmdFTN00RbqVCuzZcU4WmItVMPylxe ShjA1a7m1QVb4n1h/PzbMhy4bO3IRa3FBYTNxOurDCIfJc+xTP01zJqBuhyco1Vkz6 NyBvR9gjjMLKZN/QkhHuOEfJALvhNLznbe1CTgsPILfqjUztXE8amb0t5E4c1sGZoX EBIy2e8wQTfFGnsQxYdfvlXuYuMdOfRCYBokuOsM05jbfiHZ6+IvC+AtbtmhYAA0R6 3ekAnHHHw7xzfZ5m/8xAaGsEDTuMPpZBStWMoOuXXlujT1XOz+DY4o3oMrE6ygv0tU njmoDMCONtCTw== Received: by pali.im (Postfix) id 9ECD9DEF; Wed, 14 Jul 2021 16:37:48 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Stefan Roese , Andre Heider , =?utf-8?q?G=C3=A9rald_Kerma?= , Konstantin Porotchkin , Baruch Siach , Fabio Estevam , Peng Fan Cc: u-boot@lists.denx.de Subject: [PATCH 3/3] mmc: mmc_get_op_cond: Allow quiet detection of eMMC Date: Wed, 14 Jul 2021 16:37:29 +0200 Message-Id: <20210714143729.2396-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210714143729.2396-1-pali@kernel.org> References: <20210714143729.2396-1-pali@kernel.org> MIME-Version: 1.0 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 Add a new 'quiet' argument to mmc_get_op_cond() function which avoids printing error message when SD/eMMC card is not detected. Espressobin and mx6cuboxi boards use this function for detecting presence of eMMC and therefore it is expected and normal that eMMC does not have to be connected. So error message "Card did not respond to voltage select!" should be skipped in this case as it is not an error. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Acked-by: Jaehoon Chung --- board/Marvell/mvebu_armada-37xx/board.c | 2 +- board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +- drivers/mmc/mmc.c | 7 ++++--- include/mmc.h | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 6086996b8062..fdc873b1952f 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -124,7 +124,7 @@ int board_late_init(void) /* eMMC is mmc dev num 1 */ mmc_dev = find_mmc_device(1); - emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0); + emmc = (mmc_dev && mmc_get_op_cond(mmc_dev, true) == 0); /* if eMMC is not present then remove it from DM */ if (!emmc && mmc_dev) { diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index 3eadc38f6fd4..6207bf8253ab 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -374,7 +374,7 @@ static bool has_emmc(void) mmc = find_mmc_device(2); if (!mmc) return 0; - return (mmc_get_op_cond(mmc) < 0) ? 0 : 1; + return (mmc_get_op_cond(mmc, true) < 0) ? 0 : 1; } int checkboard(void) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 1e83007286b2..8078a89f18cb 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -2766,7 +2766,7 @@ static int mmc_power_cycle(struct mmc *mmc) return mmc_power_on(mmc); } -int mmc_get_op_cond(struct mmc *mmc) +int mmc_get_op_cond(struct mmc *mmc, bool quiet) { bool uhs_en = supports_uhs(mmc->cfg->host_caps); int err; @@ -2842,7 +2842,8 @@ retry: if (err) { #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT) - pr_err("Card did not respond to voltage select! : %d\n", err); + if (!quiet) + pr_err("Card did not respond to voltage select! : %d\n", err); #endif return -EOPNOTSUPP; } @@ -2882,7 +2883,7 @@ int mmc_start_init(struct mmc *mmc) return -ENOMEDIUM; } - err = mmc_get_op_cond(mmc); + err = mmc_get_op_cond(mmc, false); if (!err) mmc->init_in_progress = 1; diff --git a/include/mmc.h b/include/mmc.h index 6f943e78b740..0bf19de20e52 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -900,9 +900,10 @@ int mmc_set_bkops_enable(struct mmc *mmc); * the presence of SD/eMMC when no card detect logic is available. * * @param mmc Pointer to a MMC device struct + * @param quiet Be quiet, do not print error messages when card is not detected. * @return 0 on success, <0 on error. */ -int mmc_get_op_cond(struct mmc *mmc); +int mmc_get_op_cond(struct mmc *mmc, bool quiet); /** * Start device initialization and return immediately; it does not block on