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 8ACE2C433F5 for ; Wed, 16 Feb 2022 14:58:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CF9C1808BA; Wed, 16 Feb 2022 15:58:52 +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="DDpxVdep"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9D5F383046; Wed, 16 Feb 2022 15:58:50 +0100 (CET) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 4A6E3808BA for ; Wed, 16 Feb 2022 15:58:47 +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=heiko.thiery@gmail.com Received: by mail-ej1-x636.google.com with SMTP id p15so5190807ejc.7 for ; Wed, 16 Feb 2022 06:58:47 -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:mime-version :content-transfer-encoding; bh=IV+8UJXAx3lalL4zIo+iDynf2dmQJeGO2dLm7YjyL8k=; b=DDpxVdep8zBIWC/5EIGTxyuINQegX7GDQ2Dz7rD1v6D4LWRQQewpifxpoMJ9w9HUum SaFJWRHIGGdCvBiU93IgtpM4W04YjkShS9ydCbBNMm2VeaYkitTl9DpkRzPYVoQ/C+gU /OHED8dokp0FN3sHPqEvKzOcPV4N5D05z1WDK7xHU4LFBLOdFIeHMhdcXG8ZLqQjClb5 xilEV1feuEK4WpvQyGULJsi4dFd9Hdso15x5SW9DYZFA6TtUlosYz/339MfgqdDHmUyC WuDHTCkjtKsxODppZQo8UfmyAg5wk44bM/AUM2l7GUPBU+sHo0Ya5iEvxlQnuoCKB0R+ BoGw== 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:mime-version :content-transfer-encoding; bh=IV+8UJXAx3lalL4zIo+iDynf2dmQJeGO2dLm7YjyL8k=; b=E1Lb3TQl5T7TRnomfgpqn+ULAmKPXzLwiVHNX/Ag/j0XKZ/3NkY3+wamwV9pk4kUin AzooePri9ryQVasgXFnDEbsa4SrgGRuardA7hgpSMdH6qnwAnzcH4TTO89yj9mqk/uoU skKGa/2dDiGDfuYKyJAvhohLRupoOFCnB47uGDXPMOuxxUm0TH4hCz9lwN4n9sV+Vt0B HGmJifvET2peQ5gcls8JTPEITeXiW4rdw/L1R4iXX+m9RBqfWJ9tKiRlnK5/VQRm6xR9 IJ1/GtzRwq6Q90i8QiTOwN/enwTsAaaWejaGxqQ0AC6iBeR0ZVpmfQqZINduUiVOMF5S 424Q== X-Gm-Message-State: AOAM530fhydatvTwSkjl8F51Ence1WZspc5WWlEwavhbLJd7uU9H7liX yROzCFuwxlKGnYuf5mN7tCj6cNXRaCw= X-Google-Smtp-Source: ABdhPJzj7aZ+Wv0xBQRdtClOnLtNVDPyNpCHNIdVgwokzzGqI7EeQXEIR04mF7J+qJ949VvAPbIBmw== X-Received: by 2002:a17:907:954f:b0:6ad:3614:73e6 with SMTP id ex15-20020a170907954f00b006ad361473e6mr2606259ejc.731.1645023526446; Wed, 16 Feb 2022 06:58:46 -0800 (PST) Received: from hthiery.kontron.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id v18sm2975751ejk.125.2022.02.16.06.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 06:58:45 -0800 (PST) From: Heiko Thiery To: u-boot@lists.denx.de Cc: Michael Walle , Heiko Thiery Subject: [PATCH] kontron-pitx-imx8m: fix board_mmc_getcd() Date: Wed, 16 Feb 2022 15:58:10 +0100 Message-Id: <20220216145809.2148467-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.2 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.5 at phobos.denx.de X-Virus-Status: Clean The function wrongly will return the card detection status of the SD card (USDHC2) for the eMMC (USDHC1). Thus booting from eMMC without an inserted SD card will fail. Signed-off-by: Heiko Thiery --- board/kontron/pitx_imx8m/spl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/board/kontron/pitx_imx8m/spl.c b/board/kontron/pitx_imx8m/spl.c index c043dd205b..ef3256898d 100644 --- a/board/kontron/pitx_imx8m/spl.c +++ b/board/kontron/pitx_imx8m/spl.c @@ -76,17 +76,16 @@ static struct i2c_pads_info i2c_pad_info1 = { int board_mmc_getcd(struct mmc *mmc) { struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; - int ret = 0; switch (cfg->esdhc_base) { case USDHC1_BASE_ADDR: /* the eMMC does not have a CD pin */ - ret = 1; + return 1; case USDHC2_BASE_ADDR: - ret = !gpio_get_value(USDHC2_CD_GPIO); + return !gpio_get_value(USDHC2_CD_GPIO); } - return ret; + return 0; } -- 2.30.2