summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2019-06-10 04:02:00 -0700
committerYe Li <ye.li@nxp.com>2019-06-11 01:27:30 -0700
commitc33881aa8a7e5a545b156ea2c452c5f7578f1ebd (patch)
treebf14206c01d1501d22acf15088c78ed917ceefaf /common
parent0621daad605581ce8e489749cfbfc1d4f48be894 (diff)
MLK-21988 imx8mn: rom_api: Change to support secondary boot on SD/eMMC
ROM supports secondary boot which can boot from a new offset specified by fuse. So adjust the offset calculation by counting the ROM's image_offset parameter for SD/eMMC. The secondary boot on flexspi is different like SD/eMMC. ROM will map the space of secondary boot to the start of flexspi AHB memory. So it is same as primary boot for SPL. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_imx_romapi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/spl/spl_imx_romapi.c b/common/spl/spl_imx_romapi.c
index 97cc9562a1..84c222e628 100644
--- a/common/spl/spl_imx_romapi.c
+++ b/common/spl/spl_imx_romapi.c
@@ -100,10 +100,11 @@ static int spl_romapi_load_image_seekable(struct spl_image_info *spl_image,
printf("image offset 0x%x, pagesize 0x%x, ivt offset 0x%x\n", image_offset, pagesize, offset);
- if (((rom_bt_dev >> 16) & 0xff) == BOOT_FROM_MMC && image_offset == 0)
- offset = CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 - 0x8000;
- else
+ if (((rom_bt_dev >> 16) & 0xff) == BOOT_FROM_SPINOR)
offset = CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512;
+ else
+ offset = image_offset + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 - 0x8000;
+
size = ALIGN(sizeof(struct image_header), pagesize);
ret = g_rom_api->download_image((uint8_t*)header, offset, size, ((uintptr_t) header) ^ offset ^ size);
gd = pgd;