mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-07-06 06:21:51 +00:00
imx: rom api: fix image offset computation
When not booting from FlexSPI, the offset computation is: offset = image_offset + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 - 0x8000; When booting from SD card or eMMC user partition, image_offset is 0x8000. It is useless to add and remove 0x8000. When booting from other device, image_offset is 0 so this computation is wrong. Simplfy this computation to work on all booting devices. Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
This commit is contained in:
parent
2c72bf21c6
commit
1f63ee6566
1 changed files with 1 additions and 6 deletions
|
@ -84,12 +84,7 @@ 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) == 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;
|
||||
|
||||
offset = CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512;
|
||||
size = ALIGN(sizeof(struct image_header), pagesize);
|
||||
ret = g_rom_api->download_image((u8 *)header, offset, size,
|
||||
((uintptr_t)header) ^ offset ^ size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue