Skip to contentSkip to conversation

fdt: Fix uncompress_blob() for U-Boot proper

PATCH New Marek Vasut 3 participants 3 messages Oct 18, 2018 – Nov 22, 2018 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fdt: Fix uncompress_blob() for U-Boot proper

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.

Cc Michal Simek <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/fdtdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/fdtdec.c +2 -1
index a420ba1885..d28f2cbb1c 100644
@@ -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
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/1 fdt: Fix uncompress_blob() for U-Boot proper

Quoted 10 lines · Marek Vasut

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.

Quoted 6 lines
Cc Michal Simek <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/fdtdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
#2 lore raw

PATCH 1/1 fdt: Fix uncompress_blob() for U-Boot proper

Quoted 10 lines · Marek Vasut

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.

Quoted 6 lines
Cc Michal Simek <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/fdtdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to u-boot-dm/master, thanks!