Commit graph

881 commits

Author SHA1 Message Date
Luca Weiss
95ce19c140 README: update for Python 3
Convert the usage to be compatible with Python 3 and the current API.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Message-Id: <20190817212532.15661-2-luca@z3ntu.xyz>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-08-29 11:06:11 +10:00
Denis Efremov
5345db19f6 livetree: simplify condition in get_node_by_path
The "strlen && strprefixeq" check in get_node_by_path is
excessive, since strlen is checked in strprefixeq macro
internally. Thus, "strlen(child->name) == p-path"
conjunct duplicates after macro expansion and could
be removed.

Signed-off-by: Denis Efremov <efremov@linux.com>
Message-Id: <20190827204148.20604-1-efremov@linux.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-08-28 13:57:27 +10:00
David Gibson
b8d6eca782 libfdt: Allow #size-cells of 0
c12b2b0c20 "libfdt: fdt_address_cells() and fdt_size_cells()" introduced
a bug as it consolidated code between the helpers for getting
#address-cells and #size-cells.  Specifically #size-cells is allowed to
be 0, and is frequently found so in practice for /cpus.  IEEE1275 only
requires implementations to handle 1..4 for #address-cells, although one
could make a case for #address-cells == #size-cells == 0 being used to
represent a bridge with a single port.

While we're there, it's not totally obvious that the existing implicit
cast of a u32 to int will give the correct results according to strict C,
although it does work in practice.  Straighten that up to cast only after
we've made our range checks.

Reported-by: yonghuhaige via https://github.com/dgibson/dtc/issues/28
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-28 16:31:44 +10:00
Joel Stanley
184f510994 Makefile: Add EXTRA_CFLAGS variable
Distributions packaging dtc may need to set extra flags. Currently when
they do that it overrides the ones set by the makefile. This is
particularly problematic when compiling without yaml, as the yaml
detection is ignored.

 ld: dtc.o: in function `main':
 dtc.c:(.text.startup+0x718): undefined reference to `dt_to_yaml'

This patch provides a EXTRA_CFLAGS variable that is added to the list of
CFLAGS, and can be set on the command line when packaging.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Message-Id: <20190722030244.9580-1-joel@jms.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-22 13:13:24 +10:00
David Gibson
812b1956a0 libfdt: Tweak data handling to satisfy Coverity
In libfdt we often sanity test fdt_totalsize(fdt) fairly early, then
trust it (but *only* that header field) for the remainder of our work.
However, Coverity gets confused by this - it sees the byteswap in
fdt32_ld() and assumes that means it is coming from an untrusted source
everytime, resulting in many tainted data warnings.

Most of these end up with logic in fdt_get_string() as the unsafe
destination for this tainted data, so let's tweak the logic there to make
it clearer to Coverity that this is ok.

We add a sanity test on fdt_totalsize() to fdt_probe_ro_().  Because the
interface allows bare ints to be used for offsets, we already have the
assumption that totalsize must be 31-bits or less (2GiB would be a
ludicrously large fdt).  This makes this more explicit.

We also make fdt_probe_ro() return the size for convenience, and change the
logic in fdt_get_string() to keep it in a local so that Coverity can see
that it has already been bounds-checked.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-05 15:31:12 +10:00
David Gibson
5c715a4477 fdtoverlay: Ignore symbols in overlays which don't apply to the target tree
Symbols from overlays are merged into the target tree, and are required to
have the form:
	/fragment@XXX/__overlay__/...
If any symbols don't have this form, the overlay is rejected.

But there's not really anything wrong with an overlay having "local"
labels referring to a fragment node or some other metadata, that's not
expected to end up in a target tree.

So change our overlay application to simply ignore such symbols rather than
fail.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-04 15:10:01 +10:00
David Gibson
b993534748 fdtoverlay: Allow adding labels to __overlay__ nodes in overlays
When applying overlays, we merge symbols from the overlay into the target
tree.  At the moment the logic for this assumes all symbols in the overlay
are attached to a node of the form:
	/fragment@XXX/__overlay__/relative/path

And will end up applied to the relative/path node under the fragment's
target.

