]> git.baikalelectronics.ru Git - uboot.git/commit
spl: spl_mmc: fix getting raw_sect when boot from emmc boot partition
authorPeng Fan <peng.fan@nxp.com>
Wed, 23 Oct 2019 01:43:30 +0000 (01:43 +0000)
committerPeng Fan <peng.fan@nxp.com>
Tue, 29 Oct 2019 02:09:44 +0000 (10:09 +0800)
commitb429d2c1c130feda4dad94a8bd18afc2b7756f7f
tree281802acf5f6939333c867fc05093b77ea5e9594
parentb23a617765299a95114f1673ba41dcc1c057a593
spl: spl_mmc: fix getting raw_sect when boot from emmc boot partition

On i.MX8, when booting from eMMC boot partition, the whole flash.bin
is stored in boot partition, however SPL switches to user partition
during the init 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.

So we move spl_mmc_get_uboot_raw_sector after eMMC partition switch
to address this issue.

Anyway put spl_mmc_get_uboot_raw_sector before eMMC partition switch
is not correct, so let's move it after eMMC partition switch.

Reported-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
common/spl/spl_mmc.c