Lines Matching +full:usb3 +full:- +full:if

1 // SPDX-License-Identifier: GPL-2.0
3 * xHCI host controller driver for R-Car SoCs
16 #include "xhci-plat.h"
17 #include "xhci-rzv2m.h"
23 * - The V3 firmware is for all R-Car Gen3
24 * - The V2 firmware is possible to use on R-Car Gen2. However, the V2 causes
25 * performance degradation. So, this driver continues to use the V1 if R-Car
27 * - The V1 firmware is impossible to use on R-Car Gen3.
39 #define RCAR_USB3_CONF1 0xa48 /* USB3.0 Configuration1 */
40 #define RCAR_USB3_CONF2 0xa5c /* USB3.0 Configuration2 */
41 #define RCAR_USB3_CONF3 0xaa8 /* USB3.0 Configuration3 */
42 #define RCAR_USB3_RX_POL 0xab0 /* USB3.0 RX Polarity */
43 #define RCAR_USB3_TX_POL 0xab8 /* USB3.0 TX Polarity */
67 /* USB3.0 Configuration */
72 /* USB3.0 Polarity */
79 writel(RCAR_USB3_LCLK_ENA_VAL, hcd->regs + RCAR_USB3_LCLK); in xhci_rcar_start_gen2()
80 /* USB3.0 Configuration */ in xhci_rcar_start_gen2()
81 writel(RCAR_USB3_CONF1_VAL, hcd->regs + RCAR_USB3_CONF1); in xhci_rcar_start_gen2()
82 writel(RCAR_USB3_CONF2_VAL, hcd->regs + RCAR_USB3_CONF2); in xhci_rcar_start_gen2()
83 writel(RCAR_USB3_CONF3_VAL, hcd->regs + RCAR_USB3_CONF3); in xhci_rcar_start_gen2()
84 /* USB3.0 Polarity */ in xhci_rcar_start_gen2()
85 writel(RCAR_USB3_RX_POL_VAL, hcd->regs + RCAR_USB3_RX_POL); in xhci_rcar_start_gen2()
86 writel(RCAR_USB3_TX_POL_VAL, hcd->regs + RCAR_USB3_TX_POL); in xhci_rcar_start_gen2()
91 struct device_node *node = dev->of_node; in xhci_rcar_is_gen2()
93 return of_device_is_compatible(node, "renesas,xhci-r8a7790") || in xhci_rcar_is_gen2()
94 of_device_is_compatible(node, "renesas,xhci-r8a7791") || in xhci_rcar_is_gen2()
95 of_device_is_compatible(node, "renesas,xhci-r8a7793") || in xhci_rcar_is_gen2()
96 of_device_is_compatible(node, "renesas,rcar-gen2-xhci"); in xhci_rcar_is_gen2()
103 if (hcd->regs != NULL) { in xhci_rcar_start()
105 temp = readl(hcd->regs + RCAR_USB3_INT_ENA); in xhci_rcar_start()
107 writel(temp, hcd->regs + RCAR_USB3_INT_ENA); in xhci_rcar_start()
108 if (xhci_rcar_is_gen2(hcd->self.controller)) in xhci_rcar_start()
115 struct device *dev = hcd->self.controller; in xhci_rcar_download_firmware()
116 void __iomem *regs = hcd->regs; in xhci_rcar_download_firmware()
126 if (readl(regs + RCAR_USB3_DL_CTRL) & RCAR_USB3_DL_CTRL_FW_SUCCESS) in xhci_rcar_download_firmware()
129 /* request R-Car USB3.0 firmware */ in xhci_rcar_download_firmware()
130 retval = request_firmware(&fw, priv->firmware_name, dev); in xhci_rcar_download_firmware()
131 if (retval) in xhci_rcar_download_firmware()
134 /* download R-Car USB3.0 firmware */ in xhci_rcar_download_firmware()
139 for (index = 0; index < fw->size; index += 4) { in xhci_rcar_download_firmware()
141 for (data = 0, j = 3; j >= 0; j--) { in xhci_rcar_download_firmware()
142 if ((j + index) < fw->size) in xhci_rcar_download_firmware()
143 data |= fw->data[index + j] << (8 * j); in xhci_rcar_download_firmware()
153 if (retval < 0) in xhci_rcar_download_firmware()
174 retval = readl_poll_timeout_atomic(hcd->regs + RCAR_USB3_AXH_STA, in xhci_rcar_wait_for_pll_active()
182 /* If hcd->regs is NULL, we don't just call the following function */ in xhci_rcar_init_quirk()
183 if (!hcd->regs) in xhci_rcar_init_quirk()
186 if (!xhci_rcar_wait_for_pll_active(hcd)) in xhci_rcar_init_quirk()
187 return -ETIMEDOUT; in xhci_rcar_init_quirk()
197 if (!ret) in xhci_rcar_resume_quirk()
204 * On R-Car Gen2 and Gen3, the AC64 bit (bit 0) of HCCPARAMS1 is set
205 * to 1. However, these SoCs don't support 64-bit address memory
206 * pointers. So, this driver clears the AC64 bit of xhci->hcc_params
238 .compatible = "renesas,xhci-r8a7790",
241 .compatible = "renesas,xhci-r8a7791",
244 .compatible = "renesas,xhci-r8a7793",
247 .compatible = "renesas,xhci-r8a7795",
250 .compatible = "renesas,xhci-r8a7796",
253 .compatible = "renesas,rcar-gen2-xhci",
256 .compatible = "renesas,rcar-gen3-xhci",
259 .compatible = "renesas,rzv2m-xhci",
270 priv_match = of_device_get_match_data(&pdev->dev); in xhci_renesas_probe()
280 .name = "xhci-renesas-hcd",
287 MODULE_DESCRIPTION("xHCI Platform Host Controller Driver for Renesas R-Car and RZ");