Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: Ran Wang <ran.wang_1@nxp.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Felipe Balbi <balbi@kernel.org>
Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Ran Wang <ran.wang_1@nxp.com>
Subject: [PATCH V2 1/2] usb: dwc3: Add node to update cache type setting
Date: Fri, 12 Jul 2019 14:42:05 +0800
Message-ID: <20190712064206.48249-1-ran.wang_1@nxp.com> (raw)

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)
+
+In most cases, this node is not required unless the default values of related
+registers are not correct *and* DWC3 node has enabled dma-coherent. So far we
+have observed USB device detect failure on some Layerscape platforms if this
+programming is not conducted properly.
+
+Required properties:
+- transfer_type_datard:	A value for 4-bit register which decide cache type of
+  Data Read transfer. According to above table, we can know that different
+  master bus type will cause different definition of cache type control bit. So
+  developer need to know which master bus type his platforms are using in
+  advance, then decide the value for this transfer type.
+- transfer_type_descrd:	A value for 4-bit register which decide cache type of
+  Desc Read transfer.
+- transfer_type_datawr:	A value for 4-bit register which decide cache type of
+  Data Write transfer.
+- transfer_type_descwr:	A value for 4-bit register which decide cache type of
+  Desc Write transfer.
 
 This is usually a subnode to DWC3 glue to which it is connected.
 
@@ -119,4 +156,10 @@ dwc3@4a030000 {
 	interrupts = <0 92 4>
 	usb-phy = <&usb2_phy>, <&usb3,phy>;
 	snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
+	cache_type: cache_type {
+		transfer_type_datard = <0x2>;
+		transfer_type_descrd = <0x2>;
+		transfer_type_datawr = <0x2>;
+		transfer_type_descwr = <0x2>;
+	};
 };
-- 
2.7.4


             reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  6:42 Ran Wang [this message]
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

Reply instructions:

You may reply publically 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=20190712064206.48249-1-ran.wang_1@nxp.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=robh+dt@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

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org linux-usb@archiver.kernel.org
	public-inbox-index linux-usb


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/ public-inbox