1 From d408e9c29dd580cb94e39da2b0eef81061d22061 Mon Sep 17 00:00:00 2001
2 From: Ran Wang <ran.wang_1@nxp.com>
3 Date: Thu, 19 Dec 2019 17:02:36 +0800
4 Subject: [PATCH] LF-387-1 Revert "usb: dwc3: Add cache type configuration
7 This reverts commit ebceaf435cc96892d22b334b2a6517374c0d6a6e.
8 Will use next version patch to replace this.
10 Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
12 drivers/usb/dwc3/core.c | 61 +++++--------------------------------------------
13 drivers/usb/dwc3/core.h | 15 ------------
14 2 files changed, 6 insertions(+), 70 deletions(-)
16 --- a/drivers/usb/dwc3/core.c
17 +++ b/drivers/usb/dwc3/core.c
18 @@ -913,54 +913,6 @@ static void dwc3_set_power_down_clk_scal
19 dwc3_writel(dwc->regs, DWC3_GCTL, reg);
23 -struct dwc3_cache_type {
24 - u8 transfer_type_datard;
25 - u8 transfer_type_descrd;
26 - u8 transfer_type_datawr;
27 - u8 transfer_type_descwr;
30 -static const struct dwc3_cache_type layerscape_dwc3_cache_type = {
31 - .transfer_type_datard = 2,
32 - .transfer_type_descrd = 2,
33 - .transfer_type_datawr = 2,
34 - .transfer_type_descwr = 2,
38 - * dwc3_set_cache_type - Configure cache type registers
39 - * @dwc: Pointer to our controller context structure
41 -static void dwc3_set_cache_type(struct dwc3 *dwc)
44 - const struct dwc3_cache_type *cache_type =
45 - device_get_match_data(dwc->dev);
48 - reg = dwc3_readl(dwc->regs, DWC3_GSBUSCFG0);
51 - reg &= ~DWC3_GSBUSCFG0_DATARD(~0);
52 - reg |= DWC3_GSBUSCFG0_DATARD(cache_type->transfer_type_datard);
54 - reg &= ~DWC3_GSBUSCFG0_DESCRD(~0);
55 - reg |= DWC3_GSBUSCFG0_DESCRD(cache_type->transfer_type_descrd);
57 - reg &= ~DWC3_GSBUSCFG0_DATAWR(~0);
58 - reg |= DWC3_GSBUSCFG0_DATAWR(cache_type->transfer_type_datawr);
60 - reg &= ~DWC3_GSBUSCFG0_DESCWR(~0);
61 - reg |= DWC3_GSBUSCFG0_DESCWR(cache_type->transfer_type_descwr);
64 - dwc3_writel(dwc->regs, DWC3_GSBUSCFG0, reg);
71 * dwc3_core_init - Low-level initialization of DWC3 Core
72 * @dwc: Pointer to our controller context structure
73 @@ -1021,10 +973,6 @@ static int dwc3_core_init(struct dwc3 *d
75 dwc3_set_incr_burst_type(dwc);
78 - dwc3_set_cache_type(dwc);
81 usb_phy_set_suspend(dwc->usb2_phy, 0);
82 usb_phy_set_suspend(dwc->usb3_phy, 0);
83 ret = phy_power_on(dwc->usb2_generic_phy);
84 @@ -1947,9 +1895,12 @@ static const struct dev_pm_ops dwc3_dev_
87 static const struct of_device_id of_dwc3_match[] = {
88 - { .compatible = "fsl,layerscape-dwc3", .data = &layerscape_dwc3_cache_type, },
89 - { .compatible = "snps,dwc3" },
90 - { .compatible = "synopsys,dwc3" },
92 + .compatible = "snps,dwc3"
95 + .compatible = "synopsys,dwc3"
99 MODULE_DEVICE_TABLE(of, of_dwc3_match);
100 --- a/drivers/usb/dwc3/core.h
101 +++ b/drivers/usb/dwc3/core.h
105 /* Global SoC Bus Configuration INCRx Register 0 */
107 -#define DWC3_GSBUSCFG0_DATARD_SHIFT 28
108 -#define DWC3_GSBUSCFG0_DATARD(n) (((n) & 0xf) \
109 - << DWC3_GSBUSCFG0_DATARD_SHIFT)
110 -#define DWC3_GSBUSCFG0_DESCRD_SHIFT 24
111 -#define DWC3_GSBUSCFG0_DESCRD(n) (((n) & 0xf) \
112 - << DWC3_GSBUSCFG0_DESCRD_SHIFT)
113 -#define DWC3_GSBUSCFG0_DATAWR_SHIFT 20
114 -#define DWC3_GSBUSCFG0_DATAWR(n) (((n) & 0xf) \
115 - << DWC3_GSBUSCFG0_DATAWR_SHIFT)
116 -#define DWC3_GSBUSCFG0_DESCWR_SHIFT 16
117 -#define DWC3_GSBUSCFG0_DESCWR(n) (((n) & 0xf) \
118 - << DWC3_GSBUSCFG0_DESCWR_SHIFT)
121 #define DWC3_GSBUSCFG0_INCR256BRSTENA (1 << 7) /* INCR256 burst */
122 #define DWC3_GSBUSCFG0_INCR128BRSTENA (1 << 6) /* INCR128 burst */
123 #define DWC3_GSBUSCFG0_INCR64BRSTENA (1 << 5) /* INCR64 burst */