public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v5 1/3] h2200: Add support for iPAQ h2200 palmtop
@ 2012-10-02 22:51 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
  0 siblings, 2 replies; 23+ messages in thread
From: Lukasz Dalek @ 2012-10-02 22:51 UTC (permalink / raw)
  To: u-boot

Add basic support for HP iPAQ h2200 palmtop. h2200 palmtop was targeted
to general consumers. It has 64 MB of RAM, 32 MB flash. No intergrated
Wi-Fi nor Ethernet. Based on Intel PXA255 processor. It was shipped with
Windows CE 4.2 operating system.

Signed-off-by: Lukasz Dalek <luk0104@gmail.com>
---
Changes for v5:
	- Fixed Makefile to use $(obj)

 board/h2200/Makefile       |   49 ++++++++++++++
 board/h2200/h2200-header.S |   27 ++++++++
 board/h2200/h2200.c        |   53 +++++++++++++++
 boards.cfg                 |    1 +
 include/configs/h2200.h    |  156 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 286 insertions(+), 0 deletions(-)
 create mode 100644 board/h2200/Makefile
 create mode 100644 board/h2200/h2200-header.S
 create mode 100644 board/h2200/h2200.c
 create mode 100644 include/configs/h2200.h

diff --git a/board/h2200/Makefile b/board/h2200/Makefile
new file mode 100644
index 0000000..51b1a9e
--- /dev/null
+++ b/board/h2200/Makefile
@@ -0,0 +1,49 @@
+#
+# h2200 Support
+#
+# Copyright (C) 2012 Lukasz Dalek <luk0104@gmail.com>
+#
+# 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., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	:= h2200.o
+
+SRCS	:= $(COBJS:.o=.c) h2200-header.S
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+all: $(LIB) $(obj)h2200-header.bin
+
+$(obj)h2200-header.o: h2200-header.S
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+$(obj)h2200-header.bin: $(obj)h2200-header.o
+	$(OBJCOPY) -O binary $< $@
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/h2200/h2200-header.S b/board/h2200/h2200-header.S
new file mode 100644
index 0000000..c335bfe
--- /dev/null
+++ b/board/h2200/h2200-header.S
@@ -0,0 +1,27 @@
+/*
+ * iPAQ h2200 header
+ *
+ * Copyright (C) 2012 Lukasz Dalek <luk0104@gmail.com>
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+	.word 0xea0003fe /* b 0x1000 */
+
+	.org 0x40
+	.ascii "ECEC"
+
+	.org 0x1000 - 1
+	.byte 0x0
diff --git a/board/h2200/h2200.c b/board/h2200/h2200.c
new file mode 100644
index 0000000..3076306
--- /dev/null
+++ b/board/h2200/h2200.c
@@ -0,0 +1,53 @@
+/*
+ * iPAQ h2200 board configuration
+ *
+ * Copyright (C) 2012 Lukasz Dalek <luk0104@gmail.com>
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <common.h>
+#include <asm/arch/pxa.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+	/* We have RAM, disable cache */
+	dcache_disable();
+	icache_disable();
+
+	gd->bd->bi_arch_number = MACH_TYPE_H2200;
+
+	/* adress of boot parameters */
+	gd->bd->bi_boot_params = 0xa0000100;
+
+	return 0;
+}
+
+int dram_init(void)
+{
+	/*
+	 * Everything except MSC0 was already set up by
+	 * 1st stage bootloader.
+	 *
+	 * This setting enables access to companion chip.
+	 */
+	clrsetbits_le32(MSC0, 0xffffffff, CONFIG_SYS_MSC0_VAL);
+	gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+	return 0;
+}
diff --git a/boards.cfg b/boards.cfg
index b4e0d3c..ab10938 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -282,6 +282,7 @@ dvlhost                      arm         ixp
 pdnb3                        arm         ixp         pdnb3               prodrive
 scpu                         arm         ixp         pdnb3               prodrive       -           pdnb3:SCPU
 balloon3                     arm         pxa
+h2200                        arm         pxa
 lubbock                      arm         pxa
 palmld                       arm         pxa
 palmtc                       arm         pxa
