From patchwork Wed Apr 15 16:46:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 237808 List-Id: U-Boot discussion From: xypron.glpk at gmx.de (Heinrich Schuchardt) Date: Wed, 15 Apr 2020 18:46:19 +0200 Subject: [PATCH 1/5] lib: do not build OID registry in SPL In-Reply-To: <20200415164623.142908-1-xypron.glpk@gmx.de> References: <20200415164623.142908-1-xypron.glpk@gmx.de> Message-ID: <20200415164623.142908-2-xypron.glpk@gmx.de> The OID registry is only used by crypto functions that are not built in SPL. So we should not build it in SPL. Fixes: a9b45e6e8382 ("lib: add oid registry utility") Signed-off-by: Heinrich Schuchardt Reviewed-by: Tom Rini --- lib/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.25.1 diff --git a/lib/Makefile b/lib/Makefile index 32bf3f3693..5d4bb3232c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -119,6 +119,7 @@ obj-$(CONFIG_$(SPL_TPL_)STRTO) += strto.o else # Main U-Boot always uses the full printf support obj-y += vsprintf.o strto.o +obj-$(CONFIG_OID_REGISTRY) += oid_registry.o endif obj-y += date.o @@ -127,8 +128,6 @@ obj-$(CONFIG_LIB_ELF) += elf.o # # Build a fast OID lookup registry from include/linux/oid_registry.h # -obj-$(CONFIG_OID_REGISTRY) += oid_registry.o - $(obj)/oid_registry.o: $(obj)/oid_registry_data.c $(obj)/oid_registry_data.c: $(srctree)/include/linux/oid_registry.h \ From patchwork Wed Apr 15 16:46:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 237806 List-Id: U-Boot discussion From: xypron.glpk at gmx.de (Heinrich Schuchardt) Date: Wed, 15 Apr 2020 18:46:20 +0200 Subject: [PATCH 2/5] lib: date functions in SPL In-Reply-To: <20200415164623.142908-1-xypron.glpk@gmx.de> References: <20200415164623.142908-1-xypron.glpk@gmx.de> Message-ID: <20200415164623.142908-3-xypron.glpk@gmx.de> Date functions are only needed in SPL if SPL contains RTC drivers. Fixes: 05429b6cf5b3 ("rtc: move date.c from drivers/rtc/ to lib/") Signed-off-by: Heinrich Schuchardt --- lib/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/lib/Makefile b/lib/Makefile index 5d4bb3232c..dbea69f52c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -116,13 +116,14 @@ else obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += vsprintf.o endif obj-$(CONFIG_$(SPL_TPL_)STRTO) += strto.o +obj-$(CONFIG_$(SPL_TPL_)RTC_SUPPORT) += date.o else # Main U-Boot always uses the full printf support obj-y += vsprintf.o strto.o obj-$(CONFIG_OID_REGISTRY) += oid_registry.o +obj-y += date.o endif -obj-y += date.o obj-$(CONFIG_LIB_ELF) += elf.o # From patchwork Wed Apr 15 16:46:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 237810 List-Id: U-Boot discussion From: xypron.glpk at gmx.de (Heinrich Schuchardt) Date: Wed, 15 Apr 2020 18:46:21 +0200 Subject: [PATCH 3/5] common: image_sign_info helper functions in SPL In-Reply-To: <20200415164623.142908-1-xypron.glpk@gmx.de> References: <20200415164623.142908-1-xypron.glpk@gmx.de> Message-ID: <20200415164623.142908-4-xypron.glpk@gmx.de> Do not build image_sign_info helper functions in SPL if not needed. Fixes: b983cc2da0ba ("lib: rsa: decouple rsa from FIT image verification") Signed-off-by: Heinrich Schuchardt Reviewed-by: Tom Rini --- Kconfig | 2 +- common/Kconfig | 11 +++++++++++ common/Makefile | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/Kconfig b/Kconfig index 1b0b6999d8..6038e93afb 100644 --- a/Kconfig +++ b/Kconfig @@ -447,7 +447,7 @@ config SPL_FIT_SIGNATURE select SPL_FIT select SPL_RSA select SPL_RSA_VERIFY - select IMAGE_SIGN_INFO + select SPL_IMAGE_SIGN_INFO config SPL_LOAD_FIT bool "Enable SPL loading U-Boot as a FIT (basic fitImage features)" diff --git a/common/Kconfig b/common/Kconfig index 3072651082..75d9dfdc33 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -1053,3 +1053,14 @@ config IMAGE_SIGN_INFO select SHA256 help Enable image_sign_info helper functions. + +if IMAGE_SIGN_INFO + +config SPL_IMAGE_SIGN_INFO + bool + select SHA1 + select SHA256 + help + Enable image_sign_info helper functions in SPL. + +endif diff --git a/common/Makefile b/common/Makefile index 702f2396cf..ad030e05eb 100644 --- a/common/Makefile +++ b/common/Makefile @@ -112,7 +112,7 @@ obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o image-android-dt.o obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o obj-$(CONFIG_$(SPL_TPL_)FIT) += image-fit.o obj-$(CONFIG_$(SPL_)MULTI_DTB_FIT) += boot_fit.o common_fit.o -obj-$(CONFIG_IMAGE_SIGN_INFO) += image-sig.o +obj-$(CONFIG_$(SPL_TPL_)IMAGE_SIGN_INFO) += image-sig.o obj-$(CONFIG_$(SPL_TPL_)FIT_SIGNATURE) += image-fit-sig.o obj-$(CONFIG_$(SPL_TPL_)FIT_CIPHER) += image-cipher.o obj-$(CONFIG_IO_TRACE) += iotrace.o From patchwork Wed Apr 15 16:46:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 237807 List-Id: U-Boot discussion From: xypron.glpk at gmx.de (Heinrich Schuchardt) Date: Wed, 15 Apr 2020 18:46:22 +0200 Subject: [PATCH 4/5] lib: do not provide hexdump in SPL In-Reply-To: <20200415164623.142908-1-xypron.glpk@gmx.de> References: <20200415164623.142908-1-xypron.glpk@gmx.de> Message-ID: <20200415164623.142908-5-xypron.glpk@gmx.de> SPL should not be enlarged by building with CONFIG_HEXDUMP=y. Signed-off-by: Heinrich Schuchardt Reviewed-by: Tom Rini --- lib/hexdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/lib/hexdump.c b/lib/hexdump.c index bf14b5bdbd..a3f219a874 100644 --- a/lib/hexdump.c +++ b/lib/hexdump.c @@ -18,7 +18,7 @@ const char hex_asc[] = "0123456789abcdef"; const char hex_asc_upper[] = "0123456789ABCDEF"; -#ifdef CONFIG_HEXDUMP +#if CONFIG_IS_ENABLED(HEXDUMP) /** * hex_dump_to_buffer - convert a blob of data to "hex ASCII" in memory * @buf: data blob to dump From patchwork Wed Apr 15 16:46:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 237809 List-Id: U-Boot discussion From: xypron.glpk at gmx.de (Heinrich Schuchardt) Date: Wed, 15 Apr 2020 18:46:23 +0200 Subject: [PATCH 5/5] dlmalloc: remove unit test support in SPL In-Reply-To: <20200415164623.142908-1-xypron.glpk@gmx.de> References: <20200415164623.142908-1-xypron.glpk@gmx.de> Message-ID: <20200415164623.142908-6-xypron.glpk@gmx.de> We cannot run unit tests in SPL. So remove the unit test support. Signed-off-by: Heinrich Schuchardt --- common/dlmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/common/dlmalloc.c b/common/dlmalloc.c index dade68faf7..db5ab55ed3 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -1,6 +1,6 @@ #include -#if defined(CONFIG_UNIT_TEST) +#if CONFIG_IS_ENABLED(UNIT_TEST) #define DEBUG #endif