Skip to contentSkip to conversation

h2200: Add support for iPAQ h2200 palmtop

PATCH Superseded Lukasz Dalek 2 participants 14 messages Oct 2, 2012

Subsystems (2)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/8 h2200: Add support for iPAQ h2200 palmtop

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.

---
 board/h2200/Makefile       |   51 ++++++++++++++
 board/h2200/h2200-header.S |   27 ++++++++
 board/h2200/h2200.c        |   53 +++++++++++++++
 boards.cfg                 |    1 +
 include/configs/h2200.h    |  156 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 288 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
board/h2200/Makefile new file +51 -0
new file mode 100644
index 0000000..2265aa9
@@ -0,0 +1,51 @@
+#
+# h2200 Support
+#
+# Copyright (C) 2012 Lukasz Dalek <[email protected]>
+#
+# 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) h2200-header.bin
+
+h2200-header.o: h2200-header.S
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+h2200-header.bin: h2200-header.o
+	$(OBJCOPY) -O binary $< $@
+
+all: $(LIB) h2200-header.bin
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/h2200/h2200-header.S new file +27 -0
new file mode 100644
index 0000000..c335bfe
@@ -0,0 +1,27 @@
+/*
+ * iPAQ h2200 header
+ *
+ * Copyright (C) 2012 Lukasz Dalek <[email protected]>
+ *
+ * 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
board/h2200/h2200.c new file +53 -0

53 lines not on this page · raw message

boards.cfg +1 -0
index b4e0d3c..ab10938 100644
@@ -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
include/configs/h2200.h new file +156 -0

156 lines not on this page · raw message

Signature · 1 line
1.7.8.6
#1 lore raw

PATCH v4 2/8 pxa: Add some stuff to examine cpu model and rev

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

---
 arch/arm/cpu/pxa/cpuinfo.c          |   11 +++++++++--
 arch/arm/include/asm/arch-pxa/pxa.h |   13 +++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)
arch/arm/cpu/pxa/cpuinfo.c +9 -2
index f1cdd40..bab6340 100644
@@ -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)
 {
arch/arm/include/asm/arch-pxa/pxa.h +13 -0
index 49c6552..b67d8f2 100644
@@ -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__ */
Signature · 1 line
1.7.8.6
#2 lore raw

PATCH v4 2/8 pxa: Add some stuff to examine cpu model and rev

Dear Lukasz Dalek,

Quoted 4 lines

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

[...]

s/some stuff/code/ would be really nicer.

I think the rest of the patches are ok ... unless they changed?

Best regards,
Marek Vasut

#3 lore raw

PATCH v4 2/8 pxa: Add some stuff to examine cpu model and rev

Quoted 11 lines · Marek Vasut

Dear Lukasz Dalek,

Quoted 4 lines

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

[...]

s/some stuff/code/ would be really nicer.

I think the rest of the patches are ok ... unless they changed?

Nothing changed except patch 7/8 where I only added nicer comment

?ukasz Da?ek

#4 lore raw

PATCH v4 3/8 usbether: Fixed bug when using with PXA25X chips

In reply to Lukasz Dalek

PXA25X chips don't support alternate settings so driver uses non-CDC driver.
But only code defined between DEV_CONFIG_CDC signals that network is up. This patch is fixing this bug by signaling that network is up after USB SET_INTERFACE request.

---
 drivers/usb/gadget/ether.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
drivers/usb/gadget/ether.c +16 -1
index d975fb6..9ce2c17 100644
@@ -44,7 +44,12 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#define DEV_CONFIG_CDC	1
+#ifdef CONFIG_USB_GADGET_PXA2XX
+# undef DEV_CONFIG_CDC
+# define DEV_CONFIG_SUBSET 1
+#else
+# define DEV_CONFIG_CDC	1
+#endif
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
@@ -864,7 +869,9 @@ static struct usb_gadget_strings	stringtab = {
 
 /*============================================================================*/
 static u8 control_req[USB_BUFSIZ];
+#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
+#endif
 
 
 /**
@@ -1352,6 +1359,14 @@ eth_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 		if (gadget_is_pxa(gadget)) {
 			value = eth_set_config(dev, DEV_CONFIG_VALUE,
 						GFP_ATOMIC);
+			/*
+			 * PXA25x driver use non-CDC ethernet gadget.
+			 * But only _CDC and _RNDIS code can signalize
+			 * that network is working. So we signalize it
+			 * here.
+			 */
+			l_ethdev.network_started = 1;
+			debug("USB network up!\n");
 			goto done_set_intf;
 		}
 
