Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218397

Re: [PATCH v4 5/9] usb: dwc3: core: make dual-role work with OTG irq

From Felipe Balbi <balbi@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 5/9] usb: dwc3: core: make dual-role work with OTG irq
Date 2015-09-03 18:00 +0200
Message-ID <q4F5F-83m-37@gated-at.bofh.it> (permalink)
References <q4hcZ-7Er-3@gated-at.bofh.it> <q4hd0-7Er-33@gated-at.bofh.it> <q4hwn-81p-33@gated-at.bofh.it> <q4Ddv-5mr-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

On Thu, Sep 03, 2015 at 04:52:02PM +0300, Roger Quadros wrote:
> >>  	if (on) {
> >> -		dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
> >> +		/* OCTL.PeriMode = 0 */
> >> +		reg = dwc3_readl(dwc->regs, DWC3_OCTL);
> >> +		reg &= ~DWC3_OCTL_PERIMODE;
> >> +		dwc3_writel(dwc->regs, DWC3_OCTL, reg);
> >> +		/* unconditionally turn on VBUS */
> >> +		reg |= DWC3_OCTL_PRTPWRCTL;
> >> +		dwc3_writel(dwc->regs, DWC3_OCTL, reg);
> >>  		/* start the HCD */
> >>  		usb_otg_start_host(fsm, true);
> >>  	} else {
> >>  		/* stop the HCD */
> >>  		usb_otg_start_host(fsm, false);
> >> +		/* turn off VBUS */
> >> +		reg = dwc3_readl(dwc->regs, DWC3_OCTL);
> >> +		reg &= ~DWC3_OCTL_PRTPWRCTL;
> >> +		dwc3_writel(dwc->regs, DWC3_OCTL, reg);
> >> +		/* OCTL.PeriMode = 1 */
> >> +		reg = dwc3_readl(dwc->regs, DWC3_OCTL);
> >> +		reg |= DWC3_OCTL_PERIMODE;
> >> +		dwc3_writel(dwc->regs, DWC3_OCTL, reg);
> >>  	}
> > 
> > it looks like you're not really following the fluxchart from SNPS
> > documentation, see Figure 11-4 on section 11.1.4.5
> 
> Did you mean that I'm ignoring all OTG bits (HNP/SRP/ADP)?

yes and no :-)  There's a rather complex flux chart which details how we
switch from host to peripheral and vice versa. We need to follow that to
the smallest details since that's what IP provider considers to be
correct. If we deviate from that we should have very strong reasons for
doing so and we also want big, fat, long comments in source code
detailing why and how we're deviating :-)

