Message ID | 20210910204718.17765-6-marek.vasut+renesas@gmail.com |
---|---|
State | Accepted |
Commit | c16de86ec0ac7dc208cd397eeb3f6bdf4406aad7 |
Delegated to: | Tom Rini |
Headers | show |
Series | [01/12] lmb: Always compile arch_lmb_reserve() into U-Boot on arm | expand |
On Fri, Sep 10, 2021 at 10:47:12PM +0200, Marek Vasut wrote: > This function is clearly architecture specific code, not board specific > code. The only difference from the previous arm arch_lmb_reserve() is the > extra reservation of 16k of memory below the stack bottom, rather than > the 4k. The common code now also uses 16k alignment. Remove this custom > implementation, as it now behaves exactly as the common code. > > Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> > Cc: Alexey Brodkin <alexey.brodkin@synopsys.com> > Cc: Angelo Dureghello <angelo@sysam.it> > Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> > Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> > Cc: Hai Pham <hai.pham.ud@renesas.com> > Cc: Michal Simek <monstr@monstr.eu> > Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> > Cc: Tom Rini <trini@konsulko.com> > Cc: Wolfgang Denk <wd@denx.de> > Cc: Ye Li <ye.li@nxp.com> Applied to u-boot/next, thanks!
diff --git a/arch/arm/mach-imx/misc.c b/arch/arm/mach-imx/misc.c index d82efa7f8f..09a758ff6e 100644 --- a/arch/arm/mach-imx/misc.c +++ b/arch/arm/mach-imx/misc.c @@ -77,33 +77,3 @@ int mxs_reset_block(struct mxs_register_32 *reg) return 0; } - -static ulong get_sp(void) -{ - ulong ret; - - asm("mov %0, sp" : "=r"(ret) : ); - return ret; -} - -void board_lmb_reserve(struct lmb *lmb) -{ - ulong sp, bank_end; - int bank; - - sp = get_sp(); - debug("## Current stack ends at 0x%08lx ", sp); - - /* adjust sp by 16K to be safe */ - sp -= 4096 << 2; - for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { - if (sp < gd->bd->bi_dram[bank].start) - continue; - bank_end = gd->bd->bi_dram[bank].start + - gd->bd->bi_dram[bank].size; - if (sp >= bank_end) - continue; - lmb_reserve(lmb, sp, bank_end - sp); - break; - } -}
This function is clearly architecture specific code, not board specific code. The only difference from the previous arm arch_lmb_reserve() is the extra reservation of 16k of memory below the stack bottom, rather than the 4k. The common code now also uses 16k alignment. Remove this custom implementation, as it now behaves exactly as the common code. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Alexey Brodkin <alexey.brodkin@synopsys.com> Cc: Angelo Dureghello <angelo@sysam.it> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Cc: Hai Pham <hai.pham.ud@renesas.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tom Rini <trini@konsulko.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Ye Li <ye.li@nxp.com> --- V2: Drop the custom implementation altogether --- arch/arm/mach-imx/misc.c | 30 ------------------------------ 1 file changed, 30 deletions(-)