[PATCH v4 05/15] lmb: notify of any changes to the LMB memory map

Sughosh Ganu sughosh.ganu at linaro.org
Mon Jan 20 10:10:38 CET 2025


On Fri, 17 Jan 2025 at 16:40, Alexander Dahl <ada at thorsis.com> wrote:
>
> Hei hei,
>
> Am Tue, Oct 15, 2024 at 09:07:07PM +0530 schrieb Sughosh Ganu:
> > In U-Boot, LMB and EFI are two primary modules who provide memory
> > allocation and reservation API's. Both these modules operate with the
> > same regions of memory for allocations. Use the LMB memory map update
> > event to notify other interested listeners about a change in it's
> > memory map. This can then be used by the other module to keep track of
> > available and used memory.
> >
> > There is no need to send these notifications when the LMB module is
> > being unit-tested. Add a flag to the lmb structure to indicate if the
> > memory map is being used for tests, and suppress sending any
> > notifications when running these unit tests.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> > ---
> > Changes since V3:
> > * Drop use of is_addr_in_ram() function
> > * Drop use of CONFIG_MEM_MAP_UPDATE_NOTIFY symbol to check if the
> >   notification needs to be sent.
> > * s/lmb_notify/lmb_should_notify
> > * Put a check for EFI_LOADER in the lmb_should_notify() function
>
> This changeset breaks build with CONFIG_CC_OPTIMIZE_FOR_DEBUG=y for
> me.  In a usual non-debug build, everything is fine.  However in a
> debug build now I get this error:
>
>       UPD     include/generated/timestamp_autogenerated.h
>       GEN     Makefile
>       Using /mnt/data/adahl/src/u-boot as source for U-Boot
>       CC      common/version.o
>       AR      common/built-in.o
>       LD      u-boot
>     arm-v5te-linux-gnueabi-ld.bfd: lib/lmb.o: in function `lmb_map_update_notify':
>     /mnt/data/adahl/src/u-boot/lib/lmb.c:458: undefined reference to `efi_add_memory_map_pg'

Can you share the details of the toolchain that you are using, where
can I download it from. And the target that you build which shows this
up. Thanks.

-sughosh

>
> My tree is based on v2025.01 release.  lib/lmb.c is built because …
>
>   │   Selected by [y]:
>   │   - SYS_BOOT_RAMDISK_HIGH [=y] && (CMD_BOOTM [=y] || CMD_BOOTI [=n] || CMD_BOOTZ [=y]) && !NIOS2 [=n] && !SANDBOX [=n] && !SH [=n] && !XTENSA [=n]
>   │   Selected by [n]:
>   │   - EFI_LOADER [=n] && OF_LIBFDT [=y] && (ARM [=y] && (SYS_CPU [=arm926ejs]=arm1136 || SYS_CPU [=arm926ejs]=arm1176 || …
>
> So as you can see EFI_LOADER is disabled, because I don't need to run
> UEFI applications on my armv5te SoC (Microchip sam9x60).
> CMD_BOOTZ is enabled, because I boot a Linux kernel.
>
> I can not enable EFI_LOADER however, because there's nothing in the
> long list of "depends on" which is or can be satified on my target.
>
> I would really appreciate to be able to use a debug build again,
> please advice!
>
> Greets
> Alex
>


More information about the U-Boot mailing list