Re: [U-Boot] [PATCH v6 3/4] OMAP: networking support for SPL

2012-09-18 Thread Ilya Yanok
Hi Tom,

On Tue, Sep 18, 2012 at 4:17 AM, Tom Rini tr...@ti.com wrote:


 Please add a GPLv2+ header to the file, thanks.


Done.



  diff --git a/lib/vsprintf.c b/lib/vsprintf.c index e38a4b7..6bb819c
  100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -784,7 +784,7
  @@ void panic(const char *fmt, ...) vprintf(fmt, args);
  putc('\n'); va_end(args); -#if defined (CONFIG_PANIC_HANG) +#if
  defined (CONFIG_PANIC_HANG) || defined(CONFIG_SPL_BUILD) hang();
  #else udelay (10);/* allow messages to go out */

 Oh no, this change...  Do we still really need this?


Seems like it's not needed anymore. I've removed it.



  diff --git a/net/tftp.c b/net/tftp.c index 59a8ebb..baba8f3 100644
  --- a/net/tftp.c +++ b/net/tftp.c @@ -7,6 +7,10 @@ */
 
  #include common.h +#ifdef CONFIG_SPL_BUILD +#undef
  CONFIG_CMD_TFTPPUT +#undef CONFIG_CMD_TFTPSRV +#endif #include
  command.h #include net.h #include tftp.h

 Missed this.


Yes, sorry.



 Also I saw a few manual inclusions of config_uncmd_spl.h, please fix
 those since mkconfig adds it always.  Thanks.


Hm, I can't see any.

I reposted only this patch. Hope it's ok now.

Regards, Ilya.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v6 3/4] OMAP: networking support for SPL

2012-09-17 Thread Ilya Yanok
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.ya...@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
 - undefine unneeded CONFIG_CMD_* while building SPL to save space

Changes in v6:
 - remove some unneeded changes introduced by earlier versions
 - switch clauses and use ifdef instead of ifndef
 - create new header config_uncmd_spl.h which undefines CONFIG_CMD_*
   options unneeded in SPL and include it last from config.h
 - remove explicit undefs from net/net.c and net/bootp.c

 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  |4 +++
 common/cmd_nvedit.c  |8 +
 common/env_common.c  |7 ++--
 include/bootstage.h  |6 +++-
 include/config_uncmd_spl.h   |   24 ++
 lib/Makefile |9 --
 lib/hashtable.c  |2 ++
 lib/vsprintf.c   |2 +-
 mkconfig |1 +
 net/bootp.c  |7 +++-
 net/tftp.c   |4 +++
 spl/Makefile |3 ++
 16 files changed, 138 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl_net.c
 create mode 100644 include/config_uncmd_spl.h

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
@@ -53,6 +53,9 @@ endif
 ifdef CONFIG_SPL_YMODEM_SUPPORT
 COBJS  += spl_ymodem.o
 endif
+ifdef CONFIG_SPL_NET_SUPPORT
+COBJS  += spl_net.o
+endif
 endif
 
 ifndef CONFIG_SPL_BUILD
diff --git a/arch/arm/cpu/armv7/omap-common/spl.c 
b/arch/arm/cpu/armv7/omap-common/spl.c
index f0d766c..53b9261 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -178,6 +178,15 @@ void board_init_r(gd_t *id, ulong dummy)
spl_ymodem_load_image();
break;
 #endif
