U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Soeren Moch <smoch@web.de>
To: Maxim Uvarov <maxim.uvarov@linaro.org>
Cc: Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de, pbrobinson@gmail.com,
	ilias.apalodimas@linaro.org, goldsimon@gmx.de
Subject: Re: [PATHv11 26/43] configs/tbs2910_defconfig inc limit
Date: Tue, 5 Dec 2023 19:25:15 +0100	[thread overview]
Message-ID: <b47859ca-36d3-4eee-88fb-f7859e69ff2d@web.de> (raw)
In-Reply-To: <CAD8XO3bYyfDVnVQdcqDji39Y=i1Q2jdG-SQ6KUWsBPo0umoZnQ@mail.gmail.com>



On 05.12.23 17:25, Maxim Uvarov wrote:
>
>
> On Tue, 5 Dec 2023 at 21:49, Soeren Moch <smoch@web.de> wrote:
>
>     On 05.12.23 14:15, Maxim Uvarov wrote:
>>     I think I solved the size issue on all the boards.
>>
>>     Key changes:
>>     1. remove compilation of original ping.c and tftp.c (tftp had
>>     also server code, so I will partially bring it back.)
>     Interesting.
>     @Tom: Is there other server code in u-boot, that is enabled by
>     default (and can be used to reclaim code space)?
>     Fur sure I do not need u-boot to act as server for tftp (maye nfs,
>     others).
>
>
> Maybe I need to be more clear about this. reference to code from
> tftp.c and ping.c exist in net.c, test/image/spl_load_net.c,
> test.dm/dsa.c <http://test.dm/dsa.c>, test/dm/eth.c.
> And even if that code is not used (replaced with lwip calls to the
> same commands in my case) it adds additional size. Even enabled LTO
> does not see
> direct difference.
So 'server code' does not mean u-boot acting as network server, you mean
this code is referenced by something else? And things in test do
increase image size?
>
>>     2. LTO=y
>>     3. CONFIG_LOGLEVEL=3 instead of 4.
>>     4. CONFIG_CMD_DATE is not set
>>     5. CONFIG_CMD_LICENSE is not set
>>     6. CONFIG_CMD_PING (if 1-6 did not help).
>>
>>     And these changes were enough for CI tagrets to build.
>>     I also tested that Raspberry PI 4B works fine (dhcp, ping).
>>     Looking for other boards to test.
>>
>>     For example for this tbs2910 board changes are:
>     Disabling CMD_DATE is unfortunate. This can help to debug RTC
>     problems (already used it for this purpose).
>     And, if we are that close to the size limit, than maybe we can get
>     away for this series, but for sure will run into trouble for every
>     other small change to u-boot core/driver code.
>
>     Regards,
>     Soeren
>
>
> The problem is that for many targets the limit is 1MB.
For tbs2910 it is 383kBytes. And there was plenty of free space when I
introduced mainline u-boot support. But yes, space got tighter over time.
> U-Boot in some minimal configuration is about 500kb. But U-boot with
> EFI, USB, Eth drivers,  MMC, RTC, and all the commands is 900+ kb and
> very close to 1MB. Most of the new features are enabled by default.
No. Tom does a very good job to ensure that there is no (not much)
additional space required for unrelated boards that do not need new
features.
> I.e. they do not exist in _defconfig and appear in the resulting
> .config automatically.  I would say that for some small targets things
> like EFI, Secure boot, TPM, Updates and many others are not needed.
> But if new features will appear by default very soon we will see limits.
New features will not be enabled for old space constrained boards. In
your series you did not offer to keep the old implementation instead,
this is different and the reason why we discuss image size constraints.

