From mboxrd@z Thu Jan 1 00:00:00 1970 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 59118C433EF for ; Sat, 2 Apr 2022 22:18:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2041D8395A; Sun, 3 Apr 2022 00:17:35 +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="b74cRqP9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F37DC839B9; Sun, 3 Apr 2022 00:17:29 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (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 4A9DA83988 for ; Sun, 3 Apr 2022 00:17:18 +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: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EA05BB80AC3; Sat, 2 Apr 2022 22:17:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86701C340F0; Sat, 2 Apr 2022 22:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648937836; bh=3T7WUaTjBkXsgkC1oP0G4vqLYMvB18IhZscyhVj+pxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b74cRqP9FBV/mWQyaK6jPB8+qtyHnwK8XIrneGaXeFdj55UHwSmTVBIXZaFqhP6jt 73pSwljcWMGxi9AyIKrsJYLDZAbGsVxDUwJkKFBrkmiN64s7SQ4Ptl7WLuz2OeVItg 4H9AyKnvM9to/hLEF+tKeQK2bSnPd156ZE5ke0KBlO2azUy0+y0cK2JGykkiEw22or fsIUomIvLUPZfDRlLjWLkPBCDQFL183fZ4OdMPv9jJLtN+RnYR76Vo9i37g7rzkXSl 2PnuJA2AHpzeO0kPs8Y9wB+oYCQniN8qc4P1pbAT3GjHb2981IVqtb3QFd4q1MR9Sz BObe5jgyxVunA== Received: by pali.im (Postfix) id 3F780819; Sun, 3 Apr 2022 00:17:16 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Priyanka Jain , Peng Fan , Jaehoon Chung Cc: u-boot@lists.denx.de Subject: [PATCH 3/3] mmc: fsl_esdhc_spl: Call mmc_init() before booting from SD card Date: Sun, 3 Apr 2022 00:17:01 +0200 Message-Id: <20220402221701.18498-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220402221701.18498-1-pali@kernel.org> References: <20220402221701.18498-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 If env is stored on SD card then U-Boot SPL automatically calls mmc_init() before it is going to load proper U-Boot from SD card. If env is not stored on SD card then U-Boot SPL fails to read proper U-Boot from SD card due to missing mmc_init() call. So add missing mmc_init() call into fsl_esdhc_spl's mmc_boot() function. It fixes booting from SD card on P2020 boards without env support in SPL. mmc_init() returns early if card was already initialized, so there is no issue with calling this function more times. Signed-off-by: Pali Rohár --- drivers/mmc/fsl_esdhc_spl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c index b87597a88e1d..0146a231b221 100644 --- a/drivers/mmc/fsl_esdhc_spl.c +++ b/drivers/mmc/fsl_esdhc_spl.c @@ -77,6 +77,11 @@ void __noreturn mmc_boot(void) hang(); } + if (mmc_init(mmc)) { + puts("spl: mmc device init failed!\n"); + hang(); + } + #ifdef CONFIG_FSL_CORENET offset = CONFIG_SYS_MMC_U_BOOT_OFFS; #else -- 2.20.1