diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig | 7 | ||||
-rw-r--r-- | lib/fdtdec.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/Kconfig b/lib/Kconfig index 2425296ce6..a83f32d82a 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 8d5c68860e..0827e16859 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) { |