From 0c16fca927751fbb9be6f026ec8534d289156d3c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 7 Jan 2023 14:57:20 -0700 Subject: tpm: Add a proper Kconfig option for crc8 in SPL The current approach is a bit of a hack and only works for the tpm subsystem. Add a Kconfig so that crc8 can be enabled in SPL for other purposes. Signed-off-by: Simon Glass --- lib/Kconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/Kconfig') diff --git a/lib/Kconfig b/lib/Kconfig index def36f275ce..36d3cf99c3c 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -422,6 +422,7 @@ config TPM config SPL_TPM bool "Trusted Platform Module (TPM) Support in SPL" depends on SPL_DM + imply SPL_CRC8 help This enables support for TPMs which can be used to provide security features for your board. The TPM can be connected via LPC or I2C @@ -617,6 +618,23 @@ config SPL_MD5 security applications, but it can be useful for providing a quick checksum of a block of data. +config CRC8 + def_bool y + help + Enables CRC8 support in U-Boot. This is normally required. CRC8 is + a simple and fast checksumming algorithm which does a bytewise + checksum with feedback to produce an 8-bit result. The code is small + and it does not require a lookup table (unlike CRC32). + +config SPL_CRC8 + bool "Support CRC8 in SPL" + depends on SPL + help + Enables CRC8 support in SPL. This is not normally required. CRC8 is + a simple and fast checksumming algorithm which does a bytewise + checksum with feedback to produce an 8-bit result. The code is small + and it does not require a lookup table (unlike CRC32). + config CRC32 def_bool y help -- cgit v1.2.3 From 12619d4ec8a3177d1197117302762bf9e8d03be9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 21 Dec 2022 16:08:26 -0700 Subject: trace: Don't require TIMER_EARLY Some platforms cannot honour this and don't need trace before relocation. Use 'imply' instead, so boards can disable this. Signed-off-by: Simon Glass --- lib/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Kconfig') diff --git a/lib/Kconfig b/lib/Kconfig index 36d3cf99c3c..2425296ce6a 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -316,7 +316,7 @@ config BITREVERSE config TRACE bool "Support for tracing of function calls and timing" imply CMD_TRACE - select TIMER_EARLY + imply TIMER_EARLY help Enables function tracing within U-Boot. This allows recording of call traces including timing information. The command can write data to -- cgit v1.2.3 From ebc1d50ab51bd08f3adc19de37e81d23d655f9f4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 21 Dec 2022 16:08:28 -0700 Subject: Revert "fdtdec: drop needlessly convoluted CONFIG_PHANDLE_CHECK_SEQ" The fdt_path_offset() function is slow since it must scan the tree. This substantial overhead now applies to all boards. The original code may not be ideal but it is fit for purpose and is only needed on a few boards. Reverting this reduces time to set up driver model by about 30ms. Before revert: Accumulated time: 47,170 dm_r 53,237 dm_spl 572,986 dm_f Accumulated time: 44,598 dm_r 50,347 dm_spl 549,133 dm_f This reverts commit 26f981f295d00351b6f0c69b5317b254b2361cc0. Signed-off-by: Simon Glass --- configs/am65x_evm_a53_defconfig | 1 + configs/evb-ast2600_defconfig | 1 + configs/sama7g5ek_mmc1_defconfig | 1 + configs/sama7g5ek_mmc_defconfig | 1 + lib/Kconfig | 7 +++++++ lib/fdtdec.c | 7 +++++-- 6 files changed, 16 insertions(+), 2 deletions(-) (limited to 'lib/Kconfig') diff --git a/configs/am65x_evm_a53_defconfig b/configs/am65x_evm_a53_defconfig index fe3346f2150..ad46a74d1f2 100644 --- a/configs/am65x_evm_a53_defconfig +++ b/configs/am65x_evm_a53_defconfig @@ -179,3 +179,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451 CONFIG_USB_GADGET_PRODUCT_NUM=0x6162 CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_PHANDLE_CHECK_SEQ=y diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index 2fac79bbd72..34400621568 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -120,3 +120,4 @@ CONFIG_WDT=y CONFIG_SHA384=y CONFIG_HEXDUMP=y # CONFIG_EFI_LOADER is not set +CONFIG_PHANDLE_CHECK_SEQ=y diff --git a/configs/sama7g5ek_mmc1_defconfig b/configs/sama7g5ek_mmc1_defconfig index f004e448039..ecb4dfc7854 100644 --- a/configs/sama7g5ek_mmc1_defconfig +++ b/configs/sama7g5ek_mmc1_defconfig @@ -79,3 +79,4 @@ CONFIG_TIMER=y CONFIG_MCHP_PIT64B_TIMER=y CONFIG_OF_LIBFDT_OVERLAY=y # CONFIG_EFI_LOADER_HII is not set +CONFIG_PHANDLE_CHECK_SEQ=y diff --git a/configs/sama7g5ek_mmc_defconfig b/configs/sama7g5ek_mmc_defconfig index 5b42fc63f30..1d5bccd15b3 100644 --- a/configs/sama7g5ek_mmc_defconfig +++ b/configs/sama7g5ek_mmc_defconfig @@ -79,3 +79,4 @@ CONFIG_TIMER=y CONFIG_MCHP_PIT64B_TIMER=y CONFIG_OF_LIBFDT_OVERLAY=y # CONFIG_EFI_LOADER_HII is not set +CONFIG_PHANDLE_CHECK_SEQ=y diff --git a/lib/Kconfig b/lib/Kconfig index 2425296ce6a..a83f32d82a5 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -1045,6 +1045,13 @@ config LMB_RESERVED_REGIONS Define the number of supported reserved regions in the library logical memory blocks. +config PHANDLE_CHECK_SEQ + bool "Enable phandle check while getting sequence number" + help + When there are multiple device tree nodes with same name, + enable this config option to distinguish them using + phandles in fdtdec_get_alias_seq() function. + endmenu menu "FWU Multi Bank Updates" diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 8d5c68860ec..0827e16859f 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -519,8 +519,11 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int offset, * Adding an extra check to distinguish DT nodes with * same name */ - if (offset != fdt_path_offset(blob, prop)) - continue; + if (IS_ENABLED(CONFIG_PHANDLE_CHECK_SEQ)) { + if (fdt_get_phandle(blob, offset) != + fdt_get_phandle(blob, fdt_path_offset(blob, prop))) + continue; + } val = trailing_strtol(name); if (val != -1) { -- cgit v1.2.3