[EXT] [PATCH] ARM: imx: romapi: Repair FlexSPI NOR boot offset

Marek Vasut marex at denx.de
Wed Mar 23 22:16:07 CET 2022


On 3/23/22 03:42, Ye Li wrote:
> Hi Marek,

Hi,

>>>> diff --git a/arch/arm/mach-imx/spl_imx_romapi.c b/arch/arm/mach-
>>>> imx/spl_imx_romapi.c
>>>> index d827de375a6..c47f5a6bdb4 100644
>>>> --- a/arch/arm/mach-imx/spl_imx_romapi.c
>>>> +++ b/arch/arm/mach-imx/spl_imx_romapi.c
>>>> @@ -38,14 +38,8 @@ ulong spl_romapi_raw_seekable_read(u32 offset,
>>>> u32
>>>> size, void *buf)
>>>>
>>>>    ulong __weak spl_romapi_get_uboot_base(u32 image_offset, u32
>>>> rom_bt_dev)
>>>>    {
>>>> -       u32 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;
>>>> -
>>>> -       return offset;
>>>> +       return image_offset +
>>>> +               (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 -
>>>> 0x8000);
>>>>    }
>>> The change is problematic to flexspi.
>> Yes, I need this change to get boot from flexspi working on i.MX8MP,
>> without this change writing flash.bin to flexspi results in
>> unbootable
>> system.
>>
> 
> To support boot from flexspi, please try another two changes.
> 1. Modify board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg, set
>     "BOOT_FROM" to "fspi". (This change is unnecessary on 8MP after
> switch to binman)

I already use binman and I need to be able to boot from both SD and 
FlexSPI, with this patch I can do just that.

> 2. Update the u-boot.itb offset in imx8mp-u-boot.dtsi, set the offset
> to 0x5f000.  The previous offset 0x58000 is for SD, calculated by
> 0x60000 - 0x8000 (32KB image offset).
> 
>     		uboot: blob-ext at 2 {
> 			filename = "u-boot.itb";
> 			offset = <0x5f000>;
> 		};

But that breaks booting from SD card for me ?


More information about the U-Boot mailing list