mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "open list:BAREBOX" <barebox@lists.infradead.org>
Subject: [PATCH 1/2] filetype: detect i.MX flash header v3
Date: Wed, 30 Oct 2024 16:00:00 +0100	[thread overview]
Message-ID: <20241030-imx-flash-header-v3-v1-1-1ae28b3b8947@pengutronix.de> (raw)
In-Reply-To: <20241030-imx-flash-header-v3-v1-0-1ae28b3b8947@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/filetype.c  | 4 ++++
 include/filetype.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/common/filetype.c b/common/filetype.c
index 67ae4916d1..73ea17e19b 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -70,6 +70,7 @@ static const struct filetype_str filetype_str[] = {
 	[filetype_elf] = { "ELF", "elf" },
 	[filetype_imx_image_v1] = { "i.MX image (v1)", "imx-image-v1" },
 	[filetype_imx_image_v2] = { "i.MX image (v2)", "imx-image-v2" },
+	[filetype_imx_image_v3] = { "i.MX image (v3)", "imx-image-v3" },
 	[filetype_layerscape_image] = { "Layerscape image", "layerscape-PBL" },
 	[filetype_layerscape_qspi_image] = { "Layerscape QSPI image", "layerscape-qspi-PBL" },
 	[filetype_nxp_fspi_image] = { "NXP FlexSPI image", "nxp-fspi-image" },
@@ -432,6 +433,9 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
 	if (buf[8] == 0xAA995566 && buf[9] == 0x584C4E58)
 		return filetype_zynq_image;
 
+	if (buf8[0] == 0x0 && buf8[3] == 0x87)
+		return filetype_imx_image_v3;
+
 	return filetype_unknown;
 }
 
diff --git a/include/filetype.h b/include/filetype.h
index 6425c9c8c5..c24d061e8f 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -51,6 +51,7 @@ enum filetype {
 	filetype_elf,
 	filetype_imx_image_v1,
 	filetype_imx_image_v2,
+	filetype_imx_image_v3,
 	filetype_layerscape_image,
 	filetype_layerscape_qspi_image,
 	filetype_ubootvar,

-- 
2.39.5




  reply	other threads:[~2024-10-30 15:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 14:59 [PATCH 0/2] ARM: i.MX: Add bootm support for i.MX flash header v3 images Sascha Hauer
2024-10-30 15:00 ` Sascha Hauer [this message]
2024-10-30 15:00 ` [PATCH 2/2] ARM: i.MX: Add bootm handler " Sascha Hauer

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=20241030-imx-flash-header-v3-v1-1-1ae28b3b8947@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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