From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sat, 30 Mar 2019 15:18:12 -0600 Subject: [U-Boot] [PATCH v3 01/13] libfdt: Add phandle generation helper In-Reply-To: <20190325072708.GA22420@ulmo> References: <20190321181010.27005-1-thierry.reding@gmail.com> <20190321181010.27005-2-thierry.reding@gmail.com> <20190325072708.GA22420@ulmo> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Thierry, On Mon, 25 Mar 2019 at 01:27, Thierry Reding wrote: > > On Fri, Mar 22, 2019 at 03:52:59PM +0800, Simon Glass wrote: > > On Fri, 22 Mar 2019 at 02:10, Thierry Reding wrote: > > > > > > From: Thierry Reding > > > > > > 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 > > > --- > > > 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 > > Looks like this was reverted again upstream (for, in my opinion, dubious > reasons). Shall I just move it to fdtdec again and we can convert to > whatever we end up with upstream, if anything, later on? Yes that is OK with me. Regards, Simon