<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<STYLE type=text/css>@import url( V:\Local Settings\Temporary Internet Files\scrollbar.css );
</STYLE>
<META name=GENERATOR content="MSHTML 8.00.6001.18928"></HEAD>
<BODY style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">
<META name=GENERATOR content="MSHTML 8.00.6001.18928">
<STYLE>@font-face {
        font-family: 宋体;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: @宋体;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; layout-grid: 15.6pt; }
P.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
LI.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
DIV.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-STYLE: normal; FONT-FAMILY: Verdana; COLOR: windowtext; FONT-WEIGHT: normal; TEXT-DECORATION: none; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
UNKNOWN {
        FONT-SIZE: 10pt
}
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>
<DIV><FONT color=#000080 size=2 face=Verdana>Hi, Igor,</FONT></DIV>
<DIV><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080>Thank you very much for your
warm and professional help!</FONT></DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080>I will try to upgrade the
codes for ohci-pxa27x first.</FONT></DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"> </DIV>
<DIV style="TEXT-INDENT: 2em">>
Do you really have sl811 and r8a66597 usb host controllers on your board?<FONT
color=#000080></FONT></DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080 size=2 face=Verdana>I think no
real IC installed on my board, I just configure it on menuconfig by choose
something </FONT></DIV>
<DIV><FONT color=#000080>seems related to USB (--blindly<IMG
src="cid:__0@Foxmail.net">)</FONT></DIV>
<DIV><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080>Actually, my board use a
ISP1105 as the PHY interface,the schematic is :</FONT></DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><A
href="http://picasaweb.google.com/114830881710721561783/Public#5502732460750351090">http://picasaweb.google.com/114830881710721561783/Public#5502732460750351090</A>
</DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080>Do you think there is anything
wrong?</FONT></DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080>GPIO setting is :</FONT></DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080>//file:
mfp-pxa300.h</FONT></DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em">
<DIV>/* USB P3 */</DIV>
<DIV>#define GPIO77_USB_P3_1 MFP_CFG(GPIO77, AF2)</DIV>
<DIV>#define GPIO78_USB_P3_2 MFP_CFG(GPIO78, AF2)</DIV>
<DIV>#define GPIO79_USB_P3_3 MFP_CFG(GPIO79, AF2)</DIV>
<DIV>#define GPIO80_USB_P3_4 MFP_CFG(GPIO80, AF2)</DIV>
<DIV>#define GPIO81_USB_P3_5 MFP_CFG(GPIO81, AF2)</DIV>
<DIV>#define GPIO82_USB_P3_6 MFP_CFG(GPIO82, AF2)</DIV>
<DIV> </DIV>
<DIV>#define GPIO126_USB_SPEED MFP_CFG_LPM(GPIO126, AF5, PULL_HIGH) </DIV></DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080>I will upgrade the driver and
test it again. </FONT></DIV>
<DIV><FONT color=#000080></FONT> </DIV>
<DIV style="TEXT-INDENT: 2em"><FONT color=#000080 size=2 face=Verdana>Thank you
very very much!</FONT></DIV>
<DIV><FONT color=#000080></FONT> </DIV>
<DIV><FONT color=#c0c0c0 size=2 face=Verdana>2010-08-08 </FONT></DIV><FONT
color=#000080 size=2 face=Verdana>
<HR style="WIDTH: 100px" align=left color=#b5c4df SIZE=1>
</FONT>
<DIV><FONT color=#c0c0c0 size=2 face=Verdana><SPAN>Chen
Wenjie</SPAN></FONT></DIV>
<HR color=#b5c4df SIZE=1>
<DIV><FONT size=2 face=Verdana><STRONG>发件人:</STRONG> Igor Grinberg
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>发送时间:</STRONG> 2010-08-07
21:42:57 </FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>收件人:</STRONG> Chen Wenjie
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>抄送:</STRONG> linux-arm-kernel
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>主题:</STRONG> Re: usb host port3 on
pxa310? </FONT></DIV>
<DIV><FONT size=2 face=Verdana></FONT></DIV>
<DIV><FONT size=2 face=Verdana>
<DIV>On 08/06/10 21:43, Chen Wenjie wrote:</DIV>
<DIV>> I want to use PXA310 to realize a USB HOST.</DIV>
<DIV>></DIV>
<DIV>> (My kernel version: 2.6.27)</DIV>
<DIV>> </DIV>
<DIV></DIV>
<DIV>There was a relatively big change in ohci-pxa27x driver, I think</DIV>
<DIV>around 2.6.28-rc1. May be you should consider upgrading...</DIV>
<DIV> </DIV>
<DIV>> Zylonite have implemented a USB host through USBH_N(USBH1_N) USBH_P(USBH1_P).</DIV>
<DIV>> Unfortunatly, In PXA310, the pins of USBH1_N and USBH1_P does not exist.</DIV>
<DIV>></DIV>
<DIV>> So I have to use "usb host port3 " described in the manual "Vol. IV: Monahans </DIV>
<DIV>> L Processor and</DIV>
<DIV>> Monahans LV Processor Developers Manual"</DIV>
<DIV>></DIV>
<DIV>></DIV>
<DIV>></DIV>
<DIV>> GPIO</DIV>
<DIV>> Alternate</DIV>
<DIV>> Function</DIV>
<DIV>> Port UP3OCR[CFG]</DIV>
<DIV>> 0x0 0x2 </DIV>
<DIV>> USB_P3_1 UHC Rx Data (RCV - in) —
UHC Rx Data (RCV - </DIV>
<DIV>> out) —</DIV>
<DIV>> USB_P3_2 UHC OE (OE_n - out) — UHC OE
(OE_n - in)</DIV>
<DIV>> —</DIV>
<DIV>> USB_P3_3 UHC Rx D– (VM - in) —
UHC Rx D- (VM - </DIV>
<DIV>> out) —</DIV>
<DIV>> USB_P3_4 UHC Tx D– (VMO - out) —
UHC Tx D- (VMO - </DIV>
<DIV>> in) —</DIV>
<DIV>> USB_P3_5 UHC Rx D+ (VP - in) —
UHC Rx D+ (VP - </DIV>
<DIV>> out) —</DIV>
<DIV>> USB_P3_6 UHC Tx D+ (VPO - out) —
UHC Tx D+ (VPO - </DIV>
<DIV>> in) —</DIV>
<DIV>></DIV>
<DIV>> In the schematic, I have connected GPIO77~82 to USB_P3_1 ~ USB_P3_6.</DIV>
<DIV>> </DIV>
<DIV></DIV>
<DIV>You need also to configure those gpios to alternate function 2 in the MFPRs.</DIV>
<DIV>If you use a transceiver mode, then may be you need USBHPEN signal</DIV>
<DIV>connected to your PHY and configured accordingly in MFPR.</DIV>
<DIV>Also, in pxa310 there is a U2DP3CR register, which controls output</DIV>
<DIV>and serial mode selection of the usb port3.</DIV>
<DIV></DIV>
<DIV>></DIV>
<DIV>></DIV>
<DIV>> However, The USB port 3 does not work.</DIV>
<DIV>> Here is the log:</DIV>
<DIV>></DIV>
<DIV>> ======================================</DIV>
<DIV>> pxa27x-ohci pxa27x-ohci: PXA27x OHCI</DIV>
<DIV>> pxa27x-ohci pxa27x-ohci: new USB bus registered, assigned bus number 1</DIV>
<DIV>> pxa27x-ohci pxa27x-ohci: irq 3, io mem 0x4c000000</DIV>
<DIV>> usb usb1: configuration #1 chosen from 1 choice</DIV>
<DIV>> hub 1-0:1.0: USB hub found</DIV>
<DIV>> hub 1-0:1.0: 3 ports detected</DIV>
<DIV>> usb usb1: New USB device found, idVendor=1d6b, idProduct=0001</DIV>
<DIV>> usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1</DIV>
<DIV>> usb usb1: Product: PXA27x OHCI</DIV>
<DIV>> usb usb1: Manufacturer: Linux 2.6.27-dirty ohci_hcd</DIV>
<DIV>> usb usb1: SerialNumber: pxa27x</DIV>
<DIV>> sl811: driver sl811-hcd, 19 May 2005</DIV>
<DIV>> r8a66597_hcd: driver r8a66597_hcd, 10 Apr 2008</DIV>
<DIV>> </DIV>
<DIV></DIV>
<DIV>Do you really have sl811 and r8a66597 usb host controllers on your board?</DIV>
<DIV></DIV>
<DIV>> usb 1-3: new full speed USB device using pxa27x-ohci and address 2</DIV>
<DIV>> usb 1-3: device descriptor read/64, error -62</DIV>
<DIV>> usb 1-3: device descriptor read/64, error -62</DIV>
<DIV>> usb 1-3: new full speed USB device using pxa27x-ohci and address 3</DIV>
<DIV>> usb 1-3: device descriptor read/64, error -62</DIV>
<DIV>> usb 1-3: device descriptor read/64, error -62</DIV>
<DIV>> usb 1-3: new full speed USB device using pxa27x-ohci and address 4</DIV>
<DIV>> usb 1-3: device not accepting address 4, error -62</DIV>
<DIV>> usb 1-3: new full speed USB device using pxa27x-ohci and address 5</DIV>
<DIV>> usb 1-3: device not accepting address 5, error -62</DIV>
<DIV>> hub 1-0:1.0: unable to enumerate USB device on port 3</DIV>
<DIV>> ======================================</DIV>
<DIV>></DIV>
<DIV>></DIV>
<DIV>> Then I found a bit in UP2OCR -- (VPMBlockEnbN).</DIV>
<DIV>> It is quite strange (if not ugly:( ) the this bit is to control port 3</DIV>
<DIV>> (In UP2OCR--a register for port 2, while there is too many unused bits in </DIV>
<DIV>> UP3OCR)</DIV>
<DIV>></DIV>
<DIV>> But I am not very sure how to use this bit.</DIV>
<DIV>> I grep the source tree, but found nothing about VPMBlockEnbN.</DIV>
<DIV>></DIV>
<DIV>></DIV>
<DIV>> Can anyone tell me that how to write a driver for USB-host-port-3?</DIV>
<DIV>> </DIV>
<DIV></DIV>
<DIV>As far as I know pxa310 usb port3 does not need any special driver</DIV>
<DIV>to work in host mode, ohci-pxa27x is enough.</DIV>
<DIV>Currently, the setup of registers, which are not related to UHC</DIV>
<DIV>(UP2OCR, UP3OCR, etc.), is done in the board code, in the ohci</DIV>
<DIV>callback.</DIV>
<DIV></DIV>
<DIV>> High appreciation for your kind help!</DIV>
<DIV>></DIV>
<DIV>></DIV>
<DIV>></DIV>
<DIV>></DIV>
<DIV>> _______________________________________________</DIV>
<DIV>> linux-arm-kernel mailing list</DIV>
<DIV>> linux-arm-kernel@lists.infradead.org</DIV>
<DIV>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel</DIV>
<DIV>> </DIV>
<DIV></DIV>
<DIV>-- </DIV>
<DIV>Regards,</DIV>
<DIV>Igor.</DIV>
<DIV></DIV></FONT></DIV></BODY></HTML>