However, this disallows the case of a symbol in the form just:
	/fragment@XXX/__overlay__

This does have a pretty obvious sensible meaning: attach the new symbol
directly to the fragment's target, but we don't currently do that.

It's pretty easy to workaround this limitation in one's overlays, but it's
also easy to handle in the overlay applying code, so we might as well
extend it to cover this case.

Reported-by: Christophe Braillon
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-04 14:39:02 +10:00
Appana Durga Kedareswara rao
d6de81b81b pylibfdt: Add support for fdt_get_alias()
Add this into the class to simplify use of this function.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Message-Id: <1562130487-27028-1-git-send-email-appana.durga.rao@xilinx.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-04 12:56:47 +10:00
Simon Glass
1c17714dbb pylibfdt: Correct the FdtSw example
At present this example is incorrect since it is missing the call to
finish_reservemap() and does not add a root node. Fix these problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
Message-Id: <20190703000815.102459-1-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-03 10:23:21 +10:00
Fabrice Gasnier
ad57e4574a tests: Add a failed test case for 'fdtoverlay' with long target path
This adds a test case to demonstrate some issue seen when applying
overlays using 'fdtoverlay'. It fails with FDT_ERR_NOSPACE:
- with long target path
- symbols in order to use these nodes in possible subsequent overlay.

This is seen with this patch, by running:
$ make check # Reports a failed test
$ ./fdtoverlay -i tests/overlay_base.test.dtb -o out.dtb \
  tests/overlay_overlay_long_path.fdoverlay.test.dtb
  Failed to apply tests/overlay_overlay_long_path.fdoverlay.test.dtb (-3)

This overlay fails to apply, because dtb size is close to modulo 1024
bytes chunk: utilfdt_read() -> utilfdt_read_err() -> bufsize = 1024.

As there is not much extra space in the blob to resolve symbols (long
target path), it fails with FDT_ERR_NOSPACE. In fdtoverlay, size is :
 /* grow the blob to worst case */
 blob_len = fdt_totalsize(blob) + total_len;

I can see assumption is made that result should be lower than:
- base fdt size + overlay size. Is there a simple way to find to know
what the final size is?
I'm not sure what the correct fix might be, for such (worst) case?
Similar issue is also seen in u-boot/common/image-fit.c that implements
similar approach (e.g. base fdt size + overlay size).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Message-Id: <1538553302-1353-1-git-send-email-fabrice.gasnier@st.com>
[dwg: To avoid breaking bisection, I committed this after a fix, so
 the "failed" description is no longer accurate]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-30 15:48:40 +10:00
David Gibson
bbe3b36f54 fdtoverlay: Rework output allocation
At present the fdtoverlay tool allocates space for its output based on a
calculation of the worse case size based on the size of the input blobs.

Except.. that certain edge cases with very long target paths can actually
exceed that "worst case" calculation.

This reworks the code to instead dynamically reallocate the output buffer
if we run out of space at any point.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-30 15:47:50 +10:00
David Gibson
6c2e61f083 fdtoverlay: Improve error messages
Make several improvements to the error messages from the fdtoverlay helper
program: improve brevity, consistently quote filenames and print symbolic
errors from libfdt rather than a raw error number.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-30 15:47:50 +10:00
David Gibson
297f5abb36 fdtoverlay: Check for truncated overlay blobs
The fdtoverlay helper program checks if it has read a base blob which is
incomplete: that is, where the amount of data read in is less that the
declared size of the blob.

