diff mbox series

[PATHv11,33/43] configs/am335x_evm_defconfig: inc SPL size

Message ID 20231127125726.3735-34-maxim.uvarov@linaro.org
State New
Headers show
Series net/lwip: add lwip library for the network stack | expand

Commit Message

Maxim Uvarov Nov. 27, 2023, 12:57 p.m. UTC
Increase allowed binary size to fit lwip code.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 configs/am335x_evm_defconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Tom Rini Nov. 27, 2023, 1:08 p.m. UTC | #1
On Mon, Nov 27, 2023 at 06:57:16PM +0600, Maxim Uvarov wrote:

> Increase allowed binary size to fit lwip code.
> 
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
>  configs/am335x_evm_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
> index f048e60f7f..9fd608bd76 100644
> --- a/configs/am335x_evm_defconfig
> +++ b/configs/am335x_evm_defconfig
> @@ -124,3 +124,4 @@ CONFIG_WDT=y
>  CONFIG_DYNAMIC_CRC_TABLE=y
>  CONFIG_RSA=y
>  CONFIG_LZO=y
> +CONFIG_SPL_MAX_SIZE=0x29000

As probably a problem for other platforms you made this change on too,
you can't do this. The link limit is here because that's the limit the
hardware (and ROM) imposes.

You might need to either:
- Figure out how to make lwip even tinier for the SPL case
- Limit the old network stack to just for SPL, and a later task is to
  reduce what's in the old stack to just what's also needed within SPL.
Maxim Uvarov Nov. 27, 2023, 2:06 p.m. UTC | #2
On Mon, 27 Nov 2023 at 19:08, Tom Rini <trini@konsulko.com> wrote:

> On Mon, Nov 27, 2023 at 06:57:16PM +0600, Maxim Uvarov wrote:
>
> > Increase allowed binary size to fit lwip code.
> >
> > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> > ---
> >  configs/am335x_evm_defconfig | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
> > index f048e60f7f..9fd608bd76 100644
> > --- a/configs/am335x_evm_defconfig
> > +++ b/configs/am335x_evm_defconfig
> > @@ -124,3 +124,4 @@ CONFIG_WDT=y
> >  CONFIG_DYNAMIC_CRC_TABLE=y
> >  CONFIG_RSA=y
> >  CONFIG_LZO=y
> > +CONFIG_SPL_MAX_SIZE=0x29000
>
> As probably a problem for other platforms you made this change on too,
> you can't do this. The link limit is here because that's the limit the
> hardware (and ROM) imposes.
>
> You might need to either:
> - Figure out how to make lwip even tinier for the SPL case
> - Limit the old network stack to just for SPL, and a later task is to
>   reduce what's in the old stack to just what's also needed within SPL.
>
>
Thanks Tom. All these size changes need to be reviewed.  Some of them are
ok, I think like for x86 or qemu virt, but some of them might not work.

Question - Do we need networking inside SPL rather than in the main binary?
Is it a real use case?

BR,
Maxim.


> --
> Tom
>
Peter Robinson Nov. 27, 2023, 2:06 p.m. UTC | #3
On Mon, Nov 27, 2023 at 1:08 PM Tom Rini <trini@konsulko.com> wrote:
>
> On Mon, Nov 27, 2023 at 06:57:16PM +0600, Maxim Uvarov wrote:
>
> > Increase allowed binary size to fit lwip code.
> >
> > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> > ---
> >  configs/am335x_evm_defconfig | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
> > index f048e60f7f..9fd608bd76 100644
> > --- a/configs/am335x_evm_defconfig
> > +++ b/configs/am335x_evm_defconfig
> > @@ -124,3 +124,4 @@ CONFIG_WDT=y
> >  CONFIG_DYNAMIC_CRC_TABLE=y
> >  CONFIG_RSA=y
> >  CONFIG_LZO=y
> > +CONFIG_SPL_MAX_SIZE=0x29000
>
> As probably a problem for other platforms you made this change on too,
> you can't do this. The link limit is here because that's the limit the
> hardware (and ROM) imposes.
>
> You might need to either:
> - Figure out how to make lwip even tinier for the SPL case
> - Limit the old network stack to just for SPL, and a later task is to
>   reduce what's in the old stack to just what's also needed within SPL.