Regards,
Soeren
>
> BR,
> Maxim.
>
>>
>>     --- a/configs/tbs2910_defconfig
>>     +++ b/configs/tbs2910_defconfig
>>     @@ -18,6 +18,7 @@ CONFIG_SYS_MEMTEST_END=0x2f400000
>>      CONFIG_LTO=y
>>      CONFIG_HAS_BOARD_SIZE_LIMIT=y
>>      CONFIG_BOARD_SIZE_LIMIT=392192
>>     +CONFIG_TIMESTAMP=y (this was added by savedefconfig)
>>      # CONFIG_BOOTSTD is not set
>>      CONFIG_SUPPORT_RAW_INITRD=y
>>      CONFIG_BOOTDELAY=3
>>     @@ -26,6 +27,7 @@ CONFIG_BOOTCOMMAND="mmc rescan; if run
>>     bootcmd_up1; then run bootcmd_up2; else r
>>      CONFIG_USE_PREBOOT=y
>>      CONFIG_PREBOOT="echo PCI:; pci enum; pci 1; usb start"
>>      CONFIG_DEFAULT_FDT_FILE="imx6q-tbs2910.dtb"
>>     +CONFIG_LOGLEVEL=3
>>      CONFIG_PRE_CONSOLE_BUFFER=y
>>      CONFIG_HUSH_PARSER=y
>>      CONFIG_SYS_PROMPT="Matrix U-Boot> "
>>     @@ -52,7 +54,7 @@ CONFIG_CMD_DHCP=y
>>      CONFIG_CMD_MII=y
>>      CONFIG_CMD_PING=y
>>      CONFIG_CMD_CACHE=y
>>     -CONFIG_CMD_TIME=y
>>     +# CONFIG_CMD_DATE is not set
>>      CONFIG_CMD_SYSBOOT=y
>>      # CONFIG_CMD_VIDCONSOLE is not set
>>      CONFIG_CMD_EXT2=y
>>
>>     BR,
>>     Maxim.
>>
>>
>>     On Tue, 28 Nov 2023 at 13:09, Maxim Uvarov
>>     <maxim.uvarov@linaro.org> wrote:
>>
>>
>>
>>         On Tue, 28 Nov 2023 at 03:20, Soeren Moch <smoch@web.de> wrote:
>>
>>             On 27.11.23 14:11, Tom Rini wrote:
>>             > On Mon, Nov 27, 2023 at 06:57:09PM +0600, Maxim Uvarov
>>             wrote:
>>             >
>>             >> Increase allowed binary size to fit lwip code.
>>             >>
>>             >> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>>             >> ---
>>             >>   configs/tbs2910_defconfig | 2 +-
>>             >>   1 file changed, 1 insertion(+), 1 deletion(-)
>>             >>
>>             >> diff --git a/configs/tbs2910_defconfig
>>             b/configs/tbs2910_defconfig
>>             >> index 8fbe84f1d2..ce40efa9ab 100644
>>             >> --- a/configs/tbs2910_defconfig
>>             >> +++ b/configs/tbs2910_defconfig
>>             >> @@ -17,7 +17,7 @@ CONFIG_SYS_MEMTEST_START=0x10000000
>>             >>   CONFIG_SYS_MEMTEST_END=0x2f400000
>>             >>   CONFIG_LTO=y
>>             >>   CONFIG_HAS_BOARD_SIZE_LIMIT=y
>>             >> -CONFIG_BOARD_SIZE_LIMIT=392192
>>             >> +CONFIG_BOARD_SIZE_LIMIT=417792
>>             >>   # CONFIG_BOOTSTD is not set
>>             >>   CONFIG_SUPPORT_RAW_INITRD=y
>>             >>   CONFIG_BOOTDELAY=3
>>             > This is another case where the binary size is a fairly
>>             hard limit. You
>>             > forgot to cc the board maintainer here (and I assume
>>             the rest of the
>>             > series too) for these config changes.
>>             ThanksTom for sending a notification to me.
>>
>>             Yes, the CONFIG_BOARD_SIZE_LIMIT is a hard limit and this
>>             patch in its
>>             current form will break tbs2910 support and even brick
>>             the board for
>>             some configurations. So NAK for this patch.
>>             > I think on this platform it's not
>>             > impossible (like it is on am335x where I just replied)
>>             but really
>>             > difficult. I'll let Soeren comment on if switching the
>>             network stack to
>>             > lwip is the kind of feature enhancement that warrants
>>             the pain of
>>             > dealing with the size change here or not.
>>             Network boot is no important feature for this board and
>>             not used in
>>             the default boot configuration. But network support
>>             always was part
>>             of the config, may be used by some users, and is at least
>>             required
>>             to communicate the ethernet address to linux.
>>
>>             So I'm not interested in a new network stack for this
>>             board, but
>>             also cannot disable network support completely. This
>>             seems to be a
>>             problem for this patch series, since networking support
>>             implies LWIP
>>             now.
>>
>>
>>         Thanks Soeren for the explanation. Then yes, something more
>>         advanced is needed
>>         to be done here.
>>
>>             The question for me is, why is the new network stack
>>             consuming so
>>             much space, with only a few enabled commands? Is the
>>             whole library
>>             linked in with some unused features (the cover letter
>>             mentions much
>>             more than what seems to be used in the converted
>>             commands). Or is
>>             the old network stack linked in in parallel to the new
>>             one? Can
>>             we save space here?
>>
>>
>>         Yes, the old code is still there. I decided to not touch it
>>         for the first integration (arp.o, bootp.o, ping.o and
>>         mostly all from net/Makefile).  Those files also have
>>         reference code in net/net.c. Not compiling
>>         and not linking this code will save some space, but It's
>>         larger than the current version.
>>         Like for EVM SPL code with usb+net+ext4 and etc have very
>>         minimal space for network stack.
>>         I will take a look at this more closely...
>>
>>
>>             NFS support in the old networking code is quite big,
>>             enabled by default,
>>             and probably still there in parallel to this new lwip
>>             library. If there
>>             is really no other option to save space, and lwip in
>>             general is agreed
>>             to be the way forward for U-Boot, and only tbs2910 is
>>             blocking that,
>>             then from my point of view disabling NFS for tbs2910
>>             could be a way
>>             to stay within the size limit.
>>
>>         ok. I think that by default we need something very minimal
>>         (dhcp, tftp),  probably ping is even not needed.
>>
>>             Regards,
>>             Soeren
>>
>

  reply	other threads:[~2023-12-05 18:25 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 12:56 [PATHv11 00/43] net/lwip: add lwip library for the network stack Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 01/43] submodule: add lwIP as git submodule Maxim Uvarov
