mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-23 07:31:32 +00:00
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>
This commit is contained in:
parent
78b7d37b1b
commit
ed5af03f9b
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue