All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] arm: dts: ls1021a: Enable usb3-lpm-capable for usb3 node
@ 2018-01-05  9:40 ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Enable USB3 HW LPM feature for ls1021a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm/boot/dts/ls1021a.dtsi |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index f81fad2..21a4488 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -709,6 +709,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		pcie@3400000 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 1/4] arm: dts: ls1021a: Enable usb3-lpm-capable for usb3 node
@ 2018-01-05  9:40 ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Enable USB3 HW LPM feature for ls1021a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm/boot/dts/ls1021a.dtsi |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index f81fad2..21a4488 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -709,6 +709,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		pcie@3400000 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [1/4] arm: dts: ls1021a: Enable usb3-lpm-capable for usb3 node
@ 2018-01-05  9:40 ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Enable USB3 HW LPM feature for ls1021a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm/boot/dts/ls1021a.dtsi |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index f81fad2..21a4488 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -709,6 +709,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		pcie@3400000 {

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 1/4] arm: dts: ls1021a: Enable usb3-lpm-capable for usb3 node
@ 2018-01-05  9:40 ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

Enable USB3 HW LPM feature for ls1021a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm/boot/dts/ls1021a.dtsi |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index f81fad2..21a4488 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -709,6 +709,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		pcie at 3400000 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/4] arm64: dts: ls1043a: Enable usb3-lpm-capable for usb3 node
  2018-01-05  9:40 ` [PATCH 1/4] " Ran Wang
  (?)
  (?)
@ 2018-01-05  9:40   ` Ran Wang
  -1 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Enable USB3 HW LPM feature for ls1043a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
