diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/bbu.c | 4 | ||||
-rw-r--r-- | common/filetype.c | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/common/bbu.c b/common/bbu.c index 5cb09e4eb0..00bec32a86 100644 --- a/common/bbu.c +++ b/common/bbu.c @@ -299,6 +299,8 @@ static int bbu_std_file_handler(struct bbu_handler *handler, return -EINVAL; } + device_detect_by_name(devpath_to_name(data->devicefile)); + ret = stat(data->devicefile, &s); if (ret) { oflags |= O_CREAT; @@ -361,7 +363,7 @@ err_close: * Return: 0 if successful, negative error code otherwise */ int bbu_register_std_file_update(const char *name, unsigned long flags, - char *devicefile, enum filetype imagetype) + const char *devicefile, enum filetype imagetype) { struct bbu_std *std; struct bbu_handler *handler; diff --git a/common/filetype.c b/common/filetype.c index fb029a7739..e2d707b156 100644 --- a/common/filetype.c +++ b/common/filetype.c @@ -75,6 +75,8 @@ 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_layerscape_image] = { "Layerscape image", "layerscape-PBL" }, + [filetype_layerscape_qspi_image] = { "Layerscape QSPI image", "layerscape-qspi-PBL" }, }; const char *file_type_to_string(enum filetype f) @@ -329,6 +331,11 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize) if (is_sparse_image(_buf)) return filetype_android_sparse; + if (buf[0] == 0x55aa55aa && buf[1] == 0x0001ee01) + return filetype_layerscape_image; + if (buf[0] == 0x01ee0100 && buf[1] == 0xaa55aa55) + return filetype_layerscape_qspi_image; + if (bufsize < 64) return filetype_unknown; |