From patchwork Fri Jun 19 01:51:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 242649 List-Id: U-Boot discussion From: atish.patra at wdc.com (Atish Patra) Date: Thu, 18 Jun 2020 18:51:50 -0700 Subject: [PATCH 3/3] cmd: bootefi: Honor the address & size cells properties correctly In-Reply-To: <20200619015150.27745-1-atish.patra@wdc.com> References: <20200619015150.27745-1-atish.patra@wdc.com> Message-ID: <20200619015150.27745-4-atish.patra@wdc.com> fdtdec_get_addr_size reads the uses a fixed value for address & size cell properties which may not be correct always. Use the auto variant of the function which automatically reads #address-cells & #size-cells from parent and uses to read the "reg" property. Signed-off-by: Atish Patra --- cmd/bootefi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 0f6d0f77507c..5f3fcce597de 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -190,8 +190,9 @@ static void efi_carve_out_dt_rsv(void *fdt) subnode = fdt_first_subnode(fdt, nodeoffset); while (subnode >= 0) { /* check if this subnode has a reg property */ - addr = fdtdec_get_addr_size(fdt, subnode, "reg", - (fdt_size_t *)&size); + addr = fdtdec_get_addr_size_auto_parent(fdt, nodeoffset, + subnode, "reg", 0, + (fdt_size_t *)&size, false); /* * The /reserved-memory node may have children with * a size instead of a reg property.