Project

General

Profile

USB OTG with rocko and kernel 4.9 RT

Added by V J over 4 years ago

Hi
I am struggling to get USB OTG up and running using the rocko branch with kernel 4.9 RT (ref. https://support.criticallink.com/redmine/boards/45/topics/4963?r=5812#message-5812)
I have connected a USB hard disk (mass storage) to the USB OTG port but the USB device is not recognized. I also notice that D406 on the evaluation board is not on.
USB related messages in dmesg (I have enabled some debug options):

[    1.677912] dwc2 ffb40000.usb: HCTSIZ         @0xF08E0590 : 0x00000000
[    1.677919] dwc2 ffb40000.usb: HCDMA  @0xF08E0594 : 0x4DAF13A2
[    1.677926] dwc2 ffb40000.usb: Host Channel 5 Specific Registers
[    1.677933] dwc2 ffb40000.usb: HCCHAR         @0xF08E05A0 : 0x00000000
[    1.677940] dwc2 ffb40000.usb: HCSPLT         @0xF08E05A4 : 0x00000000
[    1.677947] dwc2 ffb40000.usb: HCINT  @0xF08E05A8 : 0x00000002
[    1.677954] dwc2 ffb40000.usb: HCINTMSK       @0xF08E05AC : 0x00000000
[    1.677961] dwc2 ffb40000.usb: HCTSIZ         @0xF08E05B0 : 0x00000000
[    1.677968] dwc2 ffb40000.usb: HCDMA  @0xF08E05B4 : 0xF5BF11EF
[    1.677975] dwc2 ffb40000.usb: Host Channel 6 Specific Registers
[    1.677982] dwc2 ffb40000.usb: HCCHAR         @0xF08E05C0 : 0x00000000
[    1.677989] dwc2 ffb40000.usb: HCSPLT         @0xF08E05C4 : 0x00000000
[    1.677996] dwc2 ffb40000.usb: HCINT  @0xF08E05C8 : 0x00000002
[    1.678003] dwc2 ffb40000.usb: HCINTMSK       @0xF08E05CC : 0x00000000
[    1.678010] dwc2 ffb40000.usb: HCTSIZ         @0xF08E05D0 : 0x00000000
[    1.678017] dwc2 ffb40000.usb: HCDMA  @0xF08E05D4 : 0x8701329B
[    1.678024] dwc2 ffb40000.usb: Host Channel 7 Specific Registers
[    1.678031] dwc2 ffb40000.usb: HCCHAR         @0xF08E05E0 : 0x00000000
[    1.678038] dwc2 ffb40000.usb: HCSPLT         @0xF08E05E4 : 0x00000000
[    1.678045] dwc2 ffb40000.usb: HCINT  @0xF08E05E8 : 0x00000002
[    1.678052] dwc2 ffb40000.usb: HCINTMSK       @0xF08E05EC : 0x00000000
[    1.678059] dwc2 ffb40000.usb: HCTSIZ         @0xF08E05F0 : 0x00000000
[    1.678066] dwc2 ffb40000.usb: HCDMA  @0xF08E05F4 : 0xDE85CC2C
[    1.678073] dwc2 ffb40000.usb: Host Channel 8 Specific Registers
[    1.678080] dwc2 ffb40000.usb: HCCHAR         @0xF08E0600 : 0x00000000
[    1.678087] dwc2 ffb40000.usb: HCSPLT         @0xF08E0604 : 0x00000000
[    1.678094] dwc2 ffb40000.usb: HCINT  @0xF08E0608 : 0x00000002
[    1.678101] dwc2 ffb40000.usb: HCINTMSK       @0xF08E060C : 0x00000000
[    1.678108] dwc2 ffb40000.usb: HCTSIZ         @0xF08E0610 : 0x00000000
[    1.678115] dwc2 ffb40000.usb: HCDMA  @0xF08E0614 : 0xC0688DA8
[    1.678122] dwc2 ffb40000.usb: Host Channel 9 Specific Registers
[    1.678129] dwc2 ffb40000.usb: HCCHAR         @0xF08E0620 : 0x00000000
[    1.678136] dwc2 ffb40000.usb: HCSPLT         @0xF08E0624 : 0x00000000
[    1.678143] dwc2 ffb40000.usb: HCINT  @0xF08E0628 : 0x00000002
[    1.678150] dwc2 ffb40000.usb: HCINTMSK       @0xF08E062C : 0x00000000
[    1.678157] dwc2 ffb40000.usb: HCTSIZ         @0xF08E0630 : 0x00000000
[    1.678164] dwc2 ffb40000.usb: HCDMA  @0xF08E0634 : 0x1E6EE5B2
[    1.678171] dwc2 ffb40000.usb: Host Channel 10 Specific Registers
[    1.678178] dwc2 ffb40000.usb: HCCHAR         @0xF08E0640 : 0x00000000
[    1.678185] dwc2 ffb40000.usb: HCSPLT         @0xF08E0644 : 0x00000000
[    1.678192] dwc2 ffb40000.usb: HCINT  @0xF08E0648 : 0x00000002
[    1.678199] dwc2 ffb40000.usb: HCINTMSK       @0xF08E064C : 0x00000000
[    1.678206] dwc2 ffb40000.usb: HCTSIZ         @0xF08E0650 : 0x00000000
[    1.678214] dwc2 ffb40000.usb: HCDMA  @0xF08E0654 : 0x92115880
[    1.678221] dwc2 ffb40000.usb: Host Channel 11 Specific Registers
[    1.678228] dwc2 ffb40000.usb: HCCHAR         @0xF08E0660 : 0x00000000
[    1.678235] dwc2 ffb40000.usb: HCSPLT         @0xF08E0664 : 0x00000000
[    1.678242] dwc2 ffb40000.usb: HCINT  @0xF08E0668 : 0x00000002
[    1.678249] dwc2 ffb40000.usb: HCINTMSK       @0xF08E066C : 0x00000000
[    1.678256] dwc2 ffb40000.usb: HCTSIZ         @0xF08E0670 : 0x00000000
[    1.678263] dwc2 ffb40000.usb: HCDMA  @0xF08E0674 : 0xFFFA8217
[    1.678270] dwc2 ffb40000.usb: Host Channel 12 Specific Registers
[    1.678277] dwc2 ffb40000.usb: HCCHAR         @0xF08E0680 : 0x00000000
[    1.678284] dwc2 ffb40000.usb: HCSPLT         @0xF08E0684 : 0x00000000
[    1.678291] dwc2 ffb40000.usb: HCINT  @0xF08E0688 : 0x00000002
[    1.678298] dwc2 ffb40000.usb: HCINTMSK       @0xF08E068C : 0x00000000
[    1.678305] dwc2 ffb40000.usb: HCTSIZ         @0xF08E0690 : 0x00000000
[    1.678312] dwc2 ffb40000.usb: HCDMA  @0xF08E0694 : 0xC8A64512
[    1.678319] dwc2 ffb40000.usb: Host Channel 13 Specific Registers
[    1.678326] dwc2 ffb40000.usb: HCCHAR         @0xF08E06A0 : 0x00000000
[    1.678333] dwc2 ffb40000.usb: HCSPLT         @0xF08E06A4 : 0x00000000
[    1.678341] dwc2 ffb40000.usb: HCINT  @0xF08E06A8 : 0x00000002
[    1.678348] dwc2 ffb40000.usb: HCINTMSK       @0xF08E06AC : 0x00000000
[    1.678355] dwc2 ffb40000.usb: HCTSIZ         @0xF08E06B0 : 0x00000000
[    1.678362] dwc2 ffb40000.usb: HCDMA  @0xF08E06B4 : 0x9B9DDFB9
[    1.678369] dwc2 ffb40000.usb: Host Channel 14 Specific Registers
[    1.678376] dwc2 ffb40000.usb: HCCHAR         @0xF08E06C0 : 0x00000000
[    1.678383] dwc2 ffb40000.usb: HCSPLT         @0xF08E06C4 : 0x00000000
[    1.678390] dwc2 ffb40000.usb: HCINT  @0xF08E06C8 : 0x00000002
[    1.678397] dwc2 ffb40000.usb: HCINTMSK       @0xF08E06CC : 0x00000000
[    1.678404] dwc2 ffb40000.usb: HCTSIZ         @0xF08E06D0 : 0x00000000
[    1.678411] dwc2 ffb40000.usb: HCDMA  @0xF08E06D4 : 0x0A5D4B89
[    1.678418] dwc2 ffb40000.usb: Host Channel 15 Specific Registers
[    1.678425] dwc2 ffb40000.usb: HCCHAR         @0xF08E06E0 : 0x00000000
[    1.678432] dwc2 ffb40000.usb: HCSPLT         @0xF08E06E4 : 0x00000000
[    1.678439] dwc2 ffb40000.usb: HCINT  @0xF08E06E8 : 0x00000002
[    1.678446] dwc2 ffb40000.usb: HCINTMSK       @0xF08E06EC : 0x00000000
[    1.678453] dwc2 ffb40000.usb: HCTSIZ         @0xF08E06F0 : 0x00000000
[    1.678460] dwc2 ffb40000.usb: HCDMA  @0xF08E06F4 : 0xBE446DEE
[    1.678467] dwc2 ffb40000.usb: ************************************************************
[    1.678473] dwc2 ffb40000.usb:
[    1.679281] usbcore: registered new interface driver usb-storage
[    1.695136] usb0: HOST MAC f2:86:6e:1e:2a:21
[    1.699456] usb0: MAC 5a:0c:4c:f2:64:56
[    1.722829] dwc2 ffb40000.usb: bound driver g_ether
[    1.727695] dwc2 ffb40000.usb: dwc2_hsotg_pullup: is_on: 1 op_state: 9
[    1.781541] dwc2 ffb40000.usb: GetPortStatus wIndex=0x0001 flags=0x00000000
[    1.840552] usbcore: registered new interface driver usbhid
[    1.848953] usbhid: USB HID core driver
[    2.634904] dwc2 ffb40000.usb: gintsts=04000025  gintmsk=f3000806
[    2.634919] dwc2 ffb40000.usb: ++OTG Interrupt gotgint=40000 [a_host]
[    2.634944] dwc2 ffb40000.usb:  ++OTG Interrupt: A-Device Timeout Change++

USB OTG is working when using the original SD card (kernel 3.16) that came with the evaluation board, and LED D406 is on. USB related messages in dmesg for this version:
[    0.212390] usbcore: registered new interface driver usbfs
[    0.212456] usbcore: registered new interface driver hub
[    0.212563] usbcore: registered new device driver usb
[    0.892972] dwc2 ffb40000.usb: EPs: 15, dedicated fifos, 8064 entries in SPRAM
[    1.755325] dwc2 ffb40000.usb: DWC OTG Controller
[    1.758737] dwc2 ffb40000.usb: new USB bus registered, assigned bus number 1
[    1.764480] dwc2 ffb40000.usb: irq 160, io mem 0x00000000
[    1.768811] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.774276] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.780186] usb usb1: Product: DWC OTG Controller
[    1.783574] usb usb1: Manufacturer: Linux 3.16.0-g2067793 dwc2_hsotg
[    1.788613] usb usb1: SerialNumber: ffb40000.usb
[    1.792416] hub 1-0:1.0: USB hub found
[    1.797924] usbcore: registered new interface driver usb-storage
[    1.919741] usbcore: registered new interface driver usbhid
[    1.923990] usbhid: USB HID core driver
[    3.145280] usb 1-1: new high-speed USB device number 2 using dwc2
[    3.356701] usb 1-1: New USB device found, idVendor=059f, idProduct=106a
[    3.362084] usb 1-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[    3.367913] usb 1-1: Product: Rikiki USB 3.0
[    3.370869] usb 1-1: Manufacturer: LaCie
[    3.373481] usb 1-1: SerialNumber: 000000002577534e2031
[    3.377999] usb-storage 1-1:1.0: USB Mass Storage device detected
[    3.383018] scsi0 : usb-storage 1-1:1.0
[    4.385813] scsi 0:0:0:0: Direct-Access     LaCie    Rikiki USB 3.0   1053 PQ: 0 ANSI: 6

