diff options
author | Marek Vasut <marek.vasut+renesas@mailbox.org> | 2024-03-02 23:54:02 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-03-13 12:40:43 -0400 |
commit | d545fe3b82ca319f699abb40f59f7ab5f8116de5 (patch) | |
tree | a5bd1bdd3e0a9c32f99b247bac5c4d6e89845ff3 /drivers/firmware/psci.c | |
parent | 213ffd49bdbd30512661eaf47b7445ef8a81bcdb (diff) |
fdt: Fix bootm_low handling
According to README CFG_SYS_BOOTMAPSZ section, in case both "bootm_low" and
"bootm_size" variables are defined, "bootm_mapsize" variable is not defined
and CFG_SYS_BOOTMAPSZ macro is not defined, all data for the Linux kernel
must be between "bootm_low" and "bootm_low" + "bootm_size".
Currently, for systems with DRAM between 0x4000_0000..0x7fff_ffff and with
e.g. bootm_low=0x60000000 and bootm_size=0x10000000, the code will attempt
to reserve memory from 0x4000_0000..0x4fff_ffff, which is incorrect. This
is because "bootm_low" is not taken into consideration correctly.
The last parameter of lmb_alloc_base() is the maximum physical address of
the to be reserved LMB area. Currently this is the start of DRAM bank that
is considered for LMB area reservation + min(DRAM bank size, bootm_size).
In case bootm_low is set to non-zero, this maximum physical address has to
be shifted upward, to min(DRAM bank start + size, bootm_low + bootm_size),
otherwise the reserved memory may be below bootm_low address.
In case of multiple DRAM banks, the current change reserves top part of
the first bank, and reserves the rest of memory in the follow up banks.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Diffstat (limited to 'drivers/firmware/psci.c')
0 files changed, 0 insertions, 0 deletions