diff mbox series

[U-Boot] fdt: Fix uncompress_blob() for U-Boot proper

Message ID 20181018183705.15864-1-marek.vasut+renesas@gmail.com
State Accepted
Commit 410d9b644639799259cddba9cbff96c2db038a6b
Delegated to: Simon Glass
Headers show
Series [U-Boot] fdt: Fix uncompress_blob() for U-Boot proper | expand

Commit Message

Marek Vasut Oct. 18, 2018, 6:37 p.m. UTC
When U-Boot proper is compiled with CONFIG_MULTI_DTB_FIT and tries
to call uncompress_blob(), it fails with -ENOTSUPP. This is because
the full implementation of this function which includes compression
is available only in SPL. In U-Boot proper or if the compression is
not enabled, the blob is not compressed and thus can be passed to
locate_dtb_in_fit() in fdtdec_setup() without any changes. Pass the
blob without any changes if compression is not enabled instead of
failing.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Tom Rini <trini@konsulko.com>
---
 lib/fdtdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Simon Glass Nov. 17, 2018, 12:14 a.m. UTC | #1
On Thu, 18 Oct 2018 at 12:38, Marek Vasut <marek.vasut@gmail.com> wrote:
>
> When U-Boot proper is compiled with CONFIG_MULTI_DTB_FIT and tries
> to call uncompress_blob(), it fails with -ENOTSUPP. This is because
> the full implementation of this function which includes compression
> is available only in SPL. In U-Boot proper or if the compression is
> not enabled, the blob is not compressed and thus can be passed to
> locate_dtb_in_fit() in fdtdec_setup() without any changes. Pass the
> blob without any changes if compression is not enabled instead of
> failing.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: Tom Rini <trini@konsulko.com>
> ---
>  lib/fdtdec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass Nov. 22, 2018, 8:21 p.m. UTC | #2
On Thu, 18 Oct 2018 at 12:38, Marek Vasut <marek.vasut@gmail.com> wrote:
>
> When U-Boot proper is compiled with CONFIG_MULTI_DTB_FIT and tries
> to call uncompress_blob(), it fails with -ENOTSUPP. This is because
> the full implementation of this function which includes compression
> is available only in SPL. In U-Boot proper or if the compression is
> not enabled, the blob is not compressed and thus can be passed to
> locate_dtb_in_fit() in fdtdec_setup() without any changes. Pass the
> blob without any changes if compression is not enabled instead of
> failing.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: Tom Rini <trini@konsulko.com>
> ---
>  lib/fdtdec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm/master, thanks!
diff mbox series

Patch

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index a420ba1885..d28f2cbb1c 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1198,7 +1198,8 @@  static int uncompress_blob(const void *src, ulong sz_src, void **dstp)
 # else
 static int uncompress_blob(const void *src, ulong sz_src, void **dstp)
 {
-	return -ENOTSUPP;
+	*dstp = (void *)src;
+	return 0;
 }
 # endif
 #endif