[U-Boot] [PATCH v3 01/13] libfdt: Add phandle generation helper

Simon Glass sjg at chromium.org
Fri Mar 22 07:52:59 UTC 2019


On Fri, 22 Mar 2019 at 02:10, Thierry Reding <thierry.reding at gmail.com> wrote:
>
> From: Thierry Reding <treding at nvidia.com>
>
> The new fdt_generate_phandle() function can be used to generate a new,
> unused phandle given a specific device tree blob. The implementation is
> somewhat naive in that it simply walks the entire device tree to find
> the highest phandle value and then returns a phandle value one higher
> than that. A more clever implementation might try to find holes in the
> current set of phandle values and fill them. But this implementation is
> relatively simple and works reliably.
>
> Also add a test that validates that phandles generated by this new API
> are indeed unique.
>
> Signed-off-by: Thierry Reding <treding at nvidia.com>
> ---
> Changes in v3:
> - update to latest upstream commit
>
>  lib/libfdt/fdt_ro.c             | 31 +++++++++++++++++++++++++++++++
>  scripts/dtc/libfdt/fdt_ro.c     | 31 +++++++++++++++++++++++++++++++
>  scripts/dtc/libfdt/libfdt.h     | 19 +++++++++++++++++++
>  scripts/dtc/libfdt/libfdt_env.h |  1 +
>  4 files changed, 82 insertions(+)

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


More information about the U-Boot mailing list