Maybe also verify if network is actually needed/used in SPL for those devices.
Tom Rini Nov. 27, 2023, 2:08 p.m. UTC | #4
On Mon, Nov 27, 2023 at 08:06:23PM +0600, Maxim Uvarov wrote:
> On Mon, 27 Nov 2023 at 19:08, Tom Rini <trini@konsulko.com> wrote:
> 
> > On Mon, Nov 27, 2023 at 06:57:16PM +0600, Maxim Uvarov wrote:
> >
> > > Increase allowed binary size to fit lwip code.
> > >
> > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> > > ---
> > >  configs/am335x_evm_defconfig | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
> > > index f048e60f7f..9fd608bd76 100644
> > > --- a/configs/am335x_evm_defconfig
> > > +++ b/configs/am335x_evm_defconfig
> > > @@ -124,3 +124,4 @@ CONFIG_WDT=y
> > >  CONFIG_DYNAMIC_CRC_TABLE=y
> > >  CONFIG_RSA=y
> > >  CONFIG_LZO=y
> > > +CONFIG_SPL_MAX_SIZE=0x29000
> >
> > As probably a problem for other platforms you made this change on too,
> > you can't do this. The link limit is here because that's the limit the
> > hardware (and ROM) imposes.
> >
> > You might need to either:
> > - Figure out how to make lwip even tinier for the SPL case
> > - Limit the old network stack to just for SPL, and a later task is to
> >   reduce what's in the old stack to just what's also needed within SPL.
> >
> >
> Thanks Tom. All these size changes need to be reviewed.  Some of them are
> ok, I think like for x86 or qemu virt, but some of them might not work.
> 
> Question - Do we need networking inside SPL rather than in the main binary?
> Is it a real use case?

Yes, the device supports loading SPL, and then SPL loading U-Boot both
over USB RNDIS as well as regular physical ethernet.
Maxim Uvarov Nov. 27, 2023, 3:31 p.m. UTC | #5
On Mon, 27 Nov 2023 at 20:08, Tom Rini <trini@konsulko.com> wrote:

> On Mon, Nov 27, 2023 at 08:06:23PM +0600, Maxim Uvarov wrote:
> > On Mon, 27 Nov 2023 at 19:08, Tom Rini <trini@konsulko.com> wrote:
> >
> > > On Mon, Nov 27, 2023 at 06:57:16PM +0600, Maxim Uvarov wrote:
> > >
> > > > Increase allowed binary size to fit lwip code.
> > > >
> > > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> > > > ---
> > > >  configs/am335x_evm_defconfig | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/configs/am335x_evm_defconfig
> b/configs/am335x_evm_defconfig
> > > > index f048e60f7f..9fd608bd76 100644
> > > > --- a/configs/am335x_evm_defconfig
> > > > +++ b/configs/am335x_evm_defconfig
> > > > @@ -124,3 +124,4 @@ CONFIG_WDT=y
> > > >  CONFIG_DYNAMIC_CRC_TABLE=y
> > > >  CONFIG_RSA=y
> > > >  CONFIG_LZO=y
> > > > +CONFIG_SPL_MAX_SIZE=0x29000
> > >
> > > As probably a problem for other platforms you made this change on too,
> > > you can't do this. The link limit is here because that's the limit the
> > > hardware (and ROM) imposes.
> > >
> > > You might need to either:
> > > - Figure out how to make lwip even tinier for the SPL case
> > > - Limit the old network stack to just for SPL, and a later task is to
> > >   reduce what's in the old stack to just what's also needed within SPL.
> > >
> > >
> > Thanks Tom. All these size changes need to be reviewed.  Some of them are
> > ok, I think like for x86 or qemu virt, but some of them might not work.
> >
> > Question - Do we need networking inside SPL rather than in the main
> binary?
> > Is it a real use case?
>
> Yes, the device supports loading SPL, and then SPL loading U-Boot both
> over USB RNDIS as well as regular physical ethernet.
>
> --
> Tom
>

That looks like not a production use case. USB + NET + drivers + EXT4 +
NAND + MTD and everything else and trying to fit into SPL.
With enabling LTO I still need 4k (without dropping current code). From one
point it's too synthetic use case here and might be a historical
limitation which we will not see on future boards. From the other point it
will be good to not break it somehow....

BR,
Maxim.
Tom Rini Nov. 27, 2023, 3:33 p.m. UTC | #6
On Mon, Nov 27, 2023 at 09:31:54PM +0600, Maxim Uvarov wrote:
> On Mon, 27 Nov 2023 at 20:08, Tom Rini <trini@konsulko.com> wrote:
> 
> > On Mon, Nov 27, 2023 at 08:06:23PM +0600, Maxim Uvarov wrote:
> > > On Mon, 27 Nov 2023 at 19:08, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > > On Mon, Nov 27, 2023 at 06:57:16PM +0600, Maxim Uvarov wrote:
> > > >
> > > > > Increase allowed binary size to fit lwip code.
> > > > >
> > > > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> > > > > ---
> > > > >  configs/am335x_evm_defconfig | 1 +
> > > > >  1 file changed, 1 insertion(+)
> > > > >
> > > > > diff --git a/configs/am335x_evm_defconfig
> > b/configs/am335x_evm_defconfig
> > > > > index f048e60f7f..9fd608bd76 100644
> > > > > --- a/configs/am335x_evm_defconfig
> > > > > +++ b/configs/am335x_evm_defconfig
> > > > > @@ -124,3 +124,4 @@ CONFIG_WDT=y
> > > > >  CONFIG_DYNAMIC_CRC_TABLE=y
> > > > >  CONFIG_RSA=y
> > > > >  CONFIG_LZO=y
> > > > > +CONFIG_SPL_MAX_SIZE=0x29000
> > > >
> > > > As probably a problem for other platforms you made this change on too,
> > > > you can't do this. The link limit is here because that's the limit the
> > > > hardware (and ROM) imposes.
> > > >
> > > > You might need to either:
> > > > - Figure out how to make lwip even tinier for the SPL case
> > > > - Limit the old network stack to just for SPL, and a later task is to
> > > >   reduce what's in the old stack to just what's also needed within SPL.
> > > >
> > > >
> > > Thanks Tom. All these size changes need to be reviewed.  Some of them are
> > > ok, I think like for x86 or qemu virt, but some of them might not work.
> > >
> > > Question - Do we need networking inside SPL rather than in the main
> > binary?
> > > Is it a real use case?
> >
> > Yes, the device supports loading SPL, and then SPL loading U-Boot both
> > over USB RNDIS as well as regular physical ethernet.
> 
> That looks like not a production use case. USB + NET + drivers + EXT4 +
> NAND + MTD and everything else and trying to fit into SPL.

