summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-06-10 15:04:20 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-06-12 08:28:04 +0200
commite7b23c6a9df57b5c8bba4fa9c10f8b5f793745cc (patch)
treed23b14209befafaab5e67d1ac71d56b0484b1abc
parentff40732d0adfba399a3a2914d347a85c24fbf461 (diff)
downloadbarebox-e7b23c6a9df57b5c8bba4fa9c10f8b5f793745cc.tar.gz
filetype: Add filetype for MXS bootstream
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/filetype.c3
-rw-r--r--include/filetype.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/common/filetype.c b/common/filetype.c
index 25d9761..28a4b2c 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -60,6 +60,7 @@ static const struct filetype_str filetype_str[] = {
"TI OMAP CH boot image (big endian)", "ch-image-be" },
[filetype_xz_compressed] = { "XZ compressed", "xz" },
[filetype_exe] = { "MS-DOS executable", "exe" },
+ [filetype_mxs_bootstream] = { "Freescale MXS bootstream", "mxsbs" },
};
const char *file_type_to_string(enum filetype f)
@@ -292,6 +293,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
if (buf8[0] == 'M' && buf8[1] == 'Z')
return filetype_exe;
+ if (le32_to_cpu(buf[5]) == 0x504d5453)
+ return filetype_mxs_bootstream;
if (is_barebox_arm_head(_buf))
return filetype_arm_barebox;
diff --git a/include/filetype.h b/include/filetype.h
index cca4dad..e452b7a 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -34,6 +34,7 @@ enum filetype {
filetype_ch_image_be,
filetype_exe,
filetype_xz_compressed,
+ filetype_mxs_bootstream,
filetype_max,
};