fdtdec: Honor #address-cells and #size-cells in fdtdec_add_reserved_memory()

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>
This commit is contained in:
Bin Meng 2020-05-19 23:38:33 -07:00 committed by Simon Glass
parent a9ad113df0
commit f6704c7994
1 changed files with 2 additions and 1 deletions

View 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;