[PATCH v3 0/2] Assorted fixes related to reserved memory

This series has few small assorted fixes related to reserved memory support in RISC-V.
The series is rebased on top of the following series http://patchwork.ozlabs.org/project/uboot/patch/1591767391-2669-2-git-send-e...
Changes form v2->v3: 1. Dropped bootefi patch as it is already merged. 2. Fixed minor typos.
Changes from v1->v2: 1. Rebased on top of the Bin's series. Dropped the fix generic fdtdec code. 2. Added bootefi fix.
Atish Patra (2): riscv: Do not return error if reserved node already exists riscv: Use optimized version of fdtdec_get_addr_size_no_parent
arch/riscv/lib/fdt_fixup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
-- 2.24.0

Not all errors are fatal. If a reserved memory node already exists in the destination device tree, we can continue to boot without failing.
Signed-off-by: Atish Patra atish.patra@wdc.com --- arch/riscv/lib/fdt_fixup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c index 6db48ad04a56..05ca41b49dda 100644 --- a/arch/riscv/lib/fdt_fixup.c +++ b/arch/riscv/lib/fdt_fixup.c @@ -62,7 +62,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst) pmp_mem.end = addr + size - 1; err = fdtdec_add_reserved_memory(dst, basename, &pmp_mem, &phandle); - if (err < 0) { + if (err < 0 && err != -FDT_ERR_EXISTS) { printf("failed to add reserved memory: %d\n", err); return err; }

On Thu, Jun 25, 2020 at 5:56 AM Atish Patra atish.patra@wdc.com wrote:
Not all errors are fatal. If a reserved memory node already exists in the destination device tree, we can continue to boot without failing.
Signed-off-by: Atish Patra atish.patra@wdc.com
arch/riscv/lib/fdt_fixup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Bin Meng bin.meng@windriver.com

fdtdec_get_addr_size_no_parent is not an optimized version if parent node is already available with the caller.
Use fdtdec_get_addr_size_auto_parent to read the "reg" property
Signed-off-by: Atish Patra atish.patra@wdc.com Reviewed-by: Bin Meng bin.meng@windriver.com --- arch/riscv/lib/fdt_fixup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c index 05ca41b49dda..fab93873d5c7 100644 --- a/arch/riscv/lib/fdt_fixup.c +++ b/arch/riscv/lib/fdt_fixup.c @@ -44,9 +44,9 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst) fdt_for_each_subnode(node, src, offset) { name = fdt_get_name(src, node, NULL);
- addr = fdtdec_get_addr_size_auto_noparent(src, node, - "reg", 0, &size, - false); + addr = fdtdec_get_addr_size_auto_parent(src, offset, node, + "reg", 0, &size, + false); if (addr == FDT_ADDR_T_NONE) { debug("failed to read address/size for %s\n", name); continue;
participants (2)
-
Atish Patra
-
Bin Meng