Signature · 1 line
1.7.8.6
#5 lore raw

PATCH v4 4/8 usbether: Define CONFIG_USB_ETH_{CDC, SUBSET}

In reply to Lukasz Dalek

Introduced CONFIG_USB_ETH_CDC and CONFIG_USB_ETH_SUBSET as preparation for removal DEV_CONFIG_CDC and DEV_CONFIG_SUBSET

---
 drivers/usb/gadget/ether.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)
drivers/usb/gadget/ether.c +14 -5
index 9ce2c17..7e6491d 100644
@@ -44,12 +44,21 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#ifdef CONFIG_USB_GADGET_PXA2XX
-# undef DEV_CONFIG_CDC
-# define DEV_CONFIG_SUBSET 1
-#else
-# define DEV_CONFIG_CDC	1
+#undef DEV_CONFIG_CDC
+#undef DEV_CONFIG_SUBSET
+
+#if !defined(CONFIG_USB_ETH_CDC) && !defined(CONFIG_USB_ETH_SUBSET)
+# define DEV_CONFIG_CDC		1	/* preserve default behavior */
+#endif
+
+#if defined(CONFIG_USB_ETH_CDC)
+# define DEV_CONFIG_CDC		1
 #endif
+
+#if defined(CONFIG_USB_ETH_SUBSET)
+# define DEV_CONFIG_SUBSET	1
+#endif
+
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
Signature · 1 line
1.7.8.6
#6 lore raw

PATCH v4 5/8 usbether: Removed DEV_CONFIG_{CDC,SUBSET}

In reply to Lukasz Dalek

Removed DEV_CONFIG_CDC and DEV_CONFIG_SUBSET and replaced it with CONFIG_USB_ETH_CDC and CONFIG_USB_ETH_SUBSET.

---
 drivers/usb/gadget/ether.c |   75 +++++++++++++++++--------------------------
 1 files changed, 30 insertions(+), 45 deletions(-)
