From patchwork Wed Oct 3 18:20:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?xYF1a2FzeiBEYcWCZWs=?= X-Patchwork-Id: 188888 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B99032C013B for ; Thu, 4 Oct 2012 04:21:12 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 70CFD2811E; Wed, 3 Oct 2012 20:21:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fGtlmE2XH3O9; Wed, 3 Oct 2012 20:21:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4FA7028112; Wed, 3 Oct 2012 20:21:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D13F28112 for ; Wed, 3 Oct 2012 20:21:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n9dRoc-51bHu for ; Wed, 3 Oct 2012 20:21:05 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by theia.denx.de (Postfix) with ESMTPS id 67FB92810F for ; Wed, 3 Oct 2012 20:21:03 +0200 (CEST) Received: by eekd4 with SMTP id d4so4040292eek.3 for ; Wed, 03 Oct 2012 11:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=6BW1gkWOcUWaPifhRJ+KdtpnBTIbhKFhTIRqbo3qHYk=; b=hnJ+umTegMmnrej4bk30NyM/++XYjL+L05xVxevSGiO6nBoo1nNxQwirErH0DSzAWf xRcIf6ur17a6aOz5+517BOTURZE3/4N5z73OQ7s8Qom6ydieexcl7J+rxPJqyh7vznQe 4hMJ0GQq9ZHWXtKJ3O/LCZHGgesHQKeQJ8vrmG/fvOg9RPHffQrPEoIo1GPJW0lAKzW+ 4ZyrNbp62OlmwIJEhvDR5EzweyjJQ0/gzBjtF/Waqih0IpejaWSuDzmhZIRCbEjCCulX taowNRi/jlOws+Es+fzE3xSyAYH17NGG24wV1jbPA2M3uS4/C6d8YMkZ1eYAg48k/I2u AXpA== Received: by 10.14.176.66 with SMTP id a42mr4050724eem.1.1349288463535; Wed, 03 Oct 2012 11:21:03 -0700 (PDT) Received: from mover.dalas.net (riviera.nat.student.pw.edu.pl. [194.29.137.1]) by mx.google.com with ESMTPS id 42sm11048985eee.0.2012.10.03.11.21.02 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 03 Oct 2012 11:21:03 -0700 (PDT) From: Lukasz Dalek To: u-boot@lists.denx.de Date: Wed, 3 Oct 2012 20:20:50 +0200 Message-Id: <1349288450-11095-1-git-send-email-luk0104@gmail.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <506C0A82.5050301@gmail.com> References: <506C0A82.5050301@gmail.com> Cc: marex@denx.de Subject: [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- Changes for v6: - Defined only one entire for board Changes for v5: - Surrendered #include with CONFIGs board/h2200/h2200.c | 17 +++++++++++++++++ boards.cfg | 2 +- include/configs/h2200.h | 27 +++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletions(-) diff --git a/board/h2200/h2200.c b/board/h2200/h2200.c index 3076306..617bb04 100644 --- a/board/h2200/h2200.c +++ b/board/h2200/h2200.c @@ -22,9 +22,20 @@ #include #include #include +#ifdef CONFIG_H2200_USBETH +# include +#endif 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 +47,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..f557c2b 100644 --- a/boards.cfg +++ b/boards.cfg @@ -282,7 +282,7 @@ dvlhost arm ixp pdnb3 arm ixp pdnb3 prodrive scpu arm ixp pdnb3 prodrive - pdnb3:SCPU balloon3 arm pxa -h2200 arm pxa +h2200 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 */