USB OTG was also working on kernel version 4.12 which I have used earlier.

I have tried with various kernel configurations, but have not managed to get it to work.
Is this supposed to work “out of the box” for the rocko branch with kernel 4.9?
Are you aware of any changes in kernel 4.9 compared to earlier versions which affects the USB OTG?

BR
VJ


Replies (5)

RE: USB OTG with rocko and kernel 4.9 RT - Added by Daniel Vincelette over 4 years ago

Hello,

There is a patch missing from our 4.9 RT branch, sorry this was missed when we did the RT port. I'm working on getting that merged in now.

In order to get USB OTG to work with the MitySOM-5CSX you need the following patch: https://support.criticallink.com/gitweb/?p=linux-socfpga.git;a=blobdiff;f=drivers/usb/dwc2/platform.c;h=7f2cdc926f287b161d68c2e07b415a4018e9d618;hp=2dfb140567c06a01c6ce74346f425070eb6933f0;hb=7ee4a5102924e434458f1e93e986b9fc1f021a65;hpb=7d052214ad7f2ae552649bf7e1acec667c9667b8

This patch adds a new config that will configure the USB PHY to enable VBUS.

I'll update once I've tested and pushed it, should be by the end of the day.

Dan

RE: USB OTG with rocko and kernel 4.9 RT - Added by Daniel Vincelette over 4 years ago

