summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSébastien Szymanski <sebastien.szymanski@armadeus.com>2020-05-13 16:02:28 +0200
committerStefano Babic <sbabic@denx.de>2020-06-08 10:42:14 +0200
commit1f63ee656698724bcdc4e711b4ccd267f6bf64ab (patch)
tree576af1c3b66ae32e6b02dd3be90f3aa2c993c617 /arch
parent2c72bf21c66692cf0b9c305c27ac4a5218a4dd01 (diff)
downloadu-boot-1f63ee656698724bcdc4e711b4ccd267f6bf64ab.tar.gz
u-boot-1f63ee656698724bcdc4e711b4ccd267f6bf64ab.tar.xz
u-boot-1f63ee656698724bcdc4e711b4ccd267f6bf64ab.zip
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/spl_imx_romapi.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/arm/mach-imx/spl_imx_romapi.c b/arch/arm/mach-imx/spl_imx_romapi.c
index f588a5f521..893b7d12a7 100644
--- a/arch/arm/mach-imx/spl_imx_romapi.c
+++ b/arch/arm/mach-imx/spl_imx_romapi.c
@@ -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);