[PATCH v2 14/32] lmb: introduce a function to add memory to the lmb memory map

Simon Glass sjg at chromium.org
Wed Aug 21 04:11:35 CEST 2024


Hi Sughosh,

On Tue, 20 Aug 2024 at 02:17, Sughosh Ganu <sughosh.ganu at linaro.org> wrote:
>
> On Fri, 16 Aug 2024 at 02:04, Simon Glass <sjg at chromium.org> wrote:
> >
> > Hi Sughosh,
> >
> > On Wed, 14 Aug 2024 at 12:01, Sughosh Ganu <sughosh.ganu at linaro.org> wrote:
> > >
> > > Introduce a function lmb_add_memory() to add available memory to the
> > > LMB memory map. Call this function during board init once the LMB data
> > > structures have been initialised.
> > >
> > > Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> > > ---
> > > Changes since V1:
> > > * Call the lmb_add_memory() from lmb_init() instead of
> > >   lmb_mem_regions_init().
> > >
> > >
> > >  include/lmb.h | 10 ++++++++++
> > >  lib/lmb.c     | 42 ++++++++++++++++++++++++++++++++++++++++++
> > >  2 files changed, 52 insertions(+)
> > >
> >
> > Reviewed-by: Simon Glass <sjg at chromium.org>
> >
> > But this should not be weak.
>
> This is being made weak, as there would be lmb_add_memory()
> definitions added for powerpc and x86 arch's in the EFI part of my
> patches. Moreover, the lmb_add_memory() function would be called even
> in the SPL stage when LMB is enabled for that stage. So I am not sure
> how do we get around this. You can check the relevant branch [1] on my
> github to check for the specific commits [2][3] that I am referring
> to. Thanks.

This is really strange.

The e820 is different on each x86 board. I'm not sure we want that in
the lmb. What is the purpose of that? It is somewhat circular in most
cases, since U-Boot sets it up itself. Where it comes from coreboot,
it looks like we are mirroring it in the EFI memory map. I'm not sure
I understand all this very well.

For fsl, perhaps copy the #ifdef and handle arch.resv_ram in your code?

[..]
Regards,
Simon


> [1] - https://github.com/sughoshg/u-boot/tree/lmb_efi_sep_apis_nrfc_next_v3
> [2] - https://github.com/u-boot/u-boot/commit/077ced7aaa6d495b1b87b324fb1c60658c203ce1
> [3] - https://github.com/u-boot/u-boot/commit/d0fa3a89865b796f3bbebffebbe4f7b5b048c140
>


More information about the U-Boot mailing list