Add a filetype for i.MX23/28 SD card images so that they can be detected. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- 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@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox