public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ye Li <ye.li@nxp.com>
To: "marex@denx.de" <marex@denx.de>,
	"u-boot@lists.denx.de" <u-boot@lists.denx.de>
Cc: Peng Fan <peng.fan@nxp.com>,
	"festevam@denx.de" <festevam@denx.de>,
	"sbabic@denx.de" <sbabic@denx.de>
Subject: Re: [EXT] [PATCH] ARM: imx: romapi: Repair FlexSPI NOR boot offset
Date: Wed, 23 Mar 2022 02:42:00 +0000	[thread overview]
Message-ID: <1648002489.7912.21.camel@nxp.com> (raw)
In-Reply-To: <1eb56ad6-0158-5600-0ef9-6970316e96e7@denx.de>

Hi Marek,

On Mon, 2022-03-21 at 15:59 +0100, Marek Vasut wrote:
> Caution: EXT Email
> 
> On 3/21/22 04:35, 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) 

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@2 {
			filename = "u-boot.itb";
			offset = <0x5f000>;
		};

Best regards,
Ye Li
> > 
> > Actually u-boot.itb is fixed at device offset 0x60000 (= 512 *
> > 0x300)
> > for flexspi/emmc/sd.The case is the image_offset for emmc/sd may
> > vary according to the
> > primary boot or secondary boot and the eMMC user partition or boot
> > partition.
> > 
> > If you changed to "image_offset +
> > (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 - 0x8000", the
> > address
> > for flexspi becomes 0x59000 (= 0x1000 + 0x60000 - 0x8000)
> This is how I populate the FlexSPI on MX8MP:
> 
> dhcp ${loadaddr} 192.168.1.1:flash.bin ; \
> \
> setexpr sfaddr ${loadaddr} - 0x1000 ; \
> \
> base ${sfaddr} ; \
> mw 0 0 0x400 ; \
> mw 0x400 0x42464346 ; \
> mw 0x404 0x56010000 ; \
> mw 0x40c 00030300 ; \
> mw 0x444 0x00020101 ; \
> mw 0x450 0x10000000 ; \
> mw 0x480 0x0818040b ; \
> mw 0x484 0x24043008 ; \
> mw 0x5c0 0x100 ; \
> mw 0x5c4 0x10000 ; \
> base 0 ; \
> \
> setexpr filesize ${filesize} + 0x1000 ; \
> \
> sf probe && sf update ${sfaddr} 0 ${filesize}

  reply	other threads:[~2022-03-23  2:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 16:09 [PATCH] ARM: imx: romapi: Repair FlexSPI NOR boot offset Marek Vasut
2022-03-21  3:35 ` [EXT] " Ye Li
2022-03-21 14:59   ` Marek Vasut
2022-03-23  2:42     ` Ye Li [this message]
2022-03-23 21:16       ` Marek Vasut
2022-03-28  6:54         ` Ye Li
2022-03-28 14:54           ` Marek Vasut
2022-03-29  2:49             ` Ye Li
2022-03-29  9:01               ` Marek Vasut
2022-03-29  9:56                 ` Ye Li
2022-03-30 22:27                   ` Marek Vasut
2022-03-30 22:36                     ` Fabio Estevam
2022-03-31  4:45                     ` Ye Li
2022-03-31 15:09             ` Tim Harvey
2022-03-31 15:26               ` Marek Vasut
2022-03-31 16:03                 ` Tim Harvey
2022-03-31 16:41                   ` Marek Vasut
2022-03-31 18:02                     ` Tim Harvey
2022-03-31 18:04                       ` Marek Vasut
2022-04-12 21:40 ` sbabic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1648002489.7912.21.camel@nxp.com \
    --to=ye.li@nxp.com \
    --cc=festevam@denx.de \
    --cc=marex@denx.de \
    --cc=peng.fan@nxp.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox