[PATCH] lib: fdt: Introduce fdtdec_setup_mem_size_base_lowest()

Simon Glass sjg at chromium.org
Fri Jul 10 02:35:09 CEST 2020


Hi Michal,

On Thu, 9 Jul 2020 at 07:02, Michal Simek <michal.simek at xilinx.com> wrote:
>
> New function should be called from board dram_init() because it initialized
> gd->ram_base/ram_size. It finds the lowest available memory.
>
> On systems with multiple memory nodes finding out the first memory node by
> fdtdec_setup_mem_size_base() is not enough because this memory can be above
> actual U-Boot VA mapping. Currently only mapping till 39bit is supported
> (Full 44bit mapping was removed by commit 7985cdf74b28 ("arm64: Remove
> non-full-va map code")).
> If DT starts with the first memory node above 39bit address then system can
> be unpredictable.
>
> The function is available only when multiple memory bank support is
> enabled.
>
> Calling fdtdec_setup_memory_banksize() from dram_init() is not possible
> because fdtdec_setup_memory_banksize() is saving dram information to bd
> structure which is placed on stack but not initialized at this time. Also
> stack is placed at location setup in dram_init().
>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
> ---
>
>  board/xilinx/versal/board.c |  2 +-
>  include/fdtdec.h            | 17 ++++++++++++++
>  lib/fdtdec.c                | 44 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 62 insertions(+), 1 deletion(-)

This should move over to the livetree API (using ofnode) and please
add a little test. We should be trying to retire fdtdec. Probably
should split the xilinx patch separately too.

Regards,
Simon


More information about the U-Boot mailing list