+#ifdef CONFIG_SPL_ETH_SUPPORT
+   case BOOT_DEVICE_CPGMAC:
+#ifdef CONFIG_SPL_ETH_DEVICE
+   spl_net_load_image(CONFIG_SPL_ETH_DEVICE);
+#else
+   spl_net_load_image(NULL);
+#endif
+   break;
+#endif
default:
printf(SPL: Un-supported Boot Device - %d!!!\n, boot_device);
hang();
diff --git a/arch/arm/cpu/armv7/omap-common/spl_net.c 
b/arch/arm/cpu/armv7/omap-common/spl_net.c
new file mode 100644
index 000..cbb3087
--- /dev/null
+++ b/arch/arm/cpu/armv7/omap-common/spl_net.c
@@ -0,0 +1,52 @@
+/*
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * (C) Copyright 2012
+ * Ilya Yanok ilya.ya...@gmail.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc.
+ */
+#include common.h
+#include net.h
+#include asm/omap_common.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void spl_net_load_image(const char *device)
+{
+   int rv;
+
+   

Re: [U-Boot] [PATCH v6 3/4] OMAP: networking support for SPL

2012-09-17 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/17/12 13:26, Ilya Yanok 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.ya...@cogentembedded.com
[snip]
 diff --git a/include/config_uncmd_spl.h
 b/include/config_uncmd_spl.h new file mode 100644 index
 000..8ad6045 --- /dev/null +++ b/include/config_uncmd_spl.h @@
 -0,0 +1,24 @@ +/* + * We don't use any commands in SPL, but generic
 networking code + * has some features enabled/disabled based on
 CONFIG_CMD_* + * options. As we want a minimal set of features
 included + * into network SPL image, we undefine some config
 options here. + */ + +#ifndef __CONFIG_UNCMD_SPL_H__ +#define
 __CONFIG_UNCMD_SPL_H__ + +#ifdef CONFIG_SPL_BUILD +/* SPL needs
 only BOOTP + TFTP so undefine other stuff to save space */ +#undef
 CONFIG_CMD_CDP +#undef CONFIG_CMD_DHCP +#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 /*
 CONFIG_SPL_BUILD */ +#endif /* __CONFIG_UNCMD_SPL_H__ */

Please add a GPLv2+ header to the file, thanks.

 diff --git a/lib/vsprintf.c b/lib/vsprintf.c index e38a4b7..6bb819c
 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -784,7 +784,7
 @@ void panic(const char *fmt, ...) vprintf(fmt, args); 
 putc('\n'); va_end(args); -#if defined (CONFIG_PANIC_HANG) +#if
 defined (CONFIG_PANIC_HANG) || defined(CONFIG_SPL_BUILD) hang(); 
 #else udelay (10);/* allow messages to go out */

Oh no, this change...  Do we still really need this?

 diff --git a/net/tftp.c b/net/tftp.c index 59a8ebb..baba8f3 100644 
 --- a/net/tftp.c +++ b/net/tftp.c @@ -7,6 +7,10 @@ */
 
 #include common.h +#ifdef CONFIG_SPL_BUILD +#undef
 CONFIG_CMD_TFTPPUT +#undef CONFIG_CMD_TFTPSRV +#endif #include
 command.h #include net.h #include tftp.h

Missed this.

Also I saw a few manual inclusions of config_uncmd_spl.h, please fix
those since mkconfig adds it always.  Thanks.

- -- 
Tom

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQV721AAoJENk4IS6UOR1WHnUP+wdiliv2T4GUH/Z39TYoW0uo
WqAREC3pHZ9YMYKSZgGGOHwlAOuk2az5GPAqiCaXLLIgx43h5tkQnjbBHlB0T9rv
R+uqy4LF0Lxyz86ITSf4nmpkn66gnd5L6ET2b46Siof+PFIzNLEnM0Z0sWpnsWAU
ZlKnwS/Y/VAKDiwW5rxWiXTbs1vMHn8BWU+wTVrMLE80Sm3yE/C5mpzOBl42+O+V
kmo/nUNIiTK4C8VmlvL7+w+mqMPDtB4nSFFmmjmH7z8991RBhLJ0Nmlg26wmtXDL
Vyy5Jg6SQRSuyDJFplvoPu7FVhgI2umRxOIl6SEONKzSQQSBQmMqtIZV4pW4hFVZ
3RO5wrr0RKpJJy4Izb2MoGqvUv4fDIK9K2xiQihBUkc4X7UCpPMMqBpLwKVSoIdW
1y7o+2LzUAlBU9q/nP+ZHBzZFL9jYZHEDaYkuY+MT7i+tLcW2T6dV0Q4KsXTwHhx
D9zbU6tEXbgRZr/n8gUMeSWu7r6F2tr3a4UiTMsAP8lkVyXUPmYnfUhpxQrUuIx/
yuGmpigYPNicvP1hiU/quX2Fxxx2kuy3gDLVIc7tZv0VSmW6NI+WZC8inGBhk4Bb
GsZaYkoZnv799Z7GJy8wqCszSqb4BmI9wB3Hzz49jiwurvz/n7tDKEOtjjcIWCZc
MXsKY53Ulu6dW0vk5qQK
=2lLS
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot