public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@gmail.com>
To: "Pali Rohár" <pali@kernel.org>,
	"Priyanka Jain" <priyanka.jain@nxp.com>,
	"Peng Fan" <peng.fan@nxp.com>,
	"Jaehoon Chung" <jh80.chung@samsung.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH 3/3] mmc: fsl_esdhc_spl: Call mmc_init() before booting from SD card
Date: Fri, 22 Apr 2022 21:07:22 +0900	[thread overview]
Message-ID: <91c80ac7-2e2f-27d7-ff48-97fd8f683e0b@gmail.com> (raw)
In-Reply-To: <20220402221701.18498-4-pali@kernel.org>



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 <pali@kernel.org>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

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

      reply	other threads:[~2022-04-22 12:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-02 22:16 [PATCH 0/3] mmc: fsl_esdhc_spl: Fix booting P2020 from SD card Pali Rohár
2022-04-02 22:16 ` [PATCH 1/3] mmc: fsl_esdhc_spl: pre-PBL: check for BOOT signature instead of MBR/DBR Pali Rohár
2022-04-22 12:06   ` Jaehoon Chung
2022-04-02 22:17 ` [PATCH 2/3] mmc: fsl_esdhc_spl: pre-PBL: fix determining U-Boot size Pali Rohár
2022-04-22 12:07   ` Jaehoon Chung
2022-04-02 22:17 ` [PATCH 3/3] mmc: fsl_esdhc_spl: Call mmc_init() before booting from SD card Pali Rohár
2022-04-22 12:07   ` Jaehoon Chung [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91c80ac7-2e2f-27d7-ff48-97fd8f683e0b@gmail.com \
    --to=jh80.chung@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=pali@kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=priyanka.jain@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox