From a536b2fdb10c6eb678fda6f239eb16414caf0496 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 7 Aug 2023 12:32:19 -0400 Subject: bloblist: Enforce CRC32 In the common bloblist code we call crc32 to get a checksum for the data. Ensure we will have the CRC32 code via select. Signed-off-by: Tom Rini --- common/Kconfig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common') diff --git a/common/Kconfig b/common/Kconfig index d103bc6ddb8..f2dfda4c74e 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -951,6 +951,7 @@ menu "Blob list" config BLOBLIST bool "Support for a bloblist" + select CRC32 help This enables support for a bloblist in U-Boot, which can be passed from TPL to SPL to U-Boot proper (and potentially to Linux). The @@ -961,6 +962,7 @@ config BLOBLIST config SPL_BLOBLIST bool "Support for a bloblist in SPL" depends on BLOBLIST && SPL_LIBGENERIC_SUPPORT && SPL_LIBCOMMON_SUPPORT + select SPL_CRC32 default y if SPL help This enables a bloblist in SPL. If this is the first part of U-Boot @@ -970,6 +972,7 @@ config SPL_BLOBLIST config TPL_BLOBLIST bool "Support for a bloblist in TPL" depends on BLOBLIST && TPL_LIBGENERIC_SUPPORT && TPL_LIBCOMMON_SUPPORT + select TPL_CRC32 default y if TPL help This enables a bloblist in TPL. The bloblist is set up in TPL and -- cgit v1.3.1 From 0d2761abbde00e1ff756426fdb77b4b30192311d Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Thu, 3 Aug 2023 19:05:39 +0300 Subject: spl: remove duplicate SPL_MD5 option There is another SPL_MD5 option defined in lib/Kconfig. Renaming SPL_MD5_SUPPORT introduced duplicate option with different description. As for now FIT and hash algorithm options are not related to each others, removing a duplicate option seems OK. Fixes: 4b00fd1a84c ("Kconfig: Rename SPL_MD5_SUPPORT to SPL_MD5") Signed-off-by: Oleksandr Suvorov --- common/spl/Kconfig | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'common') diff --git a/common/spl/Kconfig b/common/spl/Kconfig index bee231b583a..c66d70e2a99 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -561,18 +561,6 @@ config SPL_CRC32 for detected accidental image corruption. For secure applications you should consider SHA1 or SHA256. -config SPL_MD5 - bool "Support MD5" - depends on SPL_FIT - help - Enable this to support MD5 in FIT images within SPL. An MD5 - checksum is a 128-bit hash value used to check that the image - contents have not been corrupted. Note that MD5 is not considered - secure as it is possible (with a brute-force attack) to adjust the - image while still retaining the same MD5 hash value. For secure - applications where images may be changed maliciously, you should - consider SHA256 or SHA384. - config SPL_FIT_IMAGE_TINY bool "Remove functionality from SPL FIT loading to reduce size" depends on SPL_FIT -- cgit v1.3.1 From af62d83cc0ee27ca5051718a0df44341f71abff1 Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Thu, 3 Aug 2023 19:05:40 +0300 Subject: spl: move SPL_CRC32 option to lib/Kconfig All SPL hash algorithm options are collected in lib/Kconfig. Move SPL_CRC32 there as well. Signed-off-by: Oleksandr Suvorov Reviewed-by: Simon Glass --- common/spl/Kconfig | 11 ----------- lib/Kconfig | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'common') diff --git a/common/spl/Kconfig b/common/spl/Kconfig index c66d70e2a99..c5dd476db58 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -550,17 +550,6 @@ config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION the eMMC EXT_CSC_PART_CONFIG selection should be overridden in SPL by user defined partition number. -config SPL_CRC32 - bool "Support CRC32" - default y if SPL_LEGACY_IMAGE_FORMAT || SPL_EFI_PARTITION - default y if SPL_ENV_SUPPORT || TPL_BLOBLIST - help - Enable this to support CRC32 in uImages or FIT images within SPL. - This is a 32-bit checksum value that can be used to verify images. - For FIT images, this is the least secure type of checksum, suitable - for detected accidental image corruption. For secure applications you - should consider SHA1 or SHA256. - config SPL_FIT_IMAGE_TINY bool "Remove functionality from SPL FIT loading to reduce size" depends on SPL_FIT diff --git a/lib/Kconfig b/lib/Kconfig index 3926652db63..07e61de5b64 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -534,6 +534,17 @@ config SHA_HW_ACCEL if SPL +config SPL_CRC32 + bool "Enable CRC32 support in SPL" + default y if SPL_LEGACY_IMAGE_SUPPORT || SPL_EFI_PARTITION + default y if SPL_ENV_SUPPORT || TPL_BLOBLIST + help + This option enables support of hashing using CRC32 algorithm. + The CRC32 algorithm produces 32-bit checksum value. For FIT + images, this is the least secure type of checksum, suitable for + detected accidental image corruption. For secure applications you + should consider SHA256 or SHA384. + config SPL_SHA1 bool "Enable SHA1 support in SPL" default y if SHA1 -- cgit v1.3.1 From 3b7b73879f27d8a7b21792b3e9bb25dce1a5d082 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 1 Aug 2023 15:33:41 +0200 Subject: common: fix detection of SYS_MALLOC_F_LEN=0x0 CONFIG_$(SPL_TPL_)SYS_MALLOC_F_LEN is defined as hex. If set to zero manually, .config contains '0x0' and not '0' as value. The default value for CONFIG_SPL_SYS_MALLOC_F_LEN should not be set to 0 but to 0x0 if CONFIG_SPL_FRAMEWORK=n to match a manually set value. Fixes: c0126bd862a0 ("spl: Support bootstage, log, hash and early malloc in TPL") Fixes: b61694705217 ("SPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default") Signed-off-by: Heinrich Schuchardt Reviewed-by: Tom Rini --- Kconfig | 2 +- common/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/Kconfig b/Kconfig index 70efb41cc66..91170bf8d22 100644 --- a/Kconfig +++ b/Kconfig @@ -298,7 +298,7 @@ config SYS_MALLOC_LEN config SPL_SYS_MALLOC_F_LEN hex "Size of malloc() pool in SPL" depends on SYS_MALLOC_F && SPL - default 0 if !SPL_FRAMEWORK + default 0x0 if !SPL_FRAMEWORK default 0x2800 if RCAR_GEN3 default 0x2000 if IMX8MQ default SYS_MALLOC_F_LEN diff --git a/common/Makefile b/common/Makefile index c87bb2e78b3..f5c3d90f067 100644 --- a/common/Makefile +++ b/common/Makefile @@ -79,7 +79,7 @@ endif # CONFIG_SPL_BUILD obj-$(CONFIG_CROS_EC) += cros_ec.o obj-y += dlmalloc.o ifdef CONFIG_SYS_MALLOC_F -ifneq ($(CONFIG_$(SPL_TPL_)SYS_MALLOC_F_LEN),0) +ifneq ($(CONFIG_$(SPL_TPL_)SYS_MALLOC_F_LEN),0x0) obj-y += malloc_simple.o endif endif -- cgit v1.3.1 From fa96774d2925443363aa2a5da8a12ced28e158a1 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 29 Jul 2023 15:34:51 +0200 Subject: common: Drop duplicate space in SPL_BMP description Drop duplicate space in Kconfig symbol description. Signed-off-by: Marek Vasut --- common/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/Kconfig b/common/Kconfig index f2dfda4c74e..cdb77a6a7da 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -1174,7 +1174,7 @@ config BMP Enable bmp functions to display bmp image and get bmp info. config SPL_BMP - bool "Enable bmp image display at SPL" + bool "Enable bmp image display at SPL" depends on SPL_VIDEO help Enable bmp functions to display bmp image and get bmp info at SPL. -- cgit v1.3.1