[U-Boot] [PATCH 01/30] lib: Allow crc32 to be disabled.

Heinrich Schuchardt xypron.glpk at gmx.de
Sun Oct 27 16:48:39 UTC 2019


On 10/27/19 4:53 PM, Simon Glass wrote:
> Unfortunately this table seems to appear in TPL with gcc 7.3 even if it
> is not used. Fix it by creating a Kconfig that can be used to disable this
> routine.
>
> It is enabled by default, since most boards use it.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>   lib/Kconfig  | 29 +++++++++++++++++++++++++++++
>   lib/Makefile |  2 +-
>   2 files changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/lib/Kconfig b/lib/Kconfig
> index 135f0b372b..be5f9d343a 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -353,6 +353,35 @@ config SHA_PROG_HW_ACCEL
>   config MD5
>   	bool
>
> +config CRC32
> +	bool "Enable crc32 routine"

env/common.c uses crc32(). I could not find how to disable building it.
So this configuration option seems to be superfluous. Otherwise please,
add all reverse dependencies like EFI_LOADER, CMD_UBIFS, ...

> +	default y
> +	help
> +	  This enables a 32-bit CRC (cyclic-redundancy check) routine. It is
> +	  typically used to check for changes in a group of bytes. Even a
> +	  small change typically produces a very different CRC value. This
> +	  algorithm is simple and quite fast.
> +
> +config SPL_CRC32
> +	bool "Enable crc32 routine in SPL"
> +	depends on SPL

Reverse dependencies are missing here, e.g.

selected by SPL_EFI_PARTITION

Best regards

Heinrich

> +	default y
> +	help
> +	  This enables a 32-bit CRC (cyclic-redundancy check) routine in SPL. It
> +	  is typically used to check for changes in a group of bytes. Even a
> +	  small change typically produces a very different CRC value. This
> +	  algorithm is simple and quite fast.
> +
> +config TPL_CRC32
> +	bool "Enable crc32 routine in SPL"
> +	depends on TPL
> +	default y
> +	help
> +	  This enables a 32-bit CRC (cyclic-redundancy check) routine in SPL. It
> +	  is typically used to check for changes in a group of bytes. Even a
> +	  small change typically produces a very different CRC value. This
> +	  algorithm is simple and quite fast.
> +
>   config CRC32C
>   	bool
>
> diff --git a/lib/Makefile b/lib/Makefile
> index d248d8626c..8adc08fd73 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -84,7 +84,7 @@ obj-y += errno.o
>   obj-y += display_options.o
>   CFLAGS_display_options.o := $(if $(BUILD_TAG),-DBUILD_TAG='"$(BUILD_TAG)"')
>   obj-$(CONFIG_BCH) += bch.o
> -obj-y += crc32.o
> +obj-$(CONFIG_$(SPL_TPL_)CRC32) += crc32.o
>   obj-$(CONFIG_CRC32C) += crc32c.o
>   obj-y += ctype.o
>   obj-y += div64.o
>



More information about the U-Boot mailing list