[U-Boot] [PATCH 01/30] lib: Allow crc32 to be disabled.
Simon Glass
sjg at chromium.org
Sun Oct 27 15:53:41 UTC 2019
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"
+ 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
+ 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
--
2.24.0.rc0.303.g954a862665-goog
More information about the U-Boot
mailing list