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>
diff --git a/common/fdt_support.c b/common/fdt_support.c
index bd0478d..b148536 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -447,6 +447,13 @@
 		return err;
 	}
 
+	for (i = 0; i < banks; i++) {
+		if (start[i] == 0 && size[i] == 0)
+			break;
+	}
+
+	banks = i;
+
 	if (!banks)
 		return 0;