All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] imx: imx8: fix loading container image from eMMC boot partitions
Date: Tue, 22 Oct 2019 11:49:06 +0200	[thread overview]
Message-ID: <20191022114906.1386b50c@crub> (raw)
In-Reply-To: <AM0PR04MB4481D2F2CFB825C902ADED1088680@AM0PR04MB4481.eurprd04.prod.outlook.com>

Hi Peng,

On Tue, 22 Oct 2019 08:13:31 +0000
Peng Fan peng.fan at nxp.com wrote:
...
> But I do not understand well. When burn flash.bin into boot partition,
> SPL will be loaded from boot partition,

yes, correct. On my test board flash.bin is in the first boot partition
and SPL is loaded as expected.

> SPL will load container images
> from boot partition,

SPL switches to user partition during the inif of mmc driver:
  spl_mmc_load() -> mmc_init()

Then it tries to load the container image in spl_mmc_get_uboot_raw_sector(),
but here it reads the data from user partition and the header is not
recognized as a valid header.

> but in your case, I think SPL will load container images
> from user partition, so you switch back to boot partition.

yes, because the mmc init switches to user partition.

> From common/spl/spl_mmc.c, there is boot partition switch there,
> Why need to add such logic in imx8/image.c?

spl_mmc_load() reads the container header before partition
switching.

--
Anatolij

  reply	other threads:[~2019-10-22  9:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 15:21 [U-Boot] [PATCH] imx: imx8: fix loading container image from eMMC boot partitions Anatolij Gustschin
2019-10-22  2:43 ` Peng Fan
2019-10-22  7:34   ` Anatolij Gustschin
2019-10-22  8:13     ` Peng Fan
2019-10-22  9:49       ` Anatolij Gustschin [this message]
2019-10-22 10:08         ` Peng Fan
2019-10-22 10:16           ` Anatolij Gustschin
2019-10-22 10:18             ` Peng Fan
2019-10-22 10:19               ` Anatolij Gustschin

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=20191022114906.1386b50c@crub \
    --to=agust@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.