index e4fed04..686c7db 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
@@ -698,6 +698,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb1: usb3@3000000 {
@@ -707,6 +709,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb2: usb3@3100000 {
@@ -716,6 +720,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		sata: sata@3200000 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/4] arm64: dts: ls1043a: Enable usb3-lpm-capable for usb3 node
@ 2018-01-05  9:40   ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Enable USB3 HW LPM feature for ls1043a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
index e4fed04..686c7db 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
@@ -698,6 +698,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb1: usb3@3000000 {
@@ -707,6 +709,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb2: usb3@3100000 {
@@ -716,6 +720,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		sata: sata@3200000 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [2/4] arm64: dts: ls1043a: Enable usb3-lpm-capable for usb3 node
@ 2018-01-05  9:40   ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Enable USB3 HW LPM feature for ls1043a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
index e4fed04..686c7db 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
@@ -698,6 +698,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb1: usb3@3000000 {
@@ -707,6 +709,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb2: usb3@3100000 {
@@ -716,6 +720,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		sata: sata@3200000 {

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/4] arm64: dts: ls1043a: Enable usb3-lpm-capable for usb3 node
@ 2018-01-05  9:40   ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

Enable USB3 HW LPM feature for ls1043a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
index e4fed04..686c7db 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
@@ -698,6 +698,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb1: usb3 at 3000000 {
@@ -707,6 +709,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb2: usb3 at 3100000 {
@@ -716,6 +720,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		sata: sata at 3200000 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/4] arm64: dts: ls1046a: Enable usb3-lpm-capable for usb3 node
  2018-01-05  9:40 ` [PATCH 1/4] " Ran Wang
  (?)
  (?)
@ 2018-01-05  9:40   ` Ran Wang
  -1 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Enable USB3 HW LPM feature for ls1046a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
index c115f17..07ca420 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
@@ -611,6 +611,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb1: usb@3000000 {
@@ -620,6 +622,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb2: usb@3100000 {
@@ -629,6 +633,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		sata: sata@3200000 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/4] arm64: dts: ls1046a: Enable usb3-lpm-capable for usb3 node
@ 2018-01-05  9:40   ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Enable USB3 HW LPM feature for ls1046a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
index c115f17..07ca420 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
@@ -611,6 +611,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb1: usb@3000000 {
@@ -620,6 +622,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb2: usb@3100000 {
@@ -629,6 +633,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		sata: sata@3200000 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [3/4] arm64: dts: ls1046a: Enable usb3-lpm-capable for usb3 node
@ 2018-01-05  9:40   ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Enable USB3 HW LPM feature for ls1046a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
index c115f17..07ca420 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
@@ -611,6 +611,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb1: usb@3000000 {
@@ -620,6 +622,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb2: usb@3100000 {
@@ -629,6 +633,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		sata: sata@3200000 {

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/4] arm64: dts: ls1046a: Enable usb3-lpm-capable for usb3 node
@ 2018-01-05  9:40   ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

Enable USB3 HW LPM feature for ls1046a and active patch for
snps erratum A-010131. It will disable U1/U2 temperary when
initiate U3 request.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
index c115f17..07ca420 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
@@ -611,6 +611,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb1: usb at 3000000 {
@@ -620,6 +622,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		usb2: usb at 3100000 {
@@ -629,6 +633,8 @@
 			dr_mode = "host";
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,dis_rxdet_inp3_quirk;
+			usb3-lpm-capable;
+			snps,dis-u1u2-when-u3-quirk;
 		};
 
 		sata: sata at 3200000 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/4] xHCI: Handle dwc3 erratum on USB3 HW LPM feature.
  2018-01-05  9:40 ` [PATCH 1/4] " Ran Wang
  (?)
  (?)
@ 2018-01-05  9:40   ` Ran Wang
  -1 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Synopsys STARS ticket: 90000969472(A-010131)

Description: This erratum is applicable for the USB 3.0 Super
Speed host mode operation. When the U2 timer expires while in
U1 mode, the USB 3.0 controller completes a U1->U2 entry operation
lasting three mac3_clk (24 ns). If the xHCI driver issues a
U3 request during this operation, thecontroller drops this request.

Impact: The controller ignores the request when the xHCI driver
programs the U3 entry (PORTSC.PLS = U3).

Workaround:
1. Before initiating U3 entry, save PORTPMSC.
2. Disable U2 entry by programming PORTPMSC[U2 Timeout] = h'FF.
3. After U3 entry, re-enable the U2 timer by programming PORTPMSC
with the value saved in Step 1.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 drivers/usb/host/xhci-hub.c  |   22 ++++++++++++++++++++++
 drivers/usb/host/xhci-plat.c |    6 +++++-
 drivers/usb/host/xhci.h      |    1 +
 3 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index f070f94..a61185e 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -676,12 +676,34 @@ void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array,
 				int port_id, u32 link_state)
 {
 	u32 temp;
+	u32 portpmsc_u2_backup = 0;
+
+	/* Backup U2 timeout info before initiating U3 entry erratum A-010131 */
+	if (xhci->shared_hcd->speed >= HCD_USB3 &&
+			link_state == USB_SS_PORT_LS_U3 &&
+			(xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
+		portpmsc_u2_backup = readl(port_array[port_id] + PORTPMSC);
+		portpmsc_u2_backup &= PORT_U2_TIMEOUT_MASK;
+		temp = readl(port_array[port_id] + PORTPMSC);
+		temp |= PORT_U2_TIMEOUT_MASK;
+		writel(temp, port_array[port_id] + PORTPMSC);
+	}
 
 	temp = readl(port_array[port_id]);
 	temp = xhci_port_state_to_neutral(temp);
 	temp &= ~PORT_PLS_MASK;
 	temp |= PORT_LINK_STROBE | link_state;
 	writel(temp, port_array[port_id]);
+
+	/* Restore U2 timeout info after U3 entry complete */
+	if (xhci->shared_hcd->speed >= HCD_USB3 &&
+			link_state == USB_SS_PORT_LS_U3 &&
+			(xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
+		temp = readl(port_array[port_id] + PORTPMSC);
+		temp &= ~PORT_U2_TIMEOUT_MASK;
+		temp |= portpmsc_u2_backup;
+		writel(temp, port_array[port_id] + PORTPMSC);
+	}
 }
 
 static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci,
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 1969e56..616c56e 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -266,8 +266,12 @@ static int xhci_plat_probe(struct platform_device *pdev)
 	if (device_property_read_bool(sysdev, "usb2-lpm-disable"))
 		xhci->quirks |= XHCI_HW_LPM_DISABLE;
 
-	if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
+	if (device_property_read_bool(sysdev, "usb3-lpm-capable")) {
 		xhci->quirks |= XHCI_LPM_SUPPORT;
+		if (device_property_read_bool(sysdev,
+					"snps,dis-u1u2-when-u3-quirk"))
+			xhci->quirks |= XHCI_DIS_U1U2_WHEN_U3;
+	}
 
 	if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped"))
 		xhci->quirks |= XHCI_BROKEN_PORT_PED;
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index b966cd8..9704779 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1835,6 +1835,7 @@ struct xhci_hcd {
 /* Reserved. It was XHCI_U2_DISABLE_WAKE */
 #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL	(1 << 28)
 #define XHCI_HW_LPM_DISABLE	(1 << 29)
+#define XHCI_DIS_U1U2_WHEN_U3 (1 << 30)
 
 	unsigned int		num_active_eps;
 	unsigned int		limit_active_eps;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/4] xHCI: Handle dwc3 erratum on USB3 HW LPM feature.
@ 2018-01-05  9:40   ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Synopsys STARS ticket: 90000969472(A-010131)

Description: This erratum is applicable for the USB 3.0 Super
Speed host mode operation. When the U2 timer expires while in
U1 mode, the USB 3.0 controller completes a U1->U2 entry operation
lasting three mac3_clk (24 ns). If the xHCI driver issues a
U3 request during this operation, thecontroller drops this request.

Impact: The controller ignores the request when the xHCI driver
programs the U3 entry (PORTSC.PLS = U3).

Workaround:
1. Before initiating U3 entry, save PORTPMSC.
2. Disable U2 entry by programming PORTPMSC[U2 Timeout] = h'FF.
3. After U3 entry, re-enable the U2 timer by programming PORTPMSC
with the value saved in Step 1.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 drivers/usb/host/xhci-hub.c  |   22 ++++++++++++++++++++++
 drivers/usb/host/xhci-plat.c |    6 +++++-
 drivers/usb/host/xhci.h      |    1 +
 3 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index f070f94..a61185e 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -676,12 +676,34 @@ void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array,
 				int port_id, u32 link_state)
 {
 	u32 temp;
+	u32 portpmsc_u2_backup = 0;
+
+	/* Backup U2 timeout info before initiating U3 entry erratum A-010131 */
+	if (xhci->shared_hcd->speed >= HCD_USB3 &&
+			link_state == USB_SS_PORT_LS_U3 &&
+			(xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
+		portpmsc_u2_backup = readl(port_array[port_id] + PORTPMSC);
+		portpmsc_u2_backup &= PORT_U2_TIMEOUT_MASK;
+		temp = readl(port_array[port_id] + PORTPMSC);
+		temp |= PORT_U2_TIMEOUT_MASK;
+		writel(temp, port_array[port_id] + PORTPMSC);
+	}
 
 	temp = readl(port_array[port_id]);
 	temp = xhci_port_state_to_neutral(temp);
 	temp &= ~PORT_PLS_MASK;
 	temp |= PORT_LINK_STROBE | link_state;
 	writel(temp, port_array[port_id]);
+
+	/* Restore U2 timeout info after U3 entry complete */
+	if (xhci->shared_hcd->speed >= HCD_USB3 &&
+			link_state == USB_SS_PORT_LS_U3 &&
+			(xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
+		temp = readl(port_array[port_id] + PORTPMSC);
+		temp &= ~PORT_U2_TIMEOUT_MASK;
+		temp |= portpmsc_u2_backup;
+		writel(temp, port_array[port_id] + PORTPMSC);
+	}
 }
 
 static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci,
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 1969e56..616c56e 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -266,8 +266,12 @@ static int xhci_plat_probe(struct platform_device *pdev)
 	if (device_property_read_bool(sysdev, "usb2-lpm-disable"))
 		xhci->quirks |= XHCI_HW_LPM_DISABLE;
 
-	if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
+	if (device_property_read_bool(sysdev, "usb3-lpm-capable")) {
 		xhci->quirks |= XHCI_LPM_SUPPORT;
+		if (device_property_read_bool(sysdev,
+					"snps,dis-u1u2-when-u3-quirk"))
+			xhci->quirks |= XHCI_DIS_U1U2_WHEN_U3;
+	}
 
 	if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped"))
 		xhci->quirks |= XHCI_BROKEN_PORT_PED;
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index b966cd8..9704779 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1835,6 +1835,7 @@ struct xhci_hcd {
 /* Reserved. It was XHCI_U2_DISABLE_WAKE */
 #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL	(1 << 28)
 #define XHCI_HW_LPM_DISABLE	(1 << 29)
+#define XHCI_DIS_U1U2_WHEN_U3 (1 << 30)
 
 	unsigned int		num_active_eps;
 	unsigned int		limit_active_eps;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [4/4] xHCI: Handle dwc3 erratum on USB3 HW LPM feature.
@ 2018-01-05  9:40   ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman
  Cc: Shawn Guo, Felipe Balbi, Li Yang, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb, Ran Wang

Synopsys STARS ticket: 90000969472(A-010131)

Description: This erratum is applicable for the USB 3.0 Super
Speed host mode operation. When the U2 timer expires while in
U1 mode, the USB 3.0 controller completes a U1->U2 entry operation
lasting three mac3_clk (24 ns). If the xHCI driver issues a
U3 request during this operation, thecontroller drops this request.

Impact: The controller ignores the request when the xHCI driver
programs the U3 entry (PORTSC.PLS = U3).

Workaround:
1. Before initiating U3 entry, save PORTPMSC.
2. Disable U2 entry by programming PORTPMSC[U2 Timeout] = h'FF.
3. After U3 entry, re-enable the U2 timer by programming PORTPMSC
with the value saved in Step 1.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 drivers/usb/host/xhci-hub.c  |   22 ++++++++++++++++++++++
 drivers/usb/host/xhci-plat.c |    6 +++++-
 drivers/usb/host/xhci.h      |    1 +
 3 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index f070f94..a61185e 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -676,12 +676,34 @@ void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array,
 				int port_id, u32 link_state)
 {
 	u32 temp;
+	u32 portpmsc_u2_backup = 0;
+
+	/* Backup U2 timeout info before initiating U3 entry erratum A-010131 */
+	if (xhci->shared_hcd->speed >= HCD_USB3 &&
+			link_state == USB_SS_PORT_LS_U3 &&
+			(xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
+		portpmsc_u2_backup = readl(port_array[port_id] + PORTPMSC);
+		portpmsc_u2_backup &= PORT_U2_TIMEOUT_MASK;
+		temp = readl(port_array[port_id] + PORTPMSC);
+		temp |= PORT_U2_TIMEOUT_MASK;
+		writel(temp, port_array[port_id] + PORTPMSC);
+	}
 
 	temp = readl(port_array[port_id]);
 	temp = xhci_port_state_to_neutral(temp);
 	temp &= ~PORT_PLS_MASK;
 	temp |= PORT_LINK_STROBE | link_state;
 	writel(temp, port_array[port_id]);
+
+	/* Restore U2 timeout info after U3 entry complete */
+	if (xhci->shared_hcd->speed >= HCD_USB3 &&
+			link_state == USB_SS_PORT_LS_U3 &&
+			(xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
+		temp = readl(port_array[port_id] + PORTPMSC);
+		temp &= ~PORT_U2_TIMEOUT_MASK;
+		temp |= portpmsc_u2_backup;
+		writel(temp, port_array[port_id] + PORTPMSC);
+	}
 }
 
 static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci,
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 1969e56..616c56e 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -266,8 +266,12 @@ static int xhci_plat_probe(struct platform_device *pdev)
 	if (device_property_read_bool(sysdev, "usb2-lpm-disable"))
 		xhci->quirks |= XHCI_HW_LPM_DISABLE;
 
-	if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
+	if (device_property_read_bool(sysdev, "usb3-lpm-capable")) {
 		xhci->quirks |= XHCI_LPM_SUPPORT;
+		if (device_property_read_bool(sysdev,
+					"snps,dis-u1u2-when-u3-quirk"))
+			xhci->quirks |= XHCI_DIS_U1U2_WHEN_U3;
+	}
 
 	if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped"))
 		xhci->quirks |= XHCI_BROKEN_PORT_PED;
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index b966cd8..9704779 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1835,6 +1835,7 @@ struct xhci_hcd {
 /* Reserved. It was XHCI_U2_DISABLE_WAKE */
 #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL	(1 << 28)
 #define XHCI_HW_LPM_DISABLE	(1 << 29)
+#define XHCI_DIS_U1U2_WHEN_U3 (1 << 30)
 
 	unsigned int		num_active_eps;
 	unsigned int		limit_active_eps;

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/4] xHCI: Handle dwc3 erratum on USB3 HW LPM feature.
@ 2018-01-05  9:40   ` Ran Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Ran Wang @ 2018-01-05  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

Synopsys STARS ticket: 90000969472(A-010131)

Description: This erratum is applicable for the USB 3.0 Super
Speed host mode operation. When the U2 timer expires while in
U1 mode, the USB 3.0 controller completes a U1->U2 entry operation
lasting three mac3_clk (24 ns). If the xHCI driver issues a
U3 request during this operation, thecontroller drops this request.

Impact: The controller ignores the request when the xHCI driver
programs the U3 entry (PORTSC.PLS = U3).

Workaround:
1. Before initiating U3 entry, save PORTPMSC.
2. Disable U2 entry by programming PORTPMSC[U2 Timeout] = h'FF.
3. After U3 entry, re-enable the U2 timer by programming PORTPMSC
with the value saved in Step 1.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 drivers/usb/host/xhci-hub.c  |   22 ++++++++++++++++++++++
 drivers/usb/host/xhci-plat.c |    6 +++++-
 drivers/usb/host/xhci.h      |    1 +
 3 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index f070f94..a61185e 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -676,12 +676,34 @@ void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array,
 				int port_id, u32 link_state)
 {
 	u32 temp;
+	u32 portpmsc_u2_backup = 0;
+
+	/* Backup U2 timeout info before initiating U3 entry erratum A-010131 */
+	if (xhci->shared_hcd->speed >= HCD_USB3 &&
+			link_state == USB_SS_PORT_LS_U3 &&
+			(xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
+		portpmsc_u2_backup = readl(port_array[port_id] + PORTPMSC);
+		portpmsc_u2_backup &= PORT_U2_TIMEOUT_MASK;
+		temp = readl(port_array[port_id] + PORTPMSC);
+		temp |= PORT_U2_TIMEOUT_MASK;
+		writel(temp, port_array[port_id] + PORTPMSC);
+	}
 
 	temp = readl(port_array[port_id]);
 	temp = xhci_port_state_to_neutral(temp);
 	temp &= ~PORT_PLS_MASK;
 	temp |= PORT_LINK_STROBE | link_state;
 	writel(temp, port_array[port_id]);
+
+	/* Restore U2 timeout info after U3 entry complete */
+	if (xhci->shared_hcd->speed >= HCD_USB3 &&
+			link_state == USB_SS_PORT_LS_U3 &&
+			(xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
+		temp = readl(port_array[port_id] + PORTPMSC);
+		temp &= ~PORT_U2_TIMEOUT_MASK;
+		temp |= portpmsc_u2_backup;
+		writel(temp, port_array[port_id] + PORTPMSC);
+	}
 }
 
 static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci,
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 1969e56..616c56e 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -266,8 +266,12 @@ static int xhci_plat_probe(struct platform_device *pdev)
 	if (device_property_read_bool(sysdev, "usb2-lpm-disable"))
 		xhci->quirks |= XHCI_HW_LPM_DISABLE;
 
-	if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
+	if (device_property_read_bool(sysdev, "usb3-lpm-capable")) {
 		xhci->quirks |= XHCI_LPM_SUPPORT;
+		if (device_property_read_bool(sysdev,
+					"snps,dis-u1u2-when-u3-quirk"))
+			xhci->quirks |= XHCI_DIS_U1U2_WHEN_U3;
+	}
 
 	if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped"))
 		xhci->quirks |= XHCI_BROKEN_PORT_PED;
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index b966cd8..9704779 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1835,6 +1835,7 @@ struct xhci_hcd {
 /* Reserved. It was XHCI_U2_DISABLE_WAKE */
 #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL	(1 << 28)
 #define XHCI_HW_LPM_DISABLE	(1 << 29)
+#define XHCI_DIS_U1U2_WHEN_U3 (1 << 30)
 
 	unsigned int		num_active_eps;
 	unsigned int		limit_active_eps;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] xHCI: Handle dwc3 erratum on USB3 HW LPM feature.
  2018-01-05  9:40   ` [PATCH 4/4] " Ran Wang
  (?)
@ 2019-05-23 21:43     ` Li Yang
  -1 siblings, 0 replies; 19+ messages in thread
From: Li Yang @ 2019-05-23 21:43 UTC (permalink / raw)
  To: Ran Wang
  Cc: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman, Shawn Guo,
	Felipe Balbi,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE, lkml,
	linux-usb

On Fri, Jan 5, 2018 at 4:00 AM Ran Wang <ran.wang_1@nxp.com> wrote:
>
> Synopsys STARS ticket: 90000969472(A-010131)
>
> Description: This erratum is applicable for the USB 3.0 Super
> Speed host mode operation. When the U2 timer expires while in
> U1 mode, the USB 3.0 controller completes a U1->U2 entry operation
> lasting three mac3_clk (24 ns). If the xHCI driver issues a
> U3 request during this operation, thecontroller drops this request.
>
> Impact: The controller ignores the request when the xHCI driver
> programs the U3 entry (PORTSC.PLS = U3).
>
> Workaround:
> 1. Before initiating U3 entry, save PORTPMSC.
> 2. Disable U2 entry by programming PORTPMSC[U2 Timeout] = h'FF.
> 3. After U3 entry, re-enable the U2 timer by programming PORTPMSC
> with the value saved in Step 1.

Hi Mathias,

Could you help to review this patch?

Hi Ran,

Since this is an dwc3 related hardware issue, can it be addressed in
the dwc3 layer instead of in the common xhci layer?

>
> Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> ---
>  drivers/usb/host/xhci-hub.c  |   22 ++++++++++++++++++++++
>  drivers/usb/host/xhci-plat.c |    6 +++++-
>  drivers/usb/host/xhci.h      |    1 +
>  3 files changed, 28 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
> index f070f94..a61185e 100644
> --- a/drivers/usb/host/xhci-hub.c
> +++ b/drivers/usb/host/xhci-hub.c
> @@ -676,12 +676,34 @@ void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array,
>                                 int port_id, u32 link_state)
>  {
>         u32 temp;
> +       u32 portpmsc_u2_backup = 0;
> +
> +       /* Backup U2 timeout info before initiating U3 entry erratum A-010131 */
> +       if (xhci->shared_hcd->speed >= HCD_USB3 &&
> +                       link_state == USB_SS_PORT_LS_U3 &&
> +                       (xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
> +               portpmsc_u2_backup = readl(port_array[port_id] + PORTPMSC);
> +               portpmsc_u2_backup &= PORT_U2_TIMEOUT_MASK;
> +               temp = readl(port_array[port_id] + PORTPMSC);
> +               temp |= PORT_U2_TIMEOUT_MASK;
> +               writel(temp, port_array[port_id] + PORTPMSC);
> +       }
>
>         temp = readl(port_array[port_id]);
>         temp = xhci_port_state_to_neutral(temp);
>         temp &= ~PORT_PLS_MASK;
>         temp |= PORT_LINK_STROBE | link_state;
>         writel(temp, port_array[port_id]);
> +
> +       /* Restore U2 timeout info after U3 entry complete */
> +       if (xhci->shared_hcd->speed >= HCD_USB3 &&
> +                       link_state == USB_SS_PORT_LS_U3 &&
> +                       (xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
> +               temp = readl(port_array[port_id] + PORTPMSC);
> +               temp &= ~PORT_U2_TIMEOUT_MASK;
> +               temp |= portpmsc_u2_backup;
> +               writel(temp, port_array[port_id] + PORTPMSC);
> +       }
>  }
>
>  static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci,
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 1969e56..616c56e 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -266,8 +266,12 @@ static int xhci_plat_probe(struct platform_device *pdev)
>         if (device_property_read_bool(sysdev, "usb2-lpm-disable"))
>                 xhci->quirks |= XHCI_HW_LPM_DISABLE;
>
> -       if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
> +       if (device_property_read_bool(sysdev, "usb3-lpm-capable")) {
>                 xhci->quirks |= XHCI_LPM_SUPPORT;
> +               if (device_property_read_bool(sysdev,
> +                                       "snps,dis-u1u2-when-u3-quirk"))
> +                       xhci->quirks |= XHCI_DIS_U1U2_WHEN_U3;
> +       }
>
>         if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped"))
>                 xhci->quirks |= XHCI_BROKEN_PORT_PED;
> diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> index b966cd8..9704779 100644
> --- a/drivers/usb/host/xhci.h
> +++ b/drivers/usb/host/xhci.h
> @@ -1835,6 +1835,7 @@ struct xhci_hcd {
>  /* Reserved. It was XHCI_U2_DISABLE_WAKE */
>  #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL        (1 << 28)
>  #define XHCI_HW_LPM_DISABLE    (1 << 29)
> +#define XHCI_DIS_U1U2_WHEN_U3 (1 << 30)
>
>         unsigned int            num_active_eps;
>         unsigned int            limit_active_eps;
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] xHCI: Handle dwc3 erratum on USB3 HW LPM feature.
@ 2019-05-23 21:43     ` Li Yang
  0 siblings, 0 replies; 19+ messages in thread
From: Li Yang @ 2019-05-23 21:43 UTC (permalink / raw)
  To: Ran Wang
  Cc: Rob Herring, Mark Rutland, Russell King, Catalin Marinas,
	Will Deacon, Mathias Nyman, Greg Kroah-Hartman, Shawn Guo,
	Felipe Balbi,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE, lkml,
	linux-usb

On Fri, Jan 5, 2018 at 4:00 AM Ran Wang <ran.wang_1@nxp.com> wrote:
>
> Synopsys STARS ticket: 90000969472(A-010131)
>
> Description: This erratum is applicable for the USB 3.0 Super
> Speed host mode operation. When the U2 timer expires while in
> U1 mode, the USB 3.0 controller completes a U1->U2 entry operation
> lasting three mac3_clk (24 ns). If the xHCI driver issues a
> U3 request during this operation, thecontroller drops this request.
>
> Impact: The controller ignores the request when the xHCI driver
> programs the U3 entry (PORTSC.PLS = U3).
>
> Workaround:
> 1. Before initiating U3 entry, save PORTPMSC.
> 2. Disable U2 entry by programming PORTPMSC[U2 Timeout] = h'FF.
> 3. After U3 entry, re-enable the U2 timer by programming PORTPMSC
> with the value saved in Step 1.

Hi Mathias,

Could you help to review this patch?

Hi Ran,

Since this is an dwc3 related hardware issue, can it be addressed in
the dwc3 layer instead of in the common xhci layer?

>
> Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> ---
>  drivers/usb/host/xhci-hub.c  |   22 ++++++++++++++++++++++
>  drivers/usb/host/xhci-plat.c |    6 +++++-
>  drivers/usb/host/xhci.h      |    1 +
>  3 files changed, 28 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
> index f070f94..a61185e 100644
> --- a/drivers/usb/host/xhci-hub.c
> +++ b/drivers/usb/host/xhci-hub.c
> @@ -676,12 +676,34 @@ void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array,
>                                 int port_id, u32 link_state)
>  {
>         u32 temp;
> +       u32 portpmsc_u2_backup = 0;
> +
> +       /* Backup U2 timeout info before initiating U3 entry erratum A-010131 */
> +       if (xhci->shared_hcd->speed >= HCD_USB3 &&
> +                       link_state == USB_SS_PORT_LS_U3 &&
> +                       (xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
> +               portpmsc_u2_backup = readl(port_array[port_id] + PORTPMSC);
> +               portpmsc_u2_backup &= PORT_U2_TIMEOUT_MASK;
> +               temp = readl(port_array[port_id] + PORTPMSC);
> +               temp |= PORT_U2_TIMEOUT_MASK;
> +               writel(temp, port_array[port_id] + PORTPMSC);
> +       }
>
>         temp = readl(port_array[port_id]);
>         temp = xhci_port_state_to_neutral(temp);
>         temp &= ~PORT_PLS_MASK;
>         temp |= PORT_LINK_STROBE | link_state;
>         writel(temp, port_array[port_id]);
> +
> +       /* Restore U2 timeout info after U3 entry complete */
> +       if (xhci->shared_hcd->speed >= HCD_USB3 &&
> +                       link_state == USB_SS_PORT_LS_U3 &&
> +                       (xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
> +               temp = readl(port_array[port_id] + PORTPMSC);
> +               temp &= ~PORT_U2_TIMEOUT_MASK;
> +               temp |= portpmsc_u2_backup;
> +               writel(temp, port_array[port_id] + PORTPMSC);
> +       }
>  }
>
>  static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci,
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 1969e56..616c56e 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -266,8 +266,12 @@ static int xhci_plat_probe(struct platform_device *pdev)
>         if (device_property_read_bool(sysdev, "usb2-lpm-disable"))
>                 xhci->quirks |= XHCI_HW_LPM_DISABLE;
>
> -       if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
> +       if (device_property_read_bool(sysdev, "usb3-lpm-capable")) {
>                 xhci->quirks |= XHCI_LPM_SUPPORT;
> +               if (device_property_read_bool(sysdev,
> +                                       "snps,dis-u1u2-when-u3-quirk"))
> +                       xhci->quirks |= XHCI_DIS_U1U2_WHEN_U3;
> +       }
>
>         if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped"))
>                 xhci->quirks |= XHCI_BROKEN_PORT_PED;
> diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> index b966cd8..9704779 100644
> --- a/drivers/usb/host/xhci.h
> +++ b/drivers/usb/host/xhci.h
> @@ -1835,6 +1835,7 @@ struct xhci_hcd {
>  /* Reserved. It was XHCI_U2_DISABLE_WAKE */
>  #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL        (1 << 28)
>  #define XHCI_HW_LPM_DISABLE    (1 << 29)
> +#define XHCI_DIS_U1U2_WHEN_U3 (1 << 30)
>
>         unsigned int            num_active_eps;
>         unsigned int            limit_active_eps;
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] xHCI: Handle dwc3 erratum on USB3 HW LPM feature.
@ 2019-05-23 21:43     ` Li Yang
  0 siblings, 0 replies; 19+ messages in thread
From: Li Yang @ 2019-05-23 21:43 UTC (permalink / raw)
  To: Ran Wang
  Cc: Mark Rutland, Felipe Balbi, Mathias Nyman,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Catalin Marinas, linux-usb, Will Deacon, Russell King, lkml,
	Rob Herring, Greg Kroah-Hartman, Shawn Guo,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Fri, Jan 5, 2018 at 4:00 AM Ran Wang <ran.wang_1@nxp.com> wrote:
>
> Synopsys STARS ticket: 90000969472(A-010131)
>
> Description: This erratum is applicable for the USB 3.0 Super
> Speed host mode operation. When the U2 timer expires while in
> U1 mode, the USB 3.0 controller completes a U1->U2 entry operation
> lasting three mac3_clk (24 ns). If the xHCI driver issues a
> U3 request during this operation, thecontroller drops this request.
>
> Impact: The controller ignores the request when the xHCI driver
> programs the U3 entry (PORTSC.PLS = U3).
>
> Workaround:
> 1. Before initiating U3 entry, save PORTPMSC.
> 2. Disable U2 entry by programming PORTPMSC[U2 Timeout] = h'FF.
> 3. After U3 entry, re-enable the U2 timer by programming PORTPMSC
> with the value saved in Step 1.

Hi Mathias,

Could you help to review this patch?

Hi Ran,

Since this is an dwc3 related hardware issue, can it be addressed in
the dwc3 layer instead of in the common xhci layer?

>
> Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> ---
>  drivers/usb/host/xhci-hub.c  |   22 ++++++++++++++++++++++
>  drivers/usb/host/xhci-plat.c |    6 +++++-
>  drivers/usb/host/xhci.h      |    1 +
>  3 files changed, 28 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
> index f070f94..a61185e 100644
> --- a/drivers/usb/host/xhci-hub.c
> +++ b/drivers/usb/host/xhci-hub.c
> @@ -676,12 +676,34 @@ void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array,
>                                 int port_id, u32 link_state)
>  {
>         u32 temp;
> +       u32 portpmsc_u2_backup = 0;
> +
> +       /* Backup U2 timeout info before initiating U3 entry erratum A-010131 */
> +       if (xhci->shared_hcd->speed >= HCD_USB3 &&
> +                       link_state == USB_SS_PORT_LS_U3 &&
> +                       (xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
> +               portpmsc_u2_backup = readl(port_array[port_id] + PORTPMSC);
> +               portpmsc_u2_backup &= PORT_U2_TIMEOUT_MASK;
> +               temp = readl(port_array[port_id] + PORTPMSC);
> +               temp |= PORT_U2_TIMEOUT_MASK;
> +               writel(temp, port_array[port_id] + PORTPMSC);
> +       }
>
>         temp = readl(port_array[port_id]);
>         temp = xhci_port_state_to_neutral(temp);
>         temp &= ~PORT_PLS_MASK;
>         temp |= PORT_LINK_STROBE | link_state;
>         writel(temp, port_array[port_id]);
> +
> +       /* Restore U2 timeout info after U3 entry complete */
> +       if (xhci->shared_hcd->speed >= HCD_USB3 &&
> +                       link_state == USB_SS_PORT_LS_U3 &&
> +                       (xhci->quirks & XHCI_DIS_U1U2_WHEN_U3)) {
> +               temp = readl(port_array[port_id] + PORTPMSC);
> +               temp &= ~PORT_U2_TIMEOUT_MASK;
> +               temp |= portpmsc_u2_backup;
> +               writel(temp, port_array[port_id] + PORTPMSC);
> +       }
>  }
>
>  static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci,
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 1969e56..616c56e 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -266,8 +266,12 @@ static int xhci_plat_probe(struct platform_device *pdev)
>         if (device_property_read_bool(sysdev, "usb2-lpm-disable"))
>                 xhci->quirks |= XHCI_HW_LPM_DISABLE;
>
> -       if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
> +       if (device_property_read_bool(sysdev, "usb3-lpm-capable")) {
>                 xhci->quirks |= XHCI_LPM_SUPPORT;
> +               if (device_property_read_bool(sysdev,
> +                                       "snps,dis-u1u2-when-u3-quirk"))
> +                       xhci->quirks |= XHCI_DIS_U1U2_WHEN_U3;
> +       }
>
>         if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped"))
>                 xhci->quirks |= XHCI_BROKEN_PORT_PED;
> diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> index b966cd8..9704779 100644
> --- a/drivers/usb/host/xhci.h
> +++ b/drivers/usb/host/xhci.h
> @@ -1835,6 +1835,7 @@ struct xhci_hcd {
>  /* Reserved. It was XHCI_U2_DISABLE_WAKE */
>  #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL        (1 << 28)
>  #define XHCI_HW_LPM_DISABLE    (1 << 29)
> +#define XHCI_DIS_U1U2_WHEN_U3 (1 << 30)
>
>         unsigned int            num_active_eps;
>         unsigned int            limit_active_eps;
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-05-23 21:44 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-05  9:40 [PATCH 1/4] arm: dts: ls1021a: Enable usb3-lpm-capable for usb3 node Ran Wang
2018-01-05  9:40 ` Ran Wang
2018-01-05  9:40 ` [1/4] " Ran Wang
2018-01-05  9:40 ` [PATCH 1/4] " Ran Wang
2018-01-05  9:40 ` [PATCH 2/4] arm64: dts: ls1043a: " Ran Wang
2018-01-05  9:40   ` Ran Wang
2018-01-05  9:40   ` [2/4] " Ran Wang
2018-01-05  9:40   ` [PATCH 2/4] " Ran Wang
2018-01-05  9:40 ` [PATCH 3/4] arm64: dts: ls1046a: " Ran Wang
2018-01-05  9:40   ` Ran Wang
2018-01-05  9:40   ` [3/4] " Ran Wang
2018-01-05  9:40   ` [PATCH 3/4] " Ran Wang
2018-01-05  9:40 ` [PATCH 4/4] xHCI: Handle dwc3 erratum on USB3 HW LPM feature Ran Wang
2018-01-05  9:40   ` Ran Wang
2018-01-05  9:40   ` [4/4] " Ran Wang
2018-01-05  9:40   ` [PATCH 4/4] " Ran Wang
2019-05-23 21:43   ` Li Yang
2019-05-23 21:43     ` Li Yang
2019-05-23 21:43     ` Li Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.