summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2021-08-07 11:01:08 +0300
committerStefano Babic <sbabic@denx.de>2021-08-09 15:46:51 +0300
commite8b68048e1deca93976a2656faf778f877a208b2 (patch)
treeb7c8cf447a921792ff2311a333ef5cf7a45c1c4e /arch
parent27b6a4504e8d190177bbe8ece5a079cd7e83de4d (diff)
downloadu-boot-e8b68048e1deca93976a2656faf778f877a208b2.tar.xz
imx8ulp: Add workaround for eMMC boot
When booting from boot part1/2, the image offset should be 0, but ROM has a bug to return 0x8000. Has to workaround the issue before ROM fix it. Use a ROM function to know boot from emmc boot part or user part So we can set the image offset accordingly. Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/image-container.c7
-rw-r--r--arch/arm/mach-imx/imx8ulp/soc.c10
2 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/image-container.c b/arch/arm/mach-imx/image-container.c
index c3f62872c6..68b30bcfc5 100644
--- a/arch/arm/mach-imx/image-container.c
+++ b/arch/arm/mach-imx/image-container.c
@@ -265,10 +265,17 @@ unsigned long spl_nor_get_uboot_base(void)
#endif
#ifdef CONFIG_SPL_BOOTROM_SUPPORT
+u32 __weak spl_arch_boot_image_offset(u32 image_offset, u32 rom_bt_dev)
+{
+ return image_offset;
+}
+
ulong spl_romapi_get_uboot_base(u32 image_offset, u32 rom_bt_dev)
{
ulong end;
+ image_offset = spl_arch_boot_image_offset(image_offset, rom_bt_dev);
+
end = get_imageset_end((void *)(ulong)image_offset, ROM_API_DEV);
end = ROUND(end, SZ_1K);
diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c
index 96d65690c4..1c33acc7dd 100644
--- a/arch/arm/mach-imx/imx8ulp/soc.c
+++ b/arch/arm/mach-imx/imx8ulp/soc.c
@@ -533,3 +533,13 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
{
memset(mac, 0, 6);
}
+
+int (*card_emmc_is_boot_part_en)(void) = (void *)0x67cc;
+u32 spl_arch_boot_image_offset(u32 image_offset, u32 rom_bt_dev)
+{
+ /* Hard code for eMMC image_offset on 8ULP ROM, need fix by ROM, temp workaround */
+ if (((rom_bt_dev >> 16) & 0xff) == BT_DEV_TYPE_MMC && card_emmc_is_boot_part_en())
+ image_offset = 0;
+
+ return image_offset;
+}