summaryrefslogtreecommitdiffstats
path: root/cpukit/dtc/libfdt/fdt_addresses.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update company nameSebastian Huber2023-05-201-1/+1
| | | | | The embedded brains GmbH & Co. KG is the legal successor of embedded brains GmbH.
* libfdt: fix an incorrect integer promotionElvira Khabirova2021-12-141-1/+1
| | | | | | | | | | UINT32_MAX is an integer of type unsigned int. UINT32_MAX + 1 overflows unless explicitly computed as unsigned long long. This led to some invalid addresses being treated as valid. Cast UINT32_MAX to uint64_t explicitly. Signed-off-by: Elvira Khabirova <e.khabirova@omp.ru>
* libfdt: Allow #size-cells of 0David Gibson2020-03-021-3/+5
| | | | | | | | | | | | | | | | | | c12b2b0c20eb "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>
* libfdt: Replace GPL/BSD boilerplate/reference with SPDX tagsRob Herring2020-03-021-46/+1
| | | | | | | | 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>
* libfdt: add fdt_append_addrrange()AKASHI Takahiro2020-03-021-0/+47
| | | | | | | | | | | | | 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>
* libfdt: return correct value if #size-cells property is not presentJohn Clarke2020-03-021-3/+13
| | | | | | | | | | | | | According to the device tree specification, the default value for #size-cells is 1, but fdt_size_cells() was returning 2 if this property was not present. This patch also makes fdt_address_cells() and fdt_size_cells() conform to the behaviour documented in libfdt.h. The defaults are only returned if fdt_getprop() returns -FDT_ERR_NOTFOUND, otherwise the actual error is returned. Signed-off-by: John Clarke <johnc@kirriwa.net>
* libfdt: fdt_address_cells() and fdt_size_cells()Sebastian Huber2018-07-201-22/+13
| | | | | | | | Add internal fdt_cells() to avoid copy and paste. Test error cases and default values. Fix typo in fdt_size_cells() documentation comment. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Initial importSebastian Huber2015-10-161-0/+96
Import from: git://git.kernel.org/pub/scm/utils/dtc/dtc.git Commit: 604e61e081e3c6c8fa1a8189c71cb3908a5bbc1e Date: 2015-09-29T09:09:08Z