public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
Date: Wed, 3 Oct 2012 20:34:52 +0200	[thread overview]
Message-ID: <201210032034.53144.marex@denx.de> (raw)
In-Reply-To: <1349288450-11095-1-git-send-email-luk0104@gmail.com>

Dear Lukasz Dalek,

> 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>
> ---
> Changes for v6:
> 	- Defined only one entire for board
> Changes for v5:
> 	- Surrendered #include <usb.h> 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 <asm/arch/pxa.h>
>  #include <asm/arch/pxa-regs.h>
>  #include <asm/io.h>
> +#ifdef CONFIG_H2200_USBETH

It's always defined, remove it.

> +# include <usb.h>
> +#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                     
[...]

This change isn't needed if you remove CONFIG_H2200_USBETH

> 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

ifdef - endif not needed, otherwise good.

> +# 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 */

  reply	other threads:[~2012-10-03 18:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 22:51 [U-Boot] [PATCH v5 1/3] h2200: Add support for iPAQ h2200 palmtop Lukasz Dalek
2012-10-02 22:51 ` [U-Boot] [PATCH v5 2/3] pxa: Add code to examine cpu model and revision Lukasz Dalek
2012-10-02 22:51 ` [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support Lukasz Dalek
2012-10-03  0:06   ` Marek Vasut
2012-10-03  0:09     ` Łukasz Dałek
2012-10-03  0:18       ` Marek Vasut
2012-10-03  0:24         ` Łukasz Dałek
2012-10-03  0:25           ` Marek Vasut
2012-10-03  0:30             ` Łukasz Dałek
2012-10-03  1:04               ` Marek Vasut
2012-10-03  9:50                 ` Łukasz Dałek
2012-10-03 18:20                   ` [U-Boot] [PATCH v6] " Lukasz Dalek
2012-10-03 18:34                     ` Marek Vasut [this message]
2012-10-03 19:02                       ` Łukasz Dałek
2012-10-03 19:22                         ` Marek Vasut
2012-10-03 19:25                           ` Łukasz Dałek
2012-10-03 19:40                             ` Marek Vasut
2012-10-03 19:44                               ` Łukasz Dałek
2012-10-03 20:02                                 ` Marek Vasut
2012-10-03 21:10                                   ` Łukasz Dałek
2012-10-03 21:32                                     ` Marek Vasut
2012-10-03 21:46                                       ` [U-Boot] [PATCH v7] " Lukasz Dalek
2012-10-03 23:30                                         ` Marek Vasut

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=201210032034.53144.marex@denx.de \
    --to=marex@denx.de \
    --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