From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 09/13] filetype: Add filetype for i.MX23/28 SD card images
Date: Wed, 6 May 2020 10:17:12 +0200 [thread overview]
Message-ID: <20200506081716.20143-9-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20200506081716.20143-1-s.hauer@pengutronix.de>
Add a filetype for i.MX23/28 SD card images so that they can be
detected.
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 fd6e8e3d1c..813f55ef61 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -81,6 +81,7 @@ static const struct filetype_str filetype_str[] = {
"ubootvar" },
[filetype_stm32_image_v1] = { "STM32 image (v1)", "stm32-image-v1" },
[filetype_zynq_image] = { "Zynq image", "zynq-image" },
+ [filetype_mxs_sd_image] = { "i.MX23/28 SD card image", "mxs-sd-image" },
};
const char *file_type_to_string(enum filetype f)
@@ -342,6 +343,9 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
if (buf[0] == 0x01ee0100 && buf[1] == 0xaa55aa55)
return filetype_layerscape_qspi_image;
+ if (le32_to_cpu(buf[0]) == 0x00112233 && le32_to_cpu(buf[1]) == 0x1)
+ return filetype_mxs_sd_image;
+
if (bufsize < 64)
return filetype_unknown;
diff --git a/include/filetype.h b/include/filetype.h
index c3a5bdfbbe..3019dda6ed 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -51,6 +51,7 @@ enum filetype {
filetype_ubootvar,
filetype_stm32_image_v1,
filetype_zynq_image,
+ filetype_mxs_sd_image,
filetype_max,
};
--
2.26.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2020-05-06 8:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 8:17 [PATCH 01/13] net: fec_imx: Make ptp clock optional Sascha Hauer
2020-05-06 8:17 ` [PATCH 02/13] net: fec_imx: Return with an error when mandatory clock is missing Sascha Hauer
2020-05-06 8:17 ` [PATCH 03/13] clk: mxs: Do not enable enet_out clock Sascha Hauer
2020-05-06 8:17 ` [PATCH 04/13] arm: mxs: Add Kconfig option for device tree boards Sascha Hauer
2020-05-06 8:17 ` [PATCH 05/13] clk: mxs: Fix clock numbering Sascha Hauer
2020-05-06 8:17 ` [PATCH 06/13] clk imx28: Add USB clocks Sascha Hauer
2020-05-06 8:17 ` [PATCH 07/13] clk: mxs: Use device tree provided clock lookups Sascha Hauer
2020-05-06 8:17 ` [PATCH 08/13] ARM: mxs: Increase VDDD voltage to match specification Sascha Hauer
2020-05-06 8:17 ` Sascha Hauer [this message]
2020-05-06 8:17 ` [PATCH 10/13] watchdog: i.MX28: Add device tree support Sascha Hauer
2020-05-06 8:17 ` [PATCH 11/13] usb: imx-usb-phy: Add delay Sascha Hauer
2020-05-06 8:17 ` [PATCH 12/13] usb: i.MX: Add i.MX28 support Sascha Hauer
2020-05-06 8:17 ` [PATCH 13/13] ARM: i.MX28: Update defconfig 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=20200506081716.20143-9-s.hauer@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