Skip to contentSkip to conversation

pxa27x_udc -- support for usb gadget for pxa27x?

DISCUSSION Pavel Machek 6 participants 11 messages Nov 3, 2005 – Nov 26, 2005 USB

lore
Share & tools
lore
#0 lore raw

Hi!

Is there recent version somewhere? I found one version (pxa27x-0218.patch), but it is *really* old.

I'd like to connect zaurus c-3000 to desktop somehow... what is the recommended way? I wanted to use bluetooth originally, but billionton card is way too slow.

Is there chance for usb-gadget support for collie (sl-5500, sa1100 cpu)?

Pavel

Signature · 1 line
Thanks, Sharp!
#1 lore raw
Quoted 2 lines · Pavel Machek

Is there recent version somewhere? I found one version (pxa27x-0218.patch), but it is *really* old.

Pull it out of handhelds.org kernel26 cvs tree and let me and the usb developers have the patch please :)

Quoted 3 lines

I'd like to connect zaurus c-3000 to desktop somehow... what is the recommended way? I wanted to use bluetooth originally, but billionton card is way too slow.

I use a CF wifi card.

USB Host works so a usb host<->host cable might work but is untested.

Quoted 2 lines

Is there chance for usb-gadget support for collie (sl-5500, sa1100 cpu)?

I think 2.4 drivers exist but nothing for 2.6 :-(. Someone needs to write that driver...

Richard

#2 lore raw

Hi!

Quoted 5 lines
Quoted 2 lines

Is there recent version somewhere? I found one version (pxa27x-0218.patch), but it is *really* old.

Pull it out of handhelds.org kernel26 cvs tree and let me and the usb developers have the patch please :)

This is what I extracted, with makefile hack to actually include it. [I'm signing it off, because GPL gives me right to distribute. I'm not saying this is good code or something. It could use some cleanups.]

...ahha, so it does not even compile. At the end, you'll find my fixes.

Add pxa27x udc drivers from handhelds.org tree.

---
commit d876994b61ffc16ac949a4094fa4e04a90ca782a tree 330747a59bf128526a9f3f9eee023dd4f8c428fb parent bd8d7bcb11d32f50dce05ec96fdfbbc7489e8d62 author <pavel@amd.(none)> Sun, 06 Nov 2005 20:34:07 +0100 committer <pavel@amd.(none)> Sun, 06 Nov 2005 20:34:07 +0100

 drivers/usb/gadget/Makefile     |    2 
 drivers/usb/gadget/pxa27x_udc.c | 2347 +++++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/pxa27x_udc.h |  332 ++++++
 3 files changed, 2680 insertions(+), 1 deletions(-)
drivers/usb/gadget/Makefile +1 -1
@@ -7,6 +7,7 @@ obj-$(CONFIG_USB_PXA2XX)	+= pxa2xx_udc.o
 obj-$(CONFIG_USB_GOKU)		+= goku_udc.o
 obj-$(CONFIG_USB_OMAP)		+= omap_udc.o
 obj-$(CONFIG_USB_LH7A40X)	+= lh7a40x_udc.o
+obj-$(CONFIG_MACH_SPITZ)	+= pxa27x_udc.o
 
 #
 # USB gadget drivers
@@ -27,4 +28,3 @@ obj-$(CONFIG_USB_ETH)		+= g_ether.o
 obj-$(CONFIG_USB_GADGETFS)	+= gadgetfs.o
 obj-$(CONFIG_USB_FILE_STORAGE)	+= g_file_storage.o
 obj-$(CONFIG_USB_G_SERIAL)	+= g_serial.o
-
drivers/usb/gadget/pxa27x_udc.c new file +2347 -0

2,347 lines not on this page · raw message

drivers/usb/gadget/pxa27x_udc.h new file +332 -0

332 lines not on this page · raw message

Fix compilation problems and fix warnings.

---
commit ab6660987b2c2b116995c5f827937d07613088fd tree 0430d753e0879b40570844554411bdf03c978d3e parent d876994b61ffc16ac949a4094fa4e04a90ca782a author <pavel@amd.(none)> Sun, 06 Nov 2005 20:46:12 +0100 committer <pavel@amd.(none)> Sun, 06 Nov 2005 20:46:12 +0100

 drivers/usb/gadget/pxa27x_udc.c |   79 +++++++++++++++++++--------------------
 1 files changed, 38 insertions(+), 41 deletions(-)
drivers/usb/gadget/pxa27x_udc.c +38 -41

128 lines not on this page · raw message

Signature · 1 line
Thanks, Sharp!
#3 lore raw
In reply to Richard Purdie

Hi!

Quoted 5 lines
Quoted 2 lines

Is there recent version somewhere? I found one version (pxa27x-0218.patch), but it is *really* old.

Pull it out of handhelds.org kernel26 cvs tree and let me and the usb developers have the patch please :)

I got it to compile it for me, but I'd probably need something like

/*
* USB Device Controller
*/
static void corgi_udc_command(int cmd)

{
        switch(cmd)     {
        case PXA2XX_UDC_CMD_CONNECT:
                GPSR(CORGI_GPIO_USB_PULLUP) =
GPIO_bit(CORGI_GPIO_USB_PULLUP);
                break;
        case PXA2XX_UDC_CMD_DISCONNECT:
                GPCR(CORGI_GPIO_USB_PULLUP) =
GPIO_bit(CORGI_GPIO_USB_PULLUP);
                break;
        }
}

static struct pxa2xx_udc_mach_info udc_info __initdata = {
/* no connect GPIO; corgi can't tell connection status */
.udc_command = corgi_udc_command,
};

...for the spitz. Do you think I can just copy this one? ...eh, no, will not fly, there's no SPITZ_GPIO_USB_PULLUP.

Pavel

Signature · 1 line
Thanks, Sharp!
#4 lore raw
Quoted 3 lines · Pavel Machek

...for the spitz. Do you think I can just copy this one? ...eh, no, will not fly, there's no SPITZ_GPIO_USB_PULLUP.

There are internal pull-ups (and pull-downs) perhaps you can use those?

Hmmm. Though the C5 stepping might be different -- best to check the "specification update".

David Vrabel

#5 lore raw
Quoted 9 lines · David Vrabel
Quoted 3 lines · Pavel Machek

...for the spitz. Do you think I can just copy this one? ...eh, no, will not fly, there's no SPITZ_GPIO_USB_PULLUP.

There are internal pull-ups (and pull-downs) perhaps you can use those?

Hmmm. Though the C5 stepping might be different -- best to check the "specification update".

I can confirm that you'll need to use the internal pxa27x pullups for this. You'll probably also need to make sure GPIO 35 is low to ensure the usb Vcc line isn't powered (as it would be in usb host mode.

Ultimately, it would be nice to have the Zaurus detect whether a usb host or client was present (using gpio 41 maybe?) and then activate the host (ohci) or client (pxa27x_udc) driver as appropriate.

Cheers,

Richard

#6 lore raw

Hi!

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines · Pavel Machek

...for the spitz. Do you think I can just copy this one? ...eh, no, will not fly, there's no SPITZ_GPIO_USB_PULLUP.

Quoted 7 lines
Quoted 4 lines

There are internal pull-ups (and pull-downs) perhaps you can use those?

Hmmm. Though the C5 stepping might be different -- best to check the "specification update".

I can confirm that you'll need to use the internal pxa27x pullups for

How can I use pxa27x pullups?

Quoted 2 lines

