public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 2/4] Respect that some compression algos can be enabled separately for SPL
Date: Fri,  5 Feb 2021 16:11:06 -0800	[thread overview]
Message-ID: <1612570268-8625-3-git-send-email-tharvey@gateworks.com> (raw)
In-Reply-To: <1612570268-8625-1-git-send-email-tharvey@gateworks.com>

From: Frieder Schrempf <frieder.schrempf@kontron.de>

Some compression algorithms currently can be enabled for SPL and
U-Boot proper separately. Therefore take into account USE_HOSTCC
is well as CONFIG_IS_ENABLED() in these cases to prevent compiling these
functions in case of a host tool build.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
v2: avoid using USE_HOSTCC with another CONFIG to avoid issue found building m68k
---
 common/image.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/common/image.c b/common/image.c
index 6923dac..dc9b191 100644
--- a/common/image.c
+++ b/common/image.c
@@ -461,13 +461,16 @@ int image_decomp(int comp, ulong load, ulong image_start, int type,
 		else
 			ret = -ENOSPC;
 		break;
-#ifdef CONFIG_GZIP
+#ifndef USE_HOSTCC
+#if CONFIG_IS_ENABLED(GZIP)
 	case IH_COMP_GZIP: {
 		ret = gunzip(load_buf, unc_len, image_buf, &image_len);
 		break;
 	}
 #endif /* CONFIG_GZIP */
-#ifdef CONFIG_BZIP2
+#endif
+#ifndef USE_HOSTCC
+#if CONFIG_IS_ENABLED(BZIP2)
 	case IH_COMP_BZIP2: {
 		uint size = unc_len;
 
@@ -483,7 +486,9 @@ int image_decomp(int comp, ulong load, ulong image_start, int type,
 		break;
 	}
 #endif /* CONFIG_BZIP2 */
-#ifdef CONFIG_LZMA
+#endif
+#ifndef USE_HOSTCC
+#if CONFIG_IS_ENABLED(LZMA)
 	case IH_COMP_LZMA: {
 		SizeT lzma_len = unc_len;
 
@@ -493,7 +498,9 @@ int image_decomp(int comp, ulong load, ulong image_start, int type,
 		break;
 	}
 #endif /* CONFIG_LZMA */
-#ifdef CONFIG_LZO
+#endif
+#ifndef USE_HOSTCC
+#if CONFIG_IS_ENABLED(LZO)
 	case IH_COMP_LZO: {
 		size_t size = unc_len;
 
@@ -502,7 +509,9 @@ int image_decomp(int comp, ulong load, ulong image_start, int type,
 		break;
 	}
 #endif /* CONFIG_LZO */
-#ifdef CONFIG_LZ4
+#endif
+#ifndef USE_HOSTCC
+#if CONFIG_IS_ENABLED(LZ4)
 	case IH_COMP_LZ4: {
 		size_t size = unc_len;
 
@@ -511,7 +520,9 @@ int image_decomp(int comp, ulong load, ulong image_start, int type,
 		break;
 	}
 #endif /* CONFIG_LZ4 */
-#ifdef CONFIG_ZSTD
+#endif
+#ifndef USE_HOSTCC
+#if CONFIG_IS_ENABLED(ZSTD)
 	case IH_COMP_ZSTD: {
 		size_t size = unc_len;
 		ZSTD_DStream *dstream;
@@ -561,6 +572,7 @@ int image_decomp(int comp, ulong load, ulong image_start, int type,
 		break;
 	}
 #endif /* CONFIG_ZSTD */
+#endif
 	default:
 		printf("Unimplemented compression type %d\n", comp);
 		return -ENOSYS;
-- 
2.7.4

  parent reply	other threads:[~2021-02-06  0:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-06  0:11 [PATCH v2 0/4] Add Gateworks Venice board support Tim Harvey
2021-02-06  0:11 ` [PATCH v2 1/4] thermal: imx_tmu: enable monitoring and default alert/critical Tim Harvey
2021-03-01 11:55   ` sbabic at denx.de
2021-02-06  0:11 ` Tim Harvey [this message]
2021-03-01 11:56   ` [PATCH v2 2/4] Respect that some compression algos can be enabled separately for SPL sbabic at denx.de
2021-02-06  0:11 ` [PATCH v2 3/4] arm: dts: imx8mm: add Gateworks i.MX8 Mini Dev kits Tim Harvey
2021-02-06  0:11 ` [PATCH v2 4/4] board: gateworks: imx8mm: Add Gateworks Venice board support Tim Harvey
2021-03-01 16:04   ` Stefano Babic
2021-03-01 22:18     ` Tim Harvey
2021-03-02  8:14       ` Stefano Babic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1612570268-8625-3-git-send-email-tharvey@gateworks.com \
    --to=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox