summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-06-22 13:26:23 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-07-14 20:20:18 +0200
commit9a727ccc46e702329853478b6531640207c2e604 (patch)
tree162b94ab287074d1b409df2526afc27a858c0362 /arch/arm/mach-imx
parentf6dee177830ea8007614d7f2789b4a28b95b112a (diff)
downloadbarebox-9a727ccc46e702329853478b6531640207c2e604.tar.gz
barebox-9a727ccc46e702329853478b6531640207c2e604.tar.xz
ARM: i.MX: bbu: Fix IVT offset for i.MX8MP
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/imx-bbu-internal.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index a922470988..1b3cb70da8 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -384,16 +384,21 @@ static enum filetype imx_bbu_expected_filetype(void)
static unsigned long imx_bbu_flash_header_offset_mmc(void)
{
- unsigned long offset = SZ_1K;
+ /*
+ * i.MX8MQ moved the header by 32K to accomodate for GPT partition
+ * tables. The offset to the IVT is 1KiB.
+ */
+ if (cpu_is_mx8mm() || cpu_is_mx8mq())
+ return SZ_32K + SZ_1K;
/*
- * i.MX8MQ moved the header by 32K to accomodate for GPT
- * partition tables
+ * i.MX8MP moved the header by 32K to accomodate for GPT partition
+ * tables, but the IVT is right at the beginning of the image.
*/
- if (cpu_is_mx8m())
- offset += SZ_32K;
+ if (cpu_is_mx8mp())
+ return SZ_32K;
- return offset;
+ return SZ_1K;
}
static int imx_bbu_update(struct bbu_handler *handler, struct bbu_data *data)