this. You'll probably also need to make sure GPIO 35 is low to ensure the usb Vcc line isn't powered (as it would be in usb host mode.

Are you sure? spitz_ohci_init() seems to play with GPIO 37.

(Perhaps spitz_ohci_init should disable the other GPIO?)

Quoted 3 lines

Ultimately, it would be nice to have the Zaurus detect whether a usb host or client was present (using gpio 41 maybe?) and then activate the host (ohci) or client (pxa27x_udc) driver as appropriate.

Unfortunately, that would make ohci unfunctional for me. I have normal usb device cable, connected to "USB gender changer" -- basically two female connectors -- so that I can plug USB network card into that.

Pavel

Signature · 1 line
Thanks, Sharp!
#7 lore raw

make oldconfig issues since 2.15-rc1-mm1

Gentleman,

Since the release of kernel 2.15-rc1-mm1 I can't compile the kernel anymore due to this issue while doing an make oldconfig.

When running make oldconfig I get this output:\

HOSTCC scripts/kconfig/zconf.tab.o
scripts/kconfig/zconf.tab.c: In function 'conf_parse':
scripts/kconfig/zconf.tab.c:1939: error: 'SYMBOL_CHECK_DONE' undeclared (first use in this function) scripts/kconfig/zconf.tab.c:1939: error: (Each undeclared identifier is reported only once scripts/kconfig/zconf.tab.c:1939: error: for each function it appears in.)
make[1]: *** [scripts/kconfig/zconf.tab.o] Error 1

When trying to compile the kernel using make but a non update .config file I get this output which might be related to the previous issue:

bash-2.05b$ make

 CHK     include/linux/version.h
 CHK     include/linux/compile.h
 CHK     usr/initramfs_list
 CC      arch/i386/kernel/apm.o
In file included from include/linux/mm.h:4,
                from include/linux/poll.h:11,
                from arch/i386/kernel/apm.c:207:
include/linux/sched.h:256:16: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined
In file included from include/linux/poll.h:11,
                from arch/i386/kernel/apm.c:207:

include/linux/mm.h:236:16: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined include/linux/mm.h:828:16: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined arch/i386/kernel/apm.c: In function 'apm_init':
arch/i386/kernel/apm.c:2293: error: 'pm_active' undeclared (first use in this function) arch/i386/kernel/apm.c:2293: error: (Each undeclared identifier is reported only once arch/i386/kernel/apm.c:2293: error: for each function it appears in.) arch/i386/kernel/apm.c: In function 'apm_exit':
arch/i386/kernel/apm.c:2384: error: 'pm_active' undeclared (first use in this function) make[1]: *** [arch/i386/kernel/apm.o] Error 1

I'm using gcc-4.0.2, and glibc-2.3.3

Thanks in advance for your help.

Stef

#8 lore raw
In reply to Pavel Machek
Quoted 24 lines · --- Pavel Machek

Hi!

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines · Pavel Machek

...for the spitz. Do you think I can just copy this one? ...eh, no, will not fly, there's no SPITZ_GPIO_USB_PULLUP.

Quoted 7 lines
Quoted 4 lines

There are internal pull-ups (and pull-downs) perhaps you can use those?

Hmmm. Though the C5 stepping might be different -- best to check the "specification update".

I can confirm that you'll need to use the internal pxa27x pullups for

How can I use pxa27x pullups?

Quoted 2 lines

this. You'll probably also need to make sure GPIO 35 is low to ensure the usb Vcc line isn't powered (as it would be in usb host mode.

Are you sure? spitz_ohci_init() seems to play with GPIO 37.

(Perhaps spitz_ohci_init should disable the other GPIO?)

Quoted 8 lines
Quoted 3 lines

Ultimately, it would be nice to have the Zaurus detect whether a usb host or client was present (using gpio 41 maybe?) and then activate the host (ohci) or client (pxa27x_udc) driver as appropriate.

Unfortunately, that would make ohci unfunctional for me. I have normal usb device cable, connected to "USB gender changer" -- basically two female connectors -- so that I can plug USB network card into that.

Just a thought. How about a sysfs entry which you can use to jam the device into either slave or host mode?

Mark

Quoted 10 lines

Pavel

Signature · 6 lines
Thanks, Sharp!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

#9 lore raw

Hi!

Quoted 11 lines
Quoted 8 lines
Quoted 3 lines

Ultimately, it would be nice to have the Zaurus detect whether a usb host or client was present (using gpio 41 maybe?) and then activate the host (ohci) or client (pxa27x_udc) driver as appropriate.

Unfortunately, that would make ohci unfunctional for me. I have normal usb device cable, connected to "USB gender changer" -- basically two female connectors -- so that I can plug USB network card into that.

Just a thought. How about a sysfs entry which you can use to jam the device into either slave or host mode?

Yes, that would do the trick. Auto sense is probably good solution, too, it is just that it should have /sys override or something like that.

Pavel

Signature · 1 line
Thanks, Sharp!
#10 lore raw
Quoted 12 lines · --- Pavel Machek

Hi!

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

Ultimately, it would be nice to have the Zaurus detect whether a usb host or client was present (using gpio 41 maybe?) and then activate the host (ohci) or client (pxa27x_udc) driver as appropriate.

Unfortunately, that would make ohci unfunctional for me. I have normal usb device cable, connected to "USB gender changer" -- basically two female connectors -- so that I can plug USB network card into that.

Just a thought. How about a sysfs entry which you can use to jam the device into either slave

Quoted 8 lines

or

Quoted 1 line

host mode?

Yes, that would do the trick. Auto sense is probably good solution, too, it is just that it should have /sys override or something like that.

Pavel

That is what I was thinking. Do you have an OTG device in your sysfs tree in which you could add this?

I have been working on a platform which also has OTG and I have been thinking how to handle OTG in a generic way.

A while back I started work on an OTG subsystem as there doesn’t seem to be any standard way of implementing OTG controller driver in the kernel. The only example I could find was the TI OMAP which has all the OTG stuff in the driver for the external transceiver (plus it also seemed to have 3 or 4 OTG state machines). The idea of the subsystem is to break the OTG driver into its constituent parts:

USB Host driver : This is already is the kernel and shouldn’t require any alteration.

USB Device driver: Again, the OTG subsystem should use the current framework.

USB Logic driver: This is the part of the OTG hardware that connects the slave or the host the physical connector plus clock control etc.

USB Transceiver: This driver generates the special signals the OTG protocol uses as well as detecting the signals that will cause a change of state in the state machine.

USB state machine: Some hardware has the state machine build into them, some don’t, and some have an incomplete implementation. This driver will implement in software what is lacking in the hardware state machine.

This flexible subsystem should allow you to combine any USB master, USB device, USB OTG logic and transceiver (be it internal as part of the OTG block or an external transceiver). This is only in the early stages of development and I would need to talk to the USB guys first to see what I have missed (I need to have another look at the otg_transceiver struct again). What would be great to see in sysfs is something like:

/sys/devices/platform/otg1

|--host (symbolic link to device)
|--gadget (symbolic link to device)
|--otg_logic (symbolic link to device)
|--transceiver (symbolic link to device)

`--force_mode

Just an idea!

Mark

Quoted 7 lines

Thanks, Sharp!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

___________________________________________________________
How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com