Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FACFC4338F for ; Sun, 15 Aug 2021 19:47:28 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4950661246 for ; Sun, 15 Aug 2021 19:47:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4950661246 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C476A80612; Sun, 15 Aug 2021 21:47:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="TW4EtOJq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 16BE5821F0; Sun, 15 Aug 2021 21:47:23 +0200 (CEST) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EE6E780608 for ; Sun, 15 Aug 2021 21:47:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x832.google.com with SMTP id z24so12707972qtn.8 for ; Sun, 15 Aug 2021 12:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jeM0l8Dbf2SCyOGhs44vUNrj10bCayh/CQAJOZVy3SE=; b=TW4EtOJqby6oul4Ew43az5CD2V8m+PimDVwdsXewH/k6ow1GbmL5r8VykhOOGMbQkd Nf+bkxlD5FEvORLV2NqJRtKN5azJXoCGcKiQmLAIcZOsc+nNSxEF4f5Ior3szXkotTW4 dIGO7RNjmu6GTYmF0KKGz+aw55mb4tXokbhmc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jeM0l8Dbf2SCyOGhs44vUNrj10bCayh/CQAJOZVy3SE=; b=pH8ctV3XmmLIbMoA8ylGXLMnncbmDybw0rXh1zLPI17r9FZ6pptAdFdwGENpHL0B7+ 7dI/Wguguzq0HlYVDTJOum6xKLzMBfnz2+vP91qdYWgx9nwveHPHmCWg/DAOzrLK13WT LkkZldqKTr+CqbdYgRSxps0AgL9YugBdrjT3OFOgrfXKYDm5KZ88lHFRo9I9mUHwl7RA oGcBaHP1WVRlF/bY+5bWAQVAVl09K6UyzITJrUT0pUdIlzXAxrcRX9Z1CzlrXmh13eAs 8/JJZQtyir8/rY3mcY4KLuZEf5lNQ5khFLhSnleOwQ7db7eGX+GANRDF6FrFhAP5yUYR eg+A== X-Gm-Message-State: AOAM530wRZRTbkde5BqJYwcVul8JsK8Mhdl6g0Uv2R3Ag4YM0QAluXlk uZbcDlqUZxp2XXlAIYMKKLBypQ== X-Google-Smtp-Source: ABdhPJzDLrLFxnanR7+smh9lxC2OSwRe9QKc9P4+AKRgIsLeG1iqAfC2dkBSgARBnqgoXoc555O3Ow== X-Received: by 2002:ac8:5e4c:: with SMTP id i12mr11059243qtx.267.1629056836750; Sun, 15 Aug 2021 12:47:16 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-6085-4c50-20fd-dcb7.res6.spectrum.com. [2603:6081:7b01:cbda:6085:4c50:20fd:dcb7]) by smtp.gmail.com with ESMTPSA id l13sm849764qtr.67.2021.08.15.12.47.15 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 15 Aug 2021 12:47:15 -0700 (PDT) Date: Sun, 15 Aug 2021 15:47:13 -0400 From: Tom Rini To: Marek Vasut Cc: u-boot@lists.denx.de, Marek Vasut , Alexey Brodkin , Angelo Dureghello , Daniel Schwierzeck , Eugeniy Paltsev , Hai Pham , Michal Simek , Simon Goldschmidt , Wolfgang Denk , Ye Li Subject: Re: [PATCH 14/14] lmb: Switch imx board_lmb_reserve() to arch_lmb_reserve() Message-ID: <20210815194713.GM858@bill-the-cat> References: <20210815181314.132330-1-marek.vasut+renesas@gmail.com> <20210815181314.132330-14-marek.vasut+renesas@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cO/GqTdnHauCmbNY" Content-Disposition: inline In-Reply-To: <20210815181314.132330-14-marek.vasut+renesas@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --cO/GqTdnHauCmbNY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 15, 2021 at 08:13:14PM +0200, Marek Vasut wrote: > This function is clearly architecture specific code, not board specific > code. The only difference from the generic arm arch_lmb_reserve() is the > extra reservation of 16k of memory below the stack bottom, rather than > the default 4k. Switch this from board_lmb_reserve() to arch_lmb_reserve() > and use arch_lmb_reserve_generic() with 16k stack reservation parameter > instead of replicating older version of arch_lmb_reserve() here. >=20 > Signed-off-by: Marek Vasut > Cc: Alexey Brodkin > Cc: Angelo Dureghello > Cc: Daniel Schwierzeck > Cc: Eugeniy Paltsev > Cc: Hai Pham > Cc: Michal Simek > Cc: Simon Goldschmidt > Cc: Tom Rini > Cc: Wolfgang Denk > Cc: Ye Li > --- > arch/arm/mach-imx/misc.c | 21 ++------------------- > 1 file changed, 2 insertions(+), 19 deletions(-) >=20 > diff --git a/arch/arm/mach-imx/misc.c b/arch/arm/mach-imx/misc.c > index d82efa7f8f..529601156f 100644 > --- a/arch/arm/mach-imx/misc.c > +++ b/arch/arm/mach-imx/misc.c > @@ -86,24 +86,7 @@ static ulong get_sp(void) > return ret; > } > =20 > -void board_lmb_reserve(struct lmb *lmb) > +void arch_lmb_reserve(struct lmb *lmb) > { > - ulong sp, bank_end; > - int bank; > - > - sp =3D get_sp(); > - debug("## Current stack ends at 0x%08lx ", sp); > - > - /* adjust sp by 16K to be safe */ > - sp -=3D 4096 << 2; > - for (bank =3D 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { > - if (sp < gd->bd->bi_dram[bank].start) > - continue; > - bank_end =3D gd->bd->bi_dram[bank].start + > - gd->bd->bi_dram[bank].size; > - if (sp >=3D bank_end) > - continue; > - lmb_reserve(lmb, sp, bank_end - sp); > - break; > - } > + arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 16384); > } As I previously said, this should be the generic ARM one. And arguably all device-tree using architectures should give themselves more headroom here, based on the additional context we got. Calling the iMX entry the arch one is wrong. If we don't want to address the general problem more, we should keep this as a board one that reserves an additional 12KiB. --=20 Tom --cO/GqTdnHauCmbNY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEZbz0ACgkQFHw5/5Y0 tyygkgv/co+lKVwnKIWLCGGygqEhIv5PsNl8GpN8Am3Rc2oCOpINaNawqywBxFAn pW0kOOEMusygpJGeztE3y1O/9Noaruib69pwZb69uR7OoZKvdeCdsbm/LuArP2Gf EZHYoUYe94KYnchYuX7o4s4beEkVSA41hMR6xEold6/HiOGEC/PI32a9l3pE+o6c V3O9uuRou34ZtKkIUfSVrrIlrHTqiBgZf7wUv9Nvc6O04sEG/E45A212DIEZMb0F k0scPggT1P/tPFX0kWiaDvLm2ZsuwTPWRLLKIadK9+vSkExWI2dgWjE5yvb/xij+ iYXkCCmnHNkmQKu1v6cqPEzB9tz0i11fnZQYchDs1b4A/WmorEr2Bx3dFUdSDht1 KyKJ56bF3GG6E4hr2QZtrADZ2QJSEkVVf9D1RVxcURii1MNzv+VAB2Fff8rHjhtt se9meCqiR0HOmk9mAQLDmG6DjY9WyrdR7HFBo9HkK9LNIKVNWlZ7Lx3KpXf8/Bps ZrQfCnlr =DCaB -----END PGP SIGNATURE----- --cO/GqTdnHauCmbNY--