It unfortunately is. It's the eval kit and it's supposed to showcase
what is possible with the platform / SoC, and we've already previously
reworked things so that what's there today works.
Peter Robinson Nov. 27, 2023, 3:52 p.m. UTC | #7
On Mon, Nov 27, 2023 at 3:32 PM Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
>
>
> On Mon, 27 Nov 2023 at 20:08, Tom Rini <trini@konsulko.com> wrote:
>>
>> On Mon, Nov 27, 2023 at 08:06:23PM +0600, Maxim Uvarov wrote:
>> > On Mon, 27 Nov 2023 at 19:08, Tom Rini <trini@konsulko.com> wrote:
>> >
>> > > On Mon, Nov 27, 2023 at 06:57:16PM +0600, Maxim Uvarov wrote:
>> > >
>> > > > Increase allowed binary size to fit lwip code.
>> > > >
>> > > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>> > > > ---
>> > > >  configs/am335x_evm_defconfig | 1 +
>> > > >  1 file changed, 1 insertion(+)
>> > > >
>> > > > diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
>> > > > index f048e60f7f..9fd608bd76 100644
>> > > > --- a/configs/am335x_evm_defconfig
>> > > > +++ b/configs/am335x_evm_defconfig
>> > > > @@ -124,3 +124,4 @@ CONFIG_WDT=y
>> > > >  CONFIG_DYNAMIC_CRC_TABLE=y
>> > > >  CONFIG_RSA=y
>> > > >  CONFIG_LZO=y
>> > > > +CONFIG_SPL_MAX_SIZE=0x29000
>> > >
>> > > As probably a problem for other platforms you made this change on too,
>> > > you can't do this. The link limit is here because that's the limit the
>> > > hardware (and ROM) imposes.
>> > >
>> > > You might need to either:
>> > > - Figure out how to make lwip even tinier for the SPL case
>> > > - Limit the old network stack to just for SPL, and a later task is to
>> > >   reduce what's in the old stack to just what's also needed within SPL.
>> > >
>> > >
>> > Thanks Tom. All these size changes need to be reviewed.  Some of them are
>> > ok, I think like for x86 or qemu virt, but some of them might not work.
>> >
>> > Question - Do we need networking inside SPL rather than in the main binary?
>> > Is it a real use case?
>>
>> Yes, the device supports loading SPL, and then SPL loading U-Boot both
>> over USB RNDIS as well as regular physical ethernet.
>>
>> --
>> Tom
>
>
> That looks like not a production use case. USB + NET + drivers + EXT4 + NAND + MTD and everything else and trying to fit into SPL.
> With enabling LTO I still need 4k (without dropping current code). From one point it's too synthetic use case here and might be a historical
> limitation which we will not see on future boards. From the other point it will be good to not break it somehow....

Does this still include the old network code?

Also I wonder if we can have a paired down SPL_LWIP option that
removes things like PXE and HTTP/wget because none of those would be
used in the SPL use case as they're all brand new.

Peter
Tom Rini Nov. 27, 2023, 4:31 p.m. UTC | #8
On Mon, Nov 27, 2023 at 03:52:50PM +0000, Peter Robinson wrote:
> On Mon, Nov 27, 2023 at 3:32 PM Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> >
> >
> >
> > On Mon, 27 Nov 2023 at 20:08, Tom Rini <trini@konsulko.com> wrote:
> >>
> >> On Mon, Nov 27, 2023 at 08:06:23PM +0600, Maxim Uvarov wrote:
> >> > On Mon, 27 Nov 2023 at 19:08, Tom Rini <trini@konsulko.com> wrote:
> >> >
> >> > > On Mon, Nov 27, 2023 at 06:57:16PM +0600, Maxim Uvarov wrote:
> >> > >
> >> > > > Increase allowed binary size to fit lwip code.
> >> > > >
> >> > > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> >> > > > ---
> >> > > >  configs/am335x_evm_defconfig | 1 +
> >> > > >  1 file changed, 1 insertion(+)
> >> > > >
> >> > > > diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
> >> > > > index f048e60f7f..9fd608bd76 100644
> >> > > > --- a/configs/am335x_evm_defconfig
> >> > > > +++ b/configs/am335x_evm_defconfig
> >> > > > @@ -124,3 +124,4 @@ CONFIG_WDT=y
> >> > > >  CONFIG_DYNAMIC_CRC_TABLE=y
> >> > > >  CONFIG_RSA=y
> >> > > >  CONFIG_LZO=y
> >> > > > +CONFIG_SPL_MAX_SIZE=0x29000
> >> > >
> >> > > As probably a problem for other platforms you made this change on too,
> >> > > you can't do this. The link limit is here because that's the limit the
> >> > > hardware (and ROM) imposes.
> >> > >
> >> > > You might need to either:
> >> > > - Figure out how to make lwip even tinier for the SPL case
> >> > > - Limit the old network stack to just for SPL, and a later task is to
> >> > >   reduce what's in the old stack to just what's also needed within SPL.
> >> > >
> >> > >
> >> > Thanks Tom. All these size changes need to be reviewed.  Some of them are
> >> > ok, I think like for x86 or qemu virt, but some of them might not work.
> >> >
> >> > Question - Do we need networking inside SPL rather than in the main binary?
> >> > Is it a real use case?
> >>
> >> Yes, the device supports loading SPL, and then SPL loading U-Boot both
> >> over USB RNDIS as well as regular physical ethernet.
> >>
> >> --
> >> Tom
> >
> >
> > That looks like not a production use case. USB + NET + drivers + EXT4 + NAND + MTD and everything else and trying to fit into SPL.
> > With enabling LTO I still need 4k (without dropping current code). From one point it's too synthetic use case here and might be a historical
> > limitation which we will not see on future boards. From the other point it will be good to not break it somehow....
> 
> Does this still include the old network code?
> 
> Also I wonder if we can have a paired down SPL_LWIP option that
> removes things like PXE and HTTP/wget because none of those would be
> used in the SPL use case as they're all brand new.

