[PATCH v2 18/32] lmb: add a common implementation of arch_lmb_reserve()

Sughosh Ganu sughosh.ganu at linaro.org
Fri Aug 16 13:26:12 CEST 2024


On Fri, 16 Aug 2024 at 02:04, Simon Glass <sjg at chromium.org> wrote:
>
> Hi Sughosh,
>
> On Wed, 14 Aug 2024 at 12:02, Sughosh Ganu <sughosh.ganu at linaro.org> wrote:
> >
> > Almost all of the current definitions of arch_lmb_reserve() are doing
> > the same thing. The only exception in a couple of cases is the
> > alignment parameter requirement. Have a generic weak implementation of
> > this function, keeping the highest value of alignment that is being
> > used(16K).
> >
> > Also, instead of using the current value of stack pointer for starting
> > the reserved region, have a fixed value, considering the stack size
> > config value.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> > ---
> > Changes since V1: None
> >
> >  arch/arc/lib/cache.c        | 14 --------------
> >  arch/arm/lib/stack.c        | 14 --------------
> >  arch/m68k/lib/bootm.c       | 17 -----------------
> >  arch/microblaze/lib/bootm.c | 14 --------------
> >  arch/mips/lib/bootm.c       | 15 ---------------
> >  arch/nios2/lib/bootm.c      | 13 -------------
> >  arch/powerpc/lib/bootm.c    | 13 +++----------
> >  arch/riscv/lib/bootm.c      | 13 -------------
> >  arch/sh/lib/bootm.c         | 13 -------------
> >  arch/x86/lib/bootm.c        | 18 ------------------
> >  arch/xtensa/lib/bootm.c     | 13 -------------
> >  lib/lmb.c                   |  6 +++++-
> >  12 files changed, 8 insertions(+), 155 deletions(-)
>
> Rather than a weak function, can you put the extra ppc code into your
> generic function, behind an #ifdef or whatever. We don't want it to
> diverge again.

I am attempting to implement this in a slightly different manner, by
moving the ppc specific code to arch_misc_init() instead, and doing
away with arch_lmb_reserve() and board_lmb_reserve(). Thanks.

-sughosh

>
> Regards,
> Simon


More information about the U-Boot mailing list