image: Add a common compression type detection function.
authorAtish Patra <atish.patra@wdc.com>
Fri, 6 Mar 2020 00:24:22 +0000 (16:24 -0800)
committerTom Rini <trini@konsulko.com>
Fri, 17 Apr 2020 16:32:36 +0000 (12:32 -0400)
commit155d6a3575470c1a735b8cf368d9e987930910a8
tree102854264876f6bbee25449bea7cbad36cd145a8
parent2a2119e10ca364d7c1539a9103b9fd3839dbe6ac
image: Add a common compression type detection function.

Currently, there is no method that can detect compression types
given a file. This is very useful where a compressed kernel image
is loaded directly to the memory.

Inspect initial few bytes to figure out compression type of the
image. It will be used in booti method for now but can be reused
any other function in future as well.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
common/image.c
include/image.h