To be clear, I am fine with either "old network stack only for SPL" or
"figure out how to pair down lwip to just SPL features". In fact having
said that, the first thing I would suggest is to turn off LTO as it
makes reading the linker map file harder, increase the size limit for
this platform, and take a look at what's being linked in and not
discarded in SPL, for networking, in spl/u-boot-spl.map. Maybe the
answer is that we just need to be more careful about using
IS_ENABLED/CONFIG_IS_ENABLED (and obj-$(CONFIG_$(SPL_)FOO)) in the lwip
series.
Maxim Uvarov Nov. 28, 2023, 9:35 a.m. UTC | #9
On Mon, 27 Nov 2023 at 22:31, Tom Rini <trini@konsulko.com> wrote:

> On Mon, Nov 27, 2023 at 03:52:50PM +0000, Peter Robinson wrote:
> > On Mon, Nov 27, 2023 at 3:32 PM Maxim Uvarov <maxim.uvarov@linaro.org>
> wrote:
> > >
> > >
> > >
> > > On Mon, 27 Nov 2023 at 20:08, Tom Rini <trini@konsulko.com> wrote:
> > >>
> > >> On Mon, Nov 27, 2023 at 08:06:23PM +0600, Maxim Uvarov wrote:
> > >> > On Mon, 27 Nov 2023 at 19:08, Tom Rini <trini@konsulko.com> wrote:
> > >> >
> > >> > > On Mon, Nov 27, 2023 at 06:57:16PM +0600, Maxim Uvarov wrote:
> > >> > >
> > >> > > > Increase allowed binary size to fit lwip code.
> > >> > > >
> > >> > > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> > >> > > > ---
> > >> > > >  configs/am335x_evm_defconfig | 1 +
> > >> > > >  1 file changed, 1 insertion(+)
> > >> > > >
> > >> > > > diff --git a/configs/am335x_evm_defconfig
> b/configs/am335x_evm_defconfig
> > >> > > > index f048e60f7f..9fd608bd76 100644
> > >> > > > --- a/configs/am335x_evm_defconfig
> > >> > > > +++ b/configs/am335x_evm_defconfig
> > >> > > > @@ -124,3 +124,4 @@ CONFIG_WDT=y
> > >> > > >  CONFIG_DYNAMIC_CRC_TABLE=y
> > >> > > >  CONFIG_RSA=y
> > >> > > >  CONFIG_LZO=y
> > >> > > > +CONFIG_SPL_MAX_SIZE=0x29000
> > >> > >
> > >> > > As probably a problem for other platforms you made this change on
> too,
> > >> > > you can't do this. The link limit is here because that's the
> limit the
> > >> > > hardware (and ROM) imposes.
> > >> > >
> > >> > > You might need to either:
> > >> > > - Figure out how to make lwip even tinier for the SPL case
> > >> > > - Limit the old network stack to just for SPL, and a later task
> is to
> > >> > >   reduce what's in the old stack to just what's also needed
> within SPL.
> > >> > >
> > >> > >
> > >> > Thanks Tom. All these size changes need to be reviewed.  Some of
> them are
> > >> > ok, I think like for x86 or qemu virt, but some of them might not
> work.
> > >> >
> > >> > Question - Do we need networking inside SPL rather than in the main
> binary?
> > >> > Is it a real use case?
> > >>
> > >> Yes, the device supports loading SPL, and then SPL loading U-Boot both
> > >> over USB RNDIS as well as regular physical ethernet.
> > >>
> > >> --
> > >> Tom
> > >
> > >
> > > That looks like not a production use case. USB + NET + drivers + EXT4
> + NAND + MTD and everything else and trying to fit into SPL.
> > > With enabling LTO I still need 4k (without dropping current code).
> From one point it's too synthetic use case here and might be a historical
> > > limitation which we will not see on future boards. From the other
> point it will be good to not break it somehow....
> >
> > Does this still include the old network code?
> >
> > Also I wonder if we can have a paired down SPL_LWIP option that
> > removes things like PXE and HTTP/wget because none of those would be
> > used in the SPL use case as they're all brand new.
>
> To be clear, I am fine with either "old network stack only for SPL" or
> "figure out how to pair down lwip to just SPL features". In fact having
> said that, the first thing I would suggest is to turn off LTO as it
> makes reading the linker map file harder, increase the size limit for
> this platform, and take a look at what's being linked in and not
> discarded in SPL, for networking, in spl/u-boot-spl.map. Maybe the
> answer is that we just need to be more careful about using
> IS_ENABLED/CONFIG_IS_ENABLED (and obj-$(CONFIG_$(SPL_)FOO)) in the lwip
> series.
>
> --
> Tom
>

