]> git.baikalelectronics.ru Git - uboot.git/commit
fdt: Use phandle to distinguish DT nodes with same name
authorAswath Govindraju <a-govindraju@ti.com>
Thu, 3 Dec 2020 05:25:45 +0000 (10:55 +0530)
committerSimon Glass <sjg@chromium.org>
Wed, 23 Dec 2020 03:39:25 +0000 (20:39 -0700)
commit7caeaf07d4f4d86c1a586478995cd55528efbfea
tree6c46955a14391088b6a96af8d18795986967f5e4
parente432ec78381321118550c7c2c6c125951f388e62
fdt: Use phandle to distinguish DT nodes with same name

While assigning the sequence number to subsystem instances by reading the
aliases property, only DT nodes names are compared and not the complete
path. This causes a problem when there are two DT nodes with same name but
have different paths.

In arch/arm/dts/k3-am65-main.dtsi there are two USB controllers with the
same device tree node name but different path. When aliases are defined for
these USB controllers then fdtdec_get_alias_seq() fails to pick the correct
instance for a given index.

fdt_path_offset() function is slow and this would effect the U-Boot
startup. To avert the time penalty on all boards, apply this extra check
only when required by using a config option.

Fix it by comparing the phandles of DT nodes after the node names match,
under a config option.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Fix whitespace error in Kconfig:
Signed-off-by: Simon Glass <sjg@chromium.org>
lib/Kconfig
lib/fdtdec.c