• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » Linux » Linux forum » DM365 USB Hardware Reset in musb_hdrc
Share
Linux
  • Forum
Options
  • Subscribe via RSS

DM365 USB Hardware Reset in musb_hdrc

DM365 USB Hardware Reset in musb_hdrc

This question is not answered
Evgheniy Ilyine
Posted by Evgheniy Ilyine
on Apr 03 2012 03:27 AM
Prodigy60 points

Hello!

Sorry for my English!

I am working on davinci kernel 2.6.34. I have a board with two processors one is DM365 and other C5515. The exchanging with data by usb, 365 is host and 5515 slave.

On 365 I also have another one usb jack, for other usb devices, but I don't have hub, and I am using special key on gpio for switching usb port, I name this "internal"(5515) and "external"(other usb devices on second port).

 Most time I am working with 5515 processor, but in any time I need to save my data to external flash device, for this I switch usb to "external" port , 5515 disconnecting and after that I am inserting usb-stick, and work with it! All good, but if insert usb-stick before switching ports, I haven't got disconnect message on switching. And after removing, inserting stick, in /proc/bus/usb/devices I have seen that 5515 is connected, after reverse switching to 5515 I couldn't work with it, I had error "usb 1-1: device descriptor read/64, error -19"

I ve begun to find where is problem, and I noticed that on switching I am getting interrupt 0x04(MUSB_INTR_RESET) in musb_core.c. This means that we got hardware reset on a bus. This means that controller clear all registers to their initial state. After reinsmoding musb driver I can work with usb device! We all know that this takes a lot of time.

I have  patched musb_core.c, and now on recieving reset, I am disconnecting all usb devices, and reiniting all control regs, cppi regs and epoints .

My question is: Why musb_hdrc doesn't process this interrupt?

                            Is there another solution for my problem?

 If any one needs this patch I can upload it.

Thank you!!!

DM365 USB Linux Drivers Kernel Linux driver musb_hdrc reset
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Krunal Patil
    Posted by Krunal Patil
    on Apr 03 2012 03:48 AM
    Expert2840 points

    Hi Evgheniy,

    Its always better to upload if you have found anything new. That may help someone else in future. Also, Other experts can comment on the solution.

    Regards,

    Krunal


    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Apr 03 2012 04:31 AM
    Genius9470 points

    The BUS_RESET bit D2 indicates BABBLE interrupt in host mode. D2 bit is read as RESET interrupt only in peripheral mode. Babble is generated when there is some electrical noise on usb bus and so should be avoided at first place. As a workaround you can try setting the SESSION bit in DEVCTL register when you get BABBLE (D2 bit) interrupt.

    Ajay

    If my reply answers your question then please click on the green button "Verify Answer"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Evgheniy Ilyine
    Posted by Evgheniy Ilyine
    on Apr 03 2012 05:33 AM
    Prodigy60 points

    I thought that it is babble, too. But in my situation devctl is 0x98 and it goes outside babble interrupt process.This interrupt only handled but no one work with it it.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Apr 03 2012 05:37 AM
    Genius9470 points

    There seem to be some issue with ID pin being grounding as DEVCTL-0x98 menas D7=1 indicating musb is in device mode, and thus D2 bit set means RESET interrupt. You may want to check the ID pin value when switching the port from internal to external one.

    Ajay

    If my reply answers your question then please click on the green button "Verify Answer"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Apr 03 2012 05:38 AM
    Genius9470 points

    There seem to be some issue with ID pin being grounding as DEVCTL-0x98 menas D7=1 indicating musb is in device mode, and thus D2 bit set means RESET interrupt. You may want to check the ID pin value when switching the port from internal to external one.

    Additionally try switching off the session before swicthing internal <-> external and then set session bit again after switching.

    Ajay

    If my reply answers your question then please click on the green button "Verify Answer"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Evgheniy Ilyine
    Posted by Evgheniy Ilyine
    on Apr 03 2012 05:57 AM
    Prodigy60 points

    Here is another problem, I can't control switching, it controls by other processor (5515) , and I can't track this process. That' s why it very important to process this irq correctly.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Apr 03 2012 06:01 AM
    Genius9470 points

    This is strange, DM365 being host should known and be able to control switching. To me it looks like that when SESSION is on and suddenly usb pins are switched then ID pin goes floating for a short period of time and mentor controller thinks its in device mode. To reflect the new mode, we need to switch off the session and switch on it again.

    You said DEVCTL is 0x98 that is indicating that session is indeed off D0 =0. Can you just try sessting SESSION bit when you get this interrupt?

    Ajay

    If my reply answers your question then please click on the green button "Verify Answer"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Evgheniy Ilyine
    Posted by Evgheniy Ilyine
    on Apr 03 2012 06:43 AM
    Prodigy60 points

    Ok I tried, I set SESSION bit in devctl and nothing has happened, I tried to  reverse switching to device which marked as connected and I couldn't work with it.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Apr 03 2012 09:55 AM
    Genius9470 points

    Do you see Devctl.D0 = 1 after setting the session bit?

    Ajay

    If my reply answers your question then please click on the green button "Verify Answer"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Evgheniy Ilyine
    Posted by Evgheniy Ilyine
    on Apr 03 2012 10:34 AM
    Prodigy60 points

    Yes its 1

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Apr 03 2012 10:47 AM
    Genius9470 points

    Sme question after re-reading the main post.

    =>but if insert usb-stick before switching ports, I haven't got disconnect message on switching.

    I guess you are talking about disconnect of "internal" 5515 processor right? If so then why it's not coming? Disconnect is detected when host finds both D+ and D- going low for >=2.5us. This may happen as external port has devices connected and so D+ pull up also enabled. Can you put some delay of say >=2.5 micro seconds between the switching events? It should be like, 5515 does the disconnect then pauses for >=2.5us and then connects the usb pins to external port.

    =>And after removing, inserting stick, in /proc/bus/usb/devices I have seen that 5515 is connected,

    That means usb stack still thinks same old device is connected as there was no disconnect event.

    Ajay


    If my reply answers your question then please click on the green button "Verify Answer"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Evgheniy Ilyine
    Posted by Evgheniy Ilyine
    on Apr 04 2012 02:49 AM
    Prodigy60 points

    =>That means usb stack still thinks same old device is connected as there was no disconnect event.


    Yes I know, because this switching is very fast.

    =>Can you put some delay of say >=2.5 micro seconds between the switching events?

    I repeat that I couldn't control switching, and this looks like workaround. And I am not sure that 5515 who control switching can put delay, because it can only control gpio, for example 0 - internal, 1 - external. Board designer put there special key chip, it only can switch d+,d- lines and it is not possible to put any delay in switching.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use