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.

USB0 host mode configuration for AM335x with sdk8 (Device Tree)

Other Parts Discussed in Thread: TPS65910

Hi All,

Recently we migrate from SDK6 (kernel 3.2.0) to SDK8 (kernel 3.14.26), and I have a problem with conf USB controller (with kernel 3.2.0 it works well).

We use USB0 in host mode.

Configuration from the sdk6

static struct omap_musb_board_data musb_board_data = {
	.interface_type	= MUSB_INTERFACE_ULPI,
	/*
	 * mode[0:3] = USB0PORT's mode
	 * mode[4:7] = USB1PORT's mode
	 */
	.mode       = (MUSB_UNDEFINED<<4) | MUSB_HOST,
	.power		= 500,
	.instances	= 1,
};

Into kernel from sdk8 I try to configure like:
Device Tree fragment:

/dts-v1/;
#include "am33xx.dtsi"

&usb {
	status = "okay";

	control@44e10620 {
		status = "okay";
	};

	usb-phy@47401300 {
		status = "okay";
	};

	usb-phy@47401b00 {
		status = "okay";
	};

	usb@47401000 {
		status = "okay";
		dr_mode = "host";
	};

	usb@47401800 {
		status = "okay";
	};

	dma-controller@47402000  {
		status = "okay";
	};
};


And kernel .config fragment:

root@build:/workspace/linux-3.14.26-g2489c02# grep -i usb .config
CONFIG_MFD_OMAP_USB_HOST=y
# USB HID support
CONFIG_USB_HID=y
# CONFIG_USB_HIDDEV is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
# CONFIG_USB_DEBUG is not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
# Miscellaneous USB options
CONFIG_USB_DEFAULT_PERSIST=y
# CONFIG_USB_DYNAMIC_MINORS is not set
CONFIG_USB_OTG=y
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
CONFIG_USB_MON=y
# CONFIG_USB_WUSB_CBAF is not set
# USB Host Controller Drivers
# CONFIG_USB_C67X00_HCD is not set
CONFIG_USB_XHCI_HCD=m
CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
CONFIG_USB_EHCI_HCD_OMAP=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
# CONFIG_USB_OHCI_HCD is not set
# CONFIG_USB_UHCI_HCD is not set
CONFIG_USB_STORAGE=y
CONFIG_USB_MUSB_HDRC=y
# CONFIG_USB_MUSB_HOST is not set
# CONFIG_USB_MUSB_GADGET is not set
CONFIG_USB_MUSB_DUAL_ROLE=y
# CONFIG_USB_MUSB_TUSB6010 is not set
CONFIG_USB_MUSB_OMAP2PLUS=y
# CONFIG_USB_MUSB_AM35X is not set
# CONFIG_USB_MUSB_DSPS is not set
# CONFIG_USB_MUSB_UX500 is not set
# CONFIG_USB_INVENTRA_DMA is not set
CONFIG_USB_TI_CPPI41_DMA=y
# CONFIG_MUSB_PIO_ONLY is not set
# CONFIG_USB_DWC3 is not set
# CONFIG_USB_DWC2 is not set
# CONFIG_USB_CHIPIDEA is not set
# USB Physical Layer drivers
CONFIG_USB_PHY=y
# CONFIG_USB_OTG_FSM is not set
CONFIG_NOP_USB_XCEIV=y
CONFIG_AM335X_CONTROL_USB=y
CONFIG_AM335X_PHY_USB=y
# CONFIG_SAMSUNG_USB2PHY is not set
# CONFIG_SAMSUNG_USB3PHY is not set
# CONFIG_TWL6030_USB is not set
# CONFIG_USB_GPIO_VBUS is not set
# CONFIG_USB_ISP1301 is not set
# CONFIG_USB_RCAR_PHY is not set
CONFIG_USB_ULPI=y
CONFIG_OMAP_USB2=y

Also I apply patches from here (processors.wiki.ti.com/.../Sitara_Linux_MUSB_Issues)
But it not works
! When I connect usb storage it not annouce new device.

Where I made a mistake?

Log from dmesg:

