[PATCH v3] fdt: Use phandle to distinguish DT nodes with same name

Simon Glass sjg at chromium.org
Sat Dec 12 16:35:33 CET 2020


On Wed, 2 Dec 2020 at 22:26, Aswath Govindraju <a-govindraju at ti.com> wrote:
>
> 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 at ti.com>
> ---
>
> Changes since v2:
>  - changed #ifdef to if(IS_ENABLED())
>  - corrected errors in commit description
>
> Changes since v1:
>  - Added a config option as fdt_path_offset() slows down the u-boot start
>    up and would be better to be enabled only when required
>  - Added an example case in commit message where the following fix is
>    required.
>
>  lib/Kconfig  |  8 ++++++++
>  lib/fdtdec.c | 11 +++++++++++
>  2 files changed, 19 insertions(+)
>

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list