[PATCH v3 1/6] lmb: replace lmb_reserve() and lmb_alloc_addr() API's
Sughosh Ganu
sughosh.ganu at linaro.org
Fri May 30 11:58:16 CEST 2025
On Fri, 30 May 2025 at 13:02, Ilias Apalodimas
<ilias.apalodimas at linaro.org> wrote:
>
> Hi Sughosh
>
> [...]
>
>
> > /*
> > * Handle the BOOTM_STATE_FINDOTHER state ourselves as we do not
> > diff --git a/cmd/load.c b/cmd/load.c
> > index 899bb4f598e..c3ef307bb68 100644
> > --- a/cmd/load.c
> > +++ b/cmd/load.c
> > @@ -178,8 +178,11 @@ static ulong load_serial(long offset)
> > #endif
> > {
> > void *dst;
> > + phys_addr_t addr;
>
> addr is already defined as ulong in this function. You need a
> different name here.
Oh yes, I can use a different name. Although this should not be an
issue as the variable being added would be relevant only for the
encompassing block, where the other variable is not being used. But
this is definitely confusing, and I will change the name of the
variable.
> But on that why can't you use store_addr directly?
store_addr is of type ulong, and that results in a warning since the
API expects the address to be of type phys_addr_t. Typecasting it to a
void pointer does not help as we have at least one architecture
(riscv32) where the ulong will be 4 bytes, and the phys_addr_t has
been defined to be a 64 bit value.
-sughosh
>
> >
> > - ret = lmb_reserve(store_addr, binlen, LMB_NONE);
> > + addr = (phys_addr_t)store_addr;
> > + ret = lmb_alloc_mem(LMB_MEM_ALLOC_ADDR, 0, &addr,
> > + binlen, LMB_NONE);
> > if (ret) {
> > printf("\nCannot overwrite reserved area (%08lx..%08lx)\n",
> > store_addr, store_addr + binlen);
>
> [...]
>
> Thanks
> /Ilias
More information about the U-Boot
mailing list