Ilya Yanok | 5 Aug 2012 23:21
Favicon

[PATCH v4 0/5] OMAP: SPL networking support


These series provides support for networking in SPL.
These patches try to use network infrasctructure as is, without
trying to cut some minimal set of it, so the resulting SPL image
is quite big and only useful for boards with plenty of SRAM/OCRAM
(like TI AM335x based ones).

Changes in v3:
 - add support for setting different VCI in SPL
 - set Vendor Class Identifier for SPL
 - use BOOTP in SPL regardless of CONFIG_CMD_DHCP

Changes in v4:
   and CONFIG_BOOTD defined
 - SPL_BOARD_INIT is not needed anymore
 - fix compilation of SPL's libcommon with CONFIG_HUSH_PARSER
 - moved vci_strlen var inside macro
 - rename spl_eth.c to spl_net.c
 - set ethact variable if device name is passed
 - used strlen instead of sizeof

Ilya Yanok (5):
  net/bootp: add VCI support for BOOTP also
  spl: don't mark __u_boot_cmd* as undefined
  OMAP: spl: call timer_inti() from SPL
  OMAP: networking support for SPL
  am335x_evm: enable networking in SPL

 arch/arm/cpu/armv7/omap-common/Makefile  |    3 ++
 arch/arm/cpu/armv7/omap-common/spl.c     |   11 +++++++
(Continue reading)

Ilya Yanok | 5 Aug 2012 23:21
Favicon

[PATCH v4 1/5] net/bootp: add VCI support for BOOTP also

Vendor Class Identifier option is common to BOOTP and DHCP and
can be useful without PXE. So send VCI in both BOOTP and DHCP
requests if CONFIG_BOOTP_VCI_STRING is defined.

Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>

---
Changes in v4:
 - moved vci_strlen var inside macro
 - used strlen instead of sizeof

 net/bootp.c |   22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/net/bootp.c b/net/bootp.c
index c9b8349..35b2e77 100644
--- a/net/bootp.c
+++ b/net/bootp.c
 <at>  <at>  -341,6 +341,15  <at>  <at>  BootpTimeout(void)
 	}
 }

+#define put_vci(e, str)						\
+	do {							\
+		size_t vci_strlen = strlen(str);		\
+		*e++ = 60;	/* Vendor Class Identifier */	\
+		*e++ = vci_strlen;				\
+		memcpy(e, str, vci_strlen);			\
+		e += vci_strlen;				\
+	} while (0)
(Continue reading)

Ilya Yanok | 10 Aug 2012 19:57
Favicon

Re: [PATCH v4 1/5] net/bootp: add VCI support for BOOTP also

Hi Joe,

On Mon, Aug 6, 2012 at 1:21 AM, Ilya Yanok <ilya.yanok <at> cogentembedded.com>wrote:

> Vendor Class Identifier option is common to BOOTP and DHCP and
> can be useful without PXE. So send VCI in both BOOTP and DHCP
> requests if CONFIG_BOOTP_VCI_STRING is defined.
>
> Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>
>
> ---
> Changes in v4:
>  - moved vci_strlen var inside macro
>  - used strlen instead of sizeof
>
>
Is it ok now? What about the rest of the series?

Regards, Ilya.
_______________________________________________
U-Boot mailing list
U-Boot <at> lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Joe Hershberger | 29 Aug 2012 23:01
Picon

Re: [PATCH v4 1/5] net/bootp: add VCI support for BOOTP also

Hi Ilya,

On Sun, Aug 5, 2012 at 4:21 PM, Ilya Yanok
<ilya.yanok <at> cogentembedded.com> wrote:
> Vendor Class Identifier option is common to BOOTP and DHCP and
> can be useful without PXE. So send VCI in both BOOTP and DHCP
> requests if CONFIG_BOOTP_VCI_STRING is defined.
>
> Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>
>
> ---

Acked-by: Joe Hershberger <joe.hershberger <at> ni.com>
Ilya Yanok | 5 Aug 2012 23:21
Favicon

[PATCH v4 3/5] OMAP: spl: call timer_inti() from SPL

We need to initialize timer properly, otherwise all delays
inside SPL will be wrong.

Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>
---

 arch/arm/cpu/armv7/omap-common/spl.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
index 4d1ac85..f0d766c 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
 <at>  <at>  -152,6 +152,8  <at>  <at>  void board_init_r(gd_t *id, ulong dummy)
 	mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
 			CONFIG_SYS_SPL_MALLOC_SIZE);

+	timer_init();
+
 #ifdef CONFIG_SPL_BOARD_INIT
 	spl_board_init();
 #endif
--

