summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorBin Meng <bin.meng@windriver.com>2020-06-25 12:36:39 +0300
committerAnup Patel <anup@brainfault.org>2020-07-06 11:35:29 +0300
commita5f9104330353491fc6c0fdb42262543d39518d9 (patch)
tree99d591a355406b1230da7bd8378d84d401f240ac /lib/utils
parent7d61a687755323989a35d6ba88d333cb006bab4a (diff)
downloadopensbi-a5f9104330353491fc6c0fdb42262543d39518d9.tar.xz
lib/utils: fdt: Update FDT expand size to 1024 for reserved memory node
Currently 256 bytes is used for the FDT expand size when fixing up reserved memory node. Increase it to 1024 bytes with an estimated size of 64 bytes per PMP memory region by 16 regions in total. Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/fdt/fdt_fixup.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/utils/fdt/fdt_fixup.c b/lib/utils/fdt/fdt_fixup.c
index adf1be3..a3bccae 100644
--- a/lib/utils/fdt/fdt_fixup.c
+++ b/lib/utils/fdt/fdt_fixup.c
@@ -151,8 +151,14 @@ int fdt_reserved_memory_fixup(void *fdt)
int na = fdt_address_cells(fdt, 0);
int ns = fdt_size_cells(fdt, 0);
- /* expand the device tree to accommodate new node */
- err = fdt_open_into(fdt, fdt, fdt_totalsize(fdt) + 256);
+ /*
+ * Expand the device tree to accommodate new node
+ * by the following estimated size:
+ *
+ * Each PMP memory region entry occupies 64 bytes.
+ * With 16 PMP memory regions we need 64 * 16 = 1024 bytes.
+ */
+ err = fdt_open_into(fdt, fdt, fdt_totalsize(fdt) + 1024);
if (err < 0)
return err;