From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Cc: Marek Vasut <marex@denx.de>, Fabio Estevam <festevam@denx.de>,
Peng Fan <peng.fan@nxp.com>, Stefano Babic <sbabic@denx.de>
Subject: [PATCH] ARM: imx: romapi: Repair FlexSPI NOR boot offset
Date: Wed, 9 Mar 2022 17:09:45 +0100 [thread overview]
Message-ID: <20220309160945.214591-1-marex@denx.de> (raw)
The FlexSPI NOR boot offset does not require any special handling,
the image_offset is correct in either case (0x1000 for FlexSPI NOR
and 0x8000 for SD/eMMC) and the offset of u-boot.itb from the start
of flash.bin is always 0x58000 on MX8MN/MX8MP, which matches the
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 - 0x8000 in case
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300, which is always the
case on MX8MN/MX8MP.
The CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is really overloaded in
case of the MX8MN/MX8MP, but fixing that needs additional plumbing.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
arch/arm/mach-imx/spl_imx_romapi.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
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);
}
static int is_boot_from_stream_device(u32 boot)
--
2.34.1
next reply other threads:[~2022-03-09 16:10 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 16:09 Marek Vasut [this message]
2022-03-21 3:35 ` [EXT] [PATCH] ARM: imx: romapi: Repair FlexSPI NOR boot offset Ye Li
2022-03-21 14:59 ` Marek Vasut
2022-03-23 2:42 ` Ye Li
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=20220309160945.214591-1-marex@denx.de \
--to=marex@denx.de \
--cc=festevam@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