[U-Boot] [PATCH v2 1/2] image: android: allow booting lz4-compressed kernels

Eugeniu Rosca erosca at de.adit-jv.com
Tue Apr 9 12:29:18 UTC 2019


On Tue, Apr 09, 2019 at 01:06:31PM +0200, Marek Vasut wrote:
> On 4/8/19 5:35 PM, Eugeniu Rosca wrote:
> > According to Android image format [1], kernel image resides at 1 page
> > offset from the boot image address. Grab the magic number from there
> > and allow U-Boot to handle LZ4-compressed KNL binaries instead of
> > hardcoding compression type to IH_COMP_NONE. Other compression types,
> > if needed, can be added later.
> > 
> > Tested on H3ULCB-KF using the image detailed in [2].
> 
> H3ULCB Kingfisher is not supported in mainline ;-)

Well, my H3 ES2.0 ULCB attached to Kingfisher-M06 boots just fine with
the recently released v2019.04 U-Boot. I guess U-Boot simply doesn't
(need to) care about the fancy peripherals present on the KF extension
board (hence no need to spawn another KF defconfig)?

> 
> [...]
> 
> > diff --git a/include/image.h b/include/image.h
> > index 765ffecee0a7..889305cbefdb 100644
> > --- a/include/image.h
> > +++ b/include/image.h
> > @@ -306,6 +306,7 @@ enum {
> >  	IH_COMP_COUNT,
> >  };
> >  
> > +#define LZ4F_MAGIC	0x184D2204	/* LZ4 Magic Number		*/
> >  #define IH_MAGIC	0x27051956	/* Image Magic Number		*/
> >  #define IH_NMLEN		32	/* Image Name Length		*/
> >  
> 
> Keep the list sorted please.

I hope below looks better?

 #define IH_MAGIC	0x27051956	/* Image Magic Number		*/
 #define IH_NMLEN		32	/* Image Name Length		*/
+#define LZ4F_MAGIC	0x184D2204	/* LZ4 Magic Number		*/

Please, share any other comments/wishes before I push v3 in the
next couple of days. TIA!

> 
> [...]
> 
> 
> -- 
> Best regards,
> Marek Vasut

Best regards,
Eugeniu.


More information about the U-Boot mailing list