]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Revert "fdtdec: drop needlessly convoluted CONFIG_PHANDLE_CHECK_SEQ"
authorSimon Glass <sjg@chromium.org>
Wed, 21 Dec 2022 23:08:28 +0000 (16:08 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 18 Jan 2023 18:49:13 +0000 (11:49 -0700)
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 <sjg@chromium.org>
configs/am65x_evm_a53_defconfig
configs/evb-ast2600_defconfig
configs/sama7g5ek_mmc1_defconfig
configs/sama7g5ek_mmc_defconfig
lib/Kconfig
lib/fdtdec.c

index fe3346f215018bc8d194349c66405c19fd478ad9..ad46a74d1f2f74f4b520bdc6f3ea9a9cb37de878 100644 (file)
@@ -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
index 2fac79bbd72358df79630983898aaf5815feb393..344006215682ee9d67c82f6c574458c9cc0c94b2 100644 (file)
@@ -120,3 +120,4 @@ CONFIG_WDT=y
 CONFIG_SHA384=y
 CONFIG_HEXDUMP=y
 # CONFIG_EFI_LOADER is not set
+CONFIG_PHANDLE_CHECK_SEQ=y
index f004e448039ede36e4c1f21a90899c37bf5a7080..ecb4dfc7854493d5a3ed3549a9c506a4ddb0fec5 100644 (file)
@@ -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
index 5b42fc63f304413e2169230d79228ad8517d346e..1d5bccd15b32315a5a0225502040e39433cebcb5 100644 (file)
@@ -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
index 2425296ce6a6189f487c001c9751c81839976a55..a83f32d82a5e668b061de8c872291afb809674d5 100644 (file)
@@ -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"
index 8d5c68860ec84f0905d5dd82ff602658a80b3031..0827e16859f1994793d53d0de45243e16ffda011 100644 (file)
@@ -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) {