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.

Enabling USB on DM37x evm board

Hi,

I am working on DM37x evm board with linux 3.10.44 from kernel.org.

I would like to use usb port on the board.  I have connected a usb mouse to the board through powered usb hub.

But USB mouse is not getting detected. I have made the necessary changes in dts to add the phy device entry and also I have checked clock, regulator supply etc.

But still usb device is not detected.

Can you please help out in understanding what might be the cause for the usb device to not get detected

Thank you,

Suma

  • Hi Suma,

    Have you enabled USB HID DEV support in linux through "make menuconfig" ?

    make menuconfig ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-
    Device Drivers --->
    [*] HID Devices --->
  • Hi Titus,

    Thanks for your reply.
    Yes I have enabled HID support.

    I don't see ehci-usb interrupt in cat /proc/interrupts when usb device is connected to usb port.
    93: 0 INTC ehci_hcd:usb1

    But where as with linux 2.6.35 kernel image USB device is detected and interrupts are seen when device is connected.

    While debugging I checked for PORTSC_1 ehci register, to see if register at least shows the device connection. But that also doesn't show up the device connect status even if the device is connected.

    Looks I am missing some register settings.
    As I have working linux 2.6.35 code, I tried to compare the driver and ported changes which I felt are necessary. Still nothing worked out.
    Can you please tell me if there are any specific changes for linux 3.10.44?

    Thank you
  • Able to see any USB messages (enabling) while linux bootup.
    Compare the old and new linux bootup messages.
    Also try to compare the board file of old and new linux release.

    It is hard to find the exact issue here since it had big difference between your old and new kernel (migrating).
  • Ya I understand its hard to tell the exact issue.

    I have compared both the logs and have taken necessary changes from board file.
    The driver gets registered, probe gets called everything is fine except from the device detection.
    I am having doubt if USB3320 is the phy connected and also the regulators connected to that.
    Could you please share me the schematic of DM37xx rev g evm board. Because I am not getting it from the net.
    And also could you please tell me if 3.10.44's ehci-omap driver is working fine with other processors and board? Because I see that DTS migration is not complete.

    Thank you
  • Hi Suma,

    Have you validate the correctness of your DTS file like voltage, pinmux configuration and other definitions in the dts file . Dts file is highly sensitive one.

    Can you post your updated DTS file here ?
  • Hi Lyf Sci,

    Thanks very much for your response on my query.

    I am pasting here the changes I made to dts file ontop of mainline 3.10.44 kernel
    omap3-evm.dtb binary file is used to provide the DM37xx hardware information
    omap3-evm.dts file includes omap3.dtsi and twl4030.dtsi

    I have made changes in omap3-evm.dts and twl4030.dtsi for usb. Those are

    1. omap3-evm.dts
    ---------------------------------------------------------------------
    @@ -33,6 +33,10 @@
    linux,default-trigger = "default-on";
    };
    };
    + hsusb1_phy: hsusb1_phy {
    + compatible = "usb-nop-xceiv";
    + };
    +
    };

    &i2c1 {
    @@ -124,3 +128,11 @@
    mode = <3>;
    power = <50>;
    };
    +&usbhshost {
    + port2-mode = "ehci-phy";
    +};
    +
    +&usbhsehci {
    + phys = <0 &hsusb1_phy 0>;
    +};
    +
    ---------------------------------------------------------------



    2. Changes made in twl4030.dtsi
    -------------------------------------------------------------------
    @@ -19,6 +19,29 @@
    interrupts = <11>;
    };

    + vaux1: regulator-vaux1 {
    + compatible = "ti,twl4030-vaux1";
    + regulator-always-on;
    + };
    +
    + vaux2: regulator-vaux2 {
    + compatible = "ti,twl4030-vaux2";
    + regulator-min-microvolt = <1800000>;
    + regulator-max-microvolt = <1800000>;
    + regulator-always-on;
    + };
    +
    + vaux3: regulator-vaux3 {
    + compatible = "ti,twl4030-vaux3";
    + regulator-always-on;
    + };
    +
    + vaux4: regulator-vaux4 {
    + compatible = "ti,twl4030-vaux4";
    + regulator-always-on;
    + };
    +
    +
    watchdog {
    compatible = "ti,twl4030-wdt";
    };
    @@ -49,14 +72,17 @@

    vusb1v5: regulator-vusb1v5 {
    compatible = "ti,twl4030-vusb1v5";
    + regulator-always-on;
    };

    vusb1v8: regulator-vusb1v8 {
    compatible = "ti,twl4030-vusb1v8";
    + regulator-always-on;
    };

    vusb3v1: regulator-vusb3v1 {
    compatible = "ti,twl4030-vusb3v1";
    + regulator-always-on;
    };

    vsim: regulator-vsim {
    @@ -64,6 +90,12 @@
    regulator-min-microvolt = <1800000>;
    regulator-max-microvolt = <3000000>;
    };
    + vio: regulator-vio {
    + compatible = "ti,twl4030-vio";
    + regulator-min-microvolt = <1800000>;
    + regulator-max-microvolt = <1800000>;
    + regulator-always-on;
    + };

    twl_gpio: gpio {
    compatible = "ti,twl4030-gpio";
    ---------------------------------------------------------------------------------------


    I have taken care of pin multiplexing for hsusb2 pins by hardcoding the required values at the beginning of the driver probe in omap-usb-host.c (omap_mux_init was not working)

    voltage used for usb3320 usb phy tranceiver on dm37xx board is vaux2 and vio1.8. those are taken care in twl4030.dtsi file and enabling them in omap-usb-host.c probe function.

    clock used for usb host controller module are
    usbhost_120m_fck
    usbhost_48m_fck
    usbhost_ick
    I have enabled above clocks.

    USB32320 Phy is connected with gpio 21 and gpio 22 from processor.
    Gpio 21 is phy reset pin . Have added code to provide the reset to phy during probing. gpio21 goes low initially for 100us and then high.

    Bootlog related to usb are:

    ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    ehci-omap: OMAP-EHCI Host Controller driver
    ehci-omap 48064800.ehci: EHCI Host Controller
    ehci-omap 48064800.ehci: new USB bus registered, assigned bus number 1
    ehci-omap 48064800.ehci: irq 93, io mem 0x48064800
    ehci-omap 48064800.ehci: USB 2.0 started, EHCI 1.00
    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb1: Product: EHCI Host Controller
    usb usb1: Manufacturer: Linux 3.10.44 ehci_hcd
    usb usb1: SerialNumber: 48064800.ehci
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 3 ports detected
    successfully probed********************
    ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    ohci-omap3 48064400.ohci: OMAP3 OHCI Host Controller
    ohci-omap3 48064400.ohci: new USB bus registered, assigned bus number 2
    ohci-omap3 48064400.ohci: irq 92, io mem 0x48064400
    usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
    usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb2: Product: OMAP3 OHCI Host Controller
    usb usb2: Manufacturer: Linux 3.10.44 ohci_hcd
    usb usb2: SerialNumber: 48064400.ohci
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 3 ports detected
    usbcore: registered new interface driver cdc_acm
    cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    usbcore: registered new interface driver usb-storage
    .............
    .............

    Do you think I am missing any configuration?
  • Hi Suma,

    The dts file and boot up prints looks ok.
    Do you have any USB protocol anayzer to obtain the initial enumeration sequence or any other transactions ?

    Also you can check for the interrupts occured in the USB HCI while connecting the device.

    Kindly provide some more info on the above.
  • Hi Lyf Sci,

    First of all I would like to thank you for your effort in understanding my problem.

    I have not connected USB protocol analyser and checked for the transactions.
    As ehci-omap driver already exists there and I believe its working, I was suspecting platform data passing is the problem and was focusing mainly on that area.
    I was more doubting on regulator part, if that is enabled or not really. I will dump some of the twl4030 registers and compare the values between two versions of kernel.
    After I verify that , then I will check with USB protocol analyser and will update you more about that.

    Regarding ehci-omap interrupts, I don't see any ehci interrupts in /proc/interrupts. When the device is connected status is not even getting reflected in PORTSC_1 register of omap ehci USB host controller.

    If you think of any other platform data and phy configuration is needed please let me know. I will try them.


    Thank you.
  • Hi Suma,

    Is it fixed by now !!

    Regards,
    Lyf
  • Hi Lyf,

    Ya. It worked. I was missing one twl4030 gpio pin configuration which enables the bus switch controllers for usb lines.
    That change is present in board-omap3evm.c file. But since I am booting through DTB, that change was missed.

    I wanted to reply on this thread as soon as usb started working, but since we had our project release i couldn't reply.

    Thank you
  • Fine, Its glad that you solved.