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.

Linux/AM5726: USB2.0 Host mode fails on USB2

Part Number: AM5726
Other Parts Discussed in Thread: BEAGLEBOARD-X15, AM5728, DRA742, TPS51200, TPD12S015, TMP102, TLV320AIC3104

Tool/software: Linux

Hello,

We are working on AM5726 custom board, and kernel version is "linux-4.4.32".

And in that we are not able to detect any device on USB 2.

Even we are configuring the host mode drive VBUS pin is not going high.

Please find attached dts file for your reference.

============================ DTS =================================

/*
 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
/dts-v1/;
#include "dra74x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
/ {
        model = "TI AM5728 BeagleBoard-X15";
        compatible = "ti,am572x-beagle-x15", "ti,am5728", "ti,dra742", "ti,dra74", "ti,dra7";
        aliases {
                rtc1 = &tps659038_rtc;
                rtc2 = &rtc;
                display0 = &hdmi0;
                sound1 = &hdmi;
                spi2 = &mcspi2;
                spi1 = &mcspi1;
        };
        memory {
                device_type = "memory";
                reg = <0x0 0x80000000 0x0 0x80000000>;
        };
        reserved-memory {
                #address-cells = <2>;
                #size-cells = <2>;
                ranges;
                ipu2_cma_pool: ipu2_cma@95800000 {
                        compatible = "shared-dma-pool";
                        reg = <0x0 0x95800000 0x0 0x3800000>;
                        reusable;
                        status = "okay";
                };
                dsp1_cma_pool: dsp1_cma@99000000 {
                        compatible = "shared-dma-pool";
                        reg = <0x0 0x99000000 0x0 0x4000000>;
                        reusable;
                        status = "okay";
                };
                ipu1_cma_pool: ipu1_cma@9d000000 {
                        compatible = "shared-dma-pool";
                        reg = <0x0 0x9d000000 0x0 0x2000000>;
                        reusable;
                        status = "okay";
                };
                dsp2_cma_pool: dsp2_cma@9f000000 {
                        compatible = "shared-dma-pool";
                        reg = <0x0 0x9f000000 0x0 0x800000>;
                        reusable;
                        status = "okay";
                };
        };
        vdd_3v3: fixedregulator-vdd_3v3 {
                compatible = "regulator-fixed";
                regulator-name = "vdd_3v3";
                vin-supply = <&regen1>;
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
        };
        aic_dvdd: fixedregulator-aic_dvdd {
                compatible = "regulator-fixed";
                regulator-name = "aic_dvdd_fixed";
                vin-supply = <&vdd_3v3>;
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
        };
        vtt_fixed: fixedregulator-vtt {
                /* TPS51200 */
                compatible = "regulator-fixed";
                regulator-name = "vtt_fixed";
                vin-supply = <&smps3_reg>;
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
                regulator-always-on;
                regulator-boot-on;
                enable-active-high;
                gpio = <&gpio7 11 GPIO_ACTIVE_HIGH>;
        };
        hdmi0: connector {
                compatible = "hdmi-connector";
                label = "hdmi";
                type = "a";
                port {
                        hdmi_connector_in: endpoint {
                                remote-endpoint = <&tpd12s015_out>;
                        };
                };
        };
        tpd12s015: encoder {
                compatible = "ti,tpd12s015";
        /*      gpios = <&gpio7 10 GPIO_ACTIVE_HIGH>,*/ /* gpio7_10, CT CP HPD */
        /*              <&gpio6 28 GPIO_ACTIVE_HIGH>, */        /* gpio6_28, LS OE */
        /*              <&gpio7 12 GPIO_ACTIVE_HIGH>; */        /* gpio7_12/sp1_cs2, HPD */
                ports {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        port@0 {
                                reg = <0>;
                                tpd12s015_in: endpoint {
                                        remote-endpoint = <&hdmi_out>;
                                };
                        };
                        port@1 {
                                reg = <1>;
                                tpd12s015_out: endpoint {
                                         remote-endpoint = <&hdmi_connector_in>;
                                };
                        };
                };
        };
};
&i2c1 {
        status = "okay";
        clock-frequency = <400000>;
        tps659038: tps659038@58 {
                compatible = "ti,tps659038";
                reg = <0x58>;
                interrupt-parent = <&gpio1>;
                interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
                #interrupt-cells = <2>;
                interrupt-controller;
                ti,system-power-controller;
                ti,palmas-override-powerhold;
                tps659038_pmic {
                        compatible = "ti,tps659038-pmic";
                        regulators {
                                smps12_reg: smps12 {
                                        /* VDD_MPU */
                                        regulator-name = "smps12";
                                        regulator-min-microvolt = < 850000>;
                                        regulator-max-microvolt = <1250000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                smps3_reg: smps3 {
                                        /* VDD_DDR */
                                        regulator-name = "smps3";
                                        regulator-min-microvolt = <1350000>;
                                        regulator-max-microvolt = <1350000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                smps45_reg: smps45 {
                                        /* VDD_DSPEVE, VDD_IVA, VDD_GPU */
                                        regulator-name = "smps45";
                                        regulator-min-microvolt = < 850000>;
                                        regulator-max-microvolt = <1250000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                smps6_reg: smps6 {
                                        /* VDD_CORE */
                                        regulator-name = "smps6";
                                        regulator-min-microvolt = <850000>;
                                        regulator-max-microvolt = <1150000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                /* SMPS7 unused */
                                smps8_reg: smps8 {
                                        /* VDD_1V8 */
                                        regulator-name = "smps8";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                /* SMPS9 unused */
                                ldo1_reg: ldo1 {
                                        /* VDD_SD / VDDSHV8  */
                                        regulator-name = "ldo1";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <3300000>;
                                        regulator-boot-on;
                                        regulator-always-on;
                                };
                                ldo2_reg: ldo2 {
                                        /* VDD_SHV5 */
                                        regulator-name = "ldo2";
                                        regulator-min-microvolt = <3300000>;
                                        regulator-max-microvolt = <3300000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                ldo3_reg: ldo3 {
                                        /* VDDA_1V8_PHYA */
                                        regulator-name = "ldo3";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                ldo4_reg: ldo4 {
                                        /* VDDA_1V8_PHYB */
                                        regulator-name = "ldo4";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                ldo9_reg: ldo9 {
                                        /* VDD_RTC */
                                        regulator-name = "ldo9";
                                        regulator-min-microvolt = <1050000>;
                                        regulator-max-microvolt = <1050000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                ldoln_reg: ldoln {
                                        /* VDDA_1V8_PLL */
                                        regulator-name = "ldoln";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                ldousb_reg: ldousb {
                                        /* VDDA_3V_USB: VDDA_USBHS33 */
                                        regulator-name = "ldousb";
                                        regulator-min-microvolt = <3300000>;
                                        regulator-max-microvolt = <3300000>;
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                                regen1: regen1 {
                                        /* VDD_3V3_ON */
                                        regulator-name = "regen1";
                                        regulator-boot-on;
                                        regulator-always-on;
                                };
                        };
                };
                tps659038_rtc: tps659038_rtc {
                        compatible = "ti,palmas-rtc";
                        interrupt-parent = <&tps659038>;
                        interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
                        wakeup-source;
                };
                tps659038_pwr_button: tps659038_pwr_button {
                        compatible = "ti,palmas-pwrbutton";
                        interrupt-parent = <&tps659038>;
                        interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
                        wakeup-source;
                        ti,palmas-long-press-seconds = <12>;
                };
                tps659038_gpio: tps659038_gpio {
                        compatible = "ti,palmas-gpio";
                        gpio-controller;
                        #gpio-cells = <2>;
                };
                extcon_usb2: tps659038_usb {
                        compatible = "ti,palmas-usb-vid";
                        ti,enable-vbus-detection;
                        vbus-gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
                };
        };
        tmp102: tmp102@48 {
                compatible = "ti,tmp102";
                reg = <0x48>;
                interrupt-parent = <&gpio7>;
                interrupts = <16 IRQ_TYPE_LEVEL_LOW>;
                #thermal-sensor-cells = <1>;
        };
/*
        tlv320aic3104: tlv320aic3104@18 {
                #sound-dai-cells = <0>;
                compatible = "ti,tlv320aic3104";
                reg = <0x18>;
                assigned-clocks = <&clkoutmux2_clk_mux>;
                assigned-clock-parents = <&sys_clk2_dclk_div>;
                adc-settle-ms = <40>;
                AVDD-supply = <&vdd_3v3>;
                IOVDD-supply = <&vdd_3v3>;
                DRVDD-supply = <&vdd_3v3>;
                DVDD-supply = <&aic_dvdd>;
                status = "okay";
        };
*/
};
&dra7_pmx_core {
        mmc1_pins_default: mmc1_pins_default {
                pinctrl-single,pins = <
                        DRA7XX_CORE_IOPAD(0x3754, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc1_clk.clk */
                        DRA7XX_CORE_IOPAD(0x3758, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc1_cmd.cmd */
                        DRA7XX_CORE_IOPAD(0x375c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc1_dat0.dat0 */
                        DRA7XX_CORE_IOPAD(0x3760, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc1_dat1.dat1 */
                        DRA7XX_CORE_IOPAD(0x3764, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc1_dat2.dat2 */
                        DRA7XX_CORE_IOPAD(0x3768, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc1_dat3.dat3 */
                >;
        };
        mmc2_pins_default: mmc2_pins_default {
                pinctrl-single,pins = <
                        DRA7XX_CORE_IOPAD(0x349c, (PIN_INPUT_PULLUP | MUX_MODE1)) /* gpmc_a23.mmc2_clk */
                        DRA7XX_CORE_IOPAD(0x34b0, (PIN_INPUT_PULLUP | MUX_MODE1)) /* gpmc_cs1.mmc2_cmd */
                        DRA7XX_CORE_IOPAD(0x34a0, (PIN_INPUT_PULLUP | MUX_MODE1)) /* gpmc_a24.mmc2_dat0 */
                        DRA7XX_CORE_IOPAD(0x34a4, (PIN_INPUT_PULLUP | MUX_MODE1)) /* gpmc_a25.mmc2_dat1 */
                        DRA7XX_CORE_IOPAD(0x34a8, (PIN_INPUT_PULLUP | MUX_MODE1)) /* gpmc_a26.mmc2_dat2 */
                        DRA7XX_CORE_IOPAD(0x34ac, (PIN_INPUT_PULLUP | MUX_MODE1)) /* gpmc_a27.mmc2_dat3 */
                        DRA7XX_CORE_IOPAD(0x348c, (PIN_INPUT_PULLUP | MUX_MODE1)) /* gpmc_a19.mmc2_dat4 */
                        DRA7XX_CORE_IOPAD(0x3490, (PIN_INPUT_PULLUP | MUX_MODE1)) /* gpmc_a20.mmc2_dat5 */
                        DRA7XX_CORE_IOPAD(0x3494, (PIN_INPUT_PULLUP | MUX_MODE1)) /* gpmc_a21.mmc2_dat6 */
                        DRA7XX_CORE_IOPAD(0x3498, (PIN_INPUT_PULLUP | MUX_MODE1)) /* gpmc_a22.mmc2_dat7 */
                >;
        };
};
&mmc1 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins_default>;
};
&mmc2 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc2_pins_default>;
};
&vip1 {
status = "okay";
};
&i2c2 {
    status = "okay";
        clock-frequency = <400000>;
    tlc59208@48 {
                compatible = "ti,tlc59208";
                reg = <0x48>;
        };
};
&i2c3 {
        status = "okay";
        clock-frequency = <400000>;
                mt9t11x@3C {
                compatible = "aptina,mt9t111";
                reg = <0x3C>;
                /* reset-gpios = <&gpio7 4 GPIO_ACTIVE_LOW>; */
                /* oscen-gpios = <&gpio7 6 GPIO_ACTIVE_HIGH>; */
                /* powerdown-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; */
                /* bufen-gpios = <&gpio1 31 GPIO_ACTIVE_LOW>; */
                port {
                        cam: endpoint {
                                remote-endpoint = <&vin1a>;
                                hsync-active = <1>;
                                vsync-active = <1>;
                                pclk-sample = <0>;
                                input-clock-freq = <32000000>;
                                pixel-clock-freq = <96000000>;
                        };
                };
        };
        ov798cam@4C {
                compatible = "aptina,ov798cam";
                reg = <0x4C>;
                port {
                        cam2: endpoint {
                                remote-endpoint = <&vin2a>;
                                hsync-active = <1>;
                                vsync-active = <1>;
                                pclk-sample = <0>;
                                input-clock-freq = <32000000>;
                                pixel-clock-freq = <96000000>;
                        };
                };
        };
};
&vin1a {
        status = "okay";
        endpoint {
                slave-mode;
                remote-endpoint = <&cam>;
        };
};
&vin2a {
        status = "okay";
        endpoint {
                slave-mode;
                remote-endpoint = <&cam2>;
        };
};
&mcspi1{
        pinctrl-names = "default";
        pinctrl-0 =  <&spi1_pins_default>;
        spi-max-frequency = <1000000>;
        status = "okay";
        camov798_cfg{
                compatible = "ti,omap4-mcspi_ovcam";
                status = "okay";
                spi-max-frequency = <1000000>;
                reg = <0x48098000 0x200>;
                port {
                        cam3: endpoint {
                              remote-endpoint = <&vin2a>;
                              hsync-active = <1>;
                              vsync-active = <1>;
                              pclk-sample = <0>;
                              input-clock-freq = <32000000>;
                              pixel-clock-freq = <96000000>;
                              status = "okay";
                      };
                };
        };
};
&mcspi2{
        pinctrl-names = "default";
        pinctrl-0 =  <&spi2_pins_default>;
        spi-max-frequency = <1000000>;
        status = "okay";
        ov798_cfg{
                compatible = "ti,omap4-mcspi_ov";
                status = "okay";
                spi-max-frequency = <1000000>;
                reg = <0x4809a000 0x200>;
                port {
                        cam1: endpoint {
                              remote-endpoint = <&vin1a>;
                              hsync-active = <1>;
                              vsync-active = <1>;
                              pclk-sample = <0>;
                              input-clock-freq = <32000000>;
                              pixel-clock-freq = <96000000>;
                              status = "okay";
                      };
                };
        };
};
&gpio7 {
        ti,no-reset-on-init;
        ti,no-idle-on-init;
};
&uart3 {
        status = "okay";
        interrupts-extended = <&crossbar_mpu GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
                              <&dra7_pmx_core 0x3f8>;
};
/*Interrupt Number 218, 219,220 and 221 are found from Interrupt control routines in TRM, page 3929 */
&uart7 {
        status = "okay";
        interrupts-extended = <&crossbar_mpu GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH>,
                              <&dra7_pmx_core 0x324>;
};
&uart8 {
        status = "okay";
        interrupts-extended = <&crossbar_mpu GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
                              <&dra7_pmx_core 0x334>;
};
&uart9 {
        status = "okay";
        interrupts-extended = <&crossbar_mpu GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>,
                              <&dra7_pmx_core 0x344>;
};
&uart10 {
        status = "okay";
        interrupts-extended = <&crossbar_mpu GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>,
                              <&dra7_pmx_core 0x394>;
};
&mac {
        status = "okay";
        dual_emac;
};
&cpsw_emac0 {
        phy_id = <&davinci_mdio>, <3>;
        phy-mode = "rgmii";
        dual_emac_res_vlan = <1>;
};
&mmc1 {
        status = "okay";
        vmmc-supply = <&ldo1_reg>;
        bus-width = <4>;
        cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; /* gpio 219 */
};
&mmc2 {
        status = "okay";
        vmmc-supply = <&vdd_3v3>;
        bus-width = <8>;
        ti,non-removable;
        cap-mmc-dual-data-rate;
};
&sata {
        status = "okay";
};
&usb2_phy1 {
        phy-supply = <&ldousb_reg>;
};
&usb2_phy2 {
        phy-supply = <&ldousb_reg>;
};
&usb1 {
    status = "okay";
        dr_mode = "host";
};
&omap_dwc3_2 {
        extcon = <&extcon_usb2>;
};
&usb2 {
        /*
         * Stand alone usage is peripheral only.
         * However, with some resistor modifications
         * this port can be used via expansion connectors
         * as "host" or "dual-role". If so, provide
         * the necessary dr_mode override in the expansion
         * board's DT.
         * dr_mode = "peripheral";
         */
    status = "okay";
        dr_mode = "host";
};
&cpu_trips {
        cpu_alert1: cpu_alert1 {
                temperature = <50000>; /* millicelsius */
                hysteresis = <2000>; /* millicelsius */
                type = "active";
        };
};
&thermal_zones {
        board_thermal: board_thermal {
                polling-delay-passive = <1250>; /* milliseconds */
                polling-delay = <1500>; /* milliseconds */
                                /* sensor       ID */
                thermal-sensors = <&tmp102     0>;
                board_trips: trips {
                        board_alert0: board_alert {
                                temperature = <40000>; /* millicelsius */
                                hysteresis = <2000>; /* millicelsius */
                                type = "active";
                        };
                        board_crit: board_crit {
                                temperature = <105000>; /* millicelsius */
                                hysteresis = <0>; /* millicelsius */
                                type = "critical";
                        };
                };
       };
};
&oppdm_mpu {
        vdd-supply = <&smps12_reg>;
};
&oppdm_dspeve {
        vdd-supply = <&smps45_reg>;
};
&oppdm_gpu {
        vdd-supply = <&smps45_reg>;
};
&oppdm_ivahd {
        vdd-supply = <&smps45_reg>;
};
&oppdm_core {
        vdd-supply = <&smps6_reg>;
};
&dss {
        status = "ok";
        vdda_video-supply = <&ldoln_reg>;
};
&bb2d {
        status = "okay";
};
&hdmi {
        status = "ok";
        vdda-supply = <&ldo4_reg>;
        port {
                hdmi_out: endpoint {
                        remote-endpoint = <&tpd12s015_in>;
                };
        };
};
&mcasp3 {
        #sound-dai-cells = <0>;
        assigned-clocks = <&mcasp3_ahclkx_mux>;
        assigned-clock-parents = <&sys_clkin2>;
        status = "okay";
        op-mode = <0>;  /* MCASP_IIS_MODE */
        tdm-slots = <2>;
        /* 4 serializers */
        serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
                1 2 0 0
        >;
        tx-num-evt = <32>;
        rx-num-evt = <32>;
};
&mailbox3 {
        status = "okay";
        mbox_pru1_0: mbox_pru1_0 {
                status = "okay";
        };
        mbox_pru1_1: mbox_pru1_1 {
                status = "okay";
        };
};
&mailbox4 {
        status = "okay";
        mbox_pru2_0: mbox_pru2_0 {
                status = "okay";
        };
        mbox_pru2_1: mbox_pru2_1 {
                status = "okay";
        };
};
&mailbox5 {
        status = "okay";
        mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
                status = "okay";
        };
        mbox_dsp1_ipc3x: mbox_dsp1_ipc3x {
                status = "okay";
        };
};
&mailbox6 {
        status = "okay";
        mbox_ipu2_ipc3x: mbox_ipu2_ipc3x {
                status = "okay";
        };
        mbox_dsp2_ipc3x: mbox_dsp2_ipc3x {
                status = "okay";
        };
};
&mmu0_dsp1 {
        status = "okay";
};
&mmu1_dsp1 {
        status = "okay";
};
&mmu0_dsp2 {
        status = "okay";
};
&mmu1_dsp2 {
        status = "okay";
};
&mmu_ipu1 {
        status = "okay";
};
&mmu_ipu2 {
        status = "okay";
};
&ipu2 {
        status = "okay";
        memory-region = <&ipu2_cma_pool>;
        mboxes = <&mailbox6 &mbox_ipu2_ipc3x>;
        timers = <&timer3>;
        watchdog-timers = <&timer4>, <&timer9>;
};
&ipu1 {
        status = "okay";
        memory-region = <&ipu1_cma_pool>;
        mboxes = <&mailbox5 &mbox_ipu1_ipc3x>;
        timers = <&timer11>;
};
&dsp1 {
        status = "okay";
        memory-region = <&dsp1_cma_pool>;
        mboxes = <&mailbox5 &mbox_dsp1_ipc3x>;
        timers = <&timer5>;
};
&dsp2 {
        status = "okay";
        memory-region = <&dsp2_cma_pool>;
        mboxes = <&mailbox6 &mbox_dsp2_ipc3x>;
        timers = <&timer6>;
};
&pruss1 {
        status = "okay";
        pru1_0: pru0@4b234000 {
                interrupt-parent = <&pruss1_intc>;
                interrupts = <16>, <17>;
                interrupt-names = "vring", "kick";
                status = "okay";
        };
        pru1_1: pru1@4b238000 {
                interrupt-parent = <&pruss1_intc>;
                interrupts = <18>, <19>;
                interrupt-names = "vring", "kick";
                status = "okay";
        };
};
&pruss2 {
        status = "okay";
        pru2_0: pru0@4b2b4000 {
                interrupt-parent = <&pruss2_intc>;
                interrupts = <16>, <17>;
                interrupt-names = "vring", "kick";
                status = "okay";
        };
        pru2_1: pru1@4b2b8000 {
                interrupt-parent = <&pruss2_intc>;
                interrupts = <18>, <19>;
                interrupt-names = "vring", "kick";
                status = "okay";
        };
};

Regards,

Ronak

  • Part Number: AM5726

    Tool/software: Linux

    Hello,

    We are working on AM5726 custom board, and kernel version is "linux-4.4.32".

    And in that we are not able to detect any device on USB 2.

    Even we are configuring the host mode drive VBUS pin is not going high.

    Please find attached dts file for your reference.

    /cfs-file/__key/communityserver-discussions-components-files/791/5148.am57xx_2D00_beagle_2D00_x15_2D00_common.txt

    Regards,

    Ronak

  • Ronak,

    Please attach the full kernel boot log, and provide the USB2 schematic.

    Please also run the script attached below on your board and provide its output.

    #!/bin/bash
    #
    # Util to check USB subsystem for Linux kernel 3.12+ on TI Sitara devices
    #
    # Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
    #
    #
    #  Redistribution and use in source and binary forms, with or without
    #  modification, are permitted provided that the following conditions
    #  are met:
    #
    #    Redistributions of source code must retain the above copyright
    #    notice, this list of conditions and the following disclaimer.
    #
    #    Redistributions in binary form must reproduce the above copyright
    #    notice, this list of conditions and the following disclaimer in the
    #    documentation and/or other materials provided with the
    #    distribution.
    #
    #    Neither the name of Texas Instruments Incorporated nor the names of
    #    its contributors may be used to endorse or promote products derived
    #    from this software without specific prior written permission.
    #
    #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    #  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    #  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    #  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    #  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    #  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    #  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
    VERSION=0.2.7
    
    
    ### functions ###
    
    # $1 command to be checked
    check_command() {
        local _cmd=$1
    
        which $_cmd > /dev/null || {
            echo "Error: $_cmd command not found"
            exit 1
        }
    }
    
    # check if the kernel is supported
    # this tool only runs on v3.12+ kernel
    # return 0 - if kernel version >= 3.12
    #        1 - if kernel version < 3.12
    has_supported_kernel() {
    	local _ver
    	local _t
    
        check_command uname
        uname -a
    	_ver=`uname -r`
        _t=${_ver%%.*}
        # 2.x.x, unsupported
        [ $_t -ge 3 ] || return 1
        # 4.x.x, supported
        [ $_t -lt 4 ] || return 0
    
        _ver=${_ver#*.}
        _t=${_ver%%.*}
        # < 3.12.x, unsupported
        [ $_t -ge 12 ] || return 1
        return 0
    }
    
    # check if the platform is supported
    #    $PLATFORM - global variable
    # return 0 - if platform is supported
    #        1 - if platform is not supported
    check_platform () {
    	local _hw
    
        check_command grep
        [ "$PLATFORM" != "" ] || {
    	    _hw=`grep '^Hardware' /proc/cpuinfo`
    	    DBG_PRINT $_hw
    
            if [ "${_hw#*AM33XX}" != "$_hw" ]; then
                PLATFORM="am335x"
            elif [ "${_hw#*AM43}" != "$_hw" ]; then
                PLATFORM="am437x"
            elif [ "${_hw#*DRA7}" != "$_hw" ]; then
                PLATFORM="am57x"
            elif [ "${_hw#*Keystone}" != "$_hw" ]; then
                PLATFORM="keystone"
            elif [ "${_hw#*AM18x}" != "$_hw" ]; then
                PLATFORM="omapl1"
            else
                PLATFORM=$_hw
            fi
        }
    
        DBG_PRINT $PLATFORM
        case $PLATFORM in
            "am335x")
                USB0='/ocp/usb@47400000/usb@47401000'
                USB1='/ocp/usb@47400000/usb@47401800'
                return 0;;
            "am437x")
                USB0='/ocp/omap_dwc3@48380000/usb@48390000'
                USB1='/ocp/omap_dwc3@483c0000/usb@483d0000'
                return 0;;
            "am57x")
                USB0='/ocp/omap_dwc3_1@48880000/usb@48890000'
                USB1='/ocp/omap_dwc3_2@488c0000/usb@488d0000'
                return 0;;
            "keystone")
                USB0='/ocp/omap_dwc3_1@48880000/usb@48890000'
                USB1='/ocp/omap_dwc3_2@488c0000/usb@488d0000'
                return 0;;
            "omapl1")
                USB0='/soc@1c00000/usb@200000'
                USB1=''
                return 0;;
            *)
                echo "Unsupported $PLATFORM"
                return 1;;
        esac
    }
    
    # check a kernel CONFIG option
    # params $1 - the config option
    #        $2 = '-q', quiet output
    # return 0 - undefined
    #        1 - defined as 'm', kernel module
    #        2 - defined as 'y', kernel builtin
    check_kernel_config() {
        local _cfg
    
        [ -n "$1" ] || return 0
        check_command zcat
        _cfg=`zcat /proc/config.gz | grep "^$1\>"`
    
        case ${_cfg#*=} in
            "y") return 2;;
            "m") return 1;;
              *) [ "$2" = "-q" ] ||
                  echo "Error: $1 is undefined in kernel config"
              return 0;;
        esac
    }
    
    # check a kernel module
    # $1 - module name, relative path from drivers/, with .ko surfix
    # return 0 - found
    #        1 - error
    check_module() {
        local _modname
        local _moddep
    
        [ -n "$1" ] || return 1
    
        _modname="/lib/modules/`uname -r`/kernel/drivers/${1}.ko"
        _moddep="/lib/modules/`uname -r`/modules.dep"
    
        DBG_PRINT 1
        [ -f $_modname ] || {
            echo "Error: $_modname not found."
            echo "       Please ensure 'make module_install' is done properly."
            return 1
        }
    
        DBG_PRINT 2
        [ -f $_moddep ] || $moddep_checked || {
            echo "Error: $_moddep not found."
            echo "       Please ensure 'make module_install' is done properly."
            moddep_checked=true
        }
    
        DBG_PRINT 3
        check_command lsmod
        check_command basename
        check_command tr
    
        lsmod | grep `basename $1 | tr '-' '_'` > /dev/null || {
            DBG_PRINT ">>>> ${1}.ko:"
            if grep "${1}.ko:" $_moddep > /dev/null; then
                DBG_PRINT 5
                echo "Error: $_moddep seems to be valid,"
                echo "       but `basename $1`.ko is not loaded."
                echo "       Please provide /proc/config.gz and /lib/module/`uname -r`/*"
                echo "       for further investigation."
            else
                DBG_PRINT 6
                echo "Error: `basename $1`: $_moddep is invalid."
                echo "       Please run command 'depmod' on the target to re-generate it,"
                echo "       then reboot the target. If the issue still exists, please"
                echo "       ensure 'make module_install' is done properly."
            fi
    
            DBG_PRINT 7
            return 1
        }
        DBG_PRINT 8
        return 0
    }
    
    # check kernel config, and modules (if CONFIG_*=M) for musb
    check_musb_drivers() {
        check_kernel_config CONFIG_USB_MUSB_HDRC
        [ $? != 1 ] || check_module 'usb/musb/musb_hdrc'
    
        check_kernel_config CONFIG_USB_MUSB_DUAL_ROLE -q
        [ $? != 0 ] || echo "Warning: CONFIG_USB_MUSB_DUAL_ROLE undefined."
    
        case $PLATFORM in
            am335x)
                check_kernel_config CONFIG_USB_MUSB_DSPS
                [ $? != 1 ] || {
                    check_module 'usb/musb/musb_dsps'
                    check_module 'usb/musb/musb_am335x'
                }
                ;;
            omapl1)
                check_kernel_config CONFIG_USB_MUSB_DA8XX
                [ $? != 1 ] || check_module 'usb/musb/da8xx'
                ;;
        esac
    
        case $PLATFORM in
            am335x)
                check_kernel_config CONFIG_AM335X_PHY_USB
                [ $? != 1 ] || {
                    check_module 'usb/phy/phy-am335x'
                    check_module 'usb/phy/phy-am335x-control'
                }
                ;;
            omapl1)
                check_kernel_config CONFIG_NOP_USB_XCEIV
                [ $? != 1 ] || check_module 'usb/phy/phy-generic'
                ;;
        esac
    
        check_kernel_config CONFIG_MUSB_PIO_ONLY -q
        [ $? != 0 ] || {
           if check_kernel_config CONFIG_TI_CPPI41 -q; then
               echo "Error: MUSB CPPI DMA mode is enabled, but CPPI moudle is not enabled in DMA Engine."
               echo "       Please enable CONFIG_TI_CPPI41 under DMA Engine Support in kernel config."
           fi
        }
    }
    
    # check kernel config, and modules (if CONFIG_*=M) for dwc3
    check_dwc3_drivers() {
        check_kernel_config CONFIG_USB_DWC3
        [ $? != 1 ] || check_module 'usb/dwc3/dwc3'
    
        check_kernel_config CONFIG_USB_DWC3_DUAL_ROLE -q
        [ $? != 0 ] || echo "Warning: CONFIG_USB_DWC3_DUAL_ROLE undefined."
    
        check_kernel_config CONFIG_USB_OTG -q
        [ $? != 0 ] || echo "Warning: CONFIG_USB_OTG undefined, which is required for DRD mode."
    
        check_kernel_config CONFIG_USB_DWC3_OMAP
        [ $? != 1 ] || check_module 'usb/dwc3/dwc3-omap'
    
        check_kernel_config CONFIG_USB_XHCI_HCD
        [ $? != 1 ] || {
            check_module 'usb/host/xhci-plat-hcd'
            check_module 'usb/host/xhci-hcd'
        }
    
        check_kernel_config CONFIG_OMAP_CONTROL_PHY
        [ $? != 1 ] || check_module 'phy/phy-omap-control'
    
        if [ $PLATFORM = am437x ]; then
            check_kernel_config CONFIG_OMAP_USB2
            [ $? != 1 ] || check_module 'phy/phy-omap-usb2'
        else
            check_kernel_config CONFIG_TI_PIPE3
            [ $? != 1 ] || check_module 'phy/phy-ti-pipe3'
        fi
    }
    
    check_musb_dt() {
        local _dt_dir
        local _ent
        local _sts
    
        case $PLATFORM in
        am335x)
            _dt_dir='/proc/device-tree/ocp/usb@47400000'
            _ent='. control@44e10620 usb-phy@47401300 usb-phy@47401b00 dma-controller@47402000'
            ;;
        omapl1)
            _dt_dir='/proc/device-tree/soc@1c00000'
            _ent='usb@200000 chip-controller@1417c/usb-phy usb@200000/dma-controller@201000'
            ;;
        *)
            return ;;
        esac
    
        for _t in $_ent; do
            _sts=$(cat ${_dt_dir}/${_t}/status)
            [ "$_sts" != "disabled" ] ||
                echo $_t: $(cat ${_dt_dir}/${_t}/status)
        done
    }
    
    ### debug ###
    
    g_log_file=/tmp/chkusb.log
    
    DBG_ENABLE() { g_dbg_enabled=true; }
    DBG_DISABLE() { g_dbg_enabled=false; }
    DBG_LOG_RESET() { ! $g_dbg_enabled || echo > $g_log_file; }
    DBG_PRINT() { ! $g_dbg_enabled || echo "$(date +%H:%M:%S) [$(basename $0)]: $*"; }
    DBG_LOG() { DBG_PRINT $* >> $g_log_file; }
    DBG_LOG_MARK() { DBG_PRINT "----------------" >> $g_log_file; }
    
    
    ### main ####
    
    moddep_checked=false
    
    echo "chkusb.sh Version $VERSION"
    
    [ "$V" = "1" ] && DBG_ENABLE && DBG_LOG_RESET || DBG_DISABLE
    
    has_supported_kernel ||
        { echo "Unsupported kernel version: `uname -r`"; exit 1; }
    check_platform || exit 2
    DBG_PRINT device: $PLATFORM
    
    check_command lsusb
    if lsusb > /dev/null 2>&1; then
        echo "USB is initialized"
    else
        echo "USB initialization failed"
    fi
    
    # check kernel configs
    
    if [ -f /proc/config.gz ]; then
        case $PLATFORM in
            am335x | omapl1) check_musb_drivers;;
            am437x | am57x | keystone) check_dwc3_drivers;;
            *)
                echo "Error: unsupported platform $PLATFORM"
                exit 5;;
        esac
    else
        echo "Error: /proc/config.gz not found"
    fi
    
    case $PLATFORM in
        am335x | omapl1)
            _debugfs=`sed -ne 's/^debugfs \(.*\) debugfs.*/\1/p' /proc/mounts`
            [ -z "$_debugfs" ] ||
                grep -i 'power\|devctl\|testmode' ${_debugfs}/musb-hdrc*/regdump
            ;;
    esac
    
    # check dr_mode & gadget drivers
    
    [ -d /proc/device-tree ] || {
        echo "Warning: /proc/device-tree/ not found"
        if [ -d "/lib/modules/`uname -r`/" ]; then
            echo "The list of USB gadget drivers installed:"
            ls -1Rp "/lib/modules/`uname -r`/kernel/drivers/usb/gadget/"
        fi
        exit 0
    }
    
    check_command basename
    for _usb in "${USB0}" "${USB1}"; do
        [ -n "$_usb" ] || continue
    
        _usb_dir="/proc/device-tree/${_usb}"
        _status=`cat $_usb_dir/status 2> /dev/null`
        _dr_mode=`cat $_usb_dir/dr_mode`
        echo `basename $_usb`: $_dr_mode, $_status
    
        [ "$_status" = "disabled" -o "$_dr_mode" = "host" ] || gadget_mode=true
    done
    
    case $PLATFORM in
        am335x | omapl1) check_musb_dt;;
        *) ;;
    esac
    
    DBG_PRINT $gadget_mode
    $gadget_mode || exit 0
    
    echo
    
    check_kernel_config CONFIG_USB_LIBCOMPOSITE
    case $? in
        0) echo "Error: no any gadget driver enabled"
           exit 6;;
        1) is_gadget_builtin=false;;
        2) echo "The gadget driver is built-in"
           is_gadget_builtin=true;;
    esac
    
    check_kernel_config CONFIG_USB_ZERO -q ||
        echo "Gadget Kernel Config: g_zero is enabled"
    check_kernel_config CONFIG_USB_AUDIO -q ||
        echo "Gadget Kernel Config: g_audio is enabled"
    check_kernel_config CONFIG_USB_ETH -q ||
        echo "Gadget Kernel Config: g_ether is enabled"
    check_kernel_config CONFIG_USB_G_NCM -q ||
        echo "Gadget Kernel Config: g_ncm is enabled"
    check_kernel_config CONFIG_USB_MASS_STORAGE -q ||
        echo "Gadget Kernel Config: g_mass_storage is enabled"
    check_kernel_config CONFIG_USB_G_SERIAL -q ||
        echo "Gadget Kernel Config: g_serial is enabled"
    check_kernel_config CONFIG_USB_G_PRINTER -q ||
        echo "Gadget Kernel Config: g_printer is enabled"
    
    g_driver=`grep '^DRIVER=' /sys/class/udc/*/uevent 2>/dev/null`
    echo "gadget driver loaded: ${g_driver:-(none)}"
    
    echo
    
    if ! $is_gadget_builtin; then
        if [ -d "/lib/modules/`uname -r`/" ]; then
            echo "The list of USB gadget drivers installed:"
            ls -1Rp "/lib/modules/`uname -r`/kernel/drivers/usb/gadget/"
        else
            echo "Error: /lib/modules/`uname -r`/ not found"
            echo "       Please ensure 'make modules_install' is done properly."
            exit 7
        fi
    fi
    
    # vim: ft=sh:ts=4:sw=4:et
    

  • Hello Bin,

    Thanks for your quick response.

    Please find attached Kernel logs and schematics.

    Below is the output of the script which you provided.

    ==============OUTPUT===================

    root@am57xx-evm:~# sh test.sh
    chkusb.sh Version 0.2.7
    Linux am57xx-evm 4.4.32-gadde2ca9f8 #2 SMP PREEMPT Fri Mar 23 18:37:25 IST 2018 armv7l GNU/Linux
    USB is initialized
    usb@48890000: host,
    usb@488d0000: peripheral,

    Gadget Kernel Config: g_zero is enabled
    Gadget Kernel Config: g_audio is enabled
    Gadget Kernel Config: g_ether is enabled
    Gadget Kernel Config: g_ncm is enabled
    Gadget Kernel Config: g_mass_storage is enabled
    Gadget Kernel Config: g_serial is enabled
    Gadget Kernel Config: g_printer is enabled
    gadget driver loaded: (none)

    The list of USB gadget drivers installed:
    /lib/modules/4.4.32-gadde2ca9f8/kernel/drivers/usb/gadget/:
    function/
    legacy/
    libcomposite.ko
    udc/

    /lib/modules/4.4.32-gadde2ca9f8/kernel/drivers/usb/gadget/function:
    u_ether.ko
    u_serial.ko
    usb_f_acm.ko
    usb_f_ecm.ko
    usb_f_ecm_subset.ko
    usb_f_fs.ko
    usb_f_hid.ko
    usb_f_mass_storage.ko
    usb_f_midi.ko
    usb_f_ncm.ko
    usb_f_obex.ko
    usb_f_printer.ko
    usb_f_rndis.ko
    usb_f_serial.ko
    usb_f_ss_lb.ko
    usb_f_uac2.ko
    usb_f_uvc.ko

    /lib/modules/4.4.32-gadde2ca9f8/kernel/drivers/usb/gadget/legacy:
    g_acm_ms.ko
    g_audio.ko
    g_cdc.ko
    g_dbgp.ko
    g_ether.ko
    g_ffs.ko
    g_hid.ko
    g_mass_storage.ko
    g_midi.ko
    g_multi.ko
    g_ncm.ko
    g_printer.ko
    g_serial.ko
    g_webcam.ko
    g_zero.ko
    gadgetfs.ko

    /lib/modules/4.4.32-gadde2ca9f8/kernel/drivers/usb/gadget/udc:
    udc-core.ko
    root@am57xx-evm:~#

    /cfs-file/__key/communityserver-discussions-components-files/791/Kernel.log

    Please, let me know if you require anything more than this.

    Thanks,

    Ronak

  • Ronak,

    Ronak Patel said:
    root@am57xx-evm:~# sh test.sh
    chkusb.sh Version 0.2.7
    Linux am57xx-evm 4.4.32-gadde2ca9f8 #2 SMP PREEMPT Fri Mar 23 18:37:25 IST 2018 armv7l GNU/Linux
    USB is initialized
    usb@48890000: host,
    usb@488d0000: peripheral,

    The log shows USB2 is in peripheral mode, not host.

    I see your DTS already set USB2 dr_mode = "host", please check why the DT setting doesn't take affect.

  • Hi Bin,

    Yes I did the set dr_mode ="host" in DTS file but why it is not coming in to the picture.
    Any suggestion apart from this file is there any file which will configure this entry as a host mode?

    Regards,
    Ronak
  • Ronak,

    The message I highlighted means kernel reads the dr_mode is set to peripheral from the DT blob which uboot passed to kernel, so your DTS setting doesn't take effect.

    The DTS you provided is a new DTS file for your board? or you must modified an existing DTS in the Processor SDK kernel? Please check uboot log to ensure the dtb filename loaded is the one you created/modified.

    The mode of the USB port is only controlled by the DT dr_mode setting, nothing else would affect the USB mode.
  • Okay, I see the DTS you attached is named as am57xx_beagle_x15_common.txt, did your uboot loaded _its_ dtb - am57xx_beagle_x15_common.dtb?
  • Hello Bin, 

    Thank you so much for your quick support.

    Kernel

    In the kernel part we are using "am57xx-beagle-x15.dtb".

    It is depends on "am57xx-beagle-x15.dts", and this "am57xx-beagle-x15.dts" will includes "am57xx-beagle-x15-common.dtsi". 

    So we modify these two files "am57xx-beagle-x15.dts" and "am57xx-beagle-x15-common.dtsi" and make a DTB file for this kernel.

     

    U-boot

    In u-boot part we are using "am57xx_evm_nodt_config" def-config for compiling the u-boot.

    So as per my knowledge it will not use any dtb in u-boot portion.  

    If my understanding is wrong then please make it correct.

    And If my understanding is correct then please help me to find out the solution.

    Regards,

    Ronak 

  • Thanks it is resolve my issue.
    USb2 is working in host mode now.
    That script helps to me debug.