public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Fabio Estevam <festevam@gmail.com>
Cc: Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>,
	Marek Vasut <marex@denx.de>, Stefano Babic <sbabic@denx.de>
Subject: Re: Thoughts about U-boot binary size increase
Date: Thu, 28 Mar 2024 13:52:28 +0100	[thread overview]
Message-ID: <20240328135228.000c1e0d@wsk> (raw)
In-Reply-To: <CAOMZO5CKc_CGgzu3Xhba-FKN1svJt9V2if6yv3_sP7cjA-rPHg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2413 bytes --]

Hi Fabio,

> Hi Lukasz,
> 
> On Thu, Mar 28, 2024 at 6:20 AM Lukasz Majewski <lukma@denx.de> wrote:
> >
> > Dear Community,
> >
> > I'd like to share with you some thoughts about growth of u-boot's
> > binary size for SPL and u-boot proper.
> >
> > Board: XEA
> > SoC  : imx287 (still in active production)
> > Problem: SPL size constrained to ~55 KiB (This cannot be exceeded).
> >          Board design constraints u-boot proper size to less than
> > ~448 KiB
> >
> >
> > When XEA was added (2019.07):
> >         - u-boot.sb (SPL): 37 KiB
> >         - u-boot.img     : 401 KiB
> >
> > Now (2024.04):
> >         - u-boot.sb (SPL): 40 KiB
> >         - u-boot.img     : 427 KiB
> >
> > (With a _lot_ of effort put to reduce the size)
> >
> > Hence, the question - would it be possible to take more concern
> > about the binary size growth?
> >
> > Maybe CI could catch patches, which enable by default some features
> > and the size is unintentionally increased?
> >
> > I'm open for any feedback and thoughts on "stopping" the binary size
> > increase.  
> 
> In addition to adding CONFIG_BOARD_SIZE_LIMIT and
> CONFIG_SPL_SIZE_LIMIT checks, could you try the change below?
> 
> diff --git a/arch/arm/mach-imx/mxs/Kconfig
> b/arch/arm/mach-imx/mxs/Kconfig index d2e4205c5ce5..ee8c23d0e04f
> 100644 --- a/arch/arm/mach-imx/mxs/Kconfig
> +++ b/arch/arm/mach-imx/mxs/Kconfig
> @@ -32,6 +32,7 @@ if ARCH_MX28
> 
>  config MX28
>         bool
> +       select LTO
>         default y
> 
> I did a quick imx28_xea_defconfig build test here:
> 
> U-Boot mainline
> ---------------
> 
> $ ls -al u-boot.img
> -rw-rw-r-- 1 fabio fabio 444128 mar 28 09:11 u-boot.img
> 
> $ ls -al spl/u-boot-spl.bin
> -rwxrwxr-x 1 fabio fabio 39800 mar 28 09:12 spl/u-boot-spl.bin
> 
> 
> U-Boot mainline + LTO
> ---------------------
> 
> $ ls -al u-boot.img
> -rw-rw-r-- 1 fabio fabio 424144 mar 28 09:14 u-boot.img
> 
> $ ls -al spl/u-boot-spl.bin
> -rw-rw-r-- 1 fabio fabio 37664 mar 28 09:14 spl/u-boot-spl.bin

Thanks for the tip - I will check if enabling LTO is not causing any
regressions.


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2024-03-28 12:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28  9:20 Thoughts about U-boot binary size increase Lukasz Majewski
2024-03-28  9:40 ` Marek Vasut
2024-03-28 10:29   ` Lukasz Majewski
2024-03-28 12:18 ` Tom Rini
2024-03-28 12:55   ` Lukasz Majewski
2024-03-28 12:58     ` Tom Rini
2024-03-28 13:03       ` Lukasz Majewski
2024-03-28 12:18 ` Fabio Estevam
2024-03-28 12:52   ` Lukasz Majewski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240328135228.000c1e0d@wsk \
    --to=lukma@denx.de \
    --cc=festevam@gmail.com \
    --cc=marex@denx.de \
    --cc=sbabic@denx.de \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox