This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to config the usb host if I want to use omap3530 with a 4-pin usb transceiver

Other Parts Discussed in Thread: OMAP3530, TUSB2046B, TPS65930

    I am using omap3530 with a 4-pin usb transceiver through port2(mm2txdat , mm2txen ,mm2_rxrcv , mm2_txse0 )  . I config the usb host according to the datasheet: 23.2.5 High-Speed USB Host Subsystem Basic Programming Model

that is:  1, bypass ULPI by setting 1 to the corresponding bits in UHH_HOSTCONFIG

              2, config TLL_CHANNEL_CONF  and choose  UTMI-to-serial (FS/LS) mode: To serial controller (TLL) or serial PHY   and    4-pin" bidirectional PHY i/f mode    

    But the usb host doesn't work.   Is there anyother register that I need to config? 

Please help me !

  • Simon,

    Which development board ar you using ? and whats the PHY connected. In general you need to configure,

    you can refer linux implementation of USBHOST driver at,

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/usb/host/ehci-omap.c;h=f784ceb862a3e24f924561d4fda04b36240bdec3;hb=6f576d57f1fa0d6026b495d8746d56d949989161

    Regards,

    Ajay

  • Ajay,

      thanks for you reply.

    Which development board ar you using ?

      I am using a board that is similar to beagle board. The difference is that we use  a 4-pin serial usb transceiver instead of  the 12-pin ULPI usb transceiver.

    and whats the PHY connected

    Actually , I don't know the exactly meaning of PHY. I think PHY means a physical layer transceiver which the usb host controller will connect to. And thus the PHY here means the 4-pin usb transceiver.    In my unstanding and according to the datasheet , if I want to use a 4-pin serial usb transceiver , I need to use USBTLL module and set the usb host controller to mode : Serial PHY (transceiver ) .  Is my understanding correct?

    you can refer linux implementation of USBHOST driver at,

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/usb/host/ehci-omap.c;h=f784ceb862a3e24f924561d4fda04b36240bdec3;hb=6f576d57f1fa0d6026b495d8746d56d949989161

      The source code I am using  is a copy of rowboat project.  I also have a copy of linux kernel source code which is download from ti (I am also using DVSDK) .   And  the source codes about usb host  are the same.   The codes default configs usb host controller in PHY mode,which need a 12-pin usb transceiver to make the usb system work.  

        Thanks in advance.

       

     

  • If my unstanding about the usb host is correct ,  I have a question  in Ehci-omap.c  about how to config the usb host controller mode.  

      Ehci-omap.c  Line 575:     In function:  omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd) 

     omap_start_ehc (struct ehci_hcd_omap *omap, struct usb_hcd *hcd)    will call  omap_usb_utmi_init(omap, tll_ch_mask)     and    

    tll_ch mask is :

    #define OMAP_TLL_CHANNEL_1_EN_MASK   (1 << 1)  // defined in Ehci-omap.c
    #define OMAP_TLL_CHANNEL_2_EN_MASK   (1 << 2)  // defined in Ehci-omap.c
    #define OMAP_TLL_CHANNEL_3_EN_MASK   (1 << 4)   // defined in Ehci-omap.c

      if (omap->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL)
           tll_ch_mask |= OMAP_TLL_CHANNEL_1_EN_MASK;
      if (omap->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL)
           tll_ch_mask |= OMAP_TLL_CHANNEL_2_EN_MASK;
      if (omap->port_mode[2] == EHCI_HCD_OMAP_MODE_TLL)
           tll_ch_mask |= OMAP_TLL_CHANNEL_3_EN_MASK;

    It means that bit1,bit2,bit4 are used as flags and  will be used in function omap_usb_utmi_init()  to config the 3 usb ports . The problem is here:  in omap_usb_utmi_init() ,  the code uses bit0,bit1,bit2  of  tll_ch_mask  to judge whether to config the corresponding channel or just skip.  

    So I think it is an error. 

  • USB PHY is needed when you program USBHOST in PHY mode and not in TLL. You comment on possible error on channel mask look correct. It seems your are using linux driver only so could you test again with these changes ?

    Regards,
    ajay

  • Ajay

        I am a little confused.  According to Datasheet  23.2.5 High-Speed USB Host Subsystem Basic Programming Model  and  Figure 23-33. Selecting and Configuring High-Speed USB Host Subsystem Connectivity .   

       If we want to use the serial PHY interface, we have to use USBTLL module. Then we can choose Serial PHY(transciever) interface or Serial TLL interface.  

       Is my understanding wrong? could you please correct me? Thanks a lot.

    It seems your are using linux driver only so could you test again with these changes ?

    Yes,I am using linux driver. I have modified the code but has no luck. And I have checked several versions of linux kernel , all have the same ehci-omap.c file.  So I am getting more confused.

  • The EHCI module only supports high speed USB.  You need to be using the OHCI drivers for low/full speed USB with 4-pin USB transceiver.

     

    You should be setting UHH_HOSTCONF[11] = 0x1, TLL_CHANNEL_CONF_i[27:24] = 0x3, TLL_CHANNEL_CONF_i[2:1] = 0x1.  However, you may also need to configure the pin multiplexing registers to select the correct multiplexing mode for the four pins that connect to the USB transceiver.

     

    Regards,

    Paul

     

     

  •  , thanks a lot.  I will try it now.

  •   ,  I config linux kernel with OHCI support only but I don't see the OHCI driver being loaded. 

       When using EHCI , a definition of platform_device is in file arch\arm\mach-omap2\Usb-ehci.c .  And the device will be register to linux when the system boot.  Compared to EHCI driver, there isn't  a  file which contains the definition of   platform_device  to match the ohci driver. So the ohci driver won't be loaded.  I am not sure about how to define a ohci platform_device ,  can you help me ?  Thanks again.

  • Simon,

    looks like you are using old kernel version as latest kernel does have OHCI support added. Please check the latest source at,

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=arch/arm/mach-omap2/usb-ehci.c;h=25eeadabc39b36b5a007f18205bcdb51589acc27;hb=f5412be599602124d2bdd49947b231dd77c0bf99

    You can apply OHCI support patches instead of moving to new kernel.

    Regards,

    Ajay

  • Here are the three patches supporting OHCI,

    1. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=95344fcc07964202737f85c16dbabbc40cae5e4d;hp=73a0bd77d60163d8b4639834119a1ed65155c062

    2. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=88ed0c97c9e9d48dddeca98856645f6ee5c56489;hp=95344fcc07964202737f85c16dbabbc40cae5e4d

    3. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=968b448b22f5a42689cc55648510834010d42379;hp=88ed0c97c9e9d48dddeca98856645f6ee5c56489

    Regards,
    Ajay

  • Ajay,

        Thanks for your help very much.   I have checked my source code and it does need to be patched.  I have two version of linux kernel in my hand. One is a copy of  Rowboat Project and the other is AM35x-OMAP35x-PSP-SDK-03.00.00.03 .   Unfortunately,  they are all unpatched.   I think I'd better get a new kernel first. 

      Thanks again.

      Best Regards

      Simon

  • Ajay said:

    Here are the three patches supporting OHCI,

    1. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=95344fcc07964202737f85c16dbabbc40cae5e4d;hp=73a0bd77d60163d8b4639834119a1ed65155c062

    2. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=88ed0c97c9e9d48dddeca98856645f6ee5c56489;hp=95344fcc07964202737f85c16dbabbc40cae5e4d

    3. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=968b448b22f5a42689cc55648510834010d42379;hp=88ed0c97c9e9d48dddeca98856645f6ee5c56489

    Regards,
    Ajay

     

    Ajay ,

      The linux kernel I am using is 2.6.32. I have applied the three patches  and  add the following codes to make OHCI  driver be called:

    static struct ohci_hcd_omap_platform_data ohci_pdata __initdata = {

     .port_mode[0] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
     .port_mode[1] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
     .port_mode[2] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,  //

     .es2_compatibility  = true  //  ES2.1
    };

    Now only the OHCI driver is loaded. But the usb host still can not accept usb device successfully.  Here are some debug messages:

    usb 1-2: new full speed USB device using ohci-omap3 and address 3
    usb 1-2: device descriptor read/64, error -62
    usb 1-2: device descriptor read/64, error -62
    usb 1-2: new full speed USB device using ohci-omap3 and address 4
    usb 1-2: device descriptor read/64, error -62
    usb 1-2: device descriptor read/64, error -62
    usb 1-2: new full speed USB device using ohci-omap3 and address 5
    usb 1-2: device not accepting address 5, error -62
    usb 1-2: new full speed USB device using ohci-omap3 and address 6
    usb 1-2: device not accepting address 6, error -71
    hub 1-0:1.0: unable to enumerate USB device on port 2
    hub 1-0:1.0: connect-debounce failed, port 2 disabled

      When the system boots up, I read out the UHH_CONFIG and TLL_CHANNEL_CONF registers:

    UHH_CONFIG: phy_addr=0x48064040 ,mapped_addr=0xfa064040,val=0x0000001d
    channel0: phy_addr=0x48062040 ,mapped_addr=0xfa062040,val=0x030006db
    channel1: phy_addr=0x48062044 ,mapped_addr=0xfa062044,val=0x030006db
    channel2: phy_addr=0x48062048 ,mapped_addr=0xfa062048,val=0x030006db  

       I think the config is right.  And then,  I use a oscillograph to observe signals on the pins that connect to the transceiver.  When I insert a device, there are signals on mm2_txen(controls the usb transceiver to input or output),  mm2_txdat (VP), and I don't see any signal on mm2_txse0 (VM) .   What can be the problem?   

    BTW: where can I download the latest linux kernel(supports BeagleBoard) supported by TI?  I  have downloaded kernels at: http://arago-project.org/git/projects/?p=linux-omap3.git;a=summary   and    http://www.kernel.org/pub/linux/kernel/v2.6/  . But there is no config file for BeagleBoard.

       

  • And then,  I use a oscillograph to observe signals on the pins that connect to the transceiver.  When I insert a device, there are signals on mm2_txen(controls the usb transceiver to input or output),  mm2_txdat (VP), and I don't see any signal on mm2_txse0 (VM)

    Actually, signals at   mm2_txen  and   mm2_txdat  may probably just electric level changes.  When I insert usb device ,the mm2_txen becomes high  and VP(D+) also becomes high so that the usb host can detect usb device.     The signal at mm2_txdat is the same as mm2_txen. So I think they are not usb datas and my last description is not correct.

       The electric level at mm2_txen is controlled by usb host controller,isn't it?  If signals changes at mm2_txen , it means usb host controller functions correctly?  Then why there isn't any usb data output?    still the usb driver problem??

  • Simon,

    You can refer the latest drivers at Linus's tree below,

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary

     

    Regards,

    Ajay

  • Ajay said:

    Simon,

    You can refer the latest drivers at Linus's tree below,

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary

     

    Regards,

    Ajay

     

    Ajay

        Thanks for your reply.  I am building Rowboat project and it is a Google Android system based on OMAP35xx platform.  So I can not just replace the whole kernel.  I tried to port usb host driver from 2.6.37 to 2.6.32 , but some definitions have already changed. So a lot of  errors will appear when building the kernel. 

        What's the best way to make usb host controller work with a 4-pin transceiver? Can you give me some advice? Thanks a lot.

     

     

  • Simon,

    I think you need to just comapre the latest files with your current version and take only necessary changes for OHCI. like, drivers/usb/host/ohci-omap3.c and arch/arm/mach-omap2/usb-ehci.c etc.

    Regards,
    Ajay

  • Ajay said:

    Simon,

    I think you need to just comapre the latest files with your current version and take only necessary changes for OHCI. like, drivers/usb/host/ohci-omap3.c and arch/arm/mach-omap2/usb-ehci.c etc.

    Regards,
    Ajay

     

    Ajay

        I will try it. 

       In the new versions of linux kernel code, the function usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata)  is never called, and there is no instance of  struct ohci_hcd_omap_platform_data.  How can the kernel works with OHCI only?  Do we have to define an object of struct ohci_hcd_omap_platform_data as I did before:

    static struct ohci_hcd_omap_platform_data ohci_pdata __initdata = {

     .port_mode[0] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
     .port_mode[1] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
     .port_mode[2] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,  //

     .es2_compatibility  = true  //  ES2.1
    };

       Please correct me if I am wrong.

  • Ajay said:

    Simon,

    I think you need to just comapre the latest files with your current version and take only necessary changes for OHCI. like, drivers/usb/host/ohci-omap3.c and arch/arm/mach-omap2/usb-ehci.c etc.

    Regards,
    Ajay

     

    Ajay

        I will try it. 

       In the new versions of linux kernel code, the function usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata)  is never called, and there is no instance of  struct ohci_hcd_omap_platform_data.  How can the kernel works with OHCI only?  Do we have to define an object of struct ohci_hcd_omap_platform_data as I did before:

    static struct ohci_hcd_omap_platform_data ohci_pdata __initdata = {

     .port_mode[0] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
     .port_mode[1] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
     .port_mode[2] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,  //

     .es2_compatibility  = true  //  ES2.1
    };

       Please correct me if I am wrong.

  • Yes, you need to define "ohci_hcd_omap_platform_data ohci_pdata" and call usb_ohci_init from board file. Additionally you should enable OHCI HCD in defconfig.

    Regards,

    Ajay

  • Ajay

        I port OHCI from 2.6.35 to my linux kernel 2.6.32 , including:

    ohci-hcd.c  ohci-omap3.c  ohci-omap.c  usb-ehci.c.

    And the system still can not accept usb device.    By enabling verbose log, I got the following  dmesg:

    # dmesg
    <7>hub 1-0:1.0: state 7 ports 3 chg 0000 evt 0004
    <7>ohci-omap3 ohci-omap3.0: GetStatus roothub.portstatus [1] = 0x00010100 CSC PPS
    <7>hub 1-0:1.0: port 2, status 0100, change 0001, 12 Mb/s
    <7>hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x100
    <7>ohci-omap3 ohci-omap3.0: auto-stop root hub
    <7>ohci-omap3 ohci-omap3.0: auto-wakeup root hub
    <7>hub 1-0:1.0: state 7 ports 3 chg 0000 evt 0004
    <7>ohci-omap3 ohci-omap3.0: GetStatus roothub.portstatus [1] = 0x00010101 CSC PPS CCS
    <7>hub 1-0:1.0: port 2, status 0101, change 0001, 12 Mb/s
    <7>hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101
    <7>ohci-omap3 ohci-omap3.0: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES CCS
    <6>usb 1-2: new full speed USB device using ohci-omap3 and address 11
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES CCS
    <3>usb 1-2: device descriptor read/64, error -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES CCS
    <3>usb 1-2: device descriptor read/64, error -62
    <7>ohci-omap3 ohci-omap3.0: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES CCS
    <6>usb 1-2: new full speed USB device using ohci-omap3 and address 12
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES CCS
    <3>usb 1-2: device descriptor read/64, error -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0in 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES CCS
    <3>usb 1-2: device descriptor read/64, error -62
    <7>ohci-omap3 ohci-omap3.0: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES CCS
    <6>usb 1-2: new full speed USB device using ohci-omap3 and address 13
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0out 7ec20000 cc 7 --> status -71
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0out 7ec20000 cc 7 --> status -71
    <3>usb 1-2: device not accepting address 13, error -71
    <7>ohci-omap3 ohci-omap3.0: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES CCS
    <6>usb 1-2: new full speed USB device using ohci-omap3 and address 14
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0out 5ec20000 cc 5 --> status -62
    <7>ohci-omap3 ohci-omap3.0: urb cb6186c0 path 2 ep0out 5ec20000 cc 5 --> status -62
    <3>usb 1-2: device not accepting address 14, error -62
    <3>hub 1-0:1.0: unable to enumerate USB device on port 2
    <7>hub 1-0:1.0: state 7 ports 3 chg 0000 evt 0004

    Is there any useful information?

  •  

    Simon,

    Please share the schematics of your custom board and also provide the register dump of host controller using below script and readmem tool.

    2235.ehcidump.txt

    6038.readmem.txt [remove .txt ext]

    Regards,
    Ajay

  • Ajay

        The program you provided can not run in android.  So I wrote a program to dump the registers as you required. The OMAP3530 package is BCUS.

       3175.usb_reg_dump_info.txt  6403.usb transceiver.doc

  • Ajay

        The size of the schematics is nealy 5M and it is difficult to upload here.    Can you tell me your email address so that I can send it to you.

        Thanks a lot.

  • Ajay

        I would like to confirm that theOHCI host controller works fine.  Are there any usb register that I can write to make the cpu pins output some signals?

        If writing data to usb register can generate signal on cpu pins , then there may be some problem with the usb host driver.

    Best regards

    Simon.

  • Ajay,

        I noticed that  all the 3 HCRHPORTSTATUS registers have the same value.

    0x48064454 = 0x00000100
    0x48064458 = 0x00000100
    0x4806445c = 0x00000100

    Bit8 is set to 1 and it means that the corresponding usb port power is not enabled.  Does it mean that we must enable the power first?  How can I make the usb port2 power enabled?

  • Simon,

    We got your schematics and register dump reviewed by internal team. The response is:

    1. Your configuration is 4-pin DP/DM mode

    2. Pads look okay, TLL_CHANNEL_CONF looks okay - for port2.

    3. But UHH_HOSTCONFIG.P2_ULPI_BYPASS needs to be set (bit 11 in register 0x48064040).

    4. Which rev of the OMAP3x silicon is this? ES1.0, 2.1, 3.0 or 3.1

    Ajay

     

     

  • Ajay said:

    Simon,

    We got your schematics and register dump reviewed by internal team. The response is:

    1. Your configuration is 4-pin DP/DM mode

    2. Pads look okay, TLL_CHANNEL_CONF looks okay - for port2.

    3. But UHH_HOSTCONFIG.P2_ULPI_BYPASS needs to be set (bit 11 in register 0x48064040).

    4. Which rev of the OMAP3x silicon is this? ES1.0, 2.1, 3.0 or 3.1

    Ajay

     

     

     

    Hi Ajay

        Yes,the configuration is 4-pin DP/DM mode because I am using a 4-pin usb transceiver on usb host port2.      

    3. But UHH_HOSTCONFIG.P2_ULPI_BYPASS needs to be set (bit 11 in register 0x48064040).

         My agent told that the rev is ES2.1 .   

          If the rev<=ES2.1  the OHCI driver only sets bit0. If the rev>ES2.1.      I  have tried to set bit11 in register 0x48064040 but  it seems that bit11 can  NOT  be set.  

    The OHCI code is like this:

      if (omap->es2_compatibility) {
      /*
       * All OHCI modes need to go through the TLL,
       * unlike in the EHCI case. So use UTMI mode
       * for all ports for OHCI, on ES2.x silicon
       */
      dev_dbg(omap->dev, "OMAP3 ES version <= ES2.1\n");
      reg |= OMAP_UHH_HOSTCONFIG_ULPI_BYPASS;
      reg |= 1<<11;  //cyh add
      printk("****cyh: UHH_HOSTCONFIG=0x%08x\n",reg);  //cyh add
     } else {
      dev_dbg(omap->dev, "OMAP3 ES version > ES2.1\n");
      if (omap->port_mode[0] == OMAP_OHCI_PORT_MODE_UNUSED)
       reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS;
      else
       reg |= OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS;

      if (omap->port_mode[1] == OMAP_OHCI_PORT_MODE_UNUSED)
       reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS;
      else
       reg |= OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS;

      if (omap->port_mode[2] == OMAP_OHCI_PORT_MODE_UNUSED)
       reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS;
      else
       reg |= OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS;

     }
     ohci_omap_writel(omap->uhh_base, OMAP_UHH_HOSTCONFIG, reg);
     dev_dbg(omap->dev, "UHH setup done, uhh_hostconfig=%x\n", reg);
     printk("UHH setup done, uhh_hostconfig=%x\n", ohci_omap_readl(omap->uhh_base,OMAP_UHH_HOSTCONFIG));    //  The value of the reg is 0x1d.   It means that  bit11 is cleared. This is very strange.

     ohci_omap3_tll_config(omap);

  • Ajay,

        I have read several version's linux kernel codes about usb driver.  I found that most of the codes are platform-independent. For example: ohci_urb_enqueue,ohci_urb_dequeue.  Thus, what we need to do is call  platform-depedent  codes to initialize the source(eg:enable the clock) and then pass the correct OHCI register base address to  platform-independent code.   

      So I think only the following files need to be modified or added (like you said)

    1. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=95344fcc07964202737f85c16dbabbc40cae5e4d;hp=73a0bd77d60163d8b4639834119a1ed65155c062

    2. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=88ed0c97c9e9d48dddeca98856645f6ee5c56489;hp=95344fcc07964202737f85c16dbabbc40cae5e4d

    3. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=968b448b22f5a42689cc55648510834010d42379;hp=88ed0c97c9e9d48dddeca98856645f6ee5c56489

     

    But why the OHCI still can not work?  I have followed the code and found that when a usb device is inserted, the function: ohci_urb_enqueue will be call to send a USB control frame to usb device.   But the OHCI controller doesn't output any data.  Then the ohci driver returns error because it doesn't get respoonse from the usb device.

    Does it means that there is something wrong with the OHCI controller? Or the configure is wrong?

  •   Can anyone give me some advice? 

      I think most of the OHCI codes are platform-independent and what we need to do is to initialize the OMAP3530 correctly   and passing the common  resources (eg: OHCI register base) to OHCI driver.    Am I correct?

      I have checked that the code has enabled the usb clock and configed the usb host controller as the datasheet said. But why  the usb host still can not work?

      What can the problem be?  

  •   I set the usb transceiver mode to FS mode and now omap3530 can accept a hub.

  • That's great news Simon Cool. 

    Can you be more specific about what you did to resolve the problem?  Was this a software driver or hardware configuration change?

     

    Regards,

    Paul

  • peaves said:

    That's great news Simon Cool. 

    Can you be more specific about what you did to resolve the problem?  Was this a software driver or hardware configuration change?

     

    Regards,

    Paul

     

    The driver need to be patched as Ajay said. 

     Then we must define a platform device to make the OHCI driver be loaded.  

    Last step: Only choose OHCI support and remove the EHCI initialization code in  board specific file( eg: board-omap3beagle.c)

  • peaves said:

    That's great news Simon Cool. 

    Can you be more specific about what you did to resolve the problem?  Was this a software driver or hardware configuration change?

     

    Regards,

    Paul

     

    The driver need to be patched as Ajay said. 

     Then we must define a platform device to make the OHCI driver be loaded.  

    Third step: Only choose OHCI support and remove the EHCI initialization code in  board specific file( eg: board-omap3beagle.c)

    Last step(just in my case): Set the transceiver to a certain mode by connecting the FS/LS pin to 5V statically

  • Hi! I'm encountered the same problem.

    I'm using DM-3730 SoC (TDM-3730 module from Technexion with our custom "motherboard") and linux v. 2.6.37. And in our board we are using Full-speed hub (TUSB 2046B) instead of GL850G (that used in Technexion's Blizzardboard). 

    Kernel is already patched as described in your posts, and only CONFIG_USB_OHCI_HCD=y (CONFIG_USB_EHCI_HCD=n and CONFIG_USB_MUSB_HDRC=n). 

    Then we had a problem with proper initialization in board-specific file:

    static struct ohci_hcd_omap_platform_data ohci_pdata __initconst = {
    .port_mode[0] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
    .port_mode[1] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
    .port_mode[2] = OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
    .es2_compatibility = true
    };

    This one does not work: kernel runs with no respond on USB flash insertion.

    Boot log (concerning USB):

    [ 1.583984] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [ 1.590423] ohci_hcd: block sizes: ed 64 td 64
    [ 1.597442] ohci-omap3 ohci-omap3.0: starting TI OHCI USB Controller
    [ 1.597747] ohci-omap3 ohci-omap3.0: TLL reset done
    [ 1.597747] ohci-omap3 ohci-omap3.0: OMAP3 ES version <= ES2.1
    [ 1.597778] ohci-omap3 ohci-omap3.0: UHH setup done, uhh_hostconfig=1d
    [ 1.597778] ohci-omap3 ohci-omap3.0: OMAP3 OHCI Host Controller
    [ 1.603973] drivers/usb/core/inode.c: creating file 'devices'
    [ 1.604003] drivers/usb/core/inode.c: creating file '001'
    [ 1.604034] ohci-omap3 ohci-omap3.0: new USB bus registered, assigned bus number 1
    [ 1.611938] ohci-omap3 ohci-omap3.0: starting OHCI controller
    [ 1.611999] ohci-omap3 ohci-omap3.0: created debug files
    [ 1.612030] ohci-omap3 ohci-omap3.0: irq 76, io mem 0x48064400
    [ 1.695343] ohci-omap3 ohci-omap3.0: OHCI controller state
    [ 1.695343] ohci-omap3 ohci-omap3.0: OHCI 1.0, NO legacy support registers
    [ 1.695373] ohci-omap3 ohci-omap3.0: control 0x283 RWC HCFS=operational CBSR=3
    [ 1.695373] ohci-omap3 ohci-omap3.0: cmdstatus 0x00000 SOC=0
    [ 1.695373] ohci-omap3 ohci-omap3.0: intrstatus 0x00000004 SF
    [ 1.695404] ohci-omap3 ohci-omap3.0: intrenable 0x8000005a MIE RHSC UE RD WDH
    [ 1.695404] ohci-omap3 ohci-omap3.0: hcca frame #0015
    [ 1.695434] ohci-omap3 ohci-omap3.0: roothub.a 0a000203 POTPGT=10 NPS NDP=3(3)
    [ 1.695434] ohci-omap3 ohci-omap3.0: roothub.b 00000000 PPCM=0000 DR=0000
    [ 1.695465] ohci-omap3 ohci-omap3.0: roothub.status 00008000 DRWE
    [ 1.695465] ohci-omap3 ohci-omap3.0: roothub.portstatus [0] 0x00000100 PPS
    [ 1.695465] ohci-omap3 ohci-omap3.0: roothub.portstatus [1] 0x00000100 PPS
    [ 1.695495] ohci-omap3 ohci-omap3.0: roothub.portstatus [2] 0x00000100 PPS
    [ 1.695678] usb usb1: default language 0x0409
    [ 1.695709] usb usb1: udev 1, busnum 1, minor = 0
    [ 1.695709] usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
    [ 1.702789] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [ 1.710327] usb usb1: Product: OMAP3 OHCI Host Controller
    [ 1.715972] usb usb1: Manufacturer: Linux 2.6.37 ohci_hcd
    [ 1.721588] usb usb1: SerialNumber: ohci-omap3.0
    [ 1.726867] usb usb1: usb_probe_device
    [ 1.726867] usb usb1: configuration #1 chosen from 1 choice
    [ 1.726898] usb usb1: adding 1-0:1.0 (config #1, interface 0)
    [ 1.727172] hub 1-0:1.0: usb_probe_interface
    [ 1.727172] hub 1-0:1.0: usb_probe_interface - got id
    [ 1.727203] hub 1-0:1.0: USB hub found
    [ 1.731170] hub 1-0:1.0: 3 ports detected
    [ 1.735351] hub 1-0:1.0: standalone hub
    [ 1.735351] hub 1-0:1.0: no power switching (usb 1.0)
    [ 1.735351] hub 1-0:1.0: global over-current protection
    [ 1.735382] hub 1-0:1.0: power on to power good time: 20ms
    [ 1.735382] hub 1-0:1.0: local power source is good
    [ 1.735382] hub 1-0:1.0: no over-current condition exists
    [ 1.735412] hub 1-0:1.0: trying to enable port power on non-switchable hub
    [ 1.735534] drivers/usb/core/inode.c: creating file '001'

    Power is always present on VBUS, so there is no need to switch it up. I have tried another configuration ( TLL_2PIN_DPDM ) with no effect. Looks like I'm doing something completely wrong, but I'm wonder what exactly... How should I configure linux system using TUSB2046B 4-port HUB connected to SMSC3320 and TWL4030 (TPS65930) ?

    Configuration provided by Technexion for their board with EHCI hub is:

    static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
    .port_mode[0] = OMAP_EHCI_PORT_MODE_UNKNOWN,
    .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
    .port_mode[2] = OMAP_EHCI_PORT_MODE_UNKNOWN,
    .phy_reset = true,
    .reset_gpio_port[0] = -EINVAL,
    .reset_gpio_port[1] = TAOTDM_EHCI_RESET,
    .reset_gpio_port[2] = -EINVAL,
    };