[PATCH] image: Add support for ZSTD decompression

Robert Marko robert.marko at sartura.hr
Fri May 1 17:15:41 CEST 2020


On Fri, May 1, 2020 at 4:56 PM Tom Rini <trini at konsulko.com> wrote:
>
> On Sat, Apr 25, 2020 at 07:37:21PM +0200, Robert Marko wrote:
>
> > This patch adds support for ZSTD decompression of FIT images.
> >
> > Signed-off-by: Robert Marko <robert.marko at sartura.hr>
> > Cc: Luka Perkov <luka.perkov at sartura.hr>
> > ---
> >  common/image.c  | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
> >  include/image.h |  1 +
> >  2 files changed, 53 insertions(+)
> >
> > diff --git a/common/image.c b/common/image.c
> > index 94873cb6ed..70ba0f4328 100644
> > --- a/common/image.c
> > +++ b/common/image.c
> > @@ -42,6 +42,7 @@
> >  #include <lzma/LzmaTypes.h>
> >  #include <lzma/LzmaDec.h>
> >  #include <lzma/LzmaTools.h>
> > +#include <linux/zstd.h>
> >
> >  #ifdef CONFIG_CMD_BDI
> >  extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
> > @@ -193,6 +194,7 @@ static const table_entry_t uimage_comp[] = {
> >       {       IH_COMP_LZMA,   "lzma",         "lzma compressed",      },
> >       {       IH_COMP_LZO,    "lzo",          "lzo compressed",       },
> >       {       IH_COMP_LZ4,    "lz4",          "lz4 compressed",       },
> > +     {       IH_COMP_ZSTD,   "zstd",         "zstd compressed",      },
> >       {       -1,             "",             "",                     },
> >  };
> >
> > @@ -480,6 +482,56 @@ int image_decomp(int comp, ulong load, ulong image_start, int type,
> >               break;
> >       }
> >  #endif /* CONFIG_LZ4 */
> > +#ifdef CONFIG_ZSTD
>
> We need to add SPL_ZSTD as a symbol to lib/Kconfig and then use
> CONFIG_IS_ENABLED() tests here to avoid growth in SPL.  Thanks!
Hi,
is that something that I need to do or?

Thanks
>
> --
> Tom


More information about the U-Boot mailing list