-- 
1.7.9.5
Tom Rini | 6 Aug 2012 00:35
Picon
Favicon
Gravatar

Re: [PATCH v4 3/5] OMAP: spl: call timer_inti() from SPL

On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
<ilya.yanok <at> cogentembedded.com> wrote:
> We need to initialize timer properly, otherwise all delays
> inside SPL will be wrong.
>
> Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>
> ---
>
>  arch/arm/cpu/armv7/omap-common/spl.c |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
> index 4d1ac85..f0d766c 100644
> --- a/arch/arm/cpu/armv7/omap-common/spl.c
> +++ b/arch/arm/cpu/armv7/omap-common/spl.c
>  <at>  <at>  -152,6 +152,8  <at>  <at>  void board_init_r(gd_t *id, ulong dummy)
>         mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
>                         CONFIG_SYS_SPL_MALLOC_SIZE);
>
> +       timer_init();
> +
>  #ifdef CONFIG_SPL_BOARD_INIT
>         spl_board_init();
>  #endif

Calling it twice has other bad side-effects so there should be a
timer_init removal somewhere too.

--

-- 
Tom
(Continue reading)

Ilya Yanok | 6 Aug 2012 17:02
Favicon

Re: [PATCH v4 3/5] OMAP: spl: call timer_inti() from SPL

Hi Tom,

On Mon, Aug 6, 2012 at 2:35 AM, Tom Rini <trini <at> ti.com> wrote:

> On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
> <ilya.yanok <at> cogentembedded.com> wrote:
> > We need to initialize timer properly, otherwise all delays
> > inside SPL will be wrong.
> >
> > Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>
> > ---
> >
> >  arch/arm/cpu/armv7/omap-common/spl.c |    2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm/cpu/armv7/omap-common/spl.c
> b/arch/arm/cpu/armv7/omap-common/spl.c
> > index 4d1ac85..f0d766c 100644
> > --- a/arch/arm/cpu/armv7/omap-common/spl.c
> > +++ b/arch/arm/cpu/armv7/omap-common/spl.c
> >  <at>  <at>  -152,6 +152,8  <at>  <at>  void board_init_r(gd_t *id, ulong dummy)
> >         mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
> >                         CONFIG_SYS_SPL_MALLOC_SIZE);
> >
> > +       timer_init();
> > +
> >  #ifdef CONFIG_SPL_BOARD_INIT
> >         spl_board_init();
> >  #endif
>
(Continue reading)

Tom Rini | 6 Aug 2012 17:11
Picon
Favicon
Gravatar

Re: [PATCH v4 3/5] OMAP: spl: call timer_inti() from SPL

On Mon, Aug 6, 2012 at 8:02 AM, Ilya Yanok
<ilya.yanok <at> cogentembedded.com> wrote:
> Hi Tom,
>
> On Mon, Aug 6, 2012 at 2:35 AM, Tom Rini <trini <at> ti.com> wrote:
>
>> On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
>> <ilya.yanok <at> cogentembedded.com> wrote:
>> > We need to initialize timer properly, otherwise all delays
>> > inside SPL will be wrong.
>> >
>> > Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>
>> > ---
>> >
>> >  arch/arm/cpu/armv7/omap-common/spl.c |    2 ++
>> >  1 file changed, 2 insertions(+)
>> >
>> > diff --git a/arch/arm/cpu/armv7/omap-common/spl.c
>> b/arch/arm/cpu/armv7/omap-common/spl.c
>> > index 4d1ac85..f0d766c 100644
>> > --- a/arch/arm/cpu/armv7/omap-common/spl.c
>> > +++ b/arch/arm/cpu/armv7/omap-common/spl.c
>> >  <at>  <at>  -152,6 +152,8  <at>  <at>  void board_init_r(gd_t *id, ulong dummy)
>> >         mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
>> >                         CONFIG_SYS_SPL_MALLOC_SIZE);
>> >
>> > +       timer_init();
>> > +
>> >  #ifdef CONFIG_SPL_BOARD_INIT
>> >         spl_board_init();
(Continue reading)

Tom Rini | 6 Aug 2012 20:49
Picon
Favicon
Gravatar

[PATCH] am33xx: Remove redundant timer config

We have the timer code in arch/arm/cpu/armv7/omap-common/timer.c that
has been configuring and enabling the timer, so remove our code that
does the same thing by different methods.

Tested on EVM GP, SK-EVM and Beaglebone.

Signed-off-by: Tom Rini <trini <at> ti.com>
---
 arch/arm/cpu/armv7/am33xx/board.c |   20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c
