Re: [PATCH 08/10] filetype: Detect Layerscape PBL images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 09, 2019 at 11:50:08AM +0200, Sascha Hauer wrote:
> On Wed, May 08, 2019 at 01:02:54PM +0200, Roland Hieber wrote:
> > Hi Sascha,
> > 
> > On Wed, May 08, 2019 at 11:03:05AM +0200, Sascha Hauer wrote:
> > > The Layerscape SoCs have their own boot image format. Add filetype
> > > detection for it.
> > > 
> > > 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 fb029a7739..f8ae214446 100644
> > > --- a/common/filetype.c
> > > +++ b/common/filetype.c
> > > @@ -75,6 +75,7 @@ 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" },
> > 
> > The comment above that array says for the "shortname" member:
> > 
> >   const char *shortname;  /* short string without spaces for shell scripts */
> > 
> > So I would recommend to "layerscape-pbl" instead.
> 
> I should know that as I have written the comment :-/
> 
> Here is a v2 that also detects the QSPI image which have an endianess
> swapped header.

Yep, LGTM now :)

 - Roland 

> 
> Sascha
> 
> ------------------------8<-----------------------------
> 
> From 0aafb86e38c5e436fee409f2b94b145e22c4a8be Mon Sep 17 00:00:00 2001
> From: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> Date: Fri, 3 May 2019 13:10:53 +0200
> Subject: [PATCH] filetype: Detect Layerscape PBL images
> 
> The Layerscape SoCs have their own boot image format. Add filetype
> detection for it.
> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> ---
>  common/filetype.c  | 7 +++++++
>  include/filetype.h | 2 ++
>  2 files changed, 9 insertions(+)
> 
> 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;
>  
> diff --git a/include/filetype.h b/include/filetype.h
> index 395053dd59..dcb331a6c9 100644
> --- a/include/filetype.h
> +++ b/include/filetype.h
> @@ -45,6 +45,8 @@ enum filetype {
>  	filetype_elf,
>  	filetype_imx_image_v1,
>  	filetype_imx_image_v2,
> +	filetype_layerscape_image,
> +	filetype_layerscape_qspi_image,
>  	filetype_max,
>  };
>  
> -- 
> 2.20.1
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> _______________________________________________
> barebox mailing list
> barebox@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber                     | r.hieber@xxxxxxxxxxxxxx     |
Pengutronix e.K.                  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux