summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPranav Sanwal <[email protected]>2026-01-29 17:30:20 +0530
committerMichal Simek <[email protected]>2026-02-13 08:16:24 +0100
commit7105f8f2958b23823388ac4963caffeed5fe607c (patch)
tree54720f1ecf3bc6d50c6798f5eb76640d5bee2a78 /lib
parent350ca5a90ba012734f14a599665398810bc84449 (diff)
fdtdec: Add declaration for get_next_memory_node() helper
Add get_next_memory_node() function declaration to fdtdec.h to support iterating through multiple memory nodes in device tree. This function is used to enumerate memory banks when the system has non-contiguous or multiple memory regions defined with device_type = "memory". The function implementation already exists in lib/fdtdec.c (lines 1298-1305) but was missing the public declaration in the header file. This patch adds the declaration and includes dm/ofnode_decl.h for the ofnode type definition. This is needed for platforms that require early memory enumeration before standard fdtdec_setup_memory_banksize() is called, particularly for dynamic MMU page table size calculation based on actual DRAM configuration. Signed-off-by: Pranav Sanwal <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib')
-rw-r--r--lib/fdtdec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index c38738b48c7..3779076377f 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1083,7 +1083,7 @@ int fdtdec_setup_mem_size_base(void)
return 0;
}
-ofnode get_next_memory_node(ofnode mem)
+static ofnode get_next_memory_node(ofnode mem)
{
do {
mem = ofnode_by_prop_value(mem, "device_type", "memory", 7);
@@ -1092,6 +1092,11 @@ ofnode get_next_memory_node(ofnode mem)
return mem;
}
+ofnode fdtdec_get_next_memory_node(ofnode mem)
+{
+ return get_next_memory_node(mem);
+}
+
int fdtdec_setup_memory_banksize(void)
{
int bank, ret, reg = 0;