diff options
author | Stefano Babic | 2020-06-09 11:19:55 +0200 |
---|---|---|
committer | Stefano Babic | 2020-06-09 11:19:55 +0200 |
commit | 385429680106f8612386e26564f69dccdd110620 (patch) | |
tree | 641a6bf90b0c261a04cf4cb280269668f69cee5b /arch/arm/mach-imx | |
parent | a13644c065173fad6bcaf163569bd01e6eb93834 (diff) |
Revert "imx: rom api: fix image offset computation"
This reverts commit 1f63ee656698724bcdc4e711b4ccd267f6bf64ab.
As reported by Ye Li on ML:
1. Removing the image_offset will break secondary (redundant) boot support for sd and emmc.
2. When booting from emmc boot partition, the image_offset is 0. But the flash.bin
generated by mkimage with imximage-8mp-lpddr4.cfg is for sd. It expects to be burn at 32KB offset.
The fit offset 0x60000 has already included the 32KB offset. So when you burn this flash.bin
to emmc boot partition at offset 0, the fit offset should subtract the 32KB (0x60000 - 0x8000).
Signed-off-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/spl_imx_romapi.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/spl_imx_romapi.c b/arch/arm/mach-imx/spl_imx_romapi.c index 893b7d12a79..f588a5f5216 100644 --- a/arch/arm/mach-imx/spl_imx_romapi.c +++ b/arch/arm/mach-imx/spl_imx_romapi.c @@ -84,7 +84,12 @@ 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); - offset = CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512; + if (((rom_bt_dev >> 16) & 0xff) == BT_DEV_TYPE_FLEXSPINOR) + 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((u8 *)header, offset, size, ((uintptr_t)header) ^ offset ^ size); |