kernel: bump 4.14 to 4.14.223
[openwrt/openwrt.git] / target / linux / layerscape / patches-4.14 / 807-usb-support-layerscape.patch
index ab43bc49fcc2f40ea944c77d3cff96618fc556a8..89390320e9846b48bbde8fb32b461635464fcea0 100644 (file)
@@ -323,7 +323,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
        usb_phy_set_suspend(dwc->usb2_phy, 0);
        usb_phy_set_suspend(dwc->usb3_phy, 0);
        ret = phy_power_on(dwc->usb2_generic_phy);
-@@ -870,6 +1006,22 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -873,6 +1009,22 @@ static int dwc3_core_init(struct dwc3 *d
                dwc3_writel(dwc->regs, DWC3_GUCTL1, reg);
        }
  
@@ -346,7 +346,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
        return 0;
  
  err4:
-@@ -1073,6 +1225,8 @@ static void dwc3_get_properties(struct d
+@@ -1079,6 +1231,8 @@ static void dwc3_get_properties(struct d
                                &hird_threshold);
        dwc->usb3_lpm_capable = device_property_read_bool(dev,
                                "snps,usb3_lpm_capable");
@@ -355,9 +355,9 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
  
        dwc->disable_scramble_quirk = device_property_read_bool(dev,
                                "snps,disable_scramble_quirk");
-@@ -1105,8 +1259,16 @@ static void dwc3_get_properties(struct d
-       dwc->dis_tx_ipgap_linecheck_quirk = device_property_read_bool(dev,
-                               "snps,dis-tx-ipgap-linecheck-quirk");
+@@ -1113,8 +1267,16 @@ static void dwc3_get_properties(struct d
+       dwc->parkmode_disable_ss_quirk = device_property_read_bool(dev,
+                               "snps,parkmode-disable-ss-quirk");
  
 +      dwc->quirk_reverse_in_out = device_property_read_bool(dev,
 +                              "snps,quirk_reverse_in_out");
@@ -372,7 +372,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
        device_property_read_u8(dev, "snps,tx_de_emphasis",
                                &tx_de_emphasis);
        device_property_read_string(dev, "snps,hsphy_interface",
-@@ -1117,6 +1279,9 @@ static void dwc3_get_properties(struct d
+@@ -1125,6 +1287,9 @@ static void dwc3_get_properties(struct d
        dwc->dis_metastability_quirk = device_property_read_bool(dev,
                                "snps,dis_metastability_quirk");
  
@@ -382,7 +382,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
        dwc->lpm_nyet_threshold = lpm_nyet_threshold;
        dwc->tx_de_emphasis = tx_de_emphasis;
  
-@@ -1367,12 +1532,14 @@ static int dwc3_resume_common(struct dwc
+@@ -1387,12 +1552,14 @@ static int dwc3_resume_common(struct dwc
  
        switch (dwc->dr_mode) {
        case USB_DR_MODE_PERIPHERAL:
@@ -440,9 +440,9 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
 +#define DWC3_GUCTL_HSTINAUTORETRY     BIT(14)
 +
  /* Global User Control 1 Register */
+ #define DWC3_GUCTL1_PARKMODE_DISABLE_SS       BIT(17)
  #define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS    BIT(28)
- #define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24)
-@@ -477,6 +506,14 @@
+@@ -479,6 +508,14 @@
  #define DWC3_DEV_IMOD_INTERVAL_SHIFT  0
  #define DWC3_DEV_IMOD_INTERVAL_MASK   (0xffff << 0)
  
@@ -457,7 +457,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
  /* Structures */
  
  struct dwc3_trb;
-@@ -788,6 +825,7 @@ struct dwc3_scratchpad_array {
+@@ -790,6 +827,7 @@ struct dwc3_scratchpad_array {
   * @regs: base address for our registers
   * @regs_size: address space size
   * @fladj: frame length adjustment
@@ -465,7 +465,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
   * @irq_gadget: peripheral controller's IRQ number
   * @nr_scratch: number of scratch buffers
   * @u1u2: only used on revisions <1.83a for workaround
-@@ -843,6 +881,7 @@ struct dwc3_scratchpad_array {
+@@ -845,6 +883,7 @@ struct dwc3_scratchpad_array {
   * @setup_packet_pending: true when there's a Setup Packet in FIFO. Workaround
   * @three_stage_setup: set if we perform a three phase setup
   * @usb3_lpm_capable: set if hadrware supports Link Power Management
@@ -473,7 +473,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
   * @disable_scramble_quirk: set if we enable the disable scramble quirk
   * @u2exit_lfps_quirk: set if we enable u2exit lfps quirk
   * @u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk
-@@ -922,6 +961,12 @@ struct dwc3 {
+@@ -926,6 +965,12 @@ struct dwc3 {
        enum usb_phy_interface  hsphy_mode;
  
        u32                     fladj;
@@ -486,7 +486,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
        u32                     irq_gadget;
        u32                     nr_scratch;
        u32                     u1u2;
-@@ -1006,6 +1051,7 @@ struct dwc3 {
+@@ -1010,6 +1055,7 @@ struct dwc3 {
        unsigned                setup_packet_pending:1;
        unsigned                three_stage_setup:1;
        unsigned                usb3_lpm_capable:1;
@@ -494,7 +494,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
  
        unsigned                disable_scramble_quirk:1;
        unsigned                u2exit_lfps_quirk:1;
-@@ -1025,6 +1071,11 @@ struct dwc3 {
+@@ -1030,6 +1076,11 @@ struct dwc3 {
  
        unsigned                tx_de_emphasis_quirk:1;
        unsigned                tx_de_emphasis:2;
@@ -528,7 +528,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
                reg &= ~DWC3_DCTL_INITU2ENA;
 --- a/drivers/usb/dwc3/gadget.c
 +++ b/drivers/usb/dwc3/gadget.c
-@@ -3220,6 +3220,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3231,6 +3231,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
  {
        int ret;
        int irq;
@@ -536,7 +536,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
  
        irq = dwc3_gadget_get_irq(dwc);
        if (irq < 0) {
-@@ -3299,6 +3300,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3309,6 +3310,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
  
        dwc3_gadget_set_speed(&dwc->gadget, dwc->maximum_speed);
  
@@ -1183,7 +1183,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
  #endif                                /* _EHCI_FSL_H */
 --- a/drivers/usb/host/ehci-hub.c
 +++ b/drivers/usb/host/ehci-hub.c
-@@ -305,6 +305,8 @@ static int ehci_bus_suspend (struct usb_
+@@ -304,6 +304,8 @@ static int ehci_bus_suspend (struct usb_
                                                USB_PORT_STAT_HIGH_SPEED)
                                fs_idle_delay = true;
                        ehci_writel(ehci, t2, reg);
@@ -1206,7 +1206,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
        struct list_head        cached_itd_list;
 --- a/drivers/usb/host/fsl-mph-dr-of.c
 +++ b/drivers/usb/host/fsl-mph-dr-of.c
-@@ -229,6 +229,17 @@ static int fsl_usb2_mph_dr_of_probe(stru
+@@ -232,6 +232,17 @@ static int fsl_usb2_mph_dr_of_probe(stru
        pdata->has_fsl_erratum_a005697 =
                of_property_read_bool(np, "fsl,usb_erratum-a005697");
  
@@ -1289,7 +1289,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
                xhci->quirks |= XHCI_BROKEN_PORT_PED;
 --- a/drivers/usb/host/xhci-ring.c
 +++ b/drivers/usb/host/xhci-ring.c
-@@ -1976,10 +1976,12 @@ static int finish_td(struct xhci_hcd *xh
+@@ -1983,10 +1983,12 @@ static int finish_td(struct xhci_hcd *xh
        union xhci_trb *ep_trb, struct xhci_transfer_event *event,
        struct xhci_virt_ep *ep, int *status)
  {
@@ -1302,7 +1302,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
        u32 trb_comp_code;
        int ep_index;
  
-@@ -2002,14 +2004,30 @@ static int finish_td(struct xhci_hcd *xh
+@@ -2009,14 +2011,30 @@ static int finish_td(struct xhci_hcd *xh
        if (trb_comp_code == COMP_STALL_ERROR ||
                xhci_requires_manual_halt_cleanup(xhci, ep_ctx,
                                                trb_comp_code)) {
@@ -1340,7 +1340,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
                while (ep_ring->dequeue != td->last_trb)
 --- a/drivers/usb/host/xhci.c
 +++ b/drivers/usb/host/xhci.c
-@@ -1607,13 +1607,38 @@ static int xhci_urb_dequeue(struct usb_h
+@@ -1605,13 +1605,38 @@ static int xhci_urb_dequeue(struct usb_h
                        ret = -ENOMEM;
                        goto done;
                }