[root@Host:~]# dmesg | grep -i usb
[    0.239935] usbcore: registered new interface driver usbfs
[    0.240123] usbcore: registered new interface driver hub
[    0.240336] usbcore: registered new device driver usb
[    1.247056] usbcore: registered new interface driver asix
[    1.252702] usbcore: registered new interface driver ax88179_178a
[    1.258992] usbcore: registered new interface driver cdc_ether
[    1.265065] usbcore: registered new interface driver smsc95xx
[    1.270995] usbcore: registered new interface driver net1080
[    1.276861] usbcore: registered new interface driver cdc_subset
[    1.283052] usbcore: registered new interface driver cdc_ncm
[    1.289337] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.311846] usbcore: registered new interface driver cdc_acm
[    1.317555] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    1.325791] usbcore: registered new interface driver usb-storage
[    1.383048] usbcore: registered new interface driver usbhid
[    1.388683] usbhid: USB HID core driver

  • Thank You for recommendation, but I can't find a suggestion for my case.

    From menuconfig I have been enabled USB Support, AM335x USB PHY Driver, MUSB DMA (TI CPPI), USB Mass Storage..., but it not works for me.

    Maybe I made a mistake with configuration from device tree? I don't see anything about MUSB into dmesg, I suspect the MUSB driver nor loaded into kernel.

    From Your recommendation - sysfs:

    [root@Host:~]# ls /sys/devices/platform/
    Fixed MDIO bus.0  cpufreq-cpu0.0     omap2-nand.0     power      serial8250
    alarmtimer        edma-dma-engine.0  oprofile-perf.0  reg-dummy  uevent

    There is no /sys/devices/platform/musb_hdrc.0/ directory.

    And debugfs:

    [root@Host:~]# ls /sys/kernel/debug/usb/
    devices  usbmon

    And there also I can't find /sys/kernel/debug/musb-hdrc.X.auto/

    I'm truyng to put printk message to drivers/usb/musb/musb_am335x.c (into am335x_child_probe() ), but after I can't find this message into dmesg.

    Maybe You give me another recommendation for My problem?


    Best regards,

    Radu Donos

  • Radu Donos said:
    # CONFIG_USB_MUSB_DSPS is not set

    This option should be enabled instead, not CONFIG_USB_MUSB_OMAP2PLUS.

    Please refer to wiki http://processors.wiki.ti.com/index.php/MUSB_Linux_Driver_Configuration for MUSB kernel configuration for AM335x.

    Please you still have issue, please attach the full .config here.

  • Hi Bin,

    Thanks a lot for your help.

    Now I found musb driver messages musb-hdrc into dmesg, but now I have these messages:

    [    1.334761] of_get_named_gpiod_flags: can't parse gpios property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
    [    1.334827] 47401300.usb-phy supply vcc not found, using dummy regulator
    [    1.344206] musb-hdrc musb-hdrc.0.auto: Failed to request rx1.
    [    1.350251] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517
    [    1.358097] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferral
    [root@Host:~]# dmesg | grep -i usb
    [    0.239143] usbcore: registered new interface driver usbfs
    [    0.239324] usbcore: registered new interface driver hub
    [    0.239594] usbcore: registered new device driver usb
    [    1.247794] usbcore: registered new interface driver asix
    [    1.253441] usbcore: registered new interface driver ax88179_178a
    [    1.259743] usbcore: registered new interface driver cdc_ether
    [    1.265813] usbcore: registered new interface driver smsc95xx
    [    1.271772] usbcore: registered new interface driver net1080
    [    1.277609] usbcore: registered new interface driver cdc_subset
    [    1.283793] usbcore: registered new interface driver cdc_ncm
    [    1.290078] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    1.312555] usbcore: registered new interface driver cdc_acm
    [    1.318267] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    [    1.326526] usbcore: registered new interface driver usb-storage
    [    1.334761] of_get_named_gpiod_flags: can't parse gpios property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
    [    1.334827] 47401300.usb-phy supply vcc not found, using dummy regulator
    [    1.344206] musb-hdrc musb-hdrc.0.auto: Failed to request rx1.
    [    1.350251] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517
    [    1.358097] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferral
    [    1.366147] of_get_named_gpiod_flags: can't parse gpios property of node '/ocp/usb@47400000/usb-phy@47401b00[0]'
    [    1.366204] 47401b00.usb-phy supply vcc not found, using dummy regulator
    [    1.375422] musb-hdrc musb-hdrc.1.auto: Failed to request rx1.
    [    1.381334] musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with status -517
    [    1.389243] platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferral
    [    1.465592] usbcore: registered new interface driver usbhid
    [    1.471194] usbhid: USB HID core driver
    [    2.657704] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    [    2.657719] musb-hdrc: MHDRC RTL version 2.0
    [    2.657727] musb-hdrc: setup fifo_mode 4
    [    2.657742] musb-hdrc: 28/31 max ep, 16384/16384 memory
    [    2.657848] musb-hdrc musb-hdrc.0.auto: MUSB HDRC host driver
    [    2.664080] musb-hdrc musb-hdrc.0.auto: new USB bus registered, assigned bus number 1
    [    2.672216] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    2.679061] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    2.686327] usb usb1: Product: MUSB HDRC host driver
    [    2.691313] usb usb1: Manufacturer: Linux 3.14.26RTR8A+ musb-hcd
    [    2.697356] usb usb1: SerialNumber: musb-hdrc.0.auto
    [    2.703314] hub 1-0:1.0: USB hub found
    [    2.714913] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    [    2.714928] musb-hdrc: MHDRC RTL version 2.0
    [    2.714936] musb-hdrc: setup fifo_mode 4
    [    2.714951] musb-hdrc: 28/31 max ep, 16384/16384 memory
    [    2.715097] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
    [    2.721333] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 2
    [    2.729446] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    [    2.736290] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    2.743544] usb usb2: Product: MUSB HDRC host driver
    [    2.748541] usb usb2: Manufacturer: Linux 3.14.26RTR8A+ musb-hcd
    [    2.754573] usb usb2: SerialNumber: musb-hdrc.1.auto
    [    2.760497] hub 2-0:1.0: USB hub found
    [    2.863715] musb-hdrc musb-hdrc.0.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #1, port1 00000104
    [    3.016133] musb-hdrc musb-hdrc.0.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #2, port1 00000104
    [    3.168557] musb-hdrc musb-hdrc.0.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #3, port1 00000104
    

    How I can fix that? Need to add regulator definition into usb node (device tree) ? On our board we use tps65910

    i2c1: i2c@4802a000 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&i2c1_pins>;
    
    	status = "okay";
    	clock-frequency = <100000>;
    
    	tps: tps@2d {
    		reg = <0x2d>;
    	};
    };
    
    #include "tps65910.dtsi"
    
    &tps {
    	vcc1-supply = <&vbat>;
    	vcc2-supply = <&vbat>;
    	vcc3-supply = <&vbat>;
    	vcc4-supply = <&vbat>;
    	vcc5-supply = <&vbat>;
    	vcc6-supply = <&vbat>;
    	vcc7-supply = <&vbat>;
    	vccio-supply = <&vbat>;
    
    	rtc:0 {
    		compatible = "ti,tps65910-rtc";
    		interrupts = <0>;
    	};
    
    	regulators {
    		vrtc_reg: regulator@0 {
    			regulator-always-on;
    		};
    
    		vio_reg: regulator@1 {
    			regulator-always-on;
    		};
    
    		vdd1_reg: regulator@2 {
    			/* VDD_MPU voltage limits 0.95V - 1.325V with +/-4% tolerance */
    			regulator-name = "vdd_mpu";
    			regulator-min-microvolt = <912500>;
    			regulator-max-microvolt = <1378000>;
    			regulator-boot-on;
    			regulator-always-on;
    		};
    
    		vdd2_reg: regulator@3 {
    			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
    			regulator-name = "vdd_core";
    			regulator-min-microvolt = <912500>;
    			regulator-max-microvolt = <1150000>;
    			regulator-boot-on;
    			regulator-always-on;
    		};
    
    		vdd3_reg: regulator@4 {
    			regulator-always-on;
    		};
    
    		vdig1_reg: regulator@5 {
    			regulator-always-on;
    		};
    
    		vdig2_reg: regulator@6 {
    			regulator-always-on;
    		};
    
    		vpll_reg: regulator@7 {
    			regulator-always-on;
    		};
    
    		vdac_reg: regulator@8 {
    			regulator-always-on;
    		};
    
    		vaux1_reg: regulator@9 {
    			regulator-always-on;
    		};
    
    		vaux2_reg: regulator@10 {
    			regulator-always-on;
    		};
    
    		vaux33_reg: regulator@11 {
    			regulator-always-on;
    		};
    
    		vmmc_reg: regulator@12 {
    			regulator-min-microvolt = <1800000>;
    			regulator-max-microvolt = <3300000>;
    			regulator-always-on;
    		};
    	};
    };

  • Radu Donos said:
    [ 1.334761] of_get_named_gpiod_flags: can't parse gpios property of node '/ocp/usb@47400000/usb-phy@47401300[0]'

    This message can be ignored, MUSB PHY does not use GPIO.

    Radu Donos said:
    [ 1.334827] 47401300.usb-phy supply vcc not found, using dummy regulator

    I never pay attention on this message, but I think it can be ignored too.

    Radu Donos said:
    [ 1.344206] musb-hdrc musb-hdrc.0.auto: Failed to request rx1.
    [ 1.350251] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517
    [ 1.358097] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferral

    These messages can be ignored. it is about driver probe deferral. MUSB drivers are loaded correctly after this point.

    Radu Donos said:
    [ 2.863715] musb-hdrc musb-hdrc.0.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd)

    This is the problem. Most likely you don't have enough cap on VBUS. The USB2.0 Spec requires VBUS should have >120uF cap for host mode.

  • Thanks a lot for your help.