linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ran Wang <ran.wang_1@nxp.com>
To: Rob Herring <robh@kernel.org>, Felipe Balbi <balbi@kernel.org>
Cc: Yang Li <pku.leo@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH V2 1/2] usb: dwc3: Add node to update cache type setting
Date: Wed, 9 Oct 2019 03:20:28 +0000	[thread overview]
Message-ID: <DB8PR04MB68268ECD73BA976CB59A3EDDF1950@DB8PR04MB6826.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <CADRPPNRHOda+ZfB25CeqReXBb-MrB1oAeTHF-3muXVExn+G+Dg@mail.gmail.com>

Hi Rob, Felipe,

On Tuesday, September 24, 2019 00:38, Yang Li wrote:
> 
> On Thu, Jul 25, 2019 at 4:56 PM Rob Herring <robh@kernel.org> wrote:
> >
> > On Wed, Jul 24, 2019 at 8:29 PM Ran Wang <ran.wang_1@nxp.com> wrote:
> > >
> > > Hi Rob,
> > >
> > > On Thursday, July 25, 2019 04:42 Rob Herring <robh@kernel.org> wrote:
> > > >
> > > > On Fri, Jul 12, 2019 at 02:42:05PM +0800, Ran Wang wrote:
> > > > > Some Layerscape paltforms (such as LS1088A, LS2088A, etc)
> > > > > encounter USB detect failues when adding dma-coherent to DWC3
> > > > > node. This is because the HW default cache type configuration of
> > > > > those SoC are not right, need to be updated in DTS.
> > > > >
> > > > > Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> > > > > ---
> > > > > Change in v2:
> > > > >     - New file.
> > > > >
> > > > >  Documentation/devicetree/bindings/usb/dwc3.txt | 43
> > > > > ++++++++++++++++++++++++++
> > > > >  1 file changed, 43 insertions(+)
> > > > >
> > > > > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt
> > > > > b/Documentation/devicetree/bindings/usb/dwc3.txt
> > > > > index 8e5265e..7bc1cef 100644
> > > > > --- a/Documentation/devicetree/bindings/usb/dwc3.txt
> > > > > +++ b/Documentation/devicetree/bindings/usb/dwc3.txt
> > > > > @@ -110,6 +110,43 @@ Optional properties:
> > > > >   - in addition all properties from usb-xhci.txt from the current directory
> are
> > > > >     supported as well
> > > > >
> > > > > +* Cache type nodes (optional)
> > > > > +
> > > > > +The Cache type node is used to tell how to configure cache type
> > > > > +on 4 different transfer types: Data Read, Desc Read, Data Write
> > > > > +and Desc write. For each treasfer type, controller has a 4-bit
> > > > > +register field to enable different cache type. Quoted from DWC3
> > > > > +data book Table 6-5
> > > > Cache Type Bit Assignments:
> > > > > +----------------------------------------------------------------
> > > > > +MBUS_TYPE| bit[3]       |bit[2]       |bit[1]     |bit[0]
> > > > > +----------------------------------------------------------------
> > > > > +AHB      |Cacheable     |Bufferable   |Privilegge |Data
> > > > > +AXI3     |Write Allocate|Read Allocate|Cacheable  |Bufferable
> > > > > +AXI4     |Allocate Other|Allocate     |Modifiable |Bufferable
> > > > > +AXI4     |Other Allocate|Allocate     |Modifiable |Bufferable
> > > > > +Native   |Same as AXI   |Same as AXI  |Same as AXI|Same as AXI
> > > > > +---------------------------------------------------------------
> > > > > +-
> > > > > +Note: The AHB, AXI3, AXI4, and PCIe busses use different names
> > > > > +for certain signals, which have the same meaning:
> > > > > +  Bufferable = Posted
> > > > > +  Cacheable = Modifiable = Snoop (negation of No Snoop)
> > > >
> > > > This should all be implied from the SoC specific compatible strings.
> > >
> > > Did you mean I could implement a soc driver which can be matched by
> compatible of 'fsl,ls1088a-dwc3' which will pass known bus type to DWC3 driver?
> If yes, how to pass?
> >
> > Yes. The DT match table can have data associated with that compatible
> > string. Beyond that, I'm not really familiar with the DWC3 driver.
> 
> Hi Rob,
> 
> It looks like that the current dwc3 binding perfers to define general quirks in
> device tree properties instead of trying to rely on the compatible string to
> determine quirks.  In this case, can we keep following the existing preference
> instead of choosing the other way?

Looks like you have different opinions on this solution, so I 'd like to have all opens
get settled here to help me find a acceptable solution for both of you. 
Please let me explain more about this:

1. This feature (configure cache type) is natively from DWC3 IP (we can find it from data book),
    not a SoC specific feature (more details please see v1 discussion: https://lore.kernel.org/patchwork/patch/851306/)

2. However, in most SoC, the HW default setting looks fine (no need driver help), but some case
    (like Layerscape) might need driver to do some programming to fix USB no detect issue.
    That's why I implement this patch.

3. For now, Rob think this should be handled by SoC specific code rather than adding a property to
    control it (by DWC3 core driver). And Felipe prefer to avoid using glue diver. So I am not sure how
    to meet this requirements at the same time. 
   
Any further suggestion are really appreciated. Thank you.

Regards,
Ran

      reply	other threads:[~2019-10-09  3:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  6:42 [PATCH V2 1/2] usb: dwc3: Add node to update cache type setting Ran Wang
2019-07-12  6:42 ` [PATCH V2 2/2] usb: dwc3: Add cache type configuration support Ran Wang
2019-07-24 20:42 ` [PATCH V2 1/2] usb: dwc3: Add node to update cache type setting Rob Herring
2019-07-25  2:29   ` Ran Wang
2019-07-25 21:55     ` Rob Herring
2019-07-26  3:29       ` Ran Wang
2019-08-14  3:34         ` Ran Wang
2019-09-23 16:38       ` Yang Li
2019-10-09  3:20         ` Ran Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB8PR04MB68268ECD73BA976CB59A3EDDF1950@DB8PR04MB6826.eurprd04.prod.outlook.com \
    --to=ran.wang_1@nxp.com \
    --cc=balbi@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pku.leo@gmail.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).