diff options
author | Huang Rui <ray.huang@amd.com> | 2014-10-28 07:54:30 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-11-03 11:03:37 -0500 |
commit | a2a1d0f5838d6aa0d1306ef9bb1011f501faa695 (patch) | |
tree | 252fdd65bb448aa55edb1d75d257335f38714e29 /drivers/usb/dwc3 | |
parent | df31f5b3a6d3ef0bb692edff13167e9a1c5aa25e (diff) |
usb: dwc3: add delay p1p2p3 quirk
This patch adds delay P0 to P1/P2/P3 quirk for U2/U2/U3, and some special
platforms can configure that if it is needed.
[ balbi@ti.com : added DeviceTree binding documentation ]
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r-- | drivers/usb/dwc3/core.c | 6 | ||||
-rw-r--r-- | drivers/usb/dwc3/core.h | 5 | ||||
-rw-r--r-- | drivers/usb/dwc3/platform_data.h | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 600d3bc8d04d..c07651484c60 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c | |||
@@ -380,6 +380,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc) | |||
380 | if (dwc->req_p1p2p3_quirk) | 380 | if (dwc->req_p1p2p3_quirk) |
381 | reg |= DWC3_GUSB3PIPECTL_REQP1P2P3; | 381 | reg |= DWC3_GUSB3PIPECTL_REQP1P2P3; |
382 | 382 | ||
383 | if (dwc->del_p1p2p3_quirk) | ||
384 | reg |= DWC3_GUSB3PIPECTL_DEP1P2P3_EN; | ||
385 | |||
383 | dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); | 386 | dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); |
384 | 387 | ||
385 | mdelay(100); | 388 | mdelay(100); |
@@ -761,6 +764,8 @@ static int dwc3_probe(struct platform_device *pdev) | |||
761 | "snps,u2ss_inp3_quirk"); | 764 | "snps,u2ss_inp3_quirk"); |
762 | dwc->req_p1p2p3_quirk = of_property_read_bool(node, | 765 | dwc->req_p1p2p3_quirk = of_property_read_bool(node, |
763 | "snps,req_p1p2p3_quirk"); | 766 | "snps,req_p1p2p3_quirk"); |
767 | dwc->del_p1p2p3_quirk = of_property_read_bool(node, | ||
768 | "snps,del_p1p2p3_quirk"); | ||
764 | } else if (pdata) { | 769 | } else if (pdata) { |
765 | dwc->maximum_speed = pdata->maximum_speed; | 770 | dwc->maximum_speed = pdata->maximum_speed; |
766 | dwc->has_lpm_erratum = pdata->has_lpm_erratum; | 771 | dwc->has_lpm_erratum = pdata->has_lpm_erratum; |
@@ -774,6 +779,7 @@ static int dwc3_probe(struct platform_device *pdev) | |||
774 | dwc->u2exit_lfps_quirk = pdata->u2exit_lfps_quirk; | 779 | dwc->u2exit_lfps_quirk = pdata->u2exit_lfps_quirk; |
775 | dwc->u2ss_inp3_quirk = pdata->u2ss_inp3_quirk; | 780 | dwc->u2ss_inp3_quirk = pdata->u2ss_inp3_quirk; |
776 | dwc->req_p1p2p3_quirk = pdata->req_p1p2p3_quirk; | 781 | dwc->req_p1p2p3_quirk = pdata->req_p1p2p3_quirk; |
782 | dwc->del_p1p2p3_quirk = pdata->del_p1p2p3_quirk; | ||
777 | } | 783 | } |
778 | 784 | ||
779 | /* default to superspeed if no maximum_speed passed */ | 785 | /* default to superspeed if no maximum_speed passed */ |
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index ce331630fad9..b8fbc4a1ee4a 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h | |||
@@ -178,6 +178,9 @@ | |||
178 | #define DWC3_GUSB3PIPECTL_PHYSOFTRST (1 << 31) | 178 | #define DWC3_GUSB3PIPECTL_PHYSOFTRST (1 << 31) |
179 | #define DWC3_GUSB3PIPECTL_U2SSINP3OK (1 << 29) | 179 | #define DWC3_GUSB3PIPECTL_U2SSINP3OK (1 << 29) |
180 | #define DWC3_GUSB3PIPECTL_REQP1P2P3 (1 << 24) | 180 | #define DWC3_GUSB3PIPECTL_REQP1P2P3 (1 << 24) |
181 | #define DWC3_GUSB3PIPECTL_DEP1P2P3(n) ((n) << 19) | ||
182 | #define DWC3_GUSB3PIPECTL_DEP1P2P3_MASK DWC3_GUSB3PIPECTL_DEP1P2P3(7) | ||
183 | #define DWC3_GUSB3PIPECTL_DEP1P2P3_EN DWC3_GUSB3PIPECTL_DEP1P2P3(1) | ||
181 | #define DWC3_GUSB3PIPECTL_SUSPHY (1 << 17) | 184 | #define DWC3_GUSB3PIPECTL_SUSPHY (1 << 17) |
182 | 185 | ||
183 | /* Global TX Fifo Size Register */ | 186 | /* Global TX Fifo Size Register */ |
@@ -685,6 +688,7 @@ struct dwc3_scratchpad_array { | |||
685 | * @u2exit_lfps_quirk: set if we enable u2exit lfps quirk | 688 | * @u2exit_lfps_quirk: set if we enable u2exit lfps quirk |
686 | * @u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk | 689 | * @u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk |
687 | * @req_p1p2p3_quirk: set if we enable request p1p2p3 quirk | 690 | * @req_p1p2p3_quirk: set if we enable request p1p2p3 quirk |
691 | * @del_p1p2p3_quirk: set if we enable delay p1p2p3 quirk | ||
688 | */ | 692 | */ |
689 | struct dwc3 { | 693 | struct dwc3 { |
690 | struct usb_ctrlrequest *ctrl_req; | 694 | struct usb_ctrlrequest *ctrl_req; |
@@ -796,6 +800,7 @@ struct dwc3 { | |||
796 | unsigned u2exit_lfps_quirk:1; | 800 | unsigned u2exit_lfps_quirk:1; |
797 | unsigned u2ss_inp3_quirk:1; | 801 | unsigned u2ss_inp3_quirk:1; |
798 | unsigned req_p1p2p3_quirk:1; | 802 | unsigned req_p1p2p3_quirk:1; |
803 | unsigned del_p1p2p3_quirk:1; | ||
799 | }; | 804 | }; |
800 | 805 | ||
801 | /* -------------------------------------------------------------------------- */ | 806 | /* -------------------------------------------------------------------------- */ |
diff --git a/drivers/usb/dwc3/platform_data.h b/drivers/usb/dwc3/platform_data.h index d3e6ec210ef3..a421cecd6c16 100644 --- a/drivers/usb/dwc3/platform_data.h +++ b/drivers/usb/dwc3/platform_data.h | |||
@@ -32,4 +32,5 @@ struct dwc3_platform_data { | |||
32 | unsigned u2exit_lfps_quirk:1; | 32 | unsigned u2exit_lfps_quirk:1; |
33 | unsigned u2ss_inp3_quirk:1; | 33 | unsigned u2ss_inp3_quirk:1; |
34 | unsigned req_p1p2p3_quirk:1; | 34 | unsigned req_p1p2p3_quirk:1; |
35 | unsigned del_p1p2p3_quirk:1; | ||
35 | }; | 36 | }; |