index 2ca4ca7..5b00719 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
 <at>  <at>  -37,7 +37,6  <at>  <at> 
 DECLARE_GLOBAL_DATA_PTR;

 struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
-struct gptimer *timer_base = (struct gptimer *)CONFIG_SYS_TIMERBASE;
 struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE;

 static const struct gpio_bank gpio_bank_am33xx[4] = {
 <at>  <at>  -119,22 +118,6  <at>  <at>  static int read_eeprom(void)
 #define UART_SMART_IDLE_EN	(0x1 << 0x3)
 #endif

-#ifdef CONFIG_SPL_BUILD
-/* Initialize timer */
-static void init_timer(void)
(Continue reading)

Ilya Yanok | 5 Aug 2012 23:21
Favicon

[PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

__u_boot_cmd* symbols are not used in SPL so there is no need
to tell the linker that they are undefined. With these symbols
marked as undefined linker fails to garbage collect some unused
functions and even fails to build the resulting image.

Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>
---

 spl/Makefile |    2 --
 1 file changed, 2 deletions(-)

diff --git a/spl/Makefile b/spl/Makefile
index ea7d475..8576d56 100644
--- a/spl/Makefile
+++ b/spl/Makefile
 <at>  <at>  -126,8 +126,6  <at>  <at>  $(obj)u-boot-spl.bin:	$(obj)u-boot-spl
 	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $ <at> 

 GEN_UBOOT = \
-	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
-	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
 	cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$( <at> F)) $$UNDEF_SYM $(__START) \
 		--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
 		-Map u-boot-spl.map -o u-boot-spl
--

-- 
1.7.9.5
Tom Rini | 6 Aug 2012 00:36
Picon
Favicon
Gravatar

Re: [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
<ilya.yanok <at> cogentembedded.com> wrote:
> __u_boot_cmd* symbols are not used in SPL so there is no need
> to tell the linker that they are undefined. With these symbols
> marked as undefined linker fails to garbage collect some unused
> functions and even fails to build the resulting image.

I don't like this because it causes SPL to bloat when the commands
aren't also removed from the build.  But I assume a number of commands
were being pulled in as part of the networking stack?

--

-- 
Tom
Ilya Yanok | 6 Aug 2012 17:10
Favicon

Re: [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

Hi Tom,

On Mon, Aug 6, 2012 at 2:36 AM, Tom Rini <trini <at> ti.com> wrote:

> On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
> <ilya.yanok <at> cogentembedded.com> wrote:
> > __u_boot_cmd* symbols are not used in SPL so there is no need
> > to tell the linker that they are undefined. With these symbols
> > marked as undefined linker fails to garbage collect some unused
> > functions and even fails to build the resulting image.
>
> I don't like this because it causes SPL to bloat when the commands
> aren't also removed from the build.  But I assume a number of commands
>

Nah. As far as I understand it,  UNDEF_SYM stuff is there to protect
commands from being purged by linker garbage collector. This is needed for
main U-Boot as commands are referenced inderectly.
I seems to me that this stuff was just copy-pasted into SPL Makefile. As
far as we don't need commands in SPL we don't care about them being garbage
collected (well, actually we want them to be collected). So it has nothing
to do about bloating, actually SPL image is smaller with this patch applied.

were being pulled in as part of the networking stack?
>

Not really, only some functions.

Regards, Ilya.
(Continue reading)

Tom Rini | 6 Aug 2012 17:30
Picon
Favicon
Gravatar

Re: [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

On 08/06/2012 08:10 AM, Ilya Yanok wrote:
> Hi Tom,
> 
> On Mon, Aug 6, 2012 at 2:36 AM, Tom Rini <trini <at> ti.com
> <mailto:trini <at> ti.com>> wrote:
> 
>     On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
>     <ilya.yanok <at> cogentembedded.com
>     <mailto:ilya.yanok <at> cogentembedded.com>> wrote:
>     > __u_boot_cmd* symbols are not used in SPL so there is no need
>     > to tell the linker that they are undefined. With these symbols
>     > marked as undefined linker fails to garbage collect some unused
>     > functions and even fails to build the resulting image.
> 
>     I don't like this because it causes SPL to bloat when the commands
>     aren't also removed from the build.  But I assume a number of commands
> 
> 
> Nah. As far as I understand it,  UNDEF_SYM stuff is there to protect
> commands from being purged by linker garbage collector. This is needed
> for main U-Boot as commands are referenced inderectly.
> I seems to me that this stuff was just copy-pasted into SPL Makefile. As
> far as we don't need commands in SPL we don't care about them being
> garbage collected (well, actually we want them to be collected). So it
> has nothing to do about bloating, actually SPL image is smaller with
> this patch applied.

What toolchain are you using?  In my tests they have not been collected.

--

-- 
(Continue reading)

Ilya Yanok | 6 Aug 2012 17:31
Favicon

Re: [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

On Mon, Aug 6, 2012 at 7:30 PM, Tom Rini <trini <at> ti.com> wrote:

> On 08/06/2012 08:10 AM, Ilya Yanok wrote:
> > Hi Tom,
> >
> > On Mon, Aug 6, 2012 at 2:36 AM, Tom Rini <trini <at> ti.com
> > <mailto:trini <at> ti.com>> wrote:
> >
> >     On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
> >     <ilya.yanok <at> cogentembedded.com
> >     <mailto:ilya.yanok <at> cogentembedded.com>> wrote:
> >     > __u_boot_cmd* symbols are not used in SPL so there is no need
> >     > to tell the linker that they are undefined. With these symbols
> >     > marked as undefined linker fails to garbage collect some unused
> >     > functions and even fails to build the resulting image.
> >
> >     I don't like this because it causes SPL to bloat when the commands
> >     aren't also removed from the build.  But I assume a number of
> commands
> >
> >
> > Nah. As far as I understand it,  UNDEF_SYM stuff is there to protect
> > commands from being purged by linker garbage collector. This is needed
> > for main U-Boot as commands are referenced inderectly.
> > I seems to me that this stuff was just copy-pasted into SPL Makefile. As
> > far as we don't need commands in SPL we don't care about them being
> > garbage collected (well, actually we want them to be collected). So it
> > has nothing to do about bloating, actually SPL image is smaller with
> > this patch applied.
>
(Continue reading)

Tom Rini | 6 Aug 2012 19:10
Picon
Favicon
Gravatar

Re: [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

On Mon, Aug 6, 2012 at 8:31 AM, Ilya Yanok
<ilya.yanok <at> cogentembedded.com> wrote:
> On Mon, Aug 6, 2012 at 7:30 PM, Tom Rini <trini <at> ti.com> wrote:
>
>> On 08/06/2012 08:10 AM, Ilya Yanok wrote:
>> > Hi Tom,
>> >
>> > On Mon, Aug 6, 2012 at 2:36 AM, Tom Rini <trini <at> ti.com
>> > <mailto:trini <at> ti.com>> wrote:
>> >
>> >     On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
>> >     <ilya.yanok <at> cogentembedded.com
>> >     <mailto:ilya.yanok <at> cogentembedded.com>> wrote:
>> >     > __u_boot_cmd* symbols are not used in SPL so there is no need
>> >     > to tell the linker that they are undefined. With these symbols
>> >     > marked as undefined linker fails to garbage collect some unused
>> >     > functions and even fails to build the resulting image.
>> >
>> >     I don't like this because it causes SPL to bloat when the commands
>> >     aren't also removed from the build.  But I assume a number of
>> commands
>> >
>> >
>> > Nah. As far as I understand it,  UNDEF_SYM stuff is there to protect
>> > commands from being purged by linker garbage collector. This is needed
>> > for main U-Boot as commands are referenced inderectly.
>> > I seems to me that this stuff was just copy-pasted into SPL Makefile. As
>> > far as we don't need commands in SPL we don't care about them being
>> > garbage collected (well, actually we want them to be collected). So it
>> > has nothing to do about bloating, actually SPL image is smaller with
(Continue reading)

Ilya Yanok | 6 Aug 2012 21:15
Favicon

Re: [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

Hi Tom,

On Mon, Aug 6, 2012 at 9:10 PM, Tom Rini <trini <at> ti.com> wrote:

>
> OK, installed and it's still larger with this change than without and
> it's not garbage collecting and dropping commands if I un-guard the
> nandecc command for example.  Tested with omap3_beagle.
>

Did some testing as well.

master branch, omap3_beagle config. Trying clean master, master + remove
undef patch, master + remove undef patch + un-guard nandecc & master +
un-guard nandecc.

Here is my results:

$ ls -l ../out/master/spl/u-boot-spl.bin
-rwxrwxr-x 1 ilya ilya 44692 Aug  6 21:57 ../out/master/spl/u-boot-spl.bin
$ ls -l ../out/undef/spl/u-boot-spl.bin
-rwxrwxr-x 1 ilya ilya 44692 Aug  6 21:52 ../out/undef/spl/u-boot-spl.bin
$ ls -l ../out/undef+nandecc/spl/u-boot-spl.bin
-rwxrwxr-x 1 ilya ilya 44844 Aug  6 21:53
../out/undef+nandecc/spl/u-boot-spl.bin

(and master + un-guard ecc actually failed to build with:
$ ./MAKEALL omap3_beagle
Configuring for omap3_beagle board...
make[1]: *** [/work/u-boot/spl/u-boot-spl] Error 1
(Continue reading)

Tom Rini | 6 Aug 2012 22:52
Picon
Favicon
Gravatar

Re: [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

On Mon, Aug 06, 2012 at 11:15:25PM +0400, Ilya Yanok wrote:
> Hi Tom,
> 
> On Mon, Aug 6, 2012 at 9:10 PM, Tom Rini <trini <at> ti.com> wrote:
> 
> >
> > OK, installed and it's still larger with this change than without and
> > it's not garbage collecting and dropping commands if I un-guard the
> > nandecc command for example.  Tested with omap3_beagle.
> >
> 
> Did some testing as well.
[snip]
> My interpretation: first two builds are equal, that's to be expected as in
> mainline U-Boot all command definitions are carefully guarded so remove
> undef patch has no effect at all. You said in your testing patched version
> produced bigger image... Probably you patched it by hand without commiting
> and got "-dirty" difference? (I did so initially ;) )

That would be it, yes :)

> Next, when we unguard the command we definitely get bigger image... But the
> code is not here:
> 
> $ arm-linux-gnueabi-nm ../out/undef+nandecc/spl/u-boot-spl |grep
> do_switch_ecc
> $
> 
> By comparing of two images I've found that the difference comes from
> ro-strings (two help strings in U_BOOT_CMD, string in printf, "sw" & "hw").
(Continue reading)

Ilya Yanok | 6 Aug 2012 23:11
Favicon

Re: [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

Hi Tom,

On Tue, Aug 7, 2012 at 12:52 AM, Tom Rini <trini <at> ti.com> wrote:

> > By comparing of two images I've found that the difference comes from
> > ro-strings (two help strings in U_BOOT_CMD, string in printf, "sw" &
> "hw").
> > It looks like the linker doesn't collect ro-strings referenced from
> > collected functions... Probably that's a bug but I'm not sure...
>
> Yes.  What I meant was that not all of the stuff that is guarded today
> is garbage collected so the resulting image is larger than it must be.
>

Yep. And that's actually goes beyond the subject of this patch: as long as
we rely on linker GC and not putting guards by hands we will get unused
string literals compiled in.

I still think that this patch does the correct things (UNDEF_SYM is there
to protect commands from GC and we don't really want commands in SPL so
there is nothing to protect). But I will try to add guards to make net-spl
compile even without this patch.

> And yes, this is a toolchain issue of sorts (not being aggressive enough
> in collecting unreferenced data).
>

Looks like it can be fixed by forcing the compiler to emit symbols for
string literals... But I'm not really compiler guy...

(Continue reading)

Ilya Yanok | 7 Aug 2012 10:12
Favicon

Re: [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

Hi Tom,

On Tue, Aug 7, 2012 at 1:11 AM, Ilya Yanok <ilya.yanok <at> cogentembedded.com>wrote:

>
> Yes.  What I meant was that not all of the stuff that is guarded today
>> is garbage collected so the resulting image is larger than it must be.
>>
>
> Yep. And that's actually goes beyond the subject of this patch: as long as
> we rely on linker GC and not putting guards by hands we will get unused
> string literals compiled in.
>
> I still think that this patch does the correct things (UNDEF_SYM is there
> to protect commands from GC and we don't really want commands in SPL so
> there is nothing to protect). But I will try to add guards to make net-spl
> compile even without this patch.
>

I've just posted v5 for patch 4/5 that doesn't depend on this patch. It
really has some improvement wrt size (~50KB net-only SPL image) so probably
it could be useful not only for AM33xx...

Regards, Ilya.
_______________________________________________
U-Boot mailing list
U-Boot <at> lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
(Continue reading)

Ilya Yanok | 5 Aug 2012 23:21
Favicon

[PATCH v4 4/5] OMAP: networking support for SPL

This patch adds support for networking in SPL. Some devices are
capable of loading SPL via network so it makes sense to load the
main U-Boot binary via network too. This patch tries to use
existing network code as much as possible. Unfortunately, it depends
on environment which in turn depends on other code so SPL size
is increased significantly. No effort was done to decouple network
code and environment so far.

Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>

---
Changes in v3:
 - add support for setting different VCI in SPL
 - use BOOTP in SPL regardless of CONFIG_CMD_DHCP

Changes in v4:
   and CONFIG_BOOTD defined
 - fix compilation of SPL's libcommon with CONFIG_HUSH_PARSER
 - rename spl_eth.c to spl_net.c
 - set ethact variable if device name is passed

 arch/arm/cpu/armv7/omap-common/Makefile  |    3 ++
 arch/arm/cpu/armv7/omap-common/spl.c     |    9 ++++++
 arch/arm/cpu/armv7/omap-common/spl_net.c |   52 ++++++++++++++++++++++++++++++
 arch/arm/include/asm/omap_common.h       |    4 +++
 common/Makefile                          |    6 ++++
 common/cmd_nvedit.c                      |    6 ++--
 common/command.c                         |    2 +-
 common/env_common.c                      |    3 +-
 common/main.c                            |    4 +--
(Continue reading)

Ilya Yanok | 7 Aug 2012 10:07
Favicon

[PATCH v5 4/5] OMAP: networking support for SPL

This patch adds support for networking in SPL. Some devices are
capable of loading SPL via network so it makes sense to load the
main U-Boot binary via network too. This patch tries to use
existing network code as much as possible. Unfortunately, it depends
on environment which in turn depends on other code so SPL size
is increased significantly. No effort was done to decouple network
code and environment so far.

Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>

---
Changes in v3:
 - use BOOTP in SPL regardless of CONFIG_CMD_DHCP
 - add support for setting different VCI in SPL

Changes in v4:
 - fix compilation of SPL's libcommon with CONFIG_HUSH_PARSER
   and CONFIG_BOOTD defined
 - rename spl_eth.c to spl_net.c
 - set ethact variable if device name is passed

Changes in v5:
 - set up guards in cmd_nvedit.c more carefully
 - now we don't need command.c and only need main.c for
   show_boot_progress() so defined it to be noop and remove
   both files from SPL sources
 - SPL guards in command.c and main.c are no longer needed
 - add some guards in env_common.c
 - qsort.c is no longer needed
 - add guard to hashtable.c to save some space
(Continue reading)

Joe Hershberger | 29 Aug 2012 23:25
Picon

Re: [PATCH v5 4/5] OMAP: networking support for SPL

Hi Ilya,

On Tue, Aug 7, 2012 at 3:07 AM, Ilya Yanok
<ilya.yanok <at> cogentembedded.com> wrote:
> This patch adds support for networking in SPL. Some devices are
> capable of loading SPL via network so it makes sense to load the
> main U-Boot binary via network too. This patch tries to use
> existing network code as much as possible. Unfortunately, it depends
> on environment which in turn depends on other code so SPL size
> is increased significantly. No effort was done to decouple network
> code and environment so far.
>
> Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>
>
> ---
> Changes in v3:
>  - use BOOTP in SPL regardless of CONFIG_CMD_DHCP
>  - add support for setting different VCI in SPL
>
> Changes in v4:
>  - fix compilation of SPL's libcommon with CONFIG_HUSH_PARSER
>    and CONFIG_BOOTD defined
>  - rename spl_eth.c to spl_net.c
>  - set ethact variable if device name is passed
>
> Changes in v5:
>  - set up guards in cmd_nvedit.c more carefully
>  - now we don't need command.c and only need main.c for
>    show_boot_progress() so defined it to be noop and remove
>    both files from SPL sources
(Continue reading)

Tom Rini | 30 Aug 2012 00:28
Picon
Favicon
Gravatar

Re: [PATCH v5 4/5] OMAP: networking support for SPL

On 08/29/2012 02:25 PM, Joe Hershberger wrote:

[snip]
>>  #include <common.h>
>> +#ifdef CONFIG_SPL_BUILD
>> +/* SPL needs only BOOTP + TFTP so undefine other stuff to save space */
>> +#undef CONFIG_CMD_DHCP
>> +#undef CONFIG_CMD_CDP
>> +#undef CONFIG_CMD_DNS
>> +#undef CONFIG_CMD_LINK_LOCAL
>> +#undef CONFIG_CMD_NFS
>> +#undef CONFIG_CMD_PING
>> +#undef CONFIG_CMD_RARP
>> +#undef CONFIG_CMD_SNTP
>> +#undef CONFIG_CMD_TFTPPUT
>> +#undef CONFIG_CMD_TFTPSRV
>> +#endif
> 
> Is this the best place to do this?  Seems it would be clearer to
> modify config_cmd_default.h or add a config_cmd_spl.h that will
> undefine them, and include that.

I was thinking about that too, include/config_cmd_spl.h should probably
be how this happens.

--

-- 
Tom
Ilya Yanok | 17 Sep 2012 11:55
Favicon

Re: [PATCH v5 4/5] OMAP: networking support for SPL

Hi Joe,

On Thu, Aug 30, 2012 at 1:25 AM, Joe Hershberger
<joe.hershberger <at> gmail.com>wrote:

>
> > diff --git a/arch/arm/cpu/armv7/omap-common/Makefile
> b/arch/arm/cpu/armv7/omap-common/Makefile
> > index d37b22d..f042078 100644
> > --- a/arch/arm/cpu/armv7/omap-common/Makefile
> > +++ b/arch/arm/cpu/armv7/omap-common/Makefile
> >  <at>  <at>  -53,6 +53,9  <at>  <at>  endif
> >  ifdef CONFIG_SPL_YMODEM_SUPPORT
> >  COBJS  += spl_ymodem.o
> >  endif
> > +ifdef CONFIG_SPL_NET_SUPPORT
> > +COBJS  += spl_net.o
> > +endif
>
>
> Why not use common pattern of...
>
> COBJS-$(CONFIG_SPL_NET_SUPPORT) += spl_net.o
>
> COBJS   := $(sort $(COBJS-y))
>

In fact, I'm just following the existing style here... But I can change it
as you requested.

(Continue reading)

Tom Rini | 17 Sep 2012 19:04
Picon
Favicon
Gravatar

Re: [PATCH v5 4/5] OMAP: networking support for SPL


On 09/17/12 02:55, Ilya Yanok wrote:
> Hi Joe,
> 
> On Thu, Aug 30, 2012 at 1:25 AM, Joe Hershberger 
> <joe.hershberger <at> gmail.com <mailto:joe.hershberger <at> gmail.com>>
> wrote:
[snip]
>> diff --git a/net/net.c b/net/net.c index e8ff066..bbd1a6d 100644 
>> --- a/net/net.c +++ b/net/net.c  <at>  <at>  -81,6 +81,19  <at>  <at> 
>> 
>> 
>> #include <common.h> +#ifdef CONFIG_SPL_BUILD +/* SPL needs only
>> BOOTP + TFTP so undefine other stuff to save
> space */
>> +#undef CONFIG_CMD_DHCP +#undef CONFIG_CMD_CDP +#undef
>> CONFIG_CMD_DNS +#undef CONFIG_CMD_LINK_LOCAL +#undef
>> CONFIG_CMD_NFS +#undef CONFIG_CMD_PING +#undef CONFIG_CMD_RARP 
>> +#undef CONFIG_CMD_SNTP +#undef CONFIG_CMD_TFTPPUT +#undef
>> CONFIG_CMD_TFTPSRV +#endif
> 
> Is this the best place to do this?  Seems it would be clearer to 
> modify config_cmd_default.h or add a config_cmd_spl.h that will 
> undefine them, and include that.
> 
> 
> I agree it's not the best place... config_cmd_spl.h sounds a little
> bit crazy as we don't have any commands at all in SPL...

How about config_uncmd_spl.h then and a nice big comment up top
(Continue reading)

Ilya Yanok | 17 Sep 2012 19:54
Favicon

Re: [PATCH v5 4/5] OMAP: networking support for SPL

Hi Tom,

On Mon, Sep 17, 2012 at 9:04 PM, Tom Rini <trini <at> ti.com> wrote:

> > I agree it's not the best place... config_cmd_spl.h sounds a little
> > bit crazy as we don't have any commands at all in SPL...
>
>
> How about config_uncmd_spl.h then and a nice big comment up top
>

Well, it will be at least less confusing...

> explaining what we're doing.  Or can we take another stab at seeing
> why some stuff isn't being garbage collected?  If
> garbage_collected_func_a calls never_seen_while_linking_func, we still
> succeed since we garbage collect the first func.  There's just the gcc
> issue I've noted before about strings.
>

That's not really about garbage collection in this case (net-spl). I want
to disable some functionality of generic net code not some stuff used only
by commands implementation. The confusion comes from the fact that this
code is protected by CONFIG_CMD_* defines.

Regards, Ilya.
_______________________________________________
U-Boot mailing list
(Continue reading)

Tom Rini | 17 Sep 2012 20:07
Picon
Favicon
Gravatar

Re: [PATCH v5 4/5] OMAP: networking support for SPL


On 09/17/12 10:54, Ilya Yanok wrote:
> Hi Tom,
> 
> On Mon, Sep 17, 2012 at 9:04 PM, Tom Rini <trini <at> ti.com 
> <mailto:trini <at> ti.com>> wrote:
> 
>> I agree it's not the best place... config_cmd_spl.h sounds a
>> little bit crazy as we don't have any commands at all in SPL...
> 
> 
> How about config_uncmd_spl.h then and a nice big comment up top
> 
> 
> Well, it will be at least less confusing...
> 
> 
> explaining what we're doing.  Or can we take another stab at
> seeing why some stuff isn't being garbage collected?  If 
> garbage_collected_func_a calls never_seen_while_linking_func, we
> still succeed since we garbage collect the first func.  There's
> just the gcc issue I've noted before about strings.
> 
> 
> That's not really about garbage collection in this case (net-spl).
> I want to disable some functionality of generic net code not some
> stuff used only by commands implementation. The confusion comes
> from the fact that this code is protected by CONFIG_CMD_* defines.

So I guess the code construct is roughly:
(Continue reading)

Ilya Yanok | 17 Sep 2012 20:10
Favicon

Re: [PATCH v5 4/5] OMAP: networking support for SPL

On Mon, Sep 17, 2012 at 10:07 PM, Tom Rini <trini <at> ti.com> wrote:

> > That's not really about garbage collection in this case (net-spl).
> > I want to disable some functionality of generic net code not some
> > stuff used only by commands implementation. The confusion comes
> > from the fact that this code is protected by CONFIG_CMD_* defines.
>
> So I guess the code construct is roughly:
> function_we_need(...) {
> #ifdef CONFIG_CMD_A
>   ... stuff_spl_does_not_need();
> #endif
> ...
> }
>
> ?  Otherwise we would end up building files we don't use, but then all
> of the un-used code gets garbage collected.
>

Exactly.

Regards, Ilya.
_______________________________________________
U-Boot mailing list
U-Boot <at> lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Ilya Yanok | 17 Sep 2012 20:16
Favicon

Re: [PATCH v5 4/5] OMAP: networking support for SPL

BTW, I'm going to repost this serie soon. Shouldn't I rebase it on top of
your SPL rework patches? Where can I find the tree?

Regards, Ilya.
_______________________________________________
U-Boot mailing list
U-Boot <at> lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Tom Rini | 17 Sep 2012 20:19
Picon
Favicon
Gravatar

Re: [PATCH v5 4/5] OMAP: networking support for SPL


On 09/17/12 11:10, Ilya Yanok wrote:
> 
> 
> On Mon, Sep 17, 2012 at 10:07 PM, Tom Rini <trini <at> ti.com 
> <mailto:trini <at> ti.com>> wrote:
> 
>> That's not really about garbage collection in this case
>> (net-spl). I want to disable some functionality of generic net
>> code not some stuff used only by commands implementation. The
>> confusion comes from the fact that this code is protected by
>> CONFIG_CMD_* defines.
> 
> So I guess the code construct is roughly: function_we_need(...) { 
> #ifdef CONFIG_CMD_A ... stuff_spl_does_not_need(); #endif ... }
> 
> ?  Otherwise we would end up building files we don't use, but then
> all of the un-used code gets garbage collected.
> 
> 
> Exactly.

OK, config_uncmd_spl.h, nice big comment and v6, thanks :)

--

-- 
Tom
Ilya Yanok | 17 Sep 2012 20:36
Favicon

Re: [PATCH v5 4/5] OMAP: networking support for SPL

On Mon, Sep 17, 2012 at 1:55 PM, Ilya Yanok
<ilya.yanok <at> cogentembedded.com>wrote:

> > +#include <common.h>
>> > +#include <net.h>
>> > +#include <asm/omap_common.h>
>>
>> What in here needs this header?
>>
>
> Looks like it's unneeded. Thanks, I'll remove it.
>

Nope, it's needed for spl_parse_image_header.

Regards, Ilya.
_______________________________________________
U-Boot mailing list
U-Boot <at> lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Ilya Yanok | 5 Aug 2012 23:21
Favicon

[PATCH v4 5/5] am335x_evm: enable networking in SPL

This patch adds support for networking in SPL on TI AM335x based
boards. Vendor Class Identifier used by SPL during BOOTP is
"AM335x U-Boot SPL".

Signed-off-by: Ilya Yanok <ilya.yanok <at> cogentembedded.com>

---
Changes in v3:
 - set Vendor Class Identifier for SPL

Changes in v4:
 - SPL_BOARD_INIT is not needed anymore

 include/configs/am335x_evm.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 69ab076..d36ad8f 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
 <at>  <at>  -185,7 +185,7  <at>  <at> 
 /* Defines for SPL */
 #define CONFIG_SPL
 #define CONFIG_SPL_TEXT_BASE		0x402F0400
-#define CONFIG_SPL_MAX_SIZE		(46 * 1024)
+#define CONFIG_SPL_MAX_SIZE		(101 * 1024)
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK

 #define CONFIG_SPL_BSS_START_ADDR	0x80000000
 <at>  <at>  -205,6 +205,9  <at>  <at> 
(Continue reading)


Gmane