summaryrefslogtreecommitdiff
path: root/common/fdt_support.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2018-02-15 19:05:59 +0100
committerTom Rini <trini@konsulko.com>2018-02-23 10:40:50 -0500
commited5af03f9bb8905f1e94d68ab49f22d7f061d75f (patch)
treeed1c83c6a1efcac0411a4239b9dabe6718aec57d /common/fdt_support.c
parent78b7d37b1b2b692b9e38780bdbae430b25202932 (diff)
fdt: Fixup only valid memory banks
Memory banks with address 0 and size 0 are empty and should not be passed to the OS via device tree. Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'common/fdt_support.c')
-rw-r--r--common/fdt_support.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index bd0478de40..b14853625f 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -447,6 +447,13 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
return err;
}
+ for (i = 0; i < banks; i++) {
+ if (start[i] == 0 && size[i] == 0)
+ break;
+ }
+
+ banks = i;
+
if (!banks)
return 0;