2023-11-27 18:16   ` Tom Rini
2023-11-30  2:45     ` Simon Glass
2023-11-30 11:43       ` Michal Suchánek
2023-11-27 12:56 ` [PATHv11 02/43] net/lwip: add doc/develop/net_lwip.rst Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 03/43] net/lwip: integrate lwIP library Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 04/43] net/lwip: implement dns cmd Maxim Uvarov
2023-11-27 18:27   ` Tom Rini
2023-11-27 12:56 ` [PATHv11 05/43] net/lwip: implement dhcp cmd Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 06/43] net/lwip: implement tftp cmd Maxim Uvarov
2023-11-28 16:34   ` neil.armstrong
2023-11-28 19:09     ` Maxim Uvarov
2023-11-29  9:24   ` neil.armstrong
2023-11-27 12:56 ` [PATHv11 07/43] net/lwip: implement wget cmd Maxim Uvarov
2023-11-28 11:32   ` Fabio Estevam
2023-11-28 19:07     ` Maxim Uvarov
2023-11-28 19:12       ` Fabio Estevam
2023-11-28 20:41         ` Tim Harvey
2023-11-28 20:43           ` Tom Rini
2023-11-29  7:18             ` Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 08/43] net/lwip: implement ping cmd Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 09/43] net/lwip: add lwIP configuration Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 10/43] net/lwip: implement lwIP port to U-Boot Maxim Uvarov
2023-11-27 18:31   ` Tom Rini
2023-11-27 12:56 ` [PATHv11 11/43] net/lwip: update .gitignore with lwIP Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 12/43] net/lwip: connection between cmd and lwip apps Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 13/43] net/lwip: replace original net commands with lwip Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 14/43] net/lwip: split net.h to net.h, arp.h and eth.h Maxim Uvarov
2023-11-27 12:56 ` [PATHv11 15/43] test_efi_loader.py: use $filesize var Maxim Uvarov
2023-11-27 18:18   ` Tom Rini
2023-11-28 11:05     ` neil.armstrong
2023-11-27 12:56 ` [PATHv11 16/43] test_net: print out net list Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 17/43] net: sandbox: fix NULL pointer derefences Maxim Uvarov
2023-11-27 18:19   ` Tom Rini
2023-12-02 18:33     ` Simon Glass
2023-12-02 19:04       ` Tom Rini
2023-11-27 12:57 ` [PATHv11 18/43] net/smc911x: fix return from smc911x_send Maxim Uvarov
2023-11-27 18:20   ` Tom Rini
2023-11-27 12:57 ` [PATHv11 19/43] sandbox: eth-raw-os: successful return code is 0 Maxim Uvarov
2023-11-30  2:45   ` Simon Glass
2023-11-27 12:57 ` [PATHv11 20/43] driver/net/rtl8139: remove debug print Maxim Uvarov
2023-11-27 18:33   ` Tom Rini
2023-11-27 12:57 ` [PATHv11 21/43] mach-socfpga: do not overlap defines with lwip Maxim Uvarov
2023-11-27 18:35   ` Tom Rini
2023-11-27 12:57 ` [PATHv11 22/43] bcm_ns3: fix overlap define " Maxim Uvarov
2023-11-27 18:36   ` Tom Rini
2023-11-27 12:57 ` [PATHv11 23/43] rcar3_salvator-x_defconfig: increase binary size limit Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 24/43] lwip: omap3: rename mem_init Maxim Uvarov
2023-11-27 13:12   ` Tom Rini
2023-11-27 12:57 ` [PATHv11 25/43] configs/turris_omnia_defconfig set limit to 0xf6000 Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 26/43] configs/tbs2910_defconfig inc limit Maxim Uvarov
2023-11-27 13:11   ` Tom Rini
2023-11-27 21:20     ` Soeren Moch
2023-11-28  7:09       ` Maxim Uvarov
2023-12-05 13:15         ` Maxim Uvarov
2023-12-05 15:49           ` Soeren Moch
2023-12-05 16:25             ` Maxim Uvarov
2023-12-05 18:25               ` Soeren Moch [this message]
2023-12-05 20:00                 ` Maxim Uvarov
2023-12-06  7:06                   ` Soeren Moch
2023-12-06 10:40                     ` Maxim Uvarov
2023-12-07 11:10                       ` Sören Moch
2023-12-09 20:32                 ` Tom Rini
2023-12-09 20:21             ` Tom Rini
2023-11-27 12:57 ` [PATHv11 27/43] configs/socfpga_secu1_defconfig: enable LTO Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 28/43] configs/turris_omnia_defconfig: " Maxim Uvarov
2023-11-27 15:59   ` marek.behun
2023-12-19  9:38   ` Marek Behún
2023-12-19 14:37     ` Marek Behún
2023-11-27 12:57 ` [PATHv11 29/43] configs/am335x_boneblack_vboot_defconfig: enable LTO and increase SPL size Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 30/43] configs/sheevaplug_defconfig: enable LTO and inc size Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 31/43] configs/lschlv2_defconfig: " Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 32/43] configs/lsxhl_defconfig: LTO + size Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 33/43] configs/am335x_evm_defconfig: inc SPL size Maxim Uvarov
2023-11-27 13:08   ` Tom Rini
2023-11-27 14:06     ` Maxim Uvarov
2023-11-27 14:08       ` Tom Rini
2023-11-27 15:31         ` Maxim Uvarov
2023-11-27 15:33           ` Tom Rini
2023-11-27 15:52           ` Peter Robinson
2023-11-27 16:31             ` Tom Rini
2023-11-28  9:35               ` Maxim Uvarov
2023-11-28 15:07                 ` Tom Rini
2023-11-27 14:06     ` Peter Robinson
2023-11-27 12:57 ` [PATHv11 34/43] configs/bk4r1_defconfig: inc size Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 35/43] configs/linkit-smart-7688_defconfig: increse size Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 36/43] configs/gardena-smart-gateway-mt7688_defconfig: increase size Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 37/43] configs/rcar3_ulcb_defconfig: " Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 38/43] configs/qemu-x86_64_defconfig: increase ROM size Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 39/43] Makefile: add dtbs to clean Maxim Uvarov
2023-11-27 18:17   ` Tom Rini
2023-11-27 12:57 ` [PATHv11 40/43] .azure-pipelines: init submodules Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 41/43] mach-mtmips: inc SPL size limit Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 42/43] configs/linkit-smart-7688_defconfig: increase board limit Maxim Uvarov
2023-11-27 12:57 ` [PATHv11 43/43] .gitlab-ci.yml: change ownership of the git files Maxim Uvarov
2023-11-27 18:37 ` [PATHv11 00/43] net/lwip: add lwip library for the network stack Tom Rini
2023-11-27 18:59 ` Tom Rini
2023-11-28 10:37 ` neil.armstrong
2023-11-28 19:13   ` Maxim Uvarov
2023-11-28 23:05 ` Tim Harvey
2023-11-28 23:21   ` Fabio Estevam
2023-11-29  0:10     ` Tim Harvey
2023-11-29  0:16       ` Fabio Estevam
2023-11-30  8:39         ` Maxim Uvarov
2023-11-30 13:00           ` Fabio Estevam
2023-11-30 13:14             ` Maxim Uvarov
2023-11-30 13:18               ` Fabio Estevam
2023-11-30 11:09 ` Peter Robinson
2023-11-30 13:05   ` Maxim Uvarov
2023-12-19 10:12 ` Alexander Dahl
2024-01-02 17:30   ` Maxim Uvarov
2024-01-03 14:30     ` Fabio Estevam
2024-01-04 15:02       ` Maxim Uvarov
2024-01-04 20:45         ` Fabio Estevam
2024-01-08  8:41           ` Maxim Uvarov
2024-01-08 11:39             ` Fabio Estevam

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=b47859ca-36d3-4eee-88fb-f7859e69ff2d@web.de \
    --to=smoch@web.de \
    --cc=goldsimon@gmx.de \
    --cc=ilias.apalodimas@linaro.org \
    --cc=maxim.uvarov@linaro.org \
    --cc=pbrobinson@gmail.com \
    --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