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/AM3352: Device tree USB problem

Part Number: AM3352
Other Parts Discussed in Thread: TPS65217

Tool/software: Linux

Im moving from a older TI SDK with no Device tree support to 04.01.00.06 (ti-processor-sdk-linux-am335x-evm-04.01.00.06-Linux-x86-Install.bin). I have manged to get most parts working except the USBs. No matter how I configure the device trees and config options I use I cant seem to get it working. The connections and layout for the USB is as below in the picture



I never see any USBs found on boot, or if I insert modules after boot. lsusb always comes up empty.


This is what I have included in the device tree file which is related to the USB part:
#include "am33xx.dtsi"
#include <dt-bindings/interrupt-controller/irq.h>

&usb {
status = "okay";
};

&usb_ctrl_mod {
status = "okay";
};

&usb0_phy {
status = "okay";
};

&usb0 {
status = "okay";
dr_mode = "host";
};

&cppi41dma {
status = "okay";
};
In our old setup we didnt use DMA, and I have tried disabling it now also without any success. I bet Im just missing some simple piece of code or config option, but I looked through the wikis and documentation and cant seem to figure it out. If more info is needed to help me let me know and Ill try to provide it!

So my question is: Do I need anything more in my device tree file and what CONFIG options should I use to get USB0 recognized as hosts during boot?


  • Hi Biser,

    Yes I have seen those pages. From your response I guess all the information I need should be available there? Need to read them through again and see what I missed.

    So the hardware setup should be ok (I think so because it works with previous SDK) and the device tree setup also?

    /Henrik
  • I have asked the software team to look at this. They will respond here.
  • Hi Henrik,

    Henrik Makitaavola said:
    &usb {
    status = "okay";
    };

    &usb_ctrl_mod {
    status = "okay";
    };

    &usb0_phy {
    status = "okay";
    };

    &usb0 {
    status = "okay";
    dr_mode = "host";
    };

    &cppi41dma {
    status = "okay";
    };

    Your main DTS file looks correct to me.

    What you should check now is the am33xx.dtsi file. This file is used for AM335x TI EVM and TI SK boards (am335x-evm.dts and am335x-evmsk.dts). You should check if you have HW differences with AM335x TI boards and if you need to apply these differences in the am33xx.dtsi file. See also the below txt file for more info:

    linux-4.9.41/Documentation/devicetree/bindings/usb/am33xx-usb.txt

    Make sure also you are using the correct <defconfig> file - tisdk_am335x-evm_defconfig, see the below wiki:

    See also below e2e threads:

    Regards,
    Pavel

  • Hi Pavel,

    Thanks for the info, I will look through the links later today and see if I cannot resolve the problem. Got the USB working in U-Boot yesterday, so I atleast know that the hardware isn't broken.

  • Henrik,

    If issue is not resolved by the links, please post the full console boot-up log.

    Regards,
    Pavel
  • Ok, as I expected I had missed one define ( CONFIG_USB_MUSB_DSPS ) *facepalm*. Which the person in one of the post you linked to also had done. Maybe the documentation is unclear?

    Im seeing the same VBUS_ERROR also, "musb-hdrc musb-hdrc.0.auto: VBUS_ERROR in a_wait_vrise". I guess the caps are to low on our setup also? Commented this to the hardware folks long ago, and need to be resolved to the next revision. I guess the USB should work anyway because it worked on previous kernel?
  • Ok, so musb shows up but I cant seem to use my USB port anyway. I have added caps, so there is 200uF now on VBUS. If I measure VBUS I dont get 5 V on the USB port.

    This is the console bootup, hope you can help me:

    0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Initializing cgroup subsys cpuset
    [ 0.000000] Initializing cgroup subsys cpu
    [ 0.000000] Initializing cgroup subsys cpuacct
    [ 0.000000] Linux version 4.4.41 (henrik@henrik-dekstop) (gcc version 6.4.0 (Buildroot 2017.08.1-g78bc8db) ) #6 SMP Tue Dec 19 11:11:28 CET 2017
    [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] Machine model: TI AM335x EVM
    [ 0.000000] cma: Reserved 16 MiB at 0x85800000
    [ 0.000000] Memory policy: Data cache writeback
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM335X ES2.1 (neon )
    [ 0.000000] PERCPU: Embedded 14 pages/cpu @c7c78000 s24936 r8192 d24216 u57344
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 31968
    [ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mtdblock9 rw rootfstype=jffs2
    [ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
    [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    [ 0.000000] Memory: 91980K/129024K available (7079K kernel code, 779K rwdata, 2364K rodata, 448K init, 8266K bss, 20660K reserved, 16384K cma-reserved, 0K highmem)
    [ 0.000000] Virtual kernel memory layout:
    [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
    [ 0.000000] vmalloc : 0xc8800000 - 0xff800000 ( 880 MB)
    [ 0.000000] lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
    [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
    [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
    [ 0.000000] .text : 0xc0008000 - 0xc09410d4 (9445 kB)
    [ 0.000000] .init : 0xc0942000 - 0xc09b2000 ( 448 kB)
    [ 0.000000] .data : 0xc09b2000 - 0xc0a74eb8 ( 780 kB)
    [ 0.000000] .bss : 0xc0a76000 - 0xc12888e0 (8267 kB)
    [ 0.000000] Running RCU self tests
    [ 0.000000] Hierarchical RCU implementation.
    [ 0.000000] RCU lockdep checking is enabled.
    [ 0.000000] Build-time adjustment of leaf fanout to 32.
    [ 0.000000] RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
    [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
    [ 0.000000] NR_IRQS:16 nr_irqs:16 16
    [ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [ 0.000039] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [ 0.000100] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [ 0.000217] OMAP clocksource: timer1 at 24000000 Hz
    [ 0.001693] clocksource_probe: no matching clocksources found
    [ 0.004128] Console: colour dummy device 80x30
    [ 0.004284] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
    [ 0.004313] ... MAX_LOCKDEP_SUBCLASSES: 8
    [ 0.004338] ... MAX_LOCK_DEPTH: 48
    [ 0.004362] ... MAX_LOCKDEP_KEYS: 8191
    [ 0.004386] ... CLASSHASH_SIZE: 4096
    [ 0.004409] ... MAX_LOCKDEP_ENTRIES: 32768
    [ 0.004433] ... MAX_LOCKDEP_CHAINS: 65536
    [ 0.004455] ... CHAINHASH_SIZE: 32768
    [ 0.004479] memory used by lock dependency info: 5167 kB
    [ 0.004504] per task-struct memory footprint: 1536 bytes
    [ 0.004570] Calibrating delay loop... 297.36 BogoMIPS (lpj=1486848)
    [ 0.126133] pid_max: default: 32768 minimum: 301
    [ 0.127252] Security Framework initialized
    [ 0.127595] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.127648] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.136547] Initializing cgroup subsys io
    [ 0.136839] Initializing cgroup subsys memory
    [ 0.137103] Initializing cgroup subsys devices
    [ 0.137476] Initializing cgroup subsys freezer
    [ 0.137706] Initializing cgroup subsys perf_event
    [ 0.137913] CPU: Testing write buffer coherency: ok
    [ 0.141952] CPU0: thread -1, cpu 0, socket -1, mpidr 0
    [ 0.142272] Setting up static identity map for 0x80008280 - 0x800082f8
    [ 0.153326] Brought up 1 CPUs
    [ 0.153389] SMP: Total of 1 processors activated (297.36 BogoMIPS).
    [ 0.153420] CPU: All CPU(s) started in SVC mode.
    [ 0.165190] devtmpfs: initialized
    [ 0.281379] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [ 0.492734] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [ 0.498990] pinctrl core: initialized pinctrl subsystem
    [ 0.514514] NET: Registered protocol family 16
    [ 0.532662] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [ 0.538904] cpuidle: using governor ladder
    [ 0.538996] cpuidle: using governor menu
    [ 0.579243] OMAP GPIO hardware version 0.1
    [ 0.640983] omap-gpmc 50000000.gpmc: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/nandflash_pins_s0, deferring probe
    [ 0.649335] No ATAGs?
    [ 0.649418] hw-breakpoint: debug architecture 0x4 unsupported.
    [ 0.651009] omap4_sram_init:Unable to allocate sram needed to handle errata I688
    [ 0.651059] omap4_sram_init:Unable to get sram pool needed to handle errata I688
    [ 0.797662] edma 49000000.edma: TI EDMA DMA engine driver
    [ 0.807621] SCSI subsystem initialized
    [ 0.812549] usbcore: registered new interface driver usbfs
    [ 0.813057] usbcore: registered new interface driver hub
    [ 0.813508] usbcore: registered new device driver usb
    [ 0.815573] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
    [ 0.816606] pps_core: LinuxPPS API ver. 1 registered
    [ 0.816644] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [ 0.816852] PTP clock support registered
    [ 0.828800] clocksource: Switched to clocksource timer1
    [ 1.284868] NET: Registered protocol family 2
    [ 1.290788] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
    [ 1.290935] TCP bind hash table entries: 1024 (order: 3, 36864 bytes)
    [ 1.291947] TCP: Hash tables configured (established 1024 bind 1024)
    [ 1.292482] UDP hash table entries: 256 (order: 2, 20480 bytes)
    [ 1.293051] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
    [ 1.295746] NET: Registered protocol family 1
    [ 1.300712] RPC: Registered named UNIX socket transport module.
    [ 1.300774] RPC: Registered udp transport module.
    [ 1.300806] RPC: Registered tcp transport module.
    [ 1.300837] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 1.308151] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
    [ 1.322034] futex hash table entries: 256 (order: 2, 16384 bytes)
    [ 1.322711] audit: initializing netlink subsys (disabled)
    [ 1.323289] audit: type=2000 audit(1.320:1): initialized
    [ 1.336689] VFS: Disk quotas dquot_6.6.0
    [ 1.337529] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [ 1.344894] NFS: Registering the id_resolver key type
    [ 1.345899] Key type id_resolver registered
    [ 1.345943] Key type id_legacy registered
    [ 1.346452] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
    [ 1.363805] io scheduler noop registered
    [ 1.363900] io scheduler deadline registered
    [ 1.364059] io scheduler cfq registered (default)
    [ 1.369282] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
    [ 1.377585] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    [ 1.397266] omap_uart 44e09000.serial: no wakeirq for uart0
    [ 1.399184] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a OMAP UART0
    [ 2.148179] console [ttyO0] enabled
    [ 2.267176] brd: module loaded
    [ 2.339603] loop: module loaded
    [ 2.347807] SCSI Media Changer driver v0.25
    [ 2.356122] mtdoops: mtd device (mtddev=name/number) must be supplied
    [ 2.448723] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
    [ 2.455208] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
    [ 2.472038] libphy: 4a101000.mdio: probed
    [ 2.476345] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
    [ 2.490074] cpsw 4a100000.ethernet: No slave[1] phy_id, phy-handle, or fixed-link property
    [ 2.499246] cpsw 4a100000.ethernet: Detected MACID = 54:4a:16:ce:70:ad
    [ 2.507208] cpsw 4a100000.ethernet: cpts: overflow check period 2100
    [ 2.526255] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [ 2.533510] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [ 2.541007] usbcore: registered new interface driver usb-storage
    [ 2.557477] 47401300.usb-phy supply vcc not found, using dummy regulator
    [ 2.576010] musb-hdrc musb-hdrc.0.auto: Failed to request rx1.
    [ 2.584503] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517
    [ 2.656126] mousedev: PS/2 mouse device common for all mice
    [ 2.662411] i2c /dev entries driver
    [ 2.669950] ledtrig-cpu: registered to indicate activity on CPUs
    [ 2.677478] usbcore: registered new interface driver usbhid
    [ 2.683505] usbhid: USB HID core driver
    [ 2.690597] oprofile: using arm/armv7
    [ 2.696632] Initializing XFRM netlink socket
    [ 2.702442] NET: Registered protocol family 10
    [ 2.716561] sit: IPv6 over IPv4 tunneling driver
    [ 2.728903] NET: Registered protocol family 17
    [ 2.733867] NET: Registered protocol family 15
    [ 2.739668] Key type dns_resolver registered
    [ 2.744710] omap_voltage_late_init: Voltage driver support not added
    [ 2.751598] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize
    [ 2.760211] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize
    [ 2.772963] ThumbEE CPU extension supported.
    [ 2.777596] Registering SWP/SWPB emulation handler
    [ 2.782886] SmartReflex Class3 initialized
    [ 2.803780] omap-gpmc 50000000.gpmc: GPMC revision 6.0
    [ 2.810023] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
    [ 2.825151] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xdc
    [ 2.832158] nand: Micron MT29F4G08ABADAH4
    [ 2.836453] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
    [ 2.844834] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme
    [ 2.851347] 10 ofpart partitions found on MTD device 8000000.nand
    [ 2.857844] Creating 10 MTD partitions on "8000000.nand":
    [ 2.863723] 0x000000000000-0x000000020000 : "NAND.SPL"
    [ 2.890877] 0x000000020000-0x000000040000 : "NAND.SPL.backup1"
    [ 2.909800] 0x000000040000-0x000000060000 : "NAND.SPL.backup2"
    [ 2.928838] 0x000000060000-0x000000080000 : "NAND.SPL.backup3"
    [ 2.947505] 0x000000080000-0x0000000c0000 : "NAND.u-boot-spl-os"
    [ 2.966433] 0x0000000c0000-0x0000001c0000 : "NAND.u-boot"
    [ 2.984863] 0x0000001c0000-0x0000001e0000 : "NAND.u-boot-env"
    [ 3.003393] 0x0000001e0000-0x000000200000 : "NAND.u-boot-env.backup1"
    [ 3.022708] 0x000000200000-0x000000a00000 : "NAND.kernel"
    [ 3.049116] 0x000000a00000-0x000010000000 : "NAND.file-system"
    [ 3.298676] tps65217 0-0024: TPS65217 ID 0xf version 1.2
    [ 3.304711] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 100 kHz
    [ 3.333944] musb-hdrc musb-hdrc.0.auto: MUSB HDRC host driver
    [ 3.346798] musb-hdrc musb-hdrc.0.auto: new USB bus registered, assigned bus number 1
    [ 3.359946] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [ 3.367137] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [ 3.374853] usb usb1: Product: MUSB HDRC host driver
    [ 3.380174] usb usb1: Manufacturer: Linux 4.4.41 musb-hcd
    [ 3.385876] usb usb1: SerialNumber: musb-hdrc.0.auto
    [ 3.402883] hub 1-0:1.0: USB hub found
    [ 3.407902] hub 1-0:1.0: 1 port detected
    [ 3.426953] hctosys: unable to open rtc device (rtc0)
    [ 3.432592] sr_init: No PMIC hook to init smartreflex
    [ 3.438898] sr_init: platform driver register failed for SR
    [ 4.028555] musb-hdrc musb-hdrc.0.auto: VBUS_ERROR in a_wait_vrise (80, <SessEnd), retry #3, port1 0008010c
    [ 4.322956] jffs2: Empty flash at 0x00445bf4 ends at 0x00446000
    [ 4.344074] jffs2: Empty flash at 0x0044ab30 ends at 0x0044b000
    [ 5.161631] jffs2: jffs2_scan_inode_node(): CRC failed on node at 0x069437f0: Read 0xffffffff, calculated 0x4beedd8c
    [ 5.191013] jffs2: Empty flash at 0x06943848 ends at 0x06944000
    [ 6.306854] jffs2: notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
    [ 6.328925] VFS: Mounted root (jffs2 filesystem) on device 31:9.
    [ 6.338963] devtmpfs: mounted
    [ 6.344563] Freeing unused kernel memory: 448K (c0942000 - c09b2000)
    [ 6.351400] This architecture does not have kernel memory protection.
    [ 6.899480] devpts: called with bogus options
  • Henrik Makitaavola said:
    Ok, as I expected I had missed one define ( CONFIG_USB_MUSB_DSPS ) *facepalm*. Which the person in one of the post you linked to also had done. Maybe the documentation is unclear?

    CONFIG_USB_MUSB_DSPS is build as a module by default in the tisdk_am335x-evm_defconfig. Also instructions for this one are provided in the below wiki:

    Henrik Makitaavola said:
    Im seeing the same VBUS_ERROR also, "musb-hdrc musb-hdrc.0.auto: VBUS_ERROR in a_wait_vrise". I guess the caps are to low on our setup also? Commented this to the hardware folks long ago, and need to be resolved to the next revision. I guess the USB should work anyway because it worked on previous kernel?

    This is another issue, not related to the subject of this thread (USB device tree). Please open new e2e thread for new issues.

    Regards,
    Pavel

  • Henrik Makitaavola said:
    Linux version 4.4.41 (henrik@henrik-dekstop) (gcc version 6.4.0 (Buildroot 2017.08.1-g78bc8db)

    In your first post you stated that you are using AM335x TI PSDK v4.01, which seems to be NOT true based on the log you have provided.

    Please work with AM335x TI PSDK.

    Regards,
    Pavel

  • That is both true and false. I was working with buildroot and did not get the USB working. So I tried the TI SDK and didnt manage to get it working their either. Once I got musb working in TI SDK i tried it in buildroot, and only tried with an actuall usb device with buildroot which wouldnt pop up, that the output you see here. Need to try it out with the TI SDK also, if it works there I guess I will go with it.

    Thanks for noting it.
  • Henrik,

    Please provide the TI SDK boot-up log for analysis.

    Regards,
    Pavel
  • I started a new thread as you suggested: e2e.ti.com/.../651055
    Regarding the documentation, the more you point out the more clear it becomes :)
    I guess this thread can be closed.