Hello,

Just to update you, I've applied the patch I mentioned but unluckily VBUS still doesn't turn on. This will unluckily take a few more days in order to get to work it seems.

We will update this redmine once we have USB working with the 4.9 RT kernel. My apologizes for the delay.

Dan

RE: USB OTG with rocko and kernel 4.9 RT - Added by V J over 4 years ago

Hi
I have tried the patch here, but got the same result as you: no VBUS.
Thank you for working on this issue.
BR
VJ

RE: USB OTG with rocko and kernel 4.9 RT - Added by Daniel Vincelette over 4 years ago

Hello,

We've found the other patch that was needed: https://support.criticallink.com/gitweb/?p=linux-socfpga.git;a=commit;h=a5ae1d10efe50e0a80a4cd401992624d1218399a. With both patches USB will enumerate correctly and works as expected.

I've pushed both the patches to https://support.criticallink.com/gitweb/?p=linux-socfpga.git;a=shortlog;h=refs/heads/socfpga-4.9.76-ltsi-rt

Thank you for reporting this issue and please let us know if you have any further questions.

Kind Regards,
Dan

RE: USB OTG with rocko and kernel 4.9 RT - Added by V J about 4 years ago

Thank you for the update. I now have a working USB OTG.
I needed to build the kernel with option CONFIG_LBDAF to be able to mount my SSD.
(Ref. mount message: "EXT4-fs (sda1): Filesystem with huge files cannot be mounted RDWR without CONFIG_LBDAF").
BR
VJ

    (1-5/5)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)