aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-01-15fdtdump: Fix gcc11 warningDavid Gibson1-1/+1
In one place, fdtdump abuses fdt_set_magic(), passing it just a small char array instead of the full fdt header it expects. That's relying on the fact that in fact fdt_set_magic() will only actually access the first 4 bytes of the buffer. This trips a new warning in GCC 11 - and it's entirely possible it was always UB. So, don't do that. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-01-13srcpos: increase MAX_SRCFILE_DEPTHIgnacy Kuchciński1-1/+1
Some kernels require the MAX_SRCFILE_DEPTH to be bigger than 100, and since it's just a sanity check to detect infinite recursion it shouldn't hurt increasing it to 200. Signed-off-by: Ignacy Kuchciński <ignacykuchcinski@gmail.com> Message-Id: <CAJq_QG0BHBQYT4RnVi0QSxM_vFK2K-5k1eTpJnwZQtWbKnCBJA@mail.gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-01-11dtc: Allow overlays to have .dtbo extensionViresh Kumar1-0/+4
Allow the overlays to have .dtbo extension instead of just .dtb. This allows them to be identified easily by tools as well as humans. Allow the dtbo outform in dtc.c for the same. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Message-Id: <30fd0e5f2156665c713cf191c5fea9a5548360c0.1609926856.git.viresh.kumar@linaro.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-01-04Set last_comp_version correctly in new dtb and fix potential version issues ↵Justin Covell3-2/+5
in fdt_open_into Changes in v3: - Remove noop version sets - Set version correctly on loaded fdt in fdt_open_into Fixes: f1879e1a50eb ("Add limited read-only support for older (V2 and V3) device tree to libfdt.") Signed-off-by: Justin Covell <jujugoboom@gmail.com> Message-Id: <20201229041749.2187-1-jujugoboom@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-12-22tests: Fix overlay_overlay_nosugar test casePaul Barker2-5/+5
This test was accidentally skipped as the wrong test dts file was built. The fragment numbering in this sugar-free test case needed adjusting to match the numbering generated by dtc for overlay_overlay.dts. Signed-off-by: Paul Barker <pbarker@konsulko.com> Message-Id: <20201219143521.2118-1-pbarker@konsulko.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-12-16libfdt: Tweak description of assume-aligned load helpersDavid Gibson1-7/+7
There's a small inaccuracy in the comment describing these new helpers. This corrects it, and reformats while we're there. Fixes: f98f28ab ("libfdt: Internally perform potentially unaligned loads") Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-12-16libfdt: Internally perform potentially unaligned loadsTom Rini3-15/+32
Commits 6dcb8ba4 "libfdt: Add helpers for accessing unaligned words" introduced changes to support unaligned reads for ARM platforms and 11738cf01f15 "libfdt: Don't use memcpy to handle unaligned reads on ARM" improved the performance of these helpers. On further discussion, while there are potential cases where we could be used on platforms that do not fixup unaligned reads for us, making this choice the default is very expensive in terms of binary size and access time. To address this, introduce and use new fdt{32,64}_ld_ functions that call fdt{32,64}_to_cpu() as was done prior to the above mentioned commits. Leave the existing load functions as unaligned-safe and include comments in both cases. Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Tom Rini <trini@konsulko.com> Message-Id: <20201211022736.31657-1-trini@konsulko.com> Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-12-08meson: increase default timeout for testsMarc-André Lureau1-0/+1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20201207130055.462734-4-marcandre.lureau@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-12-08meson: do not assume python is installed, skip testsMarc-André Lureau1-6/+6
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20201207130055.462734-3-marcandre.lureau@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-12-08meson: fix -Wall warningMarc-André Lureau1-10/+12
Meson already handles Wall via the built-in warning_level option. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20201207130055.462734-2-marcandre.lureau@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-11-24libfdt: Check for 8-byte address alignment in fdt_ro_probe_()Tom Rini2-1/+9
The device tree must be loaded in to memory at an 8-byte aligned address. Add a check for this condition in fdt_ro_probe_() and a new error code to return if we are not. Signed-off-by: Tom Rini <trini@konsulko.com> Message-Id: <20201104130605.28874-1-trini@konsulko.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-21build-sys: add meson buildMarc-André Lureau6-0/+331
The meson build system allows projects to "vendor" dtc easily, thanks to subproject(). QEMU has recently switched to meson, and adding meson support to dtc will help to handle the QEMU submodule. meson rules are arguably simpler to write and maintain than the hand-crafted/custom Makefile. meson support various backends, and default build options (including coverage, sanitizer, debug/release etc, see: https://mesonbuild.com/Builtin-options.html) Compare to the Makefiles, the same build targets should be built and installed and the same tests should be run ("meson test" can be provided extra test arguments for running the equivalent of checkm/checkv). There is no support EXTRAVERSION/LOCAL_VERSION/CONFIG_LOCALVERSION, instead the version is simply set with project(), and vcs_tag() is used for git/dirty version reporting (This is most common and is hopefully enough. If necessary, configure-time options could be added for extra versioning.). libfdt shared library is build following regular naming conventions: instead of libfdt.so.1 -> libfdt-1.6.0.so (with current build-sys), libfdt.so.1 -> libfdt.so.1.6.0. I am not sure why the current build system use an uncommon naming pattern. I also included a libfdt.pc pkg-config file, as convenience. Both Linux native build and mingw cross-build pass. CI pass. Tests are only run on native build. The current Makefiles are left in-tree, and make/check still work. Eventually, the Makefiles could be marked as deprecated, to start a transition period and avoid having to maintain 2 build systems in the near future. (run_tests.sh could eventually be replaced by the meson test runner, which would have several advantages in term of flexibility/features, but this is left for another day) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20201012073405.1682782-3-marcandre.lureau@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-21pylibfdt: allow build out of treeMarc-André Lureau2-10/+21
With meson, we have to support out-of-tree build. Introduce a --top-builddir option, which will default to the current directory to lookup generated filed such as version_gen.h and output directories. Other source paths are derived from the location of the setup.py script in the source tree. --build-lib is changed to be relative to the current directory, instead of relative to setup.py. This has less surprising results! Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20201012073405.1682782-2-marcandre.lureau@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-13dtc: Fix signedness comparisons warnings: Wrap (-1)Andre Przywara1-1/+1
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in dtc's data_copy_file(). Even though maxlen is of an unsigned type, we compare against "-1", which is passed in from the parser to indicate an unknown size. Cast the "-1" to an unsigned size to make the comparison match. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201012161948.23994-9-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-13dtc: Fix signedness comparisons warnings: change typesAndre Przywara5-14/+14
With -Wsign-compare, compilers warn about a mismatching signedness in comparisons in various parts of dtc. Many variables are using signed types unnecessarily, as we never use negative value in them. Change their types to be unsigned, to prevent issues with comparisons. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201012161948.23994-7-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-13convert-dtsv0: Fix signedness comparisons warningAndre Przywara1-1/+1
With -Wsign-compare, compilers warn about a mismatching signedness in comparisons in the generated lexer code. In this case we walk over an array, and never use negative indicies, so we can change the loop counter variable to be unsigned. This fixes "make convert-dtsv0", when compiled with -Wsign-compare. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201012161948.23994-3-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-13libfdt: Fix kernel-doc commentsAndre Przywara1-36/+75
The API documentation in libfdt.h seems to follow the Linux kernel's kernel-doc format[1]. Running "scripts/kernel-doc -v -none" on the file reports some problems, mostly missing return values and missing parameter descriptions. Fix those up by providing the missing bits, and fixing the other small issues reported by the script. Signed-off-by: Andre Przywara <andre.przywara@arm.com> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/doc-guide/kernel-doc.rst Message-Id: <20201012165331.25016-1-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-02checks: Allow PCI bridge child nodes without an addressRob Herring1-3/+1
Some PCI bridge nodes have child nodes such as an interrupt controller which are not PCI devices. Allow these nodes which don't have a unit-address. Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20200928201942.3242124-1-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-02libfdt: fdt_strerror(): Fix comparison warningAndre Przywara1-2/+2
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_strerror(). Force FDT_ERRTABSIZE to be signed (it's surely small enough to fit), so that the types match. Also move the minus sign to errval, as this is actually what we use in the next line. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201001164630.4980-7-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-02libfdt: fdt_get_string(): Fix sequential write comparison warningsAndre Przywara1-4/+6
With -Wsign-compare, compilers warn about a mismatching signedness in comparisons in fdt_get_string(). Introduce a new usigned variable, which holds the actual (negated) stroffset value, so we avoid negating all the other variables and have proper types everywhere. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201001164630.4980-6-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-02libfdt: libfdt_wip: Fix comparison warningAndre Przywara1-1/+1
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_setprop_inplace_namelen_partial(). fdt_getprop_namelen() will only return negative error values in "proplen" if the return value is NULL. So we can rely on "proplen" being positive in our case and can safely cast it to an unsigned type. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201001164630.4980-5-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-02libfdt: fdt_create_with_flags(): Fix comparison warningAndre Przywara1-2/+2
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_create_with_flags(). By making hdrsize a signed integer (we are sure it's a very small number), we avoid all the casts and have matching types. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201001164630.4980-4-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-02libfdt: fdt_move(): Fix comparison warningsAndre Przywara1-1/+4
With -Wsign-compare, compilers warn about a mismatching signedness in comparisons in fdt_move(). This stems from "bufsize" being passed in as a signed integer, even though we would expect a buffer size to be positive. Short of changing the prototype, check that bufsize is not negative, and cast it to an unsigned type in the comparison. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201001164630.4980-3-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-10-02libfdt: fdt_add_string_(): Fix comparison warningAndre Przywara1-7/+7
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_add_string_(). Make all variables unsigned, and express the negative offset trick via subtractions in the code. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201001164630.4980-2-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-25libfdt: fdt_node_offset_by_phandle(): Fix comparison warningAndre Przywara1-1/+1
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_node_offset_by_phandle(). Uses a better suited bitwise NOT operator to denote the special value of -1, which automatically results in an unsigned type. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20200921165303.9115-14-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-25libfdt: overlay: Fix comparison warningAndre Przywara1-1/+2
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in overlay_update_local_node_references(). This happens because the division of a signed int by an unsigned int promotes the dividend to unsigned first (ANSI C standard 6.1.3.8). As in this case we basically just divide by 4, we can do the division separately earlier, which preserves the original type. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20200921165303.9115-12-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-24libfdt: fdt_resize(): Fix comparison warningAndre Przywara1-1/+4
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_resize(). A negative buffer size will surely do us no good, so let's rule this case out first. In the actual comparison we then know that a cast to an unsigned type is safe. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20200921165303.9115-10-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-24libfdt: fdt_splice_(): Fix comparison warningAndre Przywara1-1/+1
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_splice_(). Since we just established that oldlen is not negative, we can safely cast it to an unsigned type. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20200921165303.9115-8-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-24libfdt: fdt_get_string(): Fix comparison warningsSimon Glass1-2/+2
With -Wsign-compare, compilers warn about a mismatching signedness in comparisons in fdt_get_string(). In the first two cases, we have just established that the signed values are not negative, so it's safe to cast the values to an unsigned type. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20200921165303.9115-7-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-23libfdt: fdt_grab_space_(): Fix comparison warningAndre Przywara1-2/+2
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_grab_space_(). All the involved values cannot be negative, so let's switch the types of the local variables to unsigned to make the compiler happy. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20200921165303.9115-4-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-23libfdt: fdt_mem_rsv(): Fix comparison warningsAndre Przywara1-2/+2
With -Wsign-compare, compilers warn about a mismatching signedness in comparisons in fdt_mem_rsv(). Since all involved values must be positive, change the used types to be unsigned. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20200921165303.9115-3-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-23libfdt: fdt_offset_ptr(): Fix comparison warningsAndre Przywara1-3/+7
With -Wsign-compare, compilers warn about mismatching signedness in comparisons in fdt_offset_ptr(). This mostly stems from "offset" being passed in as a signed integer, even though the function would not really tolerate negative values. Short of changing the prototype, check that offset is not negative, and use an unsigned type internally. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20200921165303.9115-2-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-08-25Makefile: Specify cflags for libyamlEmmanuel Vadot1-0/+1
Some systems don't install third party software includes in a default path (like FreeBSD), add yaml cflags to fix compilation. Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>
2020-08-14libfdt: fix fdt_check_node_offset_ w/ VALID_INPUTFrank Mehnert1-6/+10
fdt_check_node_offset_() checks for a valid offset but also changes the offset by calling fdt_next_tag(). Hence, do not skip this function if ASSUME_VALID_INPUT is set but only omit the initial offset check in that case. As this function works very similar to fdt_check_prop_offset_(), do the offset check there as well depending on ASSUME_VALID_INPUT. Message-Id: <1913141.TlUzK5foHS@noys4> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-07-22dtc: Include stdlib.h in util.hAndrei Ziureaev1-0/+1
If used on its own, util.h needs stdlib.h for exit(), malloc() and realloc(). Signed-off-by: Andrei Ziureaev <andrei.ziureaev@arm.com> Message-Id: <20200721155900.9147-2-andrei.ziureaev@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-07-15dtc: Avoid UB when shiftingAndrei Ziureaev1-2/+2
Prevent undefined behavior when shifting by a number that's bigger than or equal to the width of the first operand. Signed-off-by: Andrei Ziureaev <andrei.ziureaev@arm.com> Message-Id: <20200714154542.18064-2-andrei.ziureaev@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-07-10libfdt: fix fdt_check_full buffer overrunPatrick Oppenlander1-0/+2
fdt_check_header assumes that its argument points to a complete header and can read data beyond the FDT_V1_SIZE bytes which fdt_check_full can provide. fdt_header_size can safely return a header size with FDT_V1_SIZE bytes available and will return a usable value even for a corrupted header. Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com> Message-Id: <20200709041451.338548-1-patrick.oppenlander@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-06-24dtc: Consider one-character strings as stringsGeert Uytterhoeven1-1/+1
When using overlays, a target-path property pointing to the root node is quite common. However, "dtc -O dts" prints it as a byte array: target-path = [2f 00]; instead of a string: target-path = "/"; For guess_value_type() to consider a value to be a string, it must contain less nul bytes than non-nul bytes, thus ruling out strings containing only a single character. Allow printing such strings by relaxing the condition slightly. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Message-Id: <20200623094343.26010-1-geert+renesas@glider.be> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-06-22checks: Improve i2c reg property checkingJoel Stanley1-2/+6
The i2c bindings in the kernel tree describe support for 10 bit addressing, which must be indicated with the I2C_TEN_BIT_ADDRESS flag. When this is set the address can be up to 10 bits. When it is not set the address is a maximum of 7 bits. See Documentation/devicetree/bindings/i2c/i2c.txt. Take into account this flag when checking the address is valid. Signed-off-by: Joel Stanley <joel@jms.id.au> Message-Id: <20200622031005.1890039-3-joel@jms.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-06-22checks: Remove warning for I2C_OWN_SLAVE_ADDRESSJoel Stanley1-0/+6
dtc does a sanity check on reg properties that they are within the 10 bit address range for i2c slave addresses. In the case of multi-master buses or devices that act as a slave, the binding may describe an address that the bus will listen on as a device. Do not warn when this flag is set. See Documentation/devicetree/bindings/i2c/i2c.txt. This fixes the following build warnings reported by Stephen and by Arnd: arch/arm/boot/dts/aspeed-bmc-facebook-yosemitev2.dts:126.11-130.4: Warning (i2c_bus_reg): /ahb/apb/bus@1e78a000/i2c-bus@80/ipmb1@10: I2C bus unit address format error, expected "40000010" arch/arm/boot/dts/aspeed-bmc-facebook-yosemitev2.dts:128.3-30: Warning (i2c_bus_reg): /ahb/apb/bus@1e78a000/i2c-bus@80/ipmb1@10:reg: I2C address must be less than 10-bits, got "0x40000010" Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Joel Stanley <joel@jms.id.au> Message-Id: <20200622031005.1890039-2-joel@jms.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-06-19libfdt: add extern "C" for C++Patrick Oppenlander1-0/+8
Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com> Message-Id: <20200616011217.15253-1-patrick.oppenlander@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-06-18libfdt: trivial typo fixPatrick Oppenlander1-1/+1
Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com> Message-Id: <20200618042117.131731-1-patrick.oppenlander@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-06-16libfdt: Correct condition for reordering blocksSimon Glass1-1/+1
This condition uses bitwise OR but should be logical OR. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: kernel test robot <lkp@intel.com> Message-Id: <20200615160033.87328-1-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-05-18checks: Add interrupt provider testAndre Przywara3-1/+32
An interrupt provider (an actual interrupt-controller node or an interrupt nexus) should have both #address-cells and #interrupt-cells properties explicitly defined. Add an extra test for this. We check for the #interrupt-cells property already, but this does not cover every controller so far, only those that get referenced by an interrupts property in some node. Also we miss interrupt nexus nodes. A missing #address-cells property is less critical, but creates ambiguities when used in interrupt-map properties, so warn about this as well now. This removes the now redundant warning in the existing interrupts test. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20200515141827.27957-2-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-05-14Makefile: when building libfdt only, do not add unneeded depsClaudio Fontana1-0/+4
implemented originally for the QEMU consumer of libfdt. Signed-off-by: Claudio Fontana <cfontana@suse.de> Message-Id: <20200512103315.1926-1-cfontana@suse.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-04-14Fix some potential unaligned accesses in dtcDavid Gibson4-7/+38
Because of the convention of packed representations in property layouts, it's not uncommon to have integer values in properties which aren't naturally aligned. Thus, there are several places in the dtc code where we cast a potentially unaligned byte pointer into an integer pointer and load it directly. On a number of architectures (including sparc64 and arm) this won't work and will cause a fault. In some cases it may be trapped and emulated by the kernel, but not always. Therefore, replace such direct unaligned reads with a helper which will handle unaligned data reads (a variant on the fdtXX_ld() functions already used in libfdt). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-10check: Inform about missing rangesArkadiusz Drabczyk1-1/+1
In check_unit_address_vs_reg() warning message already says 'reg _or_ ranges' when reg or ranges are present but unit name is missing. Add this message for compatibility to say "reg _or_ ranges" when unit name is present but neither reg nor ranges are present. Signed-off-by: Arkadiusz Drabczyk <arkadiusz@drabczyk.org> Message-Id: <20200308165643.19281-1-arkadiusz@drabczyk.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-06libfdt: fix undefined behaviour in fdt_splice_()Jan Beulich1-6/+7
libfdt: fix undefined behaviour in fdt_splice_() Along the lines of commit d0b3ab0a0f46 ("libfdt: Fix undefined behaviour in fdt_offset_ptr()"), fdt_splice_() similarly may not use pointer arithmetic to do overflow checks. (The left side of the checks added by d4c7c25c9ed1 ["libfdt: check for potential overrun in _fdt_splice()"] doesn't really lend itself to similar replacement though.) Signed-off-by: Jan Beulich <jbeulich@suse.com> Message-Id: <f2d09e81-7cb8-c5cc-9699-1ac05b0626ff@suse.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-04Bump version to v1.6.0v1.6.0David Gibson1-1/+1
We've accumulated some new features and a bunch of fixes. Also the versioning on v1.5.1 was messed up :(. Prepare for another release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-04Execute tests on FreeBSD with Cirrus CIDavid Gibson1-0/+2
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>