summaryrefslogtreecommitdiffstats
path: root/common/filetype.c
diff options
context:
space:
mode:
authorSteffen Trumtrar <s.trumtrar@pengutronix.de>2016-08-09 14:37:26 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-08-18 08:19:25 +0200
commit1047fa8ab4cda25a930ef390d15f06e4d18366fe (patch)
tree6cbb7f09d1d9e796d7d31a6d614592f7c25938ef /common/filetype.c
parenteabab332838178044b98014b06d3195531eac95d (diff)
downloadbarebox-1047fa8ab4cda25a930ef390d15f06e4d18366fe.tar.gz
filetype: add new filetype for SoCFPGA xload image
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/filetype.c')
-rw-r--r--common/filetype.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/filetype.c b/common/filetype.c
index a8666a1..4728f87 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -61,6 +61,7 @@ static const struct filetype_str filetype_str[] = {
[filetype_xz_compressed] = { "XZ compressed", "xz" },
[filetype_exe] = { "MS-DOS executable", "exe" },
[filetype_mxs_bootstream] = { "Freescale MXS bootstream", "mxsbs" },
+ [filetype_socfpga_xload] = { "SoCFPGA prebootloader image", "socfpga-xload" },
};
const char *file_type_to_string(enum filetype f)
@@ -294,6 +295,9 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
if (le32_to_cpu(buf[5]) == 0x504d5453)
return filetype_mxs_bootstream;
+ if (buf[16] == 0x31305341)
+ return filetype_socfpga_xload;
+
if (is_barebox_arm_head(_buf))
return filetype_arm_barebox;
if (buf[9] == 0x016f2818 || buf[9] == 0x18286f01)