]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fdtdec: Honor #address-cells and #size-cells in fdtdec_add_reserved_memory()
authorBin Meng <bin.meng@windriver.com>
Wed, 20 May 2020 06:38:33 +0000 (23:38 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 12 Jun 2020 02:52:11 +0000 (20:52 -0600)
At present fdtdec_add_reserved_memory() calls fdtdec_get_addr_size()
to get address and size for the subnodes of /reserved-memory node.

We should honor #address-cells and #size-cells properties in the
parent node.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/fdtdec.c

index 42f7a255056acc90585c1df458383f5b7950c089..0dd7ff1ac3f797e23e1ec3ee6ba944872866af6c 100644 (file)
@@ -1297,7 +1297,8 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename,
                fdt_addr_t addr;
                fdt_size_t size;
 
-               addr = fdtdec_get_addr_size(blob, node, "reg", &size);
+               addr = fdtdec_get_addr_size_fixed(blob, node, "reg", 0, na, ns,
+                                                 &size, false);
                if (addr == FDT_ADDR_T_NONE) {
                        debug("failed to read address/size for %s\n", name);
                        continue;