[PATCH 3/3] cmd: bootefi: Honor the address & size cells properties correctly
Atish Patra
atish.patra at wdc.com
Fri Jun 19 03:51:50 CEST 2020
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 <atish.patra at wdc.com>
---
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.
--
2.24.0
More information about the U-Boot
mailing list