-- 
balbi

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/9] usb: dwc3: add dual-role support Roger Quadros <rogerq@ti.com> - 2015-09-02 16:30 +0200
  [PATCH v4 1/9] usb: dwc3: add dual-role support Roger Quadros <rogerq@ti.com> - 2015-09-02 16:30 +0200
    Re: [PATCH v4 1/9] usb: dwc3: add dual-role support Felipe Balbi <balbi@ti.com> - 2015-09-02 16:40 +0200
      Re: [PATCH v4 1/9] usb: dwc3: add dual-role support Roger Quadros <rogerq@ti.com> - 2015-09-03 14:30 +0200
        Re: [PATCH v4 1/9] usb: dwc3: add dual-role support Felipe Balbi <balbi@ti.com> - 2015-09-03 18:10 +0200
          Re: [PATCH v4 1/9] usb: dwc3: add dual-role support Roger Quadros <rogerq@ti.com> - 2015-09-04 11:10 +0200
  [PATCH v4 6/9] usb: dwc3: save/restore OTG registers during suspend/resume Roger Quadros <rogerq@ti.com> - 2015-09-02 16:30 +0200
    Re: [PATCH v4 6/9] usb: dwc3: save/restore OTG registers during  suspend/resume Felipe Balbi <balbi@ti.com> - 2015-09-02 16:50 +0200
      Re: [PATCH v4 6/9] usb: dwc3: save/restore OTG registers during  suspend/resume Roger Quadros <rogerq@ti.com> - 2015-09-03 16:00 +0200
  [PATCH v4 3/9] usb: dwc3: dwc3-omap: Make the wrapper interrupt shared Roger Quadros <rogerq@ti.com> - 2015-09-02 16:30 +0200
    Re: [PATCH v4 3/9] usb: dwc3: dwc3-omap: Make the wrapper interrupt  shared Felipe Balbi <balbi@ti.com> - 2015-09-02 16:40 +0200
  [PATCH v4 5/9] usb: dwc3: core: make dual-role work with OTG irq Roger Quadros <rogerq@ti.com> - 2015-09-02 16:30 +0200
    Re: [PATCH v4 5/9] usb: dwc3: core: make dual-role work with OTG irq Felipe Balbi <balbi@ti.com> - 2015-09-02 16:50 +0200
      Re: [PATCH v4 5/9] usb: dwc3: core: make dual-role work with OTG irq Roger Quadros <rogerq@ti.com> - 2015-09-03 16:00 +0200
        Re: [PATCH v4 5/9] usb: dwc3: core: make dual-role work with OTG irq Felipe Balbi <balbi@ti.com> - 2015-09-03 18:00 +0200
          Re: [PATCH v4 5/9] usb: dwc3: core: make dual-role work with OTG irq Roger Quadros <rogerq@ti.com> - 2015-09-04 11:20 +0200
  [PATCH v4 9/9] usb: dwc3: core: don't break during suspend/resume while we're dual-role Roger Quadros <rogerq@ti.com> - 2015-09-02 16:30 +0200
    Re: [PATCH v4 9/9] usb: dwc3: core: don't break during  suspend/resume while we're dual-role Felipe Balbi <balbi@ti.com> - 2015-09-02 16:50 +0200
      Re: [PATCH v4 9/9] usb: dwc3: core: don't break during suspend/resume  while we're dual-role Roger Quadros <rogerq@ti.com> - 2015-09-03 16:10 +0200
    Re: [PATCH v4 9/9] usb: dwc3: core: don't break during suspend/resume  while we're dual-role Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-09-02 19:30 +0200
      Re: [PATCH v4 9/9] usb: dwc3: core: don't break during suspend/resume  while we're dual-role Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-09-03 16:10 +0200
        Re: [PATCH v4 9/9] usb: dwc3: core: don't break during suspend/resume  while we're dual-role Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-09-03 16:20 +0200
        Re: [PATCH v4 9/9] usb: dwc3: core: don't break during suspend/resume  while we're dual-role Roger Quadros <rogerq@ti.com> - 2015-09-03 16:20 +0200
      Re: [PATCH v4 9/9] usb: dwc3: core: don't break during suspend/resume  while we're dual-role Roger Quadros <rogerq@ti.com> - 2015-09-03 16:10 +0200
  [PATCH v4 2/9] usb: dwc3: core.h: add some register definitions Roger Quadros <rogerq@ti.com> - 2015-09-02 16:30 +0200
  [PATCH v4 4/9] usb: dwc3: core: Adapt to named interrupts Roger Quadros <rogerq@ti.com> - 2015-09-02 16:30 +0200
    Re: [PATCH v4 4/9] usb: dwc3: core: Adapt to named interrupts Felipe Balbi <balbi@ti.com> - 2015-09-02 16:40 +0200
      Re: [PATCH v4 4/9] usb: dwc3: core: Adapt to named interrupts Roger Quadros <rogerq@ti.com> - 2015-09-03 14:50 +0200
        Re: [PATCH v4 4/9] usb: dwc3: core: Adapt to named interrupts Felipe Balbi <balbi@ti.com> - 2015-09-03 18:00 +0200
          Re: [PATCH v4 4/9] usb: dwc3: core: Adapt to named interrupts Roger Quadros <rogerq@ti.com> - 2015-09-04 11:20 +0200

csiph-web