On Tue, 28 Jun 2005, Bill Gatliff wrote:
> The isp1161's INT1 line is tied to GPIO22 on my PXA255
> (according to the schematic). Here is my latest platform
> stuff:
>
> #define CSB625_USB_PHYS PXA_CS5_PHYS
> #define CSB625_USB_IRQ 22
>
> static struct resource isp116x_resources[] = {
> [0] = {
> .start = CSB625_USB_PHYS,
> .end = CSB625_USB_PHYS + 1,
> .flags = IORESOURCE_MEM,
> },
> [1] = {
> .start = CSB625_USB_PHYS + 2,
> .end = CSB625_USB_PHYS + 3,
> .flags = IORESOURCE_MEM,
> },
> [2] = {
> .start = CSB625_USB_IRQ,
> .end = CSB625_USB_IRQ,
> .flags = IORESOURCE_IRQ,
> },
> };
>
> static struct isp116x_platform_data
> csb625_isp116x_platform_data = {
> .sel15Kres = 1,
> .int_act_high = 1,
> .int_edge_triggered = 1,
> };
>
> static struct platform_device isp116x_device = {
> .name = "isp116x-hcd",
> .id = 0,
> .num_resources = ARRAY_SIZE(isp116x_resources),
> .resource = isp116x_resources,
> .dev = {
> .platform_data = &csb625_isp116x_platform_data,
> },
> };
>
> ...
> pxa_gpio_mode(GPIO33_nCS_5_MD);
> pxa_gpio_mode(CSB625_USB_IRQ);
> set_irq_type(IRQ_GPIO(CSB625_USB_IRQ), IRQT_RISING);
> ...
>
> I also modified /proc/driver/isp116x, so that it also
> reports register values.
>
> [Note: I'm a bit confused about the IRQ_GPIO macro, I'm not
> sure where I need it and where I don't. But variations on
> where I put it don't seem to improve anything.]
>
I cannot comment on IRQ_GPIO. I have never worked with pxa.
It seems that we can better continue this discussion on LAK
list. I'm subscribed there too.
> Ok, with that out of the way, here is what I see the machine
> doing. After booting without a device attached:
>
> # cat /proc/driver/isp116x
> ISP116x Host Controller
> isp116x-hcd version 08 Apr 2005
> hc_irq_enable 0012 opr atl
> hc_irq_status 0041 clkrdy sof
> hc_int_enable 80000050 MIE rhsc ue
> hc_int_status 00000024 fno sof
> periodic size= 32
> HCREVISION [00]: 00000010
> HCCONTROL [01]: 00000080
> HCCMDSTAT [02]: 00000000
> HCINTSTAT [03]: 00000024
> HCINTENB [04]: 80000050
> HCFMINTVL [0d]: 27782edf
> HCFMREM [0e]: 00002d7b
> HCFMNUM [0f]: 0000c780
> HCLSTHRESH [11]: 00000628
> HCRHDESCA [12]: 19000002
> HCRHDESCB [13]: 00060000
> HCRHSTATUS [14]: 00000000
> HCRHPORT1 [15]: 00000000
> HCRHPORT2 [16]: 00000000
> HCHWCFG [20]: 100f
> HCDMACFG [21]: 0000
> HCXFERCTR [22]: 0000
> HCuPINT [24]: 0041
> HCuPINTENB [25]: 0012
> HCCHIPID [27]: 6123
> HCSCRATCH [28]: 0000
> HCITLBUFLEN [2a]: 0000
> HCATLBUFLEN [2b]: 1000
> HCBUFSTAT [2c]: 0000
> HCRDITL0LEN [2d]: 0000
> HCRDITL1LEN [2e]: 0000
>
> # cat /proc/interrupts
> CPU0
> 4: 0 pxa2xx_udc
> 10: 2 LCD
> 13: 474 STUART
> 16: 6 pxa2xx-mci
> 18: 0 DMA
> 19: 220088 PXA Timer Tick
> 22: 0 isp116x-hcd:usb1
> 26: 0 pxamcicd
> 33: 0 CF0 IRQ
> 35: 0 CF0 CD
> 37: 20014 eth0
> Err: 0
>
>
> Now plug in a USB keyboard:
>
> # cat /proc/driver/isp116x
> ISP116x Host Controller
> isp116x-hcd version 08 Apr 2005
> hc_irq_enable 0012 opr atl
> hc_irq_status 0041 clkrdy sof
> hc_int_enable 80000050 MIE rhsc ue
> hc_int_status 00000024 fno sof
> periodic size= 32
> HCREVISION [00]: 00000010
> HCCONTROL [01]: 00000080
> HCCMDSTAT [02]: 00000000
> HCINTSTAT [03]: 00000024
> HCINTENB [04]: 80000050
> HCFMINTVL [0d]: 27782edf
> HCFMREM [0e]: 00001bdb
> HCFMNUM [0f]: 00000c1a
> HCLSTHRESH [11]: 00000628
> HCRHDESCA [12]: 19000002
> HCRHDESCB [13]: 00060000
> HCRHSTATUS [14]: 00000000
> HCRHPORT1 [15]: 00000000
> HCRHPORT2 [16]: 00000000
> HCHWCFG [20]: 100f
> HCDMACFG [21]: 0000
> HCXFERCTR [22]: 0000
> HCuPINT [24]: 0041
> HCuPINTENB [25]: 0012
> HCCHIPID [27]: 6123
> HCSCRATCH [28]: 0000
> HCITLBUFLEN [2a]: 0000
> HCATLBUFLEN [2b]: 1000
> HCBUFSTAT [2c]: 0000
> HCRDITL0LEN [2d]: 0000
> HCRDITL1LEN [2e]: 0000
>
>
> # cat /proc/interrupts
> CPU0
> 4: 0 pxa2xx_udc
> 10: 2 LCD
> 13: 532 STUART
> 16: 6 pxa2xx-mci
> 18: 0 DMA
> 19: 224547 PXA Timer Tick
> 22: 0 isp116x-hcd:usb1
> 26: 0 pxamcicd
> 33: 0 CF0 IRQ
> 35: 0 CF0 CD
> 37: 20056 eth0
> Err: 0
>
>
> Finally, booting with pen drive *and* a keyboard attached
> (and, in this case, with IRQ_GPIO in the resources
> definition):
>
> # cat /proc/driver/isp116x
> ISP116x Host Controller
> isp116x-hcd version 08 Apr 2005
> hc_irq_enable 0012 opr atl
> hc_irq_status 0041 clkrdy sof
> hc_int_enable 80000050 MIE rhsc ue
> hc_int_status 00000024 fno sof
> periodic size= 32
> HCREVISION [00]: 00000010
> HCCONTROL [01]: 00000080
> HCCMDSTAT [02]: 00000000
> HCINTSTAT [03]: 00000024
> HCINTENB [04]: 80000050
> HCFMINTVL [0d]: 27782edf
> HCFMREM [0e]: 00000b94
> HCFMNUM [0f]: 00008867
> HCLSTHRESH [11]: 00000628
> HCRHDESCA [12]: 19000002
> HCRHDESCB [13]: 00060000
> HCRHSTATUS [14]: 00000000
> HCRHPORT1 [15]: 00000000
> HCRHPORT2 [16]: 00000000
One strange thing is that these two registers remain 0
regardless of whether anything is plugged in or not. For
comparison, if I have a low-speed device (mouse) plugged in,
I see the following:
116x: HCRHPORT1 [15]: 00000100
116x: HCRHPORT2 [16]: 00110301
This should be independent of the interrupt settings. The
strange thing is why your regs 15,16 report that ports are
not powered; bit 8 should read 1 if the chip is initialized
successfully.
> HCHWCFG [20]: 100f
> HCDMACFG [21]: 0000
> HCXFERCTR [22]: 0000
> HCuPINT [24]: 0041
> HCuPINTENB [25]: 0012
> HCCHIPID [27]: 6123
> HCSCRATCH [28]: 0000
> HCITLBUFLEN [2a]: 0000
> HCATLBUFLEN [2b]: 1000
> HCBUFSTAT [2c]: 0000
> HCRDITL0LEN [2d]: 0000
> HCRDITL1LEN [2e]: 0000
>
> # cat /proc/interrupts
> CPU0
> 4: 0 pxa2xx_udc
> 10: 1 LCD
> 13: 316 STUART
> 16: 6 pxa2xx-mci
> 18: 0 DMA
> 19: 11250 PXA Timer Tick
> 26: 0 pxamcicd
> 33: 0 CF0 IRQ
> 35: 0 CF0 CD
> 37: 19830 eth0
> 45: 0 isp116x-hcd:usb1
^^
Note that now the hcd is at int45.
> Err: 0
>
>
> Regarding your comment on power connections, that was bad
> grammar on my part. What I see is that the VCC pin has 5V,
> and without any devices attached the other pins are all 0V.
> With the keyboard attached, one of the data pins goes to
> 3.3V. With the pen drive attached, the *other* data pin
> goes to about 2.9V.
Sounds OK. I see the power line at 4.9V and when plugging a
mouse, one of the data pins goes from 0 to 2.9V.
One thing: both Ian and me have no_power_switching = 1 in
our configurations, while you don't. Try this. It may well
be that there's a bug in driver.
For comparison, below are the messages at insmod-ing if a
mouse is plugged in. In the driver, both DEBUG and VERBOSE
are defined.
# insmod isp116x-hcd.ko
116x: driver isp116x-hcd, 08 Apr 2005
isp116x-hcd isp116x-hcd.0: ISP116x Host Controller
isp116x-hcd isp116x-hcd.0: new USB bus registered, assigned
bus number 1
isp116x-hcd isp116x-hcd.0: irq 5, io base 0x10000002
isp116x-hcd isp116x-hcd.0: supports USB remote wakeup
usb usb1: default language 0x0409
usb usb1: new device strings: Mfr=3, Product=2,
SerialNumber=1
usb usb1: Product: ISP116x Host Controller
usb usb1: Manufacturer: Linux 2.6.12-rc3 isp116x-hcd
usb usb1: SerialNumber: isp116x-hcd.0
usb usb1: adding 1-0:1.0 (config #1, interface 0)
hub 1-0:1.0: usb_probe_interface
hub 1-0:1.0: usb_probe_interface - got id
hub 1-0:1.0: USB hub found
116x: GetHubDescriptor
hub 1-0:1.0: 2 ports detected
hub 1-0:1.0: standalone hub
hub 1-0:1.0: no power switching (usb 1.0)
hub 1-0:1.0: global over-current protection
hub 1-0:1.0: power on to power good time: 50ms
116x: GetHubStatus
hub 1-0:1.0: local power source is good
hub 1-0:1.0: no over-current condition exists
hub 1-0:1.0: state 5 ports 2 chg 0000 evt 0000
116x: GetPortStatus
116x: GetPortStatus: port[1] 00000000
116x: GetPortStatus
116x: GetPortStatus: port[2] 00000000
116x: HCREVISION [00]: 00000010
116x: HCCONTROL [01]: 00000480
116x: HCCMDSTAT [02]: 00000000
116x: HCINTSTAT [03]: 00000044
116x: HCINTENB [04]: 80000058
116x: HCFMINTVL [0d]: 27782edf
116x: HCFMREM [0e]: 000001c9
116x: HCFMNUM [0f]: 00000015
116x: HCLSTHRESH [11]: 00000628
116x: HCRHDESCA [12]: 19000202
116x: HCRHDESCB [13]: 00060000
116x: HCRHSTATUS [14]: 00008000
116x: HCRHPORT1 [15]: 00000100
116x: HCRHPORT2 [16]: 00110301
116x: HCHWCFG [20]: 1809
116x: HCDMACFG [21]: 0000
116x: HCXFERCTR [22]: 0000
116x: HCuPINT [24]: 0011
116x: HCuPINTENB [25]: 0012
116x: HCCHIPID [27]: 6122
116x: HCSCRATCH [28]: 0000
116x: HCITLBUFLEN [2a]: 0000
116x: HCATLBUFLEN [2b]: 1000
116x: HCBUFSTAT [2c]: 0000
116x: HCRDITL0LEN [2d]: 0000
116x: HCRDITL1LEN [2e]: 0000
# hub 1-0:1.0: state 5 ports 2 chg 0000 evt 0004
116x: GetPortStatus
116x: GetPortStatus: port[2] 00110301
116x: ClearPortFeature: <7>116x: USB_PORT_FEAT_C_CONNECTION
hub 1-0:1.0: reset change on port 2
116x: ClearPortFeature: <7>116x: USB_PORT_FEAT_C_RESET
hub 1-0:1.0: port 2, status 0301, change 0011, 1.5 Mb/s
116x: GetPortStatus
116x: GetPortStatus: port[2] 00000301
116x: GetPortStatus
116x: GetPortStatus: port[2] 00000301
116x: GetPortStatus
116x: GetPortStatus: port[2] 00000301
116x: GetPortStatus
116x: GetPortStatus: port[2] 00000301
116x: GetPortStatus
116x: GetPortStatus: port[2] 00000301
hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms
status 0x301
116x: SetPortFeature: <7>116x: USB_PORT_FEAT_RESET
116x: GetPortStatus
116x: GetPortStatus: port[2] 00100303
116x: ClearPortFeature: <7>116x: USB_PORT_FEAT_C_RESET
usb 1-2: new low speed USB device using isp116x-hcd and
address 2
116x: Allowed data underrun
116x: SetPortFeature: <7>116x: USB_PORT_FEAT_RESET
116x: GetPortStatus
116x: GetPortStatus: port[2] 00100303
116x: ClearPortFeature: <7>116x: USB_PORT_FEAT_C_RESET
usb 1-2: skipped 1 descriptor after interface
116x: Allowed data underrun
usb 1-2: default language 0x0409
116x: Allowed data underrun
usb 1-2: new device strings: Mfr=1, Product=0,
SerialNumber=0
usb 1-2: Manufacturer: Logitech
usb 1-2: adding 1-2:1.0 (config #1, interface 0)
usbhid 1-2:1.0: usb_probe_interface
usbhid 1-2:1.0: usb_probe_interface - got id
116x: Allowed data underrun
input: USB HID v1.00 Mouse [Logitech] on usb-isp116x-hcd.0-2
hub 1-0:1.0: state 5 ports 2 chg 0000 evt 0004
116x: GetPortStatus
116x: GetPortStatus: port[2] 00000303
Olav
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel