mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-21 22:23:05 +00:00
kboot: Postpone setting of /memory
Postpone the setting of the /memory node so that any allocations made in course of the devicetree prep (e.g. the SIO reservations allocated from the top of memory) are reflected in the usable memory span that's set on the /memory node. Signed-off-by: Martin Povišer <povik@cutebit.org>
This commit is contained in:
parent
9f12d5b3ff
commit
94cf41e124
1 changed files with 8 additions and 2 deletions
10
src/kboot.c
10
src/kboot.c
|
@ -2071,8 +2071,6 @@ int kboot_prepare_dt(void *fdt)
|
|||
return -1;
|
||||
if (dt_set_serial_number())
|
||||
return -1;
|
||||
if (dt_set_memory())
|
||||
return -1;
|
||||
if (dt_set_cpus())
|
||||
return -1;
|
||||
if (dt_set_mac_addresses())
|
||||
|
@ -2108,6 +2106,14 @@ int kboot_prepare_dt(void *fdt)
|
|||
return 1;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set the /memory node late since we might be allocating from the top of memory
|
||||
* in one of the above devicetree prep functions, and we want an up-to-date value
|
||||
* for the usable memory span to make it into the devicetree.
|
||||
*/
|
||||
if (dt_set_memory())
|
||||
return -1;
|
||||
|
||||
if (fdt_pack(dt))
|
||||
bail("FDT: fdt_pack() failed\n");
|
||||
|
||||
|
|
Loading…
Reference in a new issue