This applies the same check for safety to each overlay blob as well.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-30 15:47:50 +10:00
Rob Herring
702c1b6c0e README.license: Update to reflect SPDX tag usage
Update README.license since files now have SPDX tags rather than license
text. Adding a copy of BSD-2-Clause license since that no longer exists
within the project.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190620211944.9378-8-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21 21:06:10 +10:00
Rob Herring
4097bbffcf dtc: Add GPLv2 SPDX tags to files missing license text
A couple of dtc files are missing licenses. Add GPL-2.0-or-later SPDX
tag to them.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190620211944.9378-7-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21 21:06:10 +10:00
Rob Herring
94f87cd5b7 libfdt: Add dual GPL/BSD SPDX tags to files missing license text
A couple of libfdt files are missing licenses. Add (GPL-2.0-or-later OR
BSD-2-Clause) SPDX tag to them.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190620211944.9378-6-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21 21:06:10 +10:00
Rob Herring
c4ffc05574 tests: Replace license boilerplate with SPDX tags
Replace instances in tests of mostly LGPL-2.1 license boilerplate
with SPDX tags.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190620211944.9378-5-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21 21:06:10 +10:00
Rob Herring
a5ac29baac pylibfdt: Replace dual GPLv2/BSD license boilerplate with SPDX tags
Replace pylibfdt GPLv2/BSD license boilerplate and add missing license
with SPDX tags.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190620211944.9378-4-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21 21:06:10 +10:00
Rob Herring
7fb0f4db2e libfdt: Replace GPL/BSD boilerplate/reference with SPDX tags
Replace instances of dual GPLv2 or BSD license boilerplate with SPDX tags.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190620211944.9378-3-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21 21:06:10 +10:00
Rob Herring
acfe84f2c4 dtc: Replace GPLv2 boilerplate/reference with SPDX tags
Replace instances of GPLv2 or later boilerplate with SPDX tags.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190620211944.9378-2-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21 21:06:10 +10:00
Rob Herring
87963ee206 livetree: add missing type markers in generated overlay properties
The YAML output fails for overlays and when symbol generation are enabled
due to missing markers in the generated properties.

Add type markers when generating properties under '__symbols__' and
'__fixups__' nodes as well as target-path properties. As a side effect of
append_to_property() changes, this also sets type markers in
'__local_fixups__' node properties.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190517202804.9084-1-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-12 16:01:16 +10:00
Thomas Huth
825146d13d Fix typos in various documentation and source files
The typos have been discovered with the "codespell" utility.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190520081209.20415-1-thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-05-21 10:01:01 +10:00
Thomas Huth
25bb080c18 Update the GPL2 text to the latest revision
This patch replaces the GPL2 text with the latest one from:

 https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

The FSF moved to a different location quite a while ago already, and
the latest revision recommends to use the LGPL-2.1 ("Lesser" license)
instead of the LGPL-2.0 ("Library" license) in certain cases.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190520072720.14755-1-thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-05-21 09:58:37 +10:00
David Gibson
243176c4ce Fix bogus error on rebuild
Currently if a file is touched requiring libfdt.so rebuild, it will fail
because the ln -s command will attempt to replace an already existing link
an error.  Correct this by using ln -sf.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-05-10 11:57:19 +10:00
Nicholas Piggin
ce01b21098 libfdt: Add FDT_CREATE_FLAG_NO_NAME_DEDUP flag that trades size for speed
Searching for duplicate names scales O(n^2) with the number of names
added to a fdt, which can cause a noticable slowdown with larger device
trees and very slow CPU cores.

Add FDT_CREATE_FLAG_NO_NAME_DEDUP that allow the caller to trade fdt size
for speed in the creation process.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20190509094122.834-4-npiggin@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-05-10 11:53:10 +10:00
Nicholas Piggin
fbb62754ce libfdt: Introduce fdt_create_with_flags()
There is a need to be able to specify some options when building an FDT
with the SW interface. This can be accomplished with minimal changes by
storing intermediate data in the fdt header itself, in fields that are
not otherwise needed during the creation process and can be set by
fdt_finish().

The fdt.magic field is already used exactly this way, as a state to
check with callers that the FDT has been created but not yet finished.

fdt.version and fdt.last_comp_version are used to make room for more
intermediate state. These are adjacent and unused during the building
process. last_comp_version is not yet used for intermediate state, but
it is zeroed and treated as used, so as to allow future growth easily.

A new interface, fdt_create_with_flags() is added, which takes 32-bit
flag value to control creation.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20190509094122.834-3-npiggin@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-05-10 11:53:10 +10:00
Nicholas Piggin
228a44cce8 libfdt: Ensure fdt_add_property frees allocated name string on failure
If fdt_add_property or fdt_property_placeholder fail after allocating
a string for the name, they return without freeing that string. This
does not change the structure of the tree, but in very specific cases
it could lead to undesirable space consumption.

Fix this by rolling back the string allocation in this situation.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20190509094122.834-2-npiggin@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-05-10 11:53:10 +10:00
David Gibson
8f69567622 Avoid assertion in check_interrupts_property()
If running on a tree with an 'interrupt-parent' property which contains
an invalid phandle (0 or -1, not merely for a node which doesn't exist),
then check_interrupts_property() will trip the assertion in
get_node_by_phandle().

There's logic that almost detects this, but it only handles the overlay
case, where we can't fully check because the links will be fixed up later.

For the non-overlay case, this is definitely a bad property, but we
shouldn't crash.  Fix it by failing the check early.

Fixes: c1e55a5513 ("checks: fix handling of unresolved phandles for dts plugins")
Fixes: ee3d26f696 ("checks: add interrupts property check")
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-05-06 17:00:07 +10:00
David Gibson
5c3513f689 Link tools and tests against libfdt shared library
Currently the libfdt based tools (fdtput, fdtget, etc.) and all the
test binaries using libfdt are linked against the static version of libfdt.
That's made it very easy in the past to forget to properly update the
version.lds file which is needed to make functions publicaly accessible
from the shared library.

To avoid problems like that in future, alter the build so that we link and
run the tests against the shared library version of libfdt.

That immediately points out several important symbols that are still
missing from the version.lds, so fix those as well.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 17:20:16 +11:00
David Gibson
00f9febf9c tests: Rename tests.sh to testutils.sh
tests.sh has a bunch of shell setup that's sourced in a number of other
scripts.  It _doesn't_ actually run a bunch of tests, which is kind of what
the name suggests.  So rename it to be more obvious.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 16:31:39 +11:00
David Gibson
c5d45188f9 Clean up LDLIBS handling
We currently set LDLIBS to include libyaml globally if we're using it.
However only dtc itself actually needs to link with libyaml - the other
tool binaries don't.  Avoid that unnecessary inclusion by making LDLIBS
handling per-target.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 16:15:08 +11:00
David Gibson
6ef8fcd05b Rebuild libfdt shared object if versioning linker script changes
The usable content of the shared library varies depending on the symbol
versions given in the version.lds linker script, however it's not currently
in the make dependencies.  Correct that, and move the libfdt rules together
for consistency while we're at it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 15:43:24 +11:00
David Gibson
26ee65a16c Use Python3 by default
Python2 is deprecated upstream, lets try to move forwards. Along with it
generalize the .gitignore file so we ignore the .pyc files in the new
location that Python3 uses.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 15:43:24 +11:00
David Gibson
cca6546244 libfdt: Make fdt_get_max_phandle() an inline
It's now a trivial wrapper around fdt_find_max_phandle() so we might as
well inline it.  We also remove it from the versioning linker script.
Theoretically, that's a breaking ABI change except that we haven't yet
released a version with it exposed in the shared object, so we can get
away with it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 13:59:04 +11:00
Thierry Reding
730875016a libfdt: Add phandle generation helper
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@nvidia.com>
Message-Id: <20190326153302.17109-3-thierry.reding@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 13:31:16 +11:00
Thierry Reding
7dfb61ba96 libfdt: Use fdt_find_max_phandle()
Use the fdt_find_max_phandle() function instead of the deprecated
fdt_get_max_phandle() function.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Message-Id: <20190326153302.17109-2-thierry.reding@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 13:31:16 +11:00
Thierry Reding
2bc5b66d7f libfdt: Add new maximum phandle lookup function
The fdt_get_max_phandle() function has some shortcomings. On one hand
it returns just a uint32_t which means to check for the "negative"
error code a caller has to explicitly check against the error code
(uint32_t)-1. In addition, the -1 is the only error code that can be
returned, so a caller cannot tell the difference between the various
failures.

Fix this by adding a new fdt_find_max_phandle() function that returns an
error code on failure and 0 on success, just like other APIs, and stores
the maximum phandle value in an output argument on success.

This also refactors fdt_get_max_phandle() to use the new function. Add a
note pointing out that the new fdt_find_max_phandle() function should be
preferred over fdt_get_max_phandle().

Signed-off-by: Thierry Reding <treding@nvidia.com>
Message-Id: <20190326153302.17109-1-thierry.reding@gmail.com>
[dwg: Reword for some inaccuracies in the commit message]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 13:29:51 +11:00
AKASHI Takahiro
7fcf8208b8 libfdt: add fdt_append_addrrange()
This function will append an address range property using parent node's
"#address-cells" and "#size-cells" properties.

It will be used in implementing kdump with kexec_file_load system call
at linux kernel for arm64 once it is merged into kernel tree.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Message-Id: <20190327061552.17170-2-takahiro.akashi@linaro.org>
[dwg: Correct a SEGV error in the testcase]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 12:12:29 +11:00
Chen-Yu Tsai
ae795b2db7 checks: Do not omit nodes with labels if symbol generation is requested
Commit 4038fd9005 ("dtc: add ability to make nodes conditional on them
being referenced") added the new /omit-if-no-ref/ directive to mark
nodes as eligible to be discarded if not referenced. The mechanism to
process this happens before the symbol generation phase. This means even
if symbol generation is requested and the node has a label, it will be
discarded if there are no references to it within the same file.

This is probably not what people expect. When using symbol generation to
compile base device trees for applying overlays, nodes with labels could
be referenced by the overlays, and therefore should be preserved.

Check if the node has a label and symbol generation was requested before
dropping the node.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Message-Id: <20190327035352.24036-1-wens@csie.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-27 17:02:54 +11:00
David Gibson
eac2ad495b Update version.lds again
Yet again, we've added several functions to libfdt that were supposed
to be exported, but forgotten to add them to the versio.lds script.
This adds them.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-25 14:52:47 +11:00
David Gibson
f67b471355 Revert "libfdt: Add phandle generation helper"
This reverts commit 54ea41c224.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-25 14:51:27 +11:00
Thierry Reding
54ea41c224 libfdt: Add phandle generation helper
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@nvidia.com>
Message-Id: <20190320151003.28941-1-thierry.reding@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-21 11:37:44 +11:00
Leonard Crestez
4762ad051e checks: Fix spelling in check_graph_endpoint
Should be "endpoint" rather than "endpont"

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Message-Id: <6fcb6e160163467b706c312ffe307ee8a5d9255d.1552328099.git.leonard.crestez@nxp.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-12 19:16:14 +11:00
David Gibson
d37f6b2010 Bump version to v1.5.0
We've accumulated several new features as well as a number of bugfixes,
so prepare for another release.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-06 15:51:37 +11:00
Lumir Balhar
a4b1a307ff pylibfdt:tests: Extend the way how to find a Python module
Python 3 C extensions have suffix containing platform, Python version
and another details in the name so the condition has to be extended.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Message-Id: <20190218164856.23861-5-frenzy@frenzy.cz>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-02-19 16:07:58 +11:00
Lumir Balhar
625dd8aaf2 pylibfdt: Change how passing tests are recognized
When some warning appears in test result, "ok" is still
at the end of the line but without three dots.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Message-Id: <20190218164856.23861-4-frenzy@frenzy.cz>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-02-19 13:51:48 +11:00
Petr Viktorin
364631626b pylibfdt: Test fdt.setprop take bytes on Python 3, add error handling
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Message-Id: <20190218164856.23861-3-frenzy@frenzy.cz>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-02-19 13:51:48 +11:00
Lumir Balhar
cb0f454f73 pylibfdt: check_err accepts only integer as a first argument.
A list passed as an argument to check_err() means that
there is no error code to check and therefore it should
be returned back.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Message-Id: <20190218164856.23861-2-frenzy@frenzy.cz>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-02-19 13:49:27 +11:00
Lumir Balhar
4b68c6b360 pylibfdt: Proper handling of bytes/unicode strings and octal literals
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Message-Id: <20190218164856.23861-1-frenzy@frenzy.cz>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-02-19 13:43:27 +11:00
Andreas Schwab
78e113e81c Use PRIxPTR for printing uintptr_t values
Fixes: 49903aed77 ("use ptrdiff_t modifier for printing pointer differences")
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
2019-01-02 12:35:12 +01:00