diff --git a/include/configs/h2200.h b/include/configs/h2200.h
new file mode 100644
index 0000000..de5299b
--- /dev/null
+++ b/include/configs/h2200.h
@@ -0,0 +1,156 @@
+/*
+ * iPAQ h2200 board configuration
+ *
+ * Copyright (C) 2012 Lukasz Dalek <luk0104@gmail.com>
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define MACH_TYPE_H2200			341
+#define CONFIG_MACH_TYPE		MACH_TYPE_H2200
+
+#define CONFIG_CPU_PXA25X		1
+#define CONFIG_BOARD_H2200
+
+#define CONFIG_SYS_NO_FLASH
+
+#define CONFIG_SYS_HZ			1000
+
+#define CONFIG_NR_DRAM_BANKS		1
+#define PHYS_SDRAM_1			0xa0000000 /* SDRAM Bank #1 */
+#define PHYS_SDRAM_1_SIZE		0x04000000 /* 64 MB */
+
+#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
+#define CONFIG_SYS_SDRAM_SIZE		PHYS_SDRAM_1_SIZE
+
+#define CONFIG_SYS_INIT_SP_ADDR		0xfffff800
+
+#define CONFIG_ENV_SIZE			0x00040000
+#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 128*1024)
+
+#define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_SYS_MAXARGS		16
+#define CONFIG_SYS_LOAD_ADDR		0xa3000000 /* default load address */
+
+/*
+ * iPAQ 1st stage bootloader loads 2nd stage bootloader
+ * at address 0xa0040000 but bootloader requires header
+ * which is 0x1000 long.
+ *
+ * --- Header begin ---
+ *	.word 0xea0003fe ; b 0x1000
+ *
+ *	.org 0x40
+ *	.ascii "ECEC"
+ *
+ *	.org 0x1000
+ * --- Header end ---
+ */
+
+#define CONFIG_SYS_TEXT_BASE		0xa0041000
+
+/*
+ * Static chips
+ */
+
+#define CONFIG_SYS_MSC0_VAL		0x246c7ffc
+#define CONFIG_SYS_MSC1_VAL		0x7ff07ff0
+#define CONFIG_SYS_MSC2_VAL		0x7ff07ff0
+
+/*
+ * PCMCIA and CF Interfaces
+ */
+
+#define CONFIG_SYS_MECR_VAL		0x00000000
+#define CONFIG_SYS_MCMEM0_VAL		0x00000000
+#define CONFIG_SYS_MCMEM1_VAL		0x00000000
+#define CONFIG_SYS_MCATT0_VAL		0x00000000
+#define CONFIG_SYS_MCATT1_VAL		0x00000000
+#define CONFIG_SYS_MCIO0_VAL		0x00000000
+#define CONFIG_SYS_MCIO1_VAL		0x00000000
+
+#define CONFIG_SYS_FLYCNFG_VAL		0x00000000
+#define CONFIG_SYS_SXCNFG_VAL		0x00040004
+
+#define CONFIG_SYS_MDREFR_VAL		0x0099E018
+#define CONFIG_SYS_MDCNFG_VAL		0x01C801CB
+#define CONFIG_SYS_MDMRS_VAL		0x00220022
+
+#define CONFIG_SYS_PSSR_VAL		0x00000000
+#define CONFIG_SYS_CKEN			0x00004840
+#define CONFIG_SYS_CCCR			0x00000161
+
+/*
+ * GPIOs
+ */
+
+#define CONFIG_SYS_GPSR0_VAL		0x01000000
+#define CONFIG_SYS_GPSR1_VAL		0x00000000
+#define CONFIG_SYS_GPSR2_VAL		0x00010000
+
+#define CONFIG_SYS_GPCR0_VAL		0x00000000
+#define CONFIG_SYS_GPCR1_VAL		0x00000000
+#define CONFIG_SYS_GPCR2_VAL		0x00000000
+
+#define CONFIG_SYS_GPDR0_VAL		0xF7E38C00
+#define CONFIG_SYS_GPDR1_VAL		0xBCFFBF83
+#define CONFIG_SYS_GPDR2_VAL		0x000157FF
+
+#define CONFIG_SYS_GAFR0_L_VAL		0x80401000
+#define CONFIG_SYS_GAFR0_U_VAL		0x00000112
+#define CONFIG_SYS_GAFR1_L_VAL		0x600A9550
+#define CONFIG_SYS_GAFR1_U_VAL		0x0005AAAA
+#define CONFIG_SYS_GAFR2_L_VAL		0x20000000
+#define CONFIG_SYS_GAFR2_U_VAL		0x00000000
+
+/*
+ * Serial port
+ */
+
+#define CONFIG_PXA_SERIAL
+#define CONFIG_FFUART
+
+#define CONFIG_BAUDRATE			115200
+#define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 38400, 115200 }
+
+#define CONFIG_CMD_IMPORTENV		1
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_SOURCE
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_IMI
+
+#define CONFIG_FIT
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_INITRD_TAG
+
+/* Monitor Command Prompt */
+#define CONFIG_SYS_PROMPT		"> "
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"$ "
+
+/* Console I/O Buffer Size */
+#define CONFIG_SYS_CBSIZE		256
+
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
+					sizeof(CONFIG_SYS_PROMPT) + 16)
+
+#define CONFIG_BOOTARGS "root=/dev/ram0 ro console=ttyS0,115200n8"
+
+#endif /* __CONFIG_H */
-- 
1.7.8.6

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v5 2/3] pxa: Add code to examine cpu model and revision
  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 ` Lukasz Dalek
  2012-10-02 22:51 ` [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support Lukasz Dalek
  1 sibling, 0 replies; 23+ messages in thread
From: Lukasz Dalek @ 2012-10-02 22:51 UTC (permalink / raw)
  To: u-boot

Add function which return CPU model and revision which can be used for
cpu detection.

Signed-off-by: Lukasz Dalek <luk0104@gmail.com>
---
Changes for v5:
	- Changed commit message

 arch/arm/cpu/pxa/cpuinfo.c          |   11 +++++++++--
 arch/arm/include/asm/arch-pxa/pxa.h |   13 +++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/pxa/cpuinfo.c b/arch/arm/cpu/pxa/cpuinfo.c
index f1cdd40..bab6340 100644
--- a/arch/arm/cpu/pxa/cpuinfo.c
+++ b/arch/arm/cpu/pxa/cpuinfo.c
@@ -24,9 +24,11 @@
 #include <errno.h>
 #include <linux/compiler.h>
 
-#define	CPU_MASK_PXA_REVID	0x00f
+#define	CPU_MASK_PXA_PRODID	0x000003f0
+#define	CPU_MASK_PXA_REVID	0x0000000f
+
+#define	CPU_MASK_PRODREV	(CPU_MASK_PXA_PRODID | CPU_MASK_PXA_REVID)
 
-#define	CPU_MASK_PXA_PRODID	0x3f0
 #define	CPU_VALUE_PXA25X	0x100
 #define	CPU_VALUE_PXA27X	0x110
 
@@ -51,6 +53,11 @@ int cpu_is_pxa27x(void)
 	return id == CPU_VALUE_PXA27X;
 }
 
