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 86094C433F5 for ; Fri, 22 Apr 2022 12:07:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 50C7483D79; Fri, 22 Apr 2022 14:07:33 +0200 (CEST) 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="JrlKZaUK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6F7C583D7A; Fri, 22 Apr 2022 14:07:31 +0200 (CEST) Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) (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 6E11483D71 for ; Fri, 22 Apr 2022 14:07:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@gmail.com Received: by mail-pl1-x62b.google.com with SMTP id c12so10401213plr.6 for ; Fri, 22 Apr 2022 05:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=kZTOtZ4MLaNLB8UJjlwLQ2f/RlL7uaeDX/900pV9Z2w=; b=JrlKZaUKRzb/ZAQivbCnRAppHe9aB61P0kXpvTND7LdapWXKt5zOim3kAnUSMzYAub eOycFk80iZbl6HKOztFNcsllYdL1ivytUbvIr49MpwqbYC9i2X9JQPpfy8zYsskvpHfe kluRrZZOzptZ7PZj2LZE3vt+aNdYEr/ahjiMBTeq6VBem9BJB1F0VcTxNznAxDo0Z1CH 9HR6KUr44rnFXmRVStPJTZ2PIYuM63tNuBJP5QBeeKtlbkJoOuVpOnwUy7ZK6GCPoacm rboeVw997mci7/TTniTIrf9a8f4M9/HDojC33lPGGjLt+sXx6i4OpG9s30BkTALQAdKf oqGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=kZTOtZ4MLaNLB8UJjlwLQ2f/RlL7uaeDX/900pV9Z2w=; b=1NsrIZBYM5Hk8YaQ7rqEY3m3n8zAYpxqkgAeUTBBmSfSPhB+HDnHPF36hP39ahxuGl lIebNyw/Fji1pRkgwdN4KeGb9Ii63+Yy7nLh7qo9Rsr+Yc7oc8T01U6sNBFvhXSw0o0Z errchG/85i8SVhZgreRLF2x9/TIU0lKGtug1ueWeIM/WQxVKYyqVRSMXom08uteEsFKa FnPj9YyFAx5WpGQMoo/imiG2Q7Ewow7EiB65zZ/A0snpBNdNXcP9gY+mHdMa3yjtm8Ko C45luKhHPjWwg0DOdZWazkgfWjo1u5K+kUTEOg3Os2gn8jx5uoa4Ypr4MALhs3BWnHfq Jcqw== X-Gm-Message-State: AOAM530ccTNRPMJDBbAmyWh+IoY304wtHo24mRz/Orf2fCvVoCYzAGrE M9a+66YuC/cX8Efg1C97KRCnpTvBAa8= X-Google-Smtp-Source: ABdhPJwg+hbg50exMqqfi8WHSac8BUHDx9qos9dLS2MyXmqiZYgW1iU/cv3IUeZPbkRugvtkifwV+Q== X-Received: by 2002:a17:903:41c8:b0:15b:1491:5d51 with SMTP id u8-20020a17090341c800b0015b14915d51mr4289183ple.96.1650629246859; Fri, 22 Apr 2022 05:07:26 -0700 (PDT) Received: from [192.168.0.19] ([183.99.112.216]) by smtp.gmail.com with ESMTPSA id 123-20020a620681000000b004fa7c20d732sm2390375pfg.133.2022.04.22.05.07.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Apr 2022 05:07:25 -0700 (PDT) Message-ID: <91c80ac7-2e2f-27d7-ff48-97fd8f683e0b@gmail.com> Date: Fri, 22 Apr 2022 21:07:22 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 3/3] mmc: fsl_esdhc_spl: Call mmc_init() before booting from SD card Content-Language: en-US To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , Priyanka Jain , Peng Fan , Jaehoon Chung Cc: u-boot@lists.denx.de References: <20220402221701.18498-1-pali@kernel.org> <20220402221701.18498-4-pali@kernel.org> From: Jaehoon Chung In-Reply-To: <20220402221701.18498-4-pali@kernel.org> 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 On 4/3/22 07:17, Pali Rohár wrote: > 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 Reviewed-by: Jaehoon Chung Best Regards, Jaehoon Chung > --- > 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