Yea. If I disable TCP then we get the right size for this board. So for SPL
I think to build without TCP so that ping, dhcp and tftp will still work.
For normal binary TCP will be enabled. For other boards with limits I think
also to disable TCP for now.

BR,
Maxim.
Tom Rini Nov. 28, 2023, 3:07 p.m. UTC | #10
On Tue, Nov 28, 2023 at 03:35:00PM +0600, Maxim Uvarov wrote:
> On Mon, 27 Nov 2023 at 22:31, Tom Rini <trini@konsulko.com> wrote:
> 
> > On Mon, Nov 27, 2023 at 03:52:50PM +0000, Peter Robinson wrote:
> > > On Mon, Nov 27, 2023 at 3:32 PM Maxim Uvarov <maxim.uvarov@linaro.org>
> > wrote:
> > > >
> > > >
> > > >
> > > > On Mon, 27 Nov 2023 at 20:08, Tom Rini <trini@konsulko.com> wrote:
> > > >>
> > > >> On Mon, Nov 27, 2023 at 08:06:23PM +0600, Maxim Uvarov wrote:
> > > >> > On Mon, 27 Nov 2023 at 19:08, Tom Rini <trini@konsulko.com> wrote:
> > > >> >
> > > >> > > On Mon, Nov 27, 2023 at 06:57:16PM +0600, Maxim Uvarov wrote:
> > > >> > >
> > > >> > > > Increase allowed binary size to fit lwip code.
> > > >> > > >
> > > >> > > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> > > >> > > > ---
> > > >> > > >  configs/am335x_evm_defconfig | 1 +
> > > >> > > >  1 file changed, 1 insertion(+)
> > > >> > > >
> > > >> > > > diff --git a/configs/am335x_evm_defconfig
> > b/configs/am335x_evm_defconfig
> > > >> > > > index f048e60f7f..9fd608bd76 100644
> > > >> > > > --- a/configs/am335x_evm_defconfig
> > > >> > > > +++ b/configs/am335x_evm_defconfig
> > > >> > > > @@ -124,3 +124,4 @@ CONFIG_WDT=y
> > > >> > > >  CONFIG_DYNAMIC_CRC_TABLE=y
> > > >> > > >  CONFIG_RSA=y
> > > >> > > >  CONFIG_LZO=y
> > > >> > > > +CONFIG_SPL_MAX_SIZE=0x29000
> > > >> > >
> > > >> > > As probably a problem for other platforms you made this change on
> > too,
> > > >> > > you can't do this. The link limit is here because that's the
> > limit the
> > > >> > > hardware (and ROM) imposes.
> > > >> > >
> > > >> > > You might need to either:
> > > >> > > - Figure out how to make lwip even tinier for the SPL case
> > > >> > > - Limit the old network stack to just for SPL, and a later task
> > is to
> > > >> > >   reduce what's in the old stack to just what's also needed
> > within SPL.
> > > >> > >
> > > >> > >
> > > >> > Thanks Tom. All these size changes need to be reviewed.  Some of
> > them are
> > > >> > ok, I think like for x86 or qemu virt, but some of them might not
> > work.
> > > >> >
> > > >> > Question - Do we need networking inside SPL rather than in the main
> > binary?
> > > >> > Is it a real use case?
> > > >>
> > > >> Yes, the device supports loading SPL, and then SPL loading U-Boot both
> > > >> over USB RNDIS as well as regular physical ethernet.
> > > >>
> > > >> --
> > > >> Tom
> > > >
> > > >
> > > > That looks like not a production use case. USB + NET + drivers + EXT4
> > + NAND + MTD and everything else and trying to fit into SPL.
> > > > With enabling LTO I still need 4k (without dropping current code).
> > From one point it's too synthetic use case here and might be a historical
> > > > limitation which we will not see on future boards. From the other
> > point it will be good to not break it somehow....
> > >
> > > Does this still include the old network code?
> > >
> > > Also I wonder if we can have a paired down SPL_LWIP option that
> > > removes things like PXE and HTTP/wget because none of those would be
> > > used in the SPL use case as they're all brand new.
> >
> > To be clear, I am fine with either "old network stack only for SPL" or
> > "figure out how to pair down lwip to just SPL features". In fact having
> > said that, the first thing I would suggest is to turn off LTO as it
> > makes reading the linker map file harder, increase the size limit for
> > this platform, and take a look at what's being linked in and not
> > discarded in SPL, for networking, in spl/u-boot-spl.map. Maybe the
> > answer is that we just need to be more careful about using
> > IS_ENABLED/CONFIG_IS_ENABLED (and obj-$(CONFIG_$(SPL_)FOO)) in the lwip
> > series.
> >
> > --
> > Tom
> >
> 
> Yea. If I disable TCP then we get the right size for this board. So for SPL
> I think to build without TCP so that ping, dhcp and tftp will still work.
> For normal binary TCP will be enabled. For other boards with limits I think
> also to disable TCP for now.

Yes, that sounds right and also like you need to integrate lwIP more
with our Kconfig symbols, PROT_TCP is already there and needs to be
obeyed.
diff mbox series

Patch

diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index f048e60f7f..9fd608bd76 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -124,3 +124,4 @@  CONFIG_WDT=y
 CONFIG_DYNAMIC_CRC_TABLE=y
 CONFIG_RSA=y
 CONFIG_LZO=y
+CONFIG_SPL_MAX_SIZE=0x29000