Add h2200 support and pxa25x ethernet gadget
Subsystems (2)
v2 cover Add h2200 support and pxa25x ethernet gadget
Patch 2/6 (usbethernet support) was revied. I've added only simple noisy defintion (at the end of patch).
+#ifndef DEBUG
+# define NOISY 0
+#endif
Patch 3/6 was also revied.
Lukasz Dalek (6):
h2200: Add support for iPAQ h2200 palmtop
pxa25x: Add support for USB ethernet gadget
pxa: Add some stuff to examine cpu model and rev
usbether: Fixed bug when using with PXA25X chips
usbether: Define CONFIG_USB_ETH_{CDC,SUBSET}
usbether: Removed DEV_CONFIG_{CDC,SUBSET}
arch/arm/cpu/pxa/cpuinfo.c | 11 +- arch/arm/include/asm/arch-pxa/pxa.h | 13 + board/h2200/Makefile | 51 + board/h2200/h2200-header.S | 27 + board/h2200/h2200.c | 66 ++ board/h2200/h2200.h | 28 + boards.cfg | 2 + drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/ether.c | 69 +- drivers/usb/gadget/pxa25x_udc.c | 2059 +++++++++++++++++++++++++++++++++++ drivers/usb/gadget/pxa25x_udc.h | 162 +++ include/configs/h2200.h | 189 ++++ 12 files changed, 2646 insertions(+), 32 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 board/h2200/h2200.h create mode 100644 drivers/usb/gadget/pxa25x_udc.c create mode 100644 drivers/usb/gadget/pxa25x_udc.h create mode 100644 include/configs/h2200.h
Signature · 1 line
1.7.8.6
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Basic support of HP iPAQ h2200 palmtop. Support includes also USB ethernet gadget.
--- board/h2200/Makefile | 51 ++++++++++++ board/h2200/h2200-header.S | 27 ++++++ board/h2200/h2200.c | 66 +++++++++++++++ board/h2200/h2200.h | 28 +++++++ boards.cfg | 2 + include/configs/h2200.h | 189 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 363 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 board/h2200/h2200.h create mode 100644 include/configs/h2200.h
board/h2200/Makefile new file +51 -0
@@ -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
@@ -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 +66 -0
66 lines not on this page · raw message
board/h2200/h2200.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* iPAQ h2200 board configuration +* +* 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 +*/ + +#ifndef __IPAQ_H2200_H +#define __IPAQ_H2200_H + +#if defined(CONFIG_H2200_USBETH ) +extern void udc_disconnect (void ); +#endif + +#endif /* __IPAQ_H2200_H */
boards.cfg +2 -0
@@ -282,6 +282,8 @@ dvlhost arm ixp pdnb3 arm ixp pdnb3 prodrive 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 new file +189 -0
189 lines not on this page · raw message
Signature · 1 line
1.7.8.6
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Dear Lukasz Dalek,
[...]
board/h2200/h2200.c line 63
Quoted 7 lines
board/h2200/h2200.c new file +7
-0+int dram_init (void ) +{ +/* +* Everything except MSC0 was already set up by +* 1st stage bootloader +*/ +clrsetbits_le32 (MSC0 ,0xffffffff ,0x246c7ffc );
This magic would use more description eventually.
board/h2200/h2200.h
Quoted 5 lines
board/h2200/h2200.c new file +3
-0+ gd->ram_size =CONFIG_SYS_SDRAM_SIZE ; +return 0 ; +}board/h2200/h2200.h new file +0
-0
Do you need this file at all? Can the udc_disconnect() not be put somewhere into usb.h ?
[...]
Rest seems fine, thanks.
Best regards,
Marek Vasut
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Quoted 7 lines · Marek Vasut
board/h2200/h2200.h
Quoted 5 lines
board/h2200/h2200.c new file +3
-0+ gd->ram_size =CONFIG_SYS_SDRAM_SIZE ; +return 0 ; +}board/h2200/h2200.h new file +0
-0Do you need this file at all? Can the
udc_disconnect()not be put somewhere intousb.h?
Can I just move this declaration into h2200.c?
?ukasz Da?ek
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Dear ?ukasz Da?ek,
Quoted 11 lines · Marek Vasut
Quoted 8 lines
board/h2200/h2200.h
Quoted 5 lines
board/h2200/h2200.c new file +3
-0+ gd->ram_size =CONFIG_SYS_SDRAM_SIZE ; +return 0 ; +}board/h2200/h2200.h new file +0
-0Do you need this file at all? Can the
udc_disconnect()not be put somewhere intousb.h?Can I just move this declaration into
h2200.c?
extern ... ? No, checkpatch will scream and extern is prohibited for a good reason.
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Quoted 10 lines · Marek Vasut
Dear ?ukasz Da?ek,
Quoted 8 lines · Marek Vasut
Quoted 7 lines
board/h2200/h2200.h
Quoted 5 lines
board/h2200/h2200.c new file +3
-0+ gd->ram_size =CONFIG_SYS_SDRAM_SIZE ; +return 0 ; +}board/h2200/h2200.h new file +0
-0Do you need this file at all? Can the
udc_disconnect()not be put somewhere intousb.h?
Quoted 3 lines
Quoted 1 line
Can I just move this declaration into
h2200.c?extern ... ? No, checkpatch will scream and extern is prohibited for a good reason.
So where should I put it?
?ukasz Da?ek
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Dear ?ukasz Da?ek,
Quoted 13 lines · Marek Vasut
Quoted 12 lines
Dear ?ukasz Da?ek,
Quoted 10 lines · Marek Vasut
Quoted 8 lines
board/h2200/h2200.h
Quoted 5 lines
board/h2200/h2200.c new file +3
-0+ gd->ram_size =CONFIG_SYS_SDRAM_SIZE ; +return 0 ; +}board/h2200/h2200.h new file +0
-0Do you need this file at all? Can the
udc_disconnect()not be put somewhere intousb.h?
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Can I just move this declaration into
h2200.c?extern ... ? No, checkpatch will scream and extern is prohibited for a good reason.
So where should I put it?
Isn't it a general call? some include/usb.h ?
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Quoted 13 lines · Marek Vasut
Dear ?ukasz Da?ek,
Quoted 11 lines · Marek Vasut
Quoted 10 lines
Dear ?ukasz Da?ek,
Quoted 8 lines · Marek Vasut
Quoted 7 lines
board/h2200/h2200.h
Quoted 5 lines
board/h2200/h2200.c new file +3
-0+ gd->ram_size =CONFIG_SYS_SDRAM_SIZE ; +return 0 ; +}board/h2200/h2200.h new file +0
-0Do you need this file at all? Can the
udc_disconnect()not be put somewhere intousb.h?
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line
Can I just move this declaration into
h2200.c?extern ... ? No, checkpatch will scream and extern is prohibited for a good reason.
So where should I put it?
Isn't it a general call? some
include/usb.h?
For old layer maybe it is.
I'm not sure but include/usb.h is for device implementing usb host but pxa can only be device. Including usb.h generate error.
I'm going to add sd card support and other functions, maybe leaving it would be better idea?
?ukasz Da?ek
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Dear ?ukasz Da?ek,
Quoted 21 lines · Marek Vasut
Quoted 20 lines
Dear ?ukasz Da?ek,
Quoted 18 lines · Marek Vasut
Quoted 16 lines
Dear ?ukasz Da?ek,
Quoted 11 lines · Marek Vasut
Quoted 8 lines
board/h2200/h2200.h
Quoted 5 lines
(quoted diff) +3
-0+ gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + return 0; +}board/h2200/h2200.h new file +0
-0Do you need this file at all? Can the
udc_disconnect()not be put somewhere intousb.h?Can I just move this declaration into
h2200.c?extern ... ? No, checkpatch will scream and extern is prohibited for a good reason.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
So where should I put it?
Isn't it a general call? some
include/usb.h?For old layer maybe it is.
I'm not sure but
include/usb.his for device implementing usb host but pxa can only be device.
PXA can be both, actually u-boot is mostly about host. Just put it there.
Quoted 4 lines
Including
usb.hgenerate error.I'm going to add sd card support and other functions, maybe leaving it would be better idea?
Why do you think usb.h is not a good place ?
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Quoted 25 lines · Marek Vasut
Dear ?ukasz Da?ek,
Quoted 15 lines · Marek Vasut
Quoted 14 lines
Dear ?ukasz Da?ek,
Quoted 12 lines · Marek Vasut
Quoted 11 lines
Dear ?ukasz Da?ek,
Quoted 9 lines · Marek Vasut
Quoted 7 lines
board/h2200/h2200.h
Quoted 5 lines
(quoted diff) +3
-0+ gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + return 0; +}board/h2200/h2200.h new file +0
-0Do you need this file at all? Can the
udc_disconnect()not be put somewhere intousb.h?Can I just move this declaration into
h2200.c?Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
extern ... ? No, checkpatch will scream and extern is prohibited for a good reason.
So where should I put it?
Isn't it a general call? some
include/usb.h?For old layer maybe it is.
I'm not sure but
include/usb.his for device implementing usb host but pxa can only be device.
Quoted 7 lines
PXA can be both, actually u-boot is mostly about host. Just put it there.
Quoted 4 lines
Including
usb.hgenerate error.I'm going to add sd card support and other functions, maybe leaving it would be better idea?
Why do you think
usb.his not a good place ?
Because:
#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \
defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X)...
#else
#error USB Lowlevel not defined
#endif
All of these definitions are usb host implementation (maybe OTG too) but pxa cannot be host.
?ukasz Da?ek
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Dear ?ukasz Da?ek,
Quoted 49 lines · Marek Vasut
Quoted 32 lines
Dear ?ukasz Da?ek,
Quoted 21 lines · Marek Vasut
Quoted 20 lines
Dear ?ukasz Da?ek,
Quoted 18 lines · Marek Vasut
Quoted 16 lines
Dear ?ukasz Da?ek,
Quoted 11 lines · Marek Vasut
Quoted 8 lines
board/h2200/h2200.h
Quoted 5 lines
(quoted diff) +3
-0+ gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + return 0; +}board/h2200/h2200.h new file +0
-0Do you need this file at all? Can the
udc_disconnect()not be put somewhere intousb.h?Can I just move this declaration into
h2200.c?extern ... ? No, checkpatch will scream and extern is prohibited for a good reason.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
So where should I put it?
Isn't it a general call? some
include/usb.h?For old layer maybe it is.
I'm not sure but
include/usb.his for device implementing usb host but pxa can only be device.Quoted 8 lines
PXA can be both, actually u-boot is mostly about host. Just put it there.
Quoted 4 lines
Including
usb.hgenerate error.I'm going to add sd card support and other functions, maybe leaving it would be better idea?
Why do you think
usb.his not a good place ?Because:
#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \ defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \ defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \ defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \ defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \ defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X)
Quoted 7 lines
...
#else
#error USB Lowlevel not defined
#endifAll of these definitions are usb host implementation (maybe OTG too) but pxa cannot be host.
PXA2xx is OHCI host with one OTG port.
what about include/usb/pxa27x_udc.h ... btw can't pxa27x and pxa25x UDC use the same driver?
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Quoted 47 lines · Marek Vasut
Dear ?ukasz Da?ek,
Quoted 45 lines · Marek Vasut
Quoted 25 lines
Dear ?ukasz Da?ek,
Quoted 15 lines · Marek Vasut
Quoted 14 lines
Dear ?ukasz Da?ek,
Quoted 12 lines · Marek Vasut
Quoted 11 lines
Dear ?ukasz Da?ek,
Quoted 9 lines · Marek Vasut
Quoted 7 lines
board/h2200/h2200.h
Quoted 5 lines
(quoted diff) +3
-0+ gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + return 0; +}board/h2200/h2200.h new file +0
-0Do you need this file at all? Can the
udc_disconnect()not be put somewhere intousb.h?Can I just move this declaration into
h2200.c?Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
extern ... ? No, checkpatch will scream and extern is prohibited for a good reason.
So where should I put it?
Isn't it a general call? some
include/usb.h?For old layer maybe it is.
I'm not sure but
include/usb.his for device implementing usb host but pxa can only be device.Quoted 7 lines
PXA can be both, actually u-boot is mostly about host. Just put it there.
Quoted 4 lines
Including
usb.hgenerate error.I'm going to add sd card support and other functions, maybe leaving it would be better idea?
Why do you think
usb.his not a good place ?Because:
#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \ defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \ defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \ defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \ defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \ defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X)...
#else
#error USB Lowlevel not defined
#endif
Quoted 3 lines
Quoted 2 lines
All of these definitions are usb host implementation (maybe OTG too) but pxa cannot be host.
PXA2xx is OHCI host with one OTG port.
From pxa255 documentation:
"The UDC supports 16 endpoints and can operate half-duplex at a rate of 12 Mbps (as a slave only,
not as a host or hub controller)."
Quoted 2 lines
what about
include/usb/pxa27x_udc.h... btw can't pxa27x and pxa25x UDC use the same driver?
pxa27x_udc driver is using older layer which doesn't work with usb ethernet driver.
Btw. pxa27x can be host, pxa25x can't.
?ukasz Da?ek
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Dear ?ukasz Da?ek,
Quoted 70 lines · Marek Vasut
Quoted 59 lines
Dear ?ukasz Da?ek,
Quoted 57 lines · Marek Vasut
Quoted 35 lines
Dear ?ukasz Da?ek,
Quoted 21 lines · Marek Vasut
Quoted 20 lines
Dear ?ukasz Da?ek,
Quoted 18 lines · Marek Vasut
Quoted 16 lines
Dear ?ukasz Da?ek,
Quoted 11 lines · Marek Vasut
Quoted 8 lines
board/h2200/h2200.h
Quoted 5 lines
(quoted diff) +3
-0+ gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + return 0; +}board/h2200/h2200.h new file +0
-0Do you need this file at all? Can the
udc_disconnect()not be put somewhere intousb.h?Can I just move this declaration into
h2200.c?extern ... ? No, checkpatch will scream and extern is prohibited for a good reason.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
So where should I put it?
Isn't it a general call? some
include/usb.h?For old layer maybe it is.
I'm not sure but
include/usb.his for device implementing usb host but pxa can only be device.PXA can be both, actually u-boot is mostly about host. Just put it there.
Quoted 6 lines
Quoted 4 lines
Including
usb.hgenerate error.I'm going to add sd card support and other functions, maybe leaving it would be better idea?
Why do you think
usb.his not a good place ?Because:
#ifdefined(CONFIG_USB_UHCI)||defined(CONFIG_USB_OHCI)|| \defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \ defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \ defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \ defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \ defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X)...
#else
#error USB Lowlevel not defined
#endifQuoted 4 lines
Quoted 2 lines
All of these definitions are usb host implementation (maybe OTG too) but pxa cannot be host.
PXA2xx is OHCI host with one OTG port.
From pxa255 documentation:
"The UDC supports 16 endpoints and can operate half-duplex at a rate of 12 Mbps (as a slave only,
not as a host or hub controller)."
Quoted 7 lines
Quoted 2 lines
what about
include/usb/pxa27x_udc.h... btw can't pxa27x and pxa25x UDC use the same driver?
pxa27x_udcdriver is using older layer which doesn't work with usb ethernet driver.Btw. pxa27x can be host, pxa25x can't.
Can you update the new gadget driver to be compatible with pxa27x then ?
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Quoted 10 lines · Marek Vasut
Dear ?ukasz Da?ek,
Quoted 8 lines · Marek Vasut
Quoted 2 lines
PXA2xx is OHCI host with one OTG port.
From pxa255 documentation:
"The UDC supports 16 endpoints and can operate half-duplex at a rate of 12 Mbps (as a slave only,
not as a host or hub controller)."
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
what about
include/usb/pxa27x_udc.h... btw can't pxa27x and pxa25x UDC use the same driver?
pxa27x_udcdriver is using older layer which doesn't work with usb ethernet driver.Btw. pxa27x can be host, pxa25x can't.
Can you update the new gadget driver to be compatible with pxa27x then ?
I don't have any board with pxa27x processor. And I'm quite sure that differences between pxa25x and pxa27x usb are too big. Even in Linux kernel are two separate drivers for 25x and 27x chips.
?ukasz Da?ek
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Dear ?ukasz Da?ek,
Quoted 17 lines · Marek Vasut
Quoted 16 lines
Dear ?ukasz Da?ek,
Quoted 14 lines · Marek Vasut
Quoted 2 lines
PXA2xx is OHCI host with one OTG port.
From pxa255 documentation:
"The UDC supports 16 endpoints and can operate half-duplex at a rate of 12 Mbps (as a slave only,
not as a host or hub controller)."Quoted 2 lines
what about
include/usb/pxa27x_udc.h... btw can't pxa27x and pxa25x UDC use the same driver?
pxa27x_udcdriver is using older layer which doesn't work with usb ethernet driver.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Btw. pxa27x can be host, pxa25x can't.
Can you update the new gadget driver to be compatible with pxa27x then ?
I don't have any board with pxa27x processor. And I'm quite sure that differences between pxa25x and pxa27x usb are too big. Even in Linux kernel are two separate drivers for 25x and 27x chips.
Isn't the 25x only a subset of the 27x ?
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Quoted 18 lines · Marek Vasut
Dear ?ukasz Da?ek,
Quoted 16 lines · Marek Vasut
Quoted 15 lines
Dear ?ukasz Da?ek,
Quoted 13 lines · Marek Vasut
Quoted 2 lines
PXA2xx is OHCI host with one OTG port.
From pxa255 documentation:
"The UDC supports 16 endpoints and can operate half-duplex at a rate of 12 Mbps (as a slave only,
not as a host or hub controller)."Quoted 2 lines
what about
include/usb/pxa27x_udc.h... btw can't pxa27x and pxa25x UDC use the same driver?
pxa27x_udcdriver is using older layer which doesn't work with usb ethernet driver.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line
Btw. pxa27x can be host, pxa25x can't.
Can you update the new gadget driver to be compatible with pxa27x then ?
I don't have any board with pxa27x processor. And I'm quite sure that differences between pxa25x and pxa27x usb are too big. Even in Linux kernel are two separate drivers for 25x and 27x chips.
Isn't the 25x only a subset of the 27x ?
Maybe it is.
You've asked me if I could update driver to compatible with pxa27x and my answer is no. Maybe someone with pxa27x chip could.
I will left that h2200.h header. I'm sure that it will be helpful some day.
?ukasz Da?ek
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Dear ?ukasz Da?ek,
Quoted 29 lines · Marek Vasut
Quoted 28 lines
Dear ?ukasz Da?ek,
Quoted 25 lines · Marek Vasut
Quoted 13 lines
Dear ?ukasz Da?ek,
Quoted 11 lines · Marek Vasut
Quoted 2 lines
PXA2xx is OHCI host with one OTG port.
From pxa255 documentation:
"The UDC supports 16 endpoints and can operate half-duplex at a rate of 12 Mbps (as a slave only,
not as a host or hub controller)."Quoted 2 lines
what about
include/usb/pxa27x_udc.h... btw can't pxa27x and pxa25x UDC use the same driver?Quoted 7 lines
Quoted 4 lines
pxa27x_udcdriver is using older layer which doesn't work with usb ethernet driver.Btw. pxa27x can be host, pxa25x can't.
Can you update the new gadget driver to be compatible with pxa27x then ?
I don't have any board with pxa27x processor. And I'm quite sure that differences between pxa25x and pxa27x usb are too big. Even in Linux kernel are two separate drivers for 25x and 27x chips.
Quoted 6 lines
Quoted 1 line
Isn't the 25x only a subset of the 27x ?
Maybe it is.
You've asked me if I could update driver to compatible with pxa27x and my answer is no. Maybe someone with pxa27x chip could.
I can test it. It'd be good to have only one driver and get rid of the old one seems to be the way to go.
Quoted 1 line
I will left that
h2200.hheader. I'm sure that it will be helpful some day.
For what exactly? Just put it into include/usb.h .
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Quoted 27 lines · Marek Vasut
Dear ?ukasz Da?ek,
Quoted 25 lines · Marek Vasut
Quoted 24 lines
Dear ?ukasz Da?ek,
Quoted 22 lines · Marek Vasut
Quoted 10 lines
Dear ?ukasz Da?ek,
Quoted 8 lines · Marek Vasut
Quoted 2 lines
PXA2xx is OHCI host with one OTG port.
From pxa255 documentation:
"The UDC supports 16 endpoints and can operate half-duplex at a rate of 12 Mbps (as a slave only,
not as a host or hub controller)."Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
what about
include/usb/pxa27x_udc.h... btw can't pxa27x and pxa25x UDC use the same driver?
pxa27x_udcdriver is using older layer which doesn't work with usb ethernet driver.Btw. pxa27x can be host, pxa25x can't.
Can you update the new gadget driver to be compatible with pxa27x then ?
I don't have any board with pxa27x processor. And I'm quite sure that differences between pxa25x and pxa27x usb are too big. Even in Linux kernel are two separate drivers for 25x and 27x chips.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Isn't the 25x only a subset of the 27x ?
Maybe it is.
You've asked me if I could update driver to compatible with pxa27x and my answer is no. Maybe someone with pxa27x chip could.
I can test it. It'd be good to have only one driver and get rid of the old one seems to be the way to go.
Does this driver work with usb ethernet gadget?
Quoted 3 lines
Quoted 2 lines
I will left that
h2200.hheader. I'm sure that it will be helpful some day.For what exactly? Just put it into
include/usb.h.
I can't. It doesn't compile because of #error at 170 line.
?ukasz Da?ek
PATCH v2 1/6 h2200: Add support for iPAQ h2200 palmtop
Dear ?ukasz Da?ek,
Quoted 36 lines · Marek Vasut
Quoted 35 lines
Dear ?ukasz Da?ek,
Quoted 33 lines · Marek Vasut
Quoted 21 lines
Dear ?ukasz Da?ek,
Quoted 19 lines · Marek Vasut
Quoted 18 lines
Dear ?ukasz Da?ek,
Quoted 15 lines · Marek Vasut
Quoted 2 lines
PXA2xx is OHCI host with one OTG port.
From pxa255 documentation:
"The UDC supports 16 endpoints and can operate half-duplex at a rate of 12 Mbps (as a slave only,
not as a host or hub controller)."Quoted 2 lines
what about
include/usb/pxa27x_udc.h... btw can't pxa27x and pxa25x UDC use the same driver?
pxa27x_udcdriver is using older layer which doesn't work with usb ethernet driver.Btw. pxa27x can be host, pxa25x can't.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Can you update the new gadget driver to be compatible with pxa27x then ?
I don't have any board with pxa27x processor. And I'm quite sure that differences between pxa25x and pxa27x usb are too big. Even in Linux kernel are two separate drivers for 25x and 27x chips.
Isn't the 25x only a subset of the 27x ?
Maybe it is.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
You've asked me if I could update driver to compatible with pxa27x and my answer is no. Maybe someone with pxa27x chip could.
I can test it. It'd be good to have only one driver and get rid of the old one seems to be the way to go.
Does this driver work with usb ethernet gadget?
I have no idea, I never used it (and I'm not quite sure it's used at all). It's a rotting piece of code, maybe we should throw it out altogether.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
I will left that
h2200.hheader. I'm sure that it will be helpful some day.For what exactly? Just put it into
include/usb.h.I can't. It doesn't compile because of #error at 170 line.
You know ... #elif defined () is your friend there. Besides seriously, it'd be very nice to share the error message if nothing else ...
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 2/6 pxa25x: Add support for USB ethernet gadget
In reply to Lukasz DalekAdd 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
@@ -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
PATCH v2 2/6 pxa25x: Add support for USB ethernet gadget
Dear Lukasz Dalek,
Quoted 4 lines
Add to pxa25x based devices support for USB ethernet gadget. This is a port of pxa25x UDC driver from Linux kernel.
Signed-off-by Lukasz Dalek <[email protected]>
Quoted 8 lines
--- 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
[...]
So what's the change here? Or is it a repost?
Best regards,
Marek Vasut
PATCH v2 2/6 pxa25x: Add support for USB ethernet gadget
Quoted 14 lines · Marek Vasut
Dear Lukasz Dalek,
Quoted 4 lines
Add to pxa25x based devices support for USB ethernet gadget. This is a port of pxa25x UDC driver from Linux kernel.
Signed-off-by Lukasz Dalek<[email protected]>Quoted 8 lines
--- 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.ccreate mode 100644drivers/usb/gadget/pxa25x_udc.h
Quoted 6 lines
[...]
So what's the change here? Or is it a repost?
Best regards,
Marek Vasut
Everything was fine except DEBUG_NOISY defintions. I fixed them and I have resend patch.
Can I ask what about patches 3,4,5,6?
?ukasz Da?ek
PATCH v2 2/6 pxa25x: Add support for USB ethernet gadget
Dear ?ukasz Da?ek,
Quoted 21 lines · Marek Vasut
Quoted 20 lines
Dear Lukasz Dalek,
Quoted 15 lines
Add to pxa25x based devices support for USB ethernet gadget. This is a port of pxa25x UDC driver from Linux kernel.
Signed-off-by Lukasz Dalek<[email protected]>---
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.ccreate mode 100644drivers/usb/gadget/pxa25x_udc.h[...]
Quoted 7 lines
Quoted 4 lines
So what's the change here? Or is it a repost?
Best regards,
Marek VasutEverything was fine except
DEBUG_NOISYdefintions. I fixed them and I have resend patch.
http://www.denx.de/wiki/U-Boot/Patches did you read this? Worth reading so I don't have to repeat myself ;-)
Quoted 1 line
Can I ask what about patches 3,4,5,6?
I think they're fine ... did you do any changes to them ?
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 2/6 pxa25x: Add support for USB ethernet gadget
Quoted 22 lines · Marek Vasut
Dear ?ukasz Da?ek,
Quoted 20 lines · Marek Vasut
Quoted 19 lines
Dear Lukasz Dalek,
Quoted 15 lines
Add to pxa25x based devices support for USB ethernet gadget. This is a port of pxa25x UDC driver from Linux kernel.
Signed-off-by Lukasz Dalek<[email protected]>---
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.ccreate mode 100644drivers/usb/gadget/pxa25x_udc.h[...]
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
So what's the change here? Or is it a repost?
Best regards,
Marek VasutEverything was fine except
DEBUG_NOISYdefintions. I fixed them and I have resend patch.http://www.denx.de/wiki/U-Boot/Patches did you read this? Worth reading so I don't have to repeat myself ;-)
Yes.
Quoted 4 lines
Quoted 2 lines
Can I ask what about patches 3,4,5,6?
I think they're fine ... did you do any changes to them ?
If they are ok then my job is done :-)
?ukasz Da?ek
PATCH v2 2/6 pxa25x: Add support for USB ethernet gadget
Dear ?ukasz Da?ek,
Quoted 37 lines · Marek Vasut
Quoted 27 lines
Dear ?ukasz Da?ek,
Quoted 25 lines · Marek Vasut
Quoted 24 lines
Dear Lukasz Dalek,
Quoted 9 lines
Add to pxa25x based devices support for USB ethernet gadget. This is a port of pxa25x UDC driver from Linux kernel.
Signed-off-by Lukasz Dalek<[email protected]>---
drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/pxa25x_udc.c | 2059Quoted 8 lines
+++++++++++++++++++++++++++++++++++++++
drivers/usb/gadget/pxa25x_udc.h| 162 +++
|3 files changed, 2222 insertions(+), 0 deletions(-)create mode 100644
drivers/usb/gadget/pxa25x_udc.ccreate mode 100644drivers/usb/gadget/pxa25x_udc.h[...]
So what's the change here? Or is it a repost?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Best regards,
Marek VasutEverything was fine except
DEBUG_NOISYdefintions. I fixed them and I have resend patch.http://www.denx.de/wiki/U-Boot/Patches did you read this? Worth reading so I don't have to repeat myself ;-)
Quoted 7 lines
Yes.
Quoted 3 lines
Quoted 1 line
Can I ask what about patches 3,4,5,6?
I think they're fine ... did you do any changes to them ?
If they are ok then my job is done :-)
You did not answer my question ... and no, your job isn't done ... once your code is mainline, you're the maintainer, every change to common code will also be your responsibility to at least review/test on your hardware etc ... you know the drill.
Even though PXA is semi-dead, so I don't expect much happening there.
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 2/6 pxa25x: Add support for USB ethernet gadget
Quoted 38 lines · Marek Vasut
Dear ?ukasz Da?ek,
Quoted 36 lines · Marek Vasut
Quoted 24 lines
Dear ?ukasz Da?ek,
Quoted 22 lines · Marek Vasut
Quoted 21 lines
Dear Lukasz Dalek,
Quoted 17 lines
Add to pxa25x based devices support for USB ethernet gadget. This is a port of pxa25x UDC driver from Linux kernel.
Signed-off-by Lukasz Dalek<[email protected]>---
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[...]
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
So what's the change here? Or is it a repost?
Best regards,
Marek VasutEverything was fine except
DEBUG_NOISYdefintions. I fixed them and I have resend patch.http://www.denx.de/wiki/U-Boot/Patches did you read this? Worth reading so I don't have to repeat myself ;-)
Yes.
Quoted 1 line
Quoted 1 line
Can I ask what about patches 3,4,5,6?
Quoted 8 lines
Quoted 2 lines
Quoted 1 line
I think they're fine ... did you do any changes to them ?
If they are ok then my job is done :-)
You did not answer my question ... and no, your job isn't done ... once your code is mainline, you're the maintainer, every change to common code will also be your responsibility to at least review/test on your hardware etc ... you know the drill.
Even though PXA is semi-dead, so I don't expect much happening there.
No, since last email I didn't change anything.
But for now you have said that they're fine, so all I have to wait. Am I wrong?
?ukasz Da?ek
PATCH v2 2/6 pxa25x: Add support for USB ethernet gadget
Dear ?ukasz Da?ek,
Quoted 53 lines · Marek Vasut
Quoted 52 lines
Dear ?ukasz Da?ek,
Quoted 37 lines · Marek Vasut
Quoted 27 lines
Dear ?ukasz Da?ek,
Quoted 25 lines · Marek Vasut
Quoted 24 lines
Dear Lukasz Dalek,
Quoted 9 lines
Add to pxa25x based devices support for USB ethernet gadget. This is a port of pxa25x UDC driver from Linux kernel.
Signed-off-by Lukasz Dalek<[email protected]>---
drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/pxa25x_udc.c | 2059Quoted 8 lines
+++++++++++++++++++++++++++++++++++++++
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[...]
So what's the change here? Or is it a repost?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Best regards,
Marek VasutEverything was fine except
DEBUG_NOISYdefintions. I fixed them and I have resend patch.http://www.denx.de/wiki/U-Boot/Patches did you read this? Worth reading so I don't have to repeat myself ;-)
Quoted 7 lines
Yes.
Quoted 3 lines
Quoted 1 line
Can I ask what about patches 3,4,5,6?
I think they're fine ... did you do any changes to them ?
If they are ok then my job is done :-)
You did not answer my question ... and no, your job isn't done ... once your code is mainline, you're the maintainer, every change to common code will also be your responsibility to at least review/test on your hardware etc ... you know the drill.
Quoted 6 lines
Quoted 1 line
Even though PXA is semi-dead, so I don't expect much happening there.
No, since last email I didn't change anything.
But for now you have said that they're fine, so all I have to wait. Am I wrong?
You're right.
Quoted 1 line
?ukasz Da?ek
Best regards,
Marek Vasut
PATCH v2 3/6 pxa: Add some stuff to examine cpu model and rev
In reply to Lukasz DalekAdd 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
@@ -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
@@ -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
PATCH v2 4/6 usbether: Fixed bug when using with PXA25X chips
In reply to Lukasz DalekPXA25X 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
@@ -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
PATCH v2 5/6 usbether: Define CONFIG_USB_ETH_{CDC, SUBSET}
In reply to Lukasz DalekIntroduced 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
@@ -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
PATCH v2 6/6 usbether: Removed DEV_CONFIG_{CDC,SUBSET}
In reply to Lukasz DalekRemoved 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
@@ -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