From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Tue, 22 Oct 2019 11:49:06 +0200 Subject: [U-Boot] [PATCH] imx: imx8: fix loading container image from eMMC boot partitions In-Reply-To: References: <20191021152154.15385-1-agust@denx.de> <20191022093422.54bc10f8@crub> Message-ID: <20191022114906.1386b50c@crub> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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