public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Dalek <luk0104@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 8/8] h2200: Add USB CDC ethernet support
Date: Tue,  2 Oct 2012 17:04:34 +0200	[thread overview]
Message-ID: <1349190274-1924-8-git-send-email-luk0104@gmail.com> (raw)
In-Reply-To: <1349190274-1924-1-git-send-email-luk0104@gmail.com>

Add support for ethernet over USB which can be used for e.g. booting
process. It works with tftp and dhcp clients code.

Signed-off-by: Lukasz Dalek <luk0104@gmail.com>
---
 board/h2200/h2200.c     |   15 +++++++++++++++
 boards.cfg              |    1 +
 include/configs/h2200.h |   27 +++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/board/h2200/h2200.c b/board/h2200/h2200.c
index 3076306..c5b084e 100644
--- a/board/h2200/h2200.c
+++ b/board/h2200/h2200.c
@@ -22,9 +22,18 @@
 #include <asm/arch/pxa.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/io.h>
+#include <usb.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_H2200_USBETH
+int board_eth_init(bd_t *bis)
+{
+	usb_eth_initialize(bis);
+	return 0;
+}
+#endif
+
 int board_init(void)
 {
 	/* We have RAM, disable cache */
@@ -36,6 +45,12 @@ int board_init(void)
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = 0xa0000100;
 
+	/* Let host see that device is disconnected */
+#if defined(CONFIG_H2200_USBETH)
+	udc_disconnect();
+	mdelay(500);
+#endif
+
 	return 0;
 }
 
diff --git a/boards.cfg b/boards.cfg
index ab10938..a03a469 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -283,6 +283,7 @@ pdnb3                        arm         ixp         pdnb3               prodriv
 scpu                         arm         ixp         pdnb3               prodrive       -           pdnb3:SCPU
 balloon3                     arm         pxa
 h2200                        arm         pxa
+h2200_usbeth                 arm         pxa         h2200               -              -           h2200:H2200_USBETH
 lubbock                      arm         pxa
 palmld                       arm         pxa
 palmtc                       arm         pxa
diff --git a/include/configs/h2200.h b/include/configs/h2200.h
index de5299b..4c5a1ae 100644
--- a/include/configs/h2200.h
+++ b/include/configs/h2200.h
@@ -153,4 +153,31 @@
 
 #define CONFIG_BOOTARGS "root=/dev/ram0 ro console=ttyS0,115200n8"
 
+#ifdef CONFIG_H2200_USBETH
+# define CONFIG_SYS_CONSOLE_IS_IN_ENV
+# define CONFIG_USB_DEV_PULLUP_GPIO	33
+/* USB VBUS GPIO 3 */
+
+# define CONFIG_CMD_NET
+# define CONFIG_CMD_PING
+
+# define CONFIG_BOOTDELAY		2
+# define CONFIG_BOOTCOMMAND		\
+	"setenv downloaded 0 ; while test $downloaded -eq 0 ; do " \
+	"if bootp ; then setenv downloaded 1 ; fi ; done ; " \
+	"source :script ; " \
+	"bootm ; "
+
+# define CONFIG_USB_GADGET_PXA2XX
+# define CONFIG_USB_ETHER
+# define CONFIG_USB_ETH_SUBSET
+
+# define CONFIG_USBNET_DEV_ADDR		"de:ad:be:ef:00:01"
+# define CONFIG_USBNET_HOST_ADDR	"de:ad:be:ef:00:02"
+# define CONFIG_EXTRA_ENV_SETTINGS \
+	"stdin=serial\0" \
+	"stdout=serial\0" \
+	"stderr=serial\0"
+#endif
+
 #endif /* __CONFIG_H */
-- 
1.7.8.6

  parent reply	other threads:[~2012-10-02 15:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 15:04 [U-Boot] [PATCH v4 1/8] h2200: Add support for iPAQ h2200 palmtop Lukasz Dalek
2012-10-02 15:04 ` [U-Boot] [PATCH v4 2/8] pxa: Add some stuff to examine cpu model and rev Lukasz Dalek
2012-10-02 19:36   ` Marek Vasut
2012-10-02 20:02     ` Łukasz Dałek
2012-10-02 15:04 ` [U-Boot] [PATCH v4 3/8] usbether: Fixed bug when using with PXA25X chips Lukasz Dalek
2012-10-02 15:04 ` [U-Boot] [PATCH v4 4/8] usbether: Define CONFIG_USB_ETH_{CDC, SUBSET} Lukasz Dalek
2012-10-02 15:04 ` [U-Boot] [PATCH v4 5/8] usbether: Removed DEV_CONFIG_{CDC,SUBSET} Lukasz Dalek
2012-10-02 15:04 ` [U-Boot] [PATCH v4 6/8] pxa25x: Add support for USB ethernet gadget Lukasz Dalek
2012-10-02 15:04 ` [U-Boot] [PATCH v4 7/8] usb.h: Add udc_disconnect prototype to usb.h Lukasz Dalek
2012-10-02 15:04 ` Lukasz Dalek [this message]
2012-10-02 19:35 ` [U-Boot] [PATCH v4 1/8] h2200: Add support for iPAQ h2200 palmtop Marek Vasut
2012-10-02 20:09   ` Łukasz Dałek
2012-10-02 20:19     ` Marek Vasut
2012-10-02 20:38       ` Łukasz Dałek

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=1349190274-1924-8-git-send-email-luk0104@gmail.com \
    --to=luk0104@gmail.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