+uint32_t pxa_get_cpu_revision(void)
+{
+	return pxa_get_cpuid() & CPU_MASK_PRODREV;
+}
+
 #ifdef	CONFIG_DISPLAY_CPUINFO
 static const char *pxa25x_get_revision(void)
 {
diff --git a/arch/arm/include/asm/arch-pxa/pxa.h b/arch/arm/include/asm/arch-pxa/pxa.h
index 49c6552..b67d8f2 100644
--- a/arch/arm/include/asm/arch-pxa/pxa.h
+++ b/arch/arm/include/asm/arch-pxa/pxa.h
@@ -22,8 +22,21 @@
 #ifndef	__PXA_H__
 #define	__PXA_H__
 
+#define PXA255_A0	0x00000106
+#define PXA250_C0	0x00000105
+#define PXA250_B2	0x00000104
+#define PXA250_B1	0x00000103
+#define PXA250_B0	0x00000102
+#define PXA250_A1	0x00000101
+#define PXA250_A0	0x00000100
+#define PXA210_C0	0x00000125
+#define PXA210_B2	0x00000124
+#define PXA210_B1	0x00000123
+#define PXA210_B0	0x00000122
+
 int cpu_is_pxa25x(void);
 int cpu_is_pxa27x(void);
+uint32_t pxa_get_cpu_revision(void);
 void pxa2xx_dram_init(void);
 
 #endif	/* __PXA_H__ */
-- 
1.7.8.6

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support
  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 ` Lukasz Dalek
  2012-10-03  0:06   ` Marek Vasut
  1 sibling, 1 reply; 23+ messages in thread
From: Lukasz Dalek @ 2012-10-02 22:51 UTC (permalink / raw)
  To: u-boot

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 v5:
	- Surrendered #include <usb.h> with CONFIGs

 board/h2200/h2200.c     |   17 +++++++++++++++++
 boards.cfg              |    1 +
 include/configs/h2200.h |   27 +++++++++++++++++++++++++++
 3 files changed, 45 insertions(+), 0 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
+# 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..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

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support
  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
  0 siblings, 1 reply; 23+ messages in thread
From: Marek Vasut @ 2012-10-03  0:06 UTC (permalink / raw)
  To: u-boot

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 v5:
> 	- Surrendered #include <usb.h> with CONFIGs
> 
>  board/h2200/h2200.c     |   17 +++++++++++++++++
>  boards.cfg              |    1 +
>  include/configs/h2200.h |   27 +++++++++++++++++++++++++++
>  3 files changed, 45 insertions(+), 0 deletions(-)
> 
[...]
> 
> 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               -

I told you to enable the USB ethernet by default, so why do you add this board?

[...]

btw. http://www.denx.de/wiki/U-Boot/Patches esp. the In-reply-to part.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support
  2012-10-03  0:06   ` Marek Vasut
@ 2012-10-03  0:09     ` Łukasz Dałek
  2012-10-03  0:18       ` Marek Vasut
  0 siblings, 1 reply; 23+ messages in thread
From: Łukasz Dałek @ 2012-10-03  0:09 UTC (permalink / raw)
  To: u-boot

On 03.10.2012 02:06, Marek Vasut wrote:
> 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 v5:
>> 	- Surrendered #include<usb.h>  with CONFIGs
>>
>>   board/h2200/h2200.c     |   17 +++++++++++++++++
>>   boards.cfg              |    1 +
>>   include/configs/h2200.h |   27 +++++++++++++++++++++++++++
>>   3 files changed, 45 insertions(+), 0 deletions(-)
>>
> [...]
>> 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               -
> I told you to enable the USB ethernet by default, so why do you add this board?

I don't understand.
We agreed to split h2200 support into two parts. First one adding basic
support for device, second one adding support for usb ethernet for
h2200.


?ukasz Da?ek

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support
  2012-10-03  0:09     ` Łukasz Dałek
@ 2012-10-03  0:18       ` Marek Vasut
  2012-10-03  0:24         ` Łukasz Dałek
  0 siblings, 1 reply; 23+ messages in thread
From: Marek Vasut @ 2012-10-03  0:18 UTC (permalink / raw)
  To: u-boot

Dear ?ukasz Da?ek,

> On 03.10.2012 02:06, Marek Vasut wrote:
> > 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 v5:
> >> 	- Surrendered #include<usb.h>  with CONFIGs
> >> 	
> >>   board/h2200/h2200.c     |   17 +++++++++++++++++
> >>   boards.cfg              |    1 +
> >>   include/configs/h2200.h |   27 +++++++++++++++++++++++++++
> >>   3 files changed, 45 insertions(+), 0 deletions(-)
> > 
> > [...]
> > 
> >> 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             
> >>  -
> > 
> > I told you to enable the USB ethernet by default, so why do you add this
> > board?
> 
> I don't understand.
> We agreed to split h2200 support into two parts. First one adding basic
> support for device, second one adding support for usb ethernet for
> h2200.

Yes, but I fail to understand why you need TWO board entries for that. Adding 
the USB ethernet support is just a feature, you don't need additional board 
entry for that ... so what is the idea behind adding it?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support
  2012-10-03  0:18       ` Marek Vasut
@ 2012-10-03  0:24         ` Łukasz Dałek
  2012-10-03  0:25           ` Marek Vasut
  0 siblings, 1 reply; 23+ messages in thread
From: Łukasz Dałek @ 2012-10-03  0:24 UTC (permalink / raw)
  To: u-boot

On 03.10.2012 02:18, Marek Vasut wrote:
> Dear ?ukasz Da?ek,
>
>> On 03.10.2012 02:06, Marek Vasut wrote:
>>> 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 v5:
>>>> 	- Surrendered #include<usb.h>   with CONFIGs
>>>> 	
>>>>    board/h2200/h2200.c     |   17 +++++++++++++++++
>>>>    boards.cfg              |    1 +
>>>>    include/configs/h2200.h |   27 +++++++++++++++++++++++++++
>>>>    3 files changed, 45 insertions(+), 0 deletions(-)
>>> [...]
>>>
>>>> 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
>>>>   -
>>> I told you to enable the USB ethernet by default, so why do you add this
>>> board?
>> I don't understand.
>> We agreed to split h2200 support into two parts. First one adding basic
>> support for device, second one adding support for usb ethernet for
>> h2200.
> Yes, but I fail to understand why you need TWO board entries for that. Adding
> the USB ethernet support is just a feature, you don't need additional board
> entry for that ... so what is the idea behind adding it?

Because easier is to type make h2200_usbeth_config than modifiy config.

?ukasz Da?ek

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support
  2012-10-03  0:24         ` Łukasz Dałek
@ 2012-10-03  0:25           ` Marek Vasut
  2012-10-03  0:30             ` Łukasz Dałek
  0 siblings, 1 reply; 23+ messages in thread
From: Marek Vasut @ 2012-10-03  0:25 UTC (permalink / raw)
  To: u-boot

Dear ?ukasz Da?ek,

> On 03.10.2012 02:18, Marek Vasut wrote:
> > Dear ?ukasz Da?ek,
> > 
> >> On 03.10.2012 02:06, Marek Vasut wrote:
> >>> 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 v5:
> >>>> 	- Surrendered #include<usb.h>   with CONFIGs
> >>>> 	
> >>>>    board/h2200/h2200.c     |   17 +++++++++++++++++
> >>>>    boards.cfg              |    1 +
> >>>>    include/configs/h2200.h |   27 +++++++++++++++++++++++++++
> >>>>    3 files changed, 45 insertions(+), 0 deletions(-)
> >>> 
> >>> [...]
> >>> 
> >>>> 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
> >>>> 
> >>>>   -
> >>> 
> >>> I told you to enable the USB ethernet by default, so why do you add
> >>> this board?
> >> 
> >> I don't understand.
> >> We agreed to split h2200 support into two parts. First one adding basic
> >> support for device, second one adding support for usb ethernet for
> >> h2200.
> > 
> > Yes, but I fail to understand why you need TWO board entries for that.
> > Adding the USB ethernet support is just a feature, you don't need
> > additional board entry for that ... so what is the idea behind adding
> > it?
> 
> Because easier is to type make h2200_usbeth_config than modifiy config.

Why don't you enable the USB ethernet by default for "h2200" target then?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support
  2012-10-03  0:25           ` Marek Vasut
@ 2012-10-03  0:30             ` Łukasz Dałek
  2012-10-03  1:04               ` Marek Vasut
  0 siblings, 1 reply; 23+ messages in thread
From: Łukasz Dałek @ 2012-10-03  0:30 UTC (permalink / raw)
  To: u-boot

On 03.10.2012 02:25, Marek Vasut wrote:
> Dear ?ukasz Da?ek,
>
>> On 03.10.2012 02:18, Marek Vasut wrote:
>>> Dear ?ukasz Da?ek,
>>>
>>>> On 03.10.2012 02:06, Marek Vasut wrote:
>>>>> 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 v5:
>>>>>> 	- Surrendered #include<usb.h>    with CONFIGs
>>>>>> 	
>>>>>>     board/h2200/h2200.c     |   17 +++++++++++++++++
>>>>>>     boards.cfg              |    1 +
>>>>>>     include/configs/h2200.h |   27 +++++++++++++++++++++++++++
>>>>>>     3 files changed, 45 insertions(+), 0 deletions(-)
>>>>> [...]
>>>>>
>>>>>> 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
>>>>>>
>>>>>>    -
>>>>> I told you to enable the USB ethernet by default, so why do you add
>>>>> this board?
>>>> I don't understand.
>>>> We agreed to split h2200 support into two parts. First one adding basic
>>>> support for device, second one adding support for usb ethernet for
>>>> h2200.
>>> Yes, but I fail to understand why you need TWO board entries for that.
>>> Adding the USB ethernet support is just a feature, you don't need
>>> additional board entry for that ... so what is the idea behind adding
>>> it?
>> Because easier is to type make h2200_usbeth_config than modifiy config.
> Why don't you enable the USB ethernet by default for "h2200" target then?
>
> Best regards,
> Marek Vasut
I will enable. This two entries really look weird.

?ukasz Da?ek

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support
  2012-10-03  0:30             ` Łukasz Dałek
@ 2012-10-03  1:04               ` Marek Vasut
  2012-10-03  9:50                 ` Łukasz Dałek
  0 siblings, 1 reply; 23+ messages in thread
From: Marek Vasut @ 2012-10-03  1:04 UTC (permalink / raw)
  To: u-boot

Dear ?ukasz Da?ek,

> On 03.10.2012 02:25, Marek Vasut wrote:
> > Dear ?ukasz Da?ek,
> > 
> >> On 03.10.2012 02:18, Marek Vasut wrote:
> >>> Dear ?ukasz Da?ek,
> >>> 
> >>>> On 03.10.2012 02:06, Marek Vasut wrote:
> >>>>> 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 v5:
> >>>>>> 	- Surrendered #include<usb.h>    with CONFIGs
> >>>>>> 	
> >>>>>>     board/h2200/h2200.c     |   17 +++++++++++++++++
> >>>>>>     boards.cfg              |    1 +
> >>>>>>     include/configs/h2200.h |   27 +++++++++++++++++++++++++++
> >>>>>>     3 files changed, 45 insertions(+), 0 deletions(-)
> >>>>> 
> >>>>> [...]
> >>>>> 
> >>>>>> 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
> >>>>>> 
> >>>>>>    -
> >>>>> 
> >>>>> I told you to enable the USB ethernet by default, so why do you add
> >>>>> this board?
> >>>> 
> >>>> I don't understand.
> >>>> We agreed to split h2200 support into two parts. First one adding
> >>>> basic support for device, second one adding support for usb ethernet
> >>>> for h2200.
> >>> 
> >>> Yes, but I fail to understand why you need TWO board entries for that.
> >>> Adding the USB ethernet support is just a feature, you don't need
> >>> additional board entry for that ... so what is the idea behind adding
> >>> it?
> >> 
> >> Because easier is to type make h2200_usbeth_config than modifiy config.
> > 
> > Why don't you enable the USB ethernet by default for "h2200" target then?
> > 
> > Best regards,
> > Marek Vasut
> 
> I will enable. This two entries really look weird.

Ok, so we're clear there'll be one entry with ethernet enabled called "h2200", 
yes?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support
  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
  0 siblings, 1 reply; 23+ messages in thread
From: Łukasz Dałek @ 2012-10-03  9:50 UTC (permalink / raw)
  To: u-boot

On 03.10.2012 03:04, Marek Vasut wrote:
> Dear ?ukasz Da?ek,
>
>> On 03.10.2012 02:25, Marek Vasut wrote:
>>> Dear ?ukasz Da?ek,
>>>
>>>> On 03.10.2012 02:18, Marek Vasut wrote:
>>>>> Dear ?ukasz Da?ek,
>>>>>
>>>>>> On 03.10.2012 02:06, Marek Vasut wrote:
>>>>>>> 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 v5:
>>>>>>>> 	- Surrendered #include<usb.h>     with CONFIGs
>>>>>>>> 	
>>>>>>>>      board/h2200/h2200.c     |   17 +++++++++++++++++
>>>>>>>>      boards.cfg              |    1 +
>>>>>>>>      include/configs/h2200.h |   27 +++++++++++++++++++++++++++
>>>>>>>>      3 files changed, 45 insertions(+), 0 deletions(-)
>>>>>>> [...]
>>>>>>>
>>>>>>>> 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
>>>>>>>>
>>>>>>>>     -
>>>>>>> I told you to enable the USB ethernet by default, so why do you add
>>>>>>> this board?
>>>>>> I don't understand.
>>>>>> We agreed to split h2200 support into two parts. First one adding
>>>>>> basic support for device, second one adding support for usb ethernet
>>>>>> for h2200.
>>>>> Yes, but I fail to understand why you need TWO board entries for that.
>>>>> Adding the USB ethernet support is just a feature, you don't need
>>>>> additional board entry for that ... so what is the idea behind adding
>>>>> it?
>>>> Because easier is to type make h2200_usbeth_config than modifiy config.
>>> Why don't you enable the USB ethernet by default for "h2200" target then?
>>>
>>> Best regards,
>>> Marek Vasut
>> I will enable. This two entries really look weird.
> Ok, so we're clear there'll be one entry with ethernet enabled called "h2200",
> yes?
>
> Best regards,
> Marek Vasut
Yes

?ukasz Da?ek

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
  2012-10-03  9:50                 ` Łukasz Dałek
@ 2012-10-03 18:20                   ` Lukasz Dalek
  2012-10-03 18:34                     ` Marek Vasut
  0 siblings, 1 reply; 23+ messages in thread
From: Lukasz Dalek @ 2012-10-03 18:20 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
  2012-10-03 18:20                   ` [U-Boot] [PATCH v6] " Lukasz Dalek
@ 2012-10-03 18:34                     ` Marek Vasut
  2012-10-03 19:02                       ` Łukasz Dałek
  0 siblings, 1 reply; 23+ messages in thread
From: Marek Vasut @ 2012-10-03 18:34 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
  2012-10-03 18:34                     ` Marek Vasut
@ 2012-10-03 19:02                       ` Łukasz Dałek
  2012-10-03 19:22                         ` Marek Vasut
  0 siblings, 1 reply; 23+ messages in thread
From: Łukasz Dałek @ 2012-10-03 19:02 UTC (permalink / raw)
  To: u-boot

On 03.10.2012 20:34, Marek Vasut wrote:
> 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 */
Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be able to
disable USB ethernet support.

?ukasz Da?ek

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
  2012-10-03 19:02                       ` Łukasz Dałek
@ 2012-10-03 19:22                         ` Marek Vasut
  2012-10-03 19:25                           ` Łukasz Dałek
  0 siblings, 1 reply; 23+ messages in thread
From: Marek Vasut @ 2012-10-03 19:22 UTC (permalink / raw)
  To: u-boot

Dear ?ukasz Da?ek,

> On 03.10.2012 20:34, Marek Vasut wrote:
> > 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 */
> 
> Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be able to
> disable USB ethernet support.

Why would you disable it?

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
  2012-10-03 19:22                         ` Marek Vasut
@ 2012-10-03 19:25                           ` Łukasz Dałek
  2012-10-03 19:40                             ` Marek Vasut
  0 siblings, 1 reply; 23+ messages in thread
From: Łukasz Dałek @ 2012-10-03 19:25 UTC (permalink / raw)
  To: u-boot

On 03.10.2012 21:22, Marek Vasut wrote:
> Dear ?ukasz Da?ek,
>
>> On 03.10.2012 20:34, Marek Vasut wrote:
>>> 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 */
>> Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be able to
>> disable USB ethernet support.
> Why would you disable it?
Because of other gadgets, e.g. ttyACM

?ukasz Da?ek

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
  2012-10-03 19:25                           ` Łukasz Dałek
@ 2012-10-03 19:40                             ` Marek Vasut
  2012-10-03 19:44                               ` Łukasz Dałek
  0 siblings, 1 reply; 23+ messages in thread
From: Marek Vasut @ 2012-10-03 19:40 UTC (permalink / raw)
  To: u-boot

Dear ?ukasz Da?ek,

[...]
> >> 
> >> Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be able
> >> to disable USB ethernet support.
> > 
> > Why would you disable it?
> 
> Because of other gadgets, e.g. ttyACM

Can't these co-exist?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
  2012-10-03 19:40                             ` Marek Vasut
@ 2012-10-03 19:44                               ` Łukasz Dałek
  2012-10-03 20:02                                 ` Marek Vasut
  0 siblings, 1 reply; 23+ messages in thread
From: Łukasz Dałek @ 2012-10-03 19:44 UTC (permalink / raw)
  To: u-boot

On 03.10.2012 21:40, Marek Vasut wrote:
> Dear ?ukasz Da?ek,
>
> [...]
>>>> Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be able
>>>> to disable USB ethernet support.
>>> Why would you disable it?
>> Because of other gadgets, e.g. ttyACM
> Can't these co-exist?
>
> Best regards,
> Marek Vasut

No they can't.

?ukasz Da?ek

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
  2012-10-03 19:44                               ` Łukasz Dałek
@ 2012-10-03 20:02                                 ` Marek Vasut
  2012-10-03 21:10                                   ` Łukasz Dałek
  0 siblings, 1 reply; 23+ messages in thread
From: Marek Vasut @ 2012-10-03 20:02 UTC (permalink / raw)
  To: u-boot

Dear ?ukasz Da?ek,

> On 03.10.2012 21:40, Marek Vasut wrote:
> > Dear ?ukasz Da?ek,
> > 
> > [...]
> > 
> >>>> Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be
> >>>> able to disable USB ethernet support.
> >>> 
> >>> Why would you disable it?
> >> 
> >> Because of other gadgets, e.g. ttyACM
> > 
> > Can't these co-exist?
> > 
> > Best regards,
> > Marek Vasut
> 
> No they can't.

Not even with the composite driver ? What's ttyacm and where is it in u-boot btw 
?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
  2012-10-03 20:02                                 ` Marek Vasut
@ 2012-10-03 21:10                                   ` Łukasz Dałek
  2012-10-03 21:32                                     ` Marek Vasut
  0 siblings, 1 reply; 23+ messages in thread
From: Łukasz Dałek @ 2012-10-03 21:10 UTC (permalink / raw)
  To: u-boot

On 03.10.2012 22:02, Marek Vasut wrote:
> Dear ?ukasz Da?ek,
>
>> On 03.10.2012 21:40, Marek Vasut wrote:
>>> Dear ?ukasz Da?ek,
>>>
>>> [...]
>>>
>>>>>> Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be
>>>>>> able to disable USB ethernet support.
>>>>> Why would you disable it?
>>>> Because of other gadgets, e.g. ttyACM
>>> Can't these co-exist?
>>>
>>> Best regards,
>>> Marek Vasut
>> No they can't.
> Not even with the composite driver ? What's ttyacm and where is it in u-boot btw
> ?
>
> Best regards,
> Marek Vasut

As far as I know they can't exists on pxa25x. I don't know how about pxa27x.

ttyacm is a serial over usb.

Driver exists in u-boot for pxa27x (gadget/usb/pxa27x_udc.c) but I have 
my own
for pxa25x not published.

?ukasz Da?ek

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support
  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
  0 siblings, 1 reply; 23+ messages in thread
From: Marek Vasut @ 2012-10-03 21:32 UTC (permalink / raw)
  To: u-boot

Dear ?ukasz Da?ek,

> On 03.10.2012 22:02, Marek Vasut wrote:
> > Dear ?ukasz Da?ek,
> > 
> >> On 03.10.2012 21:40, Marek Vasut wrote:
> >>> Dear ?ukasz Da?ek,
> >>> 
> >>> [...]
> >>> 
> >>>>>> Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be
> >>>>>> able to disable USB ethernet support.
> >>>>> 
> >>>>> Why would you disable it?
> >>>> 
> >>>> Because of other gadgets, e.g. ttyACM
> >>> 
> >>> Can't these co-exist?
> >>> 
> >>> Best regards,
> >>> Marek Vasut
> >> 
> >> No they can't.
> > 
> > Not even with the composite driver ? What's ttyacm and where is it in
> > u-boot btw ?
> > 
> > Best regards,
> > Marek Vasut
> 
> As far as I know they can't exists on pxa25x. I don't know how about
> pxa27x.
> 
> ttyacm is a serial over usb.
> 
> Driver exists in u-boot for pxa27x (gadget/usb/pxa27x_udc.c) but I have
> my own
> for pxa25x not published.

Your own... what? Check the composite driver, add the ifdefs when you need them, 
not prematurely.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v7] h2200: Add USB CDC ethernet support
  2012-10-03 21:32                                     ` Marek Vasut
@ 2012-10-03 21:46                                       ` Lukasz Dalek
  2012-10-03 23:30                                         ` Marek Vasut
  0 siblings, 1 reply; 23+ messages in thread
From: Lukasz Dalek @ 2012-10-03 21:46 UTC (permalink / raw)
  To: u-boot

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 v7:
	- Removed CONFIG_H2200_USBETH
Changes for v6:
	- Defined only one entire for board
Changes for v5:
	- Surrendered #include <usb.h> with CONFIGs

 board/h2200/h2200.c     |   11 +++++++++++
 include/configs/h2200.h |   25 +++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/board/h2200/h2200.c b/board/h2200/h2200.c
index 3076306..720b06e 100644
--- a/board/h2200/h2200.c
+++ b/board/h2200/h2200.c
@@ -22,9 +22,16 @@
 #include <asm/arch/pxa.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/io.h>
+#include <usb.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+int board_eth_init(bd_t *bis)
+{
+	usb_eth_initialize(bis);
+	return 0;
+}
+
 int board_init(void)
 {
 	/* We have RAM, disable cache */
@@ -36,6 +43,10 @@ int board_init(void)
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = 0xa0000100;
 
+	/* Let host see that device is disconnected */
+	udc_disconnect();
+	mdelay(500);
+
 	return 0;
 }
 
diff --git a/include/configs/h2200.h b/include/configs/h2200.h
index de5299b..db406e5 100644
--- a/include/configs/h2200.h
+++ b/include/configs/h2200.h
@@ -153,4 +153,29 @@
 
 #define CONFIG_BOOTARGS "root=/dev/ram0 ro console=ttyS0,115200n8"
 
+#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 /* __CONFIG_H */
-- 
1.7.8.6

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [U-Boot] [PATCH v7] h2200: Add USB CDC ethernet support
  2012-10-03 21:46                                       ` [U-Boot] [PATCH v7] " Lukasz Dalek
@ 2012-10-03 23:30                                         ` Marek Vasut
  0 siblings, 0 replies; 23+ messages in thread
From: Marek Vasut @ 2012-10-03 23:30 UTC (permalink / raw)
  To: u-boot

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>

I'll apply once -pxa is pulled into -next. Thanks
[...]
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2012-10-03 23:30 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox