| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
of_read_file already prints to log messages when it fails, so
duplicating the error message in the caller is needlessly verbose.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240304190038.3486881-11-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of_diff - + is quite useful to find what fixups barebox would apply to
its own device tree. But for some cases, like barebox-state or OP-TEE
reservations, the nodes that would be fixed up into the kernel device
tree already exist within the barebox device tree and wouldn't be shown
by of_diff - +. To make them visible, let's redefine +:
- Previously, it always meant the fixed up barebox DT
- Now, it means the other DT with fixups applied
That way, of_diff - + continues to work, but kernel DTs can now be
diffed against their fixed up version by doing:
of_diff /mnt/tftp/afa-oftree-myboard +
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230608134040.2123869-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The error check and message is duplicated for each argument and
could be unified if we move it to get_tree instead.
While at it, we limit argc to exactly 3 in case we want to add options
in the future.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230608134040.2123869-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
There are several places in the tree that read in a dtb file
and unflatten it. Add a of_read_file() helper function for that
and use it where appropriately.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Tests may want to leverage of_diff to verify that fixups proceeded as
expected. of_diff lends itself nicely to that by being silent in case of
success and just reporting diff on error. Add a return code to make it
usable in follow-up tests.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220207082801.1052894-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
of_unflatten_dtb() doesn't check the size of the device tree blob
passed to it. Add a size argument end add checks for the size. Some
callers have no idea of the buffer size themselves, INT_MAX is passed
in these cases.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210624085223.14616-4-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds of_dup() to duplicate a device tree. Previously of_copy_node()
was used for this, but of_copy_node() has issues with potentially
duplicated phandle values when the new tree is inserted to an existing
tree, that is when the parent argument of of_copy_node() is non NULL.
All users of of_copy_node() with a NULL parent argument are converted
to of_dup() which is safe to use leaving only the problematic users
of of_copy_node().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210624085223.14616-3-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
strerrorp() is only used along with printf. We now have a format
specifier for printing error pointers directly, so use that and
remove strerrorp.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While at it also drop references to the non-existing CREDITS file and do
some small rearrangements for some uniform formatting.
(SPDX-License-Identifier first, then copyright texts and then an empty
line.)
The advantage is that these specifiers are machine-parseable which helps
license conformance.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
The of_diff command compares two device trees against each other
and prints a diff-like result. This can be handy to find out the
differences between the barebox live tree and the one we start the
kernel with. Another usecase would be to examine the changes our
of_fixup process introduces (of_diff - +)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|