drivers/usb/gadget/ether.c +30 -45
index 7e6491d..1e187e5 100644
@@ -44,21 +44,6 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#undef DEV_CONFIG_CDC
-#undef DEV_CONFIG_SUBSET
-
-#if !defined(CONFIG_USB_ETH_CDC) && !defined(CONFIG_USB_ETH_SUBSET)
-# define DEV_CONFIG_CDC		1	/* preserve default behavior */
-#endif
-
-#if defined(CONFIG_USB_ETH_CDC)
-# define DEV_CONFIG_CDC		1
-#endif
-
-#if defined(CONFIG_USB_ETH_SUBSET)
-# define DEV_CONFIG_SUBSET	1
-#endif
-
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
@@ -174,9 +159,9 @@ static struct usb_gadget_driver eth_driver;
 /* "main" config is either CDC, or its simple subset */
 static inline int is_cdc(struct eth_dev *dev)
 {
-#if	!defined(DEV_CONFIG_SUBSET)
+#if	!defined(CONFIG_USB_ETH_SUBSET)
 	return 1;		/* only cdc possible */
-#elif	!defined(DEV_CONFIG_CDC)
+#elif	!defined(CONFIG_USB_ETH_CDC)
 	return 0;		/* only subset possible */
 #else
 	return dev->cdc;	/* depends on what hardware we found */
@@ -420,7 +405,7 @@ rndis_config = {
  * get those drivers from MCCI, or bundled with various products.
  */
 
-#ifdef	DEV_CONFIG_CDC
+#ifdef	CONFIG_USB_ETH_CDC
 static struct usb_interface_descriptor
 control_intf = {
 	.bLength =		sizeof control_intf,
@@ -459,7 +444,7 @@ static const struct usb_cdc_header_desc header_desc = {
 	.bcdCDC =		__constant_cpu_to_le16(0x0110),
 };
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 
 static const struct usb_cdc_union_desc union_desc = {
 	.bLength =		sizeof union_desc,
@@ -493,7 +478,7 @@ static const struct usb_cdc_acm_descriptor acm_descriptor = {
 
 #endif
 
-#ifndef DEV_CONFIG_CDC
+#ifndef CONFIG_USB_ETH_CDC
 
 /*
  * "SAFE" loosely follows CDC WMC MDLM, violating the spec in various
@@ -543,7 +528,7 @@ static const struct usb_cdc_ether_desc ether_desc = {
 	.bNumberPowerFilters =	0,
 };
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 
 /*
  * include the status endpoint if we can, even where it's optional.
@@ -575,7 +560,7 @@ fs_status_desc = {
 };
 #endif
 
-#ifdef	DEV_CONFIG_CDC
+#ifdef	CONFIG_USB_ETH_CDC
 
 /* the default data interface has no endpoints ... */
 
@@ -630,7 +615,7 @@ rndis_data_intf = {
 
 #endif
 
-#ifdef DEV_CONFIG_SUBSET
+#ifdef CONFIG_USB_ETH_SUBSET
 
 /*
  * "Simple" CDC-subset option is a simple vendor-neutral model that most
@@ -676,7 +661,7 @@ fs_sink_desc = {
 
 static const struct usb_descriptor_header *fs_eth_function[11] = {
 	(struct usb_descriptor_header *) &otg_descriptor,
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 	/* "cdc" mode descriptors */
 	(struct usb_descriptor_header *) &control_intf,
 	(struct usb_descriptor_header *) &header_desc,
@@ -690,12 +675,12 @@ static const struct usb_descriptor_header *fs_eth_function[11] = {
 	(struct usb_descriptor_header *) &fs_source_desc,
 	(struct usb_descriptor_header *) &fs_sink_desc,
 	NULL,
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 };
 
 static inline void fs_subset_descriptors(void)
 {
-#ifdef DEV_CONFIG_SUBSET
+#ifdef CONFIG_USB_ETH_SUBSET
 	/* behavior is "CDC Subset"; extra descriptors say "SAFE" */
 	fs_eth_function[1] = (struct usb_descriptor_header *) &subset_data_intf;
 	fs_eth_function[2] = (struct usb_descriptor_header *) &header_desc;
@@ -733,7 +718,7 @@ static const struct usb_descriptor_header *fs_rndis_function[] = {
  * descriptors, unless they only run at full speed.
  */
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 static struct usb_endpoint_descriptor
 hs_status_desc = {
 	.bLength =		USB_DT_ENDPOINT_SIZE,
@@ -743,7 +728,7 @@ hs_status_desc = {
 	.wMaxPacketSize =	__constant_cpu_to_le16(STATUS_BYTECOUNT),
 	.bInterval =		LOG2_STATUS_INTERVAL_MSEC + 4,
 };
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 
 static struct usb_endpoint_descriptor
 hs_source_desc = {
@@ -776,7 +761,7 @@ dev_qualifier = {
 
 static const struct usb_descriptor_header *hs_eth_function[11] = {
 	(struct usb_descriptor_header *) &otg_descriptor,
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 	/* "cdc" mode descriptors */
 	(struct usb_descriptor_header *) &control_intf,
 	(struct usb_descriptor_header *) &header_desc,
@@ -790,12 +775,12 @@ static const struct usb_descriptor_header *hs_eth_function[11] = {
 	(struct usb_descriptor_header *) &hs_source_desc,
 	(struct usb_descriptor_header *) &hs_sink_desc,
 	NULL,
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 };
 
 static inline void hs_subset_descriptors(void)
 {
-#ifdef DEV_CONFIG_SUBSET
+#ifdef CONFIG_USB_ETH_SUBSET
 	/* behavior is "CDC Subset"; extra descriptors say "SAFE" */
 	hs_eth_function[1] = (struct usb_descriptor_header *) &subset_data_intf;
 	hs_eth_function[2] = (struct usb_descriptor_header *) &header_desc;
@@ -857,11 +842,11 @@ static struct usb_string		strings[] = {
 	{ STRING_SERIALNUMBER,	serial_number, },
 	{ STRING_DATA,		"Ethernet Data", },
 	{ STRING_ETHADDR,	ethaddr, },
-#ifdef	DEV_CONFIG_CDC
+#ifdef	CONFIG_USB_ETH_CDC
 	{ STRING_CDC,		"CDC Ethernet", },
 	{ STRING_CONTROL,	"CDC Communications Control", },
 #endif
-#ifdef	DEV_CONFIG_SUBSET
+#ifdef	CONFIG_USB_ETH_SUBSET
 	{ STRING_SUBSET,	"CDC Ethernet Subset", },
 #endif
 #ifdef	CONFIG_USB_ETH_RNDIS
@@ -878,7 +863,7 @@ static struct usb_gadget_strings	stringtab = {
 
 /*============================================================================*/
 static u8 control_req[USB_BUFSIZ];
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
 #endif
 
@@ -967,7 +952,7 @@ set_ether_config(struct eth_dev *dev, gfp_t gfp_flags)
 	int					result = 0;
 	struct usb_gadget			*gadget = dev->gadget;
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 	/* status endpoint used for RNDIS and (optionally) CDC */
 	if (!subset_active(dev) && dev->status_ep) {
 		dev->status = ep_desc(gadget, &hs_status_desc,
@@ -1148,7 +1133,7 @@ static int eth_set_config(struct eth_dev *dev, unsigned number,
 
 /*-------------------------------------------------------------------------*/
 
-#ifdef	DEV_CONFIG_CDC
+#ifdef	CONFIG_USB_ETH_CDC
 
 /*
  * The interrupt endpoint is used in CDC networking models (Ethernet, ATM)
@@ -1379,7 +1364,7 @@ eth_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 			goto done_set_intf;
 		}
 
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 		switch (wIndex) {
 		case 0:		/* control/master intf */
 			if (wValue != 0)
@@ -1421,7 +1406,7 @@ eth_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 		 * all non-PXA hardware talks real CDC ...
 		 */
 		debug("set_interface ignored!\n");
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 
 done_set_intf:
 		break;
@@ -1444,7 +1429,7 @@ done_set_intf:
 		value = min(wLength, (u16) 1);
 		break;
 
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 	case USB_CDC_SET_ETHERNET_PACKET_FILTER:
 		/*
 		 * see 6.2.30: no data, wIndex = interface,
@@ -1468,7 +1453,7 @@ done_set_intf:
 	 * case USB_CDC_GET_ETHERNET_STATISTIC:
 	 */
 
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 
 #ifdef CONFIG_USB_ETH_RNDIS
 	/*
@@ -2039,7 +2024,7 @@ static int eth_bind(struct usb_gadget *gadget)
 	u8			tmp[7];
 
 	/* these flags are only ever cleared; compiler take note */
-#ifndef	DEV_CONFIG_CDC
+#ifndef	CONFIG_USB_ETH_CDC
 	cdc = 0;
 #endif
 #ifndef	CONFIG_USB_ETH_RNDIS
@@ -2151,7 +2136,7 @@ autoconf_fail:
 		goto autoconf_fail;
 	out_ep->driver_data = out_ep;	/* claim */
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 	/*
 	 * CDC Ethernet control interface doesn't require a status endpoint.
 	 * Since some hosts expect one, try to allocate one anyway.
@@ -2163,7 +2148,7 @@ autoconf_fail:
 		} else if (rndis) {
 			error("can't run RNDIS on %s", gadget->name);
 			return -ENODEV;
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 		} else if (cdc) {
 			control_intf.bNumEndpoints = 0;
 			/* FIXME remove endpoint from descriptor list */
@@ -2206,7 +2191,7 @@ autoconf_fail:
 				fs_source_desc.bEndpointAddress;
 		hs_sink_desc.bEndpointAddress =
 				fs_sink_desc.bEndpointAddress;
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 		if (status_ep)
 			hs_status_desc.bEndpointAddress =
 					fs_status_desc.bEndpointAddress;
@@ -2275,7 +2260,7 @@ autoconf_fail:
 	dev->req->complete = eth_setup_complete;
 
 	/* ... and maybe likewise for status transfer */
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 	if (dev->status_ep) {
 		dev->stat_req = usb_ep_alloc_request(dev->status_ep,
 							GFP_KERNEL);
Signature · 1 line
1.7.8.6
#7 lore raw

PATCH v4 6/8 pxa25x: Add support for USB ethernet gadget

In reply to Lukasz Dalek

Add to pxa25x based devices support for USB ethernet gadget. This is a port of pxa25x UDC driver from Linux kernel.

---
 drivers/usb/gadget/Makefile     |    1 +
 drivers/usb/gadget/pxa25x_udc.c | 2059 +++++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/pxa25x_udc.h |  162 +++
 3 files changed, 2222 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/pxa25x_udc.c
 create mode 100644 drivers/usb/gadget/pxa25x_udc.h
drivers/usb/gadget/Makefile +1 -0
index 5bbdd36..040eaba 100644
@@ -36,6 +36,7 @@ ifdef CONFIG_USB_ETHER
 COBJS-y += ether.o epautoconf.o config.o usbstring.o
 COBJS-$(CONFIG_USB_ETH_RNDIS) += rndis.o
 COBJS-$(CONFIG_MV_UDC)	+= mv_udc.o
+COBJS-$(CONFIG_CPU_PXA25X) += pxa25x_udc.o
 else
 # Devices not related to the new gadget layer depend on CONFIG_USB_DEVICE
 ifdef CONFIG_USB_DEVICE
drivers/usb/gadget/pxa25x_udc.c new file +2059 -0

2,059 lines not on this page · raw message

drivers/usb/gadget/pxa25x_udc.h new file +162 -0

162 lines not on this page · raw message

Signature · 1 line
1.7.8.6
#8 lore raw

PATCH v4 7/8 usb.h: Add udc_disconnect prototype to usb.h

In reply to Lukasz Dalek

PXA25x gadget implements common function usb_disconnect(). This patch adds this function prototype into usb.h for boards using it.

---
 include/usb.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
include/usb.h +11 -0
index ba3d169..b6642de 100644
@@ -166,6 +166,17 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 #define USB_UHCI_VEND_ID	0x8086
 #define USB_UHCI_DEV_ID		0x7112
 
+/*
+ * PXA25x can only act as USB device. There are drivers
+ * which works with USB CDC gadgets implementations.
+ * Some of them have common routines which can be used
+ * in boards init functions e.g. udc_disconnect() used for
+ * forced device disconnection from host.
+ */
+#elif defined(CONFIG_USB_GADGET_PXA2XX)
+
+extern void udc_disconnect(void);
+
 #else
 #error USB Lowlevel not defined
 #endif
Signature · 1 line
1.7.8.6
#9 lore raw

PATCH v4 8/8 h2200: Add USB CDC ethernet support

In reply to 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.

---
 board/h2200/h2200.c     |   15 +++++++++++++++
 boards.cfg              |    1 +
 include/configs/h2200.h |   27 +++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 0 deletions(-)
board/h2200/h2200.c +15 -0
index 3076306..c5b084e 100644
@@ -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;
 }
 
boards.cfg +1 -0
index ab10938..a03a469 100644
@@ -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
include/configs/h2200.h +27 -0
index de5299b..4c5a1ae 100644
@@ -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 */
Signature · 1 line
1.7.8.6
#10 lore raw

PATCH v4 1/8 h2200: Add support for iPAQ h2200 palmtop

In reply to Lukasz Dalek

Dear Lukasz Dalek,

Quoted 6 lines

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.

Quoted 12 lines
---
 board/h2200/Makefile       |   51 ++++++++++++++
 board/h2200/h2200-header.S |   27 ++++++++
 board/h2200/h2200.c        |   53 +++++++++++++++
 boards.cfg                 |    1 +
 include/configs/h2200.h    |  156
++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 288
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

Will you please learn to write patch changelog ?

Quoted 30 lines
board/h2200/Makefile new file +24 -0
new file mode 100644
index 0000000..2265aa9
@@ -0,0 +1,51 @@
+#
+# h2200 Support
+#
+# Copyright (C) 2012 Lukasz Dalek <[email protected]>
+#
+# 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

board/h2200/Makefile line 34

Quoted 10 lines
board/h2200/Makefile new file +10 -0
+
+COBJS	:= h2200.o
+
+SRCS	:= $(COBJS:.o=.c) h2200-header.S
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+ALL: $(LIB) h2200-header.bin
+
+h2200-header.o: h2200-header.S
+	$(CC) $(CFLAGS) -c -o $@ $<

Try building with BUILD_DIR=<somewhere> ./MAKEALL h2200

hint: you're missing $(obj) all around here so the resulting files are still in the source tree, not the BUILD_DIR, which is wrong of course.

Quoted 5 lines
board/h2200/Makefile new file +5 -0
+h2200-header.bin: h2200-header.o
+	$(OBJCOPY) -O binary $< $@
+
+all: $(LIB) h2200-header.bin
+

[...]

#11 lore raw

PATCH v4 1/8 h2200: Add support for iPAQ h2200 palmtop

Quoted 20 lines · Marek Vasut

Dear Lukasz Dalek,

Quoted 12 lines

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.

---
  board/h2200/Makefile       |   51 ++++++++++++++
  board/h2200/h2200-header.S |   27 ++++++++
  board/h2200/h2200.c        |   53 +++++++++++++++
  boards.cfg                 |    1 +
  include/configs/h2200.h    |  156
Quoted 6 lines

++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 288 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

Quoted 1 line

Will you please learn to write patch changelog ?

I will, I promise.

Quoted 34 lines
Quoted 34 lines
board/h2200/Makefile new file +27 -0
new file mode 100644
index 0000000..2265aa9
@@ -0,0 +1,51 @@
+#
+# h2200 Support
+#
+# Copyright (C) 2012 Lukasz Dalek<[email protected]>
+#
+# 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
+
Quoted 8 lines

board/h2200/Makefile line 34

Quoted 7 lines
board/h2200/Makefile new file +7 -0
+SRCS	:= $(COBJS:.o=.c) h2200-header.S
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+ALL: $(LIB) h2200-header.bin
+
+h2200-header.o: h2200-header.S
+	$(CC) $(CFLAGS) -c -o $@ $<

Try building with BUILD_DIR=<somewhere> ./MAKEALL h2200

what toolchain do you recommend? I use codesourcery and it complains about some enums.

Quoted 3 lines

hint: you're missing $(obj) all around here so the resulting files are still in the source tree, not the BUILD_DIR, which is wrong of course.

Can you recommend board which has proper Makefile?

?ukasz Da?ek

#12 lore raw

PATCH v4 1/8 h2200: Add support for iPAQ h2200 palmtop

Dear ?ukasz Da?ek,

Quoted 72 lines · Marek Vasut
Quoted 19 lines

Dear Lukasz Dalek,

Quoted 17 lines

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.

---

  board/h2200/Makefile       |   51 ++++++++++++++
  board/h2200/h2200-header.S |   27 ++++++++
  board/h2200/h2200.c        |   53 +++++++++++++++
  boards.cfg                 |    1 +
  include/configs/h2200.h    |  156

++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 288 insertions(+), 0 deletions(-)

Quoted 6 lines
Quoted 4 lines

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

Will you please learn to write patch changelog ?

I will, I promise.

Quoted 34 lines
Quoted 34 lines
board/h2200/Makefile new file +28 -0
new file mode 100644
index 0000000..2265aa9
@@ -0,0 +1,51 @@
+#
+# h2200 Support
+#
+# Copyright (C) 2012 Lukasz Dalek<[email protected]>
+#
+# 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
Quoted 8 lines

board/h2200/Makefile line 34

Quoted 6 lines
board/h2200/Makefile new file +6 -0
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+ALL: $(LIB) h2200-header.bin
+
+h2200-header.o: h2200-header.S
+	$(CC) $(CFLAGS) -c -o $@ $<

Try building with BUILD_DIR=<somewhere> ./MAKEALL h2200

Quoted 2 lines

what toolchain do you recommend? I use codesourcery and it complains about some enums.

http://www.denx.de/wiki/DULG/ELDK or debian toolchains

Quoted 4 lines
Quoted 2 lines

hint: you're missing $(obj) all around here so the resulting files are still in the source tree, not the BUILD_DIR, which is wrong of course.

Can you recommend board which has proper Makefile?

All of them should, did you detect such problem elsewhere?

Quoted 2 lines

?ukasz Da?ek

Best regards,
Marek Vasut

#13 lore raw

PATCH v4 1/8 h2200: Add support for iPAQ h2200 palmtop

Quoted 4 lines · Marek Vasut
Quoted 3 lines
Quoted 2 lines

hint: you're missing $(obj) all around here so the resulting files are still in the source tree, not the BUILD_DIR, which is wrong of course.

Can you recommend board which has proper Makefile?

All of them should, did you detect such problem elsewhere?

No. I'll fix this.

?ukasz Da?ek